SERiF v0.0.1a
Stellar Evolution and Rotation in Four Dimensions
Loading...
Searching...
No Matches
serif::eos::models::Polytrope Class Referencefinal

#include <polytropic.hpp>

Public Types

using Relations
 A type alias for the relation catalog that this EOS supports. This is used to determine which relations are valid for this EOS.
 

Public Member Functions

 Polytrope (const PolytropeParameters &parameters)
 Constructs a Polytrope with the given parameters.
 
 Polytrope (double n, double K)
 Constructs a Polytrope with the given polytropic index and constant.
 
double polytropic_index () const noexcept
 Returns the polytropic index of the equation of state.
 
double polytropic_constant () const noexcept
 Returns the polytropic constant of the equation of state.
 
double enthalpy_scale () const noexcept
 Returns the enthalpy scale of the equation of state. Note that this is calculated at construction time from the polytropic index and constant as h = (n + 1) * K.
 
dimensions::PressureValue evaluate (relations::PressureFromDensity, dimensions::DensityValue density) const
 Evaluate the pressure from the density.
 
dimensions::DensityValue evaluate (relations::DensityFromPressure, dimensions::PressureValue pressure) const
 Evaluate the density at a nonnegative pressure, including the vacuum trace.
 
dimensions::BarotropicPressurePotentialValue evaluate (relations::PressurePotentialFromDensity, dimensions::DensityValue density) const
 Evaluate the pressure primitive; for this EOS it equals the specific enthalpy and vanishes in vacuum.
 
dimensions::PressureValue evaluate (relations::PressureFromSpecificEnthalpy, dimensions::SpecificEnthalpyValue specific_enthalpy) const
 Evaluate the pressure from the specific enthalpy.
 
dimensions::SpecificEnthalpyValue evaluate (relations::SpecificEnthalpyFromDensity, dimensions::DensityValue density) const
 Evaluate the specific enthalpy from the density.
 
dimensions::SpecificEnthalpyValue evaluate (relations::SpecificEnthalpyFromPressure, dimensions::PressureValue pressure) const
 Evaluate the specific enthalpy from the pressure.
 
dimensions::DensityValue evaluate (relations::DensityFromSpecificEnthalpy, dimensions::SpecificEnthalpyValue specific_enthalpy) const
 Evaluate the density from the specific enthalpy.
 
dimensions::PartialDerivative< dimensions::MassDensity, dimensions::SpecificEnthalpy > partial_derivative (relations::DensityFromSpecificEnthalpy, dimensions::WithRespectTo< dimensions::SpecificEnthalpy >, dimensions::SpecificEnthalpyValue specific_enthalpy) const
 Evaluate the partial derivative of the density with respect to the specific enthalpy.
 
dimensions::PartialDerivative< dimensions::Pressure, dimensions::SpecificEnthalpy > partial_derivative (relations::PressureFromSpecificEnthalpy, dimensions::WithRespectTo< dimensions::SpecificEnthalpy >, dimensions::SpecificEnthalpyValue specific_enthalpy) const
 Evaluate the partial derivative of the pressure with respect to the specific enthalpy.
 
dimensions::PartialDerivative< dimensions::Pressure, dimensions::MassDensity > partial_derivative (relations::PressureFromDensity, dimensions::WithRespectTo< dimensions::MassDensity >, dimensions::DensityValue density) const
 Evaluate the partial derivative of the pressure with respect to the mass density.
 
dimensions::SecondPartialDerivative< dimensions::Pressure, dimensions::MassDensity, dimensions::MassDensity > second_partial_derivative (relations::PressureFromDensity, dimensions::WithRespectTo< dimensions::MassDensity >, dimensions::WithRespectTo< dimensions::MassDensity >, dimensions::DensityValue density) const
 Evaluate d²P/dρ²; for n > 1 its vacuum limit is singular and is rejected.
 

Private Attributes

double m_polytropic_index
 The polytropic index of the equation of state.
 
double m_polytropic_constant
 The polytropic constant of the equation of state.
 
double m_enthalpy_scale
 The enthalpy scale of the equation of state, calculated as (n + 1) * K.
 

Member Typedef Documentation

◆ Relations

Initial value:
>
Relation< dimensions::BarotropicPressurePotential, dimensions::MassDensity > PressurePotentialFromDensity
Evaluate A(density), whose derivative on the positive barotropic branch is (dP/density)/density.
Definition relations.hpp:22
Relation< dimensions::MassDensity, dimensions::SpecificEnthalpy > DensityFromSpecificEnthalpy
A relation to compute density from specific enthalpy.
Definition relations.hpp:26
Relation< dimensions::MassDensity, dimensions::Pressure > DensityFromPressure
A relation to compute density at a prescribed pressure.
Definition relations.hpp:15
Relation< dimensions::SpecificEnthalpy, dimensions::Pressure > SpecificEnthalpyFromPressure
A relation to compute specific enthalpy from pressure.
Definition relations.hpp:25
Relation< dimensions::Pressure, dimensions::MassDensity > PressureFromDensity
A relation to compute pressure from density.
Definition relations.hpp:14
Relation< dimensions::SpecificEnthalpy, dimensions::MassDensity > SpecificEnthalpyFromDensity
A relation to compute specific enthalpy from density.
Definition relations.hpp:24
Relation< dimensions::Pressure, dimensions::SpecificEnthalpy > PressureFromSpecificEnthalpy
A relation to compute pressure from specific enthalpy.
Definition relations.hpp:23
A struct to represent a catalog of relations between physical quantities. This is used to group relat...
Definition catalog.hpp:36

A type alias for the relation catalog that this EOS supports. This is used to determine which relations are valid for this EOS.

A polytropic EOS supports the following relations:

Constructor & Destructor Documentation

◆ Polytrope() [1/2]

serif::eos::models::Polytrope::Polytrope ( const PolytropeParameters & parameters)
explicit

Constructs a Polytrope with the given parameters.

Parameters
parametersThe parameters for the polytropic equation of state.

◆ Polytrope() [2/2]

serif::eos::models::Polytrope::Polytrope ( double n,
double K )
explicit

Constructs a Polytrope with the given polytropic index and constant.

Parameters
nThe polytropic index.
KThe polytropic constant.

Member Function Documentation

◆ enthalpy_scale()

double serif::eos::models::Polytrope::enthalpy_scale ( ) const
nodiscardnoexcept

Returns the enthalpy scale of the equation of state. Note that this is calculated at construction time from the polytropic index and constant as h = (n + 1) * K.

Returns
The enthalpy scale.

◆ evaluate() [1/7]

DensityValue serif::eos::models::Polytrope::evaluate ( relations::DensityFromPressure ,
dimensions::PressureValue pressure ) const
nodiscard

Evaluate the density at a nonnegative pressure, including the vacuum trace.

◆ evaluate() [2/7]

DensityValue serif::eos::models::Polytrope::evaluate ( relations::DensityFromSpecificEnthalpy ,
dimensions::SpecificEnthalpyValue specific_enthalpy ) const
nodiscard

Evaluate the density from the specific enthalpy.

Parameters
relationThe relation to evaluate (note that this is not used in the function but is used to constrain the overload being called).
specific_enthalpyThe specific enthalpy value to evaluate the density from.

◆ evaluate() [3/7]

PressureValue serif::eos::models::Polytrope::evaluate ( relations::PressureFromDensity ,
dimensions::DensityValue density ) const
nodiscard

Evaluate the pressure from the density.

Parameters
relationThe relation to evaluate (note that this is not used in the function but is used to constrain the overload being called).
densityThe density value to evaluate the pressure from.

◆ evaluate() [4/7]

PressureValue serif::eos::models::Polytrope::evaluate ( relations::PressureFromSpecificEnthalpy ,
dimensions::SpecificEnthalpyValue specific_enthalpy ) const
nodiscard

Evaluate the pressure from the specific enthalpy.

Parameters
relationThe relation to evaluate (note that this is not used in the function but is used to constrain the overload being called).
specific_enthalpyThe specific enthalpy value to evaluate the pressure from.

◆ evaluate() [5/7]

BarotropicPressurePotentialValue serif::eos::models::Polytrope::evaluate ( relations::PressurePotentialFromDensity ,
dimensions::DensityValue density ) const
nodiscard

Evaluate the pressure primitive; for this EOS it equals the specific enthalpy and vanishes in vacuum.

Reuse the polytropic enthalpy relation, which is also this EOS's pressure primitive.

◆ evaluate() [6/7]

SpecificEnthalpyValue serif::eos::models::Polytrope::evaluate ( relations::SpecificEnthalpyFromDensity ,
dimensions::DensityValue density ) const
nodiscard

Evaluate the specific enthalpy from the density.

Parameters
relationThe relation to evaluate (note that this is not used in the function but is used to constrain the overload being called).
densityThe density value to evaluate the specific enthalpy from.

◆ evaluate() [7/7]

SpecificEnthalpyValue serif::eos::models::Polytrope::evaluate ( relations::SpecificEnthalpyFromPressure ,
dimensions::PressureValue pressure ) const
nodiscard

Evaluate the specific enthalpy from the pressure.

Parameters
relationThe relation to evaluate (note that this is not used in the function but is used to constrain the overload being called).
pressureThe pressure value to evaluate the specific enthalpy from.

◆ partial_derivative() [1/3]

Evaluate the partial derivative of the density with respect to the specific enthalpy.

Parameters
relationThe relation to evaluate (note that this is not used in the function but is used to constrain the overload being called).
with_respect_toThe quantity to take the partial derivative with respect to (note that this is not used in the function but is used to constrain the overload being called).
specific_enthalpyThe specific enthalpy value to evaluate the partial derivative from.

◆ partial_derivative() [2/3]

PartialDerivative< Pressure, MassDensity > serif::eos::models::Polytrope::partial_derivative ( relations::PressureFromDensity ,
dimensions::WithRespectTo< dimensions::MassDensity > ,
dimensions::DensityValue density ) const
nodiscard

Evaluate the partial derivative of the pressure with respect to the mass density.

Parameters
relationThe relation to evaluate (note that this is not used in the function but is used to constrain the overload being called).
with_respect_toThe quantity to take the partial derivative with respect to (note that this is not used in the function but is used to constrain the overload being called).
densityThe density value to evaluate the partial derivative from.

◆ partial_derivative() [3/3]

Evaluate the partial derivative of the pressure with respect to the specific enthalpy.

Parameters
relationThe relation to evaluate (note that this is not used in the function but is used to constrain the overload being called).
with_respect_toThe quantity to take the partial derivative with respect to (note that this is not used in the function but is used to constrain the overload being called).
specific_enthalpyThe specific enthalpy value to evaluate the partial derivative from.

◆ polytropic_constant()

double serif::eos::models::Polytrope::polytropic_constant ( ) const
nodiscardnoexcept

Returns the polytropic constant of the equation of state.

Returns
The polytropic constant.

◆ polytropic_index()

double serif::eos::models::Polytrope::polytropic_index ( ) const
nodiscardnoexcept

Returns the polytropic index of the equation of state.

Returns
The polytropic index.

◆ second_partial_derivative()

Evaluate d²P/dρ²; for n > 1 its vacuum limit is singular and is rejected.

Member Data Documentation

◆ m_enthalpy_scale

double serif::eos::models::Polytrope::m_enthalpy_scale
private

The enthalpy scale of the equation of state, calculated as (n + 1) * K.

◆ m_polytropic_constant

double serif::eos::models::Polytrope::m_polytropic_constant
private

The polytropic constant of the equation of state.

◆ m_polytropic_index

double serif::eos::models::Polytrope::m_polytropic_index
private

The polytropic index of the equation of state.


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