BlockMesh Drill down
dt based on Courant number:
Courant number C = U*(dt/dx)
Where,
U - velocity = 1 m/s assumed
dt - time steps to be find
dx = x/no. of cells along x axis
dx = 0.1/200 = 0.0005
courant number should be less than one (C < 1)
thus, using the above equation
dt < 5e-5 .
Grading factor (f):
f = size of the end cell / size of the starting cell.
Grading is done along the surface of the wall.
Dimension unit
dimensions [0 2 -2 0 0 0 0]; i.e. m2 s −2
1 Mass kilogram (kg)
2 Length metre (m
3 Time second (s)
4 Temperature Kelvin (K)
5 Quantity mole (mol)
6 Current ampere (A)
7 Luminous intensity candela (cd)
zeroGradient boundary condition for p, meaning “the normal gradient of pressure is zero”.
The frontandback patch represents the front and back planes of the 2D case and therefore must be set as empty.
The mesh is generated by running blockMesh.
icoFoam is used to process the input.
Inlet velocity is given as 1 along x axis.
Outlet pressure as zero-gauge pressure.
transportProperties in constant folder contains the kinematic viscosity in m2/s.
blockMeshDict file have the geometry .
controlDict file have the time properties.
0 folder contains pressure and velocity boundary conditions.
velocity along y axis at 0.085:
curve is raising up to 0.014 in y axis.
but for a pipe flow the velocity should be higher at the mid portion ( 0.01) because since it is near the sudden enlargement.
Boundary layer is nearly a parabolic.
Velocity along x axis at 0.2 grading
Velocity along x axis at 0.5 grading
Velocity along x axis at 0.8 grading
there is no significant difference between 0.2 ,0.5, 0.8 grading.
From the above plot we can see that the velocity became steady state after some distance along x axis 0.02 to 0.08.
From 0.08 to 0.1 the velocity decreases due to the enlargement in area.
pressure boundary condition:
/*--------------------------------*- 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;
}
front
{
type empty;
}
back
{
type empty;
}
topandbottom
{
type zeroGradient;
}
}
// ************************************************************************* //
velocity boundary condition:
/*--------------------------------*- 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;
}
front
{
type empty;
}
back
{
type empty;
}
topandbottom
{
type noSlip;
}
}
// ************************************************************************* //
blockMeshDict:
/*--------------------------------*- 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
(
(0 0 0) // point0
(8 0 0) // point1
(8 -1 0) // point2
(20 -1 0) //point3
(20 0 0) //point4
(20 0.5 0) //point5CD
(20 1 0) //point6
(8 1 0) //point7
(0 1 0) //point8
(0 0.5 0) //point9
(8 0.5 0) //point10
(0 0 1) // point11
(8 0 1) // point12
(8 -1 1) // point13
(20 -1 1) //point14
(20 0 1) //point15
(20 0.5 1) //point16
(20 1 1) //point17
(8 1 1) //point18
(0 1 1) //point19
(0 0.5 1) //point20
(8 0.5 1) //point21
);
blocks
(
hex (0 1 10 9 11 12 21 20) (200 10 1) simpleGrading (1 1.2 1)
hex (9 10 7 8 20 21 18 19) (200 10 1) simpleGrading (1 0.8 1)
hex (2 3 4 1 13 14 15 12) (200 10 1) simpleGrading (1.2 1.2 1)
hex (1 4 5 10 12 15 16 21) (200 10 1) simpleGrading (1.2 1.2 1)
hex (10 5 6 7 21 16 17 18) (200 10 1) simpleGrading (1.2 0.8 1)
);
edges
(
);
boundary
(
inlet
{
type patch;
faces
(
(9 8 19 20)
(0 9 20 11)
);
}
outlet
{
type patch;
faces
(
(6 5 16 17)
(5 4 15 16)
(4 3 14 15)
);
}
front
{
type empty;
faces
(
(0 1 10 9)
(1 2 3 4)
(1 4 5 10)
(10 5 6 7)
(7 8 9 10)
);
}
back
{
type empty;
faces
(
(11 20 21 12)
(15 14 13 12)
(12 21 16 15)
(21 18 17 16)
(20 19 18 21)
);
}
topandbottom
{
type wall;
faces
(
(6 17 18 7)
(7 18 19 8)
(0 11 12 1)
(13 2 3 14)
(13 12 1 2)
);
}
);
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.005;
deltaT 0.00001;
writeControl timeStep;
writeInterval 20;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
// ************************************************************************* //