1 Introduction

A Thermal Protection System (TPS) of a space capsule is able to withstand extreme thermal stresses which occur due to air friction of the high-speed vehicle in a re-entry scenario. A proper understanding of the re-entry boundary-layer dynamics on these blunt bodies is a mission critical aspect in order to improve the safety of space missions. The heat-transfer rate can increase by one order of magnitude in case laminar to turbulent transition of the boundary layer occurs [1]. However, a precise prediction of the laminar-turbulent transition is yet not possible and the physical mechanism is not fully understood in present literature. It is necessary to provide a base for future transition criteria by gaining a deeper understanding of the physical mechanism to provide a more reliable and safe spacecraft as well as to reduce cost and weight.

Laminar-turbulent transition on a space capsule has been observed despite the stabilizing effect of the highly accelerated flow over the capsule surface. Additionally, Hein et al. [2] observed small N-factors which can not trigger transition. This suggests roughness-induced transition as a possible underlying physical mechanism. Experimental studies on capsule geometries and the mission critical status of laminar-turbulent transition have been summarized by Schneider [3]. The study suggests further transition research. Furthermore, the investigation of roughness-induced transition relied heavily on experimental investigations due to the lack of computational resources in the past. A summary of blunt bodies with roughness experiments was described by Schneider [4]. Both isolated and distributed roughness patches are found to be the dominating cause for laminar-turbulent transition on a capsule geometry.

The influence of surface roughness on turbulent flow is summarized by Kadivar et al. [5]. The study provides various roughness parameters to classify roughness statistically and provides insights on the influence of roughness in various ranges of flow regimes. Kadivar et al. point out that the sand-grain roughness height can not describe the roughness effects on the turbulent flow in many cases.

In terms of roughness-induced hypersonic transitional flows, two different kind of roughness types are investigated in numerical studies: An isolated and a distributed roughness patch. For different isolated roughness elements, Several DNS were investigated by Van den Eynde et al. [6]. A Mach 6 flow over a flat plate with a roughness element was computed. The study took several different factors of the roughness element into account, e.g. the shape and the planform of the roughness. Disturbance levels of the freestream were also considered. It was noted that the transition process was not exclusively influenced by the frontal, but also by the aft section of the isolated roughness element. The detached shear layer at the ramped-down aft section of the roughness element was spread out and reduced in strength and led to a lower instability growth rate.

Di Giovanni and Stemmer [7] studied distributed roughness elements in a re-entry scenario of an Apollo-like space capsule. In the wake of the roughness, unsteady disturbances were amplified in cross-flow-type vortices. The highest amplification was observed in the vortices created by the highest skewed roughness peaks. The focus of the study was on the disturbance amplification for different chemical models (chemical equilibrium, chemical/thermal non-equilibrium). A destabilizing effect of the chemical non-equilibrium occurred in the proposed set-up.

A roughness with a sinusoidal and triangular base function with the same maximum roughness height were compared by Ulrich and Stemmer [8]. This setup was chosen to better understand the role of the roughness geometry of distributed patches in terms of their vorticity generation. For patches with a triangular base function, stronger streamwise vorticity was observed in the wake compared to sinusoidal ones. The growth of unsteady disturbances is analysed with a 2D Fourier transformation for both roughness types. The breakdown of the cross-flow-like vortex is observed for both sinusoidal and triangular roughness patches. For the triangular patch, transition is occurring further upstream, due to earlier disturbance amplification in the stronger wall-normal and spanwise gradients of the streamwise velocity.

The complexity of (possible) industry relevant rough surfaces on transitional flows is addressed by Thakkar et al. [9] in a study containing 17 rough surface samples. Different roughness effects were observed although all samples were scaled to the same roughness height (k=\(\delta \)/6) which once more underlines the necessity to consider the roughness topology and not only its maximum height. The authors present a method to compute \(\Delta \)U+ and the peak turbulent kinetic energy from surface parameters. Further, key surface parameters for the \(\Delta \)U+ calculation are identified, such as surface skewness and rms roughness height amongst others. The study focuses on the transitionally rough regime, but could be extended to fully rough regimes with significantly more data. Thakkar et al. show the feasibility to predict roughness effects with surface characteristics with a fitting method.

Brunton et al. [10] give an overview of the usage of machine learning (ML) methods in the field of computational fluid mechanics and emphasize its potential. Specifically on the influence of a rough distributed surface topology on turbulent flow, Jouybari et al. [11] introduce a Deep Neural Network (DNN) and Gaussian Process Regression (GPR) to predict the Nikuradse equivalent sand-grain height ks. The ML-based method performed significantly better compared to conventional polynomial models. An average prediction error of less then 10% was achieved for a database with different roughness types. Jouybari et al. hope to predict physics-related flow quantities, e.g., flow separation locations, with their approach in the future.

Lee et al. [12] use transfer learning to reduce the size of the high-fidelity training data set. The study uses a two-step approach to develop a machine learning-driven framework to compute the drag over a roughness patch. In the first step, the neural networks were informed with ’approximate’ knowledge based on empirical relations. With this information, the networks were fine tuned in the second step based on DNS data. The proposed configuration showed that drag prediction benefited significantly from the usage of transfer learning. The authors acknowledge that an increase of the training database size is necessary to also cover roughness where empirical relations are not investigated.

Distributed roughnesses are technically more relevant as they come closer to model an ablative surface of a space capsule. Since random distributed roughnesses have a limitless amount of possible parameters, we made the following considerations: The effect of roughness on laminar-turbulent transition can be roughly characterized by the roughness Reynolds number \(Re_{kk}\). For a large roughness heights in the order of the boundary layer thickness, transition is triggered immediately downstream of the roughness element (\(Re_{kk}>\)450). The effects of very small roughness heights are damped downstream in the accelerated flow of the capsule surface where the flow remains laminar. This Reynolds number is evaluated with flow parameters in the smooth wall flow regime at the roughness peak height. All investigated roughness patches in the database have a roughness Reynolds number of \(Re_{kk}=180\) corresponding to a maximum roughness height of \(h_\text {max}\)=4.3 mm or 18% of the boundary layer thickness. The roughness peak height was chosen as it does not trigger transition immediately. The roughness has the potential to generate a cross-flow-like vortex in the wake of the roughness patch eventually leading to laminar transition. The size of the individual roughness elements within the patch is representative for an ablative wake and is a technical representative roughness of reduced complexity as was already shown in detail by Di Giovanni and Stemmer [13]. In Ulrich and Stemmer [8], it could be shown that the dominant cross-flow-like vortex is formed by a peak and an adjacent valley and the chosen configuration would deliver destabilizing vortices. Larger or smaller wavelengths deliverer smaller vortex magnitudes less relevant for transition. These roughness wavelengths were omitted to simplify the model. The chosen configuration represents a low-order model of a pseudo-random ablative heat-shield surface.

The present study investigates the influence of different streamwise vorticity magnitudes and other flow parameters on the laminar transition process. It compares two different data-driven machine learning methods (Deep Neural Networks and Convolutional Neural Networks (CNN)) for the prediction of the streamwise vorticity magnitude as well as maxima of velocity gradients and the vortex core position. For training, validation and testing of the networks, a large DNS database is formed with 9180 simulations of a reduced domain containing a random distributed roughness patch. In the second part of the study the unsteady downstream disturbance evolution is investigated for the different vorticity magnitudes with a 2D Fourier transformation.

2 Governing equations

The investigation uses the unsteady three-dimensional compressible Navier–Stokes equations to perform Direct Numerical Simulations

$$\begin{aligned} \frac{\partial \rho }{\partial t} + \frac{\partial }{\partial x_{i}} \left( \rho u_{i}\right) =0, \end{aligned}$$
(1)

with the density \(\rho \) and the velocity component \(u_{i}\) in the Einstein summation notation. Further, we use the following momentum equations

$$\begin{aligned} \frac{\partial }{\partial t} \left( \rho u_i \right) + \frac{\partial }{\partial x_j} \left( \rho u_i u_j \right) = - \frac{\partial p}{\partial x_i} +\frac{\partial \tau _{ij} }{\partial x_j}, \end{aligned}$$
(2)

with the spatial coordinates \(x_i\) and the time t. The stress tensor \(\tau _{ij}\) is computed with the dynamic viscosity \(\mu \) as

$$\begin{aligned} \tau _{ij}=\mu \left[ \left( \frac{\partial u_i}{\partial x_j}- \frac{\partial u_j}{\partial x_i} \right) -\frac{2}{3} \frac{\partial u_k}{\partial x_k} \right] . \end{aligned}$$
(3)

The energy equation is defined the following way,

$$\begin{aligned} \frac{\partial \rho E}{\partial t}+\frac{\partial }{\partial x_j} \left[ \left( \rho E + p\right) u_j \right] = \frac{\partial }{\partial x_j}\left( \tau _{ij}u_j\right) +\frac{\partial }{\partial x_j} \left( \lambda \frac{\partial T}{\partial x_j} \right) . \end{aligned}$$
(4)

For the chemical modelling, Park’s two temperature model [14] is used. It uses five different species (N2, O2, NO, N, O). In this model, the equilibrium constants for the chemical equations are obtained by polynomials. Additionally, the single-species viscosity is computed by Blottner’s formula [15]. Hirschfelder et al. [16] describe the single-species thermal conductivity. All single-species thermodynamic properties are combined with Wilke’s mixing rule [17].

Fig. 1
figure 1

Sketch of the full (a), restricted and reduced restricted (b) domain

3 Numerical set-up

A semi-commercial finite volume solver called Navier–Stokes Multi-Block Solver (NSMB) is used in this investigation. It utilizes the Message-Passing-Interface (MPI) to work in parallel by communicating data between different blocks. The computations were performed on the SuperMUC HPC System at the high performance computing facility of the Leibniz Rechenzentrum (LRZ) in Garching b. Munich. It was used and validated in previous hypersonic studies, e.g., [13].

The DNS performed in this study is done in three steps. At first, a two-dimensional axisymmetric simulation for the entire capsule is computed which provides the necessary inflow conditions for the three-dimensional simulations. This preliminary simulation is conducted on an axisymmetric two-dimensional grid (see Fig. 1a). Once the conditions behind the bow shock close to the capsule surface are known, a 3D simulation is performed on a restricted domain. In this second domain (Fig. 1b), a three-dimensional steady simulation is performed based on the conditions computed in the 2D simulation. For the unsteady calculations, the restricted 3D domain is further reduced and only the wake flow of the roughness (marked in blue in Fig. 1b) is observed. Previous investigations [18] have shown that the main interaction between the disturbances and the vortical structures triggering instabilities leading to transition happen in the wake flow of the roughness and not through the interaction of unsteady disturbances with the roughness itself. The third 3D domain is used for the AI database (red in Fig. 1b) only and it consists of the immediate vicinity of the roughness patch exclusively, see Fig. 2. This reduction was necessary to be able to simulate a wide range of random roughness patches and focus on the vorticity production by the roughness patch. This study only shows results from the AI domain (red in Fig. 1b) and the domain for unsteady simulations (blue in Fig. 1b).

The 2D simulation is performed on a grid with about 80,000 grid points. The bow shock, which forms in front of the capsule’s heat shield, is captured by an upstream splitting method (AUSM+) upwind scheme of first order accuracy. An implicit Euler time integration method is used to perform the study simulation. The restricted 3D domain has a size of 51.2 Million grid points and its grid convergence has been verified in previous studies [7, 13] using the results from the 2D simulations as boundary conditions. A fourth-order accurate central scheme is chosen for the spatial discretization. A hybrid explicit Runge–Kutta Method is applied in the unsteady case. This domain is used for unsteady simulations to investigate the influence of the cross-flow-like vortex on the onset of transition in the flow.

The AI domain (Fig. 2) is 17 cm wide in the spanwise direction and has a streamwise extension of 28 cm. Also the maximum domain height is reduced to 6.6 cm compared to the restricted domain in Fig. 1b. The grid resolution is reduced to i=85 (streamwise direction), j=69 (wall-normal direction) k=200 (spanwise direction) points. The resolution of the domain with a total number of grid points of 1,173,000 was compared to the fine resolution of the restricted domain. The AI domain is used to perform a DNS to extract flow parameters from the wake. The main focus was to extract flow parameters which best characterizes the strength of cross-flow-like vortex in the wake. We used the maximum of the streamwise vorticity, the maximum of \(\partial u / \partial y\) and \(\partial u / \partial z\) in the wake as well as the wall-normal distance of the vortex core (see Sect. 6.2.2). Further investigations had shown that other parameters which might have an influence on the wake had no influence on the outcome of the Neural Network analysis. The flow parameters extracted from the DNS describe how the cross-flow-like vortex is disturbing the flow compared to a smooth surface. The maximum of streamwise vorticity downstream of the roughness patch, the vortex core position and streamwise and spanwise gradients of the streamwise velocity were not significantly affected by the chosen grid resolution for the reduced domain compared to the higher resolution of the restricted domain. The number of grid points in the wall-normal and spanwise direction was chosen to fully resolve the boundary-layer and the cross-flow-like vortex. The maximum streamwise vorticity, wall-normal and spanwise gradients of the streamwise velocity at the outflow of the AI domain were all below a five per cent error margin from the DNS result of the restricted domain for the tested grids. The grid for the AI database provides sufficient accuracy to compute reasonable DNS-based training data.

Fig. 2
figure 2

Reduced domain for the ML training and test database

4 Roughness generation

The roughness generation process used in this study was introduced by Di Giovanni and Stemmer [13]. It produces a pseudo-random distributed roughness pattern which is composed of several sinusoidal waves with different amplitudes and phases. The roughness height h relative to the wall surface is defined by

$$\begin{aligned} h(x,z)=h_\text {max} \cdot g(x) \sum _{q,r=1}^{3} A_{q,r} \sin \left( \frac{2 \pi q}{\lambda _0}x + \frac{2 \pi r}{\lambda _0}z+ \phi _{q,r}\right) . \end{aligned}$$
(5)

The function g(x) provides a smooth transition from the smooth wall to the roughness patch. The spanwise extension of the domain defines the fundamental wavelength \(\lambda _0\). At the roughness location, the fundamental wavelength is \(\lambda _0\)=170 mm. Each roughness is made of nine amplitude and nine phase values. The amplitudes \(A_{q,r}\) and phases \(\phi _{q,r}\) are defined randomly and are uniformly distributed. The amplitudes are randomly chosen from 0 to 1, but amplitudes \(A_{q,r}\) are set to zero for \(q^2+r^2>3^2+1\). This ensures that \(\lambda _{0}\) is the maximum wavelength in all directions. Also the phase values are uniformly distributed, but range from 0 to \(2\pi \). An overview of the average value and the standard deviation of all amplitudes within the database can be seen in Table 4.

Fig. 3
figure 3

Histogram of all random \(\phi _{11}\) phases inside the database

A sample of such a uniform distribution is given in Fig. 3 for the phase \(\phi _{11}\). A similar uniform distribution can be found for the other amplitude and phase values.

The random numbers were generated with the Fortran RANDOM_NUMBER command. According to the GNU Compiler Handbook, this generator has a period of \(2^{256} - 1\), which is more than sufficient (Table 1).

Table 1 Average and standard deviation of Aq,r and ϕq,r
Fig. 4
figure 4

Wall-normal distribution of \(\rho '\), \(p'\), \(T'\) and \(u'\)

Eq. 5 is used to generate a database of DNS with random distributed roughness patches. Every patch within the database has the same maximum height \(h_\text {max}\)=4.3 mm for better comparison.

4.1 Perturbation generation

The steady cross-flow-like vortices in the wake of the roughness patch are perturbed with high-frequency perturbations in order to trigger transition. These waves are introduced at the inflow of the reduced domain. In order to model these perturbations, some assumptions are made: The perturbation amplitude is smaller by orders of magnitude compared to the base flow variables. The ratio between the disturbance pressure and the steady flow pressure is \(p_{diss}/p_0=1\cdot 10^{-6}\) at the boundary-layer thickness. The properties are modelled as local one-dimensional inviscid (LODI) relations. The physical properties of the flow are locally constant for a certain height and are not changed by the small perturbations, but are changing in the wall-normal direction within the boundary layer of the base flow. This investigation is using a pressure, temperature, streamwise velocity u and density wave. The v- and w-velocity components are not included.

These considerations lead to the following wall-normal pressure function for a given time t at the wall-normal distance y

$$\begin{aligned} p'(y,t)=e^{-(y/\delta )}p_\text {diss} \; \cos (2 \pi f_\text {diss} t). \end{aligned}$$
(6)

The disturbance frequency is \(f_\text {diss}=8.3\) kHz. This frequency showed disturbance growth in the wake for similar roughness configurations at a Mach 20 re-entry scenario in previous studies [8]. The wall-normal and spanwise gradients of the streamwise velocity of the cross-flow-type vortex are shear flow regions where unsteady perturbations are amplified. This amplification happens for a broad band of frequencies in the kHz regime. We used these perturbation frequencies in a previous publication and know from stability calculations that a 8.3 kHz perturbation will be amplified (see [8]). For higher frequencies (16–50 kHz), Di Giovanni and Stemmer [7] observe a similar behaviour in the temporal Fourier modes of the streamwise velocity as for a 8.3 kHz disturbance. However, different N-factors are observed. We therefore can expect, that we will observe a similar downstream behaviour in the transition mechanism but the onset of transition position may vary. In order to assure comparability with previously generated results (as mentioned) we retained the 8.3 kHz which is known to be unstable for these scenarios.

The pressure disturbance is damped outside the boundary layer with \(e^{-(y/\delta )}\). Following the LODI procedure described in [19], the velocity perturbation is computed according to

$$\begin{aligned} u'(y,t)= \frac{1}{\rho _0(y)c_0(y)}p'(y,t), \end{aligned}$$
(7)

and the temperature disturbance as

$$\begin{aligned} T'(y,t)= \frac{T_0(y)}{\rho _0(y)c_0(y)^2}\left( \frac{c_0(y)^2}{R_0(y)T_0(y)}-1\right) p'(y,t), \end{aligned}$$
(8)

with the variables \(\rho _0(y)\), \(c_0(y)\), \(T_0(y)\) and \(R_0(y)\) from the steady flow. Finally, the equation of state delivers the density perturbation,

$$\begin{aligned} \rho '(y,t)= \frac{p'(y,t)}{R_0(y)T'(y,t)}. \end{aligned}$$
(9)

The maximum of the disturbance variables is very small compared to the original steady value, see Table 2 and therefore the effect on the physical and chemical properties is negligible.

Table 2 Maxima and minima of disturbance amplitudes

The envelope function of the four disturbances can be found in Fig. 4. At the inflow, the disturbance variables are added to the static steady inflow variables.

Fig. 5
figure 5

Network graph of the used DNN

5 Machine learning methods

In order to predict the maximum streamwise vorticity downstream of the roughness patch, two different machine learning methods are tested: A Deep Neural Network and Convolutional Neural Network. The DNN is using geometric parameters derived from the roughness surface as input, the CNN directly obtains images of the roughness surface as an input. Both networks are predicting a single value as the output, e.g. the maximum streamwise vorticity downstream the roughness patch and are trained, tested and validated with simulations from the DNS database.

For the prediction of a single value output from multiple input parameter, both ML setups use feed-forward neural networks. The networks in this study consist of an input layer, three hidden layers and a single output neuron. All neurons of one layer are connected with the next layer, but there is no connexion within a layer itself. Each neuron output is weighted and summed up in the input of a neuron in the next layer. The activation function in each neuron computes the output which is fed to the next layer. Using the notation from [20], the input vectors \(x_{1j}\) to \(x_{Dj}\) with D being the number of input values and j a specific neuron, are weighted with the synaptic weights \(w_{1j}\) to \(w_{Dj}\). The output o of a single neuron j can be calculated as

$$\begin{aligned} o_j=f\left( \sum _{i=1}^{D}w_{ij}x_{ij}\right) . \end{aligned}$$
(10)

The network is trained by solving an optimization problem such that the defined error function is minimized. In this study, we optimized for mean squared error which counterbalances outliers of bad prediction values stronger than the absolute percentage error. Additionally, the CNN network uses a set of convolutional layers to extract a set of parameters for the adjacent feed-forward network. It filters geometric significant features for the flow-parameter prediction as these networks were designed for image pattern recognition. A recent and detailed overview over this method can be found in [21].

All networks have a single variable output, whilst the input data is linked to the 9180 Simulations over the corresponding roughness patch. For example, common roughness-defining statistical parameters such as the RMS value of the roughness height are used as input. We made sure that no data calculated by the DNS is used as an input parameter. If flow parameters from the DNS are used as an input, we could not use the ML approach to bypass a costly DNS. The DNS data is presented to the Networks as the output training variable. However, we observed a significant prediction improvement of the maximum streamwise vorticity once we also provide the wall-normal distance of the vortex core as an input parameter. A stronger vortex is often further away from the surface. However, this information had to be retrieved from the DNS data. The results from the DNS are only presented to the network via training data. Since we train our network for a single flow parameter in a slice downstream of the roughness patch, only a single flow parameter is extracted from the 3D DNS.

Fig. 6
figure 6

Sample of input parameters

5.1 Deep neural network setup

The Deep Neural Network is using a selection of geometric parameters to compute the maximum vorticity at x=0.27 m downstream of the roughness patch. At first, the streamwise position of the highest peak \(Pos_{max,i}\) and the lowest peak \(Pos_{min,i}\) as well as the spanwise coordinates (\(Pos_{max,j},Pos_{min,k})\) are included, because the vortex is generally formed downstream the highest peak and its adjacent valley. An initial study has shown that this factor has a significant influence on the prediction capability of the DNN.

Further, we used statistical functions to compute a single input parameter from a field of geometric values. A height value points in the wall-normal direction (j), whilst the roughness patch extends in the streamwise (i) and spanwise (k) direction. The geometric features for prediction were the roughness height h(ik), the streamwise derivative of the roughness heights

$$\begin{aligned} \frac{\partial h(i,k)}{\partial i}, \end{aligned}$$
(11)

and the spanwise derivative,

$$\begin{aligned} \frac{\partial h(i,k)}{\partial k}. \end{aligned}$$
(12)

Feeding curvature values, such as the mean or Gaussian curvature did not significantly improve the prediction and hence were omitted from the database.

Then, we computed the geometric average for the roughness height \(h_{avg}\)

$$\begin{aligned} h_\text {avg}=\frac{1}{N_i\cdot N_k}\sum _{i,k}h(i,k), \end{aligned}$$
(13)

with the number of points \(N_i\), \(N_k\) in the streamwise and spanwise directions, respectively.

The root-mean square (RMS) of the height is calculated as

$$\begin{aligned} h_\text {rms}=\sqrt{\frac{1}{N_i\cdot N_k}\sum _{i,k}\left( h(i,k) - h_\text {avg}\right) ^2}. \end{aligned}$$
(14)

The skewness of the height values is defined as

$$\begin{aligned} Sk(h)= \frac{1}{h_\text {rms}^3}\left( \frac{1}{N_i\cdot N_k}\sum _{i,k}\left( h(i,k) - h_\text {avg}\right) ^3\right) . \end{aligned}$$
(15)

The statistical functions used in Eqs. 13, 14 and 15 are applied to the spatial derivatives (Eq. 11,12) accordingly. The random roughness patches have an average skewness of 0.0187 with a standard deviation of 0.0162. The smallest skewness is \(-0.24\) and the biggest skewness is 0.0598. For the flatness, a mean value of 2.560 is measured with a standard deviation of 0.312. A minimal flatness of 1.543 and maximum of 3.376 is computed.

Further, we derive the streamwise inclination angle from the skewness value of the streamwise derivative

$$\begin{aligned} I_i = \tan ^{-1}\left( \frac{1}{2} \cdot Sk\left( \frac{\partial h(i,k)}{\partial i}\right) \right) , \end{aligned}$$
(16)

and in the spanwise direction accordingly

$$\begin{aligned} I_k = \tan ^{-1}\left( \frac{1}{2} \cdot Sk\left( \frac{\partial h(i,k)}{\partial k}\right) \right) . \end{aligned}$$
(17)

For the training step, the data is split into training data (80%) and test data (20%). In both datasets, the input parameters are normalized before they are introduced to the network. The DNN is a multilayer perceptron (MLP) with three hidden layers. In total, there are 17 input parameters. In this study, we used a DNN with 320 neurons in the first, 760 neurons in the second and 960 neurons in the third hidden layer. These dimension were determined by a hyper-parameter study and this setup proved to deliver best results compared to other combinations investigated. Every layer is fully connected to the previous layer. This means that the output of each neuron is used as input for each neuron in the next layer (see Fig. 5). The data is fed forward through the network by the Exponential Linear Unit activation function. Finally, the maximum streamwise vorticity is derived at the output layer as a single variable output. The structure of this network is visualized in Fig. 5 and a sample of input parameters is shown in Fig. 6.

Fig. 7
figure 7

Structure of CNN

5.2 Convolutional Network Setup

For the CNN, no input parameters are mathematically derived from the roughness patch. An image of the patch with the normalized roughness height as grey-scale values is used as an input for this network. No further pre-processing of the data is necessary. The image has a resolution of 16\(\times \)16 pixels. A sample input image can be seen in Fig. 7 marked as input image. In this image, the height values are normalized from -1 (white) to 1 (black).

Fig. 8
figure 8

Histogram of maximum streamwise vorticity values in the AI database

The network contains three convolutional layers with a filter (kernel) size of 3\(\times \)3. The feature extraction from the roughness image is performed in the convolutional layer. The rectified linear activation function (ReLU) is used. After each convolutional layer, a max-pooling layer of the size 2\(\times \)2 is added and the data is fed through a dropout layer. The max-pooling layer reduces the in-plane dimensionality of the detected features by selecting only the maximum values of a feature within a group [22]. At the end of the convolutional layer, the data is flattened into a 1D array with 1152 parameters. This array is now the input for a DNN with three hidden layers. The first has a 500 and the second and third layer 200 neurons each. The final output is also a single variable output. In total, the CNN has over 770,021 trainable features.

5.3 AI training and test database

Both ML methods were trained with a database of of 9180 simulations with random roughness patches. The networks were initially trained to predict the maximum streamwise vorticity in a y-z-slice at x=0.27 m at the outflow of the domain. An overview of the vorticity distribution produced by random roughness patches with a peak to boundary layer thickness ratio of 18% can be seen in Fig. 8. Most vorticity values are around 100,000 1/s. Other flow parameters of interest were also saved for possible prediction outputs such as the wall-normal distance of the vortex core of the cross-flow-like vortex, the maximum streamwise derivatives in wall-normal and spanwise direction. All parameters were calculated in a y-z-slice at x=0.27 m like the maximum streamwise vorticity. Depending on the ML method, the input parameters consist of a set of roughness parameters or the images of the roughness patch described in sects. 5.1 and 5.2.

Fig. 9
figure 9

Detail restricted with random roughness and sample streamlines with temperature contour at x = 0.27 m

During the training phase of the network, the training data (80% of the data set) was split once more in 80% actual training data and 20% validation data. The prediction capability of the networks is tested in every epoch with the validation data. Is the mean squared error not improved 10 times in a row, the training is stopped. This prevents to overfit the network by training too many epochs. After every epoch, a new set of validation data is chosen from the training data. This way, the whole training data is covered during the training of the networks. The test data is measuring the networks prediction performance, for example by computing the average of the relative error of the prediction. During the training process, the network is not exposed to the test data in anyway.

6 Results

This study investigates a Mach 20 re-entry flow of an Apollo-like capsule at a flight altitude of about 57.5 km. The freestream conditions \(p_\infty \)=29.9 Pa, \(T_\infty \)=253.3 K, \(T_{wall}\)=1800 K and \(Re_\infty \)=1.97 \(\cdot \,\) 10\(^{6}\) m\(^{-1}\) are taken from an Apollo trajectory. The main focus of this study is to investigate the influence of distributed roughness patches on the disturbance evolution. Further, the prediction capability of the streamwise vorticity by machine learning methods is discussed.

Cross-flow-like vortices are observed in the steady wake flow of a distributed roughness patch. Figure 9 shows a sample streamline through the vortex core with the strongest streamwise vorticity. The flow is passing over the distributed roughness patch. A temperature contour of a cross section (x=0.27 m) in the wake is also displayed in Fig. 9. The strongest vortex generally emerges downstream of the highest peak within the patch. This elevation in the patches forces fluid in the wall-normal direction. A vortical motion is induced in combination with the adjacent valley which are not aligned in the main flow direction. It is observed that the vortex is damped along the streamwise direction due to the strong acceleration of the flow (not shown). Further, the cross-flow-like vortex transports low-temperature fluid towards higher regions of the boundary layer.

Fig. 10
figure 10

Comparison between predicted an simulated data for DNN (red) and CNN (blue)

In the next sections, the capability of machine learning methods to predict the maximum streamwise vorticity observed in the y-z-slice at x=0.27 m (see Fig. 9) is discussed. Further, unsteady simulations investigate the disturbance development in the wake of the a small, medium and strong vortices in the wake to show their transitional potential.

6.1 Vorticity Prediction by the DNN and the CNN

The CNN is predicting the vorticity with a mean error of 13.29% with a standard deviation of \(\sigma =11.70\%\) compared to the 17.36% (\(\sigma =16.91\%\)) of the DNN.

Fig. 11
figure 11

Prediction error for different input tile sizes

The DNN can predict 95.4% of the test simulations within a deviation of [\(-\)4.4 \(\cdot \)10\(^4\); 4.4\(\cdot \) 10\(^4\)] [1/s]. This confidence interval is marked by the green line in Fig. 10. This margin corresponds to two times the standard deviation of the absolute error. Further, the DNN methods compute 40% of the test sets with an error below 10%. For only 4% of the values, the DNN prediction amounts to more than twice as much as the DNS vorticity value.

On the other side, the CNN is computing half of the vorticity value with an error below 10% and 90% of the data below 25%. Except for one simulation in Fig. 10, all DNN predictions (blue) are in the confidence interval of the DNN marked in green. The confidence interval (\(2 \times \sigma \)) of the CNN prediction is marked as blue lines in Fig. 10. It can clearly be seen that the CNN is predicting the maximum streamwise vorticity within a confidence interval which is almost twice as narrow compared to the prediction of the DNN. The error of the CNN is also smaller depending on the actual vorticity values. The DNN is weaker in predicting the correct value for very low or very small vorticity values because there are few examples within the database. A summary of the different error quantities for both ML methods is summarized in Table 3. The standard error is computed as

$$\begin{aligned} \hat{\sigma _x}=\frac{\sigma }{\sqrt{n}}, \end{aligned}$$
(18)

with the standard deviation \(\sigma \) and the sample size of our test database n.

Table 3 Prediction errors for the DNN and CNN

The standard error of the linear regression of predicted and computed values in Fig. 10 for the CNN is 12,546.24 [1/s] and 18,765.52 [1/s] for the DNN.

A study with an increased input image resolution (32\(\times \)32 and 64\(\times \)64) did not show improvements in the prediction capability. In Fig. 11, the average prediction error of the CNN is plotted for databases with different sized input images. The performance slightly drops for larger tiles. The relevant features for the prediction can be extracted from the input image with a resolution of 16\(\times \)16. All notable roughness features, such as the maximum height in the patch, are sufficiently resolved. Hence, for patches composed with more sinusoidal waves, per fundamental wavelength, a higher resolution might be necessary. The input tiles with a higher resolution (32\(\times \)32 and 64\(\times \)64) contain more information about the roughness patch due to the higher resolution. The CNN cannot use this increase in information to outperform the smallest tile-set database. This indicates that the higher resolution is containing features that obfuscate the CNN (noise) and lead to less accurate prediction.

Fig. 12
figure 12

Structure of autoencoder

The CNN network is also able to be trained to predict different flow parameters with a comparable prediction error. We have tested the network on the wall-normal distance of the vortex core, the maximum derivative of u in the spanwise and wall-normal direction. Both networks can be trained to predict different flow parameters, but only one at once. We observed that training the network to predict two or multiple flow parameters with the same network is not as effective as creating specialized networks for each parameter due to the relatively low number of training data. An overview over the relative prediction error for the CNN is given in Table4.

Table 4 Relative prediction error for different output parameters

The DNN reveals influential parameters for the prediction process with a parameter study. This allows physical insight to a certain extent. An initial parameter study [23] showed that the vortex formation is mostly influenced by the surface gradients of the roughness patch and the location of the highest peak and lowest valley within the patch. On the other hand, the CNN performs better in the vorticity prediction, but remains a black box. With the help of a saliency map, we were able to confirm that the CNN is using the region of the highest peak and adjacent valley as the key feature for the prediction of the streamwise vorticity. This peak region is also the origin of the strongest cross-flow-like vortex, like Fig. 9.

In Ulrich and Stemmer [8], we compared surfaces synthesized from sinusoidal waves with a patch synthesized from triangular waves but with the same amplitude and phase values. We tested our ML methods with 50 three-wave patches with a triangular base function and 50 patches with five waves instead of three wavenumbers present. Predicting a different surface challenged the network and the error of the CNN increased for the test cases from an average error of 11.2% to 26.5% for the triangular three-wave patch and 28.2% for the sinusoidal five-wave patch. This was expected as we trained the network with patches with only three sinusoidal waves present. The cross-flow-like vortex is formed by a single dominant peak and an adjacent valley. A change in the base function introduces a different slope of the surface and in a five-wave patch more peaks and valleys are present. This leads to the formation of a different magnitude of the cross-flow-like vortex which the network is not trained for.

We are confident that given a wider training database the network will be able to adapt. In the current stage, the network can not predict arbitrary roughnesses as accurate. As ablation is involved, the shapes are expected to be rather non-edgy than really rough and we therefore believe to have chosen a suitable roughness model for the investigation of the generation of cross-flow-type vortices through a large number of distributed roughness patches. This study tries to explore the potential for the methodology as a whole. We hope to have shown that it is feasible. The next step to fully random surfaces would enlarge the potential of the method, but on the other hand, the generation of unstable vortical structures downstream of the patch might be not as successful as with the current patches. This then can shed more light on the general transition scenario in these highly accelerated boundary-layer flows.

6.1.1 Autoencoder

The computational effort to obtain input data for the CNN is negligible compared to the output training data. Computer-generated images of random roughness patches can be used as input data, whilst the output data is computed via a DNS on an HPC system. Hence, we used an autoencoder in a prepossessing step to pre-train the network with a large set of input roughness images of over 100,000 images.

The encoder part of the autoencoder transforms this set of input data into a latent space representation. An information bottleneck is created in the middle of the network. The decoder part is using this reduced information of the input image to recreate the original input image. Since the input and output are the same in the training process of the autoencoder, no DNS data is required to train the autoencoder. An overview of this set-up can be found in Fig. 12.

Fig. 13
figure 13

Prediction error of the CNN and CNN with an autoencoder for different training database sizes

In a second step, the encoder part of the autoencoder replaces the set of convolutional layers that compute the input array for the forward feeding network in the CNN setup (see Fig. 7). The encoder part is only fine tuned in the training process. The effect of the inclusion of the autoencoder can be seen in Fig. 13. For smaller training databases, a pretrained encoder is better in order to predict the maximum streamwise vorticity since it has already learned to compute a representative latent space representation of the incoming images. This reduced representation is enough to fully reconstruct the input image but it was not fully optimized for the task of the output computation. For larger datasets (4000 and above), the autoencoder slightly reduces the prediction capability. The encoder part is trained to deconstruct the input images into an abstract space, which is sufficient to fully reconstruct the input image. This abstract layer can also be used as input to compute the streamwise derivatives. However, for larger sets, it is slightly more efficient to fully train the convolutional layers without the initial encoder weights. The CNN training process is optimized to extract features from the input images into the abstract layer, which are relevant features for the output prediction. However, the autoencoder includes all information about the patch in the abstract layer which might also include irrelevant parameters for the output prediction.

Fig. 14
figure 14

Isosurface contour of Q-crtierium \(Q=5.5 \cdot 10^{7}\) of the steady (a) and unsteady (b) cross-flow vortex

In summary, the use of the autoencoder for different training sizes confirms that it is useful for smaller training databases. This makes it also an interesting method for studies with only a small set of DNS. It also confirms that our database is sufficient in size. The prediction error is converging and does not improve significantly with larger data sets for both configurations.

6.2 Unsteady simulations

This investigation is divided in two major parts. At first, we investigate in detail how machine learning methods can be utilized to predict flow parameters which characterize the flow regime in the wake of the random roughness patch (Sects. 66.1). The domain for the AI database ends shortly downstream of the roughness patch to keep the domain size as small as possible. Our AI is capable to predict flow parameters that describe the strongest vortex in the wake. It is meant as a tool to test a large number of roughnesses and select roughness patches which generate a strong vortex. These patches can then be studied by a detailed DNS or manufactured in a 3D printer for an experiment. The future user then saves the computational effort of a full DNS which could reveal that the patch simulated does not provide a strong and destabilizing cross-flow-like vortex. We tried to identify a worst-case scenario for the instability and subsequent laminar-turbulent transition from the current patch setup in a reduced parameter space. In this section (6.2), we want to provide further information about the effect such a cross-flow-like vortex has in an unsteady flow regime. Further, we take a more detailed look at the effect such a unsteady cross-flow-like vortex has on the onset of transition. This section analyses the effect of different streamwise vorticity magnitudes induced by five different roughness patches on the streamwise development (according to Eq. 20) of the unsteady disturbances. The streamwise velocity component is Fourier transformed in space and time and the amplitude development is described in this investigation in Sect. 6.2.1.

Fig. 15
figure 15

Normalized maximum amplitudes for temporal and spatial Fouriermodes for f=\(f_1\), n=1 for patch 1-5 (left) and for different frequencies and wavenumbers for patch 5 (right)

The maximum streamwise vorticity \(\omega _{x}\) for five different random roughness patches is provided in Table 5. The patches are chosen from the ML database and represent the lower third, the average and the upper third of the produced vorticity values within the database.

Table 5 Streamwise vorticity magnitudes of random roughness patches

The introduction of unsteady disturbances at the inflow of the domain is destabilizing the steady cross-flow-like vortex. The disturbances are amplified in the regions with large spanwise and wall-normal gradients in the shear flow of the vortex. An iso-contour of the Q-criterion \(Q=5.5 \cdot 10^{7}\) shows the development of the steady (a) and unsteady (b) vortex downstream of the wake for patch 2. The highly accelerated flow favours stabilization and damping of the steady cross-flow-type vortex. The perturbation induces finger-like structures starting at x=0.16 m in Fig. 14b. Further downstream, horseshoe vortices are observed. A similar observation is made for the other roughness configurations and a similar configuration by Di Giovanni and Stemmer [13].

6.2.1 Development of spatial and temporal Fouriermodes

The unsteady results are analysed with a spatio-temporal Fourier transformation of the streamwise velocity. The spatio-temporal Fourier transformation of a generic flow variable q(xyzt) is defined as

$$\begin{aligned} Q_{m,n}(x,y)=\sum _{j=0}^{J-1}\sum _{l=0}^{L-1}q(x,y,z_j,t_l)e^{-i2\pi (n_j/J+m_l/L)}, \end{aligned}$$
(19)

where J is indicating the number of samples in spanwise direction and L is referring to the number of time steps. The multiples of the fundamental frequency are indicated by m and the multiples of the spanwise wave length by index n.

The local maximum in the wall-normal direction (y) describes the amplitude of the mode (mn) for a given location in x. The amplitude \( A_{m,n}^q\) is given by

$$\begin{aligned} A_{m,n}^q(x)=\max _{y\ge 0} \mid Q_{m,n}(x,y) \mid . \end{aligned}$$
(20)

The Fourier amplitudes \({\hat{u}}\) are normalized with the boundary-layer edge velocity \(u_{edge}\)=1600 m/s at the inflow. In Fig. 15, the logarithmic value of this normalized Fourier amplitudes are plotted. At first, we study the downstream development of the perturbation frequency \(f_1\)=8.3 kHz and wavenumber n=1 in Fig. 15a. The amplitudes are damped until x=0.14 m for patch 2 and x=0.2 m for patch 1 and 5, patch 3 is damped until x=0.3m. Further downstream, the Fourier amplitudes rise exponentially. The magnitude of streamwise vorticity does not correlate with the location of the sudden exponential rise. For example, for patch 1, the Fourier mode starts to rise exponentially at x=0.26 m. Patch 3 starts to increase at 0.4 m. The first appearance of the finger-like structures corresponds to the sudden rise in the Fourier amplitudes and is taken as a reference location for the onset of transition in this study.

The influence of different wavenumbers and frequencies is presented in Fig. 15b for patch 5, but a similar development is also observed for patch 1 to 4. In the plot, the higher harmonics (\(f_2\),\(f_3\)) of the perturbation frequency \(f_1\) also have a reduced amplitude compared to \(f_1\). For even higher harmonics (not shown), the amplitude is reduced further but behaves similarly. Upstream of the transition region the wavenumber n=3 is larger than the rest of the amplitudes for all frequencies. The spanwise wavenumber n=3 corresponds to the wavelength of the cross-flow-type vortex. The amplitudes saturate soon after the exponential rise at similar levels for all patches.

Fig. 16
figure 16

Streamwise maxima of streamwise vorticity and of spatial derivatives of the streamwise velocity

6.2.2 Influence of y- and z-instability-mode

The streamwise vorticity is not the only parameter driving the transition mechanism in the wake of a streamwise roughness patch. For isolated roughness elements, Van den Eynde and Sandham [6] observed a larger disturbance growth rate through a stronger liftup effect caused by streamwise vorticity. For cross-flow vortices in low speed flows, various authors [24,25,26] observed the presence of a y- and z-mode instabilities. The wall-normal gradient of the streamwise velocity are the origin of the y-mode and the spanwise gradient of the z-mode. Damping is observed in Fig. 16 for the streamwise vorticity and spatial derivatives of u. Also \(\partial u / \partial y\) and \(\partial u / \partial z\) in the streamwise direction are damped but remain present through-out the length of the domain. This underlines that the behaviour of the flow is not only driven by the streamwise vorticity but also other flow parameters in the wake should be taken into consideration.

Fig. 17
figure 17

Alignment of the distribution of \(\partial u / \partial y\) in the steady flow and Fourier-transformed streamwise velocity for the disturbed flow

The cross section in Fig. 17 is located at x=0.35 m. The mode sits on top of the cross-flow-like vortex which can not be seen here. The kidney shaped form of the y-mode in color is aligned with the distribution of \(\partial u / \partial y\) of the steady base flow. This is displayed in Fig. 17 by a contour plot for the amplitude of the Fourier-transformed streamwise velocity at the perturbation frequency. The \(\partial u / \partial y\) distribution is shown as contour lines. Every line represents a 10% decrease with respect to the maximum derivative. An alignment between the perturbed velocity and the wall-normal derivative of the downstream velocity can be seen.

Fig. 18
figure 18

Streamline through y-z-slices of spanwise and streamwise derivative of u

The streamwise development of the driving modes is shown in Fig. 18. It displays shear flow regions at y-z-slices at x= 0.05 m, 0.15 m and 0.35 m where perturbation growth is observed. The first two slices in the streamwise direction display large gradients of u in the spanwise direction. The last slice displays the \(\partial u /\partial y\). For better visibility of the shear flow regions, values above \(-0.3\) for \(\partial u /\partial z\) and values below 0.25 for \(\partial u /\partial y\) are not plotted. The streamline passing through the minimum of \(\partial u /\partial z\) in the first slice is transported through the turning motion of the vortex to the kidney shaped local maximum of \(\partial u /\partial y\). This explains that initially the perturbation wave is amplified as a z-mode and then grows as a y-mode. In summary, the strongest perturbation growth starts in the shear flow region driven by the z-mode. The roll-up motion of the vortex brings fluid upward. This motion is defined by the streamwise vorticity and causes the perturbations to grow in the wall-normal shear flow region.

Fig. 19
figure 19

Proportionality of Eqn. 21 with the transition onset location

Finally, we show in Fig. 19 how the flow parameters, such as the maximum streamwise vorticity, wall-normal and spanwise derivatives of u at the inflow of the restricted domain are influencing the transition onset location for the three different roughness patches. We defined the transition onset location as the intersection of two lines in this study: the rise in the Fourier amplitudes of the perturbation frequency is intersecting with the line approximating the initial damping of these Fourier amplitudes. We observe that for flows where the flow field is less distorted, the transition onset location is further upstream. Several flow parameters are contributing to this distortion and therefore a combination of these parameters is suggested. All flow parameters are first normalized against the largest value of each parameter since the gradients vary considerably depending on the direction. With a certain arrangement of the logarithmic values of the normalized flow parameter, we are for example able to reach a linear dependence

$$\begin{aligned} x_\text {transition}\propto 0.075\cdot \left( 3.5 \cdot \log \left( \omega _{x}\right) + 7.4 \cdot \log \left( \frac{\partial u}{ \partial y} \right) - 32\cdot \log \left( \frac{\partial u}{ \partial z} \right) \right) . \end{aligned}$$
(21)

We see a potential for a proportional relationship with the transition onset location in our case which needs to be evaluated for other flow and roughness parameters.

Higher vorticity itself does not necessarily lead to transition further upstream or faster perturbation growth. A vortex located further away from the wall is transporting low-momentum fluid in faster regions of the boundary layer and high-momentum fluid in regions close to the wall more effectively. This generates gradients in regions where consecutively the unsteady perturbations grow, as previously observed in [8]. Therefore, the wall-normal distance of the vortex core is already incorporated in the suggested relation.

7 Conclusion and summary

This study investigates cross-flow-like vortices in the wake of random distributed roughness patches. In the steady base flow, a cross-flow vortex is formed in the wake downstream of the highest peak within the roughness patch.

Since the vorticity magnitude has a direct influence on transition, a database of 9180 DNS simulation was computed and was utilized for machine learning-driven vorticity prediction. Two different network types were used in this investigation: A DNN type network used input parameters derived from the surface geometry. An average error in the predictions of 17% was achieved for the DNN. A better prediction was shown by the CNN. The method is using an image of the roughness surface as input to predict the vorticity with an average error of only 13%. Hence, ML methods can provide a fast possibility to estimate the streamwise vorticity in the wake and provide information on stability. With the usage of a pre-trained autoencoder, the prediction results can be improved for small datasets. This can improve results for training databases where the number of simulations is limited due to the computational cost. Further, the CNN network was also able to compute different flow parameters such as the wall-normal distance of the vortex core, the maxima of the spanwise and wall-normal derivatives of u.

In order to investigate the connexion between vorticity magnitude and transition location, the steady vortex in the wake is disturbed in unsteady simulations by a pressure, velocity, density and temperature wave of a fixed frequency known to provoke laminar-turbulent transition in these roughness cases. These disturbances are amplified in the shear flow of the vortex. Finger-like structures are rising at the edge of the steady vortex. We studied five different patches with a low, medium and high streamwise vorticity in the wake. For all patches, an exponential rise occurs in the Fourier modes of the streamwise velocity. For stronger vorticity magnitudes of the cross-flow vortex, we do not observe onset transition further downstream in every case, although the flow field is more disturbed by the stronger vortex. The unsteady perturbation grows in the shear flow of the wall-normal and spanwise gradient of the streamwise velocity. Initially, the disturbances grow in the region of the wall-normal derivative and are moved upwards with the turning motion of the vortex in the region of the spanwise derivative. A relation for the streamwise vorticity and the transition location can be formulated by considering the streamwise vorticity of the cross-flow-type vortex as well as the wall-normal and spanwise gradient maxima of the streamwise velocity.

This study laid out a framework for a potential transition-prediction criterion for roughness-induced transition in the future. However, further studies need to investigate the influence of a noisy disturbance signal including several frequencies on different cross-flow-like vortices. Also the influence of geometric roughness parameters on the formation of the streamwise vorticity needs to be investigated in more detail in the future.