Challenge

BlockMesh Drill down challenge

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) //0 vertices
    (80 0 0)//1 vertices
    (80 5 0)//2 vertices
    (0 5 0)//3 vertices
    (80 10 0)//4 vertices
    (0 10 0)//5 vertices
    (200 10 0)//6 vertices
    (200 5 0)//7 vertices
    (200 0 0)//8 vertices
    (200 -10 0)//9 vertices
    (80 -10 0)//10 vertices
    (0 0 1)//11 vertices 
    (80 0 1)//12 vertices
    (80 5 1)//13 vertices
    (0 5 1)//14 vertices
    (80 10 1)//15 vertices
    (0 10 1)//16 vertices
    (200 10 1)//17 vertices
    (200 5 1)//18 vertices
    (200 0 1)//19 vertices
    (200 -10 1)//20 vertices
    (80 -10 1)//21 vertices
 

);

blocks
(
    hex (0 1 2 3 11 12 13 14) (80 5 1)  simpleGrading (0.8 1.8 1)
    hex (3 2 4 5 14 13 15 16) (80 5 1)  simpleGrading (0.8 0.8 1)
    hex (1 8 7 2 12 19 18 13) (120 5 1)  simpleGrading (1.8 1.8 1) 
    hex (2 7 6 4 13 18 17 15) (120 5 1)  simpleGrading (1.8 0.8 1) 
    hex (12 19 20 21 1 8 9 10) (120 10 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 8 19 20)
        (8 7 18 19)
        (7 6 17 18)
        );
       }
      step 
      {
      type wall;
      faces 
      (
      (1 10 21 12)
      );
       }
      front 
      {
      type empty;
      faces 
      (
      (11 12 13 14)
      (14 13 15 16)
      (21 20 19 12)
      (12 19 18 13)
      (13 18 17 15)
      );
       }
      back
      {
       type empty;
       faces 
       (
       (0 3 2 1)
       (3 5 4 2)
       (1 2 7 8)
       (2 4 6 7)
       (10 1 8 9)
       );
       }  
       top
       {
       type wall;
       faces 
	(
       (5 16 15 4)
       (4 15 17 6)
       );
       }
       bottom
       {
       type wall;
       faces  
	(
       (0 1 12 11)
       (10 9 20 21)
       );
       }
);

mergePatchPairs
(
);
//**********************************************************************//     

As the Mesh is generated using blockMesh Command in the terminal. Next step is to apply the boundary conditions to the model and specify the Simulation time. The respective files are shown below:

Boundary and initial Conditions:

P (Pressure)

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

    step
    {
        type            zeroGradient;
    }
    top
    {
        type            zeroGradient;
    }
    bottom
    {
        type            zeroGradient;
    }
    front
    {
        type            empty;
    }
    back
    {
        type            empty;
    }
}

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

U (velocity)

/*--------------------------------*- 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 (2 0 0);
    } 
    outlet
    {
          type        zeroGradient;
    }
    top
    {
        type            noSlip;
    }
    bottom
    {
        type            noSlip;
    }
    step
    {
        type            noSlip;
    }
    front
    {
        type            empty;
    }
    back
    {
        type            empty;
    }
}

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

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         0.3;

deltaT          0.0001;

writeControl    timeStep;

writeInterval   100;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;


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

As, Model is setup for solving. icoFoam Solver is used to solve the above Model.The following results are generated which are shown below.Postprocessing is carried out using paraview.

Velocity profile at 0.085 m from the inlet of the geometry:

Similarly, the above model is simulated with grading factors of 0.5 and 0.2. Just by making changes in blockMeshDict file as shown below. Timestep in controlDict file is adjusted for the respective grading factor to the keep courant number less than 1.

Grading factor :0.5

Meshed Geometry with a grading scheme of 0.5 near walls is shown below:

Velocity profile at 0.085 m from the inlet of the geometry:

Grading factor :0.2

Meshed Geometry with a grading scheme of 0.2 near walls is shown below:

Velocity profile at 0.085 m from the inlet of the geometry:

Comparision of velocity magnitude contours near the step region for the above mentioned grading factors.

Conclusion:

As it can be seen from above graphs there is not much differences found in results with different grading factors for the above problem.The maximum velocity is same in all cases. With the mesh specification as mentioned above for the given proble, the change of grading factors doesn't have much differences.

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.