SpECTRE  v2025.03.17
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
grmhd::ValenciaDivClean::ConservativeFromPrimitive Struct Reference

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

#include <ConservativeFromPrimitive.hpp>

Public Types

using return_tags = implementation defined
 
using argument_tags = implementation defined
 

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.

D~=γρWY~e=γρYeWS~i=γ(ρhW2vi+BmBmviBmvmBi)τ~=γ[ρhW2pρW12(Bmvm)2+12BmBm(1+vmvm)]B~i=γBiΦ~=γΦ

where the conserved variables D~, Y~e, S~i, τ~, B~i, and Φ~ are a generalized mass-energy density, electron fraction, momentum density, specific internal energy density, magnetic field, and divergence cleaning field. Furthermore γ is the determinant of the spatial metric, ρ is the rest mass density, Ye is the electron fraction, W=1/1vivi is the Lorentz factor, h=1+ϵ+pρ is the specific enthalpy, vi is the spatial velocity, ϵ is the specific internal energy, p is the pressure, Bi is the spatial magnetic field measured by an Eulerian observer, and Φ is a divergence cleaning field.

The quantity τ~ is rewritten as in RelativisticEuler to avoid cancellation error in the non-relativistic limit:

(ρhW2pρW)W2[ρ(ϵ+v2WW+1)+pv2].


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