Академический Документы
Профессиональный Документы
Культура Документы
Contact: cyprien.soulaine@stanford.edu
http://web.stanford.edu/~csoulain/
Stanford
October27,2014
Version 5.0
OpenFOAM initiation
Objectives
Understand what is behind solvers to identify the most suitable for the
specific problem
OpenFOAM initiation
What is OpenFOAM ?
Where one can find help and documentation ?
Nov 10
OpenFOAM initiation
What is OpenFOAM ?
- Solve the Partial Differential Equations using the finite volumes method
- Multiphysic simulation platform mainly devoted to fluid flow
- Manage 3D geometries by default
- Open-source software developed in C++ (object-oriented programming)
- Can be freely download at www.openfoam.com
- Designed as a toolbox easily customisable
- Parallel computation implemented at lowest level
- Cross-platform installation (Linux preferred)
1989 : First development at Imperial College London
1996 : First release of FOAM
2004 : OpenFOAM release under GPL licence by OpenCFD Ltd.
2014 : version 2.3.0 ; acquisition of OpenCFD by ESI Group
cyprien.soulaine@stanford.edu
OpenFOAM initiation
Pre-processing:
-
Solvers:
- incompressible / compressible flow
- multiphase flow
- combustion, electro-magnetism, solid mechanics
- heat transfer
- several turbulence approach (DNS, RANS, LES)
- etc
post-processing:
-
cyprien.soulaine@stanford.edu
openfoam.com
OpenFOAM initiation
openfoam.com
Simulation examples
cyprien.soulaine@stanford.edu
OpenFOAM initiation
C. Soulaine, P. Horgue, J. Franc, M. Quintard, GasLiquid Flow Modeling in Columns Equipped with Structured
Packing, AIChE Journal 60 (2014) 3665-3674
Shewani, A., Horgue, P., Pommier, S., Debenest, G., Lefebvre, X., Gandon, E., Paul, E., Assessment of percolation
through a solid leach bed in dry batch anaerobic digestion processes, Bioresource Technology (2014)
L. Orgogozo, N. Renon, C. Soulaine, F. Hnon, S. K. Tomer, D. Labat, O. S. Pokrovsky, M. Sekhar, R. Ababou, M.
Quintard, An open source massively parallel solver for Richards equation: Mechanistic modelling of water fluxes at
the watershed scale, Computer Physics Communications 185 (2014) 33583371
http://cpc.cs.qub.ac.uk/summaries/AEUF_v1_0.html
OpenFOAM initiation
OpenFOAM initiation
An active community !
- A discussion forum (www.cfd-online.com/Forums/openfoam/)
- A community-driven wiki (openfoamwiki.net)
- An annual Workshop (9th edition in 2014) (www.openfoamworkshop.org)
- Social network related to OpenFOAM (www.extend-project.de)
- www.cocoons-project.org : A peer-reviewed documentation project
- A lot of tutorials, reports, presentations made by the community (search on Google)
cyprien.soulaine@stanford.edu
10
OpenFOAM initiation
Lack of documentation..
Regular updates,
cyprien.soulaine@stanford.edu
11
OpenFOAM initiation
Navigation
pwd
ls
cd
Visualization
cat
Manipulation of files
cp
mkdir
Create a directory.
rm
mv
I/O redirection
>
grep
12
OpenFOAM initiation
Turn on or reboot the computer and hold down the Option key until the dualboot appears on screen.
cyprien.soulaine@stanford.edu
13
OpenFOAM initiation
For this training, we will use the tool servers in graphic mode
$ ssh
sunetid@cees-tool-3.stanford.edu
-X
Or
$ ssh
sunetid@cees-tool-4.stanford.edu
-X
Once you are login, create your OpenFOAM home directory (this stage only needs to
be done once)
$ cd ~
$ mkdir
-p
$FOAM_RUN
cyprien.soulaine@stanford.edu
14
OpenFOAM initiation
cyprien.soulaine@stanford.edu
15
Tini = 273K
273K
OpenFOAM initiation
573K
Solver : laplacianFoam
cyprien.soulaine@stanford.edu
16
OpenFOAM initiation
$ run
$ cp r $FOAM_TUTORIALS/basic/laplacianFoam/flange
$ cd Exo1
$ ls
$ gedit 0/T
Exo1
17
OpenFOAM initiation
cyprien.soulaine@stanford.edu
18
OpenFOAM initiation
$ gedit constant/transportProperties
cyprien.soulaine@stanford.edu
19
OpenFOAM initiation
$ gedit system/controlDict
cyprien.soulaine@stanford.edu
20
-scale 0.001
OpenFOAM initiation
4 Choose the
field to display (T)
5 Press play to
read all the time
steps
3- Choose
surface
2 - apply
Exo1bis :
DT = 1e-7 m/s
Until steady-state
1 Choose
the field you
want to load
for viewing
cyprien.soulaine@stanford.edu
21
#2 - Cavity (1/6)
Ux=1m/s
movingWall
y
x
fixedWalls
fixedWalls
OpenFOAM initiation
fixedWalls
$ run
$ cp
r
$ cd Exo2
$ ls
$FOAM_TUTORIALS/incompressible/icoFoam/cavity
Exo2
cyprien.soulaine@stanford.edu
22
#2 - Cavity (2/6)
blockMesh = pre-processing tool to design and mesh simple geometries
Vertices definition
OpenFOAM initiation
$ gedit constant/polyMesh/blockMeshDict
Definition of the hexahedral
block. Pay attention to the
numerotation order
y
z
1
4
23
#2 - Cavity (3/6)
Generate the grid mesh :
$ blockMesh
$ checkMesh
$ paraFoam
OpenFOAM initiation
4 - Apply
5 - wireframe
2 To display
the patch
names on the
geometry
1 Choose the
elements you want
to visualize
cyprien.soulaine@stanford.edu
24
#2 - Cavity (4a/6)
OpenFOAM initiation
$ gedit constant/transportProperties
cyprien.soulaine@stanford.edu
25
#2 - Cavity (4b/6)
OpenFOAM initiation
$ gedit 0/U
cyprien.soulaine@stanford.edu
26
#2 - Cavity (4c/6)
OpenFOAM initiation
$ gedit 0/p
cyprien.soulaine@stanford.edu
27
#2 - Cavity (4d/6)
OpenFOAM initiation
$ gedit system/controlDict
cyprien.soulaine@stanford.edu
28
#2 - Cavity (5/6)
Start the simulation :
OpenFOAM initiation
$ icoFoam
$ paraFoam
cyprien.soulaine@stanford.edu
29
#2 - Cavity (6a/6)
To view the velocity vectors
OpenFOAM initiation
cyprien.soulaine@stanford.edu
30
#2 - Cavity (6b/6)
OpenFOAM initiation
31
outlet
symmetryPlane
inlet
OpenFOAM initiation
bottomWall
y
x
$ run
$ cp r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily
Exo3
$ cd Exo3
$ cp ../Exo2/constant/polyMesh/blockMeshDict
constant/polyMesh/.
cyprien.soulaine@stanford.edu
32
OpenFOAM initiation
inlet
y
z
outlet
1
4
bottomWall
$ blockMesh
cyprien.soulaine@stanford.edu
33
OpenFOAM initiation
$ gedit 0/p
cyprien.soulaine@stanford.edu
34
OpenFOAM initiation
$ gedit constant/RASProperties
$ gedit system/controlDict
cyprien.soulaine@stanford.edu
35
$ simpleFoam
$ paraFoam
OpenFOAM initiation
cyprien.soulaine@stanford.edu
36
wetting fluid
(=1)
OpenFOAM initiation
Contact
angle
inlet
outlet
Exo4
cyprien.soulaine@stanford.edu
37
top (wall)
right (inlet)
OpenFOAM initiation
1
5
4
y
z
bottom (wall)
left (outlet)
$ blockMesh
cyprien.soulaine@stanford.edu
38
OpenFOAM initiation
$ gedit constant/transportProperties
Non-wetting phase
properties
Surface tension
cyprien.soulaine@stanford.edu
39
$ gedit 0/U
OpenFOAM initiation
We use a hydrostatic
pressure
cyprien.soulaine@stanford.edu
40
OpenFOAM initiation
0/alphawater.org
41
$ gedit constant/turbulenceProperties
OpenFOAM initiation
$ gedit constant/g
cyprien.soulaine@stanford.edu
42
OpenFOAM initiation
$ gedit system/controlDict
cyprien.soulaine@stanford.edu
43
OpenFOAM initiation
$ cp 0/alphawater.org/
0/alphawater
$ paraFoam
$ gedit system/setFieldsDict
$ setFields
$ paraFoam
BEFORE
AFTER
cyprien.soulaine@stanford.edu
44
OpenFOAM initiation
theta=45 degrees
theta=20 degrees
t=0.05s
t=0.10s
t=0.15s
t=0.20s
45
OpenFOAM initiation
Part III: First programs, development of a heat tranfer solver in porous media
http://web.stanford.edu/~csoulain/
cyprien.soulaine@stanford.edu
46