Project

Comparing the wedge and symmetry Boundary conditions for flow through a pipe

Objective : Simulate the flow through pipe in the openfoam using wedge and symmetry boundary

Conditions.

Need to show Results :

  1. Validate Hydro-dynamic length with the numerical result
  2. Validate the fully developed flow velocity profile with its analytical profile
  3. Validate maximum velocity and pressured drop for fully developed flow.
  4. Post-process Shear stress and validate wall shear stress for fully developed flow.
  5. Highligh the differences in both boundary conditions in terms of their usage and aplication.

Theory for this project mentioned in the previous project :

https://skill-lync.com/projects/flow-through-pipe-using-openfoam

changes :

diameter = 0.01m

Solver used : icoFoam ( Transient + incompressible + Laminar ) Flow solver.

Boundary Conditions :

1. Wedge

Wedge Boundary conditions is used for the axis symmetric flow.

Model must be axis symmetric along a central line.

Connect the wedge boundaries using a single patch (single thickness along the curvature).

Axissymmetric is exhibiting symmetry around an axis.

From the benchMark results , angle(<5deg) , wedge is good.

2. Symmetry

This boundary condition is used in the case of mirrrored flow patterns in the model , to reduce the

Usage of the computation power (decreasing the time).

This boundary conditions can be applied in the following constraints on the flow variable :

  • The flux across the symmetry are zero.
  • Normal components of all the variables are zero.

It can be applied to both planar and non-planar faces/surfaces on the domain boundaries.

For an axisymmetric flow field, symmetric boundary conditions are also applicable.

No parameters are required in the symmetric boundary conditions; only a reasonable symmetry position must be determined, where it should be specified as the hole axis.

Co-ordinates representation of the model :

BlockMeshDictFile for 10 degree wedge :

/*––––––––––––––––––––––––––––––--*- C++ -*–––––––––––––––––––––––––––––––––-*  
| =========                 |                                                 |  
|       /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |  
|      /   O peration     | Version:  4.0                                   |  
|     /    A nd           | Web:      www.OpenFOAM.org                      |  
|    /     M anipulation  |                                                 |  
 *–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––*/  
 FoamFile 
{ 
     version     2.0; 
     format      ascii; 
     class       dictionary; 
     object      blockMeshDict; 
} 
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 
convertToMeters 1;

vertices 
(     (0.000000 0 0)  // 0 
      (0.000000 0.00498 0.000436)  // 1 
      (0.000000 0.00498 -0.000436)  // 2 
      (2.000000 0.00000 0.000000)  // 3 
      (2.000000 0.00498 0.000436)  // 4 
      (2.000000 0.00498 -0.000436)  // 5 
); 
 blocks 
(
      hex (0 3 5 2 0 3 4 1) (200 25 1) simpleGrading (1 0.1 1) 
);
edges
(
      arc 1 2 (0.000000 0.005 0.000000)
      arc 4 5 (2.000000 0.005 0.000000)
);
boundary
(
     inflow
     {
          type patch;
          faces
          (
               (0 1 2 0)
          );
     }
     outflow
     {
          type patch;
          faces
          (
               (3 5 4 3)
          );
     }
     front
     {
          type wedge;
          faces
          (
               (0 3 4 1)
          );
     }
     back
     {
          type wedge;
          faces
          (
               (0 2 5 3)
          );
     }
     wall
     {
          type wall;
          faces
          (
               (1 4 5 2)
          );
     }
     axis
     {
          type empty;
          faces
          (
               (0 3 3 0)
          );
     }
);

mergePatchPairs
(
);
// *************************************************************************** //

For 25 degree :

vertices 
(     (0.000000 0 0)  // 0 
      (0.000000 0.00488 0.001082)  // 1 
      (0.000000 0.00488 -0.001082)  // 2 
      (2.000000 0.00000 0.000000)  // 3 
      (2.000000 0.00488 0.001082)  // 4 
      (2.000000 0.00488 -0.001082)  // 5 
);

For 45 degree :

vertices 
(     (0.000000 0 0)  // 0 
      (0.000000 0.00462 0.00191)  // 1 
      (0.000000 0.00462 -0.00191)  // 2 
      (2.000000 0.00000 0.000000)  // 3 
      (2.000000 0.00462 0.00191)  // 4 
      (2.000000 0.00462 -0.00191)  // 5 
);

ControlDictFile :

/*--------------------------------*- 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         11;

deltaT          0.001;

writeControl    timeStep;

writeInterval   10;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;


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

Velocity 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
{
    inflow
    {
        type           fixedValue;
        value          uniform (0.1875 0 0);
    }
    outflow
    { 
        type           zeroGradient;
    }
    front
    {
        type            wedge;
    }
    back
    {
        type            wedge;
    }
    wall
    {
        type            noSlip;
        value           uniform (0 0 0);
    }

    axis
    {
        type            empty;
    }
}

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

Pressure 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
{
    outflow
    {
       type             fixedValue;
       value            uniform  0;
    }
    inflow
    {
      type              zeroGradient;
    }

    wall
    {
        type            zeroGradient;
    }

    front
    {
        type            wedge;
    }
    back
    {
        type            wedge;
    }
    axis
    {
        type            empty;
    }
}

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

For symmetry condition replace the 'symmetry' in the place of 'wedge' in the above files.

What is zeroGradient ?

zeroGradient represents the gradient of the property with the neighbours is zero , takes the same profile of the nodes in the neighbour.

Below graph shows the good representation.

Analytical result :

`V_{avg} = frac{Re*mu}{rho*d}`

`V_{max} = 2*V_{avg}`

`d_p = frac{32*V_{avg}*mu*L}{d^2}`

`d_{pk} = frac{d_p}{rho}`

V_avg = 0.1875m/s.
V_max = 0.3749.
d_pk = 0.0396. ( For the fully developed flow )

Using ParaView for post processing :

Post Processing for the 10 degree wedge condition :

Above velocity plots shown the correct behaviour of the flow through a pipe as said the poiseuille

At inlet the velocity is given an input value (0.1897m/s) and at near the wall (v=0m/s) due to no slip condition.

Due to the cohesive forces in the fluid , restrict the flow over that layer and slowly propogate away from the wall surface.

To satisfy the conservation of mass , velocity deficiency near the wall , need to compensate in the other region , possible if the profile is parabola.

Shear stress :

The graph of the shear stress shows the correct behaviour , Shear stress at the walls are high due to the large gradients.

Numeric Result :

V_max = 0.37233.

d_{pk} = 0.0401053.

time = 493.94sec.

Post Processing for the 10 degree symmetry condition :

Here , In the symmetry case shown the complete parabola profile using the 'reflect' Filter along the y-axis (considered).

Pressure gradually decreasing along the flow as it drivens the flow. (satisfied)

Similar physics captured using the 'symmetry' boundary condition.

Numeric Result :

V_max = 0.37233.

d_pk = 0.0401051.

time = 529.36sec.

Comparision b/w wedge and symmetry for the 10 degree (200x25x1) mesh :

0.366719 - wedge (1.0)
0.369435 - wedge (1.2)
0.370275 - wedge (1.3)
0.371345 - wedge (1.5)
0.371677 - wedge (1.6)
0.371921 - wedge (1.7)
0.372101 - wedge (1.8)
0.372232 - wedge (1.9)
0.37233  - wedge (2.0)

0.366726 - sysme (1.0)
0.369439 - sysme (1.2)
0.370279 - sysme (1.3)
0.371346 - sysme (1.5)
0.371675 - sysme (1.6)
0.371922 - sysme (1.7)
0.372101 - sysme (1.8)
0.372233 - sysme (1.9)
0.37233  - sysme (2.0)

Matlab Code :

close all
%clear all
clc
% Before plotting importing the velocity files of wedge and the symmetry
%% 200x25x1
% wedge
M = velocity10wedge;
v_wedge = table2array(M(1:end,1));
arc = table2array(M(1:end,6));
plot(arc,v_wedge,'r','LineStyle','--','LineWidth',2)

hold on
% symmetry
M1 = velocity10sys;
v_sym1 = table2array(M1(1:end,1));
arc1 = table2array(M1(1:end,6));
plot(arc1,v_sym1,'k')

% Analytical
re =2100;
mu = 8.9*10^(-4);
rho = 997;
D = 0.01;
R = D/2;
r = arc1;
v_avg = (re*mu)/(rho*D);
v = 2.*v_avg.*(1-(r./R).^2);
plot(r,v,'LineWidth',1.2)

%Labelling
xlabel('Radial distane(m)')
ylabel('velocity(m/s)')
legend('wedge','symmetry','Anlytical')
title('Velocity profiles')

From the graph can observe that the results are very similar to the analytical solution using the wedge and the symmetry boundary condition

Post processing for 25 degrees wedge condition:

Numeric Result :

V_max = 0.37239

d_pk = 0.0434342

Results of 25 degree symmetry condition :

Numeric Result :

V_max = 0.372391

d_pk =0.0434342

Results of the symmetry Boundary condition is same as the wedge Boundary condition , but a very finite differences.

Time taken by the symmetry is greater than time taken by the wedge condition.

Results of the 45 degree wedge Case :

Numeric result :

V_max = 0.3725

d_pk = 0.0483733

Result of 45 degree symmetry Case :

Numeric Result :

V_max = 0.3725.

d_pk = 0.0483733

For all the cases , the physics captured is similar as said by the poiseuille's.

Numeric result comparision for all the cases :

From the above graphs can say that the higher angles shows the more accurate than the small angles.

Matlab Code :

close all
clc

% 200x25x1
% wedge
M = velocity10wedge;
v_wedge = table2array(M(1:end,1));
arc = table2array(M(1:end,6));
plot(arc,v_wedge,'r','LineStyle','--','LineWidth',2)

hold on
% symmetry
M1 = velocity10sys;
v_sym = table2array(M1(1:end,1));
arc1 = table2array(M1(1:end,6));
plot(arc1,v_sym,'k')

M2 = vel25wed2;
v_wedge1 = table2array(M2(1:end,1));
arc2 = table2array(M2(1:end,6));
plot(arc2,v_wedge1,'b','LineStyle','--','LineWidth',2)

% symmetry
M3 = velocity25sys;
v_sym1 = table2array(M3(1:end,1));
arc3 = table2array(M3(1:end,6));
plot(arc3,v_sym1,'m')

M4 = velocity45wedge;
v_wedge2 = table2array(M4(1:end,1));
arc4 = table2array(M4(1:end,6));
plot(arc4,v_wedge2,'c','LineStyle','--','LineWidth',2)

% symmetry
M5 = velocity45sys;
v_sym2 = table2array(M5(1:end,1));
arc5 = table2array(M5(1:end,6));
plot(arc5,v_sym2,'k')


% Analytical
re =2100;
mu = 8.9*10^(-4);
rho = 997;
D = 0.01;
R = D/2;
r = arc1;
v_avg = (re*mu)/(rho*D);
v = 2.*v_avg.*(1-(r./R).^2);
plot(r,v,'LineWidth',1.2)

% Labelling
xlabel('Radial distane(m)')
ylabel('velocity(m/s)')
legend('10wedge','10symmetry','25w','25s','45w','45s','Anlytical')
title('Velocity profiles')

Import all .CSV file using import option in the matlab itself.

Generate the .CSV files in the paraFoam using spreadsheet option.

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.