Week 12 - Validation studies of Symmetry BC vs Wedge BC in OpenFOAM vs Analytical H.P equation
Introduction
The inlet conditions remain the same and the angle of the wedge is increased to 10°, 25°, 45° respectively and the results are compared, the wedge type is required to be updated from wedge to symmetry in blockMesh, pressure, and velocity files.
Problem
In this challenge, simulation of the same problem as the previous challenge but by applying Symmetry Boundary Condition. Do the simulation for the below-mentioned angles using both symmetry and wedge boundary conditions and validate them with HP equations as done previously.
Angles
- 10°
- 25°
- 45°
Solution
Just like the previous week’s challenge solutions we will use MATLAB to generate the ‘blockMeshDict’ file and we will do it for the angles of wedge mentioned above and once the files are generated we will transport them to OpenFOAM and generate the results.
To get the results we will have to copy the original file thrice and make changes in the ‘wedge’ in the controlDict file, velocity file, and the pressure file will change to type ‘symmetry’.
clear all
close all
clc
%% Input
D = 0.04;
theta1 = 10;
theta2 = 25;
theta3 = 45;
Re = 2100;
L = 0.06*Re*D;
r = D/2;
L_p = 0.7+L;
mu = 0.89e-3;
rho = 1000;
v_avg = (Re*mu)/(rho/D);
v_max = 2*(v_avg);
%% Shear Stress Computation
R = linspace(-0.01,0.01,1000);
for i = 1:length(R)
tau(i) = (2*mu*v_max*(abs(R(i))))/(r^2);
end
%% Plotting
figure(1)
plot(R,tau)
xlabel('Radial Dist. in (m)');
ylabel('Shear Stress tau in (N/m^2)');
title(sprintf('Change in Shear stress in fully developed flow'));
grid minor
%% Coordinates
% 10 deg
Ca0 = [0 0 0];
Ca1 = [0 r*(cosd(theta1/2)) r*(sind(theta1/2))];
Ca2 = [0 r*(cosd(theta1/2)) -r*(sind(theta1/2))];
Ca3 = [L_p 0 0];
Ca4 = [L_p r*(cosd(theta1/2)) r*(sind(theta1/2))];
Ca5 = [L_p r*(cosd(theta1/2)) -r*(sind(theta1/2))];
% 25 deg
Cb0 = [0 0 0];
Cb1 = [0 r*(cosd(theta2/2)) r*(sind(theta2/2))];
Cb2 = [0 r*(cosd(theta2/2)) -r*(sind(theta2/2))];
Cb3 = [L_p 0 0];
Cb4 = [L_p r*(cosd(theta2/2)) r*(sind(theta2/2))];
Cb5 = [L_p r*(cosd(theta2/2)) -r*(sind(theta2/2))];
% 45 deg
Cc0 = [0 0 0];
Cc1 = [0 r*(cosd(theta3/2)) r*(sind(theta3/2))];
Cc2 = [0 r*(cosd(theta3/2)) -r*(sind(theta3/2))];
Cc3 = [L_p 0 0];
Cc4 = [L_p r*(cosd(theta3/2)) r*(sind(theta3/2))];
Cc5 = [L_p r*(cosd(theta3/2)) -r*(sind(theta3/2))];
%% File Generation
h1 = ('/*--------------------------------*- C++ -*--------------------------------*\');
h2 = (' ========= ');
h3 = (' \\ / F ield | OpenFOAM: The Open Source CFD Toolbox ');
h4 = (' \\ / O peration | Version: 9 ');
h5 = (' \\ / A nd | Web: www.OpenFOAM.org ');
h6 = (' \\/ M anipulation | ');
h7 = ('\*-------------------------------------------------------------------------*/');
h8 = ('// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //');
% 10 deg
% Header
name1 = sprintf('blockMeshDict_%d',theta1);
f1 = fopen(name1,'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, 'FoamFile \n');
fprintf(f1, '{ \n');
fprintf(f1, '%12s \t 2.0; \n','version');
fprintf(f1, '%11s \t ascii; \n', 'format');
fprintf(f1, '%10s \t dictionary; \n', 'class');
fprintf(f1, '%11s \t blockMeshDict; \n', 'object');
fprintf(f1, '}\n');
fprintf(f1, '%s \n\n',h8);
% Vertices
fprintf(f1, 'convertToMeters 1; \n\n');
fprintf(f1, 'vertices \n');
fprintf(f1, '(\n');
fprintf(f1, '\t(%d %d %d) \n',Ca0(1),Ca0(2),Ca0(3));
fprintf(f1, '\t(%d %d %d) \n',Ca1(1),Ca1(2),Ca1(3));
fprintf(f1, '\t(%d %d %d) \n',Ca2(1),Ca2(2),Ca2(3));
fprintf(f1, '\t(%d %d %d) \n',Ca3(1),Ca3(2),Ca3(3));
fprintf(f1, '\t(%d %d %d) \n',Ca4(1),Ca4(2),Ca4(3));
fprintf(f1, '\t(%d %d %d) \n',Ca5(1),Ca5(2),Ca5(3));
fprintf(f1, '); \n\n');
fprintf(f1, 'blocks \n');
fprintf(f1, '(\n');
fprintf(f1, ' \t hex (0 3 5 2 0 3 4 1) (300 30 1) SimpleGrading (1 0.1 1)\n');
fprintf(f1, ');\n\n');
fprintf(f1, 'edges\n');
fprintf(f1, '(\n');
fprintf(f1, '\t arc %d %d (%d %d %d)\n',1,2,0,r,0);
fprintf(f1, '\t arc %d %d (%d %d %d)\n',4,5,L_p,r,0);
fprintf(f1, ');\n\n');
fprintf(f1, 'boundary\n');
fprintf(f1, '(\n');
fprintf(f1, '\t inlet \n');
fprintf(f1, '\t { \n');
fprintf(f1, '\t\t type patch;\n');
fprintf(f1, '\t\t faces\n');
fprintf(f1, '\t\t ( \n');
fprintf(f1, '\t\t\t (0 1 2 0) \n');
fprintf(f1, '\t\t ); \n');
fprintf(f1, '\t } \n');
fprintf(f1, '\t outlet \n');
fprintf(f1, '\t { \n');
fprintf(f1, '\t\t type patch;\n');
fprintf(f1, '\t\t faces\n');
fprintf(f1, '\t\t ( \n');
fprintf(f1, '\t\t\t (3 5 4 3) \n');
fprintf(f1, '\t\t ); \n');
fprintf(f1, '\t } \n');
fprintf(f1, '\t top \n');
fprintf(f1, '\t { \n');
fprintf(f1, '\t\t type wall;\n');
fprintf(f1, '\t\t faces\n');
fprintf(f1, '\t\t ( \n');
fprintf(f1, '\t\t\t (1 4 5 2) \n');
fprintf(f1, '\t\t ); \n');
fprintf(f1, '\t } \n');
fprintf(f1, '\t front \n');
fprintf(f1, '\t { \n');
fprintf(f1, '\t\t type symmetry;\n');
fprintf(f1, '\t\t faces\n');
fprintf(f1, '\t\t ( \n');
fprintf(f1, '\t\t\t (0 3 4 1) \n');
fprintf(f1, '\t\t ); \n');
fprintf(f1, '\t } \n');
fprintf(f1, '\t back \n');
fprintf(f1, '\t { \n');
fprintf(f1, '\t\t type symmetry;\n');
fprintf(f1, '\t\t faces\n');
fprintf(f1, '\t\t ( \n');
fprintf(f1, '\t\t\t (0 2 5 3) \n');
fprintf(f1, '\t\t ); \n');
fprintf(f1, '\t } \n');
fprintf(f1, '\t axis \n');
fprintf(f1, '\t { \n');
fprintf(f1, '\t\t type empty;\n');
fprintf(f1, '\t\t faces\n');
fprintf(f1, '\t\t ( \n');
fprintf(f1, '\t\t\t (0 3 3 0) \n');
fprintf(f1, '\t\t ); \n');
fprintf(f1, '\t } \n');
fprintf(f1, '\t );\n\n');
fprintf(f1, 'mergePatchPairs \n');
fprintf(f1, '(\n');
fprintf(f1, ');\n');
h9 = ('// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //');
fprintf(f1, '%s\n',h9);
fclose(f1);
% 25 deg
% Header
name2 = sprintf('blockMeshDict_%d',theta2);
f2 = fopen(name2,'w');
fprintf(f2, '%s\n',h1);
fprintf(f2, '%s\n',h2);
fprintf(f2, '%s\n',h3);
fprintf(f2, '%s\n',h4);
fprintf(f2, '%s\n',h5);
fprintf(f2, '%s\n',h6);
fprintf(f2, '%s\n',h7);
fprintf(f2, 'FoamFile \n');
fprintf(f2, '{ \n');
fprintf(f2, '%12s \t 2.0; \n','version');
fprintf(f2, '%11s \t ascii; \n', 'format');
fprintf(f2, '%10s \t dictionary; \n', 'class');
fprintf(f2, '%11s \t blockMeshDict; \n', 'object');
fprintf(f2, '}\n');
fprintf(f2, '%s \n\n',h8);
% Vertices
fprintf(f2, 'convertToMeters 1; \n\n');
fprintf(f2, 'vertices \n');
fprintf(f2, '(\n');
fprintf(f2, '\t(%d %d %d) \n',Cb0(1),Cb0(2),Cb0(3));
fprintf(f2, '\t(%d %d %d) \n',Cb1(1),Cb1(2),Cb1(3));
fprintf(f2, '\t(%d %d %d) \n',Cb2(1),Cb2(2),Cb2(3));
fprintf(f2, '\t(%d %d %d) \n',Cb3(1),Cb3(2),Cb3(3));
fprintf(f2, '\t(%d %d %d) \n',Cb4(1),Cb4(2),Cb4(3));
fprintf(f2, '\t(%d %d %d) \n',Cb5(1),Cb5(2),Cb5(3));
fprintf(f2, '); \n\n');
fprintf(f2, 'blocks \n');
fprintf(f2, '(\n');
fprintf(f2, ' \t hex (0 3 5 2 0 3 4 1) (300 30 1) SimpleGrading (1 0.1 1)\n');
fprintf(f2, ');\n\n');
fprintf(f2, 'edges\n');
fprintf(f2, '(\n');
fprintf(f2, '\t arc %d %d (%d %d %d)\n',1,2,0,r,0);
fprintf(f2, '\t arc %d %d (%d %d %d)\n',4,5,L_p,r,0);
fprintf(f2, ');\n\n');
fprintf(f2, 'boundary\n');
fprintf(f2, '(\n');
fprintf(f2, '\t inlet \n');
fprintf(f2, '\t { \n');
fprintf(f2, '\t\t type patch;\n');
fprintf(f2, '\t\t faces\n');
fprintf(f2, '\t\t ( \n');
fprintf(f2, '\t\t\t (0 1 2 0) \n');
fprintf(f2, '\t\t ); \n');
fprintf(f2, '\t } \n');
fprintf(f2, '\t outlet \n');
fprintf(f2, '\t { \n');
fprintf(f2, '\t\t type patch;\n');
fprintf(f2, '\t\t faces\n');
fprintf(f2, '\t\t ( \n');
fprintf(f2, '\t\t\t (3 5 4 3) \n');
fprintf(f2, '\t\t ); \n');
fprintf(f2, '\t } \n');
fprintf(f2, '\t top \n');
fprintf(f2, '\t { \n');
fprintf(f2, '\t\t type wall;\n');
fprintf(f2, '\t\t faces\n');
fprintf(f2, '\t\t ( \n');
fprintf(f2, '\t\t\t (1 4 5 2) \n');
fprintf(f2, '\t\t ); \n');
fprintf(f2, '\t } \n');
fprintf(f2, '\t front \n');
fprintf(f2, '\t { \n');
fprintf(f2, '\t\t type symmetry;\n');
fprintf(f2, '\t\t faces\n');
fprintf(f2, '\t\t ( \n');
fprintf(f2, '\t\t\t (0 3 4 1) \n');
fprintf(f2, '\t\t ); \n');
fprintf(f2, '\t } \n');
fprintf(f2, '\t back \n');
fprintf(f2, '\t { \n');
fprintf(f2, '\t\t type symmetry;\n');
fprintf(f2, '\t\t faces\n');
fprintf(f2, '\t\t ( \n');
fprintf(f2, '\t\t\t (0 2 5 3) \n');
fprintf(f2, '\t\t ); \n');
fprintf(f2, '\t } \n');
fprintf(f2, '\t axis \n');
fprintf(f2, '\t { \n');
fprintf(f2, '\t\t type empty;\n');
fprintf(f2, '\t\t faces\n');
fprintf(f2, '\t\t ( \n');
fprintf(f2, '\t\t\t (0 3 3 0) \n');
fprintf(f2, '\t\t ); \n');
fprintf(f2, '\t } \n');
fprintf(f2, '\t );\n\n');
fprintf(f2, 'mergePatchPairs \n');
fprintf(f2, '(\n');
fprintf(f2, ');\n');
fprintf(f2, '%s\n',h9);
fclose(f2);
% 45 deg
% Header
name3 = sprintf('blockMeshDict_%d',theta3);
f3 = fopen(name3,'w');
fprintf(f3, '%s\n',h1);
fprintf(f3, '%s\n',h2);
fprintf(f3, '%s\n',h3);
fprintf(f3, '%s\n',h4);
fprintf(f3, '%s\n',h5);
fprintf(f3, '%s\n',h6);
fprintf(f3, '%s\n',h7);
fprintf(f3, 'FoamFile \n');
fprintf(f3, '{ \n');
fprintf(f3, '%12s \t 2.0; \n','version');
fprintf(f3, '%11s \t ascii; \n', 'format');
fprintf(f3, '%10s \t dictionary; \n', 'class');
fprintf(f3, '%11s \t blockMeshDict; \n', 'object');
fprintf(f3, '}\n');
fprintf(f3, '%s \n\n',h8);
% Vertices
fprintf(f3, 'convertToMeters 1; \n\n');
fprintf(f3, 'vertices \n');
fprintf(f3, '(\n');
fprintf(f3, '\t(%d %d %d) \n',Cc0(1),Cc0(2),Cc0(3));
fprintf(f3, '\t(%d %d %d) \n',Cc1(1),Cc1(2),Cc1(3));
fprintf(f3, '\t(%d %d %d) \n',Cc2(1),Cc2(2),Cc2(3));
fprintf(f3, '\t(%d %d %d) \n',Cc3(1),Cc3(2),Cc3(3));
fprintf(f3, '\t(%d %d %d) \n',Cc4(1),Cc4(2),Cc4(3));
fprintf(f3, '\t(%d %d %d) \n',Cc5(1),Cc5(2),Cc5(3));
fprintf(f3, '); \n\n');
fprintf(f3, 'blocks \n');
fprintf(f3, '(\n');
fprintf(f3, ' \t hex (0 3 5 2 0 3 4 1) (300 30 1) SimpleGrading (1 0.1 1)\n');
fprintf(f3, ');\n\n');
fprintf(f3, 'edges\n');
fprintf(f3, '(\n');
fprintf(f3, '\t arc %d %d (%d %d %d)\n',1,2,0,r,0);
fprintf(f3, '\t arc %d %d (%d %d %d)\n',4,5,L_p,r,0);
fprintf(f3, ');\n\n');
fprintf(f3, 'boundary\n');
fprintf(f3, '(\n');
fprintf(f3, '\t inlet \n');
fprintf(f3, '\t { \n');
fprintf(f3, '\t\t type patch;\n');
fprintf(f3, '\t\t faces\n');
fprintf(f3, '\t\t ( \n');
fprintf(f3, '\t\t\t (0 1 2 0) \n');
fprintf(f3, '\t\t ); \n');
fprintf(f3, '\t } \n');
fprintf(f3, '\t outlet \n');
fprintf(f3, '\t { \n');
fprintf(f3, '\t\t type patch;\n');
fprintf(f3, '\t\t faces\n');
fprintf(f3, '\t\t ( \n');
fprintf(f3, '\t\t\t (3 5 4 3) \n');
fprintf(f3, '\t\t ); \n');
fprintf(f3, '\t } \n');
fprintf(f3, '\t top \n');
fprintf(f3, '\t { \n');
fprintf(f3, '\t\t type wall;\n');
fprintf(f3, '\t\t faces\n');
fprintf(f3, '\t\t ( \n');
fprintf(f3, '\t\t\t (1 4 5 2) \n');
fprintf(f3, '\t\t ); \n');
fprintf(f3, '\t } \n');
fprintf(f3, '\t front \n');
fprintf(f3, '\t { \n');
fprintf(f3, '\t\t type symmetry;\n');
fprintf(f3, '\t\t faces\n');
fprintf(f3, '\t\t ( \n');
fprintf(f3, '\t\t\t (0 3 4 1) \n');
fprintf(f3, '\t\t ); \n');
fprintf(f3, '\t } \n');
fprintf(f3, '\t back \n');
fprintf(f3, '\t { \n');
fprintf(f3, '\t\t type symmetry;\n');
fprintf(f3, '\t\t faces\n');
fprintf(f3, '\t\t ( \n');
fprintf(f3, '\t\t\t (0 2 5 3) \n');
fprintf(f3, '\t\t ); \n');
fprintf(f3, '\t } \n');
fprintf(f3, '\t axis \n');
fprintf(f3, '\t { \n');
fprintf(f3, '\t\t type empty;\n');
fprintf(f3, '\t\t faces\n');
fprintf(f3, '\t\t ( \n');
fprintf(f3, '\t\t\t (0 3 3 0) \n');
fprintf(f3, '\t\t ); \n');
fprintf(f3, '\t } \n');
fprintf(f3, '\t );\n\n');
fprintf(f3, 'mergePatchPairs \n');
fprintf(f3, '(\n');
fprintf(f3, ');\n');
fprintf(f3, '%s\n',h9);
fclose(f3);
From the above code, we generate 3 different ‘blockMeshDict’ files for 10°, 25°, 45° respectively.
In the folders that are copied, the changes are done to pressure and the velocity files in the respective computation folders.

We then import all the generated files in their respective folders and starting with the file of the wedge angle 10° we edit the pressure and velocity file.
Once that is done we use the ‘blockMesh’ command to generate the profile and the mesh.
BlockMeshDict for 10Deg. wedge angle
/*--------------------------------*- C++ -*--------------------------------*\
=========
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Version: 9
\\ / A nd | Web: www.OpenFOAM.org
\\/ M anipulation |
\*-------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
(0 0 0)
(0 1.992389e-02 1.743115e-03)
(0 1.992389e-02 -1.743115e-03)
(5.740000e+00 0 0)
(5.740000e+00 1.992389e-02 1.743115e-03)
(5.740000e+00 1.992389e-02 -1.743115e-03)
);
blocks
(
hex (0 3 5 2 0 3 4 1) (300 30 1) SimpleGrading (1 0.1 1)
);
edges
(
arc 1 2 (0 2.000000e-02 0)
arc 4 5 (5.740000e+00 2.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
(
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
BlockMeshDict for 25Deg. wedge angle
/*--------------------------------*- C++ -*--------------------------------*\
=========
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Version: 9
\\ / A nd | Web: www.OpenFOAM.org
\\/ M anipulation |
\*-------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
(0 0 0)
(0 1.952592e-02 4.328792e-03)
(0 1.952592e-02 -4.328792e-03)
(5.740000e+00 0 0)
(5.740000e+00 1.952592e-02 4.328792e-03)
(5.740000e+00 1.952592e-02 -4.328792e-03)
);
blocks
(
hex (0 3 5 2 0 3 4 1) (300 30 1) SimpleGrading (1 0.1 1)
);
edges
(
arc 1 2 (0 2.000000e-02 0)
arc 4 5 (5.740000e+00 2.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
(
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
BlockMeshDict for 45Deg. wedge angle
/*--------------------------------*- C++ -*--------------------------------*\
=========
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Version: 9
\\ / A nd | Web: www.OpenFOAM.org
\\/ M anipulation |
\*-------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
(0 0 0)
(0 1.847759e-02 7.653669e-03)
(0 1.847759e-02 -7.653669e-03)
(5.740000e+00 0 0)
(5.740000e+00 1.847759e-02 7.653669e-03)
(5.740000e+00 1.847759e-02 -7.653669e-03)
);
blocks
(
hex (0 3 5 2 0 3 4 1) (300 30 1) SimpleGrading (1 0.1 1)
);
edges
(
arc 1 2 (0 2.000000e-02 0)
arc 4 5 (5.740000e+00 2.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
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 9
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application icoFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 130;
deltaT 0.02;
writeControl timeStep;
writeInterval 50;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
// ************************************************************************* //
Pressure
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 9
\\/ 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 1;
}
top
{
type zeroGradient;
}
front
{
type symmetry;
}
back
{
type symmetry;
}
axis
{
type empty;
}
}
// ************************************************************************* //
Velocity
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 9
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0.0467 0 0);
boundaryField
{
inlet
{
type fixedValue;
value uniform (0.0467 0 0);
}
outlet
{
type zeroGradient;
}
top
{
type fixedValue;
value uniform (0 0 0);
}
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: 9
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
nu [0 2 -1 0 0 0 0] 8.9256e-07;
// ************************************************************************* //
10Deg
We run the 'blockMesh' Command.

Which is followed by the 'checkMesh' command.

Then we simulate with the 'icoFoam' command.

Then with 'paraFoam', we get the visual representation of the same.




25Deg
We run the 'blockMesh' Command.

Which is followed by the 'checkMesh' command.

Then we simulate with the 'icoFoam' command.

Then with 'paraFoam', we get the visual representation of the same.




45Deg
We run the 'blockMesh' Command.

Which is followed by the 'checkMesh' command.

Then we simulate with the 'icoFoam' command.

Then with 'paraFoam', we get the visual representation of the same.




Shear Stress
Analytical shear stress

Shear stress for 10 deg wedge

maximum shear stress for 10 deg wedge is 0.00824254 N/m^2.
Shear stress for 25 deg wedge

Pressure

Pressure drop for 10Deg wedge (developed flow)

Pressure drop for 25Deg wedge (developed flow)

Pressure drop for 45Deg wedge (developed flow)
Velocities
| 10Deg | 25Deg | 45Deg | |
| V_max Calculated | 0.0923145 | 0.0924114 | 0.0926211 |
| V_max Analytical | 0.095 | 0.095 | 0.095 |
| % error | 2.82% | 2.72% | 2.5% |
Observation
As the wedge angle increases the value of 'Courant Number' also increases.
Symmetry Boundary Condition requires less time as compared to wedge boundary condition for solving.
Accuracy also increases with the wedge angle.