Instantly predict design behavior with Python based Response Surface Models
Written by Alberto Clarich, Danilo Di Stefano, Alessandro Viola and Riccardo Di Meo
29 November 2022 · 5 min read
Physics-based design optimization is essential in simulation-driven development to get reliable insights on the performance of real products. However, assessing the behavior of complex designs often requires a large number of simulations which can be both time consuming and computational expensive. In such circumstances, you should opt for statistical-based Response Surface Models (RSM) to approximate, analyze and simulate complex real world systems. With this approach, you can get an instant and accurate insight into the relationship between a set of design parameters and one or more design objectives. Then, you can use it to perform RSM-based optimization. This is helpful in all those situations where a simulation based on real-physics models would not be affordable in terms of computational time. But what about combining RSM with Python Machine Learning libraries?
RSM training with Python Machine Learning libraries
RSM or metamodels are statistical and numerical models that approximate the input and output behavior of the system. The idea is to run physics-based simulations on a limited number of designs and use them to create a mathematical function able to predict the behavior of the response variables more or less accurately. The behavior of the RSM model is determined by the algorithm and its parameters set by the user, which are computed by modeFRONTIER during the training phase.
All of this could already be familiar to anyone who has already used RSM techniques in the past. But there is more than this. In the engineering simulation world, deep expertise in scripting languages became a valuable skill set to perform data analysis. Python programming language gained popularity over the last decade due to its simplicity and flexibility. Its numerous Machine Learning (ML) libraries can be also beneficial to train and evaluate RSM.
Python-based RSM with modeFRONTIER
The creation of meta-models can be a complex and laborious task, especially in situations where high accuracy is required. With modeFRONTIER process automation and design optimization software, you can generate reliable metamodels that are effective in approximating the multivariate input/output behavior of complex systems with little computational effort. With the pyCONSOLE, the environment that integrates Python and the design space, you can evaluate RSM with the algorithms available in the Python world. The pyRSM module now adds the capabilities to train Python algorithms as RSM. This means using external Python Machine Learning libraries (such as scikit-learn) within modeFRONTIER to perform RSM analyses, with all the benefits that a modeFRONTIER RSM entails (sharing, charts creation, etc.).
Both training and evaluation features available for modeFRONTIER native RSM are also available for Python-based RSM. Basically, you can code your own Python algorithm in the script to train the model and evaluate it with exactly the same chart as modeFRONTIER native RSM.
With Python you can explore the complexity of training an accurate RSM model not only by giving access to the most advanced ML algorithms, but also by enabling a very flexible training strategy to build the most effective model for the dataset under consideration. As an example, multi-fidelity modeling, where the training strategy is able to leverage training data of different accuracy, can be quickly implemented by using dedicated python libraries, as you will see in the following use case.
Application scenario: multi-fidelity Python-based RSM for airfoil aerodynamics optimization
The overall computational cost to train metamodels is generally lower than the one required by an optimization fed directly by numerical simulations. However, the computational cost to generate the training dataset can still be relevant in many cases, especially with high-fidelity (HF) simulations.
Multi-fidelity methodologies have been introduced to combine HF simulations with middle or low-fidelity ones (MF/LF), to train efficiently meta-models with a significantly lower computational cost. LF models can be obtained for instance from a model grid that is coarser than the HF one, or from a simulation model which introduces a higher level of approximation still keeping a good accuracy in the results. To prove the efficiency of the multi-fidelity methodology, it has been applied to an aeronautical test case.
A NACA0012 airfoil, in transonic conditions at Mach=0.6, Re=1.35E7, and angle of attack of 4°, has been simulated using ANSYS Fluent software, using two grids of different quality: the coarser grid (LF) has 30,000 elements while the refined one (HF) has 150,000 elements.
The baseline airfoil is parameterized in the modeFRONTIER workflow by adding two parametric Bezier curves of 4 control points on the upper and lower baseline profiles. The goal of the study is to train a Response Surface to predict the aerodynamic coefficients in function of the 8 parameters.
First, a uniform DOE of 50 LF simulations has been executed. Selecting by the Dataset Reducer DOE of modeFRONTIER the optimal subset of training points, 10 optimal sampling points have been re-evaluated by the HF grid.
The dataset made by the combination of 50 LF and 10 HF simulations is selected as a training set in the RSM Wizard of modeFRONTIER. Selecting the pyRSM module, it is then possible to import a Python script which calls the Multi-fidelity Cokriging algorithm from the public library of Surrogate Modeling Toolbox of University of Michigan.
Cokriging is a multi-fidelity surrogate model based on Bayesian theory, which aims at exploiting the cross-correlation between two or more Gaussian process surrogates through a stochastic auto-regressive scheme, yielding a predictive posterior distribution for the high-fidelity model output that encodes the contribution of lower fidelity levels with quantified uncertainty.
As result, the Cokigring RSM has proved to be more efficient than a single-fidelity RSM trained on the set of HF simulations only. The RSM trained by pyRSM can be used for every chart and tool, including RSM-based optimization, available in modeFRONTIER.
In conclusion, python RSM bridge in modeFRONTIER is a very effective way of dealing with complexity, at any level, when creating RSM models that have to be as accurate as possible to be used with confidence in your simulation design workflow. In this way, both the most advanced algorithms and flexible and customizable training strategies becomes an option, together with modeFRONTIER consolidated native RSMs.
modeFRONTIER is the leading software solution for simulation process automation and design optimization
Design better products faster
modeFRONTIER is the leading software solution for simulation process automation and design optimization
Design better products faster
modeFRONTIER is the leading software solution for simulation process automation and design optimization