Week 8 - Simulation of a backward facing step in OpenFOAM
Objective: To simulate an incompressible -laminar flow through the backward facing step using OpenFOAM.
case: 1- To simulate the flow without using any grading actor i.e. GF = 1.
case : 2- To simulate the flow with using grading factor 0.2.
The flow in which there is no change in density is called incompressible flow.
The flow in which fluid flow reguler and there is no mixing is called laminar flow.
Reynold's number is defined as the ratio of inertial force by viscous force.
Reynold's number less than 2100, the flow become laminar and if greater than 2100 then flow become turbulant.
Mesh Grading:
`text(Grading Factor) = text(size of last cell )/text( size of first cell)`
Procedure:
- At the starting inside the blockMeshDict folder convert the scale in to meters .
- Firstly we have to create the run folder in which we have to run the mesh simulation.
- We will get cavity folder in which there is three sub folder.
- After cavity folder we will find 0 , caonstant and system folder in which blockMeshDict,ControlDict,P,U,transportproperties folder we have to edit as our required problem.
- Inside blockMeshDict folder firstly vertex we have to define and blocks.
- inside blocks we have to define vetrex , axis and simple grading .
- we wil provide our required input like inlet , outlet , and walls then define the patch as a type.
- Inside controlDict folder we will provide simulation start time and end time will dellta.
- U folder having velocity parameter in which we will define velocity of the fluid.
- P folder having pressure parameter in which we will define the preesure .
- At last we will edit the transportproperties folder .
blockMeshDict File without grading
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2012 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 0.01;
vertices
(
(0 0 0) //vertex 0
(8 0 0)//vertex 1
(8 0.5 0)//vertex 2
(0 0.5 0)//vertex 3
(8 1 0)//vertex 4
(0 1 0)//vertex 5
(20 1 0)//vertex 6
(20 0.5 0)//vertex 8
(20 -1 0) //vertex 9
(8 -1 0)//vertex 10
(0 0 1)//vertex 11
(8 0 1)//vertex 12
(8 0.5 1)//vertex 13
(0 0.5 1)//vertex 14
(8 1 1)//vertex 15
(0 1 1)//vertex 16
(20 1 1)//vertex 17
(20 0.5 1)//vertex 18
(20 0 1)//vertex 19
(20 -1 1)//vertex 20
(8 -1 1)//vertex 21
);
blocks
(
hex (0 1 2 3 11 12 13 14) (80 10 1)simpleGrading (1 1 1)
hex (3 2 4 5 14 13 15 16) (80 10 1)simpleGrading (1 1 1)
hex (2 7 6 4 1318 17 15) (120 10 1)simpleGrading (1 1 1)
hex (1 8 7 2 12 19 18 13) (120 10 1)simpleGrading (1 1 1)
hex (10 9 8 1 21 20 19 12) (120 10 1)simpleGrading (1 1 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)
);
}
walls
{
type wall;
faces
(
(4 5 16 15)
(6 4 15 17)
(0 1 12 11)
(10 9 20 21)
(10 21 12 1)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //
blockMeshDict file with grading 0.02
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2012 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 0.01;
vertices
(
(0 0 0) //vertex 0
(8 0 0)//vertex 1
(8 0.5 0)//vertex 2
(0 0.5 0)//vertex 3
(8 1 0)//vertex 4
(0 1 0)//vertex 5
(20 1 0)//vertex 6
(20 0.5 0)//vertex 8
(20 -1 0) //vertex 9
(8 -1 0)//vertex 10
(0 0 1)//vertex 11
(8 0 1)//vertex 12
(8 0.5 1)//vertex 13
(0 0.5 1)//vertex 14
(8 1 1)//vertex 15
(0 1 1)//vertex 16
(20 1 1)//vertex 17
(20 0.5 1)//vertex 18
(20 0 1)//vertex 19
(20 -1 1)//vertex 20
(8 -1 1)//vertex 21
);
blocks
(
hex (0 1 2 3 11 12 13 14) (80 10 1)simpleGrading (1 5 1)
hex (3 2 4 5 14 13 15 16) (80 10 1)simpleGrading (1 0.2 1)
hex (2 7 6 4 1318 17 15) (120 10 1)simpleGrading (5 0.2 1)
hex (1 8 7 2 12 19 18 13) (120 10 1)simpleGrading (5 5 1)
hex (10 9 8 1 21 20 19 12) (120 10 1)simpleGrading (5 10 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)
);
}
walls
{
type wall;
faces
(
(4 5 16 15)
(6 4 15 17)
(0 1 12 11)
(10 9 20 21)
(10 21 12 1)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //
ControlDict File
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2012 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application icoFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 4;
deltaT 1e-3;
writeControl timeStep;
writeInterval 20;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
// ************************************************************************* //
p file
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2012 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ 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;
}
walls
{
type zeroGradient;
}
}
// ************************************************************************* //
U file
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2012 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ 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 (0.085 0 0);
}
outlet
{
type zeroGradient;
}
walls
{
type noSlip;
}
}
// ************************************************************************* //
transportproperties file
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2012 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
nu [0 2 -1 0 0 0 0] 1e-6;
// ************************************************************************* //
blockmesh diagram without grading factor

blockmesh diagram with grading factor 0.2

Velocity flow diagram without grading factor

Velocity flow diagram with grading factor 0.2

Pressure flow diagram without grading factor

Pressure flow diagram with grading factor 0.2

the plot of Velocity flow diagram without grading factor

The plot of Velocity flow diagram with grading factor 0.2

The plot of pressure flow diagram without grading factor

the plot of Pressure flow diagram with grading factor 0.2

Conclusion
1) By changing the simple grading factor mesh becaome finer and finer and solution become more accurate.
2) it seems like there is no much change in the result after applying garding factor.
3) Simulation time less for lower grading factor and more as we increase the grading factor.
4) As we increase the simulation time courant number going to be increase.