OpenFOAM/C2/Installing-Running/English

From Script | Spoken-Tutorial
Revision as of 18:23, 27 November 2012 by Chandrika (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Title of script: Installing and Running OpenFOAM and Paraview

Author: Rahul Ashok Joshi

Keywords: Video Tutorial,Computational Fluid Dynamics (CFD)

Click here for the slides

Visual Cue Narration
Slide 1

Hello and welcome to the spoken tutorial on Installing and running OpenFOAM and paraView.

Slide 2: Learning Objective In this tutorial I will show you

how to install and run

OpenFOAM

ParaView , and

How to solve the lid driven cavity.

Slide 3: System Requirement To record this tutorial

I am using GNU / Linux Operating system Ubuntu 10.04

OpenFOAM version 2.1.0

ParaView version 3.12.0

Note that OpenFOAM does not run on Windows platform.

Also Note OpenFOAM v 2.1.0 is compatible with linux version 10.04 and above.

Slide 4:Prerequisites To practice this tutorial you should have some basic knowledge of
Computational Fluid Dynamics.

Linux Commands.

Slide 5 Let me introduce you to OpenFOAM

It is a Computational Fluid Dynamics Software.

It contains a wide range of solvers for solving CFD problems of

2dimensional

as well as

3dimensionals.


Slide 6 Now let me introduce you to Paraview:

It is used for visualizing results obtained in OpenFOAM.

Slide 7: Install Openfoam and Paraview

OpenFOAM and Paraview can also be installed through Synaptic package manager


Demonstration For Synaptic Package Manager go to System > Administration > Synaptic Package Manager

Type your password.

In the Search Box type OpenFOAM .

You can see both OpenFOAM and Paraview

Mark both of them for installation

Click on mark and then Apply

It make take some time to install.

OpenFOAM and Paraview are installed.

Let me switch back to the slides

Slide 7 For more details on Synaptic Package Manager

please visit our website on this URL : http://www.spoken-tutorials.org

Demonstration and Slide 8 Alternately you can also install OpenFOAM and paraView from openfoam website on this url: http://www.openfoam.com/download

Open browser Firefox

In the browser URL type : http://www.openfoam.com/download

Ubuntu Debian pack > Ubuntu debian pack installation Click on it

Scroll down and go to installation

From the first point of installation copy the first command line and paste it in command terminal.

Demonstration: From the first point of installation copy the command line and paste it in the terminal window.

To open the terminal window press Ctrl,Alt and t keys simultaneously or go to Application > Accessories > Terminal

Note in place of 'lsb_release -cs' replace it with the name of Linux version you are using.

Above installation you will see the code name for the different Linux versions, as i am using Linux 10.04 i will replace lbs_release -cs by lucid.

Installation here is incomplete if you follow the steps in the sequence 1-2-3-4 you will be done through with the installation.

I have already installed OpenFOAM through Synaptic Package Manage some while ago.

Demonstration:Configure Software after Installation from Synaptic Package Manager or website After the software has been installed we need to configure it, to do this we need to edit the bash file.

Open a new terminal window.

Open the .bashrc file by typing in terminal by  : 'gedit ~/.bashrc' This opens up the bash file, scroll down to the bottom of the file.

Under installation you can see User configuration.

Now go to the second line and copy it.,and paste it at the bottom of the bash file : 'source/opt/openfoam201/etc/bashrc'

Close the bash file.

Now we need to test the installed application.

To do this open up a new command terminal terminal again.

In the command terminal type 'icoFoam -help'.

A usage message will appear.

You are now ready to start with OpenFoam

Demonstration:Set up working Directory Now let me show you how to set up a working directory.

Create a project or a user directory by the name run.

Open a new command terminal.

In the Command Terminal type : 'mkdir -p $FOAM_RUN' (Press Enter)

(Please note FOAM and RUN are in capital)

Copy the tutorial directory from openfoam distribution to run directory: 'cp -r $FOAM_TUTORIALS $FOAM_RUN ' (Press Enter)

(Please note TUTORIAL,FOAM and RUN are capital)

Both the directories are now created.

For viewing both the directories go to Places > Home Folder > OpenFOAM.

Now let me shift to the slides.

Demonstration: If some errors occurs during downloading OpenFOAM and Paraview

form the Ubuntu Deb pack from website or Synaptic Package Manager then you can download and install Openfoam and paraview from the source pack installation: Go to the Download page > Source Pack Installation

Go to Packs and download the 2 tar files and save them.

Create a folder in your Home Directory by any name of your choice

Copy the downloaded files in this folder you just created.

Untar or unzip the files in the same folder.

In the command terminal go to the same folder in which you have untared the tar files.

For installation we need to compile OpenFOAM and Paraview.

Follow the steps given below for Linux distribution for OpenFOAM and Paraview.

Installation may take about 4 to 5 hours but this works always.

Slide 9:Diagram

Let us see how to Solve a problem in OpenFOAM with an example

Let me take “Lid Driven Cavity” as an example.

It is a 2D problem where the upper plate moves with a certain velocity a

and other three sides of the plate are fixed.


Slide 10:Solver The type of Solver I am using here is for incompressible flow-icofoam
Demonstration:Run OpenFOAM Open a new terminal window.

Type 'run' in the command terminal.

This will direct you to the run directory. (Press Enter)

Type the path for Lid driven cavity problem:

Now type cd tutorial (Press Enter)

                cd incompressible (Press Enter) 
                cd icoFoam   (Press Enter)
                cd cavity   (Press Enter)

You can see three files : 0,constant and system.

Mesh the geometry using blockMesh utility In the command terminal type blockMesh (Note here that M is capital) (Press Enter)

Now run the solver 'icoFoam' by typing in the terminal icoFoam (Note here that F is capital) and Press Enter.

Demonstration: Run Paraview

The iterations which are running can be seen in the terminal window.

Here we notice we have completed the solving point.

To visualize these results let us open the paraview window.

To open paraView, type “paraFoam” in the terminal. (Note that 'F' is capital here) and press Enter

Let me shift this into the capture area.

On the left hand side,

In the object inspector menu,

Click on Apply to view the geometry.

To view the moving and the fixed walls, scroll down the object inspector menu and go to Mesh Parts:

Uncheck Internel Mesh box. The geometry will disappear.

Check the moving and fixed wall boxes. You can see the boundary conditions.

Now uncheck the Moving wall checkbox.You can now see the fixedwalls and the moving wall which just now disappeared.

Thus we are done with running openfoam and paraview. In future we will come across more tutorials on solvers and post- processing the results of OpenFOAM.


Slide 11:Summary In this tutorial we learnt how to install

OpenFOAM and Paraview through Synaptic Package Manager and the website solved a lid driven cavity.

Slide 12:Assignment As as Assignment,

please install OpenFOAM and Paraview This brings us to the end of the tutorial

Slide 13 & 14:About Spoken Tutorial

The video available at this URL: http://spoken-tutorial.org/What_is_a_Spoken_Tutorial

It summarizes the Spoken Tutorial project. 

If you do not have good bandwidth, you can download and watch it.

Slide 15:Acknowledgement Spoken Tutorials are part of Talk to a Teacher project,

It is supported by the National Mission on Education through ICT, MHRD, Government of India.

This project is coordinated by http://spoken-tutorial.org

More information on the same is available at the following URL link http://spoken-tutorial.org/NMEICT-Intro

Slide 16:About the contributor This is Rahul Joshi from IIT BOMBAY signing off.

Thanks for joining.

Contributors and Content Editors

Chandrika, Rahuljoshi