Brought to you by:
Paper

A Bayesian study of uncertainty in ultrasonic flow meters under non-ideal flow conditions

, , and

Published 24 July 2017 © 2017 BIPM & IOP Publishing Ltd
, , Citation Z Belligoli et al 2017 Metrologia 54 584 DOI 10.1088/1681-7575/aa7b8d

0026-1394/54/4/584

Abstract

This paper presents an approach for updating the epistemic uncertainty of ultrasonic flow meter measurements under non-ideal flow conditions. Instead of re-calibrating the instrument to correct its behavior in these difficult working conditions, a Bayesian calibration of a computer model of the real process is used. The numerical model is based on computational fluid dynamics (CFD) and a surrogate model is constructed from a limited number of CFD calculations using kriging. The computer model predicts the flow rate dependent on certain parameters including the bulk Reynolds number—which carries information about the true speed of the flow, and is measured only approximately by an ultrasonic flow meter. Bayesian calibration is applied, and the posterior of the true speed can be derived from the marginal posterior of the Reynolds number. This pdf has a smaller uncertainty with respect to the observed data used to fit the model on the condition that sufficiently informative data are available. If this is the case, the proposed approach is capable of reducing not only the uncertainty but also the error associated with the flow meter measurements in non-ideal conditions.

Export citation and abstract BibTeX RIS

1. Introduction and motivation

Transit-time ultrasonic flow meters (UFM) are one of the most common types of flow meter used in industrial applications, thanks to their versatility, accuracy and ease of use [1, 2]. The uncertainties in a UFM measurement can either be aleatoric or epistemic. The former are due to a natural variability in the process being studied, and cannot be reduced by gathering additional knowledge about the system (e.g. uncertainty due to repeatability). The latter are due to a lack of knowledge about the process under study and can be reduced, for example, by gathering more data or refining models [3]. Drenthen and de Boer [4] claimed that the main sources of epistemic uncertainty in a UFM are due to the flow velocity profile not being uniform, to inaccurate time measurements, to geometric tolerances, or installation effects. In this paper we focus on the uncertainty due to inhomogeneous flow profiles—which is usually the most severe.

To reduce the uncertainty due to flow profile inhomogeneity, flow meter manufacturers recommend positioning the instrument far away from any source of disturbance, in a location where the flow resembles fully-developed pipe flow as much as possible. In reality, however, this is not always possible due to the constrained lengths of pipe installations, and to the persistence of flow disturbances for many diameters downstream of their source. For the case of a pipe bend, significant flow disturbances can persist for more than twenty diameters from the bend exit [5]. This can cause meter errors of several percent (the exact amount depends on the type of UFM) [6] with associated higher uncertainties. A possible solution to this problem would be re-calibrating the flow meter for these non-ideal flow conditions, but this is not always possible due to economical constraints or absence of appropriate experimental facilities.

In this paper, a computer model is calibrated using Bayesian inference in order to estimate epistemic uncertainty due to pipe bends, given observations of the system under test. In this study, the observations are the experimental flow-meter measurements, and the computer model is built by combining computational fluid dynamics (CFD) with a kriging surrogate model.

1.1. Previous work

The application of Bayesian inference for the estimation of measurement uncertainty is gradually becoming popular in the metrological community. Forbes and Sousa [7] compared the inverse uncertainty evaluation provided by the Bayesian approach with the forward uncertainty evaluation provided by the law of propagation of uncertainty and Monte Carlo methods. They concluded both methodologies are valid, but highlighted that Bayesian approaches can be misleading when nonlinear models are considered. Similar conclusions were also reached by Elster and Toman [8]. Lira and Grientschnig extended the Bayesian uncertainty estimation technique in metrology from single-output models to multi-output models [9]. These and other studies were relevant for the revision and update of the Guide to the Expression of Uncertainty in Measurement (GUM) [10]. Although important, these studies provided only general guidelines to the application of Bayesian techniques in metrology.

In the narrower context of flow rate measurements, Bayesian inference has been used by Kok et al [11] to calibrate a turbine flow meter proving that, by taking into account prior knowledge about the flow meter or the calibration procedure, the uncertainty can be reduced with respect to a standard GUM-based calibration. However, White [12] noted that the technique produced a bias in the curve, making it useless for some decision making processes, and suggested avoiding informative priors for calibration analyses.

As far as CFD is concerned, its capabilities to reproduce wall bounded flows have increased dramatically over the last thirty years in Reynolds-averaged Navier–Stokes (RANS) equations [1315], large eddy simulations (LES) [1618], and even direct numerical simulations (DNS) [19].

In this paper, Bayesian inference techniques are applied to the problem of flow rate measurements in a pipe under non-ideal flow conditions caused by a bend. Uninformative priors are used, and a model based on computational fluid dynamics and a kriging surrogate is employed to reduce the computational overhead to feed together with experimental data into the Bayesian procedure. The aim of this study is to prove that the combination of Bayesian inference and additional information about the particular configuration (provided by the numerical model) can reduce the uncertainty and (potentially) the error in the flow rate measurement of a two-path ultrasonic flow meter.

The paper is organized as follows. The principles of the Bayesian calibration of computer models and the overview of the proposed approach are presented at the beginning of section 2. The working principle of ultrasonic flow meters and an overview of the flow physics are introduced in sections 2.1 and 2.2 respectively. The experimental set-up is described in section 2.3. The CFD set up and the surrogate model are described in section 2.4. Results and discussion of experiments, CFD simulations and Bayesian methods are presented and discussed in section 3. Finally, section 4 contains some concluding remarks.

2. Proposed approach

The aim of this paper is to present a methodology for correcting the measurements of a UFM and estimating its uncertainty when the flow is in non-ideal conditions. It is supposed that the instrument cannot be re-calibrated in situ, and Bayesian calibration of a computer model of the UFM is used to update the real UFM measurements instead. This general methodology was introduced by Kennedy and O'Hagan [20], but here additional assumptions are made.

In general, a Bayesian calibration of a computer model can be performed in three steps. First, a statistical model relating the measured data to the computer model is defined:

Equation (1)

where $\boldsymbol{d} = [d_i] \in \mathbb{R}^N$ are the measured data, $\boldsymbol{\varepsilon} \sim \mathcal{N}(\boldsymbol{0}, \sigma_{\varepsilon}^2\boldsymbol{I})$ is the random vector of measurement errors, $\boldsymbol{\theta} \in \mathbb{R}^M$ are the parameters governing the computer model $\boldsymbol{m}(\cdot)$ , and $\boldsymbol{\delta}\sim \mathcal{N}(\boldsymbol{\mu_{\delta}}, \boldsymbol{\Sigma_{\delta}})$ is an additive model inadequacy parameter that takes into account the model output not being equal to the true value of the flow rate [20].

The parameters governing the model can be calibrated using Bayes' theorem:

Equation (2)

where $\boldsymbol{\gamma} = [\boldsymbol{\theta}, \boldsymbol{\mu_{\delta}}, \boldsymbol{\hat{\xi}}]$ , and $\boldsymbol{\hat{\xi}}$ is a vector of hyperparameters depending on the form of the model inadequacy covariance matrix $\boldsymbol{\Sigma_{\delta}}$ . The term $p(\boldsymbol{d}\vert \boldsymbol{\gamma})$ is the likelihood and provides the means for updating the model with observed data. The term $\pi_0(\boldsymbol{\gamma})$ is called the prior distribution and it represents what is known about $\boldsymbol{\gamma}$ before the data become available. Note that we denote with $\pi(\cdot)$ the pdfs relating to non-observable variables, and with $p(\cdot)$ those relating to observable variables.

Finally, once the elements of $\boldsymbol{\gamma}$ have been calibrated, they can be fed to the statistical model of (1) to make predictions of the quantity of interest $\tilde{d}$ at a new $\boldsymbol{\theta}$ (after all the hyperparameters have been fixed e.g. to their posterior mean value) by computing the posterior predictive distribution:

Equation (3)

In this paper, we select the elements of $\boldsymbol{\theta}$ in such a way that the marginal posterior of one of these elements already contains the information needed to estimate the epistemic uncertainty of the quantity of interest without needing to apply (3). It is worth noting that the proposed approach is completely general, and can be applied to flow rates measured by any instrument (e.g. pitot tubes, flow meters, etc).

The case under consideration is that of a two-path ultrasonic flow meter measuring downstream of a pipe bend. The raw data provided by the UFM are the two flow rates measured by the two paths $\boldsymbol{d} = [\dot{m}_1\;\;\dot{m}_2]$ . Since so little data (information) is available, it will be very difficult to infer anything about $\boldsymbol{\gamma}$ unless a very accurate computer model is used. Hence, the need for computational fluid dynamics.

Given this statistical model in (1), with Gaussian prior information and Gaussian experimental noise, the likelihood function is a Gaussian pdf in $\boldsymbol{d}$ :

Equation (4)

where $\boldsymbol{\gamma} = [\boldsymbol{\theta}, \boldsymbol{\rho}]$ , and $\boldsymbol{\rho}$ is the vector of model inadequacy hyperparameters associated with $\boldsymbol{\delta}$ , z is the size of $\boldsymbol{d}$ , $\boldsymbol{m} = \boldsymbol{m}(\boldsymbol{\theta}) + \boldsymbol{\mu_{\delta}}$ , and $\boldsymbol{Q} = \boldsymbol{Q_e} + \boldsymbol{Q_m} + \boldsymbol{Q_{\delta}}$ is a matrix obtained by assuming an independent Gaussian uncertainty, i.e. $\boldsymbol{Q_e} = {\rm diag}(\boldsymbol{\sigma_{\epsilon}^2})$ , $\boldsymbol{Q_m} = \boldsymbol{\Sigma_K}$ being the covariance matrix of kriging, and $\boldsymbol{Q_{\delta}} = {\rm diag}(\boldsymbol{\sigma_{\delta}^2})$ , where $\boldsymbol{\delta}$ is assumed to be normally distributed with mean $\boldsymbol{\mu_{\delta}}$ and covariance matrix $\boldsymbol{\Sigma_{\delta}} = \boldsymbol{Q_{\delta}}$ .

CFD simulations of the geometry causing the disturbance are performed at $n_{{\rm Re}_b}$ Reynolds numbers (${\rm Re}_b$ ). It is assumed that the pipe diameter D and fluid kinematic viscosity ν are constants—hence, the terms Reynolds number, flow rate, or flow speed used in this paper are interchangeable, and are all related to the average flow speed in the pipe.

Samples of the flow rate at $n_{x/D}$ distances from the bend ($x/D$ ) and $n_{\alpha}$ flow-meter rotation angles (α) are extracted, thus providing $n_{{\rm Re}_b} \times n_{x/D} \times n_{\alpha}$ flow rate samples $\dot{m}_i$ for the ith flow-meter path. A kriging technique is used to regress these data and build a computer model of the form $\boldsymbol{d} = [\dot{m}_2\;\;\dot{m}_2] = \boldsymbol{m}(\boldsymbol{\theta})$ , where $\boldsymbol{\theta} = (x/D, {\rm Re}_b, \alpha)$ . In this way, a computer model able to replicate the behavior of the UFM in non-ideal flow conditions could be built.

The key factor is that, in the simulations, ${\rm Re}_b$ is computed using the speed specified as inflow condition, which corresponds to the true bulk speed of the flow computed as:

Equation (5)

where A is the pipe cross-sectional area, $\boldsymbol{v}$ is the flow velocity vector of an infinitesimal surface element ${\rm d}A$ , and the hat over $\hat{U_b}$ indicates that this is the true bulk speed of the flow, as opposed to that measured by the UFM, which is an approximation.

Hence, by calibrating $\boldsymbol{\theta}$ , an updated estimate of the true flow rate can be derived from the posterior of the Reynolds number as:

Equation (6)

where ν is the flow kinematic viscosity, A is the pipe cross-sectional area, and D is the pipe diameter. This method is expected to be able to reduce the epistemic uncertainty associated with the UFM measurements, provided the observed data are informative enough to identify not only ${\rm Re}_b$ but also $x/D$ and α. Furthermore, if the computer model is able to fit the experimental data well enough, the updated flow rate computed with this approach will have a smaller error with respect to the experimentally measured one, thanks to the information about the true flow speed stored in the Reynolds number.

The overview of the entire approach is schematically presented in figure 1.

Figure 1.

Figure 1. Flowchart of the method.

Standard image High-resolution image

2.1. Ultrasonic flow meter

An ultrasonic flow meter is a measurement device that indicates the volume of fluid flowing through the device per unit of time. A flow meter can have one or multiple paths, a path being the imaginary straight line connecting two sensors sending ultrasonic pulses to each other. For transit-time UFM the flow speed is an approximation of the true bulk velocity obtained by measuring the time difference between a pulse traveling upstream and one traveling downstream along the same path. The basic equations for calculating propagation times in the UFM can be written as:

Equation (7)

where $\boldsymbol{v}$ is the fluid velocity vector, c is the speed of sound, $\boldsymbol{e}$ is a unit vector of sound path, ${\rm d}s$ is an infinitesimal length element along the path, and d and u indicate the positions of the downstream and upstream sensors respectively. The approximation of the true flow speed measured by the UFM is obtained as:

Equation (8)

where ϕ is the path axial angle with the pipe centreline, L is the path length, and tup and tdown are the times the pulse takes to travel upstream and downstream respectively [21].

If multiple paths are present, the ultimate estimate of the flow speed is obtained by a weighted average of the flow speed measured along each path:

Equation (9)

where k is the total number of paths, and different choices of weights are possible. Finally, the flow rate is approximated by multiplying the flow speed with the pipe cross-sectional area:

Equation (10)

2.2. Flow physics

If a fluid is moving along a straight pipe that after some point becomes curved, the bend will cause the fluid particles to change their principle direction of motion. A high streamwise velocity region close to the outer part of the bend and a low streamwise velocity region close to the inner part of the bend are formed. At the same time, a secondary motion consisting of a pair of Dean vortices symmetrically counter-rotating with respect to the pipe symmetry plane is created, as shown in figure 2 [13], [2224]. This distorted flow profile persists for many diameters downstream of the bend exit [5].

Figure 2.

Figure 2. Qualitative images of some characteristics of the flow in a pipe with a bend. (a) Scheme of the Dean vortices produced downstream of a pipe bend. (b) Scheme of the flow development in a pipe with a bend.

Standard image High-resolution image

For a 90-degree bend, the flow in the low velocity region can either be separated or not. This depends on the flow speed and on the curvature ratio $\kappa = \frac{R_a}{R_c}$ , where $R_a=D/2$ is the pipe radius, Rc being the pipe curvature radius. If the flow is separated, unsteadiness can be generated thus adding an extra layer of complexity to the flow rate measurements with ultrasonic flow metering principles as presented in section 2.1.

2.3. Experimental configurations

The observed data were gathered during an experiment carried out at the Dutch Metrology Institute (VSL). An uncalibrated two-path OPTISONIC 7300 flow meter from Krohne GmbH [25] was used to measure the flow rate.

The experimental set up consists of three parts: a 20D-long straight pipe connected to a 90-degree pipe bend with $\kappa= 0.5$ and a straight pipe of variable length extending downstream of the bend exit, as shown in figure 3. The diameter of the pipe is $D=0.159$ m. The working fluid is air at ambient temperature $T = 293$ K. The flow approaching the bend is assumed to be fully developed. The flow meter is positioned at zero, four and ten diameters from the exit of the pipe elbow. At each of these positions, the instrument is rotated of an azimuthal angle α of $0\pi$ , $\pi/3$ and $\pi/2$ with respect to the pipe symmetry plane. Different flow velocities are investigated in this experiment as in table 1.

Figure 3.

Figure 3. Sketch of the geometry under investigation. P1 and P2 are path 1 and path 2 respectively. The origin of the reference system is placed at the pipe centre immediately after the bend.

Standard image High-resolution image

Table 1. Parameters of the pipe-bend experiment. Note that the velocities are an average of those measured by the reference flow meter.

κ (—) $x/D$ (—) α (rad) v (m ${\rm s}^{-1}$ )
$0.5$ $0, \, 4, \, 10$ $0\pi, \, \pi/3, \, /\pi/2$ $3.2, \, 5.1, \, 10.0, \, 20.0$

Flow-meter measurements were recorded every second for approximately three minutes for all configurations examined. For each configuration, the arithmetic average and the standard deviation of the samples were computed as:

Equation (11)

where $U_i^{\,j}$ is the jth measurement of the average speed at the ith path, and $\sigma_{\bar{U}_i}$ represents the aleatoric uncertainty due to repeatability associated with the ith path.

A reference flow meter was positioned far downstream from the bend to ensure its performance was not influenced by any sort of disturbance. It is important to highlight that the data from the reference flow meter are not used in any way in building the computer model or carrying out the Bayesian calibration, as can be seen from the flowchart of figure 1. Its measurements are used only for validation purposes, as ground truth to compute the errors in the values measured by the two-path flow meter under test, and in those obtained after applying the method proposed in this paper. The reference flow meter is a SM-RI-X Turbine meter from Elster Instromet [26].

2.4. CFD simulations

In this work, CFD is fundamental to building the computer model that will be used in the Bayesian data analysis. Because its direct use in a Bayesian calibration is unfeasible due to the large number of model evaluations required, a surrogate model of the CFD is built using kriging.

With this in mind, RANS simulations of the geometry under consideration are carried out for a variety of Reynolds numbers. For each of these simulations, samples of the velocity vector along the two paths are extracted at the intersection between the path line and the mesh cells. After discretizing (7), the transit times for a given path can be estimated and, by substituting them into (8), the flow speed can be computed. This is assumed to give similar results to those of a real flow meter [27, 28]. In this way, a database was built relating parameters $\boldsymbol{\theta}=(x/D, {\rm Re}_b, \alpha)$ to the numerically-computed flow rate $\boldsymbol{d}=[\dot{m}_1\;\; \dot{m}_2]$ , where $\dot{m}_1$ , $\dot{m}_2$ are the flow rates measured by each path.

In this study, all computations are performed using OpenFOAM, an open source CFD toolbox using a second-order, cell-centred, finite-volume method. The SIMPLE procedure is applied to compute the pressure and the velocity field, the $k-\epsilon$ turbulence model is used for the turbulent kinetic energy and turbulent dissipation computation. Steady state simulations are performed on a structured numerical grid, selected after a grid convergence study, with approximately ten million cells and $y^+ \approx 1$ which is adapted for the various Reynolds numbers. Details of the numerical grid are shown in figure 4.

Figure 4.

Figure 4. Details of the 10M-point CFD mesh. (a) Cross-sectional mesh topology for the RANS simulations. (b) Mesh topology at the bend for the RANS simulations.

Standard image High-resolution image

A no-slip adiabatic boundary condition is imposed on the pipe wall, a constant speed is specified at the pipe inlet and a constant pressure at the pipe outlet. The inlet values for the turbulent kinetic energy and the turbulent dissipation are:

Equation (12)

where I is the turbulence intensity and is computed as $I \approx 0.16{\rm Re}_b^{-\frac{1}{8}}$ , $C_{\mu}$ is a turbulence closure model coefficient (that usually has a value of $0.09$ ) and l is the turbulent length-scale, which is approximated as $l \approx 0.038D$ . Note that the value of the speed specified at the inlet is the true value of the bulk speed, and is used to compute the Reynolds number. All the combinations of the elements of $\boldsymbol{\theta}$ at which the flow rate for both paths was calculated are reported in table 2.

Table 2. Combinations of elements of $\boldsymbol{\theta}$ for which the flow rate was calculated as a UFM would do. For $x/D$ and α, 25 uniformly distributed samples in the specified intervals were considered.

${\rm Re}_b$ (—) Ub (m ${\rm s}^{-1}$ ) $x/D$ (—) α (rad)
$2.1\cdot 10^4$ $2.0$ $[0.0, 16.0]$ $[0, 2\pi)$
$3.4\cdot 10^4$ $3.2$ $[0.0, 16.0]$ $[0, 2\pi)$
$5.1\cdot 10^4$ $5.0$ $[0.0, 16.0]$ $[0, 2\pi)$
$1.1\cdot 10^5$ $10.0$ $[0.0, 16.0]$ $[0, 2\pi)$
$1.6\cdot 10^5$ $15.0$ $[0.0, 16.0]$ $[0, 2\pi)$
$2.1\cdot 10^5$ $20.0$ $[0.0, 16.0]$ $[0, 2\pi)$
$2.4\cdot 10^5$ $22.5$ $[0.0, 16.0]$ $[0, 2\pi)$

2.5. Kriging and surrogate model

The posterior distribution of the parameters given the data as expressed in (2) can be approximated with Markov-chain Monte Carlo methods (MCMC). These methods require thousands of evaluations of the computer simulation at various $\boldsymbol{\theta}$ , which implies thousands of RANS simulations, thus making the process computationally unfeasible. Instead, the data from the numerical model is used to build a surrogate model that permits retrieving the flow rate as computed by the flow meter for any $\boldsymbol{\theta}$ much faster than by performing CFD simulations. Note that no experimental data is required for this step—only numerical data is used. This is achieved by means of kriging, a regression technique based on Gaussian processes which can also be formulated in terms of Bayes' rule. The kriging estimator is able to predict the mean and variance of a quantity dependent on some parameters. For this particular problem, the quantity of interest is the flow rate for the two paths of the UFM, and the parameters are given by the elements of $\boldsymbol{\theta}$ . Note that both the kriging mean and variance are used in the statistical model specified in (1) with likelihood as in (4). The reader is referred to Wikle and Berliner [29] for a precise derivation and description of kriging.

3. Results and discussion

3.1. Experiment

In the experiment, different distances between flow-meter and elbow ($x/D$ ), different Reynolds numbers (${\rm Re}_b$ ), and different flow meter rotation angles (α) were tested. This was done in order to gather enough data to validate the proposed approach for a variety of cases. Each measurement was interpreted as a realization of a random variable:

Equation (13)

where $\mu_{U_i}$ and $\sigma_{U_i}$ are estimated for each path as in (11). In this case, $\sigma_{U_i}$ represents the aleatoric uncertainty only due to repeatability. The quantity of interest is the flow rate output by the meter obtained as:

Equation (14)

where $\dot{m}_1$ and $\dot{m}_2$ are the approximations to the true flow rates computed by path 1 and path 2 respectively, and $CF = 0.902$ 3 is a correction factor applied by the flow-meter manufacturer.

As already mentioned in section 2.3, the output of the UFM measurement is approximately a three-minute time series of the flow rate evaluated at intervals of one second and correlation between the samples may be an issue. To check for this, the discrete autocorrelation $R_{yy}$ at lag l for a discrete signal $y(n)$ was computed as:

Equation (15)

and normalized by the variance. An example of the result of the autocorrelation study is reported in figure 5. The other time series display similar behaviors. It can be seen that the autocorrelation between the samples is very small, thus proving that the samples are uncorrelated in time.

Figure 5.

Figure 5. Time series and autocorrelation plot for the experiment at $x/D = 4.0$ , ${\rm Re}_b=2.1\cdot 10^4$ , $\alpha= 0\pi$ . The red line indicates the zero-value of the autocorrelation.

Standard image High-resolution image

This could be anticipated by thinking that, even at the smallest flow speed of $3.2$ m ${\rm s}^{-1}$ , the flow in the pipe moves of $3.2$ m after each second, thus making evident that two successive UFM measurements can be hardly correlated.

The effect of the elbow on the flow meter performance can be studied by looking at the relative error between the UFM measurements and the corresponding reference values. For a normally distributed quantity, we can write:

Equation (16)

where $\dot{m}_{\rm ref}$ is value of the flow rate as measured by the reference flow meter, and $\sigma_{\rm ref}$ is its repeatability assumed to be 0.2%4.

Figure 6(a) shows that the flow rate is overestimated at small flow rates and underestimated at large flow rates. This looks like a bias in the UFM measurements that could be due to the instrument not being calibrated. This dependence of the relative error on the flow speed can also be observed in the CFD results, although it is not as strong as in the experimental case. The relative error seems to reduce as the flow moves away from the bend exit, although the trend is not that clear for the smallest flow rates at $x/D=10$ , which could be due to installation effects.

Figure 6.

Figure 6. Relative error and repeatability from the experiment on the pipe bend. (a) Relative error as function of distance from the elbow exit for different flow velocities averaged over α. (b) Repeatability as a function of distance from the elbow exit for different flow velocities averaged over α.

Standard image High-resolution image

The effect of the bend can also be noted by looking at the repeatability of the measurements as a function of the distance from the elbow exit, as shown in figure 6(b). Repeatability is larger at locations close to the bend exit, and becomes smaller as the flow develops because the unsteadiness of the flow generated by the bend decays as the flow moves further downstream. It can be also noted that, because of the presence of the bend, the uncertainty due to repeatability is of the same order of magnitude as the relative error, thus contributing significantly to lowering the performance of the UFM. This issue is expected to significantly hamper the Bayesian calibration from learning anything about $x/D$ or α, which are quantities that are not so closely related to the flow rate as the Reynolds number is.

The aleatoric uncertainty due to repeatability is not the only source of uncertainty associated with the UFM measurements. An estimate of the other sources of uncertainty can be derived from reproducibility information with varying $x/D$ and α for a given flow rate. Note that the uncertainty due to repeatability is obtained by performing multiple measurements at a given $\boldsymbol{\theta} = (x/D, {\rm Re}_b, \alpha)$ , while the uncertainty due to reproducibility is obtained by performing multiple measurements with varying $x/D$ and α for the same ${\rm Re}_b$ . Figure 7 shows all the pdf's of the experimental measurements—each experiment at a given $x/D$ -α combination is plotted as a Gaussian, with repeatability as standard deviation. An estimate of the additional sources of uncertainty can be computed by fitting all the pdf's for a given flow speed by means of a kernel density estimate [30, 31] and taking the standard deviation $\hat{\sigma}$ of this new probability distribution. This represents the spread of the UFM measurements at a given flow speed. Note that $\hat{\sigma}$ can only be evaluated if a large number of experimental data is available. This may not be the case, and therefore reproducibility is not incorporated in the MCMC but just added a posteriori for the sake of completeness.

Figure 7.

Figure 7. Probability density functions of the experimental measurements of both paths as a function of the flow rate.

Standard image High-resolution image

Hence, (13) can be updated to:

Equation (17)

which gives a more complete representation of the uncertainty associated with the experimental measurements. As can be observed, the data is very noisy, and therefore, for this particular test case, getting any meaningful information from the posterior will already be an achievement, since the data is expected to be very little informative about $x/D$ and α.

3.2. CFD simulations

A grid refinement study with 5M-, 10M-, and 15M-point meshes was carried out to reduce discretization errors and ensure sufficiently accurate results. Figure 8(a) indicates that there is little difference between the results of the three grids, with the streamwise velocity profiles of the two finer grids almost overlapping. The maximum error of the coarse and medium grid with respect to the fine grid was computed. While the coarse grid has, at each $x/D$ , a maximum error over $10\%$ , the medium grid maximum error is about $1\%$ . Hence, a grid of 10M points was chosen for the continuation of this study.

Figure 8.

Figure 8. Results of the grid convergence study. (a) Velocity profiles in the pipe symmetry plane for different grids at different $x/D$ . (b) Velocity profiles in the pipe symmetry plane at $x/D = 0.67$ for different turbulence models. Reference data are taken from [32].

Standard image High-resolution image

Significantly more important is the choice of the turbulence model. RANS simulations are generally good at reproducing flow in straight pipes but encounter some challenges in pipe bends. This is mainly because the isotropic eddy viscosity assumption of the most commonly used class of linear eddy-viscosity models is violated when the flow meets the bend. Possible solutions to this problem are using anisotropic turbulence models such as nonlinear eddy viscosity models or Reynolds-stress models or resorting to large eddy simulations (LES) [33]. However, since this paper focuses on industrial applications, we concentrate on testing the performance of the popular and practical isotropic $k-\epsilon$ [34] model and its Launder–Sharma variation [35].

The results presented in figure 8(b) show the velocity profile in the symmetry plane of a pipe with a 90-degree bend with $\kappa = 0.312$ . This test case was experimentally investigated by Kalpakli et al [32] and numerically by Roehrig et al [36]. It can be seen that neither of the two eddy-viscosity models is able to capture the behavior of the fluid in the inner part of the bend. This is consistent with the results by Roehrig et al, and implies that our computational model will not be able to exactly reproduce the real dynamics of the flow and, hence, the UFM behavior. In the end, the $k-\epsilon$ model was preferred for this study, as it proved to be stabler than its Launder–Sharma variation.

Samples of the flow rate along lines corresponding to the two paths of the flow meter ($\dot{m}_{i_{\rm CFD}}$ ) are extracted as explained in section 2.4 and compared to the actual flow meter measurements ($\dot{m}_{i_{\rm exp}}$ ). Figure 9 shows this comparison for $\alpha = 0\pi, \; \pi/3, \; \pi/2$ for the smallest flow speed tested. Results for the other flow speeds are similar.

Figure 9.

Figure 9. Evolution of flow rate with $x/D$ for different α both for experimental and simulated flow meter measurements at $v = 3.2$ m ${\rm s}^{-1}$ . P1 and P2 refers to path 1 and path 2 of the UFM, respectively. The confidence intervals represent the repeatability associated with each experimental measurement.

Standard image High-resolution image

For $\alpha = 0\pi$ , close to the bend exit, an important difference between the simulations and the experiments can be observed. For this α, the flow meter paths are parallel to the pipe centreplane, which is also the plane about which the flow is symmetric, as shown in section 2.2. Hence, theoretically, the two paths should 'see' almost the same flow profile and, therefore, measure almost the same flow rate, the only difference being due to one path being located slightly more downstream than the other. This is the case only for the CFD data. The experimental data shows a different behavior with the second path measuring a larger flow rate than the first one. This is an indication that, in the experiment, the flow profile had been distorted not only by the elbow, but also by something else, for example by the presence of a small step between the junction of two consecutive pipes, or by the entire set up not being exactly horizontal. This is an additional epistemic uncertainty that our CFD is not able to take into consideration. This problem is not present for $\alpha=\pi/3$ or $\alpha=\pi/2$ , where flow inhomogeneity dominates, and for which the trend between CFD and experiments is quite similar (although there are quantitative differences).

It is immediately observed that CFD and experiments come in closer agreement as the distance from the bend exit is increased: already after $x/D=4$ , the CFD data are within the confidence intervals of the experimental data, although the differences between the measurements of the two paths are larger than in reality. This phenomenon could be a problem if the ultimate objective were to obtain a better estimate of the mean of the flow rate, because on one hand the computer model is not accurate enough to exactly reproduce the behavior of the flow meter in these conditions, and on the other hand the quality and quantity of the UFM measurement is too low. This means that, for every MCMC sample of $\boldsymbol{\theta} = (x/D, \; {\rm Re}_b, \; \alpha)$ , the computer model will return a flow rate that is close to what the real UFM would measure but not exactly. Hence, in the majority of cases, the true flow rate associated with a given Reynolds number sample will be close to the real true flow rate but it will not be exactly it, thus making it hard to systematically obtain a better estimate of the mean of the flow rate with respect to what the meter under test is measuring. Building a more accurate computer model of the meter under test could be a solution to this problem, for example by using more advanced (and more computationally expensive) turbulence models or CFD simulations (e.g. LES), or by better modeling the geometry under consideration. Another option would be to have more high-quality data from the measurement instrument.

3.3. Kriging

Once the CFD results have been sampled, we have a database of flow rate values for the two paths for a variety of $\boldsymbol{\theta}$ . In the present study, flow rates have been recorded for 25 equidistant locations downstream of the bend exit $x/D$ , 25 equidistant flow meter rotation angles α, and 7 Reynolds numbers ${\rm Re}_b$ , thus adding up to 4375 different $\boldsymbol{\theta}$ samples. This tensor-product grid sampling technique is one of the most naive approaches, in that it is not guaranteed to minimize the variance of the kriging predictor, thus potentially adding further uncertainty to the statistical model. To rule out this possible problem, it is sufficient to evaluate the variance of the kriging built with these tensor-product grid samples at a sufficiently large number of randomly distributed points in the $\boldsymbol{\theta}$ -space. The maximum of this variance was found to be in the order of $\mathcal{O}(10^{-6})$ , which is one order of magnitude smaller than the uncertainty associated with the repeatability of the experimental measurements and, in principle, can be neglected. However, for the sake of completeness, we will also take this uncertainty into consideration while building the statistical model of (1).

There are two kinds of checks that must be carried out to ensure kriging is a good approximation of the CFD response. The first is controlling that the data used for the regression, i.e. the 4375 CFD samples of the flow rate, are regressed correctly, and the second is to check how well the experimental data are predicted by the surrogate model.

In the first case, an exact match between kriging and CFD data is not expected since the former is not used as an interpolation technique but rather as a regression. Hence, an approximate agreement like that in figure 10(a) is sufficient to assess the quality of the method, even though a larger spread of the points is observed at high flow rates.

Figure 10.

Figure 10. Agreement of Kriging with CFD and experimental data. (a) Kriging versus CFD data. The red line represents the $y=x$ curve. (b) Kriging versus experimental data. The red line represents the $y=x$ curve.

Standard image High-resolution image

As seen in section 3.2, CFD results do not reproduce experimental results exactly. Hence, a surrogate model based on CFD results is not expected to exactly reproduce experimental results either. This is shown in figure 10(b). However, it can be noted that the agreement between Kriging and experimental results is fairly good at low flow rates, and gets worse with increasing flow speed, as already observed in figure 10. This is because the absolute error between kriging and the experiment (or CFD) grows proportionally to the flow rate, but it can be shown that the values taken by the relative error do not change much throughout the data set. Furthermore, as expected, the median relative error of the kriging with respect to the CFD is approximately 0.8%, which is smaller than the median relative error with respect to the experimental data (3.6%).

3.4. Bayesian data analysis

The posterior probability distribution $\pi(\boldsymbol{\gamma}\vert \boldsymbol{d})$ , where $\boldsymbol{d}=[\dot{m}_1\;\;\dot{m}_2]$ contains the flow rate measured by the two paths of the meter under test, can be approximated using MCMC methods, as implemented in the PyMC package [37]. For simplicity, instead of $\pi(\boldsymbol{\gamma}\vert \boldsymbol{d})$ we will write $\pi(\boldsymbol{\theta}\vert \boldsymbol{d})$ , to highlight the posterior of the parameters of $\boldsymbol{\theta}$ is the result we are interested in. PyMC operates by creating a Markov process whose stationary distribution is the specified posterior. Three uninformative flat priors were selected for the elements of $\boldsymbol{\theta}$ as $\pi_0(x/D)\sim \mathcal{U}(0.0, 16.0)$ , $\pi_0({\rm Re}_b) \sim \mathcal{U}(2.1 \cdot 10^4, 2.4 \cdot 10^5)$ , and $\pi_0(\alpha) \sim \mathcal{U}(0\pi, 2\pi)$ . Note that the minimum and maximum values of each prior were chosen to be at the boundaries of the $\boldsymbol{\theta}$ -space used to build the kriging surrogate model. Specifying values outside of these boundaries would force kriging to extrapolate at some point during the MCMC sampling, which is not ideal. As explained in section 2, the little information provided by the experimental data makes it hard for the Bayesian calibration to infer something about $\boldsymbol{\theta}$ and the hyperparameters of the model inadequacy. This is why an accurate computer model such as CFD is needed. In this context, very narrow uniform priors can be specified for the model inadequacy hyperparameters as $\pi_0(\mu_{\delta_i}) \sim \mathcal{U}(-s\cdot \mu_{U_i}, \; +s\cdot \mu_{U_i})$ , and $\pi_0(\sigma_{\delta_i}) \sim \mathcal{U}(-s\cdot \sigma_{U_i}, \; +s\cdot \sigma_{U_i})$ , where $\mu_{U_i}$ and $\sigma_{U_i}$ are the experimental mean and repeatability as defined in (11). Note that the priors for the hyperparameters are centred at zero and the scaling factor s is arbitrarily chosen to be equal to $10^{-1}$ , thus meaning that the corrections provided by the model inadequacy parameters can be at maximum one order of magnitude smaller than the experimental values. This is why the prior intervals for these parameters are regarded as narrow: the allowed corrections by the hyperparameters have only a marginal influence.

The number of iterations of the MCMC was set to 40 000, with a burn-in of 16 000 samples. Out of the 24 000 samples left, only one in every three was chosen (thinning) to reduce correlation between successive samples. Hence, in the end, only 8000 samples are considered as a result of the MCMC. Finally, a kernel density estimation routine was used to compute the probability density function of the parameters, and of the quantity of interest.

One way of evaluating model fit is to compare the posterior predictive distributions (ppd's) of the flow rate for path 1 and 2 with the observations used to fit the model. The ppd is defined as in (3), and can easily be obtained at the end of the MCMC samples with PyMC [37]. Figures 11(a) and (b) demonstrate high goodness of fit because the experimental data pdf's lie in high-probability regions of the posterior predictive distribution.

Figure 11.

Figure 11. Example of results of a MCMC simulation. (a) Ppd's for both paths compared to experimental pdf's for $x/D = 0.0$ , ${\rm Re}_b = 3.4 \cdot 10^4$ and $\alpha = 0\pi$ . (b) Ppd's for both paths compared to experimental pdf's for $x/D = 10.0$ , ${\rm Re}_b = 2.1 \cdot 10^5$ and $\alpha = \pi/3$ .

Standard image High-resolution image

After making sure the model fits the data adequately, one can use the MCMC samples of the Reynolds number to derive an estimate of the uncertainty in the flow meter readings. This is done by transforming the samples of the Reynolds number in samples of the true flow rate as:

Equation (18)

and then by computing the pdf of the new quantity by a kernel density estimate. Figures 12(a) and (b) show that the pdf computed with the methodology presented in this paper has a smaller uncertainty than that associated with the experimental measurements. This result is an update of the epistemic uncertainty caused by the presence of the bend, and was obtained despite the large uncertainty associated with the experimental data. Note that no aleatoric uncertainty is present any more, because the computer model is deterministic.

Figure 12.

Figure 12. Example of flow rate pdf's before and after the application of the methodology. Note that the reference values have an uncertainty of 0.2$\%$ and that $(x/D, {\rm Re}_b, \alpha)$ refer to the most upstream path. (a) Comparison of posterior of true flow rate with flow meter measurement for $x/D = 14.0$ , ${\rm Re}_b = 3.4 \cdot 10^4$ and $\alpha = 0\pi$ . (b) Comparison of posterior of true flow rate with flow meter measurement for $x/D = 0.0$ , ${\rm Re}_b = 2.1 \cdot 10^5$ and $\alpha =\pi/3$ .

Standard image High-resolution image

It can be seen from figures 13(a) and (b) that the UFM measurements are only very little informative about $x/D$ or α, thus making it extremely challenging to infer anything about the mean value of the true flow rate. This was expected, since these quantities are much less closely related to the flow rate than the Reynolds number is.

Figure 13.

Figure 13. Marginal posterior pdf's after the application of the methodology. Note that the values pf $(x/D, {\rm Re}_b, \alpha)$ refer to the most upstream path. (a) Marginal posterior of $x/D$ and α for data at $x/D = 14.0$ , ${\rm Re}_b = 3.4 \cdot 10^4$ and $\alpha = 0\pi$ . (b) Marginal posterior of $x/D$ and α for data at $x/D = 0.0$ , ${\rm Re}_b = 2.1 \cdot 10^5$ and $\alpha =\pi/3$ .

Standard image High-resolution image

It should be noted that the uncertainty of the experimental data of figure 12 is given by the sum of repeatability and reproducibility, as specified in (17). The uncertainty due to reproducibility could be calculated only thanks to the large number of experimental data available collected for validation purposes. However, this is not readily available in normal industrial situations. This is why it was not included in the MCMC procedure, and was added only a posteriori in the plots of figure 12 to convey a more realistic and complete picture of the uncertainty associated with an experimental measurement. It must be stressed that, since only experimental repeatability is used in the MCMC, if the data are not informative then the posterior uncertainty will be at best comparable with the experimental repeatability. On the other hand, when the data are informative, the posterior uncertainty is also reduced compared to experimental repeatability only.

Theoretically, the proposed approach is able to reduce both the uncertainty and error associated with a given measurement but, in practice, this is not always possible because of the availability and/or quality of the data. The results of the methodology with high-quality synthetic data are shown in the appendix to prove the full potential of this approach.

When high-quality data are not available, the question of the best position for the measurement instrument immediately arises. For a UFM, the optimal position suggested by the manufacturers is far away from any source of disturbance. However, as stated in the introduction of this paper, this is not always possible. Hence, if this method is to be applied for correcting the UFM measurements in non-ideal flow conditions, the best position for the real UFM providing the data for the Bayesian calibration is where the computer model is reproducing the real process with the highest accuracy. This depends on certain parameters, as shown in section 3.2, and cannot be framed in a general rule.

4. Conclusions

In this paper an approach has been presented which is able to update the uncertainty associated with ultrasonic flow meter measurements under non-ideal flow conditions. The methodology in itself is completely general, and can be used for any kind of flow rate measurement technique, provided that a computer model of the process under consideration can be built.

Flow meter measurements in non-ideal flow conditions are characterized by larger errors and uncertainties than in ideal flow conditions. The typical solution would be to re-calibrate the instrument but this is not always possible. In this paper, we propose to calibrate a computer model of the UFM using Bayesian techniques instead. The case under consideration is that of a pipe bend, and CFD simulations are used to simulate it. An experiment was carried out to gather the necessary data for validation of the methodology but the method can be applied even if only one data point is available. Markov-Chain Monte Carlo samples are needed to approximate the posterior pdf, and therefore a kriging surrogate of the CFD was adopted to speed up the process. The computer model simulating the UFM measurements takes the Reynolds number, the distance of the UFM from the bend exit and the UFM azimuthal angle with respect to the flow symmetry plane as inputs. The fundamental point lies in the fact that the Reynolds number is computed using the true bulk speed of the flow, and therefore its posterior also carries this information, thus providing the mean to update the initial flow rate estimate by the real UFM.

When few data that are little informative are available, the posterior uncertainty will be at best comparable with that in the data, and the error might not be systematically reduced as shown in section 3.4. However, if more and/or better-quality observed data are available, the procedure will systematically reduce both the error and the uncertainty, thus providing a more accurate measurement of the flow rate than that from the UFM. This is shown in the appendix.

Acknowledgments

The authors of this paper would like to thank T Paans of VSL for the help with the experiments, and E Funke of Krohne GmbH for the insights on ultrasonic flow meters.

This work was funded by the European Metrology Research Programme (EMRP) which is jointly funded by the EMRP participating countries within Euramet (European Association of National Metrology Institutes) and the European Union.

Appendix

The fundamental idea of the paper relies heavily on advancements in computational fluid dynamics up to a point where results of a computer model can be trusted to be reproducing the real physical process with a high level of accuracy. What 'high level' means is dependent on the application. For the case of a flow in a pipe bend, this means that the computer model is able to predict the dynamics of the flow in such a way that the flow rate measured as an ultrasonic flow meter would do is reasonably close to the experimentally measured quantity.

Although still reproducing the flow dynamics in a pipe bend approximately, the literature suggests that the computer models at our disposal are accurate enough for this purpose. Hence, the accuracy of computer models is not an obstacle for the application of this methodology to real-life problems. The true obstacle lies in the subtle discrepancies between the real-life geometries and the geometry used in the simulations. The latter are sometimes sketchy approximations of the former so that, in the end, it is as if a different geometry were simulated. The authors believe that these differences yielded to the results of figure 9.

Therefore, a test case with synthetic data was also studied to illustrate the potential of the proposed approach. The synthetic data were randomly selected from the CFD samples and random noise extracted from a normal distribution of the form $\mathcal{N}(0, \sigma_{\rm synth}^2)$ (with $\sigma_{\rm synth} = 0.05\cdot \dot{m}_i$ ) was added to them in order to simulate aleatoric and epistemic uncertainty.

The same approach outlined in the paper above was followed, with the only difference that now the agreement between the computer model and the synthetic data is much better. As with noisy experimental data, the outcome of the process is a reduction in the uncertainty associated with the flow rate measurements, but also a reduction of the error as shown in the examples of figure A1.

Figure A1.

Figure A1. Example of flow rate pdf's before and after the application of the methodology with good-quality synthetic data. Note that the reference values have an uncertainty of 0.2$\%$ and that $(x/D, {\rm Re}_b, \alpha)$ refer to the most upstream path. (a) Comparison of posterior of true flow rate with synthetic flow meter measurement at $x/D = 3.2$ , ${\rm Re}_b = 2.1\cdot 10^5$ and $\alpha = 0\pi$ . (b) Comparison of posterior of true flow rate with synthetic flow meter measurement at $x/D$ and α for data at $x/D = 2.0$ , ${\rm Re}_b = 5.4 \cdot 10^4$ and $\alpha =\pi/3$ .

Standard image High-resolution image

This is because the synthetic data are informative enough to allow the computer model to identify, also, the distance from the bend and the angle at which they were acquired, thus helping it to identify the Reynolds number much more accurately. This can be seen from figure A2. As can be seen, the posterior of $x/D$ and α are much more informed by the data than with the noisy experimental data yielding posteriors such those in figure 13. Indeed the proposed approach reduced the uncertainty in 100% of the cases and reduced the error in 95% of the cases.

Figure A2.

Figure A2. Marginal posterior pdf's after the application of the methodology to synthetic data. Note that the values pf $(x/D, {\rm Re}_b, \alpha)$ refer to the most upstream path. (a) Marginal posterior of $x/D$ and α for data at $x/D = 3.2$ , ${\rm Re}_b = 2.1\cdot 10^5$ and $\alpha = 0\pi$ . (b) Marginal posterior of $x/D$ and α for data at $x/D = 2.0$ , ${\rm Re}_b = 5.4 \cdot 10^4$ and $\alpha =\pi/3$ .

Standard image High-resolution image

In general, there are three possible ways to increase the chances to obtain an error reduction from the proposed approach:

  • Gathering more data would provide more information and allow the methodology to identify the elements of $\boldsymbol{\theta}$ more accurately.
  • Gathering better quality data, that is data with smaller measurement uncertainty, would provide more information as well.
  • Using a more accurate computer model. This implies better modeling of the geometry under study and/or more accurate CFD techniques.

Footnotes

  • Krohne GmbH, personal communication, December 2016.

  • VSL, personal communication, March 2016.

Please wait… references are loading.
10.1088/1681-7575/aa7b8d