A cosmological constant is implemented in the 3 + 1 framework simply by introducing the quantity as an effective isotropic pressure in the stress-energy tensor
The dynamics of scalar fields is governed by the Lagrangian density
For a massive, minimally coupled scalar field , to yield
The stress-energy tensor for a fluid composed of collisionless particles (or dark matter) can be written simply as the sum of the stress-energy tensors for each particle ,
The stress-energy tensor for a perfect fluid is Update
When solving Equations (45, 46, 47), an artificial viscosity (AV) method is needed to handle the formation and propagation of shock fronts [162, 84, 85]. These methods are computationally cheap, easy to implement, and easily adaptable to multi-physics applications. However, it has been demonstrated that problems involving very high Lorentz factors are somewhat sensitive to different implementations of the viscosity terms, and can result in substantial numerical errors if solved using time explicit methods .
On the other hand, a number of different formulations  of these equations have been developed to take advantage of the hyperbolic and conservative nature of the equations in using high resolution and non-oscillatory shock capturing schemes (although strict conservation is only possible in flat spacetimes – curved spacetimes exhibit source terms due to geometry). These techniques potentially provide more accurate and stable treatments in highly relativistic regimes. A particular formulation used together with high resolution Godunov techniques and approximate Riemann solvers is the following [139, 26]:Update
Although Godunov-type schemes are accepted as more accurate alternatives to AV methods, especially in the limit of high Lorentz factors, they are not immune to problems and should generally be used with caution. They may produce unexpected results in certain cases that can be overcome only with problem-specific fixes or by adding additional dissipation. A few known examples include the admittance of expansion shocks, negative internal energies in kinematically dominated flows, the ‘carbuncle’ effect in high Mach number bow shocks, kinked Mach stems, and odd/even decoupling in mesh-aligned shocks . Godunov methods, whether they solve the Riemann problem exactly or approximately, are also computationally much more expensive than their simpler AV counterparts, and it is more difficult to incorporate additional physics.
A third class of computational fluid dynamics methods reviewed here is also based on a conservative hyperbolic formulation of the hydrodynamics equations. However, in this case the equations are derived directly from the conservation of stress-energy,[99, 100] has been applied by Anninos and Fragile  to solve the relativistic hydrodynamics equations in the above form. These schemes combine the speed, efficiency, and flexibility of AV methods with the advantages of the potentially more accurate conservative formulation approach of Godunov methods, but without the cost and complication of Riemann solvers and flux splitting.
NOCD and artificial viscosity methods have been discussed at length in  and compared also with other published Godunov methods on their abilities to model shock tube, wall shock and black hole accretion problems. They find that for shock tube problems at moderate to high boost factors, with velocities up to , internal energy formulations using artificial viscosity methods compare quite favorably with total energy schemes, including NOCD methods and Godunov methods using either approximate or exact Riemann solvers. However, AV methods can be somewhat sensitive to parameters (e.g., viscosity coefficients, Courant factor, etc.) and generally suspect in wall shock problems at high boost factors (). On the other hand, NOCD methods can easily be extended to ultra-relativistic velocities () for the same wall shock tests, and are comparable in accuracy to the more standard but complicated Riemann solver codes. NOCD schemes thus provide a reasonable alternative for relativistic hydrodynamics, though it should be noted that low order versions of these methods can be significantly more diffusive than either the AV or Godunov methods.
The perfect fluid equations discussed in Section 6.2.4 can be generalized to include viscous stress in the stress-energy tensor,
The corresponding energy and momentum conservation equations for the internal energy formulation of Section 6.2.4 become
© Max Planck Society and the author(s)