Week 12 - Symmetry vs Wedge vs HP equation
AIM-: Pipe is a passage with a closed perimeter through which the fluid flows under pressure. The fluid flowing in the pipe is always subjected to resistance due to the shear force between fluid particles and the surface of the pipe. In this principle, we will use the symmetry, wedge, and HP equation form this we will compare the flow through. Flow-through condition simulates through OpenFOAM with Matlab. from this experiment we will get results obtained from solving the Hagen Poisuelle's equation.
INTRODUCTION-:
Flow-through pipe, depend on the Hagen-poiseuille equation, Reynolds numbers, entrance length, and pressure losses.
Hagen-poiseuille equation-:
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 constant cross-section.
In standard fluid-kinetics notation:
where:
- Δp is the pressure difference between the two ends,
- L is the length of pipe,
- μ is the dynamic viscosity,
- Q is the volumetric flow rate,
- R is the pipe radius,
- A is the cross section of pipe.
The Reynolds number-:
The Reynolds number is the ratio of inertial forces to viscous forces and is a convenient parameter for predicting if a flow condition will be laminar or turbulent. It can be interpreted that when the viscous forces are dominant (slow flow, low Re) they are sufficient enough to keep all the fluid particles in line, then the flow is laminar. Even very low Re indicates viscous creeping motion, where inertia effects are negligible. When the inertial forces dominate over the viscous forces (when the fluid is flowing faster and Re is larger) then the flow is turbulent.

Entrance Length-:
Consider a flow entering a pipe. Let us think of the entering flow being uniform, so inviscid. As soon as the flow 'hits' the pipe many changes take place. The most important of these is that viscosity imposes itself on the flow and the "No Slip" condition at the wall of the pipe comes into effect. Consequently the velocity components are each zero on the wall, ie., u = v = 0. The flow adjacent to the wall decelerates continuously. We have a layer close to the body where the velocity builds up slowly from zero at wall to a uniform velocity towards the center of the pipe. This layer is what is called the Boundary Layer. Viscous effects are dominant within the boundary layer. Outside of this layer is the inviscid core where viscous effects are negligible or absent.
The boundary layer is not a static phenomenon; it is dynamic. it grows meaning that its thickness increases as we move downstream. From Fig. it is seen that the boundary layer from the walls grows to such an extent that they all merge on the centreline of the pipe. Once this takes place, inviscid core terminates and the flow is all vicious. The flow is now called a Fully Developed Flow. The velocity profile becomes parabolic. Once the flow is fully developed the velocity profile does not vary in the flow direction. In fact in this region, the pressure gradient and the shear stress in the flow are in balance. The length of the pipe between the start and the point where the fully developed flow begins is called the Entrance Length. As denoted by Le, the entrance length is a function of the Reynolds Number of the flow. In general,

CODING OF SIMULATION-:
blockMeshDict file
clear all
close all
clc
re=2100;
d=0.02;
r=d/2;
theta=input('enter the value of theta angle (preferably less than 5 degrees)');
l_e=0.06*re*d;
l-l_e+0.5;
h=r*sind(theta/2);
v=r*cosd(theta/2);
v0=[0 0 0];
v1=[-h v 0];
v2=[h v 0];
v3=[0 0 l];
v4=[-h v l];
v5=[h v l];
fprintf(f,'%sn','/*--------------------------------*- C++ -*----------------------------------*');
fprintf(f,'%sn','| ========= |');
fprintf(f,'%sn','| \ / F ield | OpenFOAM: The Open Source CFD Toolbox');
fprintf(f,'%sn','| \ / O peration | Version: 4.0');
fprintf(f,'%sn','| \ / A nd | Website: https://openfoam.org');
fprintf(f,'%sn','| \/ M anipulation | ');
fprintf(f,'%sn','*----------------------------------------------------------------------------*/');
fprintf(f,'%sn','FoamFile');
fprintf(f,'%sn','{');
fprintf(f,'%sn',' version 2.0;');
fprintf(f,'%sn',' format ascii;');
fprintf(f,'%sn',' class dictionary;');
fprintf(f,'%sn',' object blockMeshDict;');
fprintf(f,'%sn','}');
fprintf(f,'%sn','// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //');
fprintf(f,'%sn','');
fprintf(f,'%sn','converToMeter 1;');
fprintf(f,'%sn','');
fprintf(f,'%sn','vertices');
fprintf(f,'%sn','(');
fprintf(f,' (%f %f %f)n',v0(1),v0(2),v0(3));
fprintf(f,' (%f %f %f)n',v1(1),v1(2),v1(3));
fprintf(f,' (%f %f %f)n',v2(1),v2(2),v2(3));
fprintf(f,' (%f %f %f)n',v3(1),v3(2),v3(3));
fprintf(f,' (%f %f %f)n',v4(1),v4(2),v4(3));
fprintf(f,' (%f %f %f)n',v5(1),v5(2),v5(3));
fprintf(f,'%sn',');');
fprintf(f,'%sn','');
fprintf(f,'%sn','blocks');
fprintf(f,'%sn','(');
fprintf(f,'%sn',' hex (0 2 1 0 3 5 3) (20 1 500) simpleGrading (1 1 1)');
fprintf(f,'%sn',');');
fprintf(f,'%sn','');
fprintf(f,'%sn','edges');
fprintf(f1,'(');
fprintf(f,'%sn',' arc 1 2 (0 0.01 0)');
fprintf(f,'%sn',' arc 4 5 (3 0.01 0)');
fprintf(f,'%sn',');');
fprintf(f,'%sn','');
fprintf(f,'%sn','boundary');
fprintf(f,'%sn','(');
fprintf(f,'%sn',' inlet');
fprintf(f,'%sn',' {');
fprintf(f,'%sn',' type patch;');
fprintf(f,'%sn',' faces');
fprintf(f,'%sn',' (');
fprintf(f,'%sn',' (0 0 1 2)');
fprintf(f,'%sn',' );');
fprintf(f,'%sn',' }');
fprintf(f,'%sn',' outlet');
fprintf(f,'%sn',' {');
fprintf(f,'%sn',' type patch;');
fprintf(f,'%sn',' faces');
fprintf(f,'%sn',' (');
fprintf(f,'%sn',' (3 5 4 3)');
fprintf(f,'%sn',' );');
fprintf(f,'%sn',' }');
fprintf(f,'%sn',' top');
fprintf(f,'%sn',' {');
fprintf(f,'%sn',' type wall;');
fprintf(f,'%sn',' faces');
fprintf(f,'%sn',' (');
fprintf(f,'%sn',' (1 4 5 2)');
fprintf(f,'%sn',' );');
fprintf(f,'%sn',' }');
fprintf(f,'%sn',' wedge1');
fprintf(f,'%sn',' {');
fprintf(f,'%sn',' type wedge;');
fprintf(f,'%sn',' faces');
fprintf(f,'%sn',' (');
fprintf(f,'%sn',' (0 2 5 3)');
fprintf(f,'%sn',' );');
fprintf(f,'%sn',' }');
fprintf(f,'%sn',' wedge2');
fprintf(f,'%sn',' {');
fprintf(f,'%sn',' type wedge;');
fprintf(f,'%sn',' faces');
fprintf(f,'%sn',' (');
fprintf(f,'%sn',' (0 3 4 1)');
fprintf(f,'%sn',' );');
fprintf(f,'%sn',' }');
fprintf(f,'%sn',' bot');
fprintf(f,'%sn',' {');
fprintf(f,'%sn',' type empty;');
fprintf(f,'%sn',' faces');
fprintf(f,'%sn',' (');
fprintf(f,'%sn',' (0 0 3 3)');
fprintf(f,'%sn',' );');
fprintf(f,'%sn',' }');
fprintf(f,'%sn',');');
fprintf(f,'%sn','');
fprintf(f,'%sn','mergePatchPairs');
fprintf(f,'%sn','(');
fprintf(f,'%sn',');');
fprintf(f,'%sn','');
fprintf(f,'%sn','// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //');
The controlDict file-:
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 8
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application icoFoam;
startFoam startTime;
startTime 0;
stopAt endTime;
endTime 28;
deltaT 0.005;
writeControl timeStep;
writeInterval 20;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression off;
timeFormate general;
TimePrecision 6;
runTimeModifiable true;
// ************************************************************************* //
blockMeshDict for wedge angle 10 degrees for symmetry Boundary 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.000000 0.000000 0.000000)
(-0.000872 0.009962 0.000000)
(0.000872 0.009962 0.000000)
(0.000000 0.000000 3.020000)
(-0.000872 0.009952 3.020000)
(0.000872 0.009952 3.020000)
);
blocks
(
hex (0 2 1 0 3 5 4 3) (20 1 500) simpleGrading (1 1 1)
);
edges
(
arc 1 2 (0 0.01 0)
arc 4 5 (3 0.01 0)
);
boundary
(
inlet
{
type patch;
faces
(
(0 0 1 2)
);
}
outlet
{
type patch;
faces
(
(3 5 4 3)
);
}
top
{
type wall;
faces
(
(1 4 5 2)
);
}
wedge1
{
type wedge;
faces
(
(0 2 5 3)
);
}
wedge2
{
type wedge;
faces
(
(0 3 4 1)
);
}
bot
{
type empty;
faces
(
(0 0 3 3)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //
Initial Condition for pressure -:
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 8
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type fixedValue;
value uniform 0;
}
top
{
type zeroGradient;
}
wedge1
{
type wedge;
}
wedge2
{
type wedge;
}
bot
{
type empty;
}
}
// ************************************************************************* //
Initial condition for velocity-:
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 8
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
inlet
{
type fixedValue;
value uniform (0 0 0.1050);
}
outlet
{
type zeroGradient;
}
top
{
type noslip;
}
wedge1
{
type wedge;
}
wedge2
{
type wedge;
}
bot
{
type empty;
}
}
// ************************************************************************* //
Transport properties
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 8
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant"
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
nu [0 2 -1 0 0 0 0] 0.000001;
// ************************************************************************* //
Matlab script for comparing the velocity and shear stress for different wedge angles for wedge and symmetry boundary conditon-:
m5=readmatrix('45dsu');
u5=m5(:,2);
r5=m5(:,1);
m6=readmatrix('45dwu');
u6=m6(:,2);
r6=m6(:,1);
figure(1)
title('compression of the velocity profile')
plot(r1,u1);
hold on
plot(r2,u2);
plot(r3,u3);
plot(r4,u4);
plot(r5,u5);
plot(r6,u6);
xlabel('radial distance')
ylabel('velocity')
legend('10 degree wedge','10 degree symmetric','25 degree wedge','25 degree symmetric','45 degree wedge','45 degree symmetric')
t1=readmatrix('10dtw');
tau1=t1(:,2);
arc1=t1(:,1);
t2=readmatrix('10dts');
tau2=t2(:,2);
arc2=t2(:,1);
t3=readmatrix('25dwt');
tau3=t3(:,2);
arc3=t3(:,1);
t4=readmatrix('25dst');
tau4=t4(:,2);
arc4=t4(:,1);
t5=readmatrix('45dtw');
tau5=t5(:,2);
arc5=t5(:,1);
t6=readmatrix('45dts');
tau6=t6(:,2);
arc6=t6(:,1);
figure(2)
title('shear stress comprison')
plot(arc1,tau1)
hold on
plot(arc2,tau2)
plot(arc3,tau3)
plot(arc4,tau4)
plot(arc5,tau5)
plot(arc6,tau6)
xlabel('radial distance')
ylabel('shear stress')
legend('10 degree wedge','10 degree symmetric','25 degree wedge','25 degree symmetric','45 degree wedge','45 degree symmetric')
Result-:
MESHING
10-degree mesh-:

25-degree mesh-:

45-degree mesh-:

velocity profile -:

Pressure filed-:

Comparison between velocity and pressure.

Form the above graph, we see that numerical value is near about analytical solution. in this small variation in numerical solution in the analytical solution because of the discretization error
Velocity-:
As per the result, we have seen that as the wedge angle increases the accuracy decrease we can see that although we have used 2 different methods that is wedge and symmetry plane the simulation results are identical.
shear stress-:
As per the result, we have seen that as the wedge angle increases the value of shear stress increases we can see that although we have used 2 different methods that is wedge and symmetry plane the simulation results are identical.
