Accuracy of Mesh Representation in Nektar++¶
Nektar++ supports supplying information on the curvature of edges (line segments) and faces (triangles and quads). This is done by specifying the coordinates of the edge/face in real space at a number of control points. A polynomial is then used to map between coordinates in reference-space and real-space on that geometry. The order of this polynomial is determined by the number of control points used and can be arbitrarily large.
Typically curved faces are only used when they are embedded in a 3D space. If one were defining a 2D grid existing only in a 2D space then one might make the edge of the 2D elements curved, but generally would not bother to describe the curvature for the interior of the face.
2D Case¶
Consider the quad elements in the diagram above. For the upper-left element (with straight sides), it is possible to map between reference coordinates \(\xi_1, \xi_2\) and real coordinates \(x_1, x2\) using bilinear interpolation:
When the edges are curved (as is the case for the upper-right element), this expansion can be modified by the incorporation of that curvature information:
where
The functions \(\vec{f}\) are polynomials in the reference coordinates, meaning that the \(\vec{g}\) functions are as well. This expression consists of the sum of the vertex and edge modes of the polynomial expansion of the element. Effectively, the face modes have been assumed to have coefficients of 0. A similar technique can be used for representing triangles, but extra care must be taken due to the collapsed-coordinates which are used.
This approach provides a perfectly adequate means of mapping between coordinates in reference space and real space such that the boundary of the element will have the desired curvature. However, by setting the coefficients of face nodes to 0 it imposes certain assumptions about how the mapping should behave in the element interior.
When using finite difference methods in plasma physics it has been found that good numerical results can only be achieved by using “flux-coordinate independent” techniques. Effectively what this means is that the coordinate system must be aligned with magnetic field lines. This does not appear to be vital when using high-p finite element methods, but there is some evidence that aligning elements with the magnetic field can improve performance.
Consider Cartesian coordinates \(\vec{x} = [x_1, x_2]\) in real-space. If there is a magnetic field with unit vector \(\hat{b}(\vec{x}) = [b_1, b_2]\) (with components expressed in real-space) then the following relationship between real and reference coordinates will ensure the elements are field-aligned:
where \(\alpha_1, \alpha_2\) are constants of proportionality, determining the overall size of the elements. Given expressions for \(\vec{x}(0, \xi_2)\) and \(\hat{b}\) it would be possible to compute the mapping between real and reference space, \(\vec{x}_{\rm fa}(\xi_1,\xi_2)\), albeit it only a numerical solution may be available..
Equation (1) will represent this coordinate mapping to the desired order of accuracy if the polynomial projection of \(\vec{x}_{\rm fa}\) has coefficients of 0 for all face modes. This can only be the case if
Examining the form of the terms in Equation (1), it can be seen that \(\frac{\partial^4 \vec{x}_{\rm curve}}{\partial \xi_1^2\xi_2^2} = 0\), as do all higher derivatives. Therefore, if \(\frac{\partial^4 \vec{x}_{\rm fa}}{\partial \xi_1^2\xi_2^2} \ne 0\) then it can not be represented to the desired order of accuracy by Equation (1).
In a 3D tokamak simulation it is usually assumed that the magnetic field is uniform in the toroidal direction. Take that to correspodn to the \(x_1\) direction. Differentiating Equation (2) gives
Although \(\partial x_2/\partial \xi_2\) is unknown, it must be non-zero if the coordinate transform is not degenerate. Therefore, in general, these derivatives will be non-zero and equation (1) only provides the desired order of accuracy for the special case with a uniform magnetic field.
A similar technique can be used to derive a more complicated expression when \(\hat{b}(x_1, x_2)\). Once again, in general it will be non-zero.
3D Case¶
The 3D case follows essentially the same logic as the 2D case. It can be shown that the mapping between real and reference space used by Nektar++ will only provide the desired order of accuracy if