integrated computational physics and numerical
play

Integrated computational physics and numerical optimization Matthew - PowerPoint PPT Presentation

Integrated computational physics and numerical optimization Matthew J. Zahr Luis W. Alvarez Postdoctoral Fellow Mathematics Group Computational Research Division Lawrence Berkeley National Laboratory UCB/LBNL Applied Mathematics Seminar


  1. Extension: Multiphysics problems [Huang et al., 2018] For problems that involve the interaction of multiple types of physical phenomena, no changes required if monolithic system considered M 0 ˙ u 0 = r 0 ( u 0 , c 0 ( u 0 , u 1 )) M 1 ˙ u 1 = r 1 ( u 1 , c 1 ( u 0 , u 1 )) However, to solve in partitioned manner and achieve high-order, split as follows and apply implicit-explicit Runge-Kutta M 0 ˙ u 0 = r 0 ( u 0 , c 0 ( u 0 , u 1 )) M 1 ˙ u 1 = r 1 ( u 1 , ˜ c 1 ) + ( r 1 ( u 1 , c 1 ( u 0 , u 1 )) − r 1 ( u 1 , ˜ c 1 )) Adjoint equations inherit explicit-implicit structure

  2. High-order method for general multiphysics problems with uncondi- tional linear stability Particle-laden flow Fluid-structure interaction

  3. Optimal energy harvesting from foil-damper system Goal: Maximize energy harvested from foil-damper system � T 1 ( c ˙ h 2 ( u s ) − M z ( u f ) ˙ maximize θ ( µ , t )) dt T µ 0 • Fluid: Isentropic Navier-Stokes on deforming domain (ALE) • Structure: Force balance in y -direction between foil and damper • Motion driven by imposed θ ( µ , t ) = µ 1 cos(2 πft ) θ ( µ , t ) h ( u s ) c µ ∗ 1 ≈ 45 ◦

  4. High-order methods for PDE-constrained optimization • Developed fully discrete adjoint method for high-order numerical discretizations of PDEs and QoIs • Used to compute gradients of QoI for use in gradient-based numerical optimization method • Treatment of parametrized time domain (optimal frequency) • Explicit enforcement of time-periodicity constraints • Extension to multiphysics (fluid-structure interaction, particle-laden flow, ...) • Applications : optimal flapping flight, energy harvesting, data assimilation

  5. Integrating computational physics and numerical optimization Optimize physics Optimize numerics

  6. Discontinuities often arise in engineering systems, particularly in those involving compressible flows: shock waves, contact lines Supersnoic and transonic flow around commercial planes and fighter jets Hypersonics, e.g., re-entry of vehicles in atmosphere, and scramjets Other applications with discontinuities: fracture, problems with interfaces

  7. State-of-the-art numerical methods for resolving shocks Fundamental issue: approximate discontinuity with polynomial basis

  8. State-of-the-art numerical methods for resolving shocks Fundamental issue: approximate discontinuity with polynomial basis

  9. State-of-the-art numerical methods for resolving shocks Fundamental issue: approximate discontinuity with polynomial basis

  10. State-of-the-art numerical methods for resolving shocks Fundamental issue: approximate discontinuity with polynomial basis

  11. State-of-the-art numerical methods for resolving shocks Fundamental issue: approximate discontinuity with polynomial basis Exising solutions: limiting , artificial viscosity Drawbacks: order reduction, local refinement

  12. State-of-the-art numerical methods for resolving shocks Fundamental issue: approximate discontinuity with polynomial basis Exising solutions: limiting , artificial viscosity Drawbacks: order reduction, local refinement

  13. State-of-the-art numerical methods for resolving shocks Fundamental issue: approximate discontinuity with polynomial basis Exising solutions: limiting, artificial viscosity Drawbacks: order reduction, local refinement

  14. State-of-the-art numerical methods for resolving shocks Fundamental issue: approximate discontinuity with polynomial basis Exising solutions: limiting, artificial viscosity Drawbacks: order reduction, local refinement

  15. State-of-the-art numerical methods for resolving shocks Fundamental issue: approximate discontinuity with polynomial basis Exising solutions: limiting, artificial viscosity Drawbacks: order reduction, local refinement

  16. State-of-the-art numerical methods for resolving shocks Fundamental issue: approximate discontinuity with polynomial basis Exising solutions: limiting, artificial viscosity Drawbacks: order reduction, local refinement Proposed solution: align features of solution basis with features in the solution using optimization formulation and solver

  17. State-of-the-art numerical methods for resolving shocks Fundamental issue: approximate discontinuity with polynomial basis Exising solutions: limiting, artificial viscosity Drawbacks: order reduction, local refinement Proposed solution: align features of solution basis with features in the solution using optimization formulation and solver

  18. Tracking method for stable, high-order resolution of discontinuities Goal: Align element faces with (unknown) discontinuities to perfectly capture them and approximate smooth regions to high-order Non-aligned Discontinuity-aligned

  19. Tracking method for stable, high-order resolution of discontinuities Goal: Align element faces with (unknown) discontinuities to perfectly capture them and approximate smooth regions to high-order Non-aligned Discontinuity-aligned Ingredients • Discontinuous Galerkin discretization: inter-element jumps, high-order • Optimization formulation that penalizes local instabilities in the solution and enforces the discrete PDE • Full space solver that converges the solution and mesh simultaneously to ensure solution of PDE never required on non-aligned mesh

  20. Discontinuity-tracking as PDE-constrained optimization problem minimize f ( u , x ) u , x subject to r ( u , x ) = 0

  21. Discontinuity-tracking as PDE-constrained optimization problem minimize f ( u , x ) u , x subject to r ( u , x ) = 0 Objective function Must obtain minimum when mesh face aligned with shock and monotonically decreases to minimum in neighborhood of radius O ( h/ 2) about discontinuity

  22. Discontinuity-tracking as PDE-constrained optimization problem minimize f ( u , x ) u , x subject to r ( u , x ) = 0 Objective function Must obtain minimum when mesh face aligned with shock and monotonically decreases to minimum in neighborhood of radius O ( h/ 2) about discontinuity Optimization approach Cannot use nested approach where constraint r ( u , x ) = 0 is eliminated because discrete PDE cannot be solved unless x = x ∗ = ⇒ full space approach required

  23. Transformed conservation law from deformation of physical domain Consider physical domain as the result of a µ -parametrized diffeomorphism applied to some reference domain Ω 0 Ω = G (Ω 0 , µ ) Re-write conservation law on reference domain in G (Ω 0 , µ ) in Ω 0 , ∇ · F ( U ) = 0 = ⇒ ∇ X · F ( u, µ ) = 0 ∂ F ( u, µ ) = g µ F ( g − 1 µ u ) G − T u = g µ U, µ , G µ = ∂X G ( X, µ ) , g µ = det G µ n da N dA x = G ( X, µ ) Ω x 2 Ω 0 x 1 X 2 X 1 Mapping between reference and physical domains

  24. Discontinuous Galerkin discretization of conservation law Element-wise weak form of transformed conservation law � � ψ · F ( u, µ ) N dA − F ( u, µ ) : ∇ X ψ dV = 0 ∂K K Global weak form and introduction of numerical flux � � � ψ · F ∗ ( u, µ, N ) dA − F ( u, µ ) : ∇ X ψ dV = 0 ∂K Ω 0 K ∈E h,p Strict requirements on numerical flux since inter-element jumps will not tend to zero on shock surface Fully discrete transformed conservation law in terms of the discrete state vector u and coordinates of physical mesh x r ( u , x ) = 0

  25. Objective function: penalize oscillations and mesh distortion Consider a discontinuity indicator that aims to penalize oscillations in finite-dimensional solution � � 2 f shk ( u , x ) = h − 2 � u K � �� � �� � u h,p − ¯ W dV, 0 h,p G ( K, x ) K ∈E h,p 1 � � u K h 0 = | Ω 0 | 1 /d ¯ h,p = u h,p dV, |G ( K, x ) | = dV, |G ( K, x ) | G ( K, x ) G ( K, x )

  26. Objective function: penalize oscillations and mesh distortion Consider a discontinuity indicator that aims to penalize oscillations in finite-dimensional solution � � 2 f shk ( u , x ) = h − 2 � u K � �� � �� � u h,p − ¯ W dV, 0 h,p G ( K, x ) K ∈E h,p 1 � � u K h 0 = | Ω 0 | 1 /d ¯ h,p = u h,p dV, |G ( K, x ) | = dV, |G ( K, x ) | G ( K, x ) G ( K, x ) Construct objective function as weighted combination between discontinuity indicator and mesh distortion metric f ( u , x ; α ) = f shk ( u , x ) + αf msh ( x )

  27. One-dimensional mesh parametrization and objective function test

  28. One-dimensional mesh parametrization and objective function test

  29. One-dimensional mesh parametrization and objective function test

  30. One-dimensional mesh parametrization and objective function test

  31. One-dimensional mesh parametrization and objective function test

  32. One-dimensional mesh parametrization and objective function test

  33. Objective function monotonically approaches minimum as mesh aligns with discontinuity, regardless of p , for a range of α j α ( φ ) = f shk ( u ( x ( φ )) , x ( φ )) + αf msh ( x ( φ )) 3 j α ( φ ) , α = 0 2 1 0 0 . 46 0 . 48 0 . 5 0 . 52 0 . 54 φ (position of node closest to shock) Objective function as an element face is smoothly swept across discontinuity ( ): p = 1 ( ), p = 2 ( ), p = 3 ( ), p = 4 ( ).

  34. Objective function monotonically approaches minimum as mesh aligns with discontinuity, regardless of p , for a range of α j α ( φ ) = f shk ( u ( x ( φ )) , x ( φ )) + αf msh ( x ( φ )) 3 j α ( φ ) , α = 1 2 1 0 0 . 46 0 . 48 0 . 5 0 . 52 0 . 54 φ (position of node closest to shock) Objective function as an element face is smoothly swept across discontinuity ( ): p = 1 ( ), p = 2 ( ), p = 3 ( ), p = 4 ( ).

  35. Objective function monotonically approaches minimum as mesh aligns with discontinuity, regardless of p , for a range of α j α ( φ ) = f shk ( u ( x ( φ )) , x ( φ )) + αf msh ( x ( φ )) 4 3 j α ( φ ) , α = 10 2 1 0 0 . 46 0 . 48 0 . 5 0 . 52 0 . 54 φ (position of node closest to shock) Objective function as an element face is smoothly swept across discontinuity ( ): p = 1 ( ), p = 2 ( ), p = 3 ( ), p = 4 ( ).

  36. Objective function monotonically approaches minimum as mesh aligns with discontinuity, regardless of p , for a range of α j α ( φ ) = f shk ( u ( x ( φ )) , x ( φ )) + αf msh ( x ( φ )) 6 j α ( φ ) , α = 20 4 2 0 0 . 46 0 . 48 0 . 5 0 . 52 0 . 54 φ (position of node closest to shock) Objective function as an element face is smoothly swept across discontinuity ( ): p = 1 ( ), p = 2 ( ), p = 3 ( ), p = 4 ( ).

  37. Objective function monotonically approaches minimum as mesh aligns with discontinuity, regardless of p , for a range of α j α ( φ ) = f shk ( u ( x ( φ )) , x ( φ )) + αf msh ( x ( φ )) 8 j α ( φ ) , α = 40 6 4 2 0 0 . 46 0 . 48 0 . 5 0 . 52 0 . 54 φ (position of node closest to shock) Objective function as an element face is smoothly swept across discontinuity ( ): p = 1 ( ), p = 2 ( ), p = 3 ( ), p = 4 ( ).

  38. Objective function monotonically approaches minimum as mesh aligns with discontinuity, regardless of p , for a range of α j α ( φ ) = f shk ( u ( x ( φ )) , x ( φ )) + αf msh ( x ( φ )) 150 j α ( φ ) , α = 1000 100 50 0 0 . 46 0 . 48 0 . 5 0 . 52 0 . 54 φ (position of node closest to shock) Objective function as an element face is smoothly swept across discontinuity ( ): p = 1 ( ), p = 2 ( ), p = 3 ( ), p = 4 ( ).

  39. Proposed discontinuity indicator is monotonic and attains minimum at discontinuity, whereas other indicators are not monotonic f shk ( u ( x ( φ )) , x ( φ )) 20 10 0 − 0 . 06 − 0 . 03 0 0 . 03 0 . 06 φ (position of node closest to shock) Objective function as an element face is smoothly swept across discontinuity ( ): p = 1 ( ), p = 2 ( ), p = 3 ( ).

  40. Proposed discontinuity indicator is monotonic and attains minimum at discontinuity, whereas other indicators are not monotonic 80 residual-based indicator 60 40 20 0 − 0 . 06 − 0 . 03 0 0 . 03 0 . 06 φ (position of node closest to shock) Objective function as an element face is smoothly swept across discontinuity ( ): p = 1 ( ), p = 2 ( ), p = 3 ( ).

  41. Proposed discontinuity indicator is monotonic and attains minimum at discontinuity, whereas other indicators are not monotonic 6 physics-based indicator 4 2 0 − 0 . 06 − 0 . 03 0 0 . 03 0 . 06 φ (position of node closest to shock) Objective function as an element face is smoothly swept across discontinuity ( ): p = 1 ( ), p = 2 ( ), p = 3 ( ).

  42. Cannot use nested approach to PDE optimization because it requires solving r ( u , x ) = 0 for x � = x ∗ = ⇒ crash Full space approach : u → u ∗ and x → x ∗ simultaneously 1 usually requires globalization such as linesearch or trust-region

  43. Cannot use nested approach to PDE optimization because it requires solving r ( u , x ) = 0 for x � = x ∗ = ⇒ crash Full space approach : u → u ∗ and x → x ∗ simultaneously Define Lagrangian L ( u , x , λ ) = f ( u ; x ) − λ T r ( u ; x ) First-order optimality (KKT) conditions for full space optimization problem ∇ u L ( u ∗ , x ∗ , λ ∗ ) = 0 , ∇ x L ( u ∗ , x ∗ , λ ∗ ) = 0 , ∇ λ L ( u ∗ , x ∗ , λ ∗ ) = 0 Apply (quasi-)Newton method 1 to solve nonlinear KKT system for u ∗ , x ∗ , λ ∗ 1 usually requires globalization such as linesearch or trust-region

  44. Implementation mostly requires standard terms in implicit code Gradient-based optimizers for the tracking optimization problem will require ∂f ∂f f ( u , x ) , ∂ u ( u , x ) , ∂ x ( u , x ) , ∂ r ∂ r r ( u , x ) , ∂ u ( u , x ) , ∂ x ( u , x ) - r and ∂ u r required by standard implicit solvers - Same terms required for reduced space approach

  45. L 2 projection of discontinuous function on DG basis x 2 + y 2 < r 2 � 2 , η ( x ) = x 2 + y 2 > r 2 1 , Non-aligned ( left ) vs. discontinuity-aligned mesh with linear ( middle ) and cubic ( right ) elements

  46. Resolution of modified Burgers’ equation with few elements 3 2 1 0 − 1 − 2 − 3 − 2 − 1 . 5 − 1 − 0 . 5 0 0 . 5 1 1 . 5 2 x Exact solution ( ), tracking solution ( ) and mesh ( ) for p = 3

  47. Resolution of modified Burgers’ equation with few elements 3 2 1 0 − 1 − 2 − 3 − 2 − 1 . 5 − 1 − 0 . 5 0 0 . 5 1 1 . 5 2 x Exact solution ( ), tracking solution ( ) and mesh ( ) for p = 3

  48. Resolution of modified Burgers’ equation with few elements 3 2 1 0 − 1 − 2 − 3 − 2 − 1 . 5 − 1 − 0 . 5 0 0 . 5 1 1 . 5 2 x Exact solution ( ), tracking solution ( ) and mesh ( ) for p = 3

  49. O ( h p +1 ) convergence rates demonstrated for Burgers’ equation 10 0 10 − 2 L 1 error 10 − 4 10 − 6 10 − 8 10 0 10 1 10 2 10 3 Number of elements p = 1 ( ), p = 2 ( ), p = 3 ( ), p = 4 ( ), p = 5 ( ), p = 6 ( ) The slopes of the best-fit lines to the data points in the asymptotic regime are: ∠ − 2 . 0 ( ), ∠ − 3 . 1 ( ), ∠ − 3 . 9 ( ), ∠ − 5 . 5 ( ), ∠ − 4 . 4 ( ), ∠ − 8 . 7 ( )

  50. Convergence: tracking vs. uniform/adaptive refinement 10 − 1 L 1 error 10 − 4 10 − 7 10 0 10 1 10 2 10 3 10 − 1 L 1 error 10 − 4 10 − 7 10 0 10 1 10 2 10 3 10 0 10 1 10 2 10 3 number of elements number of elements discontinuity-tracking p = 1 ( ) p = 2 ( ) p = 3 ( ) uniform refinement p = 1 ( ) p = 2 ( ) p = 3 ( ) adaptive refinement p = 1 ( ) p = 2 ( ) p = 3 ( )

  51. Nozzle flow: quasi-1d Euler equations A ( x ) 1 0 . 8 0 . 5 0 . 5 Inviscid wall ( ), inflow ( ), outflow ( )

  52. Resolution of quasi-1d Euler equations with few elements 1 0 . 8 0 . 6 0 . 4 0 . 2 0 0 0 . 1 0 . 2 0 . 3 0 . 4 0 . 5 0 . 6 0 . 7 0 . 8 0 . 9 1 x Exact solution ( ), tracking solution ( ) and mesh ( ) for p = 3

  53. Resolution of quasi-1d Euler equations with few elements 1 0 . 8 0 . 6 0 . 4 0 . 2 0 0 0 . 1 0 . 2 0 . 3 0 . 4 0 . 5 0 . 6 0 . 7 0 . 8 0 . 9 1 x Exact solution ( ), tracking solution ( ) and mesh ( ) for p = 3

  54. Resolution of quasi-1d Euler equations with few elements 1 0 . 8 0 . 6 0 . 4 0 . 2 0 0 0 . 1 0 . 2 0 . 3 0 . 4 0 . 5 0 . 6 0 . 7 0 . 8 0 . 9 1 x Exact solution ( ), tracking solution ( ) and mesh ( ) for p = 3

  55. O ( h p +1 ) convergence rates demonstrated for nozzle flow 10 0 10 − 1 L 1 error 10 − 2 10 − 3 10 − 4 10 − 5 10 0 10 1 10 2 10 3 Number of elements p = 1 ( ), p = 2 ( ) Slope of best-fit line: ∠ − 2 . 0 ( ), ∠ − 2 . 7 ( ) Reference second-order method ( p = 1 ) with adaptive mesh refinement ( )

  56. Supersonic flow ( M = 2 ) around cylinder: 2D Euler equations 8 3 1 Inviscid wall/symmetry condition ( ) and farfield ( )

  57. Resolution of 2D supersonic flow with 48 elements Density ( ρ ) Left : Solution on non-aligned mesh with 48 linear elements and added viscosity (initial guess for shock tracking method). Remaining : solution using shock tracking framework corresponding to mesh with 48 p = 1 , p = 2 , p = 3 , p = 4 elements.

  58. Resolution of 2D supersonic flow with 48 elements Density ( ρ ) Left : Solution on non-aligned mesh with 48 linear elements and added viscosity (initial guess for shock tracking method). Remaining : solution using shock tracking framework corresponding to mesh with 48 p = 1 , p = 2 , p = 3 , p = 4 elements.

  59. Resolution of 2D supersonic flow with 48 elements Shock tracking objective ( f shk ) Left : Solution on non-aligned mesh with 48 linear elements and added viscosity (initial guess for shock tracking method). Remaining : solution using shock tracking framework corresponding to mesh with 48 p = 1 , p = 2 , p = 3 , p = 4 elements.

  60. Resolution of 2D supersonic flow with 48 elements Distortion metric ( f msh ) Left : Solution on non-aligned mesh with 48 linear elements and added viscosity (initial guess for shock tracking method). Remaining : solution using shock tracking framework corresponding to mesh with 48 p = 1 , p = 2 , p = 3 , p = 4 elements.

  61. Convergence to optimal solution and mesh

  62. Discontinuity-tracking performance summary Polynomial order ( p ) 1 2 3 4 Degrees of freedom ( N u ) 576 1152 1920 2880 Enthalpy error ( e H ) 0 . 0106 0 . 000462 0 . 00151 0 . 000885 Stagnation pressure error ( e p ) 0 . 0711 0 . 00479 0 . 0112 0 . 000616

  63. Supersonic flow ( M = 4 ) around blunt body: 2D Euler equations 9 4 1 Inviscid wall/symmetry condition ( ) and farfield ( )

  64. Resolution of 2D supersonic flow with 102 quadratic elements Left : Solution (density) on non-aligned mesh with 102 linear elements and added viscosity (initial guess for shock tracking method). Middle/right : solution using shock tracking framework corresponding to mesh with 102 linear ( middle ) and quadratic ( right ) elements.

  65. Resolution of 2D supersonic flow with 102 quadratic elements Left : Solution (density) on non-aligned mesh with 102 linear elements and added viscosity (initial guess for shock tracking method). Middle/right : solution using shock tracking framework corresponding to mesh with 102 linear ( middle ) and quadratic ( right ) elements.

  66. Convergence to optimal solution and mesh

  67. Solver simultaneously minimizes objective and solves PDE 10 2 ) 1 . 8 ) 10 0 Residual norm, || r ( u , x ) || ∞ ( 1 . 6 Objective function ( 1 . 4 10 − 2 1 . 2 10 − 4 1 10 − 6 0 . 8 10 − 8 0 . 6 10 − 10 0 . 4 0 50 100 150 200 250 300 350 400 Iteration Convergence of residual and objective function

  68. Conclusions and future work • Introduced high-order shock tracking method based on DG discretization and PDE-constrained optimization formulation • Key innovations: objective function that monotonically approaches a minimum as mesh face aligns with shock and full space solver • Optimal convergence O ( h p +1 ) rates obtained and used to resolve a number of transonic and supersonic flows on very coarse meshes • Future work • numerical flux consistent with integral form (jumps do not tend to 0) • solver that exploits problem structure and incorporates homotopy • local topology changes to reduce iterations and improve mesh quality Mach 2 flow around cylinder ( left ), Mach 4 flow around blunt body ( middle ), and L 2 projection of discontinuous function ( right ).

  69. References I Barter, G. E. (2008). Shock capturing with PDE-based artificial viscosity for an adaptive, higher-order discontinuous Galerkin finite element method . PhD thesis, M.I.T. Huang, D. Z., Persson, P.-O., and Zahr, M. J. (2018). High-order, linearly stable, partitioned solvers for general multiphysics problems based on implicit-explicit Runge-Kutta schemes. Computer Methods in Applied Mechanics and Engineering . Wang, J., Zahr, M. J., and Persson, P.-O. (6/5/2017 – 6/9/2017). Energetically optimal flapping flight based on a fully discrete adjoint method with explicit treatment of flapping frequency. In Proc. of the 23rd AIAA Computational Fluid Dynamics Conference , Denver, Colorado. American Institute of Aeronautics and Astronautics.

Recommend


More recommend