Project

Flow our Backward Facing Step

BlockMesh Drill down challenge:

The classical backward facing step is most sought after problem in CFD. The following geometry represents the backward facing steps with boundry conditions.

\"\"

Mesh specification

  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

The folw our backward facing steps are carried for different mesh grading factor 0.2, 0.5, 0.8. The velocity profile is measured accros the step profile (i.e, 0.085m from Inlet). The velocity profile changes with grading factor.

To creat the geometry, BlockMeshDict file from cavity tutorial is updated as follow

/*--------------------------------*- 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.08 0 0)
    (0.08 0.005 0)
    (0 0.005 0)
    (0.08 0.01 0)
    (0 0.01 0)
    (0.20 0.01 0)
    (0.20 0.005 0)
    (0.20 0 0) 
    (0.20 -0.01 0)
    (0.08 -0.01 0)
    (0 0 0.001)
    (0.08 0 0.001) 
    (0.08 0.005 0.001)
    (0 0.005 0.001)
    (0.08 0.01 0.001)
    (0 0.01 0.001)
    (0.20 0.01 0.001)
    (0.20 0.005 0.001)
    (0.20 0 0.001)
    (0.20 -0.01 0.001)
    (0.08 -0.01 0.001)
);

blocks
(
    hex (0 1 2 3 11 12 13 14) (80 5 1) simpleGrading (1 1 1)
    hex (3 2 4 5 14 13 15 16) (80 5 1) simpleGrading (1 1 1)
    hex (2 7 6 4 13 18 17 15) (120 5 1) simpleGrading (1 1 1)
    hex (1 8 7 2 12 19 18 13) (120 5 1) simpleGrading (1 1 1) 
    hex (10 9 8 1 21 20 19 12) (120 10 1) simpleGrading (1 1 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) 
        );
    }
    No_slip_face
    {
        type wall; 
        faces
        (
            (0 1 12 11)
            (1 10 21 12)
            (10 9 20 21)
            (5 16 15 4)
            (4 15 17 6)
        );
    }
    front_and_back
    {
        type empty;
        faces 
        (
            (0 3 2 1) 
            (3 5 4 2) 
            (10 1 8 9)
            (1 2 7 8)
            (2 4 6 7)  
            (11 12 13 14) 
            (14 13 15 16)
            (21 20 19 12)
            (12 19 18 13)
            (13 18 17 15)
        ); 
    } 
);
mergePatchPairs
(
);

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

This will creat a geometry with no grading factor.

Pressure file (p):

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

boundaryField
{
    inlet
    {
        type            zeroGradient; 
    }
    outlet
    {
        type           fixedValue; 
        value          uniform 0;
    }
    No_slip_face
    {
        type            zeroGradient; 
    }
    front_and_back
    {
        type            empty;
    }
}

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

Velocity file (U):

/*--------------------------------*- 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 (2 0 0);
    }
    outlet
    { 
       type             zeroGradient; 
    }
    No_slip_face 
    {
        type            noSlip;
    }

    front_and_back
    {
        type            empty;
    }
}

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

ControlDict 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;
    location    \"system\";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     icoFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         0.15; 

deltaT          1e-5; 

writeControl    timeStep;

writeInterval   20;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;


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

Transport Properties:

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

nu              [0 2 -1 0 0 0 0] 0.01;


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

Flow Conditions:

The fluid properties are,

  • Viscosity: 0.01 `(m^2)/s`
  • the Inlet speed: 2 `m/s`
  • Start time is: 0
  • Endtime: 0.15 Second
  • Time step: 1e-5

The geometry for 0.2, 0.5 and 0.8 grading factor is look respectively as follow:

0.2 Mesh grading along X & Y direction:

\"\"

0.5 Mesh grading along X & Y direction:

\"\"

0.8 Mesh grading along X & Y direction:

\"\"

Flow simulation of fluid on backward facing steps:

0.2 Grading Factor

\"\"

0.5 Grading Factor

\"\"

0.8 Grading Factor

\"\"

It Can be seen that vortex formed near the step region changes with the grading factor

Velocity Line Plot:

The following plots are obtained by analyzing the flow at X = 0.085 m from inlet, Point 1 (0.085, -0.01) and Point 2 (0.085, 0.01)

Velocity plot for 0.2 grading factor:

\"\"

Velocity plot for 0.5 grading factor:

\"\"

Velocity plot for 0.8 grading factor:

\"\"

When grading is 0.2, the velocity at step region is near to 2m/s compare to the other plot. The accuracy can be further increase by finer mesh along X & Y directions.

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.