Project

Simulation of a flow through backward facing step -Open Foam

Project Objective :

  • To simulate the fluid flow through a backward facing step in openFoam using icoFoam solver .
  • To predict the magnitude of velocity at a distance of 0.085 m from the inlet section of the geometry & grid dependency is also tested for this prediction by imposing various mesh gradings ( 0.2 ,0.5 &0.8 )with respect to the wall respectively.

Scope of the project

The work is carried out with the aid of tutorial named cavity under the icoFoam solver and the appropriate Geometry , Mesh , Boundary and initial conditions are created by modifying the script files from the respective solver .

Modelling information:

The solver here used is icoFoam which solves for a combination of transient , laminar , incompressible and newtonian fluid flow problems.

Since this is a mere flow problem , energy equations are not required and it solves for only the mass balance (continuity eqn ) and Force balance (Momentum balance) respectively.

The flow is assumed to be incompressible ( water is used as a working fluid ) and the flow is assumed to be a two dimensional flow (i.e) not a function of z axis .

Boundary conditions :

The inlet velocity is set to be 1 m/s and boundary condition at the outlet is pressure outlet .

Inital conditions :

The initial conditions for the above flow problem is defined in accordance with the velocity and size of the mesh.

Keeping the velocity constant(1 m/s) , For the ungraded mesh , size of the mesh is 0.001 m .So to keep the CFL number less than 1 ( here we fixed as 0.5) ,the time step should be 5e-04.Similarly for the grading factor of 0.2 , the minimum size of the mesh is 0.0002 m ( 20 % of the ungraded) , so the time step for this case setup is 1e-04 .In this fashion , the time step is to be fixed for the next two cases .

  • for grading = 0.5 , the least size of mesh is 0.0005(50 %) , so del t = 2.5e-04
  • for grading = 0.8 , the least size of mesh is 0.0008 (80 %), so del t = 4 e-04 .

The code snippet for the vertices and grading information is as follows :

/*--------------------------------*- 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 0.01 0)				//4
    (0.08 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 0.01 0.001)			//15
    (0.08 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 (1 1 1)
    hex (3 2 5 4 14 13 16 15) (80 5 1) simpleGrading (1 1 1)
    hex (2 7 6 5 13 18 17 16) (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
(
    fixedWalls
    {
        type wall;
        faces
        (
            (15 16 5 4)
            (16 17 6 5)
            (0 1 12 11)
            (10 21 12 1)
            (10 9 20 21)
        );
    }
    frontAndBack
    {
        type empty;
        faces
        (
            (0 3 2 1)
            (11 12 13 14)
            (3 4 5 2)
            (14 13 16 15)
            (2 5 6 7)
            (13 18 17 16)
            (1 2 7 8)
            (12 19 18 13)
            (10 1 8 9)
            (21 20 19 12)
        );
    }
    inlet
    {
	type patch;
	faces
	(
	    (0 11 14 3)
	    (3 14 15 4)
	);
    }

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

mergePatchPairs
(
);

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

Grading setup for 0.2

blocks
(
    hex (0 1 2 3 11 12 13 14) (80 5 1) simpleGrading (1 5 1)
    hex (3 2 5 4 14 13 16 15) (80 5 1) simpleGrading (1 0.2 1)
    hex (2 7 6 5 13 18 17 16) (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)
);

Grading setup for 0.5

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

Grading setup for 0.8

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

Results and discussions :

The mesh and the Vector contours is shown for the four case setups ( Ungraded , graded to 0.2 ,graded to 0.5 & graded to 0.8 in order ).

a ) Ungraded b) graded to 0.2 c) graded to 0.5 d) graded to 0.8

\"\"

\"\"

\"\"

\"\"

The velocity contours in the same order (Ungraded , 0.2 ,0.5,0.8) as follows

\"\"

\"\"

\"\"

\"\"

The Line plot for the above cases in the same order(Ungraded , 0.2 ,0.5,0.8) as follows:

\"\"

\"\"

\"\"

\"\"

Inference :

As seen from the above plot , the velocity profile looks fairly similar but when through deeper look at the location of highest velocity , it is observed that for the grading 0.2 , the more information is captured at that particular location which is seen by a flatter profile .Near the wall the profile looks similiar but by looking the data points , we were able to predict what is the lowest velocity closes to the wall at a distance of 0.085 m from inlet for all the above cases .

Ungraded : U = 0.00037

graded to 0.2 : U = 0.00010

graded to 0.5 : U = 0.00035

graded to 0.8 : U = 0.00036

Thus the quality with which the information is retrived based on the mesh resolution and time step .

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.