Model Order Reduction for Aerodynamic Lifting Surfaces

Gonçalo da Cunha Laboreiro Mendonça

Thesis to obtain the Master of Science Degree in Aerospace Engineering

Supervisors: Prof. Fernando José Parracho Lau Dr. Frederico José Prata Rente Reis Afonso

Examination Committee Chairperson: Prof. Filipe Szolnoky Ramos Pinto Cunha Supervisor: Prof. Fernando José Parracho Lau Member of the Committee: Prof. Afzal Suleman

November 2017 ii Dedicated to my family and friends, who were always there for me.

iii iv Acknowledgments

I would like to thank dearly my supervisors Prof. Lau and Dr. Afonso who gave me constant support throughout this thesis up until the very end. Their insights on aerodynamics and CFD models guided me in my research of model order reduction methods and allowed me to better understand the models with which I had to work. Their demands for rigor and quality also pushed me to better my work, and in the end write a better thesis.

v vi Resumo

Nesta tese o tema de reduc¸ao˜ de modelos e a sua aplicac¸ao˜ a Mecanicaˆ de Fluidos Computacional sao˜ abordados. E´ mostrada a necessidade da industria´ aeroespacial, seja nacional ou Europeia, de modelos mais rapidos´ mas fieis´ a` realidade. Isto e´ devido ao elevado tempo de calculo´ associado aos modelos de alta-fidelidade. Estes mostram-se pouco viaveis´ para aplicac¸oes˜ do tipo Optimizac¸ao˜ Multi- disciplinar, como a plataforma de optimizac¸ao˜ NOVEMOR. Tendo por objectivo testar e aplicar reduc¸ao˜ de modelos a modelos CFD de superf´ıcies sustentadoras, uma pesquisa bibliografica´ abrangendo a reduc¸ao˜ de modelos nao-lineares,˜ dinamicosˆ e ou estaticos´ foi feita. Esta demonstrou a predominanciaˆ dos metodos´ de Projecc¸ao˜ de Galerkin e Reduc¸ao˜ por M´ınimos Quadrados, que funcionam atraves´ da Decomposic¸ao˜ Propria´ Ortogonal de soluc¸oes˜ obtidas do modelo a reduzir. Tecnicas´ complementares de amostragem e reduc¸ao˜ h´ıbrida tambem´ sao˜ apresentadas e discutidas. Os metodos´ de Projecc¸ao˜ e M´ınimos Quadrados sao˜ testados em modelos-referenciaˆ presentes na literatura, e o seu desem- penho em tempo e erro suplementar e´ analisado. Modelos dinamicos,ˆ estaticos,´ nao-lineares˜ e mul- tiparametricos´ foram reduzidos, com as versoes˜ mais simples dos metodos´ referidos a apresentar um desempenho superior. Estes metodos´ foram depois aplicados a problemas de fluidos uni-parametricos,´ nomeadamente a` cavidade a tampa movel´ com Navier-Stokes incompress´ıvel e Reynolds variavel,´ e ao perfil RAE-2822 com compress´ıvel e anguloˆ de ataque variavel.´ No final da tese o desem- penho dos metodos´ de reduc¸ao˜ e´ analisado, demonstrando-se o tempo de calculo´ menor obtido e os problemas com modelos multi-parametricos´ ou com singularidades locais.

Palavras-chave: Reduc¸ao˜ de Modelos,Projecc¸ao˜ de Galerkin, Reduc¸ao˜ por M´ınimos Quadra- dos, Decomposic¸ao˜ Propria´ Ortogonal , Mecanicaˆ de Flu´ıdos Computacional

vii viii Abstract

In this thesis the subject of model reduction and its application to Computational Fluid Dynamics is ex- plored. We show the need of the aerospace industry, at national or European level, of faster yet reliable models. This need is linked to the time cost of high-fidelity models, rendering them inefficient for ap- plications like Multi-Disciplinary Optimization, implemented in the NOVEMOR framework. With the goal of testing and applying model reduction to CFD models applicable to lifting surfaces, a bibliographical research covering reduction of non-linear, dynamic or static models was done. This established the prevalence of Projection and Least Mean Squares methods, which rely on solutions of the original high- fidelity model and their Proper Orthogonal Decomposition to work. Other complementary techniques such as adaptive sampling, greedy sampling and hybrid models are also presented and discussed. These Projection and Least Mean Squares methods are then tested on simple and documented bench- marks, to test the error and speed-up of the reduced order models thus generated. Dynamic, static, non-linear and multi-parametric problems were reduced, with the simplest version of these methods showing the most promise. These methods were later applied to single parameter problems, namely the lid-driven cavity with Incompressible Navier-Stokes and varying Reynolds, and the RAE-2822 airfoil at varying angles of atack for compressible Euler flow. An analysis of the performance of these methods is given at the end of this thesis, highlighting the computational speed-up obtained with these techniques, and the challenges presented by multi-parametric problems and problems showing point singularities in their domain.

Keywords: Model Order Reduction, Galerkin Projection, Least Mean Squares Reduction, Proper Orthogonal Decomposition, Computational Fluid Dynamics

ix x Contents

Acknowledgments...... v Resumo...... vii Abstract...... ix List of Tables...... xiii List of Figures...... xv Nomenclature...... xix Glossary...... xxi

1 Introduction 1 1.1 Motivation...... 1 1.2 Topic Overview...... 2 1.3 Objectives...... 4 1.4 Thesis Outline...... 4

2 Model reduction methods7 2.1 Model Reduction methods...... 7 2.1.1 A posteriori methods...... 7 2.1.2 A priori methods - the PGD...... 11 2.2 Basis creation...... 12 2.2.1 Proper Orthogonal Decomposition...... 13 2.2.2 Compact POD...... 16 2.2.3 Error Estimation and control...... 17 2.3 Sampling...... 18 2.3.1 Quad-Tree exploration with leave-one-out error cross validation...... 19 2.3.2 Kriging-based greedy search...... 20 2.3.3 Fast low-rank modifications of the SVD...... 21 2.3.4 Argument error estimation...... 21 2.4 Precision...... 22 2.4.1 Stability preservation...... 22 2.4.2 Hybrid Methods...... 23

xi 3 Reduction of Benchmarks 25 3.1 Introduction...... 25 3.2 Advection - dynamical...... 26 3.2.1 Methods Applied...... 27 3.2.2 Results and Discussion...... 27 3.3 Oscillatory...... 29 3.3.1 Methods Applied...... 31 3.3.2 Results and Discussion...... 31 3.4 Advection - static...... 34 3.4.1 Methods Applied...... 35 3.4.2 Results and Discussion...... 35 3.5 Diffusion - static...... 40 3.5.1 Methods Applied...... 41 3.5.2 Results and Discussion...... 41 3.6 Conclusion...... 43

4 CFD Analysis and Reduction 45 4.1 Introduction...... 45 4.2 Choice of Solver...... 45 4.3 Incompressible Navier Stokes...... 48 4.3.1 Verification...... 49 4.3.2 Validation...... 52 4.3.3 Reduction...... 57 4.4 Compressible Euler...... 65 4.4.1 Verification...... 66 4.4.2 Validation...... 66 4.4.3 Reduction...... 70

5 Conclusions 77 5.1 Achievements...... 78 5.2 Future Work...... 78

Bibliography 79

xii List of Tables

3.1 Relative errors for ROM of order 5 for different POD methods and different ∆S for the Dynamic Advection problem...... 29 3.2 Effect of the order of the integration method on the error for ROM of order 5, ∆S = 5 for the Dynamic Advection problem. We give the difference relative to the case of rectangle integration, in other words, we present ei−e0 , where i is the order of the integration method. 29 e0 3.3 Wall Clock times for the HDM and ROM for the Dynamic Advection problem. The time does not depend on the method for basis generation, being the same for whatever snap- shot set or POD used. Values taken are approximate averages...... 29 3.4 Relative errors for the different snapshot sets for a ROM of order 6 for the Oscillatory Problem...... 32 3.5 Wall clock time for ROM and HDM solves (left) and SVD computation time for different snapshot sets (right) for Oscillatory problem...... 33 3.6 Relative errors for a ROM of order 6 for the Static Advection Problem. The errors for the System Induced POD (not shown), are all superior to 10.000 %...... 36 3.7 Wall clock times for the HDM, SVD computation and the several ROMs for the Static Advection problem. The ROMs using the Output or System Oriented take slightly more than one hour to compute...... 38 3.8 Coefficients used in [74] (left) and made available in [75] (right) for Static Diffusion Prob- lem. The coefficients at the right will be used for our model...... 40 3.9 Relative errors for ROM of order 6 for different reduction methods and snapshot sets for the nonlinear static diffusion problem...... 41 3.10 Computation times for the nonlinear static diffusion problem. Top : solution times in sec- onds for the HDM (top), Galerkin ROMs using ”fsolve” for ∆S = 1 and ∆S = 3 (left), the Least Mean Squares ROM using ”leastsq” (middle) and the Galerkin ROM with ∆S = 3 using ”leastsq” (right). Bottom : representative values of POD calculation times in seconds for different values of ∆S...... 43

4.1 Solver Decision Matrix. SU(2) is the baseline choice from which we make our comparison. 48 4.2 Relative deviation of the model from references [113] (Ghia or ”G”) and [112] (Erturk or ”E”). u refers to horizontal velocity data at the vertical centerline, v to the vertical velocity data at the horizontal centerline, ω to the vorticity data at the lid...... 53

xiii 4.3 Numerical result of the product of V T V for the modes obtained by us...... 59 4.4 Numerical result of the product of V T V for the original modes of the script...... 59 4.5 Scalability test results for Re = 201. We also include the time spent assembling the HDM

matrices per each solve as tAssembly. The solution time for the ROM is given in seconds and as a percentage of the HDM solution time...... 62 4.6 Scalability test results for Re = 201 for the (Lin) initialization...... 64 4.7 Different mesh cases used for validation of the solver and the element sizes defined at the boundaries of different zones of the domain. Element size is given relative to the chord. Element quality interval and average is given at the last two columns...... 67

4.8 Numerical CL and CD data, with residue data for the FreeFem++ solver. The experimental

AGARD data gives CL = 0.522 and CD = 0.0101...... 70 4.9 Scalability test results for Rae-2822 for AoA = 6 degrees. The solution time for the ROM is given in seconds and as a percentage of the HDM solution time. In the last two columns the Cauchy Residue for the Lift and Drag coefficients computed by the ROM are given.. 74

xiv List of Figures

3.1 At the left, the purple area is the dynamical advection problem domain, the heater is the point where we will measure the temperature vs time. At the right, the outputs. Both images were taken from [61]...... 26 3.2 Response of the full order model and a selected ROM for the Dynamic Advection problem. 28 3.3 Ordered Eigenvalues of the POD of the Dynamic Advection problem...... 28 3.4 Error of the ROM of the Dynamic Advection problem for 100 Snapshots...... 30 3.5 Error of the ROM of the Dynamic Advection problem for 20 Snapshots...... 30 3.6 Error of the ROM of the Dynamic Advection problem for 20 Snapshots with Goal Oriented POD...... 30 3.7 Analytical solution of the two body problem described in [70] and [71] versus the coded Newmark solver for a timestep ∆t of 0.1 ...... 31 3.8 Response of the full order model and a selected ROM of order 6 and ∆S = 30 for the Oscillatory problem...... 32 3.9 Ordered Eigenvalues of the POD of the Oscillatory problem...... 32 3.10 ROM error for ∆S=3 with Standard POD for the Oscillatory problem...... 33 3.11 ROM error for ∆S=10 with Standard POD for the Oscillatory problem...... 33 3.12 ROM error for ∆S=30 with Standard POD for the Oscillatory problem...... 34 3.13 The multi-parametric problem described in [72] (left) and the expected HDM response (right)...... 34 3.14 Computed HDM and chosen ROM of order 6 ∆S = 10 response for the Static Advection problem...... 36 3.15 Magnitude of the ordered Eigenvalues of the POD of the Static Advection problem..... 36 3.16 ROM error for ∆S=1 with Standard POD for the Static Advection problem...... 38 3.17 ROM error for ∆S=5 with Least Mean Squares Reduction Standard ROM for the Static Advection problem...... 38 3.18 ROM error for ∆S=5 with Standard POD for the Static Advection problem...... 38 3.19 ROM error for ∆S=5 with System Induced POD for the Static Advection problem...... 39 3.20 ROM error for ∆S=10 with Output Oriented POD for the Static Advection problem..... 39 3.21 ROM error for ∆S=10 with Standard POD for the Static Advection problem...... 39

xv 3.22 ROM error for ∆S=10 with Least Mean Squares Reduction Standard ROM for the Static Advection problem...... 39 3.23 Static Diffusion Problem in [74]. In our model there is no heat flux coming from the left. Since our model has different coefficients, the responses should be slightly different.... 40 3.24 HDM response and chosen ROM of order 6 for δS=3 response for the nonlinear static diffusion problem. The original model in [74] only went up to 350.000 W/m2 of input heat flux...... 42 3.25 Ordered Eigenvalues of the POD for the nonlinear static diffusion problem...... 42 3.26 Error of the Galerkin ROM with ∆S = 1 for the nonlinear static diffusion problem. The collinear and Total errors are superposed. In the same fashion, the Orthogonal and Pre- dicted Orthogonal errors are superposed...... 43 3.27 Error of the Galerkin ROM with ∆S = 3 for the nonlinear static diffusion problem, meaning a total of 7 snapshots were taken. The collinear and Total errors are superposed...... 44 3.28 Error of the Least Mean Squares ROM with ∆S = 3 for the nonlinear static diffusion problem, meaning a total of 7 snapshots were taken. The ”leastsq” function was used for this case...... 44

4.1 Representation of the lid-driven cavity problem taken from [112].Here, u is the horizontal component of the velocity and v is the vertical component of the velocity...... 50 4.2 First mode supplied in [109]. Velocity vector plot...... 50 4.3 First mode obtained from the script. Velocity vector plot...... 50 4.4 Second mode supplied in [109]. Velocity vector plot...... 50 4.5 Second obtained mode. Velocity vector plot...... 50 4.6 Third mode supplied in [109]. Velocity vector plot...... 50 4.7 Third obtained mode. Velocity vector plot...... 50 4.8 Fourth mode supplied in [109]. Velocity vector plot...... 51 4.9 Fourth obtained mode. Velocity vector plot...... 51 4.10 ROM response for Re = 101 in [109]. Velocity vector plot...... 51 4.11 ROM response for Re = 101 obtained. Velocity vector plot...... 51 4.12 Velocity error (magnitude of) for the original script’s ROM for Re = 101...... 51 4.13 Mesh generated by the script...... 52 4.14 Mesh pattern used for validation...... 52 4.15 Convergence of the different validation cases...... 54 4.16 Vertical velocity at the horizontal centerline for low Reynolds...... 54 4.17 Vertical velocity at the horizontal centerline for Reynolds = 5 000...... 54 4.18 Vertical velocity at the horizontal centerline for Reynolds = 10 000...... 54 4.19 Horizontal velocity at the vertical centerline for low Reynolds...... 54 4.20 Horizontal velocity at the vertical centerline for Reynolds = 5 000...... 54 4.21 Horizontal velocity at the vertical centerline for Reynolds = 10 000...... 55

xvi 4.22 Vorticity at the lid for Re = 10 000...... 55 4.23 Vorticity at the lid...... 55 4.24 Streamlines obtained by [113] for Re = 100...... 55 4.25 Streamlines obtained with script for (192x192) Re = 100...... 55 4.26 Streamlines obtained by [113] for Re = 400...... 55 4.27 Streamlines obtained with script for (192x192) Re = 400...... 56 4.28 Streamlines obtained by [113] for Re = 1000...... 56 4.29 Streamlines obtained with script for (192x192) Re = 1000...... 56 4.30 Streamlines obtained by [113] for Re = 5000...... 56 4.31 Streamlines obtained with script for (297x297) Re = 5000...... 56 4.32 Streamlines obtained by [113] for Re = 10 000...... 56 4.33 Streamlines obtained with script for (400x400) Re = 10 000 after 70 iterations...... 56 4.34 Streamlines obtained with script for (400x400) Re = 10 000 after 140 iterations...... 56 4.35 Velocity field for Re = 1...... 60 4.36 Velocity field for Re = 51...... 60 4.37 Velocity field for Re = 101...... 60 4.38 Velocity field for Re = 151...... 60 4.39 1st POD mode computed through our method...... 60 4.40 2nd POD mode computed through our method...... 60 4.41 3rd POD mode computed through our method...... 60 4.42 4th POD mode computed through our method...... 60 4.43 1st Mode computed from the original script, with the average...... 60 4.44 2nd Mode computed from the original script, with the average...... 60 4.45 3rd Mode computed from the original script, with the average...... 60 4.46 4th Mode computed from the original script, with the average...... 60 4.47 Relative Velocity error of the constructed ROM for different Reynolds numbers for the mesh given in 4.13. Values below 10−3 are not shown...... 62 4.48 Relative pressure error of the constructed ROM for different Reynolds numbers for the mesh given in 4.13. Values below 10−3 are not shown...... 62 4.49 Pressure calculated by the ROM made from the mesh in figure 4.13 for Re=210...... 62 4.50 Pressure calculated by the HDM made from the mesh in figure 4.13 for Re=210...... 62 4.51 Evolution of the cost functional throughout the iterations of the HDM for several Reynolds’ numbers...... 63 4.52 Evolution of the L-2 norm of the gradient of the cost functional throughout the iterations of the HDM for several Reynolds’ numbers...... 63 4.53 Relative Velocity error of the constructed ROM for different Reynolds numbers for the mesh given in 4.13. Values below 10−3 are not shown...... 65 4.54 Relative pressure error of the constructed ROM for different Reynolds numbers for the mesh given in 4.13. Values below 10−3 are not shown...... 65

xvii 4.55 Initial mesh given in [101]...... 67 4.56 Initial mesh obtained from the script...... 67 4.57 Final mesh given in [101]. Velocity vector plot...... 67 4.58 Final mesh obtained from the script...... 67 4.59 Pressure given in [101]...... 67 4.60 Pressure obtained from the script...... 67 4.61 Density given in [101]...... 68 4.62 Density obtained from the script...... 68 4.63 Experimental [80] and numerical (FreeFem++) Cp data for the RAE-2822. Leading edge is at x/c = 0...... 71 4.64 Experimental [80] and numerical (SU2) Cp data for the RAE-2822. Leading edge is at x/c = 0...... 71 4.65 Cp obtained with the FreeFem++ script for the Very Fine mesh...... 71 4.66 Cp obtained with SU(2) for the Normal mesh...... 71 4.67 Mach obtained with the FreeFem++ script for the Very Fine mesh...... 72 4.68 Mach obtained with SU(2) for Normal mesh...... 72 4.69 Vorticity obtained with the FreeFem++ script for the Very Fine mesh...... 72 4.70 Relative error results for the sweep the RAE-2822 model...... 75 4.71 Relative error results for the sweep the original supersonic model in [101]...... 75 4.72 Aerodynamic coefficients for the sweep the RAE-2822 model...... 75 4.73 Aerodynamic coefficients for the sweep the original supersonic model in [101]...... 75 4.74 Ratio of the Cauchy residues in pressure for the supersonic airfoil in [101]...... 75 4.75 Pressure (Pa) distribution for the RAE-2822 HDM with the Normal mesh for an AoA of 6 degrees...... 76 4.76 Pressure (Pa) distribution for the RAE-2822 ROM with the Normal mesh for an AoA of 6 degrees...... 76

xviii Nomenclature

Greek symbols

µ Model parameter(s).

Roman symbols

D CD Drag coefficient. Calculated as CD = 2 , where ρ∞ is the free stream density, u∞ is the 0.5×ρ∞u∞c free stream velocity and c the airfoil’s chord.

L CL Lift coefficient. Calculated as CL = 2 , where ρ∞ is the free stream density, u∞ is the 0.5×ρ∞u∞c free stream velocity and c the airfoil’s chord.

p−p∞ Cp Pressure coefficient. Calculated as Cp = 2 , where ρ∞ is the free stream density, u∞ is 0.5×ρ∞u∞

the free stream velocity and p∞ the free stream pressure and p the local pressure (meaning the pressure that is being analyzed).

D Drag. Force with the same direction as the velocity of the airfoil relative to the fluid but acting opposite to it. It opposes the motion an object through the fluid. e Error. e⊥ Orthogonal error. Defined later in detail in the thesis. It is the error component of the ROM orthogonal to the subspace defined by V

priori e⊥ A priori orthogonal error. Defined later in detail in the thesis. It is the error component of the ROM orthogonal to the subspace defined by V predicted through the analysis of the singular values of S. et Total error. Defined later in detail in the thesis. It is the sum of the Collinear and Orthogonal Errors. e// Collinear error. Defined later in detail in the thesis. It is the error component of the ROM in the subspace defined by V f State function, which is used to write the full order model equations, once they are discretized via finite difference, finite elements, finite volumes or any other method. k Model order of the ROM. The number of variables in the ROM.

xix L Lift. Force perpendicular to the velocity of the airfoil relative to the fluid. In flight this force is used to oppose Earth’s Gravity. n Model order of the HDM. The number of variables in the HDM. q Reduced state variable. It is the state variable of the reduced-order model The number of linearly independent solutions in the snapshot matrix. For POD ROMs, k ≤ r.

S Snapshot Matrix. A matrix with solutions of the HDM for various time and parameter values multiplied by integration weights if several time instants are present for one parameter value.

V Reduced basis, modal basis, or functional basis (if the PDE is discretized via finite elements V can be linked back to the PDE by doing V (x) = V ×φ(x), where φ(x) is the test function basis for the finite elements). V transforms data in the reduced state space into the full order state space. w Full order model state variable(s)

Subscripts

∞ Free-stream condition. i, j Computational indexes. x, y, z Cartesian components.

Superscripts

T Transpose.

xx Glossary

CAD Computer Aided Design. CAE Computer Aided Engineering. CFD Computational Fluid Dynamics. FEM Finite Element Method. FVM Finite Volume Method. HDM High Definition Model or High Fidelity Model or Full-Order Model. It’s a semi-discretized model that well describes a certain problem. This is the model we are trying to reduce LMSQ Least Mean Squares. In the context of this the- sis it refers to a model reduction method that attempts to reduce a residue. MDO Multidisciplinary Optimization. An example in the context of aircraft is to find both the struc- ture (fuselage, spars) and aerodynamic shape (wings, rotors) that maximizes the range of the vehicle, while accounting for the interactions between the former. This contrasts with single discipline optimization, which would be finding the lightest structure for a given flight load, or finding the aerodynamic shape with least drag for a given flight condition. MEMS MicroElectroMechanical Systems. One exam- ple is a micro gyroscope sensor. MOR Model Order Reduction. To create a ROM from a HDM. ODE Ordinary Differential Equation. PDE Partial Differential Equation.

xxi ROM Reduced Order Model. A model built from the HDM with less variables that attempts to solve the same problem as the HDM, but with a devi- ation relative to the HDM. It is supposed to be faster to compute than the HDM. SVD Singular Value Decomposition. The decompo- sition of an m × n matrix M into M = UΛV T , where U is an m × m matrix with r orthonormal column vectors, where r is the rank of M, Λ an m × n diagonal matrix and V and n × n matrix. V&V Verification and Validation. Verification of a code means to verify that it is correctly coded: the functions give the expected outputs and there are no bugs. Validation of code means to (in the case of technologies) en- sure that the generated by the code are close to reality. The former can be done via unit testing or full code tests. The latter is done by comparing the results from the code against known test cases.

xxii Chapter 1

Introduction

1.1 Motivation

Under the European NOVEMOR project, an Optimization Framework was created that allows for the MDO (Multidisciplinary Optimization) of airplanes with morphing aerodynamic surfaces [1]. In this frame- work the aerodynamics of a wing are modeled using a panel code with skin friction and compressibility corrections to account for the viscous drag and transonic Mach (0.6-0.8) numbers present in normal commercial aircraft cruise conditions. The panel code was complemented by a surrogate model that added the aerodynamic forces due to the stabilizing planes and fuselage. The structure (in which wings, fuselage and stabilizing planes are included) is modeled via beams discretized by the FEM (Finite Ele- ment Method). These models allow a simple computation of the drag, lift, internal stress and deformation of the aircraft without being too costly to calculate, being well adapted to optimization routines that re- quire frequent model computations. However, these simplified models and surrogate models are limited in their predicting power. Surrogate models are so limited due to the fact that they do not incorporate the ”physics” of the problem: a set of parametrized curves is merely made to fit the given data. Simplified models are limited because the approximations that they are based on necessarily limit or misrepre- sent the underlying physics. For the aerodynamics module, the potential model with Prandtl-Glauert correction used by the authors ceases to be accurate for higher Mach numbers or when in presence of transonic shocks (which are not captured by potential flow theory). This is quite critical in the optimiza- tion of transonic aircraft as the appearance of shocks at subsonic speeds severely hampers the fuel economy of an aeroplane. To properly capture transonic shocks, a compressible Euler code or com- pressible RANS (Reynold Average Navier-Stokes) code should be used. All these higher-fidelity models or HDMs (High-Definition Models) would be able to properly predict the very complicated phenomena that must be accounted for when designing a commercial aeroplane, but they may take far too much time to compute once inside an optimization loop. Ideally there would be a way to create a simpler and faster model that still captures the relevant physics encoded in the HDM. Surrogate models and simpli- fied physical models have already been studied for this framework. But one method not yet explored is Model Order Reduction or MOR. MOR takes the PDE (Partial Differential Equation) or ODE (Ordinary

1 Differential Equation) described by the HDM and generates a reduced order model (ROM) that is essen- tially another, smaller, ODE with less unknowns. This ODE is supposed to be much faster to compute all the while generating results not very different from the HDM. In other words, the point of MOR is to take the HDM and generate a model that is faster to compute but still captures the same dynamics, same physics of the HDM. Using MOR could aid in predicting the existence of transonic shocks when the design of the wing is changed, or capture the non-linear deformation of the wing during cruise, or any other phenomena well-captured by modern HDMs. The Optimization Framework would then be able to produce designs that perform better in reality, and aeroplane designers could place greater trust on these designs. The designs could then be used as a starting point or reference for their work, speeding up the design cycles and getting to a better performing aircraft in a smaller amount of time.

1.2 Topic Overview

Since the 1950s the overall shape and hence aerodynamic architecture of commercial airplanes has not dramatically changed. Comparing commercial aircraft introduced in this era such as the Tu-104, Boeing 707, DH 106 Comet or the SE 210 Caravelle to modern planes such as the 777, A320, E190 or Superjet 100, we find that they share many major features : circular or oval fuselage; trapezoidal wings and stabilizers, of which the latter are always tail planes; wings under the fuselage with slightly positive dihedral angle (at least in flight); reaction engines near the tail or under the wings, encased in nacelles. But this does not mean that manufacturers have not been improving their designs. Continuous improvement of aerodynamic and structural performance is ever present, and the presence of better computer models has been a major factor. Models used to simulate aerofoils or wings have gone from potential theory, to the compressible Euler equations to modern RANS and LES (Large Eddy Simulation) formulations, saving countless wind-tunnel hours [2]. These models, the software that implements them, and the computers that run it play an active role in modern engineering and design and have their own moniker: CAE and CAD or Computer Aided Engineering and Computer Aided Design,respectively. One recent addition to CAE is automatic optimization or computer aided optimization. In this case, the software tries to reduce or maximize a certain criteria supplied by the engineer, by changing the thickness, topography or other characteristics of a piece. In aerodynamics this can be maximizing the Lift-to-Drag ratio of an aerofoil, nacelle noise reduction, or minimizing nozzle pressure loss and wing drag. This gives the engineer new insights on possible shapes to use on an aircraft, leaving him to be the final authority on feasibility and performance of the new design. Despite the wonders of modern high fidelity models and automatic optimization, they cannot account for the inherent variability in engineering, and take a long time for a complete product, such as a complete aircraft. The wing design produced by an engineer must perform well even if the shape produced by the manufacturer is not exactly the same as the one specified. The engineering team must ensure that the product will not break, even if the metal or composite from the supplier varies in physical strength. The finished product must be economically competitive, which means optimizing the whole plane while accounting for all disciplines. Minimizing structural weight, maximizing Lift-to-Drag or minimizing maintenance costs separately is not

2 enough. The complexity of the models required for proper automation of these tasks leads to very long computation times, as several computations must be done to obtain an answer. Therefore these tasks are usually done by heuristics, experiments, surrogate models and other methods. As it can be seen, computation times are always a major factor in advancement of CAE. Faster computations mean quicker design iterations and the possibility of getting an even better performing final idealized product. They also mean that we can consider more non-ideal cases, and hence guarantee that the real product performs better. This has led both the industry and the scientific community to search for ways of decreasing the complexity of a mathematical or computer model that is known to work, while guaranteeing that this decrease in complexity does not lead to substantial error. This is called model order reduction: from a set of equations that can be implemented in a computer and that well describe reality (called the HDM or High Definition Model), we create a smaller set of equations that are much faster to compute (called the ROM or Reduced Order Model) that do not deviate too much from the original model. The complexity of the models used in the aerospace industry means that there are no readily available software packages for creating and computing reduced order models. Effort is ongoing: the European program AEROGUST for aircraft robustness against wind gusts [3]; Reduced Basis methods and the surrounding community [4]; Proper Generalized Decomposition which was partly developed by EADS researchers [5][6][7]; model reduction methods being developed by NASA [8][9] or even the DLR [10] [11] or CEA [12]. These technologies are still being perfected and complete books on the matter only have started to appear in this decade. The main issues to solve in this area are: ”certification” or finding accurate measures of ROM error without solving the HDM; how to obtain reliable ROMs for non-linear parametric problems (such as aerodynamics); how to integrate a ROM in an automatic optimizer, since data or designs initially used to train a ROM might be very different from the true optimal design. On a more national level, a survey was conducted by us in order to evaluate the interest of Portuguese aerospace companies in MOR, and their needs in terms of simulation and model error. A total of 23 companies were surveyed, but only 4 answered our query: Uavision, CEiiA, Active Space Technologies and Spin.Works. All companies reported using simulation software, with it being present or behind (in average) 59% of the products and services offered by these companies. A third of the companies use CFD, all companies use FEM for structural problems, half of the companies use simulation for circuits and antennas, and one company reported using software for launch and orbital trajectory simulation and planning. All companies reported using at least one simulation software package for multidisciplinary analysis, with the average being 2 software packages. On a scale going from 0 (irrelevant) to 5 (critical), the companies gave an average rating of 4 to weight of simulation in their competitiveness. If given a method to cut down simulation time in half at the cost of higher error, the error tolerance of the surveyed companies reportedly varies significantly with the engineering problem at hand, the lowest upper limit given in additional error being 1%. Only one company reported using surrogate or reduced order models, namely Projection-based ROMs, neuronal networks and polynomial response surfaces, these methods reportedly not being applied more frequently due to absence of knowledge and costumer requirements. The other companies reported either no particular reason or work methods as the root cause of not using MOR. Three-quarters of the responding companies reported using automated optimization, with it being

3 employed in 5% of their service or product line for optimizing structures, antennas and circuits. One company reported applying reduced or surrogate models in optimization. The remaining company that does not use optimization software admitted that automated optimization could bring a significant gain in competitiveness in 30 % of their product or service line, but is not used due to excessive computation times.

1.3 Objectives

The point of this thesis is to test model reduction methods and their applicability to CFD (Computational Fluid Dynamics). The objectives of this master thesis can then be listed as such:

• Research available model reduction methods and ascertain the state of the art in MOR.

• Test chosen model reduction methods on simple problems exhibiting properties similar to CFD models

• Test chosen model reduction methods on simple CFD models with physical phenomena present in modern aircraft

• Conclude on the applicability of MOR to CFD of lifting surfaces and its eventual use in MDO.

Hence goal of this thesis is not the creation and fidelity of the HDMs themselves, but to understand the error and speed-up generated by the use of existing model order reduction techniques, in particular for aerodynamic models.

1.4 Thesis Outline

The thesis will be divided in the following chapters :

1. Model reduction methods

2. Reduction of benchmarks

3. CFD analysis and Reduction

4. Conclusion

”Model reduction methods”, is comprised of the bibliographical research done to better understand model reduction and its application in optimization. Aerodynamic models can be based on PDEs (Par- tial Differential Equations) that are both hyperbolic and elliptic. The only model reduction methods that seem to enjoy some success in this class of problems are a posteriori methods. These methods take pre-calculated solutions or samples from the HDM, and construct a ROM from them. This sampling and model reduction constitute the two main sections of this chapter, along with a discussion on how to further ameliorate the precision of the ROM. Once the bibliographical research has been exposed, we apply selected model reduction methods onto selected benchmarks. These benchmarks are HDMs

4 whose solution has previously been calculated and whose ODE (Ordinary Differential Equation) system is given by the author. This allows us to test the found model reduction methods on a variety of prob- lems where the mathematical or physical properties are close to that of a full-fledged CFD model. It also allows us to ensure that the HDM we are attempting to reduce is correct, letting us focus completely on properly reducing these models. We will reduce static, dynamic, non linear and multi-parameter prob- lems, ensuring a thorough test of the selected model reduction methods. From the previous section, we will select model reduction methods that demonstrated superior performance, and we apply them to the model reduction of CFD models. We have chosen specifically two models: the lid-driven cavity prob- lem for the Navier-Stokes Incompressible (NSI) equations and the RAE-2822 airfoil for the compressible Euler equations. The former is solved by an iterative method whilst the latter relies on a time-marching one. This will allow us to test MOR for these two major ways of solving stationary problems, and also see how MOR performs on fluid problems where either viscosity or compressibility effects are present (the two main physical phenomena not directly simulated in the referenced MDO framework). Finally, in the conclusion chapter a short summary of the work done will be provided, and the most relevant points and results concerning MOR for lifting surfaces will be presented. Considerations on how to further evolve and ameliorate the considered MOR techniques will be given, as also on how to apply MOR to high-fidelity codes.

5 6 Chapter 2

Model reduction methods

In this chapter we expose the bibliographical research done concerning model order reduction methods, in particular the control of their error, their applicability to optimization and their usage in industry. Since our goal is to be able to reduce aerodynamic models, we will expose and discuss the several methods available, and will present this chapter in the same way one would go about reducing a model. For this reason, the chapter is divided in:

• Model Reduction Methods - how to replace the original HDM problem or equations by another, reduced problem or equation set.

• Basis creation - how to create the basis for the reduced solution subspace.

• Sampling - how to extract data from the HDM, so as to obtain the best reduced basis possible.

• Precision - techniques that do not fit the previous definitions, used to decrease the error of the ROM.

This chapter thus aims to as best as possible show the current state of model order reduction for CFD. We will present methods used for MOR of structural models found during the bibliographical research that may be interesting for the Optimization Framework that motivates this thesis, but we will not analyze them as thoroughly.

2.1 Model Reduction methods

2.1.1 A posteriori methods

These methods rely on previous full-order calculations so as to generate the required reduced basis. This basis is usually computed by using the POD (Proper Orthogonal Decomposition) or variants of it. We distinguish basis generation from model reduction methods, because basis generation does not determine the new equations to be solved, but their coefficients. This distinction is also useful to understand the literature around model reduction with POD and detect similarities between the several

7 methods. Most methods are based on or created from projection-based reduction. Therefore we will start by presenting the projections, then projection-based methods and later the rest.

Linear Algebra elements

Before presenting projections, we will present some key linear algebra concepts, notably orthogonality and parallelism, as they are presented in the notes in [13]. Given two vectors u, v ∈ Rn, these vectors are orthogonal if their internal product is null, meaning if < u, v >= 0. A vector is also called a unit vector if it’s internal product is one, or if < u, u >= 1. A semi-orthogonal matrix is a matrix Vn×k (n > k) whose column vectors are orthonormal: each column vector is a unit vector orthogonal to the remaining column vectors. The product of the transpose of the matrix by the matrix itself is equal to T the identity matrix : V V = Ik×k. If the matrix is square (n = k), it is called a orthogonal matrix. Let n n us consider the subspace P ⊂ R and some point v1 ∈ R . The set A = v1 + P is called an affine n space, and is the space of all points a = v1 + p : p ∈ P. Given another point v2 ∈ R , v2 6= v1, the space defined as B = v2 + P is also an affine space but parallel to the affine space A. Now we present the linear algebra concept of projection, which is paramount to understanding projection-based reduction methods. We will not link the concepts presented here with the notion of HDM or ROM yet, but the we will conserve the notation used in the following sections so that the reader can easily establish the link between Projections in linear algebra and their use in MOR. The theory presented here is based on source [14]. A n × n projection matrix M of rank k < n is a matrix who is equal to it’s own square, and consequentially whose eigenvalues are either 1 or 0:

  2 Ik×k 0k×(n−k) −1 M = M = X   X (2.1) 0(n−k)×k 0(n−k)×(n−k)

Here 0 is a null matrix, I the identity matrix, and X is a basis where:

h i n×k n×(n−k) X = X1 X2 ,X1 ∈ R ,X2 ∈ R (2.2)

Suppose Q ⊂ Rn and P ⊂ Rn the column and null subspaces of M, which are respectively of order k and n − k. Then given a vector w ∈ Rn, it’s projection onto Q parallel to P is given simply by the matrix vector product: M × w. In other words, the matrix M defines the following linear application:

n M : R → Q (2.3)

Such that ∀w ∈ Rn, (I − M)w ∈ P. Suppose now that we have two full-rank n × k matrices V and W , whose column space is equal to the subspaces Q and P⊥, respectively. The previous projection matrix can be rewritten as : M = V (W T V )−1W T (2.4)

8 Additionally, if Q⊥ = P, and V is semi-orthogonal, the projection matrix will be simply:

M = VV T (2.5)

Finally we will present some norms, that will be useful later in error quantification. Given a vector v ∈ Rn, pPn 2 it’s L-2 norm is defined as ||v||2 = i=1 vi . In a similar fashion, the Frobenius norm of a n × k matrix q Pn Pk 2 V is given as ||V ||F = i=1 j=1 aij. In this thesis, each time the norm of a vector is mentioned, it is implicitly the L-2 norm, while for matrices it is the Frobenius norm that is implied.

Projection-based reduction

Projection-based reduction methods for PDEs (Partial Differential Equations) are based on the following concept, take the following semi-discretized (as in discretized by Finite Elements or Finite Volumes or Finite Differences) parametrized PDE system in the form [14]:

dw(µ) dt = f(w(µ), µ) (2.6) y = g(w(µ)) (2.7)

Here w ∈ Rn (n being the order of the HDM) is the HDM state vector, and µ is the parameter space vector, f is the system function, g is the output function and y are the system outputs. Notice that we have a dynamic equation here, but the following ideas can be applied to a statical system too. Now let us say that we have a n × k matrix V , called the reduced basis, and reduced state space vector q ∈ Rk (k being the order of the ROM with k < n), such that:

V q ≈ w (2.8)

V is then a basis for the subspace of order k in Rn that would well approximate the trajectory of w, meaning the space occupied by w as the time or parameters vary. The new equation is:

dV q(µ) = f(V q(µ), µ) + r(µ, t) (2.9) dt

We can see that we have a residue r ∈ Rn that needs to be eliminated in order to have a system that only depends on q. Suppose we have another n × k matrix W , such that:

W T r(µ, t) = 0 (2.10)

We can finally have our reduced order system be written as:

dq(µ) T −1 T dt = (W V ) W f(V q(µ), µ) (2.11) y = g(V q(µ)) (2.12)

9 This is called the Petrov-Galerkin projection: we project the equations onto a subspace that should capture well the dynamics of the complete solution, in the direction parallel to the residue due to the use of the subspace. One intuitive notion of this method can be found in aircraft performance and flight modes courses taught in university: dutch roll can be considered to be a horizontal motion, with acceptable error in period (less than 10%) [15]. In this case the equations of motion of the aircraft were projected onto the horizontal plane of motion, producing a model with less unknowns than before and giving a solution with acceptable error. Should we further postulate V is orthogonal, then V = W and we obtain the so-called Galerkin projection. The difference between the two is that the Galerkin projection is an orthogonal projection and the Petrov-Galerkin is an oblique one (and therefore not necessarily orthogonal). Both methods could have the same reduced-state space, but the projection used for the Galerkin method must be orthogonal to the reduced-state space. Still the main idea is that we are projecting the equations onto a subspace of the original higher-order space. The dimension of this subspace is smaller than that of the original system (k < n), and therefore we have less unknowns to compute. Since we are dealing with stationary equations our reduction is simply:

0 = (W T V )−1W T f(V q(µ), µ) (2.13)

y = g(V q(µ)) (2.14)

For CFD, even though we solve a stationary problem, a time marching method might be used to find the answer. Therefore we are also going to explore some model reduction techniques that deal with dynamical systems. Unfortunately, we can see from the get-go that projection based methods require to a certain degree that we tamper with the solver. That is because the equation to solve is no longer f() = 0 but (W T V )−1W T f() = 0.

Others

One common method is the Least Mean Squares reduction, whose idea is quite simple and presents many variants [16], [17], [18], but we shall present a version in [17]. The method in its most simple form is a least mean squares problem. For a static system it is posed as follows:

q = arg min ||f(V q, µ)|| (2.15) q

Therefore, rather than projecting the system of equations in such a way that one can neglect r(t, µ), we simply try to minimize the residue for a given basis V . Rather than minimizing the error over all reduced state space, one can try to minimize the residue at a boundary as in [17], add regularizations or even attempt to optimize the base V [18]. We would like to note that this method has been applied with satisfactory results for 2D Euler and RANS equations (see articles above and Hybrid Methods at the end of this chapter).

10 Reduction by L1-norm minimization was developed in [19] specifically for hyperbolic equations, and is based on their discretization by the finite volume method. For a static problem we have:

1 arg min ||f(V q, µ)||1 (2.16) q

Or minimize the regularized variant which guarantees unicity of the solution:

1 1 ||f(V q, µ)||1 + η||q||1, η > 0 (2.17)

In order to actually find the q, one can use Linear Programming if f depends linearly on the parameters or a Gauss-Newton mixed with Linear Programming procedure for the non-linear problem. See [19] for the method for dynamic systems. For the 1-D Euler equations, the authors found the precision of the solution to be enhanced if q is calculated separately for each physical quantity being evaluated (velocity, pressure, etc). The article being recent (published in 2016), the authors are currently trying to extend the method to the multidimensional case and are developing an error measure. The relative infancy of this method means that we will not test it in this thesis.

Hyper-reduction is a Galerkin or Petrov-Galerkin projection where only certain entries of f are eval- uated and the rest of the solution is reconstructed from these entries [20]. These methods are more complex than the methods presented above, and require full-access to the source code of a model. Their complexity and the fact that a lot of solvers used in the industry are proprietary means that we will not explore these methods any further.

The so-called reduced basis community seeks to consolidate projection methods, POD, snapshot and basis generation into one mathematically solid package, with precise error bounds. The article [4] gives the advances and limitations of the reduced basis methods for reduced order modeling, mention- ing shock-capturing methods and more interestingly methods to capture geometrical parameter depen- dence (for dynamic problems). The reduced basis methods have been applied to a number of diffusion and structural problems with decent results and good error estimation, but not for aerodynamics. These methods rely on a complete mathematical analysis of the PDE to be solved, making their generalization difficult. We also have not yet detected the participation of industry in their development.

2.1.2 A priori methods - the PGD

A new, recently developed method for model reduction is the PGD : Proper Generalized Decomposi- tion. This method has been used frequently for uncertainty quantification in several domains, namely structural calculations (see [21],[5] or the book [6] for a discussion on the matter). More recently, it has been applied to the incompressible Navier Stokes equations in [22] for a lid-driven cavity problem, with a speed-up of 10× relatively to full HDM. Given a parameter vector µ ∈ Rp, we shall consider that each

µj parameter is a random variable with a known probability function, each variable being independent

11 from the rest. We consider that these parameters are influencing a field wˆ(x, µ), that is well described by a certain PDE. The PGD works by doing a multiplicative decomposition of the field in the form [23]:

k X wˆ(x, µ) ≈ vi(x)qi(µ) (2.18) i=1

z p X 0 Y j qi(µ) ≈ ql φl (µj) (2.19) l=1 j=1

Where v(x) a functional basis, q(µ) the reduced state space variable,φ(µ) functions describing the de- pendency of the reduced variable on the parameters. Once the PDE modeling the field wˆ(x) has been discretized via finite differences, finite elements or finite volumes, we work with the discretized field w, and the first equation is written as: k X w ≈ viqi(µ) (2.20) i=1

And we get a reduced representation similar to the previous section, with the vectors vi forming the n × k reduced basis matrix V . The major difference relatively to the previously presented a posteriori methods is that the reduced state variable q is made to depend explicitly on the parameters, and both the 0 j terms vi and ql are to be determined. The method of determining these terms and φl (µj) depends on the PDE in question, with methods for structures, diffusion and others being presented in the book [6]. From the same work the authors make it clear that there are problems with linking the PGD to equations discretized by first-order upwind schemes. This combined with the lack of applications to compressible flows or airfoils means that we will not be applying this method to the model reduction of aerodynamic model.

2.2 Basis creation

For any of the aforementioned a posteriori model reduction techniques, we have not specified how the reduced basis V is computed. This was done on purpose in order to separate these two distinct problems : how the reduced model response is calculated and in which subspace of the full order state space it is calculated. To us the former is the domain of the model reduction technique, the latter of the basis creation method. This method usually takes a snapshot set (a set of pre-calculated solutions), and generates the reduced state space. For the case of non-linear PDEs, in particular the Navier-Stokes equations, the methods found are either the POD (Proper Orthogonal Decomposition) or modified versions of it. Hence in this section we are going to present the POD method, and modified versions of it that we judge relevant. In the end we present ways to estimate and control error of some ROMs made with the POD.

12 2.2.1 Proper Orthogonal Decomposition

The idea behind the POD is to find the basis V for the projection, such that the orthogonal error (com- ponent of the error orthogonal to the subspace defined by V ) is minimized over the time and parameter space considered. This is done by finding V that minimizes the L-2 norm of the projection error over the time and parameter space samples (see [24] and [25]):

X 1 Z ||w(t, µ ) − VV T w(t, µ )||2dt (2.21) 2 i i i t

It is shown in [24] and [25] that the optimal basis in this sense is the same as the basis for the invariant subspace (basis made of the eigenvectors) of the first k ordered (from biggest to smallest) eigenvalues of the following matrix:

Z ˆ T K = [w(t, µ1)...w(t, µnµ )][w(t, µ1)...w(t, µnµ )] dt (2.22) t

Solving this eigen-problem allows us to obtain the optimal POD-Basis. Equation 2.22 can be discretized in time, leading to the snapshot POD. The so-called snapshot matrix S would then be the square root of the time integration method’s weights multiplied by the samples of the HDM (or snapshots) at the corresponding time point.

ˆ X T K ≈ αi[w(ti, µ1)...w(ti, µnµ )][w(ti, µ1)...w(ti, µnµ )] (2.23) i

ˆ T √ √ √ K ≈ SS ,S = [ α1w(t1, µ1)... αnt w(tnt , µ1)... αnt w(tnt , µnµ )] (2.24)

Here αi are the time integration weights. This specific method was initially developed by Sirovich [26]. In the case of static problems with an euclidean norm (as presented in equation 2.21) the snapshot method is exact (there is no time discretization) and the snapshot matrix is simply:

S = [w(µ1)...w(µr)] (2.25)

Here r is the total number of snapshots. Rather than solving directly the new eigenvalue problem, common practice is to employ Singular Value Decomposition (SVD) to do it. To obtain V , we simply compute the SVD of S as:

T Σr×r T S = UΣZ = [U1...Ur...Un] Z (2.26)

0n−r×r

n Where Ui are column vectors belonging to R , Σr×r is a diagonal matrix, and Z is a r × r matrix .Assuming that the eigenvalues are ordered in decreasing magnitude and the left eigenvectors following this, we can immediately write the modal basis of the k-th (where k ≤ r) order model as :

V = [U1...Uk] (2.27)

13 The SVD method has the benefit of being much faster to compute than the complete eigenproblem, while still having algorithms that retrieve the biggest eigenvalue in an iterative fashion (hence, we need not solve the whole SVD problem for n eigenvalues when we are interested only in the first k ones). The power behind this whole process is that no assumptions are made on the original PDE itself, or on the properties of the ODE or solution that is reduced. In short, one can define the whole process behind the SVD-POD and like-minded methods to be:

1. Pose an optimization problem, of which the Reduced Basis V is the solution.

2. Discretized said problem over the considered space.

3. Generate the modal basis V from the discretized problem.

4. Solve the ROM.

Though this might seem just a repetition of something that can be seen from above, it is paramount to state it for it induces the questions that many researchers have made and tried to answer : is there a better problem to pose for a given application ? What solution samples or ”snapshots” should I use in my discretization ? What should I use for the state-space vector or what norm should i use for the optimization problem? How should I generate my modal basis? Going back to the POD, we would like to point the interested reader to article [27] for a complete review on it with some historical background, and other possible uses. See [28] for a more complete discussion on its uses.

Inner product modification of the traditional POD problem can be done in the search for a better basis. We can, for example, use a change of variables, so that the POD expresses an energy that is conserved in the full order problem [29]. We can also modify the inner product used for computing K and Kˆ . In other words we concern ourselves with the choice of a symmetric positive-definite (or semi-definite for a demi norm) matrix M such that:

Z ˆ T K = [w(t, µ1)...w(t, µnµ )]M[w(t, µ1)...w(t, µnµ )] dt (2.28) t

For the standard POD, M would be the identity matrix. But one could choose a demi-norm based on the outputs for the system, leading to the Goal-Oriented POD. Discussed in [30] and presented in [18], the idea is to go from a problem where we minimize the projection error of the state, as stated in equation 2.21, to minimizing the error of the output:

n 1 X ||g(w(µ ), µ ) − g(VV T w(µ ), µ )||2 (2.29) 2 i i i i i

To solve this problem, [30] suggests computing the original problem in 2.21 but with the inner product Θ given by: ∂g T ∂g Θ = , g = g(w(¯µ), µ¯) (2.30) ∂w ∂w

14 Here µ¯ are the parameters of the solutions we wish to calculate and w(¯µ) can be estimated by the methods presented in Compact POD. For the case where the outputs depend linearly on the state variables, this changes the problem in 2.29 into:

n 1 X ∂g || (w − VV T w)||2 (2.31) 2 ∂w i

To compute the problem, the standard SVD method can be used by recalculating the snapshot matrix as : new 1 old S = Θ 2 S (2.32)

We could also use an inner-product based on the Jacobian of f, called the system-induced inner product : ∂f T ∂f Θ = , f = f(w(¯µ), µ¯) (2.33) ∂w ∂w

The point of this inner-product is to also minimize the in-plane error. All of the derivatives are computed for the target parameters µ¯ and the estimated solution given by equation 2.34. The authors do not seem to study the difference induced by either inner-product in their article. The authors in [18] generalize the idea exposed in [31] to non-linear systems and go beyond changing the inner-product, stating a new problem to be minimized that mixes the model reduction technique and basis creation. It is shown that for linearized problems this method gives better results than just using POD, specially when the focused outputs are far less than the total number of states. However, no study of the computation time of the optimized basis is given, and no contrast is given between the total computation time of unmodified POD and the new method. At best we have a comparison of the number of modes to attain a certain error level. This is unfortunate, as we can not be sure of the computational efficiency of the method because a non-linear optimization problem must be solved, the non-linearity depending heavily on the problem being solved.

The POD with adaptive finite-element snapshots developed in [32] allows for a POD of snap- shots from triangular meshes exhibiting different degrees of refinement. Starting from triangular finite- elements, the author provides a group of triangular meshes and shows how one can interpolate the function values of one mesh onto another, more refined common mesh. All snapshots would then be converted onto this common base. The author proposes a method where the ROM can still be created without generating this costly finite element space, where pairs of snapshots share a common mesh. It was shown both mathematically and by numerical experiments with an advection-diffusion equation and with a 2D diffusive Burguers equation that this last method added a permanent error component related to the finite element discretization of the snapshots, whilst the method with the global common mesh did not. The Burguers equation used was a parabolic problem with adaptive refinement in time and the advection-diffusion equation was elliptic with different meshes for different parameter values. This may be useful for optimization, specially in transonic aerodynamics where a slight change in shape may be the difference between absence or existence of shocks. Unfortunately the fact that it restricts itself to 2D

15 domains implies that we cannot simulate a complete wing. The fact also that it was done for triangular finite-elements means that it cannot be applied to most CFD software, which rely on the Finite Volumes and quadrilaterals.

For the case of moving boundaries a strategy is given in [33]: the fluid velocity field of the moving grid is interpolated onto a fixed uniform grid and the solid domain is represented in this grid by the fictitious domain method. Here the Navier-Stokes equations are extended to the rigid domain and a rigid constraint is added to the zone occupied by the rigid body. The authors used this with the snapshot POD to simulate the vibration induced by high Reynolds number (140 000) flow impacting a rigid cylinder attached by a spring to its origin. It was shown that model error diminished with POD modes, and that with just 6 modes (therefore a 6-th order model) they match fairly well (with a relative error below 2 %) the exact oscillation of the center of gravity. This would be useful for aeroelastic calculation. However, we still have not found an extension in literature for 3D geometries.

2.2.2 Compact POD

The Compact POD brings the computed HDM sensitivities to the foray, by including them in the snapshot matrix. The method outlined in [34] and further developed in [30] is made specifically for static systems. According to the authors, it provides a generalization of the original Lagrange-basis snapshot method into a Taylor one. In other words when discretizing the original problem in equation 2.22 into 2.24, we will try to interpolate the target solution using other solution’s derivatives relative to their parameters (meaning, their sensitivities) up to an arbitrary order and add these interpolations onto the snapshot set. To make it clear, suppose that have p parameters, a pre-calculated solution w(µ) and its m derivatives relative to the parameter, and we wish to calculate the solution of the target parameters µ¯. From Taylor’s theorem :

Pp ∂w(µ) 1 Pp Pp ∂2w(µ) w(¯µ) = w(µ) + i=1 (¯µi − µi) + i=1 j=1 (¯µi − µi)(¯µj − µj) ∂µi 2 ∂µiµj (2.34) 1 Pp Pp ∂mw(µ) m+1 +... + ... (¯µi − µi)...(¯µj − µj) + O(||u¯ − µ|| ) m! i=1 j=1 ∂µi...µj 2

m+1 Removing O(||u¯ − µ||2 ) would give us an approximate yet computable value of the target solution w(¯µ). Then the snapshot matrix S for a single snapshots µ and the target parameter µ¯ is given by :

S = W × Γ (2.35)   w(µ) j = 1   ∂w(µ) Wj = j = 2...v(1) (2.36) ∂µj−1   ......   0 i 6= j    1 i = j, i = 1 Γij = (2.37)  (¯µ − µ ) i = j, i = 2, ..., v(1)  i−1 i−1   ......

16 Where v is defined for a q = 1...p, q ∈ N by:

(p − q − 1)! v(0) = 1, v(q) = v(q − 1) + (2.38) q!(p − 1)!

Only the first derivatives are shown due to their commonality in modern software, for the second order ones consult [34] and [30]. We can see that when we compute an HDM solution, if we have the first- order sensitivities, we would have a total of p+1 snapshots. Therefore from a single HDM computation, we could add p+1 modes to the ROM, saving additional HDM computations. For n HDM computations, the full snapshot matrix is obtained by concatenating each individual snapshot matrix Si = S(µi) pre- multiplied by a Gaussian radial basis function:

||µ − µ¯||2 γ = γ(µ , µ¯) = exp(− i 2 ), τ ∈ (2.39) i i 2τ 2 R+

This gives more weight to snapshots closer to the desired state. We obtain the full snapshot matrix by:

S = [S1γ1...Srγr] (2.40)

The modal basis can then be computed via SVD. The downside of this method is that the SVD must be recalculated each time and that additional computations must be done to construct the snapshot matrix.

2.2.3 Error Estimation and control

For the Galerkin projection, the total error et can be decomposed in two components: the orthogonal error e⊥ and the collinear error e// which are given as [14]:

et = w − V q = e// + e⊥ (2.41)

T e⊥ = w(I − VV ) (2.42)

T e// = V (V − q) (2.43)

If the basis is obtained via the unmodified POD, it can be shown that, at the same time and parameter values of the snapshots, the orthogonal error of a k-th order ROM is given by:

v u r priori u X 2 ||e⊥ (t, µ)||F = t λj (2.44) j=k+1

It can be deduced then, that when k = r, the orthogonal error is null. Knowing that:

v u r uX 2 ||S||F = t λj f (2.45) j=1

We can use the two previous equations in order to control the orthogonal error at the snapshot points before even doing ROM calculations, in other words, we have an a priori error measure. In [35], error

17 bounds were derived for the case of the POD-Galerkin reduction of a non-linear ODE. For the same parameters and inputs, we can bound the total and collinear error over time by using the orthogonal error:

||e//(t)||L2 < ||e⊥(t)||L2 (2.46)

0 ||et(t)||L2 < γr||e⊥(t)||L2 (2.47)

0 2 Here γr is a constant. We consider the Lebesgue L norm over time (the parameters are fixed). For dynamical systems we can thus combine equations 2.47 and 2.44 to obtain a priori error bounds over the total error at the time instants where the snapshots were taken. Care should be taken with this result : the bounds were not derived for the case where parameters or inputs vary. The error measures are only at the instants where snapshots were taken.

2.3 Sampling

Here we discuss on how to choose the starting snapshots, and how to further improve our modal basis by choosing the best snapshots possible. An initial method to gather samples would be to use uniform sampling (recommended for less than 5 parameters) or Latin Hypercube sampling (recommended for more than 5 parameters) [36]. Other than that, there are several strategies to choose samples. We group them in two types : greedy strategies, which choose samples that minimize an error measure (usually the residual) of the ROM over the specified parameter space; and adaptive sampling, which seeks to minimize error along a trajectory through the parameter space, and not the overall space. Greedy methods are intended for offline-online strategies where first one constructs the best possible snapshot matrix or modal basis, and then the ROM is analyzed to give the desired results. The most basic version searches for the parameter set that maximizes the residual, computes its snapshot, adds it to the snapshot set and restarts the search until a certain criteria is reached [36]. More advanced methods such as [37] or the ones presented below keep the principle, but try to avoid long sample generation times and over fitting This is usually achieved by partitioning the parameter space, using alternative and faster methods to estimate error, and stopping the search after a certain, fixed number of samples is taken. Greedy sampling is adapted to many-query applications such as design exploration or uncertainty quantification. An optimization done using greedy methods may take more time than full HDM optimization. In [38] we can see an example : a full HDM optimization can take almost 1/80th of the time of the off line basis building procedure. Adaptive sampling is on line only : each call on the ROM might entail taking a new snapshot. It is therefore more oriented towards optimization. Unfortunately most methods found so far in the literature are geared towards optimal control and affine parameter dependency. Examples of the former are the TR-POD or trust-region POD given in [39] and OS-POD or Optimality Systems POD given in [40]. Trust-region POD could be applied to parametric optimization (there is no specification on time or parameter dependency), but it requires the computation of a new snapshot and evaluation of the exact cost function at each step. This could be beneficial if one does not have the model sensibilities and is required to perform numerical differentiation to compute the gradient,

18 which demands additional calls on the HDM under normal circumstances. Substituting this differentiation with a ROM would save precious time. However, most modern software already give the sensitivities required to compute the gradient of the cost function. Therefore the calculation of the descent step is done easily. To make this method useful one could ”skip” some HDM evaluation steps. The second problem (affine parameter dependency) can be seen in [41] : the authors manage to treat PDE operators that depend linearly on the parameters, but in the Navier Stokes equations these correspond to fluid- characteristics, which are not to be optimized. A very interesting method which can do both POD and least-squares Petrov-Galerkin reduction is given in [42], with very good results for the inverse design of a subsonic profile: the total number of HDM calls for the inverse design procedure based on the algorithm was far less than full HDM gradient-based optimization. Given that greedy methods can be readily applied to any class of problems, no matter what type of parameter, we will detail some interesting greedy methods. Owing to the time cost of the SVD and importance of error measures, we will end presenting methods for fast SVD computations and we propose a simple measure for the error of the ROM solution.

2.3.1 Quad-Tree exploration with leave-one-out error cross validation

Developed in [43], this greedy method uses a leave-one-out cross validation to estimate the error around the region of a snapshot and the global error of the modal basis. It then does a quad-tree split of the region with most error and generates new snapshots at the center of the new subregions. The method is tested on a few test-functions and on the snapshots of an HDM computation of a RAE-2822 in a flight envelope with a subsonic-transonic transition. There was no calculation of the ROM, rather a Kriging interpolation of the reduced state variable was employed similar to [44]. However, due to no reference to what technique gives us the reduced order solution, we feel that their method is fully applicable to actual ROM error reduction. According to the authors, the method allowed to greatly diminish surrogate model error relatively to other random sampling methods using the same number of snapshots all while bringing about a 0.47% increase in computation time. It also managed to capture the transonic transition, which was not possible with the presented random parameter sampling methods. The leave-one-out cross validation error for a snapshot with parameter set µk is given by :

−k E(µk) = ||w(µk) − V q(µk)−k||2 (2.48)

−k Here V is the basis obtained by including all available snapshots except w(µk) and q(µk)−k is the −k ROM solved state variable at µk for the modal basis V . This is taken as good error measure of the error around µk. A measure for global error is given by the half of the sum of all the leave-one-out errors. The process then to refine the snapshot matrix is as follows:

1. Divide the space to explore recursively into 2p regions, p being the number of parameters. Take snapshots at the center of each region.

2. Compute the local errors E(µi) and the global error E. If E is bigger than a certain tolerance,

19 continue to the next step.

3. Find the parameter µk with the biggest local error estimate and subdivide its corresponding region again into 2p regions, and take snapshots at the center of each region. Freeze the original parame-

ter µk : no further refinement can be done for it, only on its children (thus preserving the quad-tree structure).

4. Repeat from step 2.

As it can be seen, this requires the computation of the several SVDs, where we add and take vectors from the snapshot set. To reduce the computation time the authors use the fast SVD downgrading and updating methods presented in [45].

2.3.2 Kriging-based greedy search

Presented in [46] the method has 3 characteristics that make it stand aside from the rest:

1. The time to build the database is estimated, and a method is given so that the user can control how long the database building takes. In short, a maximum model order is defined, from which the maximum modal basis construction time and ROM solve time is deduced. The solve time for the HDM is assumed to be independent of the parameters. Then a cap is placed on the maximum of ROM and HDM solves and basis construction.

2. The random initial snapshot set is used to create a surrogate kriging model for the error, and further candidate parameter sets are chosen based on the method of maximum probability of improvement on this surrogate. Upon each improvement cycle, an optimal cluster of parameters is selected from the original maximum probability improvement set and their snapshots computed. These snapshots are integrated in the ROM, the error indicator computed and their error indicators integrated into the surrogate. Thus determining the best possible snapshots requires no ROM or HDM solves until the very last moment when we choose to generate and integrate a snapshot onto our database.

3. The exact error is computed by comparing the solution from the snapshot with the ROM solution for the same parameter values with the old and updated database. These exact error indicators are created at each search cycle and give a pool of exact error indicators from which to build the surrogate error model from.

As can be deduced from above, the algorithm has a certain complexity. Still, the usage of the surrogate model and optimal parameter clustering as shown to give consistently better convergence (error of the model decays faster) than classical or random greedy algorithm for the given test case of the advection- diffusion equation of heat on a fractal domain (which is of interest for fluids). Additionally, for the structural problem of a blast under a V-hull, it was shown that for the same time budget the surrogate-error greedy method always gives a smaller error than the standard greedy procedure stated in the same article.

20 2.3.3 Fast low-rank modifications of the SVD

For low-rank modifications, such as updating (adding a snapshot or snapshots to the snapshot set), downgrading (removing a snapshot), revising (exchanging one snapshot for a new one) and re-centering (subtracting or adding a constant to all snapshots) methods are given in [45]. The author presents ways to recompute the complete SVD or just update the vectors up to the k-th biggest eigenvalue with excellent performance. A speed-up of up to a 1000 × relative to the Lanczos method are reported by the author while relative (to the frobenius norm of the original data) error stays at or below 10−5. The calculations were done on 3000×3000 and 1000×1000 matrices. Snapshot sets encountered in the literature for fluid ROMs so far tend to be 1000.000×10 matrices (or within those magnitudes). We will now briefly present the fast update technique. Suppose then that we have a new snapshot, w+1 to be integrated in +1 +1 the snapshot matrix as S = [S, w ]. We define a new matrix Mk+1 and its SVD as:

  T +1  Σ U w  T Mk+1 = = AΣ+1B (2.49)  0T ||q|| 

Here q is the result from the orthogonalization of w+1 against the columns of U, U being the left eigen- vector matrix and V T the right one of the SVD of the original S (S = UΣV T ). Both q and w+1 are column vectors. It follows that:

  T q T  V 0  T S+1 = [U ]AΣ+1B = U+1Σ+1V+1 (2.50) ||q||  0T 1 

This method and the downgrading version are the backbone of SVD computations done in section 2.3.1.

2.3.4 Argument error estimation

An idea developed by us to relate the residual to the actual error on the solution. Suppose that we have the residual of the reduced state solution of a stationary system computed at the target parameter set µ, given as : r = f(V q(µ), µ) (2.51)

We suppose that there exists a small increment δw, called argument error, such that:

0 = f(V q(µ) + δw, µ) (2.52)

By subtracting the above equations and considering the residual to be very small we have:

− r = δf = f(V q(µ) + δw, µ) − f(V q(µ), µ) (2.53)

21 If the increment is small enough we can use the first order Taylor approximation of f to say, in Einstein’s notation: ∂fi − ri ≈ (V q(µ), µ)δwj (2.54) ∂wj Therefore we can estimate the argument error as:

−1 ∂fi E = || (V q(µ), µ)ri|| ≈ ||δw|| (2.55) ∂wj

This can be used to address a known problem in greedy methods (mentioned in [46] and [38]) using the residual as error estimators, which is that the residual might not reflect the proper scale of the error. This method requires access to the sensitivities of the residual. The time for the computation of the inverse of the sensitivities might be prohibitive.

2.4 Precision

Here we present ways to ensure that the reduced order models stay as close as possible to the original full order models, seeking to preserve some information or part of the original HDM. We will start by presenting how one can, for dynamical systems, obtain a ROM whose dynamics are close to that of the original model. The reason behind this is even though we are working with stationary CFD, some solvers use time-marching methods. Time-marching methods solve a static equation by simulating the response of the original dynamical system to a constant input. If the stability of this system is not preserved, the resulting ROM may diverge. In the second and final part we will try to mix the full and reduced order model, so as to obtain the desired speed up of our calculations whilst keeping the error as small as possible.

2.4.1 Stability preservation

For the dynamical simulations POD - Least Mean Squares tends to be dissipative and stable [16], but the POD - Galerkin can generate unstable models as shown in [29]. The solution given by the same authors is to choose an inner product for the POD that is equivalent to an energy product, as it is demonstrated that in this way the stability of the original system is preserved. For compressible isentropic flows, the authors suggest using a change of variables for the POD inner-product so that it expresses the stagnation enthalpy. An alternative far less complex approach is to use artificial viscosity. As it is noted in [16],[47] and [48] using the SUPG (Stream-wise Upwind Petrov Galerkin) to model the Navier-Stokes Equations allows the POD-Galerkin to faithfully reproduce the dynamics captured by the snapshots used to build it. It also allows it to remain stable and precise when the original DNS model was under solved, or in other words, when the original mesh was too coarse to faithfully capture the desired dynamics [47]. VMS (Variational Multiscale), of which SUPG is a particular case, can also be used, and is shown in [16] and [48] to give improved results at no additional computational cost. Both methods however need to be calibrated: SUPG requires the calibration of one parameter and VMS of

22 two. In [47] the artificial viscosity parameter of SUPG was based on the original article presenting the SUPG method ([49]) while in [48] the authors developed and employed a method that calibrates these parameters in a specific optimal fashion (see article), they also point to [50] for a method that is model independent, requiring no calibration for either VMS or SUPG. It seems that the choice of parameter can affect the long term integration of the ROM: for a SUPG ROM in [47], a stalled airfoil would produce no CD and CL oscillations after the snapshot time interval (meaning the time interval where snapshots were taken) was exceeded. Instead, they converged to a mean value equal to the mean value of the HDM. In [48] snapshots were taken for 1 vortex shedding cycle of a square cylinder, here both SUPG and VMS ROMs remained accurate 40 vortex shedding cycles after the initial conditions, therefore well after the initial snapshot set. For the general case where we may use either RANS, LES or compressible Euler, [48] presents a review of stabilization methods that add dissipation directly to the reduced model in it’s ODE form.

2.4.2 Hybrid Methods

Hybrid methods attempt to marry an HDM and a ROM so as to speed up calculations whilst preserving a precision comparable to that of the full order model. The hybrid ROM that we are about to present achieve this marriage by only reducing the part of the domain that changes the least with the parameters or boundary conditions that will be varied. An example can be found in [51]: to analyze the effects of wind gusts on an airfoil, the response of domain with no airfoil is calculated, and the corresponding snapshots are used to reduce only the far field of the full computation. Near the airfoil a full-order model is used, and the two domains are coupled via a Schwarz method. We will start by presenting this approach first, and will finish by presenting another one which relies on sub-structuring.

Hybrid reduction by domain decomposition has its origins in the report [52] and later the article [48], where the authors sped by up to 20% the DNS calculations of a vortex-shedding square-cylinder, by using a POD-Least Mean Squares ROM during up to 30% of the calculated time interval. But rather than using POD-Least Mean Squares to reduce part of the time, the authors in [17] suggested using it to reduce part of the physical domain. In this case, the authors analyzed a convergent-divergent conduit with the compressible Euler equations. No shocks were present. The divergent end had its geometry and exit pressure varied, while the convergent end remained static. The full domain was cut in two, overlapping domains: one for the convergent part and the other for the divergent one. For the former POD - Least Mean Squares was used and for the latter a full solve was done each time. To get the complete answer the two domains were coupled via the Schwarz method (see [53] for a brief presentation, or the full book for a complete overview). The authors obtained relative (to the full HDM) errors on the state variables inferior to 0.5 %. A way to build the required snapshot base was presented in [16], in which residual-based greedy sampling was combined with Voronoi tessellation. Under the European AerGust (Aeroelastic Gust Modeling) program these methods were applied and further developed ([54], [55]) and finally presented in [51]. Here the authors applied it to a multi query analysis of an airfoil hit by gusts, and optimization (drag-reduction) of the front bumper of a car. The

23 former was done by DNS, the latter by RANS+Spalart-Allmaras. For the airfoil a 65× speedup from Full CFD to Hybrid was observed all the while maintaining excellent accuracy. For the front bumper optimization the Hybrid model took 26% of the time (with snapshot generation included) of the full CFD optimization , and gave a drag reduction of 3.42 %, while the full model gave one of 3.89%. For the optimization part, the authors recommend mesh morphing in lieu of re-meshing due to much faster execution times. Also, no adaptive or greedy sampling was used for the optimization. Developments are still under way, with sampling strategies being tested [56], as part of a doctoral thesis by the same author entitled ”Aerodynamic Shape Optimization through Reduced-Order Modeling in Industrial Problems”.

Sub-structuring POD Structure-wise, in [57] the authors present their previously developed method of POD - sub-structuring or SPOD ([58]) and introduce a new adaptive sub-structuring method (A-SPOD). Both these methods rely on Craig-Bampton [59] sub-structuring to separate parts of the structure that deform in a primarily elastic manner, and those that do not. For the model reduction in itself the authors applied the POD-Galerkin method to the typical Newton-Raphson iterations encountered in structural mechanics. The authors tested their methods on the horizontal flute forming of sheet metal: in this process a robot presses down on a sheet of metal to bend it permanently along a horizontal line. They simulated this problem for several sheets of varying thickness using full-order models in order to obtain snapshots. Then they applied SPOD and APOD to a sheet whose thickness was different from the rest. In both cases the calculations are done in less than half of the time of the HDM with relative errors for the displacement below 1% when more than 10 modes (ROM orders superior to 10) are used. Both methods have their disadvantages. A-SPOD requires continuous evaluation during solver iterations, therefore going against the black box principle, which states that a MOR method should not need access to the HDM’s code. SPOD requires the user to guess beforehand which zones will remain primarily elastic and which will not. Still, these methods seem very useful for the structures, but not for fluids. Through S-POD, we could use a ROM where the deformation and the strains are the lowest, such as at the root of the wing, and using the HDM at the tip where they are the highest. We have yet to find articles where such methods are used in optimization.

24 Chapter 3

Reduction of Benchmarks

3.1 Introduction

In this part of this master thesis we are going to test chosen model reduction methods on problems whose partial differential equations are close to those of the systems that we are trying to optimize. We have therefore chosen problems that exhibit advection, which is one of the simplest yet fundamental phenomenons of aerodynamics, diffusion and oscillatory problems. We will test the model reduction methods on both static and dynamic problems, and we will include at least one multi-parameter problem and one non-linear problem. The static problems are solved for various parameter or input values, to justify the use of model reduction methods. The methods we will be testing are:

1. Galerkin projection with Standard POD (all problems).

2. Galerkin projection with output/goal oriented POD (static problems,where the output Jacobian is available).

3. Galerkin projection with System Induced POD (static problems, where the System Jacobian is available).

4. Least Mean Squares reduction with POD basis (static problems).

The benchmarks that we will be using can be found in University of Freiburg’s benchmark page [60]. Here one can find benchmark problems and the matrices required to simulate them. They are usually given in Matrix Market format and are used along with Matlab scripts. Since we use Scilab, Numpy and Scipy for the simulations, we were obliged to create scripts for the translation of Matrix Market data into Scilab or Scipy format,depending on the problem. We will measure HDM and ROM solution times, the output error, the total error (difference between full order model and reduced model state variables), orthogonal error and collinear error. The collinear and orthogonal error will not be present for the Least Mean Squares Method. This is due to the fact that these measures were not derived for it. Were we to calculate such errors at each solve, we would be severely penalizing the speed of the method. The

25 (b) HDM and ROM output. (a) The Dynamic Advection problem.

Figure 3.1: At the left, the purple area is the dynamical advection problem domain, the heater is the point where we will measure the temperature vs time. At the right, the outputs. Both images were taken from [61]. errors will be evaluated in a relative way, using the Frobenius norm, they will thus be calculated as:

||e|| F (3.1) ||QHDM ||F

Here e is the relevant error measure and QHDM is the quantity of interest of the HDM. For the output error this would be the output, and for the remaining errors this would be the HDM state variable.This allows one to also compare the absolute errors. In the case of unidimensional data, such as the time response of a single output, this is equivalent to using the L2 norm. We will calculate the errors for several model orders and several snapshots sets, we are also trying to verify if we can obtain reasonable precision (relative errors within the 1%) using if possible as few as 10 snapshots for the basis.

3.2 Advection - dynamical

The problem chosen is described in [61] and whose matrices are available in [62]. We have chosen the 2D problem, which is a 2D thermal diffusion problem where a convective flow is applied to the domain (see figure 3.1a for a representation):

∂T ρc( + ~v · ∇T ) + ∇ · (−k∇T ) =q ˙ (3.2) ∂t

Where ρ is the density, T the temperature, t the time, ~v the advection/convection speed, k the thermal diffusivity and q˙ the heat input. The transport speed profile is constant and the transport speed amplitude can be varied. We have chosen the version of the problem where the speed amplitude is 0.5 m/s. The discretized problem is given by:

CT˙ + KT = b, T (t = 0) = T0 (3.3)

T being the state variable, C a mass matrix, K the matrix accounting for diffusion and advection, b the load vector . The full order model response given by the authors can be seen in figure 3.1b.

26 3.2.1 Methods Applied

We will solve the ODE by using a first order implicit method for the discretization in time. In other words, we transform equation 3.3 into:

T i+1 − T i C + KT i+1 = b, T 0 = T (3.4) ∆t 0

The reason for the implicit method is its unconditional stability: this allows us to immediately check if a model is unstable or not. We can later vary the time step ∆t so as to get a correct solution. We will use the Galerkin Projection with standard POD for the basis. We will be checking if the following relationships are verified:

||ecollinear||2 ≤ ||eorthogonal||2 (3.5)

sPr 2 i=k+1 λi ||eorthogonal||2/||x||2 = Pr 2 (3.6) i=1 λi We will be also using the Galerkin Projection with the Goal Oriented POD, for the output of interest.

Snapshots of the HDM will be taken each ∆S ∈ N time steps. We will verify the errors for different ∆S and different k (model order), so as to understand the influence of the amount of samples and model order on the errors. We will also be testing the effect of the integration method used for calculating the POD. Since for time varying data the POD requires the numerical integration of this data, we will be testing the effect on the several errors of using the rectangle rule (0th order method), trapeze rule (1st order method) and Simpson rule (2nd order method). We will apply the composite versions of these rules, as they are presented in [63] and [64]. For all models we have chosen a time step ∆t to be equal to 0.015 s,as the solution of the HDM seems to not vary significantly if we decrease the time step any further, and the models will be solved for the time interval [0,1.5] s. All computations were done on a laptop with an Intel Core i7-420HQ CPU, 7.89 GB of usable RAM and running Windows 10.

3.2.2 Results and Discussion

The full order model time response computed by us can be seen in figure 3.2, and it seems to match the curve given by the authors in [61] (see figure 3.1b). Its time response is quite similar to a simple exponential response of the type 1 − exp(−t/τ), so we expect that with only a few modes we will be able to capture the original time response quite well. For the Galerkin Projection 2 studies were done : one where the POD of all timesteps (∆S = 1) was done; another where only 20 uniformly spaced timesteps (∆S = 5) were evaluated. We expect that equations 3.5 and 3.6 be verified by the former and equation 3.5 be verified by the latter. The several error measures for ∆S = 1 and ∆S = 5 can be found in figures 3.4 and 3.5 respectively. As predicted, the output error falls sharply, being largely inferior to any of the state error measures. For ∆S = 1 we find that nor equation 3.6 or 3.5 are strictly verified. For the latter we suppose that the magnitude of the errors might come into play : the total, orthogonal and collinear errors are quite close initially, but for k = 10 and after, the magnitude is of 10−8 and equation 3.5 is clearly not verified. However, the behavior

27 POD ordered EigenValues

100 ∆S = 1 103 ∆S = 5 80

60 10−1

40 10−5 Temperature K Magnitude 20 HDM 10−9 0 ROM of order 5 and ∆S 5

0 0.5 1 1.5 10−13 Time (s) 0 5 10 15 20 i Figure 3.2: Response of the full order model and a selected ROM for the Dynamic Advec- Figure 3.3: Ordered Eigenvalues of the POD tion problem. of the Dynamic Advection problem. of the Orthogonal error is mimicked by the collinear and total errors, so one can safely assume that by reducing the former we are also reducing the latter. The violation of equation 3.6 is existent, but the relative orthogonal error and predicted orthogonal error are close enough for us to consider equation 3.6 valid. For the case of ∆S = 5 we can see that equation 3.5 is also violated, in a much similar fashion to ∆S = 1. More interesting is the behavior of the a priori indicator : after k = 5 it fails to properly follow the variation of the orthogonal error. Knowing that r = 20 in this case, we assume that this behavior is due to the fact that the modes after k = 5 do not properly capture the dynamics of the HDM, and more snapshots are required. Further evidence can be found in figure 3.3, where the eigenvalues between the PODs of ∆S = 1 and ∆S = 5 start to differ dramatically after i = 5. This phenomena is accompanied by an increase in collinear and total state error. It is thus advisable to have far more snapshots than modes, so as to ensure the quality of the latter. As it can be seen in table 3.2, the integration rule has little effect on the several error measures for the Galerkin ROM. It can have, however, a slight effect in its performance : for regularly spaced intervals, the rectangle rule is applied by multiplying all entries by a constant, a task which can be easily made in parallel. The remaining methods require the prior calculation of the coefficients for each time step. For very big snapshot matrices this might cause a slight performance loss. Currently we see no tangible gain in using higher-order integration methods. But in the case the HDM has uneven timesteps, one should at least use the trapeze method since the rectangle rule does not converge for uneven timesteps. For the Goal/Output Oriented ROM the errors are available in figure 3.6 for ∆S = 5. It is clear that the errors, both for the output and the state are unacceptable. Curiously, equation 3.5 is verified by this ROM.

Wall Clock Time is given in table 3.3. The POD took 13.7 seconds to compute for the case of ∆S = 1 and 2.9 seconds for the case of ∆S = 5. Thus here POD computation times are far more important than

28 Table 3.1: Relative errors for ROM of order 5 for different POD methods and different ∆S for the Dynamic Advection problem.

k=5 ∆S=1 ∆S=5 ∆S=5 (Output Oriented) Total error 3.29E-03 % 7.38E-02 % 100 % Ortho error 2.59E-03 % 4.93E-02 % 99 % Predicted Orthogonal 1.45E-02 % 7.08E-04 % N/A Colin error 2.03E-03 % 5.49E-02 % 5 % Output error 2.91E-9 % 2.14E-05 % 98 %

Table 3.2: Effect of the order of the integration method on the error for ROM of order 5, ∆S = 5 for the Dynamic Advection problem. We give the difference relative to the case of rectangle integration, in other words, we present ei−e0 , where i is the order of the integration method. e0 Time integration order 0 1 2 Output err (rel) 0 -1.97E-02% 7.98E-02% Total err 0 1.64E-01% 3.20E-01% Ortho err 0 9.22E-04% 5.52E-02% Predic orth 0 7.62% 4.21% Colin err 0 2.96E-01% 5.34E-01% the computation of the ROM itself. The total speed up of the model is 15 × for ∆S = 1 and 70 × for ∆S = 5 all while ensuring an output error below 1% when k bigger than 5 is used, as it can be seen from table 3.1.

3.3 Oscillatory

The problem that we are going to reduce here is that of a butterfly gyro, commonly used for MEMS (micro electro-mechanical systems) applications, as described in [65], [66] and [67]. We will be using the data available in [65] which gives a non-parametrized dynamical model of the gyroscope, already in its semi-discretized form as: Mx¨ + Ex˙ + Kx = Bu (3.7)

Here u is given by : u = .055 sin(2384(Hz) × t), (µN) (3.8)

Table 3.3: Wall Clock times for the HDM and ROM for the Dynamic Advection problem. The time does not depend on the method for basis generation, being the same for whatever snapshot set or POD used. Values taken are approximate averages.

HDM solution time : 2.06e+02 s k Solve Time (s) 1 1.16e-01 5 1.81e-01 10 1.92e-01 15 2.12e-01 20 2.34e-01 30 5.01E-01

29 ROM error for ∆S=1 ROM error for ∆S=5

100 eout 100 et e⊥ epriori 10−4 ⊥ 10−4 e//

10−8 10−8

eout Relative Error Relative Error et −12 −12 10 10 e⊥ priori e⊥ e// 10−16 10−16 0 5 10 15 20 25 30 0 5 10 15 20 Model Order Model Order

Figure 3.4: Error of the ROM of the Dynamic Figure 3.5: Error of the ROM of the Dynamic Advection problem for 100 Snapshots. Advection problem for 20 Snapshots.

ROM error for ∆S=5 with Output Oriented ROM

eout 1 et e⊥ e 0.8 //

0.6

0.4 Relative Error

0.2

0 2 4 6 8 10 Model Order

Figure 3.6: Error of the ROM of the Dynamic Advection problem for 20 Snapshots with Goal Oriented POD.

With the state and its derivatives starting at 0. One of the issues with this benchmark is that the units of the state variable are unknown, and no HDM response is given by the authors. We assume them to be in µm, given that the matrices were generated from and that (µm, µN, s...) is the only predefined unit set that has the same units for the force [68]. We set the time duration of the problem to 3 milliseconds. The choice of this benchmark lies in the fact that it is the purely structural dynamical benchmark with the highest number of unknowns (the state vector has 17 361 variables). This allows us to test MOR on a bigger problem where there is less damping, and thus there might be stability issues. The remainder of the structural dynamical benchmarks found also did not come with an example of the HDM response. This means that we need to find another way to verify that the equations are being solved correctly.

30 x1 - Newmark x2 - Newmark 1 x1 - Analytical x2 - Analytical

0 Position

−1

0 5 10 15 20 Time

Figure 3.7: Analytical solution of the two body problem described in [70] and [71] versus the coded Newmark solver for a timestep ∆t of 0.1 .

3.3.1 Methods Applied

To solve this problem we employed the Newmark Average accelerations method [69]. The coded solver was verified against a 2-body dimensionless elastic problem as described in [70] and in [71] which can be solved analytically. A comparison between the analytical solution and the coded Newmark solver can be seen in figure 3.7. Given the almost completely perfect match between the analytical solution and the computed one, we consider our solver to be working correctly. To retain this precision, we have chosen a time step ∆t equal to 1e-5 seconds, since further reducing the time step yielded no significant changes in the computed HDM response. We will only explore the Galerkin Projection method with the standard POD for snapshot sets with snapshots taken each ∆S = 3, 10 and 30 time steps. As for the Dynamic Advection problem, our aim is to verify equation 3.5 for whatever snapshot set and 3.6 for very refined snapshot sets. The solver was verified on Scilab, due to its easy coding and plotting. Given the size of the matrices, it was later recoded in Python 3.7 using Numpy and Scipy on a custom built machine with Ryzen 1800X, 16 GB of RAM and running the Manjaro OS (a fork of ArchLinux). The HDM and ROM were computed on this machine.

3.3.2 Results and Discussion

For the full order model the time response is available in figure 3.8, and the magnitude of the eigenvalues resulting from the POD of different snapshot sets is available in figure 3.15. The magnitude of the HDM response is unexpectedly small, and might cause problems in computations due to machine precision. However, we have no way of confirming precisely if we are using the same units as the authors, and we will keep using the same units we have been using thus far. The response of the system is quite simple, it seems to be just a sinus wave in anti phase with the input force. The fact that it is a sinus wave may be at the origin of the extremely fast decay of the POD’s eigenvalues : with only 10 snapshots we manage to capture almost completely the energy of the response.

31 ·10−15 POD ordered EigenValues 4 ∆S = 3 ∆S = 30

) 2 10−11 µm

0 10−16 Amplitude (

−2 Magnitude

HDM 10−21 −4 ROM 0 0.5 1 1.5 2 2.5 3 10−26 Time (s) ·10−3 0 50 100 150 200 250 300 i Figure 3.8: Response of the full order model and a selected ROM of order 6 and ∆S = 30 Figure 3.9: Ordered Eigenvalues of the POD for the Oscillatory problem. of the Oscillatory problem.

For the Galerkin Projection the error progression for different snapshot sets and different model orders can be found in figures 3.10, 3.11 and 3.12, and complete error values for a 6th order model are given in table 3.4. As it can be seen the relative errors obtained are very small, even when using only 10 snapshots (∆S). However, equation 3.5 is not at all verified and increasing model order actually seems to increase all errors (except the orthogonal error). This could be the consequence of the very small numbers that we are dealing with, which induce additional error due to machine precision. As for equation 3.6, as expected it remains applicable to the case where we have most snapshots (∆S = 3). No ROM has demonstrated any instability. Wall Clock Time is given in table 3.5 for the ROM, HDM and SVD solves. As it can be seen, the HDM

Table 3.4: Relative errors for the different snapshot sets for a ROM of order 6 for the Oscillatory Problem.

k = 6 ∆S 30 ∆S 10 ∆S 3 Out err 7.07E-02 % 5.60E-02 % 8.01E-02 % Predicted err 6.82E-13 % 5.01E-12 % 4.58E-10 % Orthogonal err 2.30E-05 % 1.42E-8 % 5.25E-10 % Colin err 9.28E-03 % 1.93E-02 % 9.34E-03 % Total err 9.28E-03 % 1.93E-02 % 9.34E-03 %

itself does not take much time to be computed, and yet the ROM can speed up the computation by more than 10 ×, whilst giving very reasonable errors. The computation of the POD can take more time than the computation of the HDM itself, but we believe that for non-linear models this will not be the case. Still, caution should be taken to not use a too large snapshot set.

32 Table 3.5: Wall clock time for ROM and HDM solves (left) and SVD computation time for different snap- shot sets (right) for Oscillatory problem.

HDM solution 21.68 s ∆S SVD t (s) Model order t (s) 3 55.53 1 0.04 10 16.64 6 0.11 30 5.41 11 0.18 (b) SVD (a) ROM & HDM

ROM error for ∆S=3 with Standard POD ROM error for ∆S=10 with Standard POD 10−2

10−4 10−5

10−7 10−8 10−10 eout eout Relative Error −11 Relative Error 10 et et e⊥ 10−13 e⊥ priori priori e⊥ e⊥ 10−14 e// e// 10−16 0 2 4 6 8 10 12 0 2 4 6 8 10 12 Model Order Model Order

Figure 3.10: ROM error for ∆S=3 with Stan- Figure 3.11: ROM error for ∆S=10 with Stan- dard POD for the Oscillatory problem. dard POD for the Oscillatory problem.

33 ROM error for ∆S=30 with Standard POD

10−3

10−6

10−9

eout Relative Error et −12 10 e⊥ priori e⊥ e// 10−15 0 2 4 6 8 10 12 Model Order

Figure 3.12: ROM error for ∆S=30 with Standard POD for the Oscillatory problem.

(a) The Static Advection problem. (b) HDM output.

Figure 3.13: The multi-parametric problem described in [72] (left) and the expected HDM response (right).

3.4 Advection - static

For this problem we have chosen the multi-parametric anemometer model described in [72] and that is made available in [73]. In particular, we chose the 3 parameter model. A representation of the problem is made available in figure 3.13a. Like the previous advection model, its is a convection diffusion model of the form: ∂T ρc = ∇ · (k∇T ) − ρcv∇T +q ˙ (3.9) ∂t

Where c, heat capacity, v advection velocity, ρ mass density, k the thermal diffusivity , q˙ the heat input, T temperature and t time. The following three parameters can be varied: P1 - ρc, P2 - k,P3 - ρcv. Since we will deal with a static response, and we will apply a static input, the equation of the system is simply:

0 = ∇ · (k∇T ) − ρcv∇T +q ˙ (3.10)

34 And the new parameter set is: p1 - k, p2 - ρcv. The authors discretized this problem via the finite element method, leading to the following equation:

(As + p1Af + p2Ac)T = Bu (3.11)

Here As, Af and Ac are matrices linked to the discretization done by the authors. Since the magnitude of the input is not given, we calculate the response for u = 1 (the system being linear, the response of the system for a different input can be obtained by multiplying our response by the amplitude of said input), p1=[1;1.9] with step ∆p1 = 0.1 , p2=[0;1.8] with step ∆p2 = 0.2. The response calculated by the authors is shown in figure 3.13b.

3.4.1 Methods Applied

We will be testing the following model reduction methods:

1. Galerkin Projection with Standard POD

2. Least Mean Squares with Standard POD

3. Galerkin Projection with Goal/Output Orient POD

4. Galerkin Projection with System Oriented POD

For the POD, we have 3 possible cases : where all HDM data is decomposed (∆S = 1); where only data along the lines p2 = 1.8 and p2 = 0.8 was used (∆S = 5); where only data along the line p2 = 1.8 was used (∆S = 10). We are not comparing space sampling methods, we are simply trying to see how each model reduction method performs, specially against one another. The model reduction and HDM were done using the Python Numpy and Scipy packages and the Spyder IDE. Calculations were done on a custom built machine with Ryzen 1800X, 16 GB of RAM and running the Manjaro OS (a fork of ArchLinux).

3.4.2 Results and Discussion

The full-order model the response can be viewed at figure 3.14. It is clear that we do not have the same amplitude as the response 3.13b. However, since the load u was not given, it is impossible for us to check if our HDM corresponds to the same model as the author’s. Given the fact that the functions for reading the matrices have been verified and the function for constructing the problem was supplied by the authors, we see no way to obtain the original author’s response. We will thus keep the model, and for the sake of consistency apply the same problem used in the HDM to the ROMs. The eigenvalues for the POD of different snapshot sets is given in figure 3.15. The magnitude of the eigenvalues does not go down as fast as the eigenvalues for the dynamical problems. Therefore, for parametric problems, more snapshots and higher order ROMs may be required in order to maintain low error.

35 POD ordered EigenValues

104 ∆S = 1 HDM ∆S = 10 ROM 101

0 10−2

−5 −0.05 10 T ∆ 10−8 −0.1 1 1.8 10−11 1.6 1.4 vc 0 20 40 60 80 100 1.2 1 0 k i

Figure 3.14: Computed HDM and chosen Figure 3.15: Magnitude of the ordered Eigen- ROM of order 6 ∆S = 10 response for the values of the POD of the Static Advection prob- Static Advection problem. lem.

Table 3.6: Relative errors for a ROM of order 6 for the Static Advection Problem. The errors for the System Induced POD (not shown), are all superior to 10.000 %

k=6 ∆S=1 ∆S=5 ∆S=5 LMS ∆S= 10 ∆S =10 LMS ∆S=10 Output Output 6.77 % 10.00 % 22.50 % 8.94 % 66.40 % 100.00 % Total 46.00 % 45.00 % 45.00 % 44.00 % 49.00 % 100.00 % Orthogonal 0.05 % 0.33 % NA 0.45 % NA 100.00 % Predicted orth. 0.05 % 0.01 % NA 8.89E-06 % NA NA Collinear 46.00 % 45.00 % NA 44.00 % NA 0.02 %

36 For the Galerkin Projection the errors can be viewed in figures 3.16, 3.18, 3.21 for ∆S = 1, ∆S = 5 and ∆S = 10, respectively. For ROMs of order 6, table 3.6 gives the actual values of the relative errors for the several snapshot sets and model reduction methods. We can see in figure 3.16, equation 3.6 is well verified. One of the most important lessons in these figures is that even with all the snapshots and with high order models the Output error is still superior to 5%. It seems that we have reached the end of the capabilities of the method: domain decomposition may be required. The problem is specially severe for ∆S = 10, where the Output error is close to 10%. For any of the cases the Total error is quite high and its value dominated by the Collinear error. The a priori orthogonal error measure is therefore of little use. Trying to use a different formulation for the POD problem nets no improvement. It can be seen from either figure 3.20 (Output Oriented POD) or 3.19 (System Oriented POD) that the Output error for these methods is always close to 100% or far more superior, even if the Output Oriented POD managed to give a Collinear error inferior to the Orthogonal Error. It seems therefore useless to use these methods as a way to decrease the error of the Galerkin Projection. Finally, we attempted to estimate the total error using the method presented in section 2.3.4, but no matter the implementation, the computation of this error estimate took more than one hour to complete, making it impractical for MOR. For the Least Mean Squares reduction the errors can be seen in figures 3.17 and 3.22 for ∆S = 5 and ∆S = 10. The error achieved is quite similar to the normal Galerkin projection for ∆S = 5, but for ∆S = 10 this is clearly not the case. Here, the error is far superior to that of the Galerkin ROM. This makes it clear some of the limitations of the Galerkin and Least Mean Squares ROM in terms of error : even if we manage to decrease orthogonal error (for the Galerkin ROM) by increasing model order, the actual Output and Total error might not vary at all. This might be solved by a more clever choice of snapshots and hence, the use of a sampling algorithm. The Galerkin ROM appears to have lower error or deviation than the Least Mean Squares method. In terms of Wall Clock time the HDM took 19 s to complete, with the ROM and SVD solution times shown in table 3.7. As seen before, it seems that for linear systems the most penalizing step in MOR is computing the SVD, as the higher order ROMs are still about 10 × faster than the HDM. Each Galerkin ROM test case or an equivalent test case with the Least Mean Squares Reduction takes about 1 second to compute. The modified POD methods take 1 hour (for Output Oriented) or 3 hours (for System Oriented) for each solve. The inefficiency of these last two methods is due to the fact that we further complicate the SVD of the snapshot set. This is especially the case for the System Oriented POD, where a full SVD solve is required for each parameter set, and the Snapshot Set must be always available. This quickly blows up the usage of RAM (which was the case), and the system is forced to use the swap space of the hard drive, seriously impacting the performance of the computation (even if the machine was using a solid-sate drive). For the case of the Output oriented ROM, this only impacts the SVD computation, but it does so in a severe way, destroying the performance of the method.

37 Table 3.7: Wall clock times for the HDM, SVD computation and the several ROMs for the Static Advection problem. The ROMs using the Output or System Oriented take slightly more than one hour to compute.

HDM Solve : 19.07 s ROM order Galerkin LMS Others 2 0.69 s 0.72 s > 1 hour 4 1.05 s 1.16 s - 6 1.32 s 1.57 s - 8 1.87 s 2.05 s - 10 2.39 s 2.70 s - ∆S 1 5 10 SVD time 164.9 s 33.8 s 17.9 s

ROM error for ∆S=1 with Standard POD

10−1

10−3

−5 eout

Relative Error 10 et e⊥ epriori −7 ⊥ 10 e// 0 5 10 15 20 Model Order

Figure 3.16: ROM error for ∆S=1 with Standard POD for the Static Advection problem.

ROM error for ∆S=5 with Least Mean Squares ROM error for ∆S=5 with Standard ROM 100 100

10−1

10−2

10−3

−4

Relative Error 10 eout −1 Relative Error 10 10−5 et Output e⊥ Total 10−6 priori e⊥ e// 2 4 6 8 10 10−7 Model Order 2 4 6 8 10 Model Order Figure 3.17: ROM error for ∆S=5 with Least Mean Squares Reduction Standard ROM for Figure 3.18: ROM error for ∆S=5 with Stan- the Static Advection problem. dard POD for the Static Advection problem.

38 ROM error for ∆S=10 with Output Oriented POD ROM error for ∆S=5 with System Induced POD 1010 103 Output Total 10−28 102

10−66

eout 101 Relative Error et

Relative Error −104 10 e⊥ priori e⊥ e// 100 10−142 2 4 6 8 10 2 2.5 3 3.5 4 Model Order Model Order Figure 3.20: ROM error for ∆S=10 with Output Figure 3.19: ROM error for ∆S=5 with System Oriented POD for the Static Advection prob- Induced POD for the Static Advection problem. lem.

ROM error for ∆S=10 with Least Mean Squares ROM error for ∆S=10 with Standard POD 101 Output Total

10−1 100.5

10−3

−5 10 Relative Error 0 eout 10 Relative Error et 10−7 e⊥ priori e⊥ e// 10−9 2 4 6 8 10 2 4 6 8 10 Model Order Model Order Figure 3.22: ROM error for ∆S=10 with Least Figure 3.21: ROM error for ∆S=10 with Stan- Mean Squares Reduction Standard ROM for dard POD for the Static Advection problem. the Static Advection problem.

39 (a) The Static Diffusion problem. (b) HDM output.[74]

Figure 3.23: Static Diffusion Problem in [74]. In our model there is no heat flux coming from the left. Since our model has different coefficients, the responses should be slightly different.

3.5 Diffusion - static

For this case we chose the benchmark available in [74], which deals with the heat diffusion through a bar where heat diffusion varies with the temperature. See figure 3.23a for a representation of the problem. The differential equation for this problem is thus:

n X i − ∇ · (k(T )∇T ) + ρcpT˙ = Q, k(T ) = aiT (3.12) i=0

In our case n = 4. The PDE was discretized by using Ritz-Galerkin Finite Elements into the system:

ET˙ + AT = Bu + F (T ), y = CT (3.13)

Where u is the input heat flux. We took the discretized equations directly from [75], where the density, heat capacity and heat conductivity coefficients differ slightly from the ones used in [74]. There is no version with exactly the same coefficients as in [74]. We present in table 3.8 the coefficients of the article and the version we used as a benchmark. We will vary the input heat flux u from 50.000 to

Table 3.8: Coefficients used in [74] (left) and made available in [75] (right) for Static Diffusion Problem. The coefficients at the right will be used for our model.

Parameter Value in [74] Value in [75] Length (m) .1 .1 Cross-sectional area (m2) 1e-4 1e-4 Density (kg/m3) 2330 3970 Heat capacity (J/KgK) 720 766 a0 (W/(m ∗ K)) 144.495 36 a1 (W/(m ∗ K2)) -.54534 -.1116 a2 (W/(m ∗ K3)) 9.27496e-4 0.00017298 a3 (W/(m ∗ K4)) -8.28691e-7 -1.78746e-7 a4 (W/(m ∗ K5)) 3.18727e-10 1.3852815e-10

550.000 W/m2 with steps of 25.000 W/m2, and we will assume for each simulation that the heat input

40 Table 3.9: Relative errors for ROM of order 6 for different reduction methods and snapshot sets for the nonlinear static diffusion problem.

∆S=1 ∆S=3 ∆S=3 LMS Output err 1.29E-02 % 7.56E-03 % 3.62E-01 % Total err 8.58E-01 % 9.65E-01 % 6.02E-01 % Ortho err 2.60E-03 % 1.36E-01 % NA Predic orth 2.60E-03 % 6.57E-05 % NA Colin err 8.58E-01 % 9.55E-01 % NA is constant. We can therefore immediately obtain the answer to the static problem by solving:

AT = Bu + F (T ), y = CT (3.14)

The HDM static response computed by the authors is shown in figure 3.23b.

3.5.1 Methods Applied

We will employ two different methods to reduce equation 3.13:

1. Galerkin Projection with Standard POD

2. Least Mean Squares with Standard POD

All models were coded in Scilab. The innate ”fsolve” function was used to solve the HDM and the Galerkin ROM, while ”leastsq” was used for the Least Mean Squares ROM and also the Galerkin ROM (to compare the results). For the Galerkin ROM we will construct a basis using all the available data (∆S = 1) and using only 7 snapshots (∆S = 3). For the Least Mean Squares we will only consider the case where there are 7 snapshots. We expect equation 3.5 to be verified for the Galerkin ROM with ∆S = 1. As mentioned before we will calculate the static response of the model for an input u going from 50,000 to 550,000 with a step of 25,000 (all in W/m2). All computations were done on a laptop with an Intel Core i7-420HQ CPU, 7.89 GB of usable RAM and running Windows 10.

3.5.2 Results and Discussion

For the full-order model the response can be found in figure 3.24 below. As expected, the HDM response is different from the response given by the authors in figure 3.23b. However it is not so different as to invalidate our calculations. We will therefore consider our HDM as correct. The POD decomposition of different snapshot sets of the HDM is available in figure 3.25. Again it can be seen that the eigenvalues do not decay as fast as in the dynamical problems. For the Galerkin Projection with ∆S = 1 and ∆S = 3 we can find the various error measures in figures 3.26 and 3.27. Actual error values are given in table 3.9 for the different model reduction methods and snapshot sets. As one can glean from the figures, even with a reduced amount of snapshots and a first order model, we can guarantee output errors below 1 %. Moreover, for ∆S = 1, equation 3.6 is completely verified : the a priori gives a quite accurate figure for the orthogonal error. Naturally this

41 500 POD ordered EigenValues 400 105 ∆S = 1 104 ∆S = 3 300 103

200 102

Temperature - 300 K 101 100 HDM Magnitude ROM 100 0 1 2 3 4 5 6 10−1 5 Input Heat Flux (W/m2) ·10 10−2 Figure 3.24: HDM response and chosen ROM 1 2 3 4 5 6 7 of order 6 for δS=3 response for the nonlinear i static diffusion problem. The original model in [74] only went up to 350.000 W/m2 of input Figure 3.25: Ordered Eigenvalues of the POD heat flux. for the nonlinear static diffusion problem.

stops being the case for ∆S = 3 when we start using model orders that approach the limit imposed by the 7 snapshots.

Unlike the Dynamical Advection model, the variation of the collinear error does not follow that of the orthogonal error, and the collinear error presents the biggest contribution to the total error. Thus, even if the a priori could give us an estimate of the orthogonal error, we would have no way to tell how the Total error is varying. Moreover, the Output error follows the variation of the Total error. Hence we would not be able to predict the output error either. For the Least Mean Squares ROM the errors can be found in figure 3.28. One of the immediate obser- vations that can be done is the fact that we obtain a higher errors than the Galerkin method with the same amount of snapshots. We believe that this is not necessarily related to the method itself, but might rather be Scilab’s function ”leastsq”. This is Scilab’s function for solving non-linear least mean square problems, which itself calls on Scilab’s optimization suite to minimize the residual associated with the least mean squares problem. By inspecting the evolution of this algorithm both for the Galerkin ROM and the Least Mean Squares ROM, we found that for the former it monotonically decreases the residue until it is in the order of 10−1 while for the latter it keeps decreasing the residue until 0.8 and after it increases it until 2.1. Hence the algorithm seems to find a minimum but promptly discards it and keeps doing it’s iterations. Even if this problem is present for the Least Mean Squares ROM, we find no major difference between the results given by ”fsolve” and ”leastsq” for the Galerkin Projection method. Wall Clock Time for all models is given in table 3.10, including the time required for computing the SVD. As it can be observed, the Solve time of the ROMs dominates over the POD calculation time. We sup- posed this is due to the limited number of snapshots used, and the nonlinear nature of the problem, which naturally entails a bigger workload for the CPU. The Wall Clock times for the Least Mean Squares ROM are quite surprising : if we wish to guarantee an output error below 1%, we will need to wait a time

42 comparable to, or almost double of the HDM solution. Indeed the Galerkin ROM using the ”fsolve” func- tion can give a solution in almost one tenth of the time of the Least Mean Squares ROM. We suspected that this might be another problem related to the ”leastsq” function used. And in fact this is the case : we have comparable solution times between the Galerkin ROM and the Least Mean Squares ROM when ”leastsq” is used on both.

Table 3.10: Computation times for the nonlinear static diffusion problem. Top : solution times in seconds for the HDM (top), Galerkin ROMs using ”fsolve” for ∆S = 1 and ∆S = 3 (left), the Least Mean Squares ROM using ”leastsq” (middle) and the Galerkin ROM with ∆S = 3 using ”leastsq” (right). Bottom : representative values of POD calculation times in seconds for different values of ∆S.

HDM Solve : 173 seconds k ∆S = 1 and ∆S = 3 ∆S = 3 LMS ∆S = 3 (”leastsq”) 1 3.96 24.7 15.9 3 9.70 138 118 6 8.53 345 441 9 11.4 12 16.0 15 14.5 18 12.2 20 13.5 ∆S 1 3 SVD time 1.13e-03 2.27e-03

Galerkin ROM error for ∆S=1

10−3

10−7

eout Relative Error 10−11 et e⊥ priori e⊥ e 10−15 // 0 5 10 15 20 Model Order

Figure 3.26: Error of the Galerkin ROM with ∆S = 1 for the nonlinear static diffusion problem. The collinear and Total errors are superposed. In the same fashion, the Orthogonal and Predicted Orthogo- nal errors are superposed.

3.6 Conclusion

The Galerkin Projection and Least Mean Square methods seem to guarantee precise reduced order models with as little as 10 previous HDM computations. These ROMs are more than 10 × faster than the original reduced order model and boast deviations below 1% as long as the model has only one

43 Galerkin ROM error for ∆S=3 LMSQ ROM error for ∆S=3

10−1 100 Output Total 10−2

10−3 10−1

10−4

eout −2

Relative Error Relative Error 10 10−5 et e⊥ priori −6 e⊥ 10 e // 10−3 1 2 3 4 5 6 1 2 3 4 5 6 Model Order Model Order

Figure 3.27: Error of the Galerkin ROM with Figure 3.28: Error of the Least Mean Squares ∆S = 3 for the nonlinear static diffusion prob- ROM with ∆S = 3 for the nonlinear static diffu- lem, meaning a total of 7 snapshots were sion problem, meaning a total of 7 snapshots taken. The collinear and Total errors are su- were taken. The ”leastsq” Scilab function was perposed. used for this case. varying parameter. Otherwise we can expect relative output errors near 10 % or perhaps even higher (for the least mean squares method), which may be unacceptable according to the industrials who have answered our survey. It is clear therefore, that the Galerkin or LMSQ method alone is not sufficient for multi-parameter static problems. Given that we plan on reducing a high fidelity model of a wing, one way to get to the required precision would be by using domain decomposition methods. We do not consider other methods because when we change the shape of the wing, we are not changing a linear parameter of the underlying PDE. Using the least-mean squares method tends to give slightly worse results for any problem, or far worse in the case of the multi-parameter one, and it presents no speed advantages relatively to the Galerkin Projection method. However, these disadvantages seem highly dependent on the optimizer used to solve the ROM. Finally the System Induced and Output/Goal Oriented POD give extremely high errors and computation times, which means that these methods are not fit for our purpose. Setting the problems related to parametric systems aside, both the Galerkin and Least Mean Squares seem apt at producing precise ROMs, and we have detected no stability problems when using the Galerkin Projection.

44 Chapter 4

CFD Analysis and Reduction

4.1 Introduction

We will now test the POD+Galerkin Projection and POD+LMSQ reduction on CFD problems presenting the same physical phenomena found in lifting surfaces.

4.2 Choice of Solver

We will now attempt to reduce a high-fidelity CFD model. We therefore require solvers and models for aerodynamics where we can easily implement reduced order models. Given the error found in section 3.4, hybrid reduction may be required in order to ensure a small error. Therefore we need a solver where we can easily control the type of domain decomposition being done. Finally, we would like to keep in mind the overarching context of optimization of an aircraft. This entails having solvers that can supply sensitivities and that allow for high fidelity models. We are therefore going to start to screen potential solvers for our problem. We will judge them by basing ourselves on the following criteria:

• Fidelity - the ability to produce solutions close to reality.

• Optimization ready - can supply sensitivities of a solution.

• Easy Model Reduction - configuring the solver to run reduced order models requires little effort.

• Easy Decomposition specification - specifying the type of domain decomposition or sub-structuring being used requires little effort.

Of the universe of solvers analyzed, we found three candidates: OpenFOAM, SU2 and FreeFem++. We will analyze each solver in detail, and finishing by showing a decision matrix comparing the various solvers and the choice of solver for this section.

SU2 - Stanford University Unstructured SU2 (full software description in [76]) is a standalone solver (requires external software for mesh generation and for output visualization) originally developed at

45 Stanford University and being currently developed by teams in Holland, Germany, United Kingdom, Italy, Australia, Canada and India [77]. For aerodynamic problems it features RANS (with the Menter SST and Spalart Allmaras turbulence models) and Euler FVM solvers for any type of unstructured mesh and the choice of several limiters and convergence acceleration methods. It can also compute other physical problems such as plasma flow, thermal diffusion, wave propagation, and more interestingly : linear elasticity. These problems can also be coupled with one another, enabling multi-physics calculations. In terms of fidelity, one can find in the article cited at the beginning how SU2 performs in calculating flows for industry standards such as the ONERA M6 (experimental data in [78] and geometric data in [79]) and the RAE 2822 profile (experimental data in [80] and profile curve in [81]), two well documented aerodynamic bodies flying at transonic speeds. Excellent agreement between the models and Cp data is found, as for many other benchmarks (see [82] for a complete V&V report). As for the optimization part, SU2 is designed from the get-go for shape optimization, and several examples are available on the documentation on how to optimize airfoils or entire wings. It can even take into account elastic deformation, performing aerodynamic optimization on elastically deforming bodies [83]. For full structural and aerodynamic optimization, the approach taken by some of the main contributors to SU2 is to use SU2 for aerodynamic computations, other solvers for structural computations, and SUAVE for solver coordination and multidisciplinary optimization [84]. It is possible to use over-set grids or chimera grids in SU2 via the OPERA tool presented in [85]. The chimera grids are manually specified by the users. However, domain decomposition itself is handled automatically in SU2, being the primary component in its parallelization. The solving in SU2 is coordinated by the ”CDriver” class of the program. The domain decomposition itself starts by a call from the constructor of the class ”CDriver” to the constructor of the ”CGeometry class”. The terms of the PDE to be solved (fluxes and sources) are computed by calls to the ”CSolver” class and the residual of the corresponding ODE is computed by the ”CIntegration” class. The specific numerical method for determining fluxes is set by calls to the ”CNumerics” class, which will itself compute these fluxes. The method by which these numerical fluxes are calculated do not only depend on the choice of limiter, but also on the user’s choice to use multi-grid methods or not. If he did, two (or more) separate grid entities are handled. The iterations themselves (and hence the actual solving of the model) are done by calling the ”Iterate” method of the ”CIteration” class (”CMeanFlowIteration” for the Navier Stokes equations), which will itself call a method in the ”CIntegration” class (”SingleGrid Integration” if we do not use multi-grid methods). This method will call a series of methods in the ”CSolver” class in order to get boundary condition and residual data, the residual data depending on the choice of integration and regulators. These methods will also be used to build the system matrix (”CSysMatrix” class) which will be used for the subsequent calculations and is stored along with the Solution and Residuals vector (”CSysVector”) in the ”CSolver” class. See the SU2 Doxygen documentation [86] for a complete list of all the class and method dependencies. The complexity of the code is immediately apparent, and should we attempt to either implement manual zone selection for domain decomposition, or the usage of reduced order models, it would probably take far more time than what is available for the conclusion of a master thesis. To implement the desired domain decomposition we would have to modify the CPhysicalGeometry and how it deals with ParMETIS, and take care that the rest of the

46 code is not negatively affected by it. For model reduction, we would need to modify the CSolver and CIntegration to get the desired reduced model and reduced residual. Then, we would need to make sure that CIteration the class responsible for doing one iteration of the solver, is decreasing the reduced residual. For complete usability, we would also have to make sure that the code required for model reduction does not negatively affect the code for the HDM computation.

OpenFOAM - Open Field Operation And Manipulation Much like SU2 it is an open source solver meant for CFD computations, but it also allows for Fluid Structure Interactions, Multi-Phase and linear structural simulations. The solver is the intellectual property of the ESI company, which ensures the quality of the code by running V&V independently of the OpenFOAM foundation (another development group) [87]. The verification and validation run by the ESI company should ensure that the code is ca- pable of high fidelity simulations. A short bibliographical research seems to indicate so. Work developed by other authors demonstrates that OpenFOAM can assure reliable results for turbulent flows [88][89], compressible flows [90] and complex flows such as those found in turbo-machinery [91][92]. For opti- mization purposes, there is a Special Interest Group dedicated to this matter [93], that offers a package for topological optimization [94] or manuals on how to couple OpenFOAM with DAKOTA (an optimization package developed by Sandia Laboratories) [95]. However we do not find as many examples of opti- mization cases as for SU2. When it comes to manual domain decomposition, OpenFOAM ensures this is an easy task [96]: the user can choose to manually specify how the mesh is decomposed. Since the point of domain decomposition in this software is to parallelize tasks, the specified decomposed domains will be allocated to different processors. Also, the type of domain decomposition cannot be chosen. For the implementation of a reduced order model, we fortunately find more documentation on the matter [97] than in SU2, and the program structure makes it clearer when we are solving the ODEs corresponding to the discretized PDE [98]. In the abstract class ”ODESolver” one can find the method ”solve” which solves the ODE system. For model reduction, all that would be required would be to identify the type of ODE solver class is used for the compressible stationary flow solver (”rhosimpleFOAM”) and modify it in such a way that it does not negatively impact the flow solver.

FreeFem++ FreeFem++ [99] is an open source code for solving PDEs using the Finite Element Method. The user starts by specifying the geometry and then uses the internal mesher (or possibly an external one) to discretize the domain. The problem to solve is written in variational form, and the program automatically computes the solution. For non-linear or time varying problems newton methods or time integration methods must be specified. However, the supplied manual gives more than enough examples one how to tackle this [100]. It is therefore a general-purpose solver, geared towards testing numerical methods. This is the main weakness of this program : since it is not specifically oriented towards CFD, we do not find validations cases that can assure us that we can eventually produce high fidelity models using this solver. Still, this program seems capable of solving the Euler compressible equations: in [101], the author manages to simulate the perfect compressible flow around an elliptical profile (there are even other examples in the community, such as supersonic bumps). Limiters for the Burger’s equation can be

47 found in [102], and finite volume formulations using first order upwind schemes are presented in [103]. As a side note, turbulence models for the incompressible Navier-stokes equations are also available in [104]. This gives us enough material to implement the Compressible Euler equations in FreeFem++ and test the desired methods. When it comes to optimization there is plenty of literature and codes available, whether for structural [105][106] (both shape, parameter and topography) or fluids [107] optimization, but it deals mostly with low Reynolds flows. For domain decomposition, the manual itself demonstrates how it can be done [100] in the code with examples, and more examples and literature are available on how to implement domain decomposition and use it for parallelization [108]. Finally for model or- der reduction, in particular POD-base reduction, we can find application cases with code examples for the incompressible Navier Stokes equations in [109] and the use of reduced basis methods for optimal control in [110].

Comparison and conclusion A decision matrix is presented in table 4.1, where we compare the last two solvers against SU(2). We penalized the optimization of OpenFOAM due to the need to interface with extra software, and we penalize the fidelity of the FreeFEM++ solver due to the absence of proper validation cases for aerodynamic problems. We later grant favor to these solvers for the Domain De- composition and Model reduction testing thanks to the easier implementation of code. FreeFEM++ is particularly favored due to the existence of already made scripts and tutorials for the simulation of these kinds of problems. We expect that this will dramatically reduce the time required for the testing of the various methods we wish to test. Therefore, we will use FreeFEM++ for the remainder of this chapter. For the remainder of the chapter we will test the available FreeFem++ models for compressible Euler and

Table 4.1: Solver Decision Matrix. SU(2) is the baseline choice from which we make our comparison.

SU(2) OpenFOAM FreeFEM++ Fidelity 0 0 - Optimization 0 - 0 Domain Decomposition Testing 0 + ++ Model Reduction Testing 0 + ++ Total 0 + +++

Incompressible Navier-Stokes. We will check if the scripts found function as predicted by their authors (Verification) and if they produce results close to reality (Validation). We will then reduce the models present in these scripts by using LMSQ reduction and the Galerkin projection, and conclude on the performance of the MOR techniques.

4.3 Incompressible Navier Stokes

For the Incompressible Navier-Stokes Equations, we will use the script supplied in [109] that was origi- nally developed by the same author in [111]. The script solves the dimensionless incompressible Navier-

48 Stokes:  u · ∇u − 1 ∆u + ∇p = 0 Re (4.1) ∇ · u = 0

Here u is the velocity vector, p the pressure and Re the Reynolds number of the problem. The Reynolds uL number is defined as Re = ν , L being a characteristic length, u a characteristic speed, and ν the kinematic viscosity of the fluid. By adding the test functions v and q, we obtain the variational formulation of these equations as:  (v, u · ∇u) − 1 (∇v, ∇u) + (∇ · v, p) = 0 Re (4.2) (q, ∇ · u) = 0

Which can be written directly to FreeFem++ so as create and compute the discrete system generated via the FEM. In this specific case, the author used the fixed-point iterations method, which at each step i, attempts to find pi and ui such that:

 (v, ui−1 · ∇ui) − 1 (∇v, ∇ui) + (∇ · v, pi) = 0 Re (4.3) (q, ∇ · ui) = 0

It is therefore not a time marching method. We will attempt to reduce the lid-driven cavity problem with the incompressible Navier-Stokes equations. The reasons behind this choice are:

• Well studied problem in literature with known solutions.

• MOR is already performed by the script in [109] for Reynolds going from 1 to 151

• Incorporates viscosity and eddies, the basis of drag in airfoils and wings.

4.3.1 Verification

The script provided by the author computes the dimensionless lid-driven cavity test case. In the lid driven cavity, the domain is a unit square, and we have zero velocities on all the walls except the top one, where the horizontal velocity is equal to 1. A representation of the problem can be found in figure 4.1. The author’s script solves 10 iterations of the system in equation 4.3 for Re = 1, 51, 101, and 151. It then reportedly computed the POD modes from these snapshots, and uses them to create and compute a ROM for Re = 101. Without any modifications, we have run the script supplied by the author and compared its outputs against those made available in [109]. We can see a direct side-by- side comparison between the obtained outputs and those of the author in figures 4.2 through 4.11. The obtained script seems to exactly match the outputs given by the author. We therefore assume to have the same code as the author.

49 Figure 4.1: Representation of the lid-driven cavity problem taken from [112].Here, u is the horizontal component of the velocity and v is the vertical component of the velocity.

Figure 4.3: First mode ob- Figure 4.4: Second mode sup- Figure 4.2: First mode supplied tained from the script. Velocity plied in [109]. Velocity vector in [109]. Velocity vector plot. vector plot. plot.

Figure 4.6: Third mode sup- Figure 4.5: Second obtained plied in [109]. Velocity vector Figure 4.7: Third obtained mode. Velocity vector plot. plot. mode. Velocity vector plot.

50 Figure 4.8: Fourth mode sup- Figure 4.10: ROM response for plied in [109]. Velocity vector Figure 4.9: Fourth obtained Re = 101 in [109]. Velocity vec- plot. mode. Velocity vector plot. tor plot.

Figure 4.11: ROM response for Re = 101 obtained. Velocity Figure 4.12: Velocity error (magnitude of) for the vector plot. original script’s ROM for Re = 101.

51 Figure 4.13: Mesh gener- Figure 4.14: Mesh pattern ated by the script. used for validation.

4.3.2 Validation

The driven cavity is a known benchmark in fluid dynamics. For this reason, for the validation of this script we have decided to directly compare the results of the HMD in the script against results in [112] and [113]. The author seems to have originally benchmarked his script in [111] against [112], but we will compare the script also against [113] for completeness. The mesh originally used in the script can be found in figure 4.13. It is a structured square mesh made with triangular elements that has been slightly morphed so as to be more refined near the edges, as the author judges this to improve accuracy near the walls. In order to avoid the error induced by element size variation near the walls, we will use a uniform mesh with the repeating pattern such as the one seen in 4.14. The elements are triangular because these are the only elements allowed by FreeFem++. In order to have results comparable to those in sources [112] and [113], we will use three different meshes presenting this pattern : one with 129 subdivisions, another with 257, and yet another with 400. For 129 divisions we will test Re = 100, 400, 1000. For 257 divisions we will test only Re = 5000. For 400 divisions we will test Re = 5000 and Re = 10 000. We will analyze the convergence of the following residue:

sZ sZ Resi = (ui − ui−1)2 + (∇ui − ∇ui−1)2dΩ + (pi − pi−1)2dΩ (4.4) Ω Ω

Here a2 = P ... P a2 . All computations were stopped when a residue inferior to 10−3 or when i1 in i1..in more than 70 iterations had been computed. The only exception is the case for Re = 10 000, which due to convergence difficulties, we allowed it to run for 140 iterations. We will also analyze the vorticity at the lid (the top wall), the horizontal velocity along the vertical centerline (the vertical line that splits the square domain in half) and the vertical velocity along the horizontal centerline (the horizontal line that splits the square domain in half). We will determine the relative deviation of the data obtained through the script against the references [112] and [113]. This relative deviation is calculated as:

v u Script Reference uP (q − q )2 dev = t i i i (4.5) P Reference 2 i(qi )

Here q is the quantity we are comparing (vorticity, vertical or horizontal velocity) taken at the same point as the chosen benchmark. Finally the streamlines of the flow for the various Reynold numbers will be

52 Table 4.2: Relative deviation of the model from references [113] (Ghia or ”G”) and [112] (Erturk or ”E”). u refers to horizontal velocity data at the vertical centerline, v to the vertical velocity data at the horizontal centerline, ω to the vorticity data at the lid.

(Mesh) Reynolds u (Ghia) u (Erturk) v (Ghia) v (Erturk) ω (Ghia) (129x) 100 0.45% N/A 7.69% N/A 1.43% (129x) 400 0.74% N/A 16.00% N/A 1.63% (129x) 1000 14.20% 2.18% 5.52% 3.98% 3.32% (257x) 5000 12.09% 2.24% 4.67% 3.56% 2.97% (400x) 5000 12.44% 1.19% 5.02% 2.00% 3.11% (400x) 10 000 (70 Iterations) 12.70% 0.99% 5.16% 1.32% 4.68% (400x) 10 000 (140 Iterations) 12.70% 0.83% 5.00% 1.29% 13.37%

presented, so as to ensure that the script predicts well the overall behavior of the flow. As it can be seen in figure 4.15, we obtain very low residues very quickly for Reynolds 1000 and below. Up until Re = 10 000 the code converges monotonically, showing increased convergence with finer meshes. For Reynolds = 10 000 the code fails to converge : the residue starts increasing after 20 iterations and stabilizes at a value superior to 1 even well after 70 iterations. We find no oscillatory pattern after 70 iterations but instead a steady convergence towards 1.2. For Re = 5000 we still have a residue superior to 10−3 after 70 iterations (the maximum number of iterations that we have allowed for these tests), but we have a monotonic convergence of the residue. As it can be seen in table 4.2, the solver’s results remain always quite close to those of Erturk ([112]), even for Reynolds = 10 000. However for Ghia ([113]) we obtain more significant deviations, specially for the higher Reynolds numbers. Despite these deviations, when we analyze graphically the horizontal velocity at the vertical centerline, the vertical velocity at the horizontal centerline and the vorticity at the lid, we seem to obtain results quite close to those of Ghia et al. This can be seen in figures 4.16 through 4.23, where for the coarser meshes, the solution computed by us not only has the same behavior as the benchmarks, but seems to remain quite close in value. This is true even for moderate Reynolds numbers, as can be seen in figures 4.17 and 4.20 or even for Re = 10 000, in figures 4.18 and 4.21. When it comes to the overall behavior of the velocity field, we can see a side-by-side comparison of the streamlines obtained by [113] and the script in figures 4.24 through 4.34 (the streamlines of Erturk were not shown due to their high similarity to [113]). There seems to be a good agreement between the streamlines of the benchmark and those generated by the script, even for Re = 10 000, when the residue indicates the non-convergence of the code. For this last case it seems that from figure 4.33 to 4.34 the top left eddy takes on a slightly different shape than that predicted by Ghia et al after 140 iterations. However, there is no serious change in the overall behavior of the streamlines. In conclusion it seems safe to assume then that the code can produce valid results for incompressible flow with Reynolds number going from 102 to 104. We exclude the upper limit from the validity domain, due the deviation shown for high Reynolds relative to the results of Ghia and the behavior of the residue.

53 101 0.4

100 0.2

10−1 0 (129x) 100 (G) 100

Residue (129x) 400 (G) 400 −2 −0.2 10 (129x) 1000 (G) 1000 Vertical Velocity (257x) 5000 (129x) 100 (400x) 5000 −0.4 10−3 (129x) 400 (400x) 10 000 (129x) 1000 −0.6 0 20 40 60 80 100 120 140 0 0.2 0.4 0.6 0.8 1 Iteration x

Figure 4.15: Convergence of the different vali- Figure 4.16: Vertical velocity at the horizontal dation cases. centerline for low Reynolds.

0.4 0.4

0.2 0.2

0 0

−0.2 −0.2 (G) Vertical Velocity Vertical Velocity −0.4 G) −0.4 (E) (E) (400x) 70 Iter. −0.6 (257x) −0.6 (400x) 140 Iter. 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 x x

Figure 4.17: Vertical velocity at the horizontal Figure 4.18: Vertical velocity at the horizontal centerline for Reynolds = 5 000. centerline for Reynolds = 10 000.

1 (G) 100 1 (G) (G) 400 (E) (G) 1000 (257x) (129x) 100 0.5 (129x) 400 0.5 (129x) 1000

0 0 Horizontal Velocity Horizontal Velocity

−0.5 −0.5 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 y y

Figure 4.19: Horizontal velocity at the vertical Figure 4.20: Horizontal velocity at the vertical centerline for low Reynolds. centerline for Reynolds = 5 000.

54 1 (G) (E) 200 (G) (400x) 70 Iter. (400x) 70 Iter. (400x) 140 Iter. (400x) 140 Iter. 0.5 150

0 Vorticity 100 Horizontal Velocity

−0.5 50 0 0.2 0.4 0.6 0.8 1 y 0 0.2 0.4 0.6 0.8 1 x Figure 4.21: Horizontal velocity at the vertical centerline for Reynolds = 10 000. Figure 4.22: Vorticity at the lid for Re = 10 000.

150 (G) 100 (129x) 100 (G) 400 100 (129x) 400 (G) 1000 (129x) 1000 (G) 5000 Vorticity 50 (257x) 5000

0 0 0.2 0.4 0.6 0.8 1 x

Figure 4.23: Vorticity at the lid.

Figure 4.25: Streamlines ob- Figure 4.24: Streamlines ob- tained with script for (192x192) Figure 4.26: Streamlines ob- tained by [113] for Re = 100. Re = 100. tained by [113] for Re = 400.

55 Figure 4.27: Streamlines ob- Figure 4.29: Streamlines ob- tained with script for (192x192) Figure 4.28: Streamlines ob- tained with script for (192x192) Re = 400. tained by [113] for Re = 1000. Re = 1000.

Figure 4.31: Streamlines ob- Figure 4.30: Streamlines ob- tained with script for (297x297) Figure 4.32: Streamlines ob- tained by [113] for Re = 5000. Re = 5000. tained by [113] for Re = 10 000.

Figure 4.34: Streamlines ob- Figure 4.33: Streamlines ob- tained with script for (400x400) tained with script for (400x400) Re = 10 000 after 140 itera- Re = 10 000 after 70 iterations. tions.

56 4.3.3 Reduction

We will now attempt to perform MOR of the Lid-Driven Cavity problem previously used as a benchmark. Again, the main reasons behind this choice are:

• Well studied problem in literature with known solutions (see previous section)

• MOR is already performed by the script in [109] for Reynolds going from 1 to 151

• Incorporates viscosity and eddies, the basis of drag in airfoils and wings

The first two points mean that we will be able to check our ROMs against the solutions in literature, and be able to discriminate between implementation errors on our part and actual properties of the model reduction methods. The last point implies that we are testing the model reduction techniques on models that are close (in terms of physics involved) to those used in simulating modern aircraft. This is crucial as the point of this thesis is to test MOR for lifting surfaces. The original author of the script [109] claims to reduce the lid-driven cavity by performing the POD of snapshots taken for Re = 1, 51, 101 and 151. Once the POD is done, he creates a reduced model using all of the computed modes (the 4 modes created from the snapshots) and computes the solution for Re = 101 with the ROM. Given this, we will test the POD+Galerkin Projection and POD+LMSQ for the same range of Reynolds numbers, so as to have comparable results. More specifically, for either method we will construct a POD basis from the snapshots computed at the same Reynolds numbers as in [109](Re=1,51,101 and 151). This basis will be computed from the same HDM as the one used by the author, using 10 fixed-point iterations (as defined in equation 4.3). Any subsequent ROM computations will also only take 10 iterations, so as to have comparable results. We will perform two major tests for each reduction method:

1. A sweep going from Re = 1 to Re = 400 with a step ∆Re = 1, using the original mesh shown in figure 4.13 (the same one as used by the author).

2. A scalability test, where we calculate only Re = 201 using both the ROM and HDM. The mesh shown in figure 4.14 will be used with 50,100 and 200 subdivisions of the unit square.

The sweep test will be used to analyze the ROM error behavior for the Reynolds range considered by the original author and beyond. This will allow us to check how well the ROM ”interpolates” (Re∈[1,151]) and ”extrapolates” (Re>151) the data obtained from the snapshots. During the sweep, at each Reynolds number the relative error for the pressure and the velocity will be computed. The measures for the relative errors are given as:

sR ROM HDM 2 Ω(u − u ) eu = R HDM 2 (4.6) Ω(u ) sR ROM HDM 2 Ω(p − p ) ep = R HDM 2 (4.7) Ω(p )

They are therefore essentially the L2-norm of the absolute deviation over the L2-norm of the HDM solu- tion over the considered domain. The scalability test serves to understand how much more efficient the

57 ROM is than the HDM when we need to compute results outside the original training interval. The do- main subdivisions chosen, 50, 100 and 200, generates respectively 5 000, 20 000 and 80 000 triangles (the only type of element available in 2D for FreeFem++). We have tried employing more subdivisions so as to reach a number of elements near 105 − 106, as would be expected of a high-fidelity model for an aircraft. However for more than 200 subdivisions FreeFem++ seems to fail in updating the reduced state variable used in our ROMs. These variables are stored differently than the HDM variables : the former are stored in a standard array, whilst the latter are stored in a special type of array meant for FEM fields. This means that while we were able to compute HDM responses for a mesh with 400 subdivisions, we were not capable of computing and updating the reduced state variable when such a high quantity of memory is demanded. Still, we hope that with up to 200 subdivisions we will be able catch the efficiency trend of the ROM. For each mesh test case (50x50,100x100 and 200x200) we will present: Total Time for computing the ROM, tROM ; Time for computing the HDM, tHDM ; Time for computing the SVD re- quired for the POD, tSVD; Total number of degrees of freedom for the HDM, NDOF ; Relative velocity error, eu; Relative pressure error, ep. Since the ROM will employ all the computed snapshots, it will always be of order 4, and we expect it to become faster to compute than the complete HDM.

POD basis

Before performing the model reduction itself, we will briefly discuss basis generation. In this case, since only one parameter is being varied, we feel there is no need of greedy or adaptive sampling. We will therefore focus on ensuring that we are correctly performing the POD of the HDM snapshots taken at Reynolds = 1, 51,101 and 151. As discussed in previous chapters, for the POD we compute the SVD of the snapshot matrix and take the first four left-eigenvectors. These eigenvectors will form our basis V . It should be noted that since this is a static problem, the snapshot matrix is simply a matrix where the solutions computed by the HDM are in column-vector form. We naturally expect that the modes computed by Proper Orthogonal Decomposition to be orthogonal. In other words, we expect the following equality to be verified: V T V = Λ (4.8)

Where Λ is a diagonal matrix equal to the identity matrix if the modes are orthonormal. Since the original author of the script claims to be performing POD, we expect the original modes of the script to be orthogonal too. But while indeed the modes computed by our method seem to be orthonormal up to machine precision (see table 4.3), this does not seem to be the case for the modes originally computed by the script. In fact, as can be seen in table 4.4, the modes do not even seem to be orthogonal : the off-diagonal terms are within the same order of magnitude of the diagonal terms. This even without a renormalization performed in the original script, where each computed mode was divided by the L-2 norm of the velocity terms of the mode. It can be seen in figures 4.35 through 4.38, there is no major change in the flow field when going from 1 to 151 Reynolds’ number. We would naturally expect then that at least the very first mode of the POD would produce a flow field similar to those observed. However, the first original mode in

58 Table 4.3: Numerical result of the product of V T V for the modes obtained by us.

1.00 3.63e-17 -2.31e-17 -1.37e-17 3.63e-17 1.00 2.98e-16 6.70e-19 -2.31e-17 2.98e-16 1.00 -2.06e-16 -1.37e-17 6.69e-19 -2.06e-16 1.00

Table 4.4: Numerical result of the product of V T V for the original modes of the script.

3.70e+05 -2.34e+05 -1.06e+05 2.85e-08 7.77e+07 -2.02e+08 -7.59e+08 7.75e+08 -2.34e+05 1.48e+05 6.73e+04 -1.80e-08 -2.02e+08 5.27e+08 1.98e+09 -2.02e+09 -1.06e+05 6.73e+04 3.07+e04 -8.21e-09 -7.59e+08 1.98e+09 7.41e+09 -7.57e+09 2.85e-08 -1.80e-08 -8.21e-09 2.20e-21 7.75e+08 -2.02e+09 -7.57e+09 7.73e+09 (a) Before renormalization (b) After renormalization

figure 4.2 does not seem to reproduce the average shape of the flow field at all. This is because in the original script, the average of the solution samples was subtracted from the snapshot matrix. When we remove this operation from the script, we obtain the modes in figures 4.43 through 4.46, where for the 1st mode we seem to obtain something closer to the average observed flow field. This average velocity field is also present in the modes computed by us, shown in figures 4.39 through 4.42. There are slight differences between the modes computed by us and those in the original script, with or without subtracting the average of the samples, and the original script’s modes always remain non-orthogonal. One final observation is that the ROM response of the original script for Re = 101 has non-negligible error, as shown in figure 4.12. This is unexpected, because the original author is computing a solution that was already sampled and fully integrated into the ROM (recall that the ROM of the original script is of 4th order and built from 4 samples). Since we have the same model order as number of samples taken, the solutions at the snapshots belong to the generated reduced state-space. It should then be possible to exactly compute these solutions and exactly ”interpolate” the HDM: the difference between the HDM and the ROM at the snapshots should be nearly null.

Galerkin Projection

We will now attempt to reduce the Lid-Driven cavity problem via Galerkin Projection + POD, whilst using the same samples used in [109]. This means that we will sample the driven cavity problem for Re = 1, 51, 101 and 151, obtain a reduced basis from these samples via the POD and use it to reduce the system presented in equation 4.3. The fully discretized fixed-point system is of the following form :

b = a(wi−1)wi (4.9)

Where b is the right hand side due to boundary conditions (in this case, Dirichlet type conditions at the walls), and a is the system matrix. The system is accordingly reduced as:

V T b = V T a(V qi−1)V qi (4.10)

The algorithm for reduction can be stated as follows:

59 Figure 4.35: Velocity field for Figure 4.36: Velocity field for Figure 4.37: Velocity field for Re = 1. Re = 51. Re = 101.

Figure 4.38: Velocity field for Figure 4.39: 1st POD mode Figure 4.40: 2nd POD mode Re = 151. computed through our method. computed through our method.

Figure 4.43: 1st Mode com- Figure 4.41: 3rd POD mode Figure 4.42: 4th POD mode puted from the original script, computed through our method. computed through our method. with the average.

Figure 4.44: 2nd Mode com- Figure 4.45: 3rd Mode com- Figure 4.46: 4th Mode com- puted from the original script, puted from the original script, puted from the original script, with the average. with the average. with the average.

60 1. Compute HDM at Re = 1, 51, 101 and 151

2. Compute the SVD of the obtained Snapshot Matrix.

3. From the computed SVD, use all the left eigenvectors to form the basis V . The ROM will be of order 4.

4. Assemble the matrices of problem 4.3

5. Transform these matrices into the reduced system 4.10

6. Solve the reduced system, compute reduced solution and iterate from step 4.

To test our ROM, we will perform the previously mentioned sweep and scalability tests. We expect the ROM to give an exact solution at the snapshots, and to become significantly faster than the HDM as we use finer and finer meshes. After performing the sweep test (see figures 4.48 and 4.47), we can see that at the snapshots (Re = 1, 51, 101 and 151) the ROM gives an exact solution : all errors are far below the percent unit. This contrasts with the ROM initially provided by the script, which displays errors in velocity of around 10 % for Re = 101 (see figure 4.12). It can be seen that throughout the sweep we obtain very acceptable errors for the velocity field for the interval in Re = 1 to 151. However it seems that the error for the pressure is non-negligible. The reason behind these high errors in pressure can be found in images 4.49 and 4.50: the ROM fails to appropriately approximate the pressure at the corners. The HDM presents a very local and rapid variation of pressure at the corners, and it seems that the ROM fails to capture this localized phenomena, resulting in the high error found in the sweep. One way to avoid these high errors in pressure could be to use a hybrid ROM: using a full order model at the corners and a ROM for the rest could help in correctly simulating these details whilst still being faster than the complete model. When using models with higher subdivisions (see table 4.5), we see that the errors do not seem to change much, but the ROM becomes more efficient : for 200 subdivisions of the domain, corresponding to a total of 80 000 elements, the ROM takes about 30 % of the time of the HDM to compute a solution. Should we find a way to store the reduced system in such a way that no previous HDM assembly is required, we could save half of the ROM computation time, becoming much more efficient. This can be made possible by using tensors rather than matrices for the discretization of the PDE in 4.3. We could then construct and store a reduced tensor for the advection term, rather than recomputing it each time. However constructing such a tensor in FreeFEM++ is not trivial, and our objective is to test several MOR techniques for several CFD models, rather than optimizing one specific implementation. As a final note, the sudden increase in tSVD from 0.96s to 3.56s is due to the overflow of the function made available by FreeFem++ to compute the SVD. For 200 subdivisions, we were forced to interface the script with SciPy : the snapshot matrix was published onto a file, which was analyzed by an external python script which produced a different file with the required left-eigenvectors. Since these operations rely on the usage of the hard-drive and not the RAM of the machine, the performance was naturally impacted. To avoid this issue we could use the fast SVD update techniques described in the bibliographical review, but the performance impact is not so severe as to warrant their use.

61 100 103

102

−1 10 101 p u e e 100

−2 10 10−1

10−2

10−3 10−3 0 100 200 300 400 0 100 200 300 400 Reynolds Reynolds

Figure 4.47: Relative Velocity error of the con- Figure 4.48: Relative pressure error of the con- structed ROM for different Reynolds numbers structed ROM for different Reynolds numbers for the mesh given in 4.13. Values below 10−3 for the mesh given in 4.13. Values below 10−3 are not shown. are not shown.

Table 4.5: Scalability test results for Re = 201. We also include the time spent assembling the HDM matrices per each solve as tAssembly. The solution time for the ROM is given in seconds and as a percentage of the HDM solution time.

N tHDM tSVD tROM tAssembly NDOF eu ep 50 5.64 s 0.22 s 4.08 s (72%) 1.92 s 23003 1.9 % 4000 % 100 36.54 s 0.96 s 19.12 s (52 %) 8.25 s 91003 2.2 % 4570 % 200 266.35 s 3.59 s 79.36 s (30%) 31.64 s 362003 2.0 % 4193 %

Figure 4.49: Pressure calculated by the ROM Figure 4.50: Pressure calculated by the HDM made from the mesh in figure 4.13 for Re=210. made from the mesh in figure 4.13 for Re=210.

LMSQ

In this part we will test the Least mean squares reduction. This particular method is an optimization problem of the type: i i−1 q = arg min ||b − a(V q )V q||2 (4.11) q

62 Here b is the original right-hand side of the HDM and a is the original HDM matrix. This is a least mean- squares problem, and to be solved we need two ingredients: a cost function and the gradient of the cost function. We will start by deriving these quantities for the HDM, and then convert them to the ROM problem. For the HDM, we can simply base ourselves on the square of the residue, and obtain our cost functional and gradient as (using Einstein’s notation):

T ∂J ∂fi(w) J = (f(w) − b) (f(w) − b), = 2(fi(w) − bi) (4.12) ∂wj ∂wj

Here f(w) = a(wk−1)w, k − 1 referring to the solution at the previous step. The question now is how to obtain ∂fi(w) . Fortunately, in the manual of FreeFem++ [100] has an example with exactly the same ∂wj system function (and code), where the incompressible Navier-Stokes are solved via a Newton method (instead of fixed-point iterations). The Newton method requires the differential of f to work, and this differential (both the code and the analytical form) are supplied by the manual. In figures 4.51 and 4.52 we can see the evolution of the residue and its gradient given in figure 4.12 during the resolution of the HDM. As it can be seen in the previous figures , the proposed residue and gradient decrease monotonically as the HDM converges, which would be expected of the true residue and its gradient. The sole incertitude not accounted for is the sign of the gradient. But, if we do have coded the wrong sign, this will be evident as the optimization algorithms will not converge, and the correction of the sign is fairly simple to do. Now that we have proved to have a working residue and gradient for the HDM, we

10−1 Re = 1 Re = 51 Re = 101 10−4 10−9 Re = 151 Re = 201 10−7 −16 (L-2 norm) J 10

Re = 1 DJ 10−10 Re = 51 10−23 Re = 101 Re = 151 10−13 Re = 201 10−30 2 4 6 8 10 2 4 6 8 10 Iteration Iteration Figure 4.52: Evolution of the L-2 norm of the Figure 4.51: Evolution of the cost functional gradient of the cost functional throughout the it- throughout the iterations of the HDM for sev- erations of the HDM for several Reynolds’ num- eral Reynolds’ numbers. bers. need to create one for the ROM. This can be obtained immediately through the following formulas (using Einstein’s notation): ∂J ∂J ∂wj ∂J(V q) J(q) = J(V q), = = Vjk (4.13) ∂qk ∂wj ∂qk ∂wj Where i, j, k are tensorial indexes. We should be now able to implement LMSQ reduction with minimal hassle. In FreeFem++, we found 2 optimization routines that did gradient-based optimization:a Con-

63 Table 4.6: Scalability test results for Re = 201 for the (Lin) initialization.

N tHDM tSVD tROM NDOF eu ep 50 6.21 s 0.30 s 61.829 23 003 9.89 % 18.70% 100 36.75 s 1.06 s 375 s 91 003 10.1 % 18.6 % 200 265.93 s 4.22 s 2.59e+3 s 362003 10.2% 18.6%

jugate Gradient optimizer (CG) and a Broyden–Fletcher–Goldfarb–Shanno optimizer (BFGS). These optimization routines come with internal convergence checks: if the algorithm detects that it is diverging, it will stop immediately and print a warning to the console. Upon implementing model reduction with the cost functional and gradient obtained through equation 4.13, neither of the algorithms reported any divergence. If we used a gradient with the opposite sign, all algorithms stopped in less than 10 iterations and printed a divergence warning to the console. Despite this, only BFGS systematically reduced the cost functional, while the CG algorithm increased it each time. Even if we let the CG algorithm run for well over 10 iterations, we got increasingly higher residues at each iteration. For this reason LMSQ reduction was implemented using BFGS only. The performance of the BFGS algorithm (and most op- timization algorithms for that matter) depends highly upon the starting point given to the optimizer. For this reason, besides the usual sweep test with 10 optimizer iterations, we have decided to test different ways to initialize the optimizer:

• Initialization with null solution (Null).

• Initialization with solution linearly interpolated from neighboring samples using hat functions (Lin).

• Initialization with solution interpolated from neighboring samples via a cosine bump function (cos).

The results can be seen in figures 4.54 and 4.53. It seems that the only implementation that gives reasonable errors (below 10%) is the one where we use the Linear initializer. The errors for the co-sinus initializers are always near 100 %, except when we recompute the solution at the snapshots. This is expected, since the exact solution is already given by the initializer. When we do not use previously computed snapshots, the deviations are always superior to 100 %, and we do not obtain the exact ”interpolation” as observed for the Galerkin Projection or LMSQ+initializers. Finally the deviations for pressure given by the LMSQ method, in particular with the linear initializer, are nearly 100 × smaller than those observed for the Galerkin projection. It seems that the LMSQ method is more robust against punctual variations. However, unlike the Galerkin Projection, the ROM for LMSQ actually takes more time to compute than the HDM, as can be seen in table 4.6. This might be a problem specific to the optimizers available in FreeFEM++: the optimization routines available tend to publish informations to the console at each iteration, slowing them down. We have not yet found a way to control these console prints without affecting other important outputs (such as computation times), and designing, implementing and verifying an optimization routine falls outside of the scope of this thesis.

64 cos cos Linear 101 Linear 100 Null Null

100

−1 p u 10 e e 10−1

10−2 10−2

10−3 10−3 0 100 200 300 400 0 100 200 300 400 Reynolds Reynolds

Figure 4.53: Relative Velocity error of the con- Figure 4.54: Relative pressure error of the con- structed ROM for different Reynolds numbers structed ROM for different Reynolds numbers for the mesh given in 4.13. Values below 10−3 for the mesh given in 4.13. Values below 10−3 are not shown. are not shown.

4.4 Compressible Euler

We now tackle the compressible Euler equations. For a perfect gas, which is a reasonable model for

u∞ gases when dealing with free stream Mach number M∞ = c < 1 (c being the speed of sound, u∞ being the free stream velocity), the compressible Euler equations can be written as :

 ∂ ρ + ∇ · (ρu) = 0  t   ∂t(ρu) + ∇ · (ρu × u) + ∇p = 0 (4.14) ∂t(ρE) + ∇ · ((ρE + p)u) = 0    2 1 p E = u /2 + γ−1 ρ

Here E is the total energy, u is the velocity, ρ is the density, p is the pressure, γ is the perfect gas ratio. We base ourselves on the script provided in [101], which re-writes the Euler equations as:

 D a + ∇ · u = 0  t ρ   1  Dtu + ∇ap = 0 T (4.15) Dtap + γ∇ · u = 0    p aρ = log(ρ), ap = log(p),T = ρ

As it can be seen, the original pressure and density variables are replaced by their logarithms so as to to obtain a quasi-linear system. The author then uses the Characteristics-Galerkin method to discretize this system in space, along with a semi-implicit method for the time discretization. One of the downsides of the system as it is the fact that it is not written in conservative form (the form shown in equation 4.14), which might cause problems upon the presence of shocks (see [114] for a discussion on the matter). Still,

65 for subsonic conditions this system should be more precise than the potential model originally used, as it exactly models the effects of compressibility. Finally the fact that it is solved by a time-marching method allows us to verify the stability of the ROMs produced and that they still converge towards a stationary solution even for a non-linear system. Besides the velocity and pressure fields, for this problem we will eventually analyze the Cp (pressure coefficient) distribution, CL (lift coefficient) and CD (drag coefficient) of the airfoils we are going to consider, which are defined as:

p − p∞ Cp = 2 (4.16) 0.5 × ρ∞u∞ L CL = 2 (4.17) 0.5 × ρ∞u∞c D CD = 2 (4.18) 0.5 × ρ∞u∞c

Here ρ∞ is the free stream density,c the airfoil’s chord, u∞ is the free stream velocity and p∞ the free stream pressure, p the local pressure (meaning the pressure that is being analyzed), L the lift generated by the airfoil, D the drag generated by the airfoil.

4.4.1 Verification

As was the case in Incompressible Navier Stokes, for the verification of the script we have simply run it and compared the obtained results against those published by the author in [101]. The particular test scenario is an elliptical profile with the boundary condition M∞ = 1.5 over a circular domain, the entire domain being shown in figure 4.55. The time step is 0.01 and a total of 80 iterations are computed, where in the last 10 iterations the mesh is adapted to minimize the error over the pressure. The ratio γ is 1.4, p∞ is 100, ρ∞ is 0.3, the major radius of the airfoil is 2, the minor radius 0.3, and the angle of attack is 17 degrees. The domain itself is a circle of radius 10, meaning 2.5 chords, which is relatively short, specially considering the presence of shocks which should be given enough room to dissipate. Hence this seems to be a test case not based on flight conditions encountered by modern aircraft. Once the script has been run, we obtain an initial mesh that is slightly different than that of the author, as can be seen in figures 4.55 and 4.56, but in the end the adapted meshes are quite similar. Still, since the mesh is only adapted at the last 10 iterations of the script, we obtain very slight different maximums and minimums for the pressure and density, as seen in figures 4.57 through 4.62. These relative differences are around 0.1 %, and we consider them not to be significant. It is safe to assume then, that we are using the same script as the author in [101].

4.4.2 Validation

For the validation of this script, we will implement the RAE-2822 airfoil test case as specified in the

AGARD report in [80]. This test case was done on an airfoil at M∞ 0.6-0.7, with some experimental scenarios showing transonic shocks. The scenario that we are going to use has an angle of attack of

2.57 degrees and M∞ of 0.6 and no shocks are present. The angle of attack is imposed by rotating

66 Figure 4.55: Initial mesh given Figure 4.56: Initial mesh ob- in [101]. tained from the script.

Figure 4.57: Final mesh given Figure 4.58: Final mesh ob- in [101]. Velocity vector plot. tained from the script.

Figure 4.59: Pressure given in [101]. Figure 4.60: Pressure obtained from the script.

Table 4.7: Different mesh cases used for validation of the solver and the element sizes defined at the boundaries of different zones of the domain. Element size is given relative to the chord. Element quality interval and average is given at the last two columns

Airfoil Near Field Mid Field Far field γ interval γ average Coarse 0.02 N/A 0.02 2.0 [0.7228,1.0000] 0.9905 Normal 0.01 N/A 0.01 2.0 [0.6560,1.0000] 0.9941 Fine 0.005 N/A 0.005 2.0 [0.6357,1.0000] 0.9973 Very Fine 0.0025 0.0025 0.005 2.0 [0.6357,1.0000] 0.9933

67 Figure 4.61: Density given in [101]. Figure 4.62: Density obtained from the script.

the airfoil geometry: the inbound farfield velocity is always horizontal. For the shape of the airfoil, we have used a spline interpolation of the design points (not the experimentally measured ones) supplied by the report, and we chose a unit chord (rather than the 0.61 m specified in the report). This choice was numerical in nature. Since there is no physical viscosity, uniformly scaling up or down the airfoil should not affect the obtained results. However using a unit chord seriously simplifies the post-treatment of data, as there is no need to transform data from x to x/c. For the atmospheric conditions, we have 3 chosen ISA conditions at 0 m of altitude with no correction: p∞ is 101325 Pa, ρ∞ is 1.225 kg/m and the perfect gas ratio γ was 1.4. For the discretization, we have chosen for meshing, as the mesher in FreeFem++ tends to produce very fine elements near the corners, producing strong element size variations that may locally affect the results (see figure 4.56 for an example). We have chosen a circular domain with a radius of 50.5 chords that was partitioned in 2 concentric zones by an ellipse with a major radius of 2 chords. This ellipse, the outer boundary and the airfoil are referenced in table 4.7 as Mid Field, Far field and Airfoil, respectively, and it was at these lines that we have input the element size (as given in the table) to the mesher. For the Very Fine mesh case another ellipse was defined with a major radius of 1.25 chords, partitioning the whole domain into three concentric zones. This additional ellipse is referenced to as ”Near Field” in table 4.7. The point of defining these additional lines is to ensure, to the best of our abilities, a smooth transition in element size and a superior element quality, to avoid misjudging the solver due to a low quality mesh. All meshes were created using the Frontal algorithm of GMSH followed by 10 mesh smoothing steps. An overview of the quality of the mesh is

rci also given in table 4.7. The element quality criterion used is defined as [115]: γ = , where rci is the rcc incircle radius and rcc is the radius of the circumcircle. γ = 1 for an equilateral triangle and γ = 0 for a triangle distorted into a line. The worst element quality found in table 4.7 was found for all mesh cases at the transition between the Mid Field and the Far field. Still, the vast majority of elements have near perfect quality, which explains the average γ near 1. Concerning the solver in the script itself, the time

68 step was modified so as to ensure a constant Courant number Co, in other words, we ensured that:

∆t u∞ p = constant = Co (4.19) Smin/2

Here u∞ is the farfield velocity, ∆t is the solver timestep, Smin is the minimum element area. We used the minimum element area because of the high-quality of the elements in the finer zones (meaning that we have near-perfect equilateral triangles) and because of how easy it is to obtain such data directly in FreeFem++. The number of iterations was accordingly modified so as to have a constant pseudo-time interval. Nothing else was changed, and we use the same 1st order Finite Elements used by the original author (this also avoids the need to recalculate the Courant number, as changing the element order changes the stability properties of the model). We have additionally computed the same problem with the exactly same meshes and boundary conditions by using SU2 ([76]), the solver presented earlier in this chapter where extensive validation tests have been done by the creators. This was done to give us an idea of what to expect for a ”true” inviscid solution, and to be able further criticize the validity of the solver. For the SU2 computations, we modified the ”Quick-Start” file that comes with the software suite to fit our needs. This file ran a Compressible Euler computation on a NACA-0012. It uses an Implicit-Euler time marching scheme, a Jameson-Schmidt-Turkel flux, a Venkatakrishnan limiter and a 3-level multi-grid method. Care was taken to match the non-dimensionalization length used by the solver with the airfoil length used for the RAE-2822 mesh. Again the angle of attack is imposed by rotating the geometry, whilst the incoming flow remains horizontal, and exactly the same atmospheric and boundary conditions were imposed as for the FreeFem++ script. The FreeFem++ solver seems to slowly converge to the experimental result, as evidenced by the table 4.8 and the Cp plots in 4.63, but even with the very fine mesh it shows a non-negligible deviation both in the lifting coefficients and in the obtained

Cp. What is more, despite being an inviscid solver, the FreeFem++ calculates a drag coefficient bigger than what is observed experimentally. We can see that the FreeFem++ solver generates a numerical boundary layer and wake by observing the vorticity and Mach plots provided in figures 4.69 and 4.67, which might explain the anomalous drag. The drag does decrease the further we refine the mesh but it seems that the solution itself converges very slowly with the degree of refinement of the mesh. The solution provide by SU(2) seems to rapidly converge with the degree of mesh refinement: though the

CL might still vary in table 4.8, the Cp plot itself varies little with the used mesh 4.64. We also obtain a drag coefficient smaller than what observed experimentally, specially for the Fine mesh. Besides that, we seem to overestimate the magnitude of the real Cp, whereas the FreeFem++ underestimates it. Furthermore upon analyzing the Mach plot in figure 4.68 we see no numerical boundary layer nor wake. However, the computed solution seems to indicate that we are on the verge of the critical point, as evidenced by figures 4.68 and 4.66, which is not the case nor for the FreeFem++ solver (see figure 4.65) nor for the experimental data in [80]. Due to the very fast convergence of the Cp with the refinement of the mesh, we felt that it was not necessary to compute the Very Fine case with SU(2). In conclusion we would say that though the FreeFem++ solver seems to converge very slowly towards the physics we are trying to simulate, but this convergence is too slow and the computational times too great: on the

69 Table 4.8: Numerical CL and CD data, with residue data for the FreeFem++ solver. The experimental AGARD data gives CL = 0.522 and CD = 0.0101.

Case C C Res C Res C L D L D Case C C Coarse 0.212 0.0571 1.46e-4 3.13e-6 L D Coarse 0.605 0.0168 Normal 0.339 0.0579 1.88e-4 3.92e-6 Normal 0.677 0.0067 Fine 0.440 0.0481 4.70e-5 8.22e-6 Fine 0.722 0.0018 Very Fine 0.480 0.0357 2.35e-5 4.39e-6 (b) SU(2) (a) FreeFem++

same machine, the Fine mesh took 13 hours to compute with FreeFem++ whilst SU(2) took 7 minutes. The Very Fine mesh took 2 days to compute in the same machine. This means that this model could not produce high-fidelity results as quickly as other solvers, and we are therefore inclined to label this model as a low to medium-fidelity model. The FreeFem++ model uses the characteristics method for treating the advection terms of the Euler equation, as stated in [101]. Since we are dealing with subsonic speeds and thus with problems elliptic in space, this method should handle the advection terms with low diffusion and dispersion, according to the authors of FreeFem++ (see [100] for a discussion linking the type of problem to be solved with the methods available in FreeFem++ and a study of the accuracy of the characteristics-method on a 2-dimensional linear advection problem). It could be that with higher-order elements or the use of parallel computing could speed-up both the convergence and the calculation of the solution, but when attempting to use the parallel MUMPS or Pastix solvers as specified in the manual [100] the results exploded, and using higher-order elements would require searching for a new Courant number that guarantees the stability of the model. We quickly step into the creation of high- fidelity models, which is outside of the scope of this thesis. Hence, given that this thesis concerns itself with model reduction and the deviations of ROMs relative to the models they reduce, we will still use the FreeFem++ solver as a test bed our model reduction methods, as it does seem to incorporate the physics present in compressible flows (albeit with error), and it is a time-marching non-linear model. Doing this will allow us to understand what sort of deviations to expect when using ROMs on higher-fidelity solvers that are also non-linear and time-marching.

4.4.3 Reduction

For the reduction tests, we will perform the same sort of sweep and scalability tests as done for the NSI equations by varying the angle of attack of the airfoils. We will only test the POD+Galerkin Projection because the current implementation of optimization algorithms in FreeFem++ does not allow for an efficient LMSQ ROM, and developing and coding an optimization algorithm is out of the scope of this thesis. We will reduce both the original supersonic model found in [101] and a simplified version of the RAE-2822 model developed by us. This means that for the supersonic model we will be using the conditions and mesh element sizes that were specified in the script. However, a small modification was done: the aerofoil was centred in the domain. This avoids having the detached shock so close to the boundary and avoids changing the domain when we rotate it. For the RAE-2822 model the geometry and conditions are the same as in the validation case, but the farfield boundary is closer than before :

70 2 Coarse Normal 1 Fine 1 Very Fine AGARD 0 Cp Cp 0 −1 Coarse Normal Fine −1 AGARD −2 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 x/c x/c

Figure 4.63: Experimental [80] and numerical Figure 4.64: Experimental [80] and numeri- (FreeFem++) Cp data for the RAE-2822. Lead- cal (SU2) Cp data for the RAE-2822. Leading ing edge is at x/c = 0. edge is at x/c = 0.

Figure 4.65: Cp obtained with the FreeFem++ script for the Very Fine mesh.

Figure 4.66: Cp obtained with SU(2) for the Normal mesh.

71 Figure 4.67: Mach obtained with the FreeFem++ script for the Very Fine mesh.

Figure 4.68: Mach obtained with SU(2) for Normal mesh.

Figure 4.69: Vorticity obtained with the FreeFem++ script for the Very Fine mesh.

72 the outer boundary is a circle two and a half chords long. Though this penalizes fidelity, it was necessary to be able to do the sweep in a reasonable amount of time. The supersonic model was chosen to see what happens when ”high-frequency” data, such as shocks, is present. In other words, how does the ROM behave when the pressure at a point can change abruptly, even for small variations of a given parameter. This phenomena appears in the supersonic model due to the rotation of the shock and expansion fronts relative to the airfoil as it changes angle of attack, but is also present in transonic flows as the critical point is breached. As for the RAE model, it was chosen so as to have a physical model to reduce, with an airfoil similar to those encountered in real-life and in similar flight conditions. The model as implemented will be of low fidelity, but this is a problem of the model itself, and not the reduction methods we are going to test. The latter should give us results close to the implemented HDM, regardless of how well the former describes reality. For the supersonic model, as mentioned, the original mesh was implemented. For the angle of attack the inbound Mach 1.5 flow was kept horizontal and the entire mesh was rotated. Only the sweep test was performed : 4 snapshots were taken for AoA at 1, 2, 3 and 4 degrees, and the ROM was analyzed and compared to the HDM for a sweep of the angle of attack going from 0 to 5 degrees, with a step of 0.1 degrees. For the Rae-2822 the same flight conditions as the validation tests were kept, and as for the supersonic airfoil the AoA was imposed by rotating the mesh. The meshes used are based on those of the validation tests: we used a Coarse and Normal mesh with the same element size at the airfoil as in 4.7, with the element size at the farfield boundary being 10 times bigger. A sweep test was done on the Coarse mesh, where 5 snapshots were taken at 1,2,3,4 and 5 degrees of AoA, and the ROM was analyzed for an interval ranging from 0 to 6 degrees of AoA. After, a scalability test was done, where ROMs were built for the Normal and Coarse meshes by computing the snapshots in the same points as before. We then computed the ROM response at AoA = 6 degrees and compared its performance with the HDM. For these tests we expect as before that the ROM exactly ”interpolates” the HDM at the snapshots: we should have very small deviations at the snapshots. We also expect the ROM be significantly faster than the HDM when a finer mesh is used. Besides this, we will pay attention to the following problems that may arise: ROM stability and error due to shocks. As presented in the bibliographical section, the created ROM may not be stable (which is why we chose to test MOR on a time marching method), and the POD may have difficulty in capturing abrupt variations, resulting in a wrong pressure field. For this reason, besides the RMS error for the velocity and pressure fields, we will monitor:

|LROM − LHDM | |DROM − DHDM | e = , e = (4.20) L |LHDM | D |DHDM | q R (pROM − pROM )2 Cauchy Ω i i−1 rp = q (4.21) R HDM HDM 2 Ω(pi − pi−1 )

Cauchy Here eL is the relative error in lift L, eD relative error in drag D, rp ratio between the last value of the Cauchy convergence criterion in pressure of the HDM and the ROM. This last measure is specific to the supersonic airfoil, to check if the convergence characteristics between the ROM and HDM are too different : if the ratio is far superior to one, the ROM may be diverging; if it is close or inferior to one, the

73 Table 4.9: Scalability test results for Rae-2822 for AoA = 6 degrees. The solution time for the ROM is given in seconds and as a percentage of the HDM solution time. In the last two columns the Cauchy Residue for the Lift and Drag coefficients computed by the ROM are given.

ROM ROM Mesh tHDM tSVD tROM NDOF eu ep Res CL Res CD Coarse 157.69 s 0.52 s 134.33 (85%) 7 000 0.34 % 0.064 % 6.31e-5 1.20e-5 Normal 2520.88 6.99 s 1626.7 (65 %) 25 808 0.71 % 0.54 % 2.36e-4 4.41e-5

ROM is converging at the same speed or even faster than the HDM. For the Rae-2822 case we supply the Cauchy residue of CL and CD for the scalability tests in table 4.9. The results for the sweep tests and the obtained aerodynamic coefficients can be seen in figure 4.70 through 4.73. As it can be seen we obtain errors below 1 % for most of the sweep for the RAE-2822 airfoil, with near-perfect fit of the aerodynamic coefficients. We do not seem to obtain the expect ”dip” in error at the snapshots, except for the relative velocity error in some points. Unlike for the the NSI case, for this time-dependent problem we were forced to add another level of discretization that is not accounted in the error estimates of the POD+Galerkin Projection: the time derivative must be discretized. The absence of perfect interpolation might be due to the error in time-discretization dominating over error of model reduction. Still, the error seems quite acceptable by industry standards, except for the lift for very low angles of attack where the near-zero value obtained naturally exacerbates the error. For the sweep of the supersonic airfoil, the ”dips” in the RMS relative errors are visible, indicating the interpolation properties of the ROM, but unlike what was observed for the NSI reduction, the error seems have a lower bound stopping them from going to machine 0. Again, we suspect this to be due to time-discretization error. With the supersonic airfoil we seem to have higher relative deviations than with the RAE-2822 when we are outside of the original interval at which the snapshots were taken. It might be therefore wise when constructing a basis to take snapshots at the extremes of the intervals we wish to simulate whenever abrupt variations in data (like shocks) may be present. Finally, for either sweep test, even with the presence of shocks, the ROM showed excellent stability : the Cauchy residues in pressure and aerodynamic coefficients tended to be lower for the ROM and for all models they decreased monotonically. This is exemplified in figure 4.74, where it is shown that throughout the sweep the Cauchy residue in pressure for the ROM is smaller than that of the HDM. Small residues for the RAE-2822 case are also shown in table 4.9. The scalability test results are shown in table 4.9, where we can see that for the RAE-2822 case, with 104 NDOF, the ROM is almost two times faster than the HDM, all the while maintaining relative deviations below 1%. This confirms the trend observed with NSI reduction, where with finer meshes the ROM proved to be more and more agile than the HDM, but in this case the deviations over the pressure are far more acceptable (even with shocks present, as observed for the sweeps). This might be due to the fact that there are no pressure singularities as observed in the lid-driven cavity problem. Finally it seems that for non-linear CFD codes, the SVD of the snapshots is the least costly step in MOR, which was not the case in the benchmarks evaluated in the previous chapter.

74 100 Velocity 101 Velocity Pressure Pressure 10−1 Lift Lift 100 Drag Drag

10−2 10−1 adim adim −3 10 10−2

−4 10 10−3

0 1 2 3 4 5 6 0 1 2 3 4 5 AoA (deg) AoA (deg)

Figure 4.70: Relative error results for the Figure 4.71: Relative error results for the sweep the RAE-2822 model. sweep the original supersonic model in [101].

·10−2

HDM ROM CD CD 4 HDM ROM CL CL ROM 0.4 HDM CD CD 3 ROM HDM CL CL

2 0.2

Coefficients 1 Coefficients

0 0

0 1 2 3 4 5 6 0 1 2 3 4 5 AoA (deg) AoA (deg)

Figure 4.72: Aerodynamic coefficients for the Figure 4.73: Aerodynamic coefficients for the sweep the RAE-2822 model. sweep the original supersonic model in [101].

10−1 Cauchy p r

10−2

0 1 2 3 4 5 AoA (deg)

Figure 4.74: Ratio of the Cauchy residues in pressure for the supersonic airfoil in [101].

75 Figure 4.75: Pressure (Pa) distribution for the Figure 4.76: Pressure (Pa) distribution for the RAE-2822 HDM with the Normal mesh for an RAE-2822 ROM with the Normal mesh for an AoA of 6 degrees. AoA of 6 degrees.

76 Chapter 5

Conclusions

We have shown how the time spent on simulation and optimization is important to companies, and we proposed that model order reduction can aid in obtaining results faster, with a reasonable deviation from the original models representing reality. The use of Model Order Reduction was further justified in the context of the MDO framework developed with the NOVEMOR project, where high-fidelity simulations are too costly in terms of time to be actually used. A bibliographical research was done that established that for non-linear problems, CFD in particular, the most common way to reduce models is to project the equations (called Galerkin-Projection) describing the model onto a ”reduced” space, with fewer un- knowns, or to minimize the residue of the original equations in this reduced space (called Least Mean Squares reduction). This reduced space is to be determined from solutions or ”samples” previously computed by the high-fidelity model, by using either Proper Orthogonal Decomposition or one of its variants. In order to see just how well the researched methods perform, we have started by analyzing simple advection and diffusion problems, with well-known outputs, and that were already reduced by other authors. This not only allowed us to check for errors in our implementation, but also to initially evaluate some of the MOR techniques found in literature, and the need (or absence thereof) of using more complicated model reduction techniques. We observed that reduced model constructed by Proper Orthogonal Decomposition and employing either the Galerkin Projection or Least Mean Squares method can give results with relative deviations below 10% in most cases. The reduced models present these deviations all while speeding up calculations by 2 to 10×. It was also made clear that the speed of the Least Mean Square method depends heavily on the performance of the optimization routines available in the software. Once model reduction was applied to CFD models, we found again deviations below 10%, except when point singularities are present as observed for the lid-driven cavity problem where the Reynolds number was varied. In this case the Galerkin Projection showed deviations in pressure supe- rior to 100 % whilst those in velocity were below 1%. The Least Mean Squares method revealed to be more robust, and kept deviations below 10% for the most part. However, due to the optimization routines available in the used software, the Least mean square method failed to be faster than the original model, while the Galerkin projection managed to be up to nearly 3 times faster. When applying the Galerkin Projection to the compressible Euler simulation of a subsonic and supersonic aerofoil flying at different

77 angles of attack, we were able to obtain deviations close to or below 1% when within the bounds of the samples initially employed to construct the ROM. We were also able to observe a 2 × speed-up when using finer meshes.

5.1 Achievements

Overall we have demonstrated that using the Proper Orthogonal Decomposition with either the Galerkin Projection or the Least Mean Squares Reduction methods can be used to create reduced order models that are significantly faster to compute (> 2× faster) while maintaining errors below 10 % in most cases, and without requiring many previously computed samples (in the CFD analysis and reduction the biggest number of sample taken was 5). We have also demonstrated how these methods exactly ”interpolate” or match the samples used to generate these models for stationary problems solved with iteratively methods. This property seems to be lost to time-discretization error when using time-marching methods, but the errors remain low (<1%) near the points where the samples were taken. We also remark that so far no loss of stability was observed when using reduced order modeling, even when simulating the compressible Euler equations, where no physical viscosity is present. These methods present higher deviations when more than one parameter is being varied or when strong point singularities are present. For these particular situations, in order to comply with the most stringent deviation bounds given by the industry (1%), adaptive sampling methods presented earlier could be used for the former and a hybrid model (where only a part of the original equations are reduced) could tackle the latter.

5.2 Future Work

The work developed so far during this master thesis indicates that model order reduction may be able to provide faster models with acceptable errors for computations where parameters of a model are being varied. In particular, the 2D CFD models studied in this thesis had either the angle of attack or Reynolds number varied, and the reduced order models so produced were faster than the original model with reasonable errors in most cases. For the case of a wing flying at constant flight conditions, these reduction techniques could then be used to speed up performance evaluations of the twist (angle of attack) and chord (Reynolds number, as the speed and surrounding air does not vary) of a wing section. But in order to get there, they should be implemented in a modern high-fidelity solver, whose code is quite complex and must be manipulated to generate the ROM. Furthermore, the need of NOVEMOR to evaluate several parameters a the same time, and the possibility of having point singularities or a very local variation of pressure or speed (as is the case of shock formation) warrants the need of adaptive sampling and hybrid model reduction. These additions and the corresponding available methods, which we were not able to evaluate during this thesis due to the time available, need to be tested and verified before being put to use, either in industry or in the NOVEMOR framework.

78 Bibliography

[1] F. Afonso, J. Vale, F. Lau, and A. Suleman. Performance based multidisciplinary design optimiza- tion of morphing aircraft. Aerospace Science and Technology, 67:1–12, 2017.

[2] C. Hirsch. Numerical Computation of internal and External Flows. Elsevier, second edition, 2007. ISBN 978-0-7506-6594-0.

[3] AeroGust-Team. About aerogust (grant agreement number 636053).

[4] M. Ohlberger and S. Rave. Reduced basis methods: success, limitations and future challenges. In ALGORITMY 2016, 2016.

[5] F. Chinesta, P. Ladeveze, and E. Cueto. A short review on model order reduction based on proper generalized decomposition. Archives of Computational Methods in Engineering, 18:395– 404, 2011.

[6] A. L. Francisco Chinesta, Roland Keunings. The Proper Generalized Decomposition for Advanced Numerical Simulations. Springer, 2014.

[7] B. Bognet, F. Chinesta, A. Leygue, and A. Poitou. Proper generalized decomposition et separation´ de variables spatiales pour la resolution´ en thermoelasticit´ e´ lineaire´ applique´ a` des plaques com- posites. In 10e colloque national en calcul des structures, 2011.

[8] Reduced-order models for efficient computational analysis of complex systems. Technical report, NASA, 2014. Patent No: 8,060,350, Report LAR-TOPS-65.

[9] J. Qian, Y. Wang, H. Song, K. Pant, H. Peabody, H. Ku, and C. Butler. Projection-based reduced order modeling for spacecraft thermal analysis. techreport, NASA, 2015.

[10] Reduced Order Models for Aerodynamic Applications, Loads and MDO, 2017. DLR.

[11] M. Verveld, T. Kier, N. Karcher, T. Franz, M. Abu-Zurayk, M. Ripepi, and S. Gortz.¨ Reduced order models for aerodynamic applications, loads and mdo. 2016.

[12] Cea hpc summer school 2016, 2016. http://www-hpc.cea.fr/SummerSchools2016.htm, Accessed Nov. 2017.

[13] N. Martins. Apontamentos das aulas teoricas´ de Algebra´ linear. PDF, Feb. 2014. URL https: //www.math.tecnico.ulisboa.pt/~nmartins/ALT1314.pdf. Accessed Nov. 2017.

79 [14] D. A. Charbel Farhat. Cme 345 model reduction, projection based model order reduc- tion. Presentation, 2017. URL https://web.stanford.edu/group/frg/course_work/CME345/ CA-CME345-Ch3.pdf. Accessed Nov. 2017.

[15] J. Oliveira. Estabilidade dinamicaˆ : Modos laterais. Presentation, Dec. 2010. URL https:// fenix.tecnico.ulisboa.pt/downloadFile/3779576359546/EstDinam2.pdf. IST flight stability course, Accessed Nov. 2017.

[16] M. B. J. Weller, E. Lombardi. Numerical methods for low-order modeling of fluid flows based on pod. International Journal for Numerical Methods in Fluids, 63(2):249–268, 2010.

[17] A. I. Marcelo Buffoni, Haysam Telib. Iterative methods for model reduction by domain decomposi- tion. Computers and Fluids, 38(6):1160–1167, 2009.

[18] T. Bui-Thanh, K. Willcox, O. Ghatas, and B. Waanders. Goal-oriented, model-constrained opti- mization for reduction of large scale systems. Journal of Computational Physics, 224(2):880–896, 2007.

[19] R. Abgrall, D. Amsallem, and R. Crisovan. Robust model reduction of hyperbolic problems by l1-norm minimization and dictionary approximation. HAL, 2016.

[20] D. A. Charbel Farhat. Cme 345: Model reduction - methods for nonlinear systems. Presentation, 2017. URL https://web.stanford.edu/group/frg/course_work/CME345/CA-CME345-Ch9.pdf. Accessed Nov. 2017.

[21] M. Chevreuil and A. Nouy. Model order reduction based on proper generalized decomposition for the propagation of uncertainties in structural dynamics. International Journal for Numerical Methods in Engineering, 89(2):241–268, 2012.

[22] A. A. Antoine Dumon, Cyrille Allery. Proper generalized decomposition method for incompressible navier-stokes equations with a spectral discretization. Applied Mathematics and Computation, 219(15):8145–8162, 2013.

[23] A. Nouy. Proper generalized decomposition: une maniere de vaincre la malediction de la dimen- sionalite dans les methodes spectrales stochastiques. Presentation, March 2010. In french.

[24] D. Amsallem. Parameterized partial differential equations and the proper orthogonal decompo- sition. Slides online, 04 2014. URL http://matperso.mines-paristech.fr/Donnees/data12/ 1282-POD_doc_lecture.pdf. Accessed Nov. 2017.

[25] S. Volkwein. Proper orthogonal decomposition : Theory and reduced-order modeling, 2013.

[26] L. Sirovich. Turbulence and the dyanmics of coherent structures part i, coherent structures. Quar- terly of applied mathematics, 45(3):561–571, 1987.

[27] Y. Liang. Proper orthogonal decomposition and its applications part i theory. Journal of Sound and Vibration, 252(3):527–544, 2002.

80 [28] T. Bui-Thanh, M. Damodaran, and K. Willcox. Proper orthogonal decomposition extensions for parametric applications in compressible aerodynamics. In 21st AIAA Applied Aerodynamics Con- ference, 2003.

[29] C. W. Rowley, T. Colonius, and R. M. Murray. Model reduction for compressible flows using pod and galerkin projection. Pysica D, 189(1-2):115–129, 2004.

[30] K. Carlberg and C. Farhat. A low-cost, goal-oriented ’compact proper orthogonal decomposi- tion’ basis for model reduction of static systems. International Journal for Numerical Methods in Engineering, 86(3):381–402, 2010.

[31] L. Willcox, O. Ghattas, B. Waanders, and B. Bader. An optimization framework for goal-oriented, model-based reduction of large-scale systems. In Proceedings of the 44th IEEE Conference on Decision and Control. IEEE, 2005.

[32] S. Ullmann, M. Rotkvic, and J. Lang. Pod-galerkin reduced-order modeling with adaptive finite- element snapshots. Journal of Computational Physics, 325:244–258, 2016.

[33] E. Liberge and A. Hamdouni. Reduced order modelling method via proper orthogonal decom- position for flow around an oscillating cylinder. Journal of fluids and structures, 26(2):292–311, 2010.

[34] K. Carlberg and C. Farhat. A compact proper orthogonal decomposition basis for optimization- oriented reduced-order models. In 12th AIAA/ISSMO Multidisciplinary Analysis and Optimization Conference, 2008.

[35] L. P. Muruhan Rathinam. A new look at proper orthogonal decomposition. SIAM Journal on , 41(5):1893–1925, 2003.

[36] D. A. Charbel Farhat. Cme 345: Model reduction, proper orthogonal decomposition (pod). Pre- sentation, 2017. Spring course.

[37] M. O. Bernard Haasdonk, Markus Dihlmann. A training set and multiple bases generation ap- proach for parameterized model reduction based on adaptive grids in parameter space. Mathe- matical and computer modelling of dynamical systems, 17(4):423–442, 2011.

[38] Y. Choi, D. Amsallem, and C. Farhat. Gradient-based constrained optimization using a database of linear reduced-order models. 2015.

[39] M. Fahl and E. W. Sachs. Reduced order modelling approaches to pde-constrained optimiza- tion based on proper orthogonal decomposition. In Large-Scale PDE-Constrained Optimization, volume 30 of LNCSE, pages 268–280, 2003.

[40] S. V. Karl Kunisch. Proper orthogonal decomposition for optimality systems. ESAIM: Mathematical Modelling and Numerical Analysis, 42(1):1–23, 2008.

81 [41] M. A. Dihlmann and B. Haasdonk. Certified pde-constrained parameter optimization using re- duced basis surrogate models for evolution problems. Computational Optimization an Applica- tions, 60(3):753–787, 2014.

[42] M. Zahr and C. Farhat. Progressive construction of a parametric reduced-order model for pde- constrained optimization. International Journal for Numerical Methods in Engineering, 102(5): 1111–1135, 2015.

[43] T. Braconnier, M. Ferrier, J.-C. Jouhaud, M. Montagnac, and P. Sagaut. Towards an adaptive pod svd surrogate model for aeronautic design. Computers and Fluids, 40(1):195–209, 2011.

[44] M. Xiao, P.Breitkopf, R. F. Coelho, C. Knopf-Lenoir, M. Sidorkiewicz, and P.Villon. Model reduction by cpod and kriging. Structural and Multidisciplinary Optimization, 41(4):555–574, 2010.

[45] M. Brand. Fast low rank modifications of the thin singular value decomposition. Linear Algebra and its Applications, 415(1):20–30, 2006.

[46] A. Paul-Dubois-Taine and D. Amsallem. An adaptive and efficient greedy procedure for the opti- mal training of parametric reduced-order models. International Journal for Numerical Methods in Engineering, 102(5):1–32, 2015.

[47] F. Behzad. Proper Orthogonal Decomposition Based Reduced Order Modeling for Fluid Flow. PhD thesis, Clarkson University, 2014.

[48] A. I. Michel Bergmann, Charles-Henri Bruneau. Enabler for robust pod models. Journal of Com- putational Physics, 228(2):516–538, 2009.

[49] T. H. Michel Mallet. A new finite element fomulation for computational fluid dynamics : Ii the gen- eralized streamline operator for multidimensional advective diffusive systems. Computer methods in applied Mechanics and engineering, 58(3):305–328, 1986.

[50] L. M. Thomas Hughes, Gonzalo Feijoo. The variational multiscale method, a paradigm for com- putational mechanics. Computer Methods in Applied Mechanics and Engineering, 166(1-2):3–24, 1998.

[51] M. Bergmann, A. Ferrero, A. lollo, A. Scardigli, and H. Telib. An approach to perform shape opti- misation by means of hybrid rom-cfd simulations. In Recent developments in numerical methods for model reduction., pages 747–752, 2016.

[52] M. Bergmann, C.-H. Bruneau, and A. Iollo. Improvement of reduced order modeling based on proper orthogonal decomposition. resreport 6561, INRIA, June 2008.

[53] F. N. Victorita Dolean, Pierre Jolivet. An introduction to Domain Decomposition Methods : al- gorithms, theory and parallel implementation, chapter Iterative Schwarz methods : RAS, ASM, page 15. HAL, SIAM, 2016.

[54] H. Telib. Optimad eighteen month review meeting. Technical report, Aerogust, 2016.

82 [55] A. I. M. Bergmann, A. Ferrero. A hybrid pod-cfd approach for gust computation. In 7th International Conference on Computational Methods, 2016.

[56] C. C. A. Scardigli, H. Telib. Efficient sampling strategies in hybrid full/reduced - order cfd models. In 2017 International Conference on Adaptive Modeling and Simulation, 2017.

[57] A. Radermacher and S. Reese. Model reduction in elastoplasticity : Proper orthogonal decompo- sition combines with adaptie sub-structuring. Computational Mechanics, 54(3):677–687, 2014.

[58] A. M. H. H. Annika Radermacher, Stefanie Reese. Selective proper orthogonal decomposition model reduction for forming simulations. PAMM, 13(1):115–116, 2013.

[59] R. C. Mervyn Bampton. Coupling of substructures for dynamic analyses. AIAA Journal, 6(7): 1313–1319, 1968.

[60] IMTEK. Oberwolfach model reduction benchmark collection. Online Page. URL https://portal. uni-freiburg.de/imteksimulation/downloads/benchmark. Accessed Nov. 2017.

[61] J. K. Christian Moosmann, Evgenii Rudnyi. Model order reduction for linear convective thermal flow. In L. TIMA, editor, 10th international workshop on THERmal INvestigations of ICs and Sys- tems, April 2004.

[62] A. G. Christian Moosmann. Convective thermal flow problems. URL https://portal. uni-freiburg.de/imteksimulation/downloads/benchmark/Convection%20%2838867%29. Ac- cessed Nov. 2017.

[63] J. Mahaffy. Numerical analysis and computing lecture notes 07. Slides, 2010.

[64] J. Mahaffy. Numerical analysis and computing lecture notes 08. Slides, 2010.

[65] D. Billger. The butterfly gyro. Online page, 2017. URL https://portal.uni-freiburg.de/ imteksimulation/downloads/benchmark/The%20Butterfly%20Gyro%20%2835889%29. Accessed Nov. 2017.

[66] L. Feng. Gyroscope. Online, May 2013. URL https://morwiki.mpi-magdeburg.mpg.de/ morwiki/index.php/Gyroscope. Accessed Nov. 2017.

[67] C. Moosmann. ParaMOR, Model Order Reduction for parameterized MEMS applications. phdthe- sis, Universitat Freiburg, 2007.

[68] SimuTech. Detecting units with an apdl commands object in ansys mechanical (workbench). Online, 2017. URL https://www.simutechgroup.com/tips-and-tricks/fea-articles/ 186-fea-tips-tricks-ansys-detecting-units. Accessed Nov. 2017.

[69] A. Dazio. Fundamentals of structural dynamics. PDF, April 2013. URL http://www.sasparm. ps/en/Uploads/file/SD_An_Najah_2013_DS-alesandro.pdf. Taken from the UME School, Ac- cessed Nov. 2017.

83 [70] S. Nielsen. Structural dynamics lecture 5. PDF, 2009. URL http://www.wind.civil.aau.dk/ lecture/7sem/notes/Lecture5.pdf. from AALBORG Universitet, Accessed Nov. 2017.

[71] S. Nielsen. Structural dynamics lecture 4. PDF, 2009. URL http://www.wind.civil.aau.dk/ lecture/7sem/notes/Lecture4.pdf. Accessed Nov. 2017.

[72] C. M. e. a. U. Baur, P.Benner. Parameter preserving model order reduction for mems applications. In Mathematical and Computer Modelling of Dynamical Systems: Methods, Tools and Applications in Engineering and Related Sciences, volume 17, pages 297–317, 2011.

[73] U. Baur. Anemometer. Online Page, 2014. URL https://morwiki.mpi-magdeburg.mpg.de/ morwiki/index.php/Anemometer. Taken from the MORWiki, Accessed Nov. 2017.

[74] J. G. K. J. Lienemann, A. Yousefi. Nonlinear heat transfer modelling. In Dimension Re- duction of Large-Scale Systems, pages 327–331. Springer, Jan. 2005. URL https: //portal.uni-freiburg.de/imteksimulation/downloads/benchmark/Nonlinear%20heat% 20transfer%20%2838883%29/files/fileinnercontentproxy.2010-02-05.0369225308. Ac- cessed Nov. 2017.

[75] J. G. K. Jan. Lienemann, A. Yousefi. Nonlinear heat transfer modelling. Online Page, 2017. URL https://portal.uni-freiburg.de/imteksimulation/downloads/benchmark/Nonlinear% 20heat%20transfer%20%2838883%29. Accessed Nov. 2017.

[76] F. Palacios, M. R. Colonno, A. C. Aranake, A. Campos, S. R. Copeland, T. Economon, A. Lonkar, T. Lukaczyk, T. Taylor, and J. Alonso. Stanford university unstructured : An open-source integrated computational environment for multi-physics simulation and design. In 51st AIAA Aerospace Sci- ences Meeting, 2013.

[77] Su2 developers. Online. URL http://su2.stanford.edu/develop.html. Accessed Nov. 2017.

[78] V. Schmitt and F. Charpin. Pressure distributions on the onera-m6-wing at transonic mach num- bers. techreport 138, AGARD, 1979. AGARD AR 138.

[79] J. W. Slater. Onera m6 wing, 2015. URL https://www.grc.nasa.gov/www/wind/valid/m6wing/ m6wing.html. Accessed Nov. 2017.

[80] P. Cook, M. McDonald, and M. Firmin. Aerofoil rae 2822 - pressure distributions, and boundary layer and wake measurements. techreport 138, AGARD, 1979.

[81] J. W. Slater. Rae2822 transonic airfoil. Online Page, 2008. URL https://www.grc.nasa.gov/ www/wind/valid/raetaf/raetaf.html. Accessed Nov. 2017.

[82] F. Palacios, T. D. Economon, A. C. Aranake, S. R. Copeland, A. K. Lonkar, T. Lukaczyk, D. E. Manosalvas, K. R. Naik, A. S. Padron, B. Tracey, A. Variyar, and J. J. Alonso. Stanford university unstructured (su 2 ): Open-source analysis and design technology for turbulent flows. In 52nd Aerospace Sciences Meeting. AIAA, 2014.

84 [83] T. D. Economon. An unsteady continuous adjoint approach for aerodynamic design on dynamic meshes. AIAA Journal, 53(9):2437–2453, 2015.

[84] A. Variyar, T. D. Economon, and J. J. Alonso. Multifidelity conceptual design and optimization of strut-braced wing aircraft using physics-based methods. In 54th AIAA Aerospace Sciences Meeting. AIAA, AIAA, 2016.

[85] A. A. Kanoria and D. . D. J. Chandar. American institute of aeronautics and astronautics 1 inte- grating the stanford university unstructured (su 2 ) code with overset grids. In 22nd AIAA Compu- tational Fluid Dynamics Conference, 2015.

[86] Su2 doxygen documentation. URL http://su2.stanford.edu/doxygen/. Accessed Nov. 2017.

[87] Openfoam description, 2017. URL http://www.openfoam.com/products/openfoam-plus.php. Accessed Nov. 2017.

[88] D. A. Lysenko, I. S. Ertesvag, and K. E. Rian. Modeling of turbulent separated flows using open- foam. Computers & Fluids, pages 408,422, 2012.

[89] U. Millewa, P. Senathilaka, W. Dayarathna, S. Samarasingha, and S. Rangajeeva. Validation of openfoam as computational fluid dynamics (cfd) software. In Proceedings of 8th International Research Conference, 2015.

[90] U. A. Rahman and F. Mustapha. Validations of openfoam steady state compressible solver rhosim- plefoam. In ICMAIE 2015, 2015.

[91] S. Rumeau and M. Henneton. Validation du code openfoam sur des ecoulements´ de type rotos d’helicopteres. In 22ieme Congres Franc¸ais de Mecanique, 2015.

[92] H. Nilsson, M. Page, M. Beaudoin, B. Gschaider, and H. Jasak. The openfoam turbomachinery working group and conclusions from the turbomachinery session of the third openfoam workshop. In 24th Symposium on Hydraulic Machinery and Systems, 2008.

[93] Sig numerical optimization, 2014. URL http://www.openfoamwiki.net/index.php/Sig_ Numerical_Optimization. Accessed Nov. 2017.

[94] U. Nilsson. Description of adjointShapeOptimizationFoam and how to implement new objective functions, 2014.

[95] I. Spisso. Parametric and optimization study: Openfoam and dakota. In HPC enabling of Open- FOAM for CFD applications, 2012.

[96] Running applications in parallel. OpenFOAM Foundation, 2017.

[97] C. Fernandes, L. Ferras, and J. M. Nobrega. Solver development in openfoam. In OpenFOAM Course 2nd Edition, 2015.

85 [98] ODESolver Class Reference. The OpenFOAM Foundation. URL https://cpp.openfoam.org/ v5/ODESolver_8C_source.html#l00142. Accessed Nov. 2017.

[99] F. Hecht. New development in freefem++. Journal of Numerical Mathematics, 20:251,265, 2012. ISSN 1570-2820.

[100] F. Hecht. Freefem++ Manual, 3rd edition.

[101] F. D. Vuyst. Numerical modeling of transport problems using freefem++ software with examples in biology, cfd, traffic flow and energy transfer. 09 2013.

[102] A. P. Pazos. Aspectos matematicos y numericos de algunas leyes de conservacion escalares: aplicacion al control. mathesis, Universidad del Pais Vasco.

[103] G. Sadaka. Solving shallow water flows in 2d with freefem++ on structured mesh. 2012.

[104] R. G. Hill. Benchmark testing the alpha models of turbulence. mathesis, Clemson University, 2010.

[105] S. Auliac. Developpement doutils doptimisation pour FreeFem++. PhD thesis, Universite Pierre et Marie Curie Paris IV, 2014.

[106] G. Allaire, B. Boutin, C. Dousset, and O. Pantz. A freefem++ toolbox, 2008.

[107] C. Dapogny, P. Frey, F. Omnes, and Y. Privat. Geometrical shape optimization in fluid mechanics using freefem++. 2017.

[108] P. Jolivet. Recent advances in hpc with freefem++. In Fourth workshop on FreeFem++, 2012.

[109] G. Pitton. Pod for navier-stokes, 2014. URL http://www.um.es/freefem/ff++/pmwiki.php?n= Main.POD. Accessed Nov. 2017.

[110] L. DEDE. Adaptive and Reduced Basis Methods for Optimal Control Problems in Environmental Applications. PhD thesis, Politecnico Milano, 2008.

[111] G. Pitton. Numerical investigation of buoyant flows in tigh lattice bundles. mathesis, Politecnico di Milano, 2012.

[112] E. Erturk, T. Corke, and C. Gokc¸ol. Numerical solutions of 2-d steady incompressible driven cavity flow at high reynolds numbers. International Journal for Numerical Methods in Fluids, 48 (7):747–774, 2005.

[113] U. Ghia, K. Ghia, and C. Shin. High-re solutions for incompressible flow using the navier-stokes equations and a multigrid method. Journal of Computational Physics, 48(3):387–411, 1982.

[114] R. LeVeque. Numerical Methods for Conservation Laws, chapter Conservative Methods for Nonlinear Problems, pages 122–133. Birkauser,¨ second edition, 1999. URL https://pdfs. semanticscholar.org/1470/c6f43c769572c4cfc94ffc9c5710484ff1e5.pdf. Accessed Nov. 2017.

86 [115] J.-F. R. Christophe Geuzaine. Gmsh 3.0, Sept. . URL http://gmsh.info/doc/texinfo/gmsh. html. Accessed Nov. 2017.

87 88