feat(dimensions): added second partial type and new dimensions

This commit is contained in:
2026-11-02 10:06:47 -05:00
parent 9a7e4a7112
commit 48bc7d5472
3 changed files with 52 additions and 3 deletions

View File

@@ -27,6 +27,22 @@ namespace serif::dimensions {
template <ThermodynamicQuantityType Quantity>
struct WithRespectTo final {};
/** @brief
* A second EOS partial retains both differentiation quantities in its type.
*/
template <ThermodynamicQuantityType OutputQuantity, ThermodynamicQuantityType FirstInput, ThermodynamicQuantityType SecondInput>
class SecondPartialDerivative final {
public:
/** @brief Store an explicitly evaluated second partial; this type does not differentiate. */
explicit constexpr SecondPartialDerivative(double value) noexcept : m_value(value) {}
/** @brief Return the numeric partial in the caller's physical units. */
[[nodiscard]] constexpr double value() const noexcept { return m_value; }
private:
double m_value;
};
/**
* @class PartialDerivative
*
@@ -188,4 +204,4 @@ namespace serif::dimensions {
private:
double m_value; ///< Numeric value associated with the partial. If this is known at compile time then the compiler can optimize operations with partial.value() to be equivalent to compile time double operations.
};
}
}