Difference between revisions of "OpenFOAM-version-7/C2/Creating-3D-Pipe-Geometry-and-Mesh-in-OpenFOAM/English"

From Script | Spoken-Tutorial
Jump to: navigation, search
 
Line 18: Line 18:
 
|| In this tutorial, we will learn to:
 
|| In this tutorial, we will learn to:
  
* Create a '''3D Geometry''' using '''blockMeshDict'''
+
* Create a '''3D''' geometry using '''blockMeshDict'''
* '''Mesh''' a '''3D''' '''geometry'''
+
* '''Mesh''' a '''3D''' geometry
 
* Label the''' boundary patches'''
 
* Label the''' boundary patches'''
* Check the '''mesh results '''using''' checkMesh command''' and
+
* Check the '''mesh''' results using''' checkMesh command''' and
* View the '''3D geometry''' and '''mesh '''in''' ParaView'''
+
* View the '''3D''' geometry and '''mesh '''in''' ParaView'''
  
 
|-  
 
|-  
Line 31: Line 31:
 
* '''OpenFOAM''' version 7
 
* '''OpenFOAM''' version 7
 
* '''ParaView''' version 5.6.0 and
 
* '''ParaView''' version 5.6.0 and
* '''gedit''' Text editor
+
* '''gedit Text editor'''
  
You may use any other editor of your choice.
+
You may use any other '''editor''' of your choice.
 
|-  
 
|-  
 
|| Slide: Prerequisites
 
|| Slide: Prerequisites
Line 39: Line 39:
  
 
|| As a prerequisite:
 
|| As a prerequisite:
* You should be familiar with creation of a basic '''geometry''' using the '''blockMesh''' utility.
+
* You should be familiar with creation of a basic geometry using the '''blockMesh''' utility.
 
* If you are not, please go through the prerequisite '''OpenFOAM '''tutorial on this website.
 
* If you are not, please go through the prerequisite '''OpenFOAM '''tutorial on this website.
  
Line 45: Line 45:
 
|| Slide: Code Files
 
|| Slide: Code Files
 
||  
 
||  
* The files used in this tutorial are available in the '''Code''' '''Files''' link on this tutorial page  
+
* The files used in this tutorial are available in the '''Code Files''' link on this tutorial page  
 
* Please download and extract them
 
* Please download and extract them
 
* Make a copy and then use them while practising
 
* Make a copy and then use them while practising
Line 52: Line 52:
 
|| Slide: Hagen Poiseuille flow through a pipe
 
|| Slide: Hagen Poiseuille flow through a pipe
 
||  
 
||  
* In this tutorial, we will learn to create the '''geometry''' for '''Hagen Poiseuille flow through a pipe'''.
+
* In this tutorial, we will learn to create the geometry for '''Hagen Poiseuille flow through a pipe'''.
 
* The problem description of '''Hagen Poiseuille flow through a pipe''' is shown in the diagram.
 
* The problem description of '''Hagen Poiseuille flow through a pipe''' is shown in the diagram.
  
Line 58: Line 58:
 
|| Slide: Pipe Geometry
 
|| Slide: Pipe Geometry
 
||  
 
||  
* This is the diagram of the '''geometry''' for '''Hagen Poiseuille flow through a pipe.'''
+
* This is the diagram of the geometry for '''Hagen Poiseuille flow through a pipe.'''
 
* The left and right faces are the '''inlet''' and '''outlet''' respectively.
 
* The left and right faces are the '''inlet''' and '''outlet''' respectively.
* The cylindrical face of the '''geometry''' is a '''wall'''.
+
* The cylindrical face of the geometry is a wall.
* The '''diameter''' of the pipe is 1 centimeter and its '''length''' is 30 centimeters.
+
* The diameter of the pipe is 1 centimeter and its length is 30 centimeters.
  
 
|-  
 
|-  
 
|| CTRL + ALT + T
 
|| CTRL + ALT + T
|| Open the '''terminal''' by pressing '''Ctrl''', '''Alt''' & '''T''' keys.
+
|| Open the '''terminal''' by pressing '''Ctrl, Alt''' & '''T''' keys.
 
|-  
 
|-  
 
|| [Terminal] Type:
 
|| [Terminal] Type:
  
 
'''cd $FOAM_RUN'''
 
'''cd $FOAM_RUN'''
|| At the '''prompt''', type the following '''command''' to go to the '''run directory'''.
+
|| At the '''prompt''', type the following '''command''' to go to the '''RUN directory'''.
 
|-  
 
|-  
 
|| Only Narration
 
|| Only Narration
Line 78: Line 78:
  
 
'''cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity pipe'''
 
'''cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity pipe'''
|| Let us now copy the '''cavity case''' from the '''icoFoam''' '''tutorial directory''' to the '''run directory'''.
+
|| Let us now copy the '''cavity case''' from the '''icoFoam TUTORIAL directory''' to the '''RUN directory'''.
  
 
Type the following '''command''' to do so.
 
Type the following '''command''' to do so.
Line 88: Line 88:
  
 
'''mv pipe/0 pipe/0.Orig'''
 
'''mv pipe/0 pipe/0.Orig'''
|| In this tutorial we don’t need to define '''initial''' and '''boundary''' '''conditions''' in '''zero''' time.
+
|| In this tutorial we don’t need to define '''initial''' and '''boundary conditions''' in '''0''' time.
  
Type this '''command''' to '''rename''' '''“0”''' folder to '''“0.Orig”'''
+
Type this '''command''' to rename '''0''' folder to '''0 dot O r i g'''
 
|-  
 
|-  
 
|| [Terminal] Type:
 
|| [Terminal] Type:
Line 105: Line 105:
  
 
'''Selection in the Text Editor >> Delete'''
 
'''Selection in the Text Editor >> Delete'''
|| '''Delete''' the lines from '''convertToMeters''' to the end of the file as shown here.
+
|| Delete the lines from '''convertToMeters''' to the end of the file as shown here.
  
 
The remaining content is common for all '''blockMeshDict''' files.
 
The remaining content is common for all '''blockMeshDict''' files.
Line 129: Line 129:
  
 
'''0.01'''
 
'''0.01'''
|| Note that all the '''dimensions''' will be in '''centimeters'''.
+
|| Note that all the dimensions will be in '''centimeters'''.
 
|-  
 
|-  
 
|| Slide: Vertices Detail
 
|| Slide: Vertices Detail
 
||  
 
||  
* '''Vertices''' are shown in the slide.  
+
* Vertices are shown in the slide.  
* Here we are going to use '''18''' '''vertices''' to define the '''geometry''' of a '''pipe'''.
+
* Here we are going to use 18 vertices to define the geometry of a '''pipe'''.
* For example, '''two reference points''' 0 and 17 are on (0 0 0) and (0 0 30) respectively.
+
* For example, two reference points 0 and 17 are on (0 0 0) and (0 0 30) respectively.
  
 
|-  
 
|-  
Line 141: Line 141:
  
 
'''Selection in the Text Editor >> vertices '''
 
'''Selection in the Text Editor >> vertices '''
|| All '''18''' '''points''' are defined in the '''vertices''' '''section''' in the '''blockMeshDict''' file as shown.
+
|| All 18 points are defined in the vertices section, in the '''blockMeshDict''' file as shown.
 
|-  
 
|-  
 
|| Only Narration
 
|| Only Narration
Line 148: Line 148:
 
|| Slide: Block Detail
 
|| Slide: Block Detail
 
||  
 
||  
* Here we will use 5 '''hexahedral blocks''' to define the''' pipe geometry'''.
+
* Here we will use 5 '''hexahedral blocks''' to define the''' pipe''' geometry.
* As you can see, the '''center hexahedral block''' is separately shown in the '''figure''' on the right.
+
* As you can see, the '''center hexahedral block''' is separately shown in the figure on the right.
* To '''define''' this '''block''', we need to type the '''back plane’s vertices '''first.
+
* To define this '''block''', we need to type the back plane’s vertices first.
* The '''vertices''' should be ordered''' anti-clockwise''' when viewed '''along the negative z-axis'''.
+
* The vertices should be ordered anti-clockwise when viewed along the negative '''z-axis'''.
* The '''front plane’s vertices''' should also follow the same order.
+
* The front plane’s vertices should also follow the same order.
  
 
|-  
 
|-  
Line 158: Line 158:
  
 
Highlight: '''hex (1 2 3 4 9 10 11 12) (8 8 80) simpleGrading (1 1 1)'''
 
Highlight: '''hex (1 2 3 4 9 10 11 12) (8 8 80) simpleGrading (1 1 1)'''
|| An '''example''' is shown in the '''slide'''.
+
|| An example is shown in the slide.
  
 
The same '''block''' can be defined correctly in more than one way.
 
The same '''block''' can be defined correctly in more than one way.
Line 168: Line 168:
 
|| To generate '''3D mesh''' we are using:
 
|| To generate '''3D mesh''' we are using:
  
* '''8 cells''' in '''X direction''',  
+
* 8 '''cells''' in '''X direction''',  
* '''8 cells '''in '''Y direction''' and  
+
* 8 '''cells''' in '''Y direction''' and  
* '''80 cells''' in '''Z direction'''.
+
* 80 '''cells''' in '''Z direction'''.
  
 
|-  
 
|-  
Line 176: Line 176:
  
 
'''Selection in the Text Editor >> blocks'''
 
'''Selection in the Text Editor >> blocks'''
|| Other '''4''' '''blocks''' are defined in the '''blockMeshDict''' file as shown.
+
|| Other four '''blocks''' are defined in the '''blockMeshDict''' file as shown.
  
 
|-  
 
|-  
 
|| Slide: Geometry Arc Detail
 
|| Slide: Geometry Arc Detail
|| For the '''curved geometry''', we need to define the '''edges'''.  
+
|| For the '''curved''' geometry, we need to define the '''edges'''.  
 
|-  
 
|-  
 
|| Slide: Geometry Arc Detail
 
|| Slide: Geometry Arc Detail
 
||  
 
||  
* There are a total of '''16 arcs''' that we need to define.
+
* There are a total of 16 '''arcs''' that we need to define.
 
* The '''arcs''' and the '''intermediate points''' are shown in the slide.
 
* The '''arcs''' and the '''intermediate points''' are shown in the slide.
 
* Note that I have used the '''midpoint''' of the '''arc''' as the '''intermediate point'''.
 
* Note that I have used the '''midpoint''' of the '''arc''' as the '''intermediate point'''.
* However, '''any other point''' through which the '''arc''' passes is acceptable.
+
* However, any other point through which the '''arc''' passes is acceptable.
  
 
|-  
 
|-  
Line 193: Line 193:
  
 
Highlight: '''arc 5 6 (0 0.5 0)'''
 
Highlight: '''arc 5 6 (0 0.5 0)'''
|| For example, the''' edge''' from '''Point''' number '''5''' to '''6''' is passing through (0 0.5 0).
+
|| For example, the''' edge''' from point number '''5''' to '''6''' is passing through (0 0.5 0).
 
|-  
 
|-  
 
|| [gedit - '''blockMeshDict'''] Highlight
 
|| [gedit - '''blockMeshDict'''] Highlight
  
 
'''Selection in the Text Editor >> edges'''
 
'''Selection in the Text Editor >> edges'''
|| All '''16''' '''arcs''' are defined in the '''edges''' '''section''' in the '''blockMeshDict''' file as shown.
+
|| All 16 '''arcs''' are defined in the '''edges''' section in the '''blockMeshDict''' file as shown.
 
|-  
 
|-  
 
|| [gedit - '''blockMeshDict'''] Highlight  
 
|| [gedit - '''blockMeshDict'''] Highlight  
  
 
'''arc 5 6 (0 0.5 0)'''
 
'''arc 5 6 (0 0.5 0)'''
|| The '''curved edge''' connecting '''points 5''' and '''6''' is defined as shown.
+
|| The '''curved edge''' connecting points 5 and 6 is defined as shown.
  
 
|-  
 
|-  
Line 209: Line 209:
  
 
'''arc'''
 
'''arc'''
|| The edge is an '''arc'''.
+
|| The '''edge''' is an '''arc'''.
  
 
|-  
 
|-  
Line 215: Line 215:
  
 
'''5 6'''
 
'''5 6'''
|| Its two '''end''' '''points''' are 5 and 6.
+
|| Its two end points''' are 5 and 6.
  
 
|-  
 
|-  
Line 221: Line 221:
  
 
'''(0 0.5 0)'''
 
'''(0 0.5 0)'''
|| The '''coordinates''' of the '''point''' through which the '''arc''' passes through is 0, 0.5, 0
+
|| The '''coordinates''' of the point through which the '''arc''' passes through is 0, 0.5, 0
  
 
|-  
 
|-  
Line 227: Line 227:
 
|| Let’s label the '''boundary patches'''.
 
|| Let’s label the '''boundary patches'''.
  
The '''boundary faces''' should be labelled appropriately.
+
The '''boundary''' faces should be labelled appropriately.
  
 
The labels are used to impose '''boundary conditions''' on the respective faces.
 
The labels are used to impose '''boundary conditions''' on the respective faces.
Line 256: Line 256:
  
 
'''Selection in the Text Editor >> mergePatchPairs'''
 
'''Selection in the Text Editor >> mergePatchPairs'''
|| We do not have any '''patches '''or''' internal faces''' to merge.
+
|| We do not have any '''patches '''or internal faces to merge.
  
 
Therefore, we leave the '''mergePatchPairs''' field empty.
 
Therefore, we leave the '''mergePatchPairs''' field empty.
 
|-  
 
|-  
 
|| CTRL+S >> Close Text Editor
 
|| CTRL+S >> Close Text Editor
|| Now, save the '''blockMeshDict '''file and close the text editor.
+
|| Now, save the '''blockMeshDict '''file and close the '''text editor'''.
 
|-  
 
|-  
 
|| [Terminal] Type:
 
|| [Terminal] Type:
  
 
'''cd pipe'''
 
'''cd pipe'''
|| Now, go to the '''terminal''' and navigate to the '''pipe''' directory.
+
|| Now, go to the '''terminal''' and navigate to the '''pipe directory'''.
 
|-  
 
|-  
 
|| [Terminal] Type:
 
|| [Terminal] Type:
Line 283: Line 283:
  
 
'''Patches section'''
 
'''Patches section'''
|| As we can see in '''terminal results''', three patches are created.
+
|| As we can see in '''terminal''' results, three '''patches''' are created.
  
 
|-  
 
|-  
Line 289: Line 289:
  
 
'''checkMesh'''
 
'''checkMesh'''
|| Now, let’s '''check''' '''mesh''' '''results''' and '''quality'''.
+
|| Now, let’s check '''mesh''' results and quality.
  
 
To do that type '''checkMesh''' in the '''terminal''' and press '''Enter'''.
 
To do that type '''checkMesh''' in the '''terminal''' and press '''Enter'''.
Line 296: Line 296:
 
|-  
 
|-  
 
|| Only Narration
 
|| Only Narration
|| We get the '''results''' printed of the '''mesh''' we created.
+
|| We get the results printed of the '''mesh''' we created.
 
|-  
 
|-  
 
|| [Terminal] Highlight
 
|| [Terminal] Highlight
Line 322: Line 322:
 
In our case, no negative volume is present.
 
In our case, no negative volume is present.
  
* '''Bounding box '''coordinates and
+
* '''Bounding box coordinates''' and
  
 
|-  
 
|-  
Line 343: Line 343:
 
'''polyhedra: 0'''
 
'''polyhedra: 0'''
 
||  
 
||  
* '''Number of cells''' with their '''types'''
+
* Number of '''cells''' with their '''types'''.
  
 
|-  
 
|-  
Line 355: Line 355:
 
|| Click on '''Apply''' on the left side of your window in the '''Properties''' tab.
 
|| Click on '''Apply''' on the left side of your window in the '''Properties''' tab.
  
Now you can see '''pipe geometry''' in the''' Layout window'''.
+
Now you can see '''pipe''' geometry in the''' Layout window'''.
 
|-  
 
|-  
 
|| [ParaView] '''Rotate geometry'''
 
|| [ParaView] '''Rotate geometry'''
|| You can''' rotate''' geometry in the '''Layout''' '''window''' by pressing the left mouse button and dragging.
+
|| You can rotate geometry in the '''Layout''' window by pressing the left mouse button and dragging.
 
|-  
 
|-  
 
|| [ParaView]
 
|| [ParaView]
Line 372: Line 372:
 
'''Click on vtkBlockColors >> SolidColor'''
 
'''Click on vtkBlockColors >> SolidColor'''
 
|| Click on '''vtkBlockColors''' available in the '''Active Variable Controls.'''  
 
|| Click on '''vtkBlockColors''' available in the '''Active Variable Controls.'''  
and change it to '''SolidColor'''.
 
  
You can now see the '''mesh structure''' of '''pipe geometry''' that we created.
+
And change it to '''SolidColor'''.
 +
 
 +
You can now see the '''mesh structure''' of '''pipe''' geometry that we created.
 
|-  
 
|-  
 
|| [ParaView] '''Close ParaView'''
 
|| [ParaView] '''Close ParaView'''
Line 381: Line 382:
 
|| Only Narration
 
|| Only Narration
 
|| With this we have come to the end of the tutorial.
 
|| With this we have come to the end of the tutorial.
 
Let’s summarize.
 
 
|-  
 
|-  
 
|| Slide: Summary
 
|| Slide: Summary
|| In this tutorial, we have learnt to,
+
|| To summarize, in this tutorial we have learnt to,
  
* Create a '''3D Geometry''' using '''blockMeshDict'''
+
* Create a '''3D''' geometry using '''blockMeshDict'''
* Mesh a '''3D''' '''geometry'''
+
* Mesh a '''3D''' geometry
 
* Label the''' boundary patches'''
 
* Label the''' boundary patches'''
* Check the '''mesh results '''using''' checkMesh command''' and
+
* Check the '''mesh''' results using '''checkMesh command''' and
 
* View the '''3D geometry''' and '''mesh '''in''' ParaView'''
 
* View the '''3D geometry''' and '''mesh '''in''' ParaView'''
  
Line 405: Line 404:
 
|-
 
|-
 
|| Slide: Spoken Tutorial Forum
 
|| Slide: Spoken Tutorial Forum
||  
+
|| Please post your timed queries in this forum.
* Please post your timed queries in this forum.
+
  
 
|-
 
|-
Line 417: Line 415:
 
|| Slide: FOSSEE Case Study Project
 
|| Slide: FOSSEE Case Study Project
 
||  
 
||  
* The FOSSEE team coordinates solving feasible CFD problems of reasonable complexity using OpenFOAM.
+
* The FOSSEE team coordinates solving feasible '''CFD''' problems of reasonable complexity using '''OpenFOAM'''.
 
* We give honorarium and certificates to those who do this.
 
* We give honorarium and certificates to those who do this.
 
* For more details, please visit these sites.
 
* For more details, please visit these sites.
Line 423: Line 421:
 
|-  
 
|-  
 
|| Slide: Spoken Tutorial  
 
|| Slide: Spoken Tutorial  
|| The Spoken Tutorial project is supported by MHRD, Govt. of India.
+
|| The '''Spoken Tutorial project''' is supported by MHRD, Govt. of India.
  
 
The script for this tutorial is contributed by Divyesh Variya.
 
The script for this tutorial is contributed by Divyesh Variya.

Latest revision as of 15:23, 21 July 2020

Title of the script: Creating 3D Pipe Geometry and Mesh in OpenFOAM

Author: Divyesh Variya

Keywords: OpenFOAM, 3D-Geometry, Pipe, Meshing, ParaView, Pre-Processing, Video-Tutorial, blockMesh


Visual Cue Narration
Slide: Opening slide Welcome to this tutorial on Creating 3D Pipe Geometry and Mesh in OpenFOAM.
Slide: Learning Objective In this tutorial, we will learn to:
  • Create a 3D geometry using blockMeshDict
  • Mesh a 3D geometry
  • Label the boundary patches
  • Check the mesh results using checkMesh command and
  • View the 3D geometry and mesh in ParaView
Slide: System Specifications To record this tutorial, I am using,
  • Ubuntu Linux OS version 18.04
  • OpenFOAM version 7
  • ParaView version 5.6.0 and
  • gedit Text editor

You may use any other editor of your choice.

Slide: Prerequisites As a prerequisite:
  • You should be familiar with creation of a basic geometry using the blockMesh utility.
  • If you are not, please go through the prerequisite OpenFOAM tutorial on this website.
Slide: Code Files
  • The files used in this tutorial are available in the Code Files link on this tutorial page
  • Please download and extract them
  • Make a copy and then use them while practising
Slide: Hagen Poiseuille flow through a pipe
  • In this tutorial, we will learn to create the geometry for Hagen Poiseuille flow through a pipe.
  • The problem description of Hagen Poiseuille flow through a pipe is shown in the diagram.
Slide: Pipe Geometry
  • This is the diagram of the geometry for Hagen Poiseuille flow through a pipe.
  • The left and right faces are the inlet and outlet respectively.
  • The cylindrical face of the geometry is a wall.
  • The diameter of the pipe is 1 centimeter and its length is 30 centimeters.
CTRL + ALT + T Open the terminal by pressing Ctrl, Alt & T keys.
[Terminal] Type:

cd $FOAM_RUN

At the prompt, type the following command to go to the RUN directory.
Only Narration Here onwards, please remember to press the Enter key after typing each command.
[Terminal] Type:

cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity pipe

Let us now copy the cavity case from the icoFoam TUTORIAL directory to the RUN directory.

Type the following command to do so.

[Terminal] Highlight: pipe Note that the cavity case is copied to the pipe directory.
[Terminal] Type:

mv pipe/0 pipe/0.Orig

In this tutorial we don’t need to define initial and boundary conditions in 0 time.

Type this command to rename 0 folder to 0 dot O r i g

[Terminal] Type:

gedit pipe/system/blockMeshDict

The blockMeshDict file is located in the system folder.

Open this file in a text editor. I am doing it in the gedit text editor.

[gedit - blockMeshDict] Now we can see the blockMeshDict file in the text editor.
[gedit - blockMeshDict] Highlight

Selection in the Text Editor >> Delete

Delete the lines from convertToMeters to the end of the file as shown here.

The remaining content is common for all blockMeshDict files.

[gedit - pipe] Next, open the pipe.txt file that you had downloaded in the text editor.
[gedit - blockMeshDict] Highlight

Selection in the Text Editor >> Copy

Copy the entire content of the text file.
[gedit - blockMeshDict] Now switch back to the blockMeshDict file.
[gedit - blockMeshDict]

Paste

And paste the copied contents into the blockMeshDict file as shown.
[gedit - blockMeshDict] Highlight

0.01

Note that all the dimensions will be in centimeters.
Slide: Vertices Detail
  • Vertices are shown in the slide.
  • Here we are going to use 18 vertices to define the geometry of a pipe.
  • For example, two reference points 0 and 17 are on (0 0 0) and (0 0 30) respectively.
[gedit - blockMeshDict] Highlight

Selection in the Text Editor >> vertices

All 18 points are defined in the vertices section, in the blockMeshDict file as shown.
Only Narration Now let me switch back to the Slides.
Slide: Block Detail
  • Here we will use 5 hexahedral blocks to define the pipe geometry.
  • As you can see, the center hexahedral block is separately shown in the figure on the right.
  • To define this block, we need to type the back plane’s vertices first.
  • The vertices should be ordered anti-clockwise when viewed along the negative z-axis.
  • The front plane’s vertices should also follow the same order.
Slide: Block Detail

Highlight: hex (1 2 3 4 9 10 11 12) (8 8 80) simpleGrading (1 1 1)

An example is shown in the slide.

The same block can be defined correctly in more than one way.

Slide: Block Detail

Highlight: (8 8 80)

To generate 3D mesh we are using:
  • 8 cells in X direction,
  • 8 cells in Y direction and
  • 80 cells in Z direction.
[gedit - blockMeshDict] Highlight

Selection in the Text Editor >> blocks

Other four blocks are defined in the blockMeshDict file as shown.
Slide: Geometry Arc Detail For the curved geometry, we need to define the edges.
Slide: Geometry Arc Detail
  • There are a total of 16 arcs that we need to define.
  • The arcs and the intermediate points are shown in the slide.
  • Note that I have used the midpoint of the arc as the intermediate point.
  • However, any other point through which the arc passes is acceptable.
Slide: Geometry Arc Detail

Highlight: arc 5 6 (0 0.5 0)

For example, the edge from point number 5 to 6 is passing through (0 0.5 0).
[gedit - blockMeshDict] Highlight

Selection in the Text Editor >> edges

All 16 arcs are defined in the edges section in the blockMeshDict file as shown.
[gedit - blockMeshDict] Highlight

arc 5 6 (0 0.5 0)

The curved edge connecting points 5 and 6 is defined as shown.
[gedit - blockMeshDict] Highlight

arc

The edge is an arc.
[gedit - blockMeshDict] Highlight

5 6

Its two end points are 5 and 6.
[gedit - blockMeshDict] Highlight

(0 0.5 0)

The coordinates of the point through which the arc passes through is 0, 0.5, 0
Only Narration Let’s label the boundary patches.

The boundary faces should be labelled appropriately.

The labels are used to impose boundary conditions on the respective faces.

[gedit - blockMeshDict] Highlight

Selection in the Text Editor >> inlet

The inlet boundary is defined as shown.
[gedit - blockMeshDict] Highlight

Selection in the Text Editor >>

The inlet boundary has 5 faces.

These faces are defined as shown.

[gedit - blockMeshDict] Highlight

Selection in the Text Editor >> outlet and wall

The outlet and wall boundary is defined as shown.
Only Narration Note that all boundaries have more than one face.
[gedit - blockMeshDict] Highlight

Selection in the Text Editor >> mergePatchPairs

We do not have any patches or internal faces to merge.

Therefore, we leave the mergePatchPairs field empty.

CTRL+S >> Close Text Editor Now, save the blockMeshDict file and close the text editor.
[Terminal] Type:

cd pipe

Now, go to the terminal and navigate to the pipe directory.
[Terminal] Type:

blockMesh

Type blockMesh command and press Enter.
[Terminal] Highlight

End

The meshing is now complete.
[Terminal] Highlight

Patches section

As we can see in terminal results, three patches are created.
[Terminal] Type:

checkMesh

Now, let’s check mesh results and quality.

To do that type checkMesh in the terminal and press Enter.

Note that M in checkMesh is capital.

Only Narration We get the results printed of the mesh we created.
[Terminal] Highlight

Max skewness = 0.6954 OK.

Non-orthogonality check OK.

Max aspect ratio = 30.3404 OK.



Overall domain bounding box

Here we can see:
  • Skewness
  • Orthogonality
  • Aspect ratio
  • Negative volume values if they are present

In our case, no negative volume is present.

  • Bounding box coordinates and
[Terminal] Highlight

Overall number of cells of each type:

hexahedra: 25600

prisms: 0

wedges: 0

pyramids: 0

tet wedges:0

tetrahedra:0

polyhedra: 0

  • Number of cells with their types.
[Terminal] Type paraFoam To view mesh in paraview type paraFoam and press Enter.
[ParaView] Click

Apply

Click on Apply on the left side of your window in the Properties tab.

Now you can see pipe geometry in the Layout window.

[ParaView] Rotate geometry You can rotate geometry in the Layout window by pressing the left mouse button and dragging.
[ParaView]

Click on Surface >> Click on Surface with Edges

Click on Surface available in the Active Variable Controls.

Then change it to Surface with Edges.

[ParaView]


Click on vtkBlockColors >> SolidColor

Click on vtkBlockColors available in the Active Variable Controls.

And change it to SolidColor.

You can now see the mesh structure of pipe geometry that we created.

[ParaView] Close ParaView You can close the ParaView window.
Only Narration With this we have come to the end of the tutorial.
Slide: Summary To summarize, in this tutorial we have learnt to,
  • Create a 3D geometry using blockMeshDict
  • Mesh a 3D geometry
  • Label the boundary patches
  • Check the mesh results using checkMesh command and
  • View the 3D geometry and mesh in ParaView
Slide: About the Spoken Tutorial Project The video at the following link summarises the Spoken Tutorial project.

Please download and watch it.

Slide: Spoken Tutorial Workshops We conduct workshops using Spoken Tutorials and give certificates.

Please contact us.

Slide: Spoken Tutorial Forum Please post your timed queries in this forum.
Slide: FOSSEE Forum
  • Do you have any general/technical questions?
  • Please visit the forum given in this link.
Slide: FOSSEE Case Study Project
  • The FOSSEE team coordinates solving feasible CFD problems of reasonable complexity using OpenFOAM.
  • We give honorarium and certificates to those who do this.
  • For more details, please visit these sites.
Slide: Spoken Tutorial The Spoken Tutorial project is supported by MHRD, Govt. of India.

The script for this tutorial is contributed by Divyesh Variya.

And this is Swetha Sridhar from IIT Bombay signing off.

Thank you for joining.

Contributors and Content Editors

Divyesh7, Nancyvarkey