Week 8 - BlockMesh Drill down challenge
AIM: Simulating the flow through backward facing step using icoFOAM solver.
PROCEDURE:
- icoFOAM solves the incompressible laminar navier stokes equations using PISO algorithm.
- Path to find solver
tutorials -> incompressible -> icoFOAM
Mesh generation
- To create the BFS,we have to edit the blockmeshdict file available in the system directory.
Grading factor 0.2
/*--------------------------------*- 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) //ver0
(0.08 0 0) //ver1
(0.08 0.005 0) //ver2
(0 0.005 0) //ver3
(0.08 0.01 0) //ver4
(0 0.01 0) //ver5
(0.2 0.01 0) //ver6
(0.2 0.005 0) //ver7
(0.2 0 0) //ver8
(0.2 -0.01 0) //ver9
(0.08 -0.01 0) //ver10
(0 0 0.001) //ver11
(0.08 0 0.001) //ver12
(0.08 0.005 0.001) //ver13
(0 0.005 0.001) //ver14
(0.08 0.01 0.001) // ver15
(0 0.01 0.001) //ver16
(0.2 0.01 0.001) //ver17
(0.2 0.005 0.001) //ver18
(0.2 0 0.001) //ver19
(0.2 -0.01 0.001) //ver20
(0.08 -0.01 0.001)//ver21
);
blocks
(
hex (0 1 2 3 11 12 13 14) (200 10 1) simpleGrading (1 5 1)
hex (3 2 4 5 14 13 15 16) (200 10 1) simpleGrading (1 0.2 1)
hex (2 7 6 4 13 18 17 15) (200 10 1) simpleGrading (2 0.2 1)
hex (1 8 7 2 12 19 18 13) (200 10 1) simpleGrading (5 5 1)
hex (10 9 8 1 21 20 19 12) (200 10 1) simpleGrading (5 5 1)
);
edges
(
);
boundary
(
inletWall
{
type patch;
faces
(
(0 11 14 3)
(3 14 16 5)
);
}
outletWalls
{
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)
(2 4 6 7)
(1 2 7 8)
(10 1 8 9)
(11 12 13 14)
(14 13 15 16)
(13 18 17 15)
(12 19 18 13)
(21 20 19 12)
);
}
Noslipwalls
{
type wall;
faces
(
(5 16 15 4)
(4 15 17 6)
(0 1 12 11)
(10 9 20 21)
(1 10 21 12)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //
Mesh with grading factor 0.2

Grading factor 0.5
blocks
(
hex (0 1 2 3 11 12 13 14) (200 10 1) simpleGrading (1 2 1)
hex (3 2 4 5 14 13 15 16) (200 10 1) simpleGrading (1 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 2 1)
);
Mesh with 0.5 rading factor:

Grading factor 0.8
blocks
(
hex (0 1 2 3 11 12 13 14) (200 10 1) simpleGrading (1 1.25 1)
hex (3 2 4 5 14 13 15 16) (200 10 1) simpleGrading (1 0.8 1)
hex (2 7 6 4 13 18 17 15) (200 10 1) simpleGrading (1.25 0.8 1)
hex (1 8 7 2 12 19 18 13) (200 10 1) simpleGrading (1.25 1.25 1)
hex (10 9 8 1 21 20 19 12) (200 10 1) simpleGrading (1.25 1.25 1)
);
Mesh with 0.8 grading factor

Boundary conditions:
The boundary conditions can be given by editing the pressure and velocity script files available 0 folder.
Pressure script file:
/*--------------------------------*- 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
{
inletWall
{
type zeroGradient;
}
outletWalls
{
type fixedValue;
value uniform 0;
}
frontAndBack
{
type empty;
}
Noslipwalls
{
type zeroGradient;
}
}
// ************************************************************************* //
Velocity script:
/*--------------------------------*- 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
{
inletWall
{
type fixedValue;
value uniform (3 0 0);
}
outletWalls
{
type zeroGradient;
}
frontAndBack
{
type empty;
}
Noslipwalls
{
type noSlip;
value uniform (0 0 0);
}
}
// ************************************************************************* //
control script:
/*--------------------------------*- 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.02;
deltaT 1e-5;
writeControl timeStep;
writeInterval 15;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
// ************************************************************************* //
Post processing:
Velocity contours
Grading factor 0.2

Grading factor 0.5

Grading factors 0.8

Results:
0.2 grading factor

0.5 grading factor

0.8 grading factor

Conclusion:
As grading factor increases the velocity also increases but very minutely as the change is negligible.