All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
Aim:-The aim of this project is to create the geometry for incompressible cavity flowproblem in OpenFOAM and also to simulate the flow through a backward facing step fordifferent grading factor using icoFOAM solver.OpenFOAM code:-● BlockMeshDict File:-In the following code we have created the required geometryfor grading…
Aditya Iyer
updated on 26 Sep 2021
Aim:-The aim of this project is to create the geometry for incompressible cavity flow
problem in OpenFOAM and also to simulate the flow through a backward facing step for
different grading factor using icoFOAM solver.
OpenFOAM code:-
● BlockMeshDict File:-In the following code we have created the required geometry
for grading factor 0.2 & we also we have assign the boundary condition.This we
did in the blockMeshDict file of system folder in cavity tutorial.
/*--------------------------------*- C++
-*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 7
\\/ M anipulation |
\*------------------------------------------------------------------------
---*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* //
convertToMeters 1;
vertices
(
(0 0 0)
(1 0.08 0 0)
(0.08 0.005 0)
(0 0.005 0)
(0.08 0.01 0)
(0 0.01 0)
(0.2 0.01 0)
(0.2 0.005 0)
(0.2 0 0)
(0.2 -0.01 0)
(0.08 -0.01 0)
(0 0 0.001)
(0.08 0 0.001)
(0.08 0.005 0.001)
(0 0.005 0.001)
(0.08 0.01 0.001)
(0 0.01 0.001)
(0.2 0.01 0.001)
(0.2 0.005 0.001)
(0.2 0 0.001)
(0.2 -0.01 0.001)
(0.08 -0.01 0.001)
);
blocks
(
hex (0 1 2 3 11 12 13 14) (200 10 1) simpleGrading (0.2 1.2 1)
hex (3 2 4 5 14 13 15 16) (200 10 1) simpleGrading (0.2 0.2 1)
hex (2 7 6 4 13 18 17 15) (200 10 1) simpleGrading (1.2 0.2 1)
hex (1 8 7 2 12 19 18 13) (200 10 1) simpleGrading (1.2 1.2 1)
hex (10 9 8 1 21 20 19 12) (200 10 1) simpleGrading (1.2 0.2 1)
);
edges
(
);
boundary
(
inlet
{
type patch;
faces
(
(0 11 14 3)
(3 14 16 5)
);
}
outlet
{
type patch;
faces
(
(9 8 19 20)
(8 7 18 19)
(7 6 17 18)
);
}
frontAndBack
{
type empty;
faces
(
(0 3 2 1)
(3 5 4 2)
(10 1 8 9)
(1 2 7 8)
(2 4 6 7)
(11 12 13 14)
(14 13 15 16)
(21 20 19 12)
(12 19 18 13)
(13 18 17 15)
);
}
noslipwalls
{
type wall;
faces
(
(5 16 15 4)
(4 15 17 6)
(0 1 12 11)
(10 21 12 1)
(10 9 20 21)
);
}
);
mergePatchPairs
(
);
//
*************************************************************************
//
● ControlDict File:-In the following code we have to assign the start time, end time as
well as a time step. This we did in the controlDict file of the system folder in the cavity
tutorial.
/*--------------------------------*- C++
-*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 7
\\/ M anipulation |
\*------------------------------------------------------------------------
---*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* //
application icoFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 0.01;
deltaT 1.33e-5;
writeControl timeStep;
writeInterval 20;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
//
*************************************************************************
//
● Velocity File:-In the following code we have assigned the value for velocity for
boundary conditions and also for different patchs. This we did in the U file of
the constant folder in the cavity tutorial.
/*--------------------------------*- C++
-*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 7
\\/ 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
{
moving wall
{
type fixedValue;
value uniform (1.5 0 0);
}
outlet
{
type zeroGradient;
}
frontAndBack
{
type empty;
}
noslipwalls
{
type fixedValue;
value uniform(0 0 0);
}
}
//
*************************************************************************
//
● Pressure File:-In the following code we have assigned the value for pressure for
boundary conditions and aslo for different patchs. This we did in the p file of
the constant folder in the cavity tutorial.
/*--------------------------------*- C++
-*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 7
\\/ 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;
}
frontAndBack
{
type empty;
}
noslipwalls
{
type zeroGradient;
}
}
//
*************************************************************************
//
Results:-
● The following image shows the Mesh
● For grading factor=0.2
Velocity profile:-
Line Plot:-
● Mesh Code for grading factor=0.5
blocks
(
hex (0 1 2 3 11 12 13 14) (200 10 1) simpleGrading (0.5 2 1)
hex (3 2 4 5 14 13 15 16) (200 10 1) simpleGrading (0.5 0.5 1)
hex (2 7 6 4 13 18 17 15) (200 10 1) simpleGrading (2 0.5 1)
hex (1 8 7 2 12 19 18 13) (200 10 1) simpleGrading (2 2 1)
hex (10 9 8 1 21 20 19 12) (200 10 1) simpleGrading (2 5 1)
);
Velocity profile:-
● Mesh Code for grading factor=0.8
blocks
(
hex (0 1 2 3 11 12 13 14) (200 10 1) simpleGrading (0.8 2 1)
hex (3 2 4 5 14 13 15 16) (200 10 1) simpleGrading (0.8 0.8 1)
hex (2 7 6 4 13 18 17 15) (200 10 1) simpleGrading (2 0.8 1)
hex (1 8 7 2 12 19 18 13) (200 10 1) simpleGrading (2 2 1)
hex (10 9 8 1 21 20 19 12) (200 10 1) simpleGrading (2 0.8 1)
);
Velocity profile:-
Line Plot:-
● Mesh Code for grading factor=1
blocks
(
hex (0 1 2 3 11 12 13 14) (200 10 1) simpleGrading (1 1 1)
hex (3 2 4 5 14 13 15 16) (200 10 1) simpleGrading (1 1 1)
hex (2 7 6 4 13 18 17 15) (200 10 1) simpleGrading (1 1 1)
hex (1 8 7 2 12 19 18 13) (200 10 1) simpleGrading (1 1 1)
hex (10 9 8 1 21 20 19 12) (200 10 1) simpleGrading (1 1 1)
);
Velocity profile:-
Line Plot:-
● Comparison of velocity contour for different grading factors:-
Conclusion:-
● Line plot:-All above line plots is been obtained at x=0.085 & y=0.01, we get
different plots for different grading factors at the same location.
● Velocity contour:-All above velocity contour is obtained for different grading factor
like at 1,0.2,0.5 and 0.8.
● And also after observing the above comparison we can conclude that grading
factor affects the results. Finer grading factor at the wall create more clear
simulation.
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 3 - Adiabatic Flame Temperature calculation
AIM: To use Python and the Cantera library to understand the factors affecting the adiabatic flame temperature. OBJECTIVE: To write a Python script to see the variance of equivalence ratio and adiabatic flame temperature. Using the Cantera library to do the same and observe the differences. Varying the heat…
01 Jul 2023 04:43 PM IST
Week 9 - FVM Literature Review
Aim:- To discuss different types of Interpolation schemes and Flux Limiters used infinite volume method.Interpolation Schemes in Finite Volume Method:-1. Upwind Interpolation Scheme(UDS)2. Central Differencing Schemes(CDS)3. Quadratic Upwind Differencing Scheme(QUICK)4. Hybrid Interpolation Scheme(HIS)5. Total Variation…
26 Sep 2021 03:30 PM IST
Week 8 - Simulation of a backward facing step in OpenFOAM
Aim:-The aim of this project is to create the geometry for incompressible cavity flowproblem in OpenFOAM and also to simulate the flow through a backward facing step fordifferent grading factor using icoFOAM solver.OpenFOAM code:-● BlockMeshDict File:-In the following code we have created the required geometryfor grading…
26 Sep 2021 03:15 PM IST
Week 7 - Simulation of a 1D Super-sonic nozzle flow simulation using Macormack Method
Aim:- Simulation of a 1D Super-sonic nozzle flow using Macormack Method forconservative form as well as for non-conservative form.Discretization:-The process of converting the PDE equation into algebric equation isbasically discretization.Now, here in this step, we will use the Mccormack method to solve it.Boundary conditions:-…
26 Sep 2021 03:05 PM 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.