SpECTRE  v2025.03.17
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
hydro Namespace Reference

Items related to hydrodynamic systems. More...

Namespaces

namespace  OptionTags
 Tags for options of hydrodynamic systems.
 
namespace  Solutions
 Holds classes implementing common portions of solutions to various different (magneto)hydrodynamical systems.
 
namespace  Tags
 Tag containing TildeD * SpecificInternalEnergy Useful as a diagnostics tool, as input to volume integral.
 
namespace  units
 Functions, constants, and classes for converting between different units.
 

Classes

class  TemperatureInitialization
 Wrapper to add temperature variable to initial data providing only density and or energy_density initialization. More...
 

Enumerations

enum  MagneticFieldTreatment { AssumeZero , CheckIfZero , AssumeNonZero }
 Used to specify how to handle the magnetic field. More...
 
enum class  HalfPlaneIntegralMask { None , PositiveXOnly , NegativeXOnly }
 

Functions

std::ostreamoperator<< (std::ostream &os, MagneticFieldTreatment t)
 
std::ostreamoperator<< (std::ostream &os, HalfPlaneIntegralMask mask)
 
std::string name (HalfPlaneIntegralMask mask)
 
template<typename DataType , size_t Dim, typename Fr = Frame::Inertial>
void quadrupole_moment (const gsl::not_null< tnsr::ii< DataType, Dim, Fr > * > result, const Scalar< DataType > &tilde_d, const tnsr::I< DataType, Dim, Fr > &coordinates)
 Function computing the quadrupole moment. More...
 
template<typename DataType , size_t Dim, typename Fr = Frame::Inertial>
void quadrupole_moment_derivative (const gsl::not_null< tnsr::ii< DataType, Dim, Fr > * > result, const Scalar< DataType > &tilde_d, const tnsr::I< DataType, Dim, Fr > &coordinates, const tnsr::I< DataType, Dim, Fr > &spatial_velocity)
 Function computing the first time derivative of the quadrupole moment. More...
 
template<typename DataType >
void energy_density (gsl::not_null< Scalar< DataType > * > result, const Scalar< DataType > &rest_mass_density, const Scalar< DataType > &specific_enthalpy, const Scalar< DataType > &pressure, const Scalar< DataType > &lorentz_factor, const Scalar< DataType > &magnetic_field_dot_spatial_velocity, const Scalar< DataType > &comoving_magnetic_field_squared)
 The total mass-energy density measured by a normal observer, E=nanbTab. More...
 
template<typename DataType >
void momentum_density (gsl::not_null< tnsr::I< DataType, 3 > * > result, const Scalar< DataType > &rest_mass_density, const Scalar< DataType > &specific_enthalpy, const tnsr::I< DataType, 3 > &spatial_velocity, const Scalar< DataType > &lorentz_factor, const tnsr::I< DataType, 3 > &magnetic_field, const Scalar< DataType > &magnetic_field_dot_spatial_velocity, const Scalar< DataType > &comoving_magnetic_field_squared)
 The spatial momentum density Si=γijnaTaj. More...
 
template<typename DataType >
void stress_trace (gsl::not_null< Scalar< DataType > * > result, const Scalar< DataType > &rest_mass_density, const Scalar< DataType > &specific_enthalpy, const Scalar< DataType > &pressure, const Scalar< DataType > &spatial_velocity_squared, const Scalar< DataType > &lorentz_factor, const Scalar< DataType > &magnetic_field_dot_spatial_velocity, const Scalar< DataType > &comoving_magnetic_field_squared)
 The trace of the spatial stress tensor, S=γijγiaγjbTab. More...
 
template<typename DataType >
void stress_energy_tensor (gsl::not_null< tnsr::AA< DataType, 3 > * > result, const Scalar< DataType > &rest_mass_density, const Scalar< DataType > &specific_internal_energy, const Scalar< DataType > &pressure, const Scalar< DataType > &lorentz_factor, const Scalar< DataType > &lapse, const Scalar< DataType > &comoving_magnetic_field_magnitude, const tnsr::I< DataType, 3 > &spatial_velocity, const tnsr::I< DataType, 3 > &shift, const tnsr::I< DataType, 3 > &magnetic_field, const tnsr::ii< DataType, 3 > &spatial_metric, const tnsr::II< DataType, 3 > &inverse_spatial_metric)
 Stress Energy Tesnor, Tab=(ρh)uaub+pgabbabb,. More...
 
template<typename DataType , size_t Dim, typename Fr = Frame::Inertial>
void transport_velocity (gsl::not_null< tnsr::I< DataType, Dim, Fr > * > result, const tnsr::I< DataType, Dim, Fr > &spatial_velocity, const Scalar< DataType > &lapse, const tnsr::I< DataType, Dim, Fr > &shift)
 Function computing the transport velocity. More...
 
template<typename DataType >
void comoving_magnetic_field (gsl::not_null< tnsr::A< DataType, 3 > * > result, const tnsr::I< DataType, 3 > &spatial_velocity, const tnsr::I< DataType, 3 > &magnetic_field, const Scalar< DataType > &magnetic_field_dot_spatial_velocity, const Scalar< DataType > &lorentz_factor, const tnsr::I< DataType, 3 > &shift, const Scalar< DataType > &lapse)
 The comoving magnetic field vector bμ and one-form bμ. More...
 
template<typename DataType >
tnsr::A< DataType, 3 > comoving_magnetic_field (const tnsr::I< DataType, 3 > &spatial_velocity, const tnsr::I< DataType, 3 > &magnetic_field, const Scalar< DataType > &magnetic_field_dot_spatial_velocity, const Scalar< DataType > &lorentz_factor, const tnsr::I< DataType, 3 > &shift, const Scalar< DataType > &lapse)
 The comoving magnetic field vector bμ and one-form bμ. More...
 
template<typename DataType >
void comoving_magnetic_field_one_form (gsl::not_null< tnsr::a< DataType, 3 > * > result, const tnsr::i< DataType, 3 > &spatial_velocity_one_form, const tnsr::i< DataType, 3 > &magnetic_field_one_form, const Scalar< DataType > &magnetic_field_dot_spatial_velocity, const Scalar< DataType > &lorentz_factor, const tnsr::I< DataType, 3 > &shift, const Scalar< DataType > &lapse)
 The comoving magnetic field vector bμ and one-form bμ. More...
 
template<typename DataType >
tnsr::a< DataType, 3 > comoving_magnetic_field_one_form (const tnsr::i< DataType, 3 > &spatial_velocity_one_form, const tnsr::i< DataType, 3 > &magnetic_field_one_form, const Scalar< DataType > &magnetic_field_dot_spatial_velocity, const Scalar< DataType > &lorentz_factor, const tnsr::I< DataType, 3 > &shift, const Scalar< DataType > &lapse)
 The comoving magnetic field vector bμ and one-form bμ. More...
 
template<typename DataType >
void comoving_magnetic_field_squared (gsl::not_null< Scalar< DataType > * > result, const Scalar< DataType > &magnetic_field_squared, const Scalar< DataType > &magnetic_field_dot_spatial_velocity, const Scalar< DataType > &lorentz_factor)
 The comoving magnetic field vector bμ and one-form bμ. More...
 
template<typename DataType >
Scalar< DataType > comoving_magnetic_field_squared (const Scalar< DataType > &magnetic_field_squared, const Scalar< DataType > &magnetic_field_dot_spatial_velocity, const Scalar< DataType > &lorentz_factor)
 The comoving magnetic field vector bμ and one-form bμ. More...
 
template<typename DataType >
void inverse_plasma_beta (gsl::not_null< Scalar< DataType > * > result, const Scalar< DataType > &comoving_magnetic_field_magnitude, const Scalar< DataType > &fluid_pressure)
 Computes the inverse plasma beta. More...
 
template<typename DataType >
Scalar< DataType > inverse_plasma_beta (const Scalar< DataType > &comoving_magnetic_field_magnitude, const Scalar< DataType > &fluid_pressure)
 Computes the inverse plasma beta. More...
 
template<typename DataType , size_t Dim, typename Frame >
void lorentz_factor (gsl::not_null< Scalar< DataType > * > result, const tnsr::I< DataType, Dim, Frame > &spatial_velocity, const tnsr::i< DataType, Dim, Frame > &spatial_velocity_form)
 Computes the Lorentz factor W=1/1vivi.
 
template<typename DataType , size_t Dim, typename Frame >
Scalar< DataType > lorentz_factor (const tnsr::I< DataType, Dim, Frame > &spatial_velocity, const tnsr::i< DataType, Dim, Frame > &spatial_velocity_form)
 Computes the Lorentz factor W=1/1vivi.
 
template<typename DataType >
void lorentz_factor (gsl::not_null< Scalar< DataType > * > result, const Scalar< DataType > &spatial_velocity_squared)
 Computes the Lorentz factor W=1/1vivi.
 
template<typename DataType >
Scalar< DataType > lorentz_factor (const Scalar< DataType > &spatial_velocity_squared)
 Computes the Lorentz factor W=1/1vivi.
 
template<typename DataType , size_t Dim, typename Frame >
void mass_flux (gsl::not_null< tnsr::I< DataType, Dim, Frame > * > result, const Scalar< DataType > &rest_mass_density, const tnsr::I< DataType, Dim, Frame > &spatial_velocity, const Scalar< DataType > &lorentz_factor, const Scalar< DataType > &lapse, const tnsr::I< DataType, Dim, Frame > &shift, const Scalar< DataType > &sqrt_det_spatial_metric)
 Computes the vector Ji in M˙=Jisid2S, representing the mass flux through a surface with normal si. More...
 
template<typename DataType , size_t Dim, typename Frame >
tnsr::I< DataType, Dim, Frame > mass_flux (const Scalar< DataType > &rest_mass_density, const tnsr::I< DataType, Dim, Frame > &spatial_velocity, const Scalar< DataType > &lorentz_factor, const Scalar< DataType > &lapse, const tnsr::I< DataType, Dim, Frame > &shift, const Scalar< DataType > &sqrt_det_spatial_metric)
 Computes the vector Ji in M˙=Jisid2S, representing the mass flux through a surface with normal si. More...
 
template<typename DataType , size_t Dim, typename Frame >
void u_lower_t (gsl::not_null< Scalar< DataType > * > result, const Scalar< DataType > &lorentz_factor, const tnsr::I< DataType, Dim, Frame > &spatial_velocity, const tnsr::ii< DataType, Dim, Frame > &spatial_metric, const Scalar< DataType > &lapse, const tnsr::I< DataType, Dim, Frame > &shift)
 Compute ut=.
 
template<typename DataType , size_t Dim, typename Frame >
Scalar< DataType > u_lower_t (const Scalar< DataType > &lorentz_factor, const tnsr::I< DataType, Dim, Frame > &spatial_velocity, const tnsr::ii< DataType, Dim, Frame > &spatial_metric, const Scalar< DataType > &lapse, const tnsr::I< DataType, Dim, Frame > &shift)
 Compute ut=.
 
template<typename DataType >
void mass_weighted_internal_energy (gsl::not_null< Scalar< DataType > * > result, const Scalar< DataType > &tilde_d, const Scalar< DataType > &specific_internal_energy)
 Compute tilde_d * specific_internal_energy Result of the calculation stored in result.
 
template<typename DataType >
Scalar< DataType > mass_weighted_internal_energy (const Scalar< DataType > &tilde_d, const Scalar< DataType > &specific_internal_energy)
 Compute tilde_d * specific_internal_energy Result of the calculation stored in result.
 
template<typename DataType >
void mass_weighted_kinetic_energy (gsl::not_null< Scalar< DataType > * > result, const Scalar< DataType > &tilde_d, const Scalar< DataType > &lorentz_factor)
 Compute tilde_d * (lorentz_factor - 1.0) Result of the calculation stored in result.
 
template<typename DataType >
Scalar< DataType > mass_weighted_kinetic_energy (const Scalar< DataType > &tilde_d, const Scalar< DataType > &lorentz_factor)
 Compute tilde_d * (lorentz_factor - 1.0) Result of the calculation stored in result.
 
template<typename DataType , size_t Dim, typename Fr = Frame::Inertial>
void tilde_d_unbound_ut_criterion (gsl::not_null< Scalar< DataType > * > result, const Scalar< DataType > &tilde_d, const Scalar< DataType > &lorentz_factor, const tnsr::I< DataType, Dim, Fr > &spatial_velocity, const tnsr::ii< DataType, Dim, Fr > &spatial_metric, const Scalar< DataType > &lapse, const tnsr::I< DataType, Dim, Fr > &shift)
 Returns tilde_d in regions where u_t < -1 and 0 in regions where u_t > -1 (approximate criteria for unbound matter, theoretically valid for particles following geodesics of a time-independent metric).
 
template<typename DataType , size_t Dim, typename Fr = Frame::Inertial>
Scalar< DataType > tilde_d_unbound_ut_criterion (const Scalar< DataType > &tilde_d, const Scalar< DataType > &lorentz_factor, const tnsr::I< DataType, Dim, Fr > &spatial_velocity, const tnsr::ii< DataType, Dim, Fr > &spatial_metric, const Scalar< DataType > &lapse, const tnsr::I< DataType, Dim, Fr > &shift)
 Returns tilde_d in regions where u_t < -1 and 0 in regions where u_t > -1 (approximate criteria for unbound matter, theoretically valid for particles following geodesics of a time-independent metric).
 
template<HalfPlaneIntegralMask IntegralMask, typename DataType , size_t Dim>
void tilde_d_in_half_plane (gsl::not_null< Scalar< DataType > * > result, const Scalar< DataType > &tilde_d, const tnsr::I< DataType, Dim, Frame::Grid > &grid_coords)
 Returns tilde_d in one half plane and zero in the other IntegralMask allows us to restrict the data to the x>0 or x<0 plane in grid coordinates (useful for NSNS).
 
template<HalfPlaneIntegralMask IntegralMask, typename DataType , size_t Dim>
Scalar< DataType > tilde_d_in_half_plane (const Scalar< DataType > &tilde_d, const tnsr::I< DataType, Dim, Frame::Grid > &grid_coords)
 Returns tilde_d in one half plane and zero in the other IntegralMask allows us to restrict the data to the x>0 or x<0 plane in grid coordinates (useful for NSNS).
 
template<HalfPlaneIntegralMask IntegralMask, typename DataType , size_t Dim, typename Fr = Frame::Inertial>
void mass_weighted_coords (gsl::not_null< tnsr::I< DataType, Dim, Fr > * > result, const Scalar< DataType > &tilde_d, const tnsr::I< DataType, Dim, Frame::Grid > &grid_coords, const tnsr::I< DataType, Dim, Fr > &compute_coords)
 Returns tilde_d * compute_coords IntegralMask allows us to restrict the data to the x>0 or x<0 plane in grid coordinates (useful for NSNS).
 
template<HalfPlaneIntegralMask IntegralMask, typename DataType , size_t Dim, typename Fr = Frame::Inertial>
tnsr::I< DataType, Dim, Fr > mass_weighted_coords (const Scalar< DataType > &tilde_d, const tnsr::I< DataType, Dim, Frame::Grid > &grid_coords, const tnsr::I< DataType, Dim, Fr > &compute_coords)
 Returns tilde_d * compute_coords IntegralMask allows us to restrict the data to the x>0 or x<0 plane in grid coordinates (useful for NSNS).
 
template<typename DataType , size_t ThermodynamicDim>
void sound_speed_squared (gsl::not_null< Scalar< DataType > * > result, const Scalar< DataType > &rest_mass_density, const Scalar< DataType > &specific_internal_energy, const Scalar< DataType > &specific_enthalpy, const EquationsOfState::EquationOfState< true, ThermodynamicDim > &equation_of_state)
 Computes the relativistic sound speed squared. More...
 
template<typename DataType , size_t ThermodynamicDim>
Scalar< DataType > sound_speed_squared (const Scalar< DataType > &rest_mass_density, const Scalar< DataType > &specific_internal_energy, const Scalar< DataType > &specific_enthalpy, const EquationsOfState::EquationOfState< true, ThermodynamicDim > &equation_of_state)
 Computes the relativistic sound speed squared. More...
 
template<typename DataType >
void relativistic_specific_enthalpy (gsl::not_null< Scalar< DataType > * > result, const Scalar< DataType > &rest_mass_density, const Scalar< DataType > &specific_internal_energy, const Scalar< DataType > &pressure)
 Computes the relativistic specific enthalpy h as: h=1+ϵ+pρ where ϵ is the specific internal energy, p is the pressure, and ρ is the rest mass density.
 
template<typename DataType >
Scalar< DataType > relativistic_specific_enthalpy (const Scalar< DataType > &rest_mass_density, const Scalar< DataType > &specific_internal_energy, const Scalar< DataType > &pressure)
 Computes the relativistic specific enthalpy h as: h=1+ϵ+pρ where ϵ is the specific internal energy, p is the pressure, and ρ is the rest mass density.
 

Detailed Description

Items related to hydrodynamic systems.

Enumeration Type Documentation

◆ MagneticFieldTreatment

Used to specify how to handle the magnetic field.

Enumerator
AssumeZero 

Assume the magnetic field is zero.

CheckIfZero 

Check if the magnetic field is zero.

AssumeNonZero 

Assume the magnetic field is non-zero.

Function Documentation

◆ comoving_magnetic_field() [1/2]

template<typename DataType >
tnsr::A< DataType, 3 > hydro::comoving_magnetic_field ( const tnsr::I< DataType, 3 > &  spatial_velocity,
const tnsr::I< DataType, 3 > &  magnetic_field,
const Scalar< DataType > &  magnetic_field_dot_spatial_velocity,
const Scalar< DataType > &  lorentz_factor,
const tnsr::I< DataType, 3 > &  shift,
const Scalar< DataType > &  lapse 
)

The comoving magnetic field vector bμ and one-form bμ.

The components of the comoving magnetic field vector are:

(1)b0=WBjvkγjk/α(2)bi=Bi/W+Bjvkγjkui

where ui=W(viβi/α).

Using the spacetime metric, the corresponding one-form components are:

(3)b0=αWviBi+βibi(4)bi=Bi/W+BjvkγjkWvi

The square of the vector is:

(5)b2=BiBjγij/W2+(Bivjγij)2

See also Eq. (5.173) in , with the difference that we work in Heaviside-Lorentz units where the magnetic field is rescaled by 1/4π, following .

◆ comoving_magnetic_field() [2/2]

template<typename DataType >
void hydro::comoving_magnetic_field ( gsl::not_null< tnsr::A< DataType, 3 > * >  result,
const tnsr::I< DataType, 3 > &  spatial_velocity,
const tnsr::I< DataType, 3 > &  magnetic_field,
const Scalar< DataType > &  magnetic_field_dot_spatial_velocity,
const Scalar< DataType > &  lorentz_factor,
const tnsr::I< DataType, 3 > &  shift,
const Scalar< DataType > &  lapse 
)

The comoving magnetic field vector bμ and one-form bμ.

The components of the comoving magnetic field vector are:

(6)b0=WBjvkγjk/α(7)bi=Bi/W+Bjvkγjkui

where ui=W(viβi/α).

Using the spacetime metric, the corresponding one-form components are:

(8)b0=αWviBi+βibi(9)bi=Bi/W+BjvkγjkWvi

The square of the vector is:

(10)b2=BiBjγij/W2+(Bivjγij)2

See also Eq. (5.173) in , with the difference that we work in Heaviside-Lorentz units where the magnetic field is rescaled by 1/4π, following .

◆ comoving_magnetic_field_one_form() [1/2]

template<typename DataType >
tnsr::a< DataType, 3 > hydro::comoving_magnetic_field_one_form ( const tnsr::i< DataType, 3 > &  spatial_velocity_one_form,
const tnsr::i< DataType, 3 > &  magnetic_field_one_form,
const Scalar< DataType > &  magnetic_field_dot_spatial_velocity,
const Scalar< DataType > &  lorentz_factor,
const tnsr::I< DataType, 3 > &  shift,
const Scalar< DataType > &  lapse 
)

The comoving magnetic field vector bμ and one-form bμ.

The components of the comoving magnetic field vector are:

(11)b0=WBjvkγjk/α(12)bi=Bi/W+Bjvkγjkui

where ui=W(viβi/α).

Using the spacetime metric, the corresponding one-form components are:

(13)b0=αWviBi+βibi(14)bi=Bi/W+BjvkγjkWvi

The square of the vector is:

(15)b2=BiBjγij/W2+(Bivjγij)2

See also Eq. (5.173) in , with the difference that we work in Heaviside-Lorentz units where the magnetic field is rescaled by 1/4π, following .

◆ comoving_magnetic_field_one_form() [2/2]

template<typename DataType >
void hydro::comoving_magnetic_field_one_form ( gsl::not_null< tnsr::a< DataType, 3 > * >  result,
const tnsr::i< DataType, 3 > &  spatial_velocity_one_form,
const tnsr::i< DataType, 3 > &  magnetic_field_one_form,
const Scalar< DataType > &  magnetic_field_dot_spatial_velocity,
const Scalar< DataType > &  lorentz_factor,
const tnsr::I< DataType, 3 > &  shift,
const Scalar< DataType > &  lapse 
)

The comoving magnetic field vector bμ and one-form bμ.

The components of the comoving magnetic field vector are:

(16)b0=WBjvkγjk/α(17)bi=Bi/W+Bjvkγjkui

where ui=W(viβi/α).

Using the spacetime metric, the corresponding one-form components are:

(18)b0=αWviBi+βibi(19)bi=Bi/W+BjvkγjkWvi

The square of the vector is:

(20)b2=BiBjγij/W2+(Bivjγij)2

See also Eq. (5.173) in , with the difference that we work in Heaviside-Lorentz units where the magnetic field is rescaled by 1/4π, following .

◆ comoving_magnetic_field_squared() [1/2]

template<typename DataType >
Scalar< DataType > hydro::comoving_magnetic_field_squared ( const Scalar< DataType > &  magnetic_field_squared,
const Scalar< DataType > &  magnetic_field_dot_spatial_velocity,
const Scalar< DataType > &  lorentz_factor 
)

The comoving magnetic field vector bμ and one-form bμ.

The components of the comoving magnetic field vector are:

(21)b0=WBjvkγjk/α(22)bi=Bi/W+Bjvkγjkui

where ui=W(viβi/α).

Using the spacetime metric, the corresponding one-form components are:

(23)b0=αWviBi+βibi(24)bi=Bi/W+BjvkγjkWvi

The square of the vector is:

(25)b2=BiBjγij/W2+(Bivjγij)2

See also Eq. (5.173) in , with the difference that we work in Heaviside-Lorentz units where the magnetic field is rescaled by 1/4π, following .

◆ comoving_magnetic_field_squared() [2/2]

template<typename DataType >
void hydro::comoving_magnetic_field_squared ( gsl::not_null< Scalar< DataType > * >  result,
const Scalar< DataType > &  magnetic_field_squared,
const Scalar< DataType > &  magnetic_field_dot_spatial_velocity,
const Scalar< DataType > &  lorentz_factor 
)

The comoving magnetic field vector bμ and one-form bμ.

The components of the comoving magnetic field vector are:

(26)b0=WBjvkγjk/α(27)bi=Bi/W+Bjvkγjkui

where ui=W(viβi/α).

Using the spacetime metric, the corresponding one-form components are:

(28)b0=αWviBi+βibi(29)bi=Bi/W+BjvkγjkWvi

The square of the vector is:

(30)b2=BiBjγij/W2+(Bivjγij)2

See also Eq. (5.173) in , with the difference that we work in Heaviside-Lorentz units where the magnetic field is rescaled by 1/4π, following .

◆ energy_density()

template<typename DataType >
void hydro::energy_density ( gsl::not_null< Scalar< DataType > * >  result,
const Scalar< DataType > &  rest_mass_density,
const Scalar< DataType > &  specific_enthalpy,
const Scalar< DataType > &  pressure,
const Scalar< DataType > &  lorentz_factor,
const Scalar< DataType > &  magnetic_field_dot_spatial_velocity,
const Scalar< DataType > &  comoving_magnetic_field_squared 
)

The total mass-energy density measured by a normal observer, E=nanbTab.

This quantity sources the gravitational field equations in the 3+1 decomposition (see Eq. (2.138) in ).

Perfect fluid contribution (Eq. (5.33) in ):

(31)Efluid=ρhW2p

Magnetic field contribution (Eq. (5.152) in ):

(32)Eem=b2(W212)(αbt)2

where αbt=WBkvk.

Parameters
resultOutput buffer. Will be resized if needed.
rest_mass_densityρ
specific_enthalpyh
pressurep
lorentz_factorW
magnetic_field_dot_spatial_velocityBkvk
comoving_magnetic_field_squaredb2
See also
gr::Tags::EnergyDensity

◆ inverse_plasma_beta() [1/2]

template<typename DataType >
Scalar< DataType > hydro::inverse_plasma_beta ( const Scalar< DataType > &  comoving_magnetic_field_magnitude,
const Scalar< DataType > &  fluid_pressure 
)

Computes the inverse plasma beta.

The inverse plasma beta β1=b2/(2p), where b2 is the square of the comoving magnetic field amplitude and p is the fluid pressure.

◆ inverse_plasma_beta() [2/2]

template<typename DataType >
void hydro::inverse_plasma_beta ( gsl::not_null< Scalar< DataType > * >  result,
const Scalar< DataType > &  comoving_magnetic_field_magnitude,
const Scalar< DataType > &  fluid_pressure 
)

Computes the inverse plasma beta.

The inverse plasma beta β1=b2/(2p), where b2 is the square of the comoving magnetic field amplitude and p is the fluid pressure.

◆ mass_flux() [1/2]

template<typename DataType , size_t Dim, typename Frame >
tnsr::I< DataType, Dim, Frame > hydro::mass_flux ( const Scalar< DataType > &  rest_mass_density,
const tnsr::I< DataType, Dim, Frame > &  spatial_velocity,
const Scalar< DataType > &  lorentz_factor,
const Scalar< DataType > &  lapse,
const tnsr::I< DataType, Dim, Frame > &  shift,
const Scalar< DataType > &  sqrt_det_spatial_metric 
)

Computes the vector Ji in M˙=Jisid2S, representing the mass flux through a surface with normal si.

Note that the integral is understood as a flat-space integral: all metric factors are included in Ji. In particular, if the integral is done over a Strahlkorper, the gr::surfaces::euclidean_area_element of the Strahlkorper should be used, and si is the normal one-form to the Strahlkorper normalized with the flat metric, sisjδij=1.

The formula is Ji=ρWγ(αviβi), where ρ is the mass density, W is the Lorentz factor, vi is the spatial velocity of the fluid, γ is the determinant of the 3-metric γij, α is the lapse, and βi is the shift.

◆ mass_flux() [2/2]

template<typename DataType , size_t Dim, typename Frame >
void hydro::mass_flux ( gsl::not_null< tnsr::I< DataType, Dim, Frame > * >  result,
const Scalar< DataType > &  rest_mass_density,
const tnsr::I< DataType, Dim, Frame > &  spatial_velocity,
const Scalar< DataType > &  lorentz_factor,
const Scalar< DataType > &  lapse,
const tnsr::I< DataType, Dim, Frame > &  shift,
const Scalar< DataType > &  sqrt_det_spatial_metric 
)

Computes the vector Ji in M˙=Jisid2S, representing the mass flux through a surface with normal si.

Note that the integral is understood as a flat-space integral: all metric factors are included in Ji. In particular, if the integral is done over a Strahlkorper, the gr::surfaces::euclidean_area_element of the Strahlkorper should be used, and si is the normal one-form to the Strahlkorper normalized with the flat metric, sisjδij=1.

The formula is Ji=ρWγ(αviβi), where ρ is the mass density, W is the Lorentz factor, vi is the spatial velocity of the fluid, γ is the determinant of the 3-metric γij, α is the lapse, and βi is the shift.

◆ momentum_density()

template<typename DataType >
void hydro::momentum_density ( gsl::not_null< tnsr::I< DataType, 3 > * >  result,
const Scalar< DataType > &  rest_mass_density,
const Scalar< DataType > &  specific_enthalpy,
const tnsr::I< DataType, 3 > &  spatial_velocity,
const Scalar< DataType > &  lorentz_factor,
const tnsr::I< DataType, 3 > &  magnetic_field,
const Scalar< DataType > &  magnetic_field_dot_spatial_velocity,
const Scalar< DataType > &  comoving_magnetic_field_squared 
)

The spatial momentum density Si=γijnaTaj.

This quantity sources the gravitational field equations in the 3+1 decomposition (see Eq. (2.138) in ).

Perfect fluid contribution (Eq. (5.34) in ):

(33)Sfluidi=ρhW2vi

Magnetic field contribution (Eq. (5.153) in ):

(34)Semi=b2W2viαbtγijbj

where αbtγijbj=BkvkBi+(Bkvk)2W2vi.

Parameters
resultOutput buffer. Will be resized if needed.
rest_mass_densityρ
specific_enthalpyh
spatial_velocityvi
lorentz_factorW
magnetic_fieldBi
magnetic_field_dot_spatial_velocityBkvk
comoving_magnetic_field_squaredb2
See also
gr::Tags::MomentumDensity

◆ quadrupole_moment()

template<typename DataType , size_t Dim, typename Fr = Frame::Inertial>
void hydro::quadrupole_moment ( const gsl::not_null< tnsr::ii< DataType, Dim, Fr > * >  result,
const Scalar< DataType > &  tilde_d,
const tnsr::I< DataType, Dim, Fr > &  coordinates 
)

Function computing the quadrupole moment.

Computes the quadrupole moment, using D~xixj (equation 21 of ), with D~=γρW, W being the Lorentz factor, γ being the determinant of the spatial metric, and x the coordinates in Frame Fr. Result of calculation stored in result.

◆ quadrupole_moment_derivative()

template<typename DataType , size_t Dim, typename Fr = Frame::Inertial>
void hydro::quadrupole_moment_derivative ( const gsl::not_null< tnsr::ii< DataType, Dim, Fr > * >  result,
const Scalar< DataType > &  tilde_d,
const tnsr::I< DataType, Dim, Fr > &  coordinates,
const tnsr::I< DataType, Dim, Fr > &  spatial_velocity 
)

Function computing the first time derivative of the quadrupole moment.

Computes the first time derivative of the quadrupole moment, using D~(vixj+xivj) (equation 23 of ), with D~=γρW, W being the Lorentz factor, γ being the determinant of the spatial metric, x the coordinates in Frame Fr, and v the corresponding spatial velocity. Result of calculation stored in result.

◆ stress_energy_tensor()

template<typename DataType >
void hydro::stress_energy_tensor ( gsl::not_null< tnsr::AA< DataType, 3 > * >  result,
const Scalar< DataType > &  rest_mass_density,
const Scalar< DataType > &  specific_internal_energy,
const Scalar< DataType > &  pressure,
const Scalar< DataType > &  lorentz_factor,
const Scalar< DataType > &  lapse,
const Scalar< DataType > &  comoving_magnetic_field_magnitude,
const tnsr::I< DataType, 3 > &  spatial_velocity,
const tnsr::I< DataType, 3 > &  shift,
const tnsr::I< DataType, 3 > &  magnetic_field,
const tnsr::ii< DataType, 3 > &  spatial_metric,
const tnsr::II< DataType, 3 > &  inverse_spatial_metric 
)

Stress Energy Tesnor, Tab=(ρh)uaub+pgabbabb,.

where (ρh)=ρh+b2 and p=p+b2/2 are the enthalpy density and fluid pressure augmented by contributions of magnetic pressure pmag = b^{2}/2, respectively.

b refers to magnetic field measured in the comoving frame of the fluid ba=Fabub.

◆ stress_trace()

template<typename DataType >
void hydro::stress_trace ( gsl::not_null< Scalar< DataType > * >  result,
const Scalar< DataType > &  rest_mass_density,
const Scalar< DataType > &  specific_enthalpy,
const Scalar< DataType > &  pressure,
const Scalar< DataType > &  spatial_velocity_squared,
const Scalar< DataType > &  lorentz_factor,
const Scalar< DataType > &  magnetic_field_dot_spatial_velocity,
const Scalar< DataType > &  comoving_magnetic_field_squared 
)

The trace of the spatial stress tensor, S=γijγiaγjbTab.

This quantity sources the gravitational field equations in the 3+1 decomposition (see Eq. (2.138) in ).

Perfect fluid contribution (Eq. (5.36) in ):

(35)Sfluid=3p+ρh(W21)

Magnetic field contribution (Eq. (5.155) in ):

(36)Sem=b2(W2v2+32)γijbibj

where γijbibj=b2+(Bkvk)2(W2v2+1).

Parameters
resultOutput buffer. Will be resized if needed.
rest_mass_densityρ
specific_enthalpyh
pressurep
spatial_velocity_squaredv2=γijvivj
lorentz_factorW
magnetic_field_dot_spatial_velocityBkvk
comoving_magnetic_field_squaredb2
See also
gr::Tags::StressTrace

◆ transport_velocity()

template<typename DataType , size_t Dim, typename Fr = Frame::Inertial>
void hydro::transport_velocity ( gsl::not_null< tnsr::I< DataType, Dim, Fr > * >  result,
const tnsr::I< DataType, Dim, Fr > &  spatial_velocity,
const Scalar< DataType > &  lapse,
const tnsr::I< DataType, Dim, Fr > &  shift 
)

Function computing the transport velocity.

Computes the transport velocity, using vti=αviβi, with vi being the spatial velocity, α the lapse, and βi the shift.