Challenge

BlockMesh Drill down Challenge

The objective of this challenge is to generate the geometry according to the given specification and to check its velocity distribution for various grading factors such as 0.2,0.5,0.8

FLOW USING A BACKWARD FACING STEP:

The backwards-facing step is an interesting case for studying the performance and solution strategy of a turbulence model. In this case, the flow is subjected to a sudden increase of cross-sectional area, resulting in a separation of flow starting at the point of expansion.

Spatial variations in the velocity field cause production of turbulence outside the wall region and its interaction with the mean flow influences the size of the separation bubble. The size of the bubble, or the re-attachment length, is one of the quantities that must be predicted accurately by a turbulence model.

BLOCKMESH DICT FILE EXPLAINED:

VERTICES:

Each vertice contains the x,y,z coordinates, here as per our requirement 21 vertices are created starting from origin vertex 0.

BLOCKS:

A face contains four vertices. A block contains 8 vertices. Here we use 5 blocks and mark each block by the vertice number.

GRADING FACTOR:

Here simpleGrading is used to grade the blocks. If 0.8 is the grading factor along x. It means that the size of the end cell is 0.8 times the size of start cell.

For grading factor 0.2, 0.8 is replaced with 0.2 and 1.8 is replaced with 1.2 in the Dict file

For grading factor 0.5, 0.8 is replaced with 0.5 and 1.8 is replaced with 1.5 in the Dict file

BOUNDRY:

Patch:

The basic patch type for a patch condition that contains no geometric or topological information about the mesh (with the exception of the wall), e.g. an inlet or an outlet.

Wall:

There are instances where a patch that coincides with a wall needs to be identifiable as such, particularly where specialist modelling is applied at wall boundaries. A good example is wall turbulence modelling where a wall must be specified with a wall patch type so that the distance from the wall of the cell centres next to the wall are stored as part of the patch.

Empty:

While OpenFOAM always generates geometries in 3 dimensions, it can be instructed to solve in 2 (or 1) dimensions by specifying a special empty condition on each patch whose plane is normal to the 3rd (and 2nd) dimension for which no solution is required.

EDITING THE BLOCKMESH DICT 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;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 0.001;

vertices
(
    (0 0 -0.5)
    (80 0 -0.5)
    (80 5 -0.5)
    (0 5 -0.5)
    (80 10 -0.5) 
    (0 10 -0.5)
    (200 10 -0.5)
    (200 5 -0.5)
    (200 0 -0.5)
    (200 -10 -0.5)
    (80 -10 -0.5)

    (0 0 0.5)
    (80 0 0.5)
    (80 5 0.5)
    (0 5 0.5)
    (80 10 0.5) 
    (0 10 0.5)
    (200 10 0.5)
    (200 5 0.5)
    (200 0 0.5)
    (200 -10 0.5)
    (80 -10 0.5)
);


blocks
(
    hex (0 1 2 3 11 12 13 14)
    (100 5 1)
    simpleGrading (0.8 1.8 1)

    hex (3 2 4 5 14 13 15 16)
    (100 5 1)
    simpleGrading (0.8 0.8 1)

    hex (2 7 6 4 13 18 17 15)
    (100 5 1)
    simpleGrading (1.8 0.8 1)

    hex (1 8 7 2 12 19 18 13)
    (100 5 1)
    simpleGrading (1.8 1.8 1)

    hex (10 9 8 1 21 20 19 12)
    (100 5 1)
    simpleGrading (1.8 0.8 1)
);

edges
(
);

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

	  (11 12 1 0)
	  (21 20 9 10) 
        );
    }
    frontAndBack
    {
        type empty;
        faces
        (
        

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

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

EDITING THE CONTROL DICT:

Here we assign the start time, end time, Timestep and number of intervals.

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

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         5;

deltaT          0.005;

writeControl    timeStep;

writeInterval   20;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;

functions
{
    #includeFunc streamlines
}

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

MESH GENERATION FOR 0.2:

MESH GENERATION FOR 0.5:

MESH GENERATION FOR 0.8:

BOUNDRY CONDITIONS PRESSURE AND VELOCITY FILE EXPLAINED:

fixedValue:

This boundary condition supplies a fixed value constraint, and is the base class for a number of other boundary conditions

zeroGradient:

This boundary condition applies a zero-gradient condition from the patch internal field onto the patch faces.

noslip:

The noSlip boundary condition is an alternative to the zero fixedValue boundary condition for velocity. There is no difference between them.

THE PRESSURE 'p' 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       volScalarField;
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -2 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    inlet
    {
        type            zeroGradient;
    }

    outlet
    {
        type            fixedValue;
        value           uniform 5;
    }

    upperWall
    {
        type            zeroGradient;
    }

    lowerWall
    {
        type            zeroGradient;
    }

    frontAndBack
    {
        type            empty;
    }
}

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

EDITING THE VELOCITY 'U' FILE:

Here we assign a value of 15 at inlet along the x-axis:

/*--------------------------------*- 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 (15 0 0);
    }

    outlet
    {
        type            zeroGradient;
    }

    upperWall
    {
        type            noSlip;
    }

    lowerWall
    {
        type            noSlip;
    }

    frontAndBack
    {
        type            empty;
    }
}

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

VELOCITY DISTRIBUTION:

The velocity distribution looks the same for any grading factor such as 0.2,0.5,0.8.

The velocity has minimal effect in the 5th block as it is not in touch with the inlet. Blocks 1,2,3 receive the effect of velocity 15 as we mentioned in the boundary condition.

PROBE POSITIONING:

To visualize the plot at a distance of 0.085m from the inlet 'Plot over line' command is used from Data analysis>Filter.

The x,y,z coordinates are positioned such that we derive a plot for velocity at 0.085m from inlet.

PLOT FOR GRADING FACTORS AT 0.085m FROM INLET:

The X-axis represents the time step and Y-axis the velocity. In the U file, we assigned velocity as 15m/s. Here we could see that from a distance of 0.085m from the inlet, the velocity reaches 15 and then drops as time step increases.

CONCLUSIONS:

The required geometry is created by editing the blockMesh Dict file.

The mesh is generated for various grading factors.

When the grading factor increases, the smoothness of the curve changes

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.