Professional Documents
Culture Documents
at ResearchGate.net
Manual 1:
Using Salome-Meca,
OpenFOAM,
and ParaView
Version: 2010-05-01
Author and © :
Kai Velten (Geisenheim, Germany)
➔ This group provides a forum to introduce useful Open Source Scientific Software
(OSSS) to the community as well as a forum for mutual support and the exchange
of ideas and experiences. It is intended to cover packages such as OpenFOAM for
CFD, structural mechanics and PDE's, R for statistics and ODE's, Maxima for
computer algebra, Salome for grid generation, ParaView for postprocessing, gmesh
for CAE and CAD and so on.
Today, OpenFOAM is the most powerful OSSS for applications such as computational fluid
dynamics (CFD), structural mechanics or general PDE's, cf. Jasak (2009), Nilsson (2006)
and a great number of other scientific papers using OpenFOAM shich you may find e.g. at
scholar.google.com.
The fastest way to get acquainted with a software like OpenFOAM is to work with
examples. The example described in the next sections is a flow problem, but almost the
same procedure can also be used when OpenFOAM is applied e.g. to problems from
structural mechanics or to general PDE problems.
Currently, only Linux versions of OpenFO
AM are provided at OpenFOAM's official website openfoam.com. In the web, you will find
some efforts to transfer OpenFOAM on other platforms, such as freefoam.sourceforge.net.
However, the simplest and most comfortable way to use OpenFOAM on arbitrary platforms
such as Windows, Mac or Linux is a system called CAELinux, see caelinux.com. We
recommend to use CAELinux "virtualized" using VirtualBox (virtualbox.org). The procedure
is described in Manual 2 in the "Files" section of the OSSS page at researchgate.net.
Once CAELinux is installed this way, the following packages are available that will be used
in the example below:
➔ Salome-Meca for the preprocessing
➔ OpenFoam to solve the PDE
➔ ParaView for the postprocessing (see paraview.org and Squillacote, 2008).
See Velten (2009) for more background on CAELinux, CFD, structural mechanics and
general PDE's.
1 Flow problem
Assume a geometry consisting of a large
cylinder with a small cylinder on top like this:
Assume that a fluid enters this volume with 1
m/s through the bottom surface of the big
cylinder, and that the fluid leaves the system
through the top surface of the small cylinder.
The resulting flow pattern will now be
computed using OpenFOAM in CAELinux
2009.
3. Choose
New Entity – Primitives – Cylinder
and make these selections:
4. Generate a second cylinder the same way, but with a radius of 0.5 (0.5 m, since SI units
are used).
7. Choose
New Entity – Group – Create
to define the boundaries for the fluid flow simulation.
7.1. Definition of the outlet boundary where the fluid leaves the system:
Use the
mouse to
highlight the
top surface.
7.3 Definition of the inlet boundary where the fluid enters the system:
inlet
8. Start the mesh module using the drop down list from step 2 above.
9. Choose
Mesh – Create Mesh
and apply the following settings:
Note: Press the button in the Hypothesis line to open up the "Hypothesis Construction"
window.
10. Click on "Mesh" in the Object Browser, right click to open the context menu below, then
choose Compute (or do the same thing in the Mesh menu).
12. To integrate the boundaries of the flow problem into the mesh file, choose
Mesh – Create Groups from Geometry
and then apply the following selections:
2. Type
mkdir example
to generate a working directory.
3. We are going to compute incompressible, laminar flow here, which means we need
OpenFOAM's icoFoam solver. If you want to know more about this and other available
solvers, see section "3.5 Standard solvers" on page 83 in the file UserGuide.pdf which is
located in:
/home/caelinux/OpenFOAM/OpenFOAM-1.5/doc/Guides-a4
For quick access to this directory and the user guide you may start e.g. with
Places – Home Folder
in CAELinux. Several icoFoam examples can be found in
/home/caelinux/OpenFOAM/OpenFOAM-1.5/tutorials/icoFoam
We will solve our flow problem by a modification of the "cavity" example in that directory.
To do this, copy the cavity directory into the working directory, e.g. by typing something like
cp -r /home/caelinux/OpenFOAM/OpenFOAM-1.5/tutorials/icoFoam /home/caelinux/example
6. To define the pressure boundary conditions, edit the file "p" in the cavity/0 directory. An
appropriate editor is automatically invoked if you choose
Places – Home Folder
and then go to examples/cavity/0
In the "p" file, we need to change the "boundaryField". In the OpenFOAM's original cavity
example that we are editing here, the boundaryField looks like this:
Note that we are imposing 1 m/s inflow in the positive z direction as required by the
problem described above.
1. Type
paraFoam
in the OpenFOAM terminal to start ParaView with the data of the flow computation. You
can read some basic facts about ParaView's structure in OpenFOAM's UserGuide.pdf (see
above). We will skip all general considerations here and just see how we can quickly
generate a meaningful plot.
2. In the "Properties" tab of the "Object Inspector", apply the following settings:
3. Use the color bar button and drop down list immediately below the File menu to color
the figure according to pressure levels:
After a little editing of the background color and the color bar options, this gives:
5. If you want to see the arrows in the original geometry, reactivate the first plot using the
top eye symbol in the "Pipeline Browser". After a little editing of the properties of the first
plot you may arrive at something like this:
Note that the "opacity" option has been used here to make the geometry transparent.
4 References
H. Jasak, OpenFOAM: Open Source CFD in research and industry, International Journal
of Naval Architecture and Ocean Engineering, Vol 1, No 2, 89-94, 2009.
H. Nilsson, Evaluation of OpenFOAM for CFD of turbulent flow in water turbines, 23 rd IAHR
Symposium, Yokohama, Japan, 2006.
A. Squillacote, The Paraview Guide, Kitware, Inc., 2008.
K. Velten, Mathematical Modeling and Simulation, Wiley-VCH, 2009.