<<

1

NURBS-based and Parametric-based Shape Optimisation with Dierentiated CAD Kernel

Orest Mykhaskiv1, Mladen Banovic2, Salvatore Auriemma3, Pavanakumar Mohanamuraly1, Andrea Walther2, Herve Legrand3 and Jens-Dominik Müller1

1Queen Mary University of London, [email protected] 2University of Paderborn, [email protected] 3OpenCASCADE, [email protected]

Corresponding author: Orest Mykhaskiv, [email protected]

ABSTRACT

Numerical optimisation is becoming an essential industrial method in engineering design for shapes immersed in uids. High-delity optimisation requires ne design spaces with many design variables, which can only be tackled with gradient-based optimisation methods. CAD packages that are open-source or commercially available do not provide shape derivatives, but impose to compute them with expensive, inaccurate and non- robust nite-dierences. The present work is the rst demonstration of obtaining exact shape derivatives with respect to CAD design parametrisation by applying algorithmic dierentiation to a com- plete CAD system, in this case the (OCCT) CAD-kernel. The extension of OCCT to perform shape optimisation is shown by using parametric models based on explicit parametrisations of the CAD model and on implicit parametrisations based on the BRep (NURBS). In addition, we demonstrate the imposition of geomet- ric constraints for both approaches, a salient part of industrial design, and an intuitive method of storing them in standard CAD format. The proposed method is applied to redesign TU Berlin Stator Testcase.

Keywords: aerodynamic shape optimisation, CAD-based sensitivities, gradient method

1 INTRODUCTION In engineering workows it is common practice to maintain master CAD models, which then serve as a foundation for further design and development. In complex system designs these base geometries enable cross-department collaboration and therefore minimise the time needed to bring an industrial component to the production. However, preserving a CAD model description during a gradient-based aerodynamic

Computer-Aided Design & Applications, 15(1), 2018, bbb-ccc © 2018 CAD Solutions, LLC, http://www.cadconferences.com 2

shape optimisation does not work to the full extent due to missing or inexact gradient information from a CAD system. High-delity shape optimisation of immersed bodies subject to uid dynamics, such as aeroplanes, turbines, vehicles or ducts, requires very rich design spaces with many design variables. Tackling these rich design spaces is not computationally feasible with stochastic optimisation methods such as Evolutionary Algorithms. Gradient-based optimisation has been shown to be feasible, and has widely been adopted for these problems. The optimisation community has put a lot of eort into developing methods that compute gradients of objective functions with respect to mesh point perturbation for Computational Fluid Dynamics (CFD) solvers. In particular, the adjoint method [12,8,5, 15, 10] allows to compute these gradients accurately, consistently and with low computational cost. The next step is to dene a parametrisation of the shape. A simple approach is the node-based approach where the design variables are the displacement of the grid nodes on the shape. Although the mesh nodes positions present the richest design space that computational tools can expose, the approach allows surfaces with oscillatory high-frequency noise. This could be tackled with regularisation (smooth- ing) [9]. Alternative approaches are Free Form Deformation [14] or radial basis function [3]. Afterwards, the optimised mesh is imported back to CAD, but this usually inquires signicant approximations and inaccuracies degrading the quality of the optimum. On the contrary, CAD-based methods always keep the CAD representation during the optimisation, while obtaining the necessary CAD sensitivity infor- mation is more challenging. Robinson et al. [13] apply nite dierences to the parametric CAD models created in commercial 'black-box' CAD system. The CAD sensitivity is computed as the dierence be- tween the original CAD model and the one with the perturbed design parameters. Similar approach is followed in [4], where nite dierences are applied to the open-source CAD-kernel Open CASCADE Technology (OCCT). Additionally, several often used CAD primitives and shapes (cube, sphere, etc.) are complemented with analytical derivatives. In [19] a small in-house CAD kernel was automatically dier- entiated and provides analytical derivatives for NURBS. In this paper we exploit recently dierentiated version of the OCCT kernel [1], [2]. Although dierentiation of a complete CAD-kernel is a non-trivial and time-consuming task, it allows us to get exact derivatives without numerical noise in any of CAD modelling algorithms. This makes the dierentiated OCCT practical for wide range of parametrisa- tions and geometrical manipulations. Moreover, the eciency of the sensitivities computation is in most cases superior than with previously mentioned nite dierences, which encourages shape exploration in large-dimensional CAD spaces. The design space set-up is crucial for aerodynamic shape optimisation in CAD-based methods, since it allows to eectively tweak the corresponding ow physics. Therefore, widely used parametric CAD models require from the designer a proper engineering judgement during initial design. To respond to these challenges, several application-specic parametrisation tools were developed [6], [17]. Taking to account extensive engineering experience, these tools allow to parametrise the shapes with conventional and intuitive design parameters (trailing/leading edge radius, blade thickness, wing span, etc.). These parameters are then varied during the design optimisation loop. Furthermore, an explicit control over design variables also allows to incorporate geometrical constraints directly in the parametrisation. Alternatively to the previous approach, instead of changing the parameters of the model's construc- tion algorithm, one can directly modify the geometry of the resulting shape, so-called BRep (Boundary Representation) [19], [21]. Changes to this BRep data (control points positions and weights of corre- sponding NURBS) eliminate the initial parametrisation, but propose rich design spaces, which could be easily rened even further by inserting additional control points. Hence, this method serves better the ultimate goal of optimisation, potentially exploring non-conventional designs. The method is CAD- vendor independent, and requires only a generic CAD-le (STEP, IGES, etc.), eluding problems with parametrisation tree and making the optimisation more automatic.

Computer-Aided Design & Applications, 15(1), 2018, bbb-ccc © 2018 CAD Solutions, LLC, http://www.cadconferences.com 3

Therefore we address two major elements that prevent integration of CAD into the design loop: a) Absence of necessary CAD sensitivity functionality (gradients of CAD surfaces with respect to the constructing design parameters), usually not available in the CAD systems. To overcome this problem, we use our algorithmically dierentiated OCCT kernel. b) Poor parametrisations that cannot capture shape variations originating from adjoint CFD. We consider two distinct approaches to control the shape changes: the rst updates the explicit design parameters of a CAD model; the second modies positions of NURBS control points and ensures resulting shape remains watertight (continuity and smoothness of the model). In this paper the dierentiated OCCT is used to optimise TU Berlin Stator Case [23] and to compute necessary CAD derivatives. A brief introduction to the OCCT dierentiation can be found in Sec.2. Parametrisation of the stator blade with conventional turbomachinery parameters is described in Sec.4. Section5 describes the necessary ingredients for NURBS-based optimisation including corresponding constraint impositions, followed by results for both approaches in Sec.6.

2 AUTOMATIC DIFFERENTIATION OF OCCT CAD-KERNEL Geometrical sensitivities of CAD model w.r.t. its parametrisation are necessary to perform CAD-based shape optimisation. The exact derivatives are obtained by algorithmic dierentiation (AD) of the open- source CAD-kernel Open CASCADE Technology (OCCT) using the AD software tool ADOL-C (Auto- matic Dierentiation by OverLoading in C++)[2]. The ADOL-C tool requires all variables that may be considered as dierentiable quantities to be declared as an adouble type to denote an active variable. This requires one to replace the type declaration of almost all oating point variables in the source code to the adouble type. The idea although straightforward to implement requires signicant man-hours to x compile and run-time errors. ADOL-C [18] provides two kinds of dierentiation options: (i) trace-based and (ii) traceless. Each one implements a dierent version of the adouble class leading to two distinct computational algorithms. In the trace-based option, operator-overloading is used to generate an internal representation (trace) of the function to be dierentiated. Then the ADOL-C driver routines are executed on the generated trace to compute the necessary gradients. In the traceless mode, the gradient computation is propagated directly during the function evaluation, along with the function values. This mode is simpler to use as every overloaded operator embeds both primal and gradient code in its denition. On the contrary, it is not as powerful as the trace-based option since only the forward/tangent mode of AD is possible. In the trace-based option both the forward/tangent and reverse/adjoint mode of AD are possible, where reverse mode of AD can dramatically reduce the temporal complexity of the gradient computation. The theory behind the forward and reverse mode can be found in reference [7]. We successfully dierentiated OCCT using both trace-based and traceless modes provided by ADOL- C. Hence it is possible to compute the CAD sensitivities (i.e., gradients of CAD surface points w.r.t. design parameters of the model) both in the forward and reverse mode of AD. We veried the correctness of the dierentiated CAD kernel against (central dierence) nite dierence results. The geometric algorithms involved in the TU Berlin Stator blade parametrisation in OCCT were also individually veried for correctness against nite dierence. A qualitative comparison of AD and FD surface sensitivities w.r.t. one design parameter is shown in Fig.2. In order to validate the reverse mode dierentiation of OCCT against the forward mode of AD, we developed an optimisation test-case within the CAD system. It is organised as follows:

1. Construct two blades: original and perturbed one, see Fig.1.

Computer-Aided Design & Applications, 15(1), 2018, bbb-ccc © 2018 CAD Solutions, LLC, http://www.cadconferences.com 4

(a) Original stator blade shape (b) Perturbed stator blade shape

Fig. 1: CAD optimisation with two stator blades

2. Sample nal NURBS surfaces with 20K pairs of (u, v) parametric coordinates. These parametric coordinates are later used in NURBS algorithms to evaluate the corresponding three-dimensional points (x, y, z). 3. Dene an objective function as the sum of squared distances of all (x, y, z) point pairs. 4. Declare the original design parameters as independent variables of the system. 5. Minimise the objective function by using the limited-memory BFGS optimisation algorithm with boundary constraints (L-BFGS-B) [22].

The primary objective of this test case is to match the surfaces of two blades by modifying the design parameters of the original blade. Since we have two versions of dierentiated OCCT kernel, one compiled with traceless and another one with trace-based ADOL-C headers, the optimisation was performed twice. We observed small dierences between the gradients obtained from the two modes of AD, as shown in Fig.3. Similar dierences (same order of magnitude) were present in the primal results. We attribute the dierence to oating-point round-o errors, since the oating point operations (and order) dier between traceless and trace-based ADOL-C headers. The dierences relative to the objective function value, which is O(·105) are quite insignicant. The high peaks in dierences occur, for example near gradient index 100 (Fig.3), in the regions of low sensitivity values where round-o errors dominate. The run-time ratios of the optimisation test-case for both forward and reverse mode AD are shown in Table1. Note that the run-time ratio is dened as the ratio between the original and dierentiated OCCT sources. The trace-based reverse mode AD is quite ecient and it is overall 47% faster than the traceless forward mode for the optimisation test-case.

Original sources AD Forward mode (traceless) AD Reverse mode (trace-based) Avg. time (seconds) 0.09 13.27 6.99 Run-time ratio 147.44 77.67

Table 1: Timings for initial blade optimisation iteration done with original and dierentiated (AD) sources

Computer-Aided Design & Applications, 15(1), 2018, bbb-ccc © 2018 CAD Solutions, LLC, http://www.cadconferences.com 5

Fig. 2: Blade sensitivities evaluated by AD (left) and Finite Dierences (right)

5 10− 1.0 × Iteration: 0 0.8 0.6 0.4 0.2

Difference 0.0 0.2 − 0.4 − 0.6 − 0 50 100 150 200 Gradient index

Fig. 3: Gradient dierences between two modes of AD for initial blade optimisation iteration

3 DIFFERENTIATED OCCT AND ADJOINT CFD COUPLING In a typical aerodynamic shape optimisation process one minimises a cost function J (usually scalar like lift, drag, etc.) with respect to the CAD geometry with design parameters α and subject to geometry and ow constraints R [8]: min J(U(X(α)),X(α), α) (1) α R(U(X(α)),X(α)) = 0 . (2) Equation (2) describes the ow eld within the domain of interest by system of Reynolds-Averaged Navier-Stokes equations, with the state variable U and a computational mesh coordinates X, which depend on design parameters α. In case of large amount of design parameters (usually the case in industrial applications) the adjoint method proves to be computationally ecient and could be derived by application of a chain rule to the system (1)-(2) yielding:

dJ h dJ i∂X = + νT f , (3) dα dX ∂α where ∂R f = − . (4) ∂X

Computer-Aided Design & Applications, 15(1), 2018, bbb-ccc © 2018 CAD Solutions, LLC, http://www.cadconferences.com 6

Here ν represents the solution of adjoint equations:  ∂R T ∂J ν = . (5) ∂U ∂U After computing the solution of primal and adjoint equations (2),(5), one can rewrite cost function gradient in terms of surface grid points derivatives:

dJ dJ dX = S . (6) dα dXS dα Here, the relation (spring analogy, inverse distance weighting) between volume and surface grid points

displacement is used X = X(XS). The rst term in (6), usually called CFD sensitivity, corresponds to the ow sensitivity in the surface grid points XS. These derivatives could be calculated by several available CFD solvers that have implemented the adjoint method. In this work we use our in-house discrete adjoint solver STAMPS (previously mgopt)[20].

The second term (CAD sensitivity) represents the derivative of the surface grid points XS with respect to the CAD model design parameters. This part is calculated in the automatically dierentiated version of OCCT [1]. The dierentiated OCCT provides the derivatives for almost every possible CAD parametrisation and geometrical manipulation. Equipped with these derivatives, we compose them in the total gradient, which is then used in iterative gradient-based optimisation loop:

dJ α(n+1) = Aα(n), (α(n)) , (7) dα with A as an optimisation algorithm. Next sections describe two cases of the above mentioned method, depending on the nature of CAD design parameter α: as design variable in parametric CAD model or BRep/NURBS parametrisation.

4 PARAMETRIC CAD-MODEL FOR TU BERLIN STATOR AND CONSTRAINTS The TUB TurboLab Stator Blade [23] is a typical turbomachinery optimisation testcase, where geo- metrical constraints strongly inuence the nal optimised shape. The test case prescribes the following geometrical constraints on the blade: (i) minimum radius of the leading and the trailing edge, (ii) mini- mum thickness of the blade (iii) minimum thickness near the hub and the shroud to accommodate the four mounting bolts and (iv) constant axial chord length. In the present work, we re-parametrised the blade in OCCT such that all constraints except the thickness constrains for the mounting bolts are explicitly embedded in the parametrisation. These constrains can readily be provided to any optimiser workow.

4.1 2D Prole Parametrisation The blade parametrisation starts by dening a 2d prole. We used B-spline curves to represent the 2d blade proles, since they provide a rich and exible space for the parametrisation [17]. The 2d blade prole is generated using a camber-line (shown in Fig.4) represented by a B-spline curve and characterised by seven control points. We distribute eight reference points (P 1, ..., P 8), as shown in Fig.4, along the camber line using a cosine function. The cosine function is used to cluster points near the leading and trailing edge (LE and TE) of the camber-line. The control points for the suction and pressure side B-splines curves are generated as equidistant osets of the reference points normal to the camber-line (Fig.4). Finally, the suction and pressure side curves are smoothly joined using the specied radius of curvature satisfying G2 continuity.

Computer-Aided Design & Applications, 15(1), 2018, bbb-ccc © 2018 CAD Solutions, LLC, http://www.cadconferences.com 7

LE C LE A H d1 C B d2 Camber-line

d3 A

d4 d4

d5 d5

d6 d6

d7 d7 d8 d8 TE TE TE Fig. 4: Left: Camber-line (blue) with corresponding control polygon (red) and uniform point distribution; Right: Construction of pressure/suction control points; Imposition of curvature (G2 continuity) at the LE

The AB length (Fig.4) in a B-spline curve of degree n is:

r n − 1 AB = curvature · CH · (8) n where AB is the distance between control point A and B and CH is the distance of control point C from the AB line. Therefore, it is possible to impose the curvature in the point A. This approach is applied to suction and pressure B-splines. In particular, the two curves have the same radius of curvature at the LE. This radius is controlled as design parameter of the optimisation. The same approach is also used for the TE radius. Thus the G2 continuity is kept along all the section. In summary, the 2d prole consists of 23 parameters of which, (i) 10 parameters control thickness (2 of them are the radii of TE and LE) and (ii) 13 parameters control the camber-line movement and, therefore, its angle, as shown in Fig.5.

4.2 3D Parametrisation The 3d blade parametrisation is based on a cross-sectional design approach - the lofting. This approach takes n-slices (2d proles) as input and constructs nal B-spline surface using an OCCT approximation tool. The slices are generated along a blade span dened as a B-spline curve, the path-line. Each 2d prole parameter is characterised by a law of evolution along the path-line. The laws are dened as B-spline curves, consisting of 8 control points each. These control points are the design parameters of the optimisation. Their total number is 184 (23 · 8). An example of the blade construction using seven slices is shown in Fig.6.

4.3 Optimisation Constraints The limited memory BFGS algorithm with boundary constraints (L-BFGS-B) is used as optimiser. The constraints specied in the L-BFGS-B are as follows:

ˆ G2 continuity: imposed along all the section based on the geometrical construction. ˆ Axial chord: the axial-coordinate of the last camber-line control point is set equal to the axial- coordinate of the rst control point plus the constant axial chord value.

Computer-Aided Design & Applications, 15(1), 2018, bbb-ccc © 2018 CAD Solutions, LLC, http://www.cadconferences.com 8

LE Radius

Camber-line control points Path-line

Blade thickness

TE Law of Evolution TE Radius

Fig. 5: Section parameters Fig. 6: Blade skeleton and TE law of evolution in the 3D domain

ˆ Thickness distribution: the thickness between the suction and pressure surface is approximated using the corresponding B-Spline control point distances. Therefore this constraint has to be veried a posteriori. ˆ LE and TE radii: The lower bound values are specied.

5 NURBS-BASED OPTIMISATIONS AND CONSTRAINTS The NURBS-based optimisation technique with continuity and geometrical constraints (so-called NSPCC approach) was initially proposed in [19] and [21]. In this paper, we extend and automate the NSPCC method further. The authors in [19] use a modest in-house CAD kernel, but we substitute it with a comprehensive OCCT CAD kernel and benet from the extensive CAD functionality. The major updates and novelties are related to the renement of the CAD-space, new constraints capabilities (curvature), recovery of the violated geometrical constraints and the storage of the constraints in standard CAD formats. In the current NSPCC version the role of the CAD tool is more profound, while the amount of manual constraint set-up is reduced. This brings NURBS-based optimisation closer to the industrial workows and creates an alternative to parametric CAD-models optimisation.

5.1 NURBS-based Design The advantage of NURBS-based approach is that in most cases no preprocessing (understanding of initial parametrisation tree, re-parametrisation in another tool, aerodynamic intuition to dene proper CAD space, etc.) is needed. CAD-vendor neutral boundary representation could be retrieved directly from the standard CAD les (STEP, IGES, etc.), which usually contain collection of NURBS patches. Since OCCT is already equipped with an ecient reader of standard CAD formats, its dierentiated version allows to compute the sensitivity information in any point of the surface with respect to control points position of governing NURBS. Therefore the CAD sensitivity dened in Eq.6 is obtained for every surface:

Computer-Aided Design & Applications, 15(1), 2018, bbb-ccc © 2018 CAD Solutions, LLC, http://www.cadconferences.com 9

Fig. 7: Left: Initial (9x22) and rened(18x22) Control Point Net of TUB Stator; Right: Corresponding changes in CAD Surface Sensitivity with respect to movement of the single control point

−−−−−−−−−−−−−−−−−−−−−−−−→3 × N     ∂XS1 ∂XS1 ··· ∂XS1  ∂P1 ∂P2 ∂PN ∂XS ∂XS   . . .. .  = = 3 × M   . . . .  . (9) ∂α ∂P     ∂XSM ∂XSM ··· ∂XSM y ∂P1 ∂P2 ∂PN

Here M and N are the total number of surface mesh points XS and control points P respectively. Moreover, with OCCT one can easily and intuitively rene design space by adding extra control points with knot insertion algorithm [11]. This operation does not change the shape or degree of the surface, but establishes more local control due to local support properties of the splines. This is clearly visible in the changing pattern of the CAD sensitivities shown in Fig.7. These very narrow sensitivities potentially could cope better with small ow features not 'visible' for more global parametric sensitivity (Fig.2). At the moment, the renement is performed manually prior to the optimisation, but this process can be automated with the CFD sensitivity eld as a sensor for renement. It is important to note that in some cases the NURBS surfaces extracted from standard les are not suitable for direct NURBS-based optimisation due to enormous clustering of control points (sometimes as ne as the computational mesh). The root of this problem lies in the creation of the initial shape (morphed from STL, extensive surface trimming, etc.). In these cases reverse engineering and re-approximation of the surfaces might be required.

5.2 Constraints CAD models are usually constructed from multiple adjacent patches. Therefore, modications of control points individually on patches can violate (i) patch-continuity (holes between the CAD faces, non-smooth shapes) or (ii) other geometrical constraints. We alleviate this problem by ltering out the shape modes

Computer-Aided Design & Applications, 15(1), 2018, bbb-ccc © 2018 CAD Solutions, LLC, http://www.cadconferences.com 10

Face1 Face1 PCurve2 Face1 Face2 PCurve3 PCurve1 (u2,v2)

PCurve4

Edge1

Face2 (u1,v1) Edge1 Face2 Edge2

Fig. 8: Left: TUB Stator Topology; Middle: Test-points distribution along PCurves of the common edge; Right: Test-points on generic PCurves of surfaces

with undesired constraints violations using discrete spaces constructed using test-points [19]. Conceptu- ally, the approach requires that the constraints are satised on the particular set of points dened on the surface (test-points). We avoid distinguishing the continuity and the geometrical constraints by bringing them under one framework. In the TUB stator test-case, several geometrical constraints are present and were introduced in the previous section. Several methods were devised to accelerate and automate the process of test-point distribution. Firstly, we identify topological entities (e.g. edges, parts of surfaces, etc.) necessary for constraint imposition. For instance, to distribute test-points along the leading edge (curvature and continuity constraints), we use OCCT to nd two parametric curves (PCurves) of the edge on two adjacent faces (Fig.8). Then we use OCCT to uniformly distributes points (in 1d parametric space) along each PCurve. As a result two pairs of test-points are generated each belonging to the respective PCurves. The test-point pairs along the edge1 (LE) and edge2 (TE) are then used to impose continuity and curvature constraints. It is also possible to generate test-point pairs on PCurves at arbitrary location on a given patch face (connect the predened endpoints (u1, v1) and (u2, v2) in the parametric space of the face). The generated test-points pairs are then used to impose thickness constraints between the two patches of the Stator. The treatment of constraints on a topological level allows to store these PCurves in a standard CAD le. This enables visualisation and inspection of the constraints during optimisation. For example in Fig.9 the pairs of PCurves are shown, where PCurves pairs are identically coloured. In addition, the PCurves can be stored and visualised as wire-frame objects with vertices as test-points. Once all necessary test-points are distributed, standard OCCT geometric algorithms (distance, cur- vature, normal, etc.) can be used to compute the following constraints: ˆ Distance constraints

To x the distance dr between two test-points (Xt1,Xt2), the following function is constructed:

Cd = distance(Xt1,Xt2) − dr = 0 . (10)

This constraint is used to ensure G0 continuity (dr = 0 is then used) and the constant axial chord length. Similarly, the minimum thickness (Tmin) constraint, which is required in the middle of the blade and for the bolts, corresponds to inequality constraint and is represented with:

distance(Xt1,Xt2) Cd = 1 − min 1, = 0 . (11) Tmin ˆ Radius of curvature constraint OCCT allows to compute minimum and maximum curvature in any point of the surface. Therefore,

Computer-Aided Design & Applications, 15(1), 2018, bbb-ccc © 2018 CAD Solutions, LLC, http://www.cadconferences.com 11

Face1

Cd3 Cd2 Cd1 Cr1 Cr2 Face2

Fig. 9: Left: Constraint visualisation from the STEP le; Right: Constraints computation on the test- points

the radius in the test-point corresponding to TE and LE can be calculated as r = 1/curvature(Xt1). Constraint function bounding the minimum radius value to (rmin) is: r  Cr = 1 − min 1, = 0 . (12) rmin ˆ Smoothness constraint G1 continuity can be imposed as:

Cs = normal(Xt1) × normal(Xt2) = 0 . (13)

The min operator in Eq. 11 and Eq. 12 is used to 'activate' inequality constraint if it gets violated, and 'deactivate' it (constraint value is zero) otherwise. With dierentiated OCCT we assemble derivatives of all constraint-functions into the constraint matrix: −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−→T     ∂Cd1 ∂Cd2 ··· ∂Ccr1 ∂Ccr2 ··· ∂Ccr  ∂P1 ∂P1 ∂P1 ∂P1 ∂P1 ∂Cx   ......  C = = 3 × N   ......  . (14) ∂P     ∂C ∂C d1 d2 ··· ∂Ccr1 ∂Ccr2 ··· ∂Ccr y ∂PN ∂PN ∂PN ∂PN ∂PN Here T correspond to the number of all above-mentioned constraints. Afterwards, the constraint matrix is used in the nite step update: h iT P n+1 = P n + t · Ker(C) (∇J)Ker(C) , (15) where ∂J ∂X ∇J = S . (16) ∂XS ∂P Computer-Aided Design & Applications, 15(1), 2018, bbb-ccc © 2018 CAD Solutions, LLC, http://www.cadconferences.com 12

The last equation is equivalent to one step of a projected gradient method with a step size of t. Here Ker(C) is the kernel of the constraint matrix. This ensures that the control point perturbations are in the null space of the constraint matrix i.e., control points are modied without violating the constraints (at least for innitesimal step-size).

5.3 Constraint Recovery Due to non-linearity of constraints (G1, curvature) and inequality constraints (some constraints are inactive) they could be violated after the nite step - Eq. (15). To overcome this, we have extended the continuity recovery method proposed previously in [19] to all type of constraints.

First, by means of OCCT we indicate constraints that are indeed violated (|δGd,r,s| = |Cd,r,s| > ) and input them into violation vector . We decompose constraint matrix δGviolated = (δG1, ..., δGNviolations ) into two matrices C = Cviolated ∪ Csatisfied with columns entries corresponding to violated or satised constraints respectively. Afterwards, the necessary control point update could be dened:

CviolatedδPupd + δGviolated = 0 , (17) which also have to satisfy the rest of the constants:

δPupd = Ker(Csatisfied)δα , (18)

where α corresponds to the coecients of linear combination of null space vectors. This could be further developed as:  + δPupd = −Ker(Csatisfied) CviolatedKer(Csatisfied) δGviolated . (19) Here, superscript + corresponds to the pseudoinverse of rectangular matrix and usually only few Newton steps are needed to recover constraints. The implications of this approach goes beyond shape optimisation and could be applied directly on CAD shapes, which does not satisfy some certain requirements. We have used the TUB stator model with TE radius r = 0.7 and imposed minimum curvature/radius constraint there r = 1. This created constraints violations corresponding to every test-point located on the TE. Results of the recovery step with single Newton step are shown in Fig. 10, with all constraints satised for the updated red surface.

Fig. 10: Recovery/Increase of TE radius from initial (grey) to updated (red)

Computer-Aided Design & Applications, 15(1), 2018, bbb-ccc © 2018 CAD Solutions, LLC, http://www.cadconferences.com 13

6 AERODYNAMIC SHAPE OPTIMISATION OF TU BERLIN STATOR 6.1 Optimisation Workow This subsection summarises the main steps that we use for redesign of the TU Berlin Stator. The algo- rithm is generic and can be applied without major changes to any other aerodynamic shape optimisation problem. To set up a new test-case, one has to provide new parametrisation and the corresponding CFD mesh. We refer to two aforementioned parametrisation as a) for parametric and b) for BRep. Both of them could be used in two distinct optimisation procedures:

1. Dene parametrisation and design surfaces.

2. Perform mesh point inversion (nd mesh points XS that belong to the design surfaces). 3. Run primal and adjoint CFD (get cost function value), compute CFD sensitivity: dJ . dXS

4. Compute CAD sensitivity dXS depending on the chosen parametrisation: dα 4.a) parametric approach: use dierentiated OCCT to get sensitivities w.r.t the explicit design parameters (Sec.4); 4.b) NURBS-based approach: use dierentiated OCCT to compute gradients w.r.t. the control points positions and to construct corresponding constraint matrix C (Sec.5).

5. Compose total gradient dJ = dJ dXS . dα dXS dα 6. Update design parameters using dJ , change CAD geometry and corresponding mesh: dα 6.a) update design parameters using L-BFGS-B optimiser. Geometrical constraints are automati- cally satised and lie within prescribed bounding values (Eq.7); 6.b) update control points positions. Geometrical constraints are satised due to the projected gradient. Constraint matrix 'lter' ensures updates do not violate constraints (Eq. 15). 7. Repeat 3-6 until no further cost function improvement is possible.

8. Retrieve the optimised shape directly in the CAD format.

6.2 Optimisation Results The main focus of this paper is to demonstrate a feasible approach to include a complex CAD model in a gradient-based optimisation chain. At this stage we use low-delity CFD simulations, but without any limitation this allows to test and demonstrate the strength of both aforementioned CAD parametrisations in the design chain, however restrain us from the detailed discussions on the physics of the initial and optimised ow results. Therefore, we generated a coarse computational grid with ICEM CFD from the existing CAD model and used it for ow simulations in the STAMPS solver. We perform two optimisations (explicit Parametric-based and implicit NURBS-based) to minimise the total pressure losses between the inlet and the outlet of the TU Berlin Stator. Two dierent optimisers were used, L-BFGS-B for the explicit and Steepest-Descent (with projected gradient) for the implicit parametrisation. The corresponding optimised CAD models are shown in Fig. 11 together with the initial shape. In both cases we observe similar patterns of decrease of the leading edge and trailing edge radius and reduction of the blade thickness, while all geometrical constraints are satised. The optimised parametric and NURBS models improve the the cost function by 14% and 13% respectively.

Computer-Aided Design & Applications, 15(1), 2018, bbb-ccc © 2018 CAD Solutions, LLC, http://www.cadconferences.com 14

Initial Mid Section Parametric Optimised Mid Section NSPCC Optimised Mid Section

Fig. 11: Left: Initial TU Stator (red), Optimised Parametric model (blue) and Optimised NURBS (green); Right: Comparison of mid-sections

As highlighted in the comparison (Fig. 11) at the mid-section, the two optimised shapes are dierent, which originates from the dierences in parametrisations and constraints. Judging by the CAD sensitivi- ties (NURBS space generates very local sensitivities) the NUBRS-based approach could actually provide superior results. But contrary to the parametric model, it includes additional constraints for the mount- ing bolts. This results in a thicker blade towards the shroud and hub ends of the blade where the bolts are located. The imposition of identical constraints and use of high-delity CFD (increases the impact of CAD sensitivity locality) could enable further investigation of the occurring dierences between two parametrisations.

7 CONCLUSIONS We have successfully demonstrated the integration of a large-scale CAD system into the design chain for shape optimisation of immersed bodies. The OCCT CAD kernel that is algorithmically dierentiated to compute shape derivatives is the cornerstone ingredient: it provides the necessary CAD sensitivities eciently, accurately and robustly. The approach allows to maintain CAD-models throughout the opti- misation loop thus enabling work in a multi-disciplinary framework. In addition to aerodynamic shape optimisation, the coupling of the dierentiated OCCT with structural analysis, conjugate heat transfer and robust design problems will be investigated in the future. The derivative information available in OCCT is also useful in a purely CAD context: (i) re-parametrisation of the models (formulated as the optimisation problem that tweaks parameters values to nd the best 't' to the target geometry); (ii) recovery of the violated geometrical constraints. Two dierent parametrisation techniques for aerodynamic shape optimisation of an industrial turbo- machinery blade were proposed. For both of them the recipes for imposing manufacturing (geometrical) constraints were detailed. The storage of constraints in the standard CAD les and hence their visualisa- tion and inspection is possible for the NURBS-based approach. The choice of either of the parametrisation for optimisation of an arbitrary CAD-model is case-dependent, since both approaches perform design ex- plorations in the dierent spaces. The parametric CAD models are useful for the applications when decent

Computer-Aided Design & Applications, 15(1), 2018, bbb-ccc © 2018 CAD Solutions, LLC, http://www.cadconferences.com 15

parametrisations are well established through the previous engineering experience. The NURBS-based approach could then serve as the complementary or the alternative technique which is advantageous for the optimisation of non-conventional components.

8 ACKNOWLEDGEMENTS This research is a part of the IODA project - Industrial Optimal Design using Adjoint CFD. IODA is Marie Sklodowska-Curie Innovative Training Network funded by European Commission under Grant Agreement No. 642959.

REFERENCES [1] Auriemma, S.; Banovic, M.; Mykhaskiv, O.; Legrand, H.; Müller, J.-D.; Walther, A.: Optimisa- tion of a U-bend using CAD-based adjoint method with dierentiated CAD kernel, ECCOMAS Congress, 2016. https://doi.org/10.7712/100016.2089.10065 [2] Banovic, M.; Mykhaskiv, O.; Auriemma. S.; Walther, A.; Legrand, H.; Müller, J.-D.: Automatic Dierentiation of the Open CASCADE Technology CAD System and its coupling with an Adjoint CFD Solver, http://www.optimization-online.org/DB_HTML/2017/03/5931.html [3] De Boer, A.; Van der Schoot, M. S.; Bijl, H.: New method for mesh moving based on radial basis function interpolation, In ECCOMAS CFD 2006: Proceedings of the European Conference on Computational Fluid Dynamics, 2006. [4] Dannenhoer, J.; Haimes, R.: Design sensitivity calculations directly on CAD-based geometry. In 53rd AIAA Aerospace Sciences Meeting, 2015. https://doi.org/10.2514/6.2015-1370 [5] Economon, T. D.; Palacios, F.; Copeland, S. R.; Lukaczyk, T. W.; Alonso, J. J: SU2: An Open- Source Suite for Multiphysics Simulation and Design, AIAA Journal, 54(3), 2015, 828-846. [6] Gräsel, J.; Keskin, A.; Swoboda, M.; Przewozny, H.; Saxer, A.: A full parametric model for turbomachinery blade design and optimisation, In ASME 2004 International Design Engineering Technical Conferences and Computers and Information in Engineering Conference, 2004, 907914. [7] Griewank, A.; Walther, A.: Evaluating Derivatives: Principles and Techniques of Algorithmic Dierentiation, 2nd ed., Society for Industrial Mathematics, 2008. https://doi.org/10.1137/1.9780898717761 [8] Jameson, A.: Aerodynamic Design via Control Theory, Journal of Scientic Computing, 3, 1988, 233260. https://doi.org/10.1007/BF01061285 [9] Jameson, A., Vassberg, J. C.: Studies of alternative numerical optimization methods applied to the brachistochrone problem, Computational Fluid Dynamics Journal, 9(3), 2000, 281-296. [10] Jones, D., Müller, J. D., Christakopoulos, F.: Preparation and assembly of discrete adjoint CFD codes, Computers & Fluids, 46(1), 2011, 282-286. https://doi.org/10.1016/j.compfluid.2011.01.042 [11] Piegl, L.; Tiller, W.: The NURBS book, Springer Science & Business Media, 2012. [12] Pironneau, O.: On optimum design in uid mechanics, Journal of Fluid Mechanics, 64, 1974, 97-110. [13] Robinson, T. T.; Armstrong, C. G.; Chua, H. S.; Othmer, C.; Grahs, T.: Optimizing parameter- ized CAD geometries using sensitivities based on adjoint functions, Computer-Aided Design and Applications, 9(3), 2012, 253-268. https://doi.org/10.3722/cadaps.2012.253-268 [14] Samareh, J.: Aerodynamic shape optimization based on free-form deformation, 10th AIAA/ISSMO Multidisciplinary Analysis and Optimization Conference, 2004.

Computer-Aided Design & Applications, 15(1), 2018, bbb-ccc © 2018 CAD Solutions, LLC, http://www.cadconferences.com 16

[15] Stück, A.: Adjoint Navier-Stokes methods for hydrodynamic shape optimisation. Ph.D. Thesis, Technical University of Hamburg-Harburg, 2012. https://doi.org/10.2514/6.2004-4630 [16] Vasilopoulos, I.; Flassig, P; Meyer, M.; Reiche K.: Aerodynamic Optimization of the TurboLab Stator: A Comparative Study between Conventional and Adjoint-based Approaches, In Interna- tional Conference on Numerical Optimisation Methods for Engineering Design NOED, 2016. [17] Verstraete, T.: CADO: a computer aided design and optimization tool for turbomachinery appli- cations, In 2nd Int. Conf. on Engineering Optimization, 2010, 69. [18] Walther, A.; Griewank, A.: Getting Started with ADOL-C, In Combinatorial scientic computing, Chapman & Hall/CRC Computational Science, Dagstuhl Seminar Proceedings, 2012, 181-202. https://doi.org/10.1201/b11644-8 [19] Xu, S.; Wolfram, J.; Müller J.-D.: CAD-based shape optimisation with CFD using a dis- crete adjoint, International Journal for Numerical Methods in Fluids, 74(3), 2013, 153-168. https://doi.org/10.1002/fld.3844 [20] Xu, S.: CAD-based CFD shape optimisation using discrete adjoint solvers, Ph.D. Thesis, Queen Mary University of London, 2015. [21] Xu, S.; Radford, D.; Müller, J.-D.: CAD-based adjoint shape optimisation of a one-stage turbine with geometric constraints, ASME Turbo Expo, 2015. [22] Zhu, C; Byrd, R.H.; Lu, P.; Nocedal, J.: Algorithm 778: L-bfgs-b: Fortran subroutines for large- scale bound-constrained optimization, ACM Transactions on Mathematical Software, 23, 1997, 550-560. https://doi.org/10.1145/279232.279236 [23] TU Berlin Stator Testcase, http://aboutflow.sems.qmul.ac.uk/events/munich2016/benchmark/testcase3

Computer-Aided Design & Applications, 15(1), 2018, bbb-ccc © 2018 CAD Solutions, LLC, http://www.cadconferences.com