SpECTRE  v2024.04.12
VariableFixing::FixToAtmosphere< Dim > Class Template Reference

Fix the primitive variables to an atmosphere in low density regions. More...

#include <FixToAtmosphere.hpp>

Classes

struct  DensityCutoff
 Rest mass density at which to impose the atmosphere. Should be greater than or equal to the density of the atmosphere. More...
 
struct  DensityOfAtmosphere
 Rest mass density of the atmosphere. More...
 
struct  MaxVelocityMagnitude
 The maximum magnitude of the velocity when the density is below TransitionDensityCutoff More...
 
struct  TransitionDensityCutoff
 For densities between DensityOfAtmosphere and TransitionDensityCutoff the velocity is transitioned away from atmosphere to avoid abrupt cutoffs. More...
 

Public Types

using options = tmpl::list< DensityOfAtmosphere, DensityCutoff, TransitionDensityCutoff, MaxVelocityMagnitude >
 
using return_tags = tmpl::list< hydro::Tags::RestMassDensity< DataVector >, hydro::Tags::SpecificInternalEnergy< DataVector >, hydro::Tags::SpatialVelocity< DataVector, Dim >, hydro::Tags::LorentzFactor< DataVector >, hydro::Tags::Pressure< DataVector >, hydro::Tags::Temperature< DataVector > >
 
using argument_tags = tmpl::list< hydro::Tags::ElectronFraction< DataVector >, gr::Tags::SpatialMetric< DataVector, Dim >, hydro::Tags::EquationOfStateBase >
 

Public Member Functions

 FixToAtmosphere (double density_of_atmosphere, double density_cutoff, double transition_density_cutoff, double max_velocity_magnitude, const Options::Context &context={})
 
 FixToAtmosphere (const FixToAtmosphere &)=default
 
FixToAtmosphereoperator= (const FixToAtmosphere &)=default
 
 FixToAtmosphere (FixToAtmosphere &&)=default
 
FixToAtmosphereoperator= (FixToAtmosphere &&)=default
 
void pup (PUP::er &p)
 
template<size_t ThermodynamicDim>
void operator() (gsl::not_null< Scalar< DataVector > * > rest_mass_density, gsl::not_null< Scalar< DataVector > * > specific_internal_energy, gsl::not_null< tnsr::I< DataVector, Dim, Frame::Inertial > * > spatial_velocity, gsl::not_null< Scalar< DataVector > * > lorentz_factor, gsl::not_null< Scalar< DataVector > * > pressure, gsl::not_null< Scalar< DataVector > * > temperature, const Scalar< DataVector > &electron_fraction, const tnsr::ii< DataVector, Dim, Frame::Inertial > &spatial_metric, const EquationsOfState::EquationOfState< true, ThermodynamicDim > &equation_of_state) const
 

Static Public Attributes

static constexpr Options::String help
 

Friends

template<size_t SpatialDim>
bool operator== (const FixToAtmosphere< SpatialDim > &lhs, const FixToAtmosphere< SpatialDim > &rhs)
 

Detailed Description

template<size_t Dim>
class VariableFixing::FixToAtmosphere< Dim >

Fix the primitive variables to an atmosphere in low density regions.

If the rest mass density is below \(\rho_{\textrm{cutoff}}\) (DensityCutoff), it is set to \(\rho_{\textrm{atm}}\) (DensityOfAtmosphere), and the pressure, and specific internal energy (for one-dimensional equations of state) are adjusted to satisfy the equation of state. For a two-dimensional equation of state, the specific internal energy is set to zero. In addition, the spatial velocity is set to zero, and the Lorentz factor is set to one.

If the rest mass density is above \(\rho_{\textrm{cutoff}}\) but below \(\rho_{\textrm{transition}}\) (TransitionDensityCutoff) then the velocity is rescaled such that

\begin{align*} \sqrt{v^i v_i}\le \frac{(\rho-\rho_{\textrm{cutoff}})} {(\rho_{\textrm{transition}} - \rho_{\textrm{cutoff}})} v_{\max} \end{align*}

where \(v_{\max}\) (MaxVelocityMagnitude) is the maximum allowed magnitude of the velocity. This prescription follows Appendix 2.d of [135] Note that we require \(\rho_{\textrm{transition}}\in(\rho_{\textrm{cutoff}}, 10\rho_{\textrm{atm}}]\)

Member Data Documentation

◆ help

template<size_t Dim>
constexpr Options::String VariableFixing::FixToAtmosphere< Dim >::help
staticconstexpr
Initial value:
= {
"If the rest mass density is below DensityCutoff, it is set\n"
"to DensityOfAtmosphere, and the pressure, and specific internal energy\n"
"(for one-dimensional equations of state) are\n"
"adjusted to satisfy the equation of state. For a two-dimensional\n"
"equation of state, the specific internal energy is set to zero.\n"
"In addition, the spatial velocity is set to zero, and the Lorentz\n"
"factor is set to one.\n"}

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