Challenge

Week 8 - Simulation of a backward facing step in OpenFOAM

Aim-To simulate flow through backward facing step.

-measuring the velocity profile at 8.5m from the inlet.

-To compare the velocity plot the the different grading factors.

Steps-

The geometry is than divided into 5 different blocks.

Blockmeshdict in the tutorials system folder creates the geometry for the simulation and that is modified by giving the verices according to the geometry.

  • mesh creation- we have divided the geometry along the x axis in 200 cells and alog y axis in the 10
  • The simple grading factor is selected as 1 and 0.2 for the simulating the flow.
  • Boundary conditions-for the two walls the front and back there is no noslip condition because we are interested in velocity profile along the y direction so they are specified as the empty.

The top and bottom walls are given as the no slip walls.we want to know variation of velocity between this two layers

The total simulation time and the time step is specified with the help of the controDict file and it is given as timestep=0.0003 and the endtime 0.3

Initial conditions

for initial condition velocity is given some uniform value and for pressure it is taken as zerogradient at the inlet

at outlet the velocity is as zerogradient and pressure is uniform as value zero.

Post processing the results

velocity contour for the grading factor 1

Velocity contour for the grading factor 0.2

conclusion

From both the plots we can see that the parabola is shifted towards right side which means the top side the velocity is higher after the step due to recirculation zone.

code

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  8
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1;

vertices
(
    (0 0 0)
    (.08 0 0)
    (.08 0.005 0)
    (0 0.005 0)
    (0.08 0.01 0)
    (0 0.01 0)
    (0.2 0.01 0)
    (0.2 0.005 0)
    (0.2 0 0)
    (0.2 -0.01 0)
    (0.08 -0.01 0)
    (0 0 0.1)
    (.08 0 0.1)
    (.08 0.005 0.1)
    (0 0.005 0.1)
    (0.08 0.01 0.1)
    (0 0.01 0.1)
    (0.2 0.01 0.1)
    (0.2 0.005 0.1)
    (0.2 0 0.1)
    (0.2 -0.01 0.1)
    (0.08 -0.01 0.1)
);

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 (10 9 8 1 21 20 19 12) (120 10 1) simpleGrading (1 1 1)
    hex (1 8 7 2 12 19 18 13) (120 5 1) simpleGrading (1 1 1)
    hex (2 7 6 4 13 18 17 15) (120 5 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)
        );
    }
    frontAndBack
    {
        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)
        );
    }
    noslipwalls
    {
	 type wall;
	 faces
	 (
	    (5 16 15 4)
	    (4 15 17 6)
	    (10 21 12 1)
	    (0 1 12 11)
	    (10 9 20 21)
	 );
    }
);

mergePatchPairs
(
);

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