Skip to content

Commit

Permalink
Deprecate class MaskellSolidSolnPhase
Browse files Browse the repository at this point in the history
This phase model is incomplete, has numerous thermodynamic consistency
issues as documented in #1321, and has no known non-trivial examples.

Resolves #1321
  • Loading branch information
speth authored and ischoegl committed Mar 14, 2023
1 parent 5e50be3 commit 9153ef2
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 1 deletion.
4 changes: 4 additions & 0 deletions doc/sphinx/yaml/phases.rst
Expand Up @@ -765,6 +765,10 @@ Example::
A condensed phase non-ideal solution with two species, as
`described here <https://cantera.org/documentation/dev/doxygen/html/dd/d3a/classCantera_1_1MaskellSolidSolnPhase.html#details>`__.

.. deprecated:: 3.0

This phase model is deprecated and will be removed after Cantera 3.0.

Additional fields:

``excess-enthalpy``
Expand Down
5 changes: 4 additions & 1 deletion include/cantera/thermo/MaskellSolidSolnPhase.h
Expand Up @@ -23,11 +23,14 @@ namespace Cantera
* 231-235, 1983.
*
* @ingroup thermoprops
*
* @deprecated To be removed after Cantera 3.0. This class has numerous thermodynamic
* inconsistencies. See https://github.com/Cantera/cantera/issues/1321.
*/
class MaskellSolidSolnPhase : public VPStandardStateTP
{
public:
MaskellSolidSolnPhase() = default;
MaskellSolidSolnPhase();

virtual std::string type() const {
return "MaskellSolidsoln";
Expand Down
5 changes: 5 additions & 0 deletions src/thermo/MaskellSolidSolnPhase.cpp
Expand Up @@ -17,6 +17,11 @@
namespace Cantera
{

MaskellSolidSolnPhase::MaskellSolidSolnPhase()
{
warn_deprecated("class MaskellSolidSolnPhase", "To be removed after Cantera 3.0");
}

void MaskellSolidSolnPhase::getActivityConcentrations(doublereal* c) const
{
getActivityCoefficients(c);
Expand Down
1 change: 1 addition & 0 deletions test/data/consistency-cases.yaml
Expand Up @@ -340,6 +340,7 @@ Maskell-solid-solution:
setup:
file: thermo-models.yaml
phase: MaskellSolidSoln
ignore-deprecations: true
known-failures:
g_eq_sum_gk_Xk: "Inconsistent implementation. See GitHub Issue #1321"
hk0_eq_uk0_plus_p_vk0/[234]:
Expand Down
1 change: 1 addition & 0 deletions test/python/test_convert.py
Expand Up @@ -1269,6 +1269,7 @@ def test_DH_NaCl_phase(self):
ctmlPhase, yamlPhase = self.checkConversion("debye-huckel-all", name=name)
self.checkThermo(ctmlPhase, yamlPhase, [300, 500])

@pytest.mark.usefixtures("allow_deprecated")
def test_Maskell_solid_soln(self):
self.convert("MaskellSolidSolnPhase_valid")
ctmlPhase, yamlPhase = self.checkConversion("MaskellSolidSolnPhase_valid")
Expand Down
8 changes: 8 additions & 0 deletions test/thermo/MaskellSolidSolnPhase_Test.cpp
Expand Up @@ -17,6 +17,14 @@ static const double expected_result_minus_5000[9] = { 1.2340671804814456e7, 8.01
class MaskellSolidSolnPhase_Test : public testing::Test
{
public:
MaskellSolidSolnPhase_Test() {
suppress_deprecation_warnings();
}

~MaskellSolidSolnPhase_Test() {
make_deprecation_warnings_fatal();
}

void setup(const std::string & filename)
{
test_phase = newThermo(filename);
Expand Down
2 changes: 2 additions & 0 deletions test/thermo/thermoFromYaml.cpp
Expand Up @@ -272,11 +272,13 @@ TEST(ThermoFromYaml, RedlichKister)

TEST(ThermoFromYaml, MaskellSolidSoln)
{
suppress_deprecation_warnings();
auto thermo = newThermo("thermo-models.yaml", "MaskellSolidSoln");
vector_fp chemPotentials(2);
thermo->getChemPotentials(chemPotentials.data());
EXPECT_NEAR(chemPotentials[0], -4.989677789060059e6, 1e-6);
EXPECT_NEAR(chemPotentials[1], 4.989677789060059e6 + 1000, 1e-6);
make_deprecation_warnings_fatal();
}

TEST(ThermoFromYaml, HMWSoln)
Expand Down
2 changes: 2 additions & 0 deletions test/thermo/thermoToYaml.cpp
Expand Up @@ -175,9 +175,11 @@ TEST_F(ThermoToYaml, RedlichKister)

TEST_F(ThermoToYaml, MaskellSolidSolution)
{
suppress_deprecation_warnings();
setup("thermo-models.yaml", "MaskellSolidSoln");
EXPECT_EQ(data["product-species"], "H(s)");
EXPECT_DOUBLE_EQ(data["excess-enthalpy"].asDouble(), 5e3);
make_deprecation_warnings_fatal();
}

TEST_F(ThermoToYaml, DebyeHuckel_B_dot_ak)
Expand Down

0 comments on commit 9153ef2

Please sign in to comment.