SpECTRE  v2024.03.19
NewtonianEuler::PrimitiveFromConservative< Dim > Struct Template Reference

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

#include <PrimitiveFromConservative.hpp>

Public Types

using return_tags = tmpl::list< hydro::Tags::RestMassDensity< DataVector >, hydro::Tags::SpatialVelocity< DataVector, Dim >, hydro::Tags::SpecificInternalEnergy< DataVector >, hydro::Tags::Pressure< DataVector > >
 
using argument_tags = tmpl::list< Tags::MassDensityCons, Tags::MomentumDensity< Dim >, Tags::EnergyDensity, hydro::Tags::EquationOfState< false, 2 > >
 

Static Public Member Functions

template<size_t ThermodynamicDim>
static void apply (gsl::not_null< Scalar< DataVector > * > mass_density, gsl::not_null< tnsr::I< DataVector, Dim > * > velocity, gsl::not_null< Scalar< DataVector > * > specific_internal_energy, gsl::not_null< Scalar< DataVector > * > pressure, const Scalar< DataVector > &mass_density_cons, const tnsr::I< DataVector, Dim > &momentum_density, const Scalar< DataVector > &energy_density, const EquationsOfState::EquationOfState< false, ThermodynamicDim > &equation_of_state)
 

Detailed Description

template<size_t Dim>
struct NewtonianEuler::PrimitiveFromConservative< Dim >

Compute the primitive variables from the conservative variables.

\begin{align*} v^i &= \frac{S^i}{\rho} \\ \epsilon &= \frac{e}{\rho} - \frac{1}{2}\frac{S^2}{\rho^2} \end{align*}

where \(v^i\) is the velocity, \(\epsilon\) is the specific internal energy, \(e\) is the energy density, \(\rho\) is the mass density, \(S^i\) is the momentum density, and \(S^2\) is the momentum density squared.

This routine also returns the mass density as a primitive, and the pressure from a generic equation of state \(p = p(\rho, \epsilon)\).


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