Open Access This article is
- freely available
Computation 2018, 6(1), 6; doi:10.3390/computation6010006
Implementation and Validation of Semi-Implicit WENO Schemes Using OpenFOAM®
Department of Civil and Environmental Engineering, Norwegian University of Science and Technology, 7491 Trondheim, Norway
Chair of Modeling and Simulation, University of Rostock, 18059 Rostock, Germany
Author to whom correspondence should be addressed.
Received: 3 December 2017 / Accepted: 23 January 2018 / Published: 24 January 2018
In this article, the development of high-order semi-implicit interpolation schemes for convection terms on unstructured grids is presented. It is based on weighted essentially non-oscillatory (WENO) reconstructions which can be applied to the evaluation of any field in finite volumes using its known cell-averaged values. Here, the algorithm handles convex cells in arbitrary three-dimensional meshes. The implementation is parallelized using the Message Passing Interface. All schemes are embedded in the code structure of OpenFOAM® resulting in the access to a huge open-source community and the applicability to high-level programming. Several verification cases and applications of the scalar advection equation and the incompressible Navier-Stokes equations show the improved accuracy of the WENO approach due to a mapping of the stencil to a reference space without scaling effects. An efficiency analysis indicates an increased computational effort of high-order schemes in comparison to available high-resolution methods. However, the reconstruction time can be efficiently decreased when more processors are used.
Keywords:CFD; high-order methods; WENO reconstruction; semi-implicit; unstructured grids
In recent years, open source Computational Fluid Dynamics (CFD) codes experienced an increased influence not only on ongoing science but also on the industry. It is caused by providing a suitable environment for a wide range of new developments as well as different solvers for multiple applications at no charge. Among others, the Finite Volume Method (FVM)-based open source C++ library OpenFOAM® gained popularity in the recent past since it can handle unstructured grids with polyhedral cells and provides a high-level programming platform for applying new solvers easily. Unstructured meshes are currently in the focus of operators due to their increased versatility in the application CFD methods in complex geometries  and the reduced generation time. However, the irregular structure of the grid prevents most codes such as OpenFOAM® to reach more than second order of accuracy. Further, the commonly applied second-order methods such as total variation diminishing (TVD) schemes are derived for structured grids. This might cause unbounded solutions on unstructured grids dependent on the chosen gradient scheme.
High-order methods would be preferable especially for the challenging task of discretising convective terms. Related to turbulence flows, high-order methods increase the accuracy of simulating mixing by reducing numerical diffusion significantly. At the same time, convection dominant flows, resulting in an appearance of hyperbolic aspects in the underlying equations, require monotonic schemes to assure stability . Such challenging tasks arise e.g., in flows with discontinuities such as shocks or free surfaces. A suitable scheme has to be chosen which copes with the formation of large gradients in front propagating problems and preserve the sharpness of the interface without creating spurious oscillations near discontinuities at the interface . This Gibbs-like phenomenon generates spurious oscillations at points of discontinuity, proportional to the size of the jump .
Linear schemes with such monotone behaviour are restricted to first-order accuracy according to Godunov . Therefore, non-linear schemes were developed such as TVD schemes which are based on limiters derived from corresponding conditions of Sweby . Their main drawbacks are the degeneration to first-order accuracy near extrema regardless of a smooth peak or discontinuity and at most second-order accuracy. This led to the development of (weighted) essentially non-oscillatory ((W)ENO) schemes. They introduce non-linear weighting for preventing oscillations near discontinuities and simultaneously reach an arbitrary order of accuracy in smooth regions. However, the solution is not strictly bounded leading to the eventual necessity of additional limiting .
The first ENO scheme based on adaptive stencils was developed by Harten et al. . Their scheme searches for the most suitable cells in a dynamic manner in order to obtain a stencil with the smoothest solution in each time step. The application on unstructured grids was provided by Abgrall  for the first time. The drawbacks of ENO methods are the prevention of convergence in the case of frequent switching of the stencil from one time step to another and costly operations at runtime reducing the overall performance . An alternative scheme, named Quasi-ENO, was introduced by Ollivier-Gooch  to overcome these drawbacks. In contrast to classical ENO schemes, it is based on a high-order least-squares reconstruction which fulfils the ENO-property by a pointwise data-dependent weighting in one fixed, central stencil . Classical least-squares reconstructions are able to reach high-orders in smooth regions but fail near discontinuities. A common way of eliminating this problem is introducing a limiter as Wang  and McDonald  demonstrated. However, the underlying mathematical problem is the inclusion of the data from cells behind a discontinuity into the reconstruction. The Quasi-ENO scheme solves this problem in a more efficient way than the classical ENO scheme and furthermore, offers the possibility of excluding cells of poor quality from the reconstruction. It has been shown by the authors  that the Quasi-ENO approach provides accurate solutions as long as the topology allows compact stencils without scaling effects. However, the solutions of the systems of equations often have to be calculated from ill-conditioned matrices, particularly in case of higher order polynomials. The common way of improving the condition numbers by applying preconditioning fails for the ENO weighted reconstruction matrices. Further, the stencils may lose too much information for reaching the nominal order of accuracy near discontinuities which results in a reduction of the order similar to TVD schemes .
In contrast to ENO, WENO schemes compute the solution on several fixed stencils and combine them by a non-linear weighting in order to obtain a final smooth solution. The weights are calculated from an evaluation of the smoothness in each stencil. This theoretically leads up to th order of accuracy by using a polynomial of rth-order . Further, they yield better convergence due to smoother numerical fluxes . In return, they need the preparation of several stencils which is computationally quite expensive in preprocessing especially on unstructured meshes in three dimensions . Besides, the reconstruction may fail near critical points, on very coarse grids or if not enough smooth data is provided . The first WENO scheme was introduced by Liu et al.  and Jiang and Shu  on regular grids. Later, Friedrich  extended it to two-dimensional, unstructured grids. In the recent past, Dumbser and Käser  and Tsoutsanis et al.  accomplished that finite volume WENO schemes are applicable on three-dimensional, unstructured grids with arbitrary order of accuracy. Pringuey  successfully extended their approach to non-uniform cells and sketched the possibility to implement WENO schemes in OpenFOAM®. However, in his work, he restricted the usage to explicit convection terms in hyperbolic equations and provided less information about the implementation into the code itself.
The presented research, therefore, aims firstly at a derivation and detailed verification of a WENO reconstruction method fully embedded in the existing code structure of OpenFOAM® using a similar approach to . This provides high-order reconstructions on unstructured grids to a huge group of researchers and enables these developments to a broad scope of applications for the first time. The method is mainly based on the approach of Dumbser and Käser  and Tsoutsanis et al. . Hence, the scheme operates in a reference space without scaling effects in order to prevent ill-conditioned matrices and improve the accuracy on irregular grids. All mesh types are handled automatically which is in accordance to OpenFOAM®. On these general grids, finite volume WENO schemes were usually applied to convection terms in an explicit manner. As an exceptional example, implicit discontinuous Galerkin methods based on hierarchical WENO reconstructions might be of interest to the reader . The possibility to build a semi-implicit finite volume WENO convection scheme arises by including the reconstruction in OpenFOAM® due to existing code structures for such an implementation. It results in a more stable reconstruction for larger time steps and an utilization of high-order convection schemes in common semi-implicit solution algorithms such as SIMPLE or PISO (Pressure-Implicit with Splitting of Operators). However, the theoretical accuracy limitation of these algorithms can of course not be affected.
In Section 2, the derivation of the basic reconstruction method is presented. Here, especially the parallelisation process within the 0-halo approach of OpenFOAM® is described in detail. Afterwards, the derivations of semi-implicit WENO convection schemes (Section 3) and different gradient schemes (Section 4) are given. It follows Section 5 with implementation and application details. Section 6 is dedicated to the verification process of the schemes, whereas Section 7 shows several test cases including an efficiency comparison. A conclusion completes this article in Section 8.
2. Numerical Approach of WENO Reconstruction Methods
The spatial domain is taken in its discretised form of N cells with the volumes , and the data of any scalar variable is stored in the cell centres represented by the cell averaged values . In case of a vector or tensor field, each component is evaluated separately because of the later introduced weighting. With the aid of a least-squares reconstruction, is replaced by a polynomial representation in each cell with the constraint of conservation of the mean value within . Scaling effects are prevented by mapping the reconstruction process from the physical space into a reference space using an affine transformation and its inversion , respectively. The affinity of the transformation conserves the conservation condition which results inwith the mapped cell in its reference space. The polynomials are expressed by an expansion over local polynomial basis functions 
The number of degrees of freedom K relates to the order of the polynomial r in three dimensions according torespectively in two dimensions to
The basis functions have to be chosen with the constraint of satisfying (1), equivalent to a zero mean value over . The condition can be satisfied analytically by an appropriate definition of the basis functionswith arbitrary orthogonal polynomial basis functions . In accordance with Ollivier-Gooch  and Friedrich , a Taylor series expansion around the centre of is applied and defined aswhere k corresponds to one combination of such that .
The degrees of freedom are evaluated on a set of stencils for each cell in comparison to the single, central stencil of classical least-squares reconstructions. By definition, the stencil is the central stencil. The number of sector stencils depends on the cell shape and its closeness to boundaries. For each , appropriate neighbouring cells in the reference space of are collected. The necessary number if cells is an important parameter which is discussed in Section 2.1. By definition, corresponds to the target cell . A polynomial is formulated for each using (2). Afterwards, the WENO reconstructed polynomial of each cell is obtained by a non-linear combination of several according to with the non-linear weightsand defined aswith to prevent the denominator from becoming zero and as discussed in . The linear weights are defined as for and 1 else in accordance with Dumbser and Käser . The weights (8) have to determine to what extend the solution in a stencil provides a qualitative contribution to a smooth solution of the polynomial reconstruction in the target cell. Here, the key element is the smoothness indicator , which represents the smoothness indicator of the solution in the stencil . It diminishes in case of smooth solutions and, thus, the corresponding weight increases. The matrix expression for is given by where is an element of the mesh-independent oscillation indicator matrix . The aim of the indicator is the minimization of the total variation of the sum of the -norms of all derivatives of the polynomial, which is comparable to the TVD property of other convection schemes . This property has to be satisfied by which is, therefore, defined aswith and r the polynomial order. As can be seen from (11), the matrix is solution independent and may be precomputed. Additionally, it is mesh independent through the calculation in the reference space. Under consideration of the definitions for the basis Function (5), Equation (11) can be further simplified to
The monomials are expressed by their orthogonal basis functions aswith the condition and . Applying the partial derivatives to (13), Equation (12) yieldswith 
The evaluation of the volume integrals in (14) is carried out as described below.
The final WENO polynomial arises in the form of (2) by substituting (2) in (7) and considering the partition of unity through the weights
Here, are denominated as modified degrees of freedom. A system of equations can be computed with the aim of preserving the averaged values in all cells of the stencil by the corresponding cell averages of . It can be expressed by (compare (1))
Substituting (2) in (17) yields the final system of equationswhere can be calculated under consideration of (2), (5) and (18) as
The volume integrals evaluation of each combination is avoided by transforming the Taylor series appropriate, e.g., by with the cell centre of . Inserting these expressions in (20), the final computation of gets 
The volume integrations in (21) have to be computed for each cell and its appropriate stencil separately due to the dependency of on the coordinate system of . For this purpose, the volume integrals are transformed into surface integrals by using the divergence theorem . Denoting as the outward unit normal vector in the reference space, it yields
The right-hand side can be further written as a sum of surface integrals over the faces of . Here, the unit normal vector of each face is constant and can be taken out of the integrals. The desired volume integrals of the monomials are obtained from (22) by integrating analytically over one of the coordinates. Under consideration of the definition of in (6), the evaluation can be written as
The surface integrals are computed by decomposing the faces into triangles, transforming each of them to a standard triangle using linear mapping  and using a fifth-order Gaussian quadrature rule for the standard triangle .
The system of Equation (19) provides a solution if the matrix is at least squared resulting in the condition . As Tsoutsanis et al.  state, choosing leads to unstable solutions or eventually ill-conditioned systems. Therefore, should be approximately 2 K for three-dimensional problems and 1.5 K in 2D for the sake of robustness. This results in an overdetermined, linear least-squares problem. Physically, it corresponds to the minimization of the -norm of the error in predicting the averaged values of the polynomial in all cells of the stencil with a the solution vector containing the degrees of freedom and calculated aswith the Moore-Penrose pseudoinverse. The pseudoinverses have to be computed for each stencil in preprocessing once since is solution independent. In each time step, can be inserted in (25) for calculating a. It is obtained using singular value decomposition (SVD) [25,26], here. A detailed discussion of other methods for calculating can be found in [13,27]. Further, it might be noticed that rank-deficient matrices may occur caused by nearly linear-dependent lines in . They arise if several cells of a stencil lie on a straight line on structured grids .
2.1. Stencil Collection Algorithm
The modified degrees of freedom are calculated from weighted solutions in several stencils. These solutions are evaluated in one central and several sectoral stencils which cover all spatial directions of the target cell. In the case of cells near boundaries, some stencils could be too small and have to be discarded. In contrast to classical ENO schemes, WENO reconstruction computes the solutions on time-invariant stencils. Thus, the time-consuming collection part simplifies and has to be executed just once during the preprocessing step. The most important requirement for stencils to obtain an accurate solution is compactness. On isotropic, uniform meshes it is simply preserved by adding the nearest neighbours iteratively. However, on unstructured meshes and in regions with highly anisotropic cells this procedure cannot ensure compactness. The selection of the stencils in physical space may lead to a loss of information near walls and along the boundary layer region, in particular. Therefore, the stencil is transformed to a reference system where no scaling effects from increasing grid resolution or deformed cells occur. Detailed descriptions of the applied mapping can be found in [3,16,27].
As the starting point of the collection algorithm, one big, central stencil is gathered. On arbitrary mapped meshes, the most compact stencil could be collected by using point-neighbour information. On the contrary, the use of face-neighbours extends the dependent data further into the mesh which reduces the redundancy of data on anisotropic, structured meshes . The affine transformation preserves the principal connections between the cells for which reason the gathering can be performed using existing owner-neighbour lists. The most efficient way of collecting cells on unstructured meshes is based on adding the neighbours of the target cell iteratively until each stencil has the sought size. By collecting a surplus of possible stencil cells, the algorithm is independent of the starting point of an iteration and provides complete layers of new neighbours at a time as it is shown in Figure 1. The necessary size of the list relates to the number of internal faces of the target cell according towhich offers a small surplus due to the described collection of layers and in case of convoluted boundaries. After the selection of sectoral stencils, the central stencil is simply obtained by cutting it to the necessary size . In general, the number of sectors equals the number of internal faces of . However, if some sector does not provide enough cells it is not taken into account for the runtime operations. It may happen that more layers have to be considered until the necessary size is reached near boundaries. At this point, the iterative implementation is straightforward and advantageous. Once the lists are completed, all candidates are sorted by the centre to centre distances to the target cell in and the nearest cells are stored.
As the next step, sectoral stencils are constructed under consideration of the on condition that they are not allowed to share another cell than the target cell . For this purpose, each sector is spanned as a cone with the cell centre of the target cell as the apex and the contour of the related face as the base. The cells are assigned to the sectors according to the position of their cell centres which results in a distribution as can be seen in Figure 2. In order to check the assignment of the cells, each sector is mapped to the first octant of another transformation space where the relevant cell centres have positive coordinates (see  for details). The cell centre of each of the cells is transformed to of every sectoral stencil and added to its list if
- All coordinates in the reference space are positive.
- The cell is not already a member of another stencil which may happen on Cartesian grids where the centre lies on the boundary of two adjunct sectors.
- The target stencil list contains no more than cells.
The first and last condition are simple requests while the second condition is prevented by using a dynamic list from which cells are removed after being assigned to a sector. The obtained stencils are compact by itself since the central lists are presorted and scanned from the nearest to the farthest cells.
In this section, details of the parallelisation of the code are given. It is a crucial step due to the time-consuming reconstruction process at runtime. By default, OpenFOAM® is based on a 0-halo approach which divides the domain into several non-overlapping regions and Message Passing Interface (MPI) to transmit the information between the inter-processor boundaries. This leads to at best second-order accurate solutions at such boundaries. In contrast, the stencils of a high-order (W)ENO scheme near processor patches need the geometrical and physical data from several layers of the neighbouring domain. Consequently, a n-halo approach with several overlapping sub-domains would be the proper choice. The implicit handling of the Navier-Stokes equations leads to algebraic systems of equations which are solved by linear, iterative solvers in OpenFOAM®. Since these solvers only work for 0-halo approaches, a n-halo approach is discarded. Instead, the solution is the virtual extension of the sub-domains by collecting halo cells from neighbouring processors in additional lists. Then, the field values of the halo cells are updated at the beginning of each runtime step which is computed on non-overlapping domains.
The initialization of parallelisation starts in the preprocessing step after the local stencils are collected. At this point, several stencils with a deformed shape exist near processor boundaries such as the blue framed stencil in Figure 3a. Appropriate halo cells from other processors provide the necessary correction of the stencils. It is noticeable that all possible stencils with a deformed shape and therefore, acceptors for halo cells, are included in the stencils of target cells next to processor boundaries. It implies that these acceptor cells are vice versa the only possible halo cells for stencils of other processors. Hence, the halo cells do not have to be collected separately but can just be taken from the prepared local stencil lists. This leads to the following modification of the central stencil collection algorithm (Section 2.1) in the case of using several processors:
- For each sub-domain , all cells from the stencils of target cells next to a processor boundary are gathered in a list of halo cells together with the information of the target processor. Beyond, the stencils of these cells are marked as possible acceptors for halo cells from other sub-domains. In Figure 3a, acceptor cells of the sub-domain are coloured green while its halo cells from sub-domain are coloured red and vice versa the green cells are the halo cells from sub-domain for the red acceptor cells of .
- The lists of halo cells are further prepared by assigning them a new ID and additionally, storing their cell centre coordinates and the coordinates of the triangles from the triangulation of the cell’s boundaries. Afterwards, the lists are transmitted to the appropriate target processor using MPI.
- The required halo cells for each marked central stencil are determined by a geometrical selection due to missing face neighbour information beyond processor boundaries. For this purpose, a sphere is spanned around the target cell of with the distance from the centre of to the outermost cell centre in the local stencil as the radius. All halo cells whose cell centres are located within this sphere are added to a new global stencil. In Figure 3b, this geometrical selection results in the yellow coloured global stencil for the blue framed stencil in Figure 3a.
- The final stencils are attained from sorting the global stencils by distance and pick the nearest cells. In Figure 3b, the new stencil is framed in blue.
Additional lists with the information of the origin processor of each cell in a stencil are generated in order to transmit the field data between processors before the local reconstruction starts in each runtime step. It might be noticed that the results of a reconstruction on multiple processors are minimally different to results of serial calculations due to the slightly different stencils . The stencil collecting algorithm through processor boundaries uses geometrical searching while on a single processor just the face neighbours are gathered.
3. Derivation of Semi-Implicit WENO-based Convection Schemes
The reconstruction of any function in multiple dimensions and on unstructured meshes can be computed using the above presented WENO reconstruction method. In the following sections, possible discretisation schemes are derived which are all generally applicable in the high-level use of OpenFOAM® (The presented interpolations are, however, limited to the surface interpolation class of OpenFOAM® which stands in contrast to the point interpolation class).
In FVM, any convective term is discretised applying volume integration over each cell and Gauss’s theorem for transforming the arising volume integrals in a sum of surface integrals over all faces of cell ,
In case of a high-order scheme, the integrals in (27) have to be evaluated with a Gaussian integration of higher order, too. The velocity at the face are taken out of the integration since (27) is always treated in a linearised form here. Inserting the polynomial expressions of (16) in (27) yields at any face ofwith the volumetric flow rate (Since the common gaussian integration of OpenFOAM® is limited to second order of accuracy, the basis classes multiply the results of the interpolation by the face areas. Therefore, we neglect the surface area in (28) in the implementation in order stay consistent). The remaining surface integrals in (28) are solution independent and can be precomputed. Under consideration of (5), they are expressed as
The volume integrals in (29) are already computed during the reconstruction procedure. The surface integrals over the basis functions are evaluated in a similar way by decomposing the faces into triangles and using Gaussian quadrature rules of appropriate order. Hence, the evaluation of linearised convective terms reduces to a sum of scalar products at runtime, at which the considered polynomials depend on the chosen flux evaluation procedure.
The flux evaluation of linearised convective terms can be interpreted as the flux solution of the Riemann problem for the linear advection equation which is defined as under consideration of an incompressible fluid. Its finite volume formulation arises similar to (27) aswith the numerical flux
Toro  showed that the flux evaluation in (31) can be executed in the normal direction of each face due to its rotational invariance. Thereby, it is represented at each face by the one-dimensional equationresulting in the Riemann problem with the initial data representing the values of from the adjacent cells at one point of the considered face. Taking the exact solution of (34)  into account, the flux yields at the face () at any time
These fluxes result in an unconditional stable solution for which reason the Riemann solver (35) is appropriate for creating high-order interpolation methods based on WENO reconstructions. As proposed by Toro , we extend Godunov’s first-order version, which is based on cell centre values of , by higher-order terms of the reconstruction; the so-called WENOUpwindFit arises as a high-order non-oscillatory upwind scheme. For this purpose, the two reconstructed face values and are recalled from above (compare (16))
Here, the index i represents the owner and represents the neighbour cell of the face. The correlating reference spaces are denoted by . The sought fluxes can be evaluated from (27) and (35) aswith the polynomials (36) instead of . The surface integrals are evaluated using (28) in the proper reference space.
So far, most WENO schemes were used explicitly. However, the presented method can also be applied as a deferred correction method  which combines an implicit first-order upwind scheme with an explicit high-order correction term. The first-order part ensures convergence due to its monotonicity and diagonal dominance. The required subdivision is already available as can be seen in (36). This semi-implicit WENO scheme fits in the most solution algorithms of OpenFOAM® such as SIMPLE or PISO. Unfortunately, as it is shown in , WENO schemes are not strictly bounded. The explicit correction term can, therefore, be unbounded and still influence the solution’s physical reliability.
In order to overcome possible issues with unbounded solutions, the limiting strategy of Zhang and Shu , which can be applied to any high-order finite volume scheme in order to satisfy the maximum-principle for scalar conservation laws, is adapted to the presented scheme . The property implies that a time step’s solution is bounded by the cell centred values of the previous step. Hence, it is important for the convergence to the entropy solution. It might be noticed, that all monotone and TVD schemes fulfil the maximum-principle but lose accuracy at smooth extrema due to the measuring of the total variation using the cell centred values. In contrast, the new limiter is evaluated from the maximum and minimum of the reconstruction polynomials in each cell which preserves the accuracy. I was shown  that the limited WENO polynomial fulfils the maximum-principle by applying a linear scaling limiter to the polynomial of cell in accordance to
Here, M and m are defined as the upper and lower global bounds of . The local minimum and maximum is calculated as 
The values in (39) should be evaluated from the polynomials at all Gaussian points at runtime. In the presented interpolation scheme, the surface integration is precomputed for which reason this handling would be inefficient. It is, therefore, decided to take the surface integrated values of into account instead. This decision is towards the underlying mathematics, but on the other hand, the values of M and m are also just available at the cell centres in OpenFOAM®. Hence, Equation (39) is evaluated as
By limiting the integrated polynomials, the interpolation scheme can be rewritten as a sum of a first-order upwind scheme and a limited high-order correction. For the sake of practicability, another user specified parameter is introduced which provides the switch between a limited () and unlimited () computation. Hence, the final fluxes of the WENOUpwindFit scheme become (compare (28))
As an alternative, WENO reconstructions can also be used for the implementation of central schemes which evaluate the fluxes as followswith from (36) and the central differencing weights. Analogue to the upwind scheme, this scheme is the combination of an implicit central-differencing discretisation and a central high-order correction term. The scheme is not monotone and may lead to divergence of the solution in case of convection dominant flows  and hyperbolic equations, respectively, due to the negligence of characteristic curves. More stable centred schemes can generally be build from WENO reconstructions but are not in the scope of this research (see e.g., in [33,34,35]).
4. Derivation of a WENO Gradient Scheme
The calculation of gradients in the cell centres is a frequent operation in FVM. Besides the standard discretisation using Gauss’s theorem and linear interpolation, OpenFOAM® offers a least-squares-based gradient scheme whose stencils are however limited to the first neighbours. On the contrary, the presented scheme takes a larger stencil into account and avoids spurious oscillations at the same time. Alternatively, the WENO weighting could also be skipped in order to get a high-order version of the existing least-squares method.
The starting point of the gradient calculation in the cell centre of is its finite volume formulation
The volume integral in (43) can be evaluated with a high-order accuracy in two ways. One opportunity is the transformation into surface integrals and a high-order interpolation of to the boundaries using e.g., the central WENO scheme. This method is applicable without any further derivations and superior to linear interpolation due to the mesh independence. A more efficient computation is the direct evaluation of the volume integral by replacing the gradient of by its polynomial representation using WENO reconstructions. Here, the difficulty is the correct definition of the Gaussian points in arbitrary shaped volumes which could be obtained by decomposing each cell in tetrahedra where the Gaussian points are known. The coordinates and weights could be stored in the preprocessing resulting in higher efficiency in runtime. However, the additional tetrahedralization is a time-consuming computation and should be avoided. If the non-oscillatory behaviour of the scheme is in the first place and the theoretical order of accuracy is less important, a more efficient gradient scheme can be derived by replacing the gradient of by its polynomial representation and evaluating the volume integral with second order of accuracy. It corresponds to the evaluation of the gradient at the centre of according to
The resulting gradients are a compromise between accuracy, stability and efficiency due to its simple evaluation without any integrations. They have to be further transformed into the reference space in accordance with the polynomials of the WENO reconstruction. As given in , the gradient at yields thendue to the affine transformation. represents the gradients in the principal directions of the reference space. Next, is replaced by its polynomial Formulation (16), derivatives are taken and is inserted. The formula can then be simplified due to the cell centred orthogonal basis functions (see  for details). The remaining non-zero terms are related to the coefficients of the first-order terms of the polynomial, so that the final expression reads as follows
The inverse Jacobian matrices are already calculated in the mapping process during the preprocessing. The resulting gradient scheme, called WENOGrad, can be applied to any gradient computation in OpenFOAM® due to its explicit treatment in any case.
5. Implementation of the WENO Schemes in OpenFOAM®
In the following, several details of the implementation in the framework of OpenFOAM® are provided. The main accomplishment of this step is embedding the new methodology in the existing code structure such that all schemes are applicable in the same way as the existing low-order methods.
The preprocessing of high-order WENO schemes is a time-consuming procedure including the extended stencil collection, calculation of multiple smoothness and reconstruction matrices, and several SVD computations for each cell. Assuming a time-invariant mesh, all steps just have to be computed once before the first runtime reconstruction is performed. Therefore, a singleton pattern is implemented which restricts the instantiation of the preprocessing class, called WENOBase, to a single object . To that effect, the preprocessing functions can just be called once at runtime. Here, one object is created which holds all necessary lists. In all following time steps, the singleton pattern not only prevents the creation of further instances but also provides global access to the held lists of the unique instance. The executed preprocessing steps are under consideration of Section 2:
- Generation of one large central stencil list for each control volume in the transformed space and sorting it by distance as described in Section 2.1.
- Calculation and storing of all volume integrals of the basis functions of using triangularization of the faces and a Gaussian quadrature rule of appropriate order.
- If several processors are involved, halo cells are collected. Afterwards, appropriate cell coordinates and triangulated face coordinates are transmitted and the global stencils are gathered using the procedure of Section 2.2.
- Generation of the sectoral stencils and the final central stencil in accordance with the algorithm described in Section 2.1.
- Determination of the reconstruction matrix for each sectoral stencil of (see (21)). For this purpose, volume integrals of the basis functions for the cells in the stencil are calculated in the space of . Finally, the pseudoinverse is computed using SVD.
- Calculation of the oscillation indicator matrix for each using (14).
The efficiency of the preprocessing is further improved by storing the lists of the most time-consuming processes as files in the constant folder of the considered case. During a restart of the simulation, the WENOBase class searches for these lists and read them if available.
The runtime operations of the reconstruction are performed in the WENOCoeff class (see Figure 4). The input data is any variable represented by the averaged values of each cell . The first step consists of calling the WENOBase class in order to check whether an object already exists. The constructor of the preprocessing class returns the object directly or after the preprocessed lists are newly created and read from written files, respectively. The necessary lists are then obtained in each time step by calling a designated function. Afterwards, the following runtime steps are executed:
- Collection and transmission of the field values of the halo cells in case of parallel computing.
- For each stencil of , generation of the vector b as the right hand side of (19) using . The degrees of freedom are then computed directly from a matrix vector product using .
- Insertion of the coefficients in (10) and evaluation of the smoothness indicator afterwards.
All derived schemes obtain the necessary information for building the polynomials by this procedure which facilitates the addition of new schemes by users easily. The order of accuracy of the schemes are not restricted by the presented algorithm for which reason the polynomial order r is an user defined parameter. For the sake of convenience, r is defined in the default file for the selection of all schemes (fvSchemes). Exemplary entries look as follows
The first entry corresponds to a gradient discretisation based on a second-order polynomial and the second entry to the discretisation of a convection term using Gauss’s theorem and the third-order accurate WENOUpwindFit interpolation scheme. The last entry is related to the limiting strategy in (41).
In the following, the presented implementation is verified by evaluating the accuracy of the WENO reconstruction and the WENO convection scheme applied to the advection equation.
6.1. Accuracy of Reconstruction for Smooth Functions
The order of accuracy corresponds to the relation between the -norm of the error and different grid resolutions. It is represented as the slope of the line through the corresponding points of error and mesh size in a log-log plot. Knowing the error norm for two grids and with the characteristic sizes and , the order of accuracy is obtained as
The characteristic size is taken as in 3D and in 2D with N the total number of cells in the domain. The -norm of error is considered which is calculated aswith the total volume of the domain and the known exact solution in . The polynomials are computed from (16) with appropriate space transformations. The volume integrals in (49) are evaluated by a transformation into surface integrals and the use of Gaussian quadrature rules from above with a higher order than in the reconstruction. For this purpose, an integration of the differences over one of the coordinates has to be executed analytically. This can be computed by any mathematical software package for sufficient simple functions. The grids are generated without changing the topology during the refinement steps to prevent the results from additional scaling effects. For the two-dimensional calculations, hexahedral and triangular meshes are considered. In 3D, hexahedral and non-regular tetrahedral grids are taken into account. All meshes are presented in form of their coarsest grid resolution in Figure 5 and Figure 6, respectively.
First, a smooth two-dimensional function is reconstructed using WENO reconstructions with polynomials of first- to fourth-order. No analytical integration has to be executed since the integrals in (48) simplify to surface integrals for two-dimensional cases. The considered function is taken from McDonald  which offers the possibility of comparing the results to another high-order approach. The central essential non-oscillatory (CENO) scheme is based on a least squares reconstruction and an additional limiter in order to prevent oscillations. The function is given as
The solution is computed on a quadratic domain with an edge length of 20 and centred on . In Figure 7a, the initial data is shown on a structured grid with 2500 hexahedra.
The results of the reconstructions are shown in Figure 8 where the -norm of the error is plotted over the characteristic size. As expected, the accuracy of the scheme increases with raising polynomial order and grid resolution. Further, the results are almost the same for both cell shapes except for first-order. The fourth-order accurate CENO scheme from calculations on unstructured grids is outperformed by the corresponding WENO scheme which indicates the conservation of an accurate smooth solution by the WENO weighting in comparison to limiting strategies. The order of accuracy is evaluated for the -norm of the error under consideration of (48) and presented in Table 1. Obviously, the scheme reaches the nominal convergence rate of common numerical methods and even exceeds it for higher-order polynomials which is consistent with the theoretically possible order of WENO reconstructions.
Next, a smooth, three-dimensional function is reconstructed using polynomials of first- to third-order. The function is harmonically with changes in all three coordinate directions
The solution is computed on a cubic domain with an edge length of 1 m and centred on m. The initial data on a hexahedral grid with 8000 hexahedra is shown in Figure 7. In Figure 9, the resulting -norm of the error is shown for increasing grid resolutions. Generally, the scheme provides the expected distribution of the norm for increasing order and resolution. The evaluation of the order of accuracy from the convergence study of the -norm of the error is shown in Table 2. The nominal order can be reached for both meshes and all polynomial orders. However, the convergence of the scheme is slightly better on unstructured grids as well.
6.2. Numerical Convergence Study of the Advection Equation
A verification of the WENO upwind-biased convection scheme WENOUpwindFit is presented for the advection equation. This Equation (30) is introduced in Section 3 for deriving the exact Riemann solver for the WENO scheme. The spatial discretisation of the equation’s finite volume Formulation (31) is handled by the first- to third-order unlimited WENOUpwindFit scheme as well as the TVD scheme with van Leer’s limiter (TVD-vanLeer) as a reference. The temporal discretisation is performed explicitly using the TVD third-order accurate Runge-Kutta method . The time step has to be chosen without violating the stability of WENO which is a restriction on the CFL-condition to in three dimensions . The initial field is calculated from sine functions as 
It is transported with the velocity field in a cubic domain of 2 m × 2 m × 2 m with periodic boundary conditions. Hence, the field should match the initial distribution after t = 1 s. The considered meshes are hexahedral and tetrahedral containing between 4000 and 130,000 cells. As results, the -norm of error (49) is evaluated in a second-order accurate framework. This reduces the calculated convergence rate theoretically but provides the possibility to compare with the TVD method. Both, the norm of error and the convergence rate are given in Table 3 and Table 4 for the hexahedral and tetrahedral meshes, respectively. On the structured grids, all WENO schemes can reach the nominal order if the resolution is not too coarse. This phenomenon for high order schemes has also been reported by other authors . The TVD methods also shows an increasing convergence rate and similar error norms as the first-order WENO scheme, which confirms the expectation since both methods are second-order accurate. For all grids, the third-order WENO method has the smallest norm of error which demonstrates the convergence of the implementation as the polynomial order is increased. On the tetrahedral grids, the first- and third-order WENO schemes perform slightly better than on the hexahedral grids which might be caused by the better conditioned matrices on unstructured grids . On regular hexahedral grids, almost linear dependent lines arise from the information of collinear cells. In comparison, the TVD method performs worse than before which presents evidence for the importance of the mapping. The first-order WENO scheme can, hence, outperform the standard method.
The previous verification procedure showed that the theoretical order of accuracy can be reached using the presented WENO method. In the following, the schemes are validated for different test cases to emphasise the principal working of the implementation. Special attention is paid to the advection equation and an application to two-phase flows. A performance comparison provides an additional tool for evaluating the overall performance of the schemes.
7.1. Application to the Gradient Calculation
The accuracy of the WENO gradient scheme (Section 4) shall be presented for a smooth, three-dimensional function with large gradients in all three coordinate directions. For this purpose, the first- to third-order WENOGrad scheme and OpenFOAM®’s standard method, selectable as Gauss linear, are applied to the harmonic Function (51) of Section 6.1.
The solutions for the gradients of (51) are computed on a cubic domain with an edge length of 1 m and centred on (0.5 m, 0.5 m, 0.5 m). The considered meshes are a structured grid with 5800 cells and a tetrahedral grid with ≈6000 cells. The results are represented as a plot of the gradients of along the diagonal from (0 m, 0 m, 0 m) to (1 m, 1 m, 1 m) and can be seen in Figure 10. Here, all three gradients are pictured in a single figure for each mesh. The resulting curve of the third-order WENO gradient scheme coincides well with the analytical solution for this resolution regardless of the considered direction or mesh. The first- and second-order schemes as well as the reference method perform similar on the structured grid, which is slightly worse than WENOGrad3 if the gradients have a maximum or minimum. On the unstructured grid, WENOGrad2 provides similar distributions as before. In contrast, particularly the linear scheme oscillates around the analytical solution and shows deviations up to .
7.2. Application to the Advection Equation
Next, the validation of the WENO upwind-biased convection scheme WENOUpwindFit is presented for the advection equation. Further, the improved performance by introducing the limiter strategy of Section 3 is emphasised.
Two convection test cases of Jasak , which are generated to investigate the numerical diffusion of different convection schemes, are evaluated using the first- to third-order WENO schemes and TVD-vanLeer as the reference. The left boundary of a squared domain (1 m × 1 m) is taken as an inlet with a predefined profile as shown in Figure 11. The two considered profiles are an ellipse-profileand a step-profile
In the whole domain and at all boundaries, the velocity is prescribed as leading to a transport of from the left to the right with an angle of . Further, is set be equal 1 at the lower inlet whereas a zero gradient condition is used for it at the outlet. The considered meshes are two-dimensional and consist of 2500 quadratic and 2204 uniform triangular cells, respectively. The simulations are completed after steady-state solutions are obtained. The evaluation of the results is carried out graphically by plotting the steady-state solution of along the y-axis at x = 0.5 m and a comparison with the analytical results of (53) and (54). The simulation results are presented in Figure 12 and Figure 13.
On the structured grids, all convection schemes predict similar profiles. Obviously, they benefit from the high mesh resolution resulting in less improvement by applying even higher orders. On the unstructured grids, the transformations into a reference space leads to improved results using the third-order WENO scheme. The missing collinear cells in the stencils lead to lower condition numbers of the reconstruction matrices and thereby, a more accurate solution, even though the mesh resolution is lower than on the structured grid. The results for the TVD-vanLeer scheme are similar to its results on the structured grid which is less accurate than WENO schemes. For both simulations, limiting the WENO polynomials is not be necessary since the results are as bounded as of the TVD scheme.
The benefit of the limited WENOUpwindFit scheme can, however, be emphasised by extending the advection of the step-profile to a third dimension. In Figure 14, a slice at z = 0.5 m is shown for this profile using the three-dimensional tetrahedral mesh from Section 6.1. It is clearly noticeable that the TVD scheme predicts a smeared interface in comparison to the limited fourth-order accurate WENO scheme. Furthermore, TVD-vanLeer shows an unphysical jumping of the interface near the point (x = 0.4 m, y = 0.45 m) and an unbounded solution. Here, the WENO scheme can benefit from the introduced limiter and mesh transformation leading to a less unbounded solution and a more physical interface. The remaining violation of the boundedness is due to the assumptions in Section 3.
As a second test case, the rotation of a slotted disk, designed by Zalesak  in order to verify the performance of his flux-corrected transport scheme, is simulated. It is a classical case for the comparison of different convection schemes due to its complex shape. As it can be seen in Figure 15, a disk with diameter 0.6 m is centred on (0 m, 0.5 m) in a square two-dimensional domain of 2 m × 2 m delimited by the points (−1 m, −1 m) and (1 m, 1 m). The difficulties of the shape arise from subtracting a vertical rectangle of 0.1 m × 0.5 m from the disk resulting in a slotted disk with sharp corners and thin slot . The initial field is set to be in the disk and in the rest of the domain. The velocity field is defined as which leads to an off-centred rotation of the disk. At the end of the simulation, after t = 1 s, the profile is rotated back into the initial position. The considered meshes are two-dimensional and consist of quadratic and uniform triangular cells respectively. The number of cells is fixed to and . The results are presented graphically as a comparison of the contours and slices of the convected profile at y = 0.6 m with the corresponding analytical results. Additionally, the results of the structured grids are compared to the WENO implementation of the open-source solver REEF3D . It is based on a finite-difference method and has the fifth-order accurate WENO scheme of Zhang and Jackson  implemented. It is expected to achieve a higher accuracy than with the proposed method because the polynomials are calculated for each direction separately and optimal weights are applied to the stencils. However, this approach is limited to Cartesian grids and, therefore, not suitable for an implementation in OpenFOAM®.
At first, the importance of the limiter is shown for the coarse structured grid and the third-order WENO scheme. As can be seen in Figure 16b, the unlimited method predicts overshoots of about which can be eliminated by introducing the limiter . The remaining distribution and the contour plot is almost identical which is in accordance with the theoretical considerations. In the following, only the results of the limited WENO methods are shown for the sake of clarity.
The results on the coarse structured grid in Figure 17 show superior performance of the second and third-order WENO schemes to the TVD scheme. The contour’s sharp corners are approximated more accurate and the slice shows an improved approximation of the slot due to less numerical diffusion. The TVD results are smeared because of the reduction to first-order accuracy near the extrema. The steady improvement of WENO by increasing the polynomial order is given. Similar results arise on the finer mesh in Figure 18 which shows a great accordance of the third-order WENO computations with the analytical results. The mesh resolution yields an improvement of the TVD scheme and first-order WENO scheme too. It is, however, still worse than the fourth-order accurate WENO scheme especially in the slot. The comparison to the fifth-order WENO scheme using REEF3D highlights the performance of the implementation since only small differences can be observed for the contours. In Figure 17b, REEF3D shows an improved distribution in the slot which can be explained by the theoretical details indicated above. The predicted distributions on the unstructured grids, shown in the Figure 19 and Figure 20, are generally improved if WENO is applied, as it is already stated for the previous case. Here, even the first-order WENO profiles are less smeared than the profiles of TVD-vanLeer.
7.3. Three-Dimensional Breaking of a Dam
The case of a three-dimensional breaking of a dam was documented by Issa and Violeau  and is depicted in Figure 21. The domain is a rectangular box of 3.24 m × 1 m with a rectangular obstacle placed on the centre line of the bottom. As initial condition, a water column of 1.248 m × 1 m × 0.55 m is placed at the right boundary and starts collapsing at t = 0 s. In comparison to classical two-dimensional dam-break cases, some fluid can avoid the obstacle resulting in a three-dimensional chaotic impact at the left boundary of the domain. The fluid properties of water are fixed as and , while the rest of the domain is filled with air (, ). Accordingly, all boundaries are defined as no-slip walls except of the top which is considered as an outlet. The turbulence is modelled using the standard k- model.
OpenFOAM®’s interFoam solver, which is the standard solver for incompressible two-phase flows using RANS approach, is taken as a reference. It is based on a volume of fluid method with a special compression term for avoiding smearing of interfaces. In order to avoid unphysical fluid properties from improper advection and compression, the limiting strategy MULES is introduced. It has the objective to ensure boundedness of the solution of the volume fraction in each time step. Interpreting MULES as a flux-corrected method, it is obvious that a low-order, as well as a high-order advection flux has to be provided. Here, the interface model can benefit from the developed high-order WENOUpwindFit scheme. The nominal order of accuracy is, however, reduced by applying this limiting strategy. It can be shown that interFoam may lead to oscillatory interfaces in situations where the compression acts in wrong directions. In this connection, the authors added a relaxation equation with a novel diffusion coefficient based on the idea of Rusche . The derivation of the resulting clsMULESFoam solver can be found in .
All discretisation procedures are based on at least second-order accurate schemes. The clsMULESFoam solver applies additionally the WENO gradient scheme based on third-order polynomials and the fourth-order accurate limited WENOUpwindFit scheme for convective terms in the momentum equations and in the free surface model. As reference, the interFoam solver with a linear gradient and the TVD-vanLeer convection scheme is used. The considered mesh consists of M tetrahedra and is shown in Figure 22. The mesh topology does not change in y-direction for which reason just a slice of the mesh is presented. Two refinement levels are introduced, whereby the region around the initial water column and near the obstacle are better resolved. Further, the mesh is decomposed into several sub-domains in order to run the simulations on several processors and show the principal working of the new WENO parallelisation. The evaluation is carried out by tracking the computed water column height at four different measuring points over and comparing the distributions to experimental results provided by Arnold . All measuring points are located on the symmetry plane y = 0.5 m and their x-coordinates can be taken from Figure 22. The resulting distributions are presented in Figure 23.
Starting at t = 0 s, the water column collapses which results in an accelerated decrease of the water height at . Both solvers coincide with the experiments here. A wave package returns to this measuring point after an impact on the left wall at t = 3 s. The clsMULESFoam solver predicts these wave trains more precisely, especially the highest wave at t = 4 s. Similar situations can be observed at and where OpenFOAM®’s methods predict often over- and undershoots while the high-order convection results approximate the experimental distributions with a higher accuracy. This is, in particular, noticeable for the second wave front between t = 4 s and t = 5 s at . At the last measuring point, both solvers have difficulties to predict the experimental distribution in the time interval t = [1.2 s, 2.8 s]. It should be, however, noticed that at this time the water behind the obstacle is strongly fluctuating which complicates both the experimental and numerical determination of the actual columns height.
The quality of the results can be further emphasised by evaluating the -norm of errors at due to the existence of experimental distributions. The norms are defined as
The integrals are computed numerically using the trapezoidal method which is sufficient since no nominal order of accuracy is determined. The resulting norms are listed in Table 5. At all measuring points, clsMULESFoam outperforms interFoam considerably due to the application of WENO reconstructions. They benefit from their transformation of the cells in a reference space without scaling effects and the missing collocated cells on tetrahedral meshes. Consequentially, using WENO schemes counteracts the usual degrading of accuracy on unstructured grids and improves the applicability of such meshes. The generation of tetrahedral meshes is less complicated than hexahedral meshes for which reasons a time consuming part can be omitted.
7.4. Performance Comparison
In practice, the sense of using high-order schemes is a question of performance of the resulting tool in comparison to the improvement of the results. For this purpose, an impression of the implementation’s efficiency is provided next. The presented time measurements arise from the calculations in Section 7.3 but with the interFoam solver in order to achieve comparability. The computations are executed on a local cluster of the University of Rostock with about 2700 processors (AMD 6172, 2.2 GHz) at which each of them contains 12 cores each with 2 GB of RAM.
The relative time per reconstruction relating to the fastest interpolation using TVD-vanLeer on 32 processors is shown in Figure 24. This scheme almost reaches the minimum time step size at 8 processors or about 40,000 cells per processor. It is caused by the fact that using more processors also means more inter-processor communication which counteracts the fewer computations per processor. Therefore, the maximum overall efficiency of a computation is limited to a specific number of processors. In comparison, the WENO reconstructions reach smaller periods by increasing the number of processors further. It should be noticed that all polynomial orders reach almost the same time as the TVD scheme in case of 32 processors or 9500 cells per processor. In more common decompositions with about 80,000 cells per processors, it is readable that similar time periods could be reached by the fourth-order accurate WENO reconstruction as by TVD-vanLeer if the computation is executed on two times more processors. This number would of course further increase in view of the possible application of several WENO reconstructions per time step.
An explanation of the different convergence rate in time is given by listing the sub-steps of a WENO reconstruction in Figure 25. It shows the percentage partition of the total reconstruction time per cell with an explanation of the single steps in the caption of the figure. It, indeed, confirms the impression of Figure 24 that the increased inter-processor communication on a higher number of processors is not significant to the overall efficiency of the scheme. The disadvantage of more inter-processor communication vanishes in relation to the remaining calculation. The maximum percentage is expectable for the fourth-order accurate scheme which is caused by the extended stencils and to that effect more halo cells. The by far biggest percentage is related to the calculation of the degrees of freedom in each stencil of a cell. This step takes between and of the overall time which is, however, obvious since the weighting, as the remaining step of the calculation, has to be executed just once. For schemes based on a least-squares reconstruction, the reconstruction time could be, hence, be reduced from to since no weighting is necessary.
The basis for the developed high-order convection and gradient schemes is a WENO reconstruction method. It is derived from the approaches of Dumbser and Käser  and Tsoutsanis et al. , and handles two- and three-dimensional polyhedral meshes in parallel. Most computational work is moved to the preprocessing in order to receive more efficient schemes in runtime. The implementations are integrated into the given interpolation and gradient classes of OpenFOAM® which simplifies further working with the code in high-level programming and allows the development of a wider range of high-order convection and gradient schemes. Further, the reconstruction process can be taken as the basis of high-order Riemann solver which extends the possible scope of OpenFOAM® significantly.
The WENOUpwindFit scheme extends the class of high-order upwind schemes and shows superior results for the scalar advection equation and in convection dominated, incompressible flows. It has been shown that the advanced handling of unstructured meshes reduces potential problems of common TVD schemes regarding accuracy and boundedness. Additionally, the stability of the simulations using the semi-implicit implementation was demonstrated. In perspective, a blending of upwind and downwind fluxes would be preferable for improving large eddy simulations or increase the accuracy of front propagating problems by avoiding MULES.
The derived gradient scheme WENOGrad represents a compromise between accuracy and efficiency, but still outperforms the standard linear gradient scheme. This class of schemes can easily be adapted to other operations in the code as the calculation of surface normal gradients (see  for the derivation).
The presented efficiency analysis exposes the obvious increase at runtime during increasing the order of accuracy but also shows the possibility to reach similar computational time by increasing the number of processors. Both the preprocessing and runtime efficiency could be increased by modifying specific parameters of the reconstruction. Single test cases showed little effect of a reduced stencil expansion (compare (26)) in a reasonable range. This leads to a smaller initial stencil and less inter-processor communications in the preprocessing. The final stencil sizes are also reasonable parameters which would especially affect the runtime performance. In addition, the order of the Gaussian integration is currently fixed but could be adapted to the chosen order of the polynomials in order so save preprocessing time. Further, several approaches should be noticed which would improve the efficiency of a high-order convection scheme. The limited least-squares scheme proposed by Michalak and Ollivier-Gooch  is based on a single, central stencil and avoids weighting of the coefficients. The limiter could be implemented within the interpolation class similar to the presented one. Hence, the final degrees of freedom would be calculated faster than using WENO reconstructions. However, the proposed limiter is restricted to third-order of accuracy and results were just shown for the Euler equations in 2D. As an alternative approach, the adaptive WENO scheme of Costa and Don  might be interesting. It diminishes to a low-order upwind scheme in smooth regions and applies WENO in regions of high gradients. Thereby, a fast algorithm could be developed especially for steady-state two-phase flows where the influence of surfaces is just active in a narrow band of the domain. The difficulties are the definition of a proper criterion to distinguish between the different regions and the preservation of the accuracy of the scheme. In this connection, it is though suggested to extend the indicated performance evaluation and compute weak and strong scaling tests on the basis of a suitable benchmark test before further adjustments for performance reasons are considered.
The authors would like to thank Carl Ollivier-Gooch for an interesting discussion of his schemes and his contribution to the successful development of the presented methods.
The presented developments are based on the collaborate work of Tobias Martin and Ivan Shevchuk. Main parts of the article are written by Tobias Martin with contributions of Ivan Shevchuck.
Conflicts of Interest
The authors declare no conflict of interest.
- Tsoutsanis, P.; Antoniadis, A.F.; Drikakis, D. WENO schemes on arbitrary unstructured meshes for laminar, transitional and turbulent flows. J. Comput. Phys. 2014, 256, 254–276. [Google Scholar] [CrossRef]
- Wesseling, P. Principles of Computational Fluid Dynamics; Springer: Berlin, Germany, 2001. [Google Scholar]
- Pringuey, T. Large Eddy Simulation of Primary Liqiud-Sheet Breakup. Ph.D. Thesis, Hopkinson Laboratory, University of Cambridge, Cambridge, UK, 2012. [Google Scholar]
- Harten, A.; Engquist, B.; Osher, S.; Chakravarthy, S.R. Uniformly High Order Accurate Essentially Non-oscillatory Schemes, III. J. Comput. Phys. 1987, 71, 231–303. [Google Scholar] [CrossRef]
- Godunov, S.K. A Finite Difference Method for the Computation of Discontinuous Solutions of the Equations of Fluid Dynamics. Matematicheskii Sbornik 1959, 47, 357–393. [Google Scholar]
- Sweby, P.K. High Resolution Schemes Using Flux Limiters for Hyperbolic Conservation Laws. SIAM J. Numer. Anal. 1984, 21, 995–1011. [Google Scholar] [CrossRef]
- Zhang, X.; Shu, C.-W. On maximum-principle-satisfying high order schemes for scalar conservation laws. J. Comput. Phys. 2010, 229, 3091–3120. [Google Scholar] [CrossRef]
- Abgrall, R. On Essentially Non-Oscillatory Schemes on Unstructured Meshes: Analysis and Implementation. J. Comput. Phys. 1994, 114, 45–58. [Google Scholar] [CrossRef]
- Ollivier-Gooch, C.F. Quasi-ENO Schemes for Unstructured Meshes based on Umlimited Data-Dependent Least-Squares Reconstruction. J. Comput. Phys. 1997, 133, 6–17. [Google Scholar] [CrossRef]
- Jalali, A.; Ollivier-Gooch, C.F. Higher-Order Least-Squares Reconstruction for Turbulent Aerodynamic Flows. In Proceedings of the 11th World Congress on Computational Mechanics, Barcelona, Spain, 20–25 July 2014. [Google Scholar]
- Wang, Z.J. Adaptive High-Order Methods in Computational Fluid Dynamics; World Scientific Publishing: Singapore, 2011; Volume 2. [Google Scholar]
- McDonald, S. Development of a High-Order Finite-Volume Method for Unstructured Meshes. Master’s Thesis, University of Toronto, Toronto, ON, Canada, 2011. [Google Scholar]
- Martin, T. Solving the Level Set Equation Using High-Order Non-Oscillatory Reconstruction. Study Research Project, Chair of Modelling and Simulation, University of Rostock. Available online: https://github.com/TobiasMartin/WENOEXT (accessed on 3 December 2017).
- Ollivier-Gooch, C.F.; University of British Columbia, Vancouver, BC, Canada. Private communication about Quasi-ENO schemes, 2016.
- Shu, C.-W. Essentially Non-Oscillatory and Weighted Essentially Non-Oscillatory Schemes for Hyperbolic Conservation Laws; NASA/CR-97-206253, ICASE Report No. 97-65; Institute for Computer Applications in Science and Engineering: Hampton, VA, USA, 1997. [Google Scholar]
- Dumbser, M.; Käser, M. Arbitrary high order non-oscillatory finite volume schemes on unstructured meshes for linear hyperbolic systems. J. Comput. Phys. 2007, 221, 693–723. [Google Scholar] [CrossRef]
- Wu, X.; Liang, J.; Zhao, Y. A new smoothness indicator for third-order WENO scheme. Int. J. Numer. Methods Fluids 2016, 81, 451–459. [Google Scholar] [CrossRef]
- Liu, X.; Osher, S.; Chan, T. Weighted Essentially Non-oscillatory Schemes. J. Comput. Phys. 1994, 115, 200–212. [Google Scholar] [CrossRef]
- Jiang, G.-S.; Shu, C.-W. Efficient Implementation of Weighted ENO Schemes. J. Comput. Phys. 1996, 126, 202–228. [Google Scholar] [CrossRef]
- Friedrich, O. Weighted Essentially Non-Oscillatory Schemes for the Interpolation of Mean Values on Unstructured Grids. J. Comput. Phys. 1998, 114, 194–212. [Google Scholar] [CrossRef]
- Xia, Y.; Luo, H.; Frisbey, M.; Nourgaliev, R. A set of parallel, implicit methods for a reconstructed discontinuous Galerkin method for compressible flows on 3D hybrid grids. Comput. Fluids 2014, 98, 134–151. [Google Scholar] [CrossRef]
- Henrick, A.K.; Aslam, T.D.; Powers, J.M. Mapped weighted essentially non-oscillatory schemes: Achieving optimal order near critical points. J. Comput. Phys. 2005, 207, 542–567. [Google Scholar] [CrossRef]
- Mirtich, B. Fast and Accurate Computation of Polyhedral Mass Properties. J. Graph. Tools 1996, 1, 31–50. [Google Scholar] [CrossRef]
- Deng, S. Quadrature Formulas in Two Dimensions, Lecture Math 5172—Finite Element Method. 2010. Available online: http://math2.uncc.edu/~shaodeng/TEACHING/math5172/Lectures/Lect_15.PDF (accessed on 3 December 2017).
- Golub, G.H.; Loan, C.F. Matrix Computations; John Hopkins University Press: Baltimore, MD, USA, 1996. [Google Scholar]
- Lawson, C.L.; Hanson, R.J. Solving Least Squares Problems; SIAM: Philadelphia, PA, USA, 1995. [Google Scholar]
- Martin, T. Development of a Finite Volume Solver for Two-Phase Incompressible Flows Using a Level Set Method. Master’s Thesis, Chair of Modelling and Simulation, University of Rostock, Rostock, Germany, 2016. Available online: https://github.com/TobiasMartin/WENOEXT (accessed on 3 December 2017). [Google Scholar]
- Toro, E.F. Riemann Solvers and Numerical Methods for Fluid Dynamics; Springer: Berlin, Germany, 2009. [Google Scholar]
- Toro, E.F. MUSTA: A multi-stage numerical flux. Appl. Numer. Math. 2006, 56, 1464–1479. [Google Scholar] [CrossRef]
- Khosla, P.K.; Rubin, S.G. A Diagonally Dominant Second-Order Accurate Implicit Scheme. Comput. Fluids 1974, 2, 207–209. [Google Scholar] [CrossRef]
- Zhang, X.; Shu, C.-W. Linear Instability of the Fifth-Order WENO Method. SIAM J. Numer. Anal. 2007, 45, 1871–1901. [Google Scholar]
- Versteeg, H.K.; Malalasekera, W. Computational Fluid Dynamics—The Finite Volume Method; Pearson Education Limited: Harlow, UK, 2007. [Google Scholar]
- Toro, E.F. On Glimm-Related Schemes for Conservation Laws; Technical Report MMU-9602; Department of Mathematics and Physics, Manchester Metropolitan University: Manchester, UK, 1996. [Google Scholar]
- Titarev, V.A.; Toro, E.F. Finite-volume WENO schemes for three-dimensional conservation laws. J. Comput. Phys. 2004, 201, 238–260. [Google Scholar] [CrossRef]
- Titarev, V.A.; Toro, E.F. WENO schemes based on upwind and centred TVD fluxes. Comput. Fluids 2005, 34, 705–720. [Google Scholar] [CrossRef]
- Alexandrescu, A. Modern C++ Design: Generic Programming and Design Patterns Applied; Addison Wesley: Boston, MA, USA, 2001. [Google Scholar]
- Leveque, R.J. Finite-Volume Methods for Hyperbolic Problems; Cambridge University Press: Cambridge, UK, 2004. [Google Scholar]
- Zhang, Y.-T.; Chu, C.-W.; Chan, T. Third order WENO scheme on three dimensional tetrahedral meshes. Commun. Comput. Phys. 2009, 5, 836–848. [Google Scholar]
- Jasak, H. Error Analysis and Estimation for the Finite Volume Method with Applications to Fluid Flows. Ph.D. Thesis, Department of Mechanical Engineering, Imperial College of Science, London, UK, 1996. [Google Scholar]
- Zalesak, S.T. Fully Multidimensional Flux-Corrected Algorithms for Fluids. J. Comput. Phys. 1979, 31, 335–362. [Google Scholar] [CrossRef]
- Bihs, H.; Kamath, A.; Chella, M.A.; Aggarwal, A.; Arntsen, Ø.A. A new level set numerical wave tank with improved density interpolation for complex wave hydrodynamics. Comput. Fluids 2016, 140, 191–208. [Google Scholar] [CrossRef]
- Zhang, J.; Jackson, T.L. A high-order incompressible flow solver with WENO. J. Comput. Phys. 2009, 228, 2426–2442. [Google Scholar] [CrossRef]
- Issa, R.; Violeau, D. ERCOFTAC, SPHERIC SIG Test-Case 2: 3D Dambreaking. 2006. Available online: http://app.spheric-sph.org/sites/spheric/files/SPHERIC_Test2_v1p1.pdf (accessed on 3 December 2017).
- Rusche, H. Computational Fluid Dynamics of Dispersed Two-Phase Flows at High Phase Fractions. Ph.D. Thesis, Department of Mechanical Engineering, Imperial College of Science, London, UK, 2002. [Google Scholar]
- Arnold, P. Validation of a 3D Dam Breaking Problem. 2014. Available online: https://www.flow3d.com/wp-content/uploads/2014/10/FLOW-3D-Dam-Breaking-Validation.pdf (accessed on 3 December 2017).
- Michalak, C.; Ollivier-Gooch, C.F. Accuracy preserving limiter for the high-order accurate solution of the Euler equations. J. Comput. Phys. 2009, 228, 8693–8711. [Google Scholar] [CrossRef]
- Costa, B.; Don, W.S. High order Hybrid central-WENO finite difference scheme for conservation laws. J. Comput. Appl. Math. 2007, 204, 209–218. [Google Scholar] [CrossRef]
Figure 1. Layers of cells added at each iteration: in yellow, considered cell; in purple, initial neighbours; in red, the cells added at the first iteration; in green, the cells added at the second iteration—two-dimensional example.
Figure 2. Definition of the three sectoral stencils for a triangular cell: in yellow, considered cell–two-dimensional example.
Figure 3. Stencil collection algorithm at processor boundaries. (a) Local stencil; (b) global stencil. In green, cells of processor ; in red, cells of processor ; in yellow, final stencil.
Figure 4. File structure of the WENO reconstruction implementation.
Figure 5. Two-dimensional meshes for the verification process. (a) 2500 hexahedra; (b) 6172 triangular prisms.
Figure 6. Three-dimensional meshes for the verification process. (a) 8000 hexahedra; (b) 7982 tetrahedra.
Figure 7. Initial data for the reconstruction of the smooth functions. (a) 2D function; (b) 3D function.
Figure 8. -norm of the error for the smooth, two-dimensional function. (a) 2500 hexahedra; (b) 6172 triangles.
Figure 9. -norm of the error for the smooth, three-dimensional function. (a) Hexahedra; (b) tetrahedra.
Figure 10. Results of the gradient calculation in the principal directions along the diagonal d. (a) 5800 hexahedra; (b) 6048 tetrahedra.
Figure 11. Setup for the two-dimensional transport of prescribed profiles.
Figure 12. Slice of the ellipse-profile at x = 0.5 m. (a) 2500 squares; (b) 2204 triangles.
Figure 13. Slice of the step-profile at x = 0.5 m. (a) 2500 squares; (b) 2832 triangles.
Figure 14. Slice of a three-dimensional step-profile at z = 0.5 m on a mesh with 7982 tetrahedra. (a) TVD-vanLeer; (b) limited WENOUpwindFit 3.
Figure 15. Setup for the rotation of Zalesak’s disk (all measurements in metres).
Figure 16. Results of the limited and unlimited third-order WENO scheme for Zalesak’s disk on squares. (a) Contour plot of ; (b) slice of the disk at y = 0.6 m.
Figure 17. Results of convection schemes for Zalesak’s disk on squares. (a) Contour plot of ; (b) slice of the disk at y = 0.6 m.
Figure 18. Results of convection schemes for Zalesak’s disk on squares. (a) Contour plot of ; (b) slice of the disk at y = 0.6 m.
Figure 19. Results of convection schemes for Zalesak’s disk on triangles. (a) Contour plot of ; (b) slice of the disk at y = 0.6 m.
Figure 20. Results of convection schemes for Zalesak’s disk on triangles. (a) Contour plot of ; (b) slice of the disk at y = 0.6 m.
Figure 21. Setup for the three-dimensional breaking of a dam.
Figure 22. Slice of the mesh at y = 0.5 m and locations of the four measuring points.
Figure 23. Measured water column heights over time. (a) over time; (b) over time; (c) over time; (d) over time.
Figure 24. Time for one discretisation step related to TVD-vanLeer on 32 processors using different schemes and number of processors. All computations are executed using the interFoam solver.
Figure 25. Percentage of single sub-steps of a WENO reconstruction. Explanation for the legend: Get lists—receive necessary lists from WENOBase, Swap lists—interprocessor communication and transmission of data of halo cells, Calculating —matrix vector multiplication for obtaining coefficients of sub-stencils, Calculating —weighting and summing up.
Table 1. Order of accuracy from the numerical convergence study for the smooth, two-dimensional function on hexahedral and triangular grids using .
|Polynomial Order r|
Table 2. Order of accuracy from the numerical convergence study for the smooth, three-dimensional function on hexahedral and tetrahedral grids using .
|Polynomial Order r|
Table 3. Error and convergence of WENO convection schemes for the advection equation on hexahedral meshes.
|Convection Scheme||Number of Cells||-Norm of Error|
Table 4. Error and convergence of WENO convection schemes for the advection equation on tetrahedral meshes.
|Convection Scheme||Number of Cells||-Norm of Error|
Table 5. -norm of the errors for the measured data.
© 2018 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).