Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Other Community Discussions > Tutorials & Tips
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Ubuntu 9.10 is out!!!

When downloading Ubuntu 9.10 please consider using bittorrent to get your copy of Ubuntu.

The Ubuntu Developers Summit for Lucid Lynx will be held the week of 16-Nov-2009 till 20-Nov-2009 in Dallas, TX USA. Visit the the Ubuntu wiki for more information about UDS and how to participate remotely.

Tutorials & Tips
The place to find Ubuntu related Tips & Tricks.

 
Thread Tools Display Modes
Old April 6th, 2006   #1
derjames
Way Too Much Ubuntu
 
derjames's Avatar
 
Join Date: Mar 2006
Location: Sheffield, UK
Beans: 322
Post HowTo: Scientific Ubuntu - Installing OpenFOAM CFD software

I wrote this when using Ubuntu Breeze Badger. Now I am using Hardy (32Bit)... note that version 1.5 has been recently released.

update 13-Septempber-2008: OpenFOAM release 1.5 is slightly different but easier to install in a stand alone configuration, I will describe the steps here but the old guide (v1.4.1 and older) will still be found in this document just for reference. One of the main changes is the discontinuation of FoamX, from now on the configuration files are to be modified by using your favorite text editor. The other main change is the use of paraview 3.0

The instruccions for installation are:

(1)Create the OpenFOAM folder in you home
(2)navigate to the OpenFOAM webpage and download from there the five installation files: OpenFOAM-1.5.General.gtgz, OpenFOAM-1.5.linuxGccDPOpt.gtgz, OpenFOAM-1.5.linuxGccSPOpt.gtgz, ThirdParty.General.gtgz, ThirdParty.linuxGcc.gtgz
(3)Extract the files in this location in starting with those marked as *general*
(4)You will see that two new folders are created: OpenFOAM-1.5 and ThirParty
(5)Update your environment variables by adding the following line to our .bashrc script

Code:
. $HOME/OpenFOAM/OpenFOAM-1.5/etc/bashrc
now 'source' the variables with

Code:
source ~/.bashrc
(5)Navigate to OpenFOAM-1.5/bin and execute the foamIntallationTest script

Code:
./foamInstallationTest
Since this is a standalone installation you will see that the script fails to connect to a remote server, however as I said before 'who cares' just ignore this message.

This is all you need to do, OpenFOAM is ready to run. Please see the documentation since some syntax has been changed.

I found one problem: After finishing a case a file called file.OpenFOAM containing your computation is created which is supposed to open fine when paraview is called, however an error when reading these type of files arises when one is trying to load them. The quick fix is to export the file to VTK by using the 'foamToVTK' utility and then opening the exported file normally with paraview.

Cheers
j

update 25-february-2008: WIndows users willing to install OpenFoam under XP/Vista read this guide and the advice by "Florante" from the andLinux forum here:
http://www.andlinux.org/forum/viewtopic.php?t=44
this will solve the the paraView visualisation problem...

date:23-february-2008: Note to **Windows** users: You may try to install OpenFOAM on Windows XP/VISTA via andLinux (http://www.andlinux.org) (colinux+Ubuntu) and following the guide below. I've made an attempt and the solvers are working just fine. However paraView for any reason is not working properly. The GUI works OK but the visualisation window is not displaying anything at all (at least on my computer). I will try to check this in the future and/or install any alternative such as OpenDX and post the results here...

Thanks everybody for your comments... enjoy

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

This Thread/Howto is aimed to all Engineers, Scientist, Students interested in learning/applying/experimenting Computational Fluids Dynamics (CFD), CFD uses numerical approximation to the partial differential equations that govern flow of fluids in nature (i.e. Navier-Stokes equation, etc) the solution of the Navier-Stokes equation once it comply with the requirements of the Continuity equation gives the behavior of the fluids subject to the given boundary and initial conditions. This has a tremendous importance since practically any fluid can be simulated/modeled in a computer before doing any 'real life' experiment. For example you can test the design of a new aircraft using computational techniques before even build a small scale protitype for wind tunnel testing. Thus a wide range of experimental conditions can be fully tested and corrected on the fly...
Since the basic equations (full) that govern fluid flow are in form of PDEs, the numerical methods to approximate the solution are complex, a very simple problem can be solved in a couple of minutes however if the problem is much more complicated the solver can take days in find a solution... in general CFD is not intended for common PCs but for high end computers designed to tackle this kind of problems. Of course this cannot stop you, you can install this software in your computer and 'play' with simple geometries and doing a lot of assumptions to solve a given problem more easily.
There are several CFD brands out there like Fluent, COMSOL, CFD-RC, CFD-ADAPCO, (which are quite expensive though) ... however there are also free alternatives like ELMER Multiphysics (I have already dowloaded but not playing around with it!), OpenFOAM and many others.
Inherently CFD software is a bit complicated to use, it requires a deep understanding of the physical phenomena involved in given problem, and a good mathematical background (this is a plus)

Well, after that boring introduction, this is the ultimate guide to install OpenFOAM in an Ubuntu System, I decided to this because (1) I do really need a CFD software to experiment with. (2) Commercial software is expensive (you know as a student you've got a very limited budget, I would have to spend all my year savings only for a one year license!!!!) (3) Help the scientific/student community with freely available tools. (4) Understand more about the world/nature around us...

* * * Step One * * * *
First of all System requirements (well based on my PC!!!!)

-An x86 processor or equivalent. I am using a Core 2 Duo T5600 and running great!)
-640 MB (The web page states nothing, but everybody knows the more, the better)
-1 GB hard drive available, this is a must, uncompressed files takes 750 MB, plus the cases, tutorials, grids, etc
-broadband conection (the compressed files are from 50 to 100 MB average) of course you can use dial up and wait 48 hours to download it, it's up to you...
-Ubuntu LINUX 6.10 Edgy Eft (it works also in Dapper and Breeze) , if you download the AMD64 version then use the 64bit LINUX kernel


2 * * * * * * * * * * * * *
Enter to OpenFOAM web page

http://www.openfoam.org
or
http://www.opencfd.co.uk

3 * Click on download
4 * Select your version
5 * Dowload all the packges to your Desktop (very advance LINUX users can avoid obvious steps)

Code:
~/Desktop
where ~/ is the home folder for example /home/<username>

N.B from this point it is necesary to remenber that LINUX is CASE SENSITIVE, a mistake can delay you some hours...

second I did install everything in my home folder which is ~/ it is the recommended option from the web site


6 * create a folder caller OpenFOAM in ~/ using mkdir
copy
OpenFOAM-1.4.General.gtgz
OpenFOAM-1.4.linuxGcc4DPOpt.gtgz
OpenFOAM-1.4.linuxGcc4SPOpt.gtgz
which are on ~/Desktop to the folder you've just created ~/OpenFOAM

7 * create the following folder (remember LINUX is case sensitive)

Code:
~/OpenFOAM/linux
8 * copy
gcc-4.1.1.linux.tgz
paraview-2.4.4.linux.tgz
j2sdk1.4.2.os.linux.tgz
which are in ~/Desktop to ~/OpenFOAM/linux

9 * untar avery single file in the following order

OpenFOAM-1.4.General.gtgz
OpenFOAM-1.4.linuxGcc4DPOpt.gtgz
OpenFOAM-1.4.linuxGcc4SPOpt.gtgz
gcc-4.1.1.linux.tgz
paraview-2.4.4.linux.tgz
j2sdk1.4.2.os.linux.tgz

using
Code:
tar -xzvf <filename>
This takes a bit of time

10 * after finishing you will see new directories created in ~/OpenFOAM

11 * now look for foamSystemCheck
which is located at

Code:
~/OpenFOAM/OpenFOAM-1.4/bin
this is a shell script that we have to execute, however we need to change it to an executable format

type

Code:
chmod -v 555 foamSystemCheck
press enter, then type

Code:
export PATH=$PATH:~/OpenFOAM/OpenFOAM-1.4/bin/
press enter, then type

Code:
foamSystemCheck
press enter

At this time, the shell script will call some functions to check if your system comply with the minimum requirements for the installation, Host, username, Linux version, and Network conectivity, however at the end of the process some error occur, just ignore any warning or fatal error about ssh or rsh, this is not needed for the stand alone installation (It doesn't matter what it tells you, just ignore it!!!)

type

Code:
chmod -v 755 foamSystemCheck
press enter

12 * * * * * *
Now you have to set the environment variables for a correct file access

The environment variable settings are stored in

Code:
~/OpenFOAM/OpenFOAM-1.4/.OpenFOAM-1.4
since I am using the default options in UBUNTU, my shell is BASH and my text editor is gedit, you can use VIM as well

type

Code:
echo $SHELL
(if you are not sure which shell you are using)

now type

Code:
gedit ~/.bashrc &
once in gedit type

Code:
. ~/OpenFOAM/OpenFOAM-1.4/.OpenFOAM-1.4/bashrc
N.B. it is dot, space~/.......
select
Code:
file>save
and then file>quit
now update the environment typing

Code:
. ~/.bashrc
N.B. it is dot space ~/.......


the environment variables are updated, you can see this if you type

Code:
echo $PATH
We are almost done!!,
13 **** Now test the installation

look for foamInstallationTest

it is located at

Code:
~/OpenFOAM/OpenFOAM-1.4/bin
in the same way this file is a shell script

type

Code:
chmod -v 555 foamInstallationTest
press enter

in this case you don't need to export the path, since you have already done it...

now type

Code:
foamInstallationTest
press enter

here the shell scrip verifies every directory and assigns to each of them an environment variable (PATH), also this takes a bit of time. However you will see an error at the end of the process, something like this:

test_rsh unsuccessful_conection_refused*
test_ssh unsuccessful_conection_refused*

FATAL: No remote shell available (blah, blah, blah, blah, etc....)

It is very simple: who cares, just ignore it.....

well for this new version of openFoam is likely that FoamX does not run in your system if you don't have the libssl.so.o.9.7 installed. A simple look at synaptic solve this problem... (thanks for orodoni_le for this). O course you can use OpenFoam without FoamX if you feel comfortable editing text files...

And it's done!!!!!!!

Now open

Code:
~/OpenFOAM/OpenFOAM-1.4/doc/Guides-a4
you will find there some PDFs with tutorials and very useful examples....


This section applies only to WIndows users

Alternative method for installing OpenFOAM in a windows system (2000/XP/VISTA) using andLinux(colinux+Ubuntu).

This method requires to install andLinux which is basically colinux(a linux kernel implementation for windows) xming(an X-server for windows) and Ubuntu. Once andLinux is installed it uses the Windows desktop instead of GNOME/KDE/etc...

Files you need to get:

The andLinux installer. For simplicity I decided to install the minimal version
HTML Code:
http://www.andlinux.org/downloads.php
The xming mesa-OpenGL version. For any reason the xming-version provided with andLinux interferes with paraView so you need to replace the shipped version with this one 6.9.031
HTML Code:
http://www.straightrunning.com/XmingNotes/
The OpenFOAM installation files from the places indicated in the guide above.

-The first step is to install andLinux (which is straight forward). After the installation you will notice that the default installation size of andLinux is 2GB so we need to increase the size of the virtual drive for the OpenFOAM installation and also for any other applications you may need. To do this go to the installation directory of andLinux

Code:
c:\Program Files\andLinux
stop andLinux by double clicking at srvstop.bat

Then look for

Code:
ImageResizeTool.zip
unzip that file in the current directory. Enter to the directory and look for the file

Code:
toporesize.bat
Execute this file. From the window that appears select *find file. Then navigate to

Code:
c:\Program Files\andLinux\Drives
Select base.drv and change the size to at least 3GB with the slider. Click OK

Now navigate to the xming directory at:

Code:
c:\Program Files\andLinux\xming
look for xming.exe and rename it as xming_1.exe (just in case, this is our old version)

Now install the mesa version of xming. Once the installation finishes go to installation directory

Code:
c:\Program Files\xming
and copy xming.exe from this location to

Code:
c:\Program Files\andLinux\xming
Reboot the computer

Now install OpenFOAM as described in the guide...
__ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Well that's all, have fun
* * * * * derjames * * * * *

Last edited by derjames; September 13th, 2008 at 08:54 AM..
derjames is offline   Reply With Quote
Old April 7th, 2006   #2
derjames
Way Too Much Ubuntu
 
derjames's Avatar
 
Join Date: Mar 2006
Location: Sheffield, UK
Beans: 322
Re: HowTo: Scientific Ubuntu - Installing OpenFOAM CFD software

And some screenshots... the first three are running on Linux, the last one running on Windows/andLinux/ubuntu
Attached Images
File Type: png Screenshot.png (197.9 KB, 407 views)
File Type: png post-processing.png (147.2 KB, 399 views)
File Type: png paraVIEW.png (95.8 KB, 376 views)
File Type: jpg paraview_OF_linux_windows.jpg (245.1 KB, 128 views)

Last edited by derjames; May 9th, 2008 at 12:43 PM..
derjames is offline   Reply With Quote
Old April 7th, 2006   #3
adamkane
100% Pure Ubuntu
 
adamkane's Avatar
 
Join Date: Mar 2006
Location: Toronto, Canada
Beans: 857
Send a message via MSN to adamkane Send a message via Yahoo to adamkane Send a message via Skype™ to adamkane
Re: HowTo: Scientific Ubuntu - Installing OpenFOAM CFD software

Thanks for the great post!
adamkane is offline   Reply With Quote
Old April 8th, 2006   #4
parktownprawn
Gee! These Aren't Roasted!
 
parktownprawn's Avatar
 
Join Date: Jan 2005
Location: South Africa
Beans: 201
Ubuntu 9.10 Karmic Koala
Re: HowTo: Scientific Ubuntu - Installing OpenFOAM CFD software

great howto - why don't you post it on the wiki (wiki.ubuntu.com)?
parktownprawn is offline   Reply With Quote
Old April 9th, 2006   #5
derjames
Way Too Much Ubuntu
 
derjames's Avatar
 
Join Date: Mar 2006
Location: Sheffield, UK
Beans: 322
Re: HowTo: Scientific Ubuntu - Installing OpenFOAM CFD software

Hello there, I did update the wiki page, just some aesthetic changes ... well back to work...

https://wiki.ubuntu.com/HowTo_instal...%28OpenFOAM%29

Cheers
derjames is offline   Reply With Quote
Old May 22nd, 2006   #6
xtacocorex
Skinny Soy Caramel Ubuntu
 
xtacocorex's Avatar
 
Join Date: Sep 2005
Location: Cedar Rapids, IA, USA
Beans: 594
Ubuntu 6.10 Edgy
Re: HowTo: Scientific Ubuntu - Installing OpenFOAM CFD software

I'm going to try this when I get home even though I should wait until Dapper is released since I'm going to upgrade when it's stable. But since /opt on my laptop is a separate partition, I might do it anyway since it shouldn't change too much.

derjames, have you tried any of the converting Fluent/Gambit meshes to openFoam yet? I'm assuming that it doesn't do mesh generation as that's what I got from the site. Please correct me if I'm wrong.
__________________
#399784 | Ubuntu User #287 | My Blog
*** If you're going to program, install the damn build-essential package ***
There is no such thing as Ubuntu specific programming
Save the electrons - if you quote, trim!
xtacocorex is offline   Reply With Quote
Old May 23rd, 2006   #7
derjames
Way Too Much Ubuntu
 
derjames's Avatar
 
Join Date: Mar 2006
Location: Sheffield, UK
Beans: 322
Re: HowTo: Scientific Ubuntu - Installing OpenFOAM CFD software

Hi xtacocorex

You can convert Gambit grids to OpenFOAM format by using the utilities included in the distribution... also you can create grids using other CAD/solvers packages such as: CFX, EnSight, FieldView, I-deas, Star-CD andconvert them with the plugins (all are included in the distribution)...

OpenFOAM includes a pretty basic mesh generator, which does not have GUI, i.e. you have to create and modify the mesh information file by hand (in a text file), and then use the mesh tool included which works well for my applications (Flow in microchannels), I know it is a bit tedious but it's OK once you get use to it...

hope this helps
derjames is offline   Reply With Quote
Old June 27th, 2006   #8
larry
A Carafe of Ubuntu
 
larry's Avatar
 
Join Date: Nov 2004
Location: Italy
Beans: 151
Dapper Drake Testing/
Re: HowTo: Scientific Ubuntu - Installing OpenFOAM CFD software

Quote:
Originally Posted by derjames
Hello there, I did update the wiki page, just some aesthetic changes ... well back to work...

https://wiki.ubuntu.com/HowTo_instal...%28OpenFOAM%29

Cheers

Hello,
I simply want to thank you for the excellent job!
My institute has just bought a licence for a commercial code (not exactly a CFD code, but something a PDE solver).
However, OpenFOAM looks like a good tool and I can use free on my laptop.
I am not sure, though, that it will be so easy to jump into modelling (well, I am someone who comes from a different background; it could be different for someone already experienced).
Cheers

Larry
__________________
"I can calculate the motions of heavenly bodies, but not the madness of people." - Isaac Newton
larry is offline   Reply With Quote
Old July 23rd, 2006   #9
mkw87
Just Give Me the Beans!
 
Join Date: Jun 2006
Beans: 74
Re: HowTo: Scientific Ubuntu - Installing OpenFOAM CFD software

I have successfully installed this on a 64 bit Dapper build.

Key things to note:
I had to edit ~/OpenFOAM/OpenFOAM-1.3/.bashrc to have in it at the top
Code:
WM_64="on"
I also had trouble with it not finding the correct directory of:
~/OpenFOAM/OpenFOAM-1.3/....
it always went ~/OpenFOAM/...
so to fix this I manually added the extra directory where it was necessary (for me, that was in the export of JAVA_HOME, where gcc is exported, and in the bashrc file in ~/OpenFOAM/OpenFOAM-1.3/.OpenFOAM-1.3/apps/paraview/bashrc

Feel free to add that to your wiki.
__________________
Desktop: Opty 165 @ 289x9, 1.38v | 2x1GB G.Skill, 3-4-4-8, 2.6v | nVidia 7600GT | Sound Blaster Audigy 2
Laptop: Intel Centrino Duo T2300 | 2 GB Ram | Intel 945GM Graphics | Intel 3945ABG Wireless

Last edited by mkw87; July 25th, 2006 at 07:52 PM..
mkw87 is offline   Reply With Quote
Old August 1st, 2006   #10
derjames
Way Too Much Ubuntu
 
derjames's Avatar
 
Join Date: Mar 2006
Location: Sheffield, UK
Beans: 322
Re: HowTo: Scientific Ubuntu - Installing OpenFOAM CFD software

Hey, cheers for this...
derjames is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:06 PM.


vBulletin ©2000 - 2009, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. bilberry