400 lines
10 KiB
C++
400 lines
10 KiB
C++
#pragma once
|
|
/**
|
|
* @file dimensions.hpp
|
|
* @author Emily M. Boudreaux
|
|
*
|
|
* @brief File containing prue dimensions. Note that this is not intended to be (nor does it
|
|
* have the capability to be) a general dimensional analysis library. There is no
|
|
* understanding here that, for example, a dimension of length^2 is an area. Rather,
|
|
* the purpose of this is to force developers to be explicit about what values they
|
|
* are passing to what functions. Further, most of this system is built to be compile
|
|
* time constant. This means that the compiler can still apply many optimizations. Note
|
|
* that the dimensions here do not contain a value, rather these are *just* the concept
|
|
* of a dimension. To store a value you must use a @ref Quantity and @ref QuantityValue.
|
|
*/
|
|
|
|
#include <string_view>
|
|
|
|
#include "serif/dimensions/quantities.hpp"
|
|
|
|
namespace serif::dimensions {
|
|
/**
|
|
* @struct Dimensionless
|
|
*
|
|
* @brief Non dimensional type.
|
|
*/
|
|
struct Dimensionless final : PhysicalQuantity {
|
|
static constexpr std::string_view identifier = "dimensionless";
|
|
};
|
|
|
|
/**
|
|
* @struct Mass
|
|
*
|
|
* @brief Dimension of mass
|
|
*/
|
|
struct Mass final : PhysicalQuantity {
|
|
static constexpr std::string_view identifier = "mass";
|
|
};
|
|
|
|
/**
|
|
* @struct Length
|
|
*
|
|
* @brief Dimension of Length
|
|
*/
|
|
struct Length final : PhysicalQuantity {
|
|
static constexpr std::string_view identifier = "length";
|
|
};
|
|
|
|
/**
|
|
* @struct Time
|
|
*
|
|
* @brief Dimension of Time
|
|
*/
|
|
struct Time final : PhysicalQuantity {
|
|
static constexpr std::string_view identifier = "time";
|
|
};
|
|
|
|
/**
|
|
* @struct InverseTimeSquared
|
|
*
|
|
* @brief Inverse time squared, the physical dimension of a Poisson residual.
|
|
*/
|
|
struct InverseTimeSquared final : PhysicalQuantity
|
|
{
|
|
static constexpr std::string_view identifier = "inverse_time_squared";
|
|
};
|
|
|
|
/**
|
|
* @brief Mass density divided by time,
|
|
*/
|
|
struct MassDensityRate final : PhysicalQuantity {
|
|
static constexpr std::string_view identifier = "mass_density_rate";
|
|
};
|
|
|
|
/**
|
|
* @brief Force per unit volume
|
|
*/
|
|
struct ForceDensity final : PhysicalQuantity {
|
|
static constexpr std::string_view identifier = "force_density";
|
|
};
|
|
|
|
/**
|
|
* @brief Pressure divided by length squared
|
|
*/
|
|
struct PressureLaplacian final : PhysicalQuantity
|
|
{
|
|
static constexpr std::string_view identifier = "pressure_laplacian";
|
|
};
|
|
|
|
/**
|
|
* @struct GravitationalConstant
|
|
*
|
|
* @brief Newton's gravitational constant, expressed in the selected system of units.
|
|
*/
|
|
struct GravitationalConstant final : PhysicalQuantity
|
|
{
|
|
static constexpr std::string_view identifier = "gravitational_constant";
|
|
};
|
|
|
|
/**
|
|
* @struct Area
|
|
*
|
|
* @brief Dimension of Area
|
|
*/
|
|
struct Area final : PhysicalQuantity {
|
|
static constexpr std::string_view identifier = "area";
|
|
};
|
|
|
|
/**
|
|
* @struct Volume
|
|
*
|
|
* @brief Dimension of Volume
|
|
*/
|
|
struct Volume final : PhysicalQuantity {
|
|
static constexpr std::string_view identifier = "volume";
|
|
};
|
|
|
|
/**
|
|
* @struct MassDensity
|
|
*
|
|
* @brief Dimension of Mass Density
|
|
*/
|
|
struct MassDensity final : ThermodynamicQuantity {
|
|
static constexpr std::string_view identifier = "density";
|
|
};
|
|
|
|
/**
|
|
* @struct NumberDensity
|
|
*
|
|
* @brief Dimension of Number Density
|
|
*/
|
|
struct NumberDensity final : ThermodynamicQuantity {
|
|
static constexpr std::string_view identifier = "number_density";
|
|
};
|
|
|
|
/**
|
|
* @struct Pressure
|
|
*
|
|
* @brief Dimension of Pressure
|
|
*/
|
|
struct Pressure final : ThermodynamicQuantity {
|
|
static constexpr std::string_view identifier = "pressure";
|
|
};
|
|
|
|
/**
|
|
* @struct Temperature
|
|
*
|
|
* @brief Dimension of Temperature
|
|
*/
|
|
struct Temperature final : ThermodynamicQuantity {
|
|
static constexpr std::string_view identifier = "temperature";
|
|
};
|
|
|
|
/**
|
|
* @struct Entropy
|
|
*
|
|
* @brief Dimension of Entropy
|
|
*/
|
|
struct Entropy final : ThermodynamicQuantity {
|
|
static constexpr std::string_view identifier = "entropy";
|
|
};
|
|
|
|
/**
|
|
* @struct SpecificEntropy
|
|
*
|
|
* @brief Dimension of Specific Entropy
|
|
*/
|
|
struct SpecificEntropy final : ThermodynamicQuantity {
|
|
static constexpr std::string_view identifier = "specific_entropy";
|
|
};
|
|
|
|
/**
|
|
* @struct ChemicalPotential
|
|
*
|
|
* @brief Dimension of Chemical Potential
|
|
*/
|
|
struct ChemicalPotential final : ThermodynamicQuantity {
|
|
static constexpr std::string_view identifier = "chemical_potential";
|
|
};
|
|
|
|
/**
|
|
* @struct Energy
|
|
*
|
|
* @brief Dimension of Energy
|
|
*/
|
|
struct Energy final : PhysicalQuantity {
|
|
static constexpr std::string_view identifier = "energy";
|
|
};
|
|
|
|
/**
|
|
* @struct InternalEnergy
|
|
*
|
|
* @brief Dimension of Internal Energy
|
|
*/
|
|
struct InternalEnergy final : ThermodynamicQuantity {
|
|
static constexpr std::string_view identifier = "internal_energy";
|
|
};
|
|
|
|
/**
|
|
* @struct SpecificEnergy
|
|
*
|
|
* @brief Dimension of Specific Energy
|
|
*/
|
|
struct SpecificEnergy final : PhysicalQuantity {
|
|
static constexpr std::string_view identifier = "specific_energy";
|
|
};
|
|
|
|
/**
|
|
* @struct SpecificInternalEnergy
|
|
*
|
|
* @brief Dimension of Specific Internal Energy
|
|
*/
|
|
struct SpecificInternalEnergy final : ThermodynamicQuantity {
|
|
static constexpr std::string_view identifier = "specific_internal_energy";
|
|
};
|
|
|
|
/**
|
|
* @struct SpecificEnthalpy
|
|
*
|
|
* @brief Dimension of Specific Enthalpy
|
|
*/
|
|
struct SpecificEnthalpy final : ThermodynamicQuantity {
|
|
static constexpr std::string_view identifier = "specific_enthalpy";
|
|
};
|
|
|
|
/** @brief The barotropic pressure primitive A with dA/density = (dP/density)/density. */
|
|
struct BarotropicPressurePotential final : ThermodynamicQuantity {
|
|
static constexpr std::string_view identifier = "barotropic_pressure_potential";
|
|
};
|
|
|
|
/**
|
|
* @struct EnergyDensity
|
|
*
|
|
* @brief Dimension of Energy Density
|
|
*/
|
|
struct EnergyDensity final : ThermodynamicQuantity {
|
|
static constexpr std::string_view identifier = "energy_density";
|
|
};
|
|
|
|
/**
|
|
* @struct GravitationalPotential
|
|
*
|
|
* @brief Dimension of Gravitational Potential
|
|
*/
|
|
struct GravitationalPotential final : PhysicalQuantity {
|
|
static constexpr std::string_view identifier = "gravitational_potential";
|
|
};
|
|
|
|
/**
|
|
* @struct Velocity
|
|
*
|
|
* @brief Dimension of Velocity
|
|
*/
|
|
struct Velocity final : PhysicalQuantity {
|
|
static constexpr std::string_view identifier = "velocity";
|
|
};
|
|
|
|
/**
|
|
* @struct Acceleration
|
|
*
|
|
* @brief Dimension of Acceleration
|
|
*/
|
|
struct Acceleration final : PhysicalQuantity {
|
|
static constexpr std::string_view identifier = "acceleration";
|
|
};
|
|
|
|
/**
|
|
* @struct Frequency
|
|
*
|
|
* @brief Dimension of Frequency
|
|
*/
|
|
struct Frequency final : PhysicalQuantity {
|
|
static constexpr std::string_view identifier = "frequency";
|
|
};
|
|
|
|
/**
|
|
* @struct AngularVelocity
|
|
*
|
|
* @brief Dimension of Angular Velocity
|
|
*/
|
|
struct AngularVelocity final : PhysicalQuantity {
|
|
static constexpr std::string_view identifier = "angular_velocity";
|
|
};
|
|
|
|
/** @brief Angular acceleration, distinct from angular velocity despite sharing its chosen axis. */
|
|
struct AngularAcceleration final : PhysicalQuantity {
|
|
static constexpr std::string_view identifier = "angular_acceleration";
|
|
};
|
|
|
|
/**
|
|
* @struct Momentum
|
|
*
|
|
* @brief Dimension of Momentum
|
|
*/
|
|
struct Momentum final : PhysicalQuantity {
|
|
static constexpr std::string_view identifier = "momentum";
|
|
};
|
|
|
|
/**
|
|
* @struct AngularMomentum
|
|
*
|
|
* @brief Dimension of Angular Momentum
|
|
*/
|
|
struct AngularMomentum final : PhysicalQuantity {
|
|
static constexpr std::string_view identifier = "angular_momentum";
|
|
};
|
|
|
|
/**
|
|
* @struct MomentOfInertia
|
|
*
|
|
* @brief Dimension of Moment Of Inertia
|
|
*/
|
|
struct MomentOfInertia final : PhysicalQuantity {
|
|
static constexpr std::string_view identifier = "moment_of_inertia";
|
|
};
|
|
|
|
/**
|
|
* @struct Force
|
|
*
|
|
* @brief Dimension of Force
|
|
*/
|
|
struct Force final : PhysicalQuantity {
|
|
static constexpr std::string_view identifier = "force";
|
|
};
|
|
|
|
/**
|
|
* @struct Torque
|
|
*
|
|
* @brief Dimension of Torque
|
|
*/
|
|
struct Torque final : PhysicalQuantity {
|
|
static constexpr std::string_view identifier = "torque";
|
|
};
|
|
|
|
/**
|
|
* @struct Power
|
|
*
|
|
* @brief Dimension of Power
|
|
*/
|
|
struct Power final : PhysicalQuantity {
|
|
static constexpr std::string_view identifier = "power";
|
|
};
|
|
|
|
/**
|
|
* @struct Luminosity
|
|
*
|
|
* @brief Dimension of Luminosity
|
|
*/
|
|
struct Luminosity final : PhysicalQuantity {
|
|
static constexpr std::string_view identifier = "luminosity";
|
|
};
|
|
|
|
/**
|
|
* @struct MassFlowRate
|
|
*
|
|
* @brief Dimension of Mass Flow Rate
|
|
*/
|
|
struct MassFlowRate final : PhysicalQuantity {
|
|
static constexpr std::string_view identifier = "mass_flow_rate";
|
|
};
|
|
|
|
/**
|
|
* @struct Opacity
|
|
*
|
|
* @brief Dimension of Opacity
|
|
* @note we are not currently using this in the code since we are still using a polytropic
|
|
* eos. However, when we actually get to using this we will likely want to break this out
|
|
* into more specific and meaningful opacity dimensions (RMO, per unit wavelength, etc...)
|
|
*/
|
|
struct Opacity final : PhysicalQuantity {
|
|
static constexpr std::string_view identifier = "opacity";
|
|
};
|
|
|
|
/**
|
|
* @struct DynamicViscosity
|
|
*
|
|
* @brief Dimension of Dynamic Viscosity
|
|
*/
|
|
struct DynamicViscosity final : PhysicalQuantity {
|
|
static constexpr std::string_view identifier = "dynamic_viscosity";
|
|
};
|
|
|
|
/**
|
|
* @struct KinematicViscosity
|
|
*
|
|
* @brief Dimension of Kinematic Viscosity
|
|
*/
|
|
struct KinematicViscosity final : PhysicalQuantity {
|
|
static constexpr std::string_view identifier = "kinematic_viscosity";
|
|
};
|
|
|
|
/**
|
|
* @struct MagneticFluxDensity
|
|
*
|
|
* @brief Dimension of Magnetic Flux Density
|
|
*/
|
|
struct MagneticFluxDensity final : PhysicalQuantity {
|
|
static constexpr std::string_view identifier = "magnetic_flux_density";
|
|
};
|
|
}
|