Week 12 - Validation studies of Symmetry BC vs Wedge BC in OpenFOAM vs Analytical H.P equation
INTRODUCTION
In this challenge we are required to simulate the flow through a pipe as a continutation of the previous challenge but here we are required to create the wedge with 3 different angles and also show use the symmetry boundary condition and compare the effects of symmetry vs wedge BC.
Here we are going to compare a 25 degree wedge using both Symmetry BC and wedge BC.
I. PRE PROCESSING
`25^o` wedge angle
blockMeshDict [Symmetry BC]
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 8
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
(0 0 0)
(0.009063 0.004226 0)
(0.009063 0.004226 3)
(0 0 3)
(0.009063 -0.004226 0)
(0.009063 -0.004226 3)
);
blocks
(
hex (0 4 1 0 3 5 2 3) (50 1 1000) simpleGrading (1 1 1)
);
edges
(
);
boundary
(
front
{
type wedge;
faces
(
(0 1 2 3)
);
}
back
{
type wedge;
faces
(
(0 3 5 4)
);
}
tankWall
{
type wall;
faces
(
(1 4 5 2)
);
}
inlet
{
type patch;
faces
(
(0 4 1 0)
);
}
outlet
{
type patch;
faces
(
(3 5 2 3)
);
}
axis
{
type empty;
faces
(
(0 3 3 0)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //
blockMeshDict[Symmetry BC]
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 8
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
(0 0 0)
(0.009063 0.004226 0)
(0.009063 0.004226 3)
(0 0 3)
(0.009063 -0.004226 0)
(0.009063 -0.004226 3)
);
blocks
(
hex (0 4 1 0 3 5 2 3) (50 1 1000) simpleGrading (1 1 1)
);
edges
(
);
boundary
(
front
{
type symmetry;
faces
(
(0 1 2 3)
);
}
back
{
type symmetry;
faces
(
(0 3 5 4)
);
}
tankWall
{
type wall;
faces
(
(1 4 5 2)
);
}
inlet
{
type patch;
faces
(
(0 4 1 0)
);
}
outlet
{
type patch;
faces
(
(3 5 2 3)
);
}
axis
{
type symmetryPlane;
faces
(
(0 3 3 0)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //
The difference between the 2 BC is that in the wedge condition the front and back faces are given a wedge boundary condition and the axis of the wedge is given type empty whereas in the symmetry BC the 2 faces are given type symmetry and the axis is type symmetry plane
MESH

The geometry and mesh for a wedge of 25 degree.
controlDict [both wedge BC and symmetry BC]
*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 8
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application icoFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 2;
deltaT 0.001;
writeControl timeStep;
writeInterval 20;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
functions
{
#includeFunc probes
}
// ************************************************************************* //
The controlDict file contains the values for simulation such as timestep,startTime and endTime. The timeStrep is calculated using the Courrant number in the previous challenge and was found out to be 0.001.
The only addition is the addition of functions in the controlDict #includeFunc probes. This is a runtime postprocessing that allows us to calculate the value of specific values at required locations.
probes
*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 8
\\/ M anipulation |
-------------------------------------------------------------------------------
Description
Writes out values of fields from cells nearest to specified locations.
\*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/probes/probes.cfg"
fields (p U);
probeLocations
(
(0 0 0)
(0 0 1)
(0 0 2.5)
(0 0 2.7)
(0 0 3)
);
// ************************************************************************* //
Here the values needed are specified (p,U) and the locations at which the values are required are specified. In this case 0m,1m,2.5m,2.7m and 3m.
II.POSTPROCESSING
The postprocessing values can be found in
postprocessing/probes/0
wedge BC
2 (-0.000423325 3.05179e-17 1.00008) (-1.34664e-05 7.05586e-16 1.88403) (-7.4217e-07 8.65386e-17 1.99205) (-3.75064e-07 6.55078e-17 1.99388) (8.88162e-09 2.15487e-17 1.99469)
symmetry BC
2 (-0.000396181 1.02352e-17 1.00009) (-1.34653e-05 4.40234e-17 1.88403) (-7.37336e-07 9.56719e-19 1.99205) (-3.57022e-07 1.5117e-18 1.99384) (2.1629e-08 1.74591e-19 1.99458)
III.RESULTS
1.Validate hydrodynamic length with numerical results
The hydrodynamic length of a pipe with 3 m length and diameter 0.02m was found to be 2.52m in the last challenge.The values of velocity after the hydrodynamic length remains unchanged for both wedge and symmetry bc U=1.99m/s. Hence the hydrodynamic length is validated.
2.Validate fully developed velocity flow profile
Wedge BC
Symmetry BC

3.Validate Maximum velocity and pressure drop
Pressure Drop
In the previous challenge the pressure drop is found out using the Haigen poiseuille equation
`(delp)/(delx)=304.64 Pa`
The simulation value of pressure drop for 0.3m is 0.279 m^2/s^2. With increase in mesh quality the accuracy can be improved to 0.3 m^2/s^2
For both Wedge BC and Symmetry BC

Maximum velocity
Formula to find average velocity
`u_(avg)=(R^2/(8mu))((-delp)/(delx))`
where
u_avg=Average Velocity(m/s)
R=Radius of pipe (m)
mu=Dynamic viscosity
dp/dx=Pressure drop (N/m2)
Substituting the required values we get the average velocity as 1.1m/s
As we know in a fully developed flow the maximum velocity is twice the average velocity, Hence the max velocity is 2.2m/s. Which is close to the value obtained in our simulation for maximum velocity 1.99m/s.
4.Validate wall shear stress

1V.COMPARISION B/W SYMMETRY AND WEDGE BC
| BC Type |
Execution Time |
Maximum Velocity (m/s) |
Pressure Drop (m^2/s^2) |
Error in Maximum Velocity (%) |
Error in Pressure Drop (%) |
| Wedge 10 | 2702.42 | 1.98972 | 0.236738 | 0.514 | 14 |
| Symmetry 10 | 2763.90 | 1.98839 | 0.23671 | 0.580 | 15.4 |
| Wedge 25 | 2688.56 | 1.99469 | 0.278762 | 0.265 | 0.44 |
| Symmetry 25 | 2836.04 | 1.99458 | 0.27870 | 0.271 | 0.44 |
| Wedge 45 | - | - | - | - | - |
| Symmetry 45 | 2735.86 | 1.99858 | 0.2791 | 0.071 | 0.32 |
V.CONCLUSION
1.The wedge BC has a lower execution time as compared to the symmetry BC.
2. The wedge BC also provides us with greater accurate values as compared to a symmetry BC for a given wedge angle, but this trend seems to become negligible as wedge angle increases.
3. The overall accuracy of the values increases as wedge angle increases.
4. But for a greater wedge angle the geometry is not formed in the case of a wedge BC.
5. The accuracy of the results can be increased with finer mesh quality.
Hence wedge BC gives us good accuracy and smaller computational time as compared to symmetry BC at small wedge angles.But when the angle is larger symmetry BC is the better option.