|
SERiF v0.0.1a
Stellar Evolution and Rotation in Four Dimensions
|
The constraint balancing the pressure gradient, gravitational potential, and centrifugal potential. More...
#include <hydrostatic_equilibrium.hpp>
Public Types | |
| using | Test = discretization::blocks::enthalpy::specific |
| The test type is the model specific enthalpy, which is the quantity being constrained by the hydrostatic equilibrium equation. | |
| using | ResidualQuantity = dimensions::SpecificEnthalpy |
| The residual quantity is the specific enthalpy, which is the difference between the model specific enthalpy and the specific enthalpy given by the gravitational and centrifugal potentials. | |
| using | Potential = discretization::blocks::gravity::potential |
| We alias the gravitational potential to this type for convenience. | |
| using | Constant = discretization::blocks::barotropic_constant::mass_normalization |
| We alias the barotropic constant to this type for convenience. | |
| using | AngularVelocity = discretization::blocks::rotation::angular_velocity |
| We alias the angular velocity to this type for convenience. | |
| using | Operands |
| The operand here is a pack of the model specific enthalpy, the gravitational potential, the barotropic constant, and the angular velocity. | |
Public Member Functions | |
| BarotropicHydrostaticEquilibrium (const RigidRotation::Vector &axis={0.0, 0.0, 1.0}, const RigidRotation::Vector ¢er={}) | |
| Construct a barotropic hydrostatic equilibrium equation. | |
| PointLinearization< Operands > | evaluate (const EquationPoint< Operands > &point) const |
| Evaluate h + Phi - Psi - C and its partial derivatives at a physical point. | |
| template<typename OperandT> | |
| int | additional_order (OperandT, int position_order) const |
| Return the additional quadrature order required for the operands of this equation. If the operand has a functional space then the additional order is 2 * position_order - functional_space_order, otherwise it is 2 * position_order. | |
Static Public Attributes | |
| static constexpr std::string_view | name = "hydrostatic equilibrium" |
| Compile time name for the hydrostatic equilibrium equation, used for debugging and logging. | |
Private Attributes | |
| RigidRotation | m_rotation |
| The rigid rotation object used to compute the centrifugal potential and its gradient. This is constructed from the axis and center of rotation provided to the constructor. | |
The constraint balancing the pressure gradient, gravitational potential, and centrifugal potential.
If you are a physicist, astronomer, or general science goober looking to modify physics in SERiF this is likely a good place to start. Here we lay out a simple case of how to implement an equation.
Consider the strong form of this equation, generally
\[ \theta = -\left(\frac{1}{\rho}\right)\nabla P - \nabla \phi + \omega^2 s \]
where \(s = \sqrt{x^2 + y^2}\) and is the cylindrical radius
In this particular equation we specialize this for a barotrope, for a barotrope
\[dh = \frac{dP}{\rho} \]
therefore
\[\nabla h = \frac{1}{\rho} \nabla P \]
Then
\[ \theta = -\nabla h - \nabla \phi + \omega^2 s \]
or equivalently
\[\theta = \nabla h + \nabla \phi - \omega^2 s \]
Then, in the corotating frame, we can define an effective potential \(\psi = \frac{1}{2}\omega^{2}\left(x^{2} + y^{2}\right)\)
therefore
\[\theta = \nabla h + \nabla \phi - \nabla \psi = \nabla (h + \phi - \psi) \]
hence
\[h + \phi - \psi = C \]
or
\[h + \phi - \psi - C = 0 \]
This is a pointwise residual equation. Now broadly for finite element methods we need the weak form of this equation; this system is broadly and roughly intended to reduce friction. Look at the above equation then investigate HydrostaticEquilibrium::evaluate where we set the residual in the return value. The backend system integrates the produce of these residuals and a test function over a domain. The goal here is that the above step is where you as a research get to stop.
Now there are a few other things to specify here. For one which term does this residual contribute too. You must decide this however there are natural choices. In the case of HydrostaticEquilibrium the residual is a scalar and so it contributes to the enthalpy equation. You must alias the residual term to a Test member.
In addition to enthalpy computing the residual also depends on the gravitational potential, though the residual does not contribute to the gravitational potential equation. You must specify this dependency by listing the gravitational potential as an operand in the Operands member.
In addition to the residual there are a few additional derivatives that should be implemented or explicitly set to 0, broadly these should be a field derivative for each operand and, if the term has a spatial component, a position derivative.
The implementation below shows these trivially
| using serif::equations::BarotropicHydrostaticEquilibrium::AngularVelocity = discretization::blocks::rotation::angular_velocity |
We alias the angular velocity to this type for convenience.
| using serif::equations::BarotropicHydrostaticEquilibrium::Constant = discretization::blocks::barotropic_constant::mass_normalization |
We alias the barotropic constant to this type for convenience.
The operand here is a pack of the model specific enthalpy, the gravitational potential, the barotropic constant, and the angular velocity.
Think of this as saying that the residual for this equation depends on all of the things in this type list.
| using serif::equations::BarotropicHydrostaticEquilibrium::Potential = discretization::blocks::gravity::potential |
We alias the gravitational potential to this type for convenience.
| using serif::equations::BarotropicHydrostaticEquilibrium::ResidualQuantity = dimensions::SpecificEnthalpy |
The residual quantity is the specific enthalpy, which is the difference between the model specific enthalpy and the specific enthalpy given by the gravitational and centrifugal potentials.
| using serif::equations::BarotropicHydrostaticEquilibrium::Test = discretization::blocks::enthalpy::specific |
The test type is the model specific enthalpy, which is the quantity being constrained by the hydrostatic equilibrium equation.
|
inlineexplicit |
Construct a barotropic hydrostatic equilibrium equation.
| axis | The axis of rotation for the centrifugal potential. This is a vector in physical space. |
| center | The center of rotation for the centrifugal potential. This is a vector in physical space. |
|
inlinenodiscard |
Return the additional quadrature order required for the operands of this equation. If the operand has a functional space then the additional order is 2 * position_order - functional_space_order, otherwise it is 2 * position_order.
| operand | The operand type for which to determine the additional quadrature order. |
| position_order | The order of the position basis functions. |
|
inlinenodiscard |
Evaluate h + Phi - Psi - C and its partial derivatives at a physical point.
|
private |
The rigid rotation object used to compute the centrifugal potential and its gradient. This is constructed from the axis and center of rotation provided to the constructor.
|
staticconstexpr |
Compile time name for the hydrostatic equilibrium equation, used for debugging and logging.