Keywords

1 Introduction

The approximation (discretization) error \( \Delta u^{(k)} = u^{(k)} - \tilde{u} \) is usually considered as a subject of the epistemic uncertainty quantification. The reasons for this statement are the dependence of the approximation error on the truncation error \( \Delta u^{(k)} = \left( {u^{(k)} - \tilde{u}} \right) = A_{h}^{ - 1} \delta u^{(k)} \) and the fact, that the Lagrange form of the truncation error \( \delta u^{\left( k \right)} (\alpha_{n} ) = Ch^{m} \partial^{m + 1} u(x_{n} + \alpha_{n} )/\partial x^{m + 1} \) (n is the grid point number) contains unknown deterministic parameter \( \alpha_{n} \in \left[ {0,1} \right] \).

Herein, the CFD system is formally denoted as \( A\tilde{u} = f \), the numerical solution (obtained by k-th algorithm) is governed by the discrete operator \( A_{h} u^{(k)} = f_{h} \). Truncation error \( \delta u^{(k)} \) is obtained from the Taylor series of the numerical solution (grid function \( u^{(k)} \) inserted to the main system of PDE.

However, there exist works (for example, [1]), which more or less successfully consider the approximation error to be the normally distributed random value. On the other hand, the numerical tests [2] demonstrate the universal (although, non-Gaussian) probability density distribution \( P(\alpha_{n} ) \) (for the Lagrange parameter \( \alpha_{n} \)) with the mean value about 1/3 for the heat conduction problem. So, some random features of the approximation and truncation errors are observed in numerical tests. Thus, there exists a formal contradiction between random (observed) and deterministic (theoretically based) approaches to the approximation error estimation. This paradox may be resolved via the measure concentration effect [3], relating the probability and the geometry of the high dimensional spaces, however, it is far above the present paper scope.

From the stochastic standpoint, the ensemble-based approach may provide a natural alternative in the absence of information on the truncation error probability density distribution. Herein, the element of the epistemic uncertainty quantification concerning the estimation of the discretization error is analyzed from the viewpoint of the ensemble of numerical solutions obtained via independent algorithms governed by a vector valued parameter \( \delta u^{(k)} \) (truncation error).

The ensemble of solutions is related to the flow around elongated bodies of rotation (EBR). In the late 80’s–early 90’s the computational technology allowed to make routine computing for a flow around EBR with a high degree of reliability. For example, the deviation between the numerical and experimental results for aerodynamic drag coefficients did not exceed 2–3%. The essence of this technology was that the aerodynamic drag coefficient Cx was considered as a sum of three components: Cp – coefficient for inviscid flow, Cf – coefficient for viscous friction and Cd – coefficient for near wake pressure. The present work is a part of the general project to create a similar technology [4,5,6]. The OpenFOAM software package (Open Source Field Operation and Manipulation CFD Toolbox) [7] is used to calculate the aerodynamic characteristics for inviscid flow around the elongated bodies of rotation. OpenFOAM contains a number of solvers [8,9,10,11,12] based on independent numerical algorithms.

This paper presents an analysis of the ensemble of solutions, obtained using five OpenFOAM solvers, for the discretization error estimation. Etalon solutions [13], which have a high accuracy and are used for verification of numerical methods for many years, are employed for the true error estimation. The analysis is performed for the inviscid flow around a cone.

2 The Test Problem

The statement of the CFD problem is presented in accordance with the work [13], where the results of the inviscid flow around cones with different angles at various Mach numbers are addressed. We consider a cone in the uniform supersonic flow of ideal gas at zero angle of attack α = 0° with a Mach number 2. The body under consideration is a cone with the half angle β = 20° (Fig. 1). The inflow conditions are denoted by the index “∞”, and the outflow ones by the index ξ, since the solution is self-similar and depends on the dimensionless variable. The Euler equations system is used for the flow field calculation. The system is supplemented by the equation of state of the ideal gas.

Fig. 1.
figure 1

Flow scheme

3 OpenFOAM Solvers

The following solvers from the OpenFOAM software package were used:

  • rhoCentralFoam (rCF), based on a central-upwind scheme, which is a combination of central-difference and upwind schemes [8, 9]. The essence of the central-upwind schemes consists in a special choice of a control volume containing two types of domains: around the boundary points, the first type; around the center point, the second type. The boundaries of the control volumes of the first type are determined by means of local propagation velocities. The advantage of these schemes is the possibility to achieve a good resolution for discontinuous solutions in gas dynamics, using the appropriate technique for the numerical viscosity reducing.

  • sonicFoam (sF), based on the PISO algorithm (Pressure Implicit with Splitting of Operator) [10]. The basic idea of the method is the application of two difference equations to calculate the pressure for the correction of the pressure field obtained from discrete analogs of the equations of moments and continuity. This approach is takes account of the fact that the velocities changed by the first correction may not satisfy the continuity equation, therefore, a second corrector is introduced, which enables us to calculate the velocities and pressures satisfying the linearized equations of momentum and continuity.

  • rhoPimpleFoam (rPF), based on the PIMPLE algorithm, which is a combination of the PISO and SIMPLE (Semi-Implicit Method for Pressure-Linked Equations) algorithms. In this method, an external loop is added to the PISO algorithm, due to which the method becomes iterative one and allows to count with the Courant number greater than 1.

  • pisoCentralFoam (pCF), which is a combination of a Kurganov-Tadmor scheme [8] with the PISO algorithm [11].

  • QGDFoam (QGDF), which is based on the implementation of quasi-gas dynamic equations [12].

4 Numerical Results

4.1 Initial and Boundary Conditions

On the upper boundary (“top”) the zero gradient condition for the gas dynamic functions is specified. The same conditions are set on the right border (“outlet”). On the left border (“inlet”), the parameters of the approaching flow are set: pressure P = 101325 Pa, temperature T = 300 K, speed U 694.5 m/s (Mach number = 2). On the cone surface, the condition of zero gradient is given for pressure and temperature, and the condition “slip” is given for the speed, corresponding to the non-penetration condition for the Euler equations. The special “wedge” condition is used for the front (“front”) and back (“back”) borders to model the axisymmetric geometry in the OpenFOAM package. The OpenFOAM package also employs a special “empty” boundary condition. This condition is specified in cases when calculations in a given direction are not carried out. In our case, this condition is used for the “axis” border.

The number of grid cells is 13200. The initial conditions correspond to the boundary conditions on the inlet edge, that is, the initial conditions are used for the parameters of the inflow stream. The molar mass M = 28.96 kg/mol and the specific heat at constant pressure Cp = 1004 were also set.

4.2 Parameters of Solvers

In the OpenFOAM package, there are two options for approximating differential operators: directly in the solver’s code or using the fvSchemes and fvSolution configuration files. In order the comparison to be correct, we used the same parameters, where possible. In the fvSchemes file: ddtSchemes – Euler, gradSchemes – Gauss linear, divSchemes – Gauss linear, laplacianSchemes – Gauss linear corrected, interpolationSchemes – vanLeer. In the fvSolution file: solver – smoothSolver, smoother symGaussSeidel, tolerance – 1e–09, nCorrectors – 2, nNonOrthogonalCorrectors – 1.

5 Analysis of True Errors on the Ensemble

Tables 1 and 2 show the results of calculations of the L2 and L1 norm of “true” error (differences between tested and exact (etalon) solutions):

Table 1. Norm of the deviation from the etalon solution (L2)
Table 2. Norm of the deviation from the etalon solution (L1)
$$ \sqrt {\sum\nolimits_{m} {\left| {y_{m} - y_{m}^{exact} } \right|^{2} V_{m} } } $$
(1)
$$ \sum\nolimits_{m} {\left| {y_{m} - y_{m}^{exact} } \right|V_{m} } $$
(2)

Herein, the norm is not considered as the vector norm, rather it should be treated as the grid function norm (discrete analogue of the function norm).

In Tables 1 and 2 \( y_{m} \) is the velocity components \( U_{x} \) and \( U_{y} \), pressure \( p \) and density \( \rho \) in the cell. \( V_{m} \) is the cell volume for the cone angle \( \beta = 20^\circ \) and Much number \( M = 2 \). Figures 2 and 3 shows errors from Tables 1 and 2 in the form of spider diagram, where the tabular data are normalized to the maximum values of the corresponding gas-dynamic functions.

Fig. 2.
figure 2

Norm of the deviation from the etalon solution (L2)

Fig. 3.
figure 3

Norm of the deviation from the etalon solution (L1)

6 Analysis of Distances Between Numerical Solutions on the Ensemble

The above analysis is based on the etalon solution of a priori small error. However, the availability of such solution is not a common case. There is some feasibility for error analysis based on the ensemble of numerical solutions [14,15,16].

Let the relation of the approximation error of these schemes be known a priori. We denote the numerical solution as the vector (grid function) \( u^{\left( k \right)} \in {\text{R}}^{N} \) (k is the scheme number, N is the number of grid points respectively), the values of unknown exact solution at nodes of this grid (further denoted as exact solution) as \( \widetilde{u} \in {\text{R}}^{N} \) and use a discrete (L2 or L1) equivalent norm. The unknown deviation of exact solution values at grid points \( \tilde{u} \in {\text{R}}^{N} \) from the computed solution is assuming the form \( \left\| {u^{(i)} - \widetilde{u}} \right\| = r_{i} \). The numerical solutions \( u^{(i)} \) are located at surfaces of concentric hyperspheres with the center at \( \tilde{u} \) and unknown radii \( r_{k} \).

In the simplest event of two numerical solutions \( u^{\left( 1 \right)} \) and \( u^{\left( 2 \right)} \) with a priori known errors relation \( r_{1} \ge 2r_{2} \) (\( r_{1} = \left\| {\tilde{u} - u^{(1)} } \right\| \), \( r_{2} = \left\| {\tilde{u} - u^{(2)} } \right\| \)) the following theorem [14] may be stated.

Theorem 1.

Let the norm of difference of two numerical solutions \( u^{\left( 1 \right)} \in R^{(N)} \) and \( u^{\left( 2 \right)} \in R^{(N)} \)

$$ \left\| {du_{1,2}^{{}} } \right\| = \left\| {u^{(1)} - u^{(2)} } \right\| $$
(3)

be known from computations and there is a priori information

$$ \left\| {\tilde{u} - u^{(1)} } \right\| \ge 2\left\| {\tilde{u} - u^{(2)} } \right\| $$
(4)

then the norm of approximate solution \( u^{\left( 2 \right)} \) error is less than the norm of difference of solutions:

$$ \left\| {\tilde{u} - u^{(2)} } \right\| \le \left\| {du_{1,2} } \right\| $$
(5)

Unfortunately, a priori information (Eq. 4) usually is not available. However, the separation of distances between solutions into clusters of the small error and the large error (i.e., the availability of highly precise solutions concentrated in a vicinity of the exact one) may be considered as evidence of the existence of solutions with significantly different error norms [14,15,16].

The quantitative criterion for applicability of Theorem 1, based on dimension of first cluster and the distance between clusters, may be stated as the following semiheuristic criterion:

Criterion.

If the distance between clusters is greater than the size of the cluster of accurate solutions \( \delta_{2} - \delta_{1} > \delta_{1} \) then \( \left\| {\tilde{u} - u^{(i)} } \right\| \le \left\| {du_{1,i} } \right\| \) , where \( u^{(i)} \) belongs to the cluster of more accurate solutions and \( u^{(1)} \) is the maximally inaccurate solution.

From this standpoint the collection of distances between solutions may contain the important information. The matrix of the distances engendered by L2 or L1 norm is provided in the Tables 3 and 4 for \( U_{x} \). The analysis for other components is omitted for brevity due to their similar behavior.

Table 3. Norm of the deviation from the etalon solution (L2)
Table 4. Norm of the deviation from the etalon solution (L1)

In the Tables 3 and 4, one can see no visible separation of distances by clusters, which may satisfy the above criterion. So, the above mentioned criterion is not applicable.

In this situation we consider the maximum value of distance between solutions over all data of Tables 3 and 4 as the upper bound of the error.

Corresponding values \( \left\| {du_{i,j} } \right\|_{{L_{2} }} \) and \( \left\| {du_{i,j} } \right\|_{{L_{1} }} \) are provided in Tables 5 and 6 for \( U_{x} \) component as the maximum estimation of error norms. The relations of error norms to the maximum estimate \( \left\| {\Delta u} \right\|_{{L_{2} }} /\left\| {du_{max} } \right\|_{{L_{2} }} \) and \( \left\| {\Delta u} \right\|_{{L_{1} }} /\left\| {du_{max} } \right\|_{{L_{1} }} \) are also presented in the Tables.

Table 5. Norm of the deviation from the etalon solution (L2)
Table 6. Norm of the deviation from the etalon solution (L1)

The analysis of data provided in Tables 5 and 6 demonstrates the maximum distance between solutions to be a reasonable estimate for the deviation of considered numerical solution from the etalon one. The maximum relation of the true error to estimate of the error \( \left\| {\Delta u} \right\|_{{L_{2} }} /\left\| {du_{max} } \right\|_{{L_{2} }} \) over all solutions is about 1.7 that seems to be quite acceptable value. As mentioned in [16], the L1 norm is more suitable for the error estimation. Herein, the results of Table 6 also confirm the higher quality of the error estimation via the maximum distance between solutions calculated in the L1 norm.

If one consider \( \left\| {du_{max} } \right\| \) as the error estimator and the value \( \left\| {\Delta u} \right\|/\left\| {du_{max} } \right\| \) as the effectivity index of this estimator, its magnitude in the L1 norm is about unit, that is close to “ideal” estimator [17]. The error estimator \( 2\left\| {du_{max} } \right\|_{{L_{2} }} \) is acceptable for the L2 norm.

7 Discussion

The above results demonstrate the potential of the ensemble of numerical solutions, obtained by independent algorithms, for a posteriori error estimation and verification. In papers [14,15,16] the independence of numerical methods was obtained by using schemes of the formally different order of approximation. Herein, the independence is ensured by differences of the numerical algorithms’ structure that significantly expands the application domain.

The results demonstrate also that the location of exact solution determined by the distances between solutions along with [14,15,16] is found to be close to the etalon one. It confirms the high quality of the etalon solution [13].

The evolution of the notion “solution” for the CFD equations (“strong”, “weak”, “measure-valued” [18]) is far from the final. At present, the ensemble-based option for solutions (statistic [1, 18], measure-valued [18]) seems to be of most current interest. These ensemble-based solutions may provide both the reasonable solution notion for the shocked and turbulent flows and some natural way for the Uncertainty Quantification.

The statistic solution is used in [18] for approximation of the measure-valued solution moments. The key element of this approach is the scalar stochastic parameter directly inserted in the boundary condition. In contrast, in present paper, the stochastic parameter is related with the source term of the differential approximation (truncation error) implicitly. The stochastic properties of the truncation error are caused by the high dimensionality of the problem (about 104 nodes) and the independence of the truncation error (source term) for the solvers based on different algorithms. The cumulative action of these features may cause stochastic properties due to the measure concentration effect [3].

8 Conclusion

In above presented numerical tests five OpenFOAM solvers were compared with the etalon solution [13] and with each other in the metrics engendered by L1 and L2 norm. All solutions are found to be close with each other and with the etalon one. The discretization error is estimated as the maximum distance between solutions in the ensemble.

The estimated discretization error is close to the “true” errors (between numerical and etalon solutions). Thus, the tests demonstrate that the ensemble of the numerical solutions obtained by different solvers, based on independent algorithms, provides the feasibility for verification of any considered solver with the same quality as the etalon solution.

The above error norm estimation is obtained without conditions listed in [14,15,16] (a priori information on error norm relation or availability of small error clusters) that enhances the applicability domain for the ensemble based discretization error estimation. Both the code and solution verification may be performed via an ensemble of numerical solutions obtained by independent algorithms.