Академический Документы
Профессиональный Документы
Культура Документы
Today, mathematics is used with success with one face or another in many
areas of industry. In the same time, today experiments and theory are
supplemented in many cases by numerical computation that is an equally
important component. Nowadays, in scientific computing one can treat more
complex and less simplified problems through massive amounts of numerical
calculations and thanks to the increased computer facilities in short time.
u
u u p u f
t
stress extra forces
convection
u 0
u 0
For a mathematical point of view, it is hard to answer the following
questions (in 3D):
does exists one solution?
the solution is unique?
The first equation (in fact three equations in 3D) is called the
momentum equation and the last one is called mass conservation
equation.
There is no independent equation for the pressure. The pressure
only appears in the momentum equations as a gradient. Having no
explicit equation for the pressure (I meant here there is no
equation where the pressure is the dominant unknown), it is very
hard to solve both analytical and numerical cases.
u 0
u 0
BC are the most important data to be added into the NS system.
Thus they need to add NEW information to the NS system.
From a mathematical point of view, we need to set up Dirichlet BC
(sometimes called no-slip or wall BC), i.e. (u,v,w)=g at the
boundary and NO BC for the pressure. This is of course not the
case in engineering computations. Moreover, this does not mean
that if we have some information (pointwise) for the pressure (for
instance) it is not allowed to be used. If the information reflects
the reality the solver will be “happy” to proceed. That’s why this
type of BC is used in almost all CFD codes.
Boundary Conditions u
u u p u f
t
Part 2 stress extra forces
convection
u 0
Another used BC is the slip BC, i.e. only one component of the velocity
field is set up at the boundary. This type of BC does not add enough
information and indeed the solver is giving results (wrong sometimes)
according to that (think about no wall turbulence).
There is a more sensible way with the Neumann (outflow) BC. This type of
BC (unfortunately widely used in CFD simulations) does not add also any
new information on the NS system. Indeed the CFD solvers give wrong
results. We mean here, appearance of unexpected recirculation zones or
back flows (think about FLUENT). This is the right answer of the solver.
Therefore to get rid of such unphysical results the engineers try to
enlarge the computational domain. The same situation is seen in the
aerodynamical tunnels. They are huge buildings constructed in order to
avoid the same unphysical flow motions. So, the reality is also giving us
wrong results if we do not supply the correct BC.
Boundary Conditions u
u u p u f
t
Part 3 stress extra forces
convection
u 0
At this time many numerical experiments are done in order to obtain the
so-called “transparent” BC such that these not real flow features are not
anymore visible. → If will succeed, will be no need to have so huge aero
tunnels and digital tunnels. I wish them Good Luck!
If one imposes a certain value of the pressure at the boundary then it
must impose there no no-slip condition on the velocity field. Today, I
believe that each code does that automatically and do not allow the users
to impose such combination.
→ In conclusion, we must use the physical correct BC in order to obtain a
physical correct numerical solution otherwise the numerical solver will
punish us.
u 0
Usually, having no analytical solution one try to obtain an
approximate one. First thing in this sense is to set up the
coordinates of the points where you want to obtain the solution,
which means instead of having a complete computational domain
(a car for example) we “look” only at some points of it. These
coordinates are very important and will have a big impact in the
numerical solution. The set of points together with other important
data (for example the boundary points have some labels (or PIDS,
FLAGS) to sort them, the neighbors of each point, number of
elements, volumes, lengths etc) is called mesh or grid.
→ Each CFD code has his own grid function which is stored in a
different way according to his needs/philosophy.
Meshes/Grids
Part 2
Types of grids:
structured
unstructured
Elements:
triangles, rectangles, hexagons in 2D
prisms/tetrahedra, parallelepipeds, etc in 3D
Consistency: means that the discretized version of the equation must fit the
analytical one if one goes with the grid size to zero and the truncation error (i.e. the
difference between the exact and numerical (discrete) equation) must be small and
bounded.
Stability: assures that the errors made at each time step/iteration will not grow in
time.
Convergence: numerical solution tends to the exact one as the grid size tends to
zero.
u 0
1 p
Artificial Compressibility Methods (β small) u 0
t
Particle Methods: FVPM, FPM…
All of them are trying to obtain the div-free condition!
T fin T fin
Integrating in time
u (T fin ) u (0) u u dt (p u f ) dt
0 0
T fin
Final time = T fin u dt 0
0
Round-off errors
Let ũ be an approximation of u
What to do?
TEST 2 | ũ - u | = 1e-05
u = 0.0003
ū = 0.00031 | ũ - u | / |u| = 1/30
If one try to reduce the mesh size Δx, also the “error” induced
will be settled down, but will never be zero.
The error between the exact and approximate derivative is
called truncation error.
u x 2 2 u
u ( x0 x, y 0 , t ) u ( x0 , y 0 , t ) x x0 , y 0 , t x0 , y 0 , t ...
t 2! x 2
u ( x0 x, y 0 , t ) u ( x0 , y 0 , t ) u x 2 u
x0 , y 0 , t x0 , y 0 , t ERROR
x t 2! x 2
u
x0 , y0 , t Ox .
t
0 a b x
b n
f ( x)dx a
i 0
i f ( xi ) index i counts the nodes number
between a and b.
a
f dx
a
b
0 a b x
ab
b
a
f ( x)dx (b a) f (
2
) O((b a)3 )
ba
b
a
f ( x)dx
2
[ f (a) f (b)] O((b a)3 )
ba ab
b
a
f ( x)
3
[ f (a) f (
2
) f (b)] O((b a)3 )
Answer: at each time step there is an error (total error at that time)
which is automatically “transported” in time to the next time steps
by the numerical method!
Indeed, sometimes we see that the convergence brakes out after a
while. So, it is because the accumulation error is not anymore
bounded and indeed with each time step increases until the total
error reaches the maximal limit imposed.
unum u u
a num b num 0
t x y
Consider that unum = u + E, (u E ) (u E ) (u E )
a b 0
where u is the exact solution t x y
and E is the error induced E E E
a b 0
t x y
The above equation shows that the error propagation in that case
follow the same transport equation as the original solution.
In the nonlinear case (Navier-Stokes for example) there is no
explicit error propagation formula no matter which numerical
algorithm is taken into account.
u
u u p u f
t
stress extra forces In this case we
convection
treat only this way,
u 0 and not other
nonlinear
approaches based
Discretization procedure
on Newton
iterations!!!
Ax b
Preconditioning 1
+
Multigrid xA b
Iterative Methods
Generalities:
if x has N entries then A has the dimension N2!
# of arithmetic operations needed to obtain the solution x is proportional
usually with N3! → How to decrease the computational time?
Direct Methods
Gaussian Elimination 0
Visually speaking:
# of arithmetic operations: N3/3+N2-N/3 (mult/div) + N3/3+N2/2-5N/6 (add/subst)
NOT used in practice because the computational time is proportional with N3!
LU Factorization
Factorization on the form A=LU
# arithmetic operation proportional with O(N2)
Preconditioning
Examples:
Jacobi Preconditioner:
P=D
SOR Preconditioner:
P = (D/ω+L) ω/ (2-ω)D-1(D/ ω+R), ω in (0,2), usually ω=1.7
SSOR:
P = (D/ω+L) ω/ (2-ω)D-1(D/ ω+LT)
Valid for symmetric matrices
Implemented also in FLUENT
V - cycle W - cycle
Overview:
Usually in CFD the matrix A is sparse (e.g. more zero entries than non-zero)!
A is always quadratic. For a 1.000.000 grid points the dimension of A is (1.000.000)2!
The non-zero entries are only the coefficients of the unknown values and the
connections to their neighbors! So, A is never stored as a full matrix. A is stored as a
three vectors:
1st vector: position in x dir in A
2nd vector: position in y dir in A
3th vector: non-zero value of A
Important to have symmetric matrices… easier to solve the LS
The type of discretization operators, or in the grid elements together with the overall
numerical scheme chosen have direct impact to the coefficients of the A matrix →
more tuning needed to solve LS! That’s why
Do not use angles too small
Discretization lengths in all directions in the same range, and smooth transition of the layers!
Turbulence modelling
“Definition”: a turbulent flow is characterized by a non regular/chaotic movement!
Models (just few…)
No model: DNS – usually for small Re numbers…
Zero-order models (algebraic): ex. Baldwin-Lomax Model
1 equation models: Spalart-Allmaras model (implemented FLUENT)
2 equations models: k-ε and variants (well accepted in industry)
Reynolds Stress Models (RSM)
LES, VLES
DES – to treat near boundaries in a RANS view and in other parts as LES. etc
Turbulent solutions give you only mean values instead of point wise…
There are NO exact turbulence models, only approximations…
Always playing/changing the overall viscosity…
Need a lot of coefficients to be tuned (ex. “only” 5 for k- ε model)
LES/VLES/DES new on the market
Grids
Creation of elements with “good” shape
Smooth transition areas between areas meshed with different length scales
For CFD, if possible using TRI instead of QUAD elements
At one node point there is collected more information, i.e., within TRI philosophy one node has
more neighbors than with QUAD.
More time is needed in order to assembly the matrix A!!
Structured or unstructured grids?
Structured: the final computational matrix A is almost symmetric. The LS solvers are happy to
work with block-structured matrices, indeed less computational time is demanded.
Structured: more robust software codes which do not need special tuning order to start the
simulation. See for example our PowerFlow!
Unstructured: produces computational matrices A with big discrepancies in the size of values!
Unstructured: simplicity in refining the domain in special zones!
Numerical scheme
For our purposes use ALWAYS a second-order scheme both in time and space
A first-order scheme is producing in excess numerical diffusion which will spoil the solution
A higher-order scheme will produce more accurate results, but the price paid is that needs
more computational time and finer tuning of the start-up!
It is also a must when dealing with turbulence. Each turbulence model is producing a
turbulent viscosity ~ O(h2)!!! Indeed, if using a first-order scheme, it does not mater
which turbulence model is taken the effect on the final solution will be ~0! WHY?
Maybe the grid is not good enough (usually) → check the quality parameters…
Maybe the time step is too big → try to decrease it (if possible, but not too much) …
Use a lower-order scheme at the beginning (run for few time steps) and then switch
to higher-order → you will pay in the accumulation error…
Tune the LS: change the method, preconditioners, MG/AMG steps, etc,
Make sure that the initial solution x0 is not initialized with 0 → think that at the
beginning Ax0=b0 … → problems in starting the computation of LS → initialize with
1.0-08 for example!
If BC are too steeply (ex. uInflow=160km/h) try an increasing
boundary profile linearly in time for the beginning… uinflow
Do not enforce full div-free condition more than the
accuracy of the scheme
…
0 Tfin time
→ PHYSICS
→ MATHEMATICS
→ MEASUREMENTS
→ PROGRAMMING
→ … BIG BIG WORKING EXPERIENCE!
TO BE CONTINUED…