CFD Slide Set
CFD Slide Set
www.tuwien.at
What is Computational Fluid Dynamics
• Behavior of fluidic systems
• Experimental investigations
• Numerical approaches
• Analytical solutions
• Numerical representation CFD
• Combination of Physics and Numeric
https://en.wikipedia.org
• Just time resolved
• E.g. balance calculations in a system
Details and computational cost
• Process simulation
•
https://en.wikipedia.org
Time resolved
• One space dimension also resolved
• Resonably fast and moderate details about the system
• Suitable for complex industial plants and pilots
@Bahram Haddadi
• Fully space resolved
• Sutable for detailed systems analysis
@Bahram Haddadi
An introduction to computational fluid dynamics – The finite volume method – 2nd Edition, Versteeg and Malalasekera 2007
𝜕(𝜌𝜑)
+ ∇ ∙ 𝜌𝜑𝒖 = ∇ ∙
𝜕𝑡
Time derivative
𝜕(𝜌𝜑)
+ ∇ ∙ 𝜌𝜑𝒖 = ∇ ∙ 𝛤∇𝜑 + 𝑆
𝜕𝑡
Convection term
𝜕(𝜌𝜑)
+ ∇ ∙ 𝜌𝜑𝒖 = ∇ ∙ 𝛤∇𝜑 + 𝑆𝜑
𝜕𝑡 Diffusion term
𝜕(𝜌𝜑)
+ ∇ ∙ 𝜌𝜑𝒖 = ∇ ∙ 𝛤∇𝜑 + 𝑆𝜑
𝜕𝑡 Source term
An introduction to computational fluid dynamics – The finite volume method – 2nd Edition, Versteeg and Malalasekera 2007
𝜕 𝜌𝜑
+ 𝛻 ∙ 𝜌𝜑𝒖 = 𝛻 ∙ 𝛤𝛻𝜑 + 𝑆𝜑
𝜕𝑡 www.en.wikipedia.org
𝜕
න න 𝜌𝜑 𝑑𝑉 𝑑𝑡 + න න 𝒏 ∙ 𝜌𝜑𝒖 𝑑𝐴𝑑𝑡 = න න 𝒏 ∙ 𝛤𝛻𝜑 𝑑𝐴𝑑𝑡 + න න 𝑆𝜑 𝑑𝑉 𝑑𝑡
∆𝑡 𝜕𝑡 𝐶𝑉 ∆𝑡 𝐴 ∆𝑡 𝐴 ∆𝑡 𝐶𝑉
An introduction to computational fluid dynamics – The finite volume method – 2nd Edition, Versteeg and Malalasekera 2007
www.manchestercfd.co.uk/post/all-there-is-to-know-about-different-mesh-types-in-cfd
www.manchestercfd.co.uk/post/all-there-is-to-know-about-different-mesh-types-in-cfd
@Bahram Haddadi
• Initial values will be replaced by newly calculated values
• Better the initial values the faster the convergence
• Value is assigned to the center of every cell
• A uniform value for the whole field
• Individual value per cell
• Patching fields
• OpenFOAM®: setFields
• Multi-solver solutions
@Bahram Haddadi
• Boundary conditions will connect the simulation domain with its
surroundings
• Each property interaction with outside the domain
• The values specified are located at the boundary faces of the
domain
• Three main types of boundary conditions
• Dirichlet: fixed value on the boundary
• Neumann: fixed gradient on the boundary
• Mixed: combined fixed value and gradient
• Most boundary conditions are either steady state or transient
• Ill-defined boundary conditions
• Non-convergence
• Incorrect results
• Time derivative
𝜕𝜌𝜑 𝜌𝑃𝑛 𝜑𝑃𝑛 − 𝜌𝑃0 𝜑𝑃0
• Integrating over volume න 𝑑𝑉 ≈ 𝑉𝑃
• Euler implicit scheme 𝑉 𝜕𝑡 ∆𝑡
• Convection term
• Integrating over volume න 𝒏 ∙ 𝜌𝜑𝒖 𝑑𝐴 ≈ 𝒏 ∙ 𝐴𝜌𝒖 𝑓 𝜑𝑓 = 𝐹𝜑𝑓
𝐴 𝑓 𝑓
• Applying Gauss‘s theorem
• 𝜑𝑓 to be calculated schemes
• Diffusion term
• Similar to convection term
න 𝒏 ∙ 𝛤𝛻𝜑 𝑑𝐴 = 𝛤𝑓 𝒏 ∙ 𝛻𝑓 𝜑 𝐴𝑓
𝐴 𝑓
• 𝛻𝑓 𝜑 gradient at the face
𝜑𝑁 − 𝜑𝑃
• Second order accurate d orthogonal between P and N 𝒏 ∙ 𝛻𝑓 𝜑 =
𝒅
166.049 | Summer 2023 19
Common Discritization Schemes
@Bahram Haddadi
• First Order Upwind
𝜑𝑒 = 𝜑𝑃 𝑖𝑓, 𝐹𝑒 > 0
𝜑𝑒 = 𝜑𝐸 𝑖𝑓, 𝐹𝑒 < 0
@Bahram Haddadi
𝜑𝐸 + 𝜑𝑃 𝜑𝑃 + 𝜑𝑊
𝜑𝑒 = , 𝜑𝑤 =
2 2
@Bahram Haddadi
6 3 1
When 𝐹𝑤 > 0, φ𝑤 = φ𝑊 + φ𝑃 − φ𝑊𝑊
8 8 8
@Bahram Haddadi
control volume flux through the same face
• Boundedness: ensures the solution remains within certain bound limits and
guarantees the solution does not exhibit unphysical or unrealistic behavior
• Transportiveness: Peclet number, 𝑃𝑒. It measures the relative strengths of
convection, 𝑁𝑐𝑜𝑛𝑣 and diffusion, 𝑁𝑑𝑖𝑓𝑓 .
First-order Second-order
upwind upwind
8×8
False diffusion: a multidimensional phenomenon and it
occurs when the flow is not perpendicular to the grid
@Bahram Haddadi
lines. It is a numerically introduced diffusion and arises in 64 × 64
convection dominated flows
Numerical diffusion
Conser Trans-
Scheme Bounded Accuracy Remarks
-vative portive
Include false diffusion if
Upwind Unconditionally the velocity vector is not
Yes First order Yes
bounded parallel to one of the
coordinate directions
Central Conditionally Unrealistic solutions at
Yes Second order No
Differencing bounded⃰ large Pe number
Less computationally
Unconditionally stable. Can give small
QUICK Yes Third order Yes
bounded undershoots and
overshoots
• PIMPLE
• Hybrid SIMPLE/PISO
• PISO internal loop with SIMPLE External loops
• Higher stability and reliability for bigger time steps
• Coupled algorithm
• Discritized pressure and velocity equations are solved in a single matrix
• Implicit coupling between pressure and velocity
• Computationally more expensive
• More stable for low quality meshes or large time steps
http://home.iitk.ac.in/~aksaha/QIP_Comp_Turb/background.htm
• Characterized by a wide range of eddy sizes
• Fully resolve these eddies numerically
• Obtain a full profile of the turbulent flow field
• Computationally very expensive
• Hence we require a turbulence model
• Turbulence modeling
• Important feature is averaging
• Scales of the flow that are not resolved by the grid
models need to be applied
• Turbulence resolving
• Reynolds Average Navier Stokes (RANS)-based models
• Large eddy simulations (LES)
• Direct Numerical Simulation (DNS)
@Bahram Haddadi
• Convolution of a function with a filtering kernel
• Large eddies explicitly resolved by the grid
LES
• Small eddies handled implicitly by sub grid-scale model (SGS)
• most practical (and commercial) implementations of LES use
the grid itself
• No explicit filtering is needed
• Sub grid-scale turbulence models usually employ the
Boussinesq hypothesis
• Turbulent stresses are related to the mean velocity gradients
https://en.wikipedia.org/wiki/Apparent_viscosity
• Relationship between a fluid’s shear stress and shear rate when
subjected to mechanical stress
• Types of viscosity
• Dynamic (absolute) viscosity: fluid’s internal resistance to flow
• Kinematic viscosity: ratio of dynamic viscosity to density
• Apparent (steady shear) viscosity: shear stress ratio to shear rate
• Fluids
• Newtonian
• Non-Newtonian
• Viscosity not constant (e.g. shear-rate dependent)
@Bahram Haddadi
• Separated: the boundary between phases is described in detail
• Mixed: dispersed particles as well as semi-continuous interfaces exist together
• Dispersed: one phase is dispersed in a continuous phase
• Modeling approaches
• Lagrangian
• Tracking individual point particles during their movement
• More suitable for dispersed configuration
• Studying particle flows, e.g. in Discrete Element Method (DEM)
•
@Bahram Haddadi
Eulerian
• Observing fluid behavior in a given control volume
• More suitable for fluid-fluid multiphase flows
• CFD approaches such as Euler-Euler and Volume of Fluid
@Bahram Haddadi
• Load distribution
• Shared memory: the whole system seen as a single computer
• Distributed memory: individual computers connected through network
each seen as a computational node
Shared Memory Multiprocessor Distributed Memory Multicomputer
Data is saved in a global memory that can Each computer has a local memory and a
Memory
be accessed by all processors processor can only access its local memory
Message is sent explicitly from one
The sender processor simply needs to
Data transfer computer to another using a message
write the data in a global variable and the
between processors passing library, e.g. Message Passing
receiver can read it
Interface (MPI)