So far we have only considered the left-hand side of equation (4.5). The right-hand side of the equations are known as source terms, and often arise as the result of chemical reactions. In GRHD, they arise from geometry due to the fact that we are evolving on a non-flat three dimensional hypersurface embedded in a four-dimensional manifold.
We evolve the source terms using one of the following methods:
• Euler method
un+1i =uni + ∆t·S(uni) (4.34)
• Runge-Kutta 2nd order (RK2)
un+
1 2
i =uni +∆t
2 ·S(uni) un+1i =uni + ∆t·S³
un+
1 2
i
´ (4.35)
• Runge-Kutta 4th order (RK4)
k1=S(uin) k2=S¡
uni +∆t2 k1¢ k3=S¡
uni +∆t2 k2¢ k4=S(uni + ∆tk3)
un+1i =uni +∆t6 (k1+ 2k2+ 2k3+k4).
(4.36)
The Euler method is first-order accurate, the RK2 scheme is second-order accurate, and the RK4 scheme is fourth-order accurate. However, in order to retain second-order accurate evolution overall, when combined with the evolution of the flux terms, we need to take care.
The need for this arises from the fact that if we approximate the evolution over one time-step as the evolution of two separate PDEs:
∂u
∂t +∂fi
∂xi =0, and ∂u
∂t =S(u), (4.37)
and combine them as
E(∆t) =S(∆t)T(∆t), (4.38)
where S evolves the source terms and T evolves the flux terms, and they are applied individually, from right to left, then the full evolution operatorE is then only first-order in time. However, if we use the Strang splitting
E(∆t) =S¡1
2∆t¢
T(∆t)S¡1
2∆t¢
, (4.39)
then E is second order in time if both T and S are. We could split the T operator instead of the S operator, but we generally need to evolve T by a full timestep to attain as much accuracy as possible and, in any case,T tends to be by far the more computationally expensive operator.
4.4.1 Combining the source evolution with the flux
A disadvantage of the above approach is that it may not be entirely consistent. The operatorsS and T have been constructed on the assumption that they will act on an exact solution of the system. If we consider the hypersurface of exact solutions of the system, we wish the numerical evolution to keep us on or close to this manifold, and we know that evolving the full system of equations exactly would do this. However, applying the operatorsSandT individually does not necessarily keep us on the manifold.
In particular, applying a half-step of operatorS and then a full step of operatorT would not appear to leave us in a suitable position to apply operatorSagain. It would appear to be preferable to applyS to the result of a half-step ofS and a half-step ofT which, while it is not likely to leave us exactly on the
solution hypersurface, is at least similar to evolving the system for time ∆t/2, for which we might expect to remain close to the hypersurface, and hence that applyingS might be valid.
The approach that we have developed, therefore, is as follows, beginning with stateun: 1. Apply the source term operator using RK4 for time ∆t/2 to obtain stateun+12S
2. Calculate the fluxes for time ∆tfor the stateun+12S, and add a half of them to that state to obtain stateun+12 (Note that this will not, in general, give the same fluxes as finding the fluxes for time
∆t/2, but since the fluxes are the most computationally expensive part of the algorithm, we try not to have to calculate them any more than necessary.)
3. Calculate the sources for time ∆t/2 for stateun+12 using RK4.
4. Add the full fluxes (i.e. for time ∆t) from step (2) and the sources from step (3) toun+12S to obtain the final stateun+1.
The way in which this differs from the usual Strang splitting is the way in which only half the fluxes are added before calculating the second set of sources.
4.4.2 Simpson’s Rule correction
Another improvement that can be made is to remember that, although we often calculate the source term as a point value, it is in fact an integral over the whole cell. We can therefore improve the accuracy of the source term by applying Simpson’s Rule, which is that [88]
Z x+1 2 ∆x x−1
2 ∆x
f(x) dx≈1
6∆x(f(x−12∆x) + 4f(x) +f(x+12∆x) ) + 1
2880(∆x)4hf(4)i, wherehf(4)iis an average off(4) over [x−12∆x, x+12∆x]
(4.40)
for a smooth functionf in one dimension, and is easily extended to multi-dimensions by multiple appli- cations of the one-dimensional case.
We can include the effects of the Jacobian for non-uniform grids (see§4.6 for an explanation of terms used), multiplying each source term by the Jacobians averaged in the same way as the evolution variables, before dividing by the correct combination of Jacobians. In the one-dimensional case, for example, we take
Si= Ji−12S³ ui−1
2
´+ 4JiS(ui) +Ji+12S³ ui+1
2
´ Ji−1
2 + 4Ji+Ji+1
2
. (4.41)
Usually, the values ofui−1/2for the cell faces are approximated by taking the simple average12(ui−1+ui).
4.4.3 Flux-Source balancing
Yet another improvement that can be made, at least in one dimension, is to attempt some form of flux-source balancing. A problem often arises when a solution close to a steady state is sought, but where the fluxes and sources are relatively large as compared to the perturbation from steady state. As the fluxes and sources are not calculated in the same manner as each other, the terms do not cancel exactly, and the loss of cancellation can swamp the effect sought. Much work has been done on certain sets of equations, particularly the shallow water equations [60], deriving numerical methods that allow the terms to cancel to round-off error.
For GRHD, such an analysis would take a large amount of work due to the highly non-linear nature of the problem. However, if we have a static solutionu(x) of the equation
∂u(x)
∂t +∂f(u(x))
∂x =s(u(x)), (4.42)
then (writingf(x) forf(u(x)) ands(x) fors(u(x)) as a convenient shorthand):
1
∆x(f(x+12∆x)−f(x−12∆x))
= 1
∆x
¡(f(x) +12∆xf′(x) +18∆x2f′′(x) +481 ∆x3f′′′(x))
−(f(x)−12f′(x) +18∆x2f′′(x)−481 f′′′(x)) +O(∆x4)¢
=f′(x) +241 ∆x2f′′′(x) +O(∆x3)
=s(x) +241 ∆x2s′′(x) +O(∆x3), assuminguto be an exact solution
=s(x) +16(s(x+12∆x) +s(x−12∆x)−2s(x)) +O(∆x3).
(4.43)
Unfortunately, it is not possible to extend this approach to more than one dimension, as the resulting mixed derivatives of the fluxes cannot be simplified by assuming the solution to be exact.