Title: Quantitative techniques in fire safety engineering 5 U01620 710. Computational fluid dynamics CFD fo
1Quantitative techniques in fire safety
engineering 5 (U01620) 7-10. Computational
fluid dynamics (CFD) for fire
- Stephen Welch
- S.Welch_at_ed.ac.uk
- School of Engineering and Electronics
- University of Edinburgh
2CFD for fire lectures (L7-10)
- Scope
- L7 Introduction to CFD
- L8 Introduction to Turbulence Modelling
- L9 Introduction to Combustion Modelling
- L10 Introduction to Radiation Modelling
- General overview and familiarity with some of the
terms - Covering CFD in general but with an eye on fire
applications
3Quantitative techniques in fire safety
engineering 5 (U01620) 7. Introduction to CFD
- Stephen Welch
- S.Welch_at_ed.ac.uk
- School of Engineering and Electronics
- University of Edinburgh
4Introduction to CFD Scope (1)
- Governing equations
- Navier Stokes equations
- Discretisation of transport equations
- Finite Volume Methods (FVM)
- Other methods (FDM, FEM)
- Grids, co-ordinate systems
- Interpolation
- Numerical issues
- Errors and stability
- False Diffusion
5Introduction to CFD Scope (2)
- Pressure correction methods
- Numerical solvers
- Relaxation
- Convergence
- Boundary conditions
- Static pressure boundaries
- Guidance on use of methods
- Example application
6Objective
- Introduction to terminology
- Know where to look
- Know what questions to ask!
- Grid sensitivity
- Interpolations schemes
- Boundary treatments
- Unstructured
- Newtonian fluid
7What is CFD?
- Most general sense
- All aspects of computer-based simulation of fluid
flow phenomena - More specifically
- Computer simulations solving fluid flow
conservation equations - Using established numerical methods for
second-order partial differential equations
8Whats the trouble?
- Partial differential equations
- Non-linear in all real situations
- Due to convective acceleration
- Acceleration associated with change of velocity
over position - Part of cause of turbulence
- Hard to solve
- Turbulence
- Time-dependent chaotic behaviour
- Effect of time dependent and convective
acceleration - Due to inertia of fluid as a whole
- Navier-Stokes equations model turbulence properly
9What do we need it for?
10What do we need it for?
11What do we need it for?
12Navier Stokes system of equations
- Continuity
- Momentum
- Stress tensor
- Energy
- NB - repeated subscript implies summation
13Navier Stokes system of equations
- History
- Claude-Louis Navier (1785-1836)
- French engineer and physicist
- George Gabriel Stokes (1819-1903)
- Irish mathematician and physicist
- 1822
- Established by Navier
14Continuity
? - density u, v, w - velocities
15Momentum equations
- Momentum
- Viscous stress tensor
- P pressure
- D dilation term
- ? viscosity
16Energy equation
17Governing equations - Generalised
- Generalised
- ? general unknown
- ? diffusion coefficient
- s Schmidt/Prandtl number
18Generalised transport equation
- Unknown variable, ?
- ? is a diffusion coefficient
- S is a general source term
- For continuity, ? 1, ? 0, S0
- For momentum, ? u, v, w, ?f(µ), S
- For energy, ? e (or h), ?k/cp, , Sradiation
19Notations
20Notations
- Vector notation
- Tensor notation
21Newtonian fluids
- Stress-strain curve linear and goes through O
- e.g. water
- flows, irrespective of forces on it
- Viscosity f(p,T) only!
- cf. Non-Newtonian
- Sand
- Non-drip paints
- Oobleck (starch-water mix solid if you squeeze
it) - Glurch (starch-glue-colouring polymerizes)
22Special forms
- For low Mach numbers, pressure-density coupling
can be neglected - Incompressible
- Density varies with temperature only
- Pressure effects tiny by comparison, of order
0.01 - Boussinesq approximation
- Euler equations
- Remove viscosity terms
- Not relevant to fire flows
23Finite volume method (FVM)
- Integrate the generalised transport equation
- Volume, ?
- Surface, S
- Foundation of the method
- Everything that goes in must come out!
- Conservation properties guaranteed
- Complex geometries are easily accommodated
24Other methods Finite Difference
- Finite difference method (FDM)
- Easy to formulate
- Mesh must be structured, i.e. regular
- Curved meshes transformed to orthogonal
- Gradient boundary conditions can only be
approximated, not enforced - FVM is an integral version of the FDM
- Chung (2002) shows how FVM can be formulated from
FDM
25Other methods Finite Element
- Finite element method (FEM)
- Formulation requires mathematical rigor
- Complex geometries can be easily accommodated
- Unstructured meshes allowed
- No need to transform curved meshes
- Gradient boundary conditions enforced exactly
- FVM is a special case of FEM weighted residuals
- weighting function 1 within cell volume, 0
elsewhere - Chung (2002) shows how FVM can be formulated from
FEM
26Discretisation
- To solve the integral form of generalised
transport equations first represent field by
discrete values - Nodes in a computational grid
- Assemble algebraic equations which can be solved
for the nodal values - Other values are undefined and if needed have to
be obtained by interpolation
27Discretisation - Example
- For example, continuity (2D steady-state)
- In finite difference form
28Discretisation - Cell location
- Two principal cell definition methods
- Grid based (staggered)
- Nodal value stored at intersection of grid lines
- Control volume surfaces defined midway between
grid lines - Cell centred (co-located)
- Construct control volumes and assign central
nodes - Intuitively consistent with integral approach
- Assume hereafter
j
29Discretisation Grid structure
30Discretisation Grid structure
- Two types of grid structure
- Structured
- Physical geometry mapped to a regular
computational space - Typically accessed via conventional array indices
representing physical coordinates - Less general, but assume hereafter for simplicity
- Unstructured
- Individual cells may be arbitrarily subdivided
- Control volumes related to each other using an
array of neighbour pointers - Well suited to complex geometries
- Accuracy of spatial derivatives can be diminished
- Program data structure complex, not easy to
vectorise
31Discretisation Coordinate system
- Two structured grid coordinate systems
- Curvilinear
- Most general
- Can deal with more complex geometries
- Equations far more complex and can be
non-conservative - Computational cost of additional terms
- Hard to make the mesh!
- Cartesian
- Mutually orthogonal unit vectors
- Easier to understand
32Discretisation Transport Equation
- Cartesian coordinates
- A is cell face area
- V is cell volume
- Assumes variables are functions of normal
direction only, for surface integrals - Assumes variables are constant in cells, for
volume integrals - Remaining unknowns found by interpolation
33Interpolation
- Need a method of approximating the convective and
diffusive fluxes at cell faces - An interpolation technique relates value to nodes
- At first sight would seem best to use linear
interpolation, i.e. central differencing - Stable for 2nd derivatives (diffusion terms)
- May be unstable for 1st derivatives (convection
terms) - Particular problem at high Reynolds numbers
34Interpolation Example
- Considering 1D convection/diffusion equation
- Where
- G mass flow
- D diffusive flow
- E, P, W are nodal values
35Interpolation Central Differencing
- Using linear interpolation for convective terms
- Assuming uniform mesh spacing
36Interpolation Central Differencing
- Algebraic equations can be solved if coefficient
matrix is diagonally dominant - All coefficients need to be same sign (i.e.
positive) - AP must be greater than neighbour coefficients
- Diffusion coefficients unconditionally positive
- Mass flux terms may be negative if
- Peclet number is a grid Reynolds number
- Only satisfied if ?x small
37Interpolation Upwind Differencing
- Allow flow to be influenced only by conditions
upstream (pig pen theorem) - All coefficients unconditionally positive
- Diagonal dominance
- Unconditionally stable
38Interpolation Hybrid Differencing
- Upwind is stable but can be inaccurate for
non-convection dominated flows - Use Central up to Peclet number limit and Upwind
thereafter - Good choice for low speed flows
39Errors and stability
- Two sources of numerical error
- Computer round-off
- Truncation errors
- If not limited, solution may be
- Unstable
- Spurious oscillations
40Perturbation analysis
- Convection-diffusion equation
- AP lumps all terms related to nodal variable,
- S is for neighbours
- For stability errors must decay
- AP lt 0
- Implies negative feedback
- For diffusion term
- For convection term
- Hence no damping, and errors can arise
41False diffusion
- First-order upwind schemes have a second-order
truncation error - Substituting back into convection term truncation
error contributes additional diffusion
coefficient of - Need to be sure this term is ltlt real diffusion
- Very dependent on bulk flow direction
- Errors worst when grid lines at 45o to bulk
convective flow - Take care in setting up problem
42Interpolation higher order
- Higher-order schemes reduce truncation error
- Expanding the second-order truncation error
- Problems
- Not conservative in FVM
- Can be unstable (no damping effect from
truncation term!) - TVD flux-limited second-order scheme (Van Leers)
- Third-order scheme, QUICK
- Conservative, but more cumbersome and may be
unstable
43Interpolation higher order
- Higher-order schemes inherently
- More unstable
- Overshoot where there are steep gradients
- Fitting a curve with a polynomial of finite order
- Impossible to get an exact match at corners
- Can mitigate by adjusting diffusion
- Introducing artificial diffusion
- Problem is in knowing how much to add!
- Combining higher and lower order schemes
- Using a blending factor
- Shown to work but at additional computational cost
44Interpolation summary
- Define normalised variables
- Where
- C is downstream node
- D is upstream node
- U is next upstream node
- Hence Giving
45Discretisation Scalar Transport
- Expand into form suitable for numerical solution
- Each cell face term substituted from appropriate
differencing scheme - Mass flux linear
- Diffusion central
- Convection - upwind
46Discretisation Scalar Transport
- Algebraic equation for steady-state flow
- Coefficients, A, contain contributions from
- Convection terms
- Diffusion terms
- Transported source term, S, may be non-linear
- Chemical rates
- Radiative loss (?T4)
- Hence requires special attention linearisation
- Time splitting (or lagging)
- Newton-Raphson
47Discretisation Momentum
- Analogous procedure to scalar transport equation
- Equations are all non-linear and closely coupled
- Discretisation of pressure derivative term gives
rise to unique problem - Pressure decoupling
- pi,j cancels so there is no link to nodal value
- Chequer boarding
- Two solutions
- Staggered grid
- Momentum interpolation
48Staggered Grid
- Exploits fact that there is no need to use same
control volumes for all variables - Store velocities on faces
- More complex code
- especially for boundary conditions!
49Colocated Grid
- Exploits efficiencies in storing all variables at
same place (cell centre) - Can use same code routines for all variables
- Consistent with curvilinear grids
- Relies on an interpolation procedure
- Velocity terms modified by a third-order
derivative of pressure (Rhie Chow, 1982) - Artificial damping thereby introduced
50Pressure equation
- Pressure is derived from an equation of state
- Variations are small, but still important in
driving flow - Fundamental problem in solving discretized
equations - Velocity and pressure in momentum equation
interact - equations are very tightly coupled!
- Concept of pressure correction
- Most popular for incompressible flows
51Pressure correction
- Iterative procedure for solving momentum
transport equations - Guess a pressure field
- Solve momentum equations to obtain approximate
velocity field - Correct the approximate velocity and pressure
fields such that continuity is satisfied - SIMPLE (Patankar Spalding)
- Correction to velocities obtained by subtracting
approximate and exact pressure equations, i.e.
determining pressure correction terms
52Pressure correction
- Improved methods
- SIMPLEC (SIMPLE Consistent)
- Faster convergence
- Many other variants (subject of a lot of
research) - Time-dependent algorithms
- SIMPLER (SIMPLE Revised)
- PISO (Pressure Implicit Split Operator)
53Numerical solvers
- Direct solution of full matrix of solution
variables is computationally intractable, so - Segregate solution variables and solve each in
turn - Subdivide computational space
- Coefficient matrix has a diagonal structure
- Due to each node referencing only a small number
of neighbours - Allows some memory savings
54Relaxation and convergence
- Equations need to be under-relaxed
- Solution would diverge
- Not too much, or solution may freeze!
- Convergence assessed by examining residuals
- Normalised numerical errors
- Generally require progressive reduction in
errors, stability of values and achieving certain
minimum error (e.g. 0.1 mass imbalance)
55Boundary conditions
- Require values on all boundaries for solution
- Fixed values at inlets
- Dirichlet boundary conditions
- Gradients elsewhere
- Neumann boundary conditions
- To avoid over constraining a problem
- Mirror symmetry boundaries
- Used to reduce size of simulation domain
- Half
- Quarter
56Guidance on use of codes
- Cox Kumar (2003)
- Resist temptation to do 2D simulations
- Choose mesh appropriate to main features of flow
- Keep cell aspect ratio lt50
- Demonstrate insensitivity to mesh resolution
- Try to use higher order schemes to improve
accuracy - Demonstrate insensitivity to numerical timestep
- Solved variable residuals lt1
- Residuals progressively decreasing (may
oscillate) - Solved variable values at monitoring points
stable - Global heat and mass balance should be gt99
57Advanced fire applications
- Distributed burning
- Fires are often ventilation controlled and
combustible volatiles may finally oxidise well
outside an enclosure - Heat source models are poor representations
- Smoke concentrations
- Strong coupling of smoke production, radiative
heating and combustion - Temperature-dependent material properties
- Extending up to fire temperatures!
- Moisture/intumescent effects
58Pros and cons of CFD
- Pros
- Fine detail
- High accuracy
- Versatile
- Less assumptions
- Complex geometries
- Transient phenomena
- Fully coupled
- Cons
- Problem setup mesh
- Long simulation times
- Hardware requirement
- Expertise requirement
- Post-processing burden
59References
- Chung, T.J. Computational Fluid Dynamics,
Cambridge University Press, 2002 - Cox, G. Combustion Fundamentals of Fire,
Academic Press, 1995 (chapters 1, 6) - Moss, J.B. Turbulent diffusion flames, chapter
4 in above, 1995 - Cox, G. Kumar, S. Modelling enclosure fires
using CFD, in SFPE Handbook 3rd edition, 2003 - http//www.cfd-online.com/Wiki/
60Codes
- CFD codes list
- http//www.fges.demon.co.uk/cfd/CFD_codes.html
- Fire codes
- http//www.firemodelsurvey.com/
- SOFIE RANS code
- http//www.hull.ac.uk/php/331346/sofie.htm
- NIST Fire Dynamics Simulator (FDS) LES code
- http//fire.nist.gov/fds/