CFD simulation of backward facing step
Goal: Simulate flow through backward facing step using icoFoam solver in OpenFoam software tool.
Objectives:
1) Run the simulation with and without grading factor of mesh.
2) compare the contours and plots for different grading factor of mesh.
3) plot the velocity profile at 0.085m distance from the inlet.
4) compare the velocity magnitude near step region.
Boundary conditions
inlet velocity is 1m/s. and rest all boundary conditions are applied as shown in above figure
#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 1;
vertices
(
(0 0 0)
(0.08 0 0)
(0.08 0.005 0)
(0 0.005 0)
(0.08 0.01 0)
(0 0.01 0)
(0.2 0.01 0)
(0.2 0.005 0)
(0.2 0 0)
(0.2 -0.01 0)
(0.08 -0.01 0)
(0 0 0.05)
(0.08 0 0.05)
(0.08 0.005 0.05)
(0 0.005 0.05)
(0.08 0.01 0.05)
(0 0.01 0.05)
(0.2 0.01 0.05)
(0.2 0.005 0.05)
(0.2 0 0.05)
(0.2 -0.01 0.05)
(0.08 -0.01 0.05)
);
blocks
(
hex (0 1 2 3 11 12 13 14) (200 10 1) simpleGrading (0.8 1.25 1)
hex (3 2 4 5 14 13 15 16) (200 10 1) simpleGrading (0.8 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 0.8 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)
);
}
noslipwalls
{
type wall;
faces
(
(16 15 4 5)
(15 17 6 4)
(21 12 1 10)
(0 1 12 11)
(10 9 20 21)
);
}
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)
);
}
);
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.05;
deltaT 1e-5;
writeControl timeStep;
writeInterval 20;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
//*************************************************************************//
initial conditions
# Pressure
/*--------------------------------*- 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;
}
frontAndBack
{
type empty;
}
noslipwalls
{
type zeroGradient;
}
}
// ************************************************************************* //
#Velocity initial conditions
/*--------------------------------*- 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;
}
noslipwalls
{
type noSlip;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //
Simulation Results:
Mesh Grading Factor 1
Mesh:
Velocity Contour:
Pressure Contour:
Velocity plot:
Mesh Grading Factor 0.8
Mesh:
Velocity Contour:
Pressure Contour:
Velocity plot :
Mesh Grading Factor 0.5
Mesh:
Velocity Contour:
Pressure Contour:
Velocity Plot:
Mesh Grading Factor 0.2
Mesh:
Velocity Contour:
Pressure Contour:
Velocity Plot:
Conclusions:
1) As the grading factor moves from 1 to 0.2 the execution time decreases.
2) velocity magnitude remains same about 1m/s form grading factor 1 to 0.5 , but at grading factor of 0.2, the velocity magnitude increases to 1.5 m/s because of the refined mesh.
3) velocity plot at 0.085m (near step) from inlet remains almost same from grading factor 1 to 0.5 of about 1.1 m/s ,at grading factor of 0.2 it increases slightly to 1.15 m/s.
4) As the grading factor goes from 1 to 0.2 the velocity plot shifts slightly towards right.
5) pressure contour did not change much when grading factor is changed.