Exploring Alternative Approaches to CFD
description
Transcript of Exploring Alternative Approaches to CFD
![Page 1: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/1.jpg)
Exploring Alternative Approaches to CFD
Dimitri MavriplisDept.of Mechanical Engineering
University of Wyoming
Laramie, WY
![Page 2: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/2.jpg)
Workshop Statement
• Barriers to Progress and Technology Drivers– Misguided Government and Industry Policies
• NASA: No base R&D budget, mission/vehicle emphasis• Boeing: Lack of interest in technology/internal expertise
– Dell Computer Corp.
– Multiple Scales• Anisotropy, Solver Stiffness, Mesh Refinement, Turbulence
– Software Complexity• MDO, multiphase flow front tracking, education
![Page 3: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/3.jpg)
Technology Drivers
• High-Order Accuracy (Discontinuous Galerkin)– Attempt to mitigate multiple-scale issue
– Large gains possible through more efficient approximations (temporal and spatial)
– Requires efficient solvers to realize gains
– More complex software
• Low-Order Accuracy: Simpler Models (Lattice Boltzmann)– Simpler software
– More complex physics: Mesoscales
– Also requires efficient solvers
![Page 4: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/4.jpg)
CFD Accuracy for Drag Prediction (AIAA workshop results)
• Current simulations suffer from :– Discretization errors– Physical Modeling errors
• Apparently, one does not dominate the other (still)
![Page 5: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/5.jpg)
• Apparently, one does not dominate the other (still)• Grid convergence (or lack thereof) from: AIAA-2003-3400: CFD Sensitivity Analysis of a Drag Prediction Wing/Body Transport Configuration,
E.M. Lee-Rausch, P. G. Buning, J. H Morrison, M. A. Park, C. L. Rumsey and D. J Mavriplis
![Page 6: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/6.jpg)
Higher-Order Methods
• Simple asymptotic arguments indicate benefit of higher-order discretizations
• Most beneficial for:– High accuracy requirements– Smooth functions
![Page 7: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/7.jpg)
Motivation
• Higher-order methods successes– Acoustics– Large Eddy Simulation (structured grids)– Other areas
• High-order methods not demonstrated in:– Aerodynamics, Hydrodynamics– Unstructured mesh LES– Industrial CFD– Cost effectiveness not demonstrated:
• Cost of discretization• Efficient solution of complex discrete equations
![Page 8: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/8.jpg)
Motivation
• Discretizations well developed– Spectral Methods, Spectral Elements– Streamwise Upwind Petrov Galerkin (SUPG)– Discontinuous Galerkin
• Most implementations employ explicit or semi-implicit time stepping– e.g. Multi-Stage Runge Kutta ( )
• Need efficient solvers for:– Steady-State Problems– Time-Implicit Problems ( )
xt
xt
![Page 9: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/9.jpg)
General Idea• Use element Jacobi as Smoother for p-
multigrid solver (AIAA-2003-3989: Atkins, Helenbrook and Mavriplis)
Solution of linear (2D) wave equation using 2 grid p-MG system for p=3 (Mavriplis and Atkins, 2002)
![Page 10: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/10.jpg)
Multigrid Solver for Euler Equations
• Develop efficient solvers (O(N)) for steady-state and time-implicit high-order spatial discretizations
• Discontinuous Galerkin– Well suited for hyperbolic problems– Compact-element-based stencil– Use of Riemann solver at inter-element boundaries– Reduces to 1st order finite-volume at p=0
• Natural extension of FV unstructured mesh techniques
• Closely related to spectral element methods
![Page 11: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/11.jpg)
Discontinuous Galerkin (DG)
Mass Matrix
0
iiji
ij uKt
uM Nj ,...,2,1
ijM
ijijijijij FFFEK 321Spatial (convective or Stiffness) Matrix
ijE
ijFK
Element Based-Matrix
Element-Boundary (Edge) Matrix
![Page 12: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/12.jpg)
Steady-State Solver
• Kijui=0 (Ignore Mass matrix)
• Block form of Kij:
– Eij = Block Diagonals (coupling of all modes within an element)
– Fij = 3 Block Off-Diagonals (coupling between neighboring elements)
Solve iteratively as:
Eij (ui n+1 – ui
n ) = Kij uin
![Page 13: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/13.jpg)
Steady-State Solver: Element Jacobi
Solve iteratively as:
Eij (ui n+1– ui
n) = Kij uin
uin+1 = E-1
ij Kij uin
Obtain E-1ij by Gaussian Elimination
(LU Decomposition)10X10 for p=3 on triangles
![Page 14: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/14.jpg)
DG for Euler Equations
• Mach = 0.5 over 10% sin bump
• Cubic basis functions (p=3), 4406 elements
![Page 15: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/15.jpg)
Entropy as Measure of Error
• S 0.0 for exact solution
• S is smaller for higher order accuracy
![Page 16: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/16.jpg)
Error Convergence for Bump Case
• P=1: Final Slope: 1.26• P=2: Final Slope: 2.8• P=3: Final Slope: 3.2• Based on L2 norm of entropy
H-convergence
•382 elements
•1500 elements
•2800 elements
•4406 elements
![Page 17: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/17.jpg)
Element Jacobi Convergence
• P-Independent Convergence• H-dependence
![Page 18: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/18.jpg)
Improving Convergence H-Dependence
• Requires implicitness between grid elements
• Multigrid methods based on use of coarser meshes for accelerating solution on fine mesh
![Page 19: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/19.jpg)
Spectral Multigrid
• Form coarse “grids” by reducing order of approximation on same grid– Simple implementation using hierarchical basis
functions
• When reach 1st order, agglomerate (h-coarsen) grid levels
• Perform element Jacobi on each MG level
![Page 20: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/20.jpg)
Hierarchical Basis Functions
• Low order basis functions are subset of higher order basis functions
• Low order expansion (linear in 2D):– U= a11 + a22 + a33
• Higher order (quadratic in 2D)– U=a11 + a22 + a33 + a44 + a55 + a66
• To project high order solution onto low order space:– Set a4=0, a5=0, a6=0
![Page 21: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/21.jpg)
Hierarchical Basis on Triangles
• Linear (p=1): 1=1, 2=2, 3=3
• Quadratic (p=2):
• Cubic (p=3):
![Page 22: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/22.jpg)
Spectral Multigrid
• Fine/Coarse Grids contain same elements
• Transfer operators almost trivial for hierarchical basis functions
• Restriction: Fine to Coarse– Transfer low order (resolvable) modes to coarse level exactly
– Omit higher order modes
• Prolongation: Coarse to Fine– Transfer low order modes exactly
– Zero out higher order modes
![Page 23: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/23.jpg)
Euler Equations
• System of Non-Linear Equations• Element Jacobi and Spectral MG Implemented for Euler
Equations– FAS Multigrid (non-linear MG)– Possible tradeoffs using Linear MG
• Requires storing entire Jacobian• Reduced cpu time (freeze Jacobian)
• Bump and Airfoil Test Cases– Includes Curved Surface Elements– Necessary for maintaining accuracy
![Page 24: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/24.jpg)
Element Jacobi Convergence
• P-Independent Convergence• H-dependence
![Page 25: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/25.jpg)
Multigrid Convergence
• Nearly h-independent
![Page 26: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/26.jpg)
Future Multigrid Work
• Reduced complexity of element Jacobi
• Develop implicit time integration scheme– High-order time discretization– Multigrid driven implicit solver
• H-P Adaptivity in Multigrid Context
• Towards a General Multi-resolution Framework
![Page 27: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/27.jpg)
Using Alternate Models: The Lattice Boltzmann Approach
• Lattice Boltzmann methods increasingly popular– Origins from Lattice Gas Automata (LGA) methods– LBM abandons particle formulation in favor of
particle distribution function approach• Mesoscale Method (neither macro, nor molecular)• Shown to converge to Navier-Stokes equations in
macroscopic limit• Facilitates physical modeling (and software complexity)
– Front capturing in place of fitting– Physics incorporated at mesoscale level (collision term)
![Page 28: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/28.jpg)
Front Capturing with LBM
• c/o M. Krafczyk, TU Braunschweig, Germany
![Page 29: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/29.jpg)
Governing Equations of Fluid Dynamics
• Statistical Mechanics Description (Meso-Scale)– Boltzmann Equation (BGK approximation)
– f=f(x, ,t): Distribution function in velocity space– = speed of gas molecules– Linear convection terms– Non-Linear Collision (source) term (local)
),(1
. EQffCft
f
![Page 30: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/30.jpg)
Lattice Boltzmann• 9 velocity model:
– Velocities allow exact jump to neighboring grid point– Proven mathematically to reduce to Navier-Stokes equations in
asymptotic limit
• Obtain macroscopic values as:
0x
),(),(8
0
txfetxua
aaa
),(),(8
0
txftxa
aa
![Page 31: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/31.jpg)
2 Step LBM Implementation
• Implemented as Collision step followed by advection step (reminiscent of LGA method)
),(),(1
),(),(*ii
eqaii
naiiaiia yxfyxfyxfyxf
n
),(),( *21
1iiaaiai
na yxfheyhexf
Collision:
Advection:
• Collision step is entirely local : is a non-linear function of the
•Advection: Shift in memory with no flops!
),( iieq
a yxf),( iia yxf
![Page 32: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/32.jpg)
Motivation
• Formally: 2nd order accurate in space
• Formally: 1st order accurate in time– Remarkable delivered accuracy in many cases– Numerically efficient
• Local collision term
• Linear convection term: shift operator with no flops!
• Corresponds to explicit time-stepping approach– Notoriously inefficient solution strategy
![Page 33: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/33.jpg)
LBE for 2D Driven Cavity
• Streamlines for 129 x 129 grid (Re=100)
![Page 34: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/34.jpg)
Solution of Steady-State LBE
• 16,000 time steps to machine zero on 33x33 grid
![Page 35: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/35.jpg)
Solution of Steady-State LBE
• 16,000 time steps to machine zero on 33x33 grid• 4 to 5 times slower on 129x129 grid
![Page 36: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/36.jpg)
Solution of Steady-State LBE
• 16,000 time steps to machine zero on 33x33 grid• 4 to 5 times slower on 129x129 grid• Even slower on 513x513 grid
![Page 37: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/37.jpg)
Motivation
• Develop efficient (optimal) solution strategies for LBE– LBE simplicity + Asymptotic efficiency
• Steady-state problems– Decouple space and time– Preserve exact LBE spatial discretization
• Obtain identical final result with faster solution method
![Page 38: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/38.jpg)
Steady-State LBE Discretization
• Drop time-level index n: ),(),(
1),(),( 21 ii
EQaiiaiiaaiaia yxfyxfyxfheyhexf
0),(),(1
),(),()( 21 iieq
aiiaiiaaiaiaa yxfyxfyxfheyhexffRi
• In residual form:
•Linearize and solve with Newton’s method:
•Iterative inversion of Jacobian matrix using Jacobi, GG, Multigrid…
)( fRff
R
![Page 39: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/39.jpg)
Linear Multigrid Driven Newton Scheme
• Efficiency of linear system – 150 multigrid cycles
• Quadratic convergence of non-linear system
![Page 40: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/40.jpg)
Linear vs. Non-Linear Approach
• Linearized LBE is expensive– Block 9x9 matrices for collision term
– Looses efficient 2 step non-linear evaluation
f
R
f
f
b
eqa
),(),(1
),(),(*ii
eqaii
naiiaiia yxfyxfyxfyxf
n
),(),( *21
1iiaaiai
na yxfheyhexf
Collision:
Advection:
![Page 41: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/41.jpg)
Operation Count
• Linear system iteration (Jacobi):– 9x9 matrix-vector product: 2x9x9= 162 ops
– Other terms : 63 ops
– Total: 225 ops
• Non-Linear LBE Time Step:– Macro variables: 18 ops
– Collision: 75 ops
– Advection: 0 ops
– Total : 93 ops
![Page 42: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/42.jpg)
Non-Linear Multigrid Approach
• Use LBE time-step to drive non-linear multigrid algorithm (non-linear equivalent of Jacobi)– Jacobi has poor smoothing properties– Implement non-linear under-relaxed Jacobi in 3 steps:
),(),(1
),(),(*ii
eqaii
naiiaiia yxfyxfyxfyxf
n
),(),( *21
**iiaaiaia yxfheyhexf
Collision:
Advection:
naa
na fff )1()( **1
relaxationUnder :
![Page 43: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/43.jpg)
Non-Linear Multigrid (FAS)
0
fLu
rfLunewh
holdh
holdh
newh rLuLu
hHhh
HhH rIuILLu )ˆ(
HH DLu hHhh
HhH rIuILD )ˆ(
)ˆ( hHhH
hHh
newh uIuIuu
![Page 44: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/44.jpg)
Non-Linear Multigrid Approach
• On coarse grids, need to include defect-correction :– Implement as modification to under-relaxation stage– Preserve first two steps
• Implemented by calling existing LBE code on all grid levels
),(),(1
),(),(*ii
eqaii
naiiaiia yxfyxfyxfyxf
n
),(),( *21
**iiaaiaia yxfheyhexf
Collision:
Advection:
naHa
na fDff )1()( **1
relaxationUnder :
![Page 45: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/45.jpg)
Multigrid Cost
• 1 MG cycle = 24 LBE steps– 4 pre-smoothing and 4 post-smoothing steps (factor 8)– Work of coarse grids (W-cycle in 2D: factor 2)– Remaining factor: 1.5: Under-relaxation, intergrid
transfers
• Memory Usage (factor 3)– 2 field arrays on fine grid (f + residuals)– Remainder is coarse grid variables (factor 1.5)
![Page 46: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/46.jpg)
Solution of Steady-State LBE
• 16,000 time steps to machine zero on 33x33 grid• 4 to 5 times slower on 129x129 grid• Even slower on 513x513 grid
![Page 47: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/47.jpg)
Non-Linear Multigrid Solution of LBE
• 2 to 3 orders of magnitude faster in terms of cycles• Multigrid cycle is 24 times cost of LBE time-step
![Page 48: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/48.jpg)
Non-Linear Multigrid Solution of LBE
• Work unit: CPU time for 1 LBE time-step on relevant grid• MG 1 to 2 orders of magnitude more efficient
– Benefit increases with finer grids– Asymptotic property of MG: O(N)
![Page 49: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/49.jpg)
Conclusions
• Steady-state LBE can be solved efficiently O(N) using multigrid– Implemented by calling existing LBE code on each grid
level
– Plus defect correction and under-relaxation step
• Better smoothers are available at the cost of decreased modularity
• Linearizing LBE is a poor strategy– Destroys favorable operation count
![Page 50: Exploring Alternative Approaches to CFD](https://reader036.fdocuments.in/reader036/viewer/2022070418/568158f6550346895dc632c7/html5/thumbnails/50.jpg)
Future Challenges
• For steady-state cases, apply known PDE strategies– Adaptive meshing
– Adjoint solution techniques for MDO sensitivities• Simple (but costly) linearization
• Extend steady-state solver to time-implicit solver– Exact convection (shift to neighbor) is lost
– Effect on temporal accuracy (?)