SpECTRE  v2025.08.19
VariableFixing::FixToAtmosphere< Dim >::KappaLimitingOptions Struct Reference

Options for limiting the temperature in the atmosphere by effectively limiting the polytropic constant, with a generalization for finite temperature equations of state. More...

#include <FixToAtmosphere.hpp>

Classes

struct  DensityLowerBound
 
struct  DensityUpperBound
 
struct  EplisonKappaMinus
 
struct  EpsilonKappaMax
 
struct  LimitAboveDensityUpperBound
 
struct  MinTemperature
 

Public Types

using options = tmpl::list< DensityLowerBound, EplisonKappaMinus, DensityUpperBound, EpsilonKappaMax, MinTemperature, LimitAboveDensityUpperBound >
 

Public Member Functions

void pup (PUP::er &p)
 
bool operator== (const KappaLimitingOptions &rhs) const
 
bool operator!= (const KappaLimitingOptions &rhs) const
 

Public Attributes

double density_lower_bound {std::numeric_limits<double>::signaling_NaN()}
 
double eplison_kappa_minus {std::numeric_limits<double>::signaling_NaN()}
 
double density_upper_bound {std::numeric_limits<double>::signaling_NaN()}
 
double epsilon_kappa_max {std::numeric_limits<double>::signaling_NaN()}
 
std::optional< double > min_temperature {std::nullopt}
 
bool limit_above_density_upper_bound {false}
 

Static Public Attributes

static constexpr Options::String help
 

Detailed Description

template<size_t Dim>
struct VariableFixing::FixToAtmosphere< Dim >::KappaLimitingOptions

Options for limiting the temperature in the atmosphere by effectively limiting the polytropic constant, with a generalization for finite temperature equations of state.

The basic density limit is fine for a cold EOS, but when a finite temperature EOS is used the temperature needs to be controlled in the atmosphere. While the basic bound of \(T\in[T_{\mathrm{min}},T_{\mathrm{max}}]\) is a necessary condition, it is often not sufficient for stability in the atmosphere. We define lower and upper bounds \(\rho_{\tau_-}\) and \(\rho_{\tau_+}\) for \(\rho\) where we apply different limiting behavior when \(\rho<\rho_{\tau_-}\), \(\rho\in[\rho_{\tau_-},\rho_{\tau_+}]\), and \(\rho>\rho_{\tau_+}\).

When \(\rho<\rho_{\tau_-}\) we set \(T=T_{\mathrm{min}}\) if \(|T-T_{\mathrm{min}}|>\epsilon_{\kappa_-} |T|\), otherwise we don't change \(T\). SpEC uses \(\epsilon_{\kappa_-}=10^{-3}\).

When \(\rho\in[\rho_{\tau_-},\rho_{\tau_+}]\) we apply a more complicated algorithm. We define

\begin{align*} \kappa_{\mathrm{max}} = 1 + \epsilon_{\kappa,\mathrm{max}} \min\left(\frac{\rho-\rho_{\tau_-}}{\rho_{\tau_+}-\rho_{\tau_-}},1\right) \end{align*}

where \(\epsilon_{\kappa,\mathrm{max}}\ge0\) (set to 0.01 in SpEC). With \(\kappa_{\mathrm{max}}\) computed we now limit the temperature. We define \(p_{\mathrm{min}}=p(\rho,T_{\mathrm{min}},Y_e)\), \(p=p(\rho,T,Y_e)\), and \(p_{\kappa_{\mathrm{max}}}=p_{\mathrm{min}}\kappa_{\mathrm{max}}\). We then need to find \(T\) such that \(p(\rho, T, Y_e) = p_{\kappa_{\mathrm{max}}}\). We do this by finding the root of

\begin{align*} f(T')=p(\rho, T', Y_e) - p_{\kappa_{\mathrm{max}}}. \end{align*}

We bracket the temperature \(T'\in[T_{\min}, T]\), where \(T\) is the unmodified temperature. We solve the equation using the TOMS748 algorithm to avoid the need for derivatives of the pressure with respect to the temperature. If \(T-T_{\min}<10^{-13}\) we set \(T'=\frac{1}{2}(T+T_{\min})\) to avoid any root find.

When \(\rho>\rho_{\tau_+}\) we optionally can apply the same procedure as in the previous case, but with \(\kappa_\mathrm{max}=1+\epsilon_{\kappa,\mathrm{max}}\). This is not typically done.

Member Data Documentation

◆ help

template<size_t Dim>
constexpr Options::String VariableFixing::FixToAtmosphere< Dim >::KappaLimitingOptions::help
staticconstexpr
Initial value:
= {
"If set then we apply a limiting precodure on the temperature near the "
"atmosphere based on essentially limiting the polytropic constant in a "
"Gamma-law equation of state."}

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