Challenge

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

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

GIVEN PROBLEM:

1. simulate an axi-symmetric flow by applying both wedge boundary and symmetric boundary condition.

2.The flow is laminar and flows through a constant cross-section pipe at an inlet Reynold's number of 2100.

3.You will also write code in Matlab to automate the generation of blockMeshDict file. The code should take inputs like pipe length, diameter, wedge angle, etc and output a fully functional blockMeshDict file.

4.You can create a wedge from a hex block by collapsing its bottom face (by merging both sets of adjacent vertices)

5.You can assume the pipe diameter

6.You can do a transient or steady state simulation and you will validate your results with the Hagen- Poiseuille's equations for the fully developed flow.

7. Angles to be tested: 10,25 and 45 degrees.

THEORY:

OpenFOAM (acronym for Open Source Field Operation and Manipulation) is a C++ toolbox for the development of customised numerical solvers, and pre/postprocessing utilities for the solution of continuum mechanics problems, most prominently the CFD problems.

icoFoam solves the incompressible laminar Navier-stokes equations using the PISO algorithm. The code is inherently transient, requiring an initial condition (such as zero velocity) and boundary conditions.

The problem statement for this challenge; we have a pipe geometry. But, since, simulating a complete pipe can be resource extensive and the fact that pipes are '"axis-symmetrical", we can deduce it into a wedge element and still obtain the same result.

Assumptions:

Geometry: Axisymmetric.

Reynolds number(Re): 2100.

Working fluid: Water.

Diameter of the pipe(d): 0.02 m

Dynamic viscosity(μ)=0.89x10^-3 Pas

Kinematic viscosity(ν)=0.8927x10^-6 m^2/s

theta=10, 25, 45

EQUATIONS USED:

Average velocity

Vavg=(Re*μ)/(ρ*D)

Maximum velocity, Vmax=2*Vavg m/s

Pressure drop

ΔP=(32*μ*L*V)/D^2 pa

kinematic pressure drop=ΔP/ρ

The pipe is reduced to a section with a central angle as shown below.

The length of the pipe must be greter than the entrance length to observe fully devoloped flow.

so how to calculate the value of Hydrodynamic length or entrance length:

L_h=0.06*Re*D;

so length of the pipe(L)=L_h+0.5 (since the length of the pipe must be greater than the entrance length to observe the fully developed flow)

Difference between Wedge boundary and Symmetry boundary condition:

1.The wedge boundary condition can be applied to very small angles and the symmetry condition can be applied to larger angles.

2.The wedge boundary condition also requires only a single cell between the boundary pairs, whereas the symmetry boundary condition can discretize in multiple cells.

3.This gives a slight advantage to the symmetry boundary condition since a more accurate circular surface can be generated rather than a straight line between the two wedge planes.

procedure:

  • Will start with copying the cavity file from the tutorial to the FOAM_RUN folder.
  • In the run folder only we are going to simulate and whatever we want to do the changes in the blockMeshDict file and pressure and velocity files and controlDict files we will be doing here.
  • creating the block in the OpenFoam here we are creating the wedge after making the required changes in the blockMeshDict file to check the geometry run the blockMesh command.
  • After creating the wedge assign the boundary conditions, and also sitting the simulation end time and time-step in such a way that the courant number should be less than 0.5 and also in the transportProperties enter the kinematic viscosity.
  • Run the simulation using the icoFoam solver after calculating the time needed for the fluid to travel from inlet to outlet

  • After the simulation, use paraFoam to view the flow inside the wedge and use plot over line command to plot the velocity and shear stress changes at a point after the hydrodynamical entry region so that we analyse the fully developed region of the fluid.

  • Use Matlab to parse the blockMeshDict so that the same file can be used for any wedge values.

  • We will be implementing three values of angles for both wedge and symmetry boundary condition: 10°, 25°,45°
  • The difference which we are implementing is number of grids for wedge (20,1,200) and for symmetry(40,1,500)
  • The wedge_front and wedge_back condition for pressure and velocity file is wedge in wedge boundary condition and symmetry in symmetry boundary condition.

MATLAB CODE TO GENERATE blockMeshDict FILE for wedge boundary condition.

clear all
close all
clc

%  inputs
% assumptions made the fluid is assumed as water
Re=2100; % given reynolds number
rho=997; % density of the water 
D=0.02; % diiameter of the pipe
r=D/2; % radius of the pipe
mu=0.89*10^-3; % dynamic viscosity of the water at 25 degree celcius
v=0.88927*10^-6; % kinematic viscosity of the water at 25 degree celcius
theta=input('Enter the value of the wedge angle= ')
L_h=0.06*Re*D; % hydrodynamic lenght 

L=L_h+0.5;
% Analytical solutions 
V_avg=(Re*mu)/(rho*D);  % average velocity
V_max=2*V_avg;   % maximum velocity
P_drop=(32*mu*L*V_avg)/D^2;  % pressure drop
P_kinematic=(P_drop)/rho;  % kinematic pressure drop

% 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)]


% PRINTING THE blockMeshDict FILE

H1='/*--------------------------------*- C++ -*----------------------------------*\';
H2='  =========                 |';
H3='  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox';
H4='  \\    /   O peration     | Website:  https://openfoam.org';
H5='    \\  /    A nd           | Version:  10';
H6='     \\/     M anipulation  |';
H7='\*---------------------------------------------------------------------------*/';
H8='FoamFile';
H9='{'
H10='    version     10.0;';
H11='    format      ascii;';
H12='    class       dictionary;';
H13='    object      blockMeshDict;';
H14='}'
H15='// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //';

% opening the file
f1=fopen('blockMeshDict_WEDGE.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',H7);
fprintf(f1,'%s \n',H8);
fprintf(f1,'%s \n',H9);
fprintf(f1,'%s \n',H10);
fprintf(f1,'%s \n',H11);
fprintf(f1,'%s \n',H12);
fprintf(f1,'%s \n',H13);
fprintf(f1,'%s \n',H14);
fprintf(f1,'%s \n',H15);
fprintf(f1,'\n');

fprintf(f1,'%s \n','convertToMeters 1;');

fprintf(f1,'%s \n','vertices');
fprintf(f1,'%s \n','(');
fprintf(f1,'%s (%f %f %f) \n',blanks(5),v0(1),v0(2),v0(3));
fprintf(f1,'%s (%f %f %f) \n',blanks(5),v1(1),v1(2),v1(3));
fprintf(f1,'%s (%f %f %f) \n',blanks(5),v2(1),v2(2),v2(3));
fprintf(f1,'%s (%f %f %f) \n',blanks(5),v3(1),v3(2),v3(3));
fprintf(f1,'%s (%f %f %f) \n',blanks(5),v4(1),v4(2),v4(3));
fprintf(f1,'%s (%f %f %f) \n',blanks(5),v5(1),v5(2),v5(3));
  
fprintf(f1,'%s \n',');');

fprintf(f1,'%s \n','blocks');
fprintf(f1,'%s \n','(');
fprintf(f1,'%s %s \n',blanks(5),'hex (0 2 1 0 3 5 4 3) (20 1 200) simpleGrading (1 1 1)');
fprintf(f1,'%s \n',');');

fprintf(f1,'%s \n','edges');
fprintf(f1,'%s \n','(');
fprintf(f1,'arc 1 2 (%f %f %f) \n',0,r,0);
fprintf(f1,'arc 4 5 (%f %f %f) \n',L,r,0);
fprintf(f1,'%s \n',');');

fprintf(f1,'%s \n','boundary');
fprintf(f1,'( \n');
fprintf(f1,'%s %s \n',blanks(5),'inlet');
fprintf(f1,'%s %s \n',blanks(5),'{');
fprintf(f1,'%s %s \n',blanks(10),'type patch;');
fprintf(f1,'           %s \n','faces');
fprintf(f1,'          %s \n','(');
fprintf(f1,'           (%d %d %d %d)\n',0, 1, 2, 0);
fprintf(f1,'          );\n');
fprintf(f1,'      }\n');
fprintf(f1,'      %s\n','outlet');
fprintf(f1,'      {\n');
fprintf(f1,'        %s\n','type patch;');
fprintf(f1,'         %s\n','faces');
fprintf(f1,'         (\n');
fprintf(f1,'            (%d %d %d %d)\n',3, 4, 5, 3);
fprintf(f1,'          );\n');
fprintf(f1,'     }\n');
fprintf(f1,'     %s\n','wedge_front');
fprintf(f1,'     {\n');
fprintf(f1,'         %s\n','type wedge;');
fprintf(f1,'         %s\n','faces');
fprintf(f1,'         (\n');
fprintf(f1,'             (%d %d %d %d)\n',2, 5, 3, 0);
fprintf(f1,'\n');            
fprintf(f1,'          );\n');
fprintf(f1,'     }\n');
fprintf(f1,'     %s\n','wedge_Back');
fprintf(f1,'     {\n');
fprintf(f1,'%s\n','         type wedge;');
fprintf(f1,'%s\n','         faces');
fprintf(f1,'         (\n');
fprintf(f1,'\n');            
fprintf(f1,'             (%d %d %d %d)\n',0, 3, 4, 1);
fprintf(f1,'          );\n');
fprintf(f1,'     }\n');
fprintf(f1,'     %s\n','top');
fprintf(f1,'     {\n');
fprintf(f1,'         %s\n','type wall;');
fprintf(f1,'         %s\n','faces');
fprintf(f1,'         (\n');
fprintf(f1,'             (%d %d %d %d)\n',1, 4, 5, 2);
fprintf(f1,'          );\n');
fprintf(f1,'     }\n');
fprintf(f1,'     %s\n','axis');
fprintf(f1,'     {\n');
fprintf(f1,'         %s\n','type empty;');
fprintf(f1,'         %s\n','faces');
fprintf(f1,'         (\n');
fprintf(f1,'             (%d %d %d %d)\n',0, 3, 3, 0);
fprintf(f1,'          );\n');
fprintf(f1,'     }\n');
fprintf(f1,' );\n');
fprintf(f1,'\n'); 
fprintf(f1,' %s\n','mergePatchPairs');
fprintf(f1,'(\n');
fprintf(f1,' );\n');
fprintf(f1,'\n'); 
fprintf(f1,' // ************************************************************************* //\n');


fclose(f1);

MATLAB CODE TO GENERATE blockMeshDict FILE for symmetry boundary condition.

clear all
close all
clc

%  inputs
% assumptions made the fluid is assumed as water
Re=2100; % given reynolds number
rho=997; % density of the water 
D=0.02; % diiameter of the pipe
r=D/2; % radius of the pipe
mu=0.89*10^-3; % dynamic viscosity of the water at 25 degree celcius
v=0.88927*10^-6; % kinematic viscosity of the water at 25 degree celcius
theta=input('Enter the value of the wedge angle= ')
L_h=0.06*Re*D; % hydrodynamic lenght 

L=L_h+0.5;
% Analytical solutions 
V_avg=(Re*mu)/(rho*D);  % average velocity
V_max=2*V_avg;   % maximum velocity
P_drop=(32*mu*L*V_avg)/D^2;  % pressure drop
P_kinematic=(P_drop)/rho;  % kinematic pressure drop

% 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)]


% PRINTING THE blockMeshDict FILE

H1='/*--------------------------------*- C++ -*----------------------------------*\';
H2='  =========                 |';
H3='  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox';
H4='  \\    /   O peration     | Website:  https://openfoam.org';
H5='    \\  /    A nd           | Version:  10';
H6='     \\/     M anipulation  |';
H7='\*---------------------------------------------------------------------------*/';
H8='FoamFile';
H9='{'
H10='    version     10.0;';
H11='    format      ascii;';
H12='    class       dictionary;';
H13='    object      blockMeshDict;';
H14='}'
H15='// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //';

% opening the file
f1=fopen('blockMeshDict_Symmetric_Actual.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',H7);
fprintf(f1,'%s \n',H8);
fprintf(f1,'%s \n',H9);
fprintf(f1,'%s \n',H10);
fprintf(f1,'%s \n',H11);
fprintf(f1,'%s \n',H12);
fprintf(f1,'%s \n',H13);
fprintf(f1,'%s \n',H14);
fprintf(f1,'%s \n',H15);
fprintf(f1,'\n');

fprintf(f1,'%s \n','convertToMeters 1;');

fprintf(f1,'%s \n','vertices');
fprintf(f1,'%s \n','(');
fprintf(f1,'%s (%f %f %f) \n',blanks(5),v0(1),v0(2),v0(3));
fprintf(f1,'%s (%f %f %f) \n',blanks(5),v1(1),v1(2),v1(3));
fprintf(f1,'%s (%f %f %f) \n',blanks(5),v2(1),v2(2),v2(3));
fprintf(f1,'%s (%f %f %f) \n',blanks(5),v3(1),v3(2),v3(3));
fprintf(f1,'%s (%f %f %f) \n',blanks(5),v4(1),v4(2),v4(3));
fprintf(f1,'%s (%f %f %f) \n',blanks(5),v5(1),v5(2),v5(3));
  
fprintf(f1,'%s \n',');');

fprintf(f1,'%s \n','blocks');
fprintf(f1,'%s \n','(');
fprintf(f1,'%s %s \n',blanks(5),'hex (0 2 1 0 3 5 4 3) (40 1 500) simpleGrading (1 1 1)');
fprintf(f1,'%s \n',');');

fprintf(f1,'%s \n','edges');
fprintf(f1,'%s \n','(');
fprintf(f1,'arc 1 2 (%f %f %f) \n',0,r,0);
fprintf(f1,'arc 4 5 (%f %f %f) \n',L,r,0);
fprintf(f1,'%s \n',');');

fprintf(f1,'%s \n','boundary');
fprintf(f1,'( \n');
fprintf(f1,'%s %s \n',blanks(5),'inlet');
fprintf(f1,'%s %s \n',blanks(5),'{');
fprintf(f1,'%s %s \n',blanks(10),'type patch;');
fprintf(f1,'           %s \n','faces');
fprintf(f1,'          %s \n','(');
fprintf(f1,'           (%d %d %d %d)\n',0, 1, 2, 0);
fprintf(f1,'          );\n');
fprintf(f1,'      }\n');
fprintf(f1,'      %s\n','outlet');
fprintf(f1,'      {\n');
fprintf(f1,'        %s\n','type patch;');
fprintf(f1,'         %s\n','faces');
fprintf(f1,'         (\n');
fprintf(f1,'            (%d %d %d %d)\n',3, 4, 5, 3);
fprintf(f1,'          );\n');
fprintf(f1,'     }\n');
fprintf(f1,'     %s\n','wedge_front');
fprintf(f1,'     {\n');
fprintf(f1,'         %s\n','type symmetry;');
fprintf(f1,'         %s\n','faces');
fprintf(f1,'         (\n');
fprintf(f1,'             (%d %d %d %d)\n',2, 5, 3, 0);
fprintf(f1,'\n');            
fprintf(f1,'          );\n');
fprintf(f1,'     }\n');
fprintf(f1,'     %s\n','wedge_back');
fprintf(f1,'     {\n');
fprintf(f1,'%s\n','         type symmetry;');
fprintf(f1,'%s\n','         faces');
fprintf(f1,'         (\n');
fprintf(f1,'\n');            
fprintf(f1,'             (%d %d %d %d)\n',0, 3, 4, 1);
fprintf(f1,'          );\n');
fprintf(f1,'     }\n');
fprintf(f1,'     %s\n','top');
fprintf(f1,'     {\n');
fprintf(f1,'         %s\n','type wall;');
fprintf(f1,'         %s\n','faces');
fprintf(f1,'         (\n');
fprintf(f1,'             (%d %d %d %d)\n',1, 4, 5, 2);
fprintf(f1,'          );\n');
fprintf(f1,'     }\n');
fprintf(f1,'     %s\n','axis');
fprintf(f1,'     {\n');
fprintf(f1,'         %s\n','type empty;');
fprintf(f1,'         %s\n','faces');
fprintf(f1,'         (\n');
fprintf(f1,'             (%d %d %d %d)\n',0, 3, 3, 0);
fprintf(f1,'          );\n');
fprintf(f1,'     }\n');
fprintf(f1,' );\n');
fprintf(f1,'\n'); 
fprintf(f1,' %s\n','mergePatchPairs');
fprintf(f1,'(\n');
fprintf(f1,' );\n');
fprintf(f1,'\n'); 
fprintf(f1,' // ************************************************************************* //\n');


fclose(f1);

For symmetry boundary condition angle 10°:

blockMeshDict file:

/*--------------------------------*- C++ -*----------------------------------*\ 
  =========                 | 
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox 
  \\    /   O peration     | Website:  https://openfoam.org 
    \\  /    A nd           | Version:  10 
     \\/     M anipulation  | 
\*---------------------------------------------------------------------------*/ 
FoamFile 
{ 
    version     10.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) 
      (3.020000 0.000000 0.000000) 
      (3.020000 0.009962 0.000872) 
      (3.020000 0.009962 -0.000872) 
); 
blocks 
( 
      hex (0 2 1 0 3 5 4 3) (40 1 500) simpleGrading (1 1 1) 
); 
edges 
( 
arc 1 2 (0.000000 0.010000 0.000000) 
arc 4 5 (3.020000 0.010000 0.000000) 
); 
boundary 
( 
      inlet 
      { 
           type patch; 
           faces 
          ( 
           (0 1 2 0)
          );
      }
      outlet
      {
        type patch;
         faces
         (
            (3 4 5 3)
          );
     }
     wedge_front
     {
         type symmetry;
         faces
         (
             (2 5 3 0)

          );
     }
     wedge_back
     {
         type symmetry;
         faces
         (

             (0 3 4 1)
          );
     }
     top
     {
         type wall;
         faces
         (
             (1 4 5 2)
          );
     }
     axis
     {
         type empty;
         faces
         (
             (0 3 3 0)
          );
     }
 );

 mergePatchPairs
(
 );

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

controlDict file (for all 10,25,45 degree symmetry boundary condition)

/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  10                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     10.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     icoFoam;

startFrom       latestTime;

startTime       0;

stopAt          endTime;

endTime         30;

deltaT          0.005;

writeControl    timeStep;

writeInterval   20;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;


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

pressure file(for all 10, 25,45 degree symmetry boundary condition)

/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  10                                |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     10.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;
    }

    wedge_front
    {
        type            symmetry;
    }

    wedge_back
    {
        type            symmetry;
    }

    top
    {
        type            zeroGradient;
    }

    axis
    {
        type            empty;
    }
}

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

velocity file(for all 10, 25,45 degree symmetry boundary condition)

/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  10                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     10.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.09373 0 0);
    }

    outlet
    {
        type            zeroGradient;
    }

    top
    {
        type            noSlip;
    }

    wedge_front
    {
        type            symmetry;
    }

    wedge_back
    {
        type            symmetry;
    }

    axis
    {
        type            empty;
    }
}

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

physicalProperties file(for all 10, 25,45 degree symmetry boundary conditionand wedge boundary conditions)

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  10
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    location    "constant";
    object      physicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

nu              [0 2 -1 0 0 0 0] 0.892e-6;


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

symmetric mesh(angle 10 degree)

velocity curve (symmetric 10 degree)

pressure curve(symmetric 10 degree)

shear stress curve(symmetric 10 degree)

For symmetry boundary condition angle 25°:

blockMeshDict file:

/*--------------------------------*- C++ -*----------------------------------*\ 
  =========                 | 
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox 
  \\    /   O peration     | Website:  https://openfoam.org 
    \\  /    A nd           | Version:  10 
     \\/     M anipulation  | 
\*---------------------------------------------------------------------------*/ 
FoamFile 
{ 
    version     10.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) 
      (3.020000 0.000000 0.000000) 
      (3.020000 0.009763 0.002164) 
      (3.020000 0.009763 -0.002164) 
); 
blocks 
( 
      hex (0 2 1 0 3 5 4 3) (40 1 500) simpleGrading (1 1 1) 
); 
edges 
( 
arc 1 2 (0.000000 0.010000 0.000000) 
arc 4 5 (3.020000 0.010000 0.000000) 
); 
boundary 
( 
      inlet 
      { 
           type patch; 
           faces 
          ( 
           (0 1 2 0)
          );
      }
      outlet
      {
        type patch;
         faces
         (
            (3 4 5 3)
          );
     }
     wedge_front
     {
         type symmetry;
         faces
         (
             (2 5 3 0)

          );
     }
     wedge_back
     {
         type symmetry;
         faces
         (

             (0 3 4 1)
          );
     }
     top
     {
         type wall;
         faces
         (
             (1 4 5 2)
          );
     }
     axis
     {
         type empty;
         faces
         (
             (0 3 3 0)
          );
     }
 );

 mergePatchPairs
(
 );

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

symmetric mesh(angle 25 degree)

velocity curve(symmetric 25 degree)

pressure curve(symmetric 25 degree)

shear stress curve(symmetric 25 degree)

For symmetry boundary condition angle 45°:

blockMeshDict file:

/*--------------------------------*- C++ -*----------------------------------*\ 
  =========                 | 
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox 
  \\    /   O peration     | Website:  https://openfoam.org 
    \\  /    A nd           | Version:  10 
     \\/     M anipulation  | 
\*---------------------------------------------------------------------------*/ 
FoamFile 
{ 
    version     10.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) 
      (3.020000 0.000000 0.000000) 
      (3.020000 0.009239 0.003827) 
      (3.020000 0.009239 -0.003827) 
); 
blocks 
( 
      hex (0 2 1 0 3 5 4 3) (40 1 500) simpleGrading (1 1 1) 
); 
edges 
( 
arc 1 2 (0.000000 0.010000 0.000000) 
arc 4 5 (3.020000 0.010000 0.000000) 
); 
boundary 
( 
      inlet 
      { 
           type patch; 
           faces 
          ( 
           (0 1 2 0)
          );
      }
      outlet
      {
        type patch;
         faces
         (
            (3 4 5 3)
          );
     }
     wedge_front
     {
         type symmetry;
         faces
         (
             (2 5 3 0)

          );
     }
     wedge_back
     {
         type symmetry;
         faces
         (

             (0 3 4 1)
          );
     }
     top
     {
         type wall;
         faces
         (
             (1 4 5 2)
          );
     }
     axis
     {
         type empty;
         faces
         (
             (0 3 3 0)
          );
     }
 );

 mergePatchPairs
(
 );

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

symmetric mesh(angle 45 degree):

velocity curve:

pressure curve:

shear stress curve:

For wedge boundary condition (angle 10 degree)

blockMeshDict file:

/*--------------------------------*- C++ -*----------------------------------*\ 
  =========                 | 
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox 
  \\    /   O peration     | Website:  https://openfoam.org 
    \\  /    A nd           | Version:  10 
     \\/     M anipulation  | 
\*---------------------------------------------------------------------------*/ 
FoamFile 
{ 
    version     10.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) 
      (3.020000 0.000000 0.000000) 
      (3.020000 0.009962 0.000872) 
      (3.020000 0.009962 -0.000872) 
); 
blocks 
( 
      hex (0 2 1 0 3 5 4 3) (20 1 200) simpleGrading (1 1 1) 
); 
edges 
( 
arc 1 2 (0.000000 0.010000 0.000000) 
arc 4 5 (3.020000 0.010000 0.000000) 
); 
boundary 
( 
      inlet 
      { 
           type patch; 
           faces 
          ( 
           (0 1 2 0)
          );
      }
      outlet
      {
        type patch;
         faces
         (
            (3 4 5 3)
          );
     }
     wedge_front
     {
         type wedge;
         faces
         (
             (2 5 3 0)

          );
     }
     wedge_Back
     {
         type wedge;
         faces
         (

             (0 3 4 1)
          );
     }
     top
     {
         type wall;
         faces
         (
             (1 4 5 2)
          );
     }
     axis
     {
         type empty;
         faces
         (
             (0 3 3 0)
          );
     }
 );

 mergePatchPairs
(
 );

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

controlDict file(for 10, 25 and 45 degree)

/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  10                                |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     10.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     icoFoam;

startFrom       latestTime;

startTime       0;

stopAt          endTime;

endTime         10;

deltaT          0.005;

writeControl    timeStep;

writeInterval   20;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;


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

pressure file(for 10, 25 and 45 degree)

/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  10                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     10.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;
    }

    wedge_front
    {
        type            wedge;
    }

    wedge_back
    {
        type            wedge;
    }

    top
    {
        type            zeroGradient;
    }

    axis
    {
        type            empty;
    }
}

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

velocity file (for 10,25 and 45 degree)

/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  10                                |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     10.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.09373 0 0);
    }

    outlet
    {
        type            zeroGradient;
    }

    top
    {
        type            noSlip;
    }

    wedge_front
    {
        type            wedge;
    }

    wedge_back
    {
        type            wedge;
    }

    axis
    {
        type            empty;
    }
}

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

physicalProperties file (for 10,25 and 45 degree):

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  10
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    location    "constant";
    object      physicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

nu              [0 2 -1 0 0 0 0] 0.892e-6;


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

wedge mesh(10 degree)

velocity curve:

pressure curve:

shear stress curve:

For wedge boundary condition (angle 25 degree)

blockMeshDict file:

/*--------------------------------*- C++ -*----------------------------------*\ 
  =========                 | 
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox 
  \\    /   O peration     | Website:  https://openfoam.org 
    \\  /    A nd           | Version:  10 
     \\/     M anipulation  | 
\*---------------------------------------------------------------------------*/ 
FoamFile 
{ 
    version     10.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) 
      (3.020000 0.000000 0.000000) 
      (3.020000 0.009763 0.002164) 
      (3.020000 0.009763 -0.002164) 
); 
blocks 
( 
      hex (0 2 1 0 3 5 4 3) (20 1 200) simpleGrading (1 1 1) 
); 
edges 
( 
arc 1 2 (0.000000 0.010000 0.000000) 
arc 4 5 (3.020000 0.010000 0.000000) 
); 
boundary 
( 
      inlet 
      { 
           type patch; 
           faces 
          ( 
           (0 1 2 0)
          );
      }
      outlet
      {
        type patch;
         faces
         (
            (3 4 5 3)
          );
     }
     wedge_front
     {
         type wedge;
         faces
         (
             (2 5 3 0)

          );
     }
     wedge_Back
     {
         type wedge;
         faces
         (

             (0 3 4 1)
          );
     }
     top
     {
         type wall;
         faces
         (
             (1 4 5 2)
          );
     }
     axis
     {
         type empty;
         faces
         (
             (0 3 3 0)
          );
     }
 );

 mergePatchPairs
(
 );

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

velocity curve:

pressure curve:

shear stress curve:

For wedge boundary condition (angle 45 degree)

blockMeshDict file:

/*--------------------------------*- C++ -*----------------------------------*\ 
  =========                 | 
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox 
  \\    /   O peration     | Website:  https://openfoam.org 
    \\  /    A nd           | Version:  10 
     \\/     M anipulation  | 
\*---------------------------------------------------------------------------*/ 
FoamFile 
{ 
    version     10.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) 
      (3.020000 0.000000 0.000000) 
      (3.020000 0.009239 0.003827) 
      (3.020000 0.009239 -0.003827) 
); 
blocks 
( 
      hex (0 2 1 0 3 5 4 3) (20 1 200) simpleGrading (1 1 1) 
); 
edges 
( 
arc 1 2 (0.000000 0.010000 0.000000) 
arc 4 5 (3.020000 0.010000 0.000000) 
); 
boundary 
( 
      inlet 
      { 
           type patch; 
           faces 
          ( 
           (0 1 2 0)
          );
      }
      outlet
      {
        type patch;
         faces
         (
            (3 4 5 3)
          );
     }
     wedge_front
     {
         type wedge;
         faces
         (
             (2 5 3 0)

          );
     }
     wedge_Back
     {
         type wedge;
         faces
         (

             (0 3 4 1)
          );
     }
     top
     {
         type wall;
         faces
         (
             (1 4 5 2)
          );
     }
     axis
     {
         type empty;
         faces
         (
             (0 3 3 0)
          );
     }
 );

 mergePatchPairs
(
 );

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

wedge mesh (angle 45 degree)

velocity file:

pressure file:

shear stress file:

conclusion:

We can observe there is no much change in the maximum velocities. The only difference observed is execution time a little high than type-wedge. While the angle increases the error in the maximum velocity is decreased. Though there is not much difference between analytical and numerical results and also with increasing the angle of the wedge, The Courant number is slightly increasing. we can say that the symmetric boundary condition plays an important role in terms of accuracy in the result

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.