howto_ scientific ubuntu - installing openfoam cfd software

Upload: sandeep-ravikumar-murthy

Post on 17-Oct-2015

44 views

Category:

Documents


0 download

DESCRIPTION

Installing OpenFoam 1.4.1

TRANSCRIPT

  • Forum The Ubuntu Forum Community Ubuntu Specialised Discussions Tutorials

    HowTo: Scientific Ubuntu - Installing OpenFOAM CFD software

    Thread: HowTo: Scientific Ubuntu - Installing OpenFOAM CFD software

    Login with SSO Help

    Register Activity Page

    Quic k Links Forum Community Ubuntu Community Other Support Soc ial MediaAdvanc ed Searc h

    Results 1 to 10 of 75 Page 1 of 8 1 2 3 ... Last

    Be the first of your friends to like this.Like

    Thread Tools Display

    April 7th, 2006

    Join Date:Mar 2006

    Location:Sheffield, UK

    Beans:322

    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 hasbeen recently released.

    update 13-Septempber-2008: OpenFOAM release 1.5 is slightly different but easier to install in astand alone configuration, I will describe the steps here but the old guide (v1.4.1 and older) will stillbe found in this document just for reference. One of the main changes is the discontinuation ofFoamX, from now on the configuration files are to be modified by using your favorite text editor. Theother 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:

    #1

    Way Too Much Ubuntu

    derjames

    Forum

  • 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 somesyntax has been changed.

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

    Cheersj

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

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

    Thanks everybody for your comments... enjoy

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

    This Thread/Howto is aimed to all Engineers, Scientist, Students interested inlearning/applying/experimenting Computational Fluids Dynamics (CFD), CFD uses numericalapproximation 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 therequirements of the Continuity equation gives the behavior of the fluids subject to the givenboundary and initial conditions. This has a tremendous importance since practically any fluid can besimulated/modeled in a computer before doing any 'real life' experiment. For example you can testthe design of a new aircraft using computational techniques before even build a small scale protitypefor wind tunnel testing. Thus a wide range of experimental conditions can be fully tested andcorrected on the fly...Since the basic equations (full) that govern fluid flow are in form of PDEs, the numerical methods toapproximate the solution are complex, a very simple problem can be solved in a couple of minuteshowever if the problem is much more complicated the solver can take days in find a solution... ingeneral CFD is not intended for common PCs but for high end computers designed to tackle this kindof 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 quiteexpensive 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 physicalphenomena 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 UbuntuSystem, 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 wouldhave to spend all my year savings only for a one year license!!!!) (3) Help the scientific/studentcommunity 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 usedial 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 versionthen use the 64bit LINUX kernel

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

    http://www.openfoam.orgorhttp://www.opencfd.co.uk

    3 * Click on download4 * Select your version5 * 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/

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

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

    6 * create a folder caller OpenFOAM in ~/ using mkdircopyOpenFOAM-1.4.General.gtgzOpenFOAM-1.4.linuxGcc4DPOpt.gtgzOpenFOAM-1.4.linuxGcc4SPOpt.gtgzwhich 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.tgzparaview-2.4.4.linux.tgzj2sdk1.4.2.os.linux.tgzwhich are in ~/Desktop to ~/OpenFOAM/linux

    9 * untar avery single file in the following order

    OpenFOAM-1.4.General.gtgzOpenFOAM-1.4.linuxGcc4DPOpt.gtgzOpenFOAM-1.4.linuxGcc4SPOpt.gtgzgcc-4.1.1.linux.tgzparaview-2.4.4.linux.tgzj2sdk1.4.2.os.linux.tgz

    using

    Code:

    tar -xzvf

    This takes a bit of time

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

    11 * now look for foamSystemCheckwhich 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 minimumrequirements for the installation, Host, username, Linux version, and Network conectivity, however atthe end of the process some error occur, just ignore any warning or fatal error about ssh or rsh, this isnot 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 canuse 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>saveand 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'thave the libssl.so.o.9.7 installed. A simple look at synaptic solve this problem... (thanks fororodoni_le for this). O course you can use OpenFoam without FoamX if you feel comfortable editingtext 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) usingandLinux(colinux+Ubuntu).

    This method requires to install andLinux which is basically colinux(a linux kernel implementation forwindows) xming(an X-server for windows) and Ubuntu. Once andLinux is installed it uses the Windowsdesktop 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 interfereswith 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 noticethat the default installation size of andLinux is 2GB so we need to increase the size of the virtualdrive for the OpenFOAM installation and also for any other applications you may need. To do this goto 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 01:54 PM.

    Adv Reply

    April 7th, 2006

    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 onWindows/andLinux/ubuntu

    Attac hed Images

    Sc reenshot.png (197.9 KB, 461 views)

    post- proc essing.png (147.2 KB, 453 views)

    paraVIEW.png (95.8 KB, 427 views)

    paraview_OF_linux_windows.jpg (245.1 KB, 175 views)

    Last edited by derjames; May 9th, 2008 at 05:43 PM.

    #2

    Way Too Much Ubuntu

    derjames

    Adv Reply

    April 8th, 2006

    Join Date:Mar 2006

    Location:Toronto, Canada

    Beans:855

    #3

    100% Pure Ubuntu

    adamkane

  • Re: HowTo: Scientific Ubuntu - Installing OpenFOAM CFD software

    Thanks for the great post!

    Adv Reply

    April 8th, 2006

    Join Date:Jan 2005

    Location:South Africa

    Beans:178

    Distro:Ubuntu 10.04 Lucid Lynx

    Re: HowTo: Scientific Ubuntu - Installing OpenFOAM CFD software

    great howto - why don't you post it on the wiki (wiki.ubuntu.com)?

    #4

    Gee! These Aren't Roasted!

    parktownprawn

    Adv Reply

    April 9th, 2006

    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

    #5

    Way Too Much Ubuntu

    derjames

    Adv Reply

    May 22nd, 2006

    Join Date:Sep 2005

    Location:Cedar Rapids, IA, USA

    Beans:545

    #6

    Dipped in Ubuntu

    xtacocorex

  • Distro:Xubuntu 12.04 Precise Pangolin

    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'mgoing to upgrade when it's stable. But since /opt on my laptop is a separate partition, I might do itanyway since it shouldn't change too much.

    derjames, have you tried any of the converting Fluent/Gambit meshes to openFoam yet? I'm assumingthat 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*** If you're going to program, install the damn build-essential package ***There is no such thing as Ubuntu specific programmingSave the electrons - if you quote, trim!

    Adv Reply

    May 23rd, 2006

    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 createand modify the mesh information file by hand (in a text file), and then use the mesh tool includedwhich works well for my applications (Flow in microchannels), I know it is a bit tedious but it's OK onceyou get use to it...

    hope this helps

    #7

    Way Too Much Ubuntu

    derjames

    Adv Reply

    June 27th, 2006

    Join Date:Nov 2004

    Location:Italy

    Beans:

    #8

    Gee! These Aren't Roasted!

    larry

  • 156

    Distro:Ubuntu 10.04 Lucid Lynx

    Re: HowTo: Scientific Ubuntu - Installing OpenFOAM CFD software

    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 somethinga 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 comesfrom 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

    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

    Adv Reply

    July 24th, 2006

    Join Date:Jun 2006

    Beans:82

    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"

    #9

    Just Give Me the Beans!

    mkw87

  • -- Ubuntu vB4.x

    Previous Thread | Next Thread

    Ubuntu Forums Archive Top

    All times are GMT +1. The time now is 12:39 PM.

    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 theexport 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.

    Last edited by mkw87; July 26th, 2006 at 12:52 AM.

    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

    Adv Reply

    August 1st, 2006

    Join Date:Mar 2006

    Location:Sheffield, UK

    Beans:322

    Re: HowTo: Scientific Ubuntu - Installing OpenFOAM CFD software

    Hey, cheers for this...

    #10

    Way Too Much Ubuntu

    derjames

    Adv Reply

    Page 1 of 8 1 2 3 ... Last

    Quic k Navigation Tutorials Top

    Digg

    del.ic io.us

    StumbleUpon

    Google

    Bookmarks

    You may not post newthreadsYou may not post repliesYou may not postattac hmentsYou may not edit your posts

    Posting Permissions

    BB code is OnSmilies are On[IMG] c ode is On[VIDEO] c ode is OffHTML c ode is Off

    Ubuntu ForumsCode of Conduct

  • vBulletin 2000 - 2014, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical Canonical Ltd. Tango Icons Tango DesktopProject.