Namespaces | Classes | Functions
RelativisticEuler::Valencia Namespace Reference

The Valencia formulation of the relativistic Euler System See Chapter 7 of Relativistic Hydrodynamics by Luciano Rezzolla and Olindo Zanotti or http://iopscience.iop.org/article/10.1086/303604. More...

Namespaces

 Tags
 Tags for the Valencia formulation of the relativistic Euler system.
 

Classes

struct  System
 

Functions

template<size_t Dim>
void characteristic_speeds (gsl::not_null< std::array< DataVector, Dim+2 > *> char_speeds, const Scalar< DataVector > &lapse, const tnsr::I< DataVector, Dim > &shift, const tnsr::I< DataVector, Dim > &spatial_velocity, const Scalar< DataVector > &spatial_velocity_squared, const Scalar< DataVector > &sound_speed_squared, const tnsr::i< DataVector, Dim > &normal) noexcept
 Compute the characteristic speeds for the Valencia formulation of the relativistic Euler system. More...
 
template<size_t Dim>
std::array< DataVector, Dim+2 > characteristic_speeds (const Scalar< DataVector > &lapse, const tnsr::I< DataVector, Dim > &shift, const tnsr::I< DataVector, Dim > &spatial_velocity, const Scalar< DataVector > &spatial_velocity_squared, const Scalar< DataVector > &sound_speed_squared, const tnsr::i< DataVector, Dim > &normal) noexcept
 
template<typename DataType , size_t Dim>
void conservative_from_primitive (gsl::not_null< Scalar< DataType > *> tilde_d, gsl::not_null< Scalar< DataType > *> tilde_tau, gsl::not_null< tnsr::i< DataType, Dim, Frame::Inertial > *> tilde_s, const Scalar< DataType > &rest_mass_density, const Scalar< DataType > &specific_internal_energy, const tnsr::i< DataType, Dim, Frame::Inertial > &spatial_velocity_oneform, const Scalar< DataType > &spatial_velocity_squared, const Scalar< DataType > &lorentz_factor, const Scalar< DataType > &specific_enthalpy, const Scalar< DataType > &pressure, const Scalar< DataType > &sqrt_det_spatial_metric) noexcept
 Compute the conservative variables from primitive variables. More...
 
template<size_t Dim>
void compute_source_terms_of_u (gsl::not_null< Scalar< DataVector > *> source_tilde_d, gsl::not_null< Scalar< DataVector > *> source_tilde_tau, gsl::not_null< tnsr::i< DataVector, Dim, Frame::Inertial > *> source_tilde_s, const Scalar< DataVector > &tilde_d, const Scalar< DataVector > &tilde_tau, const tnsr::i< DataVector, Dim, Frame::Inertial > &tilde_s, const tnsr::I< DataVector, Dim, Frame::Inertial > &spatial_velocity, const Scalar< DataVector > &pressure, const Scalar< DataVector > &lapse, const tnsr::i< DataVector, Dim, Frame::Inertial > &d_lapse, const tnsr::iJ< DataVector, Dim, Frame::Inertial > &d_shift, const tnsr::ijj< DataVector, Dim, Frame::Inertial > &d_spatial_metric, const tnsr::II< DataVector, Dim, Frame::Inertial > &inv_spatial_metric, const Scalar< DataVector > &sqrt_det_spatial_metric, const tnsr::ii< DataVector, Dim, Frame::Inertial > &extrinsic_curvature) noexcept
 Compute the source terms for the flux-conservative Valencia formulation of the relativistic Euler system. More...
 
template<size_t Dim>
void fluxes (gsl::not_null< tnsr::I< DataVector, Dim, Frame::Inertial > *> tilde_d_flux, gsl::not_null< tnsr::I< DataVector, Dim, Frame::Inertial > *> tilde_tau_flux, gsl::not_null< tnsr::Ij< DataVector, Dim, Frame::Inertial > *> tilde_s_flux, const Scalar< DataVector > &tilde_d, const Scalar< DataVector > &tilde_tau, const tnsr::i< DataVector, Dim, Frame::Inertial > &tilde_s, const Scalar< DataVector > &lapse, const tnsr::I< DataVector, Dim, Frame::Inertial > &shift, const Scalar< DataVector > &sqrt_det_spatial_metric, const Scalar< DataVector > &pressure, const tnsr::I< DataVector, Dim, Frame::Inertial > &spatial_velocity) noexcept
 The fluxes of the conservative variables. More...
 
template<size_t ThermodynamicDim, typename DataType , size_t Dim>
void primitive_from_conservative (gsl::not_null< Scalar< DataType > *> rest_mass_density, gsl::not_null< Scalar< DataType > *> specific_internal_energy, gsl::not_null< Scalar< DataType > *> lorentz_factor, gsl::not_null< Scalar< DataType > *> specific_enthalpy, gsl::not_null< Scalar< DataType > *> pressure, gsl::not_null< tnsr::I< DataType, Dim, Frame::Inertial > *> spatial_velocity, const Scalar< DataType > &tilde_d, const Scalar< DataType > &tilde_tau, const tnsr::i< DataType, Dim, Frame::Inertial > &tilde_s, const tnsr::II< DataType, Dim, Frame::Inertial > &inv_spatial_metric, const Scalar< DataType > &sqrt_det_spatial_metric, const EquationsOfState::EquationOfState< true, ThermodynamicDim > &equation_of_state) noexcept
 Compute the primitive variables from the conservative variables. More...
 

Detailed Description

The Valencia formulation of the relativistic Euler System See Chapter 7 of Relativistic Hydrodynamics by Luciano Rezzolla and Olindo Zanotti or http://iopscience.iop.org/article/10.1086/303604.

Function Documentation

◆ characteristic_speeds()

template<size_t Dim>
void RelativisticEuler::Valencia::characteristic_speeds ( gsl::not_null< std::array< DataVector, Dim+2 > *>  char_speeds,
const Scalar< DataVector > &  lapse,
const tnsr::I< DataVector, Dim > &  shift,
const tnsr::I< DataVector, Dim > &  spatial_velocity,
const Scalar< DataVector > &  spatial_velocity_squared,
const Scalar< DataVector > &  sound_speed_squared,
const tnsr::i< DataVector, Dim > &  normal 
)
noexcept

Compute the characteristic speeds for the Valencia formulation of the relativistic Euler system.

The principal symbol of the system is diagonalized so that the elements of the diagonal matrix are the \((\text{Dim} + 2)\) characteristic speeds

\begin{align*} \lambda_1 &= \alpha \Lambda^- - \beta_n,\\ \lambda_{i + 1} &= \alpha v_n - \beta_n,\quad i = 1,...,\text{Dim}\\ \lambda_{\text{Dim} + 2} &= \alpha \Lambda^+ - \beta_n, \end{align*}

where \(\alpha\) is the lapse, \(\beta_n = n_i \beta^i\) and \(v_n = n_i v^i\) are the projections of the shift \(\beta^i\) and the spatial velocity \(v^i\) onto the normal one-form \(n_i\), respectively, and

\begin{align*} \Lambda^{\pm} &= \dfrac{1}{1 - v^2 c_s^2}\left[ v_n (1- c_s^2) \pm c_s\sqrt{\left(1 - v^2\right)\left[1 - v^2 c_s^2 - v_n^2(1 - c_s^2)\right]} \right], \end{align*}

where \(v^2 = \gamma_{ij}v^iv^j\) is the magnitude squared of the spatial velocity, and \(c_s\) is the sound speed.

◆ compute_source_terms_of_u()

template<size_t Dim>
void RelativisticEuler::Valencia::compute_source_terms_of_u ( gsl::not_null< Scalar< DataVector > *>  source_tilde_d,
gsl::not_null< Scalar< DataVector > *>  source_tilde_tau,
gsl::not_null< tnsr::i< DataVector, Dim, Frame::Inertial > *>  source_tilde_s,
const Scalar< DataVector > &  tilde_d,
const Scalar< DataVector > &  tilde_tau,
const tnsr::i< DataVector, Dim, Frame::Inertial > &  tilde_s,
const tnsr::I< DataVector, Dim, Frame::Inertial > &  spatial_velocity,
const Scalar< DataVector > &  pressure,
const Scalar< DataVector > &  lapse,
const tnsr::i< DataVector, Dim, Frame::Inertial > &  d_lapse,
const tnsr::iJ< DataVector, Dim, Frame::Inertial > &  d_shift,
const tnsr::ijj< DataVector, Dim, Frame::Inertial > &  d_spatial_metric,
const tnsr::II< DataVector, Dim, Frame::Inertial > &  inv_spatial_metric,
const Scalar< DataVector > &  sqrt_det_spatial_metric,
const tnsr::ii< DataVector, Dim, Frame::Inertial > &  extrinsic_curvature 
)
noexcept

Compute the source terms for the flux-conservative Valencia formulation of the relativistic Euler system.

A flux-conservative system has the generic form:

\[ \partial_t U_i + \partial_m F^m(U_i) = S(U_i) \]

where \(F^a()\) denotes the flux of a conserved variable \(U_i\) and \(S()\) denotes the source term for the conserved variable.

For the Valencia formulation:

\begin{align*} S({\tilde D}) = & 0\\ S({\tilde S}_i) = & \frac{1}{2} \alpha {\tilde S}^{mn} \partial_i \gamma_{mn} + {\tilde S}_m \partial_i \beta^m - ({\tilde D} + {\tilde \tau}) \partial_i \alpha \\ S({\tilde \tau}) = & \alpha {\tilde S}^{mn} K_{mn} - {\tilde S}^m \partial_m \alpha \end{align*}

where

\begin{align*} {\tilde S}^i = & {\tilde S}_m \gamma^{im} \\ {\tilde S}^{ij} = & {\tilde S}^i v^j + \sqrt{\gamma} p \gamma^{ij} \end{align*}

where \({\tilde D}\), \({\tilde S}_i\), and \({\tilde \tau}\) are a generalized mass-energy density, momentum density, and specific internal energy density as measured by an Eulerian observer, \(\gamma\) is the determinant of the spatial metric \(\gamma_{ij}\), \(\rho\) is the rest mass density, \(W\) is the Lorentz factor, \(h\) is the specific enthalpy, \(v^i\) is the spatial velocity, \(p\) is the pressure, \(\alpha\) is the lapse, \(\beta^i\) is the shift, and \(K_{ij}\) is the extrinsic curvature.

◆ conservative_from_primitive()

template<typename DataType , size_t Dim>
void RelativisticEuler::Valencia::conservative_from_primitive ( gsl::not_null< Scalar< DataType > *>  tilde_d,
gsl::not_null< Scalar< DataType > *>  tilde_tau,
gsl::not_null< tnsr::i< DataType, Dim, Frame::Inertial > *>  tilde_s,
const Scalar< DataType > &  rest_mass_density,
const Scalar< DataType > &  specific_internal_energy,
const tnsr::i< DataType, Dim, Frame::Inertial > &  spatial_velocity_oneform,
const Scalar< DataType > &  spatial_velocity_squared,
const Scalar< DataType > &  lorentz_factor,
const Scalar< DataType > &  specific_enthalpy,
const Scalar< DataType > &  pressure,
const Scalar< DataType > &  sqrt_det_spatial_metric 
)
noexcept

Compute the conservative variables from primitive variables.

\begin{align*} {\tilde D} = & \sqrt{\gamma} \rho W \\ {\tilde S}_i = & \sqrt{\gamma} \rho h W^2 v_i \\ {\tilde \tau} = & \sqrt{\gamma} \left( \rho h W^2 - p - \rho W \right) \end{align*}

where \({\tilde D}\), \({\tilde S}_i\), and \({\tilde \tau}\) are a generalized mass-energy density, momentum density, and specific internal energy density as measured by an Eulerian observer, \(\gamma\) is the determinant of the spatial metric, \(\rho\) is the rest mass density, \(W = 1/\sqrt{1-v_i v^i}\) is the Lorentz factor, \(h = 1 + \epsilon + \frac{p}{\rho}\) is the specific enthalpy, \(v_i\) is the spatial velocity, \(\epsilon\) is the specific internal energy, and \(p\) is the pressure.

Using the definitions of the Lorentz factor and the specific enthalpy, the last equation can be rewritten in a form that has a well-behaved Newtonian limit:

\[ {\tilde \tau} = \sqrt{\gamma} W^2 \left[ \rho \left( \epsilon + v^2 \frac{W}{W + 1} \right) + p v^2 \right] .\]

◆ fluxes()

template<size_t Dim>
void RelativisticEuler::Valencia::fluxes ( gsl::not_null< tnsr::I< DataVector, Dim, Frame::Inertial > *>  tilde_d_flux,
gsl::not_null< tnsr::I< DataVector, Dim, Frame::Inertial > *>  tilde_tau_flux,
gsl::not_null< tnsr::Ij< DataVector, Dim, Frame::Inertial > *>  tilde_s_flux,
const Scalar< DataVector > &  tilde_d,
const Scalar< DataVector > &  tilde_tau,
const tnsr::i< DataVector, Dim, Frame::Inertial > &  tilde_s,
const Scalar< DataVector > &  lapse,
const tnsr::I< DataVector, Dim, Frame::Inertial > &  shift,
const Scalar< DataVector > &  sqrt_det_spatial_metric,
const Scalar< DataVector > &  pressure,
const tnsr::I< DataVector, Dim, Frame::Inertial > &  spatial_velocity 
)
noexcept

The fluxes of the conservative variables.

\begin{align*} F^i({\tilde D}) = &~ {\tilde D} v^i_{tr} \\ F^i({\tilde S}_j) = &~ {\tilde S}_j v^i_{tr} + \sqrt{\gamma} \alpha p \delta^i_j \\ F^i({\tilde \tau}) = &~ {\tilde \tau} v^i_{tr} + \sqrt{\gamma} \alpha p v^i \end{align*}

where the conservative variables \({\tilde D}\), \({\tilde S}_i\), and \({\tilde \tau}\) are a generalized mass-energy density, momentum density, and specific internal energy density as measured by an Eulerian observer, \(v^i_{tr} = \alpha v^i - \beta^i\) is the transport velocity, \(\alpha\) is the lapse, \(\beta^i\) is the shift, \(v^i\) is the spatial velocity, \(\gamma\) is the determinant of the spatial metric, and \(p\) is the pressure.

◆ primitive_from_conservative()

template<size_t ThermodynamicDim, typename DataType , size_t Dim>
void RelativisticEuler::Valencia::primitive_from_conservative ( gsl::not_null< Scalar< DataType > *>  rest_mass_density,
gsl::not_null< Scalar< DataType > *>  specific_internal_energy,
gsl::not_null< Scalar< DataType > *>  lorentz_factor,
gsl::not_null< Scalar< DataType > *>  specific_enthalpy,
gsl::not_null< Scalar< DataType > *>  pressure,
gsl::not_null< tnsr::I< DataType, Dim, Frame::Inertial > *>  spatial_velocity,
const Scalar< DataType > &  tilde_d,
const Scalar< DataType > &  tilde_tau,
const tnsr::i< DataType, Dim, Frame::Inertial > &  tilde_s,
const tnsr::II< DataType, Dim, Frame::Inertial > &  inv_spatial_metric,
const Scalar< DataType > &  sqrt_det_spatial_metric,
const EquationsOfState::EquationOfState< true, ThermodynamicDim > &  equation_of_state 
)
noexcept

Compute the primitive variables from the conservative variables.

For the Valencia formulation of the Relativistic Euler system, the conversion of the evolved conserved variables to the primitive variables cannot be expressed in closed analytic form and requires a root find. We use the method from Appendix C of Galeazzi et al, PRD 88, 064009 (2013). The method finds the root of

\[ f(z) = z - \frac{r}{h(z)} \]

where

\begin{align*} r = & \frac{\sqrt{\gamma^{mn} {\tilde S}_m {\tilde S}_n}}{\tilde D} \\ h(z) = & [1+ \epsilon(z)][1 + a(z)] \\ \epsilon(z) = & W(z) q - z r + \frac{z^2}{1 + W(z)} \\ W(z) = & \sqrt{1 + z^2} \\ q = & \frac{\tilde \tau}{\tilde D} \\ a(z) = & \frac{p}{\rho(z) [1 + \epsilon(z)]} \\ \rho(z) = & \frac{\tilde D}{\sqrt{\gamma} W(z)} \end{align*}

and where the conserved variables \({\tilde D}\), \({\tilde S}_i\), and \({\tilde \tau}\) are a generalized mass-energy density, momentum density, and specific internal energy density as measured by an Eulerian observer, \(\gamma\) and \(\gamma^{mn}\) are the determinant and inverse of the spatial metric \(\gamma_{mn}\), \(\rho\) is the rest mass density, \(W = 1/\sqrt{1 - \gamma_{mn} v^m v^n}\) is the Lorentz factor, \(h = 1 + \epsilon + \frac{p}{\rho}\) is the specific enthalpy, \(v^i\) is the spatial velocity, \(\epsilon\) is the specific internal energy, and \(p\) is the pressure. The pressure is determined from the equation of state. Finally, once \(z\) is found, the spatial velocity is given by

\[ v^i = \frac{{\tilde S}^i}{{\tilde D} W(z) h(z)} \]