Introduction CFD 2024
Introduction CFD 2024
Introduction CFD 2024
Introduction
Fabrizio Bezzo
fabrizio.bezzo@unipd.it
049 8275468
www.dii.unipd.it
Fluid dynamics simulation
Textbooks
Bezzo 2024 2
P
Conservation equations
assume know it
Background (I)
•
Mass Balance (x,y,z)
( u ) ( v ) ( w )
+ + + =0
t x y z
+ ( u ) = 0 If is constant: u = 0
t density
represent the diffusive flux of the quantity, which is the rate at which it
Species balance spreads out or moves from areas of high concentration to low
concentration
the source term, which accounts for any
( wi )
velocity component diffusion
production, destruction, or addition of the
+ ( uwi ) = − ( ji ) + Si
quantity from external sources.
T
quantity by the moving fluid.
( u ) p xx yx zx
+ ( uu ) = − + + + + S Mx
t x x y z
mass forces: gravity, centrifugal/Coriolis force, electromagnetic force
Du p xx yx zx
=− + + + + S Mx
Dt x x y z
If the effect of viscous forces can be neglected, then we have an inviscid
flow and Euler’s equation is obtained:
Du p
= − + S Mx
Bezzo 2024 Dt x 4
P
Conservation equations
Background (III)
Energy balance
Changes in the internal and kinetic energies
E = i + Ek = i +
2
(
1 2
u + v 2 + w2 ) conduction
DE
(1) = − ( pu ) + ( τ u ) + (k T ) + S E
Dt
contribution of surface forces
If the kinetic contribution is subtracted from (1):
u ui
=
Di u x x j
(2) = − pu + (k T ) + τ : + Si
Dt x
( h + Ek ) p
(4) + + ( h + Ek ) u = (k T ) + ( τ u ) + S h
t t
Note that in the momentum and energy balances variables , p, T, i (or h)
are linked through equations of state:
= ( p, T ) often in CFD : p = p ( , T )
internal energy i = i ( p, T )
h = h ( p, T )
E.g., (3) has been derived from (2) through equation of state:
i = cvT + i0
Bezzo 2024 6
What is CFD?
Definition
DE
= − ( pu ) + ( τ u ) + (k T ) + S E
Dt
Bezzo 2024 7
NOTE: in real life, equations need solving numerically, i.e. they
What is CFD? need to be discretised in space and time. The spatial domain,
in particular, has to be discretised into a number of discrete
units or cells that represent the so-called computational
Numerics grid or mesh. In a numerical solution, the change of variable
values over the space domain is not represented continuously,
but discretely (one value per cell)
discretisation
Model Numerical model
System of differential and System of algebraic
algebraic equations equations
(DAE) (AE)
consistency
stability
Exact Approximated
solution solution
convergence
Bezzo 2024 8
What is CFD?
How does it work?
Every commercial code comprises three basic parts:
1. Preprocessor
• geometry definition (computational domain)
• domain discretisation (grid/mesh)
• selection of phenomena to be modelled
• definition of fluid properties
• setting of boundary conditions
2. Solver
• approximation of flow variables
• equation discretisation
• numerical solution
3. Postprocessor
• mesh visualisation
• representation of results
• particle tracking
• output documentation
Bezzo 2024 9
What is CFD?
Which problems (I)?
Bezzo 2024 10
What is CFD?
Which problems (II)?
Bezzo 2024 11
What is CFD?
Which problems (III)?
Initially CFD is exploited to assess mixing issues
◼ Design of optimal mixing devices (impellers…)
Reactors
◼ Tubular reactors
◼ Homogeneous reactions
Design of specific equipment
◼ pumps, valves, cyclones, scrubbers
Bezzo 2024 12
What is CFD?
Which problems (IV)?
Bezzo 2024 13
Navier-Stokes equations
Introduction (I)
Bezzo 2024 14
Navier-Stokes equations
Introduction (II)
In a Newtonian fluid ij is proportional to the deformation rate. In the
representation of tensor , two proportional constants are needed: the
dynamic viscosity (or first viscosity), m, and the second viscosity, l:
u 2
xx = 2m + lu = 2m exx + lu for gases: l − m
x 3
u v
xy = yx = m + = 2m exy
y x
Du p u u v u w
= − + 2m + l u + m + + m + + S Mx
Dt x x x y y x z z x
Bezzo 2024 15
Navier-Stokes equations
Introduction (III)
Du p u u u
= − + m + m + m
Dt x x x y y z z
u v w
+ m + m + m
x x y x z x
Less important terms; often
+ ( lu ) + S Mx indicated as a generic source
x term sMx
If m , are constant:
Du
= −p + m 2u + S M
Dt
Bezzo 2024 16
Computational Fluid Dynamics
To summarise…
There are 5 differential equations:
Mass: + ( u ) = 0
t
Du p
Momentum: = − + ( mu ) + sMx + S Mx (per x, y, z )
Dt x
Di energy dissipation related
Energy: = − pu + ( k T ) + + Si to viscous stresses
Dt
= ( p, T )
and 2 algebraic equations:
i = i ( p, T )
After integration over volume V and the application of Gauss’ theorem the
integral form is obtained:
( ) d V + n ( u ) d A = n ( ) d A + S d V
t V A A V
Bezzo 2024 18
Conservation equations
Different species (I)
Bezzo 2024 19
Conservation equations
Different species (II)
Conservative form Non conservative form
(Eulerian) (Lagrangian)
Integral form
A A
V V
volume
dV dV u
D
+ ( u ) = 0 + u = 0
t Dt
Bezzo 2024 21
not part of a exam
e
Eulerian and Lagrangian forms
Some comments (I)
Velocity and density are Eulerian fields as they are defined in time according
to coordinate x in an inertial system: (x, t), u (x, t).
Now the fluid particle concept is introduced: it is a point moving according
to the local velocity; its position is determined by x*(t, y) where y is the
particle position at reference time t0. Mathematically, the particle position is
expressed as:
x* (t0 , y ) = y
x* (t , y )
= u ( x* (t , y ), t )
t
A Lagrangian field is defined in terms of the Eulerian counterpart:
* (t , y ) = ( x* (t , y), t )
u* (t , y ) = u ( x* (t , y ), t )
A Lagrangian field is represented as a function of the reference coordinate y
which is called Lagrangian or material coordinate
Bezzo 2024 22
e
Eulerian and Lagrangian forms
Some comments (II)
The time derivative of Lagrangian density represents the particle density
variation once y has been set, i.e. along the particle trajectory:
* (t , y )
= ( x* (t , y ), t )
t t
= (x, t ) + xi* (t , y ) (x, t )
t x =x* (t ,y ) t xi x =x* (t ,y )
= (x, t ) + ui (x, t ) (x, t )
t xi x = x* (t ,y )
D (x, t )
=
Dt x = x* (t ,y )
Thus, the density variation rate for a moving fluid particle is given by the
partial derivative of the Lagrangian density or from the material (or
substantial) derivative of the Eulerian density.
Bezzo 2024 23
Conservation equations
...and yet some differences exist
The integral form allows handling discontinuities in the control
volume, whereas the differential form assumes differential
properties → integral form is more generic
Bezzo 2024 24
e
Differential equations
Classification (I)
Bezzo 2024 25
e
Differential equations
Classification (II)
P Volume affected
by point P
Initial conditions xy
affecting P t
Euler equation:
x Du p
= − + S Mx
Dt x
Bezzo 2024 27
e
Differential equations
Hyperbolic fluxes
Bezzo 2024 28
e
Differential equations
Parabolic equations
y
Boundary conditions
Volume affected by point P
Solution domain
Bezzo 2024 31
e
Differential equations
Classification summary
Problem Equation Prototype Conditions Solution Solution
type equation domain
Equilibrium Elliptic ( ) = 0 Boundary Closed domain Smooth
Bezzo 2024 32
Boundary conditions
Inlets
Inlet boundary conditions may be expressed as:
uin = uset in = set
Instead of conditions on velocity, it is often recommended to use
conditions on total pressure pT (this is needed if u is unknown; in
several commercial software, this is the required conditions if the
fluid is compressible):
➢ for incompressible fluids (and velocity normal to the inlet surface):
2
uin where ps is the static pressure
pT = ps +
2
➢ for compressible fluids:
− 1 2 −1 cp u
pT = ps 1 + M = M=
M is the Mach number and
2 cv a a is the speed of sound
Bezzo 2024 33
Boundary conditions
Total pressure
𝜌𝑣 2
𝑃2 = 𝑃1 +
2
Total = Static + Dynamic
pressure pressure pressure
Bezzo 2024 34
Boundary conditions
Outlets
backflow
outlet
Bezzo 2024 35
Boundary conditions
Inlets/Outlets: the Ansys software (I)
Velocity Inlet
◼ Velocity Specification Method
Magnitude, Normal to Boundary
Components
Magnitude and Direction
◼ Applies a uniform velocity profile at the boundary, unless UDF or profile is used
◼ Velocity inlets are intended for use in incompressible flows and are not
recommended for compressible flows
◼ Velocity Magnitude input can be negative, implying that you can prescribe the
exit velocity
Pressure inlet
◼ Suitable for both compressible and incompressible flows.
◼ Pressure inlet boundary is treated as a loss-free transition from stagnation to
inlet conditions
◼ FLUENT calculates static pressure and velocity at inlet
◼ Mass flux through boundary varies depending on the interior solution and
specified flow direction.
Bezzo 2024 37
Boundary conditions
Inlets/Outlets: the Ansys software (III)
Mass flow inlets
◼ Intended for compressible flows; however, they can be used for incompressible
flows.
◼ Total pressure adjusts to accommodate mass flow inputs.
◼ More difficult to converge than pressure inlet.
Pressure outlets
◼ Suitable for compressible and incompressible flows
◼ Specified pressure is ignored if flow is locally supersonic at the outlet
◼ Can be used as a “free” boundary in an external or unconfined flow
Required information
◼ Gauge Pressure (static) – static pressure of the environment into which the flow
exits
◼ Backflow quantities – Used as inlet conditions if/when backflow occurs
Bezzo 2024 38
Boundary conditions
Inlets/Outlets: some comments
Outlet/inlet conditions on pressure p may allow for the establishment of
a backflow (due to local differences in pressure). Although an inverse
flow on a boundary indicates that an inaccurate solution may have
been obtained locally, yet it still may be a better approach than setting
the velocity when flow direction is unknown.
In general it is convenient to set inlet/outlet boundary conditions where
turbulent flow is well developed (so that no inverse flow is obtained) or
far away from the domain of interest so that the local (inaccurate)
solution does not affect the quality of the simulation results.
Bezzo 2024 39
Boundary conditions
Walls
On the domain walls, a no-slip conditions is assumed usually:
u = uW → tangential velocity = wall velocity; normal velocity = 0
For the energy and species one of the following boundary conditions
is assumed usually
T = Tw mi = miw assigned wall property
T mi
qw = k jiw = Dij assigned wall flux
n w n w
Bezzo 2024 41
Boundary conditions
Simmetry/Periodicity
Simmetry
planes
Rotational
Flow
periodic
Translational planes
periodic
planes
Bezzo 2024 42
Boundary condition
Simmetry/Periodicity
Coanda effect
Bezzo 2024 43
Note:
Substantial (or material) derivative
( u ) u
+ ( uu ) = +u + u ( u ) + u ( u )
t t t
but: + ( u ) = 0
t
( u ) u Du
+ ( uu ) = + u ( u ) =
t t Dt
D/Dt is the substantial derivative, which is physically the time rate of change
of following a moving fluid element; /t is called the local derivative,
which is physically the time rate of change of at a fixed point; u is called
convective derivative, which is physically the time rate of change of due to
the movement of the fluid element from one location to another in the flow field
where the flow properties are spatially different.
Bezzo 2024 44