Challenge

Week 8 - BlockMesh Drill down challenge

Objective

  • To study velocity magnitude profile based on mesh grading factor changes such as 0.2, 0.5,0.8
  • Measure the velocity profile at 0.085 m from the inlet and see the changes in velocity pattern according to mesh.

Block Generation

  • For blockmesh we need to generate the blocks.
  • We have define the vertices X,Y,Z according to numbering given in figure 1
  • It can be seen in below figure 0-1 gives X axis and 1-2 gives Y axis.
  • In this way we need to generate 5 blocks for this case such as
  • hex (0 1 2 10 11 12 13 21) (200 10 1) simpleGrading (5 5 1)
  • 200 is no of division on X axis and 5 is grading along X axis
  • 10 is no of division on Y axis and 5 is grading along Y axis
  • 1 is no of division on Z axis and 1 is grading along Z axis
  • Near Wall fine mesh is generated to resolve no slip condition

/*--------------------------------*- 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.12 0 0)
(0.12 0.01 0)
(0.12 0.015 0)
(0.12 0.02 0)
(0 0.02 0)
(-0.08 0.02 0)
(-0.08 0.015 0)
(-0.08 0.01 0)
(0 0.015 0)
(0 0.01 0)
(0 0 0.01)
(0.12 0 0.01)
(0.12 0.01 0.01)
(0.12 0.015 0.01)
(0.12 0.02 0.01)
(0 0.02 0.01)
(-0.08 0.02 0.01)
(-0.08 0.015 0.01)
(-0.08 0.01 0.01)
(0 0.015 0.01)
(0 0.01 0.01)
);

blocks
(
hex (0 1 2 10 11 12 13 21) (200 10 1) simpleGrading (5 5 1)
hex (10 2 3 9 21 13 14 20) (200 10 1) simpleGrading (5 5 1)
hex (9 3 4 5 20 14 15 16) (200 10 1) simpleGrading (5 0.2 1)
hex (7 9 5 6 18 20 16 17) (200 10 1) simpleGrading (1 0.2 1)
hex (8 10 9 7 19 21 20 18) (200 10 1) simpleGrading (1 5 1)
);

edges
(
);

boundary
(
inlet
{
type patch;
faces
(
(6 17 18 7)
(7 18 19 8)
);
}
outlet
{
type patch;
faces
(
(4 3 14 15)
(3 2 13 14)
(2 1 12 13)
);
}
fixedWalls
{
type wall;
faces
(
(17 6 5 16)
(16 5 4 15)
(19 21 10 8)
(11 12 1 0)
(21 11 0 10)
);
}
frontAndBack
{
type empty;
faces
(
(0 1 2 10)
(9 10 2 3)
(5 9 3 4)
(5 6 7 9)
(7 8 10 9)
(21 13 12 11)
(20 14 13 21)
(16 15 14 20)
(17 16 20 18)
(18 20 21 19)
);
}
);

mergePatchPairs
(
);

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

Boundary Defination

Inlet

  • For inlet use right hand rule on (6 17 18 7) (7 18 19 8) this gives inlet faces and named as patch.

Outlet

  • For outlet use right hand rule on (4 3 14 15) (3 2 13 14) (2 1 12 13) this gives outlet faces and named as patch.

Front and Back

  • For front and back use right hand rule on (0 1 2 10) (9 10 2 3) (5 9 3 4) (5 6 7 9) (7 8 10 9) (21 13 12 11) (20 14 13 21) (16 15 14 20) (17 16 20 18) (18 20 21 19) this gives front and back faces and named as empty.

Wall

  • For wall use right hand rule on (17 6 5 16) (16 5 4 15) (19 21 10 8) (11 12 1 0) (21 11 0 10) this gives wall faces and named as wall.

/*--------------------------------*- 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 0.6;

deltaT 0.00001;

writeControl timeStep;

writeInterval 5000;

purgeWrite 0;

writeFormat ascii;

writePrecision 6;

writeCompression off;

timeFormat general;

timePrecision 6;

runTimeModifiable true;


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

ControlDict

  • Specify the start time and end time.
  • Specify data files saving iteration.

/*--------------------------------*- 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;
}


fixedWalls
{
type zeroGradient;
}

frontAndBack
{
type empty;
}
}

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

Pressure Condition

  • Outlet set 0
  • Wall and inlet zero gradinet.

/*--------------------------------*- 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 0 0);

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

fixedWalls
{
type noSlip;

value uniform (0 0 0);
}

frontAndBack
{
type empty;
}
outlet
{
type zeroGradient;
}
}

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

Velocity Condition

  • Inlet set 1
  • Wall no slip condition.
  • Outlet zero gradient

Results

Grading 0.2

hex (0 1 2 10 11 12 13 21) (200 10 1) simpleGrading (5 5 1)
hex (10 2 3 9 21 13 14 20) (200 10 1) simpleGrading (5 5 1)
hex (9 3 4 5 20 14 15 16) (200 10 1) simpleGrading (5 0.2 1)
hex (7 9 5 6 18 20 16 17) (200 10 1) simpleGrading (1 0.2 1)
hex (8 10 9 7 19 21 20 18) (200 10 1) simpleGrading (1 5 1)

Grading 0.5

hex (0 1 2 10 11 12 13 21) (200 10 1) simpleGrading (5 5 1)
hex (10 2 3 9 21 13 14 20) (200 10 1) simpleGrading (5 5 1)
hex (9 3 4 5 20 14 15 16) (200 10 1) simpleGrading (5 0.5 1)
hex (7 9 5 6 18 20 16 17) (200 10 1) simpleGrading (1 0.5 1)
hex (8 10 9 7 19 21 20 18) (200 10 1) simpleGrading (1 5 1)

Grading 0.8

hex (0 1 2 10 11 12 13 21) (200 10 1) simpleGrading (5 5 1)
hex (10 2 3 9 21 13 14 20) (200 10 1) simpleGrading (5 5 1)
hex (9 3 4 5 20 14 15 16) (200 10 1) simpleGrading (5 0.8 1)
hex (7 9 5 6 18 20 16 17) (200 10 1) simpleGrading (1 0.8 1)
hex (8 10 9 7 19 21 20 18) (200 10 1) simpleGrading (1 5 1)

Mesh

Maximum velocity is observed in case of 0.2 refinement case.

Velocity contours at 0.085 from leading edge.

Maximum velocity is observed in case of 0.2 refined mesh case.

Conclusion

From this challege as the grading factor decreases the velocity profile becomes smooth.

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.

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.