Project

Symmetry vs Wedge vs HP equation Simulation of flow through a pipe

Part:2

OBJECTIVE:

Comparative Analysis of Symmetry and wedge Boundary condition and its validation with Hagon-Poiseuille Equations.

INTRODUCTION:

As per objective

  • Should have have results obtained from solving the Hagen Poisuelle\'s equation
  • Should have results obtained from simulating the pipe flow with the wedge BC
  • should obtain results for the pipe flow with symmetry BC
  • Matlab program that takes an angle as input and generates a blockMesh file for the given angle.
  • Angles to test 10,25,45

The matlab code for all the above conditions remains the same except changing angle theta. The simulation is first performed with symmetry boundary condition replacing wedge boundary conditions. The simulation time with wedge boundary condition is less compared to symmetry boundary condition, but limitation with wedge BC is that we can not go beyond 5 degree of theta angle.

To get solutions for Hagen Poisuelle\'s equation formula\'s are

Hagen—Poiseuille have defined pipe flow very accurately and according to them, velocity will be uniform initially and it will be parabolic once flow is flow developed. For fully developed flow, they have derived few equations

Hagen-Poisseuille equations:

(applicable for only laminar flow and fully developed flow in a pipe)

Laminarflow: `(Le)/D=0.06*Re`

Length(from experiment): `L=Le+0.3`

velocity distribution: `u= -(1)/(4pi)(dp)/(dx)(R^2-r^2)`

Discharge: `Q=A*u_(avg)`

Maximum velocity: `u_(max)= 2*u_(avg`

Shear stress: `tau = (2*mu*u_(max))/(r^2)`

Shear stress distribution: `tau = mu*(du)/(dr)`

Pressure drop: `Deltap = (128mu*L*Q)/(pi*D^2) = (32*pi*v*L)/(D^2)`

Data for simulation:

  • Working fluid: water (kinematic viscosity =0.8e-06 m^2/sec)
  • Re=2100
  • dynamic viscosity of water: mu=0.89*10^-3 pa.S.
  • Density of water: 1000kg/m^3
  • Diameter of the pipe: D= 0.02m
  • The maximum velocity: `V_max= 2.v_(avg)=0.1875 ms^-1`
  • total length of the pipe: L=2.82m

above data assumed and get the results using Hagen-Poisseuille equations.

Results obtained from simulating the pipe flow with the wedge BC available in part 1.

Matlab code for blockMeshDict file pipe flow with symmetry.

clear all
close all
clc
% Reynolds number for laminar flow
Re=2100; 
rho=1000;
%Diameter in meters
D=0.02; 
R=D/2;
L_ent=0.06*Re*D;
 %viscosity of water in pa.s
 mu=0.00089;
nu=mu/rho;
% in degress (assuming )
theta=45; 
%boundary conditions
v_avg= Re*nu/D;
v_max=2*v_avg;
L=L_ent+0.3;
delp= (8*v_avg*mu*L)/R^2;
% Vertices 
v0=[0 0 0];
v1=[0 R*cosd(theta/2) -R*sind(theta/2)];
v2=[0 R*cosd(theta/2) R*sind(theta/2)];
v3=[L 0 0];
v4=[L R*cosd(theta/2) -R*sind(theta/2)];
v5=[L R*cosd(theta/2) R*sind(theta/2)];
grading=1;
b1=50;
b2=1;
b3=200;
%creating blockmeshdict file for openfoam


h1=\'/*------------------------------------*- C++ -*--------------------------------*\\\';
h2=\'|  =====                         |                                                                       |\';
h3=\'|  \\\\      /  F ield               | OpenFOAM: The Open Source CFD Toolbox   |\';
h4=\'|   \\\\    /   O peration       | Website:  https://openfoam.org                   |\';
h5=\'|    \\\\  /    A nd                | Version:  7                                                      |\';
h6=\'|     \\\\/     M anipulation  |                                                                        |\';
h7=\'\\*---------------------------------------------------------------------------------*/\';

h8=\'// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //\';

f1=fopen(\'blockMeshDict.txt\',\'wt\');
fprintf(f1,\'%s\\n\',h1);
fprintf(f1,\'%s\\n\',h2);
fprintf(f1,\'%s\\n\',h3);
fprintf(f1,\'%s\\n\',h4);
fprintf(f1,\'%s\\n\',h5);
fprintf(f1,\'%s\\n\',h6);
fprintf(f1,\'%s\\n \\n\',h7);

fprintf(f1,\'FoamFile \\n {\\n\');
fprintf(f1,\'%16s %10s\\n\',\'version\',\' 2.0;\');
fprintf(f1,\'%16s %12s\\n\',\'format\',\'ascii;\');
fprintf(f1,\'%16s %17s\\n\',\'class\',\'dictionary;\');
fprintf(f1,\'%16s %20s\\n\',\'obect\',\'blockMeshDict;\');
fprintf(f1,\'%2s\\n\',\'}\');

fprintf(f1,\'%2s\\n\\n\',\'// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //\');

fprintf(f1,\'%2s\\n\\n\',\'converToMeters 1;\');
fprintf(f1,\'vertices \\n (\\n\');
fprintf(f1, \'\\t(%d %d %d)\\n\',v0);
fprintf(f1, \'\\t(%d %d %d)\\n\',v1);
fprintf(f1, \'\\t(%d %d %d)\\n\',v2);
fprintf(f1, \'\\t(%d %d %d)\\n\',v3);
fprintf(f1, \'\\t(%d %d %d)\\n\',v4);
fprintf(f1, \'\\t(%d %d %d)\\n\',v5);
fprintf(f1, \'%2s\\n\\n\', \');\');

fprintf(f1,\'blocks \\n (\\n\');
fprintf(f1,\' \\t %s (%d %d %d) %s (%d 1 1) \\n\',\'hex (0 1 2 0 3 4 5 3)\',b1,b2,b3,\'simpleGrading\',grading);
fprintf(f1,\' %2s\\n\\n\', \');\');

fprintf(f1,\'edges \\n (\\n\');
fprintf(f1,\'\\t  %s (0 %d 0)\\n\',\'arc 1 2\',R);
fprintf(f1,\'\\t  %s (%d %d 0)\\n\',\'arc 4 5\',L,R);
fprintf(f1,\' %2s\\n\\n\', \');\');

fprintf(f1,\'boundary \\n (\\n\');
fprintf(f1,\'\\t %5s \\n\',\'axis\',\'{\');
fprintf(f1,\'\\t %13s %s\\n\',\' type\',\'empty;\');
fprintf(f1,\'\\t %14s\\n %18s\\n\',\'faces\',\'(\');
fprintf(f1,\'\\t \\t %15s\\n %19s\\n\\n %14s\\n\\n\',\'(0 3 3 0)\',\');\',\'}\');

fprintf(f1,\' \\t %5s \\n\',\'wall\',\'{\');
fprintf(f1,\'\\t %13s %s\\n\',\' type\', \'wall;\');
fprintf(f1,\'\\t %14s\\n %18s\\n\',\' faces\', \'(\');
fprintf(f1,\'\\t \\t %15s\\n %19s\\n\\n %14s\\n\\n\',\'(2 5 4 1)\',\');\',\'}\');

fprintf(f1,\' \\t %5s \\n\',\' inlet\',\'{\');
fprintf(f1,\'\\t %13s %s\\n\',\' type\',\'patch;\');
fprintf(f1,\'\\t %14s\\n %18s\\n\',\'faces\',\'(\');
fprintf(f1,\'\\t \\t %15s\\n %19s\\n\\n %14s\\n\\n\',\'(0 0 2 1)\',\');\',\'}\');

fprintf(f1,\' \\t %5s \\n\',\'outlet\',\'{\');
fprintf(f1,\'\\t %13s %s\\n\',\' type\',\'patch;\');
fprintf(f1,\'\\t %14s\\n %18s\\n\',\'faces\',\'(\');
fprintf(f1,\'\\t \\t %15s\\n %19s\\n\\n %14s\\n\\n\',\'(3 4 5 3)\',\');\',\'}\');

fprintf(f1,\' \\t %5s \\n\',\'wedgeFront\',\'{\');
fprintf(f1,\'\\t %13s %s\\n\',\' type\',\'symmetry;\');
fprintf(f1,\'\\t %14s\\n %18s\\n\',\'faces\',\'(\');
fprintf(f1,\'\\t \\t %15s\\n %19s\\n\\n %14s\\n\\n\',\'(0 3 5 2)\',\');\',\'}\');

fprintf(f1,\' \\t %5s \\n\',\'wedgeBack\',\'{\');
fprintf(f1,\'\\t %13s %s\\n\',\' type\',\'symmetry;\');
fprintf(f1,\'\\t %14s\\n %18s\\n\',\'faces\',\'(\');
fprintf(f1,\'\\t \\t %15s\\n %19s\\n\\n %14s\\n\\n %s\\n\\n\',\'(0 1 4 3)\',\');\',\'}\',\');\');

fprintf(f1,\'mergePatchPairs \\n (\\n ); \\n\');
fprintf(f1,\'%2s\\n\\n\',\'// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //\');
fclose(f1);

The boundary conditions p, U :

Presuure:

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

    inlet
    {
        type            zeroGradient;
    }

    outlet
    {
        type            fixedValue;
        value           uniform 0.018;
    }
 
    wall
    {
        type            zeroGradient;
    }

    wedgeFront
    {
        type            symmetry;
    }

    wedgeBack
    {
        type            symmetry;
    }
}

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

Velocity:

/*--------------------------------*- 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
{
    axis
    {
        type            empty;
    }
    
    inlet
    {
        type            fixedValue;
        value           uniform (0.0937312 0 0);
    }

    outlet
    {
        type            zeroGradient;
    }

    wall
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }

    wedgeFront
    {
        type            symmetry;
    }

    wedgeBack
    {
        type            symmetry;
    }
}

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

OUTPUT:

1.Symmetry- angle at `10^o`

Velocity profile from entrnce of the pipe:

Velocity profile at length 2m for symmetry:

2.Symmetry- angle at `25^o`

Velocity profile from entrnce of the pipe:

Velocity profile at length 2m for symmetry:

3.Symmetry- angle at `45^o`

Velocity profile from entrnce of the pipe:

Velocity profile at length 2m for symmetry:

Tabulating results from wedge bc , symmetry and HP equations:

wedgeBc at 3 deg symmetry BC at 10 deg symmetry Bc at 25 deg symmetry Bc at 45 deg
HP equation 0.1869 0.1869 0.1869 0.1869
max velocity 0.1854 0.1864 0.1865 0.1866
error 0.0015 0.0005 0.0004 0.0003
pressure drop 0.357 0.367 0.3778 0.4094

And mean courant number for all conditions same that is 0.0686 and maximum courant number vary between 0.27 to 0.34, has slightly difference.

Observations:

  • The parabolic profile is maintained irrespective of the angle of wedge.The velocity is almost constant with all the wedge angles.
  • Error is decreasing with the wedge angle.
  • Pressure drop is increasing with wedge angle.
  • Wedge boundary condition instead of symmetry saves the simulation time.
  • By increasing the angle, Execution time is also increasing.
  • While the angle increases the error in the maximum velocity is decreased.Though there is not much difference between analytical and numerical results.
  • While increasing the angle of the wedge, The Courant number is slightly increasing.

CONCLUSION:

symmetry boundary condition is more accurate than wedge boundary condition and excution time is greater than symmetry boundary condition than wedge boundary condition. but wedge boundary condition is suitable for less than 5 degrees, if more than 5 degrees symmetry BC prefered.

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.