From cb514cdcd5984fa300925ffd8aaeb17bf54cc231 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Tue, 10 Jan 2023 17:46:04 -0500 Subject: [PATCH] Fix compareThermo test for PlasmaPhase --- test/thermo/thermoToYaml.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/thermo/thermoToYaml.cpp b/test/thermo/thermoToYaml.cpp index dd158d877..ca697a379 100644 --- a/test/thermo/thermoToYaml.cpp +++ b/test/thermo/thermoToYaml.cpp @@ -342,6 +342,7 @@ public: input1); skip_cp = false; skip_activities = false; + skip_entropy = false; rtol = 1e-14; } @@ -367,8 +368,10 @@ public: EXPECT_NEAR(original->cp_mass(), duplicate->cp_mass(), rtol * original->cp_mass()); } - EXPECT_NEAR(original->entropy_mass(), duplicate->entropy_mass(), - rtol * fabs(original->entropy_mass())); + if (!skip_entropy) { + EXPECT_NEAR(original->entropy_mass(), duplicate->entropy_mass(), + rtol * fabs(original->entropy_mass())); + } EXPECT_NEAR(original->enthalpy_mole(), duplicate->enthalpy_mole(), rtol * fabs(original->enthalpy_mole())); @@ -403,6 +406,7 @@ public: shared_ptr duplicate; bool skip_cp; bool skip_activities; + bool skip_entropy; double rtol; }; @@ -517,6 +521,8 @@ TEST_F(ThermoYamlRoundTrip, Surface) TEST_F(ThermoYamlRoundTrip, IsotropicElectronEnergyPlasma) { roundtrip("oxygen-plasma.yaml", "isotropic-electron-energy-plasma"); + skip_cp = true; // Not implemented for PlasmaPhase + skip_entropy = true; // Not implemented for PlasmaPhase compareThermo(800, 2*OneAtm); auto origPlasma = std::dynamic_pointer_cast(original); auto duplPlasma = std::dynamic_pointer_cast(duplicate); @@ -530,6 +536,8 @@ TEST_F(ThermoYamlRoundTrip, IsotropicElectronEnergyPlasma) TEST_F(ThermoYamlRoundTrip, DiscretizedElectronEnergyPlasma) { roundtrip("oxygen-plasma.yaml", "discretized-electron-energy-plasma"); + skip_cp = true; // Not implemented for PlasmaPhase + skip_entropy = true; // Not implemented for PlasmaPhase compareThermo(800, 2*OneAtm); EXPECT_DOUBLE_EQ(original->electronTemperature(), duplicate->electronTemperature()); }