Hostname: page-component-7f64f4797f-6fdxz Total loading time: 0 Render date: 2025-11-08T02:58:28.882Z Has data issue: false hasContentIssue false

Enhanced flow rate prediction of disturbed pipe flow using a shallow neural network

Published online by Cambridge University Press:  06 November 2025

Christoph Wilms*
Affiliation:
Physikalisch-Technische Bundesanstalt (PTB), Bundesallee 100, Braunschweig 38116, Germany Physikalisch-Technische Bundesanstalt (PTB), Abbestraße 2-12, Berlin 10587, Germany
Ann-Kathrin Ekat
Affiliation:
Physikalisch-Technische Bundesanstalt (PTB), Abbestraße 2-12, Berlin 10587, Germany
Katja Hertha-Dunkel
Affiliation:
Physikalisch-Technische Bundesanstalt (PTB), Abbestraße 2-12, Berlin 10587, Germany
Thomas Eichler
Affiliation:
Physikalisch-Technische Bundesanstalt (PTB), Abbestraße 2-12, Berlin 10587, Germany
Sonja Schmelter
Affiliation:
Physikalisch-Technische Bundesanstalt (PTB), Abbestraße 2-12, Berlin 10587, Germany
*
Corresponding author: Christoph Wilms; Email: christoph.wilms@ptb.de

Abstract

Trustworthy volumetric flow measurements are essential in many applications such as power plant controls or district heating systems. Flow metering under disturbed flow conditions, such as downstream of bends, is a challenge and leads to errors of up to 20 %. In this paper, an algorithm based on a shallow neural network (SNN) is developed, leading to a significant error reduction for strongly disturbed flow profiles. To cover a wide range of disturbances, the training dataset was chosen to consist of three base types of elbow configurations. For 83 % of the test data, the SNN produces a smaller error than the state-of-the-art approach. The average error is reduced from 2.25 % to 0.42 %. For the SNN, an error of less than 1 % can be achieved for downstream distances greater than 10 pipe diameters. The SNN demonstrated robustness to various reductions of the training dataset, as well as to noisy input data. Additionally, simulation data of a realistic pipe system with a significantly different geometry compared with the training data was used for testing. In this strong extrapolation, the mean error of the SNN was always smaller than the state-of-the-art approach and an error of less than 1 % could be achieved for more than 10 pipe diameters downstream of the last disturbance.

Information

Type
Research Article
Creative Commons
Creative Common License - CCCreative Common License - BY
This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution and reproduction, provided the original article is properly cited.
Copyright
© The Author(s), 2025. Published by Cambridge University Press

Impact Statement

Precise flow measurement plays an essential role in sectors from water supply to energy production. However, in real pipelines, the flow is often disturbed by bends or junctions, which makes accurate flow metering difficult and leads to large errors. Current methods often assume ideal, undisturbed flow patterns, which rarely occur in practice. In this work, we demonstrate a new data-driven technique that uses limited data along a single line inside the pipe to reconstruct the full flow pattern more accurately. This approach significantly improves the calculation of flow rates, reducing errors to less than 1 % in realistic conditions. Because it does not rely on ideal flow assumptions, this method can be easily adapted to many practical situations, improving the reliability of flow measurement systems.

1. Introduction

Reliable flow metering is essential in many industrial applications, e.g. in power plant controls to ensure a safe and efficient operation or in district heating systems to ensure a fair billing. Usually, the deployed flow meters are calibrated under ideal flow conditions, meaning a fully developed flow profile without disturbances such as swirl or flow asymmetry. Hence, the quality of flow rate measurements for steady flows is mainly affected by disturbances in the flow profile, which can be caused by upstream installed components like bends, valves, diffusers, nozzles, junctions and pumps. Thus, it is desirable to install flow meters after long straight pipe sections of several tens of pipe diameters to facilitate as much dissipation of the disturbance as possible. However, due to practical limitations such as confined installation space, ideal positions cannot be ensured. Several publications have investigated the influence of disturbed flow profiles on the measurement accuracy of flow meters. According to Guntermann et al. (Reference Guntermann, Rose, Lederer, Dues, Müller and Duckwe2011), large flow meters have an error of typically more than 3 % but could reach more than 20 % for strong disturbances. Wildemann et al. (Reference Wildemann, Merzkirch and Gersten2002) discussed two approaches for addressing this problem in practical applications. One method is the usage of flow conditioners to accelerate the reformation of a fully developed flow. Depending on the disturbance, the full decay is achieved at different downstream distances, see Laws (1990). However, these installations increase the pressure drop and hence the required pumping power (Drainy et al.Reference Drainy, Saqr, Aly and Jaafar2009; Mohd Ali and Mohd Iskandar, Reference Mohd Ali and Mohd Iskandar2019). The second method uses individual corrections of the flow meter by systematic investigations of the correction factor for different combinations of disturbances, see Reader-Harris et al. (Reference Reader-Harris, Sattary and Spearman1995), Straka et al. (Reference Straka, Weissenbrunner, Koglin, Höhne and Schmelter2022) and Yeh and Mattingly (Reference Yeh and Mattingly1994). Wildemann et al. (Reference Wildemann, Merzkirch and Gersten2002) propose a decomposition into fundamental disturbances where the individual correction factors are known. By superposition of these base disturbances, the final correction factor can be determined.

Figure 1. (a) Exemplary 1-D velocity profile (red line) extracted from a strongly disturbed 2-D velocity profile (shown in (b) by the red dots.). In order to consider realistic conditions, the path is limited to 80 % of the pipe diameter, see explanation in § 2.3. The profile is normalised over the pipe diameter $D^*$ and $r^*$ represents the radius coordinate. The dashed line symbolises a reflection of the entire 1-D profile. The blue profile describes the RSA profile (for the core area of the profile the mean of both sides is taken) and is plotted as a 2-D field in (c). The discontinuity of the blue curve at $r^*/\mathit{0.5}D^* \mathit{= \pm 0.6}$ is due to the averaging of the core region. The corresponding mean velocities are denoted as $\overline {u^*}_{\textit{true}}$ and $\overline {u^*}_{rot}$ .

Generally, the correction factor is a fixed constant. Due to changing boundary conditions, such as wall roughness (Calogirou et al.Reference Calogirou, Boekhoven and Henkes2001), it may be necessary to update the correction factor, making re-calibration necessary. For this purpose, Müller et al. (Reference Müller, Dues, Hübert and Rautenberg2018) developed an in situ procedure to measure a velocity profile on a one-dimensional (1-D) path. An optical access is installed and a velocity profile is recorded using Laser Doppler Velocimetry (LDV) as the flow passes through the centre of the pipe. Ideally, the velocity profile across the entire cross-section would be measured and integrated to obtain the volumetric flow rate $Q^*$ . However, in practical applications this is not feasible due to limited optical access and the significantly increased measurement time that would be required. Currently, $Q^*$ is determined by integrating the 1-D profile under the assumption of rotational symmetry, see figure 1. In other words, the flow rate calculation is equivalent to taking a weighted average of the 1-D velocity profile, where the weights account for the circumferential area of the concentric rings at each radial position. The measurement uncertainty of this procedure, called in the following rotational symmetry approach (RSA), rises with increasing disturbance, as can be seen by the comparison of the determined mean velocities $\overline {u^*}$ in figure 1. Hence, this method is only reliable in practice for non- and slightly disturbed profiles. The disturbance of the 1-D profile is determined by multiple dimensionless numbers, e.g. the asymmetry factor $K_a$ and profile factor $K_p$ , referring to Yeh and Mattingly (Reference Yeh and Mattingly1994). The measurement uncertainty is tabulated for different data ranges of these dimensional numbers, called profile classes, and rises with increasing values. For example, symmetrically disturbed profiles feature a measurement uncertainty of 1.4 % while highly asymmetric profiles show an uncertainty of 4.2 % (Müller et al.Reference Müller, Dues, Hübert and Rautenberg2018). For a fully developed profile, an uncertainty below 1 % could be reached (namely 0.7 %), see Müller et al. (Reference Müller, Dues, Hübert and Rautenberg2018). This paper aims to improve the prediction of the volumetric flow rate for disturbed profiles so that the uncertainty is below 1 %. To achieve this, the full two-dimensional (2-D) profile is predicted from the measured 1-D path allowing the determination of the flow rate by integration.

Flow field prediction based on limited sensor data has been developed for different applications like ship wake detection (Graziano et al.Reference Graziano, D’Errico and Rufino2016), arterial blood flow (Sankaran et al.Reference Sankaran, Moghadam, Kahn, Tseng, Guccione and Marsden2012; Yakhot et al.Reference Yakhot, Anor and Karniadakis2007) and atmospheric/climate science (Callaham et al.Reference Callaham, Maeda and Brunton2019; Erichson et al.Reference Erichson, Mathelin, Yao, Brunton, Mahoney and Kutz2020; Kalnay, Reference Kalnay2002). Further, many active flow control systems, e.g. increased efficiency of wind turbines (Strom et al.Reference Strom, Brunton and Polagye2017) or cars (Brunton and Noack, Reference Brunton and Noack2015; Pfeiffer and King, Reference Pfeiffer and King2012), require such algorithms. Hence, several mechanisms for flow field reconstruction can be found in the literature. One well-known approach is to describe the field by a linear composition of modes, e.g. as dynamic mode decomposition (Schmid, Reference Schmid2010) or eigenfunctions from a proper orthogonal decomposition (POD) (Lumley, Reference Lumley1967). The latter has been improved in several ways to handle, for example, missing or corrupted data, see gappy POD by Everson and Sirovich (Reference Everson and Sirovich1995). With the rise of artificial neural networks in recent years, several approaches use deep neural networks (DNNs) introducing nonlinearity into the system, like Shu et al. (Reference Shu, Li and Farimani2023), Xu et al. (Reference Xu, Sun, Huang, Guo, Yang and Ju2022) and Zhang et al. (Reference Zhang, Liu and Huang2023). However, DNNs require a vast amount of training data and are vulnerable to overfitting (Callaham et al.Reference Callaham, Maeda and Brunton2019). Thus, to reduce this risk, Erichson et al. (Reference Erichson, Mathelin, Yao, Brunton, Mahoney and Kutz2020) developed a shallow neural network (SNN). All the above-mentioned algorithms have been tested only on standard benchmark cases like the laminar flow behind a cylinder or isotropic turbulence but not on industrially relevant configurations. Thus, we selected the base algorithm of Erichson et al. (Reference Erichson, Mathelin, Yao, Brunton, Mahoney and Kutz2020), adapted it for our purposes, and confirmed its ability to predict reliably the volumetric flow rate of disturbed pipe flows. Erichson et al. (Reference Erichson, Mathelin, Yao, Brunton, Mahoney and Kutz2020) identifies the following key benefits of a SNN: fast training, reduced tuning and simplified interpretation. Additionally, given its efficacy, the necessity for more complex architectures is eliminated. Furthermore, the algorithm can only be trained on a combination of a 1-D path and a 2-D field. Hence, this approach is completely independent of any metadata that may be unreliable or unknown, such as upstream disturbances or fluid properties. Erichson et al. (Reference Erichson, Mathelin, Yao, Brunton, Mahoney and Kutz2020) compared the algorithm with POD and showed that the SNN performs better, especially with noisy input data. Moreover, the algorithm could be used to reconstruct fluid fields in other geometries where limited sensor data are available, even in three dimensions. The same applies to the reconstruction of other physical fields: for example, Wilms et al. (Reference Wilms, Xu, Ozler, Jantač, Schmelter and Grosshans2024) applied the algorithm to reconstruct an electric charge field in a square duct.

In reality, different types of disturbances cover a large parameter space and are often a combination/superposition of several individual disturbances (Wildemann et al.Reference Wildemann, Merzkirch and Gersten2002). To cover this large parameter domain with as few as possible data points, we have chosen three basic disturbances generated by different elbow configurations. Namely, these are single elbows, double elbows out of plane and double S-elbows, all with an angle of 90 $^\circ$ . These three configuration types introduce different levels of asymmetry and swirl. The performance of the machine learning (ML) algorithm is evaluated with different levels of difficulty. On the one hand, the test set contains velocity profiles within the parameter space of the training data (interpolation), on the other hand, the extrapolation capabilities are tested with velocity profiles outside the parameter space. For the latter, part of the data is extracted from a real district heating system with a combination of up to five elbows, including different bending radii and a 30 $^\circ$ elbow.

2. Methods

This section describes the ML algorithm and the dataset used to train the model. In the first part, the ML algorithm including the settings of the training is described, followed by a delineation of the training dataset and the pre- and postprocessing steps. The last subsection presents an additional dataset based on a real district heating system configuration, which is used for testing purposes especially in terms of extrapolation.

We follow the definitions given in Goodfellow et al. (Reference Goodfellow, Bengio and Courville2016) to name the different datasets. The dataset used to train the model is called the training set, denoted by $\mathcal{T}$ . The dataset used to tune the hyperparameters during training is called the validation set, $\mathcal{V}$ . The dataset that is completely independent of the first two and used to evaluate the model is called the test/evaluation set, $\mathcal{E}$ .

2.1. Machine learning algorithm

The objective of the supervised ML model $\mathcal{F}$ is to estimate the 2-D velocity field $\boldsymbol{x} \in \unicode{x211D}^{m}$ from a given 1-D path $\boldsymbol{s} \in \unicode{x211D}^{p}$ , where $p \ll m$ . Here, $p$ denotes the number of sample points along the 1-D path, and $m$ is the number of velocity grid points in the 2-D field. Hence, the task is to learn the relationship $\boldsymbol{s} \mapsto \boldsymbol{x}$ allowing the model to predict the 2-D velocity field $\hat {\boldsymbol{x}}$ for any given 1-D velocity path by training the approximation

(1) \begin{equation} \hat {\boldsymbol{x}} = \mathcal{F}(\boldsymbol{s}), \end{equation}

to accurately predict the 2-D velocity field.

For this purpose, Erichson et al. (Reference Erichson, Mathelin, Yao, Brunton, Mahoney and Kutz2020) developed an ML algorithm. They demonstrated the ability of their shallow decoder to reconstruct a flow field based on limited sensor locations using three examples: a flow behind a cylinder, a sea surface temperature map and an isotropic turbulent flow. As the general idea is similar to our problem, we have selected this SNN architecture as our base model and extended it by applying several preprocessing steps, see § 2.4. A SNN consists of few or sometimes no hidden layer(s). For this case, we have selected two hidden layers that are terminated by a linear output layer, resulting in the following network architecture:

(2) \begin{equation} \boldsymbol{s} \mapsto \text{first hidden layer} \mapsto \text{second hidden layer} \mapsto \text{output layer} \mapsto \hat {\boldsymbol{x}}. \end{equation}

The neurons in the two hidden layers $\psi$ and $\boldsymbol{\nu }$ are fully connected. Thus both layers can be described as

(3) \begin{align} \begin{split} \boldsymbol{z}^{\psi } &= \psi (\boldsymbol{s}) := F\left (\boldsymbol{W}^{\psi } \boldsymbol{s} + \boldsymbol{b}^{\psi } \right ), \\[5pt] \boldsymbol{z}^{\boldsymbol{\nu }} &= \boldsymbol{\nu }(\boldsymbol{z}^{\psi }) := F\left (\boldsymbol{W}^{\boldsymbol{\nu }} \boldsymbol{z}^{\psi } + \boldsymbol{b}^{\boldsymbol{\nu }} \right ) ,\end{split} \end{align}

with the dense weight matrix $\boldsymbol{W}$ , a bias term $\boldsymbol{b}$ and an activation function $F(\cdot )$ bringing nonlinearity into the model. The output layer $\boldsymbol{\Omega }$ describes a linear function in the form of

(4) \begin{equation} \hat {\boldsymbol{x}} = \boldsymbol{\Omega }(\boldsymbol{z}^{\boldsymbol{\nu }}) := \boldsymbol{W}^{\boldsymbol{\Omega }}\boldsymbol{z}^{\boldsymbol{\nu }} + \boldsymbol{b}^{{\boldsymbol{\Phi }}}, \end{equation}

where the columns of the weight matrix $\boldsymbol{\Phi }$ could be interpreted as modes. For the activation function $F(\cdot )$ , a rectified linear unit is chosen, which is defined as follows:

(5) \begin{equation} F(\boldsymbol{z}) := \max (\boldsymbol{z},\boldsymbol{0}). \end{equation}

In order to avoid overfitting, batch normalisation and dropout layers (denoted as $BN$ and $DL$ in (6) below) are introduced to the model. Batch normalisation describes a method introduced by Ioffe and Szegedy (Reference Ioffe and Szegedy2015) where the activation of $F(\cdot )$ (output of the previous layer) is normalised by standard normalisation (a mean of zero and standard deviation of one). This method considers different distributions of the activation across several mini-batches. Dropout layers are used to improve the generality of the SNN by dropping/switching off a fraction $p$ of the neurons in a specific layer during the training phase. This is achieved by setting the activation to zero (Hinton et al.Reference Hinton, Srivastava, Krizhevsky, Sutskever and Salakhutdinov2012). Plugged in all equations, the architecture of the SNN can be described by

(6) \begin{equation} \boldsymbol{s} \mapsto \psi (\boldsymbol{s}) \mapsto BN \mapsto DL \mapsto \boldsymbol{\nu }(\boldsymbol{z}^{\psi }) \mapsto BN \mapsto \boldsymbol{\Omega }(\boldsymbol{z}^{\boldsymbol{\nu }}) \equiv \hat {\boldsymbol{x}}. \end{equation}

During the training stage, a training set with $n$ 2-D velocity profiles $\{\boldsymbol{x}_i\}_{i=1,\dots ,n}$ and the corresponding 1-D velocity profiles $\{\boldsymbol{s}_i\}_{i=1,\dots ,n}$ is used to minimise the loss/error between the predicted quantity $\hat {\boldsymbol{x}} = \mathcal{F}(s)$ and the real quantity $\boldsymbol{x}$ . This mismatch is quantified in terms of the $L^2$ -norm

(7) \begin{equation} \mathcal{F} \in \underset{\tilde {\mathcal{F}}}{\mathrm{arg\,min}} \sum ^n_{i=1} \left \| \boldsymbol{x}_i - \tilde {\mathcal{F}}(\boldsymbol{s}_i) \right \|^2_2 + \lambda \left \| \boldsymbol{W}^i \right \|^2_2. \end{equation}

The last term introduces $L^2$ regularisation on the weight matrices. The strength of the regularisation is controlled by the coefficient $\lambda \gt 0$ , which penalises large weights to reduce overfitting. To minimise the loss function, the adaptive moment estimation (ADAM) optimisation algorithm is applied (Kingma and Ba, Reference Kingma and Ba2014), where the learning rate $\gamma$ determines the step size of the parameter updates in each epoch, see table 1. For further details of the SNN architecture, the reader is referred to Erichson et al. (Reference Erichson, Mathelin, Yao, Brunton, Mahoney and Kutz2020).

Table 1. Overview of the configuration used to train the neural networks.

In the application considered in this paper, the 2-D velocity field is given on a polar mesh (see figure A1 in the appendix). Hence, the vector $\boldsymbol{x} \in \unicode{x211D}^{m}$ is constructed from the matrix $\boldsymbol{X} = (x_{ij})_{i=1,\dots ,m_r, \, j=1,\dots ,m_\phi } \in \unicode{x211D}^{m_{r} \times m_{\phi }}$ (with $m_{r} m_{\phi } = m$ ) by stacking its columns on top of one another

(8) \begin{equation} \boldsymbol{x} = (x_{11},\dots ,x_{m_{r} 1}, \, x_{12},\dots ,x_{m_{r} 2}, \, \dots , \, x_{1 m_{\phi }},\dots ,x_{m_{r} m_{\phi }})^T, \end{equation}

where $m_r$ and $m_{\phi }$ are the vectors of the polar grid axis, in the radial and angular directions, respectively.

2.2. Settings of the training

In a precursive step, several settings of the training process were tested. In this process, the settings that led to the lowest errors in the testing were determined step by step. Once a suitable setting was found (for example, the number of neurons in the first and second hidden layers), this was not changed in the further process of finding suitable values for the other settings. Only for parameters that are directly related to each other (such as the number of neurons in the two layers, $n_{\psi }$ and $n_{\boldsymbol{\nu }}$ , or the amplitude $A_n$ and ratio $R_n$ of the applied noise) were the settings varied in combination. The final settings/parameters used for the training of all presented SNNs can be found in table 1. The order of the settings in the table corresponds to the chronology of how the settings were investigated. It should be noted that the training-to-validation data ratio ( $R_{\text{train}}/R_{\text{val}}$ ) resulted from a random split, without ensuring that all cases were represented in both sets.

2.3. Dataset

The dataset used to train the model is based on computational fluid dynamic (CFD) simulations presented in Weissenbrunner et al. (Reference Weissenbrunner, Ekat, Straka and Schmelter2023). The simulations are based on the Reynolds Averaged Navier-Stokes (RANS) approach with the Spalart–Allmaras turbulence model. For details the reader is referred to Weissenbrunner et al. (Reference Weissenbrunner, Ekat, Straka and Schmelter2023). The database contains different 90 $^\circ$ elbow configurations, namely single elbows (SE), double S-elbows (DSE) and double elbows out-of-plane (DE), see figure 2. In these simulations: (a) the Reynolds number $Re = \rho ^*\overline {u^*}D^*/\mu ^*$ , with the density of the fluid $\rho ^*$ , the mean velocity $\overline {u^*}$ , the pipe diameter $D^*$ and the dynamic viscosity $\mu ^*$ ; (b) the radius of the elbow curvature $R_c = R_c^*/D^*$ ; and (c) the distance between the elbows $D_e = D_e^*/D^*$ was varied. In total, the database contains $174$ CFD simulations (SE $_{Re=50\,000}$ : $21$ , SE $_{Re={500\,000}}$ : $21$ , DE $_{Re= 50\,000}$ : $66$ , DSE $_{Re=50\,000}$ : $66$ ), see § B.1 in the appendix.

Figure 2. Overview of the geometrical configurations. (a) Technical drawing of an S-elbow, (b) to (d) schematic renderings of a single elbow, an S-elbow and a double elbow out-of-plane.

From the simulations, 2-D slices of the streamwise velocity profile $u^*$ are extracted on a polar grid $u^*(r^*, \phi )$ with 20 angular coordinates $\phi _i, i=1,\dots ,20$ , and 36 radial coordinates $r^*_j, j=1,\dots ,36$ at different downstream positions $z = z^*/D^*$ , for details see § B.1 in the appendix. For each slice, data pairs consisting of (a) the 1-D path, starting at the wall and going up to $R_{1D} = 80\,\%$ of the pipe diameter and defined for all angular positions as

(9) \begin{equation} \big(u^{\phi _{i}}_{1D}\big)^*(r^*) := u^*(r^* \le R_{1D} D^*, \phi = \phi _{i}), \end{equation}

and (b) the corresponding 2-D profile is extracted. The 1-D path is limited to 80 % of the pipe diameter to account for practical constraints in experimental measurements. In practice, the uncertainty of the 1-D path measurement increases towards the end of the path due to reflections of the laser beams at the pipe wall. Therefore, it is not possible to use the full length of the path; instead, often only up to 80 % is reliable, see figure 1 for illustration. This ensures that the ML model can predict profiles independent of the path’s position. A detailed description of the entire dataset $\mathcal{D}$ can be found in the appendix, see § B.1. In summary, the dataset encompasses the parameter space of SE, DE and DSE with a Reynolds number of $Re = 50\,000$ ; the former is extended to $Re = 500\,000$ . The training dataset excludes eight entire simulation cases, which are reserved exclusively for testing ( $\mathcal{E}$ ). These sets are defined in § B.2 of the appendix. In short, two cases have been selected from $\textrm {DE}$ and $\textrm {DSE}$ , as well as four from $\textrm {SE}$ , with the objective of ensuring coverage of both Reynolds numbers with two cases each.

In the following, two base models are trained, called $M_1$ and $M_2$ . The former is based on the entire dataset $\mathcal{T}_{M_1}$ while the latter represents practically relevant configurations $\mathcal{T}_{{M_2}}$

(10) \begin{align} \begin{split} \mathcal{T}_{M_1} &= \mathcal{D} \setminus \mathcal{E}, \\[5pt] \mathcal{T}_{{M_2}} &= \mathcal{T}_{M_1} \cap \mathcal{D}_P. \end{split} \end{align}

The restrictions used to define the set of practically relevant cases $\mathcal{D}_P$ are described in the following. According to Hanson and Schwankl (Reference Hanson and Schwankl1998), flow meters are typically installed at least 8 to 10 pipe diameters downstream of a disturbance. For our investigation, this length was extended to five times the pipe diameter. In addition, it is most likely to find elbows with a curvature radius in the range of 1 to 3 pipe diameters. Smaller radii feature a high risk of flow separation at the inside of the elbow leading to a higher pressure drop while larger radii require a lot of space for installation. Similarly, in double elbow configurations, the distance between two elbows is typically in the range of 2 to 10 pipe diameters (Dr. Ulrich Müller, OPTOLUTION Messtechnik GmbH).

In total, the size of $\mathcal{T}_{M_1}$ amounts to $551\,220$ data pairs and to $183\,380$ in the case of $\mathcal{T}_{{M_2}}$ .

2.4. Pre- and postprocessing

Preprocessing is an essential part of ML and includes in particular the normalisation of the data. In general, this process is not necessary for the neural network, however, it significantly improves its performance. The normalisation consists of three main steps depicted in figure 3.

Figure 3. Contour plots of the different normalisation steps starting from the original velocity profile at the top left corner: 1. profile normalised by the volumetric flow rate based on the RSA using the selected 1-D profile, 2. profile with subtraction of the Gersten–Herwig profile (visualised in (a)), 3. normalisation using the standard deviation of the 1-D path. (b) Noise can be added to the 1-D profile (here also added for visualisation purposes to the 2-D profile).

All normalisation steps rely on the information given by the 1-D path as any information about the 2-D profile is not known in advance. In a precursor step, a spatial normalisation of the radius coordinate $r^*$ is performed by

(11) \begin{equation} r = \frac {r^*}{D^*/2}, \end{equation}

where $(\cdot )^*$ marks dimensioned quantities with $D^*$ being the pipe diameter. In the first normalisation of the velocity profile $u^*$ , the velocity is normalised by the mean velocity based on the 1-D path $\left ({\overline {u}_{{1D}}^{\phi }}\right )^{*}$

(12) \begin{equation} \breve {u}(r, \phi ) = u^*(r, \phi ) / \left ({\overline {u}_{{1D}}^{\phi }}\right )^{*} \quad \textrm {with} \quad \left ({\overline {u}_{{1D}}^{\phi }}\right )^{*} = \frac {1}{r_1-r_2}\int ^{r_1}_{r_2} | \left (u^{\phi }_{1D}\right )^{*}(r) \, r | \, {\rm d}r, \end{equation}

where $r_1 = -1$ (corresponding to the beginning of the path at the wall) and $r_2 = 1 - 2(1-R_{1D}) = 2R_{1D} - 1$ (corresponding to $R_{1D}$ as a percentage of the pipe diameter), see figure 3. Numerically, this is achieved by a linear weighted average, where the weights are based on the grid spacing. The second step subtracts a predefined velocity profile based on $Re_{1D} = \rho ^*\left ({\overline {u}_{{1D}}^{\phi }}\right )^{*}D^*/\mu ^*$ , either a plug flow (uniform velocity profile) or a fully developed turbulent pipe flow profile, namely the Gersten–Herwig profile as described by Gersten and Herwig (Reference Gersten and Herwig1992) in Gersten (Reference Gersten2005) (see figure 3(a)). The latter option is preferred as it is Reynolds number dependent and should cancel out the profile of the fully developed state (figure 3.2). However, in case of a small bend radius, a recirculation area can occur, leading to small or even negative values for $\left ({\overline {u}_{{1D}}^{\phi }}\right )^{*}$ . In this case, the Gersten–Herwig profile is not defined (used constants are defined according to Gersten (Reference Gersten2005) in a range of $4\times 10^3 \lt Re \lt 3\times 10^5$ for a hydraulically smooth pipe). Hence, a plug flow profile is subtracted from the corresponding mean flow direction of the path. In the last step, the difference between the 2-D profile $\breve {u}$ and the corresponding Gersten–Herwig profile $\breve {u}_{{GH}}$ is normalised by the standard deviation of its corresponding 1-D path $\breve {u}_{1D}^{\phi } - {\breve {u}_{{GH}}}$ (see figure 3.3)

(13) \begin{equation} \grave {u}\left (r, \phi \right ) = \frac {\breve {u}\left (r, \phi \right ) - {\breve {u}_{{GH}}}(r)}{\mathrm{std}\left [\breve {u}_{1D}^{\phi }(r) - {\breve {u}_{{GH}}}(r)\right ]}. \end{equation}

To improve the robustness of the model, especially concerning experimental data, noise can be added to the training data (see figure 3(b)). Here, several options are possible: application of the noise (a) only to the 1-D profile data, (b) only to the 2-D profile data and (c) to both profiles (the extracted 1-D path matches the 2-D profile data). For the results presented in this paper, option (a) is chosen. The noise $u_{noise, 1D}^{\phi }$ is based on a standard Gaussian distribution with a standard deviation of 1 $\sigma$ and mapped according to the range of the 1-D path. The noise does not consider any spatial correlation. This method enables a realistic representation in which each measuring point receives an individual noise level

(14) \begin{equation} u_{1D}^{\phi }(r) = A_n \, u_{noise, 1D}^{\phi }(r) + \grave {u}_{1D}^{\phi }(r), \end{equation}

where $A_n$ is the amplitude. However, in real LDV measurements the noise distribution might be non-uniform across the pipe cross-section, which could be investigated in future work. The noise is applied only to a fraction of the profiles to mimic a mixture of CFD and experimental data.

With this set of 1-D velocity profiles $u_{1D}^{\phi } = u_{1D}^{\phi }(r)$ and the corresponding 2-D profiles $u = u(r, \phi ) =\grave {u}(r, \phi )$ , the neural network is trained. Hence, in the prediction phase, the output of the neural network needs to be postprocessed in the reverse order to the preprocessing (except the addition of noise). After that, one receives the predicted 2-D profile, which is integrated to determine the mean velocity as the volumetric flow rate $Q^*$

(15) \begin{equation} \begin{split} \overline {u^*} &= \frac {4}{\pi (D^*)^2} \int _{0}^{2\pi } \int _{0}^{r^*} u^*(\phi , r^*) \, r^* \, dr^* \, d\phi ,\\[5pt] Q^* &= \overline {u^*} \frac {\pi (D^*)^2}{4}. \end{split} \end{equation}

Numerically, the integral is approximated similarly to the integration of the 1-D path by taking a weighted average based on the grid cell size.

The accuracy of the SNN is assessed by calculating the $L^2$ error as well as the relative difference of the flow rate between the predicted 2-D profile and the corresponding ground truth

(16) \begin{equation} \begin{split} L^2 \big(u_{{SNN}}^\phi , u_{\textit{true}}\big) &= \frac {4}{\pi (D^*)^2} \int _{0}^{2\pi } \int _{0}^{r^*} \left (\left (u_{\textit{true}}(\phi ,r^*) - u_{{SNN}}^{\phi }(\phi ,r^*)\right ) / \overline {u^*} \right )^2 r^*dr^* d\phi , \\[5pt] \delta Q\big(u_{{SNN}}^\phi , u_{\textit{true}}\big) &= 1 - \left (\frac {u_{{SNN}}^\phi }{u_{\textit{true}}}\right ) = 1 - \left (\frac {Q_{{SNN}}^\phi }{Q_{\textit{true}}}\right ), \end{split} \end{equation}

with $(\cdot )_{\textit{true}}$ describing the ground truth and $(\cdot )_{SNN}$ the prediction of the SNN in re-normalised form. The two errors can be equivalently defined for the RSA by substituting $u_{{SNN}}^\phi$ with $u_{_{rot}}^\phi$ .

The entire algorithm is implemented in Python v3.10 and can be found under Wilms et al. (Reference Wilms, Ekat, Hertha-Dunkel, Eichler and Schmelter2025). The ML algorithm itself is based on the open-source framework Pytorch.

2.5. Additional dataset for testing of the ML algorithm

The main test dataset described above is taken from the same parameter space as the training data of the SNN. To evaluate the model’s generalisability and its performance in practical applications, an additional realistic test case is included that represents a section of an actual district heating system. The geometry is based on a combination of one 30 $^\circ$ elbow followed by four 90 $^\circ$ elbows, all with a maximum distance of 13 pipe diameters. After the last elbow a straight pipe section with 100 $D^*$ is attached, see figure 4. The case is simulated with the same set-up as in Weissenbrunner et al. (Reference Weissenbrunner, Ekat, Straka and Schmelter2023) at $Re=5\times 10^4$ and downstream of every elbow the velocity profiles are sampled. This results in a total of five additional datasets for testing, which contain a total of 138 2-D profiles and thus $2\,760$ data pairs.

Figure 4. Rendering of the real test case including information about the pipe sections. The green-marked pipe sections are analysed in greater detail in the results.

3. Results and discussion

In the following, the results of different training configurations are presented and discussed. First, an exemplary one-to-one comparison of a ground truth 2-D profile with the corresponding SNN prediction is analysed. In the second step, the prediction of all downstream positions as well as all 20 angular positions is shown. The third step extends this depiction to all test cases. After that, a condensed representation of the results is introduced for several test subsets in the form of a heatmap. This visualisation is used to investigate the effect of reducing the training dataset to the practically relevant cases $\mathcal{T}_{{M_2}}$ . Further, the model is stressed with different modifications of the input data, namely a shorter path, a dramatically smaller dataset and perturbations due to noise. In the last step, the performance of the SNN is demonstrated for the realistic test case.

3.1. Evaluation over downstream distance

The first evaluation of the SNN is depicted in figure 5. The base for the following results is the model trained on $\mathcal{T}_{M_1}$ and tested with profiles from $\mathcal{E}_1$ . It shows for several exemplary downstream positions the comparison of the ground truth velocity profile and the reconstruction of the SNN. In addition, the respective mean flow velocity and the $L^2$ error are given. With increasing downstream distance $z$ and thus decreasing influence of the disturbance, the quality of the prediction rises. Nonetheless, the error of the flow rate is always smaller than the corresponding $L^2$ error.

Figure 5. Exemplary comparison of a ground truth velocity 2-D profiles (upper row) with the corresponding SNN prediction (lower row). The red dots indicate the location where the velocity is sampled for the 1-D profile. The profiles are taken from the test case $\mathcal{E}_1$ at different downstream distances increasing from left to right.

To assess the performance of the SNN for a single test case, the $L^2$ error and $\left |\delta Q \right |$ are plotted over the downstream distance $z$ , see figure 6. To ensure robustness with respect to random initialisation, the model is trained 20 times using different seeds for the neural network weight initialisation. In addition, the results achieved with the RSA are added for comparison. For both methods, the errors decrease with increasing downstream distance as the disturbance dissipates and thus the profile converges towards a fully developed profile. However, the mean absolute $L^2$ and $\left |\delta Q \right |$ of the SNN prediction is significantly smaller than the RSA. The shaded areas represent the ranges of the minimum and maximum errors where especially the latter is of interest as it describes the worst-case scenario. It can be concluded that, for $z \gt 10$ , the prediction accuracy of both $L^2$ and $\left |\delta Q \right |$ is inferior using the RSA even in comparison with the worst prediction of the SNN, with limited exceptions. The progression of the standard deviation for $\left |\delta Q \right |$ indicates that the SNN provides more consistent results compared with the RSA. Nevertheless, for $z \lt 2$ , the SNN predicts, similar to the RSA, flow rates with errors over 10 %.

Figure 6. (a) The $L^2$ error and (b) $|\delta Q |$ over downstream position $z$ for test case $\mathcal{E}_1$ ( $G=\textrm {SE}, R_c = \mathit{0.89}, Re = \mathit{5}\times \mathit{10^4}$ ). Depicted is a comparison of the RSA (blue) and the SNN (red) approaches. The solid line represents the mean, the dotted lines the mean $\pm$ standard deviation and the coloured areas the minimum and maximum ranges based on the 20 different angular paths per downstream position. The results are averages based on 20 training repetitions, the min/max and standard deviations are calculated after combining the 20 runs by averaging them.

The quality of the prediction is assessed for all test cases. This allows us to compute an average over all eight standard test cases $\mathcal{E}$ , which is visualised in figure 7. The previously described observation is confirmed and the progression of the maxima shows that there are no significant outliers for $z \gt 10$ in all test cases examined. The SNN prediction is on average always better than the RSA and also shows for the almost fully developed state an improvement in the volumetric flow rate determination. For a downstream distance of $z \gt 10$ , an error of less than 1 % can be expected. In § C in the appendix, a detailed analysis of the remaining seven test cases $\mathcal{E}_2$ to $\mathcal{E}_8$ can be found.

Figure 7. (a) The $L^2$ error and (b) $|\delta Q |$ over downstream position $z$ averaged for all test cases $\mathcal{E}$ . Depicted is a comparison of the RSA (blue) and the SNN (red) approaches. The solid line represents the mean, the dotted lines the mean $\pm$ standard deviation and the coloured areas the minimum and maximum ranges based on the 20 different angular paths per downstream position. The results are averages based on 20 training repetitions, the min/max and standard deviations are calculated after combining the 20 runs by averaging them.

Figure 8. Comparison of the model trained on the entire dataset $\mathcal{T}_{M_1}$ (middle) with the RSA (left), and the model trained on practically relevant cases $\mathcal{T}_{{M_2}}$ (right). The performance is evaluated for different test subsets. The upper half describes $|\delta Q |$ , and the lower half gives a one-to-one comparison with the RSA. It counts the cases where the RSA results in a lower $|\delta Q |$ than the SNN model. All data of the SNNs are given as an average $\pm$ standard deviation (calculated after averaging the individual predictions per training) obtained from 20 repetitions. Note that the written value and the colour code match only for the centre column. In the remaining columns, the change is illustrated by a deterioration in red shades and an improvement in green shades, in comparison with the middle column.

3.2. Evaluation on subsets

To facilitate the comparison between different cases, the mean absolute error of the volumetric flow rate is determined by analysing various subsets of the test dataset; refer to the top half in figure 8. For each test case ( $\mathcal{E}_1, \dots , \mathcal{E}_8$ ) corresponding to a specific geometry, eight 1-D profiles are extracted. These profiles are taken at four different downstream positions ( $z \approx 2.5, 7.5, 25, 75$ ), each evaluated at two different angles ( $36^\circ$ and $180^\circ$ ) and are denoted as $\mathcal{E}_{M_1}$ and $\mathcal{E}_{M_2}$ , with the latter referring to the practical cases only. The mathematical definition of the sets can be found in the appendix, see § B.4. The downstream measurement distances were selected with a higher sampling rate near the elbow outlet in order to capture the more disturbed flow profile in this region. The first point ( $z \approx 2.5$ ) accounts for physical constraints preventing measurements directly at the bend exit, while points at $z \approx 25$ and $z \approx 75$ capture the transition from disturbed to fully developed flow. An angle of $180^\circ$ was selected as it lies on the centreline, which is appropriate for assessing the symmetric profiles of the $\textrm {SE}$ and $\textrm {DSE}$ cases. An angle of $36^\circ$ was chosen as an arbitrary off-centre position. Furthermore, more precise subsets are generated by solely examining one specific geometry, such as double elbows, which are expressed as ‘ $\mathcal{E}_{{M_1},\textrm {DE}}$ ’ and ‘ $\mathcal{E}_{{M_2},\textrm {DE}}$ ’, respectively. Moreover, one subset is dedicated to the difference between $\mathcal{E}_{M_1}$ and $\mathcal{E}_{M_2}$ with $\mathcal{E}_{M_1} \setminus \mathcal{E}_{M_2}$ ( $\mathcal{E}_{{M_1}-{M_2}}$ ). The description of all test subsets can be found in table B1 in the appendix.

The first two columns of figure 8 compare the SNN versus the RSA in the described subsets. In the top half of the picture, the error of $\left |\delta Q \right |$ is given. For the RSA (left column) this is one value derived from averaging the error over all cases of the respective geometry. For the SNN (middle column), the results are not only averaged over the respective test subset, but also over the 20 repetitions of training the SNN. For the latter average, mean $\pm$ standard deviation are then shown in the picture. Please note that only the colour code of the middle column in figure 8 fits to the written values. For the other columns, the colour represents not the given values, but the deviation (in per cent) from the baseline case (i.e. the model $M_1$ trained on the entire dataset $\mathcal{T}_{M_1}$ ) shown in the centre column. Here, red shades illustrate a deterioration, whereas green shades show an improvement. The evaluation confirms the better performance of the SNN in all subsets. Overall, the mean $\left |\delta Q \right |$ of the SNN is 5.4 times smaller than the RSA ( $\mathcal{E}_{M_1}$ ). Especially for $\textrm {DSE}$ , the error is approximately 10 times smaller when applying the SNN. On the other hand, the RSA performs best for $\textrm {DE}$ , however, the SNN results on average in an approximately 2.7 times smaller $\left |\delta Q \right |$ . A more detailed analysis of the SNN’s performance reveals that all test subsets exhibit a relative error in volumetric flow rate of less than 0.5 %, with a narrow range between subsets, as the minimal error is greater than 0.23 %. The error for $M_1$ (0.42 %) is slightly larger than the error for $M_2$ (0.32 %) as the latter dataset is more centred in the parameter space of the training data. This finding is supported by the subset $\mathcal{E}_{M_1} \setminus \mathcal{E}_{M_2}$ , which contains test data from the edge region of the training parameter space, as it has the highest error across all test subsets (0.5 %). The comparison of the $\mathcal{E}_{M_1}$ and $\mathcal{E}_{M_2}$ related datasets for the individual geometries reveals a similar behaviour of $M_1$ or $M_2$ . In both cases, the intersection with $\textrm {DSE}$ results in a minimal error, which is especially striking given that the RSA yields the highest errors for this geometry. This phenomenon may be attributed to the mirror symmetry resulting from the absence of swirl. Hence, one might expect a comparable manner for the single elbows, however, they result in the largest errors. An explanation might be the smaller training dataset size compared with $\textrm {DE}$ and $\textrm {DSE}$ (SE: 42 CFD simulations, $85\,260$ 1-D paths; DE and DSE: 132 CFD simulations, $465\,960$ 1-D paths) and that the model overfitted for simpler disturbances. The smaller error of $\mathcal{E}_{M_2} \cap \mathcal{D}_{\textrm {DE}}$ (0.31 %) in comparison with $\mathcal{E}_{M_1} \cap \mathcal{D}_{\textrm {DE}}$ (0.43 %) caused the smaller error for $M_2$ stated above. Hence, predictions of flow profiles with swirl seem to be challenging at the periphery of the training dataset. In general, the 20 training repetitions show a standard deviation of less than 25 % of the average error, which highlights a stable algorithm. The standard deviation of $\mathcal{E}_{M_2}$ is higher than $\mathcal{E}_{M_1}$ (0.0607 % vs. 0.0391 %), which is a result of more outliers towards higher errors, mostly observed for symmetric profiles. The same explanation applies here as before.

The lower half of the heatmap provides a detailed, one-to-one comparison of the performance of the SNN with that of the RSA. It evaluates the number of cases where the conventional approach delivers smaller errors in the volumetric flow rate compared with the SNN approach. Similar to the upper part of the column, a smaller value represents a better performance of the SNN.

First of all, in the worst case, the SNN results twice as often in a smaller error than the RSA ( $\mathcal{E}_{M_2} \cap \mathcal{D}_{\textrm {SE}}$ ) but also reaches a case where every prediction is better than the RSA ( $\mathcal{E}_{M_2} \cap \mathcal{D}_{\textrm {DSE}}$ ). On average, 83 % ( $1 - 11/64$ ) of the SNN predictions are better than the RSA, see $\mathcal{E}_{M_1}$ . The comparison of $\mathcal{E}_{M_1}$ and $\mathcal{E}_{M_2}$ shows a better performance for the $\mathcal{E}_{M_1}$ subset. This observation is also valid for all intersections with the specific geometries (for $\textrm {DSE}$ it is difficult to judge because of the small size of the dataset). Accordingly, the subset $\mathcal{E}_{M_1} \setminus \mathcal{E}_{M_2}$ has a smaller ratio than $\mathcal{E}_{M_1}$ . In combination with the insights of $\left |\delta Q \right |$ , one can conclude that the predictions of $M_1$ perform better than the RSA. This is reasonable as especially the subset $\mathcal{E}_{M_1} \setminus \mathcal{E}_{M_2}$ contains only the edge cases with strongly disturbed profiles where the RSA fails.

3.3. Effect of restricting the training dataset to practically relevant cases

Up to now, all presented results were based on training with the dataset $\mathcal{T}_{M_1}$ , even though it was partially evaluated with data from the $\mathcal{T}_{{M_2}}$ parameter space. The dataset $\mathcal{T}_{{M_2}}$ covers a smaller parameter space that focuses on practically relevant cases and is therefore easier to generate by simulation, as the computational effort is lower. This analysis is useful as it demonstrates the trade-off between reduced simulation cost and potential limitations in prediction performance when using a more limited dataset. Figure 8 depicts results generated with an SNN trained on $\mathcal{T}_{{M_2}}$ in the right column. This comparison exhibits an increase of $\left |\delta Q \right |$ for almost all test subsets when the model is trained on $\mathcal{T}_{{M_2}}$ . In terms of $\mathcal{E}_{M_1}$ , this could be expected as the model now partially needs to extrapolate. This is emphasised by $\mathcal{E}_{M_1} \setminus \mathcal{E}_{M_2}$ , which is now entirely an extrapolation, since it contains only cases outside of $\mathcal{T}_{{M_2}}$ . Regarding the test subsets in the $\mathcal{E}_{M_2}$ parameter space, also a degradation of the performance can be observed, except for $\mathcal{E}_{M_2} \cap \mathcal{D}_{\textrm {SE}}$ . This observation can be attributed to a lower generalisation of the neural network better predicting simpler flow disturbances. Interestingly, the one-to-one comparison with the RSA shows either no change or an improvement when the model is trained on $\mathcal{T}_{{M_2}}$ . This behaviour can partially be explained by analysing the median instead of the mean (not depicted). This metric is more robust against outliers and shows, except for $\textrm {DSE}$ , an improvement in the performance of $M_2$ in the $\mathcal{E}_{M_2}$ parameter space. Thus, it can be concluded that the tailored model shows a slightly better performance for $\mathcal{E}_{M_2}$ with a higher risk of outliers toward high errors. In instances where the availability of measurement or CFD data is limited, this adaptation is a viable option, as the dataset $\mathcal{T}_{{M_2}}$ is approximately one third of the size of $\mathcal{T}_{M_1}$ .

Figure 9. Repeatability of the model based on 20 training runs depicted in the form of raincloud plots for the test subsets. The individual points represent the average error of one trained model per subset. The crosses mark the training that was used as the base case for the investigations in § 3.4.

Figure 9 provides a deeper insight into the stability and repeatability of the models. Therefore, a raincloud plot breaks down the results from the individual 20 training runs and plots them for the test subsets. The individual points represent the average error of one trained model per subset. Overall, the scatter is limited in a range of a maximum 0.5 %, emphasising the robustness of the algorithm. As mentioned above, the prediction of complex symmetric flow profiles features a higher risk of outliers and a wide distribution, especially $\textrm {DSE}$ . This is also particularly evident in the distribution of $L^2$ errors (not shown here). It can be hypothesised that the algorithm is in some cases unable to clearly distinguish between the SE and DSE profiles, which may result in a blended version of both profiles being produced. This might also explain why the lowest scatter across all test subsets is found for $\textrm {DE}$ as these profiles are clearly distinguishable from the rest of the parameter space.

The above-mentioned findings in the comparison of $M_1$ versus $M_2$ are confirmed with this depiction. The improvement of $\mathcal{E}_{M_2} \cap \mathcal{D}_{\textrm {SE}}$ by $M_2$ is also verified by the median of the distribution as well as a smaller range between the minimum and maximum.

3.4. Effect of training dataset variations

This section investigates the effect of systematic changes in input parameters for the neural network. Thereby, it is possible to get a deeper understanding of relevant input information and its effect on the stability of the model. As these tests are designed to identify trends, the training sessions were not repeated in this case to keep the computational effort reasonable. All studies are based on the training dataset $\mathcal{T}_{M_1}$ as it covers the entire parameter space and delivers the smaller $\left |\delta Q \right |$ . The results are displayed similarly to figure 8 in the form of a heatmap, where the columns represent the change of the parameter, and can be found in the Appendix D.

3.4.1. Effect of path length

Up to now, the algorithm predicted the entire velocity field based on a path that covers 80 % of the pipe diameter. For practical application, it is of interest to investigate shorter path lengths as a full path may not always be available and the measurement of shorter paths is also quicker. As anticipated, a shorter 1-D path reduces the availability of information for the SNN, resulting in weaker volumetric flow rate predictions. Interestingly, the error $\left |\delta Q \right |$ decreases marginally for intersections with $\mathcal{T}_{{M_2}}$ , when the path length is reduced to 60 %. An explanation might be that the region of 60 % to 80 % does not feature representative patterns for the entire flow field. The analysis of very short paths also shows that the area close to the wall must be very characteristic of the whole 2-D profile as the reconstruction still gives acceptable results (the maximum error is less than doubled compared with the 80 % path). In comparison, the RSA is almost unable to give reliable results.

3.4.2. Effect of the training dataset size

Another significant parameter that influences the performance of the SNN is the size of the training dataset. Generating a dataset the size of $\mathcal{T}_{M_1}$ requires a considerable amount of effort, so the influence of a gradual reduction was analysed. As expected, a reduction in the size of the training dataset causes an increased $\left |\delta Q \right |$ in the testing. However, it is remarkable how long the performance of the SNN remains almost unchanged or even slightly increases for some subsets. Even with a dataset size of only 0.5 % of the original dataset size ( $2\,682$ velocity profiles), almost no change can be detected. This observation is in line with the description of Erichson et al. (Reference Erichson, Mathelin, Yao, Brunton, Mahoney and Kutz2020), who emphasise the advantage of a small training dataset for SNNs. If the dataset size is reduced to less than 0.1 %, there is a clear increase in the errors, although a further reduction by a factor of 10 (only approximately 50 training datasets) does not lead to a significant change. In this case, the errors of flow rate are about twice as high, but, especially with sub-datasets from the set of $\mathcal{T}_{{M_2}}$ , there is no noticeable drop in the direct comparison with the RSA. It can be concluded that a smaller dataset would be sufficient, but additional data do not affect the performance of the SNN.

3.4.3. Effect of restricting the training dataset to specific configurations

This subsection analyses different versions of the neural network that were trained on specific datasets. For example, in a practical scenario, a swirl-free flow with no influence of a $\textrm {DE}$ can be detected by measuring the tangential component. In this case, a training dataset that excludes the $\textrm {DE}$ could be used. This study includes the following training datasets: (a) only $\textrm {SE}$ ( $\mathcal{T}_{{M_1}, \textrm {SE}}$ ), (b) only $\textrm {DE}$ ( $\mathcal{T}_{{M_1}, \textrm {DE}}$ ) and (c) swirl-free configurations, i.e. $\textrm {SE}$ combined with $\textrm {DSE}$ ( $\mathcal{T}_{{M_1}, \textrm {SE+DSE}}$ ). Additionally, the dataset has been reduced to contain (d) only 90 ( $\mathcal{T}_{{M_1}, 90}$ ) and (e) only nine random cases ( $\mathcal{T}_{{M_1}, 9}$ ). The cases have been reduced randomly but in such a way that there are 1/3 of the cases for each geometry. This dataset reduction excludes complete geometric configurations compared with the smaller training dataset size in the previous subsection. This results in a more realistic scenario with a limited database size, which is important when computational resources for CFD simulations are limited. This is relevant because generating a large database, whether based on simulations or experiments, can come at a high cost.

In general, the specialisation for one test subset can be recognised by two factors: nearly unchanged or improved performance for the tailored subset and degradation for the other subsets. Especially, the specialisation on DE leads to a significant reduction of $\left |\delta Q \right |$ . However, a significant increase in the mean error of more than 100 % of the flow rate as well as a deterioration in the direct comparison with the RSA for all other subsets can be noticed. This salient degradation could be explained by transferring swirl into swirl-free flows when a disturbance has been noticed. Interestingly, the other way round this behaviour could not be observed. Looking at the SNN trained on $\textrm {SE}$ and $\textrm {DSE}$ , one could notice the biggest improvement for $\textrm {DSE}$ while a decline can be recognised for $\textrm {SE}$ . An explanation might be the bias in the dataset due to the larger number of $\textrm {DSE}$ s compared with $\textrm {SE}$ s. Reducing the training dataset by excluding entire cases results in similar results as the random reduction of the dataset which emphasises the good inter- and extrapolation performance of the SNN.

3.5. Robustness against noise

Up to this point, the SNN has been trained and tested exclusively with simulation data. In this subsection, the next step in the direction for practical use with experimental measurement data is done by an investigation of the SNN on noisy data. For this purpose, the SNN is trained on $\mathcal{T}_{{M_2}}$ because these are the practically relevant cases and tested with 1-D velocity profiles, where noise has been added to mimic measurement data. In contrast to the training, the noise is applied directly as the first step to simulate that the entire algorithm, including the preprocessing, is confronted with synthetic measurement data. For a small noise amplitude of 0.01 %, no impact on the performance can be recognised. The amplitude of 0.1 % results in a slight increase of $\left |\delta Q \right |$ for most test cases – less than 12.8 % for all test data except $\textrm {DSE}$ . Further increasing the noise amplitude to a value larger than 1 % leads to an increase of $\left |\delta Q \right |$ greater than 100 % for most test subsets. Nevertheless, for an amplitude of 10 %, $\left |\delta Q \right |$ is still below 2 %. Furthermore, for the majority of the cases, the SNN performs better than the RSA. Comparing the results with those by Erichson et al. (Reference Erichson, Mathelin, Yao, Brunton, Mahoney and Kutz2020), the performance decreases faster with increasing noise level. An explanation might be the larger parameter space of the application presented here. Erichson et al. (Reference Erichson, Mathelin, Yao, Brunton, Mahoney and Kutz2020) investigated the effects of noise with the flow around a cylinder at a fixed Reynolds number of 100. Hence, only a single parameter is varied: the sampling time which is also restricted due to the periodic nature of the von Kármán vortex street. Adding a second dropout layer as suggested by Erichson et al. (Reference Erichson, Mathelin, Yao, Brunton, Mahoney and Kutz2020) as well as training with 100 % noisy data did not lead to an improvement but to a deterioration for low noise levels.

Figure 10. Value of $|\delta Q |$ over downstream position $z$ for (a) pipe section 2 and (b) pipe section 5 of the realistic test case. Depicted is a comparison of the RSA (blue) and the SNN (red) approaches. The solid line represents the mean, the dotted lines the mean $\pm$ standard deviation and the coloured areas the minimum and maximum ranges based on the 20 different angular paths per downstream position. The results are averages based on 20 training repetitions.

3.6. Evaluation with realistic test cases

In this section, the SNN trained on the entire $\mathcal{T}_{{M_2}}$ dataset is tested with the data from the realistic test case described in § 2.5. The $M_2$ model is chosen as it is designed for real cases. Figure 10 depicts the progression for two pipe sections of the test case described in § 2.5 – denoted as pipe sections 2 and 5 in figure 4. Pipe sections 1, 3 and 4 are omitted as $\left |\delta Q \right |$ is similar among these cases. The prediction of $Q$ for the SNN always results in a smaller mean error than the RSA, independent of the pipe section. With a mean error of approximately 2 %, the results are comparable to the errors of the standard test cases in the area of $z \lt 10$ , which is the most challenging part due to the high disturbance and the smallest representation in the training dataset. Thus, the SNN is able to extrapolate and cope with test cases where multiple perturbations are superimposed. The first pipe section further elucidates this by highlighting the absence of a 30 $^\circ$ elbow from the training dataset. Moreover, pipe section 5 contains the superposition of all five bends and is still able to achieve $\left |\delta Q \right |$ to be less than 1 % for $z \gt 10$ .

Prominent in the progression of the SNN for pipe sections 14 is the increase of the error towards the end. Presumably, this increase might be related to the repercussions of the following bend as such a phenomenon is not included in the training dataset. Comparing the progression of the pipe section 5 with the progression across all standard test datasets in figure 7, it becomes apparent that $\left |\delta Q \right |$ is higher for the former case in the region of $z \gt 60$ . In pipe section 5 a plateau with a slight decrease of the error could be observed. This effect might be explained by the superposition of the 5 disturbances, which take longer to dissipate as the swirl is higher compared with the standard DE cases. This observation is also supported by an asymmetry factor greater than 0 for $z = 100$ (not depicted).

4. Conclusion and outlook

Starting with the motivation to increase the precision of flow meter calibration, this paper developed an algorithm to predict the volumetric flow rate based on the measurement of the velocity along a 1-D path using a SNN. Therefore, the SNN predicts the 2-D velocity profile, which can be integrated to receive the volumetric flow rate $Q$ . The model is trained and tested on different elbow configurations. The results show that the error of $Q$ is significantly smaller with the SNN prediction compared with the state-of-the-art RSA. For distances $z \gt 10$ , a mean error of less than 1 % is achieved by the SNN, fulfilling practically relevant requirements. This observation has been confirmed with a realistic test case, which combines several elbows. Adaptions in the training dataset revealed that its reduction to a reasonable size can improve the prediction of the SNN. However, when the training dataset gets too small, it does not contain enough relevant information, leading to a significant decrease in performance. Similarly, a slight drop in performance could be observed when reducing the parameter space of the training dataset to $\mathcal{T}_{{M_2}}$ . However, it can be reasonable to do this if only specific parameters are relevant and included in the training parameter space. Nevertheless, this reduction increases the risk that predictions at the edge of the parameter space $\mathcal{T}_{M_1}$ result in high errors. Furthermore, the SNN was exposed to two additional conditions that can occur in practice: (a) noisy input data and (b) shorter 1-D paths. When the SNN is exposed to noisy data, a clear performance degradation appears. Regardless, the errors of the SNN are still significantly smaller compared with the RSA. However, improving the robustness of the algorithm is a crucial point when predicting the volumetric flow rate based on experimental 1-D path data. Hence, future work should focus on this part by e.g. generating more realistic synthetic data or even training the SNN on experimental data. For the latter in particular, the reliability of the algorithm could be improved by accounting for measurement uncertainties. The stress test of the SNN with a shorter 1-D path revealed even a slight improvement for paths in the range of 60 %. For paths shorter than 20 % a significant drop in performance occurs but the RSA is still outperformed. In addition, the robustness, in particular when the flow has swirl, might be improved by adding the tangential component to the SNN. However, it should be noted that the measurement of this component is costlier compared with the axial component. Similarly, reliable metadata could be added to the SNN to improve the prediction of the velocity profile. For example, information about the curvature radius of the last upstream elbow might support the algorithm. It will be interesting to see how the SNN performs with a larger variety of flow patterns. This can be realised by adding further geometric disturbances to increase the parameter space of the model.

Acknowledgements

The authors would like to thank A. Weissenbrunner (previously PTB) for providing the simulation data and U. Müller and W. Hübert (OPTOLUTION Messtechnik GmbH) for preparing the technical drawing of the realistic test case.

Data availability statement

The data that support the findings of this study are available from the corresponding author, C.W., upon reasonable request. The code which was used to generate the data can be accessed via 10.5281/zenodo.14006044.

Author contributions

Conceptualisation, C.W. and S.S.; Data curation, C.W., A.-K.E. and K.H.-D.; Formal analysis, C.W.; Funding acquisition, T.E.; Investigation, C.W., A.-K.E. and K.H.-D.; Methodology, C.W. and S.S.; Project administration, T.E.; Software, C.W., A.-K.E. and K.H.-D.; Supervision, S.S.; Validation, C.W., A.-K.E. and K.H.-D.; Visualisation, C.W. and A.-K.E.; Writing – original draft, C.W.; Writing – review and editing, A.-K.E. and S.S.

Funding statement

All authors gratefully acknowledge the internal funding by the PTB TransMeT programme.

Declaration of interests

The authors declare no conflict of interest.

Appendix A. Polar mesh

The velocity profile obtained from the CFD simulations is always interpolated on the same polar mesh as shown in figure A1. It consists of $m_r = 20$ equally spaced angular coordinates and a non-uniform spacing in the radial direction with a densification towards the wall. The $m_\phi = 36$ normalised radial coordinates are given by the following list: 0, 0.06, 0.12, 0.18, 0.24, 0.3, 0.36, 0.42, 0.48, 0.54, 0.6, 0.66172, 0.71408, 0.75848, 0.79616, 0.8281, 0.8552, 0.8782, 0.89768, 0.91422, 0.92826, 0.94016, 0.95024, 0.9588, 0.96606, 0.97222, 0.97744, 0.98188, 0.98564, 0.98882, 0.99152, 0.99382, 0.99576, 0.99742, 0.99882, 1.

Figure A1. Polar mesh of the velocity profile. The velocity is given for all intersections of the black lines.

Appendix B. Datasets

B.1. The entire dataset $\mathcal{D}$

The entire dataset $\mathcal{D}$ can be described as the following set consisting of the three base types of elbow configurations, namely SE, DSE and DE:

(B1) \begin{equation} \mathcal{D} = \mathcal{D}_{SE} \cup \mathcal{D}_{DSE} \cup \mathcal{D}_{DE}. \end{equation}

Here, $\mathcal{D}_{SE}$ , $\mathcal{D}_{DSE}$ and $\mathcal{D}_{DE}$ are defined as follows:

(B2) \begin{equation} \mathcal{D}_{SE} =\mathcal{D}_{SE, Re= 50\,000} \cup \mathcal{D}_{SE, Re= 500\,000}, \end{equation}

with

(B3) \begin{align} \mathcal{D}_{\mathrm{SE, Re=50\,000}} = \left \{ \vphantom {\left ( \frac {i-1}{100}\right )^2} \right . & \left ( G, R_c, D_e, Re, \phi , z \right ) \; | \nonumber\\[5pt] & G = \mathrm{SE}, \quad R_c \in \left \{ 0.51 + (10.01 - 0.51)\left (\frac {i-1}{20}\right )^2, i=1, \dots 21\right \}, \nonumber\\[5pt] & D_e = \emptyset , \quad Re = 5\cdot 10^4, \quad \phi \in \left \{ 2\pi (i-1)/20, i=1, \dots 20\right \}, \nonumber\\[5pt] & z \in \left \{100\left ( \frac {i-1}{100}\right )^2, i=1, \dots 102\right \} \left . \vphantom {\left ( \frac {i-1}{100}\right )^2} \right \}, \nonumber\\[5pt] \mathcal{D}_{\mathrm{SE, Re=500\,000}} = \left \{ \vphantom {\left ( \frac {i-1}{100}\right )^2} \right . & \left ( G, R_c, D_e, Re, \phi , z \right ) \; | \nonumber\\[5pt] & G = \mathrm{SE}, \quad R_c \in \left \{ 0.51 + (10.01 - 0.51)\left (\frac {i-1}{20}\right )^2, i=1, \dots 21\right \}, \nonumber\\[5pt] & D_e = \emptyset , \quad Re = 5\cdot 10^5, \quad \phi \in \left \{ 2\pi (i-1)/20, i=1, \dots 20\right \}, \nonumber\\[5pt] & z \in \left \{i-1, i=1, \dots 101\right \} \left . \vphantom {\left ( \frac {i-1}{100}\right )^2} \right \}, \nonumber\\[5pt] \mathcal{D}_{\mathrm{DSE}} = \left \{ \vphantom {\left ( \frac {i-1}{100}\right )^2} \right . & \left ( G, R_c, D_e, Re, \phi , z \right ) \; | \\[5pt] & R_c \in \left\{ \left (1 + 50 \left (1+10\left (\frac {i+2}{10}\right )^{2.2}\right )\right )/100, i=1, \dots 6\right\}, \nonumber\\[5pt] & D_e \in \left\{ 0.1 + (100.1 - 0.1)\left (\frac {i-1}{10}\right )^2, i=1, \dots 11\right\}, \nonumber\\[5pt] & Re = 5\cdot 10^4, \quad \phi \in \{ 2\pi (i-1)/20, i=1, \dots 20\}, \nonumber\\[5pt] & z \in \left \{100\left ( \frac {i-1}{150}\right )^2, i=1, \dots 152\right \} \left . \vphantom {\left ( \frac {i-1}{100}\right )^2} \right \}, \nonumber \\ \mathcal{D}_{\mathrm{DE}} = \left \{ \vphantom {\left ( \frac {i-1}{100}\right )^2} \right . & \left ( G, R_c, D_e, Re, \phi , z \right ) \; | \nonumber\\[5pt] & R_c \in \left\{ \left (1 + 50 \left (1+10\left (\frac {i+2}{10}\right )^{2.2}\right )\right )/100, i=1, \dots 6\right\}, \nonumber\\[5pt] & D_e \in \left\{ 0.1 + (100.1 - 0.1)\left (\frac {i-1}{10}\right )^2, i=1, \dots 11\right\}, \nonumber\\[5pt] & Re = 5\cdot 10^4, \quad \phi \in \{ 2\pi (i-1)/20, i=1, \dots 20\}, \nonumber\\[5pt] & z \in \left \{100\left ( \frac {i-1}{199}\right )^2, i=1, \dots 201\right \} \left . \vphantom {\left ( \frac {i-1}{100}\right )^2} \right \}. \nonumber\end{align}

B.2. The test dataset $\mathcal{E}$

From this dataset $\mathcal{D}$ , eight cases are excluded and used for test purposes only

(B4) \begin{equation} \begin{split} \mathcal{E}_1 &= \{ \left (G, R_c, D_e, Re, \phi , z \right ) | G=\textrm {SE}, R_c = 0.89, Re = 5\cdot 10^4 \},\\[5pt] \mathcal{E}_2 &= \{ \left (G, R_c, D_e, Re, \phi , z \right ) | G=\textrm {SE}, R_c = 1.67, Re = 5\cdot 10^4 \},\\[5pt] \mathcal{E}_3 &= \{ \left (G, R_c, D_e, Re, \phi , z \right ) | G=\textrm {SE}, R_c = 0.89, Re = 5\cdot 10^5 \},\\[5pt] \mathcal{E}_4 &= \{ \left (G, R_c, D_e, Re, \phi , z \right ) | G=\textrm {SE}, R_c = 1.67, Re = 5\cdot 10^5 \},\\[5pt] \mathcal{E}_5 &= \{ \left (G, R_c, D_e, Re, \phi , z \right ) | G=\textrm {DE}, R_c = 0.86, D_e = 3.61, Re = 5\cdot 10^4 \},\\[5pt] \mathcal{E}_6 &= \{ \left (G, R_c, D_e, Re, \phi , z \right ) | G=\textrm {DE}, R_c = 1.6, D_e = 3.61, Re = 5\cdot 10^4 \},\\[5pt] \mathcal{E}_7 &= \{ \left (G, R_c, D_e, Re, \phi , z \right ) | G=\textrm {DSE}, R_c = 0.86, D_e = 3.61, Re = 5\cdot 10^4 \},\\[5pt] \mathcal{E}_8 &= \{ \left (G, R_c, D_e, Re, \phi , z \right ) | G=\textrm {DSE}, R_c = 1.6, D_e = 3.61, Re = 5\cdot 10^4 \}. \end{split} \end{equation}

Together, these eight cases form the standard test dataset

(B5) \begin{equation} \mathcal{E} = \cup _{i=1, \dots , 8} \mathcal{E}_i. \end{equation}

B.3. Practically relevant cases $\mathcal{D}_P$

The entire dataset, $\mathcal{D}$ , contains cases that are very unlikely in real applications, especially in the edge regions of the parameter space. Therefore, the dataset $\mathcal{D}_P$ is restricted to cases that are practically relevant

(B6) \begin{equation} \mathcal{D}_P = \left \{ \left (G, R_c, D_e, Re, \phi , z \right ) \in \mathcal{T}_{M_1} | 1 \le R_c \le 3, 2 \le D_e \le 10, z \ge 5) \right \}. \end{equation}

B.4. Test subsets $\mathcal{E}_{M_1}$ and $\mathcal{E}_{M_2}$

The full test set $\mathcal{E}$ has been further reduced to

(B7) \begin{equation} \begin{split} \mathcal{E}_{M_1} &= \left \{ \left (G, R_c, D_e, Re, \phi , z \right ) \in \mathcal{E} | z \in \{2.5, 7.5, 25, 75\}D, \phi \in \{0.2\pi ,\pi \}) \right \}, \\[5pt] \mathcal{E}_{M_2} &= \mathcal{E}_{M_1} \cap \mathcal{D}_P. \end{split} \end{equation}

This additional reduction enables a clearer assessment of the algorithm, as changes can be attributed to individual cases. To gain an even deeper understanding of the SNN, we introduce subsets, which are explained in detail in table B1.

Table B1. Description of the test subsets used in the heatmaps.

Appendix C. Detailed results of M1

In this subsection, the evaluation of the $L^2$ and $\left |\delta Q \right |$ error is presented for the remaining seven test cases. This serves as an extension of figure 6 and provides a detailed breakdown of the data combined in figure 7. The results are shown in figure C1 for the test cases $\mathcal{E}_2$ to $\mathcal{E}_4$ and in figure C2 for the test cases $\mathcal{E}_5$ to $\mathcal{E}_8$ . In general, the $\left |\delta Q \right |$ of the SNN is, on average, consistently lower than that of the RSA. In terms of $L^2$ error, the SNN outperforms the RSA for the higher Reynolds number of $Re = 500\,000$ but shows slightly higher errors for $\textrm {DE}$ .

Figure C1. The $L^2$ error (left column) and $|\delta Q |$ (right column) over downstream position $z$ for test cases $\mathcal{E}_2$ to $\mathcal{E}_4$ . Depicted is a comparison of the RSA (blue) and the SNN (red) approaches. The solid line represents the mean, the dotted lines the mean $\pm$ standard deviation and the coloured areas the minimum and maximum ranges based on the 20 different angular paths per downstream position. The results are averages based on 20 training repetitions, the min/max and standard deviations are calculated after combining the 20 runs by averaging them.

Figure C2. The $L^2$ error (left column) and $|\delta Q |$ (right column) over downstream position $z$ for test cases $\mathcal{E}_5$ to $\mathcal{E}_8$ . Depicted is a comparison of the RSA (blue) and the SNN (red) approaches. The solid line represents the mean, the dotted lines the mean $\pm$ standard deviation and the coloured areas the minimum and maximum ranges based on the 20 different angular paths per downstream position. The results are averages based on 20 training repetitions, the min/max and standard deviations are calculated after combining the 20 runs by averaging them.

Appendix D. Effect of training dataset variations

D.1. The effect of path length

Figure D1 Evaluates the performance of path length decreased down to 10 % (regardless of the path length, the path always starts at the wall of the pipe and is oriented towards the centre of the pipe). As anticipated, a shorter 1-D path reduces the availability of information for the SNN, resulting in weaker volumetric flow rate predictions. Interestingly, $\left |\delta Q \right |$ decreases marginally for intersections with $\mathcal{T}_{{M_2}}$ when the path length is 60 %. Furthermore, $\textrm {DE}$ s buck the general trend as the error of the volumetric flow rate decreases with a shorter path.

The direct comparison with the RSA delivers an improvement of the SNN, which is related to a performance drop of the conventional approach for shorter paths. This is particularly evident in the $L^2$ error for a path with 10 %, as here the SNN predicts a more realistic profile in any case (not depicted).

Figure D1. Heatmap of the volumetric flow rate error for different lengths of the 1-D path (upper half) and a one-to-one comparison with the RSA. Compared are the results for different subsets of the test dataset. The number of points in the 1-D path is given for each column. Note that only for the left column do the written value and the colour code match. Cells with no coloured background represent relative changes which are not defined / infinite.

D.2. The effect of the training dataset size

Figure D2 Illustrates the effects of training with a reduced dataset. To achieve this, the parameter space remains unchanged while randomly selecting subsets of various sizes. During this process, bootstrapping is utilised by repeating each configuration five times and averaging across these runs. This process particularly impacts small datasets as the parameter space of the random draws deviates more significantly between individual runs.

As expected, a reduction in the size of the training dataset causes an increased $\left |\delta Q \right |$ in the testing. However, it is remarkable how long the performance of the SNN remains almost unchanged. Even with a dataset size of 0.5 % ( $2\,682$ velocity profiles), almost no change can be detected. Partially, one could get the impression of a slightly lower $\left |\delta Q \right |$ . Thus, smaller datasets could give an improvement as fewer profiles from the edge of the parameter space are in the training dataset, leading to almost no influence in the training process. From a dataset size of less than 0.1 %, there is a clear increase in the errors, although a further reduction by a factor of 10 (only approximately 50 training datasets) does not lead to a significant change. In this case, the errors of flow rate are approximately twice as high, but, especially with sub-datasets from the set of $\mathcal{T}_{{M_2}}$ , there is no noticeable drop in the direct comparison with the RSA.

Figure D2. Heatmap of the volumetric flow rate error for different training dataset sizes. The upper half describes $|\delta Q |$ , the lower half gives a one-to-one comparison with the RSA. Compared are the results for different subsets of the test dataset. Note that only for the left column do the written value and the colour code match. Cells with no coloured background represent relative changes which are not defined / infinite.

D.3. The effect of the restriction of the training dataset to specific configurations

Figure D3 analyses different versions of the neural network that were trained on specific datasets, e.g. only on $\textrm {SE}$ or $\textrm {DSE}$ . In general, the specialisation for one test subset can be recognised by two factors: nearly unchanged or improved performance for the tailored subset and degradation for the other subsets. Especially, the specialisation on DE leads to a significant reduction of $\left |\delta Q \right |$ . However, a significant increase in the mean error of more than 100 % of the flow rate as well as a deterioration in the direct comparison for all other subsets can be noticed, see in the upper part, third row of figure D3. This salient degradation could be explained by transferring swirl into swirl-free flows when a disturbance has been noticed. Interestingly, the other way round this behaviour could not be observed. Looking at the SNN trained on $\textrm {SE}$ and $\textrm {DSE}$ , one could notice the biggest improvement for $\textrm {DSE}$ while a decline can be recognised for $\textrm {SE}$ . An explanation might be the bias in the dataset due to the larger number of $\textrm {DSE}$ s compared with $\textrm {SE}$ s (SE: 42 CFD simulations, $85\,260$ 1-D paths; DSE: 66 CFD simulations, $200\,640$ 1-D paths).

The random reduction of the training dataset, represented by the last two columns of figure D3, lead to a reduction to 90 training cases and a drop of $\left |\delta Q \right |$ up to 20 %. The improvement is more pronounced for test cases in the core region of the parameter space, suggesting that cases in the peripheral regions of the training dataset slightly reduce performance within the core area. This observation is in line with the results presented for a random reduction of the training dataset by 50 %, leading to a comparable dataset size of approximately $270\,000$ cases, see § 2.3. If the reduction goes too far, the expected performance degradation arises. However, for most of the cases, $\left |\delta Q \right |$ rises by less than 100 %, which is in line with the observations for the random reduction of the training dataset (nine cases represent a reduction to approximately 5 %, which corresponds to 27,890 data pairs). The comparison with the random reduction shows that, for the nine cases, especially the $\textrm {DSE}$ cases suffer. Nonetheless, the error is in the same range as the other subsets, and the sharp degradation is attributed to the best performance across all geometries under standard conditions.

Figure D3. Heatmap for specific training datasets, namely a dataset optimised for $\textrm {SE}$ ( $\mathcal{T}_{{M_1}, \textrm {SE}}$ ), $\textrm {DE}$ ( $\mathcal{T}_{{M_1}, \textrm {DE}}$ ), $\textrm {SE+DSE}$ ( $\mathcal{T}_{{M_1}, \textrm {SE+DSE}}$ ) and 90 ( $\mathcal{T}_{{M_1}, 90}$ ) and 9 random cases ( $\mathcal{T}_{{M_1}, 9}$ ). The upper half describes the mean error of $Q$ , the lower half gives a one-to-one comparison with the RSA. Compared are the results for different subsets of the test dataset. Note that only for the left column do the written value and the colour code match. Cells with no coloured background represent relative changes which are not defined / infinite.

Appendix E. Robustness against noise

Figure E1 depicts the effect of different noise levels rising from left to right. In contrast to the previous heatmaps, all columns are based on the same trained SNN (trained on $\mathcal{T}_{{M_2}}$ ), only the noise level on the 1-D input path was varied. For a small noise amplitude of 0.01 %, no impact on the performance can be recognised. The amplitude of 0.1 % results in a slight increase of $\left |\delta Q \right |$ for most test cases – less than 12.8 % for all test data except $\textrm {DSE}$ . Here, an increase of $\left |\delta Q \right |$ up to 120 % ( $\mathcal{E}_{M_2} \cap \mathcal{D}_{\textrm {DSE}}$ ) can be noted. An explanation for this behaviour might be a slight overfitting for undisturbed data as this test subset features the lowest $L^2$ -error for undisturbed data over all test subsets ( $L^2=1.16$ ). Further increasing the noise amplitude to a value larger than 1 % leads to an increase of $\left |\delta Q \right |$ greater than 100 % for most test subsets. Nevertheless, for an amplitude of 10 %, $\left |\delta Q \right |$ is still below 2 %. Furthermore, for the majority of the cases, the SNN performs better than the RSA. The test subsets related to $\textrm {DE}$ exhibit the smallest deterioration. An explanation is that the $L^2$ error is highest for the undisturbed test case with $L^2=3.62$ ( $\mathcal{E}_{M_1} \cap \mathcal{D}_{\textrm {DE}}$ ) and $L^2=2.6$ ( $\mathcal{E}_{M_2} \cap \mathcal{D}_{\textrm {DE}}$ ). The one-to-one comparison reveals that in most cases the SNN is still better than the RSA.

Figure E1. Heatmap of the volumetric flow rate error for different noise levels. Note that only for the second column do the written value and the colour code match. Cells with no coloured background represent relative changes which are not defined / infinite.

References

Brunton, S. L., & Noack, B. R. (2015). Closed-loop turbulence control: Progress and challenges. Applied Mechanics Reviews, 67(5). https://doi.org/10.1115/1.4031175 CrossRefGoogle Scholar
Callaham, J. L., Maeda, K., & Brunton, S. L. (2019). Robust flow reconstruction from limited measurements via sparse representation. Physical Review Fluids, 4(10). https://doi.org/10.1103/physrevfluids.4.103907 CrossRefGoogle Scholar
Calogirou, A., Boekhoven, J., & Henkes, R. A. W. M. (2001). Effect of wall roughness changes on ultrasonic gas flowmeters. Flow Measurement and Instrumentation, 12(3), 219229. https://doi.org/10.1016/s0955-5986(01)00014-0 CrossRefGoogle Scholar
Drainy, Y. A. E., Saqr, K. M., Aly, H. S., & Jaafar, M. N. M. (2009). CFD analysis of incompressible turbulent swirling flow through zanker plate. Engineering Applications of Computational Fluid Mechanics, 3(4), 562572. https://doi.org/10.1080/19942060.2009.11015291 CrossRefGoogle Scholar
Erichson, N. B., Mathelin, L., Yao, Z., Brunton, S. L., Mahoney, M. W., & Kutz, J. N. (2020). Shallow neural networks for fluid flow reconstruction with limited sensors. Proceedings of the Royal Society A: Mathematical, Physical and Engineering Sciences, 476(2238), 20200097. https://doi.org/10.1098/rspa.2020.0097 CrossRefGoogle ScholarPubMed
Everson, R., & Sirovich, L. (1995). Karhunen–loève procedure for gappy data. Journal of the Optical Society of America A, 12(8), 1657. https://doi.org/10.1364/josaa.12.001657 CrossRefGoogle Scholar
Gersten, K. (2005). Fully developed turbulent pipe flow. In Fluid mechanics of flow metering (pp. 122). Berlin, Heidelberg: Springer. https://doi.org/10.1007/3-540-26725-5_1 Google Scholar
Gersten, K., & Herwig, H. (1992). Strömungsmechanik - Grundlagen der Impuls-, Wärme- und Stoffübertragung aus asymptotischer Sicht. Vieweg-Verlag.Google Scholar
Goodfellow, I., Bengio, Y., & Courville, A. (2016). Deep learning. Cambridge, MA: MIT Press. Available at http://www.deeplearningbook.org Google Scholar
Graziano, M. D., D’Errico, M., & Rufino, G. (2016). Ship heading and velocity analysis by wake detection in SAR images. Acta Astronautica, 128, 7282. https://doi.org/10.1016/j.actaastro.2016.07.001 CrossRefGoogle Scholar
Guntermann, P., Rose, J., Lederer, T., Dues, M., Müller, U., & Duckwe, A. (2011). In situ calibration of heat meters in operation. Euro Heat and Power, 8, 4649.Google Scholar
Hanson, B. R., & Schwankl, L. J. (1998). Error analysis of flowmeter measurements. Journal of Irrigation and Drainage Engineering, 124(5), 248256. https://doi.org/10.1061/(asce)0733-9437(1998)124:5(248) CrossRefGoogle Scholar
Hinton, G. E., Srivastava, N., Krizhevsky, A., Sutskever, I., & Salakhutdinov, R. R. (2012). Improving neural networks by preventing co-adaptation of feature detectors, 118. https://doi.org/10.48550/arXiv.1207.0580 CrossRefGoogle Scholar
Ioffe, S., & Szegedy, C. (2015). Batch normalization: Accelerating deep network training by reducing internal covariate shift, 111. https://doi.org/10.48550/arXiv.1502.03167 CrossRefGoogle Scholar
Kalnay, E. (2002). Atmospheric modeling, data assimilation and predictability. Cambridge University Press. https://doi.org/10.1017/cbo9780511802270 CrossRefGoogle Scholar
Kingma, D. P., & Ba, J. (2014). Adam: A method for stochastic optimization, 115. https://doi.org/10.48550/arXiv.1412.6980 CrossRefGoogle Scholar
Laws, E. M. (1990). Flow conditioning – a new development. Flow Measurement and Instrumentation, 1(3), 165170. https://doi.org/10.1016/0955-5986(90)90006-s CrossRefGoogle Scholar
Lumley, J. L. (1967). The structure of inhomogeneous turbulent flows. Atmospheric Turbulence and Radio Wave Propagation. Nauka, 166178.Google Scholar
Mohd Ali, N. F., & Mohd Iskandar, A. R. A. (2019). An effect of flow conditioner on accuracy of fluid flow measurement. Journal of Complex Flow, 1(1), 1115.Google Scholar
Müller, U., Dues, M., Hübert, W., & Rautenberg, C. (2018). Improving operational efficiency of power plants through on-site calibration of flow sensors. Energy Procedia, 149, 189196. https://doi.org/10.1016/j.egypro.2018.08.183 CrossRefGoogle Scholar
Pfeiffer, J., & King, R. (2012). Multivariable closed-loop flow control of drag and yaw moment for a 3d bluff body. In: 6th AIAA Flow Control Conference (pp. 114). https://doi.org/10.2514/6.2012-2802 CrossRefGoogle Scholar
Reader-Harris, M. J., Sattary, J. A., & Spearman, E. P. (1995). The orifice plate discharge coefficient equation – further work. Flow Measurement and Instrumentation, 6(2), 101114. https://doi.org/10.1016/0955-5986(94)00001-o CrossRefGoogle Scholar
Sankaran, S., Moghadam, M. E., Kahn, A. M., Tseng, E. E., Guccione, J. M., & Marsden, A. L. (2012). Patient-specific multiscale modeling of blood flow for coronary artery bypass graft surgery. Annals of Biomedical Engineering, 40(10), 22282242. https://doi.org/10.1007/s10439-012-0579-3 CrossRefGoogle ScholarPubMed
Schmid, P. J. (2010). Dynamic mode decomposition of numerical and experimental data. Journal of Fluid Mechanics, 656, 528. https://doi.org/10.1017/s0022112010001217 CrossRefGoogle Scholar
Shu, D., Li, Z., & Farimani, A. B. (2023). A physics-informed diffusion model for high-fidelity flow field reconstruction. Journal of Computational Physics, 478, 111972. https://doi.org/10.1016/j.jcp.2023.111972 CrossRefGoogle Scholar
Straka, M., Weissenbrunner, A., Koglin, C., Höhne, C., & Schmelter, S. (2022). Simulation uncertainty for a virtual ultrasonic flow meter. Metrology, 2(3), 335359.10.3390/metrology2030021CrossRefGoogle Scholar
Strom, B., Brunton, S. L., & Polagye, B. (2017). Intracycle angular velocity control of cross-flow turbines. Nature Energy, 2(8). https://doi.org/10.1038/nenergy.2017.103 CrossRefGoogle Scholar
Weissenbrunner, A., Ekat, A., Straka, M., & Schmelter, S. (2023). A virtual flow meter downstream of various elbow configurations. Metrologia, 60(5), 054002. https://doi.org/10.1088/1681-7575/ace7d6 CrossRefGoogle Scholar
Wildemann, C., Merzkirch, W., & Gersten, K. (2002). A universal, nonintrusive method for correcting the reading of a flow meter in pipe flow disturbed by installation effects. Journal of Fluids Engineering, 124(3), 650656. https://doi.org/10.1115/1.1478065 CrossRefGoogle Scholar
Wilms, C., Ekat, A.-K., Hertha-Dunkel, K., Eichler, T., & Schmelter, S. (2025). Pipe flow decoder. https://doi.org/10.5281/zenodo.15879198 CrossRefGoogle Scholar
Wilms, C., Xu, W., Ozler, G., Jantač, S., Schmelter, S., & Grosshans, H. (2024). Ml enhanced measurement of the electrostatic charge distribution of powder conveyed through a duct. Journal of Loss Prevention in the Process Industries, 92, 105474. https://doi.org/10.1016/j.jlp.2024.105474 CrossRefGoogle Scholar
Xu, S., Sun, Z., Huang, R., Guo, D., Yang, G., & Ju, S. (2022). A practical approach to flow field reconstruction with sparse or incomplete data through physics informed neural network. Acta Mechanica Sinica, 39(3). https://doi.org/10.1007/s10409-022-22302-x CrossRefGoogle Scholar
Yakhot, A., Anor, T., & Karniadakis, G. E. (2007). A reconstruction method for gappy and noisy arterial flow data. IEEE Transactions on Medical Imaging, 26(12), 16811697. https://doi.org/10.1109/tmi.2007.901991 CrossRefGoogle ScholarPubMed
Yeh, T. T., & Mattingly, G. E. (1994). Pipeflow downstream of a reducer and its effects on flowmeters. Flow Measurement and Instrumentation, 5(3), 181187. https://doi.org/10.1016/0955-5986(94)90017-5 CrossRefGoogle Scholar
Zhang, J., Liu, J., & Huang, Z. (2023). Improved deep learning method for accurate flow field reconstruction from sparse data. Ocean Engineering, 280, 114902. https://doi.org/10.1016/j.oceaneng.2023.114902 CrossRefGoogle Scholar
Figure 0

Figure 1. (a) Exemplary 1-D velocity profile (red line) extracted from a strongly disturbed 2-D velocity profile (shown in (b) by the red dots.). In order to consider realistic conditions, the path is limited to 80 % of the pipe diameter, see explanation in § 2.3. The profile is normalised over the pipe diameter $D^*$ and $r^*$ represents the radius coordinate. The dashed line symbolises a reflection of the entire 1-D profile. The blue profile describes the RSA profile (for the core area of the profile the mean of both sides is taken) and is plotted as a 2-D field in (c). The discontinuity of the blue curve at $r^*/\mathit{0.5}D^* \mathit{= \pm 0.6}$ is due to the averaging of the core region. The corresponding mean velocities are denoted as $\overline {u^*}_{\textit{true}}$ and $\overline {u^*}_{rot}$.

Figure 1

Table 1. Overview of the configuration used to train the neural networks.

Figure 2

Figure 2. Overview of the geometrical configurations. (a) Technical drawing of an S-elbow, (b) to (d) schematic renderings of a single elbow, an S-elbow and a double elbow out-of-plane.

Figure 3

Figure 3. Contour plots of the different normalisation steps starting from the original velocity profile at the top left corner: 1. profile normalised by the volumetric flow rate based on the RSA using the selected 1-D profile, 2. profile with subtraction of the Gersten–Herwig profile (visualised in (a)), 3. normalisation using the standard deviation of the 1-D path. (b) Noise can be added to the 1-D profile (here also added for visualisation purposes to the 2-D profile).

Figure 4

Figure 4. Rendering of the real test case including information about the pipe sections. The green-marked pipe sections are analysed in greater detail in the results.

Figure 5

Figure 5. Exemplary comparison of a ground truth velocity 2-D profiles (upper row) with the corresponding SNN prediction (lower row). The red dots indicate the location where the velocity is sampled for the 1-D profile. The profiles are taken from the test case $\mathcal{E}_1$ at different downstream distances increasing from left to right.

Figure 6

Figure 6. (a) The $L^2$ error and (b) $|\delta Q |$ over downstream position $z$ for test case $\mathcal{E}_1$ ($G=\textrm {SE}, R_c = \mathit{0.89}, Re = \mathit{5}\times \mathit{10^4}$). Depicted is a comparison of the RSA (blue) and the SNN (red) approaches. The solid line represents the mean, the dotted lines the mean $\pm$ standard deviation and the coloured areas the minimum and maximum ranges based on the 20 different angular paths per downstream position. The results are averages based on 20 training repetitions, the min/max and standard deviations are calculated after combining the 20 runs by averaging them.

Figure 7

Figure 7. (a) The $L^2$ error and (b) $|\delta Q |$ over downstream position $z$ averaged for all test cases $\mathcal{E}$. Depicted is a comparison of the RSA (blue) and the SNN (red) approaches. The solid line represents the mean, the dotted lines the mean $\pm$ standard deviation and the coloured areas the minimum and maximum ranges based on the 20 different angular paths per downstream position. The results are averages based on 20 training repetitions, the min/max and standard deviations are calculated after combining the 20 runs by averaging them.

Figure 8

Figure 8. Comparison of the model trained on the entire dataset $\mathcal{T}_{M_1}$ (middle) with the RSA (left), and the model trained on practically relevant cases $\mathcal{T}_{{M_2}}$ (right). The performance is evaluated for different test subsets. The upper half describes $|\delta Q |$, and the lower half gives a one-to-one comparison with the RSA. It counts the cases where the RSA results in a lower $|\delta Q |$ than the SNN model. All data of the SNNs are given as an average $\pm$ standard deviation (calculated after averaging the individual predictions per training) obtained from 20 repetitions. Note that the written value and the colour code match only for the centre column. In the remaining columns, the change is illustrated by a deterioration in red shades and an improvement in green shades, in comparison with the middle column.

Figure 9

Figure 9. Repeatability of the model based on 20 training runs depicted in the form of raincloud plots for the test subsets. The individual points represent the average error of one trained model per subset. The crosses mark the training that was used as the base case for the investigations in § 3.4.

Figure 10

Figure 10. Value of $|\delta Q |$ over downstream position $z$ for (a) pipe section 2 and (b) pipe section 5 of the realistic test case. Depicted is a comparison of the RSA (blue) and the SNN (red) approaches. The solid line represents the mean, the dotted lines the mean $\pm$ standard deviation and the coloured areas the minimum and maximum ranges based on the 20 different angular paths per downstream position. The results are averages based on 20 training repetitions.

Figure 11

Figure A1. Polar mesh of the velocity profile. The velocity is given for all intersections of the black lines.

Figure 12

Table B1. Description of the test subsets used in the heatmaps.

Figure 13

Figure C1. The $L^2$ error (left column) and $|\delta Q |$ (right column) over downstream position $z$ for test cases $\mathcal{E}_2$ to $\mathcal{E}_4$. Depicted is a comparison of the RSA (blue) and the SNN (red) approaches. The solid line represents the mean, the dotted lines the mean $\pm$ standard deviation and the coloured areas the minimum and maximum ranges based on the 20 different angular paths per downstream position. The results are averages based on 20 training repetitions, the min/max and standard deviations are calculated after combining the 20 runs by averaging them.

Figure 14

Figure C2. The $L^2$ error (left column) and $|\delta Q |$ (right column) over downstream position $z$ for test cases $\mathcal{E}_5$ to $\mathcal{E}_8$. Depicted is a comparison of the RSA (blue) and the SNN (red) approaches. The solid line represents the mean, the dotted lines the mean $\pm$ standard deviation and the coloured areas the minimum and maximum ranges based on the 20 different angular paths per downstream position. The results are averages based on 20 training repetitions, the min/max and standard deviations are calculated after combining the 20 runs by averaging them.

Figure 15

Figure D1. Heatmap of the volumetric flow rate error for different lengths of the 1-D path (upper half) and a one-to-one comparison with the RSA. Compared are the results for different subsets of the test dataset. The number of points in the 1-D path is given for each column. Note that only for the left column do the written value and the colour code match. Cells with no coloured background represent relative changes which are not defined / infinite.

Figure 16

Figure D2. Heatmap of the volumetric flow rate error for different training dataset sizes. The upper half describes $|\delta Q |$, the lower half gives a one-to-one comparison with the RSA. Compared are the results for different subsets of the test dataset. Note that only for the left column do the written value and the colour code match. Cells with no coloured background represent relative changes which are not defined / infinite.

Figure 17

Figure D3. Heatmap for specific training datasets, namely a dataset optimised for $\textrm {SE}$ ($\mathcal{T}_{{M_1}, \textrm {SE}}$), $\textrm {DE}$ ($\mathcal{T}_{{M_1}, \textrm {DE}}$), $\textrm {SE+DSE}$ ($\mathcal{T}_{{M_1}, \textrm {SE+DSE}}$) and 90 ($\mathcal{T}_{{M_1}, 90}$) and 9 random cases ($\mathcal{T}_{{M_1}, 9}$). The upper half describes the mean error of $Q$, the lower half gives a one-to-one comparison with the RSA. Compared are the results for different subsets of the test dataset. Note that only for the left column do the written value and the colour code match. Cells with no coloured background represent relative changes which are not defined / infinite.

Figure 18

Figure E1. Heatmap of the volumetric flow rate error for different noise levels. Note that only for the second column do the written value and the colour code match. Cells with no coloured background represent relative changes which are not defined / infinite.