Challenge

Week 8 - BlockMesh Drill down challenge

AIM-to create a BlockMesh and to simulate it .

OBJECTIVES:-

  • How does the velocity magnitude profile change as a function of mesh grading factor. Use factors, 0.2, 0.5,0.8
  • Measure the velocity profile at 0.085 m from the inlet of the geometry
  • Plot must be a line plot
  • Compare velocity magnitude contours near the step region for the above mentioned grading factors.

SOME INPUTS:-

  1. Number of cells along the x direction (longer dimension) = 200
  2. Number of cells along the y direction = 10
  3. Use a graded mesh. Grading factor near all walls should be 0.2

PROBLEM

OPENFOAM

Openfoam is a opensource software,it is the free, open source CFD software developed by openFoamCFD limited since 2004. It has a large user base across most areas of engineering and science, from both commercial and academic organisations. OpenFOAM has an extensive range of features to solve anything from complex fluid flows involving chemical reactions, turbulence and heat transfer, to acoustics, solid mechanics and electromagnetics.

ABOUT THE SOLVER

icoFoam solves the incompressible laminar Navier-Stokes equations using the PISO algorithm. The code is inherently transient, requiring an initial condition (such as zero velocity) and boundary conditions. The icoFOAM code can take mesh non-orthogonality into account with successive non-orthogonality iterations. The number of PISO corrections and non-orthogonality corrections are controlled through user input.

BLOCKMESH

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

convertToMeters 0.001;

vertices
(
    (0 0 0)//0
    (80 0 0)//1
    (80 5 0)//2
    (0 5 0)//3
    (80 10 0)//4
    (0 10 0)//5
    (200 10 0)//6
    (200 5 0)//7
    (200 0 0)//8
    (200 -10 0)//9
    (80 -10 0)//10
    (0 0 1)//11
    (80 0 1)//12
    (80 5 1)//13
    (0 5 1)//14
    (80 10 1)//15
    (0 10 1)//16
    (200 10 1)//17
    (200 5 1)//18
    (200 0 1)//19
    (200 -10 1)//20
    (80 -10 1)//21
    
);

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

edges
(
);

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

mergePatchPairs
(
);

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

CONTROL DICT FILE

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

application     icoFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         0.5;

deltaT          0.0001;

writeControl    timeStep;

writeInterval   20;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;


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

INITIAL PRESSURE

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  8
     \\/     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;
    }
}

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

INITIAL VELOCITY

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  8
     \\/     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);
    }
    outlet
    {
        type            zeroGradient;
    }


    fixedWalls
    {
        type            noSlip;
        value           uniform (0 0 0);
    }

    frontAndBack
    {
        type            empty;
    }
}

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

MESHGRADING FACTOR 0.2

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

MESHING FACTOR AT 0.2

MESHGRADING FACTOR 0.5

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

MESHGRADING FACTOR 0.8

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

MESH GRADING 0.8

CONCLUSION

  • From the above results the results cannot be differentiated , but from the database it is observed that

U(0.2)=0.372729

U(0.5)=0.373843

U(0.8)=0.379172

at a distance of 0.085 from the starting point.

  • The time taken for simulating 0.2 is the least.

Thus we conclude lower meshgrading size better is the accuracy.

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.