Challenge

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

Objective:

To simulate an axi-symmetric flow by applying the wedge boundary condition. The flow is laminar and flows through a constant cross-section pipe at an inlet Reynold's number of 2100.

To 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.

The final objective is to post process the results of velocity at different length of pipe and shear stress at fully developed portion and compare it with analytical solution.

Assumptions:

  • Steady flow ,incompressible and laminar flow.
  • Constant fluid properties
  • Two dimensional flow.

Laminar flow through pipe:

Flow in pipes is laminar for Re ≲ 2300, and that the flow is fully developed if the pipe is sufficiently long (relative
to the entry length) so that the entrance effects are negligible.we consider the steady, laminar, incompressible flow of fluid with constant properties in the fully developed region of a straight circular pipe.

The average velocity

The maximum velocity occurs at the centreline

Reynolds Number:

The transition from laminar to turbulent flow depends on the geometry, surface roughness, flow velocity, surface temperature, and type of fluid, among other things.The ratio of inertial forces to viscous forces in the fluid (Fig. 8–5). This ratio is called the Reynolds number.The flow in a circular pipe is laminar for Re ≲ 2300, turbulent for Re ≳ 4000,
and transitional in between.

HydroDynamic length:

The region from the pipe inlet to the point at which the velocity boundary layer merges at the centre line is called hydrodynamic entrance region.The region beyond the entrance region in which velocity profile fully developed is called fully developed region.

In laminar flow entry length is given as 0.06.Re.D.

Hagen poiseuille flow:

For a 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 inverselyproportional to the fourth power of the radius (or diameter) of the pipe.

Pressure Drop:

Working fluid (Water) Kinematic viscosity: 1e-06m^2/s

Dynamic viscosity: mu = 0.89*10^-3 Pa.s

Density of water = 1000 Kg/m^3

Reynolds Number =2100

average velocity = 0.09345m/s

V_max= 2*v_avg= 0.1869 m/s

Hydrodynamic length= 0.06 *0.02*2100 = 2.52m

Matlab code for wedge condition blockMeshdict:

close all 
clear all
clc

%input conditions
Re=2100; %given
D=0.02; %assumption in meters
R=D/2;
rho=1000; %density for water
entry_length= 0.06*Re*D; %hydrodynamic entry length
mu=0.00089; % viscosity in Pa.s
nu=mu/rho; %kinematic viscosity
theta=input;

%boundary conditions
v_avg=(Re*nu)/D;
v_max=2*v_avg;
L=entry_length+0.3; %total length of pipe
delta_p=(8*mu*L*v_avg)/R^2; %pressure drop

%vertices co-ordinates
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)];



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

f1=fopen('blockMeshDict.txt','w')

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, 'FoamFile \n {\n');
fprintf(f1,'%12s \t 2.0;\n','version');
fprintf(f1,'%12s \t ascii;\n','format');
fprintf(f1,'%12s \t dictionary;\n','class');
fprintf(f1,'%12s \t blockMeshDict;\n','object');
fprintf(f1,'}\n');
fprintf(f1,'// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *// \n');
fprintf(f1,'convertToMeters 1;\n\n');
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,');\n\n');

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

fprintf(f1,'edges\n(\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,L,R,0);
fprintf(f1,');\n\n');

fprintf(f1,'boundary\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 5 4 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,'mergePatchPairs\n');
fprintf(f1,'(\n');
fprintf(f1,');\n');

fprintf(f1,'// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *// \n');
fclose(f1)

Matlab code for symmetry condition blockMeshdict:

close all 
clear all
clc

%input conditions
Re=2100; %given
D=0.02; %assumption in meters
R=D/2;
rho=1000; %density for water
entry_length= 0.06*Re*D; %hydrodynamic entry length
mu=0.00089; % viscosity in Pa.s
nu=mu/rho; %kinematic viscosity
theta=input;

%boundary conditions
v_avg=(Re*nu)/D;
v_max=2*v_avg;
L=entry_length+0.3; %total length of pipe
delta_p=(8*mu*L*v_avg)/R^2; %pressure drop

%vertices co-ordinates
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)];



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

f1=fopen('blockMeshDict.txt','w')

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, 'FoamFile \n {\n');
fprintf(f1,'%12s \t 2.0;\n','version');
fprintf(f1,'%12s \t ascii;\n','format');
fprintf(f1,'%12s \t dictionary;\n','class');
fprintf(f1,'%12s \t blockMeshDict;\n','object');
fprintf(f1,'}\n');
fprintf(f1,'// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *// \n');
fprintf(f1,'convertToMeters 1;\n\n');
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,');\n\n');

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

fprintf(f1,'edges\n(\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,L,R,0);
fprintf(f1,');\n\n');

fprintf(f1,'boundary\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 5 4 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 symmetry;\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 symmetry;\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,'mergePatchPairs\n');
fprintf(f1,'(\n');
fprintf(f1,');\n');

fprintf(f1,'// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *// \n');
fclose(f1)

25 degrees Symmetry condition:

/*--------------------------------*- 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 0 0)
	(0 9.238795e-03 3.826834e-03)
	(0 9.238795e-03 -3.826834e-03)
	(2.820000e+00 0 0)
	(2.820000e+00 9238795.e-03 3.826834e-03)
	(2.820000e+00 9.238795e-03 -3.826834e-03)
	
);

blocks
(
	 hex (0 3 5 2 0 3 4 1) (200 20 1) simpleGrading (1 1 1)
);
 
edges
(
	 arc 1 2 (0 1.000000e-02 0)
	 arc 4 5 (2.820000e+00 1.000000e-02 0)
);

boundary
(
	 inlet
	 {
		 type patch;
		 faces
		 (
			 (0 1 2 0)
		 );
	 }
	 outlet
	 {
		 type patch;
		 faces
		 (
			 (3 5 4 3)
		 );
	 }
	 top
	 {
		 type wall;
		 faces
		 (
			 (1 4 5 2)
		 );
	 }
	 front
	 {
		 type symmetry;
		 faces
		 (
			 (0 3 4 1)
		 );
	 }
	 back
	 {
		 type symmetry;
		 faces
		 (
			 (0 2 5 3)
		 );
	 }
	 axis
	 {
		 type empty;
		 faces
		 (
			 (0 3 3 0)
		 );
	 }
);
mergePatchPairs
(
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *// 

25 degrees wedge condition:

/*--------------------------------*- 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 0 0)
	(0 9.762960e-03 2.164396e-03)
	(0 9.762960e-03 -2.164396e-03)
	(2.820000e+00 0 0)
	(2.820000e+00 9.762960e-03 2.164396e-03)
	(2.820000e+00 9.762960e-03 -2.164396e-03)
);

blocks
(
	 hex(0 3 5 2 0 3 4 1) (200 20 1) simpleGrading (1 0.1 1)
);
 
edges
(
	 arc 1 2 (0 1.000000e-02 0)
	 arc 4 5 (2.820000e+00 1.000000e-02 0)
);

boundary
(
	 inlet
	 {
		 type patch;
		 faces
		 (
			 (0 1 2 0)
		 );
	 }
	 outlet
	 {
		 type patch;
		 faces
		 (
			 (3 5 4 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
(
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *// 

45 degree wedge condition:

/*--------------------------------*- 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 0 0)
	(0 9.238795e-03 3.826834e-03)
	(0 9.238795e-03 -3.826834e-03)
	(2.820000e+00 0 0)
	(2.820000e+00 9.238795e-03 3.826834e-03)
	(2.820000e+00 9.238795e-03 -3.826834e-03)
	
);

blocks
(
	 hex (0 3 5 2 0 3 4 1) (200 20 1) simpleGrading (1 1 1)
);
 
edges
(
	 arc 1 2 (0 1.000000e-02 0)
	 arc 4 5 (2.820000e+00 1.000000e-02 0)
);

boundary
(
	 inlet
	 {
		 type patch;
		 faces
		 (
			 (0 1 2 0)
		 );
	 }
	 outlet
	 {
		 type patch;
		 faces
		 (
			 (3 5 4 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
(
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *// 

10 degree wedge condition:

/*--------------------------------*- 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 0 0)
	(0 9.961947e-03 8.715574e-04)
	(0 9.961947e-03 -8.715574e-04)
	(2.820000e+00 0 0)
	(2.820000e+00 9.961947e-03 8.715574e-04)
	(2.820000e+00 9.961947e-03 -8.715574e-04)
	
);

blocks
(
	 hex (0 3 5 2 0 3 4 1) (200 20 1) simpleGrading (1 1 1)
);
 
edges
(
	 arc 1 2 (0 1.000000e-02 0)
	 arc 4 5 (2.820000e+00 1.000000e-02 0)
);

boundary
(
	 inlet
	 {
		 type patch;
		 faces
		 (
			 (0 1 2 0)
		 );
	 }
	 outlet
	 {
		 type patch;
		 faces
		 (
			 (3 5 4 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
(
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *// 

10 degree symmetry condition:

/*--------------------------------*- 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 0 0)
	(0 9.961947e-03 8.715574e-04)
	(0 9.961947e-03 -8.715574e-04)
	(2.820000e+00 0 0)
	(2.820000e+00 9.961947e-03 8.715574e-04)
	(2.820000e+00 9.961947e-03 -8.715574e-04)
);

blocks
(
	 hex(0 3 5 2 0 3 4 1) (200 20 1) simpleGrading (1 0.1 1)
);
 
edges
(
	 arc 1 2 (0 1.000000e-02 0)
	 arc 4 5 (2.820000e+00 1.000000e-02 0)
);

boundary
(
	 inlet
	 {
		 type patch;
		 faces
		 (
			 (0 1 2 0)
		 );
	 }
	 outlet
	 {
		 type patch;
		 faces
		 (
			 (3 5 4 3)
		 );
	 }
	 top
	 {
		 type wall;
		 faces
		 (
			 (1 4 5 2)
		 );
	 }
	 front
	 {
		 type symmetry;
		 faces
		 (
			 (0 3 4 1)
		 );
	 }
	 back
	 {
		 type symmetry;
		 faces
		 (
			 (0 2 5 3)
		 );
	 }
	 axis
	 {
		 type empty;
		 faces
		 (
			 (0 3 3 0)
		 );
	 }
mergePatchPairs
(
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *// 

45 degree symmetry condition:

/*--------------------------------*- 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 0 0)
	(0 9.238795e-03 3.826834e-03)
	(0 9.238795e-03 -3.826834e-03)
	(2.820000e+00 0 0)
	(2.820000e+00 9.238795e-03 3.826834e-03)
	(2.820000e+00 9.238795e-03 -3.826834e-03)
);

blocks
(
	 hex(0 3 5 2 0 3 4 1) (200 20 1) simpleGrading (1 0.1 1)
);
 
edges
(
	 arc 1 2 (0 1.000000e-02 0)
	 arc 4 5 (2.820000e+00 1.000000e-02 0)
);

boundary
(
	 inlet
	 {
		 type patch;
		 faces
		 (
			 (0 1 2 0)
		 );
	 }
	 outlet
	 {
		 type patch;
		 faces
		 (
			 (3 5 4 3)
		 );
	 }
	 top
	 {
		 type wall;
		 faces
		 (
			 (1 4 5 2)
		 );
	 }
	 front
	 {
		 type symmetry;
		 faces
		 (
			 (0 3 4 1)
		 );
	 }
	 back
	 {
		 type symmetry;
		 faces
		 (
			 (0 2 5 3)
		 );
	 }
	 axis
	 {
		 type empty;
		 faces
		 (
			 (0 3 3 0)
		 );
	 }
mergePatchPairs
(
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *// 

Velocity profile at 25 degrees wedge condition:

Velocity profile at 45 degrees wedge condition:

Velocity profile at 10 degree wedge condition:

Shear stress at 45 wedge condition:

velocity at 45 wedge condition:

Shear stress 25 degree wedge condition:

velocity at 25 wedge condition:

Shear stress 10 dgree wedge condition:

Velocity at 10 dgree wedge condition:

Shear stress wedge condition 10 degree symmetry:

Velocity 10 degree symmetry condition:

Velcoity at 25 degrees symmetry condition:

Shear stress at symmetry condition:

Velocity at 45 degrees symmetry condition:

Shear stress at 45 degrees symmetry condition:

Pressure drop for fully developed flow:

From the graph we can see the maximum value = 0.16-0.03 =0.13 units = 130 Pa.

Procedure explanation:

1.In openFoam ,choose the icoFoam solver in which we are working on incompressible laminar flow .

2.Copy the file from the solver in the run folder to simulate the file ,then we change the file geometry in blockMeshDict file .

3.Here we writ code for blockMeshDict file in matlab using file parsing and open it in OpenFoam and the boundary conditions for the simulatin are set in the Velocity and Pressure file and the Transport properties and controlDict file are suitably changed according to the flow .

4.After all the changes the blockMesh and checkMesh command are run to find the correctness of the geometry and the mesh and the solver icoFoam is run to simulate the geometry.

Post process procedure:

1. The paraFoam command is used to simulate the geometry in paraview .

2.The velocity and the shear stress is plotted using the plot over line method.

3.The simulation of the velocity and pressure profile is saved .

Shear stress Plot:

Shear stress is the maximum near the wall because of the friction that wall has.But as we move away from the wall, the shear force decreases,and it can be confirmed from the shear stress graphs above

Comparison between the two boundary conditions:

The simulation for the two boundary conditions ;those are symmetry and wedge boundary condition .During the wedge boundary condition simulation, the simulation across the arc of the wedge is done;hence the simulation time is higher in that case.The courant number is increaing slightly in case of wedge boundary condition will be slightly more accurate .The symmetry boundary condition considers the Mesh as 3D and the calculation is done along the three global axes. We understand the results should not change due the change in the boundary conditions.

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.