Mesh Morphing and the Adjoint Solver in ANSYS R14.0 Simon Pereira Laz Foley 1
Agenda Fluent Morphing-Optimization Feature RBF Morph with ANSYS DesignXplorer Adjoint Solver What does an adjoint solver do, and how do we use the results? Supporting technologies and challenges Current Functionality Examples Summary 2
FLUENT Morpher-Optimization feature 3
FLUENT Morpher-Optimization feature Allows users to optimize product design based on shape deformation to achieve design objective Based on Free-Form Deformation tool coupled with various optimization methods 4
Mesh Morphing Applies a geometric design change directly to the mesh in the solver Uses a Bernstein polynomial-based morphing scheme Freeform mesh deformation defined on a matrix of control points leads to a smooth deformation Works on all mesh types (Tet/Prism, CutCell, HexaCore, Polyhedral) User prescribes the scale and direction of deformations to control points distributed evenly through the rectilinear region. 5
Examples Some Basic examples Optimization based morphing Modified Baseline Region Defined 6
Process What if? Setup Case Run Setup Morph Morph Evaluate OR Regions Parameters Deformation Optimizer Optimizer Setup Case Run Setup Optimizer Optimize Auto 7 Choose best design Optimal Solution
Objective Function Objective Function: Equal flow rate Baseline Design Optimized Design 8
Example Simple Sedan Sequential Tabs Define Control Region(s) 9
Deformation Definition Define constraint(s) (if any) Select control points and prescribe the relative ranges of motion 10
Optimizer Algorithms; Compass, Powell, Rosenbrock, Simplex, Torczon Auto Optimize! 11
Results Incompressible turbulent flow Objective Function; Minimize Drag Baseline Design Questions? Please contact ANSYS Tech support for help in applying this technology Optimized Design 12
RBF-Morph 13
RBF-Morph 14
How RBF-Morph Works? Once displacements are defined by the user at the source points, Radial Basis Function interpolation is used to derive the displacement at any location in the space, so it is also available at every grid node. The RBF problem definition is mesh independent, same set up can be applied to different meshes 15
External flow example 16
RBF-Morph main features Fully integrated within FLUENT and Workbench Easy to use Parallel calculation allows to morph large size models (many millions of cells) in a short time Mesh independent solution works with all element types (tetrahedral, hexahedral, polyhedral, etc.) Superposition of multiple RBF-solutions makes the FLUENT case truly parametric (only 1 mesh is stored) RBF-solution can also be applied on the CAD Precision: exact nodal movement and exact feature preservation. 17
Test case description Ship hull: Series 60, C B =0.6 Conducted by Pranzitelli & Caridi external hydrodynamics multiphase flow (air & water) ship advancing steadly in calm water trim and sinkage fixed displaced volume as constraint resistance prediction Objective: Optimization of the hull shape with no displacement reduction Reduction of the resistance 18
workbench operator Process CAD Mesh ICEM-CFD Baseline sim. Fluent grid cells Workbench and RBF-morph setup Coarse 331,652 Medium 692,984 DOE RUNS Optimization Final solution Fine 1,274,742 C T ΔC T Coarse 5.81x10-3 -2.52% Medium 5.94x10-3 -0.34% Fine 5.96x10-3 0% Exp.* 5.96x10-3 - 19
workbench operator Process CAD Mesh ICEM-CFD Baseline sim. Fluent Symmetry Eight Section Morphing cross deformation plane domain sections fixed specified applied defined Workbench and RBF-morph setup DOE RUNS Optimization Final solution 20
workbench operator Process CAD Mesh ICEM-CFD Baseline sim. Fluent Workbench and RBF-morph setup DOE RUNS Parameters are defined and transferred to the parameter set bar for use with ANSYS DesignXplorer DX builds a DOE and drives Fluent and RBF Morph Optimization Final solution 21
ANSYS DesignXplorer Sensitivity analysis Results Input parameters Output parameters Response Surface DOE Settings Design of Experiments 45 Design Points Solved in Batch 22
Optimize with ANSYS DesignXplorer Optimize Baseline Optimized F x 6.83N 6.29N baseline 7.9% resistance reduction No volume reduction optimized 23
Performance with RBF-Morph in Workbench: Mesh generation: 6 man-hours Fluent case setup: 1 man-hours Baseline simulation (coarse grid): 4 CPU*-hours Workbench and RBF-Morph setup:1 man-hours DOE (45 simulations): 45 CPU*-hours Optimization: Minutes Without Workbench & RBF-Morph...? Mesh generation (first mesh): 6 man-hours Geometry (CAD) and mesh modification for each case (considering mesh automation in ICEM-CFD): 1x45 = 45 man-hours Cases management (Fluent): 1x46 = 46 man-hours Cases execution: 4+45 = 49 CPU*-hours use of other optimization tools:?? 8 man hrs 2 CPU days ~100 man hrs 2 CPU days (optimistically) 24 *one Intel i7 quad-core processor, 2.8GHz
Fluent Adjoint 25
Preface The release of the adjoint solver in ANSYS Fluent 14 is the culmination of several years of R&D effort. This project was risky, but the rewards are great for ANSYS clients. There were a number of false starts and deadends. Writing an adjoint solver that meets the needs of the engineering community is not a trivial task. We are pleased to have come so far, and look forward to going much further. 26
What is an adjoint solution and how do we use those results? An adjoint solver allows specific information about a fluid system to be computed that is very difficult to gather otherwise. The adjoint solution itself is a set of derivatives. They are not particularly useful in their raw form and must be post-processed appropriately. The derivative of an engineering quantity with respect to all of the inputs for the system can be computed in a single calculation. Example: Sensitivity of the drag on an airfoil to its shape. There are 4 main ways in which these derivatives can be used: 1. Qualitative guidance on what can influence the performance of a system strongly. 2. Quantitative guidance on the anticipated effect of specific design changes. 3. Guidance on important factors in solver numerics. 4. Gradient-based design optimization. 27
GOAL: Identify features of a system design that are most influential in the performance of the system. EXAMPLE: How to use the results - Qualitative Sensitivity of the Drag on a NACA 0012 airfoil to changes in the shape of the airfoil. The shape sensitivity field is extracted from the adjoint solution in a postprocessing step. High sensitivity changes to shape have a big effect on drag Low sensitivity changes to shape have a small effect on drag 28
How to use the results - Quantitative GOAL: Identify specific system design changes that benefit the performance and quantify the improvement in performance that is anticipated. EXAMPLE: Design modifications to turning vanes in a 90 degree elbow to reduce the total pressure drop. The optimal adjustment that is made to the shape is defined by the shape sensitivity field (steepest descent algorithm). Effect of each change can be computed in advance based on linear extrapolation. Baseline Modified Original DP = -232.8 Pa Expected change computed using the adjoint and linear extrapolation = 10.0 Pa Make the change and recompute the solution. Actual change = 9.0 Pa 29
How to use the results Solver Numerics GOAL: Identify aspects of the solver numerics and computational mesh that have a strong influence on quantities that are being computed that are of engineering interest. EXAMPLE: Use the adjoint solution to identify parts of the mesh where mesh adaption will benefit the computed drag by reducing the influence of discretization errors. Baseline Mesh Adapted Mesh Adapted Mesh Detail 30
Dp tot [Pa] How to use the results Optimization GOAL: Perform a sequence of automated design modifications to improve a specific performance measure for a system EXAMPLE: Gradient-based optimization of the total pressure drop in a pipe. Flow solution is recomputed and the adjoint recomputed at each design iteration. 100 90 Initial design 80 70 60 50 40 30 31 Final design 30% reduction in total pressure drop after 30 design iterations 20 10 0 0 10 20 30 Iteration
How does an adjoint analysis fit into the familiar CFD workflow? Standard CFD Workflow elements Define a flow problem. Create a geometric representation of the problem and create a computational mesh. Setup and solve the flow problem. Post-process the results. If the design is not meeting performance requirements Use insight, experience and intuition to decide how to select design changes that will improve the performance of the system or Adjoint workflow elements Use the results to improve the design systematically using one of the 4 strategies outlined Pick an observation that is of engineering interest. Lift, drag, total pressure drop? Set up and solve the adjoint problem for this observation for the specific computed flow field Define adjoint solution advancement controls Set adjoint convergence criteria Initialize the adjoint solution field Iterate to convergence Post process 32
Supporting Technologies Mesh morphing Mesh morphing & Adjoint Data Mesh Morphing, Adjoint Data & Constraints 33
Mesh Morphing Once a desired change to the geometry of the system has been selected, how is that change to be made? Mesh morphing provides a convenient and powerful means of changing the geometry and the computational mesh. Use Bernstein polynomial-based morphing scheme discussed earlier 34
Mesh Morphing & Adjoint Data Example: Sensitivity of lift to surface shape Flow Select portions of the geometry to be modified Adjoint to deformation operation Surface shape sensitivity becomes control point sensitivity (chain rule for differentiation) Benefit of this approach is two-fold Smooths the surface sensitivity field Provides a smooth interior and boundary mesh deformation 35
Mesh Morphing, Adjoint Data & Constraints The adjoint solution is determined based on the specific flow physics of the problem in hand. The effect of other practical engineering constraints must be reconciled with the adjoint data to decide on an allowable design change. Example: Some walls within the control volume may be constrained not to move. A minimal adjustment is made to the control-point sensitivity field so that deformation of the fixed walls is eliminated. Fixed wall Fixed wall Moveable walls 36
Current Functionality ANSYS-Fluent flow solver has very broad scope Adjoint is configured to compute solutions based on some assumptions Steady, incompressible, laminar flow. Steady, incompressible, turbulent flow with standard wall functions. First-order discretization in space. Frozen turbulence. The primary flow solution does NOT need to be run with these restrictions Strong evidence that these assumptions do not undermine the utility of the adjoint solution data for engineering purposes. Fully parallelized Gradient algorithm for shape modification Mesh morphing using control points. Adjoint-based solution adaption 37
Current Functionality The adjoint solver is an addon that will be part of the Fluent 14 distribution. Documentation is available Theory Usage Tutorial Case study Training is available. Functionality is activated by loading the adjoint solver addon module. A new menu item is added at the top level. Limitations include unsupported models (porous media, MRF etc.), convergence can be challenging for large cases (5-10M+ cells) and cases that exhibit unsteady flow or strong shear flows Stabilized solution advancement algorithm is in place 38
User-Interface GUI Follow as closely as possible the same design layout as Fluent solver TUI Specify observable Adjoint solution advancement controls Residual monitors Initialization and iteration Post-processing: contours, vectors. Results reporting Mesh-morphing with pre-calculation of expected change in observable. /adjoint> controls morphing/ reporting/ monitors/ observable/ run/ 39
Examples 40
Total Pressure Drop in a Bend Full discrete adjoint for shape sensitivity Frozen turbulence Reduce total pressure drop, DP, through system Baseline 13 2 DP = -232.8 Expect change 10.0 Actual change 9.0 DP = -223.8 Expect change 8.9 Actual change 6.9 DP = -216.9 Expect change 7.0 Actual change 3.1 DP = -213.8 Total improvement of 8% 41
Total Pressure Drop in a Duct Flow residuals Flow Adjoint residuals Outflow Goal is to reduce the total pressure drop through the system Set up and solve the adjoint system with a total pressure drop objective function 42
Total Pressure Drop in a Duct Total Pressure Drop (Pa) Geometry Predicted Result Original --- -22.0 Modified -14.8-18.3 Aggressive adjustment results in a 17% reduction in loss in just one design iteration 43
Summary The adjoint solver will be released with R14 An adjoint solver computes sensitivity data that can be used to aid with design decisions in 4 main ways: 1. Qualitative identification of critical parts of the system of interest. 2. Quantitative predictions of the optimal choice for a design change and a prediction of the effect of that change. 3. Aiding in the numerical analysis of the flow solution to improve solution quality. 4. Gradient-based optimization. Supporting technologies such as mesh morphing, and the application of design constraints, are seen as important. The adjoint solver for the present release is limited to steady incompressible flows, with other restrictions on models. 44