If we wish to evolve PDEs in coordinate systems other than Cartesian, we have two choices. We can either transform the PDEs themselves, i.e. transform (3.4)-(3.5) or (3.39)-(3.44) and the correspond- ing variables from Cartesian coordinates into general coordinates, or we can transform the Cartesian fluxes into the general coordinate system, while leaving the variables defined everywhere in Cartesian coordinates.
Since we need to interpolate between grids with different coordinate systems, and Overture performs the interpolation itself, without doing any coordinate transformations, it is easiest to have all the variables in Cartesian coordinates. We write Cartesian coordinates asxi and the coordinate system of the grid as ri. We assume that there exists a smooth mapping between these, and that the coordinate system of the grid is rectangular, which is the case in Overture. This means that we transform the flux equations as follows
∂u
∂t +∂fi(u)
∂xi =0 7→ ∂Ju
∂t + ∂
∂ri µ
J∂ri
∂xjfj(u)
¶
=0, (4.47)
whereJ is the Jacobian of the transformation:
J =
¯
¯
¯
¯
·∂xi
∂rj
¸¯
¯
¯
¯
, (4.48)
although an extra term needs to be added when discretising this, as shown in§4.6.3.
The standard finite-volume methods can then be applied to the transformed equations. However, we have to look carefully at the transformed equations, and consider how they behave if, for example, we attempt to evolve a static fluid on a curvilinear background, where we would hope to keep the fluid static, regardless of the grid.
The slope-limiting step (4.14) will potentially limit the piecewise linear solution, where the cell volume is the only non-constant quantity. Further, since the quantitiesun+
1 2
i,L , un+
1 2
i,R are meant to be evaluated at the cell faces, rather than the cell centres, we have to make a further adjustment. We replace (4.13)-(4.18) by
∆−i =Ji· µuni
Ji −uni−1 Ji−1
¶
, ∆+i =Ji· µuni+1
Ji+1 −uni Ji
¶
, ∆i= 1 2
¡∆−i +∆+i ¢ , uni,L= Ji−12
Ji
µ uni −1
2∆i
¶
, uni,R= Ji+12 Ji
µ uni +1
2∆i
¶ , un+
1 2
i,L =uni,L+ ∆t 2∆x
Ã
f(uni,L)−Ji−12 Ji+1
2
f(uni,R)
! ,
un+
1 2
i,R =uni,R+ ∆t 2∆x
ÃJi+12 Ji−1
2
f(uni,L)−f(uni,R)
! ,
(4.49)
where Ji is the Jacobian of cell i, and Ji+12 = 12(Ji+Ji+1). We also take care to evaluate the fluxes, which require J and ∂ri/∂xj for their calculation, at the correct part of the cell, be it cell-centre or cell-face. We use a simple average of cell-centred Jacobians to find the Jacobian as required on cell- faces. The derivatives∂ri/∂xj, however, are averaged differently since, in one dimension, we know that J−1=∂r/∂x, and so we want to ensure that
J|i+1
2
∂rj
∂xj
¯
¯
¯
¯i+1 2
= 1 ∀j , (4.50)
where there is no sum overj.
One way to ensure that this is always true is to average the derivatives of the inverse coordinate mapping using the harmonic mean
Di+1 2
= 2
Di−1+D−i+11 , (4.51)
where
Di=
·∂rl
∂xm
¸¯
¯
¯
¯x=xi
. (4.52)
Even in the case of multi-dimensions, we never need to calculate the fluxes across more than one cell-face at a time, so the above averaging is only ever done in one computational grid direction at a time.
4.6.1 HLL scheme
In order to calculate the HLL flux in curvi-linear coordinates, we first transform the Cartesian compo- nents into the local grid coordinate basis. The wave speeds are then calculated for the required coordinate direction from the transformed variables. As for SLIC, we calculate the fluxes in the local grid coordinate direction, multiplied by the local Jacobian. In order to achieve second order convergence, we adjust the HLL flux to read:
fHLLi+1
2 =
f(ui) if 0< aL,
aRJi+1
2f(ui)−aLJi+1
2f(ui+1) +aLaR(Ji+1
2ui+1−Ji+1
2ui) aR−aL
ifaL<0< aR,
f(ui+1) ifaR<0,
(4.53)
where the fluxes are calculated parallel to the local grid coordinatei. We note that the local CFL number required for the calculation of GFORCE is also derived from the wave speeds calculated along the local grid coordinate directions.
4.6.2 Determination of time step
On Cartesian grids, the maximum time-step that retains stability is given by equation (4.8). On curvi-linear grids, we determine the time-step on a cell-by-cell basis, where the cell size is matched to the data in that cell. The alternative, taking the minimum cell size and the maximum wave speed over the whole grid, can lead to time steps that are more restrictive than necessary. Further, when we wish to calculate the wave-speeds, we in fact transform the numerical solution into the local grid basis so that the exact wave speeds along the coordinate directions can be found, as these may not be aligned with Cartesian directions, which could lead to an underestimate of the local wavespeed.
However, a drawback of using curvi-linear grids is that the cells are not of similar size everywhere.
Even with the above method of calculating the time-step, this still leads to an effectively lower CFL number for evolution on larger grid cells, as the time-step has been restricted by the stability condition
on smaller grid cells. Therefore a shock can become somewhat smeared on a coarser area of the grid only because of finer resolution elsewhere.
We reduce the effect of this problem by using as accurate a scheme as possible, namely GFORCE or HLL, and also by using AMR (see§4.9) appropriately.
4.6.3 Free-streaming correction
The obvious way to discretise the transformed fluxes is given in (4.47) as this leaves the new system of equations in the same form as the Cartesian form, and is therefore easy to implement in a pre-existing code. Although valid in the continuous case, (4.47) is not valid when discretised since
∂Ju
∂t +J ∂fi(u)
∂xi =0
⇒ ∂Ju
∂t +J ∂rj
∂xi
∂fi(u)
∂rj =0
⇒ ∂Ju
∂t + ∂
∂ri µ
J∂ri
∂xjfj(u)
¶
− ∂
∂ri µ
J∂ri
∂xj
¶
fj(u) =0.
(4.54)
The additional term as compared to (4.47) is analytically zero for a continuous mapping. However, it will not necessarily be so when discretised, and therefore needs to be considered when implementing a numerical algorithm, since we wish to maintain exact conservation on a discrete grid.
This extra term is composed of an evaluation of f on a cell-centred value of u, multiplied by a geometric term. This geometric term must be calculated in a certain way, dependent on the precise numerical method used, so that, for a constant stateu, the geometric terms will cancel exactly (at least up to round-off error).
The process of determining the appropriate term is fairly straightforward in practice. If we start with a fluid with constant density, velocity, and pressure (on the Minkowski metric for the time being), then it is possible to work through the SLIC algorithm by hand, ensuring that the statesunk,∗ andun+
1 2
k,∗
are again this constant state, regardless of the geometry or the slope-limiter used. This is what has been done in order to construct the form of (4.49). The outcome is that the flux for each cell face is composed of the product of a flux, derived from the given constant state, and a geometry term of the formJk+1/2 ∂ri
∂xj
¯
¯
¯k+1/2. Since the final flux for a given coordinate directionriis then simply a difference of these, the term that cancels these is
à Jk+1
2
∂ri
∂xj
¯
¯
¯
¯k+1 2
−J
k−1 2
∂ri
∂xj
¯
¯
¯
¯k
−1 2
!
F(uk), (4.55)
where the values of the Jacobian and coordinate derivatives have to be calculated in exactly the same way as in the main SLIC algorithm.
This simple additional term improves evolutions on curvi-linear grids greatly, keeping a constant state
fluid static up to round-off error (of the order of 10−17for double precision) on even the most distorted grids.