## SIMULATION OF FLOW THROUGH THE BACKWARD FACING STEP BY USING BLOCKMESH IN OPENFOAM

AIM :-

IN THIS PROJECT, I HAVE WORKED ON SIMULATING THE FLOW OF FLUID THROUGH  THE DOMAIN (CONTROL VOLUME).

DESCRIPTION:-

THE DOMAIN IS NOTHING ELSE, IT IS JUST A CONTROL VOLUME THROUGH WHICH I HAVE SIMULATED THE RESULT OBTAINED FROM THE GOVERNING EQUATION.

THE CONTROL VOLUME IS A GEOMETRY WHERE THE WHOLE GEOMETRY IS DIVIDED INTO CERTAIN BLOCKS, WHERE EACH BLOCK IS CONSIST OF SOME VERTICES i.e 8 VERTICES.

AFTER GENERATING THE GEOMETRY AND DIVIDING IT INTO BLOCKS THROUGH THE USE OF VERTICES. THE MESHING IS APPLIED OVER IT WHICH MEANS THE BLOCKS ARE CONVERTED INTO A HUGE NUMBER OF SMALL CELL WHERE EACH CELL HAS ITS OWN LOCATION.

THE PURPOSE BEHIND THE USE OF MESHING IS TO PROVIDE THE GRID POINTS SO THAT WHEN GOVERNING EQUATION IS CONVERTED INTO THE DIFFERENCE EQUATION, THE DATA COULD EASILY OBAINED AT EACH POINT AND ACCOUNT OF WHICH WE CAN OBTAIN RESULT FOR  ENTIRE VOLUME THROUGH THIS GRID POINT AND PROVIDE THE PATH TO OUR SIMULATION .

HERE, IN THE PROJECT I HAVE CONSIDERED THE DIMENSION OF GEOMETRY AS FOLLOW:-

LENGTH=0.2 m

BREATH=0.02 m

WIDHT=0.01 m

FOR MESHING, I HAVE PROVIDED THE GRID POINTS ACROSS ALL THE DIMENSIONS OF GEOMETRY:-

N=200 CELLS TO THE LENGTH OF GEOMETRY.

N=10 CELLS TO THE LENGTH OF GEOMETRY.

N=1 CELL TO THE LENGTH OF GEOMETRY.

TO DEFINE THE SIZE OF GRID, I HAVE PROVIDED HERE THE GRADING FACTOR AS 0.2,0.5 AND 0.8

BLOCKMESH DICRECTORY:-

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

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 1)
(8 0 1)
(8 0.5 1)
(0 0.5 1)
(8 1 1)
(0 1 1)
(20 1 1)
(20 0.5 1)
(20 0 1)
(20 -1 1)
(8 -1 1)
);

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

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)
(4 6 7 2)
(2 7 8 1)
(1 8 9 10)
(11 12 13 14)
(14 13 15 16)
(13 18 17 15)
(12 19 18 13)
(21 20 19 12)
);
}

noslipwall
{
type wall;
faces
(
(5 16 15 4)
(4 15 17 6)
(10 21 12 1)
(0 1 12 11)
(21 10 9 20)
);
}
);

mergePatchPairs
(
);

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

IN THE BLOCKMESH DIRECTORY, I HAVE DEFINED FIRST THE VERTICES OF GEOMETRY AND AFTER THAT DEFINED THE BLOCKS OF GEOMETRY SO THAT FACES OF GEOMETRY CAN BE DEFINED.

AFTER DEFINING THE VERTICES OF GEOMETRY AND FACE OF GEOMETRY , THE TYPE OF FACES IS DEFINED SO THAT RIGHT INFORMATION COULD BE PROVIDED TO THE FACE.

HERE, BLOCKS ARE DEFINED IN TERMS OF HEXADECIMAL NUMBER SO THAT IT CAN BE CONVINIENT TO UNDERSTAND.

CONTROL DIRECTORY:-

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

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         0.33;

deltaT          1e-5;

writeControl    timeStep;

writeInterval   10;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;

functions
{
#includeFunc streamlines
}

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

IN THE CONTROL DIRECTORY, I HAVE PROVIDED THE TIME STEP VALUE AS 1e-5. HERE, I HAVE CALCULATED THE SIMULATION FROM 0 TO 0.33 SECONDS.

PRESSURE DIRECTORY:-

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

outlet
{
type           fixedValue;
value          uniform 0;
}

frontAndBack
{
type            empty;
}

noslipwall
{

}
}

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

IN THE PRESSURE DIRECTORY, PRESSURE IS PROVIDED AS "ZEROGRADIENT" AT INLET WHERE AS UNIFORM VALUE OF 0 AT OUTLET FACE.

WHERE AS PRESSURE IS EMPTY AT FRONT AND BACK FACE OF GEOMETRY AS FACE IS OPEN HERE..

AND, ZERO GRADIENT AT WALL FACE.

VELOCITY DIRECTORY:-

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

outlet
{
}

frontAndBack
{
type            empty;
}

noslipwall
{
type          noSlip;
}
}

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

IN THE VELOCITY DIRECTORY, VELOCITY IS PROVIDED AS FIXED VALUE OF '2' IN THE FORM OF VECTOR AT INLET WHERE AS ZERO GRADIENT AT OUTLET FACE.

WHERE AS VELOCITY IS EMPTY AT FRONT AND BACK FACE OF GEOMETRY AS FACE IS OPEN THERE..

AND, NOSLIP AT WALL FACE WHICH ALSO MEANS THERE IS NO SHEAR STRESS.

FLOW OF FLUID AT GRADING FACTOR OF 0.2  :-

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

)

VELOCITY PROFILE AT GRADING FACTOR OF 0.2  :-

FLOW OF FLUID AT GRADING FACTOR OF 0.5  :-

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

)

VELOCITY PROFILE AT GRADING FACTOR OF 0.5  :-

FLOW OF FLUID AT GRADING FACTOR OF 0.8  :-

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

)

VELOCITY PROFILE AT GRADING FACTOR OF 0.8  :-

HERE , I OBSERVRE THAT WHEN I HAVE THE INCREASE THE GRADING FACTOR FROM 0.2 TO 0.8 , THE PLOT OF VELOCITY PROFILE GOT STAGGER  AND THE PLOT GET DEVIATED AS THE GRADING FACTOR IS INCREASED.

SO ON COMPARISON WITH ALL THE THREE GRAPHS, I CONCLUDED THAT GRADING FACTOR HAS TOO EFFECT ON THE SIMULATION RESULT.

SO IN THIS CASE, IF GRADING FACTOR IS INCREASED MORE, THERE IS CHANCES OF BLOWING UP OF SOLUTION . HENCE, IT GIVES US INFORMATION THAT WHILE PERFORMING THE SIMULATION, WE SHOULD ALSO TAKE CARE OF GRADING FACTOR AS IT MAY KILL THE RESULT AND PROVIDE THE RANDOM SIMULATION FLOW  OF FLUID.

### 1D Super-sonic nozzle flow simulation using Macormack Method Shyam Rai · 2019-08-04 18:34:37

IN THIS PROJECT, I HAVE WORKED ON THE ONE DIMENSIONAL SUPERSONIC NOZZLE FLOW. IN THIS FLOW, I HAVE ASSUMED THE FLOW TO BE STEADY,ISENTROPIC. IN THIS NOZZLE, I HAVE CONSIDERED THE FLOW AT INLET SECTION COMES FROM RESERVOIR WHERE THE PRESSURE, TEMPERATURE ARE DENO Read more

### PROGRAM ON FLOW OF HEAT IN THE RECTANGULAR SLAB (2-D DOMAIN) USING 2-DIMENSIONAL HEAT CONDUCTION EQUATION IN STEADY AND TRANSITION STATE Shyam Rai · 2019-07-09 18:02:52

In this project, I have worked on the simulation of conduction of temperature heat in two dimensional space (2D domain).  The aim was to determine the rate of flow of  heat due to temperature difference over the space domain under steady condition and Read more

### Program on deriving fourth order approximation for different difference schemes for second order derivative Shyam Rai · 2019-06-23 15:26:37

In this programming, I have derived the four order approximation of second order derivative using finite difference method. In Finite difference method,we generally convert ordinary differential equation into difference equation. In order to achieve so, we use simple t Read more

### SIMULATION OF AN OSCILLATION OF A 2-D PENDULUM BY USING SECOND ORDER ORDINARY DIFFERENTIAL EQUATION Shyam Rai · 2019-06-21 19:15:09

In this report, I have simulated the oscillation of 2D pendulum and also generate a plot of \'angular_displacement\' & \'angular_velocity\' vs \"time\" in octave. Consider a pendulum which is having a string of length of \'1metre\' connected to a ball of mass,m=1kg Read more