All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
Aim: Simulation of a flow over the backward-facing step in OpenFOAM Abstract: Backward facing step (known as BFS) is widely known for its application on turbulence in internal flows. The flow separation is caused due to the sudden changes in geometry which will be evident as the blockmesh file creates the geometry.…
Faizan Akhtar
updated on 15 Mar 2021
Aim: Simulation of a flow over the backward-facing step in OpenFOAM
Abstract: Backward facing step (known as BFS) is widely known for its application on turbulence in internal flows. The flow separation is caused due to the sudden changes in geometry which will be evident as the blockmesh file creates the geometry. This causes a zone of recirculation and a point of flow reattachment. The present numerical study describes the variation of velocity at a distance of 0.085 m from the inlet.
The behavior of the velocity graph is observed while changing the mesh from 20 to 200 (along the x-axis), from 10 to 20 (along with the y axis), and grading factor from 1 to 0.2 (along the x and y-axis).
Coding procedure in OpenFoam
Geometry creation
The profile under consideration has been converted into five blocks as shown in figure
The vertices have been indexed from the backside of the block to the front side. Since OpenFoam uses C++ so indexing starts from zero.
As per the given figure, there are a total of 21 vertices. The zero vertice has a coordinate of (0, 0, 0), the total length of the domain is 0.20 meter (along X-axis), the length along(y-axis) is 0.01 meter.
Accordingly, coordinate points of all the 21 vertices have been listed in the blockMesh file.
Block generation
For defining the blocks we need to define the right order of vertices.
Let us take block number 1, it will be hex(0 1 2 3 11 12 13 14) (20 10 1) simplegrading(1 1 1). The orientation of the vertices is complying with the flow direction. If we would have taken in opposite order the result will be different. The second bracket defines the number of grid points along the x,y, z-axis. The third bracket defines the technique known as mesh stretching.
Accordingly, the rest of the blocks are created in the same way.
Grading factor = (Size of end cell)/(Size of starting cell)
If the grading factor is 0.2 which means the size of the end cell is smaller than the size of starting cell.
If the grading factor is 10 which means the size of the end cell is greater than the size of starting cell.
If the grading factor is 1 which means the size of the end cell is equal to the size of starting cell.
Thus, the grading factor gives the finer mesh at the boundary to get proper flow conditions.
Boundary condition
There are four boundary condition in the given profile viz:
Accordingly, faces that contribute to each boundary condition are listed in the blockMeshDict file.
The pressure and velocity profile listed inside the 0 folder is changed as per the given profile.
The value of timesteps should be taken very small owing to the CFL number. As such large time steps value will result in making up the profile unstable.
Case-1 :
/*--------------------------------*- C++ -*----------------------------------*
========= |
/ F ield | OpenFOAM: The Open Source CFD Toolbox
/ O peration | Website: https://openfoam.org
/ A nd | Version: 8
/ M anipulation |
*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 0.01;
vertices
(
(0 0 0) // 0
(8 0 0) // 1
(8 0.5 0) // 2
(0 0.5 0) //3
(8 1 0) // 4
(0 1 0) // 5
(20 1 0) // 6
(20 0.5 0) //7
(20 0 0 ) //8
(20 -1 0) //9
(8 -1 0) //10
(0 0 0.1) //11
(8 0 0.1) //12
(8 0.5 0.1)//13
(0 0.5 0.1) //14
(8 1 0.1) //15
(0 1 0.1) //16
(20 1 0.1) //17
(20 0.5 0.1) //18
(20 0 0.1) //19
(20 -1 0.1) //20
(8 -1 0.1) //21
);
blocks
(
hex (0 1 2 3 11 12 13 14) (20 10 1) simpleGrading (1 1 1)
hex (3 2 4 5 14 13 15 16) (20 10 1) simpleGrading (1 1 1)
hex (2 7 6 4 13 18 17 15) (20 10 1) simpleGrading (1 1 1)
hex (1 8 7 2 12 19 18 13) (20 10 1) simpleGrading (1 1 1)
hex (10 9 8 1 21 20 19 12) (20 10 1) simpleGrading (1 1 1)
);
edges
(
);
boundary
(
inletWall
{
type patch;
faces
(
(0 11 14 3) // anticlockwise
(3 14 16 5) // anticlockwise
);
}
outletwall
{
type patch;
faces
(
(9 8 19 20) // clockwise
(8 7 18 19) // clockwise
(7 6 17 18) // clockwise
);
}
frontAndBack
{
type empty;
faces
(
(0 3 2 1) // back clockwise
(3 5 4 2) // back clockwise
(10 1 8 9) // back clockwise
(1 2 7 8) // back clockwise
(2 4 6 7) // back clockwise
(14 11 12 13)// front anticlockwise
(16 14 13 15)// front anticlockwise
(12 21 20 19)// front anticlockwise
(13 12 19 18)// front anticlockwise
(15 13 18 17)// front anticlockwise
);
}
Noslipwalls
{
type wall;
faces
(
(6 4 15 17) // top anticlockwise
(4 5 16 15) // top anticlockwise
(10 9 20 21) // bottom clockwise
(11 0 1 12) // bottom clockwise
(1 10 21 12) // stepsidewall anticlockwise
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application icoFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 0.5;
deltaT 0.00001;
writeControl timeStep;
writeInterval 20;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*
========= |
/ F ield | OpenFOAM: The Open Source CFD Toolbox
/ O peration | Website: https://openfoam.org
/ A nd | Version: 8
/ M anipulation |
*---------------------------------------------------------------------------*/
/*--------------------------------*- C++ -*----------------------------------*
========= |
/ F ield | OpenFOAM: The Open Source CFD Toolbox
/ O peration | Website: https://openfoam.org
/ A nd | Version: 8
/ M anipulation |
*---------------------------------------------------------------------------*/
pressure profile
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
inletWall
{
type zeroGradient;
}
outletwall
{
type fixedValue;
value uniform 0;
}
Noslipwalls
{
type zeroGradient;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*
========= |
/ F ield | OpenFOAM: The Open Source CFD Toolbox
/ O peration | Website: https://openfoam.org
/ A nd | Version: 8
/ 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
{
inletWall
{
type fixedValue;
value uniform (1 0 0);
}
outletwall
{
type zeroGradient;
}
Noslipwalls
{
type noSlip;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //
Case-2
Please note that in this case only section of the coding is represented here as the other coding algorithm is same.
blocks
(
hex (0 1 2 3 11 12 13 14) (200 20 1) simpleGrading (0.2 0.2 1)
hex (3 2 4 5 14 13 15 16) (200 20 1) simpleGrading (0.2 0.2 1)
hex (2 7 6 4 13 18 17 15) (200 20 1) simpleGrading (0.2 0.2 1)
hex (1 8 7 2 12 19 18 13) (200 20 1) simpleGrading (0.2 0.2 1)
hex (10 9 8 1 21 20 19 12) (200 20 1) simpleGrading (0.2 0.2 1)
);
Conclusion
It can be inferred from the velocity profile that a better distribution is obtained for mesh grading factor 0.2.
Also, the CFL number increases as the grading factor decreases.
The grading factor produces the finer mesh at the boundary to capture the flow condition.
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...
Week-4 : Basic Calibration of Single cylinder CI-Engine
Aim: Basic Calibration of Single cylinder CI-Engine Objective : Explore Tutorial No 1- CI final 1.Compare SI vs CI and list down differences (assignment no 2-SI) 2. Comments on the following parameters BSFC Exhaust Temperature A/F ratios 3.Change MFB 50 and observe impact on performance Introduction Difference…
11 Nov 2021 05:26 AM IST
Week 2 : Basic Calibration of Single cylinder SI-Engine
Aim: Basic Calibration of Single-cylinder SI-Engine Objective: 1. Run the case at 1800 rpm and list down important parameters (20 Marks) air flow rate BMEP BSFC In-cylinder pressure 2. Increase the power output at 3600 rpm by 10% (30 Marks) Introduction A spark-ignition engine (SI engine) is…
22 Oct 2021 07:11 AM IST
Week 1 : Exploring the GUI of GT-POWER
Aim: Exploring the GUI of GT-suite GT-suite can be used in a wide range of applications. There are several industries that are using GT-suite for various applications On-highway and off-highway vehicle Marine and rail Industrial machinery Aerospace Power generation Multiphysics platform GT-Suite has a versatile multiphysics…
12 Oct 2021 02:52 PM IST
Week 8: Literature review - RANS derivation and analysis
Aim: Literature review - RANS derivation and analysis Objective: Apply Reynolds decomposition to the NS equations and come up with the expression for Reynolds stress. Explain your understanding of the terms Reynolds stress What is turbulent viscosity? How is it different from molecular viscosity? Introduction…
01 Sep 2021 07:52 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.