Project

Phil Dias Backward Facing Step

Introduction:

This project simulated flow through a backward facing step using icoFOAM using the software OpenFOAM. This simulation resulted velocity and pressure profiles for three different mesh grading factors (MGF). The three MGFs are 0.2, 0.5, and 0.8. This project required 200 cells along the x-direction and 10 cells along the y-direction.The nature of the flow is incompressible. Five individual blocks were used to create the specified geometry.

Geometry of the backward facing step:

OpenFOAM Code:

Block Mesh:

/*--------------------------------*- 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
    (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.001)           //11
    (0.08 0 0.001)        //12 
    (0.08 0.005 0.001)    //13
    (0 0.005 0.001)       //14
    (0.08 0.01 0.001)     //15
    (0 0.01 0.001)        //16
    (0.2 0.01 0.001)      //17
    (0.2 0.005 0.001)     //18   
    (0.2 0 0.001)         //19
    (0.2 -0.01 0.001)     //20
    (0.08 -0.01 0.001)    //21
);

blocks
(
    hex (0 1 2 3 11 12 13 14) (80 5 1) simpleGrading (0.2 5 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 5 1)
    hex (10 9 8 1 21 20 19 12) (120 10 1) simpleGrading (5 5 1)
);

edges
(
);

boundary
(
    inlet
    {
        type patch;
        faces
        (
            (0 11 14 3)
            (3 14 16 5)  
        );
    }

    outlet
    {
        type wall;
        faces
        (
            (9 8 19 20)
            (8 7 18 19)
            (7 6 17 18)
        );
    }

    upperwalls
    {
        type wall;
        faces
        (
            (5 16 15 4)
            (4 15 17 6)
        );
    }

    lowerwalls
    {
        type wall;
        faces
        (
            (0 1 12 11)
            (10 21 12 1)
            (10 9 20 21)
        );
    }

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

mergePatchPairs
(
);

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

Boundary Conditions:

Velocity Conditions:

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

    outlet
    {
        type            zeroGradient;
    }

     upperwalls
    {
        type            noSlip;
    } 

     lowerwalls
    {
        type            noSlip;
    }

    frontAndBack
    {
        type            empty;
    }
}

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

Pressure Conditions:

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

     upperwalls
    {
        type            zeroGradient;
    } 

     lowerwalls
    {
        type            zeroGradient;
    }

    frontAndBack
    {
        type            empty;
    }
}

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

Kinematic Viscosity:

Air -- `= 1.48e-5 (m^2)/(s)`

/*--------------------------------*- 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    \"constant\";
    object      transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

nu              [0 2 -1 0 0 0 0] 1.48e-5;


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

Time Step:

/*--------------------------------*- 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.5;

deltaT          0.0005;

writeControl    timeStep;

writeInterval   20;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;


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

Mesh Grading Factor (MGF) :

In this project MGFs of 0.2, 0.5, and 0.8 were tested.

Results:

MGF 0.2:

https://youtu.be/sXl7BaCcruU

MGF 0.5:

https://youtu.be/CL9IzrzCm-o

MGF 0.8:

https://youtu.be/dZ-XHpVurWM

Conclusion:

MGF is used in this project to calculate flow quantities at a desired location. Increasing the MGF allowed the graph to be smoother. However; in this project I did not see a significant difference in the smoothness of the curves by switching the MGF.

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.