Académique Documents
Professionnel Documents
Culture Documents
Computational Fluid
Dynamics
Goong Chen, Qingang Xiong, Philip J. Morris, Eric G. Paterson,
Alexey Sergeev, and Yi-Ching Wang
Box 1. OpenFOAM code for the potential Box 2. OpenFOAM code for the N-S equation (3).
equation (1). Here, as well as in Box 1, equation mimicking is
quite obvious. Note that the specifications fvm
and fvc are selected by the user from the
free. The number of OpenFOAM users has been fvSchemes dictionary in the system dictionary; cf.
steadily increasing. It is now estimated to be of Chart 1. Here fvm::laplacian means an implicit
finite volume discretization for the Laplacian
<case> operator, and similarly for fvm::div for the
system divergence operator. On the other hand,
fvc::grad means an explicit finite volume
(control parameter: ∆ t, ∆ x, maximum
controlDict Courant number, etc) discretization for the gradient operator. The
fvSchemes (discretization schemes for ∇, ∇2 , ∇×, parentheses ( , ) means a product of the
interpolation, etc.)
enclosed quantities, including tensor products.
(linear algebra solvers for the
fvSolution discretized, linear systems.)
constant
As most readers may not necessarily be inter-
. . . Properties (viscosity, gravity, various coefficients.)
ested in running OpenFOAM codes for now, in this
(mesh generation files by
polyMesh BlockMeshDict.)
section we will mainly give a brief sketch. We first
illustrate this for a simple elliptic boundary value
points
problem
cells (1)
(
faces
(i) ∇2 u(x, y, z) = f (x, y, z) on Ω ⊆ R3 ,
(ii) u(x, y, z) = g(x, y, z) on the boundary ∂Ω.
boundary
In OpenFOAM, one can use a Laplacian solver in the
time directories (initial and boundary conditions.)
heat transfer library to obtain numerical solutions.
By using the C++ language, in OpenFOAM (1)(i) is
Chart 1. Case directory structure (adapted from written as in Box 1.
[1]). Note that the inhomogeneous Dirichlet bound-
ary condition, given in (1)(ii), will be prescribed
the order of many thousands, with the majority elsewhere, in the “time directories” in the Case
of them being engineers in Europe. But the U.S. is Directory Structure, as shown in Chart 1. If instead
catching up. of (1)(ii) we have inhomogeneous Neumann or
Robin boundary conditions such as
A Sketch of How to Use OpenFOAM
∂u(x, y, z)
For beginners who are enthusiastic about learning = g(x, y, z),
∂n
how to use OpenFOAM to obtain CFD solutions the
∂u(x, y, z)
best way is to study the many tutorial examples (2) + αu(x, y, z) = g(x, y, z) on ∂Ω,
available in [1]. One such tutorial is the lid-driven ∂n
cavity case [15]. (Such a case will also be computed they can be specified similarly in the time
in Examples 1 and 2.) It provides nearly all directories.
information from start to finish as to how to use To numerically solve a PDE by using OpenFOAM,
OpenFOAM, including preprocessing, solving (i.e., a user needs to create a Case Directory Structure
how to run the codes), and postprocessing. The as shown in Chart 1. Normally it contains three
tutorial has a couple dozen pages. If the beginner subdirectories. The user first gives a name for
can get some help from an experienced OpenFOAM the <case>. The compositions of the various
user, then it usually takes only a few weeks to run subdirectories are indicated in Chart 1.
a simple OpenFOAM computer program for this Now we look at the core case of this article, the
problem. incompressible Navier-Stokes (N-S) equations in
using a subgrid scale SGS model. This is usually in Grid length in RANS, LES and DNS ∆x 0.005 m, 0.001 m, 0.0002 m
the form of an eddy viscosity model that can involve Unit time step in RANS, LES and DNS ∆t 0.005 s, 0.001 s, 0.0002 s
a constant or dynamic coefficient. In the latter Table 2. Physical and geometrical parameters for
case the eddy viscosity or Smagorinsky constant is the lid-driven flow simulation.
allowed to vary in space and time and is calculated
based on two filterings of the flow variables. Some for N-S codes and benchmarks. Its geometry and
averaging is generally required for stability. This boundary conditions are indicated in Figure 2.
could be averaging in a homogeneous flow direction The parameter values of this problem are
or a local spatial average. LES methods are still summarized in Table 2. The turbulent viscosity
computationally expensive, though not as much submodels chosen for RANS and LES are the
as DNS. This is especially true for wall-bounded standard k−ε model and k-equation eddy-viscosity
turbulent flows, since the “large” scales close to
the wall can be very small. An efficient solution to
this problem is the use of hybrid RANS/LES models.
An example is the Detached Eddy Simulation (DES).
In DES the turbulence model equations behave
as RANS equations in the near-wall region but
transition to LES away from the walls. Clearly
such solutions cannot simulate the details of the
turbulence in the near-wall regions. We refer the
reader to Table 1 for a comparison among these
basic turbulence models.
OpenFOAM offers all the turbulence modeling
methods described here either as standard solvers
or libraries for users to simulate turbulence on the Figure 2. Geometry and boundary conditions for
a 2D lid-driven cavity, where (u, v) are the com-
proper spatial and temporal scales.
ponents of flow velocity. The case for 3D is simi-
In the following, to compare the simulation
lar. Note that the upper “lid” has a constant hori-
capability of the three basic turbulence modeling
zontal velocity U . Note, however, for the 3D DNS
strategies, i.e., DNS, LES, and RANS, a simple computations, because a huge memory space
lid-driven flow is simulated in both two- (2D) and and CPU time are required, the domain has been
three-dimension (3D) in Examples 1 and 2. The ×[0, 0.1]×
reduced to the size of [0, 0.1]× ×[0, 0.01].
lid-driven cavity flow [25] is a classical test problem
(b) Flow streamlines at t=20 sec obtained by (b) Flow field at t=20 sec obtained by RANS [27].
RANS [27].
After all, for the ultimate health and benefits of the [4] GitHub, http://en.wikipedia.org/wiki/GitHub,
CFD community, it is important to have diversity http://github.com/.
of CFD code developers, whether open source or [5] H. K. Versteeg and W. Halalasekera, An Introduction
by commercial vendors. to Computational Fluid Dynamics—The Finite Volume
Method, 2nd ed., Pearson Prentice Hall, Harlow, UK,
Only a few years ago the applied mathematicians
2007.
in this group at Texas A&M would never have imag- [6] Deal.II, http://en.wikipedia.org/wiki/Deal.II.
ined that they could compute CFD problems such [7] Stanford University Unstructured (SU2), http://
as those given in Examples 1–3 in this article and en.wikipedia.org/wiki/Stanford_University_
beyond. OpenFOAM has really opened up a grand Unstructured.
vista for all researchers and empowered them to do [8] A. Perronnet, Méfisto, http://www.ann.jussieu.
CFD and more: general computational mechanics fr/perronnet/mefistoa.gene.html.
and the affiliated design and optimization prob- [9] MFIX, https://mfix.netl.doe.gov/.
[10] Redhat, http://en.wikipedia.org/wiki/RedHat.
lems. This enhances the industrial job prospects
[11] The Cathedral and the Bazaar, http://en.
for math Ph.D. students up to a par with those of wikipedia.org/wiki/The_Cathedral_and_the_
engineering and physics graduates. It also presents Bazaar.
numerous opportunities for all researchers to com- [12] OpenFOAM discussion forum, http://www.
pute, collaborate (in the same computing platform cfd-online.com/Forums/openfoam/.
of OpenFOAM), and do interdisciplinary research [13] OpenFOAM Wiki, http://openfoamwiki.net/index.
on complex systems governed by PDEs in nearly php/Main_Page.
every field of science and technology. [14] OpenFOAM Workshop, http://www.openfoamworkshop.
org/.
[15] Lid-driven cavity flow (in OpenFOAM),
Acknowledgements http://openfoam.org/docs/user/cavity.php.
The authors thank the reviewers for constructive [16] R. I. Issa, Solution of the implicitly discretized fluid
criticisms, and the staff of TAMU’s Supercomputing flow equations by operator-splitting, J. Comp. Phys.
Center for allocation and assistance. They express 62 (1986), 40–65.
their gratitude for partial financial support from [17] Pressure-correction method, http://www.en.
the Qatar National Research Funds grant National wikipedia.org/wiki/Pressure-correction_method.
[18] Gambit meshing software, http://www.
Priority Research Project #5-674-1-114 and Texas
cfd-online.com/Forums/ansys-meshing/
Norman Hackman Advanced Research Program 114276-gambit-ansys-meshing-software.html.
Grant #010366-0149-2009 from the Texas Higher [19] Graphical user interfaces for OpenFOAM, http://
Education Coordinating Board. openfoamwiki.net/index.php/GUI.
[20] Paraview, http://en.wikipedia.org/wiki/
References ParaView.
[1] OpenFOAM, http://www.openfoam.com/. [21] EnSight, http://ensight.com/.
[2] Direct Industry, CFD software, http://www. [22] eFluids gallery image of turbulence,
directindustry.com/industrialmanufacturer/ http://www.efluids.com/efluids/gallery/
cfdsoftware74890.html. gallery_pages/iso_turbulence_page.htm.
[3] SourceForge, http://en.wikipedia.org/wiki/ [23] Kolmogorov microscales, http://www.en.
SourceForge, http://sourceforge.net, http:// wikipedia.org/wiki/Kolmogorov_microscales.
sf.net.