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

The constraint balancing the pressure gradient, gravitational potential, and centrifugal potential. More...

#include <hydrostatic_equilibrium.hpp>

Collaboration diagram for serif::operators::BarotropicHydrostaticEquilibrium:
[legend]

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 &center={})
 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.
 

Detailed Description

The constraint balancing the pressure gradient, gravitational potential, and centrifugal potential.

Todo
This may make sense to break into smaller contributions in the same way as the displacement force equation does already.

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

Other Notes

  • This is a particularly simple case as we start with a scalar valued operation.
  • This equation does not use the Contributions system (mostly this is because I wrote this equation first before I wrote the contribution system). There is a benefit to this in so far as I think it makes it a bit more approachable initially as it is more self contained; however, it does break the pattern that other equations use.
  • This is very much a place where the polytropic assumption has slipped in. This equation will need to be reworked or replaced to move beyond polytropes.

Member Typedef Documentation

◆ AngularVelocity

◆ Constant

◆ Operands

Initial value:
>
Compile time representation of some operand. An operand associates a term to an operation type (e....
Definition operands.hpp:113
Definition type_list.hpp:5

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.

◆ Potential

We alias the gravitational potential to this type for convenience.

◆ ResidualQuantity

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.

◆ Test

The test type is the model specific enthalpy, which is the quantity being constrained by the hydrostatic equilibrium equation.

Constructor & Destructor Documentation

◆ BarotropicHydrostaticEquilibrium()

serif::equations::BarotropicHydrostaticEquilibrium::BarotropicHydrostaticEquilibrium ( const RigidRotation::Vector & axis = {0.0, 0.0, 1.0},
const RigidRotation::Vector & center = {} )
inlineexplicit

Construct a barotropic hydrostatic equilibrium equation.

Parameters
axisThe axis of rotation for the centrifugal potential. This is a vector in physical space.
centerThe center of rotation for the centrifugal potential. This is a vector in physical space.
Todo
Currently there is nothing constraining this axis or position to agree with the axis and center or rotation set in the force equation. The defaults are the same; however, we should introduce some system to ensure that these agree and that if they dont agree an error is thrown (since I cannot imagine any world in which a reasonable model would have these disagree).

Member Function Documentation

◆ additional_order()

template<typename OperandT>
int serif::equations::BarotropicHydrostaticEquilibrium::additional_order ( OperandT ,
int position_order ) const
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.

Parameters
operandThe operand type for which to determine the additional quadrature order.
position_orderThe order of the position basis functions.
Returns
The additional quadrature order required for the given operand type.

◆ evaluate()

PointLinearization< Operands > serif::equations::BarotropicHydrostaticEquilibrium::evaluate ( const EquationPoint< Operands > & point) const
inlinenodiscard

Evaluate h + Phi - Psi - C and its partial derivatives at a physical point.

Member Data Documentation

◆ m_rotation

RigidRotation serif::equations::BarotropicHydrostaticEquilibrium::m_rotation
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.

◆ name

std::string_view serif::equations::BarotropicHydrostaticEquilibrium::name = "hydrostatic equilibrium"
staticconstexpr

Compile time name for the hydrostatic equilibrium equation, used for debugging and logging.


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