Project

BlockMesh Drill down challenge

Objective

The objective of the study is to simulate the flow through a backward facing step of the given diagram.

Mesh specification

Number of cells along the x direction (longer dimension) = 200

Number of cells along the y direction = 10

1) BlockMeshDict File:

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

convertToMeters 1;

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

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

edges
(
);

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

mergePatchPairs
(
);

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

2) Velocity

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

    outlet
    {
        type            zeroGradient;
       
    }

    frontAndBack
    {
        type            empty;
    }
   topandbottom
    {
        type            noSlip;
    }
}
// ************************************************************************* //

3) Pressure

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

    frontAndBack
    {
        type            empty;
    }
   topandbottom
    {
        type            zeroGradient;
    }
}

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

The mesh file for 0.2 grade is shown below.

\"\"

Results:

The velocity profiles for ungrades, and for different grading systems is shown below.

1) ungraded (f=1)

\"\"

2) 0.8 grade

\"\"

3) 0.5 grade

\"\"

4) 0.2 grade

\"\"

Conclusions:

X axis provides the distance and the Y axis is the velocity.

The velocity was measured from 0.085 m from the inlet and the following graphs provides the information at that point.

As we can see from the above diagrams, all the graphs look similar in nature with a very small variation. But we can conclude that 0.2 grade mesh gives the accurate results as the mesh is finer as compared to that of 0.5 and 0.8 grade mesh.

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.