Challenge

Incompressible. transient laminar flow over a 2D backstep in openFOAM

OBJECTIVE - The aim of this project is to design and analyze incompressible,transient, laminar flow in a 2D backstep channel using openFOAM.

METHODOLOGY -

1. Geometry creation and Meshing

A similar tutorial to study a steady flow in a backstep channel is already available in tutorials folder of openFoam.

However, our aim is to model a transient flow over a slighlty different geometry.

The geometry and its dimesnions are given in the problem statement.

To solve for the transient laminar flow, the cavity tutorial has been copied from the tutorials folder to the run folder to prevent any damage to the original files.

To take advantage of already available solver files, the cavity tutorial has been used with sloght modifications in the blockMesh and intitial and boundary conditions.

The geometry has been modified in the blockMeshDict file, available in the system folder.

The entire geometry has been divided into 5 blocks (numbered from 0 to 4). This has been done to meet the requirement of fine mesh near the boundary walls and the step region.

Once this is done, the mesh has been created and a grading factor of 0.2, 0.5 and 0.8 (in both directions) have been used.

The final form of the blockMeshDict file is -

/*--------------------------------*- 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)			//block 0 pt0 back
    (0.08 0 0)			//block 0 pt1 back
    (0.08 0.005 0)		//block 0 pt2 back
    (0 0.005 0)		//block 0 pt3 back
    (0 0.01 0)			//block 1 pt4 back
    (0.08 0.01 0)		//block 1 pt5 back
    (0.2 0.01 0)		//block 2 pt6 back
    (0.2 0.005 0)		//block 2 pt7 back
    (0.2 0 0)			//block 3 pt8 back
    (0.2 -0.01 0)		//block 4 pt9 back
    (0.08 -0.01 0)		//block 4 pt10 back
    
    (0 0 1)			//block 0 pt11 front
    (0.08 0 1)			//block 0 pt12 front
    (0.08 0.005 1)		//block 0 pt13 front
    (0 0.005 1)		//block 0 pt14 front
    (0 0.01 1)			//block 1 pt15 front
    (0.08 0.01 1)		//block 1 pt16 front
    (0.2 0.01 1)		//block 2 pt17 front
    (0.2 0.005 1)		//block 2 pt18 front
    (0.2 0 1)			//block 3 pt19 front
    (0.2 -0.01 1)		//block 4 pt20 front
    (0.08 -0.01 1)		//block 4 pt21 front
    
    
    
                
);

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

edges
(
);

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

mergePatchPairs
(
);

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

2. Initial and boundary conditions -

The initial velocity and pressure in the domain has been assumed to be 0.

The BCs are -

Velocity(Ux, m/s) Pressure (Pa)
Inlet 0 zero Gradient
Outlet zero gradient 0

Apart from this, no slip boundary condition is set at the upper and lower walls and also at the step face.

The inlet velocity for all the cases (with different grading factors) is 1.5 m/s.

In addition to this, since this problem is 2D, the front and back walls have been set as type empty.

The file can be found in the 0 folders.

For pressure -

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

    upperWall
    {
        type            zeroGradient;
    }

    lowerWall
    {
        type            zeroGradient;
    }

    frontAndBack
    {
        type            empty;
    }
}

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

For Velocity -

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

    outlet
    {
        type            zeroGradient;
    }

    upperWall
    {
        type            noSlip;
    }

    lowerWall
    {
        type            noSlip;
    }

    frontAndBack
    {
        type            empty;
    }
}

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

3. Time step size

This is probably the most crucial variable to define.

Since this is a graded mesh, openFoam uses the following formula to calculate the minimum cell sizes.

`deltax_s = l(r-1)/(alphar - 1)`

where `deltax_s`is the size of the smallest cell

`l`is the length of the block

`r` is the ratio between one cell size and the next and is given by -

`r = R^(1/(n-1))`

R is the expansion ratio (grading factor)

`alpha = R` for R<1

`alpha = 1 - r^-n + r^-1` for R>1

For the solution to be stable, the CFL should be less than 1.

Thus, dt is calculated such that -

`CFL (= (deltat)/(deltax)*abs(U)) <1`

For our case, a time step size of 0.00005 gives stable solution.

Due to limited computational resource, the simulation has been carried out for 0.5 seconds only.

These inputs are provided in the controlDict file in the system folder -

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

writeControl    timeStep;

writeInterval   200;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;


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

6. Transport properties

The fluid medium is considered to be air with

`nu = 1.5e-05 m^2/s`

It has been defined in the transportProperties file in the constant folder.

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


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

RESULTS AND DISCUSSIONS -

Case 1 - Grading factor = 0.2

Meshed Geometry

At time = 0.1 sec -

At time = 0.5 sec

Case 2 - Grading factor = 0.5

Meshed Geometry

At time = 0.5 sec

Case 3 - Grading factor = 0.8

Meshed geometry

At time = 0.5

In all the three cases above, the pressure and velocity plots clearly indicate the recirculation zones setup(eddy formation captured at time = 0.1 sec) due to boundary layer separation near the step region. Also in the inlet section, the boundary layers setup near the wall can be clearly observed. The velocity profile is still developing.

Similarly, the velocity profile at 0.085 m from the inlet is similar in all the three cases. The velocity below the step is very less at and a steep increase is observed above the step.

The increase in the velocity (greater than inlet velocity) can be attributed to the separation of boundaryl layer which reduces the flow area in the above the separation zone. This causes sudden increase in the velocity.

Similarly low pressure pockets can be observed in entire flow domain due to flow separtion near the step and its after effects.

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.