You are on page 1of 36

 

Computational Fluid Dynamics –


Lecture 8

Prof. Jiyuan Tu
 

Solution Errors--Causes
 Solution error depends on:
 Discretion error -- usually the dominant contribution
 Equation solver error 
 Choice of computational domain
 Implementation of boundary and initial conditions

 Discretization error depends on:


 Grid size (overall refinement
 Grid quality (aspect ratio! ortho"onality
 Grid density (local refinement 
 Discretisation formula (lo#$hi"h order

 Equation solver is: (usually a minor source of solution error 


 can be source of instability (or poor iterative convergence )

RMIT University 2
 

Sources of errors in CFD


(I)
 Discretization error (DE
 Computer round-off error (%&E
 Errors due to physical modelin" (E'
  ()urbulence modelin"
 *uman errors + ine,perience 

Wrong computational domain

Wrong Boundary Condition Garbage in!

 Bad numerical scheme Garbage out!


 Bad computational model 
 Mesh RMIT University 3
 

Sources of errors in CFD


( II )
 DE-)runcation error 
 ∂φ    φ i + − φ i  ∆ x ∂ φ -

 ∂ x  = ∆ x + o   ∂ x 


.
-
i  
/irst order  )runcation error 
  n +.
 ∂φ  φ i − φ i
n
 ∆ x ∂ T 
 ∂t   = ∆ t 
+ o
 ∂ x  
i  

0ocal error  Space The local and global discretization errors


of finite difference method at the third
Global error  time step at a specified nodal point  
)ime
RMIT University 4
 

Sources of errors in CFD


( II )
 %&E++Di"its  SP  4444.666666  4444.6667 
:
1 di"its++Sin"le precision 4444.6666 

.2 di"its++Double precision
 A!"

Example
A!"

:
A simple arithmetic
operation performed
with a computer
in a single precision
using seven significant
digits

RMIT University 5
 

Sources of errors in CFD


( III )
As the mesh or time step size decreases,
the discretization error decreases !
but the round-off error increase!

 3o4 of Computations ↑ E'++0aminar /lo#


5ccumulated %&E   ↑   ++)urbulence /lo#
odelin"
a6or error source in C/D
RMIT University 6
 

  Solution Integrity 

 7hy is predictive reliability important 8  


  Is the computer  (#uman$ #ard%are& infallible8
  7hat should #e e,pect:
 solutions are accurate
  ' can be validated against reliable eperiments
 

Testing Solution
Integrity
 Set up physical e,periment and measure 9ey data
  )pensive$ time*consuming 
 Compare #ith personal e,perience
 +e ,no% %#at to epect (most of t#e time&
 Compare #ith standard cases;
  )quivalent to -alidation/ 
 %ely on theoretical foundation
  )quivalent to -erification/  

RMIT University 8
 

<erification = <alidation (I


  (from Roache, 1999 Verification and Validation in Computational Science and Engineering )

 <erification: (>theoretical frame#or9?


 0#e process of determining if a computational simulation
represents t#e conceptual %orld 
  Provides evidence t#at t#e model is solved rig#t 

 E,amples of <erification errors:


  1nsufficient spatial discreti2ation (i.e. not enoug# grid
 points&
  1naccurate discreti2ation sc#eme

  1nsufficient temporal discreti2ation (i.e. not small enoug#

timesteps&
RMIT University 9
 

<erification = <alidation (II

 <alidation:(>compare #ith standard cases?


 0#e process of determining if a computational simulation

represents t#e real %orld 


  Provides evidence t#at t#e rig#t model is solved 

 E,amples of <alidation errors:


  1nappropriate boundary conditions
  1naccurate turbulence model 

 !omparison %it# unreliable3 inaccurate eperimental

dataad 

RMIT University 10
 

Computational Solution
 C/D is implemented by t#o-sta"e process:
  iscretisation  ‑ !onversion of t#e governing partial
differential equations into a system of algebraic equations
 

  )quation Solver  ‑ iterative solution of t#e algebraic


equations to provide t#e approimate solutions

Overview of the omputational olution "rocess

RMIT University 11
 

(Grid Conver"ence  
 C/D produces an appro,imate solution
 solution error 5 eact solution ** approimate solution
 (Grid Conver"ence 
 epect solution error 5 $ as $ t 5 
 refine grid until t#e solution no longer c#anges
  Consistency@Stability AB (Grid Conver"ence

#terative
 
convergence
 

RMIT University 12
 

Comments -- Conver"ence
 C&3SIS)E3C @ S)5I0I) AB C&3<E%GE3CE
  (-8a )quivalence 0#eorem/&  
 C/D solution obtained on a finite "rid
  9o computer po%erful enoug# to allo% $ t 5 

  'ractical implication:see9 "rid-independent solution ("rid


conver"ence
  i.e. refine t#e grid until solution no longer c#anges
  use local refinement  solution adaption

RMIT University 13
 

Consistency
 Definition: As $ y$ 2$ t 55 $ t#e system of algebraic
equations s#ould recover t#e governing partial differential
equation at eac# grid point 
 Comments: 0est by epanding all nodal values of t#e
dependent variables about t#e control volume centre
 E,ample: ;ass conservation equation 

RMIT University 14
 

  Taylor Series Expansion about


point 
   )qn (<& 55

 !omments:
  As $ y 55  t#e original governing equation is
recovered 
  Sc#eme (<& is (    = $ y= &$ i.e. #alving t#e grid si2e$
reduces t#e truncation error by four 
  )pect solution error to reduce li,e truncation error 

 !ounter**eample:   u>ort**>ran,el
RMIT University sc#eme 15
 

  /inite Grid Solutions (.


 Comments:
 Grid refinement may be restricted by memory si2e or !P? time
 @btain t#e most accurate solution %it# fied 9$ 9B$ 9C 
  Some grids can increase accuracy but increase t#e number of iterations to
convergence of t#e algebraic equation solution
  )pect solution error to follo% truncation error 
 0ypical truncation error:

  (    = 36   &D ∂ E( ρ v&3  ∂ yE F


 &D ∂ E( ρ u&3 ∂  E F  (   y= 36 
0#erefore refine grid  %#ere solution gradients large:
  boundary layers$ up%ind stagnatn points$ for%ard*facing corners

RMIT University 16
 

  /inite Grid Solutions (


 Is the "rid fine enou"h8
 refine grid until important parameter no longer variant 
 eg force against a %all 

Parameter
Value

Number of elements
RMIT University 17
 

E!uation Structure
 ost industrial fluid flo#s involve si"nificant motion
 omentum equations describe three ma6or interactions
  ρφ u ' φ ∂  φ 
     Γ   ! &%$
∂t ∂ x'  ∂x '   ∂x '  

 (convective& transport****************** motion of fluid 


 diffusion********************* (turbulent& eddy diffusivity
 source terms********production of turbulent ,inetic energy
 Is solution accuracy sensitive to discretisation of specific
terms 8  (YES
RMIT University 18
 

"ig#er $rder Interpolation%I&

  !omments:
  So far #ave interpolated "e  =  #    ( " p !" E  ) i.e. depends on local values
  9o% interpolate
assuming -u/ is positive

"e =  #  ( "W  ! " p !" E 


  ) and    "W  =  #  ( "WW  ! "W  !" E  )

RMIT University 19
 

"ig#er $rder Interpolation%II&


 (eneral three point interpolation:
"e = ) [" p &x E  + " E  &x p ] '  ( &x p +  &x E  )
+ ($ − )[" p ( &xW  + && p ) − "W  &x p ] '  ( &xW  +  &x p )   ($%

"W  ∂"' ∂ x = ("e  − "W  '&' 


  and equivalent formula for and  
q  iscretisation Sc#eme @rder (0.).&
  < !entered difference =
   E*pt up%ind =
  E34 ?1!H (4 pt& =
  =3E 4*pt up%ind E
RMIT University 20
 

'ounded "ig#er $rder


Sc#eme
  3umerical dispersion may appear as #i""les
 ounded second order scheme:


 1n (<4& evaluate 

)  = max[,! min( " p !$) ]


H  

+here " p  = (" p − "W  '(" E  − "W  


H

($*
 ounded FIC scheme:
H H H
choose )  = ( − 0" p  '($ − "  p    #or  *'/  < " p < $-,
H H H
= −0" p '($ − "  p   #or  − ,-* < " p < , ($/
= ,-.* other+ise

RMIT University 21
 

Comments
 5bove bounded schemes available in /0FE3)
 ounded schemes more accurate but less robust than po#er
la# scheme
 /or fast iterative conver"ence #ith hi"her accuracy! start from
conver"ed po#er la# solution
 oundin" is effectively introducin" very localised numerical
dissipation
 <ery lar"e literature on bounded schemes (particularly if shoc9
#aves e,pected
 /lu, corrected transport

 )otal variation diminishin" ()<D schemes

 %eference: C5 /letcher! Computational )echniques for

/luid Dynamics! <ol4 II! pp .J2-.1.


RMIT University 22
 

  (nstructured )rid
Discreti*ation
 'o#er-la# (segregated eqns. only
 >ace value obtained from solution to< !onv*iff equation
 Second-order up#ind ( S@? 
 >ace values obtained t#roug# multi*dimensional reconstruction
 FIC scheme
( for quad.3#e. cells and segIated eqns.
  Jig#er*order construction of face values from S@? and

interpolation in mes# direction


  ;ore accurate for structured mes#es t#at are mainly

  flo% aligned 

n   s c<

c7 c  f  

RMIT University 23
 

  Second $rder (p+ind %S$(&


 0inear reconstruction
  provides =nd order accuracy on unstructured grids
 up%ind values obtained from linear$ piece%ise discontinuous
s#ape functions
 limiting  is used to -suppress %iggles/ 

RMIT University 24
 

 Linear ,econstruction
 0inear reconstruction provides:
 better accuracy t#an stencil*based sc#emes
 compatibility %it# arbitrary cell s#apes (tetra#edrals$
triangles&
 improved accuracy on s,e%ed grids
 Comments:
 uses more
information t#an
stencil*based 
 sc#eme
 eample:
diffusion terms
RMIT University 25
 

 Structured s (nstructured
 5ccuracy:
 bot# can ac#ieve =nd rder accuracy for t#e convective terms
 structured grids rely on truncation error reduction
 unstructured grids rely on linear reconstruction
 Economy:
 structured grids lead to fe%er operations in t#e discretised equations
 unstructured grids can cover a domain %it# fe%er cells

 %obustness:
 reliable algorit#ms available for bot# types
 solution adaption on unstructured grids is less li,ely to affect
robustness
 limiters can be introduced for bot# to avoid -%iggles/

RMIT University 26
 

Systematic rocedure for


Solution Integrity -- $erie+
 'roblem definition
  turbulent or laminar flo%K steady or transient L
  is t#e p#ysical model$ eg granular multip#ase$ inaccurate L
 Geometry and "rid
  is t#e imported !A file correct L
 oundary Conditions
  is t#e upstream boundary too close to t#e body L
 Solution method
  is a #ig#er*order sc#eme required L

RMIT University 27
 

)uidelines – roblem
De.nition
Define clearly #hat the problem is
 +#at do you %ant to find outL
 +#at are t#e important parameters you need to inputL
 +#at %ill be t#e defining c#aracteristics of t#e flo%
(eg turbulent #eat transfer L&
 0oo9 for computational efficiencies
 !an you ma,e any simplificationsL
  Jo% muc# of t#e real domain do you need to modelL
 !an you run any simple cases first to test your modelL

RMIT University 28
 

)uidelines – )eometry
 5ny possibility of import8 A!1S 3 1G)S 
 5ny simplifications8
  SymmetryL
  Periodic "oundariesL
 Fse >top do#n? approach to "eometry creation
 Consider dividin" the domain up into smaller sections for
more control over the "rid
 a9e use of 6ournal files K
  Parametric modelling 
  )asy transport of geometry specification files

RMIT University 29
 

)rid /uality
 Grid aspect ratio:  
 A) * +  x
 Comments:
  9eed to c#oose y small if rapid
solution c#ange in t#e y direction 
 #f A)  ./0 or A) 1 2!
 possible reduction in accurac+
 ma+be poor iterative convergence &or divergence$

 Grid distortion: @rt#ogonality (   5 M deg& desirable


 Comments:
 !#oose grid so t#at 4N deg O O <EN deg 
 Grid distortion causes
 loss of accurac+
 reduced rate of iterative convergence

 5rea variation: over t#e computational domain causes reduced


rate of iterative convergence
RMIT University 30
 

  Sudden C#anges in )rid Si*e


  Comments:  
  !ould occur at bloc, boundaries in multibloc, procedure
  !ould occur at duct inlet to a plenum c#amber 
  E,ample:   Mass conser1ation e2uation

  Comments:
 0.). contains diffusion terms (=nd derivs&**destabilising %#en r    <
  
  ;a,e sure grid c#anges slo%ly and smoot#ly
  iscretisation of =nd derivatives requires very smoot# grid c#anges

RMIT University 31
 

)uidelines – 'oundary
Conditions
Does your selection of boundary conditions match the real
#orld conditions 8
 eg ,$ epsilon c#ange rapidly ust do%nstream
  of inlet value specification
 Is it possible to limit the domain size by specifyin" the
 boundary condition in more detail 8
 eg reduce upstream pipe lengt#$ if specify inlet profile
 Fse the >patch? command to fill areas after initialization4
)his is particularly useful for free surface problems4
 5re the boundaries in the correct locations8
 eg are far*field boundaries far enoug# a%ayL

RMIT University 32
 

GuidelinesLSolution Conver"ence
 If the residuals are diver"in":
  isplay t#e contours after initiali2ation. Are t#e initial conditions
correctL
 !#ec, t#e models. ;aybe start as laminar and s%itc# to turbulent
later in t#e solution$ for eample.
 If the residuals initially reduce = then are oscillatory:
  1f flo% is assumed steady$ rerun as a transient problem
 !ould a different type of boundary condition be more stableL (i.e.
outflo% instead of pressure boundaryL&
 !#ec, for %#ic# equation residual is largest 

RMIT University 33
 

Guidelines L Solution 5ccuracy


 *i"her order differencin" schemes are required for
accuracy
  Qun t#e solution first %it# default sc#emes$ t#en s%itc# to #ig#er
order once converged 
 Is the problem #ell-posed 8
   o t#e boundary conditions suit t#e problem L
  1ncorrect specification of nearby boundary conditions
 5dequate "rid resolution 8
  istorted volumes  solution adaption or revise t#e grid 
  Jig# gradients ' coarse grid  solution adaption

RMIT University 34
 

Conclusions
 5ssess C/D solution inte"rity
  p#ysical eperiments
  personal eperience

 t#eoretical foundation

 E,pect computational solution to conver"e to the e,act


solution as ∆,! ∆y! ∆z! ∆t AAB M
(see, Rgrid * independentR solution&
 /inite "rid solutions  
Avoid  *** sudden c#anges in grid si2e
  *** large c.v. aspect ratios
*** grid distortion
  *** large c.v. area variation over domain

RMIT University 35

You might also like