Professional Documents
Culture Documents
External Incompressible 3D CFD Analysis OpenFOAM Tutorial PDF
External Incompressible 3D CFD Analysis OpenFOAM Tutorial PDF
w CFD Analysi s
OpenFOAM Tutoria al
Eng. Sebastian Rodrig
guez
www.librremechanics.c
com
1. Backgground
2. Case Introduction
3. 3d Moodeling
4. Units
5. Physical Parameters
6. Meshhing with Gmsh
7. Struc
cturing the cas
se folders
8. Settin
ng up the case
e
9. Solvin
ng the case
10. Post processing
11. General Sources:
External Incompressible 3D flow CFD Analysis OpenFOAM Tutorial
OpenFOAM (Open Source Field Operation and This basic tutorial its design to be a guide for the creation
Manipulation) its an Open Source Software project claim of simple external incompressible 3D flow cases on
to be one of the best CFD tools currently available, the OpenFOAM, it must be complemented with further
constant development and its highly technical structure, reading and understanding of FEA and CFD theory and
the fine implementation of common solvers and the by no means this tutorial most replace the although
possibility to edit and create equations and mathematical complex yet useful documentation from OpenFOAM itself
cases make OpenFOAM useful tool on researching. and related sources.
OpenFOAM is a C++ toolbox for the development of
customized numerical solvers, and pre-/post-processing In this case, the dummy Kilo-Class submarine model its
utilities for the solution of continuum mechanics problems, completely submerged under water and its advancing
including computational fluid dynamics (CFD). The code completely straight throw the water medium. It is no
is released as free and open source software under the common to have an small restricted medium-- boundary
GNU General Public License like in this example, the user must be careful in make the
right assumptions in this type of procedure, the
In common plastic analysis, deformations are easily dimensions of the medium affects the turbulence model
inferred, but de fluid computational dynamics its and may lead to unreal results.
governed by a wide group of less known physics
laws and variables that make the results almost According to merely informative sources this type of
unpredictable by simple observation submarine has a maximum submerged velocity of 25
knots (12.86 m/s) , but for this first reference simulation
As the user is probably aware by now, this document the speed will be limited to 10 knots (5.14 m/s). No
make a number of simplifying assumptions as the tutorial additional forces, velocitys, or pressure points will be
progressed, this is done in the interest of gaining a clearer configures over the model, the only goal of the case its to
understanding of the fundamental without getting bogged determine the flow path over the submarine surface.
down in special details and exceptions. By no means it
hast the complete history of external 3D fluid analysis In real design process not just the hydrodynamic behavior
handling on OpenFoam, it is much broader in scope that dictates the submarine shape, it involves some deep and
can be presented in a single document such as this, but it complex studys which naval engineers master. This
is sincerely hoped that this tutorial will enable one to do a analysis its completely representative and
better job on the definition, solution and study of this kind educational due the lack of real data such as
of analysis. dimensions, velocity and materials properties the model
has been created by merely observation and assimilation
Background of some real cases.
2
External Incompressible 3D flow CFD Analysis OpenFOAM Tutorial
3D Modeling.
pound-mass
1 Mass kilogram (kg)
(lbm)
degree
4 Temperature Kelvin (K)
Rankine (R)
kilogram- pound-mole
5 Quantity
mole (kgmol) (lbmol)
Luminous
7 candela (cd)
intensity
Image 3 CAD core model. Example: [0 2 -1 0 0 0 0]
3
External Incompressible 3D flow CFD Analysis OpenFOAM Tutorial
Where each of the values corresponds to the power of Meshing with Gmsh
each of the base units of measurement listed in Table.
The table gives the base units for the International (SI) Even though OpenFOAM have a build in tool called
and the United States Customary System (USCS) but blockMesh for multi-block simple geometry meshing,
OpenFOAM can be used with any system of units. All that there is a need in CFD for multiple meshing tools that
is required is that the input data is correct for the chosen cover a range of complexity meshing task.
set of units. It is particularly important to recognize that
OpenFOAM requires some dimensioned physical Gmsh is a 3D finite element grid generator with a build-in
constants, e.g. the Universal Gas Constant. CAD engine and post-processor. Its design goal is to
provide a fast, light and user-friendly meshing tool with
Physical parameters parametric input and advanced visualization capabilities.
Gmsh is built around four modules: geometry, mesh,
The fluid of interest in this case its common sweet water, solver and post-processing. The specification of any input
incompressible fluid. to these modules is done either interactively using the
graphical user interface or in ASCII text files using
It is assumed that the pressure drops are not enough to Gmsh's own scripting language.
fall below the vapor pressure of the water and make any
phase change during the analysis, so the solver chosen is
the SimpleFoam for incompressible fluids: The Gmsh meshing process begins at the import
of the CAD geometry, many formats are
supported by the tool, depending de CAD used
Density: 1000 kg/m^3 to create the model the user may choose the
Kinematic Viscosity: 1,0 e-6m^2/s correct format, in this case the model is saved as
Inlet velocity: 5,14 m/s a .XX file, opening the file the main shape can
be checked for any overlap geometry.
2
= + +
3
.
0,09
=
.
0,09
=
0.09 0,04403
=
0,01 2500
= 6,9791
4
External Incompressible 3D flow CFD Analysis OpenFOAM Tutorial
5
E mpressible 3D
External Incom D flow CFD An
nalysis OpenF
FOAM Tutoriall
S
Structuring th
he case folders
s The 0 folder file
es respond to the initial conditions
desc ribed in the p
previous chap
pters, the files data are
ed as bellow:
edite
U---------- -------------------
DIME NSIO
ONS [0 1 --1 0 0 0 0];
BOUNDA R RYFIE LD
{
IN
{
TYP E FIX EDVA LUE ;
VAL UE NIFORM (5.140
UN 0000
0.000000 0.0000);
}
W AL LS
TThe case definnition is not a simple file con
ntaining all the
e {
information, se
everal files annd folder consttitute the casee TYP E FIX EDVA LUE ;
sstructure which
h order is man ndatory for anyy solver to run. VAL UE UN
NIFORM (0. 0. 0.);
Many pre-proc cessing tool foorm OpenFoam m create some e }
ffolders by deefault for the user just to complete and d }
cchange parameters.
E
Eng. Sebastian
n Rodriguez www.libremechanic
cs.com
6
External Incompressible 3D flow CFD Analysis OpenFOAM Tutorial
}
} timePrecision 6;
runTimeModifiable true;
TRANSPORT PROPERTIES ---------------------
---
CROSSPOWERLAWCOEFFS relaxationFactors
{ {
NU0 NU0 [ 0 2 -1 0 0 0 0 ] 1E-06;
p 0.3;
NUINF NUINF [ 0 2 -1 0 0 0 0 ] 1E-
06; U 0.7;
M M [ 0 0 1 0 0 0 0 ] 1; k 0.7;
N N [ 0 0 0 0 0 0 0 ] 1; epsilon 0.7;
}
R 0.7;
BIRDCARREAUCOEFFS nuTilda 0.7;
{ }
NU0 NU0 [ 0 2 -1 0 0 0 0 ] 1E-06;
NUINF NUINF [ 0 2 -1 0 0 0 0 ] 1E-
06;
K K [ 0 0 1 0 0 0 0 ] 0;
N N [ 0 0 0 0 0 0 0 ] 1;
}
Solving the case
The maximum steps for the solver may be limited to save
resources on the solving process but even this number is The size of the mesh and the steps the solver must run,
high the process stop at the step where the convergence require the use of multiple cores for the OpenFOAM
criteria is reached. solver to decrease the solving time.
application simpleFoam;
startFrom latestTime;
startTime 0;
stopAt endTime;
endTime 800;
deltaT 1;
writeControl timeStep;
writeInterval 40;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression off;
timeFormat general;
7
External Incompressible 3D flow CFD Analysis OpenFOAM Tutorial
Post processing
Interpreting the pressure concentration around the cavity
ParaView is an open source mutiple-platform application the submarine design can be later loaded in another
for interactive, scientific visualization. ParaView users can analysis to check the material resistance.
quickly build visualizations to analyze their data using
qualitative and quantitative techniques. The data
exploration can be done interactively in 3D or
programmatically using ParaView's batch processing
capabilities. ParaView allows to import the model to
visualize the result and also add another mesh, images
and cad models to references, for example the model of
the submarine created at firt to generate the hollow water
body can be combined with the result files to better
understanding.
8
External Incompressible 3D flow CFD Analysis OpenFOAM Tutorial
9
E mpressible 3D
External Incom D flow CFD An
nalysis OpenF
FOAM Tutoriall
General Sourc
ces:
Acqu
uiring the case
e files
Geom
metry
Web: OpenFoam tuttorials, December 2013, Mesh
h
http:///www.openfoam
m.org/docs/use
er/tutorials.php Case
e files
Resu
ult Files
e Information
More
Web: Simple beginn ning 3D OpenFOAM Tutorial,
Decem mber 2013 Theree are multiple
e ways to accquire more in nformation
http:///www.libremechanics.com/?q=node/25 abouut OpenFoam a and CFD analyysis in general, useful for
furthe
er work:
E
External Incom D flow CFD Analysis
mpressible 3D
O
OpenFOAM Tu utorial
by
Sebastian Rodriguez is liicensed under a
Creative Com mmons Attribution-ShareAlike
e 3.0
Unported Lice
ense.
Based on a woork at
http://w
www.libremechhanics.com/.
E
Eng. Sebastian
n Rodriguez www.libremechanic
cs.com
10