All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
The main objective is to use the icoFOAM solver to simulate the flow through a backward facing step. Initially, The geometry is generated for a variation of the incompressible cavity flow problem in OpenFOAM.The mesh is generated according to the need of the structure|(i.e with or without grading). …
Om Yadav
updated on 07 Feb 2019
The main objective is to use the icoFOAM solver to simulate the flow through a backward facing step. Initially, The geometry is generated for a variation of the incompressible cavity flow problem in OpenFOAM.The mesh is generated according to the need of the structure|(i.e with or without grading).
The below-shown diagram shows the required structure to be made.
INTRODUCTION
Mesh specification
The required generated geometry is given below:
A.Ungraded:
The following are the steps to be considered while giving the shape;
1. Initially open the tutorial file in the OpenFOAM.
2. Now go to the incompressible folder and open the icoFOAM folder.
3. Go to the cavity and copy this cavity folder to the run folder hence we can edit it for shape
4. Edit the blockMeshdict file in it and enter the provided cells information to create the shape
The simulation for velocity profile for following mesh grading factor cases;
1. Ungraded mesh condition
2. f=0.8
3. f=0.4
4. f=0.2
C.Graded 0.4
/*----------------------------
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 6
\\/ M anipulation |
*-----------------------------
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
(0 0 0) // vertex 0
(0.08 0 0) // vertex 1
(0.08 0.005 0) // vertex 2
(0 0.005 0) // vertex 3
(0 0.01 0) // vertex 4
(0.08 0.01 0) // vertex 5
(0.08 -0.005 0) // vertex 6
(0.08 -0.01 0) // vertex 7
(0.2 -0.01 0) // vertex 8
(0.2 -0.005 0) // vertex 9
(0.2 0 0) // vertex 10
(0.2 0.005 0) // vertex 11
(0.2 0.01 0) // vertex 12
(0 0 0.001) // vertex 13
(0.08 0 0.001) // vertex 14
(0.08 0.005 0.001) // vertex 15
(0 0.005 0.001) // vertex 16
(0 0.01 0.001) // vertex 17
(0.08 0.01 0.001) // vertex 18
(0.08 -0.005 0.001)// vertex 19
(0.08 -0.01 0.001) // vertex 20
(0.2 -0.01 0.001) // vertex 21
(0.2 -0.005 0.001) // vertex 22
(0.2 0 0.001) // vertex 23
(0.2 0.005 0.001) // vertex 24
(0.2 0.01 0.001) // vertex 25
);
blocks
(
hex (0 1 2 3 13 14 15 16) (80 5 1) simpleGrading (0.2 0.2 1)
hex (3 2 5 4 16 15 18 17) (80 5 1) simpleGrading (0.2 0.2 1)
hex (2 11 12 5 15 24 25 18) (120 5 1) simpleGrading (5 0.2 1)
hex (1 10 11 2 14 23 24 15) (120 5 1) simpleGrading (5 0.2 1)
hex (6 9 10 1 19 22 23 14) (120 5 1) simpleGrading (5 0.2 1)
hex (7 8 9 6 20 21 22 19) (120 5 1) simpleGrading (5 0.2 1)
);
edges
(
);
boundary
(
inlet
{
type patch;
faces
(
(0 13 16 3)
(4 3 16 17)
);
}
outlet
{
type patch;
faces
(
(11 12 25 24)
(10 11 24 23)
(9 10 23 22)
(8 21 22 9)
);
}
noSlipWalls
{
type wall;
faces
(
(4 17 18 5)
(5 18 25 12)
(0 1 14 13)
(1 6 19 14)
(6 7 20 19)
(7 8 21 20)
);
}
frontAndBack
{
type empty;
faces
(
(0 3 2 1)
(3 4 5 2)
(2 5 12 11)
(1 2 11 10)
(17 16 15 18)
(16 13 14 15)
(18 15 24 25)
(15 14 23 24)
(14 19 22 23)
(19 20 21 22)
);
}
);
mergePatchPairs
(
);
// ******************************
A. FOR VELOCITY
/*--------------------------------*- C++ -*----------------------------------*
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 6
\\/ M anipulation |
*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
inlet
{
type fixedValue;
value uniform (1 0 0);
}
outlet
{
type zeroGradient;
}
fixedWalls
{
type noSlip;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //
B. PRESSURE
/*--------------------------------*- C++ -*----------------------------------*
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 6
\\/ M anipulation |
*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type fixedValue;
value uniform 0;
}
fixedWalls
{
type zeroGradient;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //
0.4 velocity
.PRESSURE 0.4
-------------------------------------------------------------------------------------
B
0.8 mesh
0.8 velocity
-------------------------------------------------------------------------------------
mesh 0.2
-------------------------------------------------------------------------------------
Result for the different mesh grade
Ungraded:
------------------------------------------------------------------------------------
AT 0.8:
------------------------------------------------------------------------------------
At 0.2
CONCLUSION:
The mesh is refined near the backward step in the object by suitably grading the mesh near the exit of the inlet. Flow quantities can be accurately predicted at the desired location by grading the mesh suitably. The finer the mesh (lower value of f), the more accurately the fluid physics can be visualized. Starting time is 0 and the ending time is 1.
Leave a comment
Thanks for choosing to leave a comment. Please keep in mind that all the comments are moderated as per our comment policy, and your email will not be published for privacy reasons. Please leave a personal & meaningful conversation.
Other comments...
Simulation of Flow through a pipe in OpenFoam part 2
Objective: Write a Matlab program that takes an angle as input and generates a blockMesh file for the given angle 10,25,45 degree. To compare the above results and discuss findings Calculation and Assumption Reynolds Number: 2100 Radius of pipe (r) :0.005 dynamics viscosity of water: 1.002 X 10^-3…
19 May 2019 05:23 AM IST
Simulation of Flow through a pipe in OpenFoam part 1
Objective: To write a program in Matlab that can generate the computational mesh automatically for any wedge angle and grading schemes To show that the velocity profile matches with the Hagen Poiseuille\'s equation For a baseline mesh To show that the velocity profile is fully developed Post process…
19 May 2019 05:22 AM IST
BlockMesh Drill down challenge
The main objective is to use the icoFOAM solver to simulate the flow through a backward facing step. Initially, The geometry is generated for a variation of the incompressible cavity flow problem in OpenFOAM.The mesh is generated according to the need of the structure|(i.e with or without grading). …
07 Feb 2019 01:44 PM IST
Simulation of a 1D Super-sonic nozzle flow simulation using Macormack Method
The objective in this project is to write code to solve the 1D supersonic nozzle flow equations using the Macormack Method. The governing equations for both conservative and nonconservative are solved and compared. Also, the iteration number and computational time are compared until the final…
01 Nov 2018 12:39 AM IST
Related Courses
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.