Challenge

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

Aim:

To simulate an axi-symmetric flow by applying the symmetry boundary condition for three different angles using Matlab and OpenFoam.

Angles to test:

  • `10^0`
  • `25^0`
  • `45^0`

Assumptions:

  • The flow is laminar and flows through a constant cross-section pipe at an inlet Reynold's number of 2100.
  • Diameter of the pipe is 0.01 m.
  • Flow is axi symetrical.
  • Fluid is incompressible Newtonian fluid.
  • Density of water = 997 kg/m^3.
  • Viscosity of water at 25 deg C = 0.89e-3.
  • Validating results with Hagen- Poiseuille's equations.

Hagen- Poiseuille's Equation:

The Hagen–Poiseuille Equation (or Poiseuille equation) is a fluidic law to calculate flow pressure drop in a long cylindrical pipe and it was derived separately by Poiseuille and Hagen in 1838 and 1839, respectively.

`Delta P = (8 mu LQ)/(piR^4)`

Where,

`Delta P =`Pressure difference between the two ends

`mu =`Dynamic Viscocity

`L=`length of pipe

`Q=`Volumetric flow rate

`R=`pipe radius

For Laminar flow,

The hydrodynamic entry length `(L_e) = 0.05 R_eD`

`therefore L_e = 0.05*2100*0.01`

`= 1.05 m`

BlockMeshDict file for angle `10^0`:

/*--------------------------------*- 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.000000 0.000000 0.000000) 
      (0.000000 0.004981 0.000436) 
      (0.000000 0.004981 -0.000436) 
      (1.350000 0.000000 0.000000) 
      (1.350000 0.004981 0.000436) 
      (1.350000 0.004981 -0.000436) 
);
blocks
(
      hex (0 2 1 0 3 5 4 3) (50 1 200) simpleGrading (0.5 1 1)
);
edges
(
      arc 1 2 (0.000000 0.005000 0.000000) 
      arc 4 5 (0.000000 0.005000 1.350000) 
);
boundary
(
      inlet
      {
           type patch;
           faces
           (
                (0 1 2 0)
           );
      }
      outlet
      {
           type patch;
           faces
           (
                (3 5 4 3)
           );
      }
      front
      {
           type symmetry;
           faces
           (
                (0 2 5 3)
           );
      }
      back
      {
           type symmetry;
           faces
           (
                (0 3 4 1)
           );
      }
      pipecircumference
      {
           type wall;
           faces
           (
                (2 1 4 5)
           );
      }
      axis
      {
           type empty;
           faces
           (
                (0 3 3 0)
           );
      }
);
mergePatchPairs
(
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

BlockMeshDict file for angle `25^0`:

/*--------------------------------*- 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.000000 0.000000 0.000000) 
      (0.000000 0.004881 0.001082) 
      (0.000000 0.004881 -0.001082) 
      (1.350000 0.000000 0.000000) 
      (1.350000 0.004881 0.001082) 
      (1.350000 0.004881 -0.001082) 
);
blocks
(
      hex (0 2 1 0 3 5 4 3) (50 1 200) simpleGrading (0.5 1 1)
);
edges
(
      arc 1 2 (0.000000 0.005000 0.000000) 
      arc 4 5 (0.000000 0.005000 1.350000) 
);
boundary
(
      inlet
      {
           type patch;
           faces
           (
                (0 1 2 0)
           );
      }
      outlet
      {
           type patch;
           faces
           (
                (3 5 4 3)
           );
      }
      front
      {
           type symmetry;
           faces
           (
                (0 2 5 3)
           );
      }
      back
      {
           type symmetry;
           faces
           (
                (0 3 4 1)
           );
      }
      pipecircumference
      {
           type wall;
           faces
           (
                (2 1 4 5)
           );
      }
      axis
      {
           type empty;
           faces
           (
                (0 3 3 0)
           );
      }
);
mergePatchPairs
(
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

BlockMeshDict file for angle `45^0`:

/*--------------------------------*- 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.000000 0.000000 0.000000) 
      (0.000000 0.004619 0.001913) 
      (0.000000 0.004619 -0.001913) 
      (1.350000 0.000000 0.000000) 
      (1.350000 0.004619 0.001913) 
      (1.350000 0.004619 -0.001913) 
);
blocks
(
      hex (0 2 1 0 3 5 4 3) (50 1 200) simpleGrading (0.5 1 1)
);
edges
(
      arc 1 2 (0.000000 0.005000 0.000000) 
      arc 4 5 (0.000000 0.005000 1.350000) 
);
boundary
(
      inlet
      {
           type patch;
           faces
           (
                (0 1 2 0)
           );
      }
      outlet
      {
           type patch;
           faces
           (
                (3 5 4 3)
           );
      }
      front
      {
           type symmetry;
           faces
           (
                (0 2 5 3)
           );
      }
      back
      {
           type symmetry;
           faces
           (
                (0 3 4 1)
           );
      }
      pipecircumference
      {
           type wall;
           faces
           (
                (2 1 4 5)
           );
      }
      axis
      {
           type empty;
           faces
           (
                (0 3 3 0)
           );
      }
);
mergePatchPairs
(
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ControlDict 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         7.5;

deltaT          1e-2;

writeControl    timeStep;

writeInterval   20;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;


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

P 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       volScalarField;
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -2 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    inlet
    {
        type            zeroGradient;
    }
    outlet
    {
    	type 		 fixedValue;
    	value		 uniform 0;
    }

    noSlipWalls
    {
        type            zeroGradient;
    }

    front
    {
        type            symmetry;
    }
    back
    {
        type            symmetry;
    }
    pipecircumference
    {
        type		 zeroGradient;
    }
    axis
    {
        type		 empty;
    }
}

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

U 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       volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 -1 0 0 0 0];

internalField   uniform (0 0 0);

boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform (0.1875 0 0);
    }
    outlet
    {
    	type		zeroGradient;
    	
    }

    noSlipWalls
    {
        type            noSlip;
    }

    front
    {
        type            symmetry;
    }
    back
    {
        type            symmetry;
    }
    pipecircumference
    {
        type		 noSlip;
    }
    axis
    {
        type		 empty;
    }
}

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

Transfer 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-7;


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

Procedure:

  • Initially write program in Matlab to calculate the pressure drop and velocity by assuming the certain parameters for three different angles `10^0`, `25^0`,`45^0`.
  • Then write a code to prepare the blockMeshDict files and store the data in that files (file parsing).
  • Then copy the created blocmeshDict files to the openFoam through google drive and edit the simulation time according to the CFL number in the controlDict and update the velocity, pressure and transfer properties files accouding the required parameters assumed and calculated in the Matlab.
  • After updating the data run the 'blockMesh' and check the mesh using 'checkMesh' in the terminal, if the mesh creation is fine run the simulation by 'icoFoam' command in the terminal.
  • After the simulation open the para view using 'paraFoam' command. Then perform the post-processing to generate the plots for velocity, pressure and shear-stress. Proceed this procedure for all the three angles and observe the results.

Results:

  • Hydro-dynamic length with the numerical result using Hagen- Poiseuille's equations for the fully developed flow (Le) = 1.05 m
  • Length of the pipe (L)= 1.3500 m
  • Average velocity (V_avg) = 0.1875 m/s
  • Maximum velocity for fully developed for fully developed flow is (V_max) = 0.3749 m/s
  • Pressured drop for fully developed for fully developed flow is (del_P) = 16.016786359077230 pa
  • Wall shear stress for fully developed flow is 0.130314 N/m^2

1. For Theta = `10^0`

Velocity profile:

Pressure profile:

Plots:

Velocity plot:

Pressure plot:

Shear stress plot:

2. For Theta = `25^0`

Velocity:

Pressure:

Velocity plot:

Pressure plot:

Shear stress plot:

3. For theta = `45^0`:

Velocity profile:

Pressure profile:

Plots:

Velocity plot:

Pressure plot:

Shear stress plot:

  • Comparision:
Max Velocity (m/s) Pressure drop (Pa) Shear stress (N/m^2)
Wedge - `4^0` 0.369522 16.1008 0.1310314
Symmetry - `10^0` 0.36956 16.4365 0.130855
Symmetry - `25^0` 0.370213 17.0816 0.132108
Symmetry - `45^0` 0.371683 18.986 0.140829
Analytical 0.3749 16.00167 0.12359
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.