Comparison of Wedge and Symmetry boundary conditions for the Simulation of Laminar Flow in a Pipe using AxiSymmetry
Objective: To simulate one dimensional laminar flow through a pipe and compare the results for different wedge angles
The diameter of the pipe is taken as 0.02m in this case. the corresponding values of the other parameters are as follows:
Pipe Diameter:0.02
Reynolda Number 2100
Inlet velocity:0.0937m/s
Entry Lengthy:2.52m
Pressure Drop: 16.817
Kinematic Pressure drop:0.101m^2/s^2
The matlab script below generates the blockmesh file. the script takes the diameter, wedge angle, mesh grading and the type of boundary condition required as the input.
It also takes the input if the boundary condition should be wedge or symmetry.
clear all
close all
clc
%inputs
D=input(\'enter Diameter\');
theta=input(\'Enter Wedge angle \');
Re=2100;
rho=997;
mu=0.89e-3;
g=input(\'Mesh Grading\');
s=1e-2;
dr=2e-4;
bc=input(\'Enter 1:Symmetry 2:Wedge\');
if bc==1
bc=(\'symmetry\');
else if bc==2
bc=(\'wedge\');
end
end
%pressure drop calculation
V=(Re*mu)/(rho*D);
Vmax=2*V;
A=pi*D^2/4;
Q=A*V;
L=0.06*Re*D;
DP=(32*mu*L*V)/D^2;
dp=DP/rho;
%variables
r=D/2;
x1=r*cosd(theta/2);
x2=r*cosd(theta/2);
y1=-r*sind(theta/2);
y2=r*sind(theta/2);
%generate text file
text1=\'/*--------------------------------*-C++ -*--------------------------------*\\\';
text2=\'| ========= | |\';
text3=\'| \\\\ / F ield | OpenFOAM: The Open Source CFD Toolbox |\';
text4=\'| \\\\ / O peration | Website: https://openfoam.org |\';
text5=\'| \\\\ / A nd | Version: 7 |\';
text6=\'| \\\\/ M anipulation | |\';
text7=\'\\*-------------------------------------------------------------------------*/\';
text8=\'// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //\';
f1=fopen(\'blockMeshDict\',\'w\');
fprintf(f1,\'%s\\n\',text1);
fprintf(f1,\'%s\\n\',text2);
fprintf(f1,\'%s\\n\',text3);
fprintf(f1,\'%s\\n\',text4);
fprintf(f1,\'%s\\n\',text5);
fprintf(f1,\'%s\\n\',text6);
fprintf(f1,\'%s\\n\',text7);
fprintf(f1,\'FoamFile\\n{\\n\\t version\\t \\t 2.0;\\n\\t format \\t \\t ascii;\\n\\t class \\t \\t dictionary; \\n\\t object \\t \\t blockMeshDict;\\n}\\n \');
fprintf(f1,\'%s\\n\',text8);
fprintf(f1,\'\\nconvertToMeters 1;\\n\');
fprintf(f1,\'vertices\\n(\\n\');
fprintf(f1,\'\\t(0 0 0)\\n\\t(%8.7f %8.7f 0)\\n\\t(%8.7f %8.7f 0)\\n\',x1,y1,x2,y2);
fprintf(f1,\'\\t(0 0 %8.3f)\\n\\t(%8.7f %8.7f %8.3f)\\n\\t(%8.7f %8.7f %8.3f)\\n);\\n\',L,x1,y1,L,x2,y2,L);
fprintf(f1,\'\\nblocks\\n(\\n\\t\\t hex (0 1 2 0 3 4 5 3) (%2.0f 1 %3.0f) simpleGrading ( %2.1f 1 1)\\n);\\n\',r/dr,L/s,g);
fprintf(f1,\'\\nedges\\n(\\n\\tarc 1 2 (0 %8.3f 0)\\n\\tarc 4 5(0 %8.3f %8.3f)\\n);\\n\',r,r,L);
fprintf(f1,\'\\nboundary\\n(\\n\');
fprintf(f1,\'\\taxis\\n\\t{\\n\\t\\ttype empty;\\n\\t\\tfaces\\n\\t\\t(\\n\\t\\t\\t(3 3 0 0)\\n\\t\\t);\\n}\\n\');
fprintf(f1,\'\\twall\\n\\t{\\n\\t\\ttype wall;\\n\\t\\tfaces\\n\\t\\t(\\n\\t\\t\\t(2 5 4 1)\\n\\t\\t);\\n}\\n\');
fprintf(f1,\'\\tinlet\\n\\t{\\n\\t\\ttype patch;\\n\\t\\tfaces\\n\\t\\t(\\n\\t\\t\\t(3 4 5 3)\\n\\t\\t);\\n}\\n\');
fprintf(f1,\'\\toutlet\\n\\t{\\n\\t\\ttype patch;\\n\\t\\tfaces\\n\\t\\t(\\n\\t\\t\\t(0 2 1 0)\\n\\t\\t);\\n}\\n\');
fprintf(f1,\'\\tfront\\n\\t{\\n\\t\\ttype %s;\\n\\t\\tfaces\\n\\t\\t(\\n\\t\\t\\t(1 4 3 0)\\n\\t\\t);\\n}\\n\',bc);
fprintf(f1,\'\\tback\\n\\t{\\n\\t\\ttype %s;\\n\\t\\tfaces\\n\\t\\t(\\n\\t\\t\\t(5 2 0 3)\\n\\t\\t);\\n}\\n\',bc);
fprintf(f1,\');\\n\');
fprintf(f1,\'%s\\n\',text8);
A mesh grading of 0.3 is chosen.
The angles tested are 10, 25 and 45 degrees and the inlet side of the mesh is as shown in the figure below:
the simulation is carried out by taking time steps 0.01s for a total time of 10s.
Results:
The maximum velocity obtained for the given diameter and Reynolds number is 0.1875m/s.
For wedge angle 10, the final velocity profiles obtained for both symmetry and wedge boundary conditions are as follows
For wedge angle 25, the final velocity profiles obtained for both symmetry and wedge boundary conditions are as follows
For wedge angle 45, the final velocity profiles obtained for both symmetry and wedge boundary conditions are as follows
The results are summarised in the below table:
The execution time is lower for wedge condition that for symmetry condition The velocity profiles obtained are however very similar. The execution time also increases as the wedge angle increases.