BlockMesh Drill down challenge
Given Specification
- The number of cells along the direction of flow = 200
- The number of cells along the y-direction for each block = 10
- Inlet Velocity is 1 m/sec.
- Grading factors are 0.2, 0.5, 0.8
Methodology :
- Copy the Cavity Directory from the Tutorials directory to FOAM_RUN.
- Then, Edit the BlockMeshDict file present in cavity's system directory for Geometry of the Specified problem.
- run the blockmesh command in cavity Directory.
- After that edit the controlDict present in same directory as Blockmeshdict.
- Then edit the Initial Conditions p and U present in cavity, 0's directory.
- Also edit the transport Properties present in cavity, constant's directory.
- Then run the icoFoam solver in cavity directory for the solution.
- Open the paraView for post processing using paraFoam command.
Blockmesh Dictionary :
/*--------------------------------*- 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 0.01;
vertices
(
// Back
(0 0 0) //0
(8 0 0) //1
(8 0.5 0) //2
(0 0.5 0) //3
(8 1 0) //4
(0 1 0) //5
(20 1 0) //6
(20 0.5 0) //7
(20 0 0) //8
(20 -1 0) //9
(8 -1 0) //10
// Front
(0 0 0.1) //11
(8 0 0.1) //12
(8 0.5 0.1) //13
(0 0.5 0.1) //14
(8 1 0.1) //15
(0 1 0.1) //16
(20 1 0.1) //17
(20 0.5 0.1) //18
(20 0 0.1) //19
(20 -1 0.1) //20
(8 -1 0.1) //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 13 18 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)
);
}
frontAndBack
{
type empty;
faces
(
(11 12 13 14)
(14 13 15 16)
(13 18 17 15)
(12 19 18 13)
(21 20 19 12)
(0 3 2 1)
(3 5 4 2)
(2 4 6 7)
(1 2 7 8)
(10 1 8 9)
);
}
noSlipWalls
{
type wall;
faces
(
(16 15 4 5)
(15 17 6 4)
(10 21 12 1)
(0 11 12 1)
(10 21 20 9)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //
ControlDict :
/*--------------------------------*- 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.5;
deltaT 1e-05;
writeControl timeStep;
writeInterval 50;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
// ************************************************************************* //
TransportProperties :
/*--------------------------------*- 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 "constant";
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
nu [0 2 -1 0 0 0 0] 0.01;
// ************************************************************************* //
p :
/*--------------------------------*- 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;
}
noSlipWalls
{
type zeroGradient;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //
U :
/*--------------------------------*- 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
{
inlet
{
type fixedValue;
value uniform (1 0 0);
}
outlet
{
type zeroGradient;
}
frontAndBack
{
type empty;
}
noSlipWalls
{
type noSlip;
}
}
// ************************************************************************* //
Results and Output for Different Mesh Grading Factor :-
- Normal Mesh Grading Factor 1 :
1) Mesh Output :
2) Velocity Contour :
3) Pressure Contour :
4) velocity Profile at 0.085 m from inlet :
- Mesh Grading Factor 0.2
1) Updated Grading Factor in BlockMesh Dict :
// Grading Factor 0.2
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 13 18 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 5 1)
);
2) Mesh Output :
3) Velocity Contour :
4) Pressure Contour :
5) Velocity Profile at 0.085 m from inlet :
- Mesh Grading Factor 0.5
1) Updated Grading Factor in BlockMesh Dict :
// Grading Factor 0.5
blocks
(
hex (0 1 2 3 11 12 13 14) (80 10 1) simpleGrading (1 2 1)
hex (3 2 4 5 14 13 15 16) (80 10 1) simpleGrading (1 0.5 1)
hex (2 7 6 4 13 18 17 15) (120 10 1) simpleGrading (2 0.5 1)
hex (1 8 7 2 12 19 18 13) (120 10 1) simpleGrading (2 2 1)
hex (10 9 8 1 21 20 19 12) (120 10 1) simpleGrading (2 2 1)
);
2) Mesh Output :
3) Velocity Contour :
4) Pressure Contour :
5) Velocity Profile at 0.085 m from inlet :
- Mesh Grading Factor 0.8
1) Updated Grading Factor in BlockMesh Dict :
// Grading Factor 0.8
blocks
(
hex (0 1 2 3 11 12 13 14) (80 10 1) simpleGrading (1 1.25 1)
hex (3 2 4 5 14 13 15 16) (80 10 1) simpleGrading (1 0.8 1)
hex (2 7 6 4 13 18 17 15) (120 10 1) simpleGrading (1.25 0.8 1)
hex (1 8 7 2 12 19 18 13) (120 10 1) simpleGrading (1.25 1.25 1)
hex (10 9 8 1 21 20 19 12) (120 10 1) simpleGrading (1.25 1.25 1)
);
2) Mesh Output :
3) Velocity Contour :
4) Pressure Contour :
5) Velocity Profile at 0.085 m from inlet :
Conclusion :-
- From the above outputs we can conclude that the variation in velocity profiles for different mesh grading factors are almost negligible.
- Also the 0.2 Grade factor produces finer mesh at walls. we can say that, finer the mesh, acuurate will be the results. so for the given case the grading factors dont play significant role. As the grading factor increases there are minute changes in profile making it smoother.