SERiF v0.0.1a
Stellar Evolution and Rotation in Four Dimensions
Loading...
Searching...
No Matches
serif::equations::BarotropicClosure< EOST > Class Template Referencefinal

#include <barotropic_closure.hpp>

Collaboration diagram for serif::equations::BarotropicClosure< EOST >:
[legend]

Public Types

using Test = discretization::blocks::density::mass
 The test type is the model density, which is the quantity being constrained by the barotropic closure.
 
using ResidualQuantity = dimensions::MassDensity
 The residual quantity is the mass density, which is the difference between the model density and the density given by the equation of state.
 
using Enthalpy = discretization::blocks::enthalpy::specific
 The enthalpy type is the model specific enthalpy, which is the quantity being used to compute the density from the equation of state. Really this is just an alias.
 
using Operands = utils::types::TypeList<discretization::forms::Operand<Test>, discretization::forms::Operand<Enthalpy>>
 The operand here is a pack of the model mass density and the model enthalpy.
 

Public Member Functions

 BarotropicClosure (EOST equation_of_state, const double enthalpy_power)
 Construct a barotropic closure equation.
 
 BarotropicClosure (EOST equation_of_state)
 Construct a barotropic closure equation for a polytropic equation of state.
 
PointLinearization< Operands > evaluate (const EquationPoint< Operands > &point) const
 Evaluate the barotropic closure equation point-wise integrand and its partial derivatives.
 
template<typename OperandT>
int additional_order (OperandT, int) const
 Return the additional quadrature order required for the barotropic closure equation.
 

Static Public Attributes

static constexpr std::string_view name = "barotropic closure"
 Compile time name for the barotropic closure equation, used for debugging and logging.
 

Private Attributes

EOST m_eos
 The equation of state to use for the barotropic closure. (.
 
double m_enthalpy_power
 The power of the enthalpy to use for the quadrature. Must be positive and finite. This is only used if the additional_order method is called.
 

Detailed Description

template<eos::models::BarotropicClosureEOS EOST>
class serif::equations::BarotropicClosure< EOST >
Template Parameters
EOSTThe equation of state type, this must satisfy the BarotropicClosureEOS concept. The requires section below lays out what the BarotriopicClosureEOS concept requires.
Requirements
  • The equation of state type must publish a valid Relation catalog
  • The equation of state type must implement all relations required by the catalog it publishes
  • The equation of state type must support the relation density from specific enthalpy
  • The equation of state type must support the partial deriviative density from specific enthalpy with respect to specific enthalpy

In a barotropic model surfaces of constant pressure coincide with surfaces of constant density and constant specific enthalpy. The barotropic closure equation enforces that the density of the model argrees with the density of the the equation of state given the model specific enthalpy. Put another way, for a barotropic model, this equation is what enforces that the ethalpy and density must be consistent with each other and with the equation of state. The residual is given by \( \rho - \rho_{\text{EOS}}(h) \), where \( \rho \) is the model density, \( h \) is the model specific enthalpy.

The partial derivatives implemented are

  • \( \frac{\partial r}{\partial \rho} = 1 \)
  • \( \frac{\partial \rho}{\partial h} = -\frac{\partial \rho_{\text{EOS}}(h)}{\partial h} \)
Note
The eos derivative is implemented by the eos::partial_derivative function and is up to the eos model to implement correctly.

Member Typedef Documentation

◆ Enthalpy

template<eos::models::BarotropicClosureEOS EOST>
using serif::equations::BarotropicClosure< EOST >::Enthalpy = discretization::blocks::enthalpy::specific

The enthalpy type is the model specific enthalpy, which is the quantity being used to compute the density from the equation of state. Really this is just an alias.

◆ Operands

template<eos::models::BarotropicClosureEOS EOST>
using serif::equations::BarotropicClosure< EOST >::Operands = utils::types::TypeList<discretization::forms::Operand<Test>, discretization::forms::Operand<Enthalpy>>

The operand here is a pack of the model mass density and the model enthalpy.

◆ ResidualQuantity

template<eos::models::BarotropicClosureEOS EOST>
using serif::equations::BarotropicClosure< EOST >::ResidualQuantity = dimensions::MassDensity

The residual quantity is the mass density, which is the difference between the model density and the density given by the equation of state.

◆ Test

template<eos::models::BarotropicClosureEOS EOST>
using serif::equations::BarotropicClosure< EOST >::Test = discretization::blocks::density::mass

The test type is the model density, which is the quantity being constrained by the barotropic closure.

Constructor & Destructor Documentation

◆ BarotropicClosure() [1/2]

template<eos::models::BarotropicClosureEOS EOST>
serif::equations::BarotropicClosure< EOST >::BarotropicClosure ( EOST equation_of_state,
const double enthalpy_power )
inlineexplicit

Construct a barotropic closure equation.

Parameters
equation_of_stateThe equation of state to use for the closure.
enthalpy_powerThe power of the enthalpy to use for the quadrature. Must be positive and finite. This is only used if the additional_order method is called.
Exceptions
std::invalid_argumentIf the enthalpy power is not positive and finite.
Todo
should we add a requires that the equation of state is the same as eos::models::Polytrope here?

◆ BarotropicClosure() [2/2]

template<eos::models::BarotropicClosureEOS EOST>
serif::equations::BarotropicClosure< EOST >::BarotropicClosure ( EOST equation_of_state)
inlineexplicit

Construct a barotropic closure equation for a polytropic equation of state.

Parameters
equation_of_stateThe polytropic equation of state to use for the closure.
Requirements
  • The equation of state type must be a polytropic equation of state.
Note
This constructor is only available for polytropic equations of state. It uses the polytropic index as the enthalpy power.
Generally this is the constructor that you should likely use.

Member Function Documentation

◆ additional_order()

template<eos::models::BarotropicClosureEOS EOST>
template<typename OperandT>
int serif::equations::BarotropicClosure< EOST >::additional_order ( OperandT ,
int  ) const
inlinenodiscard

Return the additional quadrature order required for the barotropic closure equation.

The additional order is calculated as \( \text{order} = \text{density order} + 2 \times \text{position order} \), where the density order is the order of the functional space of the model density, and the position order is the order of the position functional space.

Template Parameters
OperandTThe operand type for which to calculate the additional order. This is only used to determine if the operand is the enthalpy or not. If not enthalpy then the additional order is returned as 0.
Parameters
operandThe operand type for which to calculate the additional order. This is only used to determine if the operand is the enthalpy or not. If not enthalpy then the additional order is returned as 0.
position_orderThe order of the position functional space.
Returns
The additional quadrature order required for the barotropic closure equation.
Exceptions
std::invalid_argumentIf the extra order exceeds the supported range of int.

◆ evaluate()

template<eos::models::BarotropicClosureEOS EOST>
PointLinearization< Operands > serif::equations::BarotropicClosure< EOST >::evaluate ( const EquationPoint< Operands > & point) const
inlinenodiscard

Evaluate the barotropic closure equation point-wise integrand and its partial derivatives.

The point-wise integrand is calculated as \( \rho - \rho_{\text{EOS}}(h) \), where \( \rho \) is the model density, and \( h \) is the model specific enthalpy. The partial derivatives are calculated as:

  • \( \frac{\partial r}{\partial \rho} = 1 \)
  • \( \frac{\partial \rho}{\partial h} = -\frac{\partial \rho_{\text{EOS}}(h)}{\partial h} \)
Parameters
pointThe point at which to evaluate the equation.
Returns
The point-wise linearization of the barotropic closure equation, which contains the residual and the partial derivatives with respect to the model density and enthalpy.
Exceptions
eos::EOSEvaluationErrorIf the density or enthalpy are not finite, or if the enthalpy is negative, or if the equation of state returns a non-finite density or derivative.

Member Data Documentation

◆ m_enthalpy_power

template<eos::models::BarotropicClosureEOS EOST>
double serif::equations::BarotropicClosure< EOST >::m_enthalpy_power
private

The power of the enthalpy to use for the quadrature. Must be positive and finite. This is only used if the additional_order method is called.

◆ m_eos

template<eos::models::BarotropicClosureEOS EOST>
EOST serif::equations::BarotropicClosure< EOST >::m_eos
private

The equation of state to use for the barotropic closure. (.

Todo
should this be a reference?)

◆ name

template<eos::models::BarotropicClosureEOS EOST>
std::string_view serif::equations::BarotropicClosure< EOST >::name = "barotropic closure"
staticconstexpr

Compile time name for the barotropic closure equation, used for debugging and logging.


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