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

From Script | Spoken-Tutorial
Jump to: navigation, search

Tutorial: Creating curved geometry in OpenFOAM.


Script and Narration: Rahul Joshi


Keywords: Video tutorial, CFD, Flow over cylinder, edges, blocks.


Visual Cue Narration
Slide 1 Hello and welcome to the spoken tutorial on creating Curved geometry in OpenFOAM
Slide 2 : Learning Objectives In this tutorial I will show you steps for creating a curved geometry in OpenFOAM.


Viewing the results in ParaView.

Slide 3:

System Requirement

To record this tutorial I am using
  • Linux Operating system Ubuntu version 10.04.
  • OpenFOAM version 2.1.0
  • ParaView version 3.12.0
Slide 4: System Requirement The tutorials were recorded using the versions specified in previous slide.

Subsequently the tutorials were edited to latest versions.

To install latest system requirements go to Installation Sheet.

Slide 5:


Hover over cylinder


Hover over the geometry


Hover over blocks


break the circle into 4 parts

We will create a geometry for flow over cylinder.


Note that I am using this case just for explanation.


The cylinder is in a form of a semi circle.


Meshing is a body fitted grid.


The entire geometry is divided into blocks.


We break the semi circle into equal number of parts.


Now minimise this.

Open the lid driven cavity blockMeshDict file


Hover over arcs

Open the blockMeshDict file of the previous tutorial.


I have already opened it.


Scroll down, for simple geometries you can see that edges is kept empty.

Now create a new blockMeshDict file.


To do this let us minimise this first.

On the desktop


Right click > create document >create file

Now right click > Create document > Empty file
Name this as blockMeshDict Name this as blockMeshDict.


Note that M and D here are capital.


Open this.

Copy the blockMeshDict of Lid driven cavity file from line 0 to line convert to meters Now you can copy the initial few lines from the lid driven cavity upto convertTometers.
Copy these lines Go up copy this upto convertToMeters.
Paste in the new blockMeshDict file Copy this and paste it in the new blockMeshDict file.
Change the geometry to point one to one Change the convert to meters from point one to one.
Geometry is in meters As our geometry is in meters we will keep this as one.
Press enter Now press Enter.


Press Enter again.

Refer to the figure of flow over cylinder in slide 4


After this you need to enter the co-ordinates of the geometry in vertices.

Let me switch back to the slides.

Note that the points should be ordered in such a way starting from 0,1,2,3 and so on, as shown in the figure.

Minimize the slides.

Type vertices after convertTometers Now type vertices in the blockMeshDict file and press Enter.
Insert an open bracket.


Press Enter.

Enter the co-ordinates as shown in the diagram Now enter the co-ordinates of points as shown in the diagram.
Let me switch back to the slides.
Refer to the next slide for half semi-circle For explanation I will use the right half of the semi-circle.
current blockMeshDict file Enter the values for the points in the figure starting from zero.


Let me switch back to the blockMeshDict file.

Leave some space and enter the co-ordinates of point 0.
Point 0 - Insert (0.5 0 0) Open close bracket and enter (0.5 (space) 0 (space) 0)
Again leave some space, open close bracket.
Point 1- Insert (1 0 0) Enter co-ordinates for point 1 (1 (space) 0 (space) 0)


Press Enter.

Leave two vertical spaces, again press Enter.


Again press Enter.

Leave some space and enter co-ordinates for the point number 4.
Point 4 – Insert (0.707 0.707 0) Open close bracket, enter (0.707 (space) 0.707 (space) 0)
Press Enter.


Leave some space.


Open close bracket.

Point 5 -Insert (0.353 0.353 0) Enter the co-ordinates for point 5.


Enter (0.353 (space) 0.353 (space) 0), press Enter.

Now leave 4 vertical spaces.
Enter co-ordinates for point number 9.
Vertical spaces 1 2 3 4 , again press Enter.


Leave some space.


Open close bracket.

Point 9 – Insert (0 1 0) Enter (0 (space) 1 (space) 0), press Enter.
Leave some space.


Enter the co-ordinates for point number 10.

Point 10 -Insert (0 0.5 0) Open close bracket (0 (space) 0.5 (space) 0), press Enter.
Remaining part of the semi-circle


use the same procedure

Similarly enter the co-ordinates for remaining points in the geometry.


Insert a close bracket and put a semi-colon


Press Enter.


Again press Enter.

In blockMeshDict file type blocks Now type blocks and press Enter.


Insert an open bracket and press Enter.

Let me switch back to the slides.
Slide showing blocks Block numbers are circled as shown in the figure.
Now let me switch back to the blockMeshDict file.
Enter the type of block here Leave some space.


Enter the type of the block that is hex


Leave some space.

Enter points for blocks Now enter the points for the blocks.


Open close brackets

Leave some space.


Open close brackets

Leave some space.

SimpleGrading (1 1 1) This simple grading can be kept as (1 1 1) and press Enter
Refer to the previous tutorial on simple geometry in openfoam For creating the blocks please refer to the tutorial on Creating simple geometry in OpenFOAM.


Note that there will be more number of blocks in this example.

Insert close bracket and


semi-colon


Now insert a close bracket.


Insert a semi-colon and press Enter.


Again press Enter.

Type edges In the next line, type edges and press Enter.


Insert an open bracket and press Enter.

Here you need to enter the points which are the end points of the arc.
Enter the arc points Leave some space and type arc and leave some space.


Type the points which are the end points of the arc.

Let me switch back to the slides.

Insert end points of the arc


From this slide


In this insert the end points of the arc.


We start with 0 5.


Let me switch back to the blockMeshDict file.


Enter 0 space 5.

Leave some space.


Insert open close bracket.

In brackets enter the co-ordinate of any intermediate point in between the two arc points.


Now let me switch back again to slides.

Slide 6: for arcs In the figure you can see that you have to pick up a point in between the two points of the arc.
In this geometry I have picked up right half of the circle.
Slide showing trignometric relations

Sin(theta) and cos(theta) relations

Using simple geometric relations, you can find the co-ordinates of the intermediate point shown in the semi-circle.
Repeat the above procedure for the remaining semi-circle Similarly you can repeat the procedure for rest of the semi-circle geometry.
Now let me switch back to the blockMeshDict file.


Now press Enter.

Note that there are more number of arcs in this example.
Insert a close bracket.


Insert a semi -colon and press Enter.


Again press Enter.

In the next line after arcs


refer to the tutorial on creating simple geometry in openfoam

Enter the boundary patches after arcs.


Refer to the tutorial on Simple geometry in OpenFOAM for entering the boundary patches.

Enter boundary Enter boundary, press Enter.


Insert open-close bracket, press Enter.

Insert close bracket semi-colon, press Enter.


Again press Enter.

Type mergePatchPairs


P here is capital

Now, in the next line type mergePatchPairs.


Note that P here is capital.

Press Enter.


Insert an open bracket and press Enter.

Since there are no patches to be merged, this can be kept empty.


Insert a close bracket.


Insert a semi -colon and press Enter.

Slide 7 :


Points for the front face in the geometry


Let me switch back to the slides.


Similarly enter the co-ordinate points for the points in the front face of unit thickness of the geometry, as shown in the figure.

Press Ctrl+Alt+t keys Open a Command terminal.
Type run and press Enter.

cd tutorials and press Enter

cd basic and press Enter

cd potentialFoam and press Enter

cd cylinder and press enter

In the command terminal type the path for your case.
I have already set the path for the tutorial case of flow over cylinder
Type blockMesh and press enter In the terminal type blockMesh for meshing the geometry and press Enter.


Meshing is done.

Slide 8: For OpenFOAM v 5.0

To open cylinder case directory, type the following in your run folder:

$cd tutorials/basic/potentialFoam/cylinder


To run Allrun script file, type: $./Allrun


This will run blockMesh and potentialFoam commands.

Type paraFoam and press enter Now type paraFoam in the terminal and press Enter to view the geometry.
Let me drag this to the capture area.
In the object inspector menu click APPLY button Now on the left side of object inspector menu click Apply.


The geometry will be created as seen in the ParaView window.

Scroll down the Object inspector menu.
Check and uncheck the mesh field box Check and uncheck the Mesh field box.
Demo You can see different regions of the geometry.


You can also see the wire frame of the geometry.

For wireframe of the geometry


Change from surface to wireframe

On top of active variable control menu in the drop down menu, change from Surface to Wireframe.
You can see the wireframe model of the geometry.


Close this.


Let me switch back to the slides.

Slide 9: Summary In this tutorial we learnt:
  • How to create a curved geometry.
  • How to enter points for edges in OpenFOAM


This brings us to the end of the tutorial

Slide 10: Assignment As an assignment, create a geometry with
  • inner semi-circle of radius 2 meters
  • and outer circle of radius 4 meters


and view the results in ParaView.

Slide 11:

About Spoken tutorials

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 12:

About Spoken Tutorials

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

Slide 13 : Forum to answer questions

Do you have questions on THIS Spoken Tutorial? Choose the minute and second where you have the question Explain your question briefly Someone from the FOSSEE team will answer them. Please visit http://forums.spoken-tutorial.org/

Slide 14 : Forum to answer questions

Questions not related to the Spoken Tutorial? Do you have general/technical questions on the Software? Please visit the FOSSEE forum http://forums.fossee.in/ Choose the Software and post your question

Slide 15 : Lab Migration project

We coordinate migration from commercial CFD software like ANSYS to OpenFOAM We conduct free Workshops and provide solutions to CFD Problem Statements in OpenFOAM For more details visit this site: http://cfd.fossee.in/

Slide 16 : Case Study project

We invite students to solve a feasible CFD problem statement of reasonable complexity using OpenFOAM We give honorarium and certificate to those who do this For more details visit this site: http://cfd.fossee.in/

Slide 17 :

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.

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