All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
Title: comparison of Symmetry BC vs Wedge BC vs HP equation Objective 1. To obtaine the result from solving the Hagen Poisuelle\'s equation 2.To obtain results for the pipe flow with symmetry BC 3.Write a Matlab program that takes an angle as input and generates a blockMesh file for the given angle. 4. To change the wedge…
Dipakv Virkarwe
updated on 13 Feb 2020
Title: comparison of Symmetry BC vs Wedge BC vs HP equation
Objective
1. To obtaine the result from solving the Hagen Poisuelle\'s equation
2.To obtain results for the pipe flow with symmetry BC
3.Write a Matlab program that takes an angle as input and generates a blockMesh file for the given angle.
4. To change the wedge angle 10, 25, 45 degree for symmetry Boundary condition.
Theory
In previous challange i got the result for wedge boundary condition , so here now we just made change of symmetry boundary condition instead of wedge boundary condition in Matlab code & prepared the blockMeshDict file, and this file will be use to get the result.
By change of wedge angle 10, 25, 45 degree for symmetry Boundary condition in Matlab code & generated blockMeshDict fiile is used for get the result.
So, to paste all the matlab code & blockMeshDict file for diffrent wedge angle , here i have paste the all code for only wedge 45 degree angle.
Matlab code at 45 Degree wedge angle for symmetry BC
close all
clear all
clc
% given data
Re=2100; % Reynold No.
mu=0.89e-3; % Dynamic viscosity
D=0.020; % Diameter of pipe D=20mm
R=(D/2); % Raduis of pipe
rho=997 ; % Density of water
Le= (0.06*Re*D); % Entry lenght of pipe
L= Le+0.3 ; % Length of pipe
theta=45;
% writing the header part for blockMeshDict file in Matlab
h1=\'/*--------------------------------*- C++ -*----------------------------------*\\\';
h2=\' ========= |\';
h3=\' \\\\ / F ield | OpenFOAM: The Open Source CFD Toolbox\';
h4=\' \\\\ / O peration | Website: https://openfoam.org\';
h5=\' \\\\ / A nd | Version: 7\';
h6=\' \\\\/ M anipulation |\';
h7=\'\\*---------------------------------------------------------------------------*/\';
h8=\'FoamFile\';
h9=\'{\';
h10=\' version 2.0;\';
h11=\' format ascii;\';
h12=\' class dictionary;\';
h13=\' object blockMeshDict;\';
h14=\'}\';
h15=\'// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //\';
conv=\'convertToMeters 1;\';
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)];
block=\'hex (0 3 5 2 0 3 4 1) (300 10 1) simpleGrading (1 1 1)\';
inlet=\'(0 1 2 0)\';
outlet=\'(3 5 4 3)\';
top=\'(1 4 5 2)\';
front=\'(0 3 4 1)\';
back=\'(0 2 5 3)\';
axis=\'(0 3 3 0)\';
s1=blanks(4);
s2=blanks(7);
s3=blanks(11);
s4=blanks(3);
% Writing blockMeshDict file
f1=fopen(\'blockMeshDict.txt\',\'w\');
fprintf(f1,\'%s\\n\',h1);
fprintf(f1,\'%s\\n\',h2);
fprintf(f1,\'%s\\n\',h3);
fprintf(f1,\'%s\\n\',h4);
fprintf(f1,\'%s\\n\',h5);
fprintf(f1,\'%s\\n\',h6);
fprintf(f1,\'%s\\n\',h7);
fprintf(f1,\'%s\\n\',h8);
fprintf(f1,\'%s\\n\',h9);
fprintf(f1,\'%s\\n\',h10);
fprintf(f1,\'%s\\n\',h11);
fprintf(f1,\'%s\\n\',h12);
fprintf(f1,\'%s\\n\',h13);
fprintf(f1,\'%s\\n\',h14);
fprintf(f1,\'%s\\n\',h15);
fprintf(f1,\'\\n\');
fprintf(f1,\'%s\\n\',conv);
fprintf(f1,\'\\n\');
fprintf(f1,\'%s\\n\',\'vertices\');
fprintf(f1,\'%s\\n\',\'(\');
fprintf(f1,\'%s(%d %d %d)\\n\',s1,v0(1),v0(2),v0(3));
fprintf(f1,\'%s(%d %d %d)\\n\',s1,v1(1),v1(2),v1(3));
fprintf(f1,\'%s(%d %d %d)\\n\',s1,v2(1),v2(2),v2(3));
fprintf(f1,\'%s(%d %d %d)\\n\',s1,v3(1),v3(2),v3(3));
fprintf(f1,\'%s(%d %d %d)\\n\',s1,v4(1),v4(2),v4(3));
fprintf(f1,\'%s(%d %d %d)\\n\',s1,v5(1),v5(2),v5(3));
fprintf(f1,\'%s\\n\',\');\');
fprintf(f1,\'\\n\');
fprintf(f1, \'%s\\n\',\'blocks\');
fprintf(f1,\'%s\\n\',\'(\');
fprintf(f1,\'%s %s\\n\',s4,block);
fprintf(f1,\'\\n\');
fprintf(f1,\'%s\\n\',\');\');
fprintf(f1,\'\\n\');
fprintf(f1,\'%s\\n\',\'edges\');
fprintf(f1,\'%s\\n\',\'(\');
fprintf(f1,\'%s %s %d %d (%d %d %d)\\n\',s4,\'arc\',1,2,0,R,0);
fprintf(f1,\'%s %s %d %d (%d %d %d)\\n\',s4,\'arc\',4,5,L,R,0);
fprintf(f1,\'%s\\n\',\');\');
fprintf(f1,\'\\n\');
fprintf(f1,\'%s\\n\',\'boundary\');
fprintf(f1,\'%s\\n\',\'(\');
fprintf(f1,\'%s %s\\n\',s4,\'inlet\');
fprintf(f1,\'%s %s\\n\',s4,\'{\');
fprintf(f1,\'%s %s\\n\',s2,\'type patch;\');
fprintf(f1,\'%s %s\\n\',s2,\'faces\');
fprintf(f1,\'%s %s\\n\',s2,\'(\');
fprintf(f1,\'%s (%d %d %d %d)\\n\',s3,0,1,2,0);
fprintf(f1,\'%s %s\\n\',s2,\');\');
fprintf(f1,\'%s %s\\n\',s4,\'}\');
fprintf(f1,\'%s %s\\n\',s4,\'outlet\');
fprintf(f1,\'%s %s\\n\',s4,\'{\');
fprintf(f1,\'%s %s\\n\',s2,\'type patch;\');
fprintf(f1,\'%s %s\\n\',s2,\'faces\');
fprintf(f1,\'%s %s\\n\',s2,\'(\');
fprintf(f1,\'%s (%d %d %d %d)\\n\',s3,3,5,4,3);
fprintf(f1,\'%s %s\\n\',s2,\');\');
fprintf(f1,\'%s %s\\n\',s4,\'}\');
fprintf(f1,\'%s %s\\n\',s4,\'top\');
fprintf(f1,\'%s %s\\n\',s4,\'{\');
fprintf(f1,\'%s %s\\n\',s2,\'type wall;\');
fprintf(f1,\'%s %s\\n\',s2,\'faces\');
fprintf(f1,\'%s %s\\n\',s2,\'(\');
fprintf(f1,\'%s (%d %d %d %d)\\n\',s3,1,4,5,2);
fprintf(f1,\'%s %s\\n\',s2,\');\');
fprintf(f1,\'%s %s\\n\',s4,\'}\');
fprintf(f1,\'%s %s\\n\',s4,\'front\');
fprintf(f1,\'%s %s\\n\',s4,\'{\');
fprintf(f1,\'%s %s\\n\',s2,\'type symmetry;\');
fprintf(f1,\'%s %s\\n\',s2,\'faces\');
fprintf(f1,\'%s %s\\n\',s2,\'(\');
fprintf(f1,\'%s (%d %d %d %d)\\n\',s3,0,3,4,1);
fprintf(f1,\'%s %s\\n\',s2,\');\');
fprintf(f1,\'%s %s\\n\',s4,\'}\');
fprintf(f1,\'%s %s\\n\',s4,\'back\');
fprintf(f1,\'%s %s\\n\',s4,\'{\');
fprintf(f1,\'%s %s\\n\',s2,\'type symmetry;\');
fprintf(f1,\'%s %s\\n\',s2,\'faces\');
fprintf(f1,\'%s %s\\n\',s2,\'(\');
fprintf(f1,\'%s (%d %d %d %d)\\n\',s3,0,2,5,3);
fprintf(f1,\'%s %s\\n\',s2,\');\');
fprintf(f1,\'%s %s\\n\',s4,\'}\');
fprintf(f1,\'%s %s\\n\',s4,\'axis\');
fprintf(f1,\'%s %s\\n\',s4,\'{\');
fprintf(f1,\'%s %s\\n\',s2,\'type empty;\');
fprintf(f1,\'%s %s\\n\',s2,\'faces\');
fprintf(f1,\'%s %s\\n\',s2,\'(\');
fprintf(f1,\'%s (%d %d %d %d)\\n\',s3,0,3,3,0);
fprintf(f1,\'%s %s\\n\',s2,\');\');
fprintf(f1,\'%s %s\\n\',s4,\'}\');
fprintf(f1,\'%s\\n\',\');\');
fprintf(f1,\'\\n\');
fprintf(f1,\'%s\\n\',\'mergePatchPairs\');
fprintf(f1,\'%s\\n\',\'(\');
fprintf(f1,\'%s\\n\',\');\');
h16=\'// ************************************************************************* //\';
fprintf(f1,\'%s\\n\',h16);
fclose(f1);
BlockmeshDict file at 45Degree wedge angle for symmetry BC
/*--------------------------------*- C++ -*----------------------------------*\\
========= |
\\\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\\\ / O peration | Website: https://openfoam.org
\\\\ / A nd | Version: 7
\\\\/ M anipulation |
\\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
(0 0 0)
(0 9.238795e-03 3.826834e-03)
(0 9.238795e-03 -3.826834e-03)
(2.820000e+00 0 0)
(2.820000e+00 9.238795e-03 3.826834e-03)
(2.820000e+00 9.238795e-03 -3.826834e-03)
);
blocks
(
hex (0 3 5 2 0 3 4 1) (300 10 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
(
);
// ************************************************************************* //
ControlDict file
/*--------------------------------*- C++ -*----------------------------------*\\
========= |
\\\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\\\ / O peration | Website: https://openfoam.org
\\\\ / A nd | Version: 7
\\\\/ M anipulation |
\\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location \"system\";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application icoFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 50;
deltaT 0.005;
writeControl timeStep;
writeInterval 20;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
// ************************************************************************* //
Transport Properties
/*--------------------------------*- C++ -*----------------------------------*\\
========= |
\\\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\\\ / O peration | Website: https://openfoam.org
\\\\ / A nd | Version: 7
\\\\/ M anipulation |
\\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location \"constant\";
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
nu [0 2 -1 0 0 0 0] 8.92e-7;
// ************************************************************************* //
Intial condiion for Pressure file
/*--------------------------------*- C++ -*----------------------------------*\\
========= |
\\\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\\\ / O peration | Website: https://openfoam.org
\\\\ / A nd | Version: 7
\\\\/ 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.018;
}
axis
{
type empty;
}
top
{
type zeroGradient;
}
front
{
type symmetry;
}
back
{
type symmetry;
}
}
// ************************************************************************* //
Intial condiion for Velocity file
/*--------------------------------*- C++ -*----------------------------------*\\
========= |
\\\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\\\ / O peration | Website: https://openfoam.org
\\\\ / A nd | Version: 7
\\\\/ M anipulation |
\\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0.0937 0 0);
boundaryField
{
inlet
{
type fixedValue;
value uniform (0.0937 0 0);
}
outlet
{
type zeroGradient;
}
axis
{
type empty;
}
top
{
type noSlip;
}
front
{
type symmetry;
}
back
{
type symmetry;
}
}
// ************************************************************************* //
Result of Symmtery BC at 10 degree Wedge Angle
Mesh
Velocity
Velocity At Entrance x=0.01m
Velocity at exit x= 2.81
Pressure Variation from X=0 to 2.82m
Result of Symmtery BC at 25 degree Wedge Angle
Mesh
Velocity Distribution
Velocity At Entrance x=0.01m
Velocity At Exit x=2.81m
Pressure Variation from X=0 to 2.82m
Result of Symmtery BC at 45 degree Wedge Angle
Velocity distribution
Velocity At Entrance x=0.01m
Velocity At Exit x=2.81m
From the above all graph its found that velocity is maximum at exit of pipe at x=2.81 & it velocity is get constant. At the entry region there is velocity is lower one due to higher kinematic pressure
Pressure Variation from X=0 to 2.82m
from the above graph it shows that as length of pipe increase in x-direction there is pressure is get it decrease & its constant slope is created , so that there is velocity increase at exit of pipe.
Result table
Parameter |
Wedge BC at 4 |
Symmetry BC at 10
|
Symmetry BC at 25 |
Symmetry BC at 45 |
Max.Velocity by hagen poiseuille (Theoretical) in m/sec |
0.1874 |
0.1874 |
0.1874 |
0.1874 |
Max.Velocity (Computational)m/sec |
0.1844 |
0.1842 |
0.1844 |
0.1843 |
Error in % |
1.6 |
1.7 |
1.6 |
1.6 |
Execution time in sec |
125.7 |
189.9 |
173.9 |
197.2 |
conclusion
1. As there is wedge angle increase there is error is get decreases ,so it means that result is nearly velocity is get increases & its reach to match the theoretical result of hagen poiseuille equation.
2. As there is wedge angle increase there is Execution time decrease , but for 45 angle it found that its increase.
3. Parabolic nature of flow is created for diffrent wedge angle.
4. Pressure diffrence is get decrase as wedge angle is increase.
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 10: Project 1 - FULL HYDRO case set up (PFI)
Title: Simulation of Full Hydro 4-Stroke PFI(Port fuel injection) Objective: 1. To understand the entire case setup 2. Simulation of PFI Engine in paraview 3. To calculate the engine…
09 Sep 2020 12:40 PM IST
No-hydro simulation of PFI (Port fuel injection) Engine in CONVERGE CFD
Title: No-hydro simulation by Surface preparation & boundry flagging in CONVERGE CFD Objective : 1. To Understand the boundry flagging & surface preparation on PFI 2. To perform the No-Hydro simulation of PFI Engine …
01 Sep 2020 01:40 PM IST
Literature review on RANS derivation & its Analysis
Title: Literature review on RANS derivation & its Analysis Objective: 1. Derive the RANS derivation 2. Importance of RANS Theory: The Reynolds-averaged Navier–Stokes equations (or RANS equations) are time-averaged equations…
21 Aug 2020 09:19 AM 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.