1.01k likes | 1.19k Vues
Application of the Discrete Adjoint Method to Coupled Multidisciplinary Unsteady Flow Problems for Error Estimation and Optimization. Karthik Mani Department of Mechanical Engineering University of Wyoming Ph.D. Defense March 27, 2009. Outline. Motivation Background Goals
E N D
Application of the Discrete Adjoint Method to Coupled Multidisciplinary Unsteady Flow Problems for Error Estimation and Optimization Karthik Mani Department of Mechanical Engineering University of Wyoming Ph.D. Defense March 27, 2009
Outline • Motivation • Background • Goals • Analysis problem • Adjoint gradient and optimization results • Adjoint error estimates and adaptation results • Concluding remarks
Motivation – Part 1 • Began with shape optimization in unsteady flow problems • Evolved to address multiple coupled unsteady disciplines • Airfoil design for unsteady applications such as dynamic stall , flutter control, highly unsteady flows such as rotorcraft forward flight, rotor-stator interactions in turbomachines etc • Primary mechanism – use adjoint equations for computing gradient vector CFX ONERA NLR ONERA
Motivation – Part 2 • Adjoint variables can also be used for goal-based error estimation • Can be used to drive adaptive solutions • Spatial goal-based adaptation for steady-state problems has been done • Time-dependent adjoint variables now available. Can we adapt time-domain in unsteady problems? Vendetti & Darmofal MIT FUN3D - NASA Langley
Background: Gradient-based Optimization Minimization of a functional by modifying inputs Output functional Function Input parameters dL/dD L D
Background:Computation of the Gradient • F = Flow equations or discrete flow solution (CFD-code) • D = parametric representation of geometry • L = functional of interest (ex: lift,drag etc) Change D (i.e shape) to change L (Ex: lift) => need gradient dL/dD => how? Finite difference Input D CFD Code Output L Input D+e CFD Code Output Lnew dL/dD ~ DL/DD = (Lnew – L)/e • e is heuristically determined • Large -> wrong slope due to nonlinear effects • Small -> machine error Multiple D => multiple evaluations of F
Background:Differentiating F for Gradient Possible to directly differentiate analytic F to obtain expression for analytic dL/dD Continuous Linearization L = F(D) dL/dD = dF(D)/dD Can also sequentially differentiate operations in CFD code which computes L=F(D) Input D CFD Code Output L d CFD Code dL/dD dD Discrete Linearization
Background:Adaptive Solutions - Spatial Domain • Goal is to efficiently use of computational resources • Add points to the mesh on-the-fly only where it is important • But which areas are important? High gradients? Local error? Boundary layers? Shock waves? Venditti MIT Wakes? Stagnation points? • Whatever is relevant to our functional of interest (Ex: lift, drag) is what is important ! • Same argument in time domain. • Adjoint equations establish a relationship between the functional and the regions of the mesh that are relevant to it
Goals: • Develop a unified framework for computing adjoint variables for coupled unsteady equations • Compute functional gradients using adjoint variables and demonstrate shape optimization for aeroelastic problems • Extend utility of adjoint variables for estimating functional relevant temporal discretization error and algebraic error • Demonstrate adaptation of the time-domain and adaptation of convergence tolerances • Do this in an unstructured framework with finite-volume formulation applied to dynamic meshes.
Analysis Problem:Flow Equations Conservative form of Euler equations Integrate over a moving control volume • Spatial discretization uses second-order accurate matrix dissipation scheme • Temporal discretization uses second-order accurate BDF2 scheme Define flow residual as: Newton solver
Analysis Problem Mesh Motion Equations Approximate edges as springs Overall linear system: relates interior displacements to boundary displacements 2 Spring equations (x and y) for each node that can be solved as Solve using Gauss-Seidel or linear multigrid
Analysis Problem:Structural Equations Equations of motion Airfoil with 2 pitch and plunge degrees-of-freedom Matrix form: Transform as: Structure residual: Newton solver:
Analysis Problem:Geometry Parameterization Hicks-Henne Sine bump function: node displacement bump magnitude node location bump location Valid for: Bump magnitudes amax are the design variables D
Analysis Problem:Coupled Aeroelastic Solution Coupled residual equations: Coupled iterative solution Coupled iterations convergence
Analysis Problem:Overall Solution Procedure Read flow parameters and mesh Steady-State solution from freestream conditions Deform mesh to correct AOA Deform mesh to prescribed orientation at current time-step Initiate unsteady solution using steady-state solution Unsteady aeroelastic solution initiated by prescribed unsteady solution Flow solution at current time-step Prescribed unsteady time-integration Time-integration with coupled iterative aeroelastic solution at each time-step
Adjoint-based Gradient:A Simple Steady-State Example Consider a functional L evaluated using solution state U: state sensitivity to D is a matrix Linearize for gradient: Linearization of scalar – easily computable
Adjoint-based Gradient:A Simple Steady-State Example Residual equation used to obtain solution U Residual has to evaluate to zero at all points, therefore derivative is also zero • Limiting case of a single D, this is a linear system that can be solved to be obtain state sensitivity (vector) • For multiple D, multiple linear solutions required to construct state sensitivity one column at a time • Better than finite-difference in terms of accuracy, but no better in cost
Adjoint-based Gradient:A Simple Steady-State Example Transpose to obtain adjoint linearization: Rearrange state sensitivity expression: Substitute into adjoint linearization and introduce adjoint variable: Linear adjoint equation • No dependence on D during linear solution • Effect of D confined to final matrix-vector product
Generalized Form for Multidisciplinary Unsteady Coupled Equations m coupled disciplines=> L is a functional computed using multidisciplinary solution set: Linearize using chain rule with respect to D: Inner-product form: Tranpose for adjoint total sensitivity:
Generalized Form for Multidisciplinary Unsteady Coupled Equations Linearize with respect to D: Residual equations for m disciplines: Write in combined matrix form:
Generalized Form for Multidisciplinary Unsteady Coupled Equations Transpose and rearrange for vector of state sensitivity matrices:
Generalized Form for Multidisciplinary Unsteady Coupled Equations Substitute into adjoint total sensitivity equation:
Generalized Form for Multidisciplinary Unsteady Coupled Equations Define vector of disciplinary adjoint variables: Rearrange to recover linear adjoint system:
Generalized Form for Multidisciplinary Unsteady Coupled Equations General Jacobian matrix when expanded discretely in time is lower triangular due to hyperbolic nature of time: Swap rows and columns to obtain an upper triangular linear system that can be solved by back substitution
Generalized Form for Multidisciplinary Unsteady Coupled Equations Finally, substitute vector of disciplinary adjoint variables into total sensitivity equation to obtain gradient
Unsteady Aeroelastic Problem Functional based on solution to unsteady flow, structure and mesh equations Linearize, tranpose, and write in inner-product form for adjoint total sensitivity: Tap flow, structure and mesh residuals for state variable sensitivity matrix expression Mesh residual is function of structural state
Unsteady Aeroelastic Problem Linearize residuals: Combined matrix form:
Unsteady Aeroelastic Problem Substitute expression for vector of state variables sensitivity matrices into adjoint total sensitivity equation and define adjoint variables:
Unsteady Aeroelastic Problem Now determine form of discrete temporal expansion of Jacobians Flow residual at time-step n: Tri-diagonal for both residual to flow state and residual to mesh coordinate sensitivity
Unsteady Aeroelastic Problem Mesh residual at time-step n: All Jacobians are diagonal since there is no dependence beyond time-step n: Structure residual:
Unsteady Aeroelastic Problem Substitute expanded Jacobians back into adjoint system:
Unsteady Aeroelastic Problem Swap rows and columns to form an upper triangular system: • Each diagonal block represents one time-step • Diagonal block is coupled – requires solution procedure similar to analysis problem • Backward sweep in time with coupled iterative solution at each time step
Unsteady Aeroelastic Problem Segregated form at an arbitrary time-step: When adjoint variables are available, substitute back into total sensitivity equation: Complete gradient then:
Uncoupled Unsteady Problem Functional based on only time-dependent flow and mesh coordinates: Linearize, tranpose and convert to inner-product form: Residual equations: Linearize, combine into matrix form, tranpose and rearrange for vector of state variable sensitivity matrices
Uncoupled Unsteady Problem Substitute into total sensitivity and define vector of adjoint variables: Discretely expand in time using definitions for Jacobians from before:
Uncoupled Unsteady Problem Rearrange to form upper triangular adjoint system Note: Diagonal blocks are also upper triangular => uncoupled equations Segregated form: First solve flow adjoint then solve mesh adjoint Substitute adjoint variables into total sensitivity.
Steady-State Problem Adjoint system is same as the uncoupled unsteady problem. No discrete temporal expansion since solutions span only space. Solve directly by forward substitution First solve flow adjoint as: Then mesh adjoint as: Mesh residual for steady-state: Final gradient then becomes:
Validation of Adjoint-based Gradient • Forward linearization is first verified against finite-difference • Dual consistency between transpose operations is used to verify adjoint gradient Primal operation Dual operation Dual consistency requires: Comparison of adjoint gradient with finite-difference
Steady-State Shape Optimization Lift constrained drag minimization of a NACA0012 in transonic flow Mach number = 0.8, AOA = 1.25 degrees Functional: Computational mesh ~ 20,000 elements • L-BFGS-B algorithm for optimization • Uses gradient and builds approximate Hessian on-the-fly using history • 32 bump functions – 16 on upper surface and 16 lower surface • Magnitudes of bumps form vector design variables
Steady-State Shape Optimization Entropy Contours
Uncoupled Unsteady ProblemTime-Dependent Load Matching AGARD test case No.5: Mach number = 0.755, a=0.016o, kc=0.0814, am=2.51o • L-BFGS-B Optimization Algorithm • 290 design variables • Bump at each surface node • Same mesh as steady-state problem • Target load is that of NACA64210
Uncoupled Unsteady ProblemTime-Dependent Pressure Distribution Matching Same unsteady problem and global functional formulation. Local functional at each time-step is the difference between pressures • Inverse design in unsteady flow from NACA0012 to NACA64210 • Target airfoil is NACA64210 “type” airfoil • Target is closest match possible using the parameterization of the geometry • 290 design variables (Convergence stalls) • Reduced to 14 design variables and true optimum achieved in 28 iterations
Uncoupled Unsteady ProblemTime-Dependent Pressure Distribution Matching 290 design variables 14 design variables
Uncoupled Unsteady ProblemTime-Dependent Pressure Distribution Matching 290 design variables case