diff --git a/doc/sphinx/yaml/phases.rst b/doc/sphinx/yaml/phases.rst index db4d7adf9..fe9f40af8 100644 --- a/doc/sphinx/yaml/phases.rst +++ b/doc/sphinx/yaml/phases.rst @@ -538,6 +538,9 @@ The ideal gas model as The ideal gas model, using variable pressure standard state methods as `described here `__. +.. deprecated:: 2.5 + Use the ``ideal-gas`` model instead. + .. _sec-yaml-ideal-molal-solution: diff --git a/include/cantera/thermo/IdealSolnGasVPSS.h b/include/cantera/thermo/IdealSolnGasVPSS.h index 4e4639a1a..197d6f9c4 100644 --- a/include/cantera/thermo/IdealSolnGasVPSS.h +++ b/include/cantera/thermo/IdealSolnGasVPSS.h @@ -23,6 +23,9 @@ namespace Cantera * * An ideal solution or an ideal gas approximation of a phase. Uses variable * pressure standard state methods for calculating thermodynamic properties. + * + * @deprecated "Gas" mode to be removed after Cantera 2.5. Use IdealGasPhase for + * ideal gas phases instead. */ class IdealSolnGasVPSS : public VPStandardStateTP { @@ -62,7 +65,11 @@ public: } //! Set this phase to represent an ideal gas - void setGasMode() { m_idealGas = true; } + void setGasMode() { + warn_deprecated("IdealSolnGasVPSS::setGasMode", + "To be removed after Cantera 2.5. Use class IdealGasPhase instead."); + m_idealGas = true; + } //! Set this phase to represent an ideal liquid or solid solution void setSolnMode() { m_idealGas = false; } diff --git a/interfaces/cython/cantera/test/test_convert.py b/interfaces/cython/cantera/test/test_convert.py index 4dac506c8..51d5e0c70 100644 --- a/interfaces/cython/cantera/test/test_convert.py +++ b/interfaces/cython/cantera/test/test_convert.py @@ -1187,7 +1187,9 @@ class ctml2yamlTest(utilities.CanteraTest): Path(self.test_data_dir).joinpath("pdss_hkft.xml"), Path(self.test_work_dir).joinpath("pdss_hkft.yaml"), ) - + # @todo Remove "gas" mode test after Cantera 2.5 - "gas" mode of class + # IdealSolnGasVPSS is deprecated + ct.suppress_deprecation_warnings() for name in ["vpss_gas_pdss_hkft_phase", "vpss_soln_pdss_hkft_phase"]: ctmlPhase = ct.ThermoPhase("pdss_hkft.xml", name=name) yamlPhase = ct.ThermoPhase("pdss_hkft.yaml", name=name) @@ -1200,6 +1202,7 @@ class ctml2yamlTest(utilities.CanteraTest): self.assertEqual(ctmlPhase.element_names, yamlPhase.element_names) self.assertEqual(ctmlPhase.species_names, yamlPhase.species_names) self.checkThermo(ctmlPhase, yamlPhase, [300, 500]) + ct.make_deprecation_warnings_fatal() def test_lattice_solid(self): ctml2yaml.convert( diff --git a/test/data/thermo-models.yaml b/test/data/thermo-models.yaml index beb17c401..b7007583a 100644 --- a/test/data/thermo-models.yaml +++ b/test/data/thermo-models.yaml @@ -93,6 +93,8 @@ phases: species: [KCl(l)] thermo: Margules +# todo: Remove after Cantera 2.5 - the "gas" moode of class IdealSolnGasVPSS is +# deprecated. - name: IdealSolnGas-gas thermo: ideal-gas-VPSS species: [{gas-species: [H2O, H2, O2]}] diff --git a/test/thermo/phaseConstructors.cpp b/test/thermo/phaseConstructors.cpp index 81179f06f..3d56d9200 100644 --- a/test/thermo/phaseConstructors.cpp +++ b/test/thermo/phaseConstructors.cpp @@ -344,8 +344,11 @@ TEST_F(ConstructFromScratch, RedlichKwongMFTP_missing_coeffs) EXPECT_THROW(p.setState_TP(300, 200e5), CanteraError); } +//! @todo Remove after Cantera 2.5 - "gas" mode of IdealSolnGasVPSS is +//! deprecated TEST_F(ConstructFromScratch, IdealSolnGasVPSS_gas) { + suppress_deprecation_warnings(); IdealSolnGasVPSS p; p.addSpecies(sH2O); p.addSpecies(sH2); @@ -367,6 +370,7 @@ TEST_F(ConstructFromScratch, IdealSolnGasVPSS_gas) EXPECT_NEAR(p.temperature(), 479.929, 1e-3); // based on h2o2.cti EXPECT_NEAR(p.moleFraction("H2O"), 0.01, 1e-4); EXPECT_NEAR(p.moleFraction("H2"), 0.0, 1e-4); + make_deprecation_warnings_fatal(); } TEST(PureFluidFromScratch, CarbonDioxide) diff --git a/test/thermo/thermoFromYaml.cpp b/test/thermo/thermoFromYaml.cpp index 856d96dcf..eb35b7403 100644 --- a/test/thermo/thermoFromYaml.cpp +++ b/test/thermo/thermoFromYaml.cpp @@ -234,9 +234,13 @@ TEST(ThermoFromYaml, IonsFromNeutral_fromString) EXPECT_NEAR(mu[1], -2.88157316e+06, 1e-1); } +//! @todo Remove after Cantera 2.5 - "gas" mode of IdealSolnGasVPSS is +//! deprecated TEST(ThermoFromYaml, IdealSolnGas_gas) { + suppress_deprecation_warnings(); auto thermo = newThermo("thermo-models.yaml", "IdealSolnGas-gas"); + make_deprecation_warnings_fatal(); thermo->equilibrate("HP"); EXPECT_NEAR(thermo->temperature(), 479.929, 1e-3); // based on h2o2.cti EXPECT_NEAR(thermo->moleFraction("H2O"), 0.01, 1e-4); diff --git a/test_problems/VPsilane_test/silane_equil.cpp b/test_problems/VPsilane_test/silane_equil.cpp index f1cf5aa47..98f0be48a 100644 --- a/test_problems/VPsilane_test/silane_equil.cpp +++ b/test_problems/VPsilane_test/silane_equil.cpp @@ -9,12 +9,15 @@ using namespace std; using namespace Cantera; +//! @todo Remove this test after Cantera 2.5 - "gas" mode of class +//! IdealSolnGasVPSS is deprecated int main(int argc, char** argv) { #if defined(_MSC_VER) && _MSC_VER < 1900 _set_output_format(_TWO_DIGIT_EXPONENT); #endif try { + suppress_deprecation_warnings(); IdealSolnGasVPSS gg("silane.xml", "silane"); ThermoPhase* g = ≫ cout.precision(4);