Linköping University IEI - Department of Management and Engineering Division of Applied Thermodynamics and Fluid Mechanics Master Thesis 2019|LIU-IEI-TEK-A–19/03403-SE CFD-Method for 3D Aerodynamic Adjoint Simulations For External Automotive Aerodynamics Marcus Lång Academic supervisor: Roland Gårdhagen Industrial supervisor: Mattias Olander Examiner: Matts Karlsson Linköping University SE-581 83 Linköping, Sweden +4613-28 10 00, www.liu.se Abstract Today’s rules and regulations regarding emissions from combustion vehicles are very strict and the travel range per tank and/or charge, especially for electric vehicles, is a crucial factor which will always be considered by the customers. Hence, automotive manufacturers strive to boost fuel and battery economy. This can, to a great extent, be done by improving the aerodynamics of the vehicle for lower drag. The conventional CFD process for aerodynamic development is relatively time consuming and there is rarely enough time or resources to find the optimal design in all regions of the vehicle. Hence, the adjoint solver was investigated to make the aerodynamic development process more efficient by providing sensitivities of the geometry with respect to drag force. The adjoint solver was investigated both through a literature review as well as by performing CFD and adjoint simulations. The CFD and adjoint simulations were performed using Fluent 2019 R1 and the realizable k−ε turbulence model. It was found that it is important to monitor surface sensitivities during the solution in addition to the adjoint residuals to assess convergence of the adjoint simulation. It is also recommended to analyse regions of high residuals in the domain to ensure that they are far away from the surface(s) of interest. Investigations regarding different stabilization schemes as well different meshes for the adjoint solver were performed. It was concluded that the residual minimization scheme (RMS) is the preferred stabilization scheme. It was found that a coarser mesh can be used to reduce localized transient behaviour if the adjoint solver has trouble converging. It was found that a simplified model of a fully detailed car geometry is necessary to reduce the complexity and the resolution of the mesh to be able to use the RMS and to avoid local instabilities. A proposed CFD and adjoint procedure with guidelines and recommendation was developed. Keywords: Discrete adjoint method, shape sensitivity, gradient-based optimisation, Fluent, vehicle aerodynamics, CFD, stabilization scheme, residual minimization, adjoint convergence assessment i Acknowledgements First of all, I would like to acknowledge CEVT and the CAE Energy department for giving me the opportunity to do my master’s thesis together with them. I would like to thank my industrial supervisor at CEVT, Mattias Olander, as well as my academic supervisor, Roland Gårdhagen, for their support and guidance during the project. I would also like to express my appreciation to Samuel Gabriel at CEVT who also assisted me with solutions and answers to various problems and questions that arose. Last but not least, I want to thank Aditya Naronikar, my friend and study partner from Linköping University, whom I spent uncountable hours with to acquire the required knowledge to master a thesis within this subject. Marcus Lång, Gothenburg, June 2019 ii Nomenclature Abbreviations and Acronyms Abbreviation ACN AMG AWA CAE CEVT CFD CFL DNS FRCS MP MRF NOD PID RANS RMS RKE SSM UDM URF Meaning Artificial Compressibility Number Algebraic Multigrid Area-Weighted-Average Computer Aided Engineering China Euro Vehicle Technology Computational Fluid Dynamics Courant–Friedrichs–Lewy Direct Numerical Simulation Flow Rate Courant Scaling Motion Point Moving Reference Frame Normal Optimal Displacement Property Identification Reynolds-Averaged Navier-Stokes Residual Minimization Scheme Realizable k-ε Shape Sensitivity Magnitude User Defined Memory Under-Relaxation Factor Latin Symbols Symbol A a B CD CL Cp c FD k L M p Description Projected frontal area Speed of sound Additive constant Coefficient of drag Coefficient of lift Pressure coefficient Control variable Drag force Turbulent kinetic energy Length of the vehicle Mach number Pressure iii Units 2 m −1 ms [−] [−] [−] [−] [−] [N ] 2 −2 m s [m] [−] [P a] Symbol Rij Re Sij t Uτ u u+ y y+ Description Reynolds stresses Reynolds number Strain rate Time Friction velocity Velocity Dimensionless velocity Wall distance Dimensionless wall distance Units [P a] [−] −1 s [s] −1 ms −1 ms [−] [m] [−] Description Lagrange multiplier Difference between two values Variation Kronecker delta Dissipation of turbulence energy von Karman’s constant Dynamic viscosity Density Kinematic viscosity Turbulent kinematic viscosity Viscous stress tensor Shear stress at wall Units [−] [−] [−] [−] 2 −3 m s [−] kgm−1 s−1 kgm−3 2 −1 m s 2 −1 m s [P a] [P a] Greek Symbols Symbol α ∆ δ δij ε κ µ ρ ν νt τij τw Subscripts and superscripts Abbreviation i,j,k ∞ Meaning x,y,z components Freestream value iv Contents Abstract i Acknowledgements ii Nomenclature 1 Introduction 1.1 Background . . . . 1.2 Problem Statement 1.3 Purpose . . . . . . 1.4 Objectives . . . . . 1.5 Delimitations . . . iii . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1 2 2 2 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Theory 2.1 Fluid Dynamics . . . . . . . . . . . . . . 2.1.1 Aerodynamic Drag . . . . . . . . 2.1.2 Assumptions and Simplifications 2.2 Computational Fluid Dynamics . . . . . 2.2.1 The Governing Equations . . . . 2.2.2 Turbulence Modelling . . . . . . 2.2.3 Realizable k − ε . . . . . . . . . 2.2.4 Near Wall Flow . . . . . . . . . . 2.3 Adjoint Solver . . . . . . . . . . . . . . . 2.3.1 Discrete Adjoint Method . . . . . 2.3.2 Solution Methods . . . . . . . . . 2.3.3 Solution Controls . . . . . . . . . 2.3.4 Adjoint Literature Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 . 4 . 4 . 5 . 5 . 5 . 6 . 7 . 7 . 9 . 9 . 11 . 11 . 13 3 Method 3.1 Model Setup . . . . . . . . . . . . . . . 3.1.1 Geometry and Mesh . . . . . . . 3.1.2 Solver Setup . . . . . . . . . . . 3.1.3 Boundary Conditions . . . . . . 3.1.4 Computational Domain . . . . . 3.1.5 Convergence Assessment . . . . . 3.2 Adjoint Setup . . . . . . . . . . . . . . . 3.2.1 Adjoint Convergence Assessment 3.2.2 Adjoint Solver Setup . . . . . . . 3.3 Post-processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 15 15 20 20 21 21 22 22 22 25 4 Results 27 4.1 Simplified Car Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 4.1.1 Baseline Mesh Settings . . . . . . . . . . . . . . . . . . . . . . . . . . 27 v Contents 4.1.2 Stabilization Schemes and Meshes . . . 4.1.3 Varying Number of Modes using RMS . Full Car Model . . . . . . . . . . . . . . . . . . Case Study - Single Part Adjoint Optimisation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 39 43 47 5 Discussion 5.1 Potential & Applicability of the Adjoint Solver 5.2 Adjoint Method . . . . . . . . . . . . . . . . . . 5.2.1 Convergence Assessment . . . . . . . . . 5.2.2 Stabilization Schemes and meshes . . . 5.2.3 Robustness . . . . . . . . . . . . . . . . 5.2.4 Single Part Adjoint Optimisation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 50 51 52 52 55 56 4.2 4.3 6 Conclusion 58 7 Future Work 59 References 60 Appendices A1 A Adjoint Procedure A1 vi 1 1.1 Introduction Background This master thesis was performed together with China Euro Vehicle Technology AB (CEVT) in Gothenburg, Sweden. The project was conducted within the CAE Energy department in the field of aerodynamics. CEVT is an innovation centre for the future vehicles of Geely automotive group. CEVT’s research and technology development involve all different kinds of aspects in the automotive industry such as power transmission and drivelines, chassis, aerodynamics and the vehicles’ visual design as well as the total architecture of a car. Today, the rules and regulations regarding emissions from combustion vehicles are very strict and the travel range per tank and/or charge, especially for electric vehicles, is a crucial factor which will always be considered by the customers. Hence, automotive manufacturers strive to boost fuel and battery economy. This can, to a great extent, be done by improving the aerodynamics of the vehicle for lower drag. However, the external design of the car can be varied in almost an infinite amount of designs which makes experimental testing expensive and time-consuming. First of all, new parts would have to be manufactured for each design. In addition, experimental measuring equipment and facilities are required and need to be run and maintained. Instead, different designs are simulated using Computational Fluid Dynamics (CFD) for faster and cheaper design iterations. The conventional CFD process is still relatively time-consuming due to large models with many details. As of now, each simulation requires several thousand CPU hours. Hence, it can take many days to evaluate several designs. However, a primal flow field from a CFD simulation coupled with an adjoint solver could provide very valuable insight of the sensitivity of the geometry to a specified observable, which is drag force in this case. This allows the engineer to evaluate the sensitivity map to locate the most crucial regions of the vehicle and make modifications accordingly to reduce drag. It also allows the engineer to easily find regions of the car which has a great impact on the drag which might not have been thought of before. The adjoint method is relatively new within the field of CFD but has already been applied to both internal and external flow problems [1, 2, 3, 4, 5, 6]. The adjoint solver has evolved during the last couple of years with increased stability and has shown great potential [1]. 1 1 Introduction 1.2 Problem Statement Generally in the automotive industry, the aerodynamic development is performed through an iterative process where the engineer investigates different concepts one by one through 3-dimensional aerodynamic simulations using CFD. The result from the simulation for each concept is analysed quantitatively through drag and load deltas, and qualitatively from looking at the pressure and velocity of the flow around the vehicle. The engineer then changes the concept based on the analysis. The conventional CFD process for external aerodynamics at CEVT is illustrated in fig. 1. This process can be very time-consuming and there is rarely enough time or resources to find the optimal design in all regions of the vehicle. Figure 1: Typical aerodynamic development process using CFD 1.3 Purpose To make the aerodynamic development process more efficient, an adjoint solver can be used to provide information about the sensitivity of the geometry in relation to the flow around the vehicle. For example, the adjoint solver can calculate the sensitivity of the drag depending on the geometrical shape of the vehicle. A reliable adjoint optimisation method would enable the engineers to increase the performance of the car while maintaining or even reducing the computational time and resources required for each design loop compared to the current CFD method. Hence, the adjoint method will be investigated and a method with guidelines of how to use it will be developed. 1.4 Objectives The objectives of this study are to: • Investigate the potential of Fluents adjoint solver and evaluate its applicability to external aerodynamic flow around a ground vehicle • Develop a CFD-method with guidelines to run external 3D adjoint simulations for aerodynamic analysis using Fluent’s adjoint solver to achieve information regarding the sensitivities of the vehicle with respect to drag force 2 1 Introduction 1.5 Delimitations The delimitations of the study are: • The time frame of the project is limited to the spring of 2019 (middle of January beginning of June 2019) • Computational resources are limited to the available cluster at CEVT • A car model of type SUV A will be the geometry of focus in this study • Only consider drag as the objective parameter in the adjoint solver • Simulation and solver settings are set to be similar to CEVT’s standard procedure (however, the robustness of the developed method will be tested and possibly tweaked using other settings as well) • Available software packages for aerodynamic simulations and adjoint calculations are the standard software used at CEVT which are ANSA, Harpoon, Fluent and Ensight • No experimental validation was performed 3 2 Theory The theory chapter contains information regarding important concepts and equations utilized in the study. The fundamental physical principles and relevant equations to fluid dynamics, aerodynamics and adjoint optimisation are presented in the following sections. 2.1 2.1.1 Fluid Dynamics Aerodynamic Drag Aerodynamics is the study of fluid flow around a body and the forces acting on the body. An aerodynamic analysis is an essential part of the development of a road vehicle, both for stability and handling of the car as well as for the fuel economy, as mentioned previously. This study focused on the drag force of the car but all the forces and moments are important to take into consideration when designing a vehicle [7]. The drag force, or air resistance, is the force acting opposite to the direction of motion of the car. The drag force of the car (or any geometrical object for that matter) is defined by [8]: FD = 0.5CD Aρu2∞ (1) Where A, ρ, u∞ and CD are the projected frontal area, the density of the fluid, the velocity of the car and the coefficient of drag, respectively. The drag coefficient is a dimensionless quantity which depends on the geometrical shape of the car. The coefficient of drag can be altered by adjusting the external geometry of the car since the velocity and the density are constant parameters in this study. The value CD A is usually presented instead of just CD or the drag force as a comparison between designs, as shown in eq. (2). CD A = FD 0.5ρu2∞ (2) The aerodynamic drag force for a vehicle can be decomposed into two types of drag which are the profile drag and the induced drag. The profile drag can further be divided into two components which are the form drag (also called pressure drag) and viscous drag (also called skin friction drag). The form drag is caused due to the pressure distribution over the vehicle. In general, cars have a high-pressure region in front of the car and a low-pressure region behind the car caused by flow separation. The pressure differences create a resultant force which is the pressure drag. The viscous drag is caused by the wall shear stresses between the surfaces of the car and the fluid. The induced drag (also called trailing vortex drag) is a 3-dimensional type of drag caused by lift forces. The pressure differences in certain regions of the vehicle equalize and creates a trailing vortex that propagates in the streamwise direction. Typical regions where this can be expected are at the A-pillars and at the back of the vehicle around the C-pillars.[8, 9] 4 2 Theory 2.1.2 Assumptions and Simplifications Several assumptions were made to simplify the problem in hand. The fluid was considered to be an incompressible Newtonian fluid. Additionally, external body forces such as gravitational, electric or magnetic forces were neglected. The flow field was assumed to be of a steady nature and hence, the flow field variation with respect to time was neglected. It is commonly known that air could be considered incompressible, without losing significant accuracy in calculations if the Mach number is less than 0.3 [8]. At ground level, the speed of sound is roughly equal to 340 m s−1 (the speed of sound varies with temperature but the variation is not significant for this study) [10]. Due to the low velocity of commercial passenger cars, which in this study was set to be 100 km h−1 , the Mach number was found to be much less than 0.3, see eq. (3). The flow can still be considered incompressible even if local velocities around the vehicle increases three times the freestream velocity, which is not expected to be reached. M= u∞ 100 = ≈ 0.08 a 3.6 ∗ 340 (3) Where u∞ is the velocity of the vehicle and a is the speed of sound. The flow was assumed to be incompressible and the temperature was considered to be constant implies that the energy equation can be excluded, i.e. an isothermal process. 2.2 2.2.1 Computational Fluid Dynamics The Governing Equations Fluid flow can be described based on three fundamental physical principles which are conservation of mass, Newton’s second law and the first law of thermodynamics [11]. These physical principles are commonly known as the continuity equation, Navier-Stokes momentum equations (in x, y, and z-directions) and the energy equation and forms the base of CFD. Considering the assumptions mentioned earlier, the simplified continuity as well as the momentum equation are shown in eq. (4) and (5), respectively [12]. ρ ∂ui =0 ∂xi (4) ∂ ∂p ∂τij (ui uj ) = − + ∂xi ∂xi ∂xj (5) Where ρ is the density, u is the velocity component in ’i, j, k’-directions, p is the pressure and τij is the viscous stress tensor. The viscous stress tensor is defined as shown in eq. (6) [13]. 1 τij = 2ρν Sij − Skk δij 3 5 (6) 2 Theory Where ν is the kinematic viscosity, δ is the Kronecker delta and Sij is the strain rate which is defined in eq. (7) [13]. Sij = 2.2.2 1 ∂ui ∂uj + 2 ∂xj ∂xi (7) Turbulence Modelling Turbulent flow is an irregular, disorganised and chaotic three-dimensional behaviour of the flow in time and space [11, 14]. The Navier-Stokes equations can be solved using a direct numerical simulation (DNS) which resolves all the turbulent scales of the flow. However, a DNS requires an extreme amount of computational resources which makes it unfeasible to apply for industrial flow problems with today’s resources. Instead, the turbulence of the flow can be modeled and there are several different methods to model turbulent flow. The most common method, which is usually a sufficiently accurate and computationally viable method with today’s computing resources, is the Reynolds-Average Navier-Stokes (RANS) approach. The RANS approach is based on Reynolds decomposition, where the flow quantities are decomposed into one mean term (φ̄) and one fluctuating term (φ0 ), as shown in eq. (8) [11, 14]. Where φ is any scalar quantity of the flow. φ = φ̄ + φ0 (8) By replacing the scalars with the mean and the fluctuating term in the governing equations, an average form of the equations are obtained, see eq. (9). ∂ 1 ∂ p̄ ∂ ∂ ūi 0 0 (ūi u¯j ) = − + − ρui uj ν ∂xi ρ ∂xi ∂xj ∂xj ! (9) This leads to an undefined system of equations since there are more unknown variables than equations, which is known as ’the closure problem’ [11]. One of the most common approach is to make use of the Boussinesq hypothesis which states that the Reynolds stresses (Rij ) are proportional to the mean rates of deformation by introducing a term called eddy viscosity or turbulent viscosity (νt ), see Reynolds stress tensor in eq. (10) [11, 13]. 0 0 Rij = −ρui uj = νt ∂ u¯j ∂ ūi + ∂xj ∂xi ! 2 − ρkδij 3 (10) Where k is the turbulent kinetic energy which is defined as: 1 02 k = ui 2 6 (11) 2 Theory 2.2.3 Realizable k − ε The utilized turbulence model was the Realizable k-ε (RKE) model which is a two-equation model. The model includes one transport equation for turbulent kinetic energy (k) and another transport equation for the dissipation rate (ε). RKE is an improved variation of the standard k-ε model and it has two main differences which are [13, 15]: • A new formulation of the eddy viscosity • A modified transport equation for the dissipation rate The standard k- overpredicts the eddy viscosity in large separation regions and hence, produce non-realizable results in these situations which is why the RKE model was developed [15, 16]. The eddy viscosity formulation in the standard k-ε model contains a constant. This was modified in the RKE model such that the eddy viscosity contains a variable Cµ instead, see eq. (12) [13, 15]. νt = Cµ k2 ε (12) The variable Cµ varies with the mean rotation rate, the strain rate tensor, the angular velocity of the rotation as well as the turbulence quantities k and ε as shown in eq. (13). Cµ = 1 √ A0 + AS k Sij Sij +Ω̃ij Ω̃ij ε (13) Where A0 is a constant equal to 4.04 and AS is a parameter which is a function of the strain rate. Ω̃ij is a function of the angular velocity, dissipation rate and the mean rotation rate [15]. The modified transport equation for the dissipation rate was derived from an exact equation for the transport of the mean-square vorticity fluctuation as explained by Tsan-Hising Shih et al. in [15]. 2.2.4 Near Wall Flow A boundary layer will form near any no-slip surface where the flow is attached. The gradients in the boundary layer wall are very strong and the viscous effects are large. The near wall region can be divided into three different layers. First, the viscous sublayer, where the molecular viscosity is dominant and the flow has a laminar behaviour. Secondly, the buffer layer, where the molecular viscosity and eddy viscosity are of similar magnitude. Thirdly, the logarithmic layer, where the turbulent effects are dominant.[13, 17] A variable, y + , is introduced as a dimensionless variable which defines the distance from the wall and is based on wall shear stress, see eq. (14). y+ = 7 Uτ y ν (14) 2 Theory Where Uτ is the friction velocity and is defined as shown in eq. (15). Uτ = r τw ρ (15) Where τw is the shear stress at the surface. The near wall mesh resolution can be adjusted to capture the viscous sublayer, if physics permits. A y + of approximately 1 is required to properly resolve the viscous sublayer [11]. However, it would require a very fine mesh in the near-wall region which would increase the computational time significantly. Instead of resolving the sublayer, a wall function approach can be used to bridge the effects using the law of the wall. The wall function approach requires the first cell to be located in the logarithmic layer, which corresponds to a y + of 30-500.[11, 13] The region in between the viscous sublayer and the logarithmic layer is the buffer layer (5 < y + < 30) as mentioned previously. The velocity profile using the linear law as well as the log-law are visualized in fig. 2 together with data from a DNS simulation, where u+ is the dimensionless velocity. The DNS data are taken from a DNS simulation with a fully developed turbulent channel flow with a Re of 4200 from [18]. 25 u+ 20 Linear law Log-Law DNS 15 10 5 0 1 5 10 y+ 30 70 500 Figure 2: Velocity profile in the near wall regions for turbulent flow to visualize the linear-law and the log-law to DNS data. DNS data was taken from [18] The linear law is a linear relationship as seen in eq. (16) while the log-law refers to a logarithmic relationship between u+ and y + , which are shown in eq. (17).[11, 12] u+ = y + u+ = 1 ln(y + ) + B κ (16) (17) κ is called the von Karman’s constant and is usually set to a value of 0.40-0.41 while B is called the Additive constant and is usually approximately 5.1-5.5 depending on the wall roughness. These constants are found from experimental data and are valid for all turbulent high Reynolds number flows past relatively smooth walls.[11, 12] 8 2 Theory 2.3 Adjoint Solver The adjoint solver is a gradient-based optimisation tool which provides sensitivities of the surface of the geometry and other parameters with respect to an objective. There are two types of adjoint solvers, the discrete solver and the continuous solver. The discrete adjoint solver was implemented by Fluent since they believe that it provides more useful sensitivity data, compared to the continuous approach, for their users [16, 19]. All theory, methods and controls shown in the following subsections are equations and settings utilized or available as user-options in Fluent 2019 R1. 2.3.1 Discrete Adjoint Method Fluent’s adjoint solver is based on two main assumptions which are that the turbulence is frozen and that the primal flow field is steady [16, 19]. Hence, the adjoint solver does not take turbulent effects into consideration with respect to a change in geometry and flow field. This is a drawback of the adjoint solver, especially in regions where turbulent effects are significant such as in regions where the flow is separated. A previous CFD simulation of the flow field is required since the adjoint approach makes use of the flow variables to calculate the sensitivities. This implies that the primal flow field needs to be steady for the adjoint solver to produce accurate and reliable results [20]. Hence, it is important that the RANS solution does not oscillate such that the adjoint solver would produce different results depending on when the primal solution is stopped, unless the oscillations take place in an region that is not of interest. The discrete adjoint solver is discretized from the equations used in the flow field solver and then linearized. Hence, the discrete adjoint equation is directly depending on the type of scheme used to solve the flow equations [21]. This basic concept of Fluent’s adjoint solver is explained below. The adjoint objective (d) is a function of both the state of the flow (φ) and the control variables (c) as shown in eq. (18). The control variables are the points which defines the surfaces of the car. d = d φ(c), c (18) The governing equations can be written as in eq. (19) in compact form. R φ(c), c = 0 (19) The optimisation formulation is presented below, where the goal is to minimise the objective with the flow equations as the constraint. minimize d subject to R = 0 The observation variable will change δd with a variation in both flow state and control variable in a linear fashion as stated in eq. (20). The residual variation (δR) should remain zero when the flow field is changed, see eq. (21). 9 2 Theory ∂d ∂d δφ + δc ∂φ ∂c (20) ∂R ∂R δφ + δc = 0 ∂φ ∂c (21) δd = δR = This results in a constrained optimisation problem. However, the problem can be converted to an unconstrained formulation by introducing Lagrange multiplier (α). Hence, eq. (22) is obtained from eq. (20) and 21 by introducing α. δd = ∂d ∂R ∂R ∂d δφ + δc − α δφ + δc = ∂φ ∂c ∂φ ∂c ∂d ∂R −α δφ + ∂φ ∂φ ∂d ∂R −α δc ∂c ∂c (22) The value of α should be chosen such that the variations of the flow variables are eliminated which requires the following relation (eq. (23)) to be solved: ∂d ∂R =α ∂φ ∂φ (23) This results in an explicit formulation between the objective variable and the control variables which is shown in eq. (24). δd = ∂d ∂R −α δc ∂c ∂c (24) Equation (23) is the so-called adjoint equation and eq. (24) is the adjoint sensitivity equation. Since the equations are linear they can be solved in one step. However, that would put very high requirements on the computational resources in terms of both CPU and RAM, especially when simulating larger models. In practice, the adjoint equations are solved using an iterative procedure. First, the adjoint equations are computed. The adjoint residuals from the computation are used to determine a correction to the adjoint solution using algebraic multigrid (AMG) iterations (inner iterations). The correction is added and the adjoint variables are updated. Then, the adjoint equations are computed again until convergence is reached.[19, 22] The derivation of the equations used in the discrete adjoint approach is based on the theory in ANSYS Fluent’s Advanced Add-On Modules documentation [19], ANSYS Fluent’s User’s Guide [16] and ANSYS Adjoint Solver Best Practice Guide [22]. It is suggested to go through ANSYS documentation if the reader would like even more details or additional information regarding the discrete adjoint solver. 10 2 Theory 2.3.2 Solution Methods The default schemes in Fluent’s adjoint module for the adjoint solution are standard for pressure, first order upwind for momentum and Green-Gauss cell-based for the spatial gradient discretization. These schemes are used as default due to their superior stability compared to the second order schemes. However, if the same scheme is used in both the primal RANS flow field calculation and in the adjoint solution, the most accurate discrete derivative prediction is achieved [16, 23]. Using different schemes for the two solvers can lead to a deterioration of the adjoint results even if a second order adjoint scheme would reduce the truncation error [22, 24]. The difference can be observed by comparing the observable in Fluent’s report definition to the value of the observable in the adjoint module. All schemes that are implemented for the spatial discretization in the Fluent solver are not available in the adjoint solver. Hence, Fluent implemented a feature which makes it possible to achieve the ’best match’ between the flow field schemes and the adjoint solution schemes. However, as mentioned, the first order schemes are recommended for convergence stability [19]. In general, the adjoint calculation is much less stable compared to the primal solver and the accuracy of the primal flow field calculation is of greater importance to achieve valuable adjoint results since the primal flow results is used as input to the adjoint solver. Hence, a combination with first order primal and second order adjoint schemes would not make sense and would not necessarily result in a more accurate prediction either. 2.3.3 Solution Controls This section contains information regarding the available settings in Fluent’s adjoint module including Fluent’s recommendations. Solution-Based Controls Initialization The ’solution-based controls initialization’ selects the advancement controls (which are explained in detail below) based on the state of the flow for the initialization [19]. If disabled, the solver starts with default values or the values specified by the user. Auto-Adjust Controls The ’auto-adjust controls’ is a feature which is implemented to improve convergence by automatically adjusting the advancements settings, within certain reasonable limits, during the calculation. Stabilized Scheme Since the adjoint solver is based on a linear assumption, it can not damp any instabilities that may grow during the solution. Hence, a stabilization scheme has to be used to limit and damp any instabilities that might appear. Is it possible to run the adjoint solver without the use of any stabilization scheme but it is highly recommended by Fluent to use a stabilization scheme in problems with complex geometries, large separation regions 11 2 Theory and/or large Reynolds number flows as well as models with high cell count (> 30 million) [19, 25]. A stabilization scheme is also necessary to reduce oscillations and instabilities in the adjoint solver when the cell count is very large [1]. Four different stabilization settings were available which are the modal, spatial, dissipation and residual minimization scheme (RMS). However, the modal and spatial schemes are not recommended for any flow case according to Fluent and were deprecated in Fluent 2019 R1 [26]. Hence, the dissipation scheme or the RMS are recommended for all complex flow problems. Information about the dissipation and the RMS scheme follows below: • The dissipation scheme introduces non-linear dampening to damp the growth of instabilities. It has the capability to handle both weak and strong instabilities. Another advantage is that the computational resources in terms of memory and time are comparatively low. It is important to select the order of dampening to be one order larger than the pressure and momentum scheme to reduce its effect on the adjoint solution. The dissipation scheme is the second most recent developed adjoint stabilization scheme and is one of the most effective schemes according to ANSYS [1]. If the dissipation scheme is used but the solution advancement oscillates or diverges, ANSYS recommends to increase the dampening factor by 10 and decrease the spatial dampening order to 1.[22] • The RMS is the most recent development and was implemented in Fluent 19.2 and is based on a Krylov subspace using the generalized minimum residual method [16]. The memory requirements can be very high, depending on the number of modes (which is user defined), but the overall residuals are guaranteed to decrease, which makes it the most reliable and effective scheme [26]. The modes correspond to the number of vectors in the subspace span of the Krylov sequence [27]. A larger subspace span is beneficial for the residuals to decrease. The additional required RAM for the RMS is directly proportional to the number of modes and to the cell count of the model. Fluent recommend to initially run the adjoint solver without any stabilization scheme or with the dissipation scheme before activating the RMS. The residual minimization scheme should be activated when the solution has been run for a number of iterations or when the adjoint solution starts to diverge [16]. Apply Preconditioning If preconditioning is enabled, the following options are available: • Courant Number (CFL), controls the stability and rate of the solution advancement. A larger CFL value would decrease the computational time while increasing the risk of stabilization issues [19]. The CFL number has the most influence on the convergence stability and rate among all available preconditioning and under-relaxation settings. A typical CFL number is in the range of 1-5 for external automotive aerodynamics. However, cases with local instabilities might require a CFL < 1.[22] • Artificial Compressibility Number (ACN), controls the adjoint continuity residual in the inner iterations [16][28]. While it is possible to set the ACN above one, Fluent recommend values in the range of 0.01 ≤ ACN ≤ 1 [19]. If the residuals during the 12 2 Theory solution advancement seem to ’bounce’ it can be an indication of a too large ACN value.[22] • Flow Rate Courant Scaling (FRCS), is a scaling value that needs to be greater than zero [19]. A higher value of the FRCS corresponds to a faster computation of the inner AMG iterations. However, a too large value could cause instability and divergence issues. Preconditioning of the problem is when the problem is adapted to a form that is more suitable for numerical solving methods and, as mentioned previously, Fluent’s adjoint solver was using iterative numerical methods. Hence, it is suitable for more complex problems such as for most cases involving turbulent flow. If the preconditioning is disabled, the CFL number is automatically set to an infinite value which can cause solver instabilities. The preconditioning parameters explained above can be used to adjust the stability and convergence rate of the inner iterations in the AMG solver [19]. If the inner iterations in the AMG solver diverge or fail to converge within a reasonable number of iterations specified by the user, a reduction in either CFL or FRCS may be required. Alternatively, the ACN could be increased to reduce possible instabilities. However, a more aggressive inner convergence of the AMG loop will generally result in an improved convergence of the outer loop, as long as the inner AMG loop converges. Under-Relaxation Factors The under-relaxation factors (URF) are applicable for the adjoint momentum, continuity and local flow rate equations. Any value between zero and one can be specified whereas a higher value implies a more aggressive progression of the computation which could lead to instabilities or, otherwise, a faster convergence rate. It is worth to mention that the preconditioning settings have a much higher influence on the advancement stability than the URFs [29]. Algebraic Multigrid The AMG is, as mentioned previously, used to determine a correction of the adjoint solution. The AMG algorithm has two settings which are ’Tolerance’ and ’Maximum Iterations’, where the user can specify the desired convergence criteria as well as a set number of maximum iterations for the inner AMG loop. A tolerance value greater than 0.1 is considered to be an aggressive setting while a value lower than 0.1 is considered to be a conservative value. It is also recommended to keep the inner iterations between 3-5 and to decrease all residuals by a factor of 2 within each inner iteration to achieve a stable outer convergence.[22] 2.3.4 Adjoint Literature Review CFD adjoint solvers have been evaluated in several studies and are known to have stability issues in various flow related problems. However, the stability of the solver has been improved year by year with every new Fluent release and the adjoint solver has shown great potential during the last couple of years where car models have been analysed and 13 2 Theory improved using the adjoint method [1, 5, 6, 30, 31, 32]. This section aims to point out recommendations regarding the mesh and the adjoint settings to avoid instabilities during the solving procedure that have already been found in other studies. First off, it was recommended to disable the ’Solution-based control initialization’ since it caused instabilities in the solver when solving an external aerodynamics adjoint problem. Additionally, the dissipation scheme was recommended to be used as the stabilization scheme with default settings to achieve a steady convergence. However, it is worth to mention that these conclusions were found in a study that was performed before the RMS scheme was introduced as an option in Fluent’s adjoint solver.[32] In addition, ANSYS recommended to always run the adjoint solver using the first order scheme for the momentum equations and then apply the second order scheme in the end of the design iterations to increase the accuracy. However, other studies found it difficult to reach convergence using the second order scheme, depending on the case [29, 30, 33, 23]. Hence, ANSYS recommended to use first order schemes and claimed that it was usually ’accurate enough’ to provide useful sensitivity information [16]. The adjoint solver is highly dependant on the convergence quality of the primal solution in order to obtain reliable adjoint results, else it will most likely show non-physical results [3]. Another study found that the adjoint solver has to run using first order schemes with a coarse mesh where the cell skewness is lower than 0.8 [30]. A study regarding the application of adjoint methods on drag reduction of cars states that a high quality mesh is required, if the geometry is complex, for the adjoint solver compared to the conventional CFD solver [4]. ANSYS recommend to use a coarse mesh, both to reduce computational time and to improve convergence of the solver [1, 25]. It is worth to note that most of these previous studies, where the adjoint method has been applied to road vehicles, have been simulated with a simplified model of the car. That is different configurations of the car e.g. car models without front and tail lights, suspension, floor details, door gaps and without engine bay flow etc.[1, 5, 6, 30, 31, 32] Additionally, none of the previous studies presented a clear methodology with a workflow or settings that can be followed and used to evaluate other geometries. The RMS was not found to be utilized in any previous study either which was most probably due to the recent release of the RMS stabilization scheme in Fluent at the time when this study was performed. 14 3 Method The method chapter contains information about the primal model setup as well as the adjoint setup. 3.1 Model Setup The geometry, primal solver settings, boundary conditions, computational domain size and primal convergence criteria are presented in this section. It was considered important to keep the simulation setup similar to CEVT’s procedures for external aerodynamics regarding the solver settings, computational domain and meshing strategy to ensure that the adjoint investigation and results were applicable to their current methods. 3.1.1 Geometry and Mesh The analysed vehicle geometry was an SUV A which is shown in fig. 3. It is a detailed geometry and included all details of the car such as suspension, brakes, engine bay area, cooling fan, heat exchangers, exhaust system and floor details etc. A simplified model of this geometry was also analysed to reduce the computational costs while investigating the adjoint solver and is explained in further detail later in the report, see fig. 4 on page 17. 15 3 Method Figure 3: SUV A geometry The geometry was discretized in Harpoon, which is a hex-dominant mesher. The maximum element size in the domain was set to 320 mm while the minimum size was set to 1.25 mm. The large elements were placed near the outer boundaries of the domain while the smallest elements were placed near the car. Several refinement boxes were created around the vehicle in critical regions where large gradients were expected and to properly capture the wakes around the vehicle. One large refinement box was created around the vehicle with an extension behind the vehicle to capture the wake. Two smaller refinement boxes were created at the rear of the vehicle with an even finer grid density. Additionally, refinement boxes were created under the car as well as around and behind the mirrors, which is presented in the following sections. Three prism layers were created on the surfaces of the car which resulted in a y + around 30-70 in this case. The use of the refinement boxes with small elements near the car together with the size of the outer prism layer ensures a smooth transition from the prisms to the hex-elements. The harpoon meshes were created using scripts to ensure mesh consistency, such that the mesh procedure and location of grid refinements were the same every time a new mesh was created, to avoid user errors. The primary setting for the user is to change a base level mesh size, which all the sizings in the script were related to. Hence, the whole mesh is coarsened/refined if the base level is changed. 16 3 Method Simplified Car Geometry The simplified model included a flat underbody and closed grilles which meant that the engine bay flow, suspension, brakes and the fan were not included. Additionally, details such as wipers and Moving Reference Frames (MRF) regions for the wheels where not included either. These simplifications allowed for less complexity which resulted in more stable solution advancements and faster computations of the model’s primal solution as well as the adjoint solutions. Hence, more adjoint simulations were run in a shorter period of time which allowed several different adjoint solver settings to be tested quicker. The whole geometry of the car was divided into several different surface regions, called Property Identification (PID), in the pre-processing software ANSA. This was important to be able to refer to the individual PID regions and hence, facilitate the meshing procedure while also having the possibility to monitor scalars/sensitivities on each PID during the solution of the flow field and the adjoint. Also, depending on the used software, the use of different PID’s makes it possible to morph just a certain surface or a certain set of surfaces. The PID regions are shown in fig. 4, note that several colours look very similar but are of different nuance. Figure 4: The surfaces of the car were divided into different PID regions, where each specific color is a separate PID (note that several colours look similar but are of different nuance) Each PID was named with a certain mesh number which defined the level of mesh refinement at that specific surface. A cross-section view of the mesh at the symmetry plane near the vehicle can be seen in fig. 5. A few of the refinement boxes are also visible in fig. 5. The total cell count for the simplified geometry mesh was around 60 million elements. 17 3 Method Figure 5: Mid-cross-section cut to visualize the mesh and the refinement boxes. Important to note that this figure does not show the whole flow domain The mesh quality is of great importance when running CFD simulations. A good mesh quality will decrease the simulation time by increasing the rate of convergence and the stability of the solver. ANSYS mesh recommendations for Fluent’s conventional flow solver and the adjoint solver are to keep the maximum skewness less than or equal to 0.95 while the minimum orthogonal quality should be kept larger than or equal to 0.05 [16, 34]. The mesh recommendations are guidelines and the solver can reach convergence with worse quality but the adjoint solver is more sensitive to poor orthogonal quality compared to the primal flow solver [34, 35]. The mesh quality metrics from the simplified car geometry mesh are shown in table 1. It was observed that the mesh quality metrics were at the recommended limits for Fluent’s solvers. An ideal element has a skewness of 0, an aspect ratio of 1 and minimum orthogonal quality of 1, which in the case of a hexahedron element would be a cube [16]. Table 1: Mesh quality metrics for the baseline simplified car geometry mesh Mesh Quality Metrics Value Maximum Skewness Maximum Aspect Ratio Minimum Orthogonal Quality 0.95 105 0.055 In addition, two more meshes were created. One without prism layers, to achieve a better quality mesh since all of the elements with high skewness were found to be in the prism layer of the mesh, and one coarser mesh. The mesh quality metrics from the mesh without prism layers and the coarse mesh can be seen in table 2 and 3, respectively. The mesh without prisms had much better quality compared to the previously created mesh and had a cell count of 50 million. The coarse mesh was of poor quality and had a total cell count of 30 million, which is roughly half compared to the baseline mesh. It is important to note that mesh quality is taken from Fluent and the skewness can be one since the values are automatically rounded. 18 3 Method Table 2: Mesh quality metrics for the simplified car mesh without prisms Mesh Quality Metrics Value Maximum Skewness Maximum Aspect Ratio Minimum Orthogonal Quality 0.73 69 0.083 Table 3: Mesh quality metrics for the coarse mesh Mesh Quality Metrics Value Maximum Skewness Maximum Aspect Ratio Minimum Orthogonal Quality 1 163 0.051 Full Car Geometry The full car geometry included all the details that CEVT includes in their standard aerodynamic analysis such as open front, engine bay area, porous zones for heat exchangers, underbody details and MRF-regions for the wheels and for the fan etc. Same meshing procedure used for the simplified car geometry was applied to the detailed model as well. The mesh had a cell count of around 160 million cells and the cross section of the mesh for the full car geometry are presented in fig. 6. The mesh quality metrics are shown in table 4 and it can be seen that the mesh is not within Fluent’s mesh quality recommendations. Figure 6: Cross-section cut to visualize the mesh and the refinement boxes. Important to note that this figure does not show the whole flow domain 19 3 Method Table 4: Mesh quality metrics for the full car geometry 3.1.2 Mesh Quality Metrics Value Maximum Skewness Maximum Aspect Ratio Minimum Orthogonal Quality 1 264 0.025 Solver Setup Fluent, version 2019 R1, which utilizes the finite volume method, was used as the CFD solver. The turbulence model was set to RKE with enhanced wall treatment as the nearwall treatment for convergence stability reasons. The pressure-based solver was used since the flow was assumed incompressible. The coupled algorithm was used as the pressurevelocity coupling. The main advantages of the coupled algorithm are that it is more robust and efficient in terms of convergence rate [16]. The spatial gradient discretization was set to the Green-Gauss Cell-based method which was a more robust scheme since it is first order accurate and it has a comparatively low computing cost. The standard pressure scheme was utilized and the first order upwind scheme was used for the turbulent kinetic energy and the turbulent dissipation rate. For stability reasons, the momentum equations were initially solved using the first order upwind scheme. After 1000 iterations, the second order upwind scheme was applied and the solver was set to run to convergence. The convergence assessment for the primal flow field is explained in section 3.1.5 on page 21. 3.1.3 Boundary Conditions An inlet velocity of 27.78 m s−1 was specified normal to the inlet surface with a turbulent intensity of 0.1% and a viscosity ratio of 200. The outlet was set to a pressure outlet with a gauge pressure of 0 Pa. All the surfaces of the car were set to no-slip walls. The ground under the car was set to a moving no-slip wall with the same velocity and direction as the inlet velocity as shown in fig. 7. The other three far-field walls of the domain surrounding the car were set to symmetry boundaries. Fluent assumes that the flux and gradients of all quantities are zero at a symmetry boundary, which is also the case for a free slip wall boundary [16]. Additional boundary conditions for the full geometry model were MRF regions, rotational velocity of the tires as well as porous zones for the radiators and other porous regions. All the rims had a specified fluid region each with an applied rotational velocity around the wheel hub centre axis to match the free stream velocity of 27.78 m s−1 . Also, the tire wall surfaces were set to a moving wall with the same rotational velocity as for the MRF regions in the rims. Another MRF region was specified for the fan in the engine bay with a rotational velocity that corresponds to its operational angular velocity at the specified travelling velocity of the vehicle. There are several heat exchangers placed inside the grille in the engine bay area. Each of these heat exchangers had its own fluid zone and each fluid zone was set to be a porous zone with a specified viscous and inertial resistance based on data from the hardware supplier of each radiator. 20 3 Method Figure 7: Visualization of the domain and the boundary conditions (domain and vehicle not to scale) The fluid was set to air with the following properties; the density (ρ) and the dynamic viscosity (µ) were set to 1.205 kg m−3 and 1.805 × 10−5 Pa s, respectively. This resulted in a Reynolds number of approximately 2 700 000 which is defined as shown in eq. (25) [11]. Where the projected frontal area (A) of the SUV model was approximately 2.5 m2 . √ ρu∞ A Re = µ 3.1.4 (25) Computational Domain The computational domain around the vehicle was calculated based on the dimensions of the vehicle. The domain was ensured to be large enough to not affect the outcome of the results. The domain was much larger behind to car to make sure that the wake was captured properly. 3.1.5 Convergence Assessment Since the adjoint solver requires a well-converged primal solution to provide reliable results it was important to ensure that the mesh quality and convergence criteria did not have a significant effect on the stability or the results of the final solution. The solution was deemed converged only when two conditions were fulfilled. Firstly, once the residuals were leveled out for 500 iterations at a sufficiently low value, usually when the continuity equation and the residuals for the transport equations for the turbulent quantities were less than 1E-3 and the momentum equations less than 1E-5. Secondly, when negligible variations in CL and CD were obtained in the last 500 iterations. Alternatively, if the solution reached a continuously oscillating state with a standard deviation of less than or equal to 0.003 for both CL and CD . 21 3 Method 3.2 Adjoint Setup The adjoint set-up in Fluent is explained for the different cases in this section together with information about adjoint convergence assessment. Settings according to the recommendations in the literature review and Fluent guides were implemented together with tweaks of the solution control values to make the solution advancement more stable. 3.2.1 Adjoint Convergence Assessment There are two ways to assess the convergence of the adjoint solver. First of all, the adjoint residuals that are printed and shown during the solution advancement as in the conventional flow solver. However, it was important to not blindly look at these adjoint residuals. Depending on the selected observable, which in this study was set to be the drag force, an adjoint ’wake’ might be present in front of the vehicle due to a backward calculation of the adjoint field. This leads to a region of several cells with higher residuals which makes the global adjoint residuals misleading. This is not necessarily an issue since the wake is most probably relatively far away from the vehicle and surface of interest but should be treated with caution. Other areas where higher residuals can be expected, if a hex-dominant mesh is used, are at the edges of the refinement boxes due to the rapid change of element size. Hence, it was recommended to make sure that the adjoint residuals level out and to pay attention to the residuals around the surfaces of interest. Therefore, it was decided to monitor the sensitivities of the important surfaces. The adjoint residuals in the domain from the last iteration can be saved by activating 5 User Defined Memory (UDM) locations and store the adjoint residuals in each memory location. The residuals can then be visualized using the cell registers in Fluent. Secondly, at the time of this study, no built-in function to monitor convergence of the adjoint solver, like Fluent’s report monitors for the primal flow field, exists. The adjoint solver is located in another module within Fluent and hence, the monitor features are not available during the adjoint solution process. Instead, a separate scheme script was used (mainly developed by ANSYS [24] but modified and adapted in this study to fit each case) and implemented in the journals to write adjoint surface data at every desired iteration to a file. Another script was written in Python to clean, read and plot the data. This surface sensitivity data was used as an additional check to assess convergence of the adjoint solution, i.e the solution was converged when negligible differences in the sensitivities were obtained during a sufficiently large number of iterations depending on the stabilization scheme utilized. However, the use of the scheme script for monitoring sensitivities during the solution increased the computational time significantly and stored a huge amount of ’trash’ data files in addition to the intended file. Hence, the monitor scripts were not always used to store data every iteration but rather when it was necessary, such as, at the end of the adjoint simulation and with a larger output interval than every iteration. 3.2.2 Adjoint Solver Setup Both the simplified and the full car model were divided into different regions to be able to write surface data to assess convergence. Several surfaces at different locations of the car were added to the adjoint monitor scripts. The location of each surface on the simplified car are shown in fig. 8 (the corresponding surfaces were monitored in the full car simulations). 22 3 Method The simulations were initially set to write sensitivity data, using the script mentioned in the previous section to assess convergence, every iteration which greatly increased the simulation time, especially for the dissipation case. In further simulations where the dissipation stabilization scheme was used it was specified to write surface sensitivity data every 25th iteration instead. The computational time for the RMS was not as affected by the output intensity since the sub-iterations took the most time. The full car simulations with the RMS would require an approximated 3 TB additional RAM which is not feasible with today’s computational resources and it would require several hundreds of thousand CPU hours. The monitored surfaces for the full car simulations with the dissipation scheme were only exported during the last 2 000 iterations and with a write interval of 50 iterations to reduce the simulation time. Figure 8: Surfaces and their respective names that were monitored during the adjoint solution to assess convergence The solution methods for the adjoint gradient, pressure and momentum discretization were, as recommended, set to Green-Gauss Cell-Based, standard and first order upwind, respectively. Hence, the gradient and the pressure scheme were the same in both the primal flow solver and the adjoint solver. The solution-based control initialization and the auto-adjust controls were disabled. Stabilization schemes were used and are explained later in this subsection. The preconditioning was enabled for all cases and the specific settings were very conservative due to the complex geometries (see table 5). 23 3 Method Table 5: Advancement control settings Advancement Control Value CFL ACN FRCS URF Adjoint Momentum URF Adjoint Continuity URF Adjoint Local Flow Rate Tolerance Maximum Iterations 0.2 0.01 0.2 0.2 0.2 0.2 0.0001 30 Dissipation Scheme The dissipation scheme was activated with the settings shown in table 6. It is worth to note that the first order damping was used with a larger damping factor than default. The simulations with the dissipation scheme were set to run for 5 000 iterations. Table 6: Stabilization scheme settings for the dissipation scheme Dissipation Scheme Setting Value Damping Factor Damping Relaxation Damping Order Suppression 10 0.9 1 Enabled Residual Minimization Scheme The residual minimization scheme utilized the settings shown in table 7. The number of elements using the baseline mesh together with 800 modes was found to required a massive amount of RAM and cannot be increased due to the computational limitations. The predicted additional memory required for the RMS, with these settings and the 60 million mesh was 1.1 TB. The RMS demands a huge amount of RAM and would not be feasible for larger models with today’s resources if the number of modes is kept at the same number. Larger models with more details will most likely have more local instabilities which would require even more modes to stabilize the solution. Simulations with 100, 200 and 400 modes were also investigated using the simplified model and the baseline mesh. Due to instabilities and rapidly growing residuals without any stabilization scheme, it was chosen to initially run the adjoint solver with the dissipation scheme and the settings showed in table 6. The RMS was then activated after 100 iterations and set to run for another 30 iterations. Each of these 30 iterations was set to run with a number of sub-iterations, one for each mode minus the recycled modes, which makes the RMS computational demanding in relation to both time and hardware requirements. The number of recycled modes were always kept 0.25 times the number of modes. 24 3 Method Table 7: Stabilized Scheme Settings for the RMS 3.3 RMS Setting Value Number of Modes Number of Recycled Modes AMG Iterations 800 (100,200,400) 200 (25,50,100) 6 Post-processing The pressure coefficient (Cp ) from the primal flow field simulations was presented together with the adjoint results to be able to easily interpret and judge if the adjoint results seemed physically reasonable. The adjoint residuals and the surface sensitivity monitor plots were presented for each case to assess stability and convergence of the adjoint solver. There are several different ways to visualize the results computed from an adjoint solution that could be used to manually locate and improve the shape of the car or to automatically morph the geometry to achieve lower drag. The adjoint solution data visualized in this study is the log10 shape sensitivity magnitude (SSM) and the normal optimal displacement (NOD). The SSM highlights regions of the geometry where a small change in the geometry results in a large change in the objective. A higher SSM value indicates a more sensitive region. Due to a large range of the SSM values, the log10 (SSM ) was presented instead to make it easier to analyse and interpret the results. This allows the engineer to find regions of the car where very small geometry changes can be made to decrease the drag of the vehicle.[16] While looking at the SSM results, it is important to remember that even the surfaces where the SSM are low can have a significant impact on the drag. However, that requires a small change over a larger area or a large change over a small area. However, it is not possible to extract information regarding the magnitude of the surface displacement from the SSM. The NOD shows how much and in which direction the surfaces should be displaced to achieve, in this case, lower drag. A positive value indicates a normal displacement of the surface into the flow domain, such that the surface is pulled outwards. In the same way, a negative value indicates that the surface should be pushed inwards to reduce the drag.[16] It is important to note that the NOD is not calculated during the adjoint solution but instead calculated afterward using computed adjoint sensitivity data utilizing Fluent’s ’Design-Tool’ in the adjoint module [16]. Hence, it should be treated with caution but can be very informative and of great value. There are options available in the design tool to set the desired drag reduction to a certain percentage or to optimally decrease the drag which should result in an accurate prediction of the objective. The optimum decrease was chosen because of the possible misprediction that can occur if a too large percentage value is set. This possible misprediction can be attributed to the non-linearities of larger geometry changes in relation to the flow field. The geometry change was done in Fluent without any restrictions to verify the adjoint data. The settings utilized in the design tool to calculate the NOD for each case are shown in 25 3 Method table 8. The selected zones to be modified for the car were all the surfaces of the car while only the surfaces of the side view mirrors were selected in the case study. The case study is a part of this study where the adjoint results of only the side view mirrors are analysed separately. The same surfaces were selected as the regions to create a design space around the object. The design space is then filled with a number of points called motion points (MP). The number of MPs in X, Y and Z direction utilized to calculate the NOD is case dependent. It is important that the number of MPs are less than the number of mesh nodes in each direction. That is to avoid rough elements in the surfaces since the adjoint data is not always perfectly smooth which can induce separation and hence, increase the drag instead of reducing it. However, a too smooth NOD might not always be desired since smaller details and shapes can easily be missed out. This is a trade-off which has to be decided by the user to achieve the desired information about the surface(s) of interest. When the NOD was calculated in this study a coarser set of MPs were used for the car to get an overview of the results. However, when the side view mirrors were analysed separately, a much finer set of MPs were used to achieve a more detailed NOD map of the mirror surfaces. Table 8: Settings utilized in the design tool to calculate NOD for the car as a whole and for the side view mirrors separately Setting Car Side View Mirrors Freeform Scale Factor X Motion Points Y Motion Points Z Motion Points Freeform Max Iterations Freeform Constraint Relaxation Freeform Preconditioning Freeform Parameter Relaxation 0.1 25 25 25 250 0.1 4 0.6 1 15 80 15 500 0.1 20 0.5 26 4 4.1 Results Simplified Car Model The simplified car geometry was run with all possible combinations of the different meshes and stabilization schemes explained previously and are presented in the following sections. 4.1.1 Baseline Mesh Settings The pressure coefficient on the surfaces of the vehicle from the primal solution using the baseline mesh is shown in fig. 9. As expected, high-pressure regions were observed in front of the car, at the windshield and at the mirrors. It was also observed that relatively high pressure was present at the leading edge of the B and C-pillars. However, the pressure in front of the car was much higher. Figure 9: Pressure coefficient (Cp ) on the surfaces of the simplified vehicle Figure 10 shows the regions of the domain with an isosurface with a total pressure coefficient of zero which is colored by the velocity magnitude. It was observed, and expected, that a large wake is present behind the vehicle. There are also wake regions behind the side view mirrors, around the A and C-pillars and at the wheels. 27 4 Results Figure 10: Isosurface with a total pressure coefficient of zero to visualize wake regions, colored by the velocity magnitude (the bottom view is from the back of the vehicle) The residuals from the adjoint simulations utilizing the dissipation scheme and the RMS as the stabilization schemes are shown in fig. 11a and 11b, respectively. It was observed that the residuals in the RMS case dropped very rapidly once the RMS was activated and stabilized quickly after just a few iterations. The residuals using the dissipation scheme were oscillating and required around 5 000 iterations before the residuals leveled out. The adjoint solutions using the dissipation scheme and the RMS took 13 000 and 23 300 CPU hours to run, respectively. However, since the adjoint solution was difficult to converge, the simulations were run using very conservative settings. Additionally, the RMS simulation was run 30 iteration even though it converged at around 15-20 iterations as seen in fig. 11b. Both these simulations were set to write sensitivity data every iteration which greatly increased the simulation time, as mentioned in section 3.2.2. 28 4 Results 101 Adj-Con Adj-xMom Adj-yMom Adj-zMom Adj-Flowrate 10−1 100 Residuals Residuals 100 10−2 10−3 10−1 Adj-Con Adj-xMom Adj-yMom Adj-zMom Adj-Flowrate 10−2 10−3 10−4 0 1000 2000 3000 4000 5000 Iterations (a) Residuals utilizing the dissipation scheme 0 20 40 60 80 100 120 Iterations (b) Residuals utilizing the RMS Figure 11: Adjoint residuals using different stabilization schemes The region of the domain where the highest residuals were observed are presented in fig. 12. The adjoint residual for the momentum equation in the x-direction at a cross section plane in the middle of the domain are shown. However, it is worth to mention that all residuals were high in the same region. It was observed that the so-called ’adjoint wake’ was present in front of the vehicle, as previously explained to be expected in section 3.2.1. This region with higher residuals was observed to be present in all adjoint simulations using the simplified geometry. From fig. 12 it can also be observed that slightly higher residuals were found at the transition between the large refinement box and the far field mesh. Figure 12: Residual (adj-xMom) contour of a cross section plane simulated with the dissipation scheme (the whole domain is not visible in this figure) The area-weighted-average (AWA) log10 SSM monitored during the adjoint solutions utilizing the RMS and the dissipation scheme are presented in fig. 13 and 14, respectively. The location of the monitored surfaces was shown in the method chapter in fig. 8. It was observed that the sensitivities leveled out quickly once the RMS was activated. The 29 4 Results 7 2500 5000 Iterations Headlights 6 5 0 2500 5000 Iterations 5 0 7 2500 5000 Iterations Rear Spoiler 6 5 0 2500 5000 Iterations 6 5 0 7 2500 5000 Iterations Tail Lights 6 5 0 2500 5000 Iterations AWA log10 SSM 0 6 Bumper 7 AWA log10 SSM 5 7 AWA log10 SSM 6 A-Pillars AWA log10 SSM Side View Mirrors AWA log10 SSM 7 AWA log10 SSM AWA log10 SSM AWA log10 SSM sensitivities using the dissipation scheme were initially oscillating and several surface sensitivities still showed an increasing/decreasing advancement behaviour even after 5000 iterations. However, the sensitivities at a few of the monitored surfaces were found to level out, such as for the A-pillars, bumper, headlights etc. Roof 7 6 5 0 2500 5000 Iterations Rear Body 0 2500 5000 Iterations 7 6 5 Figure 13: Surface sensitivity monitors using the dissipation scheme 7 6 5 0 65 100 Iterations 5 0 7 65 100 Iterations Rear Spoiler 6 5 0 65 100 Iterations 6 5 0 7 65 100 Iterations Tail Lights 6 5 0 65 100 Iterations AWA log10 SSM 65 100 Iterations Headlights Bumper 7 AWA log10 SSM 0 6 AWA log10 SSM 5 7 AWA log10 SSM 6 AWA log10 SSM 7 A-Pillars AWA log10 SSM AWA log10 SSM AWA log10 SSM Side View Mirrors Roof 7 6 5 0 65 100 Iterations Rear Body 0 65 100 Iterations 7 6 5 Figure 14: Surface sensitivity monitors using the RMS (the RMS scheme was activated at iteration 100) The log10 SSM for both stabilization schemes are presented in fig. 15. It was observed that the most sensitive regions for both cases were the same in general. These regions were the A-pillars, the edge between the bumper and the hood as well as the pillars around the 30 4 Results windows (B and C-pillars) and the rear spoiler. The largest difference between the two cases was seen around the tail lights of the vehicle. Figure 15: log10 SSM for the simplified car geometry using different stabilization schemes The NOD as well as the actual geometry change are presented in fig. 16 and 17, respectively. The NOD was observed to be similar for the two stabilization schemes. The NOD results are reasonable from a physical point of view compared to the Cp in fig. 9. The adjoint results proposed that the bumper should be pushed forward to reduce the size of the high-pressure region by making the front sharper while decreasing the size of the rear part of the car to reduce the size of the wake. It was also observed that a part of the side view mirrors was pushed forward while the rest of the mirror was displaced inwards, to achieve a more aerodynamic shape, shaping it towards a droplet. The actual geometry was obtained through mesh morphing in Fluent based on the NOD results. As seen in fig. 17, the whole car was morphed (including the tires and windshield) which is unrealistic but allowed for the adjoint results to be verified. 31 4 Results Figure 16: NOD for the simplified car geometry using different stabilization schemes Figure 17: Actual geometry change after the adjoint optimisation. Red indicates that the surface was displaced outwards and blue indicates that the surface was displaced inwards or that the geometry retained its shape from the baseline The predicted value of CD A in Fluent compared to the actual verified values are presented in table 9. It was observed that the prediction was off by around 3.5 % for the RMS and 2.3 % for the dissipation case. The CD A decreased roughly 4 % compared to the baseline 32 4 Results case for the RMS while the dissipation scheme resulted in a CD A decrease of 4.87 %. Table 9: Actual and predicted values of ∆CD A for the two stabilization schemes 4.1.2 Case Actual ∆CD A [%] Predicted ∆CD A [%] Baseline RMS Dissipation Scheme -4.05 -4.87 -7.60 -7.21 Stabilization Schemes and Meshes The results from the coarse mesh and the mesh without prisms are presented in this section. The primal flow solutions obtained from these two cases compared to the primal baseline mesh case showed a relatively small difference. The ∆CD A for the other meshes was found to be within 3.5 % to the baseline case, see table 10. It was also observed from fig. 18 that the pressure fields of the vehicles were similar in both cases. This comparison was performed to ensure that the other meshes primal flow fields and values were similar to the baseline mesh flow field. If too large differences would have been seen already in the primal flow field, the adjoint results would be very inaccurate. Table 10: ∆CD A (%) comparison for the different meshes Case ∆CD A [%] Baseline Without prisms Coarser mesh -3.5 -1.5 Figure 18: Cp contours on the surface of the car using different meshes 33 4 Results Using the Dissipation Scheme The adjoint solver was run utilizing the mesh without prism layers and the coarser mesh with the dissipation scheme. The residuals for both cases are presented in fig. 19a and 19b. It was observed that the residuals were much more stable and leveled out 1 500 iterations earlier in both cases compared to the baseline mesh case. The mesh without prism layers and the coarse mesh took 8 600 and 4 300 CPU hours to run, respectively. Adj-Con Adj-xMom Adj-yMom Adj-zMom Adj-Flowrate Residuals 100 10−1 10−2 10−3 101 Adj-Con Adj-xMom Adj-yMom Adj-zMom Adj-Flowrate 100 Residuals 101 10−4 10−1 10−2 10−3 10−4 0 1000 2000 3000 4000 5000 Iterations 0 (a) No prism mesh 1000 2000 3000 4000 5000 Iterations (b) Coarse mesh Figure 19: Adjoint residuals using different mesh setups The monitored surface sensitivities from the two adjoint simulations are shown in fig. 20. It was observed that the surface sensitivity between the two cases differs in both advancement behaviour and quantity. It was also observed that the coarser mesh model experienced fewer oscillations for the side view mirrors, bumper and the tail lights compared to the finer meshes. All the monitored surface sensitivities are not converged such as the rear body for the no prism mesh and roof for the coarser mesh. 34 4 Results 0 6 5 5 2500 5000 Iterations Headlights 0 2500 5000 Iterations 0 7 AWA log10 SSM AWA log10 SSM 7 6 5 5 2500 5000 Iterations Rear Spoiler 0 AWA log10 SSM 6 6 0 7 2500 5000 Iterations 2500 5000 Iterations Tail Lights 6 5 0 2500 5000 Iterations Roof 7 6 5 0 2500 5000 Iterations Rear Body 0 2500 5000 Iterations 7 AWA log10 SSM 5 Baseline Coarse No Prism 7 AWA log10 SSM 6 Bumper 7 AWA log10 SSM 7 A-Pillars AWA log10 SSM AWA log10 SSM Side View Mirrors 6 5 Figure 20: Surface sensitivity monitors using the dissipation scheme and different meshes. The legend in the first subplot is valid for every subplot in this figure The log10 SSM was observed to be slightly larger and more pronounced using the coarse mesh compared the mesh without prisms, see fig. 21. It was observed that the largest differences were at the C-pillars and around the tail lights. Figure 21: log10 SSM for the simplified car geometry simulated with different meshes using the dissipation scheme 35 4 Results The NOD comparison between the different meshes are shown in fig. 22. It was observed that the NOD results of no prism mesh were slightly asymmetric. However, both the Cp and the log10 SSM were observed to be symmetric over the vehicle. It can also be seen that the front should be displaced outwards for both cases, as observed for the baseline mesh case as well. The NOD at the rear spoiler is showing the opposite to one another, where the no prism mesh shows the best correlations with the baseline mesh. Figure 22: NOD of the car using different meshes simulated with the dissipation scheme Residual Minimization Scheme The residuals from the adjoint simulation utilizing the RMS for the mesh without prism and the coarser mesh are shown in fig. 23a and 23b, respectively. The former took around 21 000 CPU hours to simulate while the latter required around 8 600 CPU hours to finish. It was observed that the residuals drop rapidly once the RMS scheme was activated (at iteration 100) and levels out quickly afterward. 36 4 Results 100 10−1 Adj-Con Adj-xMom Adj-yMom Adj-zMom Adj-Flowrate 10−2 Residuals Residuals 100 10−3 10−4 Adj-Con Adj-xMom Adj-yMom Adj-zMom Adj-Flowrate 10−1 10−2 10−3 0 20 40 60 80 100 120 Iterations 0 (a) No prism mesh 20 40 60 80 100 120 Iterations (b) Coarse mesh Figure 23: Adjoint residuals using different mesh setups The monitored surface sensitivities for the two meshes are presented in fig. 24. It was observed that the sensitivities from the coarse mesh were leveled out while most of the obtained sensitivities from the no prism mesh were found to increase or decrease. The behaviour and magnitude from the coarse mesh correlates well with the monitored surface sensitivities from the baseline mesh. 0 6 5 5 65 100 Iterations Headlights 0 65 100 Iterations 0 7 AWA log10 SSM AWA log10 SSM 7 6 5 0 6 5 65 100 Iterations Rear Spoiler AWA log10 SSM 6 0 7 5 65 100 Iterations 65 100 Iterations Tail Lights 6 0 Roof 7 6 5 0 65 100 Iterations Rear Body 0 65 100 Iterations 7 AWA log10 SSM 5 Baseline Coarse No Prism AWA log10 SSM 6 7 Bumper 7 AWA log10 SSM 7 A-Pillars AWA log10 SSM AWA log10 SSM Side View Mirrors 65 100 Iterations 6 5 Figure 24: Surface sensitivity monitors using the RMS and different meshes. The legend in the first subplot is valid for every subplot in this figure The log10 SSM contours are presented in fig. 25 and it was observed that the sensitivity 37 4 Results similar similar for the baseline mesh and the coarse mesh. It was also observed that the sensitivity for the mesh without prism was lower on the bumper, hood and roof compared to the baseline case. Figure 25: log10 SSM for the simplified car geometry simulated with different meshes using the RMS The NOD was observed to be very similar in the front of the vehicle, as seen in fig. 26. The rear of the vehicle differed slightly whereas the case without prisms wanted to displace more of the rear outwards in a circular like fashion. 38 4 Results Figure 26: NOD of the car using different meshes simulated with RMS 4.1.3 Varying Number of Modes using RMS Three additional simulations were run with the baseline mesh to investigate if less number of modes can be used to decrease the computational time and demands. The three runs utilized 100, 200 and 400 modes and the computational time and requirement for these simulations are compared to the baseline simulation with 800 modes in table 11. As mentioned in the theory, the computational requirement is proportional to the number of modes. However, it was observed that the computational time was not proportional to the number of modes but rather have an exponential relation. Table 11: Comparison of the computational time and the RAM required for different number of modes using the baseline mesh Number of Modes 100 200 400 800 Modes Modes Modes Modes RAM [GB] Computational Time [CPU Hours] 140 280 560 1 100 1 300 2 800 7 000 23 000 The residuals from the iteration where the RMS was activated for the 100, 200, 400 and 800 mode simulations are presented in fig. 27a, 27b, 27c and 27d, respectively. It was observed that residuals leveled out in all cases. However, the residuals were found to be lower when simulations were run with a larger number of modes. 39 4 Results 100 Modes 101 Adj-Con Adj-xMom Adj-yMom Adj-zMom Adj-Flowrate 10−1 100 Residuals Residuals 100 200 Modes 101 10−2 10−3 10−1 10−2 10−3 10−4 100 105 110 115 120 125 130 Iterations 10−4 100 115 120 125 130 125 130 (b) RMS using 200 modes 400 Modes 800 Modes 101 100 Residuals 100 Residuals 110 Iterations (a) RMS using 100 modes 101 105 10−1 10−2 10−3 10−1 10−2 10−3 10−4 100 105 110 115 120 125 10−4 100 130 Iterations 105 110 115 120 Iterations (c) RMS using 400 modes (d) RMS using 800 modes Figure 27: Adjoint residuals utilizing the RMS scheme with varying number of modes with the baseline mesh The monitored surface sensitivities and the log10 SSM from the simulations with a varying number of modes are shown in fig. 28 and 29, respectively. It was observed that the surface sensitivities were very similar. More modes resulted in more stabilized sensitivities for most of the monitored surface. It was also observed, that the 400 mode data was found to result in a closer match to the 800 mode data compared to the 100 and 200 mode data. 40 4 Results AWA log10 SSM 6.5 6.0 5.5 100 115 130 Iterations 6.5 6.0 5.5 100 5.5 5.0 100 115 130 Iterations Rear Spoiler 6.5 115 130 Iterations Bumper 5.5 100 115 130 Iterations 5.5 5.0 100 115 130 Iterations Tail Lights 6.0 Roof 6.0 AWA log10 SSM AWA log10 SSM 6.0 7.0 6.5 100 115 130 Iterations Headlights A-Pillars 6.5 AWA log10 SSM 5 100 100 Modes 200 Modes 400 Modes 800 Modes AWA log10 SSM 6 7.5 AWA log10 SSM Side View Mirrors AWA log10 SSM AWA log10 SSM 7 115 130 Iterations Rear Body 6.0 5.5 100 115 130 Iterations Figure 28: Monitored surface sensitivities for each adjoint run with varying number of modes. The legend in the first subplot is valid for every subplot in this figure 41 4 Results Figure 29: log10 SSM on the surface of the car for different amount of modes It was observed from fig. 30 that the largest differences between the NOD on the surfaces of the car were at the rear of the car. The simulation with 100 modes proposed a larger displacement of the geometry in the rear of the car compared to the 800 mode case. The 200 mode case was found to be in better correlation with the 800 mode case and proposed a displacement that better fit the 800 mode case. 42 4 Results Figure 30: NOD of the surface of the car for different amount of modes 4.2 Full Car Model The Cp on the surfaces of the full car is presented in fig. 31. It was observed that a high pressure-region exists at the bumper of the car. However, this region is smaller compared to the simplified model since air flows through the upper and lower grilles and into the engine bay. A few elements stick out from the middle of the hood in the low-pressure region which was caused by the mesher but did not affect the results significantly since they were few and very small. 43 4 Results Figure 31: Pressure coefficient on the surfaces of the full car model An isosurface of the total pressure coefficient set to a value of zero is presented in fig. 32 and colored by the velocity magnitude. It can be seen that a large and unsymmetrical wake are present in the rear of the vehicle. It was also observed that there were larger regions of zero total pressure behind the mirrors and at the A and C-pillars, just as in the simulations with the simplified model. Figure 32: Isosurface with a total pressure coefficient of zero to visualize wake regions, colored by the velocity magnitude (the bottom view is from the back of the vehicle) The residuals and the monitored surface sensitivities are shown in fig. 33 and 34, respectively. The adjoint residuals were observed to oscillate and the simulation required around 52 000 CPU hours to reach 5000 iterations. The surface sensitivities did not level out and most of the monitored surfaces had values decreasing/increasing instead of stabilizing. 44 4 Results 101 Adj-Con Adj-xMom Adj-yMom Adj-zMom Adj-Flowrate Residuals 100 10−1 10−2 10−3 10−4 3000 4000 Iterations 5000 4.5 3000 4000 5000 Iterations 5.5 3000 4000 5000 Iterations Rear Spoiler 7 6 5 3000 4000 5000 Iterations Bumper 6 5 3000 4000 5000 Iterations Tail Lights 7 6 5 3000 4000 5000 Iterations AWA log10 SSM 6.5 7 AWA log10 SSM 5.5 A-Pillars AWA log10 SSM 6 3000 4000 5000 Iterations Head Lights 6.5 7.5 AWA log10 SSM 7 AWA log10 SSM Side View Mirrors 8 AWA log10 SSM AWA log10 SSM AWA log10 SSM Figure 33: Adjoint residuals of the last 2000 iterations from the full car simulation 7 Roof 6 5 3000 4000 5000 Iterations Rear Body 6.5 5.5 4.5 3000 4000 5000 Iterations Figure 34: Monitored surface sensitivities from the full car simulation The region of high residuals was observed in front of the vehicle and is shown in fig. 35. The region extends all the way from the inlet to the bumper of the vehicle. 45 4 Results Figure 35: Residual (adj-xMom) contour at the mid plane The log10 SSM on the surfaces of the full car is presented in fig. 36. It was observed that most sensitive regions were found at the A-pillars and the tail lights as well as most of the sharp and small corners and edges. Figure 36: log10 SSM on the surfaces of the full car The NOD of the full car model is presented in fig. 37. It was observed that the NOD in the front of the vehicle was asymmetric. 46 4 Results Figure 37: NOD of the surfaces of the full car 4.3 Case Study - Single Part Adjoint Optimisation The side view mirrors were analysed in more detail to verify the applicability of the adjoint method. The NOD of the side view mirrors, from the coarse mesh case that was run with the RMS, was analysed independently with an informative variable range of the legend to facilitate the visualization and interpretation of the NOD. The monitored surface sensitivity for the side view mirrors during the adjoint solution was found to oscillate with small variations each iteration. The NOD of the side view mirror is presented in fig. 38. Figure 38: NOD of the side view mirror The geometry of the mirrors was adjusted in accordance with the NOD shown above. For simplicity, the geometry change was performed by morphing the mesh in Fluent as done previously with the simplified car model but this time only with the side view mirrors. The morphing was performed without any constraints and with a relatively large displacement allowance (scaled 1:1 with the NOD values) which resulted in a maximum allowed displacement of 14 mm at the blue regions on the outside side of the mirrors. The geometry change is shown in fig. 39, where the baseline and the optimised mirror are overlapped. The red mirror is the optimised shape while the transparent grey is the 47 4 Results baseline geometry. It was observed that the projected frontal area of the optimised side view mirrors is smaller than the baseline geometry. However, the projected frontal area of the two optimised mirrors were only 1.5 % less compared to the baseline design. Hence, the projected frontal area of the whole vehicle remains more or less the same since the mirrors are fractions of the total projected frontal area of the car. Figure 39: Geometry change between the baseline shape (colored in transparent grey) and the optimised shape (colored in red) The ∆CD A of the whole car decreased significantly and is presented in table 12. The drag force on the mirrors decreased 22.75 % compared to the baseline design. Table 12: Actual and predicted values of ∆CD A for the baseline car compared to the baseline car with morphed mirrors Case Actual ∆CD A [%] Predicted ∆CD A [%] Baseline Car Car with Optimised Mirrors -0.62 -0.83 A comparison of the static pressure coefficient and an isosurface with a total pressure coefficient of zero for both the baseline geometry and the optimised design are presented in fig. 40 and 41, respectively. It was observed that the pressure region in front of the mirror was larger with the baseline geometry compared to the optimised design. Additionally, it was observed from fig. 41 that the region of the wake was smaller for the optimised design compared to the baseline design. 48 4 Results Figure 40: Comparison of the pressure coefficient on the side view mirror between the baseline and optimised shape Figure 41: Comparison of isosurface with a total pressure coefficient of zero around the side view mirror between the baseline and optimised shape colored by the velocity magnitude 49 5 5.1 Discussion Potential & Applicability of the Adjoint Solver The potential of the adjoint solver was investigated both by performing a literature study as well as CFD and adjoint simulations. The adjoint results in the literature review give the impression that it has great potential and is widely applicable to different simplified geometries for external aerodynamic flow. However, as mentioned, the details regarding the adjoint method in these studies were very vague and it would not be possible to recreate any simulation setup. Hence, several adjoint simulations were run with different settings to further examine the potential and applicability of the adjoint solver. It was found that running adjoint simulations were more difficult than initially thought, especially after going through the previous studies which make the adjoint simulation procedures look very straight forward. However, it was found that Fluent’s adjoint solver is applicable to external aerodynamic simulations to a certain extent and is discussed further in section 5.2 and its following subsections. The adjoint solver was found to provide sensitivities of the surfaces as well as NOD recommendations. This is valuable information which can be used to optimise the car in unexpected locations and directions. The adjoint optimisation method is preferred over other optimisation methods such as design of experiment since there are no specific parameters and/or dimensions of the shapes but rather free-form surfaces. The biggest limitations of the adjoint solver is the frozen turbulence assumption and the fact that the adjoint equation is linearized, as explained in the theory chapter. It is important to take these factors into consideration when working with the adjoint solver. The adjoint solver cannot predict sensitivities and design changes which are affected by turbulence, such as in separated flow regions, as accurate as in attached flow regions. The adjoint solver together with the design tool cannot predict too large design changes due to the linearization of the adjoint equation. Hence, it is important to make small changes to the geometry after each adjoint solution to ensure an improvement of the observable. Two other factors that need to be taken into consideration when using the adjoint tool is the visual design of the vehicle as well as manufacturability and cost of the parts. However, these factors always have to be considered and might be more important to keep in mind if the geometry is morphed rather then manually changed. The linear nature of the adjoint equation is one of the main reasons for the convergence problems that were experienced. Any instabilities introduced during the solution due to either physical (flow separation or regions with localized transient behavior) or numerical (poor mesh quality or discretization) will grow exponentially without any stabilization scheme and is difficult to converge. It can be compared to the governing equations which are non-linear and can limit the growth of instabilities which results in a smoother convergence. This is the reason why the convergence of the primal flow field is more stable and easier to converge than the adjoint equation. The instabilities were however limited by the use of stabilization schemes which are discussed in section 5.2. Two other factors that 50 5 Discussion were found, from both the literature review and the simulations in this study, to have a considerable effect on the adjoint convergence were the mesh quality and mesh resolution, which is further discussed in section 5.2 and its following subsections. 5.2 Adjoint Method Several adjoint simulations were performed to find settings that resulted in both converged and diverged solutions. The diverged solutions were not presented but will be discussed briefly in this paragraph to make the reader aware of some of the adjoint solvers limitations in regards to settings. The solution-based control-initialization and the auto-adjust controls features seemed to be useful tools as explained in the theory but were found to diverge the solution, which was also found in the literature review. The auto-adjust controls feature decreased the ACN continuously until the solution diverged. As seen in the results from the dissipation scheme (see e.g. fig. 11a), the residuals bounce which can be an indication of a too large ACN, as mentioned in the theory chapter. Hence, the auto-adjust control correctly decreased the ACN but to a level where the solution blew up. The adjoint solver had to be run with first order discretization, as recommended in the theory and literature review, due to instabilities of second order schemes. The schemes were set to be the same in the adjoint solver as used in the primal solver as far as possible. However, the momentum discretization had to be set to first order even though the second order was used in the primal flow field simulation. This results in a slight distortion of the adjoint results. However, the value of the observable in the adjoint solver was always compared to the value of the observable through Fluent’s report definition to make sure it was sufficiently accurate. The difference was never more than 5 % throughout the study (usually around 1-2 %) and experiences from Oliver Zühlke et al [22] and ANSYS [23] have shown that reasonable and useful results are still possible to achieve with different discretization schemes. Even if the exact same schemes are used, it is not certain that the values from the adjoint and report definition are exactly the same since the evaluation of the observable is not identical as explained and showed in [33, 36]. When coupling the adjoint solver to an aerodynamic automotive analysis it is important that the user has experience in CFD or preferably automotive aerodynamics without blindly trusting the results from the adjoint solver. The only observable in this study was set to be the drag force which implied that the adjoint solver did not take lift into consideration at all. Hence, it is important that the user has experience or knowledge about how a certain design change would change the lift forces and balance of the car. In addition, it is always recommended to run a verification simulation of the adjoint prediction to realise the actual performance increase/decrease before any design decisions are taken based on only the sensitivities or the NOD. As mentioned in the theory the adjoint solver is based on one primal flow field. Hence, it is crucial that this primal flow field does not oscillate for the adjoint to produce reliable results. If it does, different results might be obtained depending on when the primal solution is stopped. If the primal solution oscillates, it is considered important to locate the region(s) of transient behaviour to judge if it can have an impact on the surfaces of interest for the adjoint optimisation. The primal solutions in this study had, as mentioned, a much lower standard deviation of CL and CD than 0.003 and was not considered to affect 51 5 Discussion the adjoint solution. However, it is important to keep this in mind when using the adjoint solver in the future for other cases. 5.2.1 Convergence Assessment The convergence assessment of the adjoint simulations were found to be one of the most difficult parts of the study and has not been presented, discussed or investigated in the previous studies that were reviewed. This made the author question the trustworthiness of these studies. The adjoint residuals give a good indication of the solution advancement but can be misleading. The use of a monitor script increases the information about the solution advancement both during and after the simulation and makes it easier to track the sensitivities on surfaces of interest. As mentioned and shown previously (see fig. 12), an adjoint wake can be present in front of the vehicle due to a backward calculation of the adjoint field. The adjoint wake can be resolved with a finer grid but that would increase number of elements and the computational time significantly and is not necessary. Instead, the regions of high residuals can be located using UDM’s to make sure that they are away from the surface(s) of interest, the one(s) that are about to be re-designed. It was also considered important to look at the adjoint result and compare it to the primal solution and use engineering judgment to deem if the adjoint results are reasonable. As a side note, if any geometry is about to be simulated with the intention of a following adjoint simulation it is important to split the PIDs of the surfaces according to the users preferences prior to the primal simulation so that these surfaces of interest can be monitored (this cannot be changed in Fluent afterward). Since reasonable results were obtained from several adjoint simulations in this study, it proves that the adjoint residuals do not always have to be very low to provide useful information. Also, even though all surface sensitivities were not fully leveled out but oscillating with small variations, it was still possible to adjust the geometry accordingly to the NOD and obtain less drag. If the sensitivities are oscillating, the most optimal design change cannot be predicted but it will still most probably be an improvement compared to the baseline geometry. 5.2.2 Stabilization Schemes and meshes Stabilization Schemes A stabilization scheme was required due to the complex geometries and large separation regions to avoid exponential instability growth caused by the linear nature of the adjoint equation as previously explained. The two schemes investigated in this study were the dissipation scheme and the RMS together with different types of meshes. The RMS scheme was found to be very effective and rapidly reduced the residuals (see e.g. fig. 11b). However, the RMS was very computationally expensive in terms of RAM and was relatively time-consuming depending on the size of the mesh and the number of modes. The number of modes is directly related to the convergence of the solution and it was found that 400 modes were sufficient and resulted in roughly the same results as the case with 800 modes for the simplified case with the baseline mesh as seen from fig. 28, 29 and 30. By lowering the number of modes from 800 to 400 the computational time decreased by a factor of 3 and the required RAM by a factor of 2. The number of modes is expected to be geometry and 52 5 Discussion mesh dependent and has to be changed depending on the case. Different geometries and meshes will result in different regions of physical instabilities (separation and localized transient behaviour). However, the results from this study provide an indication and background for a reasonable initial guess of the number of modes for other similar cases. It is recommended that the adjoint simulation runs initially with the dissipation scheme, as done in this study with 100 iterations, before activating the RMS. It is not necessary to run exactly 100 iterations but a number of iterations is required for the RMS to work effectively. The most important thing is that the adjoint solver does not diverge rapidly during these initial iterations. If it does, the RMS should be activated as soon as possible, as explained in the theory chapter [16]. The dissipation scheme had to be run using first order damping since the second order damping was found to result in a diverged solution. This was an issue since, as mentioned in the theory chapter, it is important to run the adjoint solver with a second order dampening scheme to avoid distortion of the adjoint solution. However, due to the instabilities, the order of dampening had to be set to the same order as the pressure and momentum scheme which resulted in a higher influence on the solution. The adjoint simulations utilizing the dissipation scheme still seemed to result in a converged solution for the simplified model if used with first order dampening. However, several of the monitored surface sensitivities were found to have an increasing/decreasing advancement behaviour or were found to oscillate compared to the monitored sensitivities using the RMS which were much more stable. The dissipation scheme utilized with the baseline mesh was initially run with 5 000 iterations as shown in Figure 11a and 13. However, it was later run for an additional 10 000 iterations to see if the increasing/decreasing advancement behaviour of the sensitivities kept increasing/decreasing or if they eventually leveled out. The adjoint momentum residuals were found to remain stable while the continuity adjoint residual were found to oscillate below 1E-4. The adjoint flow rate residual were found to slowly increase but was still lower then the adjoint momentum residuals. All monitored sensitivities that previously were increasing/decreasing did not level out during these 15 000 iterations but started oscillating randomly instead. A few of the monitored surfaces that seemed to have leveled out after 5 000 iterations were found to oscillate during the additional iterations. This is another reason for why the RMS is preferred over the dissipation scheme with a first order dampening. This is probably also the case for the adjoint simulations with the dissipation scheme with the no prism and coarse mesh but they were not run for additional iterations due to the long simulation time. However, it can be seen from fig. 20 when looking at the roof sensitivity for the coarse mesh that it seems to be stable after a while but later, after around 2 500 iterations, started to show an unsteady behaviour. Mesh The mesh investigations were initiated due to all the instabilities and convergence issues that occurred in the beginning of this study and since other studies (see literature review) found that a coarse mesh can help improve the convergence while maintaining sufficient accuracy [1, 25]. However, the previous studies have only utilized the dissipation scheme without any further information regarding specific settings. The simulations with the coarse mesh was faster due to the lower element count and it was found that the convergence was much smoother for the simulations with the dissipation scheme (see fig. 19a and 19b) compared to the baseline (see fig. 11a and 11b). The smoother convergence can 53 5 Discussion be attributed to less small regions with localized transient behavior. However, the results from the coarse mesh using the dissipation scheme did not correlate well with the baseline mesh. On the other hand, the RMS results with the coarse mesh showed a good correlation with the baseline. Hence, having a reduced mesh resolution can greatly help the adjoint convergence since the calculation is more diffused but it is important to be careful to avoid mispredictions. A coarse mesh with fewer instabilities allows for fewer modes if the RMS is utilized which results in even faster computations. It seems reasonable to use a coarser mesh together with the RMS as the stabilization scheme but the required mesh resolution is expected to be very case dependent (just as the mesh for primal flow fields for different cases) and has to be decided by the user for the specific case. The mesh without prism layers was run with the same near wall treatment as the other two cases. The first cell height without prism layers was much larger but still with a y + within the logarithmic layer. Due to the differences in the mesh and mesh quality, compared to the baseline, different results were obtained even though the same settings were used (as seen in fig. 21, 22, 25 and 26 as well as in the sensitivity monitors in fig. 20 and 24). The results were expected to be more similar and can possibly be attributed to the adjoint solver’s sensitivity of the input. The most important finding was not necessarily the results in relation to the baseline but rather how different the convergence was with a mesh of improved quality. Even though the convergence of this simulation was much smoother oscillations were still present. It is important to remember that the adjoint solver is based on the results of the primal flow field. Hence, the most important thing to consider is to have a mesh that results in a sufficiently accurate primal flow field. Secondly, it is highly recommended to have a mesh of as good quality as possible but not at the cost of accuracy by removing prism layers. Thirdly, a coarse mesh can be used together with the RMS depending on the case but it is suggested to avoid coarse meshes for the dissipation scheme. The mesh recommendations from Fluent is only recommendations and both the primal flow solver and the adjoint solver can reach convergence even with a quality that is worse. However, it is as mentioned preferred to have a mesh of as good quality as possible. Full Car Model If the adjoint initialization is performed without fully compatible primal settings two types of messages can appear. The first type of message is a warning message about settings that are not supported such as porous zones. However, the adjoint solver can still initialize and run by automatically changing the settings to corresponding supported settings during the calculation. As a result, the adjoint field might be inaccurate around these regions and the sensitivities should be treated and evaluated carefully [16]. The second type of message is an error message which completely stops the initialization. The immediate stop occurs due to reasons such as the use of unsupported boundary conditions or turbulence models. Both of these messages appeared prior to the adjoint simulation of the full geometry. The warning messages appeared due to the porous zones of the heat exchangers inside the grille. The error message was due to the use of ’radiator’ boundary conditions of preamble surfaces in the domain which were used to measure mass flow rate and pressure. These ’radiator’ boundaries are not supported and were changed to an ’interior’ type of boundary condition which still is a 100 % preamble boundary. The next flow simulation can either be run again with the original setup by reverting the interior boundaries to 54 5 Discussion radiator boundaries to allow for a fair comparison between the two designs. The radiator boundary conditions and the interior boundary condition are both preamble boundaries in this study since the solver is run without the energy equation. However, they were found to produce slightly different results when two cases were run with exactly the same settings except for these preamble boundaries. Hence, it is important to use the same boundary conditions in both the primal flow field and the verified simulation. This is not an issue if the geometry is changed manually outside of Fluent and set to be re-mesh and re-solved. However, if the geometry is morphed in Fluent and re-run directly, it is important to revert to the original settings. The post processing was performed in Ensight and the solution values at the interior surfaces cannot be exported to Ensight which was the reason for the usage of the radiator boundary in the first place [37]. From the adjoint solver’s point of view, data from these preamble surfaces are not of interest and mass flow rate and pressure at the surfaces can still be obtained from Fluent. Hence, if a primal simulation is run with the intention of a following adjoint simulation, it is recommended to run them both using the interior preamble boundary. The full geometry model had to be run with the dissipation scheme since it was found to be too computationally expensive in terms of RAM to run it with the RMS. The residuals were very unstable and it was found that after 5 000 iterations, which took approximately 52 000 CPU hours, that the residuals were still oscillating (see fig. 33). In addition, most of the monitored sensitivities did not level out (see fig. 34). An adjoint wake was found to be present in front of the vehicle as in the simplified case. However, the wake in the full model was larger and much closer to the vehicle as seen in fig. 35. High residuals were found at the grille and the front bumper of the car. The cause of the is most likely due to two reasons. The first reason is that the grille was open and the engine bay was included in the simulation which increases the number of local instabilities. The second reason is the use of porous media. As mentioned above, a warning message appears when porous media is used in the adjoint solver. This decreases the quality of the results and could be a reason for the higher residuals. Both of these reasons together with the fact that the car is unsymmetrical inside the engine bay can be attributed to the non-symmetric result of the NOD in the front of the full car (see fig. 37). Another fact that is important to remember is that the NOD was not calculated during the adjoint solution but in the ’Design-Tool’ which can produce inaccurate results depending on the input. However, that was not likely to be the reason in this case. A possible third reason can be that the maximum skewness of the mesh was very close to 1 which can cause numerical errors. However, it is worth to note that the simplified model also ran with the coarse mesh which was of equal quality and reached convergence. 5.2.3 Robustness The adjoint solver relies upon an accurate primal flow solution to be able to provide useful results. Hence, as mentioned, the solver settings were kept similar to CEVT’s methods for external aerodynamics. Several different settings such as Fluent’s pseudo transient calculation as well as non-equilibrium wall treatment were also tested using the simplified model to ensure that the adjoint solver was compatible and converged to reasonable results. In addition, a simulation was also performed with an even finer mesh near the wall with a y + ≈ 1 using the RKE model with enhanced wall treatment. The adjoint solution advancement in all these simulation were similar to the baseline case seen in this study and therefore not showed in the results. The results from the adjoint solver were slightly 55 5 Discussion different compared to the baseline case since the results from the primal flow field were different. However, not significantly and unexpectedly different which implies that the adjoint solver can be run using y + ≈ 1 meshes as well as different near wall treatments. These simulations with other settings were run with the RMS as the stabilization scheme to ensure robustness of the adjoint solver. 5.2.4 Single Part Adjoint Optimisation The single part adjoint optimisation was performed with only the side view mirrors in focus as a typical application of the adjoint solver. The adjoint simulation was still run for the whole car to get a flow field around the car and the mirrors as realistic as possible to achieve accurate adjoint predictions. Hence, the adjoint results were taken from the RMS simulation of the coarse model with 800 modes and were further analysed. This case was chosen due to the stable monitored sensitivity of the mirrors and for the fast computations of the coarser mesh since it was found to be a relatively close match to the baseline case. Since a single part was analysed, it was important to change the variable range of the legend to highlight the NOD changes as shown in fig. 38. This value of the NOD will obviously vary from part to part and case to case depending on the surface(s) in focus. The geometry was changed according to the results from the NOD contour and the case was re-run to verify that the adjoint results and prediction was correct and gave an improvement of the baseline design. As mentioned, the geometry was morphed in Fluent and there were several reasons for this. First of all, it was much easier to adjust the geometry in accordance with the NOD using a morpher since it is based on the NOD results. Secondly, using a more or less identical mesh allowed for a fair comparison between the two designs by reducing mesh induced differences of the results. Thirdly, the whole process was rapid and the simulation of the morphed geometry continued from the previous primal flow field which significantly decreased the simulation time. The time required to morph the mirrors and re-run the flow field for the whole car was approximately one-fifth of the time required to re-mesh and run the simulation from the beginning again. Note that this is excluding the time required to do the actual geometry change manually in ANSA, or any other software that allows manually geometry change, which would increase the required time even further. The improvement found from the mirror optimisation was significant, both by analysing the difference in force on the mirrors themselves as well as the total CD A of the whole car (see table 12). The proposed design change of the mirrors was partly unintuative but was found to decrease the drag force significantly. It was found that the design changes of the mirrors resulted in a reduced region of high-pressure region in the front of the mirrors as well as a smaller wake behind the mirrors. It is important to highlight that these design changes are not fully realistic since no constraints were set on the glass of the mirrors prior to morphing. However, the glass of the mirrors are located in the wakes and were not in contact with any attached flow. Hence, this design change is a cause of the frozen turbulence assumption and was not expected to have a large influence of the results. If the user would like to morph the mirrors and constrain the glass or any other surface of the model it is recommended to split these surfaces into different PID regions to be able to select them separately in Fluent’s design tool. However, this is not necessary if the design is changed manually. 56 5 Discussion The monitored surface sensitivity of the mirrors was relatively stable but with small oscillations. It was found that the adjoint optimisation was successful even though the sensitivity was not fully steady. Hence, the adjoint tool can be used on surfaces that have small sensitivity oscillations. The most optimal design might not be predicted/obtained but an improvement can still be expected as long as the design is not close to a local optimum [20]. Reaching or advancing to a shape close to the local optimum requires several adjoint optimisation loops due to the linearization that limits displacement magnitude of the design change each iteration. This type of optimisation, where one part/surface of the car is analysed at time, can be applied to different parts with the use of a single adjoint simulation of the full car. However, one calculation in the design tool has to be performed per part/surface to obtain an informative NOD map of the part/surface. 57 6 Conclusion Fluent’s discrete adjoint solver has been investigated and evaluated with regard to external aerodynamic flow simulations by performing a literature study as well as CFD and adjoint simulations. It was found that running 3D adjoint simulations around ground vehicles are more complicated than it seems from previous studies. It was concluded that the gradientbased adjoint optimisation is a powerful tool that is applicable for external aerodynamic analysis to a certain extent. A CFD-method with guidelines to run external 3D adjoint simulations for aerodynamic analysis was developed by investigating different adjoint solver settings such as advancement settings and stabilization schemes together with different meshes. It is recommended to use the RMS stabilization scheme and preferably with a baseline mesh instead of a coarser mesh. However, a coarse mesh can be used in some cases when the adjoint solver has trouble converging due to localized transient behaviour. The mesh quality was found to be of great importance and it is recommended to run the adjoint solver with a mesh of as high quality as possible. It was also found that the adjoint solver has to run with first order discretization schemes for stability reasons. It was concluded that it is very important to monitor surface sensitivities during the solution in addition to the adjoint residuals to assess convergence of the adjoint simulation. Even if the adjoint residuals are relatively high and sensitivities slightly oscillating it is still possible to achieve an improved design, if the initial design is not already close to the Pareto front. It is also recommended to analyse regions of high residuals in the domain to ensure that they are far away from the surface(s) of interest. It was found that a simplified model of a fully detailed car geometry is necessary to reduce the complexity and the resolution of the mesh to be able to use the RMS and to avoid local instabilities. A proposed CFD and adjoint procedure is presented in Appendix A as a flowchart together with a list of comments and guidelines to each step. It was also concluded that it is important that the engineer who analyse the adjoint results have previous experience or knowledge in the field of CFD and preferably automotive aerodynamics in order to gain an advantage over the conventional aerodynamic development process. 58 7 Future Work The adjoint solver together with a robust, reliable and versatile mesh morphing method can reduce the computational time per design loop further by eliminating the need for manual re-design, re-meshing, and re-solving of the primal flow field. It would also allow for more fair comparisons between different designs since the mesh is more or less the same except for the morphed region(s). If implemented, it is important to consider the surface and mesh quality after each morph to avoid rough surfaces and poor quality meshes that can lead to increased numerical errors. It is also important that the morphing method has functionalities to add constraints, both external and internal, to add limits of surfaces that cannot be exceeded and to restrict the morphing from occupied spaces due packaging of other details such as electronics in the side view mirrors as an example. However, the process cannot be fully automated to run a certain number of design iterations due to two reasons. Firstly, the adjoint solver only takes drag force into consideration (lift and balance of the car are not included). Secondly, the exterior design and visual look of the vehicle have to be approved by a designer/design team. It is proposed that the developed method is revised in a few years if the adjoint solver in Fluent is improved and the available computational resources most probably increased. The adjoint solver is, as of now, continuously updated with new features, tweaks and stabilization schemes for robustness and accuracy. Hence, it might be possible to run more complex models once it is computationally faster and more robust. 59 References [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] Inc. ANSYS. “Shape Optimization for Aerodynamic Efficiency Using Adjoint Methods”. In: ANSYS White Paper (2016). Carsten Othmer. “Adjoint methods for car aerodynamics”. In: Journal of Mathematics in Industry 2014,4:6 (2014). T. et al Blacha. “Application of the Adjoint Method for Vehicle Aerodynamic Optimization”. In: SAE Technical Paper 2016-01-1615, 2016, doi:10.4271/2016-01-1615 (2016). L. Pitillo lng F. et al. Francesconi lng. G. Miretti L. Lorefice. “Application of Adjoint Methods on Drag Reduction of Current Production Cars”. In: SAE Technical Paper 2018-37-0016, 2018, doi:10.4271/2018-37-0016 (2018). Felipe Magazoni et al. “Aerodynamic Shape Improvement for Driver Side View Mirror of Hatchback Vehicle using Adjoint Optimization Method”. In: SAE Technical Paper 2015-36-0156, 2015 (2015). G. Petrone, D.C.Hill, and M.E.Biancolini. “Track by Track Robust Optimization of a F1 Front Wing Using Adjoint Solutions and Radial Basis Functions”. In: (2014). William F. Milliken and Douglas L. Milliken. Race Car Vehicle Dynamics. SAE, 1995. John J. Bertin Russel M. Cummings. Aerodynamics for Engineers. sixth. Pearson Education Limited, 2014. Wolf-Heinrich Hucho. Aerodynamics of Road Vehicles. Butterworth-Heinemann, 1987. United States Committee on Extension to the Standard Atmosphere. U.S: Standard Atmosphere, 1976. National Oceanic and Amospheric [sic] Administration : for sale by the Supt. of Docs., U.S. Govt. Print. Off., 1976, 1976. H K Versteeg and W Malalasekera. An Introduction to Computational Fluid Dynamics. Vol. 2. Pearson Education Limited, 2007. Lars Davidson. Fluid mechanics, turbulent flow and turbulence modeling. Division of Fluid Dynamics, Department of Applied Mechanics Chalmers University of Technology, 2018. ANSYS. ANSYS Academic Research Mechanical, Release 19.2, Help System, Fluent Theory Guide. 2019. Lars Davidson. An Introduction to Turbulence Models. Department of Thermo and Fluid Dynamics Chalmers University of Technology, 2017. Tsan-Hsing Shih et al. A New k- Eddy Viscosity Model for High Reynolds Number Turbulent Flows. Computers Fluids Vol. 24, No. 3, pp. 227-238. 1995, 1995. ANSYS. ANSYS Academic Research Mechanical, Release 19.2, Help System, Fluent User’s Guide. 2019. ANSYS. ANSYS Academic Research Mechanical, Release 18.2, Help System, CFX, Modeling Guide. 2018. S. Hoyas and J. Jimenez. DNS data of fully developed plane turbulent channel. 2014. url: https://torroja.dmt.upm.es/ftp/channels/data/statistics/ (visited on 03/14/2019). ANSYS. ANSYS Fluent Advanced Add-On Modules. 2016. 60 References [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] ANSYS Inc. How to use the Residual Minimization stabilization Scheme (RMS) that is part of the ANSYS Fluent Adjoint Solver? 2019. url: https://support.ansys. com/AnsysCustomerPortal/en_us/Knowledge+Resources/Solutions/FLUENT/ 2058985 (visited on 05/22/2019). Siva K. Nadarajah and Antony Jameson. “A Comparison of The Continuous and Discrete Adjoint Approach to Automatic Aerodynamic Optimization”. In: (1999). Oliver Zühlke et al. ANSYS Adjoint Solver Best Practice Guide. 2015. ANSYS Inc. ANSYS Solution 2059054: What is the effect of different discretization schemes for flow and adjoint solver in ANSYS Fluent? 2019. url: https : / / support . ansys . com / AnsysCustomerPortal / en _ us / Knowledge + Resources / Solutions/FLUENT/2059054 (visited on 05/02/2019). ANSYS Inc. ANSYS Solution 2053148: How to create a monitor for ANSYS Fluent adjoint sensitivities? 2018. url: https://support.ansys.com/AnsysCustomerPortal/ en_us/Knowledge+Resources/Solutions/FLUENT/2053148 (visited on 05/02/2019). ANSYS Inc. ANSYS Solution 2043518: How to use Adjoint Solver to large size models (>30 M cells). 2016. url: https://support.ansys.com/AnsysCustomerPortal/ en_us/Knowledge+Resources/Solutions/FLUENT/2043518 (visited on 05/02/2019). ANSYS. ANSYS Fluent Release Notes 19.2. 2018. Y. Saad and M. H. Schultz. “GMRES: A Generalized Minimal Residual Algorithm for Solving Nonsymmetric Linear Systems”. In: SIAM J. Sci. and Stat. Comput. 7(3) (1986). Joel H. Ferziger and Milovan Perić. Computational Methods for Fluid Dynamics. third. Springer, 2002. ANSYS. ANSYS Fluent Adjoint Lecture 03: Solver Settings. 2019. Athanasios Tzanakis. “Duct optimization using CFD software ‘ANSYS Fluent Adjoint Solver’.” In: Chalmers Publication Library (2014). A Wade, M Keating, and G Petrone. “Shape optimisation for aerodynamic performance using adjoint methods”. In: (2014). Christian Bach Rasmussen and Lasse Mose Lund. “Race Car Aerodynamic Design and Optimization via CFD and the Discrete Adjoint Method”. In: Aalborg Universitetet: Det Digitale Projektbibliotek (2018). ANSYS Inc. ANSYS Solution 2058309: The computed value of my adjoint observable for the adjoint solver is different from the value computed by a standard Fluent report definition for the same quantity. What could be the reason for this? 2019. url: https://support.ansys.com/AnsysCustomerPortal/en_us/Knowledge+ Resources/Solutions/FLUENT/2058309 (visited on 05/02/2019). ANSYS Inc. ANSYS Solution 2042189: What are the mesh requirements for the Fluent Adjoint Solver? 2016. url: https://support.ansys.com/AnsysCustomerPortal/ en_us/Knowledge+Resources/Solutions/FLUENT/2042189 (visited on 05/02/2019). Sharc. Harpoon Meshing Guidelines. 2019. url: www . sharc . co . uk / downloads / guidelines.pdf (visited on 04/24/2019). ANSYS Inc. "ANSYS Solution 2055725: What does this warning mean? Warning: Gradient scheme is used that is not consistent with adjoint calculation: Least Squares Cell Based". 2019. url: https://support.ansys.com/AnsysCustomerPortal/en_ us/Knowledge+Resources/Solutions/FLUENT/2055725 (visited on 05/02/2019). Martin J. Faber ANSYS. EnSight 10.2 Basic Training. 2017. 61 A Adjoint Procedure A proposed and recommended adjoint procedure for 3D external aerodynamic simulations are presented below as a flowchart, see Figure A.1, together with explanatory steps from 1-10. It is not recommended to blindly use this flowchart guide. Instead, use it as a compliment and summary of the results and conclusions obtained in this study. 1) Pre-processing by setting up the specific PID’s. Important to note that all surfaces that are about to be monitored require a separate PID. All surfaces that might be morphed and constrained in Fluent also requires a separate PID. Set up the adjoint surface monitor scripts to match the PID’s. It is also possible to monitor the sensitivities of the surfaces manually but that is very time-consuming. Hence, a monitor script is highly recommended. It is also recommended that the geometry is as simplified as possible but still representative for the full geometry. 2) Create a mesh (as good quality as possible). A coarse mesh can be used together with the residual minimization scheme but it is recommended to run the adjoint solver with a mesh that generates an accurate solution of the primal flow field at first. 3) Run the primal flow field and make sure that the primal flow solution converges and shows the expected results. Since only one primal flow field is used for the adjoint solver it is important that the primal solver is as steady as possible for the adjoint to produce reliable results. If large oscillations are present in the primal flow solver, locate them and see if they are close to the surfaces of interest for the adjoint optimisation. 4) Run the adjoint solver for 50-100 iterations using the dissipation scheme with the settings shown in Table 5 and 6. Change to the RMS stabilization scheme with the settings (or similar settings) found in Table 7 and run the simulation to convergence (∼15-30 iterations). It is recommended to run everything from a journal and include the monitor scheme script. If the monitor script is used, run at least 5 iterations before activating it. Set the number of modes depending on the geometry and number of elements in the mesh. Run the adjoint solver with first order schemes and preferably with the same type of schemes that were used in the primal flow field. 5) Analyse the monitored data as well as the adjoint residuals. If the residuals and the sensitivities of interested leveled out, move on to the design tool. If not, locate the problematic region, if possible, by storing the residuals in UDMs and visualize them using cell registers in Fluent or export the UDMs and visualized them in Ensight. A more stable solution will be obtained if the number of modes is increased, the quality of the mesh is improved, the resolution of the mesh is decreased or if the geometry is simplified even further to avoid local instabilities. It is recommended, if possible, to simplify the geometry since the computational time increases exponentially with A1 A Adjoint Procedure more modes. 6) Run the design tool to obtain NOD data for the specific surface(s) to be analysed/changed. The design tool parameters should be similar to the ones found in Table 8. However, the scaling factor and the number of motion points have to be changed depending on the surface(s) of interest. Export the desired data to the post-processing tool at this point if necessary. 7) Re-design the surface(s) or morph the mesh. If the geometry is changed manually, re-meshing is required. 8) Verify the adjoint results by running the primal flow solver with the new design. If the geometry was morphed, continue the primal flow solver from the previous simulation (saves a lot of time!). 9) Continue the adjoint optimisation either by analysing another part/surface of the vehicle from the same adjoint simulation by selecting the part/surface in the design tool. Or, by running another adjoint simulation to make an additional design iteration on an already optimised part/surface (if several design iterations are performed, the adjoint solver can also be re-run from the previous iteration to save computational time if the geometry was morphed). 10) End of adjoint optimisation. A2 No A Adjoint Procedure No 1) Pre-Processing 2) Mesh 3) Run Primal Flow Solver 4) Run Adjoint Solver No 5) Residuals & Sensitivities ok? Yes 6) Calculate NOD Using Design Tool 7) Change Geometry OR Morph Mesh 8) Run Primal Flow Solver To Verify the Results 9) Keep Optimising? Yes No 10) End of Adjoint Optimisation Figure A.1: Adjoint procedure presented as a flowchart A3