.TH "serif::operators::BarotropicHydrostaticEquilibrium" 3 "Version v0.0.1a" "SERiF" \" -*- nroff -*- .ad l .nh .SH NAME serif::operators::BarotropicHydrostaticEquilibrium \- The constraint balancing the pressure gradient, gravitational potential, and centrifugal potential\&. .SH SYNOPSIS .br .PP .PP \fR#include \fP .SS "Public Types" .in +1c .ti -1c .RI "using \fBTest\fP = \fBdiscretization::blocks::enthalpy::specific\fP" .br .RI "The test type is the model specific enthalpy, which is the quantity being constrained by the hydrostatic equilibrium equation\&. " .ti -1c .RI "using \fBResidualQuantity\fP = \fBdimensions::SpecificEnthalpy\fP" .br .RI "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\&. " .ti -1c .RI "using \fBPotential\fP = \fBdiscretization::blocks::gravity::potential\fP" .br .RI "We alias the gravitational potential to this type for convenience\&. " .ti -1c .RI "using \fBConstant\fP = \fBdiscretization::blocks::barotropic_constant::mass_normalization\fP" .br .RI "We alias the barotropic constant to this type for convenience\&. " .ti -1c .RI "using \fBAngularVelocity\fP = \fBdiscretization::blocks::rotation::angular_velocity\fP" .br .RI "We alias the angular velocity to this type for convenience\&. " .ti -1c .RI "using \fBOperands\fP" .br .RI "The operand here is a pack of the model specific enthalpy, the gravitational potential, the barotropic constant, and the angular velocity\&. " .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBBarotropicHydrostaticEquilibrium\fP (const \fBRigidRotation::Vector\fP &axis={0\&.0, 0\&.0, 1\&.0}, const \fBRigidRotation::Vector\fP ¢er={})" .br .RI "Construct a barotropic hydrostatic equilibrium equation\&. " .ti -1c .RI "PointLinearization< \fBOperands\fP > \fBevaluate\fP (const EquationPoint< \fBOperands\fP > &point) const" .br .RI "Evaluate h + Phi - Psi - C and its partial derivatives at a physical point\&. " .ti -1c .RI "template int \fBadditional_order\fP (OperandT, int position_order) const" .br .RI "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\&. " .in -1c .SS "Static Public Attributes" .in +1c .ti -1c .RI "static constexpr std::string_view \fBname\fP = 'hydrostatic equilibrium'" .br .RI "Compile time name for the hydrostatic equilibrium equation, used for debugging and logging\&. " .in -1c .SS "Private Attributes" .in +1c .ti -1c .RI "RigidRotation \fBm_rotation\fP" .br .RI "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\&. " .in -1c .SH "Detailed Description" .PP The constraint balancing the pressure gradient, gravitational potential, and centrifugal potential\&. .PP \fBTodo\fP .RS 4 This may make sense to break into smaller contributions in the same way as the displacement force equation does already\&. .RE .PP .PP 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\&. .PP Consider the strong form of this equation, generally .PP \[ \theta = -\left(\frac{1}{\rho}\right)\nabla P - \nabla \phi + \omega^2 s \] .PP where $s = \sqrt{x^2 + y^2}$ and is the cylindrical radius .PP In this particular equation we specialize this for a barotrope, for a barotrope .PP \[dh = \frac{dP}{\rho} \] therefore \[\nabla h = \frac{1}{\rho} \nabla P \] .PP Then .PP \[ \theta = -\nabla h - \nabla \phi + \omega^2 s \] or equivalently \[\theta = \nabla h + \nabla \phi - \omega^2 s \] .PP Then, in the corotating frame, we can define an effective potential $\psi = \frac{1}{2}\omega^{2}\left(x^{2} + y^{2}\right)$ .PP therefore .PP \[\theta = \nabla h + \nabla \phi - \nabla \psi = \nabla (h + \phi - \psi) \] .PP hence .PP \[h + \phi - \psi = C \] or \[h + \phi - \psi - C = 0 \] .PP 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\&. .PP 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 \fBTest\fP member\&. .PP 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 \fBOperands\fP member\&. .PP 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\&. .PP The implementation below shows these trivially .SH "Other Notes" .PP .IP "\(bu" 2 This is a particularly simple case as we start with a scalar valued operation\&. .IP "\(bu" 2 This equation does not use the \fBContributions\fP 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\&. .IP "\(bu" 2 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\&. .PP .SH "Member Typedef Documentation" .PP .SS "using \fBserif::equations::BarotropicHydrostaticEquilibrium::AngularVelocity\fP = \fBdiscretization::blocks::rotation::angular_velocity\fP" .PP We alias the angular velocity to this type for convenience\&. .SS "using \fBserif::equations::BarotropicHydrostaticEquilibrium::Constant\fP = \fBdiscretization::blocks::barotropic_constant::mass_normalization\fP" .PP We alias the barotropic constant to this type for convenience\&. .SS "using \fBserif::equations::BarotropicHydrostaticEquilibrium::Operands\fP" \fBInitial value:\fP .nf utils::types::TypeList< discretization::forms::Operand, discretization::forms::Operand, discretization::forms::Operand, discretization::forms::Operand > .PP .fi .PP 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\&. .SS "using \fBserif::equations::BarotropicHydrostaticEquilibrium::Potential\fP = \fBdiscretization::blocks::gravity::potential\fP" .PP We alias the gravitational potential to this type for convenience\&. .SS "using \fBserif::equations::BarotropicHydrostaticEquilibrium::ResidualQuantity\fP = \fBdimensions::SpecificEnthalpy\fP" .PP 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\&. .SS "using \fBserif::equations::BarotropicHydrostaticEquilibrium::Test\fP = \fBdiscretization::blocks::enthalpy::specific\fP" .PP The test type is the model specific enthalpy, which is the quantity being constrained by the hydrostatic equilibrium equation\&. .SH "Constructor & Destructor Documentation" .PP .SS "serif::equations::BarotropicHydrostaticEquilibrium::BarotropicHydrostaticEquilibrium (const \fBRigidRotation::Vector\fP & axis = \fR{0\&.0, 0\&.0, 1\&.0}\fP, const \fBRigidRotation::Vector\fP & center = \fR{}\fP)\fR [inline]\fP, \fR [explicit]\fP" .PP Construct a barotropic hydrostatic equilibrium equation\&. .PP \fBParameters\fP .RS 4 \fIaxis\fP The axis of rotation for the centrifugal potential\&. This is a vector in physical space\&. .br \fIcenter\fP The center of rotation for the centrifugal potential\&. This is a vector in physical space\&. .RE .PP \fBTodo\fP .RS 4 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)\&. .RE .PP .SH "Member Function Documentation" .PP .SS "template int serif::equations::BarotropicHydrostaticEquilibrium::additional_order (OperandT , int position_order) const\fR [inline]\fP, \fR [nodiscard]\fP" .PP 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\&. .PP \fBParameters\fP .RS 4 \fIoperand\fP The operand type for which to determine the additional quadrature order\&. .br \fIposition_order\fP The order of the position basis functions\&. .RE .PP \fBReturns\fP .RS 4 The additional quadrature order required for the given operand type\&. .RE .PP .SS "PointLinearization< \fBOperands\fP > serif::equations::BarotropicHydrostaticEquilibrium::evaluate (const EquationPoint< \fBOperands\fP > & point) const\fR [inline]\fP, \fR [nodiscard]\fP" .PP Evaluate h + Phi - Psi - C and its partial derivatives at a physical point\&. .SH "Member Data Documentation" .PP .SS "RigidRotation serif::equations::BarotropicHydrostaticEquilibrium::m_rotation\fR [private]\fP" .PP 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\&. .SS "std::string_view serif::equations::BarotropicHydrostaticEquilibrium::name = 'hydrostatic equilibrium'\fR [static]\fP, \fR [constexpr]\fP" .PP Compile time name for the hydrostatic equilibrium equation, used for debugging and logging\&. .SH "Author" .PP Generated automatically by Doxygen for SERiF from the source code\&.