Week 12 - Validation studies of Symmetry BC vs Wedge BC in OpenFOAM vs Analytical H.P equation
OBJECTIVE.
- To simulate an axis-symmetric laminar flow through the constant cross-sectional of the pipe by applying the symmetry boundary condition.
- To simulating for the mentioned angles i.e for 10, 25, 45 degrees using both symmetry and wedge boundary conditions and validate them with HP equations.
Hagen-Poiseuille's law:
In nonideal fluid dynamics, the Hagen–Poiseuille equation, also known as the Hagen–Poiseuille law, 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. The pressure drop is given by:
ΔP=32μLVD2">ΔP = 32μLV/D^2
where,
ΔP">ΔP is the pressure drop.
μ">μ is the dynamic viscosity
L is the length of the pipe.
V is the velocity.

At the entrance, the flow is said to be in the hydrodynamic entrance region where the velocity profile gradually takes the shape of a parabola from a straight line. As soon as the parabolic velocity profile becomes steady the flow is said to be in its fully developed state. Normally Hagen Poiseuille's Equation is applicable for a fully developed flow which helps us to calculate the pressure loss.
Assumptions made:
Reynolds number: 2100.
Working fluid: Water.
Diameter of the pipe: 0.02 m.
Dynamic viscosity(μ) = 0.89x10^-3 Pas
Kinematic viscosity(ν) = 0.8927x10^-6 m^2/s
theta=10, 25, 45
PROCEDURE.
- Will start with copying the cavity file from the tutorial to the FOAM_RUN folder.
- In the run folder only we are going to simulate and whatever we want to do the changes in the blockMeshDict file and pressure and velocity files and controlDict files we will be doing here.
- creating the block in the OpenFoam here we are creating the wedge after making the required changes in the blockMeshDict file to check the geometry run the blockMesh command.
- After creating the wedge assign the boundary conditions, and also sitting the simulation end time and time-step in such a way that the courant number should be less than 0.5 and also in the transportProperties enter the kinematic viscosity.
-
Run the simulation using the icoFoam solver after calculating the time needed for the fluid to travel from inlet to outlet
-
After the simulation, use paraFoam to view the flow inside the wedge and use plot over line command to plot the velocity and shear stress changes at a point after the hydrodynamical entry region so that we analyse the fully developed region of the fluid.
-
Use Matlab to parse the blockMeshDict so that the same file can be used for any wedge values.
- Writing codes for wedge as wells as symmetry only for one angle i.e 25deg , rest everything will be same for both except the angles .
- And i am generating the blockmeshdict file along with other files for every angles for both wedge and symmetry.
MATLAB CODE TO GENERATE blockMeshDict FILE for wedge boundary condition.
for angle = 25 deg.
clear all
close all
clc
% Inputs parameters
%Reynold's number
Re = 2100;
%Density
rho = 1000;
%Diameter (in m)
D = 0.02;
%Radius
R = D/2;
%Entry Length of the pipe
L_ent = 0.06*Re*D;
%viscosity (pa.s)
mu = 0.00089;
%Kinematic Viscosity
nu = mu/rho;
%Angle of wedge
theta = 25;
%Boundary conditions
v_avg = Re*nu/D;
v_max = 2*v_avg;
L_d = 0.3;
L = L_ent + L_d;
deltap = (8*v_avg*mu*L_d)/R^2;
deltap = deltap/rho;
%vertices cordinate
v0 = [0 0 0]; %point 0
v1 = [0 R*cosd(theta/2) -R*sind(theta/2)]; %point 1
v2 = [0 R*cosd(theta/2) R*sind(theta/2)]; %point 2
v3 = [L 0 0]; %point 3
v4 = [L R*cosd(theta/2) -R*sind(theta/2)]; %point 4
v5 = [L R*cosd(theta/2) R*sind(theta/2)]; %point 5
fileid = fopen('BlockMeshDict_wedge25','w')
fprintf(fileid,'FoamFile\n{\n\')
fprintf(fileid,'%12s \t 2.0;\n\','version')
fprintf(fileid,'%12s \t ascii;\n\','format')
fprintf(fileid,'%12s \t dictionary;\n\','class')
fprintf(fileid,'%12s \t blockMeshDict;\n\','object')
fprintf(fileid, '}\n\')
fprintf(fileid, 'vertices\n')
fprintf(fileid, '(\n')
fprintf(fileid, '\t(%s)\n', num2str(v0))
fprintf(fileid, '\t(%s)\n', num2str(v1))
fprintf(fileid, '\t(%s)\n', num2str(v2))
fprintf(fileid, '\t(%s)\n', num2str(v3))
fprintf(fileid, '\t(%s)\n', num2str(v4))
fprintf(fileid, '\t(%s)\n', num2str(v5))
fprintf(fileid, ');\n')
fprintf(fileid, 'blocks\n')
fprintf(fileid, '(\n')
fprintf(fileid, '\t hex (0 3 5 2 0 3 4 1) (%d %d %d)\',300,30,1)
fprintf(fileid, ' SimpleGrading (1 0.1 1)\n\n\')
fprintf(fileid, ');\n')
fprintf(fileid, 'edges\n')
fprintf(fileid, '(\n')
fprintf(fileid, '\t arc %d %d (%d %d %d)\n',1,2,0,R,0)
fprintf(fileid, '\t arc %d %d (%d %d %d)\n',4,5,L,R,0)
fprintf(fileid, ');\n')
fprintf(fileid, 'boundary\n')
fprintf(fileid, '(\n')
fprintf(fileid, '\t inlet \n')
fprintf(fileid, '\t {\n')
fprintf(fileid, '\t\t type patch;\n')
fprintf(fileid, '\t\t faces\n')
fprintf(fileid, '\t\t (\n')
fprintf(fileid, '\t\t\t (0 1 2 0)\n')
fprintf(fileid, '\t\t );\n')
fprintf(fileid, '\t }\n')
fprintf(fileid, '\t outlet\n')
fprintf(fileid, '\t {\n')
fprintf(fileid, '\t\t type patch;\n')
fprintf(fileid, '\t\t faces\n')
fprintf(fileid, '\t\t (\n')
fprintf(fileid, '\t\t\t (3 5 4 3)\n')
fprintf(fileid, '\t\t );\n')
fprintf(fileid, '\t }\n')
fprintf(fileid, '\t top\n')
fprintf(fileid, '\t {\n')
fprintf(fileid, '\t\t type wall;\n')
fprintf(fileid, '\t\t faces\n')
fprintf(fileid, '\t\t (\n')
fprintf(fileid, '\t\t\t (1 4 5 2)\n')
fprintf(fileid, '\t\t );\n')
fprintf(fileid, '\t }\n')
fprintf(fileid, '\t front\n')
fprintf(fileid, '\t {\n')
fprintf(fileid, '\t\t type wedge;\n')
fprintf(fileid, '\t\t faces\n')
fprintf(fileid, '\t\t (\n\')
fprintf(fileid, '\t\t\t (0 3 4 1)\n')
fprintf(fileid, '\t\t );\n')
fprintf(fileid, '\t }\n')
fprintf(fileid, '\t back\n')
fprintf(fileid, '\t {\n')
fprintf(fileid, '\t\t type wedge;\n')
fprintf(fileid, '\t\t faces\n')
fprintf(fileid, '\t\t (\n')
fprintf(fileid, '\t\t\t (0 2 5 3)\n')
fprintf(fileid, '\t\t );\n')
fprintf(fileid, '\t }\n')
fprintf(fileid, '\t axis\n')
fprintf(fileid, '\t {\n')
fprintf(fileid, '\t\t type empty;\n')
fprintf(fileid, '\t\t faces\n')
fprintf(fileid, '\t\t (\n')
fprintf(fileid, '\t\t\t (0 3 3 0)\n')
fprintf(fileid, '\t\t );\n')
fprintf(fileid, '\t }\n')
fprintf(fileid, '); \n\n')
fprintf(fileid, 'mergePatchPairs\n')
fprintf(fileid, '(\n')
fprintf(fileid, ');\n')
fclose(fileid)
MATLAB CODE TO GENERATE blockMeshDict FILE for symmetry boundary condition.
for angle = 25deg.
clear all
close all
clc
% Inputs parameters
%Reynold's number
Re = 2100;
%Density
rho = 1000;
%Diameter (in m)
D = 0.02;
%Radius
R = D/2;
%Entry Length of the pipe
L_ent = 0.06*Re*D;
%viscosity (pa.s)
mu = 0.00089;
%Kinematic Viscosity
nu = mu/rho;
%Angle of wedge
theta = 25;
%Boundary conditions
v_avg = Re*nu/D;
v_max = 2*v_avg;
L_d = 0.3;
L = L_ent + L_d;
deltap = (8*v_avg*mu*L_d)/R^2;
deltap = deltap/rho;
%vertices cordinate
v0 = [0 0 0]; %point 0
v1 = [0 R*cosd(theta/2) -R*sind(theta/2)]; %point 1
v2 = [0 R*cosd(theta/2) R*sind(theta/2)]; %point 2
v3 = [L 0 0]; %point 3
v4 = [L R*cosd(theta/2) -R*sind(theta/2)]; %point 4
v5 = [L R*cosd(theta/2) R*sind(theta/2)]; %point 5
fileid = fopen('BlockMeshDict_symmetry25','w')
fprintf(fileid,'FoamFile\n{\n\')
fprintf(fileid,'%12s \t 2.0;\n\','version')
fprintf(fileid,'%12s \t ascii;\n\','format')
fprintf(fileid,'%12s \t dictionary;\n\','class')
fprintf(fileid,'%12s \t blockMeshDict;\n\','object')
fprintf(fileid, '}\n\')
fprintf(fileid, 'vertices\n')
fprintf(fileid, '(\n')
fprintf(fileid, '\t(%s)\n', num2str(v0))
fprintf(fileid, '\t(%s)\n', num2str(v1))
fprintf(fileid, '\t(%s)\n', num2str(v2))
fprintf(fileid, '\t(%s)\n', num2str(v3))
fprintf(fileid, '\t(%s)\n', num2str(v4))
fprintf(fileid, '\t(%s)\n', num2str(v5))
fprintf(fileid, ');\n')
fprintf(fileid, 'blocks\n')
fprintf(fileid, '(\n')
fprintf(fileid, '\t hex (0 3 5 2 0 3 4 1) (%d %d %d)\',300,30,1)
fprintf(fileid, ' SimpleGrading (1 0.1 1)\n\n\')
fprintf(fileid, ');\n')
fprintf(fileid, 'edges\n')
fprintf(fileid, '(\n')
fprintf(fileid, '\t arc %d %d (%d %d %d)\n',1,2,0,R,0)
fprintf(fileid, '\t arc %d %d (%d %d %d)\n',4,5,L,R,0)
fprintf(fileid, ');\n')
fprintf(fileid, 'boundary\n')
fprintf(fileid, '(\n')
fprintf(fileid, '\t inlet \n')
fprintf(fileid, '\t {\n')
fprintf(fileid, '\t\t type patch;\n')
fprintf(fileid, '\t\t faces\n')
fprintf(fileid, '\t\t (\n')
fprintf(fileid, '\t\t\t (0 1 2 0)\n')
fprintf(fileid, '\t\t );\n')
fprintf(fileid, '\t }\n')
fprintf(fileid, '\t outlet\n')
fprintf(fileid, '\t {\n')
fprintf(fileid, '\t\t type patch;\n')
fprintf(fileid, '\t\t faces\n')
fprintf(fileid, '\t\t (\n')
fprintf(fileid, '\t\t\t (3 5 4 3)\n')
fprintf(fileid, '\t\t );\n')
fprintf(fileid, '\t }\n')
fprintf(fileid, '\t top\n')
fprintf(fileid, '\t {\n')
fprintf(fileid, '\t\t type wall;\n')
fprintf(fileid, '\t\t faces\n')
fprintf(fileid, '\t\t (\n')
fprintf(fileid, '\t\t\t (1 4 5 2)\n')
fprintf(fileid, '\t\t );\n')
fprintf(fileid, '\t }\n')
fprintf(fileid, '\t front\n')
fprintf(fileid, '\t {\n')
fprintf(fileid, '\t\t type symmetry;\n')
fprintf(fileid, '\t\t faces\n')
fprintf(fileid, '\t\t (\n\')
fprintf(fileid, '\t\t\t (0 3 4 1)\n')
fprintf(fileid, '\t\t );\n')
fprintf(fileid, '\t }\n')
fprintf(fileid, '\t back\n')
fprintf(fileid, '\t {\n')
fprintf(fileid, '\t\t type symmetry;\n')
fprintf(fileid, '\t\t faces\n')
fprintf(fileid, '\t\t (\n')
fprintf(fileid, '\t\t\t (0 2 5 3)\n')
fprintf(fileid, '\t\t );\n')
fprintf(fileid, '\t }\n')
fprintf(fileid, '\t axis\n')
fprintf(fileid, '\t {\n')
fprintf(fileid, '\t\t type empty;\n')
fprintf(fileid, '\t\t faces\n')
fprintf(fileid, '\t\t (\n')
fprintf(fileid, '\t\t\t (0 3 3 0)\n')
fprintf(fileid, '\t\t );\n')
fprintf(fileid, '\t }\n')
fprintf(fileid, '); \n\n')
fprintf(fileid, 'mergePatchPairs\n')
fprintf(fileid, '(\n')
fprintf(fileid, ');\n')
fclose(fileid)
Blockmeshdict File for wedge with angle = 25deg.
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
vertices
(
(0 0 0)
(0 0.009763 -0.0021644)
(0 0.009763 0.0021644)
(2.82 0 0)
(2.82 0.009763 -0.0021644)
(2.82 0.009763 0.0021644)
);
blocks
(
hex (0 3 5 2 0 3 4 1) (300 30 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
(
);
Controldict file for the same.
/*--------------------------------*- 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 latestTime; // startTime
startTime 0;
stopAt endTime;
endTime 25;
deltaT 0.02;
writeControl runTime; //timeStep - it will print an output file every writeInterval*deltaT
//runTime - writes an output file every specified writeInterval sec
writeInterval 0.5;
purgeWrite 10; // 0 - it retain all the output folders
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: 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
{
outlet
{
type fixedValue;
value uniform 0;
}
inlet
{
type zeroGradient;
}
top
{
type zeroGradient;
}
front
{
type wedge;
}
back
{
type wedge;
}
axis
{
type empty;
}
}
// ************************************************************************* //
Velocity 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.0934 0 0);
boundaryField
{
inlet
{
type fixedValue;
value uniform (0.0934 0 0);
}
outlet
{
type zeroGradient;
}
top
{
type noSlip;
}
front
{
type wedge;
}
back
{
type wedge;
}
axis
{
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] 8.9e-7;
// ************************************************************************* //
BlockmeshDict and other files for symmetry with angle = 25deg.
Blockmeshdict file
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
vertices
(
(0 0 0)
(0 0.009763 -0.0021644)
(0 0.009763 0.0021644)
(2.82 0 0)
(2.82 0.009763 -0.0021644)
(2.82 0.009763 0.0021644)
);
blocks
(
hex (0 3 4 1 0 3 5 2) (300 30 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
(
);
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 latestTime; // startTime
startTime 0;
stopAt endTime;
endTime 25;
deltaT 0.02;
writeControl runTime; //timeStep - it will print an output file every writeInterval*deltaT
//runTime - writes an output file every specified writeInterval sec
writeInterval 0.5;
purgeWrite 10; // 0 - it retain all the output folders
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: 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
{
outlet
{
type fixedValue;
value uniform 0;
}
inlet
{
type zeroGradient;
}
top
{
type zeroGradient;
}
front
{
type symmetry;
}
back
{
type symmetry;
}
axis
{
type empty;
}
}
// ************************************************************************* //
velocity 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.0934 0 0);
boundaryField
{
inlet
{
type fixedValue;
value uniform (0.0934 0 0);
}
outlet
{
type zeroGradient;
}
top
{
type noSlip;
}
front
{
type symmetry;
}
back
{
type symmetry;
}
axis
{
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] 8.9e-7;
// ************************************************************************* //
Similarly , blockmeshdict and other files for other angles of wedges and symmetry are as follows.
for wedge = 10deg.
BlockMeshdict File
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
vertices
(
(0 0 0)
(0 0.0099619 -0.00087156)
(0 0.0099619 0.00087156)
(2.82 0 0)
(2.82 0.0099619 -0.00087156)
(2.82 0.0099619 0.00087156)
);
blocks
(
hex (0 3 4 1 0 3 5 2) (300 30 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
(
);
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 latestTime; // startTime
startTime 0;
stopAt endTime;
endTime 25;
deltaT 0.02;
writeControl runTime; //timeStep - it will print an output file every writeInterval*deltaT
//runTime - writes an output file every specified writeInterval sec
writeInterval 0.5;
purgeWrite 10; // 0 - it retain all the output folders
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: 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
{
outlet
{
type fixedValue;
value uniform 0;
}
inlet
{
type zeroGradient;
}
top
{
type zeroGradient;
}
front
{
type wedge;
}
back
{
type wedge;
}
axis
{
type empty;
}
}
// ************************************************************************* //
Velocity 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.0934 0 0);
boundaryField
{
inlet
{
type fixedValue;
value uniform (0.0934 0 0);
}
outlet
{
type zeroGradient;
}
top
{
type noSlip;
}
front
{
type wedge;
}
back
{
type wedge;
}
axis
{
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] 8.9e-7;
// ************************************************************************* //
For wedge with angle = 45deg.
BlockMeshdict file
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
vertices
(
(0 0 0)
(0 0.0092388 -0.0038268)
(0 0.0092388 0.0038268)
(2.82 0 0)
(2.82 0.0092388 -0.0038268)
(2.82 0.0092388 0.0038268)
);
blocks
(
hex (0 3 4 1 0 3 5 2) (300 30 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
(
);
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 latestTime; // startTime
startTime 0;
stopAt endTime;
endTime 25;
deltaT 0.02;
writeControl runTime; //timeStep - it will print an output file every writeInterval*deltaT
//runTime - writes an output file every specified writeInterval sec
writeInterval 0.5;
purgeWrite 10; // 0 - it retain all the output folders
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: 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
{
outlet
{
type fixedValue;
value uniform 0;
}
inlet
{
type zeroGradient;
}
top
{
type zeroGradient;
}
front
{
type wedge;
}
back
{
type wedge;
}
axis
{
type empty;
}
}
// ************************************************************************* //
Velocity 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.0934 0 0);
boundaryField
{
inlet
{
type fixedValue;
value uniform (0.0934 0 0);
}
outlet
{
type zeroGradient;
}
top
{
type noSlip;
}
front
{
type wedge;
}
back
{
type wedge;
}
axis
{
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] 8.9e-7;
// ************************************************************************* //
SYMMETRY
for angle = 10deg
Blockmeshdict file
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
vertices
(
(0 0 0)
(0 0.0099619 -0.00087156)
(0 0.0099619 0.00087156)
(2.82 0 0)
(2.82 0.0099619 -0.00087156)
(2.82 0.0099619 0.00087156)
);
blocks
(
hex (0 3 4 1 0 3 5 2) (300 30 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
(
);
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 latestTime; // startTime
startTime 0;
stopAt endTime;
endTime 25;
deltaT 0.02;
writeControl runTime; //timeStep - it will print an output file every writeInterval*deltaT
//runTime - writes an output file every specified writeInterval sec
writeInterval 0.5;
purgeWrite 10; // 0 - it retain all the output folders
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: 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
{
outlet
{
type fixedValue;
value uniform 0;
}
inlet
{
type zeroGradient;
}
top
{
type zeroGradient;
}
front
{
type symmetry;
}
back
{
type symmetry;
}
axis
{
type empty;
}
}
// ************************************************************************* //
Velocity 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.0934 0 0);
boundaryField
{
inlet
{
type fixedValue;
value uniform (0.0934 0 0);
}
outlet
{
type zeroGradient;
}
top
{
type noSlip;
}
front
{
type symmetry;
}
back
{
type symmetry;
}
axis
{
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] 8.9e-7;
// ************************************************************************* //
For angle = 45 deg
symmetry
Blockmeshdict file
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
vertices
(
(0 0 0)
(0 0.0092388 -0.0038268)
(0 0.0092388 0.0038268)
(2.82 0 0)
(2.82 0.0092388 -0.0038268)
(2.82 0.0092388 0.0038268)
);
blocks
(
hex (0 3 4 1 0 3 5 2) (300 30 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
(
);
Controdict 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 latestTime; // startTime
startTime 0;
stopAt endTime;
endTime 25;
deltaT 0.02;
writeControl runTime; //timeStep - it will print an output file every writeInterval*deltaT
//runTime - writes an output file every specified writeInterval sec
writeInterval 0.5;
purgeWrite 10; // 0 - it retain all the output folders
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: 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
{
outlet
{
type fixedValue;
value uniform 0;
}
inlet
{
type zeroGradient;
}
top
{
type zeroGradient;
}
front
{
type symmetry;
}
back
{
type symmetry;
}
axis
{
type empty;
}
}
// ************************************************************************* //
Velocity 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.0934 0 0);
boundaryField
{
inlet
{
type fixedValue;
value uniform (0.0934 0 0);
}
outlet
{
type zeroGradient;
}
top
{
type noSlip;
}
front
{
type symmetry;
}
back
{
type symmetry;
}
axis
{
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] 8.9e-7;
// ************************************************************************* //
RESULTS
for plotting the results its better to make a table for comparison for both the symmetry and wedge with all the given angles i.e 10deg , 25deg and 45deg.
This is the comparison table plot for the pressure contour of both the wedges and the symmetry.
| ANGLES | WEDGE | SYMMETRY |
| 10 degrees | ![]() |
![]() |
| 25 degrees | ![]() |
![]() |
| 45 degrees | ![]() |
![]() |
now compariosn of velocity contours
| ANGLES | WEDGE | SYMMETRY |
| 10 degrees | ![]() |
![]() |
| 25 degrees | ![]() |
![]() |
| 45 degrees | ![]() |
![]() |
COMPARISON OF PROFILES
SHEAR STRESS PROFILES
| ANGLES | WEDGE | SYMMETRY |
| 10 DEGREES | ![]() |
![]() |
| 25 DEGREES | ![]() |
![]() |
| 45 DEGREES | ![]() |
![]() |
COMPARISON OF VELOCITIES PROFILE
| ANGLES | WEDGE | SYMMETRY |
| 10 DEGREES | ![]() |
![]() |
| 25 DEGREES | ![]() |
![]() |
| 45 DEGREES | ![]() |
![]() |
CONCLUSION.
We can observe there is no much change in the maximum velocities. The only difference observed is execution time a little high than type-wedge. While the angle increases the error in the maximum velocity is decreased. Though there is not much difference between analytical and numerical results and also with increasing the angle of the wedge, The Courant number is slightly increasing. we can say that the symmetric boundary condition plays an important role in terms of accuracy in the result























