Challenge

Week 12 - Validation studies of Symmetry BC vs Wedge BC in OpenFOAM vs Analytical H.P equation

Aim: Validation studies of Symmetry BC vs Wedge BC in OpenFOAM vs Analytical HP equation

Abstract: The simulation of flow through a pipe in OpenFOAM is the case of the internal flow. The flow is governed by the Hagen-Poiseuille equation.

The assumptions in the Hagen-Poiseuille equation are as under

  • The flow is steady, incompressible, laminar.
  • Reynolds number for laminar flow is `2100`
  • There is no acceleration of the fluid since it is steady.
  • There is no velocity in the radial direction.
  • Only the wedge shape of the pipe is considered because the flow is axis-symmetric.

Hagen-Poiseuille equation

The fluid enters into the inlet section of the pipe. The velocity of the fluid molecules near the wall is zero because of the no-slip condition. As such the entire responsibility hangs on the shoulder of the fluid molecules present in the center of the pipe to produce a velocity profile as shown in the figure. The region where the velocity is fully developed is the hydrodynamically fully developed region, the velocity gradient and shear stress at the wall remain unchanged.

  • Hydrodynamically fully developed region=`frac{delu(r,x)}{delx}=0` `u=u(r)`
  • Hydrodynamically entry length `frac{L}{D}=Re**0.06` `2.52m`
  • Dynamic viscosity of water `mu=0.00089` `Pa-sec`
  • Density of water `rho=997frac{kg}{m^3}`
  • Kinematic viscosity of water `nu=frac{mu}{rho}` `= 8.9268e-07frac{m^2}{sec}`
  • Average velocity=`frac{mu**Re}{rho**D}` `0.0937frac{m}{s}`
  • The velocity profile `u(r)=2**v_(avg)(1-frac{r^2}{R^2})`
  • `u_(max)=2**v_(avg)` `0.1875frac{m}{s}`
  • Pressure difference `trianglep=frac{32*mu*v_(avg)**L}{D^2}` `0.0169kPa`
  • Shear stress `tau=frac{2**mu**u_(max)**r}{R^2}`

The simulation is being performed for different wedge angles `10^@,25^@,45^@`, and the difference between symmetry, wedge boundary condition, and analytical Hagen-Poiseuille equation is studied.

Plotting wall shear stress for all the profiles.

  • The wall shear stress is maximum at the wall but is minimum at the center of pipe.
  • In Newtonian fluid dynamic viscosity is constant ,so `taupropfrac{du}{dr}`

Applying wedge boundary condition

Please note that p, U, controlDict, Transportproperties remains the same for wedge angle `25^@,45^@` respectively.

BlockMeshDict file for wedge angle ten degrees.

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\       /  F ield         | OpenFOAM: The Open Source CFD Toolbox\n
   \\     /   O peration     | Website:  https://openfoam.org\n
    \\   /    A nd           | Version:  8
      \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1;

vertices
(
    (0.000000 0.000000 0.000000)
    (0.000000 0.009962 -0.000872)
    (0.000000 0.009962 0.000872)
    (2.520000 0.000000 0.000000)
    (2.520000 0.009962 -0.000872)
    (2.520000 0.009962 0.000872)
);

blocks
(
    hex (0 1 2 0 3 4 5 3) (50 1 200) simpleGrading (0.4 1 1)
);

edges
(
    arc 1 2 (0.000000 0.010000 0.000000)
    arc 4 5 (2.520000 0.010000 0.000000)
);

boundary
(
    axis
    {
        type empty;
        faces
        (
            (0 3 3 0)
        );
    }
    inlet
    {
        type patch;
        faces
        (
            (0 1 2 0)
        );
    }
    pipe_surface
    {
        type wall;
        faces
        (
            (1 4 5 2)
        );
    }
    outlet
    {
        type patch
        faces
        (
            (3 4 5 3)
        );
    }
    front
    {
        type wedge
        faces
        (
            (0 3 5 2)
        );
    }
    back
    {
        type wedge
        faces
        (
            (0 1 4 3)
        );
    }
);
mergePatchPairs
(
);
// ************************************************************************* //

Pressure

/*--------------------------------*- 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
{
    axis
    {
        type            empty;
    }

    inlet
    {
        type            zeroGradient;
    }

    pipe_surface
    {
        type            zeroGradient;
    }
    outlet
    {
         type           fixedValue;
         value           uniform 0.0169;
    }
    front
    {
         type            wedge;
    } 
    back
    {
         type            wedge;
    }     
         
}

// ************************************************************************* //

Velocity

*--------------------------------*- 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.0937 0 0);

boundaryField
{
    axis
    {
        type            empty;
        
    }
    inlet
    {
        type            fixedValue;
        value           uniform (0.0937 0 0);
    }
    pipe_surface
    {
        type            fixedValue;
        value           uniform (0 0 0);
        
    }

    outlet
    {
        type            zeroGradient;
        
    }
    front
    {
         type            wedge;
    }
    back
    {
         type            wedge;
    }
    
}

// ************************************************************************* //              

Transport properties

/*--------------------------------*- 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] 8.9268e-07;


// ************************************************************************* //

Control Dict file

*--------------------------------*- 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         10;

deltaT          0.01;

writeControl    timeStep;

writeInterval   10;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;

Geometry profile for wedge angle `10^@`

Velocity profile at the inlet of the pipe.

Velocity profile for the fully developed flow

Pressure profile of the wedge

Velocity and pressure profile at a distance of `0.01m` from the inlet of a pipe.

Velocity and pressure profile at a distance of `0.5m` from the inlet of a pipe.

Velocity and pressure profile at a distance of `1m` from the inlet of a pipe.

Velocity and pressure profile at a distance of `2m` from the inlet of a pipe.

Shear stress plots

BlockMeshDict file for wedge angle twenty-five degrees.

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\       /  F ield         | OpenFOAM: The Open Source CFD Toolbox\n
   \\     /   O peration     | Website:  https://openfoam.org\n
    \\   /    A nd           | Version:  8
      \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1;

vertices
(
    (0.000000 0.000000 0.000000)
    (0.000000 0.009763 -0.002164)
    (0.000000 0.009763 0.002164)
    (2.520000 0.000000 0.000000)
    (2.520000 0.009763 -0.002164)
    (2.520000 0.009763 0.002164)
);

blocks
(
    hex (0 1 2 0 3 4 5 3) (50 1 200) simpleGrading (0.4 1 1)
);

edges
(
    arc 1 2 (0.000000 0.010000 0.000000)
    arc 4 5 (2.520000 0.010000 0.000000)
);

boundary
(
    axis
    {
        type empty;
        faces
        (
            (0 3 3 0)
        );
    }
    inlet
    {
        type patch;
        faces
        (
            (0 1 2 0)
        );
    }
    pipe_surface
    {
        type wall;
        faces
        (
            (1 4 5 2)
        );
    }
    outlet
    {
        type patch
        faces
        (
            (3 4 5 3)
        );
    }
    front
    {
        type wedge
        faces
        (
            (0 3 5 2)
        );
    }
    back
    {
        type wedge
        faces
        (
            (0 1 4 3)
        );
    }
);
mergePatchPairs
(
);
// ************************************************************************* //

Geometry for wedge angle `25^@`

Velocity profile at the inlet of a pipe.

Velocity profile for a fully developed flow

Velocity and pressure profile at `0.01m`from the inlet of the pipe.

Velocity and pressure profile `0.5m` from the inlet of the pipe.

Velocity and pressure profile at `1m` from the inlet of the pipe

Velocity and pressure profile at `2m` from the inlet of the pipe`

Shear stress plots

BlockMeshDict file for wedge angle forty-five degrees.

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\       /  F ield         | OpenFOAM: The Open Source CFD Toolbox\n
   \\     /   O peration     | Website:  https://openfoam.org\n
    \\   /    A nd           | Version:  8
      \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1;

vertices
(
    (0.000000 0.000000 0.000000)
    (0.000000 0.009239 -0.003827)
    (0.000000 0.009239 0.003827)
    (2.520000 0.000000 0.000000)
    (2.520000 0.009239 -0.003827)
    (2.520000 0.009239 0.003827)
);

blocks
(
    hex (0 1 2 0 3 4 5 3) (50 1 200) simpleGrading (0.4 1 1)
);

edges
(
    arc 1 2 (0.000000 0.010000 0.000000)
    arc 4 5 (2.520000 0.010000 0.000000)
);

boundary
(
    axis
    {
        type empty;
        faces
        (
            (0 3 3 0)
        );
    }
    inlet
    {
        type patch;
        faces
        (
            (0 1 2 0)
        );
    }
    pipe_surface
    {
        type wall;
        faces
        (
            (1 4 5 2)
        );
    }
    outlet
    {
        type patch
        faces
        (
            (3 4 5 3)
        );
    }
    front
    {
        type wedge
        faces
        (
            (0 3 5 2)
        );
    }
    back
    {
        type wedge
        faces
        (
            (0 1 4 3)
        );
    }
);
mergePatchPairs
(
);
// ************************************************************************* //

Geometry for wedge angle `45^@`

Velocity profile at the inlet of the pipe.

Velocity profile for the fully developed flow

Velocity and pressure profile at `0.01m` from the inlet of the pipe.

Velocity and pressure profile at `0.5m`from the inlet of the pipe.

Velocity and pressure profile at `1m`from the inlet

Velocity and pressure profile at `2m` from the inlet of the pipe.

Shear stress plots.

Applying symmetry boundary condition

  • The p, U, controlDict, transportProperties remains the same as above for wedge angle `25^@,45^@` respectively.
  • Please note that the geometry of the profile remains the same, therefore the behavior of parameters is shown below.

BlockMeshDict file for wedge angle ten degrees.

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\       /  F ield         | OpenFOAM: The Open Source CFD Toolbox\n
   \\     /   O peration     | Website:  https://openfoam.org\n
    \\   /    A nd           | Version:  8
      \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1;

vertices
(
    (0.000000 0.000000 0.000000)
    (0.000000 0.009962 -0.000872)
    (0.000000 0.009962 0.000872)
    (2.520000 0.000000 0.000000)
    (2.520000 0.009962 -0.000872)
    (2.520000 0.009962 0.000872)
);

blocks
(
    hex (0 1 2 0 3 4 5 3) (50 1 200) simpleGrading (0.4 1 1)
);

edges
(
    arc 1 2 (0.000000 0.010000 0.000000)
    arc 4 5 (2.520000 0.010000 0.000000)
);

boundary
(
    axis
    {
        type empty;
        faces
        (
            (0 3 3 0)
        );
    }
    inlet
    {
        type patch;
        faces
        (
            (0 1 2 0)
        );
    }
    pipe_surface
    {
        type wall;
        faces
        (
            (1 4 5 2)
        );
    }
    outlet
    {
        type patch
        faces
        (
            (3 4 5 3)
        );
    }
    front
    {
        type symmetry
        faces
        (
            (0 3 5 2)
        );
    }
    back
    {
        type symmetry
        faces
        (
            (0 1 4 3)
        );
    }
);
mergePatchPairs
(
);
// ************************************************************************* //

Pressure

/*--------------------------------*- 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
{
    axis
    {
        type            empty;
    }

    inlet
    {
        type            zeroGradient;
    }

    pipe_surface
    {
        type            zeroGradient;
    }
    outlet
    {
         type           fixedValue;
         value           uniform 0.0169;
    }
    front
    {
         type            symmetry;
    } 
    back
    {
         type            symmetry;
    }     
         
}

// ************************************************************************* //

Velocity profile

/*--------------------------------*- 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.0937 0 0);

boundaryField
{
    axis
    {
        type            empty;
        
    }
    inlet
    {
        type            fixedValue;
        value           uniform (0.0937 0 0);
    }
    pipe_surface
    {
        type            fixedValue;
        value           uniform (0 0 0);
        
    }

    outlet
    {
        type            zeroGradient;
        
    }
    front
    {
         type            symmetry;
    }
    back
    {
         type            symmetry;
    }
    
}

// ************************************************************************* //              

ControlDict

*--------------------------------*- 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         10;

deltaT          0.01;

writeControl    timeStep;

writeInterval   10;

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:  8
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "constant";
    object      transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

nu              [0 2 -1 0 0 0 0] 8.9268e-07;


// ************************************************************************* //

Velocity and pressure profile at `1m` from the inlet of the pipe.

Velocity and pressure profile at `2m` from the inlet of the pipe.

Shear stress plots

BlockMeshDict file for wedge angle twenty-five degrees.

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\       /  F ield         | OpenFOAM: The Open Source CFD Toolbox\n
   \\     /   O peration     | Website:  https://openfoam.org\n
    \\   /    A nd           | Version:  8
      \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1;

vertices
(
    (0.000000 0.000000 0.000000)
    (0.000000 0.009763 -0.002164)
    (0.000000 0.009763 0.002164)
    (2.520000 0.000000 0.000000)
    (2.520000 0.009763 -0.002164)
    (2.520000 0.009763 0.002164)
);

blocks
(
    hex (0 1 2 0 3 4 5 3) (50 1 200) simpleGrading (0.4 1 1)
);

edges
(
    arc 1 2 (0.000000 0.010000 0.000000)
    arc 4 5 (2.520000 0.010000 0.000000)
);

boundary
(
    axis
    {
        type empty;
        faces
        (
            (0 3 3 0)
        );
    }
    inlet
    {
        type patch;
        faces
        (
            (0 1 2 0)
        );
    }
    pipe_surface
    {
        type wall;
        faces
        (
            (1 4 5 2)
        );
    }
    outlet
    {
        type patch
        faces
        (
            (3 4 5 3)
        );
    }
    front
    {
        type symmetry
        faces
        (
            (0 3 5 2)
        );
    }
    back
    {
        type symmetry
        faces
        (
            (0 1 4 3)
        );
    }
);
mergePatchPairs
(
);
// ************************************************************************* //

Velocity and pressure profile at `1m` from the inlet of the pipe

Velocity and pressure profile at `2m` from the inlet of the pipe.

Shear stress plots

BlockMeshDict file for wedge angle forty-five degrees.

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\       /  F ield         | OpenFOAM: The Open Source CFD Toolbox\n
   \\     /   O peration     | Website:  https://openfoam.org\n
    \\   /    A nd           | Version:  8
      \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1;

vertices
(
    (0.000000 0.000000 0.000000)
    (0.000000 0.009239 -0.003827)
    (0.000000 0.009239 0.003827)
    (2.520000 0.000000 0.000000)
    (2.520000 0.009239 -0.003827)
    (2.520000 0.009239 0.003827)
);

blocks
(
    hex (0 1 2 0 3 4 5 3) (50 1 200) simpleGrading (0.4 1 1)
);

edges
(
    arc 1 2 (0.000000 0.010000 0.000000)
    arc 4 5 (2.520000 0.010000 0.000000)
);

boundary
(
    axis
    {
        type empty;
        faces
        (
            (0 3 3 0)
        );
    }
    inlet
    {
        type patch;
        faces
        (
            (0 1 2 0)
        );
    }
    pipe_surface
    {
        type wall;
        faces
        (
            (1 4 5 2)
        );
    }
    outlet
    {
        type patch
        faces
        (
            (3 4 5 3)
        );
    }
    front
    {
        type symmetry
        faces
        (
            (0 3 5 2)
        );
    }
    back
    {
        type symmetry
        faces
        (
            (0 1 4 3)
        );
    }
);
mergePatchPairs
(
);
// ************************************************************************* //

Velocity and pressure profile at `1m` from the inlet of the pipe.

Velocity and pressure profile at `2m` from the inlet of the pipe.

Shear stress plots.

Conclusion

The OpenFOAM results are tabulated as under

Output

Hagen-Poiseuille equation

Wedge angle `10^@`

BC: Wedge

Wedge angle `10^@`

BC: Symmetry

Wedge angle `25^@`

BC: Wedge

Wedge angle `25^@`

BC: Symmetry

Wedge angle `45^@`

BC: Wedge

Wedge angle `45^@`

BC: Symmetry

Mean Courant number `-` `0.02872` `0.0769289` `0.0769407` `0.07694` `0.0769` `0.0769692`
Max Courant number `-` `0.37947` `0.305395` `0.308834` `0.3088` `0.3181` `0.318186`
Execution time `-` `117.74s` `122.7s` `116.36s` `120.76s` `119.69s` `126.68s`
Clock time `-` `145s` `148s` `142s` `148s` `147s` `153s`
`u_(max)` `0.1875` `0.17952` `0.17952` `0.17952` `0.17952` `0.17952` `0.17952`
Kinematic pressure `0.0169` `0.0169` `0.0169` `0.0169` `0.0169` `0.0169` `0.0169`
Wall shear stress `0.034` `0.034` `0.034` `0.034` `0.034` `0.034` `0.034`

From the above data, it can be concluded that simulation performed for different wedge angles produces similar analytical results.

The deviation from the Hagen-Poiseuille equation is negligible.

The execution time for symmetry boundary condition is more as compared to wedge boundary condition.

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.