SpECTRE
v2025.01.30
|
Limiters to control shocks and surfaces in the solution. More...
Namespaces | |
namespace | Limiters |
Things relating to limiting. | |
namespace | Limiters::Tci |
Troubled Cell Indicators that identify when limiting is needed. | |
Classes | |
class | Limiters::Krivodonova< VolumeDim, tmpl::list< Tags... > > |
An implementation of the Krivodonova limiter. More... | |
class | Limiters::Minmod< VolumeDim, TagsToLimit > |
A minmod-based generalized slope limiter. More... | |
class | Limiters::Weno< VolumeDim, TagsToLimit > |
A compact-stencil WENO limiter for DG. More... | |
class | NewtonianEuler::Limiters::Minmod< VolumeDim > |
A minmod-based generalized slope limiter for the NewtonianEuler system. More... | |
class | NewtonianEuler::Limiters::Weno< VolumeDim > |
A compact-stencil WENO limiter for the NewtonianEuler system. More... | |
struct | Limiters::Tags::LimiterCommunicationTag< Metavariables > |
The inbox tag for limiter communication. More... | |
struct | Limiters::Actions::Limit< Metavariables > |
Receive limiter data from neighbors, then apply limiter. More... | |
struct | Limiters::Actions::SendData< Metavariables > |
Send local data needed for limiting. More... | |
Enumerations | |
enum class | Limiters::MinmodType { LambdaPi1 , LambdaPiN , Muscl } |
Possible types of the minmod slope limiter and/or troubled-cell indicator. More... | |
enum class | Limiters::WenoType { Hweno , SimpleWeno } |
Possible types of the WENO limiter. More... | |
enum class | NewtonianEuler::Limiters::FlattenerAction { NoOp = 0 , ScaledSolution = 1 , SetSolutionToMean = 2 } |
Encodes the action taken by flatten_solution | |
enum class | NewtonianEuler::Limiters::VariablesToLimit { Conserved , Characteristic , NumericalCharacteristic } |
Type of NewtonianEuler variables to apply limiter to. More... | |
Functions | |
template<size_t VolumeDim> | |
FlattenerAction | NewtonianEuler::Limiters::flatten_solution (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 Scalar< DataVector > &det_logical_to_inertial_jacobian, const EquationsOfState::EquationOfState< false, 2 > &equation_of_state) |
Scale a NewtonianEuler solution around its mean to remove pointwise positivity violations. More... | |
template<size_t VolumeDim, typename PackagedData > | |
bool | NewtonianEuler::Limiters::Tci::kxrcf_indicator (const double kxrcf_constant, const Scalar< DataVector > &cons_mass_density, const tnsr::I< DataVector, VolumeDim > &cons_momentum_density, const Scalar< DataVector > &cons_energy_density, const Mesh< VolumeDim > &mesh, const Element< VolumeDim > &element, const std::array< double, VolumeDim > &element_size, const Scalar< DataVector > &det_logical_to_inertial_jacobian, const typename evolution::dg::Tags::NormalCovectorAndMagnitude< VolumeDim >::type &normals_and_magnitudes, const std::unordered_map< DirectionalId< VolumeDim >, PackagedData, boost::hash< DirectionalId< VolumeDim > > > &neighbor_data) |
Implements the troubled-cell indicator from Krivodonova et al, 2004. More... | |
Limiters to control shocks and surfaces in the solution.
|
strong |
Possible types of the minmod slope limiter and/or troubled-cell indicator.
|
strong |
Type of NewtonianEuler variables to apply limiter to.
Characteristic
denotes the characteristic fields computed from the analytic expression, whereas the option NumericalCharacteristic
denotes the fields as computed numerically by solving for the eigenvectors of the flux Jacobian.Initial experiments with limiting in a Reimann problem by FH suggest the numerical eigenvectors can sometimes produce more accurate results than the analytic ones (does the numerical solution give a better linear combination of the degenerate eigenvectors?), and is not too much more expensive (probably the expense of the limiter as a whole dominates). More testing is needed to verify and understand this...
|
strong |
Possible types of the WENO limiter.
FlattenerAction NewtonianEuler::Limiters::flatten_solution | ( | 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 Scalar< DataVector > & | det_logical_to_inertial_jacobian, | ||
const EquationsOfState::EquationOfState< false, 2 > & | equation_of_state | ||
) |
Scale a NewtonianEuler solution around its mean to remove pointwise positivity violations.
If the solution has points with negative density, scales the solution to make these points positive again. For each component \(u\) of the solution, the scaling takes the form \(u \to \bar{u} + \theta (u - \bar{u})\), where \(\bar{u}\) is the cell-average value of \(u\), and \(\theta\) is a factor less than 1, chosen to restore positive density. The cell averages in this implementation are computed in inertial coordinates, so the flattener is conservative even on deformed grids.
A scaling of this form used to restore positivity is usually called a flattener (we use this name) or a bounds-preserving filter. Note that the scaling approach only works if the cell-averaged solution is itself physical, in other words, if the cell-averaged density is positive.
After checking for (and correcting) negative densities, if the equation of state is two-dimensional, then the pressure is also checked for positivity. If negative pressures are found, each solution component is set to its mean (this is equivalent to \(\theta = 0\) in the scaling form above). In principle, a less aggressive scaling could be used, but solving for the correct \(\theta\) in this case is more involved.
bool NewtonianEuler::Limiters::Tci::kxrcf_indicator | ( | const double | kxrcf_constant, |
const Scalar< DataVector > & | cons_mass_density, | ||
const tnsr::I< DataVector, VolumeDim > & | cons_momentum_density, | ||
const Scalar< DataVector > & | cons_energy_density, | ||
const Mesh< VolumeDim > & | mesh, | ||
const Element< VolumeDim > & | element, | ||
const std::array< double, VolumeDim > & | element_size, | ||
const Scalar< DataVector > & | det_logical_to_inertial_jacobian, | ||
const typename evolution::dg::Tags::NormalCovectorAndMagnitude< VolumeDim >::type & | normals_and_magnitudes, | ||
const std::unordered_map< DirectionalId< VolumeDim >, PackagedData, boost::hash< DirectionalId< VolumeDim > > > & | neighbor_data | ||
) |
Implements the troubled-cell indicator from Krivodonova et al, 2004.
The KXRCF (these are the author initials) TCI is described in [118].
In summary, this TCI uses the size of discontinuities between neighboring DG elements to determine the smoothness of the solution. This works because the discontinuities converge rapidly for smooth solutions, therefore a large discontinuity suggests a lack of smoothness and the need to apply a limiter.
The reference sets the constant we call kxrcf_constant
to 1. This should generally be a good threshold to use, though it might not be the optimal value (in balancing robustness vs accuracy) for any particular problem.
This implementation