All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
The appropriate solver for the given flow condition is icoFoam. From the tutorials folder of the OpenFoam, the cavity tutorial which uses icoFoam solver is copied to the run folder. The blockMeshDict file is edited as below according to the following configuration. blockMeshDict file /*--------------------------------*-…
Jaswanth Kalyan Kumar Alapati
updated on 16 Dec 2021
The appropriate solver for the given flow condition is icoFoam. From the tutorials folder of the OpenFoam, the cavity tutorial which uses icoFoam solver is copied to the run folder. The blockMeshDict file is edited as below according to the following configuration.
blockMeshDict file
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2012 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
scale 1;
vertices
(
(0 0 0)
(0.12 0 0)
(-0.08 0.01 0)
(0 0.01 0)
(0.12 0.01 0)
(-0.08 0.015 0)
(0 0.015 0)
(0.12 0.015 0)
(-0.08 0.02 0)
(0 0.02 0)
(0.12 0.02 0)
(0 0 0.05)
(0.12 0 0.05)
(-0.08 0.01 0.05)
(0 0.01 0.05)
(0.12 0.01 0.05)
(-0.08 0.015 0.05)
(0 0.015 0.05)
(0.12 0.015 0.05)
(-0.08 0.02 0.05)
(0 0.02 0.05)
(0.12 0.02 0.05)
);
blocks
(
hex (0 1 4 3 11 12 15 14) (100 10 1) simpleGrading (1 1 1)
hex (2 3 6 5 13 14 17 16) (100 10 1) simpleGrading (1 1 1)
hex (3 4 7 6 14 15 18 17) (100 10 1) simpleGrading (1 1 1)
hex (5 6 9 8 16 17 20 19) (100 10 1) simpleGrading (1 1 1)
hex (6 7 10 9 17 18 21 20) (100 10 1) simpleGrading (1 1 1)
);
edges
(
);
boundary
(
Inlet
{
type patch;
faces
(
(5 2 13 16)
(8 5 16 19)
);
}
Outlet
{
type patch;
faces
(
(15 12 1 4)
(18 15 4 7)
(21 18 7 10)
);
}
fixedWalls
{
type wall;
faces
(
(8 19 20 9)
(9 20 21 10)
(13 2 3 14)
(3 0 11 14)
(11 0 1 12)
);
}
frontandBack
{
type empty;
faces
(
(0 3 4 1)
(2 5 6 3)
(3 6 7 4)
(5 8 9 6)
(6 9 10 7)
(14 11 12 15)
(16 13 14 17)
(17 14 15 18)
(19 16 17 20)
(20 17 18 21)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //
The fluid through the channel is air and its properties are taken at 270C and 101325 Pa.
Next, the p file is edited as follows
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2012 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 86143.46691;
boundaryField
{
Inlet
{
type zeroGradient;
}
Outlet
{
type fixedValue;
value uniform 86143.46691;
}
fixedWalls
{
type zeroGradient;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //
The U file is edited as follows
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2012 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ 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 (1.0 0 0);
}
Outlet
{
type zeroGradient;
}
fixedWalls
{
type noSlip;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //
The timestep is chosen such that the Courant number is less than one. The kinematic viscosity of air is updated in the transportProperties file.
The controlDict is edited as follows
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2012 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application icoFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 4;
deltaT 0.0005;
writeControl runTime;
writeInterval 0.25;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
// ************************************************************************* //
In the first case, grading is not applied. The velocity (Vx) at x=0.085 m for the first case is obtained as follows.
In the second case, grading is applied and the blockMeshDict is edited as follows
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2012 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
scale 1;
vertices
(
(0 0 0)
(0.12 0 0)
(-0.08 0.01 0)
(0 0.01 0)
(0.12 0.01 0)
(-0.08 0.015 0)
(0 0.015 0)
(0.12 0.015 0)
(-0.08 0.02 0)
(0 0.02 0)
(0.12 0.02 0)
(0 0 0.05)
(0.12 0 0.05)
(-0.08 0.01 0.05)
(0 0.01 0.05)
(0.12 0.01 0.05)
(-0.08 0.015 0.05)
(0 0.015 0.05)
(0.12 0.015 0.05)
(-0.08 0.02 0.05)
(0 0.02 0.05)
(0.12 0.02 0.05)
);
blocks
(
hex (0 1 4 3 11 12 15 14) (100 10 1) simpleGrading (5 0.2 1)
hex (2 3 6 5 13 14 17 16) (100 10 1) simpleGrading (0.2 5 1)
hex (3 4 7 6 14 15 18 17) (100 10 1) simpleGrading (5 5 1)
hex (5 6 9 8 16 17 20 19) (100 10 1) simpleGrading (0.2 1 1)
hex (6 7 10 9 17 18 21 20) (100 10 1) simpleGrading (5 1 1)
);
edges
(
);
boundary
(
Inlet
{
type patch;
faces
(
(5 2 13 16)
(8 5 16 19)
);
}
Outlet
{
type patch;
faces
(
(15 12 1 4)
(18 15 4 7)
(21 18 7 10)
);
}
fixedWalls
{
type wall;
faces
(
(8 19 20 9)
(9 20 21 10)
(13 2 3 14)
(3 0 11 14)
(11 0 1 12)
);
}
frontandBack
{
type empty;
faces
(
(0 3 4 1)
(2 5 6 3)
(3 6 7 4)
(5 8 9 6)
(6 9 10 7)
(14 11 12 15)
(16 13 14 17)
(17 14 15 18)
(19 16 17 20)
(20 17 18 21)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //
The timestep is varied to 0.0001 for the second case. The velocity profile obtained in this case is as follows.
Leave a comment
Thanks for choosing to leave a comment. Please keep in mind that all the comments are moderated as per our comment policy, and your email will not be published for privacy reasons. Please leave a personal & meaningful conversation.
Other comments...
Week 1- Mixing Tee
This assignment aims to evaluate the mixing effectiveness of a Tee joint with two different outlet pipe lengths, namely small and long. The required Tee geometry is provided, and the interior volume for CFD analysis is extracted as shown below. Tee geometry with shorter outlet pipe: Extracted…
03 Sep 2022 08:13 PM IST
Week 12 - Validation studies of Symmetry BC vs Wedge BC in OpenFOAM vs Analytical H.P equation
Unlike in the previous assignment, where the simulation is performed using a transient solver icoFoam, the simulation is carried out using a steady-state solver simpleFoam since the emphasis is on the steady-state flow field. This assignment aims to compare the boundary conditions of Wedge and Symmetry…
11 Jan 2022 11:09 AM IST
Week 11 - Simulation of Flow through a pipe in OpenFoam
The following is the simulation of a laminar flow of an incompressible fluid through the pipe in OpenFoam. The following figure depicts the physical situation of the flow. For a laminar flow, the hydrodynamic length, Lh=0.06⋅D⋅ReD, where D is pipe diameter, and ReD is Reynolds number…
07 Jan 2022 10:13 AM IST
Week 9 - FVM Literature Review
Finite Volume Method (FVM) is a numerical technique for solving partial differential equations governing the phenomena. The method involves discretizing the domain into smaller volumes. These control volumes are connected by common faces. The governing equation in integral form is applied for all the control volumes followed…
26 Dec 2021 07:15 AM IST
Related Courses
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.