OpenFOAM/C2/Creating-simple-geometry-in-OpenFOAM/English

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

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

Title of script: Creating simple geometry in OpenFOAM

Author: Rahul Ashok Joshi

Keywords: Video Tutorial,Computational Fluid Dynamics (CFD),OpenFOAM geometry

Click here for the slides

Visual Cue Narration
Slide 1

Hello and welcome to the spoken tutorial on creating a simple geometry in OpenFOAM

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

How to create a simple geometry

How to view geometry in paraview

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

Open the path for lid driven cavity as given in the installation tutorial
.

In CFD the Pre-processing part consists of creating geometry and meshing it.

Let us take the Lid driven cavity case of the previous tutorial as an example.

Recall the path for the earlier tutorial, I have already opened the command terminal and entered the path for lid driven cavity

There are three folders 0,constant,and system

Geometry is inside the polymesh folder of constant.

In the command terminal type cd constant and press enter

Type ls and press enter

In this there is another folder called as polymesh

type cd polymesh and press enter

type ls and press enter

This contains the geometry file called as blockMeshDict

Open the blockMeshDict file with any editor of your choice

In the terminal type gedit blockMeshDict and press enter


Minimise the blockMeshDict file

Let me switch back to the slides

In openfoam the entire geometry is broken into blocks

The blocks are numbered starting from 0 as shown in the figure

Note that in OpenFOAM for creating a 2D geometry you need to give a a unit cell thickness value in the z-axis.

Lid driven cavity is of length 1 and height 1,

minimise the slide

On your desktop create an empty file by right click > create document > Empty file and name it as blockMeshDict.

Copy the data from the original lid driven cavity blockMeshDict file to the new blockMeshDict file form line 0 to convertTometers.

In the file type vertices and press enter

Put the open brackets and in the next line

Start with 0 point, in brackets enter(0 space 0 space 0) and press enter move towards the point 1 in positive x-axis and enter (1 space 0 space 0) and press enter

move towards point 2 in positive x-y plane and enter (1 space 1 space 0) and press enter

enter the 3 point in positive y axis (0 space 1 space 0 ) and press enter

enter 4 point (1 space 0 space 1) on the front face and press enter

Similarly enter the other points with one unit value in the positive z -axis

close the bracket and insert a semicolon after it.

Below vertices are the blocks Insert a Open bracket and press enter Note that, Lid driven cavity is taken as a single block

Enter the points for the blocks in a clockwise sense in brackets enter ( 0 put space after each point and enter 1 2 3 4 5 6 7 )

For multiple blocks the points will be more.

After this enter the grid points in the x,y,and z directions

In brackets enter (30 space 30 space 1) ,you can modify the grid when needed

Grid point in z-axis can be kept as one

Leave a space and in brackets enter the simple grading for the mesh (1 space 1 space 1)

Close the bracket and insert a semicolon and press enter

Now type edges,as this is a simple geometry edges can be kept empty

Insert open and closed bracket ,put a semicolon and press enter

Below edges are the boundary conditions.

Here you need to enter the boundary name for the faces

Type boundary and in the next line and press enter insert a open bracket and press enter

Let me switch back to slides

In the geometry the upper wall is moving and other three walls are fixed.

The front and back faces are termed as empty as this is a 2D problem

Open the New blockMeshDict file again

In boundary put the name of the patch as moving wall

Insert a open curly bracket

Enter type for the moving wall as wall and insert a semicolon. After this in brackets enter the points for face.

Let me switch to slides

Note that order the points in such a way that the thumb should be normal to that face

And fingers make a clockwise curl as shown in the figure

Also note that the point should match with the points inserted in vertices

Enter the face points as (3 space 7 space 6 space 2) as shown in the figure and Note : you can start from any point of that face.

Insert a curly brackets and put a semicolon.

Similarly enter boundary condition and faces for the fixed wall

Being a 2D problem the type of boundary for front and back face can be kept empty.

Insert open-closed brackets and put a semicolon.

We are done with creating the blockMeshDict file.

The complete blockMeshDict file is as shown here.



Close the original blockMeshDict file Note that command terminal will not work until blockMeshDict file is closed

type cd (dot) (dot) twice to return to the cavity folder Mesh the geometry

in terminal type: blockMesh and press enter


View the geometry by typing in the command terminal paraFoam and press enter

On the left hand side click Apply on object inspector menu.


Summary

In this tutorial we learnt:

Creating a simple geometry in OpenFOAM

Viewed the geometry in Paraview

This brings us to the end of the tutorial

Slide 7 Assignment

Change the geometry parameters : Enter the grid points as (40 40 1) and (50 50 1).

View the geometry in paraview

Slide 9:About Spoken Tuitorial

Watch 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 10: About spoken tutorial

The Spoken Tutorial Project Team -Conducts workshops using spoken tutorials -Gives certificates to those who pass an online test -For more details, please write to contact@spoken-tutorial.org

Slide 11: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

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

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

Thanks for joining.

Contributors and Content Editors

Chandrika, DeepaVedartham, Nancyvarkey, Rahuljoshi