1 Introduction

The use of computational methods for design and optimization is a topic of great interest in various engineering fields, such as aeronautics (Schmidt et al. 2013; Keanway and Martins 2016), thermal and hydraulic turbomachinery (Wang et al. 2010; Mueller et al. 2012), and the automotive industry (Othmer 2014). In computational fluid dynamics (CFD)-based optimization for large scale real-world applications, gradient-based methods are coupled with the adjoint approach (Jameson 1988; Giles and Pierce 1997) for computing the sensitivity derivatives, i.e., the gradient(s) of the objective function(s) with respect to (w.r.t.) the design variables. Adjoint methods may compute all gradient components at a computational cost which is independent of their number and more or less equal to that of the numerical solution of the primal (flow) problem.

A review of possible usages of adjoint methods for automotive applications can be found in Othmer (2014). Internal aerodynamics are an ideal field of application due to the absence of aesthetic constraints, with adjoint-based topology optimization being extensively utilized for the preliminary design of exhaust systems (Hinterberger and Olesen 2010, 2011), engine intake ports (de Villiers and Othmer 2012), and heating, ventilation, and air conditioning (HVAC) ducts (Papoutsis-Kiachagias and Giannakoglou 2016). Intake ports and in-cylinder flows have received a lot of attention, by applying shape optimization (Verma et al. 2018; Kubota et al. 2016) or a combination of topology and shape optimization (Tokuda et al. 2013), usually targeting a reduction in total pressure losses and an increase in tumble moment. The combination of sequential topology and shape optimization has also been reported for the design of exhaust manifolds (Hopf et al. 2017), improving mass flow rates and flow efficiency. In addition, the shape of HVAC systems has been optimized based on adjoint methods for defrosting and demisting, without Germanou et al. (2016) and with Najian Asl et al. (2017) packaging constraints, with the latter publication combining a node-by-node shape update and a multi-constraint projection algorithm to deal with packaging limitations. Adjoint-based optimization of multi-disciplinary problems has also been conducted (Gkaragkounis et al. 2018), by developing the adjoint to conjugate heat transfer problems and applying it to minimize the maximum temperature of internally cooled cylinder heads. Regarding shape modifications, the adjoint method is employed to compute the so-called sensitivity maps (Papoutsis-Kiachagias and Giannakoglou 2016; Blacha et al. 2016), i.e., the derivatives of the objective function w.r.t. the normal displacement of boundary wall nodes. Sensitivity maps can be a very useful tool for designers, since they offer insight into the car areas with great optimization potential and mark the direction of favorable surface displacement. Even though shape optimization in external aerodynamics suffers from the difficulty of mathematically formulating and taking aesthetic constraints into consideration, a number of adjoint-based shape optimization applications has been presented during the last few years. Most of them aim at minimizing the drag force exerted on the car surface, by using a number of parameterization techniques such as the direct displacement of the boundary wall nodes (Hojjat et al. 2014), RBF-based morphing (Papoutsis-Kiachagias et al. 2015b), and free form deformation techniques (Han et al. 2016; Papoutsis-Kiachagias et al. 2015a), with the latter article targeting the reduction of the noise perceived by the driver through a surrogate aeroacoustic objective function. Most of the abovementioned applications of the adjoint method to problems of the automotive industry rely on the continuous adjoint variant. Recently, He et al. (2018) developed a discrete adjoint to the OpenFOAM CFD toolbox and used it, among others, to optimize a simplified version of the DrivAer model under geometric constraints. A comparison of continuous and discrete adjoint solvers is beyond the scope of this article.

The purpose of this article is twofold. The first goal is to present the continuous adjoint formulation for aerodynamic shape optimization, with a part of the mathematical development regarding the computation of sensitivity derivatives (SDs) being analytically developed for the first time in the literature. In specific, the paper presents the continuous adjoint method for the automated aerodynamic shape optimization of complex geometries, implemented in the open-source CFD toolbox OpenFOAM. Within each optimization cycle, this software performs the solution of the flow and adjoint equations, the computation of SDs, the update of the design variables parameterizing the geometry and the CFD grid adaptation to the new boundaries. Regarding the computation of adjoint-based SDs, formulations using exclusively boundary or field and boundary integrals are utilized (the so-called E-SI and FI adjoint formulations (Kavvadias et al. 2015)), depending on the number of design variables. The adjoint development corresponding to the SD terms resulting from the differentiation of the Reynolds-averaged Navier–Stokes (RANS) variant of the Spalart–Allmaras turbulence model partial differential equation (PDE) using the FI approach is presented for the first time in the literature. The impact of these terms is, then, evaluated through a comparison with finite differences (FDs) in the Ahmed body geometry (Ahmed et al. 1984), a typical benchmark case of the automotive industry. The second goal of this article is to apply this method and software to the optimization of the “FP01” concept car designed by the Toyota aerodynamics department. The concept car represents a study of a visionary vehicle in line with the Toyota self-imposed challenge of reducing vehicle CO2 emissions by 90% in comparison with the 2010 levels, by 2050 (TMC 2017). In order to achieve such high fuel efficiency, ultra-lightweight structure combined with low aerodynamic drag is primary design targets. However, beyond fuel efficiency, aerodynamics can affect the driver experience of vehicle handling, especially in the case of ultra-low vehicle weight. The aerodynamic forces and moments on the vehicle affect the grip that the tires have on the road, as well as the stability of the vehicle to changes in the road or wind conditions. In many cases, attempts at streamlining passenger cars for minimizing drag have led to unwanted increases in side-wind sensitivity. This trade-off was observed as early as 1933 by Kamm (1933) out of which arose the well-known truncated rear-end design (“Kamm-back”) which helped to offset much of the side-wind susceptibility introduced from streamlining. In view of this trade-off between drag and side-wind sensitivity, a two-operating-point design problem is defined and solved. The two operating points correspond to two flow directions (0 and 30 side-wind); each case is associated with its own objective function. The two functions to be minimized are the drag coefficient at 0 and the yaw moment coefficient at 30 side-wind. The Pareto front of non-dominated solutions is computed and (some of) the optimal solutions are thoroughly examined using, among others, delayed detached eddy simulation (DDEs) analysis tools to investigate whether geometries optimized using RANS will indeed be better than the baseline if evaluated with higher fidelity models.

2 Flow and adjoint equations

2.1 Flow equations

The governing (primal) equations are the steady-state RANS equations for incompressible flows. These are written as,

$$\begin{array}{@{}rcl@{}} R^{p} & = & -\frac{\partial v_{j}}{\partial x_{j}} = 0 \end{array} $$
(1)
$$\begin{array}{@{}rcl@{}} {R^{v}_{i}} & = & v_{j} \frac{\partial v_{i}}{\partial x_{j}} - \frac{\partial \tau_{ij}}{\partial x_{j}} + \frac{\partial p}{\partial x_{i}} = 0, i = 1,2,3 \end{array} $$
(2)

where vi are the velocity components, p is the static pressure divided by the constant density, ν and νt are the constant bulk and turbulent viscosity, respectively, and \(\tau _{ij} = (\nu + \nu _t) \!\left (\! \frac {\partial v_{i}}{\partial x_{j}} + \frac {\partial v_{j}}{\partial x_{i}}\!\right )\) are the stress tensor components. According to the Spalart–Allmaras turbulence model (Spalart and Allmaras 1992), the latter is given by \(\nu _{t}=\widetilde {\nu } f_{v_{1}} \label {eddyv}\) and computed after solving the PDE

$$\begin{array}{@{}rcl@{}} R^{\widetilde {\nu}} &=& v_{j} \frac{\partial \widetilde {\nu}}{\partial x_{j}} - \frac{\partial}{\partial x_{j}} \left[ \left( \nu + \frac{\widetilde {\nu}}{\sigma} \right) \frac{\partial \widetilde {\nu}}{\partial x_{j}} \right] - \frac{c_{b2}}{\sigma} \left( \frac{\partial \widetilde {\nu}}{\partial x_{j}} \right)^{2} \\ &&- \widetilde {\nu} P(\widetilde {\nu}) + \widetilde {\nu} D(\widetilde {\nu}) = 0 \end{array} $$
(3)

for the turbulence variable \(\widetilde {\nu }\). In the above equation, the production and destruction terms are given by \(P(\widetilde {\nu })=c_{b1}\widetilde {Y}\) and \(D(\widetilde {\nu })=c_{w1} f_{w}(\widetilde {Y})\frac {\widetilde {\nu }}{{\Delta }^{2}}\), respectively, with \(\widetilde {Y}=f_{v_{3}}Y+\frac {\widetilde {\nu }}{{\Delta }^{2} \kappa ^{2}} f_{v_{2}}\), \(Y=\|\textbf {S}\|=\|e_{ijk} \frac {\partial v_{k}}{\partial x_{j}}\|\) is the vorticity magnitude, and Δ is the distance from the wall. To account for the distance variation w.r.t. the design variables during the adjoint formulation (Papoutsis-Kiachagias and Giannakoglou 2016), the Hamilton–Jacobi PDE is used

$$ R^{\Delta} = \frac{\partial (c_{j} \Delta)}{\partial x_{j}} - \Delta \frac{\partial^{2} \Delta}{\partial {x_{j}^{2}}} -1 = 0 $$
(4)

where cj = Δ/xj act as the “convecting velocity” components. All turbulence model functions and constants can be found in Spalart and Allmaras (1992). In industrial cases, the use of the law-of-the-wall (wall functions) is a common practice in order to avoid extremely stretched grids close to the solid walls and keep the computational cost affordable. Working with a cell-centered finite volume discretization scheme, Spalding’s law is used to compute the friction velocity based on the velocity magnitude at the first cell center off the wall (Frink 1996).

2.2 Continuous adjoint formulation

Starting point for the formulation of the adjoint problem is the augmented function L which is defined by adding the field integrals of the products of the flow (or primal) PDEs and the adjoint variable fields, to the objective function J, i.e.,

$$ L = J + {\int}_{\Omega} u_{i} {R^{v}_{i}} d\Omega + {\int}_{\Omega} q R^{p} d\Omega + {\int}_{\Omega} \widetilde {\nu_a} R^{\widetilde {\nu}} d\Omega + {\int}_{\Omega} {\Delta}_{a} R^{\Delta} d\Omega $$
(5)

where Ω is the computational domain, ui are the adjoint velocity components, q is the adjoint pressure, \(\widetilde {\nu _a}\) is the adjoint turbulence variable, and Δa is the adjoint distance. Given that, upon convergence, the residuals of the primal equations are zero, LJ.

A couple of different mathematical formulations can be followed when differentiating (5), as outlined in Kavvadias et al. (2015). The first makes use of the Leibniz rule for differentiating integrals with variable boundaries and formulates the adjoint equations by eliminating terms multiplying the partial derivatives (.)/bn of flow variables, w.r.t. the design variables bn, n ∈ [1, N], with N denoting the number of design variables. This approach leads to continuous adjoint formulations with SD expressions including surface integrals only; such a mathematical development yields two different SD expressions, depending on how grid sensitivities (i.e., δxk/δbn, where xk are the nodal coordinates) are treated. The second approach formulates the adjoint equations by eliminating the multipliers of the total (or material) derivatives of flow quantities w.r.t. bn (δ(.)/δbn) and leads to SD expressions containing both field and surface integrals. In this work, both approaches will be used, for reasons explained in Section 6. However, since the workhorse of the optimization runs to be presented in Section 6 is the approach which results in both surface and field integrals, the presented mathematical development is based on the latter. Thus, the differentiation of (5) gives

$$\begin{array}{@{}rcl@{}} \frac{\delta L}{\delta b_{n}} &=& \frac{\delta J}{\delta b_{n}} + {\int}_{\Omega} \left( u_{i} \frac{\delta {R^{v}_{i}}}{\delta b_{n}} + q \frac{\delta R^{p}} {\delta b_{n}} + \widetilde {\nu_a} \frac{\delta R^{\widetilde {\nu}}}{\delta b_{n}} + \Delta_{a} \frac{\delta R^{\Delta}}{\delta b_{n}} \right) d{\Omega} \\ &&+ {\int}_{\Omega} \left( u_{i} {R^{v}_{i}} + q R^{p} + \widetilde {\nu_a} R^{\widetilde {\nu}} + \Delta_{a} R^{\Delta}\right) \frac{\delta (d{\Omega})}{\delta b_{n}} \end{array} $$
(6)

The last field integral on the RHS of (6) is omitted, since the residuals of the primal equations are 0 over Ω. In order to formulate the adjoint equations, the total derivatives of the primal equations have to be developed. Since the shape and discretization of Ω depends on bn, the total and spatial derivative symbols do not permute but are related through (Papadimitriou and Giannakoglou 2007),

$$\begin{array}{@{}rcl@{}} \frac{\delta }{\delta b_n} \left( \frac{\partial (.)} {\partial x_{j}} \right) = \underbrace{\frac{\partial}{\partial x_{j}} \left( \frac{\delta (.)}{\delta b_n} \right)}_{T_{F}} \underbrace{-\frac{\partial (.)}{\partial x_{k}} \frac{\partial}{\partial x_{j}} \left( \frac{\delta x_k}{\delta b_n} \right)}_{T_{SD}} \end{array} $$
(7)

A detailed application of (7) to the incompressible Navier–Stokes equations for laminar flows is presented in Kavvadias et al. (2015) and is omitted here in the interest of space. Further development of the TF terms gives rise to the adjoint PDEs and boundary conditions (Section 2.2.2) while the TSD terms give rise to the field-integral SD expression (Section 2.3). The TSD terms resulting from the application of (7) to (3) and (4) is also discussed in Section 2.3.

2.2.1 Objective functions

The two objectives to be used in the applications of Section 6 are the drag and yaw moment coefficients, given by

$$\begin{array}{@{}rcl@{}} J_{C_{D}} &=& \frac{{\int}_{S_{W}} \left( -\tau_{ij} + p {\delta^{j}_{i}}\right) n_{j} {r^{F}_{i}} dS}{\frac{1}{2} A_{ref} U_{ref}^{2}} \end{array} $$
(8)
$$\begin{array}{@{}rcl@{}} J_{C_{M}} &=& \frac{{\int}_{S_{W}} {r_{i}^{M}} e_{ilm} (x_{l} - {x_{l}^{c}}) \left( -\tau_{mj} + p {\delta_{m}^{j}}\right) n_{j} dS}{\frac{1}{2} l_{ref} A_{ref} U_{ref}^{2}} \end{array} $$
(9)

where rF and rM are the drag and yaw moment direction vectors, \({\delta ^{j}_{i}}\) is the Kronecker delta, eilm is the Levi-Civita symbol, xc is the center of rotation w.r.t. which the moment is computed, and Aref, lref, and Uref are the frontal area, reference length, and far-field velocity magnitude, respectively. Quantities in the denominators of (8) and (9) remain fixed during the optimization loop. SW is the solid wall (car surface) on which the objective functions are defined.

In general, an objective function defined along the boundaries S of Ω can be expressed as

$$ J= {\int}_{S} j_{S} dS = {\int}_{S} j_{S,i} n_{i} dS $$
(10)

where jS is the boundary integrand. Differentiating J w.r.t. bn gives

$$ \frac{\delta J}{\delta b_{n}} = {\int}_{S} \frac{\delta j_{S,i}}{\delta b_{n}} n_{i} dS + {\int}_{S} j_{S,i} \frac{\delta (n_{i} dS)}{\delta b_{n}} $$
(11)

Since jS, i = jS, i(vk, p, τkj), using the chain rule to develop δjS, i/δbn yields

$$\begin{array}{@{}rcl@{}} \frac{\delta J}{\delta b_{n}}&=& {\int}_{S}\frac{\partial j_{S,i}}{\partial v_{k}} n_{i} \frac{\delta v_{k}}{\delta b_{n}} dS + {\int}_{S}\frac{\partial j_{S,i}}{\partial p} n_{i} \frac{\delta p} {\delta b_{n}} dS \\ &&+ {\int}_{S}\frac{\partial j_{S,i}}{\partial \tau_{kj}} n_{i} \frac{\delta \tau_{kj}}{\delta b_{n}} dS + {\int}_{S} j_{S,i} \frac{\delta (n_{i} dS)}{\delta b_{n}} \end{array} $$
(12)

Computing the variations of the flow quantities w.r.t. bn appearing in (12) would lead to a method with a cost scaling with N. To avoid such a high cost, the adjoint approach is developed.

2.2.2 Field adjoint equations

After developing (6) using (7) and the Gauss divergence theorem for the TF terms, the adjoint PDEs result by setting the multipliers of the derivatives of the flow variables w.r.t. bn to 0, in the field integrals of the developed form of (6). These read

$$\begin{array}{@{}rcl@{}} R^{q} &=& -\frac{\partial u_{j}}{\partial x_{j}} = 0 \end{array} $$
(13)
$$\begin{array}{@{}rcl@{}} {R^{u}_{i}} &=& u_{j} \frac{\partial v_{j}}{\partial x_{i}} - \frac{\partial (v_{j} u_{i})} {\partial x_{j}} - \frac{\partial \tau_{ij}^{a}}{\partial x_{j}} + \frac{\partial q}{\partial x_{i}} +\widetilde {\nu_a} \frac{\partial \widetilde {\nu}}{\partial x_{i}} \\ &-&\frac{\partial}{\partial x_{l}} \left( \widetilde {\nu_a} \widetilde {\nu} \frac{\mathcal{C}_{Y}} {Y} e_{mjk} \frac{\partial v_{k}}{\partial x_{j}} e_{mli} \right) = 0 , i = 1,2,3 \end{array} $$
(14)
$$\begin{array}{@{}rcl@{}} R^{\widetilde {\nu_a}} &=& -\frac{ \partial (v_{j}\widetilde {\nu_a})} {\partial x_{j}} -\frac{\partial}{\partial x_{j}} \left[ \left( \nu+\frac{\widetilde {\nu}}{\sigma} \right) \frac{\partial \widetilde {\nu_a}}{\partial x_{j}}\right] + \frac{1}{\sigma}\frac{\partial \widetilde {\nu_a}}{\partial x_{j}} \frac{\partial \widetilde {\nu}}{\partial x_{j}} \\ &&+ 2 \frac{c_{b2}}{\sigma} \frac{\partial}{\partial x_{j}} \!\left( \widetilde {\nu_a} \frac{\partial \widetilde {\nu}}{\partial x_{j}} \right) + \widetilde {\nu_a} \widetilde {\nu} \mathcal{C}_{\widetilde {\nu}} + \frac{\partial \nu_{t}}{\partial \widetilde {\nu}} \frac{\partial u_{i}}{\partial x_{j}} \left( \frac{\partial v_{i}}{\partial x_{j}} + \frac{\partial v_{j}}{\partial x_{i}} \right) \\ &&+ \left( -P + D \right)\widetilde {\nu_{a}} = 0 \end{array} $$
(15)
$$\begin{array}{@{}rcl@{}} R^{\Delta_{a}} &=& -2 \frac{\partial }{\partial x_{j}} (\Delta_{a} \frac{\partial \Delta}{\partial x_{j}} ) + \widetilde {\nu} \widetilde {\nu_{a}} \mathcal{C}_{\Delta} = 0 \end{array} $$
(16)

where \(\tau _{ij}^{a} = \left (\nu +\nu _{t} \right ) \left (\frac {\partial u_{i}}{\partial x_{j}} + \frac {\partial u_{j}}{\partial x_{i}} \right )\) are the adjoint stress tensor components. The \(\mathcal {C}_{\widetilde {\nu }}\), \(\mathcal {C}_{Y}\), and \(\mathcal {C}_{\Delta }\) expressions can be found in Zymaris et al. (2009).

The adjoint boundary conditions are formulated after zeroing the multipliers of the derivatives of the flow variables w.r.t. bn in the surface integrals emerging after applying the Gauss divergence theorem to the TF terms of (7). The detailed formulation of the adjoint boundary conditions is presented in Papoutsis-Kiachagias and Giannakoglou (2016), including the adjoint law of the wall for cases utilizing wall functions; this development is omitted here in the interest of space.

2.3 Sensitivity derivatives

After formulating the adjoint PDEs and their boundary conditions, the remaining terms originating from terms TSD (7), along with the last term on the RHS of (12) and additional terms emerging during the derivation of the adjoint boundary conditions, give rise to the SD expression, namely

$$\begin{array}{@{}rcl@{}} \frac{\delta L}{\delta b_{n}} &=& {\int}_{S_{W}} j_{S_{W},i} \frac{\delta (n_{i}dS)}{\delta b_n} +{\int}_{\Omega} \left( A_{jk}^{L} + A_{jk}^{T}\right) \frac{\partial}{\partial x_{j}} \left( \frac{\delta x_k}{\delta b_n} \right)d\Omega \\ &&- {\int}_{S_{W}} \left( -u_{k} n_{k} + \frac{\partial j_{S_{W},k}}{\partial \tau_{lz}} n_{k} n_{l} n_{z}\right) \tau_{ij} \frac{\delta (n_{i} n_{j})}{\delta b_{n}} dS \\ &&- {\int}_{S_{W}} \frac{\partial j_{S_{W},k}}{\partial \tau_{lz}} n_{k} t^{I}_{l} t^{I}_{z} \tau_{ij} \frac{\delta \left( t^{I}_{i} t^{I}_{j} \right)}{\delta b_{n}} dS \\ &&- {\int}_{S_{W}} \frac{\partial j_{S_{W},k}}{\partial \tau_{lz}} n_{k} t^{II}_{l} t^{II}_{z} \tau_{ij} \frac{\delta \left( t^{II}_{i} t^{II}_{j} \right)}{\delta b_{n}} dS \\ &&- {\int}_{S_{W}} \left[ \frac{\partial j_{S_{W},k}}{\partial \tau_{lz}} n_{k} \left( t^{II}_{l} t^{I}_{z} + t^{I}_{l} t^{II}_{z}\right) \right] \tau_{ij} \frac{\delta \left( t^{II}_{i} t^{I}_{j} \right)}{\delta b_{n}} dS \end{array} $$
(17)

where \(j_{S_{W},i}\) is the part of jS, i defined along SW, and tI, tII are the two tangential unit vectors along SW, forming a local Frenet system with n. The second term on the RHS of (17) is a field integral containing grid sensitivities (δxk/δbn). Their evaluation over the entire domain and for all design variables is the reason why SD with both field and surface integrals are usually expensive to evaluate in the presence of many design variables. However, in the applications presented in this work (Section 6), a volumetric B-Splines tool is used to parameterize both the boundary and (part of) the interior of the CFD grid (Section 3). Due to the closed form relation between the grid node positions and the design variables, grid sensitivities can be computed analytically and in a relatively cheap way, making the previously described approach a viable shape optimization method, even in large-scale applications.

Term \(A_{jk}^{L}\) (17) emerges after applying (7) to (1) and (2) and collecting the TSD terms. It reads (Kavvadias et al. 2015),

$$ A_{jk}^{L} = - u_{i} v_{j} \frac{\partial v_{i}}{\partial x_{k}} - u_{j} \frac{\partial p}{\partial x_{k}} - \tau^{a}_{ij}\frac{\partial v_{i}}{\partial x_{k}} + u_{i} \frac{\partial \tau_{ij}}{\partial x_{k}} + q \frac{\partial v_{j}}{\partial x_{k}} $$
(18)

Term \(A_{jk}^{T}\) ((17)) emerges after following the same procedure used to obtain \(A_{jk}^{L}\), this time applied to (3) and (4) and reads

$$\begin{array}{@{}rcl@{}} A_{jk}^{T} &=& - \widetilde {\nu_a} v_{j} \frac{\partial \widetilde {\nu}}{\partial x_{k}} + \widetilde {\nu_a} \frac{\partial}{\partial x_{k}} \left[ \left( \nu+\frac{\widetilde {\nu}}{\sigma} \right) \frac{\partial \widetilde {\nu}}{\partial x_{j}} \right] \\ &&- \left( \nu+\frac{\widetilde {\nu}}{\sigma} \right) \frac{\partial \widetilde {\nu_a}}{\partial x_{j}} \frac{\partial \widetilde {\nu}}{\partial x_{k}} + 2 \widetilde {\nu_a} \frac{c_{b_{2}}}{\sigma} \frac{\partial \widetilde {\nu}}{\partial x_{j}} \frac{\partial \widetilde {\nu}}{\partial x_{k}} \\ &&- \widetilde {\nu_a} \widetilde {\nu} \mathcal{C}_{Y} \frac{S_{q}}{\|\textbf{S}\|} e_{qji} \frac{\partial v_{i}}{\partial x_{k}} - 2 \Delta_{a} \frac{\partial \Delta}{\partial x_{j}} \frac{\partial \Delta}{\partial x_{k}} \end{array} $$
(19)

Though \(A_{jk}^{T}\) was included in applications of the same software in previous publications (e.g., Kavadias et al. 2015), its form and derivation have not been presented in the past.Footnote 1 To fill this gap in the literature, the derivation of \(A_{jk}^{T}\) is given in Appendix 1 and its impact on the final SD values in investigated in Section 5.

3 Parameterization and grid displacement using volumetric B-Splines

In this article, parameterization and grid displacement is based on volumetric B-Splines. Let \({X}_{m}^{ijk}, m\in [1,3], i\in [0,I], j\in [0,J], k\in [0,K]\) be the Cartesian coordinates of the ijk th control point of the 3D structured control grid, Fig. 6. Additionally, (I + 1),(J + 1), and (K + 1) are the number of control points per control grid direction. The Cartesian coordinates x = [x1, x2, x3]T = [x, y, z]T of a CFD grid node residing within the boundaries of the control grid are given by

$$ x_{m}(\xi, \eta, \zeta) = U_{i,p_{\xi}}(\xi) V_{j,p_{\eta}}(\eta) W_{k,p_{\zeta}}(\zeta) {X}_{m}^{ijk} $$
(20)

Here, ξ, η, ζ are the nodal parametric coordinates, U(ξ), V (η), and W(ζ) are the B-Splines basis functions, and pξ, pη, and pζ are their respective degrees, which may be different per control grid direction. Details about B-Splines basis definitions and properties can be found in Piegl and Tiller (1997). Computing the Cartesian coordinates of any parameterized CFD grid node is straightforward, at a negligible computational cost, as long as its parametric coordinates are known.

Given the control point position, the knot vectors and the basis function degrees, the parametric coordinates w = [w1, w2, w3]T = [ξ, η, ζ]T of a CFD grid node with Cartesian coordinates r = [xr, yr, zr]T result by solving the system of equations

$$ \left[ \begin{array}{c} x(\xi, \eta, \zeta) - x_{r} = 0\\ y(\xi, \eta, \zeta) - y_{r} = 0\\ z(\xi, \eta, \zeta) - z_{r} = 0 \end{array} \right] $$
(21)

where xm(ξ, η, ζ) are given by (20), based on the known X values. The 3 × 3 system of (21) can be solved independently for each parameterized grid node using the Newton–Raphson method, after computing and inverting the Jacobian xm/wj, m, j ∈ [1,3]. The Jacobian matrix has a closed form expression resulting by differentiating (20) w.r.t. the components of w. Since the evaluation of the parametric coordinates of each point is independent from any other, these computations may run in parallel.

The aforementioned process takes place once, in the beginning of the optimization loop. Then, after moving the control points X, the Cartesian coordinates of each (internal or boundary) CFD grid node residing within the control grid can be computed through (20) at a very low cost. The same holds for the computation of δxm/δbn which results by analytically differentiating (20) w.r.t. the design variables (i.e., certain elements of X, see Section 6). This makes the evaluation of SD w.r.t. the B-Splines control points, using (17) which includes both surface and field integrals, much cheaper compared to other PDE-based grid displacement methods.

4 Multi-point, multi-objective optimization algorithm and software

The overall framework for performing shape optimization using a gradient-based method assisted by continuous adjoint is implemented in-house, based on the open-source CFD toolbox OpenFOAM, under the title adjointOptimization. The basic modules used within each optimization cycle are the following:

  1. 1.

    Solution of the primal equations. The incompressible RANS equations for steady turbulent flows are solved, using native OpenFOAM solvers (e.g., simpleFoam) for the operating point under consideration.

  2. 2.

    Computation of the objective function(s). Once the flow equations have been solved, the objective function(s) value(s) quantifying the performance of a shape are computed.

  3. 3.

    Solution of the adjoint equations. As described in Section 2, the developed code solves the adjoint to the turbulence model PDE(s), avoiding thus the commonly made “frozen turbulence assumption.” For the high-Re variants, adjoint wall functions are also implemented (Papoutsis-Kiachagias and Giannakoglou 2016).

  4. 4.

    Gradient computation. Once the flow and adjoint fields have been computed, the computation of the gradient of the objective function(s) is conducted. All SD formulations discussed in Section 2.2 are available in adjointOptimization and used depending on the problem under consideration.

  5. 5.

    Update of the design variables using the previously computed SD. A variety of gradient-based algorithms, including steepest-descent, conjugate gradient, Symmetric Rank 1 (SR1, Nocedal and Wright 1999), and BFGS for unconstrained optimization and Augmented Lagrange Multipliers (ALM, Nocedal and Wright 1999), constrained projection, and SQP for constrained optimization problems, are included. The continuous adjoint method is also used to compute the gradient of the constraint functions, when necessary.

  6. 6.

    Geometry displacement and grid morphing. The aerodynamic shape is updated based on the computed design variable values. Before starting a new optimization cycle, the CFD grid has to be adapted to the new geometry. To avoid re-meshing, which in real-world applications has a high computational cost, methods to adapt the initial grid to a new geometry have been developed and implemented within adjointOptimization. In this article, the volumetric B-Splines tool presented in Section 3 is used to update both the geometry and the internal CFD grid nodes.

The previously described optimization tool can support multi-objective and/or multi-point optimization problems. When a multi-objective problem is considered, a weighted objective function

$$J_{t}=\sum\limits_{i = 1}^{M} w_{i} J_{i} $$

is minimized, with M standing for the number of objectives and wi being their corresponding weights. When objectives are defined at different operating points, one flow and adjoint solution must be conducted for each operating point. The SDs driving the optimization loop are then computed as

$$\frac{\delta J_{t}}{\delta b_{n}}=\sum\limits_{i = 1}^{M} w_{i} \frac{\delta J_{i}}{\delta b_{n}}, n\in[1,N] $$

5 Validation

In this section, the adjoint approach presented in Section 2.2 is validated in a variant of a benchmark case of the automotive industry. In specific, a 2D variant of the Ahmed body (Ahmed et al. 1984) with a slant angle of 35 is studied. To ease mesh generation, sharp edges at the two ends of the slant have been rounded, using a radius of 0.05m and 0.02m for the top and bottom ends, respectively. Though flow physics are much simpler in 2D flows, this case is used as a means to validate the adjoint solver, at a reasonable cost and in a problem that is similar to the automotive application studied in Section 6. The mesh consists of ∼ 2 × 105 cells, the Reynolds number is 4.35 × 106 based on the body length, and the average non-dimensional distance of the first cell centers off the wall is y+ ∼ 20. The same primal and adjoint models used in the optimization runs of Section 6.1 are utilized herein, as well. A 7 × 5 control box is placed at the beginning of the slant, with only the 3 × 3 central control points being free to move, resulting to 18 design variables (x and y control point coordinate positions), Fig. 1. Drag sensitivities w.r.t. these design variables are computed using the continuous adjoint formulation described in Section 2 and compared with FD, which is considered to be the reference method, Fig. 2. In addition, a third curve is presented which highlights the significance of the SD terms resulting from the differentiation of the turbulence model PDE (and the Hamilton–Jacobi equation), i.e., term \(A_{jk}^{T}\) in (17). It can be noticed that this term plays a significant role in the computation of accurate SD since its omission leads to wrong SD magnitudes and, especially, wrong SD signs for about one third of the design variables. The max. error of the adjoint-based SD, as a percentage of the FD values, appears in the derivative w.r.t. the y coordinate of control point 11, where the adjoint SD is by approximately one order of magnitude higher than its FD counterpart. However, since the FD at that point is almost 0, this is not considered critical. Excluding that point, the mean error of the adjoint-based SD is 5.6%.

Fig. 1
figure 1

2D Ahmed body: Volumetric B-Splines control point IDs along with the velocity magnitude. Blow-up view close to the top of the slant. Control points colored in red are allowed to vary while blue ones are kept fixed in order to preserve continuity between the parameterized and non-parameterized parts of the grid. The control box is placed close to the area in which flow separation begins

Fig. 2
figure 2

2D Ahmed body. Drag SD w.r.t. the x (top) and y (bottom) coordinates of the control points presented in Fig. 1, computed with the complete adjoint formulation (“adj.”), the variant that disregards term \(A_{jk}^{T}\) in (17) (“adj. no \(A_{jk}^{T}\)”) and finite differences (“FD”). It can be seen that the proposed adjoint approach matches the outcome of FD while the approach that disregards the SD terms emerging from the differentiation of the Spalart–Allmaras model deviates from them, yielding the wrong sensitivity sign for some design variables (x coordinates of control points 9,10,16,18, and 23). It should be noted that results of both adjoint approaches presented in this figure include the differentiation of the Spalart–Allmaras model (i.e., (15) is solved in both cases)

6 Applications

6.1 RANS-based optimization

The previously described algorithm is used to optimize a Toyota aerodynamics concept car, Fig. 3, which represents a study of a visionary ultra-lightweight and efficient vehicle. Due to this very low weight, wind gusts can have a more significant impact to the driving experience. It is, therefore, desirable to optimize the shape for reducing the sensitivity to side-winds, while maintaining a very low drag coefficient in longitudinal wind. Thus, the shape optimization is carried out for minimizing the drag coefficient in the absence of side-winds (\(C_{D}^{0^{\circ }}\)) and the yaw moment coefficient in the presence of a 30 side-wind (\(C_{M}^{30^{\circ }}\)), coming from the port side. In both cases, the vehicle speed is equal to 33.3 m/s and the wheels have an angular velocity which, at the contact with the ground, gives a peripheral velocity with a magnitude equal to that of the vehicle speed. Since the wheels are closed (no mesh cells exist inside them), the use of a multiple reference frame to account for the Coriolis and centripetal forces is not required. A two-point, two-objective optimization is carried out, with the following objective

$$ J_{t} = w_{D} C_{D}^{0^{\circ}} + w_{M} C_{M}^{30^{\circ}} $$
(22)

A polyhedral mesh with about 1.6M cells (∼ 7M points) is used, with an average y+ ∼ 32 at the first cell centers off the walls. The steady-state RANS equations coupled with the Spalart–Allmaras turbulence model with wall functions are solved in order to compute the flow field. The adjoint system includes the adjoint to the Spalart–Allmaras turbulence model as well as adjoint wall functions; steepest descent is used to update the design variables.

Fig. 3
figure 3

The TOYOTA aerodynamics concept car

Before running the optimization loop, the SDs of the two objectives w.r.t. the normal displacement of the boundary wall nodes (a.k.a. the sensitivity maps) were computed, Figs. 4 and 5. Areas with high (absolute)-valued SDs should receive the designer’s attention while areas with low-valued SDs are aerodynamically insignificant, at least for the current shape. Even though the aerodynamic significance of certain car areas might change as the optimization evolves, i.e., high-valued sensitivities might diminish in some areas or be enhanced in others, sensitivity maps can be used as a guide for placing the morphing boxes, to be used in the automated optimization loop. Since the number of car surface nodes is high (∼ 2 × 105), the E-SI formulation based only on surface integrals was used to compute the sensitivity maps. On the contrary, the number of design variables is relatively small (due to the use of the parameterization tool described in Section 3) and the FI formulation was used to compute the SD driving the optimization loop.

Fig. 4
figure 4

\(C_{D}^{0^{\circ }}\) sensitivity map, i.e., the derivatives of \(C_{D}^{0^{\circ }}\) w.r.t. the normal displacement of the wall nodes, computed for a longitudinal flow. Areas with a positive sign (“red areas”) indicate that an outward displacement reduces drag whereas those with a negative sign (“blue areas”) have the opposite effect

Fig. 5
figure 5

\(C_{M}^{30^{\circ }}\) sensitivity map for a 30 side-wind. Color notation as in Fig. 4

Guided by the sensitivity maps, two morphing boxes with 10 × 9 × 9 control points each were used to parameterize the spoiler and diffuser, Fig. 6. Based on the morphing boxes position and the desired level of continuity between the parameterized and non-parameterized parts of the geometry, a number of control points were kept fixed while the rest are allowed to vary during the optimization, Fig. 6. In order to ensure the smoothness of the optimized geometries and enhance manufacturability, each iso i, j, k planes of the structured grid of control points was moved in a uniform way in the corresponding x, y, and z directions. Furthermore, control points were moved in a symmetric way along the y direction (the one perpendicular to the symmetry plane of the car), in order to ensure the car symmetry, even when optimizing under non-symmetric flow conditions (30). Considering the above, N = 29 design variables were eventually used to parameterize the car shape.

Fig. 6
figure 6

Two simultaneously acting morphing boxes at the spoiler and the diffuser areas. Control points colored in red are allowed to move, in accordance with the uniformity and symmetry constraints defined in Section 6. Blue control points are kept fixed. The boundaries of the control boxes were placed according to the maximum allowed displacement suggested by the designer. Since this study pertains to a concept car in the early stages of its development, these were set relatively large

By using different weight values in (22), different points on the front of non-dominated solutions can be computed. In this study, eight different sets of (wD, wM) were used and the resulting Pareto front is shown in Fig. 7 (filled, red squares). In the same figure, the convergence histories of all the optimization runs starting from the baseline geometry (BLC; filled blue circle) are also presented, in the objective space. Steepest descent was used to update the design variables and a total of about 60 optimization cycles, each comprising two primal and two adjoint solutions, were needed to obtain the eight Pareto points illustrated in Fig. 7, at a cost of about 240 equivalent flow solutions. When initialized with the flow and adjoint solutions of the previous geometry, each optimization cycle required about 1.4 h on 40 Intel Xeon E5-2680v2 @2.8-GHz cores, leading to an overall wall-clock time of about 84 h, or 3.5 days. Though successive optimizations, in which each Pareto point results as a continuation from the previous one, or the use of Pareto tracking techniques (Schmidt and Schulz 2008) could reduce the overall CPU cost, it is beyond the scope of the article to pursue such approaches. One may notice that, according to the RANS-based optimization, four members of the front of non-dominated solutions outperform the BLC geometry w.r.t. both objectives. The different car geometries resulting from the two-point optimization are presented in Fig. 8, in comparison to the BLC geometry. To get a clearer view on the local geometry deformation, the cumulative normal displacement maps for three Pareto front members are presented in Fig. 9.

Fig. 7
figure 7

Front of non-dominated solutions (filled, red squares) and convergence history of the optimization runs carried out using different sets of (wD, wM). All values have been normalized w.r.t. the BLC geometry

Fig. 8
figure 8

Optimized geometries (port side) compared to the BLC (starboard side). The objective function weights corresponding to each optimized geometry can be found in Fig. 7

Fig. 9
figure 9

Cumulative displacement of the wall nodes, projected on the normal unit vector of the corresponding nodes on the BLC geometry, plotted over the P1 (top), P4 (mid), and P8 (bottom) geometries. Positive signs (“blue areas”) indicate an inward displacement while negative ones (“red areas”) a geometry inflation

Some insight into the mechanisms leading to the decrease in the objective functions can be obtained from Figs. 101112, and 13. The two extremes of the Pareto front (P1 and P8) along with P4 (which had both \(C_{D}^{0^{\circ }}\) and \(C_{M}^{30^{\circ }}\) improved w.r.t. the BLC) are examined.

Fig. 10
figure 10

Near-wall velocity magnitude and surface LIC for the BLC (a–c), P1 (d–f), P4 (g–i), and P8 (j–l) geometries, computed in the absence of side-wind

Fig. 11
figure 11

Near-wall velocity magnitude and surface LIC for the BLC (a–c), P1 (d–f), P4 (g–i), and P8 (j–l) geometries, computed for a 30 side-wind, coming from the port side

Fig. 12
figure 12

Difference of the local \(C_{D}^{0^{\circ }}\) value between the optimized and initial geometries, plotted on the P1 (top), P4 (mid), and P8 (bottom) car shapes. Blue areas indicate a decrease in the local drag contribution to the resultant force (i.e., are beneficial) while red areas indicate an increase

Fig. 13
figure 13

Difference of the local \(C_{M}^{30^{\circ }}\) value between the optimized and initial geometries, plotted on the P1 (top), P4 (mid) and P8 (bottom) car shapes. Color map as in Fig. 12

Regarding \(C_{D}^{0^{\circ }}\), useful conclusions can be drawn by examining Fig. 10 which depicts the near wall velocity magnitude and the corresponding surface line integral convolution (LIC) on the aforementioned geometries, for a longitudinal flow. The vortex emanating from the diffuser area of the BLC, Fig. 10a, has practically been suppressed in the P1, Fig. 10d, and P4, Fig. 10g, geometries, leading to a higher back pressure and, hence, lower drag (Fig. 12a, d). Figure 12c, f indicates that prolonging the diffuser and changing its angle has also a positive contribution on the diffuser drag itself, through a local velocity decrease, Fig. 10f, i, and a resulting pressure increase. In addition, lowering the spoiler height in the P1 geometry seems to have a mixed effect on the sides and the upper surface of the car: pressure is decreased just before the geometry change due to a local flow acceleration, leading to a local drag increase, whereas a higher pressure is observed on the lowered spoiler itself, having a positive contribution on the decrease of drag, Fig. 12a, b. Furthermore, the lowered spoiler in P1 creates a tear-like shape, increasing the pressure on the upper rear side, contributing thus to the drag decrease, Fig. 12a. On the other hand, the increased spoiler height of the P8 geometry leads to a lower back pressure and, consequently, higher drag, Fig. 12g.

Regarding \(C_{M}^{30^{\circ }}\), insight can be gained by examining Fig. 11 which depicts the near wall velocity magnitude and the corresponding surface LIC, computed on the same four geometries at 30 side-wind, coming from the port side. The main mechanism affecting yaw moment is related to changes in the velocity (and, consequently, the pressure) field on the port and starboard sides of the car, close to the spoiler. For the P4 and P8 geometries, the increase in the spoiler height and the slight widening of the car tail have led to a flow deceleration on the port side, Fig. 11h, k, and an acceleration on the starboard side, Fig. 11i, l. These lead to a higher pressure on the port side and a lower one on the starboard side, counter-balancing the yaw moment generated by the side-wind. The local effect on the \(C_{M}^{30^{\circ }}\) integrand can be observed in Fig. 13e, f for the P4 geometry and Fig. 13h, i for the P8 one. On the contrary, an opposite displacement (reduced spoiler height and narrowed car tail) has a deteriorating effect on the P1 geometry, Fig. 13b, c.

6.2 DDEs-based re-evaluation

The applications presented in Section 6.1 used a steady-state RANS-based turbulence model for evaluating the geometries computed throughout the optimization loop. The latter was chosen since using a higher fidelity model (e.g., DES-based) would lead to a significantly higher CPU cost. However, using RANS-based models for car external aerodynamics can lead to erroneously computed aerodynamic coefficients (Ashton et al. 2016). In addition, the question of whether a geometry that has been optimized using a RANS model is indeed better than the baseline, when both are evaluated using a higher fidelity model, arises. To this end, the BLC, P1, P4, and P8 geometries were re-evaluated using unsteady simulations based on the DDEs variant of the Spalart–Allmaras model (Spalart et al. 2006). Computational meshes of about 30 million cells were generated a new, with an average y+ ∼ 19 and the flow equations were integrated over a time window of 4 s, with a time-step of Δt = 10− 4 seconds. To avoid an excessively long transient phase, all flow problems examined were initialized after solving the steady-state RANS equations on the same meshes for 500 iterations. The flow fields and aerodynamic coefficients were averaged for the last 3 s of the simulation. Each of the DDEs simulations required about 50 h on 200 Intel Xeon E5-2680v2 @2.8 GHz cores. Taking into consideration that obtaining the front of Fig. 7 took about 84 h on 40 cores of the same architecture (Section 6.1), the cost of obtaining the aforementioned front is less than double of the cost of a single DDEs analysis, using 1/5 of the cores. Hence, computing the Pareto front based on DDEs would become quite expensive, taking also into consideration that the cost of solving the unsteady adjoint equations backwards in time would be significantly higher than that of the flow equations. Indicatively, Kapellos and Hartmann (2018) mention that, for an IDDES simulation around a model car, an adjoint solution takes 4.8 times longer than a primal one, including also the necessary re-computations of primal flow fields when using the checkpointing technique of Wang et al. (2009).

The evolution of the instantaneous and mean \(C_{D}^{0^{\circ }}\) and \(C_{M}^{30^{\circ }}\) coefficients through time is presented in Fig. 14 whereas Fig. 15 depicts the outcome of the DDEs re-evaluations overlaid to the Pareto front computed using RANS. A number of interesting conclusions can be drawn from this figure. Regarding the BLC, \(C_{D}^{0^{\circ }}\) does not change considerably when evaluated using the two models (∼ 1% difference); on the other hand, the difference in \(C_{M}^{30^{\circ }}\) is more significant (∼ 7%). The cause of the latter is discussed later in this section.

Fig. 14
figure 14

Evolution of the instantaneous (top) and mean (bottom) \(C_{D}^{0^{\circ }}\) (left) and \(C_{M}^{30^{\circ }}\) (right) values for the last 3 s of the DDEs runs. Both coefficients have been normalized with the mean value corresponding to the BLC geometry at the last time step

Fig. 15
figure 15

BLC and Pareto front members evaluated a using RANS and DDEs and normalized based on the RANS values of the BLC and b using DDEs and normalized based on the DDEs values of the BLC

Regarding the optimized geometries, when evaluated with DDEs, the P4 and P8 cars have a lower \(C_{M}^{30^{\circ }}\) than the BLC, reconfirming the trend computed by RANS. However, the DDEs-based improvement is lower than the RANS-based one (11.8% instead of 12.6% and 16.4% instead of 24% \(C_{M}^{30^{\circ }}\) reduction, for the P4 and P8 geometries, respectively). In addition, the two models also agree on the trend of \(C_{M}^{30^{\circ }}\) for the P1 geometry, with DDEs computing a higher deterioration when compared to the BLC (5% instead of 1% predicted by RANS). Based on the above, even though quantitative differences exist between the two models, a qualitative agreement is observed regarding the \(C_{M}^{30^{\circ }}\) trend when comparing the three Pareto points to the BLC.

Regarding \(C_{D}^{0^{\circ }}\), the two models agree that the P1 geometry is better than the BLC, with the improvement being smaller when computed with DDEs (5.8% instead of 8% \(C_{D}^{0^{\circ }}\) reduction). The DDEs and RANS models agree also on the trend of \(C_{D}^{0^{\circ }}\) for the P8 geometry, with DDEs computing a significantly smaller deterioration w.r.t. the BLC (6.4% instead of 17% computed by RANS). Finally, out of the aerodynamic coefficients being re-evaluated with DDEs, the \(C_{D}^{0^{\circ }}\) of the P4 geometry is the only one for which the two models provide a different trend. The DDEs model computes a 1.2% increase w.r.t. the BLC and RANS gives a 4% reduction. Nevertheless, the P4 geometry still lays in the DDEs-evaluated front of non-dominated solutions, providing a potentially useful design to the decision maker.

It is interesting to compare the car areas that contribute to the objective changes, as indicated by the DDEs and RANS models. The difference of the \(C_{D}^{0^{\circ }}\) integrand between the P1 and BLC geometries (\(\Delta C_{D}^{0^{\circ }}\)) according to the DDEs and RANS models is presented in Fig. 16, top and bottom, respectively. It can be observed that for the spoiler (Fig. 16b, e) and diffuser (Fig. 16c, f) areas, the \(\Delta C_{D}^{0^{\circ }}\) maps agree qualitatively; even a quantitative agreement can be observed for the largest part, apart from the end part of the diffuser. This similarity can also be observed by comparing the near-wall velocity fields for the top and bottom areas, computed with RANS (Fig. 10, top two rows) and DDEs (Fig. 17). On the contrary, the \(\Delta C_{D}^{0^{\circ }}\) maps differ for the rear side of the car (Fig. 16a, d), where flow recirculation plays a significant role. In specific, it can be seen that the vortex emanating from the diffuser area of the BLC is much stronger when computed with RANS, Fig. 10a, instead of DDEs, Fig. 17a. Hence, according to DDEs, the change in the diffuser geometry does not provide a reduction on the local \(C_{D}^{0^{\circ }}\) values at the lower part of the back side of the car, Fig. 16a. Nevertheless, it is interesting to note that, even based on DDEs, \(\Delta C_{D}^{0^{\circ }}\) is negative for a large part of the rear side of the P1 geometry, Fig. 16a, with the reduction, however, being smaller than that computed based on RANS. The differences between the DDEs and RANS models in the wake region can also be observed in Fig. 18, by comparing the velocity magnitudes on the symmetry plane of the BLC and P1 geometries. Similar to the P1 geometry, DDEs and RANS agree on the \(\Delta C_{D}^{0^{\circ }}\) trends computed on the spoiler and diffuser areas of the P4 geometry also (comparison of Fig. 19a, f with Fig. 19e, f, respectively). On the other hand, as in the P1 case, due to the absence of the abovementioned vortex (according to DDEs), the new diffuser fails to lead to significant gains in the local \(C_{D}^{0^{\circ }}\) values of the lower-rear side. This, in combination with the counter-productive spoiler, formed to reduce \(C_{M}^{30^{\circ }}\), leads to positive \(\Delta C_{D}^{0^{\circ }}\) for almost the entire rear side of the P4 geometry (Fig. 19a), in contrast to what was computed by RANS (Fig. 19d). This is the main reason for the contradicting \(C_{D}^{0^{\circ }}\) trends computed by the two models.

Fig. 16
figure 16

Difference of the local \(C_{D}^{0^{\circ }}\) value between the P1 and BLC geometries, plotted on the former, evaluated using DDEs (top)- and RANS (bottom)-based turbulence models. In order to use the same scale and due to the large difference of the local face areas between the meshes used for the DDEs and RANS computations, results are normalized using the local face area of the respective BLC meshes. Color meaning as in Fig. 12

Fig. 17
figure 17

Near-wall mean velocity magnitude and surface LIC based on DDEs, for the BLC (a–c) and P1 (d–f) geometries, computed in the absence of side-wind

Fig. 18
figure 18

RANS (left), time-averaged DDEs (mid), and instantaneous DDEs at t = 4s (right) velocity magnitude fields, plotted on the symmetry plane of the BLC (top) and P1 (bottom) geometries

Fig. 19
figure 19

Difference of the local \(C_{D}^{0^{\circ }}\) value between the P4 and BLC geometries, plotted on the former, evaluated using DDEs (top)- and RANS (bottom)-based turbulence models. The normalization discussed in Fig. 16 is applied here as well. Color meaning as in Fig. 12

Figure 20 illustrates the difference of the \(C_{M}^{30^{\circ }}\) integrand between the P8 and BLC geometries (\(\Delta C_{M}^{30^{\circ }}\)), as computed based on DDEs and RANS. Both models give a similar trend for both the port (Fig. 20b, e) and starboard (Fig. 20c, f) sides, with the improvement being lower when evaluated with DDEs. The quantitative difference can be attributed to the quite different flow fields computed by DDEs (Fig. 21) and RANS (Fig. 11, top and bottom lines). In specific, according to DDEs, the flow detaches at the top-back side of the BLC (Fig. 20a); however, it is attached when evaluated using RANS on the same geometry (Fig. 11a); this leads to important differences of the flow field at the starboard side as well (Figs. 21c and 11c). A significant difference between the near-wall velocity field of the two models can also be seen for the top (Figs. 21f and 11j) and starboard side (Fig. 21c, f) of the P8 geometry as well. However, when comparing the BLC and P8 geometries, the trend of the change in the near-wall velocity field is similar, with both models computing a flow acceleration on the starboard side (comparison of Fig. 21c, f as well as Fig. 11c, l, respectively), leading to a similar trend for \(\Delta C_{M}^{30^{\circ }}\), as already discussed. Similar \(\Delta C_{M}^{30^{\circ }}\) trends between the two models are also computed for the P4 geometry, Fig. 22, with good qualitative and quantitative agreement for both the port and starboard sides.

Fig. 20
figure 20

Difference of the local \(C_{M}^{30^{\circ }}\) value between the P8 and BLC geometries, plotted on the former, evaluated using DDEs (top)- and RANS (bottom)-based turbulence models. The normalization discussed in Fig. 16 is applied here as well. Color meaning as in Fig. 12

Fig. 21
figure 21

Near-wall mean velocity magnitude and surface LIC based on DDEs, for the BLC (a–c) and P8 (d–f) geometries, computed at 30 side-wind

Fig. 22
figure 22

Difference of the local \(C_{M}^{30^{\circ }}\) value between the P4 and BLC geometries, plotted on the former, evaluated using DDEs (top)- and RANS (bottom)-based turbulence models. The normalization discussed in Fig. 16 is applied here as well. Color meaning as in Fig. 12

7 Conclusions—discussion

The continuous adjoint method for the aerodynamic shape optimization of steady-state, incompressible flows was presented, by focusing on the sensitivity derivative (SD) terms resulting from the differentiation of the RANS variant of the Spalart–Allmaras turbulence model and the Hamilton–Jacobi PDEs; this development was presented for the first time in the literature. Numerical investigations showed that the impact of these terms is significant, since their omission resulted in wrongly signed SD for almost one third of the design variables parameterizing the shape of a 2D Ahmed body. Then, a gradient-based optimization algorithm based on the RANS equations coupled with the Spalart–Allmaras model and supported by the continuous adjoint method was used to conduct a two-point, two-objective optimization of a concept car, targeting minimum drag for a longitudinal wind and minimum yaw moment for a 30 side-wind. Within about 60 optimization cycles and a cost of about 240 equivalent flow evaluations, or 3.5 days on 40 processors, a well-populated Pareto front of non-dominated solutions containing eight members was obtained. Using the RANS model, half of the Pareto members outperform the baseline car w.r.t. both objectives, while the two extreme points lead to a reduction by ∼ 8% and ∼ 24% in the drag and yaw moment, respectively. The main mechanisms behind the drag reduction are a lowered spoiler, a boat-tailing effect, and a prolonged and widened diffuser. On the other hand, reduction in the yaw moment comes mainly through an increased spoiler height.

Then, the baseline geometry as well as some of the Pareto front members were re-evaluated using DDEs, in an attempt to answer the question of whether a geometry optimized using a RANS model is better than the baseline when both are re-evaluated using a higher fidelity tool. After their re-evaluation, the two extreme Pareto front members were indeed better than the baseline w.r.t. their objective of interest; the improvement however was smaller than that computed by RANS (reduction of 5.8% instead of 8% for \(C_{D}^{0^{\circ }}\) and 16.4% instead of 24% for \(C_{M}^{30^{\circ }}\), for the P1 and P8 geometries, respectively). Out of the six aerodynamic coefficients re-evaluated with DDEs (\(C_{D}^{0^{\circ }}\) and \(C_{M}^{30^{\circ }}\) for P1, P4, and P8), only the \(C_{D}^{0^{\circ }}\) of P4 had a different trend than that computed by RANS (1.2% increase computed by DDEs instead of 4% reduction based on RANS). However, even in this case, the P4 geometry laid in the DDEs-evaluated front of non-dominated solutions, providing a potentially useful solution to the decision maker.

Taking into consideration the excessive resources that would be required by a DDEs-based optimization (indicatively, a single DDEs run took more than half the time of the entire RANS-based Pareto computation when run on five times more processors), it can be argued that RANS-based optimization can be used as a computationally affordable approach for optimizing car external aerodynamics, with a relative confidence that the outcome of the optimization can be reconfirmed using DDEs, at least qualitatively. It should be mentioned that the geometry changes computed in this article were relatively large, since the studied case pertains to the early stages of the design of a concept car. Whether the conclusions drawn in this study hold for smaller deformations as well remains to be reconfirmed in the future.