Difference between revisions of "OpenFOAM-version-7/C2/Simulation-a-2D-Turbulent-Flow-in-a-Channel-using-OpenFOAM/English"
Ashleymelvin (Talk | contribs) |
Nancyvarkey (Talk | contribs) |
||
Line 36: | Line 36: | ||
|| As a prerequisite: | || As a prerequisite: | ||
* You should have basic knowledge of '''turbulent flows''' and '''fluid dynamics'''. | * You should have basic knowledge of '''turbulent flows''' and '''fluid dynamics'''. | ||
− | * You should also be familiar with '''simulating a flow through a pipe''' in '''OpenFOAM'''. | + | * You should also be familiar with '''simulating''' a '''flow''' through a '''pipe''' in '''OpenFOAM'''. |
* If not, please go through the prerequisite '''OpenFOAM''' tutorial on this website | * If not, please go through the prerequisite '''OpenFOAM''' tutorial on this website | ||
|- | |- | ||
Line 52: | Line 52: | ||
|- | |- | ||
|| Slide: Problem statement | || Slide: Problem statement | ||
− | || The diagram shows a''' 2D channel '''of | + | || The diagram shows a''' 2D channel '''of length '''65 m '''and width '''1 m'''. |
− | The '''kinematic viscosity''' is '''1e-05 m<sup>2</sup>/s.''' | + | The '''kinematic viscosity''' is '''1e-05 m<sup>2</sup>/s (1e to the power of minus 5 metre square per second).''' |
− | The '''Inlet velocity '''is '''20 | + | The '''Inlet velocity '''is '''20 metres per second. ''' |
Line 97: | Line 97: | ||
'''cd $FOAM_RUN''' | '''cd $FOAM_RUN''' | ||
− | || Let us''' '''open the ''' | + | || Let us''' '''open the '''RUN directory'''. |
Line 105: | Line 105: | ||
'''cp -r ~/Downloads/kepsilon .''' | '''cp -r ~/Downloads/kepsilon .''' | ||
− | || And copy the downloaded file into the | + | || And copy the downloaded file into the '''RUN directory'''. |
Line 119: | Line 119: | ||
'''cd kepsilon''' | '''cd kepsilon''' | ||
− | || With this command, we will navigate to the '''kepsilon''' | + | || With this '''command''', we will navigate to the '''kepsilon directory'''. |
|- | |- | ||
|| Slide: Y plus | || Slide: Y plus | ||
Line 131: | Line 131: | ||
− | For our '''case | + | For our '''case, yp''' is '''0.00155''' for a '''yplus''' value of '''100.''' |
Line 146: | Line 146: | ||
'''ls system''' | '''ls system''' | ||
− | || Type | + | || Type the following''' command''' to view the content of the '''system directory'''. |
|- | |- | ||
|| [Terminal] Highlight: | || [Terminal] Highlight: | ||
Line 152: | Line 152: | ||
'''blockMeshDict''' | '''blockMeshDict''' | ||
− | || This directory contains the '''blockMeshDict''' file. | + | || This '''directory''' contains the '''blockMeshDict''' file. |
|- | |- | ||
|| Only Narration | || Only Narration | ||
Line 170: | Line 170: | ||
− | For our '''case, turbulent intensity''' is '''0.0261 '''and '''Turbulent kinetic energy''' is '''0.41 m<sup>2</sup>/s<sup>2'''</sup> | + | For our '''case, turbulent intensity''' is '''0.0261 '''and '''Turbulent kinetic energy''' is '''0.41 m<sup>2</sup>/s<sup>2'''</sup> (metre square per second square) |
|- | |- | ||
|| Slide: Inlet Boundary Condition - epsilon | || Slide: Inlet Boundary Condition - epsilon | ||
Line 182: | Line 182: | ||
− | This calculates '''epsilon''' using '''kappa '''and | + | This calculates '''epsilon''' using '''kappa '''and user-specified '''mixingLength'''. |
− | + | ||
− | user-specified '''mixingLength'''. | + | |
Line 193: | Line 191: | ||
− | Here | + | Here, the''' turbulent length scale''' is '''0.07 m'''. |
− | And, the value of the '''turbulent dissipation rate''' is '''0.61 m<sup>2</sup>/s<sup>3'''</sup> | + | And, the value of the '''turbulent dissipation rate''' is '''0.61 m<sup>2</sup>/s<sup>3'''</sup> (metre square per seconds cube) |
|- | |- | ||
|| Slide: Wall Boundary Condition | || Slide: Wall Boundary Condition | ||
− | || Next, let us take a look at the | + | || Next, let us take a look at the '''wall boundary conditions '''to be used. |
Line 209: | Line 207: | ||
− | '''zeroGradient boundary condition''' is imposed at the '''outlet '''for both parameters. | + | '''zeroGradient boundary condition''' is imposed at the '''outlet '''for both '''parameters'''. |
|- | |- | ||
|| Slide: Kinematic eddy viscosity, nut | || Slide: Kinematic eddy viscosity, nut | ||
Line 221: | Line 219: | ||
|- | |- | ||
|| Only Narration | || Only Narration | ||
− | || The '''Additional Reading Material''' has more details on the boundary conditions. | + | || The '''Additional Reading Material''' has more details on the '''boundary conditions'''. |
Line 251: | Line 249: | ||
'''intensity 0.0261;''' | '''intensity 0.0261;''' | ||
− | || The | + | || The '''keyword intensity '''represents the '''turbulent intensity''', and is set to '''0.0261''' |
|- | |- | ||
− | || [gedit -'''k'''] Highlight: | + | || [gedit -'''k'''] Highlight: |
Line 269: | Line 267: | ||
'''kqRWallFunction''' | '''kqRWallFunction''' | ||
− | || The '''patch''' | + | || The '''patch type''' for both walls are set to '''kqRWallFunction'''. |
|- | |- | ||
|| [gedit -'''k'''] Highlight: | || [gedit -'''k'''] Highlight: | ||
Line 275: | Line 273: | ||
'''value $internalField; ''' | '''value $internalField; ''' | ||
− | || The''' internalField''' value is passed to the '''patch field '''value | + | || The''' internalField''' value is passed to the '''patch field '''value. |
|- | |- | ||
− | || [gedit -'''k'''] Highlight: | + | || [gedit -'''k'''] Highlight: |
Line 305: | Line 303: | ||
'''turbulentMixingLengthDissipationRateInlet''' | '''turbulentMixingLengthDissipationRateInlet''' | ||
− | || The '''inlet''' | + | || The '''inlet type''' is defined as '''turbulentMixingLengthDissipationRateInlet''' |
|- | |- | ||
|| [gedit -'''epsilon'''] Highlight: | || [gedit -'''epsilon'''] Highlight: | ||
Line 317: | Line 315: | ||
'''$internalField''' | '''$internalField''' | ||
− | || The '''internalField''' value is passed to the '''patch field '''value | + | || The '''internalField''' value is passed to the '''patch field '''value. |
|- | |- | ||
|| [gedit -'''epsilon'''] Highlight: | || [gedit -'''epsilon'''] Highlight: | ||
Line 361: | Line 359: | ||
|| Next, open the '''velocity '''file in a '''text editor.''' | || Next, open the '''velocity '''file in a '''text editor.''' | ||
|- | |- | ||
− | || [gedit -'''U'''] Highlight: | + | || [gedit -'''U'''] Highlight: |
Line 367: | Line 365: | ||
|| The '''inlet patch''' is given a fixed value of '''20 '''along the axis. | || The '''inlet patch''' is given a fixed value of '''20 '''along the axis. | ||
|- | |- | ||
− | || [gedit -'''U'''] Highlight: | + | || [gedit -'''U'''] Highlight: |
Line 383: | Line 381: | ||
'''blockMesh''' | '''blockMesh''' | ||
− | || Type '''blockMesh''' to '''mesh''' the | + | || Type '''blockMesh''' to '''mesh''' the geometry. |
|- | |- | ||
|| [Terminal] Type: | || [Terminal] Type: | ||
Line 394: | Line 392: | ||
|| 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: | + | || [Terminal] Highlight: |
'''End''' | '''End''' | ||
− | || The word '''End''' indicates that the ''' | + | || The word '''End''' indicates that the '''simulation''' has finished successfully. |
|- | |- | ||
|| Slide: Outlet Velocity Profile | || Slide: Outlet Velocity Profile | ||
Line 427: | Line 425: | ||
|- | |- | ||
|| Slide: Spoken Tutorial Workshops | || Slide: Spoken Tutorial Workshops | ||
− | || We conduct workshops using | + | || We conduct workshops using spoken tutorials and give certificates. |
Line 442: | Line 440: | ||
|| 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. |
Revision as of 20:07, 29 July 2020
Title of the script: Simulation of a Turbulent Flow in a 2D Channel using OpenFOAM
Author: Padmini Priyadarshini
Keywords: OpenFOAM, Turbulence, k-epsilon, yplus, expansion ratio, blockMesh, wall function, channel flow, simpleFoam, ParaView, video tutorial
Visual Cue | Narration |
Slide: Opening Slide | Welcome to this tutorial on Simulation of Turbulent Flow in a 2D Channel using OpenFOAM. |
Slide: Learning Objective | In this tutorial, we will learn how to:
|
Slide: System Specifications | To record this tutorial, I am using,
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:
|
Slide: Code Files |
|
Slide: Solver detail | We will use the simpleFoam solver to simulate this problem.
|
Slide: Problem statement | The diagram shows a 2D channel of length 65 m and width 1 m.
|
Slide: Flow Properties | Reynolds number is 2 million.
|
Slide: K-Epsilon turbulence model | K-epsilon is a widely used RAS turbulence model.
|
Only Narration | Let us set up the case. |
Only Narration | Download the kepsilon folder provided in the Code file and extract it. |
CTRL + ALT + T | Open the terminal by pressing Ctrl, Alt & T keys. |
[Terminal]
Only Narration |
From now onwards please remember to press the Enter key after typing each command in the Terminal. |
[Terminal] Type:
cd $FOAM_RUN |
Let us open the RUN directory.
|
[Terminal] Type:
cp -r ~/Downloads/kepsilon . |
And copy the downloaded file into the RUN directory.
|
Only Narration | I have downloaded the file into my Downloads directory.
|
[Terminal] Type:
cd kepsilon |
With this command, we will navigate to the kepsilon directory. |
Slide: Y plus | YPlus is the dimensionless wall distance.
|
Slide: Wall distance, yp | Let “yp” be the distance between the wall and the nearest cell centre.
|
Only Narration | The Additional Reading Material has more details on the wall function approach.
|
[Terminal] Type:
|
Type the following command to view the content of the system directory. |
[Terminal] Highlight:
|
This directory contains the blockMeshDict file. |
Only Narration | I have already set up the blockMesh file for a 2D multi-block channel with this yp value. |
Only Narration | Let us take a look at the initial and boundary conditions of the flow variables. |
Slide: Inlet Boundary Condition - k | Let us take a look at the inlet boundary condition for kappa.
|
Slide: Inlet Boundary Condition - epsilon
|
Let us take a look at the inlet boundary condition for epsilon.
|
Slide: Wall Boundary Condition | Next, let us take a look at the wall boundary conditions to be used.
|
Slide: Outlet Boundary Condition | This slide shows the outlet boundary condition.
|
Slide: Kinematic eddy viscosity, nut | Kinematic eddy viscosity is a dependent variable.
|
Only Narration | The Additional Reading Material has more details on the boundary conditions.
|
[Terminal] Type:
|
Open the k file in a text editor. |
[gedit -k] Highlight:
|
The internalField is initialised as 0.41 |
[gedit -k] Highlight:
|
The inlet boundary type is set to turbulentIntensityKineticEnergyInlet |
[gedit -k] Highlight:
|
The keyword intensity represents the turbulent intensity, and is set to 0.0261 |
[gedit -k] Highlight:
|
We have passed the internalField value to the patch field value. |
[gedit -k] Highlight:
|
outlet is set to zeroGradient. |
[gedit -k] Highlight:
|
The patch type for both walls are set to kqRWallFunction. |
[gedit -k] Highlight:
|
The internalField value is passed to the patch field value. |
[gedit -k] Highlight:
|
The frontAndBack patch is set as empty. |
[gedit - k] Close Text Editor | Close the k file. |
Only Narration | Let’s take a look at the epsilon file. |
[Terminal] Type:
|
Open the epsilon file in a text editor. |
[gedit -epsilon] Highlight:
|
The internalField value is initialized to 0.61 |
[gedit -epsilon] Highlight:
|
The inlet type is defined as turbulentMixingLengthDissipationRateInlet |
[gedit -epsilon] Highlight:
|
The field mixingLength is set to 0.07 |
[gedit -epsilon] Highlight:
|
The internalField value is passed to the patch field value. |
[gedit -epsilon] Highlight:
|
The outlet patch is defined as zeroGradient. |
[gedit -epsilon] Highlight:
|
The wall patch type is set to epsilonWallFunction. |
[gedit - epsilon] Close Text Editor | Close the epsilon file. |
[Terminal] Type:
|
Now, let’s open the nut file in a text editor. |
[gedit -nut] Highlight:
|
The inlet and outlet patches are set to calculated. |
[gedit -nut] Highlight:
|
The wall patch type is set as nutkWallFunction. |
[gedit - nut] Close Text Editor | Close the nut file. |
[Terminal] Type:
|
Next, open the velocity file in a text editor. |
[gedit -U] Highlight:
|
The inlet patch is given a fixed value of 20 along the axis. |
[gedit -U] Highlight:
|
The outlet patch is set to zeroGradient. |
[gedit -U] Close Text Editor | Close the U file. |
Only Narration | The case is ready to be run. |
[Terminal] Type:
|
Type blockMesh to mesh the geometry. |
[Terminal] Type:
|
Type simpleFoam in the terminal. |
Only Narration | The simulation will take some time depending on your computer’s hardware. |
[Terminal] Highlight:
|
The word End indicates that the simulation has finished successfully. |
Slide: Outlet Velocity Profile | The slide shows the velocity profile at the channel exit. |
Only Narration | With this we have come to the end of the tutorial.
|
Slide: Summary | In this tutorial, we learnt to,
|
Slide: Assignment | As an assignment:
|
Slide: About the Spoken Tutorial Project | The video at the following link summarises the Spoken Tutorial project.
|
Slide: Spoken Tutorial Workshops | We conduct workshops using spoken tutorials and give certificates.
|
Slide: Spoken Tutorial Forum | Please post your timed queries in this forum. |
Slide: FOSSEE Forum |
|
Slide: FOSSEE Case Study Project |
|
Slide: Spoken Tutorial | The Spoken Tutorial project is supported by MHRD, Govt. of India.
|