350 likes | 557 Views
General-Purpose Software for Large-Scale Bifurcation Analysis. Andy Salinger, Eric Phipps Computer Science Research Institute, Sandia National Laboratories Albuquerque, NM, USA
E N D
General-Purpose Software for Large-Scale Bifurcation Analysis Andy Salinger, Eric Phipps Computer Science Research Institute, Sandia National Laboratories Albuquerque, NM, USA Tipping Points in Complex Flows - Numerical Methods for Bifurcation Analysis of Large-Scale Systems from 31 Oct 2011 through 4 Nov 2011 Sandia is a multiprogram laboratory operated by Sandia Corporation, a Lockheed Martin Company,for the United States Department of Energy’s National Nuclear Security Administration under contract DE-AC04-94AL85000.
Trilinos: Algorithms and Enabling Technologies for Large-Scale Applications Two-level design: Self-contained packages (50+) Leveraged common tools. Version Control Build System Test Harness Nonlinear, Transient & Optimization Solvers Discretizations Linear & Eigen Solvers Scalable Linear Algebra Geometry, Meshing & Load Balancing Framework, Tools & Interfaces http://trilinos.sandia.gov
LOCA Provides Analysis Capabilities to Large-Scale Applications Multi-parameter continuation through Multifario (Henderson) Pseudo-Arclength Continuation Linear eigen-analysis through Anasazi (Thornquist & Lehoucq) Periodic orbit tracking (experimental) Pitchfork Bifurcation location and continuation (turning point, pitchfork, and Hopf) Hopf
Why Do We Need Stability Analysis Tools for Large-Scale Applications Several powerful continuation and bifurcation analysis tools are available: AUTO (Doedel et al) CONTENT (Kuznetsov et al) MATCONT (Govaerts et al) PyDSTool (Guckenheimer et al) … Large-scale applications have specific requirements Massively parallel distributed memory architectures Complicated parallel data structures and sparse matrices Application-tuned linear algebra Limited derivative capabilities Tools and algorithms are needed that Do not change matrix sparsity or increase memory requirements Agnostic to linear algebra and architecture Can be incorporated into existing simulation codes (i.e., libraries)
Basic Defining Equations in LOCA ODE/DAE Linearization Pseudo-Arclength Pitchfork Hopf Turning Point
Bifurcations Discovered Through Eigenvalue Analysis and Spectral Transformations Eigenvalue problem Shift and Invert Generalized Cayley Transformation • Eigenvalues/vectors approximated via Block Krylov-Schur Iterations (Anasazi – Thornquist & Lehoucq) • Analogies to time integration can be used to pick transformation parameters (Lehoucq and Salinger, 2001, Burroughs et al, 2004).
NOX: Object-Oriented Nonlinear Solverin Trilinos: Pawlowski et al Methods • Line Search • Trust Region Solver Layer • Searches • Directions Linear Algebra Abstract Layer Application Interface Linear Algebra Concrete Implementation Layer User Interface • Residual • Jacobian
LOCA Builton and around NOX • Step • Solve • Analyze • Predict • Stop? Stepper Layer • Eigensolvers • Spectral transformations Methods • Line Search • Trust Region Solver Layer • Searches • Directions Continuation Augmented Equations Layers Bifurcation Linear Algebra Abstract Layer Application Interface Mix-and-match between • Continuation methods • Predictor modules • Step-size control modules • Bifurcation modules • Nonlinear solvers • Linear solvers/preconditioners Linear Algebra Concrete Implementation Layer User Interface • Residual • Jacobian • Update parameters • Mass matrix
Block Elimination Algorithm for Turning Point (fold) Tracking Uses 4 Solves • Full Newton Algorithm • Turning Point Bifurcation • Block Elimination Algorithm
Modified Turning Point Bordering Algorithm Solve 5 bordered systems of equations using QR approach Then
Minimally Augmented Turning Point Formulation Given and , let then There are constants such that Standard formulation: Note for Newton’s method: 3 linear solves per Newton iteration (5 for modified bordering)! For symmetric problems reduces to 2 solves.
Flow Calculations Performed with Sandia CFD codes and Trilinos solvers MPSalsa, Charon, Albany codes • Incompressible Navier-Stokes • Heat and Mass Transfer, Reactions, variable properties • Unstructured Finite Element • Galerkin/Least-Squares: Q1Q1 • Analytic Jacobian matrix in distributed sparse storage • Compute with AD • Fully Coupled Newton Method • GMRES with ILUT or MultI-Level Preconditioners
Frank-Kamenetskii Explosion Model(~230K hex elements, ~1.1M unknowns, 128 cores) Scenario: • Continuous Stirred Tank Reactor • Exothermic Cehmical Reaction • Cooling at Walls • The stirring breaks! • Will natural convection prevent explosion? Arc-length Continuation
Frank-Kamenetskii Explosion ModelTurning Point Location • ILU(k) fill factor: 1 • ILU(k) overlap: 2 • Max Krylov space: 1000 • MS Bordering • Minimally augmented
Stability Analysis of Impinging JetsPawlowski, Salinger, Shadid, Mountziaris (2005) Region I Region II Region III H H P
Rayleigh-Benard in 5x5x1 cavity with Bifurcation Tracking Pitchfork Hopf Pitchfork Codimension 2 Bifurcation near Pr=0.0434, Ra=2106 Eigenvectors at Hopf
Hydromagnetic Rayleigh-Bernard ProblemPawlowski, Shadid Recirculations No flow Ra (fixed Q) g B0 Parameters: • Q ~ B02 (Chandresekhar number) • Ra (Rayleigh number) • Buoyancy driven instability initiates flow at high Ra numbers. • Increased values of Q delay the onset of flow. • Domain: 1x20
Resistive, Extended MHD Equations Extended MHD Model in Residual Form Involution:
Hydro-Magnetic Rayleigh-Bernard Stability: Direct Determination of Linear Stability and Nonlinear Equilibrium Solutions (Steady State Solves) Temp. Vx Vy By Bx Leading Eigenvector at Bifurcation Point, Ra = 1945.78, Q=10 • 2 Direct-to-steady-state solves at a given Q • Arnoldi method using Cayley transform to determine approximation to 2 eigenvalues with largest real part • Simple linear interpolation to estimate Critical Ra*
Design (Two-Parameter) Diagram Buoyancy Driven Flow Q Ra No Flow Q=10 Q Q=0 Vx Ra • “No flow” does not equal “no-structure” – pressure and magnetic fields must adjust/balance to maintain equilibrium. • LOCA can perform continuation of bifurcation
Critical Mode is different for various Q values Leading mode is 26 cells • Analytic solution is on an infinite domain with two bounding surfaces (top and bottom) • Multiple modes exist, mostly differentiated by number of cells/wavelength. • Therefore tracking the same eigenmode does not give the stability curve!!! • Periodic BCs will not fix this issue. 4000 3000 Ra 2000 Leading mode is 20 cells Q Mode: 20 Cells: Q=100, Ra=4017 Mode: 26 Cells: Q=100, Ra=3757
Scaling studies ~20x
LOCA has impacted several application areas without flow Pattern Formation in Swift-Hohenberg Eqs [Avitabile, Sanstede] TeraHz Resonance in Quantum Tunneling Diode [Kelley] Super-Conductivity Transitions in Ginzburg-Landau [Schlomer, Vanroose] Phase Transitions in a Confined Fluid [Frink]
How do I attribute the successes that LOCA has had? • Algorithmic research in large-scale bifurcations • Science demonstrations • LOCA is hooked up to Trilinos linear solvers 10% 15% 75% What broader lesson is there? Build software in independent-yet-interoperable components
Analysis Tools Nonlinear Solver Time Integration Continuation Sensitivity Analysis Stability Analysis Constrained Solves Optimization Linear Algebra Data Structures Iterative Solvers Derivative Tools Direct Solvers Derivatives Eigen Solver Sensitivities Preconditioners Matrix Partitioning Build Software in Independent-yet-Interoperable Components Continuation, Bifurcation, Stability Analysis
Analysis Tools Nonlinear Solver Time Integration Continuation Sensitivity Analysis Stability Analysis Constrained Solves Optimization Linear Algebra Data Structures Iterative Solvers Derivative Tools Direct Solvers Derivatives Eigen Solver Sensitivities Preconditioners Matrix Partitioning Build Software in Independent-yet-Interoperable Components Transient sensitivity analysis
Analysis Tools Initial 4-Param Bound 4-Param Free Nonlinear Solver Time Integration Continuation Sensitivity Analysis Stability Analysis Constrained Solves Optimization Linear Algebra Data Structures Iterative Solvers Derivative Tools Direct Solvers Derivatives Eigen Solver Sensitivities Preconditioners Matrix Partitioning Build Software in Independent-yet-Interoperable Components CVD Reactor Optimization
“Agile Components” Analysis Tools (black-box) Composite Physics Particle Code Tools MultiPhysics Coupling Data Structures Optimization Solution Control Neighbor Search / Sort Parameter Studies System Models Utilities UQ (non-invasive) System UQ PostProcessing Input File Parser V&V, Calibration Visualization Parameter List OUU, Reliability Embedded Verification I/O Management Computational Steering Mesh Tools Feature Extraction Memory Management Mesh I/O Data Reduction Communicators Analysis Tools (embedded) Inline Meshing Model Reduction Runtime Compiler Partitioning Nonlinear Solver MultiCore Parallelization Tools Load Balancing Time Integration Mesh Database Adaptivity Continuation Remeshing Mesh Database Sensitivity Analysis Grid Transfers Geometry Database Stability Analysis Software Quality Mesh Quality Solution Database Constrained Solves Version Control Optimization Local Fill Regression Testing UQ Solver Build System Discretizations Physics Fill Backups Discretization Library Linear Algebra Element Level Fill Mailing Lists Field Manager Data Structures Material Models Unit Testing Iterative Solvers Derivative Tools Bug Tracking Objective Function Direct Solvers UQ / PCE Propagation Performance Testing Constraints Eigen Solver Code Coverage Error Estimates Preconditioners Sensitivities Porting MMS Source Terms Matrix Partitioning Derivatives Web Pages Architecture- Dependent Kernels Adjoints Release Process
Albany Code: DemonstratingComponent-based Code Design Hand-Coded: Analysis Tools Main() Optimization UQ Mesh Database Application Exodus File Problem Discretization Solvers w/ Sensitivities Nonlinear Model Inline Mesher Nonlinear Optimization Quality Improvement Transient Continuation Stochastic Galerkin Bifurcation Load Balancing Application Linear Solve PDE Assembly is Templated for AD, PCE Linear Solvers / Preconditioners Field Manager Iterative Domain Decomp ManyCore Node Kernels PDE TERMS Block Iterative Direct MultiLevel Mulit-Core Discretization Eigensolve SchurComp Accelerators
Applications in Albany are born with Transformational Analysis Capabilities QCAD: Quantum dot design tool. • Optimization of gate voltages LCM: Platform for R&D in mechanics: • Load Stepping, AD of material models ThermoElectrostatics: Shape Optimization with Embedded UQ Std Deviation Initial Mesh 2-Param Optimum
Summary LOCA and Trilinos provide powerful simulation and analysis capabilities Continuation, bifurcation, and linear stability analysis Scalable linear algebra Optimization, time integration, automatic differentiation, uncertainty quantification, discretization, … Missing Capabilities (formerly future work) More generic algorithms for bordered matrix solves Much is hardwired to our Epetra format Periodic Orbit tracking beyond initial attempt Automated initial guess generation for null vectors Better documentation, examples, error checking, etc. Current Passion Component-based code design with Embedded Analysis in Mind from the beginning