Adjoint theory & Solver in OpenFOAM - foamacademy.com · Adjoint theory & Solver in OpenFOAM GERMAN...
Transcript of Adjoint theory & Solver in OpenFOAM - foamacademy.com · Adjoint theory & Solver in OpenFOAM GERMAN...
![Page 1: Adjoint theory & Solver in OpenFOAM - foamacademy.com · Adjoint theory & Solver in OpenFOAM GERMAN OPENFOAM USER MEETING 2017 CHRISTOS KAPELLOS christos.kapellos@volkswagen.de TU](https://reader030.fdocuments.net/reader030/viewer/2022012310/5e13ea19e22cf44c5c39a70b/html5/thumbnails/1.jpg)
Adjoint theory & Solver in OpenFOAM GERMAN OPENFOAM USER MEETING 2017
CHRISTOS KAPELLOS [email protected] TU BRAUNSCHWEIG, 21.03.2017
![Page 2: Adjoint theory & Solver in OpenFOAM - foamacademy.com · Adjoint theory & Solver in OpenFOAM GERMAN OPENFOAM USER MEETING 2017 CHRISTOS KAPELLOS christos.kapellos@volkswagen.de TU](https://reader030.fdocuments.net/reader030/viewer/2022012310/5e13ea19e22cf44c5c39a70b/html5/thumbnails/2.jpg)
2 Group Research| Vehicle & Electronics| Vehicle Technology / CAE Methods (K-GERFG/V) | Christos Kapellos
AGENDA
• Adjoint theory: • Numerical Optimisation • Why do we need the adjoints? • Continuous adjoint formulation
• OpenFOAM Adjoint Solver:
• Our baseline: adjointShapeOptimizationFoam (version 2.3.1) • Enhance the code • Applications:
• pitzDaily • Airfoil 2D
![Page 3: Adjoint theory & Solver in OpenFOAM - foamacademy.com · Adjoint theory & Solver in OpenFOAM GERMAN OPENFOAM USER MEETING 2017 CHRISTOS KAPELLOS christos.kapellos@volkswagen.de TU](https://reader030.fdocuments.net/reader030/viewer/2022012310/5e13ea19e22cf44c5c39a70b/html5/thumbnails/3.jpg)
3 Group Research| Vehicle & Electronics| Vehicle Technology / CAE Methods (K-GERFG/V) | Christos Kapellos
INTRODUCTION
• Find the minimum of f(x)
• Analytical expression
• Here: 𝛻𝛻𝑓𝑓 = 2𝑥𝑥 , 𝑥𝑥𝑚𝑚𝑚𝑚𝑚𝑚 = 0
NUMERICAL OPTIMISATION
![Page 4: Adjoint theory & Solver in OpenFOAM - foamacademy.com · Adjoint theory & Solver in OpenFOAM GERMAN OPENFOAM USER MEETING 2017 CHRISTOS KAPELLOS christos.kapellos@volkswagen.de TU](https://reader030.fdocuments.net/reader030/viewer/2022012310/5e13ea19e22cf44c5c39a70b/html5/thumbnails/4.jpg)
4 Group Research| Vehicle & Electronics| Vehicle Technology / CAE Methods (K-GERFG/V) | Christos Kapellos
INTRODUCTION
x0
𝜵𝜵𝒇𝒇
x1
f0
f1
𝜵𝜵𝒇𝒇
x2
f2
f3
x3
• In the computational world the analytic functions are not known
• A simulation is a black box with specific inputs and outputs (i.e. Input: Car geometry, flow conditions – Output: Flow field, drag force)
• To optimise an output (Objective Function) with respect to an input (Design Variables) we need the gradient
NUMERICAL OPTIMISATION
• An accurate and fast way to compute the gradient is needed!!
• A way is with Finite Differences: 𝑑𝑑𝑓𝑓𝑑𝑑𝑥𝑥 =
𝑓𝑓+ − 𝑓𝑓−𝑥𝑥+ − 𝑥𝑥−
![Page 5: Adjoint theory & Solver in OpenFOAM - foamacademy.com · Adjoint theory & Solver in OpenFOAM GERMAN OPENFOAM USER MEETING 2017 CHRISTOS KAPELLOS christos.kapellos@volkswagen.de TU](https://reader030.fdocuments.net/reader030/viewer/2022012310/5e13ea19e22cf44c5c39a70b/html5/thumbnails/5.jpg)
5 Group Research| Vehicle & Electronics| Vehicle Technology / CAE Methods (K-GERFG/V) | Christos Kapellos
ADJOINT METHOD
• Primal Equations • Objective Function • Differentiation of these:
INTRODUCTION
![Page 6: Adjoint theory & Solver in OpenFOAM - foamacademy.com · Adjoint theory & Solver in OpenFOAM GERMAN OPENFOAM USER MEETING 2017 CHRISTOS KAPELLOS christos.kapellos@volkswagen.de TU](https://reader030.fdocuments.net/reader030/viewer/2022012310/5e13ea19e22cf44c5c39a70b/html5/thumbnails/6.jpg)
6 Group Research| Vehicle & Electronics| Vehicle Technology / CAE Methods (K-GERFG/V) | Christos Kapellos
ADJOINT METHOD
• Direct Problem
• Adjoint Problem
INTRODUCTION
![Page 7: Adjoint theory & Solver in OpenFOAM - foamacademy.com · Adjoint theory & Solver in OpenFOAM GERMAN OPENFOAM USER MEETING 2017 CHRISTOS KAPELLOS christos.kapellos@volkswagen.de TU](https://reader030.fdocuments.net/reader030/viewer/2022012310/5e13ea19e22cf44c5c39a70b/html5/thumbnails/7.jpg)
7 Group Research| Vehicle & Electronics| Vehicle Technology / CAE Methods (K-GERFG/V) | Christos Kapellos
CONTINUOUS ADJOINT FORMULATION
• Navier-Stokes Equations:
• Generic objective Function
• Augmented objective functions
![Page 8: Adjoint theory & Solver in OpenFOAM - foamacademy.com · Adjoint theory & Solver in OpenFOAM GERMAN OPENFOAM USER MEETING 2017 CHRISTOS KAPELLOS christos.kapellos@volkswagen.de TU](https://reader030.fdocuments.net/reader030/viewer/2022012310/5e13ea19e22cf44c5c39a70b/html5/thumbnails/8.jpg)
8 Group Research| Vehicle & Electronics| Vehicle Technology / CAE Methods (K-GERFG/V) | Christos Kapellos
CONTINUOUS ADJOINT FORMULATION
• Differentiation of the augmented function: • where:
![Page 9: Adjoint theory & Solver in OpenFOAM - foamacademy.com · Adjoint theory & Solver in OpenFOAM GERMAN OPENFOAM USER MEETING 2017 CHRISTOS KAPELLOS christos.kapellos@volkswagen.de TU](https://reader030.fdocuments.net/reader030/viewer/2022012310/5e13ea19e22cf44c5c39a70b/html5/thumbnails/9.jpg)
9 Group Research| Vehicle & Electronics| Vehicle Technology / CAE Methods (K-GERFG/V) | Christos Kapellos
CONTINUOUS ADJOINT FORMULATION
• Product Rule:
• Green-Gauss theorem:
![Page 10: Adjoint theory & Solver in OpenFOAM - foamacademy.com · Adjoint theory & Solver in OpenFOAM GERMAN OPENFOAM USER MEETING 2017 CHRISTOS KAPELLOS christos.kapellos@volkswagen.de TU](https://reader030.fdocuments.net/reader030/viewer/2022012310/5e13ea19e22cf44c5c39a70b/html5/thumbnails/10.jpg)
10 Group Research| Vehicle & Electronics| Vehicle Technology / CAE Methods (K-GERFG/V) | Christos Kapellos
CONTINUOUS ADJOINT FORMULATION
• Applying these rules:
![Page 11: Adjoint theory & Solver in OpenFOAM - foamacademy.com · Adjoint theory & Solver in OpenFOAM GERMAN OPENFOAM USER MEETING 2017 CHRISTOS KAPELLOS christos.kapellos@volkswagen.de TU](https://reader030.fdocuments.net/reader030/viewer/2022012310/5e13ea19e22cf44c5c39a70b/html5/thumbnails/11.jpg)
11 Group Research| Vehicle & Electronics| Vehicle Technology / CAE Methods (K-GERFG/V) | Christos Kapellos
CONTINUOUS ADJOINT FORMULATION
• Applying these rules:
![Page 12: Adjoint theory & Solver in OpenFOAM - foamacademy.com · Adjoint theory & Solver in OpenFOAM GERMAN OPENFOAM USER MEETING 2017 CHRISTOS KAPELLOS christos.kapellos@volkswagen.de TU](https://reader030.fdocuments.net/reader030/viewer/2022012310/5e13ea19e22cf44c5c39a70b/html5/thumbnails/12.jpg)
12 Group Research| Vehicle & Electronics| Vehicle Technology / CAE Methods (K-GERFG/V) | Christos Kapellos
,
“Adjoint Methods for Turbulent Flows, Applied to Shape or Topology
Optimization and Robust Design”, E. Papoutsis-Kiachagias, PhD Thesis
![Page 13: Adjoint theory & Solver in OpenFOAM - foamacademy.com · Adjoint theory & Solver in OpenFOAM GERMAN OPENFOAM USER MEETING 2017 CHRISTOS KAPELLOS christos.kapellos@volkswagen.de TU](https://reader030.fdocuments.net/reader030/viewer/2022012310/5e13ea19e22cf44c5c39a70b/html5/thumbnails/13.jpg)
13 Group Research| Vehicle & Electronics| Vehicle Technology / CAE Methods (K-GERFG/V) | Christos Kapellos
CONTINUOUS ADJOINT FORMULATION
• Field Adjoint Equations
![Page 14: Adjoint theory & Solver in OpenFOAM - foamacademy.com · Adjoint theory & Solver in OpenFOAM GERMAN OPENFOAM USER MEETING 2017 CHRISTOS KAPELLOS christos.kapellos@volkswagen.de TU](https://reader030.fdocuments.net/reader030/viewer/2022012310/5e13ea19e22cf44c5c39a70b/html5/thumbnails/14.jpg)
14 Group Research| Vehicle & Electronics| Vehicle Technology / CAE Methods (K-GERFG/V) | Christos Kapellos
CONTINUOUS ADJOINT FORMULATION
• Boundary conditions at inlet:
![Page 15: Adjoint theory & Solver in OpenFOAM - foamacademy.com · Adjoint theory & Solver in OpenFOAM GERMAN OPENFOAM USER MEETING 2017 CHRISTOS KAPELLOS christos.kapellos@volkswagen.de TU](https://reader030.fdocuments.net/reader030/viewer/2022012310/5e13ea19e22cf44c5c39a70b/html5/thumbnails/15.jpg)
15 Group Research| Vehicle & Electronics| Vehicle Technology / CAE Methods (K-GERFG/V) | Christos Kapellos
CONTINUOUS ADJOINT FORMULATION
• Boundary condition at outlet:
![Page 16: Adjoint theory & Solver in OpenFOAM - foamacademy.com · Adjoint theory & Solver in OpenFOAM GERMAN OPENFOAM USER MEETING 2017 CHRISTOS KAPELLOS christos.kapellos@volkswagen.de TU](https://reader030.fdocuments.net/reader030/viewer/2022012310/5e13ea19e22cf44c5c39a70b/html5/thumbnails/16.jpg)
16 Group Research| Vehicle & Electronics| Vehicle Technology / CAE Methods (K-GERFG/V) | Christos Kapellos
CONTINUOUS ADJOINT FORMULATION
• Boundary condition at walls:
![Page 17: Adjoint theory & Solver in OpenFOAM - foamacademy.com · Adjoint theory & Solver in OpenFOAM GERMAN OPENFOAM USER MEETING 2017 CHRISTOS KAPELLOS christos.kapellos@volkswagen.de TU](https://reader030.fdocuments.net/reader030/viewer/2022012310/5e13ea19e22cf44c5c39a70b/html5/thumbnails/17.jpg)
17 Group Research| Vehicle & Electronics| Vehicle Technology / CAE Methods (K-GERFG/V) | Christos Kapellos
• Sensitivity derivatives:
![Page 18: Adjoint theory & Solver in OpenFOAM - foamacademy.com · Adjoint theory & Solver in OpenFOAM GERMAN OPENFOAM USER MEETING 2017 CHRISTOS KAPELLOS christos.kapellos@volkswagen.de TU](https://reader030.fdocuments.net/reader030/viewer/2022012310/5e13ea19e22cf44c5c39a70b/html5/thumbnails/18.jpg)
18 Group Research| Vehicle & Electronics| Vehicle Technology / CAE Methods (K-GERFG/V) | Christos Kapellos
CONTINUOUS ADJOINT FORMULATION
• Navier-Stokes for topology optimisation:
• Extra “porosity” term:
TOPOLOGY OPTIMISATION
![Page 19: Adjoint theory & Solver in OpenFOAM - foamacademy.com · Adjoint theory & Solver in OpenFOAM GERMAN OPENFOAM USER MEETING 2017 CHRISTOS KAPELLOS christos.kapellos@volkswagen.de TU](https://reader030.fdocuments.net/reader030/viewer/2022012310/5e13ea19e22cf44c5c39a70b/html5/thumbnails/19.jpg)
19 Group Research| Vehicle & Electronics| Vehicle Technology / CAE Methods (K-GERFG/V) | Christos Kapellos
CONTINUOUS ADJOINT FORMULATION
• Field adjoint equations with porosity:
• Sensitivities wrt. porosity:
TOPOLOGY OPTIMISATION
![Page 20: Adjoint theory & Solver in OpenFOAM - foamacademy.com · Adjoint theory & Solver in OpenFOAM GERMAN OPENFOAM USER MEETING 2017 CHRISTOS KAPELLOS christos.kapellos@volkswagen.de TU](https://reader030.fdocuments.net/reader030/viewer/2022012310/5e13ea19e22cf44c5c39a70b/html5/thumbnails/20.jpg)
20 Group Research| Vehicle & Electronics| Vehicle Technology / CAE Methods (K-GERFG/V) | Christos Kapellos
APPLICATIONS
• Objective Function: Power Losses
• Field Adjoint Equations
PITZ DAILY
![Page 21: Adjoint theory & Solver in OpenFOAM - foamacademy.com · Adjoint theory & Solver in OpenFOAM GERMAN OPENFOAM USER MEETING 2017 CHRISTOS KAPELLOS christos.kapellos@volkswagen.de TU](https://reader030.fdocuments.net/reader030/viewer/2022012310/5e13ea19e22cf44c5c39a70b/html5/thumbnails/21.jpg)
21 Group Research| Vehicle & Electronics| Vehicle Technology / CAE Methods (K-GERFG/V) | Christos Kapellos
APPLICATIONS
• Inlet boundary condition:
• Outlet boundary condition:
• Sensitivity derivatives:
PITZ DAILY
![Page 22: Adjoint theory & Solver in OpenFOAM - foamacademy.com · Adjoint theory & Solver in OpenFOAM GERMAN OPENFOAM USER MEETING 2017 CHRISTOS KAPELLOS christos.kapellos@volkswagen.de TU](https://reader030.fdocuments.net/reader030/viewer/2022012310/5e13ea19e22cf44c5c39a70b/html5/thumbnails/22.jpg)
22 Group Research| Vehicle & Electronics| Vehicle Technology / CAE Methods (K-GERFG/V) | Christos Kapellos
APPLICATIONS
• Objective Function: Drag
• Field Adjoint Equations
2D AIRFOIL
![Page 23: Adjoint theory & Solver in OpenFOAM - foamacademy.com · Adjoint theory & Solver in OpenFOAM GERMAN OPENFOAM USER MEETING 2017 CHRISTOS KAPELLOS christos.kapellos@volkswagen.de TU](https://reader030.fdocuments.net/reader030/viewer/2022012310/5e13ea19e22cf44c5c39a70b/html5/thumbnails/23.jpg)
23 Group Research| Vehicle & Electronics| Vehicle Technology / CAE Methods (K-GERFG/V) | Christos Kapellos
APPLICATIONS
• Wall boundary condition:
• Outlet boundary condition:
• Sensitivity derivatives:
2D AIRFOIL