Challenge

Week 12 - Validation studies of Symmetry BC vs Wedge BC in OpenFOAM vs Analytical H.P equation

AIM:

To simulate an axi-symmetric flow by applying the wedge boundary condition.

simulation for the below mentioned angles using both symmetry and wedge boundary conditions and validate them with HP equations like you did in previous challenge.

Assumptions

  • The steady laminar incompressible flow of a fluid is taken.
  • There is no acceleration since the flow is steady.
  • Reynolds number for the laminar flow is 2100.
  • Only the wedge shape of the pipe is considered because the flow is axis-symmetric.
  • The equation governing the fluid flow is described by the Hagen-Poiseuille equation.

Hagen-Poiseuille equation:

Code Explanation:

  • First We are creating Topology of Geometry. In order create a Topology we need Vertices, Hexa Blocks, Boundarys of the Geometry.
  • A point is a location in 3-D space, defined by a vector in units of metres . The points are compiled into a list and each point is referred to by a label, which represents its position in the list, starting from zero.
  • A face is an ordered list of points, where a point is referred to by its label. The ordering of point labels in a face is such that each two neighbouring points are connected by an edge,Faces are compiled into a list and each face is referred to by its label, representing its position in the list. The direction of the face normal vector is defined by the right-hand rule.
  • Internal faces, which connect two cells (and it can never be more than two). For each internal face, the ordering of the point labels is such that the face normal points into the cell with the larger label
  • Boundary faces, which belong to one cell since they coincide with the boundary of the domain. A boundary face is therefore addressed by one cell(only) and a boundary patch

Script for blockMeshDict file

/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 9
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

// blockMesh parameterization

/* Geometrical Info */

D 0.004; // Diameter
r #calc "0.5*$D"; // Radius
angle 10; //(10,25,45degrees) // Angle in degrees
theta #calc "degToRad($angle)"; // Angle in radians
Re 2100; // Reynolds Number
Le #calc "0.06*$Re*$D"; // Entrance Length
L #calc "0.2 + $Le"; // Total length of pipe

/* Vertices Info */

xmin 0;
xmax $L;
ymax #calc "$r*cos($theta)";
zmax #calc "$r*sin($theta)";
zmin #calc "-$r*sin($theta)";

/* Mesh Info */

nx 10; // Cells along local X
ny 1; // Cells along local Y
nz 50; // Cells along local Z
gx 0.2; // SG along local X
gy 1; // SG along local Y
gz 1; // SG along local Z


convertToMeters 1;

vertices
(
($xmin 0 0) //0
($xmin $ymax $zmax) //1
($xmin $ymax $zmin) //2
($xmax 0 0) //3
($xmax $ymax $zmax) //4
($xmax $ymax $zmin) //5

);

blocks
(
hex (0 2 1 0 3 5 4 3) ($nx $ny $nz) simpleGrading ($gx $gy $gz)
);

edges
(
);

boundary
(
inlet
{
type patch;
faces
(
(0 1 2 0)
);
}
outlet
{
type patch;
faces
(
(3 5 4 3)
);
}
front
{
type symmetry;
faces
(
(0 3 4 1)
);
}
back
{
type symmetry;
faces
(
(0 2 5 3)
);
}
wall
{
type wall;faces
(
(2 1 4 5)
);
}
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: 9
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application icoFoam;

startFrom startTime;

startTime 0;

stopAt endTime;

endTime 5;

deltaT 0.001;

writeControl timeStep;

writeInterval 500;

purgeWrite 0;

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: 9
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
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;
}

front
{
type symmetry;
}

back
{
type symmetry;
}

wall
{
type zeroGradient;
}

axis
{
type empty;
}
}

// ************************************************************************* //

Velocity File

/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 9
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


dimensions [0 1 -1 0 0 0 0];

internalField uniform (0 0 0);

boundaryField
{
inlet
{
type fixedValue;
value uniform (0.468655967903711 0 0);
}

outlet
{
type zeroGradient;
}

front
{
type symmetry;
}

back
{
type symmetry;
}

wall
{
type noSlip;
}

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
{
format ascii;
class dictionary;
location "constant";
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

nu [0 2 -1 0 0 0 0] 8.9267803410231e-07;


// ************************************************************************* //

Paraview screenshots and output plots:

Mesh:

Angle 10 deg:

Velocity_Maganitude:

Shear_stress_magnitude:

Angle 25 deg:

Velocity_Maganitude:

Shear_stress_magnitude:

Angle 45 deg:

Velocity_Maganitude:

Shear_stress_magnitude:

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.