diff --git a/include/cantera/zeroD/ConstPressureReactor.h b/include/cantera/zeroD/ConstPressureReactor.h index ffef058ceb..c5b5c86ec7 100644 --- a/include/cantera/zeroD/ConstPressureReactor.h +++ b/include/cantera/zeroD/ConstPressureReactor.h @@ -39,8 +39,9 @@ class ConstPressureReactor : public Reactor virtual void updateState(doublereal* y); //! Return the index in the solution vector for this reactor of the - //! component named *nm*. Possible values for *nm* are "m", "H", the name - //! of a homogeneous phase species, or the name of a surface species. + //! component named *nm*. Possible values for *nm* are "mass", "enthalpy", + //! the name of a homogeneous phase species, or the name of a surface + //! species. virtual size_t componentIndex(const std::string& nm) const; }; diff --git a/include/cantera/zeroD/IdealGasConstPressureReactor.h b/include/cantera/zeroD/IdealGasConstPressureReactor.h index f0eb0c739f..2546b8f4bc 100644 --- a/include/cantera/zeroD/IdealGasConstPressureReactor.h +++ b/include/cantera/zeroD/IdealGasConstPressureReactor.h @@ -41,8 +41,9 @@ class IdealGasConstPressureReactor : public ConstPressureReactor virtual void updateState(doublereal* y); //! Return the index in the solution vector for this reactor of the - //! component named *nm*. Possible values for *nm* are "m", "T", the name - //! of a homogeneous phase species, or the name of a surface species. + //! component named *nm*. Possible values for *nm* are "mass", + //! "temperature", the name of a homogeneous phase species, or the name of a + //! surface species. virtual size_t componentIndex(const std::string& nm) const; protected: diff --git a/include/cantera/zeroD/IdealGasReactor.h b/include/cantera/zeroD/IdealGasReactor.h index b214d77ecc..ada758cda9 100644 --- a/include/cantera/zeroD/IdealGasReactor.h +++ b/include/cantera/zeroD/IdealGasReactor.h @@ -38,6 +38,10 @@ class IdealGasReactor : public Reactor virtual void updateState(doublereal* y); + //! Return the index in the solution vector for this reactor of the + //! component named *nm*. Possible values for *nm* are "mass", + //! "volume", "temperature", the name of a homogeneous phase species, or the + //! name of a surface species. virtual size_t componentIndex(const std::string& nm) const; protected: diff --git a/include/cantera/zeroD/Reactor.h b/include/cantera/zeroD/Reactor.h index 090142cdfa..f16619efa1 100644 --- a/include/cantera/zeroD/Reactor.h +++ b/include/cantera/zeroD/Reactor.h @@ -142,8 +142,9 @@ class Reactor : public ReactorBase std::vector > getSensitivityOrder() const; //! Return the index in the solution vector for this reactor of the - //! component named *nm*. Possible values for *nm* are "m", "V", "T", the - //! name of a homogeneous phase species, or the name of a surface species. + //! component named *nm*. Possible values for *nm* are "mass", "volume", + //! "int_energy", the name of a homogeneous phase species, or the name of a + //! surface species. virtual size_t componentIndex(const std::string& nm) const; protected: diff --git a/src/zeroD/ConstPressureReactor.cpp b/src/zeroD/ConstPressureReactor.cpp index 766198d0a0..b230d02012 100644 --- a/src/zeroD/ConstPressureReactor.cpp +++ b/src/zeroD/ConstPressureReactor.cpp @@ -127,8 +127,18 @@ size_t ConstPressureReactor::componentIndex(const string& nm) const if (k != npos) { return k + 2; } else if (nm == "m" || nm == "mass") { + if (nm == "m") { + warn_deprecated("ConstPressureReactor::componentIndex(\"m\")", + "Using the name 'm' for mass is deprecated, and will be " + "disabled after Cantera 2.3. Use 'mass' instead."); + } return 0; } else if (nm == "H" || nm == "enthalpy") { + if (nm == "H") { + warn_deprecated("ConstPressureReactor::componentIndex(\"H\")", + "Using the name 'H' for enthalpy is deprecated, and will be " + "disabled after Cantera 2.3. Use 'enthalpy' instead."); + } return 1; } else { return npos; diff --git a/src/zeroD/IdealGasConstPressureReactor.cpp b/src/zeroD/IdealGasConstPressureReactor.cpp index 413fad98cd..2454c4150e 100644 --- a/src/zeroD/IdealGasConstPressureReactor.cpp +++ b/src/zeroD/IdealGasConstPressureReactor.cpp @@ -139,8 +139,18 @@ size_t IdealGasConstPressureReactor::componentIndex(const string& nm) const if (k != npos) { return k + 2; } else if (nm == "m" || nm == "mass") { + if (nm == "m") { + warn_deprecated("IdealGasConstPressureReactor::componentIndex(\"m\")", + "Using the name 'm' for mass is deprecated, and will be " + "disabled after Cantera 2.3. Use 'mass' instead."); + } return 0; } else if (nm == "T" || nm == "temperature") { + if (nm == "T") { + warn_deprecated("IdealGasConstPressureReactor::componentIndex(\"T\")", + "Using the name 'T' for temperature is deprecated, and will be " + "disabled after Cantera 2.3. Use 'temperature' instead."); + } return 1; } else { return npos; diff --git a/src/zeroD/IdealGasReactor.cpp b/src/zeroD/IdealGasReactor.cpp index 14906b06f3..560a244c4d 100644 --- a/src/zeroD/IdealGasReactor.cpp +++ b/src/zeroD/IdealGasReactor.cpp @@ -156,10 +156,25 @@ size_t IdealGasReactor::componentIndex(const string& nm) const if (k != npos) { return k + 3; } else if (nm == "m" || nm == "mass") { + if (nm == "m") { + warn_deprecated("IdealGasReactor::componentIndex(\"m\")", + "Using the name 'm' for mass is deprecated, and will be " + "disabled after Cantera 2.3. Use 'mass' instead."); + } return 0; } else if (nm == "V" || nm == "volume") { + if (nm == "V") { + warn_deprecated("IdealGasReactor::componentIndex(\"V\")", + "Using the name 'V' for volume is deprecated, and will be " + "disabled after Cantera 2.3. Use 'volume' instead."); + } return 1; } else if (nm == "T" || nm == "temperature") { + if (nm == "T") { + warn_deprecated("IdealGasReactor::componentIndex(\"T\")", + "Using the name 'T' for temperature is deprecated, and will be " + "disabled after Cantera 2.3. Use 'temperature' instead."); + } return 2; } else { return npos; diff --git a/src/zeroD/Reactor.cpp b/src/zeroD/Reactor.cpp index 8dbcdf0cf7..e229099df8 100644 --- a/src/zeroD/Reactor.cpp +++ b/src/zeroD/Reactor.cpp @@ -382,10 +382,25 @@ size_t Reactor::componentIndex(const string& nm) const if (k != npos) { return k + 3; } else if (nm == "m" || nm == "mass") { + if (nm == "m") { + warn_deprecated("Reactor::componentIndex(\"m\")", + "Using the name 'm' for mass is deprecated, and will be " + "disabled after Cantera 2.3. Use 'mass' instead."); + } return 0; } else if (nm == "V" || nm == "volume") { + if (nm == "V") { + warn_deprecated("Reactor::componentIndex(\"V\")", + "Using the name 'V' for volume is deprecated, and will be " + "disabled after Cantera 2.3. Use 'volume' instead."); + } return 1; } else if (nm == "U" || nm == "int_energy") { + if (nm == "U") { + warn_deprecated("Reactor::componentIndex(\"U\")", + "Using the name 'U' for internal energy is deprecated, and " + "will be disabled after Cantera 2.3. Use 'int_energy' instead."); + } return 2; } else { return npos;