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

Objective:-

Applying Symmetry Boundary Condition the simulation for the below mentioned angles using both symmetry and wedge boundary conditions and validate them with HP equations.

  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.

Angle at test:-

  • 10 Degree
  • 25 Degree
  • 45 Degree

Entrance Length:-

In fluid dynamics the entrance length is the distance a flow travel after a entering in pipe before the flow become fully developed. Entrance length occurs at the entry region of the pipe that area of pipe flow propagation as an expanding boundary layer (B.L.). When the B.L expands to fill the entire pipe, the developing flow becomes a fully developed flow, that flow characterstic no longer occurs with increase distance along the pipe.

Hydrodynamic entrance length:-

Hydrodynamic entrance region means the area of pipe where the fluid entering a pipe developed a velocity profile due to viscous forces propagating from the interior of wall of pipe.

When a fluid enters in a pipe at a uniform velocity, the fluid particle in that contact with the wall surface of pipe and flow become no slip condition. Due to viscouse forces within the fluid pipe surface slwolly adjust with fluid surface then the velocity profile created between fluid and surface of pipe the conservation of mass occurs. The velocity profile at the centre of the pipe is increases & reduces at the layer of fluid near the pipe surface. This developes the velocity gradient across the cross section of the pipe. The velocity profile remains unchanged in the fully developed region.

fig:- Fully Developed flow and Hydrodynamic Entrance Length of pipe

  • `L_h = 0.06*Re*D` The hydrodynamic entrance length of pipe.
  • Hagen Poiseullies Law:- It is state specified flow rate, the pressure drops and thus the required pumping power is proportional to the length of the pipe and the viscosity of the fluid, but it is inversely proportional to the fourth power of the radius (or diameter) of the pipe.

The pressure drop equation is

  • `DeltaP = (32*mu*L*V_(avg))/D^2`
  • Average velocity `V_(avg) = (Re*mu)/(rho*D)`
  • Max Velocity `u_(max) = 2*V_(avg)`
  • Kinematic Press Diff. `DeltaP_k = (DeltaP)/rho`
  • Shear Stress `tau = (2*mu*u_(max)*R)/r^2`

Given/Assuming Data:

  • Diameter, D=0.04
  • Radius, r = 0.02
  • Radial Distance, R = 0 to r
  • Re = 2100,
  • Length of pipe L=0.2
  • density of water `rho_w = 1000`
  • Dynamic viscosity `mu = 0.00089`
  • Theta `theta = 10,25, & 45 Degree`

Matlab Program for blockMeshDict file:-

clear 
close all
clc
% Simulation Flow Through Pipe by using OpenFoam 
% Given Data
Re = 2100;           % Reynold Number

D = 0.04;            % Dia of Pipe
rho = 1000;          % Density of water
mu = 0.89*10^-3;     % Dynamic Viscosity
Le = 0.05*Re*D;      % Hydrodynamic entrance length of pipe
r = D/2 ;            % Radius of pipe
theta = 10;          % Wedge Angle
L = Le+0.4;          % Total Length of pipe

% Haugen Pausselies Equation
V_avg = (Re*mu)/(rho*D);
V_max = 2*V_avg;
del_p = (8*mu*L*V_avg)/(r^2);
kinematic_p = (del_p)/rho;
tau = (2*mu*V_max*r)/(r^2);
% Calculating Shear stress
l = linspace(0,r,1000);
for i = 1:length(r)
    tau(i) = (2*mu*V_max*(abs(r(i))))/(r^2);
end
% plot(r,tau)
% xlabel('radius')
% ylabel('shear stress')
% grid on
% legend ('Shear Stress')
% % Creating a blockMesh dict file for OpenFoam
f1 = fopen('blockMeshDict10','w');
header1='/*-------------------*-C++-*-----------------------------------------*\';
header2='|==========               |                                           |';
header3='|\\       / F ield        | OpenFOAM: The Open Source CFD Toolbox     |';
header4='| \\     /  O peration    | Version: 6.1                              |';
header5='|  \\   /   A nd          | Web:www.OpenFOAM.org                      |';
header6='|   \\ /    M anupulation |                                           |';
header7='\*-------------------------------------------------------------------*/';
fprintf(f1,'%s\n',header1);
fprintf(f1,'%s\n',header2);
fprintf(f1,'%s\n',header3);
fprintf(f1,'%s\n',header4);
fprintf(f1,'%s\n',header5);
fprintf(f1,'%s\n',header6);
fprintf(f1,'%s\n',header7);
fprintf(f1,'FoamFile \n {\n');
fprintf(f1,'%15s %11s\n','version','6.0;');
fprintf(f1,'%15s %13s\n','format','ascii;');
fprintf(f1,'%15s %18s\n','Class','dictionary;');
fprintf(f1,'%15s %21s\n','object','blockMeshDict;');
fprintf(f1,'%3s\n','}');
fprintf(f1,'%3s\n\n','convertToMeter 1;');
header8='//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//';
fprintf(f1,'%s\n',header8);
fprintf(f1,'vertices \n (\n');
fprintf(f1,'\t (%d %d %d) \n', 0, 0, 0);
fprintf(f1,'\t (%d %d %d) \n',0,r*cosd(theta/2),r*sind(theta/2));
fprintf(f1,'\t (%d %d %d) \n',0,r*cosd(theta/2),-r*sind(theta/2));
fprintf(f1,'\t (%d %d %d) \n',Le, 0, 0);
fprintf(f1,'\t (%d %d %d) \n',Le,r*cosd(theta/2),r*sind(theta/2));
fprintf(f1,'\t (%d %d %d) \n',Le,r*cosd(theta/2),-r*sind(theta/2));
fprintf(f1,');\n\n');

fprintf(f1,'blocks \n \n');
fprintf(f1,'(\n');
fprintf(f1,'\t hex (0 3 5 2 0 3 4 1) (%d %d %d)',20,1,200);
fprintf(f1,' SimpleGrading (1 1 1) \n\n');
fprintf(f1,');\n \n');

fprintf(f1,'edges \n \n');
fprintf(f1,'(\n');
fprintf(f1,'\t arc %d %d (%d %d %d) \n',1,2,0,r,0);
fprintf(f1,'\t arc %d %d (%d %d %d) \n',4,5,Le,r,0);
fprintf(f1,'); \n \n');

fprintf(f1,'boundary \n \n');
fprintf(f1,'(\n');
fprintf(f1,'\t inlet \n');
fprintf(f1,'\t {\n');
fprintf(f1,'\t \t type patch; \n');
fprintf(f1,'\t \t faces\n');
fprintf(f1,'\t\t(\n');
fprintf(f1,'\t\t\t (0 1 2 0)\n');
fprintf(f1,'\t\t);\n');
fprintf(f1,'\t }\n');

fprintf(f1,'\t outlet \n');
fprintf(f1,'\t {\n');
fprintf(f1,'\t \t type patch; \n');
fprintf(f1,'\t \t faces\n');
fprintf(f1,'\t\t(\n');
fprintf(f1,'\t\t\t (3 4 5 3)\n');
fprintf(f1,'\t\t);\n');
fprintf(f1,'\t }\n');

fprintf(f1,'\t top \n');
fprintf(f1,'\t {\n');
fprintf(f1,'\t \t type wall; \n');
fprintf(f1,'\t \t faces\n');
fprintf(f1,'\t\t(\n');
fprintf(f1,'\t\t\t (1 4 5 2)\n');
fprintf(f1,'\t\t);\n');
fprintf(f1,'\t }\n');

fprintf(f1,'\t front \n');
fprintf(f1,'\t {\n');
fprintf(f1,'\t \t type wedge; \n');
fprintf(f1,'\t \t faces\n');
fprintf(f1,'\t\t(\n');
fprintf(f1,'\t\t\t (0 3 4 1)\n');
fprintf(f1,'\t\t);\n');
fprintf(f1,'\t }\n');

fprintf(f1,'\t back \n');
fprintf(f1,'\t {\n');
fprintf(f1,'\t \t type wedge; \n');
fprintf(f1,'\t \t faces\n');
fprintf(f1,'\t\t(\n');
fprintf(f1,'\t\t\t (0 2 5 3)\n');
fprintf(f1,'\t\t);\n');
fprintf(f1,'\t }\n');

fprintf(f1,'\t axis \n');
fprintf(f1,'\t {\n');
fprintf(f1,'\t \t type empty; \n');
fprintf(f1,'\t \t faces\n');
fprintf(f1,'\t\t(\n');
fprintf(f1,'\t\t\t (0 3 3 0)\n');
fprintf(f1,'\t\t);\n');
fprintf(f1,'\t }\n');
fprintf(f1,');\n \n');

fprintf(f1,' mergepatchpairs \n');
fprintf(f1,'(\n');
fprintf(f1,');\n');
header9='//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//';
fprintf(f1,'%s\n',header9);
fclose(f1);

BlockMeshDict file at angle 10 Degree

/*-------------------*-C++-*-----------------------------------------*\
|==========               |                                           |
|\\       / F ield        | OpenFOAM: The Open Source CFD Toolbox     |
| \\     /  O peration    | Version: 6.1                              |
|  \\   /   A nd          | Web:www.OpenFOAM.org                      |
|   \\ /    M anupulation |                                           |
\*-------------------------------------------------------------------*/
FoamFile 
 {
        version        6.0;
         format        ascii;
          class        dictionary;
         object        blockMeshDict;
  }
convertToMeter 1;

//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
vertices 
 (
	 (0 0 0) 
	 (0 1.992389e-02 1.743115e-03) 
	 (0 1.992389e-02 -1.743115e-03) 
	 (4.200000e+00 0 0) 
	 (4.200000e+00 1.992389e-02 1.743115e-03) 
	 (4.200000e+00 1.992389e-02 -1.743115e-03) 
);

blocks 
 
(
	 hex (0 3 5 2 0 3 4 1) (200 20 1) SimpleGrading (1 0.2 1) 

);
 
edges 
 
(
	 arc 1 2 (0 2.000000e-02 0) 
	 arc 4 5 (4.200000e+00 2.000000e-02 0) 
); 
 
boundary 
 
(
	 inlet 
	 {
	 	 type patch; 
	 	 faces
		(
			 (0 1 2 0)
		);
	 }
	 outlet 
	 {
	 	 type patch; 
	 	 faces
		(
			 (3 4 5 3)
		);
	 }
	 top 
	 {
	 	 type wall; 
	 	 faces
		(
			 (1 4 5 2)
		);
	 }
	 front 
	 {
	 	 type wedge; 
	 	 faces
		(
			 (0 3 4 1)
		);
	 }
	 back 
	 {
	 	 type wedge; 
	 	 faces
		(
			 (0 2 5 3)
		);
	 }
	 axis 
	 {
	 	 type empty; 
	 	 faces
		(
			 (0 3 3 0)
		);
	 }
);
 
 mergepatchpairs 
(
);
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//

BlockMeshDict file at angle 25 degree

/*-------------------*-C++-*-----------------------------------------*\
|==========               |                                           |
|\\       / F ield        | OpenFOAM: The Open Source CFD Toolbox     |
| \\     /  O peration    | Version: 6.1                              |
|  \\   /   A nd          | Web:www.OpenFOAM.org                      |
|   \\ /    M anupulation |                                           |
\*-------------------------------------------------------------------*/
FoamFile 
 {
        version        6.0;
         format        ascii;
          class        dictionary;
         object        blockMeshDict;
  }
convertToMeter 1;

//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
vertices 
 (
	 (0 0 0) 
	 (0 1.952592e-02 4.328792e-03) 
	 (0 1.952592e-02 -4.328792e-03) 
	 (4.200000e+00 0 0) 
	 (4.200000e+00 1.952592e-02 4.328792e-03) 
	 (4.200000e+00 1.952592e-02 -4.328792e-03) 
);

blocks 
 
(
	 hex (0 3 5 2 0 3 4 1) (200 20 1) SimpleGrading (1 0.2 1) 

);
 
edges 
 
(
	 arc 1 2 (0 2.000000e-02 0) 
	 arc 4 5 (4.200000e+00 2.000000e-02 0) 
); 
 
boundary 
 
(
	 inlet 
	 {
	 	 type patch; 
	 	 faces
		(
			 (0 1 2 0)
		);
	 }
	 outlet 
	 {
	 	 type patch; 
	 	 faces
		(
			 (3 4 5 3)
		);
	 }
	 top 
	 {
	 	 type wall; 
	 	 faces
		(
			 (1 4 5 2)
		);
	 }
	 front 
	 {
	 	 type wedge; 
	 	 faces
		(
			 (0 3 4 1)
		);
	 }
	 back 
	 {
	 	 type wedge; 
	 	 faces
		(
			 (0 2 5 3)
		);
	 }
	 axis 
	 {
	 	 type empty; 
	 	 faces
		(
			 (0 3 3 0)
		);
	 }
);
 
 mergepatchpairs 
(
);
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//

BlockMeshDict file at angle 45 Degree

/*-------------------*-C++-*-----------------------------------------*\
|==========               |                                           |
|\\       / F ield        | OpenFOAM: The Open Source CFD Toolbox     |
| \\     /  O peration    | Version: 6.1                              |
|  \\   /   A nd          | Web:www.OpenFOAM.org                      |
|   \\ /    M anupulation |                                           |
\*-------------------------------------------------------------------*/
FoamFile 
 {
        version        6.0;
         format        ascii;
          class        dictionary;
         object        blockMeshDict;
  }
convertToMeter 1;

//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
vertices 
 (
	 (0 0 0) 
	 (0 1.847759e-02 7.653669e-03) 
	 (0 1.847759e-02 -7.653669e-03) 
	 (4.200000e+00 0 0) 
	 (4.200000e+00 1.847759e-02 7.653669e-03) 
	 (4.200000e+00 1.847759e-02 -7.653669e-03) 
);

blocks 
 
(
	 hex (0 3 5 2 0 3 4 1) (200 20 1) SimpleGrading (1 0.2 1) 

);
 
edges 
 
(
	 arc 1 2 (0 2.000000e-02 0) 
	 arc 4 5 (4.200000e+00 2.000000e-02 0) 
); 
 
boundary 
 
(
	 inlet 
	 {
	 	 type patch; 
	 	 faces
		(
			 (0 1 2 0)
		);
	 }
	 outlet 
	 {
	 	 type patch; 
	 	 faces
		(
			 (3 4 5 3)
		);
	 }
	 top 
	 {
	 	 type wall; 
	 	 faces
		(
			 (1 4 5 2)
		);
	 }
	 front 
	 {
	 	 type wedge; 
	 	 faces
		(
			 (0 3 4 1)
		);
	 }
	 back 
	 {
	 	 type wedge; 
	 	 faces
		(
			 (0 2 5 3)
		);
	 }
	 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:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     icoFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         130;

deltaT          0.08;

writeControl    timeStep;

writeInterval   60;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;


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

Pressure File

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

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

internalField   uniform 0;                     // Initial condition

boundaryField
{

    inlet
    
    {
        type            zeroGradient;
        
    }
    
    outlet
    
    {
        type            zeroGradient;
        value           uniform 1.0073;          
    }

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

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

Velocity file

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

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

internalField   uniform (0.04686 0 0);

boundaryField
{
    inlet
    
    {
        
        type            fixedValue;
        value           uniform (0.04686 0 0);
        
    }

    outlet
    
    {
    
        type            zeroGradient;
        
    }

    axis
    
    {
    
        type            empty;
        
    }
    
    top
    
    {
    
        type           fixedValue;
        value          uniform (0 0 0);
        
    }
    
    front
    
    {
    
       type           wedge;
       
    }
    
    back
    
    {
    
       type           wedge;
    }
}

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

Transportproperties

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

nu              [0 2 -1 0 0 0 0] 8.9e-7;


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

Result:-

1. Mesh file at 10 degree in different view

2. Inlet Side Wedge block

3. outlet side wedge block

4.Velocity Profile at 2.1 m

5. Pressure Profile at 2.1 m

6. Shear Stress Profile

  • Result:- At 25 degree
  1. Mesh file at different view for 25 degree

2. inlet side of wedge

3. Outlet side of wedge

4. Velocity Profile at 2.1 m

5. Pressure Profile at 2.1 m

6. Shear Stress Profile

.Result:- At angle 45 degree

1. Mesh file in different view

2. inlet side view of wedge

3. outlet side view of wedge

4. velocity profile at 2.1 m

5. pressure profile at 2.1 m

6. Shear Stress Profile

Conclusion:- As above shows the different agnle show the pressure drop profile, velocity profile and shear stress at the boundary side will be near about same the changes will be small aount aoccurs at the centre of wedge.

The courant number change an after we change wegde angle more and more accurate courant number occurs at when wedge angle increase.

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.