NURBS-Based and Parametric-Based Shape Optimisation with DiErentiated CAD Kernel
Total Page:16
File Type:pdf, Size:1020Kb
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 Open Cascade Technology (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