You are on page 1of 21

OpenFlower CFD Software

R EFERENCE M ANUAL

Version 0.1
Edited on July 10, 2004

Contents
I OpenFlower: A Free Open-Source CFD Software

1 Getting started
1.1 Retrieve the source files of OpenFlower . . . . . . . . . . . . . . . . . . . . . .
1.2 Starting with the provided example files . . . . . . . . . . . . . . . . . . . . . .

9
9
9

II Numerical and Physical Overview of OpenFlower


2 Choices made in OpenFlower and objectives
2.1 Governing equations . . . . . . . . . . .
2.1.1 Mass conservation . . . . . . . .
2.1.2 Navier-Stokes equation . . . . . .
2.1.3 Temperature equation . . . . . . .

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

11
.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

13
13
13
13
14

3 Physical modeling

15

4 Numerical overview
4.1 Diffusive fluxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

17
17

References

21

CONTENTS

Introduction
OpenFlower development was first launched on february 2004 by some CFD research engineers, willing to encourage common effort in research and developments in the area of Computational Fluid Dynamics. The main reason for this was (among other things) to federate the work of
a multitude of PhD students and scientists who develop their own specific and effective codes, but
which one day or the other will vanish as they change area of interest, or become unusable as time
passes by... Moreover, the general trend shows that only some (expensive) commercial codes are
available to treat complex geometries, whereas scientists in research labs can only mainly rely on
these to accomplish research contracts with industry, when their home applications can only solve
specific academic applications.
The objective of an open-source CFD software 1 such as OpenFlower becomes clear then :
provide in a give & ask basis a reliable CFD platform to develop models, numerical techniques
and be available to respond to the increase of industrial needs in the field of CFD. OpenFlower
development will mainly rely on:
the maintainment and developments integration of contributions coming from private institutes, research labs, PhD students... by the project administrators, who also provide the main
development guidelines and starting basis;
the feedback of OpenFlower users, such as bug reports, patches, code development and
optimisations
The scientific exchange of thousands of researchers and students of numerous fields of interest
and skills can only be benefic in such an open-source code development environment, which surely
will become an interesting way around closed commercial CFD codes.
The main strength of OpenFlower will not only be its open-source community working and
hacking on it, but also a reliable colloborative framework and a well documented source of information for the fast development in the code and understanding its basic concepts and implemented
physical modelings.
OpenFlower (litteraly Open Source Flow Solver) is a free open-source finite volume Computational Fluid Dynamics software, mainly devoted to the resolution of the turbulent incompressible
Navier-Stokes equations, with scalar transport. It can deal with arbitrary complex geometries with
hybrid meshes (supporting tetrahedrals, prisms, pyramids and hexahedrals), and is mainly devoted
to the Large Eddy Simulation of turbulent flows, an area which is being greatly supported and has
received all the attention of the CFD community for the past 20 years. It is likely that this will be
the most interesting approach for the simulation of turbulent flows, as computers are being faster
year after year with their prices being more and more affordable for industries and universities.

see the argument (english) made by Stephane Zaleski for the open sourcing of CFD codes @
http://www.lmm.jussieu.fr/ zaleski/OpenCFD.html

CONTENTS

Part I

OpenFlower: A Free Open-Source CFD


Software

Chapter 1

Getting started
1.1 Retrieve the source files of OpenFlower
If you have cvs version 1.10 or higher installed, you should do the following to get the initial
copy of the repository:
% mkdir OpenFlower
% cd OpenFlower
% cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/openflower login
% cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/openflower co openflower-v0.1.1
Youll have to hit return at the password prompt after cvs login. (If you cannot login, check if
you really have cvs version 1.10 or higher!) After that you can use :
% cvs co openflower-v0.1.1
% cd openflower-v0.1.1
% ./first construction
% make
To force a fresh release after an earlier check-out do:
% make distclean
% cvs update -d -P
% ./configure
% make
from the OpenFlower directory to update your working copy. After the binaries have been built,
you can use:
% make install
to install them.
It is not possible to commit changes unless you are a member of the OpenFlower development
team, but you can send us patches and well include them in the next release of the project. Or you
can post a request for officially joining the project in the proper Forum 1 .

1.2 Starting with the provided example files


Example files are available in the /examples/ directory.
1

http://sourceforge.net/forum/?group id=104134

CHAPTER 1. GETTING STARTED

10

OpenFlower input files are denoted by *.flw (eg. prisms and hexas.flw). These contain several
instructions concerning all the necessary instructions for creating and running a CFD simulation.
Before explaining the content of the input files format, the user needs to create the geometry
and the related mesh of the configuration. As for now, only the Gmsh 2 format is available as an
OpenFlower input.
Gmsh is a three-dimensional unstructured mesh generator, with some built-in post-processing
facilities. It can generate multi-element meshes (tetrahedral, hexahedral, prism and pyramids) and
it is freely downloadable from the web-site of C. Geuzaine.
OpenFlower already provides several *.geo files (the Gmsh format for CAD and meshing
directives), in order for the beginner to quickly create a first mesh (eg. prisms and hexas.geo).
Launch Gmsh with the selected .geo file:
% gmsh prisms and hexas.geo
select the Mesh item from the drop-down menu of the Gmsh interface, then generate the mesh
by clicking and choosing a 3D mesh: the generated mesh is then displayed in the visaulization
window. Save the mesh by clicking in the Save button: a *.msh file will be created containing
all the mesh characteristics (see Gmsh Reference Manual for details concerning the mesh file
format). The file (eg. prisms and hexas.msh) can now be used by the OpenFlower interface (via
the input .flw file) for solving a problem.
Then, to launch OpenFlower on a test case, simply type:
% openflower file.flw 1>out 2>err
The parser of OpenFlower then reads the input .flw file and eventually outputs some information in the out and err files (or other post-processing files if any).

see Gmsh website maintained and developped by Christophe Geuzaine @ http://www.geuz.org/gmsh

Part II

Numerical and Physical Overview of


OpenFlower

11

Chapter 2

Choices made in OpenFlower and


objectives
OpenFlower is intended to solve the incompressible Navier-Stokes equations in their conservative form and on unstructured meshes. The governing equations are solved with a finite-volume
approach and a co-located arrangement of the variables (velocity, pressure, and temperature).

2.1 Governing equations


2.1.1

Mass conservation

The mass conservation equation, assuming an incompressible flow at constant density , reads
as:
ui
=0
xi

2.1.2

(2.1)

Navier-Stokes equation

The Navier-Stokes equation, in its conservative form reads as:


ui

1 p

+
(ui uj ) =
+
(2Sij ) + fi
t
xj
xi xj

(2.2)

where:
ui is the velocity component in the ith direction;
p denotes the pressure field;
fi relates to a source term (buoyancy force, mass flow-rate conservation term...);
is the cinematic viscosity (= /)
and Sij is the strain rate tensor given by:


uj
1 ui
Sij =
+
2 xj
xi
13

(2.3)

CHAPTER 2. CHOICES MADE IN OPENFLOWER AND OBJECTIVES

14

2.1.3

Temperature equation

The temperature (or scalar transport) equation is given by:


T

+
(uj T ) =
t
xj
xj

xj

+Q

where = /Cp is the (thermal) diffusivity and Q is a source (or sink) term.

(2.4)

Chapter 3

Physical modeling

15

16

CHAPTER 3. PHYSICAL MODELING

Chapter 4

Numerical overview
The discretized set of governing equations is written in its integral form, and following the
Gauss theorem, as:
Z

ui
dV +
t

1 p
dV +
xi

uj ui nj dS =
2( + t )Sij nj dS
V
V
Z
ui ni dS = 0
V
Z
Z
Z
T
T
(f + t )
ui T ni dS =
dV +
ni dS
t
x
i
V
V
V
V

(4.1)
(4.2)
(4.3)

~n being the outward normal unit surface vector of control volume V centered on point E.

4.1 Diffusive fluxes


The diffusion term appears in the discretized governing equations as:
1
D=
V

ni dS =
xi
V

N eibrs(E) 

X
f

f
ni
xi

Sf

(4.4)

where is the total diffusivity. For example = ( + t ) for a scalar field.


Consider a scalar field , located at CV centroids (center of elements) E and P . E represents the
center of the element for which we want to calculate diffusion, P is one of its neighbours (see
figure 4.1).
We define point I as the intersection between the face f (with neighbours E and P ) and the
straight line between E and P . Note that in non-orthogonal meshes, point I differs from the
center of the face f . We also define points E 0 and P 0 which are obtained by projecting E and P
orthogonally on the line normal to face f and passing through point f . V is the volume of cell E
and Sf is the surface of the face centered on f between cells E and P .
Consider a scalar field , located at CV centroids (center of elements). E denotes the present CV
and P one of its neighbor elements sharing face i (see figure 4.1). The objective is to determine
the diffusive flux going out of element E.
Given these notations, the gradient normal to the face at f between E and P is then given by
[1]:


P 0 E 0

'
ni
(4.5)
xi
dE 0 P 0
f
17

CHAPTER 4. NUMERICAL OVERVIEW

18

~n











P0












E0

PSfrag replacements



Figure 4.1: Notations for the estimation of the diffusive fluxes and gradients
dE 0 P 0 being the distance between points E 0 and P 0 . The values of P 0 and E 0 are determined
using a second order approximation:



(4.6)
E 0 = E + O EE 0
E

Gradient of the scalar field at control volume centers are given by:


xi

1
=
V

N eibrs(E)

f ni S f

(4.7)

The evaluation of the face center value f at f can not be a simple linear interpolation between
points E and P since it would provide an evaluation of at point I:
I = f E + (1 f ) P

(4.8)

where:
f =

dIP
dEP

(4.9)

A second order approximation for f is given by the following expression, where the gradient
used to correct the estimation at point f is given at the previous time step old:



old
f = I + O
If

(4.10)


 





old

old

old 1
+ O
=
O
O
2
P
E
I

(4.11)

Gradient at the center of element E is evaluated following (similar reasoning for element P ):
X
~ E= 1
5
i Si ~n
VE
i

(4.12)

4.1. DIFFUSIVE FLUXES

19

Now, i is approximated using the previous value (at the previous time step) of the gradient
of by:
old

~ F .d~F i
i = F + 5

(4.13)

20

CHAPTER 4. NUMERICAL OVERVIEW

Bibliography
[1] F ERZIGER , J., AND P ERIC , M. Computational Methods for Fluid Dynamics. Springer, 1997.

21

You might also like