Introduction CFD 2024

Download as pdf or txt
Download as pdf or txt
You are on page 1of 44

Fluid dynamics simulation

Introduction

Fabrizio Bezzo

fabrizio.bezzo@unipd.it

 049 8275468

www.dii.unipd.it
Fluid dynamics simulation
Textbooks

▪ H.K. Versteeg & W. Malalasekera, An introduction to


Computational Fluid Dynamics, 2nd Ed., Pearson-Prentice Hall,
2007

▪ Fluent User’s Guide

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 the spatial rate of change due to


convection, which is the transport of the

T
quantity by the moving fluid.

ji = − Dij wi − DiT often can be neglected


represents the time rate of change of the T
conserved quantity (like mass or momentum)
within a control
Bezzo 2024 volume. 3
P
Conservation equations
Background (II)
Momentum balance
2nd Newton law: Momentum balance variation on a fluid particle is equal to the sum of
forces acting on the fluid particle
surface forces: pressure and viscous forces

 ( 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)  = − pu + (k T ) + τ : + Si
Dt x

If fluid is incompressible, (2) can be expressed as:


DT u
(3)  cv =  ( k T ) + τ : + Si
Dt x 5
Bezzo 2024
P
Conservation equations
Background (IV)
If fluid is compressible, (1) is often expressed in terms of enthalpy:

   ( 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

CFD (Computational Fluid Dynamics) is a numerical technique


to solve balance equations describing the fluid flow behaviour in
a generic domain (geometry)
 Du x p
+  ( u ) = 0  = − + τ x + S Mx for x,y,z
t x balance
Dt momentum
coactively

DE
 = − ( pu ) +  ( τ  u ) + (k T ) + S E
Dt

Equations of state also need adding.


In incompressible fluids relation  = (p,T ) is usually neglected;
compressible fluids, too, may be described as incompressible ones in low
velocity flows if there are no relevant thermal phenomena.

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)?

CFD is theoretically founded in the early ‘900


It gets a viable tool in the ’60s (computer) for fluid dynamics
description:
◼ Aerospace industry
◼ Automotive industry

Bezzo 2024 10
What is CFD?
Which problems (II)?

Early applications concern heat transfer, too


◼ Heat exchangers
◼ Ovens/furnaces
Combustion processes (mainly for engines/turbines in the
automotive/aerospace industries)

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)?

Design of multiphase systems


◼ Bubble columns
◼ Dispersion systems
◼ Fluidised bed reactors
◼ Trickle beds
Non-Newtonian fluids
◼ Food industry
◼ Polymers
◼ Biological processes
Risk analysis
◼ Explosions
◼ Pollutant dispersions

Bezzo 2024 13
Navier-Stokes equations
Introduction (I)

The equations for momentum balance require a


suitable model for the description of viscous stressij
In general it is possible to express ij as a function of
local deformation, represented by:
◼ linear deformation rate eij (strain rate):
1  ui u j 
eij =  + 
2  x j xi 
 note that of the 9 strain components eij only 6 are independent
(eij = eji)

◼ volumetric deformation rate u (note that for incompressible


fluids u =0) polymer fluid is not isotropic

All gases and many liquids are isotropic (→ the stress –


strain rate relation is invariant with respect to rotations)
yeksan

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 + lu = 2m exx + lu  for gases: l − m
x  3 
 u v 
 xy =  yx = m  +  = 2m exy
 y x 

By substituting the expressions above in the momentum balance we


obtain the Navier-Stokes equations:

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)

Navier-Stokes equations may be ordered as follows:

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
+ ( lu ) + 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:  = − +  ( mu ) + sMx + S Mx (per x, y, z )
Dt x
Di energy dissipation related
Energy:  = − pu +  ( k T ) +  + Si to viscous stresses
Dt
 =  ( p, T )
and 2 algebraic equations:
i = i ( p, T )

The are 7 unknowns: , u, v, w, i, T, p time space

Problem can be solved, once suitable initial and boundary conditions


and auxiliary information (viscosity, source terms …) are given.
supporting
Bezzo 2024 17
Conservation equations
A common form

Conservation equations may be represented according to the following


common form:
 (  )
+  ( u ) =  (   ) + S Rate of variation of f
t because of source terms
Rate of variation of f in
fluid element Rate of variation of f Rate of variation of f
because of convection because of diffusion
through the fluid element through the fluid element

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)

Balance equations can be represented in different ways.


From a numerical point of view, choosing one form instead of
another one can make the difference and determine whether a
solution can be obtained.

The following forms can be considered:


• a differential form
• an integral form

• a Lagrangian (or non-conservative) form


• an Eulerian (or conservative) form

Bezzo 2024 19
Conservation equations
Different species (II)
Conservative form Non conservative form
(Eulerian) (Lagrangian)
Integral form

A A
V V

Finite/infinitesimal control volume


Finite/infinitesimal control volume moving with fluid: the same fluid
fixed in space: fluid flows through it particles are contained in the same
Differential form

volume

dV dV u

Bezzo 2024 variable volume 20


Conservation equations
Formally the same …
It is possible to go from a conservative form to a non conservative one
as well as from a differential form to the integral one and viceversa.

more general format


 D
t V
 dV +   udA = 0 
Dt V
 dV = 0
A

 D
+  ( u ) = 0 + u = 0
t Dt

In depth: see material in


Moodle for more details

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

The conservative form is easier to integrate (the finite volume


method approach is “embedded” in the conservative integral
form)
◼ The variation of a generic property  only depends on fluxes
through the control surface and not by flux values within the
control volume (if there is no source term)

The conservative form is numerically more stable (e.g., if shock


waves need considering)
◼ the conservative form uses flux variables (e.g., u) as dependent
variables along the spatial directions; variation in a flux variable are
usually smaller than those of the primitive variables (e.g., )

Bezzo 2024 24
e
Differential equations
Classification (I)

Partial derivative differential equations can be


grouped into 3 main categories:
◼ parabolic equations
◼ elliptic equations
◼ hyperbolic equations
Best numerics depends on the equation type
Initial and boundary conditions also depend on the
equation type

Bezzo 2024 25
e
Differential equations
Classification (II)

We can distinguish equilibrium and marching


problems
Equilibrium problems are steady-state situations
representing the distribution of a property: in
general, these problems are represented by elliptic
equations.
Marching problems comprise unsteady flows and
wave phenomena. Marching problems may also
include steady-state situations where the flow
directions act as time-like coordinates (e.g., inviscid
supersonic flows). There problems are represented
by parabolic and hyperbolic equations.
In depth: see material in
Moodle for more details 26
Bezzo 2024
e
Differential equations
Hyperbolic equations
y

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

Intersection between characteristic surface


of point P and boundary conditions
Initial conditions
t

Dynamic diffusion equation:


x
  2
= 2
t x
Bezzo 2024 29
e
Differential equations
Elliptic equations
y

Solution domain

2D steady diffusion equation:


 2  2
+ 2 =0
x 2
y
Bezzo 2024 30
e
Differential equations
Elliptic fluxes

Bezzo 2024 31
e
Differential equations
Classification summary
Problem Equation Prototype Conditions Solution Solution
type equation domain
Equilibrium Elliptic  (  ) = 0 Boundary Closed domain Smooth

Marching Parabolic d  d t =   (  ) Initial and Open domain Smooth


(dissipation) boundary
Marching Hyperbolic d 2  d t 2 = c 2  (  ) Initial and Open domain May be
(no dissipation) boundary discontinuous

Flow Steady Unsteady


Viscous flow Elliptic Parabolic

Inviscid flow M<1, elliptic Hyperbolic


M>1, hyperbolic
Thin shear layers Parabolic Parabolic

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

A typical condition is to assume that the gradients of all variables


(except pressure) are zero in the flow directions

=0
n

Usually the above conditions are not required to be set explicitly.

Most CFD software requires a condition on the outlet pressure.


Backflow conditions are also typically required to account for
unforeseen incoming flows.

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.

In depth: see Ansys


Fluent User’s Guide
Bezzo 2024 (chapter 6) 36
Boundary conditions
Inlets/Outlets: the Ansys software (II)
Required inputs for pressure inlets
◼ Gauge Total Pressure
◼ Supersonic / Initial Gauge Pressure (this is the static pressure and used if the
flow is supersonic)
◼ Inlet flow direction
◼ Turbulence quantities (if applicable)
◼ Total temperature (if heat transfer and/or compressible).
If Reference Frame is set to Absolute in the Pressure Inlet dialog box,
then the total temperature, total pressure, and flow direction are also
in the absolute reference frame (i.e. no relative movement w.r.t. to
other cells is assumed).

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

qw = hq (Text − Tw ) jiw = h j ( mi ,ext − miw ) assigned properties and


transfer coefficient

Specific conditions are set if other surface phenomena (e.g.


reactions) take place.
Bezzo 2024 40
Boundary conditions
Simmetry/Periodicity
If the process of interest exhibits some symmetric or periodic
behaviour then it is convenient to reduce the computational domain
by defining some artificial planes characterised by special boundary
conditions.
If there are symmetry axes (note: equipment/geometry symmetry
is not enough; flow symmetry is required!), then for each variable
the following holds (for each symmetry plane):

=0
n
If the process exhibits a cyclic or repetitive behaviour, then
periodical boundary conditions are applied to specific planes:
1 = 2

Bezzo 2024 41
Boundary conditions
Simmetry/Periodicity

Simmetry
planes

Rotational
Flow
periodic
Translational planes
periodic
planes

2D Tube Heat Exchanger

Bezzo 2024 42
Boundary condition
Simmetry/Periodicity

Coanda effect

Coanda effect - Symmetry


not allowed

No Symmetry Plane Symmetry Plane

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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy