All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
Objective Case 1 - Simulate the flow without using any grading factor (i.e., GF = 1) Case 2 - Simulate the flow with grading factor of 0.2. The cells should be finer near the walls (includig the step wall). Theory- Here the aim is simulate an incompressible-laminar-flow through backward facing step geometry.…
Kishoremoorthy SP
updated on 03 May 2023
Objective
Case 1 - Simulate the flow without using any grading factor (i.e., GF = 1)
Case 2 - Simulate the flow with grading factor of 0.2. The cells should be finer near the walls (includig the step wall).
Theory-
Here the aim is simulate an incompressible-laminar-flow through backward facing step geometry. Accordingly need to select the solver respectively.
Solver - ICOFOAM
Futher since the solver uses PISO algorithm for continunity equa -∇⋅u=0">∇⋅u=0
Momentum equal
u-Velocity">u−Velocity& p">p-Kinematic Pressure
Procedure-
1.Generate Blockmesh
2.OpenFoam Script -
/*--------------------------------*- 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.001;
vertices
(
(0 0 0) //0
(80 0 0)//1
(80 5 0)//2
(0 5 0)//3
(0 0 1)//4
(80 0 1)//5
(80 5 1)//6
(0 5 1)//7
(200 5 1)//8
(200 0 1)//9
(200 0 0)//10
(200 5 0)//11
(0 -5 0)//12
(80 -5 0)//13
(80 -5 1)//14
(0 -5 1)//15
(200 -5 1)//16
(200 -5 0)//17
(80 -10 0)//18
(200 -10 0)//19
(200 -10 1)//20
(80 -10 1)//21
);
blocks
(
hex (0 1 2 3 4 5 6 7) (200 20 1) simpleGrading (1 1 1)
hex (1 10 11 2 5 9 8 6) (200 20 1) simpleGrading (1 1 1)
hex (12 13 1 0 15 14 5 4) (200 20 1) simpleGrading (1 1 1)
hex (13 17 10 1 14 16 9 5) (200 20 1) simpleGrading (1 1 1)
hex (18 19 17 13 21 20 16 14) (200 20 1) simpleGrading (1 1 1)
);
edges
(
);
boundary
(
Inlet
{
type patch;
faces
(
(3 0 4 7)
(0 12 15 4)
);
}
Outlet
{
type patch;
faces
(
(11 10 9 8)
(10 17 16 9)
(17 19 20 16)
);
}
fixedWalls
{
type wall;
faces
(
(3 2 6 7)
(2 11 8 6)
(12 13 14 15)
(18 19 20 21)
(13 18 21 14)
);
}
FrontAndBack
{
type empty;
faces
(
(0 3 2 1) //Front
(12 0 1 13)
(18 13 17 19)
(13 1 10 17)
(1 2 11 10)
(4 5 6 7)
(15 14 5 4)
(21 20 16 14)
(5 9 8 6)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //
/*--------------------------------*- 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;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application icoFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 0.2;
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 |
*---------------------------------------------------------------------------*/
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;
}
}
// *******************************************************************
-----------------------------------------------------------------------------------------------------------------
/*--------------------------------*- 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
{
Inlet
{
type fixedValue;
value uniform (1 0 0);
}
Outlet
{
type zeroGradient;
}
fixedWalls
{
type noSlip;
}
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 dictionary;
location "constant";
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
nu [0 2 -1 0 0 0 0] 0.001;
// ************************************************************************* //
Below is the BlockMesh created -
3. Mesh -
If we look at the below mesh. One can notice that mesh is not uniform all over the surface.Inorder to make it equal we can do the following changes-
blocks
(
hex (0 1 2 3 4 5 6 7) (80 5 1) simpleGrading (1 1 1)
hex (1 10 11 2 5 9 8 6) (120 5 1) simpleGrading (1 1 1)
hex (12 13 1 0 15 14 5 4) (80 5 1) simpleGrading (1 1 1)
hex (13 17 10 1 14 16 9 5) (120 5 1) simpleGrading (1 1 1)
hex (18 19 17 13 21 20 16 14) (120 5 1) simpleGrading (1 1 1)
);
After the making the changes, now the mesh is uniformly distributed.
3.1.Mesh from inside-
FixedEnd-
Inlet -
Results -
Case 1 - Grading factor =1
Mesh Grid
Velocity Distribution along the domain area with velocity at distance 0.085 from inlet
Velocity Plot
Pressure Distribution along the domain area
Case 2 - Grading factor 0.2(cell near Fixed walls)
Code
/*--------------------------------*- 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.001;
vertices
(
(0 0 0) //0
(80 0 0)//1
(80 5 0)//2
(0 5 0)//3
(0 0 1)//4
(80 0 1)//5
(80 5 1)//6
(0 5 1)//7
(200 5 1)//8
(200 0 1)//9
(200 0 0)//10
(200 5 0)//11
(0 -5 0)//12
(80 -5 0)//13
(80 -5 1)//14
(0 -5 1)//15
(200 -5 1)//16
(200 -5 0)//17
(80 -10 0)//18
(200 -10 0)//19
(200 -10 1)//20
(80 -10 1)//21
);
blocks
(
hex (0 1 2 3 4 5 6 7) (80 5 1) simpleGrading (0.2 0.2 1) //Block1
hex (1 10 11 2 5 9 8 6) (120 5 1) simpleGrading (5 0.2 1) //Block2
hex (12 13 1 0 15 14 5 4) (80 5 1) simpleGrading (0.2 5 1) //Block3
hex (13 17 10 1 14 16 9 5) (120 5 1) simpleGrading (5 5 1) //Block4
hex (18 19 17 13 21 20 16 14) (120 5 1) simpleGrading (5 5 1) //Block5
);
edges
(
);
boundary
(
Inlet
{
type patch;
faces
(
(3 0 4 7)
(0 12 15 4)
);
}
Outlet
{
type patch;
faces
(
(11 10 9 8)
(10 17 16 9)
(17 19 20 16)
);
}
fixedWalls
{
type wall;
faces
(
(3 2 6 7)
(2 11 8 6)
(12 13 14 15)
(18 19 20 21)
(13 18 21 14)
);
}
FrontAndBack
{
type empty;
faces
(
(0 3 2 1) //Front
(12 0 1 13)
(18 13 17 19)
(13 1 10 17)
(1 2 11 10)
(4 5 6 7)
(15 14 5 4)
(21 20 16 14)
(14 16 9 5)
(5 9 8 6)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //
Mesh generated by above Code
Velocity Distribution along domain area
Velocity Plot
Pressure Distribution along domain area
Pressure Plot
Case 2 - Grading factor 0.2(cell near All walls)
Code
/*--------------------------------*- 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.001;
vertices
(
(0 0 0) //0
(80 0 0)//1
(80 5 0)//2
(0 5 0)//3
(0 0 1)//4
(80 0 1)//5
(80 5 1)//6
(0 5 1)//7
(200 5 1)//8
(200 0 1)//9
(200 0 0)//10
(200 5 0)//11
(0 -5 0)//12
(80 -5 0)//13
(80 -5 1)//14
(0 -5 1)//15
(200 -5 1)//16
(200 -5 0)//17
(80 -10 0)//18
(200 -10 0)//19
(200 -10 1)//20
(80 -10 1)//21
);
blocks
(
hex (0 1 2 3 4 5 6 7) (80 5 1) //Block1
simpleGrading
(
(
(0.5 0.5 5)//50 y-direc, 50% cells, expansion=5
(0.5 0.5 0.2)//50 y-direc, 50% cells, expansion=0.2
)
(
(0.2 0.1 1)//20 y-direc, 10% cells, expansion=1
(0.8 0.9 0.2)//80 y-direc, 90% cells, expansion=0.2
)
1 //z-direction expansion ratio
)
hex (1 10 11 2 5 9 8 6) (120 5 1) //Block2
simpleGrading
(
(
(0.5 0.5 5) //50 y-direc, 50% cells, expansion=5
(0.5 0.5 0.2)//50 y-direc, 50% cells, expansion=0.2
)
(
(0.2 0.1 1)//20 y-direc, 10% cells, expansion=1
(0.8 0.9 0.2)//80 y-direc, 90% cells, expansion=0.2
)
1 //z-direction expansion ratio
)
hex (12 13 1 0 15 14 5 4) (80 5 1) //Block3
simpleGrading
(
(
(0.5 0.5 5)//50 y-direc, 50% cells, expansion=5
(0.5 0.5 0.2)//50 y-direc, 50% cells, expansion=0.2
)
(
(0.8 0.9 0.2)//80 y-direc, 90% cells, expansion=0.2
(0.2 0.1 1)//20 y-direc, 10% cells, expansion=1
)
1 //z-direction expansion ratio
)
hex (13 17 10 1 14 16 9 5) (120 5 1) //Block4
simpleGrading
(
(
(0.5 0.5 5)//50 y-direc, 50% cells, expansion=5
(0.5 0.5 0.2)//50 y-direc, 50% cells, expansion=0.2
)
(
(0.8 0.9 0.2)//80 y-direc, 90% cells, expansion=0.2
(0.2 0.1 1)//20 y-direc, 10% cells, expansion=1
)
1 //z-direction expansion ratio
)
hex (18 19 17 13 21 20 16 14) (120 5 1) //Block5
simpleGrading
(
(
(0.5 0.5 5)//50 y-direc, 50% cells, expansion=5
(0.5 0.5 0.2)//50 y-direc, 50% cells, expansion=0.2
)
(
(0.9 0.9 5)//90 y-direc, 90% cells, expansion=5
(0.1 0.1 1)//10 y-direc, 10% cells, expansion=1
)
1 //z-direction expansion ratio
)
);
edges
(
);
boundary
(
Inlet
{
type patch;
faces
(
(3 0 4 7)
(0 12 15 4)
);
}
Outlet
{
type patch;
faces
(
(11 10 9 8)
(10 17 16 9)
(17 19 20 16)
);
}
fixedWalls
{
type wall;
faces
(
(3 2 6 7)
(2 11 8 6)
(12 13 14 15)
(18 19 20 21)
(13 18 21 14)
);
}
FrontAndBack
{
type empty;
faces
(
(0 3 2 1) //Front
(12 0 1 13)
(18 13 17 19)
(13 1 10 17)
(1 2 11 10)
(4 5 6 7)
(15 14 5 4)
(21 20 16 14)
(14 16 9 5)
(5 9 8 6)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //
Mesh generated by above Code
Velocity Distribution along the domain area
Velocity Plot
Pressure Distribution along the domain area
Pressure Plot
Inference from above results
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 Challenge : CFD Meshing for BMW car
AIM: FOR THE GIVE MODEL, CHECK AND SOLVE ALL GEOMETRICAL ERRORS ON HALF PORTION AND ASSIGN APPROPRITATE PIDS. PERFORMS MESHING WITH GIVEN TARGET LENGTH AND ELEMENT QUALITY CRITERIA. AFTER MESHING THE HALF MODEL,DO SYMMETRY TO THE OTHER SIDE. PRODECURE: INITIALLY, OPEN THE GIVEN BMW MODEL IN ANSA SOFTWARE.…
20 Oct 2023 11:25 AM IST
Week 12 - Validation studies of Symmetry BC vs Wedge BC in OpenFOAM vs Analytical H.P equation
Aim: employing the symmetry boundary condition to simulate an axis-symmetric laminar flow through the pipe's constant cross-section. Using both symmetry and wedge boundary conditions, simulate the aforementioned angles—10, 25, and 45 degrees—and evaluate your results using HP equations. Introduction: Hagen-Poiseuille's…
04 May 2023 03:14 PM IST
Week 11 - Simulation of Flow through a pipe in OpenFoam
Aim: Simulate axisymmetric flow in a pipe through foam. Objective: Verify the hydrodynamic length using the numerical result Verify a fully developed flow rate profile with its analytical profile Verify the maximum velocity and pressure drop for fully developed flow Post-process Shear Stress and verify wall shear stress…
04 May 2023 03:04 PM IST
Week 9 - FVM Literature Review
AIM To describe the need for interpolation schemes and flux limiters in Finite Volume Method (FVM). OBJECTIVE To study and understand What is Finite Volume Method(FVM) Write down the major differences between FDM & FVM Describe the need for interpolation schemes and flux limiters in FVM INTRODUCTION …
03 May 2023 05:47 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.