Symmetry BC vs Wedge BC in OpenFOAM vs Analytical H.P equation
AIM : TO SIMULATE THE WEDGE FLOW USING THE OPEN FOAM FOR DIFFERENT ANGLES OF WEDGE AND TO CAPTURE THE RESULTS THAT.
THE GIVEN ANGLES FOR THE FLOW ARE
10
25
45
simulation flow through a pipe from open foam
objective:
- the main objective of the project is to simulate the flow through the pipe in OPEN FOAM software.
- we have to write the program fro the generation of the blockmeshdict file, or computational mesh for wedge angle and grading scheme.
- calculate the length of the pipe using the entry length formula through the laminar flow through the pipe.
- show that the entry length is enough for producing the fully developed flow.
- and we have to compare the velocity profile at the different lengths of the pipe.
- we have to show our velocity profile is fully developed.
- post-process velocity and shear stress.
ASSUMPTIONS
- flow is steady, incompressible, and laminar.
- flow is two dimensional.
- fluid properties are constant(viscosity ,density ,etc..)
introduction to laminar flow through a pipe:
In this project, we aim to simulate a section of pipe (Wedge shaped geometry) to understand various aspects of flow through the pipe. The fluid chosen is water & the flow is laminar & incompressible. Also, we choose to neglect any changes in cross-section. The specified Reynold's number Re is 2100.
Internal flow occurs when the fluid is filled entirely in a conduit & is driven primarily by a pressure difference.
Fluid velocity in a pipe changes from zero at the surface because of the no-slip boundary condition to a maximum at the pipe center. The average velocity remains constant in an incompressible flow when the cross-section of the pipe is constant.
Reynold's Number (Re):
The transition from laminar flow to turbulent flow occurs from laminar (Re≤">≤≤2100) to Transition (2100≤">≤≤Re≤">≤≤4000) to turbulent (Re ≥">≥≥4000) for smooth pipe with no viscous dissipation. It depends on the geometry, face roughness, flow velocity, surface temperature, etc. Reynold's number is an important non- Dimensionless number which is the ratio of the inertial force to viscous force and is expressed for internal flow in a circular section pipe as,
Hydrodynamic Length (Le) :
The region from the pipe inlet to the point at which the velocity boundary layer merges at the centreline is called the hydrodynamic entrance region in which the velocity profile is fully developed is called the fully developed region.
In laminar flow, the entry length is given approximately as,
DIAMETER OF PIPE:
we can assume the diameter of the pipe i.e
diameter = 10mm = 0.001 meter.
to calculate the hydrodynamic entry length we have a formula,
and the Reynolds number for the laminar flow is 2100. i.e Re= 2100
`L_e = 0.06*R_e*D`
`L_e = 0.06*2100*0.001`
Le= 12.6 meters
so we can take the nearer value of length that is equal to = 15
TO CALCULATE THE VELOCITY OF THE FLUID THAT IS AVERAGE VELOCITY.
AT THE INLET OF THE PIPE.
`R_e = (V*D)/v`
where v is the viscosity of the fluid i.e = `8.9 *10^-7`
Re is the Reynolds number, for laminar flow = 2100
D is the density of the liquid at 25-degree Celcius = 0.01
so by this equation, we can calculate the velocity of the moving fluid inside the pipe
`V_(avg) = (2100* 8.9*10^-7)/0.01`
WHICH GIVES TYHE RESULT OF V = 0.1869`m/s`
according to haigen poisulles equation
the pressure drop
`DeltaP = (32 *mu*LV)/D^2`
`DeltaP = (32 *8.4*10^-4*1.5*0.1869)/0.01^2`
`DeltaP = 79.84 p`
`Delta P = 0.0789 m^2/s^`
to calculate the maximunm velocity we have formula
`V_(max) = 2 *V_(avg)`
`V_(max) = 0.3738 m/s`
programme that create the blockmeshdict file using the matlab.
close all
clear all
clc
theta =25 %input(' input the wedge angle = ')
theta = theta /2
L = 1.5
d = 0.01
r = d/2
height_wedge = r*cosd(theta)
width_wedge = r*sind(theta)
b1=('/*--------------------------------*- C++ -*----------------------------------*\')
b2=(' ========= |')
b3=(' \\ / F ield | OpenFOAM: The Open Source CFD Toolbox')
b4=(' \\ / O peration | Website: https://openfoam.org')
b5=(' \\ / A nd | Version: 8')
b6=(' \\/ M anipulation |')
b7=('\*---------------------------------------------------------------------------*/')
f1 = fopen('blockmesh.txt','w')
fprintf(f1,'%s \n',b1)
fprintf(f1,'%s \n',b2)
fprintf(f1,'%s \n',b3)
fprintf(f1,'%s \n',b4)
fprintf(f1,'%s \n',b5)
fprintf(f1,'%s \n',b6)
fprintf(f1,'%s \n',b7)
fprintf(f1,'FoamFile \n{ \n version 2.0; \n format ascii; \n class dictionary; \n object blockMeshDict; \n}' )
b8 =('// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //')
fprintf(f1,'\n%s \n',b8)
fprintf(f1,'\nconvertToMeters 1;')
fprintf(f1,'\n\nvertices \n( \n\n')
%creating the vertices
fprintf(f1,' (0 0 0)')
fprintf(f1,'\n (0 0 0)')
ver3 = zeros(1,3)
ver4 = zeros(1,3)
ver3(2) = height_wedge
ver3(3) = -width_wedge
ver4(2) =height_wedge
ver4(3) = width_wedge
fprintf(f1,'\n (%f %f %f )',ver3)
fprintf(f1,'\n (%f %f %f )\n\n',ver4)
fprintf(f1,' (1.5 0 0)')
fprintf(f1,'\n (1.5 0 0)')
ver3 = zeros(1,3)
ver4 = zeros(1,3)
ver3(1) =L
ver3(2) = height_wedge
ver3(3) = -width_wedge
ver4(1) =L
ver4(2) =height_wedge
ver4(3) = width_wedge
fprintf(f1,'\n (%d %f %f )',ver3)
fprintf(f1,'\n (%d %f %f )\n',ver4)
fprintf(f1,'\n );\n\n')
fprintf(f1,'blocks \n(\n')
fprintf(f1,' hex (0 1 2 3 4 5 6 7) (1 20 100) simpleGrading (1 0.4 1) \n); \nedges \n( \n); \n')
fprintf(f1,'boundary \n( \n top \n { \n type wall; \n faces \n ( \n (2 3 7 6) \n ); \n }')
fprintf(f1,'\n bottom \n { \n type empty; \n faces \n ( \n (1 5 4 0) \n ); \n }')
fprintf(f1,'\n frontwedge \n { \n type wedge; \n faces \n ( \n (0 4 7 3) \n ); \n }')
fprintf(f1,'\n backwedge \n { \n type wedge; \n faces \n ( \n (1 2 6 5) \n ); \n }')
fprintf(f1,'\n inlet \n { \n type patch; \n faces \n ( \n (1 0 3 2) \n ); \n }')
fprintf(f1,'\n outlet \n { \n type patch; \n faces \n ( \n (5 6 7 4) \n ); \n }')
fprintf(f1,'\n); \n\nmergePatchPairs \n( \n);')
b9 =('// ************************************************************************* //')
fprintf(f1,'\n\n%s',b9)
fclose(f1)
blockMeshdict file that creates the wedge of angle 10
/*--------------------------------*- 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 0 0)
(0.000000 0.004981 -0.000436 )
(0.000000 0.004981 0.000436 )
(1.5 0 0)
(1.5 0 0)
(1.500000e+00 0.004981 -0.000436 )
(1.500000e+00 0.004981 0.000436 )
);
blocks
(
hex (0 1 2 3 4 5 6 7) (1 20 100) simpleGrading (1 0.4 1)
);
edges
(
);
boundary
(
top
{
type wall;
faces
(
(2 3 7 6)
);
}
bottom
{
type empty;
faces
(
(1 5 4 0)
);
}
frontwedge
{
type wedge;
faces
(
(0 4 7 3)
);
}
backwedge
{
type wedge;
faces
(
(1 2 6 5)
);
}
inlet
{
type patch;
faces
(
(1 0 3 2)
);
}
outlet
{
type patch;
faces
(
(5 6 7 4)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //
blockmeshdict file that creates the wedge of angle 25
/*--------------------------------*- 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 0 0)
(0.000000 0.004881 -0.001082 )
(0.000000 0.004881 0.001082 )
(1.5 0 0)
(1.5 0 0)
(1.500000e+00 0.004881 -0.001082 )
(1.500000e+00 0.004881 0.001082 )
);
blocks
(
hex (0 1 2 3 4 5 6 7) (1 20 100) simpleGrading (1 0.4 1)
);
edges
(
);
boundary
(
top
{
type wall;
faces
(
(2 3 7 6)
);
}
bottom
{
type empty;
faces
(
(1 5 4 0)
);
}
frontwedge
{
type wedge;
faces
(
(0 4 7 3)
);
}
backwedge
{
type wedge;
faces
(
(1 2 6 5)
);
}
inlet
{
type patch;
faces
(
(1 0 3 2)
);
}
outlet
{
type patch;
faces
(
(5 6 7 4)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //
blockmeshdict file that creates the wedge of angle 45
/*--------------------------------*- 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 0 0)
(0.000000 0.004619 -0.001913 )
(0.000000 0.004619 0.001913 )
(1.5 0 0)
(1.5 0 0)
(1.500000e+00 0.004619 -0.001913 )
(1.500000e+00 0.004619 0.001913 )
);
blocks
(
hex (0 1 2 3 4 5 6 7) (1 20 100) simpleGrading (1 0.4 1)
);
edges
(
);
boundary
(
top
{
type wall;
faces
(
(2 3 7 6)
);
}
bottom
{
type empty;
faces
(
(1 5 4 0)
);
}
frontwedge
{
type wedge;
faces
(
(0 4 7 3)
);
}
backwedge
{
type wedge;
faces
(
(1 2 6 5)
);
}
inlet
{
type patch;
faces
(
(1 0 3 2)
);
}
outlet
{
type patch;
faces
(
(5 6 7 4)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //
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;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 0.4;
deltaT 0.00004;
writeControl timeStep;
writeInterval 20;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
// ************************************************************************* //
velocity boundary 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 volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0.1869 0 0);
boundaryField
{
inlet
{
type fixedValue;
value uniform (0.1869 0 0);
}
outlet
{
type zeroGradient;
}
frontwedge
{
type symmetry;
}
backwedge
{
type symmetry;
}
top
{
type noSlip;
}
bottom
{
type empty;
}
}
// ************************************************************************* //
pressure boundary 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 volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type fixedValue;
value uniform 0;
}
frontwedge
{
type symmetry;
}
backwedge
{
type symmetry;
}
top
{
type zeroGradient;
}
bottom
{
type empty;
}
}
// ************************************************************************* //
transport properties 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 "constant";
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
nu [0 2 -1 0 0 0 0] 0.001;
// ************************************************************************* //
RESULTS TABULATED FOR THE WEDGE ANGLE OF 10 DEGREES
creating the mesh using the grading factor 0.4 along with the height of the wedge for wedge angle 10 dgrees

the same mesh showing in a different direction for wedge angle 10 degrees

velocity profile 3d view for wedge angle 10 degrees

velocity profile 2d view for wedge angle 10 degrees

pressure profile 2d view for wedge angle 10 degrees

pressure profile 2d view for wedge angle 10 degrees

velocity curve along the length less than the hydrodynamic length

pressure curve along xaxis for wedge angle 10 degrees

velocity curve for fully developed flow for wedge angle 10 degrees

shear stress curve along the yaxis.

RESULTS TABULATED FOR THE WEDGE ANGLE OF 25 DEGREES
creating the mesh using the grading factor 0.4 along with the height of the wedge for wedge angle 25 degrees

the same mesh showing in a different direction for wedge angle 25 degrees

velocity profile 3d view for wedge angle 25 degrees

velocity profile 2d view for wedge angle 25 degrees

pressure profile 2d view for wedge angle 25 degrees

pressure profile 3d view for wedge angle 25 degrees

velocity curve along for wedge angle 25 degrees

pressure curve along xaxis for wedge angle 25 degrees

fully developed velocity curve along y-axis

shear stress curve

RESULTS TABULATED FOR THE WEDGE ANGLE OF 45 DEGREES
creating the mesh using the grading factor 0.4 along with the height of the wedge for wedge angle 45 degrees

the same mesh showing in a different direction for wedge angle 45 degrees

velocity profile 3d view for wedge angle 45 degrees

velocity profile 2d view for wedge angle 45 degrees

pressure profile 2d view for wedge angle 45 degrees

pressure profile 3d view for wedge angle 45 degrees

fully developed velocity curve along y-axis for wedge angle 45 degrees

pressure curve along x-axis for wedge angle 45 degrees

velocity curve along y-axis for wedge angle 45 degrees

shear stress curve
