Project

BlockMesh Drill down challenge

Aim:

To conduct the blockmesh drill down challenge in incompressible-laminar-viscous flow through the backward facing step geometry using openFoam software.

Objectives:

  • To create a given geometry by assigning the proper vertices.
  • To create a blockMesh on the geometry by different grading factor.
  • To run the blockmesh drill down test using the proper solver.
  • To conduct the simulation under different grading factor.
  • To analyse the velocity profile at 0.085 m from the inlet of the geometry in various simulations.

Geometry :

The geometry for the drill down challenge should be created based on the given input conditions. The following geometry is created by assigning the proper vertices.

This geometry is splitted up into 5 blocks as follow,

This 3D image is marked up with vertices on each block on both front and back. The block 1 is marked with the vertices 0 1 2 3 on the back face and 11 12 13 14 on the front face.

Similarly, all the other blocks are assigned with proper or correct vertices. These vertices was assigned in the blockmesh dict file to create the required shape.

Simulation setup at OpenFoam:

  • Initially, the tutorial folder at the OpenFoam is opened and the incompressible directory is opened.
  • The suitable solver is selected. Here the icoFoam solver is selected to solve.
  • The cavity directory is opened and again the directory folder is opened inside the cavity directory.
  • Under which the system directory is opened the blockMeshDict file and the controlDict file is edited.
  • The two files are edited based on our geometry.
  • The remaining files fvSchemes and fvSolutions are set as default.

BlockMesh Dict file:

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

vertices
(
    (0 0 0)
    (8 0 0)
    (8 0.5 0)
    (0 0.5 0)
    (8 1 0)
    (0 1 0)
    (20 1 0)
    (20 0.5 0)
    (20 0 0)
    (20 -1 0)
    (8 -1 0)
    (0 0 0.1)
    (8 0 0.1)
    (8 0.5 0.1)
    (0 0.5 0.1)
    (8 1 0.1)
    (0 1 0.1)
    (20 1 0.1)
    (20 0.5 0.1)
    (20 0 0.1)
    (20 -1 0.1)
    (8 -1 0.1)
);

blocks
(
    hex (0 1 2 3 11 12 13 14) (200 20 1) simpleGrading (0.2 1.2 1)
    hex (3 2 4 5 14 13 15 16) (200 20 1) simpleGrading (0.2 0.2 1)
    hex (2 7 6 4 13 18 17 15) (200 20 1) simpleGrading (1.2 0.2 1)
    hex (1 8 7 2 12 19 18 13) (200 20 1) simpleGrading (1.2 1.2 1)
    hex (10 9 8 1 21 20 19 12) (200 20 1) simpleGrading (1.2 1.2 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)
            (0 1 12 11)
            (10 21 12 1)
            (10 9 20 21)
        );
     }      
);

mergePatchPairs
(
);

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

Control Dict file:

/*--------------------------------*- 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;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     icoFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         0.5;

deltaT          0.0001;

writeControl    timeStep;

writeInterval   20;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;


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

Boundary conditions:

  • The pressure and velocity conditions are assigned in both inlet and outlet conditions.
  • The pressure has a uniform internal field.
  • The moving wall and the fixed wall are assigned with the zero gradient.
  • The front and back walls are assigned as empty.
  • The velocity conditions are also assigned.
  • The moving wall is assigned with fixed velocity value.
  • The 1m/s velocity is assigned on the x axis.
  • The noslip is assigned at the fixed walls and the front and back are empty.

Pressure condition:

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

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

internalField   uniform 0;

boundaryField
{
    movingWall
    {
        type            zeroGradient;
    }

    fixedWalls
    {
        type            zeroGradient;
    }

    frontAndBack
    {
        type            empty;
    }
}

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

Velocity condition:

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

dimensions      [0 1 -1 0 0 0 0];

internalField   uniform (0 0 0);

boundaryField
{
    movingWall
    {
        type            fixedValue;
        value           uniform (1 0 0);
    }

    fixedWalls
    {
        type            noSlip;
    }

    frontAndBack
    {
        type            empty;
    }
}

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

These conditions are assigned for different grading factor.

Meshing :

  • The case 1 is with the grading factor of 1 and the case 2 is with the grading factor of 0.2.
  • Number of cells along the x direction (longer dimension) = 200.
  • Number of cells along the longer y direction = 20.
  • The grading factor is assigned in the blockMesh Dict file.
  • Grading Factor = 1    
    
        hex (0 1 2 3 11 12 13 14) (200 20 1) simpleGrading (1 1 1)
        hex (3 2 4 5 14 13 15 16) (200 20 1) simpleGrading (1 1 1)
        hex (2 7 6 4 13 18 17 15) (200 20 1) simpleGrading (1 1 1)
        hex (1 8 7 2 12 19 18 13) (200 20 1) simpleGrading (1 1 1)
        hex (10 9 8 1 21 20 19 12) (200 20 1) simpleGrading (1 1 1)
  • Grading Factor = 0.2    
    
        hex (0 1 2 3 11 12 13 14) (200 20 1) simpleGrading (0.2 1.2 1)
        hex (3 2 4 5 14 13 15 16) (200 20 1) simpleGrading (0.2 0.2 1)
        hex (2 7 6 4 13 18 17 15) (200 20 1) simpleGrading (1.2 0.2 1)
        hex (1 8 7 2 12 19 18 13) (200 20 1) simpleGrading (1.2 1.2 1)
        hex (10 9 8 1 21 20 19 12) (200 20 1) simpleGrading (1.2 1.2 1)

Case 1:

The case 1 simulation is made up with the grading factor of 1. The blockmesh view of the geometry is attached below,

The velocity profile for the case 1 setup is attached below,

The pressure profile for the case 1 setup is attached below,

Case 2:

The case 2 simulation is made up with the grading factor of 0.2. The blockmesh view of the geometry is attached below,

The velocity profile for the case 2 setup is attached below,

The pressure profile for the case 2 setup is attached below,

Velocity plot:

The velocity magnitude at the distance of 0.085m from the inlet of the domain is analysed for both the cases.

Case 1:

Case 2:

Results and discussions:

  • The mesh become finer for the grading factor of 0.2. It can be observed in the blockmesh image.
  • It was also observed that the execution time taken for the grading factor of 0.2 to get the converged results is less when compared with the grading factor of 1.
  • Thus, when the grading factor value decreases the time taken is also decreases.
  • The velocity magnitude at a distance of 0.085m from the inlet of the domain is likely similar for both the cases.
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.