Difference between revisions of "OpenFOAM-version-7/C2/Turbulence-Modelling-in-OpenFOAM/English"

From Script | Spoken-Tutorial
Jump to: navigation, search
 
(3 intermediate revisions by 2 users not shown)
Line 28: Line 28:
 
* '''gedit Text Editor'''
 
* '''gedit Text Editor'''
 
However, you may use any other '''text editor''' of your choice.
 
However, you may use any other '''text editor''' of your choice.
 +
 
The steps explained in this tutorial are identical in '''Ubuntu Linux OS'''.
 
The steps explained in this tutorial are identical in '''Ubuntu Linux OS'''.
 
|-
 
|-
 
|| Slide: Prerequisites
 
|| Slide: Prerequisites
 
|| As a prerequisite:
 
|| As a prerequisite:
* You should have basic knowledge of '''geometric progression'''
+
* You should have basic knowledge of geometric progression
 
* You should be familiar with '''simulating''' a''' turbulent flow''' through a''' channel '''and
 
* You should be familiar with '''simulating''' a''' turbulent flow''' through a''' channel '''and
* You should also be familiar with '''Multi-block Meshing of 2D Geometry'''
+
* You should also be familiar with '''Multi-block Meshing of 2D''' geometry
 
* If not, please go through the prerequisite '''OpenFOAM''' tutorial on this website
 
* If not, please go through the prerequisite '''OpenFOAM''' tutorial on this website
 
|-
 
|-
 
|| 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 45: Line 46:
 
|| Slide: Solver detail
 
|| Slide: Solver detail
 
|| We will use the '''simpleFoam solver''' to '''simulate '''this problem.
 
|| We will use the '''simpleFoam solver''' to '''simulate '''this problem.
'''simpleFoam''' is a '''steady-state solver''' for '''incompressible''', '''turbulent flow'''.
+
 
 +
'''simpleFoam''' is a '''steady-state solver''' for '''incompressible, turbulent flow'''.
 
|-
 
|-
 
|| Slide: Problem statement
 
|| Slide: Problem statement
|| The diagram shows a''' 2D channel '''of length '''65 m '''and width '''1 m'''.
+
|| The diagram shows a''' 2D channel '''of length '''65 metres '''and width '''1 metre'''.
The '''kinematic viscosity''' is '''1e-05 m<sup>2</sup>/s.'''
+
 
The '''Inlet velocity '''is '''20 m/s. '''
+
The '''kinematic viscosity''' is '''1e to the power of minus 5 metres per second.'''
'''Outlet pressure '''is set to '''0 atmosphere.'''
+
 
 +
The '''Inlet velocity '''is '''20 metres per second. '''
 +
 
 +
'''Outlet pressure '''is set to '''zero atmosphere.'''
 
|-
 
|-
 
|| Slide: Flow Properties
 
|| Slide: Flow Properties
|| '''Reynolds' number''' is '''2 million'''.
+
|| '''Reynolds number''' is '''2 million'''.
The flow is '''turbulent.'''
+
 
 +
 
 +
The '''flow''' is '''turbulent.'''
 
|-  
 
|-  
 
|| Only Narration
 
|| Only Narration
 
|| First, We will use''' k-epsilon turbulence model '''to '''simulate''' this '''case'''.
 
|| First, We will use''' k-epsilon turbulence model '''to '''simulate''' this '''case'''.
 +
 
Let us set up the '''case.'''
 
Let us set up the '''case.'''
 
|-
 
|-
 
|| Only Narration  
 
|| Only Narration  
|| Download the '''kepsilon''' folder provided in the '''code files''' link and extract it.
+
|| Download the '''kepsilon''' folder provided in the '''Code files''' link and extract it.
 
|-
 
|-
 
|| CTRL + ALT + T
 
|| CTRL + ALT + T
|| Open the '''terminal''' by pressing '''Ctrl''', '''Alt''' & '''T''' keys.
+
|| Open the '''terminal''' by pressing '''Ctrl, Alt''' & '''T''' keys.
 
|-
 
|-
 
|| Only Narration
 
|| Only Narration
Line 75: Line 83:
 
|| [Terminal]  
 
|| [Terminal]  
 
Type: '''cp -r ~/Downloads/kepsilon .'''
 
Type: '''cp -r ~/Downloads/kepsilon .'''
|| Copy the downloaded file into the '''Run directory'''.
+
|| Copy the downloaded file into the '''RUN directory'''.
 
To do that, type the following '''command.'''
 
To do that, type the following '''command.'''
 
|-
 
|-
 
|| Only Narration  
 
|| Only Narration  
 
|| I have downloaded the file into the '''Downloads directory.'''
 
|| I have downloaded the file into the '''Downloads directory.'''
 +
 
Please change the '''command''' according to the '''file path''' on your machine.
 
Please change the '''command''' according to the '''file path''' on your machine.
 
|-
 
|-
Line 99: Line 108:
 
|| [gedit -'''blockMeshDict''']
 
|| [gedit -'''blockMeshDict''']
 
Highlight '''75''' '''30'''
 
Highlight '''75''' '''30'''
|| For each '''block''', the '''cell number''' is set to '''75 '''in the '''x-direction''', and '''30''' in the '''y-direction.'''
+
|| For each '''block''', the '''cell''' number is set to '''75 '''in the '''x-direction''', and '''30''' in the '''y-direction.'''
 
|-
 
|-
 
|| Slide: Wall distance, yp
 
|| Slide: Wall distance, yp
 
|| Let “'''yp'''” be the distance between the '''wall''' and the nearest '''cell centre'''.
 
|| Let “'''yp'''” be the distance between the '''wall''' and the nearest '''cell centre'''.
 +
 
For our '''case, yp''' is '''0.0031''' for '''YPlus''' value of '''200'''.
 
For our '''case, yp''' is '''0.0031''' for '''YPlus''' value of '''200'''.
 +
 
For''' channel flow''', the '''skin friction coefficient, Cf,''' is given by this formula.
 
For''' channel flow''', the '''skin friction coefficient, Cf,''' is given by this formula.
 
|-
 
|-
Line 110: Line 121:
 
|-
 
|-
 
|| Slide: Expansion ratio
 
|| Slide: Expansion ratio
|| The '''expansion ratio''' is the ratio of the last '''cell width''' to the first '''cell width.'''
+
|| The '''expansion ratio''' is the ratio of the last '''cell''' width to the first '''cell''' width.
 
|-
 
|-
 
|| Slide: Expansion ratio calculation
 
|| Slide: Expansion ratio calculation
|| It is calculated using '''geometric progression''' formula.  
+
|| It is calculated using '''geometric progression formula'''.  
 +
 
 
Please refer to the '''Additional Reading Material''' for more details.
 
Please refer to the '''Additional Reading Material''' for more details.
 
|-
 
|-
Line 120: Line 132:
 
* '''5.57 '''for '''block 1,''' and  
 
* '''5.57 '''for '''block 1,''' and  
 
* '''0.18 '''for''' block 2'''
 
* '''0.18 '''for''' block 2'''
for a '''block''' of width of '''0.5 m''' and '''cell number 30.'''
+
* for a '''block''' of width of '''0.5 m''' and '''cell''' number 30.
 +
 
 +
 
 
Please refer to the '''Additional Reading Material''' on this tutorial page for details.
 
Please refer to the '''Additional Reading Material''' on this tutorial page for details.
 
|-
 
|-
Line 149: Line 163:
 
|-
 
|-
 
|| [Terminal] Type: '''blockMesh'''
 
|| [Terminal] Type: '''blockMesh'''
|| On the '''terminal''', type '''blockMesh''' to '''mesh''' the '''geometry'''.
+
|| On the '''terminal''', type '''blockMesh''' to '''mesh''' the geometry.
 
|-
 
|-
 
|| [Terminal] Type:
 
|| [Terminal] Type:
Line 156: Line 170:
 
|-
 
|-
 
|| Only Narration  
 
|| Only Narration  
|| The '''simulation '''will take some '''time''' depending on your computer’s '''hardware'''.
+
|| The '''simulation '''will take some time depending on your computer’s '''hardware'''.
 
|-
 
|-
 
|| [Terminal] Highlight''' End'''
 
|| [Terminal] Highlight''' End'''
Line 169: Line 183:
 
|-  
 
|-  
 
|| [Terminal]
 
|| [Terminal]
Highlight''' Patch to 213.433'''
+
Highlight''' Patch to 214.786'''
 
|| We can see that the '''YPlus''' value stays below 300.  
 
|| We can see that the '''YPlus''' value stays below 300.  
 
|-
 
|-
 
|| [Terminal] Type: '''cd ..'''
 
|| [Terminal] Type: '''cd ..'''
|| Let us go back to the '''Run directory''' using the '''cd command'''.
+
|| Let us go back to the '''RUN directory''' using the '''cd command'''.
 
|-  
 
|-  
 
|| Only Narration  
 
|| Only Narration  
|| Let us '''simulate''' the same problem using the k-omega''' turbulence model '''now'''.'''
+
|| Let us '''simulate''' the same problem using the '''k-omega turbulence model''' now.
 
|-  
 
|-  
 
|| Slide: K-Omega turbulence model
 
|| Slide: K-Omega turbulence model
 
|| '''k-omega '''is a '''two-equation model'''.
 
|| '''k-omega '''is a '''two-equation model'''.
 
It solves-
 
It solves-
* The '''turbulent kinetic energy''' '''transport equation''', and
+
* The '''turbulent kinetic energy transport equation''', and
* The '''specific''' '''turbulent dissipation rate transport equation'''
+
* The '''specific turbulent dissipation rate transport equation'''
 
|-
 
|-
 
|| Slide: Inlet Boundary Condition - omega
 
|| Slide: Inlet Boundary Condition - omega
 
|| Let's look at the '''boundary''' and '''initial conditions''' for '''omega.'''
 
|| Let's look at the '''boundary''' and '''initial conditions''' for '''omega.'''
 +
 
We will use '''turbulentMixingLengthFrequencyInlet'''
 
We will use '''turbulentMixingLengthFrequencyInlet'''
It calculates '''omega''' using '''kappa '''and  
+
 
user-specified '''mixing length. '''
+
It calculates '''omega''' using '''kappa''' and user-specified '''mixing length. '''
'''Mixing length '''refers to the''' turbulent length scale.'''
+
 
 +
'''Mixing length '''refers to the '''turbulent length scale.'''
 +
 
 
'''Kappa''' value is automatically put in by the '''solver.'''
 
'''Kappa''' value is automatically put in by the '''solver.'''
Here''', '''the value of''' turbulent length scale''' is '''0.07 m'''
+
 
The '''specific''' '''turbulent dissipation rate '''value is '''16.67 1/s'''
+
Here, the value of '''turbulent length scale''' is '''0.07 metres'''
 +
 
 +
The '''specific turbulent dissipation rate '''value is '''16.67 second inverse'''
 +
 
 
Where''' empirical constant, cmu '''is equal to '''0.09'''
 
Where''' empirical constant, cmu '''is equal to '''0.09'''
 
|-
 
|-
 
|| Slide: Wall & Outlet Boundary Condition - omega
 
|| Slide: Wall & Outlet Boundary Condition - omega
 
|| '''Wall boundary condition''' is set to '''omegaWallFunction.'''
 
|| '''Wall boundary condition''' is set to '''omegaWallFunction.'''
 +
 
'''zeroGradient boundary condition''' is imposed at the '''outlet. '''
 
'''zeroGradient boundary condition''' is imposed at the '''outlet. '''
 +
 
Please refer to the '''Additional Reading Material''' on this tutorial page for details.
 
Please refer to the '''Additional Reading Material''' on this tutorial page for details.
 
|-
 
|-
Line 205: Line 227:
 
|| [Terminal] Type:
 
|| [Terminal] Type:
 
'''cp -r ~/Downloads/komega .'''
 
'''cp -r ~/Downloads/komega .'''
|| Copy the downloaded file into '''Run directory.'''
+
|| Copy the downloaded file into '''RUN directory.'''
To do that, type the following '''command '''in the '''terminal.'''
+
 
 +
To do that, type the following '''command''' in the '''terminal.'''
 
|-
 
|-
 
|| [Terminal] Type:
 
|| [Terminal] Type:
Line 213: Line 236:
 
|-
 
|-
 
|| Only Narration
 
|| Only Narration
|| Let’s take a look at the '''specific''' '''turbulent dissipation rate '''file.
+
|| Let’s take a look at the '''specific turbulent dissipation rate '''file.
 
|-
 
|-
 
|| [Terminal] Type: '''gedit 0/omega'''
 
|| [Terminal] Type: '''gedit 0/omega'''
Line 224: Line 247:
 
|| [gedit -'''omega''']
 
|| [gedit -'''omega''']
 
Highlight''' type turbulentMixingLengthFrequencyInlet'''
 
Highlight''' type turbulentMixingLengthFrequencyInlet'''
|| The '''inlet '''boundary '''type''' is set to '''turbulentMixingLengthFrequencyInlet'''
+
|| The '''inlet boundary type''' is set to '''turbulentMixingLengthFrequencyInlet'''
 
|-
 
|-
 
|| [gedit -'''omega''']  
 
|| [gedit -'''omega''']  
 
Highlight''' mixingLength 0.07;'''
 
Highlight''' mixingLength 0.07;'''
|| The '''keyword''' '''mixingLength '''represents the '''Turbulent length scale''', and is set to '''0.07'''
+
|| The '''keyword mixingLength '''represents the '''Turbulent length scale''', and is set to '''0.07'''
 
|-
 
|-
 
|| [gedit -'''omega''']  
 
|| [gedit -'''omega''']  
Line 251: Line 274:
 
Highlight''' kOmega'''
 
Highlight''' kOmega'''
 
|| '''kOmega '''is selected as the '''RASModel.'''
 
|| '''kOmega '''is selected as the '''RASModel.'''
 +
 
Note,''' O '''is capitalized here.
 
Note,''' O '''is capitalized here.
 
|-
 
|-
 
|| [gedit -'''turbulenceProperties''']  
 
|| [gedit -'''turbulenceProperties''']  
 
Highlight''' on'''
 
Highlight''' on'''
|| Ensure the '''keyword''' '''turbulence''' is set to '''On'''.
+
|| Ensure the '''keyword turbulence''' is set to '''On'''.
 
|-
 
|-
 
|| [gedit -'''turbulenceProperties''']
 
|| [gedit -'''turbulenceProperties''']
Line 265: Line 289:
 
|-
 
|-
 
|| [Terminal] Type: '''blockMesh'''
 
|| [Terminal] Type: '''blockMesh'''
|| On the '''terminal''', type '''blockMesh '''to '''mesh '''the '''geometry.'''
+
|| On the '''terminal''', type '''blockMesh '''to '''mesh '''the geometry.  
 
|-
 
|-
 
|| [Terminal] Type: '''simpleFoam'''
 
|| [Terminal] Type: '''simpleFoam'''
Line 274: Line 298:
 
|-
 
|-
 
|| [Terminal] Type: '''cd ..'''
 
|| [Terminal] Type: '''cd ..'''
|| Let us go back to the '''Run directory''' using the '''cd command.'''
+
|| Let us go back to the '''RUN directory''' using the '''cd command.'''
 
|-
 
|-
 
|| Only Narration  
 
|| Only Narration  
|| Now, let’s '''run''' the same '''case''' with the '''k-omegaSST''' '''turbulence model.'''
+
|| Now, let’s '''run''' the same '''case''' with the '''k-omegaSST turbulence model.'''
 
|-
 
|-
 
|| Slide: K-omegaSST turbulence model
 
|| Slide: K-omegaSST turbulence model
|| The''' K-omega SST turbulence model''' is a '''hybrid '''model.
+
|| The''' K-omega SST turbulence model''' is a '''hybrid model'''.
 
In the '''near-wall '''region, '''K-omegaSST''' uses the '''K-omega turbulence model.'''
 
In the '''near-wall '''region, '''K-omegaSST''' uses the '''K-omega turbulence model.'''
  
In the region away from the '''wall''', it switches to the '''K-epsilon''' '''turbulence model'''.
+
In the region away from the '''wall''', it switches to the '''K-epsilon turbulence model'''.
  
 
Please refer to the '''Additional Reading Material''' on this tutorial page for details.
 
Please refer to the '''Additional Reading Material''' on this tutorial page for details.
Line 292: Line 316:
 
|| [Terminal] Type:
 
|| [Terminal] Type:
 
'''cp -r ~/Downloads/komegasst .'''
 
'''cp -r ~/Downloads/komegasst .'''
|| Copy the downloaded file into the '''Run directory.'''
+
|| Copy the downloaded file into the '''RUN directory.'''
 +
 
 
To do that, type the following '''command '''in the '''terminal.'''
 
To do that, type the following '''command '''in the '''terminal.'''
 
|-
 
|-
 
|| [Terminal] Type: '''cd komegasst'''
 
|| [Terminal] Type: '''cd komegasst'''
|| Navigate to the '''komegasst '''directory using the '''cd command.'''  
+
|| Navigate to the '''komegasst directory''' using the '''cd command.'''  
 
|-
 
|-
 
|| Only Narration  
 
|| Only Narration  
 
|| '''komega''' and '''komegasst models''' use the same''' turbulence variables'''.
 
|| '''komega''' and '''komegasst models''' use the same''' turbulence variables'''.
Hence, the files in the '''0''' directory are the same.
+
 
 +
Hence, the files in the '''zero''' directory are the same.
 
|-
 
|-
 
|| [Terminal] Type:
 
|| [Terminal] Type:
 
'''gedit constant/turbulenceProperties'''
 
'''gedit constant/turbulenceProperties'''
|| Open the '''turbulence''' properties file in a '''text editor.'''
+
|| Open the '''turbulence properties''' file in a '''text editor.'''
 
|-
 
|-
 
|| [gedit -'''turbulenceProperties''']
 
|| [gedit -'''turbulenceProperties''']
 
Highlight '''kOmegaSST'''
 
Highlight '''kOmegaSST'''
 
|| '''RASModel field''' entry is set to '''kOmegaSST.'''
 
|| '''RASModel field''' entry is set to '''kOmegaSST.'''
 +
 
Note,''' O''' and''' SST''' are capitalized here.
 
Note,''' O''' and''' SST''' are capitalized here.
 
|-
 
|-
Line 327: Line 354:
 
|-
 
|-
 
|| Only Narration
 
|| Only Narration
|| This enables the calculation of the '''distance '''between the '''cell centre''' and the nearest '''wall.'''
+
|| This enables the calculation of the distance between the '''cell centre''' and the nearest '''wall.'''
 
|-
 
|-
 
|| [gedit -'''fvSchemes'''] Close Text Editor
 
|| [gedit -'''fvSchemes'''] Close Text Editor
Line 337: Line 364:
 
|-
 
|-
 
|| [Terminal] Type: '''blockMesh'''
 
|| [Terminal] Type: '''blockMesh'''
|| '''Mesh''' the '''geometry''' using the '''blockMesh command '''on the '''terminal.'''
+
|| '''Mesh''' the geometry using the '''blockMesh command '''on the '''terminal.'''
 
|-
 
|-
 
|| [Terminal] Type: '''simpleFoam'''
 
|| [Terminal] Type: '''simpleFoam'''
Line 347: Line 374:
 
|| Show slide
 
|| Show slide
 
Exit velocity profile - comparison
 
Exit velocity profile - comparison
|| The slide shows the''' exit velocity''' '''profile''' for all three '''turbulence models'''
+
|| The slide shows the''' exit velocity profile''' for all three '''turbulence models'''
 
|-
 
|-
 
|| Only Narration
 
|| Only Narration
Line 362: Line 389:
 
|| As an assignment:
 
|| As an assignment:
 
* Repeat the '''simulation''' for a '''YPlus''' value of '''250 '''using '''k-epsilon''' '''model'''
 
* Repeat the '''simulation''' for a '''YPlus''' value of '''250 '''using '''k-epsilon''' '''model'''
* Repeat the''' simulation '''for a '''velocity''' of '''40 m/s''' using '''k-omega''' and '''k-omega SST model'''
+
* Repeat the''' simulation '''for a '''velocity''' of '''40 metres per second''' using '''k-omega''' and '''k-omega SST model'''
 
|-
 
|-
 
|| Slide: About the Spoken Tutorial Project
 
|| Slide: About the Spoken Tutorial Project
 
|| The video at the following link summarises the Spoken Tutorial project.
 
|| The video at the following link summarises the Spoken Tutorial project.
 +
 
Please download and watch it.
 
Please download and watch it.
 
|-
 
|-
 
|| Slide: Spoken Tutorial Workshops
 
|| Slide: Spoken Tutorial Workshops
 
|| We conduct workshops using Spoken Tutorials and give certificates.
 
|| We conduct workshops using Spoken Tutorials and give certificates.
 +
 
Please contact us.
 
Please contact us.
 
|-
 
|-
 
|| Slide: Spoken Tutorial Forum
 
|| Slide: Spoken Tutorial Forum
||  
+
|| Please post your timed queries in this forum.
* Please post your timed queries in this forum.
+
 
|-
 
|-
 
|| Slide: FOSSEE Forum
 
|| Slide: FOSSEE Forum
Line 389: Line 417:
 
|| 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 Padmini.
 
The script for this tutorial is contributed by Padmini.
 +
 
And this is Swetha Sridhar from IIT Bombay signing off.
 
And this is Swetha Sridhar from IIT Bombay signing off.
 
Thanks for joining.
 
Thanks for joining.
 
|-
 
|-
 
|}
 
|}

Latest revision as of 13:09, 17 September 2020

Title of the script: Turbulence Modelling in OpenFOAM

Author: Padmini Priyadarshini

Keywords: OpenFOAM, Turbulence, YPlus, K-Omega, K-OmegaSST, Paraview, Video-Tutorial


Visual Cue Narration
Slide: Opening Slide Welcome to this tutorial on Turbulence Modelling in OpenFOAM.
Slide: Learning Objective In this tutorial, we will learn how to,
  • Set up the blockMeshDict dictionary for a given YPlus value
  • Implement k-omega and k-omega SST turbulence models
  • Run the simulation
Slide: System Specifications To record this tutorial, I am using,
  • Linux Mint OS version 18.3
  • OpenFOAM version 7
  • ParaView version 5.6.0
  • gedit Text Editor

However, you may use any other text editor of your choice.

The steps explained in this tutorial are identical in Ubuntu Linux OS.

Slide: Prerequisites As a prerequisite:
  • You should have basic knowledge of geometric progression
  • You should be familiar with simulating a turbulent flow through a channel and
  • You should also be familiar with Multi-block Meshing of 2D geometry
  • If 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: Solver detail We will use the simpleFoam solver to simulate this problem.

simpleFoam is a steady-state solver for incompressible, turbulent flow.

Slide: Problem statement The diagram shows a 2D channel of length 65 metres and width 1 metre.

The kinematic viscosity is 1e to the power of minus 5 metres per second.

The Inlet velocity is 20 metres per second.

Outlet pressure is set to zero atmosphere.

Slide: Flow Properties Reynolds number is 2 million.


The flow is turbulent.

Only Narration First, We will use k-epsilon turbulence model to simulate this case.

Let us set up the case.

Only Narration Download the kepsilon folder provided in the Code files link and extract it.
CTRL + ALT + T Open the terminal by pressing Ctrl, Alt & T keys.
Only Narration Here onwards, please remember to press the Enter key after typing each command in the terminal.
[Terminal] Type: cd $FOAM_RUN Open the Run directory by typing this command.
[Terminal]

Type: cp -r ~/Downloads/kepsilon .

Copy the downloaded file into the RUN directory.

To do that, type the following command.

Only Narration I have downloaded the file into the Downloads directory.

Please change the command according to the file path on your machine.

[Terminal] Type: cd kepsilon Navigate to the kepsilon directory.
[Terminal] Type:

gedit system/blockMeshDict

Open the blockMeshDict file in a text editor.
[gedit -blockMeshDict]

Highlight blocks

Scroll down to the keyword “blocks”.
[gedit -blockMeshDict]

Highlight hex .... (1 0.18 1);

The domain has two equal-sized blocks.
[gedit -blockMeshDict]

Highlight 75 30

For each block, the cell number is set to 75 in the x-direction, and 30 in the y-direction.
Slide: Wall distance, yp Let “yp” be the distance between the wall and the nearest cell centre.

For our case, yp is 0.0031 for YPlus value of 200.

For channel flow, the skin friction coefficient, Cf, is given by this formula.

Slide: Cell width The width of the cell near the wall is 0.0062.
Slide: Expansion ratio The expansion ratio is the ratio of the last cell width to the first cell width.
Slide: Expansion ratio calculation It is calculated using geometric progression formula.

Please refer to the Additional Reading Material for more details.

Slide: Expansion ratio value The expansion ratio in the +y direction is found to be
  • 5.57 for block 1, and
  • 0.18 for block 2
  • for a block of width of 0.5 m and cell number 30.


Please refer to the Additional Reading Material on this tutorial page for details.

Only Narration I have already put these values into the blockMeshDict file.
[gedit -blockMeshDict]

Highlight simpleGrading

simpleGrading describes the uniform expansion ratio in x, y, and z-directions.
Only Narration For our case, the expansion ratio in the y-direction is
[gedit -blockMeshDict]

Highlight 5.57

5.57 for block 1
[gedit -blockMeshDict]

Highlight 0.18

0.18 for block 2
[gedit - blockMeshDict] Close Text Editor Close the blockMeshDict file.
Only Narration The case is now ready to be run.
[Terminal] Type: blockMesh On the terminal, type blockMesh to mesh the geometry.
[Terminal] Type:

simpleFoam

Then type simpleFoam in the terminal to run the simulation.
Only Narration The simulation will take some time depending on your computer’s hardware.
[Terminal] Highlight End The simulation is complete.
Only Narration Let's check the final value of YPlus.
[Terminal] Type:

simpleFoam -postProcess -func "yPlus" -latestTime

Now type the following command on the terminal to get the YPlus value on the walls.
[Terminal]

Highlight Patch to 214.786

We can see that the YPlus value stays below 300.
[Terminal] Type: cd .. Let us go back to the RUN directory using the cd command.
Only Narration Let us simulate the same problem using the k-omega turbulence model now.
Slide: K-Omega turbulence model k-omega is a two-equation model.

It solves-

  • The turbulent kinetic energy transport equation, and
  • The specific turbulent dissipation rate transport equation
Slide: Inlet Boundary Condition - omega Let's look at the boundary and initial conditions for omega.

We will use turbulentMixingLengthFrequencyInlet

It calculates omega using kappa and user-specified mixing length.

Mixing length refers to the turbulent length scale.

Kappa value is automatically put in by the solver.

Here, the value of turbulent length scale is 0.07 metres

The specific turbulent dissipation rate value is 16.67 second inverse

Where empirical constant, cmu is equal to 0.09

Slide: Wall & Outlet Boundary Condition - omega Wall boundary condition is set to omegaWallFunction.

zeroGradient boundary condition is imposed at the outlet.

Please refer to the Additional Reading Material on this tutorial page for details.

Only Narration Download the komega folder provided in the Code files link and extract it.
[Terminal] Type:

cp -r ~/Downloads/komega .

Copy the downloaded file into RUN directory.

To do that, type the following command in the terminal.

[Terminal] Type:

cd komega

Navigate to the komega directory using the cd command.
Only Narration Let’s take a look at the specific turbulent dissipation rate file.
[Terminal] Type: gedit 0/omega Open the omega file in a text editor.
[gedit -omega]

Highlight internalField ... 16.67;

The internalField value is initialised as 16.67
[gedit -omega]

Highlight type turbulentMixingLengthFrequencyInlet

The inlet boundary type is set to turbulentMixingLengthFrequencyInlet
[gedit -omega]

Highlight mixingLength 0.07;

The keyword mixingLength represents the Turbulent length scale, and is set to 0.07
[gedit -omega]

Highlight value $internalField;

We have passed the internalField value to the patch field value.
[gedit -omega] Highlight zeroGradient The outlet patch type is set to zeroGradient.
[gedit -omega]

Highlight omegaWallFunction

The wall patch type is set to omegaWallFunction.
[gedit -omega] Close Text Editor Close the omega file.
[Terminal] Type:

gedit constant/turbulenceProperties

Open the turbulenceProperties file in a text editor.
[gedit -turbulenceProperties]

Highlight kOmega

kOmega is selected as the RASModel.

Note, O is capitalized here.

[gedit -turbulenceProperties]

Highlight on

Ensure the keyword turbulence is set to On.
[gedit -turbulenceProperties]

Close Text Editor

Close the turbulenceProperties file.
Only Narration The case is now ready to be run.
[Terminal] Type: blockMesh On the terminal, type blockMesh to mesh the geometry.
[Terminal] Type: simpleFoam Now, type the following command to run the case.
[Terminal] Highlight End The simulation is over.
[Terminal] Type: cd .. Let us go back to the RUN directory using the cd command.
Only Narration Now, let’s run the same case with the k-omegaSST turbulence model.
Slide: K-omegaSST turbulence model The K-omega SST turbulence model is a hybrid model.

In the near-wall region, K-omegaSST uses the K-omega turbulence model.

In the region away from the wall, it switches to the K-epsilon turbulence model.

Please refer to the Additional Reading Material on this tutorial page for details.

Only Narration Download the komegasst folder provided in the Code files link and extract it.
[Terminal] Type:

cp -r ~/Downloads/komegasst .

Copy the downloaded file into the RUN directory.

To do that, type the following command in the terminal.

[Terminal] Type: cd komegasst Navigate to the komegasst directory using the cd command.
Only Narration komega and komegasst models use the same turbulence variables.

Hence, the files in the zero directory are the same.

[Terminal] Type:

gedit constant/turbulenceProperties

Open the turbulence properties file in a text editor.
[gedit -turbulenceProperties]

Highlight kOmegaSST

RASModel field entry is set to kOmegaSST.

Note, O and SST are capitalized here.

[gedit -turbulenceProperties]

Close Text Editor

Close the turbulenceProperties file.
[Terminal] Type:

gedit system/fvSchemes

Open fvSchemes dictionary in a text editor.
Only Narration Scroll down to the end of the document.
[gedit -fvSchemes]

Highlight wallDist ... ;}

wallDist sub-dictionary is included in the fvSchemes dictionary.
Only Narration This enables the calculation of the distance between the cell centre and the nearest wall.
[gedit -fvSchemes] Close Text Editor Close the fvSchemes file.
Only Narration The setup is now ready.

Let us run the simulation.

[Terminal] Type: blockMesh Mesh the geometry using the blockMesh command on the terminal.
[Terminal] Type: simpleFoam Type simpleFoam in the terminal.
[Terminal] Highlight End The simulation is finished successfully.
Show slide

Exit velocity profile - comparison

The slide shows the exit velocity profile for all three turbulence models
Only Narration With this, we have come to the end of the tutorial.

Let’s summarize.

Slide: Summary In this tutorial, we have learnt to,
  • Set up the blockMeshDict file for a given YPlus value
  • Implement k-omega and k-omega SST turbulence models
  • Run the simulation
Slide: Assignment As an assignment:
  • Repeat the simulation for a YPlus value of 250 using k-epsilon model
  • Repeat the simulation for a velocity of 40 metres per second using k-omega and k-omega SST model
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 the 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 Padmini.

And this is Swetha Sridhar from IIT Bombay signing off. Thanks for joining.

Contributors and Content Editors

Divyesh7, Nancyvarkey