setState_DP is now also tested in the PengRobinson test suite (CoolPropValidateDP)

This commit is contained in:
T. Jeremy P. Karpowski 2025-02-05 14:58:50 +01:00
parent 134bb71401
commit d4600c41ce

View File

@ -179,6 +179,36 @@ TEST_F(PengRobinson_Test, CoolPropValidate)
}
}
TEST_F(PengRobinson_Test, CoolPropValidateDP)
{
// Validate the P-R EoS in Cantera with P-R EoS from CoolProp
const double rhoCoolProp[10] = {
9.067928191884574,
8.318322900591179,
7.6883521740498155,
7.150504298001246,
6.685330199667018,
6.278630757480957,
5.919763108091383,
5.600572727499541,
5.314694056926007,
5.057077678380463
};
double p = 5e5;
// Calculate Temperature using Peng-Robinson EoS from Cantera
for(int i=0; i<10; i++)
{
const double tempReference = 300 + i*25;
set_r(1.0);
test_phase->setState_DP(rhoCoolProp[i], p,300);
EXPECT_NEAR(test_phase->temperature(),tempReference,1.e-3);
}
}
TEST(PengRobinson, lookupSpeciesProperties)
{
AnyMap phase_def = AnyMap::fromYamlString(