Challenge

Laminar Flow over a Backward Facing Step

AIM

The aim of this project is to modify blockmeshDict file for the given conditions

OBJECTIVE

The main objective of this project is to simulate the flow over a backward step in OpenFoam and to compare the velocity plots for different mesh grading factors.

BACKWARD FACING STEP

Backward-Facing Step (BFS) flow is one representative model for separation flows, which can be widely seen in aerodynamic flows,heat transfer systems, and even the flow around buildings. The flow separation after a simple stage will introduce separation bubble formation, evolution and re-attachment process, which is dependent on the backward facing step geometric design, the inlet and outlet conditions, turbulent intensity, as well as heat transfer conditions.it has been widely studied by various theoretical, experimental and numerical methods. It is shown that the step size (duct expansion ratio) will define the basic re-circulation and re-attachment process, while the coupled effects of inflow parameters and the perturbation designs also help shape the flow behaviors after backward facing step.

The above figure shows the geometry of the backward facing step. Now in this simulation we are going to simulate the flow through the backward facing step. As we are going to divide the entire geometry into 5 blocks to supply the boundary conditions as shown in the above figure.

Thus, we can observe that we are going to take the entire geometry and divide it into 5 blocks for mesh creation. Now in order to create such a geometry we need to edit the blockmeshDict file to create the blocks and supply the required block numbering and the mesh grading factor

BLOCKMESHDICT FILE

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

vertices
(
	(0 0 0)
	(80 0 0)
	(80 5 0)
	(0 5 0)
	(80 10 0)
	(0 10 0)
	(80 -10 0)
	(200 -10 0)
	(200 0 0)
	(200 5 0)
	(200 10 0)
	(0 0 1)
	(80 0 1)
	(80 5 1)
	(0 5 1)
	(80 10 1)
	(0 10 1)
	(80 -10 1)
	(200 -10 1)
	(200 0 1)
	(200 5 1)
	(200 10 1)
);

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

edges
(
);

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

mergePatchPairs
(
);

In the blockmeshDict file we can see that the first few lines shows the header information of the software and we can see the factor of convert to metres with a suitable scaling factor. In the next line we define our vertices of all the 21 points which is used in the creation of the geometry which is in the ascending order from 1-21 points. The vertices are defined in form of (x,y,z) co-ordinates in the local co-ordinate system.After defininig the vertices we can see the blocks line where we are specifying the blocks by using hexahedral mesh and by defininig the mesh grading factor. Now the mesh grading factor can be defined as below

f= (size of last cell)/(size of first cell)

Now in the simplegrading commands we have defined the mesh grading by a factor of 0.2 for the blocks in both x and y direction. Under the "boundary" statement we can see we have defined the following blocks according to the boundary conditions as

  1. Inlet- The inlet patch defines the boundary for the inlet flow variables
  2. outlet- The outlet patch defines the boundary for the outlet flow variables
  3. no slip walls
  4. empty faces

CONTROLDICT FILE

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

deltaT          0.0001;

writeControl    timeStep;

writeInterval   20;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;

The 'controlDict" file gives information on the time control step for the time marching solution. In this case we are saying that the start time is 0 seconds an the simulation should run for 1 second with the time step of 0.0001 seconds increment. Now we should be careful while choosing the start and end time for the simulation as the CFL number for the case should be less than 1.

Boundary Conditions

Now in CFD we have to provide the boundaty conditions at the outer walls of the geometry and in this pirticular case we are providing fixed value for velocity and pressure is floated. At the inlet the boundary conditions are assigned and the outlet boundary condition is calculated. The no slip walls shows us that there is no slippage between the surfaces.

p File

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

    noSlipWalls
    {
	type            zeroGradient;
    }

    frontAndBack
    {
	type            empty;
    }
}

The p file gives us the pressure conditions for the geometry where we can see that at the inlet the pressure is zero gradient. The zero gradient indicates that it is Neumann boundary condition at the outlet. The Neumann BC computes the information from the inner nodes using variuos interpolation schemes from the outer nodes. Here we are supplying 0 pascals as the boundary condition at the outlet

U file

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

    noSlipWalls
    {
	type            noSlip;
    }

    frontAndBack
    {
	type            empty;
    }
}

The U file gives the velocity conditions for the simulation. at the inlet we can see that the flow is defined which is the Dirschlle Boundary condition and at hte outlet we are providing Neumann boundary condition. The no slip wall conditions are applied to top and bottom walls with front and back as empty walls.At the inlet we are saying that the flow is coming at the rate of 1m/s.

RESULTS

Mesh grades for 0.2

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

The code for the creation of blocks and the mesh grading is shown for the mesh grading factor of 0.2

Mesh grade for 0.5

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

The code for the creation of blocks and the mesh grading is shown for the mesh grading factor of 0.5

Mesh grade for 0.8

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

The code for the creation of blocks and the mesh grading is shown for the mesh grading factor of 0.8

Velocity Distributions for 0.2

Velocity Distributions for 0.5

Velocity Distributions for 0.8

For the velocity distribution within the geometry we see that the velocity is entering into the domian at 1m/s and as we progress into the geometry the velocity gradually decreases. When there is sudden expansion in the step we notice that the velocity suddenly drops and it then remains constant during the next phase of the geometry. During the inlet when the flow enters the domain there is boundary layer seperation occurs which increases the drag in aerodynamic applications. As the boundary layer seperates the flow velocity near the walls is low and as we go towards the center of the geometry we can see that the velocity increases. The velocity profile can be useful in many flow application simulations which can be critical parameter.

Velocity Profile at 0.085 from inlet for mesh grade of 0.2

Velocity Profile at 0.085 from inlet for mesh grade of 0.5

Velocity Profile at 0.085 from inlet for mesh grade of 0.8

Plots shows us the velocity profiles for different mesh grading factors. Now in the velocity profile plots, velocity increases in non-linear variation which is parabolic in nature. The plot is not symmetrical about the y axis beacause when the velocity in the step region there is a re-circulation zone which is created after the step region and whch causes the boundary layer to seperate further. here we are creating the plot after a distance of 0.085 units after the inlet conditions. Velocity contour obtained by all the mesh grading factor is similar with the small difference and upon further study, it has identified that lower the mesh grading size higher will be the accuracy. From the plots we can infer that there is a small effect on the mesh size by changing the mesh grades. There is also negligible changes in the maximum velocity

for mesh grade of 0.2, velocity = 1.08332 m/s

for mesh grade of 0.5, velocity = 1.08953 m/s

for mesh grade of 0.8, velocity = 1.09247 m/s

CONCLUSION

  1. The effect of mesh grade on the velocity profile is very small
  2. As finer mesh will give better,more accurate results,so where we want to know velocity value,mesh size should be kept finer near that region.
  3. As we decrease the grading factor, mesh becomes finer and finer and the solution becomes more accurate
  4. Finally from all the plots velocity at point 0.085m from the inlet is about 1.1 m/s ,
  5. From above point, we can conclude that at the step the velocity jumps to maximum.
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.