SpECTRE  v2026.04.01
Loading...
Searching...
No Matches
grmhd::ValenciaDivClean::ConservativeFromPrimitive Struct Reference

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

#include <ConservativeFromPrimitive.hpp>

Public Types

using return_tags
using argument_tags

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] .\]

Member Typedef Documentation

◆ argument_tags

using grmhd::ValenciaDivClean::ConservativeFromPrimitive::argument_tags
Initial value:
tmpl::list<hydro::Tags::RestMassDensity<DataVector>,
Definition Tags.hpp:25
Definition Tags.hpp:43
The divergence-cleaning field .
Definition Tags.hpp:99
The electron fraction .
Definition Tags.hpp:105
The Lorentz factor , where is the spatial velocity of the fluid.
Definition Tags.hpp:181
The magnetic field measured by an Eulerian observer, where is the normal to the spatial hypersurfac...
Definition Tags.hpp:197
The fluid pressure .
Definition Tags.hpp:234
The spatial velocity of the fluid, where . Here is the spatial part of the 4-velocity of the fluid,...
Definition Tags.hpp:257
The specific internal energy .
Definition Tags.hpp:286

◆ return_tags

using grmhd::ValenciaDivClean::ConservativeFromPrimitive::return_tags
Initial value:
The densitized magnetic field .
Definition Tags.hpp:56
The densitized rest-mass density .
Definition Tags.hpp:32
The densitized divergence-cleaning field .
Definition Tags.hpp:62
The densitized momentum density .
Definition Tags.hpp:49
The densitized energy density .
Definition Tags.hpp:43
The densitized electron number density times the baryon mass .
Definition Tags.hpp:38

The documentation for this struct was generated from the following file:
  • src/Evolution/Systems/GrMhd/ValenciaDivClean/ConservativeFromPrimitive.hpp