ugm2011 meshmorphing & adjoints - ansys customer ...€¢ adjoint solver • what does an...

44
© 2011 ANSYS, Inc. October 14, 2011 1 Mesh Morphing and the Adjoint Solver in ANSYS R14.0 Simon Pereira

Upload: lyque

Post on 22-May-2018

213 views

Category:

Documents


0 download

TRANSCRIPT

© 2011 ANSYS, Inc. October 14, 20111

Mesh Morphing and the Adjoint Solver in 

ANSYS R14.0

Simon Pereira

© 2011 ANSYS, Inc. October 14, 20112

• 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

Agenda

© 2011 ANSYS, Inc. October 14, 20113

FLUENT Morpher‐Optimization feature

© 2011 ANSYS, Inc. October 14, 20114

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

© 2011 ANSYS, Inc. October 14, 20115

Mesh MorphingApplies 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.

© 2011 ANSYS, Inc. October 14, 20116

Region Defined

ExamplesSome Basic examples…

Optimization based morphing…

BaselineModified

© 2011 ANSYS, Inc. October 14, 20117

Process

ORWhat if? OptimizerSetup CaseSetup Case

RunRun

Setup MorphSetup Morph

EvaluateEvaluate

Choose “best” design

Choose “best” design

RegionsRegions

ParametersParameters

DeformationDeformation

Setup CaseSetup Case

RunRun

Setup OptimizerSetup 

Optimizer

OptimizeOptimize

Optimal SolutionOptimal Solution

MorphMorph

OptimizerOptimizer Auto

© 2011 ANSYS, Inc. October 14, 20118

Objective Function

Baseline Design Optimized Design

• Objective Function: Equal flow rate• Objective Function: Equal flow rate

© 2011 ANSYS, Inc. October 14, 20119

Example – Simple Sedan

Sequential TabsSequential Tabs

• Define Control Region(s)• Define Control Region(s)

© 2011 ANSYS, Inc. October 14, 201110

Deformation Definition

• Define constraint(s) (if any)

• Select control points and prescribe the relative ranges of motion

• Define constraint(s) (if any)

• Select control points and prescribe the relative ranges of motion

© 2011 ANSYS, Inc. October 14, 201111

Optimizer Algorithms; Compass, Powell, Rosenbrock, Simplex, TorczonAlgorithms; Compass, Powell, Rosenbrock, Simplex, Torczon

Auto

• Optimize!• Optimize!

© 2011 ANSYS, Inc. October 14, 201112

ResultsIncompressible turbulent flow

Objective Function; Minimize Drag

Baseline Design Optimized Design

• Questions?

• Please contact ANSYS Tech support for help in applying this technology

• Questions?

• Please contact ANSYS Tech support for help in applying this technology

© 2011 ANSYS, Inc. October 14, 201113

RBF‐Morph

© 2011 ANSYS, Inc. October 14, 201114

RBF‐Morph

© 2011 ANSYS, Inc. October 14, 201115

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

© 2011 ANSYS, Inc. October 14, 201116

External flow example

© 2011 ANSYS, Inc. October 14, 201117

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.

© 2011 ANSYS, Inc. October 14, 201118

Ship hull: Series 60, CB=0.6

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 shapewith no displacement reduction

Reduction of the resistance

Test case description

Conducted by Pranzitelli & Caridi

© 2011 ANSYS, Inc. October 14, 201119

CAD

Mesh ICEM‐CFD

Baseline sim. Fluent

Workbench and RBF‐morph setup

DOE RUNS

Optimization

Final solution

operator

workben

ch

Process

grid cells

Coarse 331,652

Medium 692,984

Fine 1,274,742 CT ∆CT

Coarse 5.81x10-3 -2.52%

Medium 5.94x10-3 -0.34%

Fine 5.96x10-3 0%

Exp.* 5.96x10-3 -

© 2011 ANSYS, Inc. October 14, 201120

CAD

Mesh ICEM‐CFD

Baseline sim. Fluent

Workbench and RBF‐morph setup

DOE RUNS

Optimization

Final solution

operator

workben

ch

Process

Symmetry plane fixedMorphing domain definedEight cross sections specifiedSection deformation applied

© 2011 ANSYS, Inc. October 14, 201121

CAD

Mesh ICEM‐CFD

Baseline sim. Fluent

Workbench and RBF‐morph setup

DOE RUNS

Optimization

Final solution

operator

workben

ch

Process

DX builds a DOE and drives Fluent and RBF Morph 

Parameters are defined and transferred to the parameter set bar for use with ANSYS DesignXplorer

© 2011 ANSYS, Inc. October 14, 201122

• Design of Experiments

• 45 Design Points

• Solved in Batch

• Design of Experiments

• 45 Design Points

• Solved in Batch

• Input parameters• Input parameters

• Output parameters• Output parameters

• DOE Settings• DOE Settings

ANSYS DesignXplorer• Results• Results

• Sensitivity analysis• Sensitivity analysis

• Response Surface• Response Surface

© 2011 ANSYS, Inc. October 14, 201123

baseline

optimized

baseline

optimized

• Optimize• OptimizeOptimize with ANSYS DesignXplorer

Baseline Optimized

Fx 6.83N 6.29N

• 7.9% resistance reduction

• No volume reduction

• 7.9% resistance reduction

• No volume reduction

© 2011 ANSYS, Inc. October 14, 201124 *one Intel® i7 quad‐core processor, 2.8GHz

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

8 man hrs

2 CPU days

8 man hrs

2 CPU days

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: ??

~100 man hrs

2 CPU days (optimistically)

~100 man hrs

2 CPU days (optimistically)

© 2011 ANSYS, Inc. October 14, 201125

Fluent Adjoint

© 2011 ANSYS, Inc. October 14, 201126

Preface

• 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 dead‐ends.• 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.

© 2011 ANSYS, Inc. October 14, 201127

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.

What is an adjoint solution and how do we use those results?

© 2011 ANSYS, Inc. October 14, 201128

GOAL:  Identify features of a system design that are most influential in the performance of the system.

EXAMPLE:– 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 post‐processing step.

How to use the results ‐ Qualitative

High sensitivity – changes to shape have a big effect on drag

Low sensitivity – changes to shape have a small effect on drag

© 2011 ANSYS, Inc. October 14, 201129

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.

How to use the results ‐ Quantitative

Original P = ‐232.8 PaExpected change computed using the adjointand linear extrapolation =  10.0 PaMake the change and recompute the solution.Actual change = 9.0 Pa

BaselineModified

© 2011 ANSYS, Inc. October 14, 201130

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.

How to use the results – Solver Numerics

Baseline Mesh Adapted Mesh

Adapted MeshDetail

© 2011 ANSYS, Inc. October 14, 201131

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.

How to use the results – Optimization

0

10

20

30

40

50

60

70

80

90

100

0 10 20 30p t

ot[Pa]

Iteration

Initial design

Final design30% reduction in total pressure drop after 30 design iterations

© 2011 ANSYS, Inc. October 14, 201132

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

orAdjoint 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

How does an adjoint analysis fit into the familiar CFD workflow?

© 2011 ANSYS, Inc. October 14, 201133

– Mesh morphing– Mesh morphing & Adjoint Data– Mesh Morphing, Adjoint Data & Constraints

Supporting Technologies

© 2011 ANSYS, Inc. October 14, 201134

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

Mesh Morphing

© 2011 ANSYS, Inc. October 14, 201135

• Example: Sensitivity of lift to surface shape

• 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

Mesh Morphing & Adjoint Data

Flow

© 2011 ANSYS, Inc. October 14, 201136

The adjoint solution is determined based on the specific flow physics of the problem in hand.

The effect of other practical engineering constraints must also be taken into account.

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.

Mesh Morphing, Adjoint Data & Constraints

Fixed wall

Fixed wall

Moveable walls

© 2011 ANSYS, Inc. October 14, 201137

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 adjointsolution data for engineering purposes.

Fully parallelized

Gradient algorithm for shape modification– Mesh morphing using control points.

Adjoint‐based solution adaption

© 2011 ANSYS, Inc. October 14, 201138

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

Current Functionality

© 2011 ANSYS, Inc. October 14, 201139

GUI• Follow as closely as possible the same design layout as Fluent solver– 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.

TUI

User‐Interface

/adjoint> controls morphing/ reporting/monitors/ observable/ run/

/adjoint> controls morphing/ reporting/monitors/ observable/ run/

© 2011 ANSYS, Inc. October 14, 201140

Examples

© 2011 ANSYS, Inc. October 14, 201141

Full discrete adjoint for shape sensitivity

Frozen turbulence

Reduce total pressure drop, P, through system

Total Pressure Drop in a Bend

P = ‐232.8Expect change 10.0

Baseline1

Actual change 9.0P = ‐223.8Expect change 8.9

Actual change 6.9P = ‐216.9Expect change 7.0

2

Actual change 3.1P = ‐213.8

Total improvementof 8%

3

© 2011 ANSYS, Inc. October 14, 201142

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

Total Pressure Drop in a Duct

Flow residuals

Adjoint residuals

Flow

Outflow

© 2011 ANSYS, Inc. October 14, 201143

Aggressive adjustment results in a 17% reduction in loss in just one design iteration

Total Pressure Drop in a DuctTotal Pressure Drop (Pa)

Geometry Predicted Result

Original ‐‐‐ ‐22.0

Modified ‐14.8 ‐18.3

© 2011 ANSYS, Inc. October 14, 201144

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.

Summary