Project

BlockMesh Backward step

Introduction:

This project is based on setting up an Backward facing step flow using Converge CFD. The main objective of this project is to study the velocity profiles of a Backward facing block which is meshed by using different kinds of grid points. The changes in these grid points will be helpful to study the velocity profile and also to reduce the analytical error while calculating. The different kinds of mesh grids are shown below.

\"\"

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

Procedure:

  • Creating a Backward facing Block with required dimension using Converge CFD.
  • Setting up the Test Case for the Block.
  • Providing the Grid for the Block by using any of the Grid points which are mentioned above.
  • After creating and saving the BlockMesh, the file is run by using the comand prompt.
  • The results are viewed by using Paraview.

BLOCKMESH SCRIPT:

UNGRADED FACTOR:

/*--------------------------------*- C++ -*----------------------------------*\\
| =========                 |                                                 |
| \\\\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\\\    /   O peration     | Version:  4.1                                   |
|   \\\\  /    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
    (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 5 1) simpleGrading (0.2 0.2 1)
    hex (3 2 4 5 14 13 15 16) (80 5 1) simpleGrading (0.2 0.2 1)
    hex (2 7 6 4 13 18 17 15) (120 5 1) simpleGrading (5 0.2 1)
    hex (1 8 7 2 12 19 18 13) (120 5 1) simpleGrading (5 0.2 1)
    hex (10 9 8 1 21 20 19 12) (120 10 1) simpleGrading (5 0.2 1)
);

edges
(
);

boundary
(
    inlet
    {
        type patch;
        faces
        (
            (0 3 11 14)
            (3 14 16 5)
        );
    }
    outlet
    {
        type patch;
        faces
        (
           (9 8 19 20)
	   (8 7 18 19)
	   (7 6 17 18)
        );
    }
    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
(
);

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

PRESSURE:

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

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

VELOCITY:

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

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

VELOCITY MAGNITUDE:

\"\"

LINE PLOPT:

\"\"

GRADED FACTOR=0.2:

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

VELOCITY MAGNITUDE:

\"\"

LINE PLOT:

\"\"

GRADED FACTOR =0.5:

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

VELOCITY MAGNITUDE:

\"\"

LINE PLOT:

\"\"

GRDED FACTOR=0.8:

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

VELOCITY MAGNITUDE:

\"\"

LINE PLOT:

\"\"

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.