SpECTRE  v2024.03.19
grmhd::ValenciaDivClean::ConservativeFromPrimitive Struct Reference

Compute the conservative variables from primitive variables. More...

#include <ConservativeFromPrimitive.hpp>

Public Types

using return_tags = tmpl::list< grmhd::ValenciaDivClean::Tags::TildeD, grmhd::ValenciaDivClean::Tags::TildeYe, grmhd::ValenciaDivClean::Tags::TildeTau, grmhd::ValenciaDivClean::Tags::TildeS<>, grmhd::ValenciaDivClean::Tags::TildeB<>, grmhd::ValenciaDivClean::Tags::TildePhi >
 
using argument_tags = tmpl::list< hydro::Tags::RestMassDensity< DataVector >, hydro::Tags::ElectronFraction< DataVector >, hydro::Tags::SpecificInternalEnergy< DataVector >, hydro::Tags::Pressure< DataVector >, hydro::Tags::SpatialVelocity< DataVector, 3 >, hydro::Tags::LorentzFactor< DataVector >, hydro::Tags::MagneticField< DataVector, 3 >, gr::Tags::SqrtDetSpatialMetric< DataVector >, gr::Tags::SpatialMetric< DataVector, 3 >, hydro::Tags::DivergenceCleaningField< DataVector > >
 

Static Public Member Functions

static void apply (gsl::not_null< Scalar< DataVector > * > tilde_d, gsl::not_null< Scalar< DataVector > * > tilde_ye, gsl::not_null< Scalar< DataVector > * > tilde_tau, gsl::not_null< tnsr::i< DataVector, 3, Frame::Inertial > * > tilde_s, gsl::not_null< tnsr::I< DataVector, 3, Frame::Inertial > * > tilde_b, gsl::not_null< Scalar< DataVector > * > tilde_phi, const Scalar< DataVector > &rest_mass_density, const Scalar< DataVector > &electron_fraction, const Scalar< DataVector > &specific_internal_energy, const Scalar< DataVector > &pressure, const tnsr::I< DataVector, 3, Frame::Inertial > &spatial_velocity, const Scalar< DataVector > &lorentz_factor, const tnsr::I< DataVector, 3, Frame::Inertial > &magnetic_field, const Scalar< DataVector > &sqrt_det_spatial_metric, const tnsr::ii< DataVector, 3, Frame::Inertial > &spatial_metric, const Scalar< DataVector > &divergence_cleaning_field)
 

Detailed Description

Compute the conservative variables from primitive variables.

\begin{align*} {\tilde D} = & \sqrt{\gamma} \rho W \\ {\tilde Y}_e = & \sqrt{\gamma} \rho Y_e W \\ {\tilde S}_i = & \sqrt{\gamma} \left( \rho h W^2 v_i + B^m B_m v_i - B^m v_m B_i \right) \\ {\tilde \tau} = & \sqrt{\gamma} \left[ \rho h W^2 - p - \rho W - \frac{1}{2} (B^m v_m)^2 + \frac{1}{2} B^m B_m \left( 1 + v^m v_m \right) \right] \\ {\tilde B}^i = & \sqrt{\gamma} B^i \\ {\tilde \Phi} = & \sqrt{\gamma} \Phi \end{align*}

where the conserved variables \({\tilde D}\), \(\tilde{Y}_e\), \({\tilde S}_i\), \({\tilde \tau}\), \({\tilde B}^i\), and \({\tilde \Phi}\) are a generalized mass-energy density, electron fraction, momentum density, specific internal energy density, magnetic field, and divergence cleaning field. Furthermore \(\gamma\) is the determinant of the spatial metric, \(\rho\) is the rest mass density, \(Y_e\) is the electron fraction, \(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, \(p\) is the pressure, \(B^i\) is the spatial magnetic field measured by an Eulerian observer, and \(\Phi\) is a divergence cleaning field.

The quantity \({\tilde \tau}\) is rewritten as in RelativisticEuler to avoid cancellation error in the non-relativistic limit:

\[ \left( \rho h W^2 - p - \rho W \right) \longrightarrow W^2 \left[ \rho \left( \epsilon + v^2 \frac{W}{W + 1} \right) + p v^2 \right] .\]


The documentation for this struct was generated from the following file: