From ba8ac1d519b12fd19e80d0b05688d720a734664c Mon Sep 17 00:00:00 2001 From: Steven DeCaluwe Date: Wed, 12 Jun 2019 12:02:33 -0400 Subject: [PATCH] Mark ConstDensityThermo for deprecation. The thermophase ConstDensityThermo instantiates a class with constant density_mass Such a model is of dubious physical validity/applicability and has minimal foreseeable use cases. This commit marks it for deprecation, and adds a message in ctml_writer.py (where the model has the misleading alias 'incompressible_solid') refering the interested user to consider appropriate alternate thermophase classes 'lattice' or 'IdealSolidSoln.' --- include/cantera/thermo/ConstDensityThermo.h | 8 +++++++- interfaces/cython/cantera/ctml_writer.py | 11 ++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/include/cantera/thermo/ConstDensityThermo.h b/include/cantera/thermo/ConstDensityThermo.h index e7fa51ed4..37617e5a2 100644 --- a/include/cantera/thermo/ConstDensityThermo.h +++ b/include/cantera/thermo/ConstDensityThermo.h @@ -24,13 +24,19 @@ namespace Cantera * The density is assumed to be constant, no matter what the concentration of * the solution. * + * @deprecated To be removed after Cantera 2.5.0. Replaceable with LatticePhase + * or IdealSolidSolnPhase + * * @ingroup thermoprops */ class ConstDensityThermo : public ThermoPhase { public: //! Constructor. - ConstDensityThermo() {} + ConstDensityThermo() { + warn_deprecated("class ConstDensityThermo", "To be removed after Cantera " + "2.5.0. Consider replacing with LatticePhase or IdealSolidSolnPhase\n"); + } virtual std::string type() const { return "ConstDensity"; diff --git a/interfaces/cython/cantera/ctml_writer.py b/interfaces/cython/cantera/ctml_writer.py index 7ba51e691..de424b038 100644 --- a/interfaces/cython/cantera/ctml_writer.py +++ b/interfaces/cython/cantera/ctml_writer.py @@ -2137,7 +2137,16 @@ class semiconductor(phase): class incompressible_solid(phase): - """An incompressible solid.""" + """An incompressible solid. + + .. deprecated:: 2.5 + + To be deprecated with version 2.5, and removed thereafter. + This phase pointed to an ill-considered constant_density ThermoPhase + model, which assumed a constant mass density. This underlying phase is + simultaneously being deprecated. Please consider switching to + either `IdealSolidSolution` or `lattice` phase, instead. + """ def __init__(self, name = '', elements = '',