BlockMesh Drill down challenge
The main objective is to use the icoFOAM solver to simulate the flow through a backward facing step. Initially, The geometry is generated for a variation of the incompressible cavity flow problem in OpenFOAM.The mesh is generated according to the need of the structure|(i.e with or without grading).
The below-shown diagram shows the required structure to be made.
INTRODUCTION
Mesh specification
- Number of cells along the x-direction (longer dimension) = 200
- Number of cells along the y-direction = 10
- Use a graded mesh. Grading factor near all walls should be 0.2
The required generated geometry is given below:
A.Ungraded:
The following are the steps to be considered while giving the shape;
1. Initially open the tutorial file in the OpenFOAM.
2. Now go to the incompressible folder and open the icoFOAM folder.
3. Go to the cavity and copy this cavity folder to the run folder hence we can edit it for shape
4. Edit the blockMeshdict file in it and enter the provided cells information to create the shape
The simulation for velocity profile for following mesh grading factor cases;
1. Ungraded mesh condition
2. f=0.8
3. f=0.4
4. f=0.2
C.Graded 0.4
/*----------------------------
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 6
\\/ M anipulation |
*-----------------------------
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
(0 0 0) // vertex 0
(0.08 0 0) // vertex 1
(0.08 0.005 0) // vertex 2
(0 0.005 0) // vertex 3
(0 0.01 0) // vertex 4
(0.08 0.01 0) // vertex 5
(0.08 -0.005 0) // vertex 6
(0.08 -0.01 0) // vertex 7
(0.2 -0.01 0) // vertex 8
(0.2 -0.005 0) // vertex 9
(0.2 0 0) // vertex 10
(0.2 0.005 0) // vertex 11
(0.2 0.01 0) // vertex 12
(0 0 0.001) // vertex 13
(0.08 0 0.001) // vertex 14
(0.08 0.005 0.001) // vertex 15
(0 0.005 0.001) // vertex 16
(0 0.01 0.001) // vertex 17
(0.08 0.01 0.001) // vertex 18
(0.08 -0.005 0.001)// vertex 19
(0.08 -0.01 0.001) // vertex 20
(0.2 -0.01 0.001) // vertex 21
(0.2 -0.005 0.001) // vertex 22
(0.2 0 0.001) // vertex 23
(0.2 0.005 0.001) // vertex 24
(0.2 0.01 0.001) // vertex 25
);
blocks
(
hex (0 1 2 3 13 14 15 16) (80 5 1) simpleGrading (0.2 0.2 1)
hex (3 2 5 4 16 15 18 17) (80 5 1) simpleGrading (0.2 0.2 1)
hex (2 11 12 5 15 24 25 18) (120 5 1) simpleGrading (5 0.2 1)
hex (1 10 11 2 14 23 24 15) (120 5 1) simpleGrading (5 0.2 1)
hex (6 9 10 1 19 22 23 14) (120 5 1) simpleGrading (5 0.2 1)
hex (7 8 9 6 20 21 22 19) (120 5 1) simpleGrading (5 0.2 1)
);
edges
(
);
boundary
(
inlet
{
type patch;
faces
(
(0 13 16 3)
(4 3 16 17)
);
}
outlet
{
type patch;
faces
(
(11 12 25 24)
(10 11 24 23)
(9 10 23 22)
(8 21 22 9)
);
}
noSlipWalls
{
type wall;
faces
(
(4 17 18 5)
(5 18 25 12)
(0 1 14 13)
(1 6 19 14)
(6 7 20 19)
(7 8 21 20)
);
}
frontAndBack
{
type empty;
faces
(
(0 3 2 1)
(3 4 5 2)
(2 5 12 11)
(1 2 11 10)
(17 16 15 18)
(16 13 14 15)
(18 15 24 25)
(15 14 23 24)
(14 19 22 23)
(19 20 21 22)
);
}
);
mergePatchPairs
(
);
// ******************************
A. FOR VELOCITY
/*--------------------------------*- C++ -*----------------------------------*
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 6
\\/ 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;
}
}
// ************************************************************************* //
B. PRESSURE
/*--------------------------------*- C++ -*----------------------------------*
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 6
\\/ 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;
}
}
// ************************************************************************* //
0.4 velocity
.PRESSURE 0.4
-------------------------------------------------------------------------------------
B
0.8 mesh
0.8 velocity
-------------------------------------------------------------------------------------
mesh 0.2
-------------------------------------------------------------------------------------
Result for the different mesh grade
Ungraded:
------------------------------------------------------------------------------------
AT 0.8:
------------------------------------------------------------------------------------
At 0.2
CONCLUSION:
The mesh is refined near the backward step in the object by suitably grading the mesh near the exit of the inlet. Flow quantities can be accurately predicted at the desired location by grading the mesh suitably. The finer the mesh (lower value of f), the more accurately the fluid physics can be visualized. Starting time is 0 and the ending time is 1.