Keywords

1 Introduction

We first consider general convection-diffusion of a scalar in 2D:

$$\begin{aligned} \nabla \cdot (\mathbf {u} \phi ) + \nabla \cdot D \nabla \phi = f ~~~~~~~~ in ~\varOmega , \end{aligned}$$
(1)

where \(\phi \) is the unknown potential, f the source term, D is the diffusion coefficient tensor of the system, and \(\mathbf {u}\) a known divergence free vector field. Equation 1 is subjected to a homogeneous Dirichlet boundary condition:

$$\begin{aligned} \phi = 0 ~~~~~ on~ \partial \varOmega . \end{aligned}$$
(2)

The method presented is based on a combination of mimetic methods, presented in [2, 4, 12] and least-squares spectral element methods, [1, 14]. Recent work combining the two methods include [6]. The method is derived using basic components from differential geometry, which leads to conservation of invariants of the system. Using the least-squares principles lead to a symmetric positive definite matrix for the discretized problem.

2 Differential Geometry

In differential geometry the unknowns are presented by forms instead of vector and scalar fields, as in vector calculus. Variables associated with points, such as the temperature, are represented by a 0-form while variables associated with a volume are represented by 3-forms, e.g. the density. 1-forms and 2-forms can likewise represent variables associated with lines and surfaces. Furthermore forms have inner and outer orientation. Outer oriented 2-forms represent variables working through surfaces, such as a flux, while inner oriented 2-forms represent variables working on a surface e.g. describing vorticity in a plane.

Generalising the definitions of 0-forms, 1-forms, 2-forms and 3-forms, the general k-form is denoted \(\omega ^{(k)} \in \varLambda ^k(\varOmega _n)\) on the n-dimensional domain \(\varOmega _n\), for \(0 \le k \le n\). \(\varLambda ^k(\varOmega _n)\) is the space of k-forms on \(\varOmega _n\), i.e. the collection of all k-linear, antisymmetric mappings of vectors belonging to the n-dimensional tangent vector space V:

$$\begin{aligned} \omega ^{(k)}: \underbrace{V \times ... \times V}_{k} \rightarrow \mathbb {R}. \end{aligned}$$
(3)

Differential geometry also introduces the wedge product between k-forms and m-forms, which produces a (\(k+m\))-form: \( \wedge : \varLambda ^k(\varOmega _n) \times \varLambda ^m(\varOmega _n) \rightarrow \varLambda ^{k+m}(\varOmega _n)\). The wedge product, also called a skew-symmetric product, has the property: \(\alpha ^{(k)} \wedge \beta ^{(m)} = (-1)^{km}\beta ^{(m)} \wedge \alpha ^{(k)}\).

Instead of using three different operators to represent curl, divergence and gradient, differential forms are equipped with an operator representing all three operators; the exterior derivative, d. The exterior derivative operates on k-forms and maps them into (k+1)-forms: \(d : \varLambda ^k(\varOmega _n) \rightarrow \varLambda ^{k+1}(\varOmega _n)\). The exterior derivative can be defined by means of the Stokes theorem [3]:

$$\begin{aligned} \int _{\varOmega _{k+1}} d\omega ^{(k)} = \int _{\partial \varOmega _{k+1}} \omega ^{(k)}. \end{aligned}$$
(4)

Since the exterior derivative is constructed using only the boundary of the domain of interest, the discrete version of the exterior derivative can be performed exactly.

The interior product is the inverse operation of the exterior derivative and is the mapping: \(\iota _Y : \varLambda ^k(\varOmega _n) \rightarrow \varLambda ^{k-1}(\varOmega _n)\) for some vector field \(Y \in \varOmega _n\) and \(1 \le k \le n\), defined as:

$$\begin{aligned} \iota _{Y} \alpha ^{(k)}({X_2}, \cdots , {X_k}) = \alpha ^{(k)}({Y},{X_2}, \cdots , {X_k}) ~~~~ \forall {X_i},Y \in V \end{aligned}$$
(5)

The Lie-derivative represents how forms change when they are altered by the flow of some vector field \(Y \in \varOmega _n\) and is the mapping: \(\mathcal {L}_Y : \varLambda ^k(\varOmega _n) \rightarrow \varLambda ^{k}(\varOmega _n)\), see [13, 15]. The Lie-derivative can be seen as the convection operator for differential geometry and is defined by applying Cartan’s formula:

$$\begin{aligned} \mathcal {L}_Y \alpha ^{(k)} = \iota _Y d \alpha ^{(k)} + d \iota _Y \alpha ^{(k)}. \end{aligned}$$
(6)
Fig. 1.
figure 1

The six different forms in the two dimensional space. The upper row is the inner oriented forms while the bottom shows the outer oriented forms.

The inner and outer oriented forms are connected using the Hodge-star operator denoted with a \(\star \), see [3, 10]. The Hodge-star operator, \(\star \), is a map between k-forms and (\(n-k\))-forms of opposite orientation in a n-dimensional domain: \({\star } : \varLambda ^k(\varOmega ^n)\rightarrow {\varLambda }^{n-k}(\varOmega ^n)\) see for example Fig. 1. In this report the \(\sim \) denotes inner oriented forms. The Hodge-star operator is defined using the following relation:

$$\begin{aligned} \alpha ^{(k)} \wedge \star \beta ^{(k)} = (\alpha ^{(k)} , \beta ^{(k)}) \omega ^{(n)}, \end{aligned}$$
(7)

where \(\omega ^{(n)}\) is a unit n-form and the brackets \((\cdot ,\cdot )\) denote an inner product, which computes a scalar field from the vector proxy of the forms. This inner product results in a 0-form defined such that on the n-dimensional Euclidean domain: \( (\alpha ^{(1)},\beta ^{(1)}) = \sum _{i=1}^{n}\sum _{j=1}^{n} A_i B_j g^{ij}, \) where \((A_1,...,A_n)\) and \((B_1,...,B_n)\) define the vector proxies of \(\alpha ^{(1)}\) and \(\beta ^{(1)}\), respectively, and \(g^{ij}\) is the inverse of the metric tensor.

The spaces of forms are also equipped with an integral inner product or also referred to as an \(L^2\) inner product defined as:

$$\begin{aligned} (\alpha ^{(k)},\beta ^{(k)})_\varOmega = \int _{\varOmega } (\alpha ^{(k)} , \beta ^{(k)}) \omega ^{(n)}. \end{aligned}$$
(8)

When working with multiple domains, differential forms are equipped with an operator, which transforms forms defined on the codomain to the domain; the pullback operator. Consider the mapping of coordinates \(\varPhi : \widehat{\varOmega } \rightarrow \varOmega \), then the pullback operator is the mapping: \(\varPhi ^* : \varLambda (\varOmega ) \rightarrow \varLambda (\widehat{\varOmega })\). For the k-form \(a^{(k)}\) defined on \(\varOmega \), the following relation can then be constructed:

$$\begin{aligned} \int _{\varOmega } a^{(k)} = \int _{\varPhi (\widehat{\varOmega })} a^{(k)} = \int _{\widehat{\varOmega }} \varPhi ^*a^{(k)}. \end{aligned}$$
(9)

3 Mimetic Least-Squares Formulation

The variable \(\phi \) in (1), is represented by the inner oriented 0-form \({\tilde{\phi }}^{(0)}\). The Laplace operator working on a 0-form is constructed using the exterior derivative and Hodge star operator \(\varDelta \rightarrow \star d \star d\), which results in a 0-form. The source function in (1) can be represented by an inner oriented 0-form, \(\tilde{f}^{(0)}\). The term \(\nabla \cdot (\mathbf {u}\phi )\) represents the conservation of convective flux, which is naturally constructed using the Lie-derivative. One way of implementing this is to consider the 2-form \(\varvec{\star } \tilde{\phi }^{(0)} \) for the convective term, such that the following equation is obtained:

$$\begin{aligned} \mathcal {L}_\mathbf {u} \varvec{\star } \tilde{\phi }^{(0)} + d\varvec{\star }d\tilde{\phi }^{(0)} = \star \tilde{f}^{(0)}, \end{aligned}$$
(10)

where the right hand side is replaced by the 2-form \(f^{(2)} = \star \tilde{f}^{(0)}\). Using Cartans homotopy formula, (6), the convective term reduces to only one term, since \(d \circ d \equiv 0\). This leads to the following equation:

$$\begin{aligned} d \iota _\mathbf {u} \varvec{\star } \tilde{\phi }^{(0)} + d\varvec{\star }d\tilde{\phi }^{(0)} = f^{(2)}. \end{aligned}$$
(11)

This allows defining the outer oriented 1-form \(q^{(1)} = \iota _\mathbf {u} \varvec{\star } {\tilde{\phi }}^{(0)} + \varvec{\star }d\tilde{\phi }^{(0)}\), which can be interpreted as the total flux of the potential, i.e. the sum of convective and diffusive fluxes. A solution to the problem in (1), can then be obtained by solving a conservation equation and a constitutive relation:

$$\begin{aligned} \nabla \cdot (\mathbf {u} \phi ) + \varDelta \phi = f \Leftrightarrow {\left\{ \begin{array}{ll} d q^{(1)} = f^{(2)} \\ q^{(1)} = \iota _\mathbf {u} \varvec{\star }\tilde{\phi }^{(0)} + \varvec{\star }d\tilde{\phi }^{(0)}. \end{array}\right. } \end{aligned}$$
(12)

The conservation equation can be solved exactly, while the approximation is introduced in the constitutive equation. A least-squares functional is established by integrating the squared residual over the domain,

$$\begin{aligned} \mathcal {J} (\tilde{\phi }^{(0)},q^{(1)};f^{(2)}) = \frac{1}{2}\left( \left| \left| d q^{(1)} - f^{(2)} \right| \right| _0^2 + \left| \left| q^{(1)} - \iota _\mathbf {u} \varvec{\star }\tilde{\phi }^{(0)} - \varvec{\star }d\tilde{\phi }^{(0)} \right| \right| _0^2 \right) . \end{aligned}$$

where \(\left| \left| \alpha ^{(k)} \right| \right| _0^2 = ( \alpha ^{(k)}, \alpha ^{(k)})_\varOmega \). The least-squares method is a minimisation problem where the functional \(\mathcal {J}\) is minimised by setting the gradient of \(\mathcal {J}\) to zero, [8]. If we define \({\tilde{\varLambda }}_0^{0}(\varOmega )\) as the space of all inner oriented 0-forms, satisfying the boundary conditions in (2), and \(\varLambda ^{1}(\varOmega )\) as the space of all outer oriented 1-forms, then the variational formulation is obtained as: Find \({\tilde{\phi }}^{(0)} \in {\tilde{\varLambda }}_0^{0}(\varOmega )\) and \(q^{(1)} \in \varLambda ^{1}(\varOmega )\) such that:

$$\begin{aligned} (d p^{(1)},d q^{(1)}- f^{(2)})&= 0 ~~~ \forall \tilde{\varsigma }^{(0)} \in {\tilde{\varLambda }}_0^{0}(\varOmega ) \nonumber \\ (p^{(1)} - \iota _\mathbf {u} \varvec{\star }\tilde{\varsigma }^{(0)} - \varvec{\star }d\tilde{\varsigma }^{(0)} , q^{(1)} - \iota _\mathbf {u} \varvec{\star }\tilde{\phi }^{(0)} - \varvec{\star }d\tilde{\phi }^{(0)} )&= 0 ~~~ \forall p^{(1)} \in \varLambda ^{1}(\varOmega ). \end{aligned}$$
(13)

4 Mimetic Spectral Discretization

The unknowns in the system are expanded using Lagrange polynomials [9] and edge polynomials [5]. Consider the one dimensional domain \(\varOmega _1= [-1,1]\) on which N+1 Gauss-Lobatto-Legendre (GLL) nodes are defined: \(-1 = x_0< \cdot \cdot \cdot < x_N = 1\). Using these nodes we define N+1 Lagrange polynomials \(h_i(x)\), such that \(h_i(x_j) = \delta _{ij}\). The expansion coefficients are then equal to the 0-form evaluated in the nodes: \(a_i = a^{(0)}(x_i)\). The 0-form \( \phi ^{(0)} = \phi (x,y)\) is expanded using Lagrange polynomials in both coordinate directions:

$$\begin{aligned} \phi _h^{(0)} = \sum _{i=0}^{N\text {}} \sum _{j=0}^{N\text {}} \phi _{ij} {h}_i(x) {h}_j(y). \end{aligned}$$
(14)

For 1-forms and 2-forms edge polynomials, presented in [5], are used to construct the approximation of the form. Consider the 1-form \(q^{(1)} = q^x(x,y)dx + q^y(x,y) dy\). Then the approximated form is represented as:

$$\begin{aligned} q^{(1)} \approx q_h^{(1)} = \sum _{i=0}^{N\text {}} \sum _{j=1}^{N\text {}} q^x_{ij} h_i(x) e_j(y) dx + \sum _{i=1}^{N\text {}} \sum _{j=0}^{N\text {}} q^y_{ij}e_i(x) h_j(y) dy \end{aligned}$$
(15)

where \(e_i(x)\) and \(e_j(y)\) are edge polynomials defined from derivative of the Lagrange polynomials. From the N+1 Lagrange polynomials it is possible to define N edge polynomials:

$$\begin{aligned} e_i(x) = -\sum \limits _{j=0}^{i-1}\frac{dh_j(x)}{dx}, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \text {for} ~i=1:N \end{aligned}$$
(16)

which are connected to line segments between the nodes by the following relation: \( \int _{x_{j-1}}^{x_{j}} e_i(x) dx = \delta _{ij}\) for \(i,j=1:N\). For the 2-form \(\rho ^{(2)} = P(x,y) dx \wedge dy\) the approximate form is constructed as:

$$\begin{aligned} \rho ^{(2)} \approx \rho _h^{(2)} = \sum _{i=1}^{N\text {}} \sum _{j=1}^{N\text {}} \rho _{ij} e_i(x) e_j(y). \end{aligned}$$
(17)

5 Numerical Results

Choosing a solution for the convection-diffusion problem as:

$$\begin{aligned} \phi _{sol}(x,y) = (x^2-1)(y^2-1)\sin \left( \frac{1}{2}\pi x\right) , \end{aligned}$$
(18)

and a known divergence free velocity field as \(\mathbf {u} = u^x\frac{\partial }{\partial x} + u^y \frac{\partial }{\partial y}\) where \(u^x = \sin (\pi x)\cos (\pi y)\) and \( u^y = -\sin (\pi y)\cos (\pi x) \) we can calculate the source term.

Fig. 2.
figure 2

Grid shown for \(N = 15\) using mapping. (a) \(c = 0\). (b) \(c=0.1\). (c) \(c=0.2\).

The grid is constructed using the mappings; \( x(\xi ,\eta ) = \xi + c\sin (\pi \xi )\sin (\pi \eta ) \) and \( y(\xi ,\eta ) = \eta + c\sin (\pi \xi )\sin (\pi \eta ) \), where c is a skewness parameter, see Fig. 2. The results are shown in Fig. 3. It is observed that we obtain exponential convergence for the unknown potential (Fig. 3b) as well as for the accuracy of the constitutive equation (Fig. 3c). Both convergence plots show lower accuracy for large skewness of the mesh (the c parameter). In Fig. 3d we plot the invariant, \(q^{(1)}\), as function of the polynomial order and it is solved to machine accuracy.

Fig. 3.
figure 3

(a) The divergence free vector field defined for the convection-diffusion problem in (18). (b) Convergence plot showing the error calculated using the analytical solution for the convection-diffusion problem. (c) Accuracy of the constitutive equation. (d) Conservation of \(q^{(1)}\) shown for increasing polynomial order.

In order to study the method on convection-dominated problems we consider the slightly different problem:

$$\begin{aligned} \nabla \phi +\epsilon \nabla ^2 \phi = f , \end{aligned}$$
(19)

with the solution:

$$\begin{aligned} \phi _{sol}(x,y) = (x^2-1)(y^2-1)\cos \left( x\right) , \end{aligned}$$
Fig. 4.
figure 4

(a) Convergence plot showing the error calculated for the convection-dominated problem in (19). (b) Condition number of the coefficient matrix.

In Fig. 4 we present the results for the second problem. We observe that for small values of \(\epsilon \) it is not possible to obtain an accurate solution for the problem. The condition number has increased to a critical level which causes problems. In [11] a stabilization term is introduced in the form as ’upwinding’ flux for a Least-Squares finite element method. This introduces stabilization, however a slightly modified convection-diffusion equation system is solved. In [7] it is argued that all least-squares methods do not give reasonable results for convection-dominated problems possessing both interior and boundary layer structures in the solution. Solving convection-dominated problems with the least-squares method require further investigation. This introduces stabilization, however a slightly modified convection-diffusion equation system is solved for.

6 Conclusion

In this paper we present a spectral mimetic least-squares method for convection-diffusion problems. We show that by encapsulating the underlying geometric properties in the problem, we are able to discretize the convection-diffusion problem such that the invariant is conserved. The topological part of the problem can be satisfied to machine precision for moderate low values of the diffusion coefficient. However, for highly convection-dominated problems, i.e. for low values of the diffusion coefficient, the condition number of the associated matrix is huge and it is not possible to obtain the correct solution of the matrix system. We have in the present problem used a direct solver, however one of the main features of the Least-Squares method is that we obtain symmetric coefficient matrices and we can therefore use fast iterative solvers such as the preconditioned conjugate gradient method. Stabilization techniques could be one way of solving the problems with high condition numbers.