Professional Documents
Culture Documents
Solution Techniques in Openfoam: Artur Lidtke
Solution Techniques in Openfoam: Artur Lidtke
Artur Lidtke
University of Southampton
akl1g09@soton.ac.uk
November 4, 2014
Content
Concepts
Solution ideology
Understanding the process
Available methods
Practice - flat plate
Test case overview
Refining the mesh
Under-relaxation
High order schemes
Summary
Concepts
Solution ideology
The balance
Solution ideology
Solution ideology
Graphically speaking
Graphically speaking
Courant number
Courant number
I At each time the Courant number is computed for an
unsteady problem
ut
Co = x
OR
Courant number
Courant number
Courant number
Courant number
Available methods
Schemes - convective
Available methods
Schemes - time
Available methods
Other schemes
I These include
I Gradient
I Laplacian
I Surface normal gradient
I Interpolation
I Generally affect stability less than the time and convective
scheme
I As a rule of thumb OK to use linear unless a specific problem
requires otherwise - look at literature and tutorial cases to get
an idea
Available methods
Other schemes
I These include
I Gradient
I Laplacian
I Surface normal gradient
I Interpolation
I Generally affect stability less than the time and convective
scheme
I As a rule of thumb OK to use linear unless a specific problem
requires otherwise - look at literature and tutorial cases to get
an idea
I Let us examine the flat plate test case with the default
settings I specified
Available methods
Other schemes
I These include
I Gradient
I Laplacian
I Surface normal gradient
I Interpolation
I Generally affect stability less than the time and convective
scheme
I As a rule of thumb OK to use linear unless a specific problem
requires otherwise - look at literature and tutorial cases to get
an idea
I Let us examine the flat plate test case with the default
settings I specified
Go to
cd $FOAM RUN/flatPlate/ZPG wallFunction coarse
Artur Lidtke Solution techniques in OpenFOAM 16 / 39
Concepts Practice - flat plate Summary
Available methods
Other schemes
I These include
I Gradient
I Laplacian
I Surface normal gradient
I Interpolation
I Generally affect stability less than the time and convective
scheme
I As a rule of thumb OK to use linear unless a specific problem
requires otherwise - look at literature and tutorial cases to get
an idea
I Let us examine the flat plate test case with the default
settings I specified
Edit
gedit system/fvSchemes
Artur Lidtke Solution techniques in OpenFOAM 16 / 39
Concepts Practice - flat plate Summary
Available methods
Solvers
I Even less obvious choice than the schemes, here are some
commonly used ones:
I smoothSolver - fairly stable, good for steady RANS (U, k, )
I GAMG + GaussSeidel - robust for the pressure equation
I PBiCG + DILU - works OK for velocity for unsteady problems,
can also use for scalar fields (like volume fraction, for instance)
I Factors affecting the optimum solver for a given problem:
I Size and nature of the mesh (structured/unstructured)
I Parallelisation strategy
I Numerical schemes used
I Solution strategy (no. loops per equation etc.)
I More info on
http://www.openfoam.org/docs/user/fvSolution.php
Available methods
Solvers
I Even less obvious choice than the schemes, here are some
commonly used ones:
I smoothSolver - fairly stable, good for steady RANS (U, k, )
I GAMG + GaussSeidel - robust for the pressure equation
I PBiCG + DILU - works OK for velocity for unsteady problems,
can also use for scalar fields (like volume fraction, for instance)
I Factors affecting the optimum solver for a given problem:
I Size and nature of the mesh (structured/unstructured)
I Parallelisation strategy
I Numerical schemes used
I Solution strategy (no. loops per equation etc.)
I More info on
http://www.openfoam.org/docs/user/fvSolution.php
Edit
gedit system/fvSolution
Artur Lidtke Solution techniques in OpenFOAM 17 / 39
Concepts Practice - flat plate Summary
Test case
Test case
Test case
Baseline simulation
I Let us examine the flat plate test case with the default
settings I specified
Baseline simulation
I Let us examine the flat plate test case with the default
settings I specified
Go to
cd $FOAM RUN/flatPlate/ZPG wallFunction coarse
Baseline simulation
I Let us examine the flat plate test case with the default
settings I specified
I There is a ready script that should execute the solution, lets
have a look
Baseline simulation
I Let us examine the flat plate test case with the default
settings I specified
I There is a ready script that should execute the solution, lets
have a look
Edit
gedit Allrun
Baseline simulation
I Let us examine the flat plate test case with the default
settings I specified
I There is a ready script that should execute the solution, lets
have a look
I Now, run the script. The case should converge quickly
Baseline simulation
I Let us examine the flat plate test case with the default
settings I specified
I There is a ready script that should execute the solution, lets
have a look
I Now, run the script. The case should converge quickly
Use
./Allrun
Baseline simulation
I Let us examine the flat plate test case with the default
settings I specified
I There is a ready script that should execute the solution, lets
have a look
I Now, run the script. The case should converge quickly
I Let us take a look at the residuals and forces convergence
Baseline simulation
I Let us examine the flat plate test case with the default
settings I specified
I There is a ready script that should execute the solution, lets
have a look
I Now, run the script. The case should converge quickly
I Let us take a look at the residuals and forces convergence
Use
I cd ..
I python plotResiduals.py
I python plotForces.py
Go to
cd ZPG wallFunction fine
Note
mapFields -sourceTime 2000 -consistent
../ZPG wallFunction coarse
Do
I Run the simulation
I Look at the forces and residuals
Original - residuals
Under-relaxation
Under-relaxation
Under-relaxation
Under-relaxation
Use
cp -r ZPG wallFunction fine
ZPG wallFunction fine lessUnderRel
Under-relaxation
Under-relaxation
Under-relaxation
Under-relaxation
Under-relaxation
Under-relaxation
Under-relaxation
Under-relaxation
Under-relaxation
Under-relaxation
Under-relaxation
Under-relaxation
Under-relaxation
Use
cp -r ZPG wallFunction fine
ZPG wallFunction fine linear
I To this:
div ( phi , U ) bounded Gauss linear ;
Summary
Conclusions
Further reading
I Tips and tricks to choosing solvers and schemes in
OpenFOAM by Joel Guerrero
http://www.dicat.unige.it/guerrero/of2014b/
12tipsandtricks.pdf
I Implicit vs Explicit time schemes explained
http://www.cfd-online.com/Forums/main/
5982-implicit-vs-explicit-method.html
I Brief introduction to the PISO algorithm
http://openfoamwiki.net/index.php/OpenFOAM_guide/
The_PISO_algorithm_in_OpenFOAM
I Brief introduction to the SIMPLE algorithm
https://openfoamwiki.net/index.php/OpenFOAM_
guide/The_SIMPLE_algorithm_in_OpenFOAM
The End