Week 12 - Validation studies of Symmetry BC vs Wedge BC in OpenFOAM vs Analytical H.P equation
AIM
To simulate laminar viscous flow through regular pipe by applying Symmetry Boundary Condition and perform simulation for the below mentioned angles using both symmetry and wedge boundary conditions and validate them with HP equations.
Angles to test
- 10 deg
- 25 deg
- 45 deg
Expected Results
- Validate Hydro-dynamic length with the numerical result
- Validate the fully developed flow velocity profile with its analytical profile
- Validate maximum velocity and pressured drop for fully developed flow
- Post-process Shear stress and validate wall shear stress for fully developed flow
- Highligh the differences in both boundary conditions in terms of their usage and aplication
EXPLAINATION
To simulate the incompressible laminar flow through a cylindrical pipe, I have used the icoFoam solver in OpenFoam. Also simulating the flow through an entire pipe would be computationally demanding, and since the geometry of the pipe is axisymmetric I have used a wedge section of pipe for the simulation as depicted in the below figure.


As shown in the above figure, when the fluid enters the pipe, we see viscous effects because of the flow resistance characteristic of the pipe wall. The viscous effects are important at the boundary layer. The boundary layer is a dynamic phenomenon, and it is seen that it grows from the wall to such an extent that they all merge on the centerline of the pipe. That is when the flow is said to be a fully developed flow. The length required for the flow to reach a fully developed flow condition is called the hydrodynamic entrance length denoted by Le.
We have an emperical equation to compute the hydrodynamic entrance length given by
Le = 0.06*Re*D
where, Re = Reynold's number
D = Diameter of the pipe
The velocity profile of a fully developed laminar horizontal circular pipe flow is given by
`V = 1/(4mu)(partialp)/(partialx)(y^2-R^2)`
Similarly we have an equation for pressure difference given by
`deltap = (32muLV)/(D^2)`
where, V = average velocity
mu = dynamic viscosity
y = vertical distance from the pipe axis
Analytical solution is given by Hagen-Poiseuille equations
Average velocity can be computed from the Reynold's number equation i.e., `V = (mu*Re)/(rho*D)`
= (0.001003*2100)/(998.2*0.008)
= 0.2637 m/s
WKT, maximum velocity = 2 * Average velocity. Hence max. velocity = 0.5274 m/s
Hydrodynamic entrance length (Le) = 0.06*Re*D = 0.06*2100*0.008 = 1.008 m
Hence pressure drop in the fully developed flow i.e., from 1.008 to 1.5 m = (32*0.001003*0.4*0.2637)/0.008^2
= 52.89 Pa
Note that the solver in the OpenFOAM uses kinematic pressure which is the ratio of Static pressure and density and hence we need to compute the kinematic pressure given by 52.89/998.2 = 0.053 m2/s2
blockMeshDict file and generated geometry for Symmetry Boundary conditions with Wedge angle= 10deg
/*--------------------------------*- 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 3.984779e-03 3.486230e-04)
(0 3.984779e-03 -3.486230e-04)
(1.500000e+00 0 0)
(1.500000e+00 3.984779e-03 3.486230e-04)
(1.500000e+00 3.984779e-03 -3.486230e-04)
);
blocks
(
hex (0 3 5 2 0 3 4 1) (500 40 1) simpleGrading (1 0.1 1)
);
edges
(
arc 1 2 (0 4.000000e-03 0)
arc 4 5 (1.500000e+00 4.000000e-03 0)
);
boundary
(
inlet
{
type patch;
faces
(
(0 1 2 0)
);
}
outlet
{
type patch;
faces
(
(3 5 4 3)
);
}
Noslipwall
{
type wall;
faces
(
(1 4 5 2)
);
}
back
{
type symmetry;
faces
(
(0 2 5 3)
);
}
front
{
type symmetry;
faces
(
(0 3 4 1)
);
}
axis
{
type empty;
faces
(
(0 3 3 0)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //

blockMeshDict file and generated geometry for Symmetry Boundary conditions with Wedge angle= 25 deg
/*--------------------------------*- 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 0.00390518 0.000865758)
(0 0.00390518 -0.000865758)
(1.5 0 0)
(1.5 0.00390518 0.000865758)
(1.5 0.00390518 -0.000865758)
);
blocks
(
hex (0 3 5 2 0 3 4 1) (500 40 1) simpleGrading (1 0.1 1)
);
edges
(
arc 1 2 (0 0.004 0)
arc 4 5 (1.5 0.004 0)
);
boundary
(
inlet
{
type patch;
faces
(
(0 1 2 0)
);
}
outlet
{
type patch;
faces
(
(3 5 4 3)
);
}
Noslipwall
{
type wall;
faces
(
(1 4 5 2)
);
}
back
{
type symmetry;
faces
(
(0 2 5 3)
);
}
front
{
type symmetry;
faces
(
(0 3 4 1)
);
}
axis
{
type empty;
faces
(
(0 3 3 0)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //

blockMeshDict file and generated geometry for Symmetry Boundary conditions with Wedge angle= 45 deg
/*--------------------------------*- 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 0.00369552 0.00153073)
(0 0.00369552 -0.00153073)
(1.5 0 0)
(1.5 0.00369552 0.00153073)
(1.5 0.00369552 -0.00153073)
);
blocks
(
hex (0 3 5 2 0 3 4 1) (500 40 1) simpleGrading (1 0.1 1)
);
edges
(
arc 1 2 (0 0.004 0)
arc 4 5 (1.5 0.004 0)
);
boundary
(
inlet
{
type patch;
faces
(
(0 1 2 0)
);
}
outlet
{
type patch;
faces
(
(3 5 4 3)
);
}
Noslipwall
{
type wall;
faces
(
(1 4 5 2)
);
}
back
{
type symmetry;
faces
(
(0 2 5 3)
);
}
front
{
type symmetry;
faces
(
(0 3 4 1)
);
}
axis
{
type empty;
faces
(
(0 3 3 0)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //

blockMeshDict file and generated geometry for Wedge Boundary conditions with Wedge angle= 10deg
/*--------------------------------*- 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 3.984779e-03 3.486230e-04)
(0 3.984779e-03 -3.486230e-04)
(1.500000e+00 0 0)
(1.500000e+00 3.984779e-03 3.486230e-04)
(1.500000e+00 3.984779e-03 -3.486230e-04)
);
blocks
(
hex (0 3 5 2 0 3 4 1) (500 40 1) simpleGrading (1 0.1 1)
);
edges
(
arc 1 2 (0 4.000000e-03 0)
arc 4 5 (1.500000e+00 4.000000e-03 0)
);
boundary
(
inlet
{
type patch;
faces
(
(0 1 2 0)
);
}
outlet
{
type patch;
faces
(
(3 5 4 3)
);
}
Noslipwall
{
type wall;
faces
(
(1 4 5 2)
);
}
back
{
type wedge;
faces
(
(0 2 5 3)
);
}
front
{
type wedge;
faces
(
(0 3 4 1)
);
}
axis
{
type empty;
faces
(
(0 3 3 0)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //

blockMeshDict file and generated geometry for Wedge Boundary conditions with Wedge angle= 25deg
/*--------------------------------*- 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 3.905184e-03 8.657585e-04)
(0 3.905184e-03 -8.657585e-04)
(1.500000e+00 0 0)
(1.500000e+00 3.905184e-03 8.657585e-04)
(1.500000e+00 3.905184e-03 -8.657585e-04)
);
blocks
(
hex (0 3 5 2 0 3 4 1) (500 40 1) simpleGrading (1 0.1 1)
);
edges
(
arc 1 2 (0 4.000000e-03 0)
arc 4 5 (1.500000e+00 4.000000e-03 0)
);
boundary
(
inlet
{
type patch;
faces
(
(0 1 2 0)
);
}
outlet
{
type patch;
faces
(
(3 5 4 3)
);
}
Noslipwall
{
type wall;
faces
(
(1 4 5 2)
);
}
back
{
type wedge;
faces
(
(0 2 5 3)
);
}
front
{
type wedge;
faces
(
(0 3 4 1)
);
}
axis
{
type empty;
faces
(
(0 3 3 0)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //

blockMeshDict file and generated geometry for Wedge Boundary conditions with Wedge angle= 45deg
/*--------------------------------*- 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 3.695518e-03 1.530734e-03)
(0 3.695518e-03 -1.530734e-03)
(1.500000e+00 0 0)
(1.500000e+00 3.695518e-03 1.530734e-03)
(1.500000e+00 3.695518e-03 -1.530734e-03)
);
blocks
(
hex (0 3 5 2 0 3 4 1) (500 40 1) simpleGrading (1 0.1 1)
);
edges
(
arc 1 2 (0 4.000000e-03 0)
arc 4 5 (1.500000e+00 4.000000e-03 0)
);
boundary
(
inlet
{
type patch;
faces
(
(0 1 2 0)
);
}
outlet
{
type patch;
faces
(
(3 5 4 3)
);
}
Noslipwall
{
type wall;
faces
(
(1 4 5 2)
);
}
back
{
type wedge;
faces
(
(0 2 5 3)
);
}
front
{
type wedge;
faces
(
(0 3 4 1)
);
}
axis
{
type empty;
faces
(
(0 3 3 0)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //

Initial and boundary conditions for symmetric BC.'s
/*--------------------------------*- 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 volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0.2637 0 0);
boundaryField
{
inlet
{
type fixedValue;
value uniform (0.2637 0 0);
}
outlet
{
type zeroGradient;
}
Noslipwall
{
type noSlip;
}
back
{
type symmetry;
}
front
{
type symmetry;
}
axis
{
type empty;
}
}
// ************************************************************************* //
/*--------------------------------*- 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 volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type fixedValue;
value uniform 0;
}
Noslipwall
{
type zeroGradient;
}
back
{
type symmetry;
}
front
{
type symmetry;
}
axis
{
type empty;
}
}
// ************************************************************************* //
Initial and boundary conditions for wedge BC.'s
/*--------------------------------*- 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 volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0.2637 0 0);
boundaryField
{
inlet
{
type fixedValue;
value uniform (0.2637 0 0);
}
outlet
{
type zeroGradient;
}
Noslipwall
{
type noSlip;
}
back
{
type wedge;
}
front
{
type wedge;
}
axis
{
type empty;
}
}
// ************************************************************************* //
/*--------------------------------*- 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 volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type fixedValue;
value uniform 0;
}
Noslipwall
{
type zeroGradient;
}
back
{
type wedge;
}
front
{
type wedge;
}
axis
{
type empty;
}
}
// ************************************************************************* //
controlDict file for both symmetry and wedge BC.'s
/*--------------------------------*- 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 20;
deltaT 0.001;
writeControl timeStep;
writeInterval 20;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
// ************************************************************************* //
transportProperties for both types of BC.'s
/*--------------------------------*- 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 "constant";
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
nu [0 2 -1 0 0 0 0] 1.0048e-06;
// ************************************************************************* //
fvScheme file for both types of BC.'s
/*--------------------------------*- 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 fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
grad(p) Gauss linear;
}
divSchemes
{
default none;
div(phi,U) Gauss linear;
}
laplacianSchemes
{
default Gauss linear orthogonal;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default orthogonal;
}
// ************************************************************************* //
fvSolution file for both types of BC.'s
/*--------------------------------*- 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 fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
p
{
solver PCG;
preconditioner DIC;
tolerance 1e-06;
relTol 0.05;
}
pFinal
{
$p;
relTol 0;
}
U
{
solver smoothSolver;
smoother symGaussSeidel;
tolerance 1e-05;
relTol 0;
}
}
PISO
{
nCorrectors 2;
nNonOrthogonalCorrectors 0;
pRefCell 0;
pRefValue 0;
}
// ************************************************************************* //
POST PROCESSING RESULTS
Shear stress plot using analytical solution (`tau = mu(du)/(dy)`)

Shear stress plot using numerical solution in fully developed flow region

Symmetry BC with wedge angle = 10 deg
Velocity Contour for hydrodynamic entrace region

Velocity Contour for fully developed flow region

Pressure Contour for fully developed flow region

Velocity Plot at any point in fully developed flow region (say at x = 1.4 m)

Pressure Plot for fully developed flow region (between x = 1.1 m to x = 1.5 m)

Symmetry BC with wedge angle = 25 deg
Velocity Contour for hydrodynamic entrace region

Velocity Contour for fully developed flow region

Pressure Contour for fully developed flow region

Velocity Plot at any point in fully developed flow region (say at x = 1.4 m)

Pressure Plot for fully developed flow region (between x = 1.1 m to x = 1.5 m)

Symmetry BC with wedge angle = 45 deg
Velocity Contour for hydrodynamic entrace region

Velocity Contour for fully developed flow region

Pressure Contour for fully developed flow region

Velocity Plot at any point in fully developed flow region (say at x = 1.4 m)

Pressure Plot for fully developed flow region (between x = 1.1 m to x = 1.5 m)

Wedge BC with wedge angle = 10 deg
Velocity Contour for hydrodynamic entrace region

Velocity Contour for fully developed flow region

Pressure Contour for fully developed flow region

Velocity Plot at any point in fully developed flow region (say at x = 1.4 m)

Pressure Plot for fully developed flow region (between x = 1.1 m to x = 1.5 m)

Wedge BC with wedge angle = 25 deg
Velocity Contour for hydrodynamic entrace region

Velocity Contour for fully developed flow region

Pressure Contour for fully developed flow region

Velocity Plot at any point in fully developed flow region (say at x = 1.4 m)

Pressure Plot for fully developed flow region (between x = 1.1 m to x = 1.5 m)

Wedge BC with wedge angle = 45 deg
Velocity Contour for hydrodynamic entrace region

Velocity Contour for fully developed flow region

Pressure Contour for fully developed flow region

Velocity Plot at any point in fully developed flow region (say at x = 1.4 m)

Pressure Plot for fully developed flow region (between x = 1.1 m to x = 1.5 m)

Comparison of analytical and numerical results
| Symmetric BC with wedge angle = 10 deg | Symmetric BC with wedge angle = 25 deg | Symmetric BC with wedge angle = 45 deg | Wedge BC with wedge angle = 10 deg | Wedge BC with wedge angle = 25 deg | Wedge BC with wedge angle = 45 deg | Analytical Solution reults | |
| Max. vel. (m/s) | 0.53 | 0.53 | 0.53 | 0.53 | 0.53 | 0.53 | 0.5274 |
| Kinematic pre. (m2/s2) | 0.05361 | 0.05577 | 0.06218 | 0.05361 | 0.05577 | 0.06218 | 0.0529 |
| Shear stress (N/m2) | 0.26189 | 0.26716 | 0.28249 | 0.26215 | 0.26743 | 0.28247 | 0.260 |
CONCLUSION
- All the necessary contour and xy plots have been plotted for velocity, pressure and shear stress and also the numerical results are validated against the analytical results.
- From the above plots we can conclude that the overall accuracy decreases with the increase in the wedge angle.