SpECTRE  v2024.04.12
grmhd::ValenciaDivClean::Flattener< RecoverySchemesList > Class Template Reference

Reduces oscillations inside an element in an attempt to guarantee a physical solution of the conserved variables for which the primitive variables can be recovered. More...

#include <Flattener.hpp>

Classes

struct  RecoverPrimitives
 If true, then the primitive variables are updated at the end of the function. More...
 
struct  RequirePhysicalMeanTildeTau
 Require that the mean of TildeTau is physical, otherwise terminate the simulation. More...
 
struct  RequirePositiveMeanTildeD
 Require that the mean of TildeD is positive, otherwise terminate the simulation. More...
 
struct  RequirePositiveMeanTildeYe
 Require that the mean of TildeYe is positive, otherwise terminate the simulation. More...
 

Public Types

using options = tmpl::list< RequirePositiveMeanTildeD, RequirePositiveMeanTildeYe, RequirePhysicalMeanTildeTau, RecoverPrimitives >
 
using return_tags = tmpl::list< Tags::TildeD, Tags::TildeYe, Tags::TildeTau, Tags::TildeS< Frame::Inertial >, ::Tags::Variables< hydro::grmhd_tags< DataVector > > >
 
using argument_tags = tmpl::list< Tags::TildeB<>, Tags::TildePhi, gr::Tags::SqrtDetSpatialMetric< DataVector >, gr::Tags::SpatialMetric< DataVector, 3 >, gr::Tags::InverseSpatialMetric< DataVector, 3 >, domain::Tags::Mesh< 3 >, domain::Tags::DetInvJacobian< Frame::ElementLogical, Frame::Inertial >, hydro::Tags::GrmhdEquationOfState, grmhd::ValenciaDivClean::Tags::PrimitiveFromConservativeOptions >
 

Public Member Functions

 Flattener (bool require_positive_mean_tilde_d, bool require_positive_mean_tilde_ye, bool require_physical_mean_tilde_tau, bool recover_primitives)
 
 Flattener (const Flattener &)=default
 
Flatteneroperator= (const Flattener &)=default
 
 Flattener (Flattener &&)=default
 
Flatteneroperator= (Flattener &&)=default
 
void pup (PUP::er &p)
 
void operator() (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 > * > tilde_s, gsl::not_null< Variables< hydro::grmhd_tags< DataVector > > * > primitives, const tnsr::I< DataVector, 3, Frame::Inertial > &tilde_b, const Scalar< DataVector > &tilde_phi, const Scalar< DataVector > &sqrt_det_spatial_metric, const tnsr::ii< DataVector, 3, Frame::Inertial > &spatial_metric, const tnsr::II< DataVector, 3, Frame::Inertial > &inv_spatial_metric, const Mesh< 3 > &mesh, const Scalar< DataVector > &det_logical_to_inertial_inv_jacobian, const EquationsOfState::EquationOfState< true, 3 > &eos, const grmhd::ValenciaDivClean::PrimitiveFromConservativeOptions &primitive_from_conservative_options) const
 

Static Public Attributes

static constexpr Options::String help
 

Friends

template<typename LocalRecoverySchemesList >
bool operator== (const Flattener< LocalRecoverySchemesList > &lhs, const Flattener< LocalRecoverySchemesList > &rhs)
 

Detailed Description

template<typename RecoverySchemesList>
class grmhd::ValenciaDivClean::Flattener< RecoverySchemesList >

Reduces oscillations inside an element in an attempt to guarantee a physical solution of the conserved variables for which the primitive variables can be recovered.

The algorithm uses the conditions of FixConservatives on \(\tilde{D}\) and \(\tilde{\tau}\) to reduce oscillations inside an element. Oscillations are reduced by rescaling the conserved variables about the mean to bring them into the required range. When rescaling \(\tilde{D}\) because it is negative, it is important to also rescale \(\tilde{\tau}\) and \(\tilde{S}_i\) by the same amount. At least, this is what is observed in the cylindrical blast wave test problem.

This currently doesn't use the check on \(\tilde{S}^2\), but instead checks that the primitive variables can be recovered. If the primitives cannot be recovered then we flatten to the mean values in the element.

Member Data Documentation

◆ help

template<typename RecoverySchemesList >
constexpr Options::String grmhd::ValenciaDivClean::Flattener< RecoverySchemesList >::help
staticconstexpr
Initial value:
= {
"Reduces oscillations (flattens) the conserved variables according to "
"the variable fixing procedure described in Foucart's thesis.\n"}

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