CFD Best Practice Guidelines: A process to understand CFD results and establish Simulation versus Reality Judd Kaiser ANSYS Inc. judd.kaiser@ansys.com 2005 ANSYS, Inc. 1 ANSYS, Inc. Proprietary
Overview Definition of sources of error in CFD Best practice guidelines Validation example: Impinging jet Demonstration example: Cavitation in fuel injection system 2
Sources of Error Numerical errors Round-off error Iteration error Solution error Spatial discretization Temporal discretization Model errors Application uncertainties User errors Software errors Software error? Model error? User error? Numerical Error? 3
Numerical: Round-Off Error Error due to machine round-off Procedure: Define target variables Calculate with single-precision version Calculate with double-precision version Check: Compare target variables Grid aspect ratio Large differences in length scales Large variable range 4
Numerical : Iteration Error Error due to level of convergence Differences between current and infinitely converged solution, on same mesh Procedure: Define target variables (head rise, efficiency,...) Plot target variables vs convergence Check: Adequate convergence: when target variables become independent of convergence criterion For global balances, monotonic convergence 5
Iteration Error Relative error: 0.22% 0.02% Target Variable Convergence criterion R max =10-3 Iteration 36 R max =10-4 Iteration 57 R max =10-5 Iteration 103 6
Quality : Solution Error Error due to mesh resolution Difference between current and infinitely fine mesh Procedure: Minimize by using 2 nd order numerics 1 st order numerics: error is ½ when grid nodes x 2 2 nd order numerics: error is ¼ when grid nodes x 2 Check: Error indicator: solution differences between two different numerics schemes, same mesh (easy) Error level: solution differences between two different meshes, same numerics scheme (hard) 7
Test Case VAL01 Impinging jet flow with heat transfer 2-D, axisymmetric Grids: 50 50 800 800 ANSYS CFX SST turbulence model Discretization schemes: Upwind differencing Upwind differencing + second order correction Target quantity: Heat transfer Maximum Nusselt number 8
Solution Error Example 200 190 Scheme 1 Scheme 2 Nu_max 180 170 160 150 0 0.005 0.01 0.015 0.02 1/N 9
Error Estimation Richardson extrapolation Error estimated using: E = f f 1 2 ( r p 1) Practically: Grids must be in the asymptotic range Use three different mesh densities to confirm trends f : Fine grid solution 1 f : Coarse grid solution 2 r: Refinement ratio p: Truncation error order 10
Model Errors Model errors remain, even after all numerical errors have become insignificant Inadequacies of mathematical models: Base equations (Euler, RANS, steady, unsteady ) Turbulence models Multi-phase flow models, Difference between good data and calculations Check only after numerical errors have been quantified 11
Model Error: Example 250 200 150 100 Experiment 1st order, Grid 1x 1st order, Grid 2x 1st order, Grid 4x 1st order, Grid 8x 1st order, Grid 16x 50 0 0,000 0,050 0,100 0,150 12
Application Uncertainty Systematic errors: Approximations of geometry Component vs. machine Approximation of boundary conditions Turbulence quantities Profiles vs. constant values Approximation of unsteady-state flow behaviour Fluid and material properties Setup error Uncertainty in comparison data Discrepancies remain, even if numerical and model errors are insignificant 13
User Errors Examples: Geometry oversimplification Poor geometry, mesh generation Incorrect boundary conditions (locations, values) Selection of incorrect models Incorrect solver parameters Acceptance of non-converged solutions Avoidance: Training, documentation Solve relevant validation cases Process management: adhere to best practice guidelines Increasingly, software automation 14
Software errors Examples: Coding bugs Errors in interface or documentation Incorrect support information Avoidance: Automated testing Validation and verification cases QA guidelines 15
Demonstration example The original presentation included a summary of a CFD study performed by Robert Bosch, involving cavitation in a diesel fuel injector All images and data were property of Robert Bosch, and have been removed from this presentation 16
CFD Simulation Multiphase model Homogeneous model Cavitation: Rayleigh-Plesset model Isothermal Turbulence model SST model with automatic wall treatment Detached Eddy Simulation (DES) 17
Simulation Timeline Validation Throttle Flow 2-D steady state simulation 3-D steady state and transient simulation 3-D DES simulation 18
Validation: Circular Throttle Mass Flow [g/s] 12 11 10 9 8 7 6 5 d gap = 0.424 mm d in/out = 1.0 mm 0 20 40 60 80 Pressure Drop [bar] Data Coarse grid Medium grid Fine grid 19
Summary of RANS 2D steady state: Over-simplification 3-D simulation: Steady state: Cavitation inside the throttle Transient: Same as steady state Need to resolve the large scale turbulence LES: works well for free shear layer but computationally expensive in the wall layer DES model: hybrid of RANS in the near field and LES in the free shear layer 20
Overview Definition of sources of error in CFD Best practice guidelines Validation example: Impinging jet Demonstration example: Cavitation in fuel injection system References: Roach, P.J., Verification and Validation in Computational Science and Engineering, Hermosa, 1998 ERCOFTAC Best Practice Guidelines www.ercoftac.org 21