All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
Objective: To study the effect of the wedge angle and the Boundary Conditions on the simulation of an axisymmetric laminar flow in a cylindrical pipe. The given wedge angles in degrees are- 10 25 45 Axi-symmetric flow: A flow pattern is axisymmetric when it is identical in every plane that passes through…
Ravi Shankar Yadav
updated on 11 Jan 2022
Objective:
To study the effect of the wedge angle and the Boundary Conditions on the simulation of an axisymmetric laminar flow in a cylindrical pipe.
The given wedge angles in degrees are-
Axi-symmetric flow:
A flow pattern is axisymmetric when it is identical in every plane that passes through a certain straight line. The straight line is the symmetry axis. Every longitudinal plane through the axis would exhibit the same streamline pattern.
Hagen Poiseuille's Equation:
In nonideal fluid dynamics, the Hagen–Poiseuille equation is a physical law that gives the pressure drop in an incompressible and Newtonian fluid in laminar flow flowing through a long cylindrical pipe of a constant cross-section.
Laminar Flow:
In fluid dynamics, laminar flow is a type of fluid flow in which the fluid travels smoothly or in regular paths.
The diagrammatic representation of flow through the pipe. This is what the fluid profile looks like.
Assumption:
Given:
Analytical Solution:
MATLAB:
The code for Wedge Boundary Condition (Wedge angle will be taken from user input)
% Matlab code for generating the blockMeshDict file
% Wedge Boundary Condition
% Wedge angles = 10, 25, 45 degrees
clear all
close all
clc
% Inputs
% Wedge angle
% Take angle as input from 10, 25, 45 degrees
theta = input('Enter the value of wedge angle = ');
% Reynolds number
Re =2100;
% Diameter
D=0.02;
% Length
L=0.06*Re*D;
% Radius
R=D/2;
% Dynamic viscosity
mu=0.89e-3;
% Density
rho=997.0;
% Kinematic viscosity
nu=mu/rho;
% Pressure and velocity
v_avg=Re*mu/(D*rho);
v_max=2*v_avg;
del_P =(32*mu*v_avg*L)/(D^2);
kin_P=del_P/rho;
n1=50;
n2=1;
n3=300;
gfactor=0.5;
% Vertices of the wedge
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 contents of blockMesh file
string1='/*-------------------------------------*- C++ -*---------------------*\';
string2=' ========= | ';
string3=' \ / F ield | ';
string4=' \ / O peration |OPENFOAM:The Open Source CFD Toolbox ';
string5=' \ / A nd |Version: 9 ';
string6=' \ / M anipulation |Website: https://openfoam.org ';
string7='\*-------------------------------------------------------------------*/';
string8='FoamFile';
string9='{';
string10=' version 2.0;';
string11=' format ascii;';
string12=' class dictionary;';
string13=' object blockMeshDict;';
string14='}';
string15='//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //';
string16='//*******************************************************************//';
fpointer=fopen('blockMeshDict.txt','wt');
fprintf(fpointer,'%s\n',string1);
fprintf(fpointer,'%s\n',string2);
fprintf(fpointer,'%s\n',string3);
fprintf(fpointer,'%s\n',string4);
fprintf(fpointer,'%s\n',string5);
fprintf(fpointer,'%s\n',string6);
fprintf(fpointer,'%s\n \n',string7);
fprintf(fpointer,'%s\n',string8);
fprintf(fpointer,'%s\n',string9);
fprintf(fpointer,'%s\n',string10);
fprintf(fpointer,'%s\n',string11);
fprintf(fpointer,'%s\n',string12);
fprintf(fpointer,'%s\n',string13);
fprintf(fpointer,'%s\n',string14);
fprintf(fpointer,'%s\n \n',string15);
fprintf(fpointer,'%s\n','convertToMeters 1;');
fprintf(fpointer,'%s\n','vertices');
fprintf(fpointer,'%s\n','(');
fprintf(fpointer,'%s (%f %f %f)\n',blanks(5),V0(1),V0(2),V0(3));
fprintf(fpointer,'%s (%f %f %f)\n',blanks(5),V1(1),V1(2),V1(3));
fprintf(fpointer,'%s (%f %f %f)\n',blanks(5),V2(1),V2(2),V2(3));
fprintf(fpointer,'%s (%f %f %f)\n',blanks(5),V3(1),V3(2),V3(3));
fprintf(fpointer,'%s (%f %f %f)\n',blanks(5),V4(1),V4(2),V4(3));
fprintf(fpointer,'%s (%f %f %f)\n',blanks(5),V5(1),V5(2),V5(3));
fprintf(fpointer,'%s\n',');');
fprintf(fpointer,'\n');
fprintf(fpointer,'%s\n','blocks');
fprintf(fpointer,'%s\n','(');
fprintf(fpointer,'%s %s \n',blanks(5),'hex (0 1 2 0 3 4 5 3 ) (50 1 200) simpleGrading (0.5 1 1)');
fprintf(fpointer,'%s\n',');');
fprintf(fpointer,'\n');
fprintf(fpointer,'%s\n','edges');
fprintf(fpointer,'%s\n','(');
fprintf(fpointer,'%s arc 1 2 (%f %f %f)\n',blanks(5),0,R,0);
fprintf(fpointer,'%s arc 4 5 (%f %f %f)\n',blanks(5),0,R,0);
fprintf(fpointer,'%s\n',');');
fprintf(fpointer,'\n');
fprintf(fpointer,'%s\n','boundary');
fprintf(fpointer,'%s\n','(');
fprintf(fpointer,'%s %s\n',blanks(5),'inlet');
fprintf(fpointer,'%s %s\n',blanks(5),'{');
fprintf(fpointer,'%s %s\n',blanks(10),'type patch;');
fprintf(fpointer,'%s %s\n',blanks(10),'faces');
fprintf(fpointer,'%s %s\n',blanks(10),'(');
fprintf(fpointer,'%s %s\n',blanks(15),'(0 1 2 0 )');
fprintf(fpointer,'%s %s\n',blanks(10),');');
fprintf(fpointer,'%s %s\n',blanks(5),'}');
fprintf(fpointer,'%s %s\n',blanks(5),'outlet');
fprintf(fpointer,'%s %s\n',blanks(5),'{');
fprintf(fpointer,'%s %s\n',blanks(10),'type patch;');
fprintf(fpointer,'%s %s\n',blanks(10),'faces');
fprintf(fpointer,'%s %s\n',blanks(10),'(');
fprintf(fpointer,'%s %s\n',blanks(15),'(3 4 5 3)');
fprintf(fpointer,'%s %s\n',blanks(10),');');
fprintf(fpointer,'%s %s\n',blanks(5),'}');
fprintf(fpointer,'%s %s\n',blanks(5),'front');
fprintf(fpointer,'%s %s\n',blanks(5),'{');
fprintf(fpointer,'%s %s\n',blanks(10),'type wedge;');
fprintf(fpointer,'%s %s\n',blanks(10),'faces');
fprintf(fpointer,'%s %s\n',blanks(10),'(');
fprintf(fpointer,'%s %s\n',blanks(15),'(0 3 5 2)');
fprintf(fpointer,'%s %s\n',blanks(10),');');
fprintf(fpointer,'%s %s\n',blanks(5),'}');
fprintf(fpointer,'%s %s\n',blanks(5),'back');
fprintf(fpointer,'%s %s\n',blanks(5),'{');
fprintf(fpointer,'%s %s\n',blanks(10),'type wedge;');
fprintf(fpointer,'%s %s\n',blanks(10),'faces');
fprintf(fpointer,'%s %s\n',blanks(10),'(');
fprintf(fpointer,'%s %s\n',blanks(15),'(0 1 4 3)');
fprintf(fpointer,'%s %s\n',blanks(10),');');
fprintf(fpointer,'%s %s\n',blanks(5),'}');
fprintf(fpointer,'%s %s\n',blanks(5),'pipe');
fprintf(fpointer,'%s %s\n',blanks(5),'{');
fprintf(fpointer,'%s %s\n',blanks(10),'type wall;');
fprintf(fpointer,'%s %s\n',blanks(10),'faces');
fprintf(fpointer,'%s %s\n',blanks(10),'(');
fprintf(fpointer,'%s %s\n',blanks(15),'(1 4 5 2)');
fprintf(fpointer,'%s %s\n',blanks(10),');');
fprintf(fpointer,'%s %s\n',blanks(5),'}');
fprintf(fpointer,'%s %s\n',blanks(5),'axis');
fprintf(fpointer,'%s %s\n',blanks(5),'{');
fprintf(fpointer,'%s %s\n',blanks(10),'type empty;');
fprintf(fpointer,'%s %s\n',blanks(10),'faces');
fprintf(fpointer,'%s %s\n',blanks(10),'(');
fprintf(fpointer,'%s %s\n',blanks(15),'(0 3 3 0)');
fprintf(fpointer,'%s %s\n',blanks(10),');');
fprintf(fpointer,'%s %s\n',blanks(5),'}');
fprintf(fpointer,'%s\n',');');
fprintf(fpointer,'\n');
fprintf(fpointer,'%s\n','mergePatchPairs');
fprintf(fpointer,'%s\n','(');
fprintf(fpointer,'%s\n',');');
fprintf(fpointer,'\n');
fprintf(fpointer,'%s\n',string16);
fclose(fpointer);
The blockMeshDict File for wedge boundary condition at 45 degrees
/*-------------------------------------*- C++ -*---------------------*\
========= |
\ / F ield |
\ / O peration |OPENFOAM:The Open Source CFD Toolbox
\ / A nd |Version: 9
\ / M anipulation |Website: https://openfoam.org
\*-------------------------------------------------------------------*/
FoamFile
{
version 2.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)
(2.520000 0.000000 0.000000)
(2.520000 0.009239 -0.003827)
(2.520000 0.009239 0.003827)
);
blocks
(
hex (0 1 2 0 3 4 5 3 ) (50 1 200) simpleGrading (0.5 1 1)
);
edges
(
arc 1 2 (0.000000 0.010000 0.000000)
arc 4 5 (0.000000 0.010000 0.000000)
);
boundary
(
inlet
{
type patch;
faces
(
(0 1 2 0 )
);
}
outlet
{
type patch;
faces
(
(3 4 5 3)
);
}
front
{
type wedge;
faces
(
(0 3 5 2)
);
}
back
{
type wedge;
faces
(
(0 1 4 3)
);
}
pipe
{
type wall;
faces
(
(1 4 5 2)
);
}
axis
{
type empty;
faces
(
(0 3 3 0)
);
}
);
mergePatchPairs
(
);
//*******************************************************************//
The blockMeshDict File for wedge boundary condition at 25 degrees
/*-------------------------------------*- C++ -*---------------------*\
========= |
\ / F ield |
\ / O peration |OPENFOAM:The Open Source CFD Toolbox
\ / A nd |Version: 9
\ / M anipulation |Website: https://openfoam.org
\*-------------------------------------------------------------------*/
FoamFile
{
version 2.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)
(2.520000 0.000000 0.000000)
(2.520000 0.009763 -0.002164)
(2.520000 0.009763 0.002164)
);
blocks
(
hex (0 1 2 0 3 4 5 3 ) (50 1 200) simpleGrading (0.5 1 1)
);
edges
(
arc 1 2 (0.000000 0.010000 0.000000)
arc 4 5 (0.000000 0.010000 0.000000)
);
boundary
(
inlet
{
type patch;
faces
(
(0 1 2 0 )
);
}
outlet
{
type patch;
faces
(
(3 4 5 3)
);
}
front
{
type wedge;
faces
(
(0 3 5 2)
);
}
back
{
type wedge;
faces
(
(0 1 4 3)
);
}
pipe
{
type wall;
faces
(
(1 4 5 2)
);
}
axis
{
type empty;
faces
(
(0 3 3 0)
);
}
);
mergePatchPairs
(
);
//*******************************************************************//
The blockMeshDict File for wedge boundary condition at 10 degrees
/*-------------------------------------*- C++ -*---------------------*\
========= |
\ / F ield |
\ / O peration |OPENFOAM:The Open Source CFD Toolbox
\ / A nd |Version: 9
\ / M anipulation |Website: https://openfoam.org
\*-------------------------------------------------------------------*/
FoamFile
{
version 2.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)
(2.520000 0.000000 0.000000)
(2.520000 0.009962 -0.000872)
(2.520000 0.009962 0.000872)
);
blocks
(
hex (0 1 2 0 3 4 5 3 ) (50 1 200) simpleGrading (0.5 1 1)
);
edges
(
arc 1 2 (0.000000 0.010000 0.000000)
arc 4 5 (0.000000 0.010000 0.000000)
);
boundary
(
inlet
{
type patch;
faces
(
(0 1 2 0 )
);
}
outlet
{
type patch;
faces
(
(3 4 5 3)
);
}
front
{
type wedge;
faces
(
(0 3 5 2)
);
}
back
{
type wedge;
faces
(
(0 1 4 3)
);
}
pipe
{
type wall;
faces
(
(1 4 5 2)
);
}
axis
{
type empty;
faces
(
(0 3 3 0)
);
}
);
mergePatchPairs
(
);
//*******************************************************************//
ControlDict File for wedge Boundary Condition
/*--------------------------------*- 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 10;
deltaT 0.001;
writeControl timeStep;
writeInterval 20;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
// ************************************************************************* //
Pressure File for Wedge Boundary Condition
/*--------------------------------*- 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;
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type fixedValue;
value uniform 0.0168682;
}
axis
{
type empty;
}
pipe
{
type zeroGradient;
}
front
{
type wedge;
}
back
{
type wedge;
}
}
// ************************************************************************* //
Velocity File for Wedge Boundary Condition
/*--------------------------------*- 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 volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
inlet
{
type fixedValue;
value uniform (0.0937312 0 0);
}
outlet
{
type zeroGradient;
}
axis
{
type empty;
}
pipe
{
type noSlip;
}
front
{
type wedge;
}
back
{
type wedge;
}
}
// ************************************************************************* //
TransportProperties File for Wedge Boundary Condition
/*--------------------------------*- 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.927e-07;
// ************************************************************************* //
The code for Symmetry Boundary Condition (Wedge angle will be taken from user input)
% Matlab code for generating the blockMeshDict file
% Symmetry Boundary Condition
% Wedge angles = 10, 25, 45 degrees
clear all
close all
clc
% Inputs
% Wedge angle
% Take angle as input from 10, 25, 45 degrees
theta = input('Enter the value of wedge angle = ');
% Reynolds number
Re =2100;
% Diameter
D=0.02;
% Length
L=0.06*Re*D;
% Radius
R=D/2;
% Dynamic viscosity
mu=0.89e-3;
% Density
rho=997.0;
% Kinematic viscosity
nu=mu/rho;
% Pressure and velocity
v_avg=Re*mu/(D*rho);
v_max=2*v_avg;
del_P =(32*mu*v_avg*L)/(D^2);
kin_P=del_P/rho;
n1=50;
n2=1;
n3=300;
gfactor=0.5;
% Vertices of the wedge
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 contents of blockMesh file
string1='/*-------------------------------------*- C++ -*---------------------*\';
string2=' ========= | ';
string3=' \ / F ield | ';
string4=' \ / O peration |OPENFOAM:The Open Source CFD Toolbox ';
string5=' \ / A nd |Version: 9 ';
string6=' \ / M anipulation |Website: https://openfoam.org ';
string7='\*-------------------------------------------------------------------*/';
string8='FoamFile';
string9='{';
string10=' version 2.0;';
string11=' format ascii;';
string12=' class dictionary;';
string13=' object blockMeshDict;';
string14='}';
string15='//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //';
string16='//*******************************************************************//';
fpointer=fopen('blockMeshDict.txt','wt');
fprintf(fpointer,'%s\n',string1);
fprintf(fpointer,'%s\n',string2);
fprintf(fpointer,'%s\n',string3);
fprintf(fpointer,'%s\n',string4);
fprintf(fpointer,'%s\n',string5);
fprintf(fpointer,'%s\n',string6);
fprintf(fpointer,'%s\n \n',string7);
fprintf(fpointer,'%s\n',string8);
fprintf(fpointer,'%s\n',string9);
fprintf(fpointer,'%s\n',string10);
fprintf(fpointer,'%s\n',string11);
fprintf(fpointer,'%s\n',string12);
fprintf(fpointer,'%s\n',string13);
fprintf(fpointer,'%s\n',string14);
fprintf(fpointer,'%s\n \n',string15);
fprintf(fpointer,'%s\n','convertToMeters 1;');
fprintf(fpointer,'%s\n','vertices');
fprintf(fpointer,'%s\n','(');
fprintf(fpointer,'%s (%f %f %f)\n',blanks(5),V0(1),V0(2),V0(3));
fprintf(fpointer,'%s (%f %f %f)\n',blanks(5),V1(1),V1(2),V1(3));
fprintf(fpointer,'%s (%f %f %f)\n',blanks(5),V2(1),V2(2),V2(3));
fprintf(fpointer,'%s (%f %f %f)\n',blanks(5),V3(1),V3(2),V3(3));
fprintf(fpointer,'%s (%f %f %f)\n',blanks(5),V4(1),V4(2),V4(3));
fprintf(fpointer,'%s (%f %f %f)\n',blanks(5),V5(1),V5(2),V5(3));
fprintf(fpointer,'%s\n',');');
fprintf(fpointer,'\n');
fprintf(fpointer,'%s\n','blocks');
fprintf(fpointer,'%s\n','(');
fprintf(fpointer,'%s %s \n',blanks(5),'hex (0 1 2 0 3 4 5 3 ) (50 1 200) simpleGrading (0.5 1 1)');
fprintf(fpointer,'%s\n',');');
fprintf(fpointer,'\n');
fprintf(fpointer,'%s\n','edges');
fprintf(fpointer,'%s\n','(');
fprintf(fpointer,'%s arc 1 2 (%f %f %f)\n',blanks(5),0,R,0);
fprintf(fpointer,'%s arc 4 5 (%f %f %f)\n',blanks(5),0,R,0);
fprintf(fpointer,'%s\n',');');
fprintf(fpointer,'\n');
fprintf(fpointer,'%s\n','boundary');
fprintf(fpointer,'%s\n','(');
fprintf(fpointer,'%s %s\n',blanks(5),'inlet');
fprintf(fpointer,'%s %s\n',blanks(5),'{');
fprintf(fpointer,'%s %s\n',blanks(10),'type patch;');
fprintf(fpointer,'%s %s\n',blanks(10),'faces');
fprintf(fpointer,'%s %s\n',blanks(10),'(');
fprintf(fpointer,'%s %s\n',blanks(15),'(0 1 2 0 )');
fprintf(fpointer,'%s %s\n',blanks(10),');');
fprintf(fpointer,'%s %s\n',blanks(5),'}');
fprintf(fpointer,'%s %s\n',blanks(5),'outlet');
fprintf(fpointer,'%s %s\n',blanks(5),'{');
fprintf(fpointer,'%s %s\n',blanks(10),'type patch;');
fprintf(fpointer,'%s %s\n',blanks(10),'faces');
fprintf(fpointer,'%s %s\n',blanks(10),'(');
fprintf(fpointer,'%s %s\n',blanks(15),'(3 4 5 3)');
fprintf(fpointer,'%s %s\n',blanks(10),');');
fprintf(fpointer,'%s %s\n',blanks(5),'}');
fprintf(fpointer,'%s %s\n',blanks(5),'front');
fprintf(fpointer,'%s %s\n',blanks(5),'{');
fprintf(fpointer,'%s %s\n',blanks(10),'type symmetry;');
fprintf(fpointer,'%s %s\n',blanks(10),'faces');
fprintf(fpointer,'%s %s\n',blanks(10),'(');
fprintf(fpointer,'%s %s\n',blanks(15),'(0 3 5 2)');
fprintf(fpointer,'%s %s\n',blanks(10),');');
fprintf(fpointer,'%s %s\n',blanks(5),'}');
fprintf(fpointer,'%s %s\n',blanks(5),'back');
fprintf(fpointer,'%s %s\n',blanks(5),'{');
fprintf(fpointer,'%s %s\n',blanks(10),'type symmetry;');
fprintf(fpointer,'%s %s\n',blanks(10),'faces');
fprintf(fpointer,'%s %s\n',blanks(10),'(');
fprintf(fpointer,'%s %s\n',blanks(15),'(0 1 4 3)');
fprintf(fpointer,'%s %s\n',blanks(10),');');
fprintf(fpointer,'%s %s\n',blanks(5),'}');
fprintf(fpointer,'%s %s\n',blanks(5),'pipe');
fprintf(fpointer,'%s %s\n',blanks(5),'{');
fprintf(fpointer,'%s %s\n',blanks(10),'type wall;');
fprintf(fpointer,'%s %s\n',blanks(10),'faces');
fprintf(fpointer,'%s %s\n',blanks(10),'(');
fprintf(fpointer,'%s %s\n',blanks(15),'(1 4 5 2)');
fprintf(fpointer,'%s %s\n',blanks(10),');');
fprintf(fpointer,'%s %s\n',blanks(5),'}');
fprintf(fpointer,'%s %s\n',blanks(5),'axis');
fprintf(fpointer,'%s %s\n',blanks(5),'{');
fprintf(fpointer,'%s %s\n',blanks(10),'type empty;');
fprintf(fpointer,'%s %s\n',blanks(10),'faces');
fprintf(fpointer,'%s %s\n',blanks(10),'(');
fprintf(fpointer,'%s %s\n',blanks(15),'(0 3 3 0)');
fprintf(fpointer,'%s %s\n',blanks(10),');');
fprintf(fpointer,'%s %s\n',blanks(5),'}');
fprintf(fpointer,'%s\n',');');
fprintf(fpointer,'\n');
fprintf(fpointer,'%s\n','mergePatchPairs');
fprintf(fpointer,'%s\n','(');
fprintf(fpointer,'%s\n',');');
fprintf(fpointer,'\n');
fprintf(fpointer,'%s\n',string16);
fclose(fpointer);
The blockMeshDict File for symmetry boundary condition at 45 degrees
/*-------------------------------------*- C++ -*---------------------*\
========= |
\ / F ield |
\ / O peration |OPENFOAM:The Open Source CFD Toolbox
\ / A nd |Version: 9
\ / M anipulation |Website: https://openfoam.org
\*-------------------------------------------------------------------*/
FoamFile
{
version 2.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)
(2.520000 0.000000 0.000000)
(2.520000 0.009239 -0.003827)
(2.520000 0.009239 0.003827)
);
blocks
(
hex (0 1 2 0 3 4 5 3 ) (50 1 200) simpleGrading (0.5 1 1)
);
edges
(
arc 1 2 (0.000000 0.010000 0.000000)
arc 4 5 (0.000000 0.010000 0.000000)
);
boundary
(
inlet
{
type patch;
faces
(
(0 1 2 0 )
);
}
outlet
{
type patch;
faces
(
(3 4 5 3)
);
}
front
{
type symmetry;
faces
(
(0 3 5 2)
);
}
back
{
type symmetry;
faces
(
(0 1 4 3)
);
}
pipe
{
type wall;
faces
(
(1 4 5 2)
);
}
axis
{
type empty;
faces
(
(0 3 3 0)
);
}
);
mergePatchPairs
(
);
//*******************************************************************//
The blockMeshDict File for symmetry boundary condition at 25 degrees
/*-------------------------------------*- C++ -*---------------------*\
========= |
\ / F ield |
\ / O peration |OPENFOAM:The Open Source CFD Toolbox
\ / A nd |Version: 9
\ / M anipulation |Website: https://openfoam.org
\*-------------------------------------------------------------------*/
FoamFile
{
version 2.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)
(2.520000 0.000000 0.000000)
(2.520000 0.009763 -0.002164)
(2.520000 0.009763 0.002164)
);
blocks
(
hex (0 1 2 0 3 4 5 3 ) (50 1 200) simpleGrading (0.5 1 1)
);
edges
(
arc 1 2 (0.000000 0.010000 0.000000)
arc 4 5 (0.000000 0.010000 0.000000)
);
boundary
(
inlet
{
type patch;
faces
(
(0 1 2 0 )
);
}
outlet
{
type patch;
faces
(
(3 4 5 3)
);
}
front
{
type symmetry;
faces
(
(0 3 5 2)
);
}
back
{
type symmetry;
faces
(
(0 1 4 3)
);
}
pipe
{
type wall;
faces
(
(1 4 5 2)
);
}
axis
{
type empty;
faces
(
(0 3 3 0)
);
}
);
mergePatchPairs
(
);
//*******************************************************************//
The blockMeshDict File for symmetry boundary condition at 10 degrees
/*-------------------------------------*- C++ -*---------------------*\
========= |
\ / F ield |
\ / O peration |OPENFOAM:The Open Source CFD Toolbox
\ / A nd |Version: 9
\ / M anipulation |Website: https://openfoam.org
\*-------------------------------------------------------------------*/
FoamFile
{
version 2.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)
(2.520000 0.000000 0.000000)
(2.520000 0.009962 -0.000872)
(2.520000 0.009962 0.000872)
);
blocks
(
hex (0 1 2 0 3 4 5 3 ) (50 1 200) simpleGrading (0.5 1 1)
);
edges
(
arc 1 2 (0.000000 0.010000 0.000000)
arc 4 5 (0.000000 0.010000 0.000000)
);
boundary
(
inlet
{
type patch;
faces
(
(0 1 2 0 )
);
}
outlet
{
type patch;
faces
(
(3 4 5 3)
);
}
front
{
type symmetry;
faces
(
(0 3 5 2)
);
}
back
{
type symmetry;
faces
(
(0 1 4 3)
);
}
pipe
{
type wall;
faces
(
(1 4 5 2)
);
}
axis
{
type empty;
faces
(
(0 3 3 0)
);
}
);
mergePatchPairs
(
);
//*******************************************************************//
Pressure File for symmetry boundary condition
/*--------------------------------*- 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;
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type fixedValue;
value uniform 0.0168682;
}
axis
{
type empty;
}
pipe
{
type zeroGradient;
}
front
{
type symmetry;
}
back
{
type symmetry;
}
}
// ************************************************************************* //
Velocity File for symmetry boundary condition
/*--------------------------------*- 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 volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
inlet
{
type fixedValue;
value uniform (0.0937312 0 0);
}
outlet
{
type zeroGradient;
}
axis
{
type empty;
}
pipe
{
type noSlip;
}
front
{
type symmetry;
}
back
{
type symmetry;
}
}
// ************************************************************************* //
Output:
Velocity Profile
Wedge BC at 10-degree Symmetry BC at 10 degree
Wedge BC at 25-degree Symmetry BC at 25 degree
Wedge BC at 45-degree Symmetry BC at 45 degree
Pressure Profile
Wedge BC at 10-degree Symmetry BC at 10 degree
Wedge BC at 25-degree Symmetry BC at 25 degree
Wedge BC at 45-degree Symmetry BC at 45 degree
Velocity Graph
Wedge BC at 10-degree Symmetry BC at 10 degree
Wedge BC at 25-degree Symmetry BC at 25 degree
Wedge BC at 45-degree Symmetry BC at 45 degree
Pressure Graph
Wedge BC at 10-degree Symmetry BC at 10 degree
Wedge BC at 25-degree Symmetry BC at 25 degree
Wedge BC at 45-degree Symmetry BC at 45 degree
Shear Stress Graph
Wedge BC at 10-degree Symmetry BC at 10 degree
Wedge BC at 25-degree Symmetry BC at 25 degree
Wedge BC at 45-degree Symmetry BC at 45 degree
Results:
To validate the Hydrodynamic length with the Numerical Result:
In fluid dynamics, the entrance length is the distance a flow travels after entering a pipe before the flow becomes fully developed.
Numerically, we know that the velocity profile will be different before and after the Hydrodynamic entry length. After the Hydrodynamic entry length, the Velocity profile will be the final parabolic profile that it must have in a fully developed region.
To calculate the Hydrodynamic length analytically,
Lh=0.005⋅Re⋅D
where, Re = Reynolds number; D = Diameter.
Lh = 0.005*2100*0.02 = 0.21 m
To validate Maximum Pressure drop in the Fully developed Region:
Pressure Drop, ΔP = 32×0.00089×2.52×0.093730.022 = 16.817 Pa
From the graph, max P = 0.039 * 1000 Pa; min P = 0.022 * 1000 Pa
so, Pressure drop = 0.017*1000 = 17 Pa
Error in drop = Numerical - Practical = 17 - 16.817 = 0.183 Pa
To validate Maximum Velocity:
Average Velocity, Vavg=Re⋅μρ⋅D = 0.09373 ms−1
Maximum velocity, Vmax=2⋅Vavg = 0.18746 ms−1
From the graph, we can that observe max velocity is 0.15 ms−1
Error = |Numerical Velocity - Graphical Velocity| = |0.15 - 0.18746| = 0.03746
Comparison between the two Boundary Conditions:
Leave a comment
Thanks for choosing to leave a comment. Please keep in mind that all the comments are moderated as per our comment policy, and your email will not be published for privacy reasons. Please leave a personal & meaningful conversation.
Other comments...
Week-11 : Discretization of 3D intake manifold using GEM-3D
Aim: Discretization of 3D intake manifold using GEM-3D Objective: 1. Tutorial- single cyl DI add case 2 with discretization length 0.1 mm for intake runner and compare with default case 1 Parameters-Torque, BSFC, max cylinder pressure simulation time 2. Explore tutorial no 2 (GEM3D) - “Building intake…
31 Aug 2022 05:57 AM IST
Week-7 : Converting a detailed engine model to a FRM model
Aim: Converting a detailed engine model to an FRM model. Objective: Explore tutorial number 9 and write a detailed report. Build FRM Model for the following configuration using the FRM builder approach. Bore 102 mm stroke 115 mm CR 17 No of cylinder 6 CI engine Twin Scroll Turbine GT Controller Run all cases…
30 Aug 2022 02:54 AM IST
Week-6 : Turbocharger Modelling
Aim: Turbocharger Modelling using GT POWER Objective: List down different TC and locate examples from GT Power Explore tutorial number 6 and 7 Plot operating points on compressor and turbine maps In which application Variable Geometry Turbine is beneficial? Explore example- Diesel VGT EGR and understand the modeling…
22 Aug 2022 10:30 AM IST
Week-4 : Basic Calibration of Single cylinder CI-Engine
Aim: Basic Calibration of Single cylinder CI-Engine Objective: 1. Compare SI vs CI and list down differences (assignment no 2-SI) 2. Comments on the following parameters BSFC Exhaust Temperature A/F ratios 3. Change MFB 50 and observe the impact on performance Comparison: SI vs CI S.No./Engine type …
15 Aug 2022 03:48 PM IST
Related Courses
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.