CoolProp 8.0.0
An open-source fluid property and humid air property database
CoolProp-Tests-NeonMelting.cpp
Go to the documentation of this file.
1// Tests for the neon melting line (bd CoolProp-r1w7.2).
2//
3// The neon melting curve was replaced (SantamariaPerez-PRB-2010 Simon fit, which
4// was high by ~11-29x and whose p_min sat ~14.6 MPa above the triple pressure) by
5// a polynomial-in-theta fit to the solid-liquid (crystal phase C1) melting data
6// evaluated in the NIST ThermoData Engine, anchored at the triple point and
7// constrained there to the Clausius-Clapeyron slope dp/dT = dS_fus/dV_fus =
8// 6.28 MPa/K. Run explicitly: ./CatchTestRunner "[melting]"
9
10#if defined(ENABLE_CATCH)
11
12# include <catch2/catch_all.hpp>
13
14# include <memory>
15
18
19// Check values pinning the replaced neon melting line so it cannot silently
20// drift. Reference temperatures are obtained by inverting the fitted curve and
21// reproduce the experimental melting temperatures to ~1 K RMS.
22TEST_CASE("Neon melting line check values (TDE fit, C-C constrained)", "[melting]") {
23 auto AS = std::shared_ptr<CoolProp::AbstractState>(CoolProp::AbstractState::factory("HEOS", "Neon"));
24 CHECK(AS->melting_line(CoolProp::iT, CoolProp::iP, 1.0e8) == Catch::Approx(37.083).epsilon(1e-4));
25 CHECK(AS->melting_line(CoolProp::iT, CoolProp::iP, 1.0e9) == Catch::Approx(109.769).epsilon(1e-4));
26}
27
28// Regression: the prior neon curve's p_min (~14.6 MPa) sat far above the triple
29// pressure, so near-triple consistency-grid points threw "unable to calculate
30// melting line T(p) ... bounds are ...". The replacement is anchored at the
31// triple point (p_min == triple pressure), so these states now resolve.
32TEST_CASE("Neon phase determination near the triple pressure", "[melting]") {
33 const double p = 43851.4; // Pa, just above the triple pressure
34 const double T = GENERATE(24.56, 100.0);
35 CAPTURE(T, p);
36 auto AS = std::shared_ptr<CoolProp::AbstractState>(CoolProp::AbstractState::factory("HEOS", "Neon"));
37 CHECK_NOTHROW(AS->update(CoolProp::PT_INPUTS, p, T));
38}
39
40#endif // ENABLE_CATCH