SpECTRE  v2024.04.12
NewtonianEuler::Limiters::Weno< VolumeDim > Class Template Reference

A compact-stencil WENO limiter for the NewtonianEuler system. More...

#include <Weno.hpp>

Classes

struct  ApplyFlattener
 
struct  KxrcfConstant
 
struct  TvbConstant
 
struct  VariablesToLimit
 

Public Types

using ConservativeVarsWeno = ::Limiters::Weno< VolumeDim, tmpl::list< NewtonianEuler::Tags::MassDensityCons, NewtonianEuler::Tags::MomentumDensity< VolumeDim >, NewtonianEuler::Tags::EnergyDensity > >
 
using options = tmpl::list< typename ConservativeVarsWeno::Type, VariablesToLimit, typename ConservativeVarsWeno::NeighborWeight, TvbConstant, KxrcfConstant, ApplyFlattener, typename ConservativeVarsWeno::DisableForDebugging >
 
using PackagedData = typename ConservativeVarsWeno::PackagedData
 
using package_argument_tags = typename ConservativeVarsWeno::package_argument_tags
 
using limit_tags = tmpl::list< NewtonianEuler::Tags::MassDensityCons, NewtonianEuler::Tags::MomentumDensity< VolumeDim >, NewtonianEuler::Tags::EnergyDensity >
 
using limit_argument_tags = tmpl::list< domain::Tags::Mesh< VolumeDim >, domain::Tags::Element< VolumeDim >, domain::Tags::SizeOfElement< VolumeDim >, domain::Tags::DetInvJacobian< Frame::ElementLogical, Frame::Inertial >, evolution::dg::Tags::NormalCovectorAndMagnitude< VolumeDim >, ::hydro::Tags::EquationOfState< false, 2 > >
 

Public Member Functions

 Weno (::Limiters::WenoType weno_type, NewtonianEuler::Limiters::VariablesToLimit vars_to_limit, double neighbor_linear_weight, std::optional< double > tvb_constant, std::optional< double > kxrcf_constant, bool apply_flattener, bool disable_for_debugging=false, const Options::Context &context={})
 
 Weno (const Weno &)=default
 
Wenooperator= (const Weno &)=default
 
 Weno (Weno &&)=default
 
Wenooperator= (Weno &&)=default
 
void pup (PUP::er &p)
 
void package_data (gsl::not_null< PackagedData * > packaged_data, const Scalar< DataVector > &mass_density_cons, const tnsr::I< DataVector, VolumeDim > &momentum_density, const Scalar< DataVector > &energy_density, const Mesh< VolumeDim > &mesh, const std::array< double, VolumeDim > &element_size, const OrientationMap< VolumeDim > &orientation_map) const
 Package data for sending to neighbor elements.
 
bool operator() (gsl::not_null< Scalar< DataVector > * > mass_density_cons, gsl::not_null< tnsr::I< DataVector, VolumeDim > * > momentum_density, gsl::not_null< Scalar< DataVector > * > energy_density, const Mesh< VolumeDim > &mesh, const Element< VolumeDim > &element, const std::array< double, VolumeDim > &element_size, const Scalar< DataVector > &det_inv_logical_to_inertial_jacobian, const typename evolution::dg::Tags::NormalCovectorAndMagnitude< VolumeDim >::type &normals_and_magnitudes, const EquationsOfState::EquationOfState< false, 2 > &equation_of_state, const std::unordered_map< DirectionalId< VolumeDim >, PackagedData, boost::hash< DirectionalId< VolumeDim > > > &neighbor_data) const
 Limit the solution on the element.
 

Static Public Member Functions

static std::string name ()
 

Static Public Attributes

static constexpr Options::String help
 

Friends

template<size_t LocalDim>
bool operator== (const Weno< LocalDim > &lhs, const Weno< LocalDim > &rhs)
 

Detailed Description

template<size_t VolumeDim>
class NewtonianEuler::Limiters::Weno< VolumeDim >

A compact-stencil WENO limiter for the NewtonianEuler system.

Implements the simple WENO limiter of [193] and the Hermite WENO (HWENO) limiter of [194]. See the documentation of the system-agnostic Limiters::Weno limiter for a general discussion of the algorithm and the various options that control the action of the limiter. This implemention is specialized to the NewtonianEuler evolution system. By specializing the limiter to the system, we can add a few features that improve its robustness:

  • the troubled-cell indicator (TCI) can be specialized to the features of the evolution system.
  • the limiter can be applied to the system's characteristic variables. This is the recommendation of the reference, because it reduces spurious oscillations in the post-limiter solution.
  • after limiting, the solution can be processed to remove any remaining unphysical values like negative densities and pressures. We do this by scaling the solution around its mean (a "flattener" or "bounds-preserving" filter). Note: the flattener is applied to all elements, including those where the limiter did not act to reduce the solution's slopes.

The matrix of TCI, variables to limit, post-processing, etc. choices can rapidly grow large. Here we reduce the possibilities by tying the TCI to the limiter in keeping with each limiter's main reference: HWENO uses the KXRCF TCI and simple WENO uses the TVB TCI. To fully explore the matrix of possibilities, the source code could be generalized — however, experience suggests it is unlikely that there exists one combination that will perform remarkably better than the others.

Member Data Documentation

◆ help

template<size_t VolumeDim>
constexpr Options::String NewtonianEuler::Limiters::Weno< VolumeDim >::help
staticconstexpr
Initial value:
= {
"A WENO limiter specialized to the NewtonianEuler system"}

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