diff --git a/doc/SConscript b/doc/SConscript index f4873fc49..4772d1c26 100644 --- a/doc/SConscript +++ b/doc/SConscript @@ -135,7 +135,7 @@ if localenv['sphinx_docs']: # Create a dictionary of extra files associated with each class. These # files are listed relative to the top directory interfaces/matlab/cantera extra = { - '@Solution': ['IdealGasMix.m', 'GRI30.m', 'Air.m'], + '@Solution': ['GRI30.m', 'Air.m'], '@Pure Fluid Phases': ['CarbonDioxide.m', 'HFC134a.m', 'Hydrogen.m', 'Methane.m', 'Nitrogen.m', 'Oxygen.m', 'Water.m'], '@Func': ['gaussian.m', 'polynom.m'], diff --git a/doc/sphinx/cti/classes.rst b/doc/sphinx/cti/classes.rst index b9acc474b..3bb4bc7a3 100644 --- a/doc/sphinx/cti/classes.rst +++ b/doc/sphinx/cti/classes.rst @@ -35,9 +35,6 @@ Phases of Matter .. autoclass:: metal :no-undoc-members: -.. autoclass:: incompressible_solid - :no-undoc-members: - .. autoclass:: lattice :no-undoc-members: diff --git a/doc/sphinx/yaml/phases.rst b/doc/sphinx/yaml/phases.rst index 012beabdc..e1145ebb1 100644 --- a/doc/sphinx/yaml/phases.rst +++ b/doc/sphinx/yaml/phases.rst @@ -65,11 +65,9 @@ and optionally reactions that can take place in that phase. The fields of a - :ref:`constant-density ` - :ref:`Debye-Huckel ` - :ref:`edge ` - - :ref:`fixed-chemical-potential ` - :ref:`fixed-stoichiometry ` - :ref:`HMW-electrolyte ` - :ref:`ideal-gas ` - - :ref:`ideal-gas-VPSS ` - :ref:`ideal-molal-solution ` - :ref:`ideal-condensed ` - :ref:`ideal-solution-VPSS ` @@ -370,29 +368,6 @@ Example:: site-density: 5.0e-17 mol/cm -.. _sec-yaml-fixed-chemical-potential: - -``fixed-chemical-potential`` ----------------------------- - -A phase defined by a fixed value of the chemical potential, as -`described here `__. - -.. deprecated:: 2.5 - Use class StoichSubstance with a constant-cp species thermo model, with 'h0' - set to the desired chemical potential and 's0' set to 0. - -Additional fields: - -``chemical-potential`` - The molar chemical potential of the phase - -Example:: - - thermo: fixed-chemical-potential - chemical-potential: -2.3e7 J/kmol - - .. _sec-yaml-fixed-stoichiometry: ``fixed-stoichiometry`` @@ -534,17 +509,6 @@ Example:: The ideal gas model as `described here `__. -.. _sec-yaml-ideal-gas-VPSS: - -``ideal-gas-VPSS`` ------------------- - -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/Edge.h b/include/cantera/Edge.h deleted file mode 100644 index 126d3127f..000000000 --- a/include/cantera/Edge.h +++ /dev/null @@ -1,63 +0,0 @@ -//! @file Edge.h - -// This file is part of Cantera. See License.txt in the top-level directory or -// at https://cantera.org/license.txt for license and copyright information. - -#ifndef CXX_EDGE -#define CXX_EDGE - -#pragma message("warning: Edge.h is deprecated and will be removed after Cantera 2.5.0.") - -#include "thermo/ThermoFactory.h" -#include "kinetics/importKinetics.h" -#include "kinetics/EdgeKinetics.h" -#include "thermo/EdgePhase.h" - -namespace Cantera -{ - -//! Convenience class which inherits from both EdgePhase and EdgeKinetics -/*! - * @deprecated To be removed after Cantera 2.5.0. - * Replaceable with Solution and/or EdgePhase/EdgeKinetics. - */ -class Edge : - public EdgePhase, public EdgeKinetics -{ -public: - Edge(const std::string& infile, std::string id, std::vector phases) - : m_ok(false), m_r(0) - { - warn_deprecated("class Metal", - "To be removed after Cantera 2.5.0. " - "Replaceable with Solution and/or EdgePhase/EdgeKinetics."); - m_r = get_XML_File(infile); - if (id == "-") { - id = ""; - } - - XML_Node* x = get_XML_Node("#"+id, m_r); - if (!x) { - throw CanteraError("Edge::Edge","error in get_XML_Node"); - } - - importPhase(*x, this); - phases.push_back(this); - importKinetics(*x, phases, this); - m_ok = true; - } - - bool operator!() { - return !m_ok; - } - bool ready() const { - return m_ok; - } - -protected: - bool m_ok; - XML_Node* m_r; -}; -} - -#endif diff --git a/include/cantera/IdealGasMix.h b/include/cantera/IdealGasMix.h deleted file mode 100644 index 7314d7386..000000000 --- a/include/cantera/IdealGasMix.h +++ /dev/null @@ -1,84 +0,0 @@ -//! @file IdealGasMix.h - -// This file is part of Cantera. See License.txt in the top-level directory or -// at https://cantera.org/license.txt for license and copyright information. - -#ifndef CXX_IDEALGASMIX -#define CXX_IDEALGASMIX - -#pragma message("warning: IdealGasMix.h is deprecated and will be removed after Cantera 2.5.") - -#include "thermo/IdealGasPhase.h" -#include "kinetics/GasKinetics.h" -#include "kinetics/importKinetics.h" -#include "base/stringUtils.h" - -namespace Cantera -{ - -//! Convenience class which inherits from both IdealGasPhase and GasKinetics -/*! - * @deprecated To be removed after Cantera 2.5. - * Replaceable with Solution and/or IdealGasPhase/GasKinetics. - */ -class IdealGasMix : - public IdealGasPhase, - public GasKinetics -{ -public: - IdealGasMix() : m_ok(false), m_r(0) {} - - IdealGasMix(const std::string& infile, std::string id_="") : - m_ok(false), m_r(0) - { - warn_deprecated("class IdealGasMix", - "To be removed after Cantera 2.5. " - "Replaceable with Solution and/or IdealGasPhase/GasKinetics."); - m_r = get_XML_File(infile); - m_id = id_; - if (id_ == "-") { - id_ = ""; - } - m_ok = buildSolutionFromXML(*m_r, - m_id, "phase", this, this); - if (!m_ok) throw CanteraError("IdealGasMix", - "Cantera::buildSolutionFromXML returned false"); - } - - IdealGasMix(XML_Node& root, - std::string id_) : m_ok(false), m_r(&root), m_id(id_) { - warn_deprecated("class IdealGasMix", - "To be removed after Cantera 2.5. " - "Replaceable with Solution and/or IdealGasPhase/GasKinetics."); - m_ok = buildSolutionFromXML(root, id_, "phase", this, this); - } - - IdealGasMix(const IdealGasMix& other) : m_ok(false), - m_r(other.m_r), - m_id(other.m_id) { - warn_deprecated("class IdealGasMix", - "To be removed after Cantera 2.5. " - "Replaceable with Solution and/or IdealGasPhase/GasKinetics."); - m_ok = buildSolutionFromXML(*m_r, m_id, "phase", this, this); - } - - bool operator!() { - return !m_ok; - } - bool ready() const { - return m_ok; - } - friend std::ostream& operator<<(std::ostream& s, IdealGasMix& mix) { - std::string r = mix.report(true); - s << r; - return s; - } - -protected: - bool m_ok; - XML_Node* m_r; - std::string m_id; -}; -} - -#endif diff --git a/include/cantera/IncompressibleSolid.h b/include/cantera/IncompressibleSolid.h deleted file mode 100644 index 41d1c7c30..000000000 --- a/include/cantera/IncompressibleSolid.h +++ /dev/null @@ -1,53 +0,0 @@ -//! @file IncompressibleSolid.h - -// This file is part of Cantera. See License.txt in the top-level directory or -// at https://cantera.org/license.txt for license and copyright information. - -#ifndef CXX_INCOMPRESSIBLE -#define CXX_INCOMPRESSIBLE - -#pragma message("warning: IncompressibleSolid.h is deprecated and will be removed after Cantera 2.5.0.") - -#include "thermo/ConstDensityThermo.h" -#include "kinetics/importKinetics.h" - -namespace Cantera -{ - -//! Wrapper for ConstDensityThermo with constructor from file -/*! - * @deprecated To be removed after Cantera 2.5.0. - * Replaceable with Solution and/or LatticePhase/IdealSolidSolnPhase. - */ -class IncompressibleSolid : public ConstDensityThermo -{ -public: - IncompressibleSolid(const std::string& infile, - std::string id="") : m_ok(false), m_r(0) - { - warn_deprecated("class IncompressibleSolid", - "To be removed after Cantera 2.5.0. " - "Replaceable with Solution and/or LatticePhase/IdealSolidSolnPhase."); - m_r = get_XML_File(infile); - if (id == "-") { - id = ""; - } - m_ok = buildSolutionFromXML(*m_r, id, "phase", this, 0); - if (!m_ok) throw CanteraError("IncompressibleSolid", - "buildSolutionFromXML returned false"); - } - - bool operator!() { - return !m_ok; - } - bool ready() const { - return m_ok; - } - -protected: - bool m_ok; - XML_Node* m_r; -}; -} - -#endif diff --git a/include/cantera/Interface.h b/include/cantera/Interface.h deleted file mode 100644 index cf267ba75..000000000 --- a/include/cantera/Interface.h +++ /dev/null @@ -1,105 +0,0 @@ -/** - * @file Interface.h - * Declaration and Definition for the class Interface. - */ - -// This file is part of Cantera. See License.txt in the top-level directory or -// at https://cantera.org/license.txt for license and copyright information. - -#ifndef CXX_INTERFACE -#define CXX_INTERFACE - -#pragma message("warning: Interface.h is deprecated and will be removed after Cantera 2.5.") - -#include "thermo.h" -#include "kinetics.h" -#include "cantera/thermo/SurfPhase.h" -#include "cantera/kinetics/InterfaceKinetics.h" - -namespace Cantera -{ -//! An interface between multiple bulk phases. -/*! - * This class is defined mostly for convenience. It inherits both from SurfPhase - * and InterfaceKinetics. It therefore represents a surface phase, and also acts - * as the kinetics manager to manage reactions occurring on the surface, - * possibly involving species from other phases. - * - * @deprecated To be removed after Cantera 2.5. - * Replaceable with Solution and/or SurfPhase/InterfaceKinetics. - */ -class Interface : - public SurfPhase, - public InterfaceKinetics -{ -public: - //! Constructor. - /*! - * Construct an Interface instance from a specification in an input file. - * - * @param infile Cantera input file in CTI or CTML format. - * @param id Identification string to distinguish between multiple - * definitions within one input file. - * @param otherPhases Neighboring phases that may participate in the - * reactions on this interface. Don't include the surface phase - */ - Interface(const std::string& infile, std::string id, - std::vector otherPhases) : - m_ok(false), - m_r(0) { - warn_deprecated("class Interface", - "To be removed after Cantera 2.5. " - "Replaceable with Solution and/or SurfPhase/InterfaceKinetics."); - - m_r = get_XML_File(infile); - if (id == "-") { - id = ""; - } - - XML_Node* x = get_XML_Node("#"+id, m_r); - if (!x) { - throw CanteraError("Interface","error in get_XML_Node"); - } - importPhase(*x, this); - otherPhases.push_back(this); - importKinetics(*x, otherPhases, this); - m_ok = true; - } - - //! Not operator - bool operator!() { - return !m_ok; - } - - //! return whether the object has been instantiated - bool ready() const { - return m_ok; - } - -protected: - //! Flag indicating that the object has been instantiated - bool m_ok; - - //! XML_Node pointer to the XML File object that contains the Surface and - //! the Interfacial Reaction object description - XML_Node* m_r; -}; - -//! Import an instance of class Interface from a specification in an input file. -/*! - * This is the preferred method to create an Interface instance. - * - * @deprecated To be removed after Cantera 2.5. Replaceable with Solution. - */ -inline Interface* importInterface(const std::string& infile, - const std::string& id, - std::vector phases) -{ - warn_deprecated("importInterface", "To be removed after Cantera 2.5. " - "Replaceable with Solution."); - return new Interface(infile, id, phases); -} - -} - -#endif diff --git a/include/cantera/Metal.h b/include/cantera/Metal.h deleted file mode 100644 index 1ec674014..000000000 --- a/include/cantera/Metal.h +++ /dev/null @@ -1,52 +0,0 @@ -//! @file Metal.h - -// This file is part of Cantera. See License.txt in the top-level directory or -// at https://cantera.org/license.txt for license and copyright information. - -#ifndef CXX_METAL -#define CXX_METAL - -#pragma message("warning: Metal.h is deprecated and will be removed after Cantera 2.5.0.") - -#include "thermo/MetalPhase.h" -#include "kinetics/importKinetics.h" - -namespace Cantera -{ - -//! Wrapper for MetalPhase with constructor from file -/*! - * @deprecated To be removed after Cantera 2.5.0. - * Replaceable with Solution and/or MetalPhase. - */ -class Metal : public MetalPhase -{ -public: - Metal(const std::string& infile, std::string id="") : m_ok(false), m_r(0) - { - warn_deprecated("class Metal", - "To be removed after Cantera 2.5.0. " - "Replaceable with Solution and/or MetalPhase."); - m_r = get_XML_File(infile); - if (id == "-") { - id = ""; - } - m_ok = buildSolutionFromXML(*m_r, id, "phase", this, 0); - if (!m_ok) throw CanteraError("Metal::Metal", - "buildSolutionFromXML returned false"); - } - - bool operator!() { - return !m_ok; - } - bool ready() const { - return m_ok; - } - -protected: - bool m_ok; - XML_Node* m_r; -}; -} - -#endif diff --git a/include/cantera/PureFluid.h b/include/cantera/PureFluid.h deleted file mode 100644 index f774a4ea9..000000000 --- a/include/cantera/PureFluid.h +++ /dev/null @@ -1,81 +0,0 @@ -//! @file PureFluid.h - -// This file is part of Cantera. See License.txt in the top-level directory or -// at https://cantera.org/license.txt for license and copyright information. - -#ifndef CXX_PUREFLUID -#define CXX_PUREFLUID - -#pragma message("warning: PureFluid.h is deprecated and will be removed after Cantera 2.5.0.") - -#include "thermo/PureFluidPhase.h" -#include "kinetics.h" - -namespace Cantera -{ - -//! Wrapper for PureFluidPhase with constructor from file -/*! - * @deprecated To be removed after Cantera 2.5.0. Replaceable with PureFluidPhase. - */ -class PureFluid : public PureFluidPhase -{ -public: - PureFluid() : m_ok(false), m_r(0) { - warn_deprecated("class PureFluid", "To be removed after Cantera 2.5.0. " - "Replaceable with PureFluidPhase."); - } - - PureFluid(const std::string& infile, std::string id="") : m_ok(false), m_r(0) { - warn_deprecated("class PureFluid", "To be removed after Cantera 2.5.0. " - "Replaceable with PureFluidPhase::initThermoFile."); - m_r = get_XML_File(infile); - if (id == "-") { - id = ""; - } - m_ok = buildSolutionFromXML(*m_r, id, "phase", this, 0); - if (!m_ok) throw CanteraError("PureFluid", - "buildSolutionFromXML returned false"); - } - - PureFluid(XML_Node& root, const std::string& id) : m_ok(false), m_r(0) { - m_ok = buildSolutionFromXML(root, id, "phase", this, 0); - } - - bool operator!() { - return !m_ok; - } - - bool ready() const { - return m_ok; - } - - friend std::ostream& operator<<(std::ostream& s, PureFluid& mix) { - std::string r = mix.report(true); - s << r; - return s; - } - -protected: - bool m_ok; - XML_Node* m_r; -}; - - -//! Water definition from liquidvapor input file -/*! - * @deprecated To be removed after Cantera 2.5.0. Replaceable with PureFluidPhase. - */ -class Water : public PureFluid -{ -public: - Water() : PureFluid(std::string("liquidvapor.cti"),std::string("water")) { - warn_deprecated("class Water", "To be removed after Cantera 2.5.0. " - "Replaceable with PureFluidPhase."); - } - virtual ~Water() {} -}; - -} - -#endif diff --git a/include/cantera/base/Array.h b/include/cantera/base/Array.h index 8480baa87..92e7fe64d 100644 --- a/include/cantera/base/Array.h +++ b/include/cantera/base/Array.h @@ -350,18 +350,6 @@ inline void operator*=(Array2D& m, doublereal a) scale(m.begin(), m.end(), m.begin(), a); } -//! Overload the plus equals operator for addition of one matrix with another -/*! - * Adds each element of the second matrix into the first matrix - * - * @param x First matrix - * @param y Second matrix, which is a const - */ -inline void operator+=(Array2D& x, const Array2D& y) -{ - sum_each(x.begin(), x.end(), y.begin()); -} - } #endif diff --git a/include/cantera/base/utilities.h b/include/cantera/base/utilities.h index c4811935f..dde4f8ed6 100644 --- a/include/cantera/base/utilities.h +++ b/include/cantera/base/utilities.h @@ -25,38 +25,6 @@ namespace Cantera { -//! Unary operator to multiply the argument by a constant. -/*! - * The form of this operator is designed for use by std::transform. - * @see @ref scale(). - * - * @deprecated To be removed after Cantera 2.5. Replaceable with C++11 lambda. - */ -template struct timesConstant : public std::unary_function { - //! Constructor - /*! - * @param c Constant of templated type T that will be stored internally - * within the object and used in the multiplication operation - */ - timesConstant(T c) : m_c(c) { - warn_deprecated("class timesConstant", - "To be removed after Cantera 2.5. Replaceable with C++11 lambda."); - } - - //! Parenthesis operator returning a double - /*! - * @param x Variable of templated type T that will be used in the - * multiplication operator - * @returns a value of type double from the internal multiplication - */ - double operator()(T x) { - return m_c * x; - } - - //! Stored constant value of time T - T m_c; -}; - //! Templated Inner product of two vectors of length 4. /*! * If either \a x or \a y has length greater than 4, only the first 4 elements @@ -139,313 +107,6 @@ inline void scale(InputIter begin, InputIter end, [scale_factor](double x) { return x * scale_factor; }); } -//! Multiply each entry in x by the corresponding entry in y. -/*! - * The template arguments are: template - * - * Simple code Equivalent: - * \code - * double x[10], y[10] - * for (n = 0; n < 10; n++) { - * x[n] *= y[n]; - * } - * \endcode - * Example of function call usage to implement the simple code example: - * \code - * double x[10], y[10] - * multiply_each(x, x+10, y); - * \endcode - * - * @param x_begin Iterator pointing to the beginning of the vector x, - * belonging to the iterator class InputIter. - * @param x_end Iterator pointing to the end of the vector x, belonging to - * the iterator class InputIter. The difference between end and - * begin determines the loop length - * @param y_begin Iterator pointing to the beginning of the vector y, - * belonging to the iterator class outputIter. - * @deprecated Unused. To be removed after Cantera 2.5. - */ -template -inline void multiply_each(OutputIter x_begin, OutputIter x_end, - InputIter y_begin) -{ - warn_deprecated("multiply_each", "To be removed after Cantera 2.5."); - for (; x_begin != x_end; ++x_begin, ++y_begin) { - *x_begin *= *y_begin; - } -} - -//! The maximum absolute value (templated version) -/*! - * The template arguments are: template - * - * Simple code Equivalent: - * \code - * double x[10] amax = 0.0; - * for (int n = 0; n < 10; n++) { - * if (fabs(x[n]) > amax) amax = fabs(x[10]); - * } - * return amax; - * \endcode - * Example of function call usage to implement the simple code example: - * \code - * double x[10] - * double amax = absmax(x, x+10); - * \endcode - * - * @param begin Iterator pointing to the beginning of the x vector, - * belonging to the iterator class InputIter. - * @param end Iterator pointing to the end of the x vector, belonging to - * the iterator class InputIter. The difference between end and - * begin determines the loop length - * @deprecated Unused. To be removed after Cantera 2.5. - */ -template -inline doublereal absmax(InputIter begin, InputIter end) -{ - warn_deprecated("absmax", "To be removed after Cantera 2.5."); - doublereal amax = 0.0; - for (; begin != end; ++begin) { - amax = std::max(fabs(*begin), amax); - } - return amax; -} - -//! Normalize the values in a sequence, such that they sum to 1.0 (templated -//! version) -/*! - * The template arguments are: template - * - * Simple Equivalent: - * \code - * double x[10], y[10], sum = 0.0; - * for (int n = 0; n < 10; n++) { - * sum += x[10]; - * } - * for (int n = 0; n < 10; n++) { - * y[n] = x[n]/sum; - * } - * \endcode - * Example of function call usage: - * \code - * double x[10], y[10]; - * normalize(x, x+10, y); - * \endcode - * - * @param begin Iterator pointing to the beginning of the x vector, - * belonging to the iterator class InputIter. - * @param end Iterator pointing to the end of the x vector, belonging to - * the iterator class InputIter. The difference between end and - * begin determines the loop length - * @param out Iterator pointing to the beginning of the output vector, - * belonging to the iterator class OutputIter. - * @deprecated Unused. To be removed after Cantera 2.5. - */ -template -inline void normalize(InputIter begin, InputIter end, - OutputIter out) -{ - warn_deprecated("normalize", "To be removed after Cantera 2.5."); - doublereal sum = std::accumulate(begin, end, 0.0); - for (; begin != end; ++begin, ++out) { - *out = *begin/sum; - } -} - -//! Templated divide of each element of \a x by the corresponding element of \a y. -/*! - * The template arguments are: template - * - * Simple Equivalent: - * \code - * double x[10], y[10]; - * for (n = 0; n < 10; n++) { - * x[n] /= y[n]; - * } - * \endcode - * Example of code usage: - * \code - * double x[10], y[10]; - * divide_each(x, x+10, y); - * \endcode - * - * @param x_begin Iterator pointing to the beginning of the x vector, - * belonging to the iterator class OutputIter. - * @param x_end Iterator pointing to the end of the x vector, belonging to - * the iterator class OutputIter. The difference between end - * and begin determines the number of inner iterations. - * @param y_begin Iterator pointing to the beginning of the yvector, belonging - * to the iterator class InputIter. - * @deprecated Unused. To be removed after Cantera 2.5. - */ -template -inline void divide_each(OutputIter x_begin, OutputIter x_end, - InputIter y_begin) -{ - warn_deprecated("divide_each", "To be removed after Cantera 2.5."); - for (; x_begin != x_end; ++x_begin, ++y_begin) { - *x_begin /= *y_begin; - } -} - -//! Increment each entry in \a x by the corresponding entry in \a y. -/*! - * The template arguments are: template - * - * @param x_begin Iterator pointing to the beginning of the x vector, - * belonging to the iterator class OutputIter. - * @param x_end Iterator pointing to the end of the x vector, belonging to - * the iterator class OutputIter. The difference between end - * and begin determines the number of inner iterations. - * @param y_begin Iterator pointing to the beginning of the yvector, belonging - * to the iterator class InputIter. - * @deprecated Unused. To be removed after Cantera 2.5. - */ -template -inline void sum_each(OutputIter x_begin, OutputIter x_end, - InputIter y_begin) -{ - warn_deprecated("sum_each", "To be removed after Cantera 2.5."); - for (; x_begin != x_end; ++x_begin, ++y_begin) { - *x_begin += *y_begin; - } -} - -//! Copies a contiguous range in a sequence to indexed -//! positions in another sequence. -/*! - * The template arguments are: template - * - * Example: - * - * \code - * vector_fp x(3), y(20); - * vector_int index(3); - * index[0] = 9; - * index[1] = 2; - * index[3] = 16; - * scatter_copy(x.begin(), x.end(), y.begin(), index.begin()); - * \endcode - * - * This routine is templated 3 times. - * InputIter is an iterator for the source vector - * OutputIter is an iterator for the destination vector - * IndexIter is an iterator for the index into the destination vector. - * - * @param begin Iterator pointing to the beginning of the source vector, - * belonging to the iterator class InputIter. - * @param end Iterator pointing to the end of the source vector, belonging - * to the iterator class InputIter. The difference between end - * and begin determines the number of inner iterations. - * @param result Iterator pointing to the beginning of the output vector, - * belonging to the iterator class outputIter. - * @param index Iterator pointing to the beginning of the index vector, belonging to the - * iterator class IndexIter. - * @deprecated Unused. To be removed after Cantera 2.5. - */ -template -inline void scatter_copy(InputIter begin, InputIter end, - OutputIter result, IndexIter index) -{ - warn_deprecated("scatter_copy", "To be removed after Cantera 2.5."); - for (; begin != end; ++begin, ++index) { - *(result + *index) = *begin; - } -} - -//! Multiply selected elements in an array by a contiguous sequence of -//! multipliers. -/*! - * The template arguments are: template - * - * Example: - * \code - * double multipliers[] = {8.9, -2.0, 5.6}; - * int index[] = {7, 4, 13}; - * vector_fp data(20); - * ... - * // Multiply elements 7, 4, and 13 in data by multipliers[0], multipliers[1],and multipliers[2], - * // respectively - * scatter_mult(multipliers, multipliers + 3, data.begin(), index); - * \endcode - * - * @param mult_begin Iterator pointing to the beginning of the multiplier - * vector, belonging to the iterator class InputIter. - * @param mult_end Iterator pointing to the end of the multiplier vector, - * belonging to the iterator class InputIter. The difference - * between end and begin determines the number of inner - * iterations. - * @param data Iterator pointing to the beginning of the output vector, - * belonging to the iterator class RandAccessIter, that will - * be selectively multiplied. - * @param index Iterator pointing to the beginning of the index vector, - * belonging to the iterator class IndexIter. - * @deprecated Unused. To be removed after Cantera 2.5. - */ -template -inline void scatter_mult(InputIter mult_begin, InputIter mult_end, - RandAccessIter data, IndexIter index) -{ - warn_deprecated("scatter_mult", "To be removed after Cantera 2.5."); - for (; mult_begin != mult_end; ++mult_begin, ++index) { - *(data + *index) *= *mult_begin; - } -} - -//! Compute \f[ \sum_k x_k \log x_k. \f]. -/*! - * The template arguments are: template - * - * A small number (1.0E-20) is added before taking the log. This templated - * class does the indicated sum. The template must be an iterator. - * - * @param begin Iterator pointing to the beginning, belonging to the - * iterator class InputIter. - * @param end Iterator pointing to the end, belonging to the - * iterator class InputIter. - * @return The return from this class is a double. - * @deprecated Unused. To be removed after Cantera 2.5. - */ -template -inline doublereal sum_xlogx(InputIter begin, InputIter end) -{ - warn_deprecated("sum_xlogx", "To be removed after Cantera 2.5."); - doublereal sum = 0.0; - for (; begin != end; ++begin) { - sum += (*begin) * std::log(*begin + Tiny); - } - return sum; -} - -//! Compute \f[ \sum_k x_k \log Q_k. \f]. -/*! - * The template arguments are: template - * - * This class is templated twice. The first template, InputIter1 is the iterator - * that points to $x_k$. The second iterator InputIter2, point to $Q_k$. A small - * number (1.0E-20) is added before taking the log. - * - * @param begin Iterator pointing to the beginning, belonging to the - * iterator class InputIter1. - * @param end Iterator pointing to the end, belonging to the - * iterator class InputIter1. - * @param Q_begin Iterator pointing to the beginning of Q_k, belonging to the - * iterator class InputIter2. - * @return The return from this class is hard coded to a doublereal. - * @deprecated Unused. To be removed after Cantera 2.5. - */ -template -inline doublereal sum_xlogQ(InputIter1 begin, InputIter1 end, - InputIter2 Q_begin) -{ - warn_deprecated("sum_xlogQ", "To be removed after Cantera 2.5."); - doublereal sum = 0.0; - for (; begin != end; ++begin, ++Q_begin) { - sum += (*begin) * std::log(*Q_begin + Tiny); - } - return sum; -} - //! Templated evaluation of a polynomial of order 6 /*! * @param x Value of the independent variable - First template parameter diff --git a/include/cantera/clib/ctreactor.h b/include/cantera/clib/ctreactor.h index 83eac79b8..e9a0783c5 100644 --- a/include/cantera/clib/ctreactor.h +++ b/include/cantera/clib/ctreactor.h @@ -15,7 +15,7 @@ extern "C" { #endif CANTERA_CAPI int reactor_new2(const char* type); - CANTERA_CAPI int reactor_new(int type); //!< @deprecated To be changed after Cantera 2.5. + CANTERA_CAPI int reactor_new(const char* type); CANTERA_CAPI int reactor_del(int i); CANTERA_CAPI int reactor_setInitialVolume(int i, double v); CANTERA_CAPI int reactor_setChemistry(int i, int cflag); @@ -49,23 +49,20 @@ extern "C" { CANTERA_CAPI double reactornet_sensitivity(int i, const char* v, int p, int r); CANTERA_CAPI int flowdev_new2(const char* type); - CANTERA_CAPI int flowdev_new(int type); //!< @deprecated To be changed after Cantera 2.5. + CANTERA_CAPI int flowdev_new(const char* type); CANTERA_CAPI int flowdev_del(int i); CANTERA_CAPI int flowdev_install(int i, int n, int m); CANTERA_CAPI int flowdev_setMaster(int i, int n); CANTERA_CAPI double flowdev_massFlowRate2(int i); - CANTERA_CAPI double flowdev_massFlowRate(int i, double time); //!< @deprecated To be changed after Cantera 2.5. - CANTERA_CAPI int flowdev_setMassFlowRate(int i, double mdot); - CANTERA_CAPI int flowdev_setParameters(int i, int n, const double* v); //!< @deprecated To be removed after Cantera 2.5. + CANTERA_CAPI double flowdev_massFlowRate(int i); CANTERA_CAPI int flowdev_setMassFlowCoeff(int i, double v); CANTERA_CAPI int flowdev_setValveCoeff(int i, double v); CANTERA_CAPI int flowdev_setPressureCoeff(int i, double v); - CANTERA_CAPI int flowdev_setFunction(int i, int n); //!< @deprecated To be removed after Cantera 2.5. CANTERA_CAPI int flowdev_setPressureFunction(int i, int n); CANTERA_CAPI int flowdev_setTimeFunction(int i, int n); CANTERA_CAPI int wall_new2(const char* type); - CANTERA_CAPI int wall_new(int type); //!< @deprecated To be changed after Cantera 2.5. + CANTERA_CAPI int wall_new(const char* type); CANTERA_CAPI int wall_del(int i); CANTERA_CAPI int wall_install(int i, int n, int m); CANTERA_CAPI double wall_vdot(int i, double t); diff --git a/include/cantera/kinetics/Falloff.h b/include/cantera/kinetics/Falloff.h index adbdd5818..66eae6f82 100644 --- a/include/cantera/kinetics/Falloff.h +++ b/include/cantera/kinetics/Falloff.h @@ -80,16 +80,6 @@ public: return "Lindemann"; } - //! Return an integer representing the type of the Falloff parameterization. - /*! - * @deprecated To be removed after Cantera 2.5. - */ - virtual int getType() const { - warn_deprecated("Falloff::getType()", - "Replaced by Falloff::type(). To be removed after Cantera 2.5."); - return SIMPLE_FALLOFF; - } - //! Returns the number of parameters used by this parameterization. The //! values of these parameters can be obtained from getParameters(). virtual size_t nParameters() const { @@ -161,12 +151,6 @@ public: return "Troe"; } - virtual int getType() const { - warn_deprecated("Troe::getType()", - "Replaced by Troe::type(). To be removed after Cantera 2.5."); - return TROE_FALLOFF; - } - virtual size_t nParameters() const { return 4; } @@ -241,12 +225,6 @@ public: return "SRI"; } - virtual int getType() const { - warn_deprecated("SRI::getType()", - "Replaced by SRI::type(). To be removed after Cantera 2.5."); - return SRI_FALLOFF; - } - virtual size_t nParameters() const { return 5; } diff --git a/include/cantera/kinetics/FalloffFactory.h b/include/cantera/kinetics/FalloffFactory.h index 5369af025..190564d65 100644 --- a/include/cantera/kinetics/FalloffFactory.h +++ b/include/cantera/kinetics/FalloffFactory.h @@ -49,20 +49,6 @@ public: s_factory = 0; } - //! Return a pointer to a new falloff function calculator. - /*! - * @param type Integer flag specifying the type of falloff function. The - * standard types are defined in file reaction_defs.h. A - * factory class derived from FalloffFactory may define other - * types as well. - * @param c input vector of doubles which populates the falloff - * parameterization. - * @returns a pointer to a new Falloff class. - * - * @deprecated To be removed after Cantera 2.5. - */ - virtual Falloff* newFalloff(int type, const vector_fp& c); - //! Return a pointer to a new falloff function calculator. /*! * @param type String identifier specifying the type of falloff function. @@ -86,12 +72,6 @@ private: static std::mutex falloff_mutex; }; -//! @copydoc FalloffFactory::newFalloff -/*! - * @deprecated To be removed after Cantera 2.5. - */ -shared_ptr newFalloff(int type, const vector_fp& c); - //! @copydoc FalloffFactory::newFalloff shared_ptr newFalloff(const std::string& type, const vector_fp& c); diff --git a/include/cantera/kinetics/InterfaceKinetics.h b/include/cantera/kinetics/InterfaceKinetics.h index ef416262f..e15e5b1a7 100644 --- a/include/cantera/kinetics/InterfaceKinetics.h +++ b/include/cantera/kinetics/InterfaceKinetics.h @@ -375,9 +375,6 @@ public: */ int phaseStability(const size_t iphase) const; - //! @deprecated To be removed after Cantera 2.5. - virtual void determineFwdOrdersBV(ElectrochemicalReaction& r, vector_fp& fwdFullorders); - protected: //! Build a SurfaceArrhenius object from a Reaction, taking into account //! the possible sticking coefficient form and coverage dependencies @@ -517,27 +514,12 @@ protected: //! reactions in the mechanism /*! * Vector of reaction indices which involve charge transfers. This provides - * an index into the m_beta and m_ctrxn_BVform array. + * an index into the m_beta array. * * irxn = m_ctrxn[i] */ std::vector m_ctrxn; - //! Vector of Reactions which follow the Butler-Volmer methodology for specifying the - //! exchange current density first. Then, the other forms are specified based on this form. - /*! - * Length is equal to the number of reactions with charge transfer coefficients, m_ctrxn[] - * - * m_ctrxn_BVform[i] = 0; This means that the irxn reaction is calculated via the standard forward - * and reverse reaction rates - * m_ctrxn_BVform[i] = 1; This means that the irxn reaction is calculated via the BV format - * directly. - * m_ctrxn_BVform[i] = 2; this means that the irxn reaction is calculated via the BV format - * directly, using concentrations instead of activity concentrations. - * @deprecated To be removed after Cantera 2.5. - */ - std::vector m_ctrxn_BVform; - //! Vector of booleans indicating whether the charge transfer reaction rate constant //! is described by an exchange current density rate constant expression /*! diff --git a/include/cantera/kinetics/Reaction.h b/include/cantera/kinetics/Reaction.h index ff8280c2a..6147ed110 100644 --- a/include/cantera/kinetics/Reaction.h +++ b/include/cantera/kinetics/Reaction.h @@ -245,16 +245,6 @@ public: ElectrochemicalReaction(const Composition& reactants, const Composition& products, const Arrhenius& rate); - //! Film Resistivity value - /*! - * For Butler Volmer reactions, a common addition to the formulation is to - * add an electrical resistance to the formulation. The resistance modifies - * the electrical current flow in both directions. Only valid for Butler- - * Volmer formulations. Units are in ohms m2. Default = 0.0 ohms m2. - * @deprecated Unused. To be removed after Cantera 2.5. - */ - doublereal film_resistivity; - //! Forward value of the apparent Electrochemical transfer coefficient doublereal beta; diff --git a/include/cantera/kinetics/RxnRates.h b/include/cantera/kinetics/RxnRates.h index 92667dba3..a473d5797 100644 --- a/include/cantera/kinetics/RxnRates.h +++ b/include/cantera/kinetics/RxnRates.h @@ -31,16 +31,6 @@ class Array2D; class Arrhenius { public: - //! return the rate coefficient type. - /*! - * @deprecated To be removed after Cantera 2.5. - */ - static int type() { - warn_deprecated("Arrhenius::type()", - "To be removed after Cantera 2.5."); - return ARRHENIUS_REACTION_RATECOEFF_TYPE; - } - //! Default constructor. Arrhenius(); @@ -125,15 +115,6 @@ class SurfaceArrhenius { public: - /*! - * @deprecated To be removed after Cantera 2.5. - */ - static int type() { - warn_deprecated("SurfaceArrhenius::type()", - "To be removed after Cantera 2.5."); - return SURF_ARRHENIUS_REACTION_RATECOEFF_TYPE; - } - SurfaceArrhenius(); explicit SurfaceArrhenius(double A, double b, double Ta); @@ -221,16 +202,6 @@ protected: class Plog { public: - //! return the rate coefficient type. - /*! - * @deprecated To be removed after Cantera 2.5. - */ - static int type() { - warn_deprecated("Plog::type()", - "To be removed after Cantera 2.5."); - return PLOG_REACTION_RATECOEFF_TYPE; - } - //! Default constructor. Plog() {} @@ -355,16 +326,6 @@ protected: class ChebyshevRate { public: - //! return the rate coefficient type. - /*! - * @deprecated To be removed after Cantera 2.5. - */ - static int type() { - warn_deprecated("ChebyshevRate::type()", - "To be removed after Cantera 2.5."); - return CHEBYSHEV_REACTION_RATECOEFF_TYPE; - } - //! Default constructor. ChebyshevRate() {} diff --git a/include/cantera/kinetics/reaction_defs.h b/include/cantera/kinetics/reaction_defs.h index 2487b2cbb..8eaacdfbc 100644 --- a/include/cantera/kinetics/reaction_defs.h +++ b/include/cantera/kinetics/reaction_defs.h @@ -76,26 +76,6 @@ const int SURFACE_RXN = 20; //! A reaction occurring on an interface, e.g a surface or edge. const int INTERFACE_RXN = 20; -//! This is a surface reaction that is formulated using the Butler-Volmer -//! formulation and using concentrations instead of activity concentrations -//! for its exchange current density formula. -//! @deprecated To be removed after Cantera 2.5. -const int BUTLERVOLMER_NOACTIVITYCOEFFS_RXN = 25; - -//! This is a surface reaction that is formulated using the Butler-Volmer -//! formulation. Note the B-V equations can be derived from the forward -//! and reverse rate constants for a single step reaction. However, there -//! are some advantages to using the formulation directly. -//! @deprecated To be removed after Cantera 2.5. -const int BUTLERVOLMER_RXN = 26; - -//! This is a surface reaction that is formulated using the affinity -//! representation, common in the geochemistry community. -//! This is generally a global non-mass action reaction with an additional functional -//! form dependence on delta G of reaction. -//! @deprecated To be removed after Cantera 2.5. -const int SURFACEAFFINITY_RXN = 27; - /** * A reaction occurring at a one-dimensional interface between two surface phases. * NOTE: This is a bit ambiguous, and will be taken out in the future @@ -104,48 +84,6 @@ const int SURFACEAFFINITY_RXN = 27; */ const int EDGE_RXN = 22; -/** - * A global reaction. These may have non-mass action reaction orders, - * and are not allowed to be reversible. - * @deprecated To be removed after Cantera 2.5. - */ -const int GLOBAL_RXN = 30; - -//@} - -/** @name Rate Coefficient Types - * These types define the supported rate coefficient types for - * elementary reactions. Any of these may also be used as the high and - * low-pressure limits of falloff and chemical activation reactions. - * - * Note that not all of these are currently implemented! - * @todo Finish implementing reaction rate types. - * - * Magic numbers - * @deprecated To be removed after Cantera 2.5. - */ -//@{ - -const int ARRHENIUS_REACTION_RATECOEFF_TYPE = 1; -const int LANDAUTELLER_REACTION_RATECOEFF_TYPE = 2; -const int TSTRATE_REACTION_RATECOEFF_TYPE = 3; -const int SURF_ARRHENIUS_REACTION_RATECOEFF_TYPE = 4; -const int ARRHENIUS_SUM_REACTION_RATECOEFF_TYPE = 5; -const int EXCHANGE_CURRENT_REACTION_RATECOEFF_TYPE = 6; -const int PLOG_REACTION_RATECOEFF_TYPE = 7; -const int CHEBYSHEV_REACTION_RATECOEFF_TYPE = 8; - -//@} - -/** @name Falloff Function Types - * - * Magic numbers - * @deprecated To be removed after Cantera 2.5. - */ -//@{ -const int SIMPLE_FALLOFF = 100; -const int TROE_FALLOFF = 110; -const int SRI_FALLOFF = 112; //@} } diff --git a/include/cantera/numerics/Integrator.h b/include/cantera/numerics/Integrator.h index 58d073b29..b5c99be2d 100644 --- a/include/cantera/numerics/Integrator.h +++ b/include/cantera/numerics/Integrator.h @@ -175,12 +175,6 @@ public: warn("setMethodType"); } - //! Set the linear iterator. - //! @deprecated Unused. To be removed after Cantera 2.5. - virtual void setIterator(IterType t) { - warn_deprecated("Integrator::setIterator", "To be removed after Cantera 2.5."); - } - //! Set the maximum step size virtual void setMaxStepSize(double hmax) { warn("setMaxStepSize"); diff --git a/include/cantera/oneD/Boundary1D.h b/include/cantera/oneD/Boundary1D.h index f1a7807b9..3209a0cbd 100644 --- a/include/cantera/oneD/Boundary1D.h +++ b/include/cantera/oneD/Boundary1D.h @@ -97,21 +97,6 @@ protected: }; -/*! - * Renamed base class for boundaries between one-dimensional spatial domains. - * @deprecated To be removed after Cantera 2.5. - */ -class Bdry1D : public Boundary1D -{ -public: - Bdry1D() : Boundary1D() { - warn_deprecated("Bdry1D::Bdry1D()", - "To be removed after Cantera 2.5. " - "Class renamed to Boundary1D."); - } -}; - - /** * An inlet. * @ingroup onedim diff --git a/include/cantera/oneD/StFlow.h b/include/cantera/oneD/StFlow.h index bfae2394f..77e1df46b 100644 --- a/include/cantera/oneD/StFlow.h +++ b/include/cantera/oneD/StFlow.h @@ -229,15 +229,6 @@ public: //! Change the grid size. Called after grid refinement. virtual void resize(size_t components, size_t points); - /*! - * @deprecated To be removed after Cantera 2.5. - */ - virtual void setFixedPoint(int j0, doublereal t0) { - // this does nothing and does not appear to be overloaded - warn_deprecated("StFlow::setFixedPoint", - "To be removed after Cantera 2.5."); - } - //! Set the gas object state to be consistent with the solution at point j. void setGas(const doublereal* x, size_t j); diff --git a/include/cantera/thermo/ConstDensityThermo.h b/include/cantera/thermo/ConstDensityThermo.h deleted file mode 100644 index e0976ea57..000000000 --- a/include/cantera/thermo/ConstDensityThermo.h +++ /dev/null @@ -1,168 +0,0 @@ -/** - * @file ConstDensityThermo.h - * Header for a Thermo manager for incompressible ThermoPhases - * (see \ref thermoprops and \link Cantera::ConstDensityThermo ConstDensityThermo\endlink). - */ - -// This file is part of Cantera. See License.txt in the top-level directory or -// at https://cantera.org/license.txt for license and copyright information. - -#ifndef CT_CONSTRHOTHERMO_H -#define CT_CONSTRHOTHERMO_H - -#include "ThermoPhase.h" -#include "cantera/base/utilities.h" - -namespace Cantera -{ - -//! Overloads the virtual methods of class ThermoPhase to implement the -//! incompressible equation of state. -/** - * ## Specification of Solution Thermodynamic Properties - * - * 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() { - 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"; - } - - virtual bool isCompressible() const { - return false; - } - - virtual doublereal enthalpy_mole() const; - virtual doublereal entropy_mole() const; - virtual doublereal cp_mole() const; - virtual doublereal cv_mole() const; - - //! Return the thermodynamic pressure (Pa). - virtual doublereal pressure() const; - - //! Set the internally stored pressure (Pa) at constant temperature and - //! composition - /*! - * @param p input Pressure (Pa) - */ - virtual void setPressure(doublereal p); - - virtual void getActivityConcentrations(doublereal* c) const; - virtual void getActivityCoefficients(doublereal* ac) const; - - virtual void getChemPotentials(doublereal* mu) const; - virtual void getStandardChemPotentials(doublereal* mu0) const; - - //! Returns the standard Concentration in units of m3 kmol-1. - //! @copydoc ThermoPhase::standardConcentration - virtual doublereal standardConcentration(size_t k=0) const; - - virtual void getPureGibbs(doublereal* gpure) const { - const vector_fp& gibbsrt = gibbs_RT(); - scale(gibbsrt.begin(), gibbsrt.end(), gpure, RT()); - } - - void getEnthalpy_RT(doublereal* hrt) const { - const vector_fp& _h = enthalpy_RT(); - std::copy(_h.begin(), _h.end(), hrt); - } - - void getEntropy_R(doublereal* sr) const { - const vector_fp& _s = entropy_R(); - std::copy(_s.begin(), _s.end(), sr); - } - - virtual void getGibbs_RT(doublereal* grt) const { - const vector_fp& gibbsrt = gibbs_RT(); - std::copy(gibbsrt.begin(), gibbsrt.end(), grt); - } - - void getCp_R(doublereal* cpr) const { - const vector_fp& _cpr = cp_R(); - std::copy(_cpr.begin(), _cpr.end(), cpr); - } - - //! Returns a reference to the vector of nondimensional enthalpies of the - //! reference state at the current temperature of the solution and the - //! reference pressure for the species. - const vector_fp& enthalpy_RT() const { - _updateThermo(); - return m_h0_RT; - } - - //! Returns a reference to the vector of nondimensional Gibbs Free Energies - //! of the reference state at the current temperature of the solution and - //! the reference pressure for the species. - const vector_fp& gibbs_RT() const { - _updateThermo(); - return m_g0_RT; - } - - //! Returns a reference to the vector of nondimensional entropies of the - //! reference state at the current temperature of the solution and the - //! reference pressure for each species. - const vector_fp& entropy_R() const { - _updateThermo(); - return m_s0_R; - } - - //! Returns a reference to the vector of nondimensional constant pressure - //! heat capacities of the reference state at the current temperature of the - //! solution and reference pressure for each species. - const vector_fp& cp_R() const { - _updateThermo(); - return m_cp0_R; - } - - virtual bool addSpecies(shared_ptr spec); - - virtual void setParameters(int n, doublereal* const c) { - assignDensity(c[0]); - } - - virtual void getParameters(int& n, doublereal* const c) const { - double d = density(); - c[0] = d; - n = 1; - } - - virtual void initThermo(); - virtual void setParametersFromXML(const XML_Node& eosdata); - -protected: - //! Temporary storage for dimensionless reference state enthalpies - mutable vector_fp m_h0_RT; - - //! Temporary storage for dimensionless reference state heat capacities - mutable vector_fp m_cp0_R; - - //! Temporary storage for dimensionless reference state Gibbs energies - mutable vector_fp m_g0_RT; - - //! Temporary storage for dimensionless reference state entropies - mutable vector_fp m_s0_R; - - //! Current pressure (Pa) - doublereal m_press; - -private: - //! Function to update the reference state thermo functions - void _updateThermo() const; -}; -} - -#endif diff --git a/include/cantera/thermo/DebyeHuckel.h b/include/cantera/thermo/DebyeHuckel.h index 1ab1ae1a4..e826f40a5 100644 --- a/include/cantera/thermo/DebyeHuckel.h +++ b/include/cantera/thermo/DebyeHuckel.h @@ -627,44 +627,6 @@ protected: virtual void calcDensity(); public: - //! Set the internally stored density (gm/m^3) of the phase. - /*! - * Overridden setDensity() function is necessary because the density is not - * an independent variable. - * - * This function will now throw an error condition - * - * @internal May have to adjust the strategy here to make the eos for these - * materials slightly compressible, in order to create a condition where - * the density is a function of the pressure. - * - * This function will now throw an error condition if the input isn't - * exactly equal to the current density. - * - * @todo Now have a compressible ss equation for liquid water. Therefore, - * this phase is compressible. May still want to change the - * independent variable however. - * - * @param rho Input density (kg/m^3). - * @deprecated Functionality merged with base function after Cantera 2.5. - * (superseded by isCompressible check in Phase::setDensity) - */ - virtual void setDensity(const doublereal rho); - - //! Set the internally stored molar density (kmol/m^3) of the phase. - /** - * Overridden setMolarDensity() function is necessary because the density - * is not an independent variable. - * - * This function will now throw an error condition if the input isn't - * exactly equal to the current molar density. - * - * @param conc Input molar density (kmol/m^3). - * @deprecated Functionality merged with base function after Cantera 2.5. - * (superseded by isCompressible check in Phase::setDensity) - */ - virtual void setMolarDensity(const doublereal conc); - /** * @} * @name Activities, Standard States, and Activity Concentrations diff --git a/include/cantera/thermo/FixedChemPotSSTP.h b/include/cantera/thermo/FixedChemPotSSTP.h deleted file mode 100644 index 77c550dbc..000000000 --- a/include/cantera/thermo/FixedChemPotSSTP.h +++ /dev/null @@ -1,396 +0,0 @@ -/** - * @file FixedChemPotSSTP.h - * Header file for the FixedChemPotSSTP class, which represents a fixed-composition - * incompressible substance with a constant chemical potential (see \ref thermoprops and - * class \link Cantera::FixedChemPotSSTP FixedChemPotSSTP\endlink) - */ - -// This file is part of Cantera. See License.txt in the top-level directory or -// at https://cantera.org/license.txt for license and copyright information. - -#ifndef CT_FIXEDCHEMPOTSSTP_H -#define CT_FIXEDCHEMPOTSSTP_H - -#include "SingleSpeciesTP.h" - -namespace Cantera -{ - -//! Class FixedChemPotSSTP represents a stoichiometric (fixed composition) -//! incompressible substance. -/*! - * This class internally changes the independent degree of freedom from density - * to pressure. This is necessary because the phase is incompressible. It uses a - * zero volume approximation. - * - * ## Specification of Species Standard State Properties - * - * This class inherits from SingleSpeciesTP. It uses a single value for the - * chemical potential which is assumed to be constant with respect to - * temperature and pressure. - * - * The reference state thermodynamics is inherited from SingleSpeciesTP. - * However, it's only used to set the initial chemical potential to the value of - * the chemical potential at the starting conditions. Thereafter, it is ignored. - * - * For a zero volume material, the internal energy and the enthalpy are equal to - * the chemical potential. The entropy, the heat capacity, and the molar volume - * are equal to zero. - * - * ## Specification of Solution Thermodynamic Properties - * - * All solution properties are obtained from the standard state species - * functions, since there is only one species in the phase. - * - * ## Application within Kinetics Managers - * - * The standard concentration is equal to 1.0. This means that the kinetics - * operator works on an (activities basis). Since this is a stoichiometric - * substance, this means that the concentration of this phase drops out of - * kinetics expressions. - * - * An example of a reaction using this is a sticking coefficient reaction of a - * substance in an ideal gas phase on a surface with a bulk phase species in - * this phase. In this case, the rate of progress for this reaction, \f$ R_s - * \f$, may be expressed via the following equation: - * \f[ - * R_s = k_s C_{gas} - * \f] - * where the units for \f$ R_s \f$ are kmol m-2 s-1. \f$ C_{gas} \f$ has units - * of kmol m-3. Therefore, the kinetic rate constant, \f$ k_s \f$, has units of - * m s-1. Nowhere does the concentration of the bulk phase appear in the rate - * constant expression, since it's a stoichiometric phase, and the activity is - * always equal to 1.0. - * - * ## Instantiation of the Class - * - * This phase may be instantiated by calling the default ThermoFactory routine - * for %Cantera. This new FixedChemPotSSTP object must then have a standalone - * XML file description an example of which is given below. - * - * It may also be created by the following code snippets. The code includes the - * special member function setChemicalPotential( chempot), which sets the - * chemical potential to a specific value in J / kmol. - * - * @code - * XML_Node *xm = get_XML_NameID("phase", iFile + "#Li(Fixed)", 0); - * FixedChemPotSSTP *LiFixed = new FixedChemPotSSTP(*xm); - * // Set the chemical potential to -2.3E7 J/kmol - * LiFixed->setChemicalPotential(-2.3E7.) - * @endcode - * - * or by the following call to importPhase(): - * - * @code - * XML_Node *xm = get_XML_NameID("phase", iFile + "#NaCl(S)", 0); - * FixedChemPotSSTP solid; - * importPhase(*xm, &solid); - * @endcode - * - * The phase may also be created by a special constructor so that element - * potentials may be set. The constructor takes the name of the element and - * the value of the element chemical potential. An example is given below. - * - * @code - * FixedChemPotSSTP *LiFixed = new FixedChemPotSSTP("Li", -2.3E7); - * @endcode - * - * ## XML Example - * - * The phase model name for this is called FixedChemPot. It must be supplied - * as the model attribute of the thermo XML element entry. - * - * @code - * - * - * - * - * - * - * - * Li - * - * - * LiFixed - * - * - * -2.3E7 - * - * - * - * - * - * - * - * - * Li:1 - * - * - * - * 50.72389, 6.672267, -2.517167, - * 10.15934, -0.200675, -427.2115, - * 130.3973 - * - * - * - * - * - * - * @endcode - * - * The model attribute, "FixedChemPot", on the thermo element - * identifies the phase as being a FixedChemPotSSTP object. - * - * @ingroup thermoprops - * - * @deprecated To be removed after Cantera 2.5. Use the `fixed-stoichiometry` - * thermo model (class StoichSubstance) with a `constant-cp` species thermo - * model, `h0` set to the desired chemical potential, and `s0` set to 0. - */ -class FixedChemPotSSTP : public SingleSpeciesTP -{ -public: - //! Default constructor for the FixedChemPotSSTP class - FixedChemPotSSTP(); - - //! Construct and initialize a FixedChemPotSSTP ThermoPhase object - //! directly from an ASCII input file - /*! - * @param infile name of the input file - * @param id name of the phase id in the file. - * If this is blank, the first phase in the file is used. - */ - FixedChemPotSSTP(const std::string& infile, const std::string& id = ""); - - //! Construct and initialize a FixedChemPotSSTP ThermoPhase object - //! directly from an XML database - /*! - * @param phaseRef XML node pointing to a FixedChemPotSSTP description - * @param id Id of the phase. - */ - FixedChemPotSSTP(XML_Node& phaseRef, const std::string& id = ""); - - //! Special constructor for the FixecChemPotSSTP class setting an element - //! chemical potential directly - /*! - * This will create a FixedChemPotSSTP consisting of a single species with the - * stoichiometry of one of the specified atom. It will have a chemical potential - * that is given by the second argument. - * - * @param Ename String name of the element - * @param chemPot Value of the chemical potential of that element (J/kmol) - */ - FixedChemPotSSTP(const std::string& Ename, doublereal chemPot); - - virtual std::string type() const { - return "FixedChemPot"; - } - - virtual bool isCompressible() const { - return false; - } - - //! @} - //! @name Mechanical Equation of State - //! @{ - - //! Report the Pressure. Units: Pa. - /*! - * For an incompressible substance, the density is independent of pressure. - * This method simply returns the stored pressure value. - */ - virtual doublereal pressure() const; - - //! Set the pressure at constant temperature. Units: Pa. - /*! - * For an incompressible substance, the density is independent of pressure. - * Therefore, this method only stores the specified pressure value. It does - * not modify the density. - * - * @param p Pressure (units - Pa) - */ - virtual void setPressure(doublereal p); - - virtual doublereal isothermalCompressibility() const; - virtual doublereal thermalExpansionCoeff() const; - - /** - * @} - * @name Activities, Standard States, and Activity Concentrations - * - * This section is largely handled by parent classes, since there - * is only one species. Therefore, the activity is equal to one. - * @{ - */ - - virtual Units standardConcentrationUnits() const; - - //! @copydoc ThermoPhase::getActivityConcentrations - /*! - * For a stoichiometric substance, there is only one species, and the - * generalized concentration is 1.0. - */ - virtual void getActivityConcentrations(doublereal* c) const; - - //! Return the standard concentration for the kth species - /*! - * The standard concentration \f$ C^0_k \f$ used to normalize the activity - * (i.e., generalized) concentration. This phase assumes that the kinetics - * operator works on an dimensionless basis. Thus, the standard - * concentration is equal to 1.0. - * - * @param k Optional parameter indicating the species. The default is to - * assume this refers to species 0. - * @return - * Returns The standard Concentration as 1.0 - */ - virtual doublereal standardConcentration(size_t k=0) const; - virtual doublereal logStandardConc(size_t k=0) const; - - //! Get the array of chemical potentials at unit activity for the species at - //! their standard states at the current *T* and *P* of the solution. - /*! - * For a stoichiometric substance, there is no activity term in the chemical - * potential expression, and therefore the standard chemical potential and - * the chemical potential are both equal to the molar Gibbs function. - * - * These are the standard state chemical potentials \f$ \mu^0_k(T,P) \f$. - * The values are evaluated at the current temperature and pressure of the - * solution - * - * @param mu0 Output vector of chemical potentials. Length: m_kk. - */ - virtual void getStandardChemPotentials(doublereal* mu0) const; - - //@} - /// @name Partial Molar Properties of the Solution - /// These properties are handled by the parent class, SingleSpeciesTP - //@{ - - //! Get the species partial molar volumes. Units: m^3/kmol. - /*! - * This is the phase molar volume. \f$ V(T,P) = V_o(T,P) \f$. - * - * set to zero. - * - * @param vbar On return, contains the molar volume of the single species - * and the phase. Units are m^3 / kmol. Length = 1 - */ - virtual void getPartialMolarVolumes(doublereal* vbar) const; - - //@} - /// @name Properties of the Standard State of the Species in the Solution - //@{ - - virtual void getEnthalpy_RT(doublereal* hrt) const; - virtual void getEntropy_R(doublereal* sr) const; - virtual void getGibbs_RT(doublereal* grt) const; - virtual void getCp_R(doublereal* cpr) const; - - //! Returns the vector of nondimensional Internal Energies of the standard - //! state species at the current *T* and *P* of the solution - /*! - * For an incompressible, stoichiometric substance, the molar internal - * energy is independent of pressure. Since the thermodynamic properties are - * specified by giving the standard-state enthalpy, the term \f$ P_{ref} - * \hat v\f$ is subtracted from the specified reference molar enthalpy to - * compute the standard state molar internal energy. - * - * @param urt output vector of nondimensional standard state - * internal energies of the species. Length: m_kk. - */ - virtual void getIntEnergy_RT(doublereal* urt) const; - - //! Get the molar volumes of each species in their standard states at the - //! current *T* and *P* of the solution. - /* - * units = m^3 / kmol - * - * We set this to zero - * - * @param vbar On output this contains the standard volume of the species - * and phase (m^3/kmol). Vector of length 1 - */ - virtual void getStandardVolumes(doublereal* vbar) const; - - //@} - /// @name Thermodynamic Values for the Species Reference States - //@{ - - virtual void getIntEnergy_RT_ref(doublereal* urt) const; - virtual void getEnthalpy_RT_ref(doublereal* hrt) const; - virtual void getGibbs_RT_ref(doublereal* grt) const; - virtual void getGibbs_ref(doublereal* g) const; - virtual void getEntropy_R_ref(doublereal* er) const; - virtual void getCp_R_ref(doublereal* cprt) const; - - //@} - - virtual void initThermoXML(XML_Node& phaseNode, const std::string& id); - - virtual void initThermo(); - - //! Set the equation of state parameters - /*! - * @internal - * @param n number of parameters = 1 - * @param c array of \a n coefficients - * c[0] = density of phase [ kg/m3 ] - */ - virtual void setParameters(int n, doublereal* const c); - - //! Get the equation of state parameters in a vector - /*! - * @internal - * - * @param n number of parameters - * @param c array of \a n coefficients - * - * For this phase: - * - n = 1 - * - c[0] = density of phase [ kg/m3 ] - */ - virtual void getParameters(int& n, doublereal* const c) const; - - //! Set equation of state parameter values from XML entries. - /*! - * This method is called by function importPhase() when processing a phase - * definition in an input file. It should be overloaded in subclasses to set - * any parameters that are specific to that particular phase model. Note, - * this method is called before the phase is initialized with elements - * and/or species. - * - * For this phase, the chemical potential is set. - * - * @param eosdata An XML_Node object corresponding to - * the "thermo" entry for this phase in the input file. - * - * eosdata points to the thermo block, and looks like this: - * - * @code - * - * - * -2.7E7 - * - * - * @endcode - */ - virtual void setParametersFromXML(const XML_Node& eosdata); - - //! Function to set the chemical potential directly - /*! - * @param chemPot Value of the chemical potential (units J/kmol) - */ - void setChemicalPotential(doublereal chemPot); - -protected: - //! Value of the chemical potential of the bath species - /*! - * units are J/kmol - */ - doublereal chemPot_; -}; - -} - -#endif diff --git a/include/cantera/thermo/HMWSoln.h b/include/cantera/thermo/HMWSoln.h index 4c0f623c8..2aeb7e7ef 100644 --- a/include/cantera/thermo/HMWSoln.h +++ b/include/cantera/thermo/HMWSoln.h @@ -1171,44 +1171,6 @@ protected: void calcDensity(); public: - //! Set the internally stored density (kg/m^3) of the phase. - /*! - * Overridden setDensity() function is necessary because the density is not - * an independent variable. - * - * This function will now throw an error condition. - * - * Note, in general, setting the phase density is now a nonlinear - * calculation. P and T are the fundamental variables. This routine should - * be revamped to do the nonlinear problem. - * - * @todo May have to adjust the strategy here to make the eos for these - * materials slightly compressible, in order to create a condition where - * the density is a function of the pressure. - * @todo Now have a compressible ss equation for liquid water. Therefore, - * this phase is compressible. May still want to change the - * independent variable however. - * - * @param rho Input density (kg/m^3). - * @deprecated Functionality merged with base function after Cantera 2.5. - * (superseded by isCompressible check in Phase::setDensity) - */ - virtual void setDensity(const doublereal rho); - - //! Set the internally stored molar density (kmol/m^3) for the phase. - /** - * Overridden setMolarDensity() function is necessary because of the - * underlying water model. - * - * This function will now throw an error condition if the input isn't - * exactly equal to the current molar density. - * - * @param conc Input molar density (kmol/m^3). - * @deprecated Functionality merged with base function after Cantera 2.5. - * (superseded by isCompressible check in Phase::setDensity) - */ - virtual void setMolarDensity(const doublereal conc); - /** * @} * @name Activities, Standard States, and Activity Concentrations diff --git a/include/cantera/thermo/IdealMolalSoln.h b/include/cantera/thermo/IdealMolalSoln.h index 8c9e0be6f..7120b12b1 100644 --- a/include/cantera/thermo/IdealMolalSoln.h +++ b/include/cantera/thermo/IdealMolalSoln.h @@ -213,34 +213,6 @@ protected: void calcDensity(); public: - /** - * Overridden setDensity() function is necessary because the density is not - * an independent variable. - * - * This function will now throw an error condition - * - * @internal May have to adjust the strategy here to make the eos for these - * materials slightly compressible, in order to create a condition where - * the density is a function of the pressure. - * - * @param rho Input Density - * @deprecated Functionality merged with base function after Cantera 2.5. - * (superseded by isCompressible check in Phase::setDensity) - */ - virtual void setDensity(const doublereal rho); - - /** - * Overridden setMolarDensity() function is necessary because the density - * is not an independent variable. - * - * This function will now throw an error condition. - * - * @param rho Input Density - * @deprecated Functionality merged with base function after Cantera 2.5. - * (superseded by isCompressible check in Phase::setDensity) - */ - virtual void setMolarDensity(const doublereal rho); - //! The isothermal compressibility. Units: 1/Pa. /*! * The isothermal compressibility is defined as diff --git a/include/cantera/thermo/IdealSolidSolnPhase.h b/include/cantera/thermo/IdealSolidSolnPhase.h index ef42b5aa4..70dccfa29 100644 --- a/include/cantera/thermo/IdealSolidSolnPhase.h +++ b/include/cantera/thermo/IdealSolidSolnPhase.h @@ -213,34 +213,6 @@ public: */ void calcDensity(); - /** - * Overridden setDensity() function is necessary because the density is not - * an independent variable. - * - * This function will now throw an error condition - * - * @internal May have to adjust the strategy here to make the eos for these - * materials slightly compressible, in order to create a condition where - * the density is a function of the pressure. - * - * @param rho Input density - * @deprecated Functionality merged with base function after Cantera 2.5. - * (superseded by isCompressible check in Phase::setDensity) - */ - virtual void setDensity(const doublereal rho); - - /** - * Overridden setMolarDensity() function is necessary because the density - * is not an independent variable. - * - * This function will now throw an error condition. - * - * @param rho Input Density - * @deprecated Functionality merged with base function after Cantera 2.5. - * (superseded by isCompressible check in Phase::setDensity) - */ - virtual void setMolarDensity(const doublereal rho); - //@} /** @@ -574,21 +546,6 @@ public: return m_cp0_R; } - //! @deprecated To be removed after Cantera 2.5 - virtual void setPotentialEnergy(int k, doublereal pe) { - warn_deprecated("IdealSolidSolnPhase::setPotentialEnergy", - "To be removed after Cantera 2.5"); - m_pe[k] = pe; - _updateThermo(); - } - - //! @deprecated To be removed after Cantera 2.5 - virtual doublereal potentialEnergy(int k) const { - warn_deprecated("IdealSolidSolnPhase::potentialEnergy", - "To be removed after Cantera 2.5"); - return m_pe[k]; - } - //@} /// @name Utility Functions //@{ @@ -685,10 +642,6 @@ protected: //! T = m_tlast mutable vector_fp m_expg0_RT; - //! Vector of potential energies for the species. - //! @deprecated To be removed after Cantera 2.5 - mutable vector_fp m_pe; - //! Temporary array used in equilibrium calculations mutable vector_fp m_pp; diff --git a/include/cantera/thermo/IdealSolnGasVPSS.h b/include/cantera/thermo/IdealSolnGasVPSS.h index 67cb3dd0b..96d158cdf 100644 --- a/include/cantera/thermo/IdealSolnGasVPSS.h +++ b/include/cantera/thermo/IdealSolnGasVPSS.h @@ -1,7 +1,7 @@ /** * @file IdealSolnGasVPSS.h - * Definition file for a derived class of ThermoPhase that assumes either - * an ideal gas or ideal solution approximation and handles + * Definition file for a derived class of ThermoPhase that assumes + * an ideal solution approximation and handles * variable pressure standard state methods for calculating * thermodynamic properties (see \ref thermoprops and * class \link Cantera::IdealSolnGasVPSS IdealSolnGasVPSS\endlink). @@ -21,11 +21,8 @@ namespace Cantera /** * @ingroup thermoprops * - * An ideal solution or an ideal gas approximation of a phase. Uses variable + * An ideal solution 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 { @@ -48,36 +45,9 @@ public: return "IdealSolnGas"; } - //! String indicating the mechanical phase of the matter in this Phase. - /*! - * Options for the string are: - * * `gas` - * * `undefined` - * - * If `m_idealGas` is true, returns `gas`. Otherwise, returns `undefined`. - */ - virtual std::string phaseOfMatter() const { - if (m_idealGas) { - return "gas"; - } else { - return "undefined"; - } - } - - //! Set this phase to represent an ideal gas - 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; } - //! Set the standard concentration model /* - * Does not apply to the ideal gas case. Must be one of 'unity', - * 'molar_volume', or 'solvent_volume'. + * Must be one of 'unity', 'molar_volume', or 'solvent_volume'. */ void setStandardConcentrationModel(const std::string& model); @@ -96,8 +66,6 @@ public: void setPressure(doublereal p); - virtual doublereal isothermalCompressibility() const; - protected: /** * Calculate the density of the mixture using the partial molar volumes and @@ -127,9 +95,7 @@ public: /*! * This is defined as the concentration by which the generalized * concentration is normalized to produce the activity. In many cases, this - * quantity will be the same for all species in a phase. Since the activity - * for an ideal gas mixture is simply the mole fraction, for an ideal gas - * \f$ C^0_k = P/\hat R T \f$. + * quantity will be the same for all species in a phase. * * @param k Optional parameter indicating the species. The default * is to assume this refers to species 0. @@ -170,7 +136,6 @@ public: //@{ virtual bool addSpecies(shared_ptr spec); - virtual void setParametersFromXML(const XML_Node& thermoNode); virtual void initThermo(); virtual void setToEquilState(const doublereal* lambda_RT); virtual void initThermoXML(XML_Node& phaseNode, const std::string& id); @@ -178,13 +143,6 @@ public: //@} protected: - //! boolean indicating what ideal solution this is - /*! - * - 1 = ideal gas - * - 0 = ideal soln - */ - int m_idealGas; - //! form of the generalized concentrations /*! * - 0 unity (default) diff --git a/include/cantera/thermo/MaskellSolidSolnPhase.h b/include/cantera/thermo/MaskellSolidSolnPhase.h index 97a49f0b7..18eda59eb 100644 --- a/include/cantera/thermo/MaskellSolidSolnPhase.h +++ b/include/cantera/thermo/MaskellSolidSolnPhase.h @@ -73,32 +73,8 @@ public: */ virtual void setPressure(doublereal p); - /** - * Overridden setDensity() function is necessary because the density is not - * an independent variable. - * - * This function will now throw an error condition - * - * @param rho Input density - * @deprecated Functionality merged with base function after Cantera 2.5. - * (superseded by isCompressible check in Phase::setDensity) - */ - virtual void setDensity(const doublereal rho); - virtual void calcDensity(); - /** - * Overridden setMolarDensity() function is necessary because the density - * is not an independent variable. - * - * This function will now throw an error condition. - * - * @param rho Input Density - * @deprecated Functionality merged with base function after Cantera 2.5. - * (superseded by isCompressible check in Phase::setDensity) - */ - virtual void setMolarDensity(const doublereal rho); - //@} /** diff --git a/include/cantera/thermo/PDSS_SSVol.h b/include/cantera/thermo/PDSS_SSVol.h index c02ab38d6..d38bb56ad 100644 --- a/include/cantera/thermo/PDSS_SSVol.h +++ b/include/cantera/thermo/PDSS_SSVol.h @@ -152,8 +152,6 @@ public: virtual void setPressure(doublereal pres); virtual void setTemperature(doublereal temp); virtual void setState_TP(doublereal temp, doublereal pres); - //! @deprecated To be removed after Cantera 2.5. - virtual void setState_TR(doublereal temp, doublereal rho); //! @} //! @name Miscellaneous properties of the standard state diff --git a/include/cantera/thermo/Phase.h b/include/cantera/thermo/Phase.h index b125cbe88..cc9cd2a45 100644 --- a/include/cantera/thermo/Phase.h +++ b/include/cantera/thermo/Phase.h @@ -146,20 +146,6 @@ public: */ //!@{ - //! Return the string id for the phase. - /*! - * @deprecated To be removed after Cantera 2.5. - */ - std::string id() const; - - //! Set the string id for the phase. - /*! - * @param id String id of the phase - * - * @deprecated To be removed after Cantera 2.5. - */ - void setID(const std::string& id); - //! Return the name of the phase. /*! * Names are unique within a Cantera problem. diff --git a/include/cantera/thermo/Species.h b/include/cantera/thermo/Species.h index b8780765e..a113ba513 100644 --- a/include/cantera/thermo/Species.h +++ b/include/cantera/thermo/Species.h @@ -54,10 +54,6 @@ public: //! Thermodynamic data for the species shared_ptr thermo; - //! Extra data used for specific models - //! @deprecated Superseded by #input. To be removed after Cantera 2.5. - AnyMap extra; - //! Input parameters used to define a species, e.g. from a YAML input file. AnyMap input; }; diff --git a/include/cantera/transport/TransportFactory.h b/include/cantera/transport/TransportFactory.h index 412892c64..da52cf471 100644 --- a/include/cantera/transport/TransportFactory.h +++ b/include/cantera/transport/TransportFactory.h @@ -60,12 +60,8 @@ public: * @param model String name for the transport manager * @param thermo ThermoPhase object * @param log_level log level - * @param ndim Number of dimensions for fluxes - * - * @deprecated The `ndim` parameter is unused and will be removed after - * Cantera 2.5. */ - virtual Transport* newTransport(const std::string& model, thermo_t* thermo, int log_level=0, int ndim=-99); + virtual Transport* newTransport(const std::string& model, thermo_t* thermo, int log_level=0); //! Build a new transport manager using the default transport manager //! in the phase description and return a base class pointer to it @@ -98,7 +94,7 @@ private: //! @copydoc TransportFactory::newTransport(const std::string&, thermo_t*, int, int) Transport* newTransportMgr(const std::string& transportModel = "", - thermo_t* thermo = 0, int loglevel = 0, int ndim=-99); + thermo_t* thermo = 0, int loglevel = 0); //! Create a new transport manager instance. /*! diff --git a/include/cantera/transport/TransportParams.h b/include/cantera/transport/TransportParams.h deleted file mode 100644 index fd4ddcdae..000000000 --- a/include/cantera/transport/TransportParams.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - * @file TransportParams.h - * Class that holds the data that is read in from the input file, and which is used for - * processing of the transport object - * (see \ref tranprops and \link Cantera::TransportParams TransportParams \endlink). - */ - -// This file is part of Cantera. See License.txt in the top-level directory or -// at https://cantera.org/license.txt for license and copyright information. - -#ifndef CT_TRANSPORTPARAMS_H -#define CT_TRANSPORTPARAMS_H - -#include "cantera/numerics/DenseMatrix.h" -#include "TransportBase.h" - -namespace Cantera -{ - -//! Base structure to hold transport model parameters. -/*! - * This structure is used by TransportFactory. - * - * @deprecated Unused. To be removed after Cantera 2.5. - */ -class TransportParams -{ -public: - TransportParams(); - virtual ~TransportParams() {} - - //! Local storage of the number of species - size_t nsp_; - - //! Pointer to the ThermoPhase object: shallow pointer - thermo_t* thermo; - - //! Local storage of the molecular weights of the species - /*! - * Length is nsp_ and units are kg kmol-1. - */ - vector_fp mw; - - //! A basis for the average velocity can be specified. - /*! - * Valid bases include "mole", "mass", and "species" names. - */ - VelocityBasis velocityBasis_; - - //! Maximum temperatures for parameter fits - doublereal tmax; - - //! Minimum temperatures for parameter fits - doublereal tmin; - - //! Mode parameter - int mode_; - - //! Log level - int log_level; -}; - -} // End of namespace Cantera - -#endif //CT_TRANSPORTPARAMS_H diff --git a/include/cantera/zeroD/ConstPressureReactor.h b/include/cantera/zeroD/ConstPressureReactor.h index fa261525b..0590dd2f9 100644 --- a/include/cantera/zeroD/ConstPressureReactor.h +++ b/include/cantera/zeroD/ConstPressureReactor.h @@ -28,15 +28,8 @@ public: return "ConstPressureReactor"; } - /*! - * @deprecated To be changed after Cantera 2.5. - */ - virtual int type() const { - warn_deprecated("ConstPressureReactor::type", - "To be changed after Cantera 2.5. " - "Return string instead of magic number; use " - "ConstPressureReactor::typeStr during transition"); - return ConstPressureReactorType; + virtual std::string type() const { + return "ConstPressureReactor"; } virtual void getState(doublereal* y); diff --git a/include/cantera/zeroD/FlowDevice.h b/include/cantera/zeroD/FlowDevice.h index 46902db77..506bef4cf 100644 --- a/include/cantera/zeroD/FlowDevice.h +++ b/include/cantera/zeroD/FlowDevice.h @@ -16,12 +16,6 @@ namespace Cantera class Func1; class ReactorBase; -//! Magic numbers -//! @deprecated To be removed after Cantera 2.5. -const int MFC_Type = 1; -const int PressureController_Type = 2; -const int Valve_Type = 3; - /** * Base class for 'flow devices' (valves, pressure regulators, etc.) * connecting reactors. @@ -42,29 +36,14 @@ public: return "FlowDevice"; } - //! Return an integer indicating the type of flow device - /*! - * @deprecated To be changed after Cantera 2.5. - */ - virtual int type() const { - warn_deprecated("FlowDevice::type", - "To be changed after Cantera 2.5. " - "Return string instead of magic number; use " - "FlowDevice::typeStr during transition."); - return m_type; + //! String indicating the flow device implemented. Usually + //! corresponds to the name of the derived class. + virtual std::string type() const { + return "FlowDevice"; } //! Mass flow rate (kg/s). - //! @deprecated The 'time' argument will be removed after Cantera 2.5. - //! Evaluating the mass flow rate at times other than the current time - //! for the reactor network may lead to subtly incorrect results. - double massFlowRate(double time = -999.0) { - if (time != -999.0) { - warn_deprecated("FlowDevice::massFlowRate", "The 'time' argument" - " is deprecated and will be removed after Cantera 2.5."); - updateMassFlowRate(time); - } - + double massFlowRate() { if (m_mdot == Undef) { throw CanteraError("FlowDevice::massFlowRate", "Flow device is not ready. Try initializing the reactor network."); @@ -105,32 +84,6 @@ public: return *m_out; } - //! Set parameters. Generic function formerly used in the Matlab interface. - //! @deprecated To be removed after Cantera 2.5. - virtual void setParameters(int n, const double* coeffs) { - warn_deprecated("FlowDevice::setParameters", - "To be removed after Cantera 2.5. " - "Use device-specific functions (e.g. " - "Valve::setValveCoeff) instead."); - m_coeff = coeffs[0]; // vectorized coefficients are not used - } - - //! Set a function of a single variable that is used in determining the - //! mass flow rate through the device. The meaning of this function - //! depends on the parameterization of the derived type. - //! @deprecated To be removed after Cantera 2.5. - void setFunction(Func1* f) { - warn_deprecated("FlowDevice::setFunction", - "To be removed after Cantera 2.5. " - "Use FlowDevice::setTimeFunction or " - "FlowDevice::setPressureFunction instead."); - if (typeStr()=="MassFlowController") { - setTimeFunction(f); - } else if (typeStr()=="Valve") { - setPressureFunction(f); - } - } - //! Set a function of pressure that is used in determining the //! mass flow rate through the device. The evaluation of mass flow //! depends on the derived flow device class. @@ -141,17 +94,6 @@ public: //! depends on the derived flow device class. virtual void setTimeFunction(Func1* g); - //! Set the fixed mass flow rate (kg/s) through the flow device. - //! @deprecated To be removed after Cantera 2.5. - void setMassFlowRate(double mdot) { - warn_deprecated("FlowDevice::setMassFlowRate", - "To be removed after Cantera 2.5. " - "Use device-specific functions (e.g. " - "MassFlowController::setMassFlowRate or " - "Valve::setValveCoeff) instead."); - m_mdot = mdot; - } - protected: double m_mdot; @@ -164,8 +106,6 @@ protected: //! Coefficient set by derived classes; used by updateMassFlowRate double m_coeff; - int m_type; //!< @deprecated To be removed after Cantera 2.5. - private: size_t m_nspin, m_nspout; ReactorBase* m_in; diff --git a/include/cantera/zeroD/FlowDeviceFactory.h b/include/cantera/zeroD/FlowDeviceFactory.h index fbe4e1183..57403b56e 100644 --- a/include/cantera/zeroD/FlowDeviceFactory.h +++ b/include/cantera/zeroD/FlowDeviceFactory.h @@ -29,35 +29,12 @@ public: s_factory = 0; } - //! Create a new flow device by type identifier. - /*! - * @param n the type to be created. - */ - virtual FlowDevice* newFlowDevice(int n); - //! Create a new flow device by type name. /*! * @param flowDeviceType the type to be created. */ virtual FlowDevice* newFlowDevice(const std::string& flowDeviceType); - //! Register a new flow device type identifier. - /*! - * @param name the name of the flow device type. - * @param type the type identifier of the flow device. - * Integer type identifiers are used by clib and matlab interfaces. - * - * @deprecated To be removed after Cantera 2.5. - */ - void reg_type(const std::string& name, const int type) { - m_types[type] = name; - } - -protected: - //! Map containing flow device type identifier / type name pairs. - //! @deprecated To be removed after Cantera 2.5. - std::unordered_map m_types; - private: static FlowDeviceFactory* s_factory; static std::mutex flowDevice_mutex; diff --git a/include/cantera/zeroD/FlowReactor.h b/include/cantera/zeroD/FlowReactor.h index 9708794fb..fefe94f55 100644 --- a/include/cantera/zeroD/FlowReactor.h +++ b/include/cantera/zeroD/FlowReactor.h @@ -21,15 +21,8 @@ public: return "FlowReactor"; } - /*! - * @deprecated To be changed after Cantera 2.5. - */ - virtual int type() const { - warn_deprecated("FlowReactor::type", - "To be changed after Cantera 2.5. " - "Return string instead of magic number; use " - "FlowReactor::typeStr during transition"); - return FlowReactorType; + virtual std::string type() const { + return "FlowReactor"; } virtual void getState(doublereal* y); diff --git a/include/cantera/zeroD/IdealGasConstPressureReactor.h b/include/cantera/zeroD/IdealGasConstPressureReactor.h index 4e6c29de8..9cda754f0 100644 --- a/include/cantera/zeroD/IdealGasConstPressureReactor.h +++ b/include/cantera/zeroD/IdealGasConstPressureReactor.h @@ -27,16 +27,8 @@ public: return "IdealGasConstPressureReactor"; } - /*! - * @deprecated To be changed after Cantera 2.5. - */ - virtual int type() const { - warn_deprecated("IdealGasConstPressureReactor::type", - "To be changed after Cantera 2.5. " - "Return string instead of magic number; use " - "IdealGasConstPressureReactor::typeStr during " - "transition"); - return IdealGasConstPressureReactorType; + virtual std::string type() const { + return "IdealGasConstPressureReactor"; } virtual void setThermoMgr(ThermoPhase& thermo); diff --git a/include/cantera/zeroD/IdealGasReactor.h b/include/cantera/zeroD/IdealGasReactor.h index 2a8577dae..ce8661352 100644 --- a/include/cantera/zeroD/IdealGasReactor.h +++ b/include/cantera/zeroD/IdealGasReactor.h @@ -25,15 +25,8 @@ public: return "IdealGasReactor"; } - /*! - * @deprecated To be changed after Cantera 2.5. - */ - virtual int type() const { - warn_deprecated("IdealGasReactor::type", - "To be changed after Cantera 2.5. " - "Return string instead of magic number; use " - "IdealGasReactor::typeStr during transition"); - return IdealGasReactorType; + virtual std::string type() const { + return "IdealGasReactor"; } virtual void setThermoMgr(ThermoPhase& thermo); diff --git a/include/cantera/zeroD/Reactor.h b/include/cantera/zeroD/Reactor.h index 41528862b..cf8ecd14a 100644 --- a/include/cantera/zeroD/Reactor.h +++ b/include/cantera/zeroD/Reactor.h @@ -43,15 +43,8 @@ public: return "Reactor"; } - /*! - * @deprecated To be changed after Cantera 2.5. - */ - virtual int type() const { - warn_deprecated("Reactor::type", - "To be changed after Cantera 2.5. " - "Return string instead of magic number; use " - "Reactor::typeStr during transition"); - return ReactorType; + virtual std::string type() const { + return "Reactor"; } /** diff --git a/include/cantera/zeroD/ReactorBase.h b/include/cantera/zeroD/ReactorBase.h index 9ac35a539..11c0af75a 100644 --- a/include/cantera/zeroD/ReactorBase.h +++ b/include/cantera/zeroD/ReactorBase.h @@ -17,15 +17,6 @@ class ReactorNet; class ReactorSurface; class Kinetics; -//! Magic numbers -//! @deprecated To be removed after Cantera 2.5. -const int ReservoirType = 1; -const int ReactorType = 2; -const int FlowReactorType = 3; -const int ConstPressureReactorType = 4; -const int IdealGasReactorType = 5; -const int IdealGasConstPressureReactorType = 6; - enum class SensParameterType { reaction, enthalpy @@ -58,14 +49,10 @@ public: return "ReactorBase"; } - //! Return a constant indicating the type of this Reactor - //! @deprecated To be changed after Cantera 2.5. - virtual int type() const { - warn_deprecated("ReactorBase::type", - "To be changed after Cantera 2.5. " - "Return string instead of magic number; use " - "ReactorBase::typeStr during transition"); - return 0; + //! String indicating the reactor model implemented. Usually + //! corresponds to the name of the derived class. + virtual std::string type() const { + return "ReactorBase"; } //! Return the name of this reactor diff --git a/include/cantera/zeroD/ReactorFactory.h b/include/cantera/zeroD/ReactorFactory.h index 02161f513..95d244e0f 100644 --- a/include/cantera/zeroD/ReactorFactory.h +++ b/include/cantera/zeroD/ReactorFactory.h @@ -29,35 +29,12 @@ public: s_factory = 0; } - //! Create a new reactor by type identifier. - /*! - * @param n the type to be created. - */ - virtual ReactorBase* newReactor(int n); - //! Create a new reactor by type name. /*! * @param reactorType the type to be created. */ virtual ReactorBase* newReactor(const std::string& reactorType); - //! Register a new reactor type identifier. - /*! - * @param name the name of the reactor type. - * @param type the type identifier of the reactor. - * Integer type identifiers are used by clib and matlab interfaces. - * - * @deprecated To be removed after Cantera 2.5. - */ - void reg_type(const std::string& name, const int type) { - m_types[type] = name; - } - -protected: - //! Map containing reactor type identifier / reactor type name pairs. - //! @deprecated To be removed after Cantera 2.5. - std::unordered_map m_types; - private: static ReactorFactory* s_factory; static std::mutex reactor_mutex; diff --git a/include/cantera/zeroD/Reservoir.h b/include/cantera/zeroD/Reservoir.h index e8febce4a..cd0e4eaa0 100644 --- a/include/cantera/zeroD/Reservoir.h +++ b/include/cantera/zeroD/Reservoir.h @@ -20,15 +20,8 @@ public: return "Reservoir"; } - /*! - * @deprecated To be changed after Cantera 2.5. - */ - virtual int type() const { - warn_deprecated("Reservoir::type", - "To be changed after Cantera 2.5. " - "Return string instead of magic number; use " - "Reservoir::typeStr during transition"); - return ReservoirType; + virtual std::string type() const { + return "Reservoir"; } virtual void initialize(doublereal t0 = 0.0) {} diff --git a/include/cantera/zeroD/Wall.h b/include/cantera/zeroD/Wall.h index ff7fe0a46..3f7f1fe05 100644 --- a/include/cantera/zeroD/Wall.h +++ b/include/cantera/zeroD/Wall.h @@ -17,10 +17,6 @@ class Kinetics; class SurfPhase; class Func1; -//! Magic numbers -//! @deprecated To be removed after Cantera 2.5. -const int WallType = 1; - /** * Base class for 'walls' (walls, pistons, etc.) connecting reactors. * @ingroup reactor0 @@ -66,18 +62,6 @@ public: //! Set the area [m^2]. virtual void setArea(double a); - //! Get the area [m^2] - /*! - * Redundant function (same as WallBase::area()). - * @deprecated To be removed after Cantera 2.5. - */ - double getArea() const { - warn_deprecated("WallBase::getArea", - "To be removed after Cantera 2.5. " - "Replace with WallBase::area."); - return m_area; - } - //! Install the wall between two reactors or reservoirs bool install(ReactorBase& leftReactor, ReactorBase& rightReactor); diff --git a/include/cantera/zeroD/WallFactory.h b/include/cantera/zeroD/WallFactory.h index 55135f09b..e09c4d847 100644 --- a/include/cantera/zeroD/WallFactory.h +++ b/include/cantera/zeroD/WallFactory.h @@ -29,35 +29,12 @@ public: s_factory = 0; } - //! Create a new wall by type identifier. - /*! - * @param n the type to be created. - */ - virtual WallBase* newWall(int n); - //! Create a new wall by type name. /*! * @param wallType the type to be created. */ virtual WallBase* newWall(const std::string& wallType); - //! Register a new wall type identifier. - /*! - * @param name the name of the wall type. - * @param type the type identifier of the wall. - * Integer type identifiers are used by clib and matlab interfaces. - * - * @deprecated To be removed after Cantera 2.5. - */ - void reg_type(const std::string& name, const int type) { - m_types[type] = name; - } - -protected: - //! Map containing wall type identifier / wall type name pairs. - //! @deprecated To be removed after Cantera 2.5. - std::unordered_map m_types; - private: static WallFactory* s_factory; static std::mutex wall_mutex; diff --git a/include/cantera/zeroD/flowControllers.h b/include/cantera/zeroD/flowControllers.h index 4d81498bc..de10333d4 100644 --- a/include/cantera/zeroD/flowControllers.h +++ b/include/cantera/zeroD/flowControllers.h @@ -25,6 +25,10 @@ public: return "MassFlowController"; } + virtual std::string type() const { + return "MassFlowController"; + } + //! Set the fixed mass flow rate (kg/s) through the mass flow controller. void setMassFlowRate(double mdot); @@ -69,6 +73,10 @@ public: return "PressureController"; } + virtual std::string type() const { + return "PressureController"; + } + virtual bool ready() { return FlowDevice::ready() && m_master != 0; } @@ -122,18 +130,8 @@ public: return "Valve"; } - //! Set the proportionality constant between pressure drop and mass flow - //! rate - /*! - * *c* has units of kg/s/Pa. The mass flow rate is computed as: - * \f[\dot{m} = c \Delta P \f] - */ - //! @deprecated To be removed after Cantera 2.5. - void setPressureCoeff(double c) { - warn_deprecated("Valve::setPressureCoeff", - "To be removed after Cantera 2.5. " - "Use Valve::setValveCoeff instead."); - m_coeff = c; + virtual std::string type() const { + return "Valve"; } //! Set the proportionality constant between pressure drop and mass flow diff --git a/interfaces/cython/cantera/_cantera.pxd b/interfaces/cython/cantera/_cantera.pxd index 26ff56dcd..2a0f99b93 100644 --- a/interfaces/cython/cantera/_cantera.pxd +++ b/interfaces/cython/cantera/_cantera.pxd @@ -545,7 +545,7 @@ cdef extern from "cantera/zerodim.h" namespace "Cantera": cdef cppclass CxxReactorBase "Cantera::ReactorBase": CxxReactorBase() - string typeStr() + string type() void setThermoMgr(CxxThermoPhase&) except +translate_exception void restoreState() except +translate_exception void syncState() except +translate_exception @@ -623,7 +623,7 @@ cdef extern from "cantera/zerodim.h" namespace "Cantera": cdef cppclass CxxFlowDevice "Cantera::FlowDevice": CxxFlowDevice() - string typeStr() + string type() double massFlowRate() except +translate_exception double massFlowRate(double) except +translate_exception cbool install(CxxReactorBase&, CxxReactorBase&) except +translate_exception diff --git a/interfaces/cython/cantera/composite.py b/interfaces/cython/cantera/composite.py index e22a532bc..e9361e126 100644 --- a/interfaces/cython/cantera/composite.py +++ b/interfaces/cython/cantera/composite.py @@ -480,7 +480,7 @@ class SolutionArray: _passthrough = [ # from ThermoPhase - 'name', 'ID', 'source', 'basis', 'n_elements', 'element_index', + 'name', 'source', 'basis', 'n_elements', 'element_index', 'element_name', 'element_names', 'atomic_weight', 'atomic_weights', 'n_species', 'species_name', 'species_names', 'species_index', 'species', 'n_atoms', 'molecular_weights', 'min_temp', 'max_temp', @@ -1382,10 +1382,6 @@ def _make_functions(): setters = 'TDPUVHS' + ext scalar = ext == 'Q' - # add deprecated setters for PureFluid (e.g. PX/TX) - # @todo: remove .. deprecated:: 2.5 - setters = setters.replace('Q', 'QX') - # obtain setters/getters from thermo objects all_states = [k for k in ph.__dict__ if not set(k) - set(setters) and len(k)>1] diff --git a/interfaces/cython/cantera/cti2yaml.py b/interfaces/cython/cantera/cti2yaml.py index f71df8db2..d46776e28 100644 --- a/interfaces/cython/cantera/cti2yaml.py +++ b/interfaces/cython/cantera/cti2yaml.py @@ -1240,23 +1240,6 @@ class metal(phase): out['density'] = applyUnits(self.density) -class incompressible_solid(phase): - """An incompressible solid.""" - def __init__(self, name='', elements='', species='', note='', density=None, - transport='None', initial_state=None, options=()): - - phase.__init__(self, name, elements, species, note, 'none', - initial_state, options) - self.thermo_model = 'constant-density' - self.density = density - if self.density is None: - raise InputError('density must be specified.') - - def get_yaml(self, out): - super().get_yaml(out) - out['density'] = applyUnits(self.density) - - class liquid_vapor(phase): """ A fluid with a complete liquid/vapor equation of state. This entry type diff --git a/interfaces/cython/cantera/ctml2yaml.py b/interfaces/cython/cantera/ctml2yaml.py index bf9725589..89991fb86 100644 --- a/interfaces/cython/cantera/ctml2yaml.py +++ b/interfaces/cython/cantera/ctml2yaml.py @@ -333,11 +333,9 @@ class Phase: "IdealSolidSolution": "ideal-condensed", "DebyeHuckel": "Debye-Huckel", "IdealMolalSolution": "ideal-molal-solution", - "IdealGasVPSS": "ideal-gas-VPSS", "IdealSolnVPSS": "ideal-solution-VPSS", "Margules": "Margules", "IonsFromNeutralMolecule": "ions-from-neutral-molecule", - "FixedChemPot": "fixed-chemical-potential", "Redlich-Kister": "Redlich-Kister", "RedlichKwongMFTP": "Redlich-Kwong", "MaskellSolidSolnPhase": "Maskell-solid-solution", @@ -566,8 +564,6 @@ class Phase: self.attribs["tabulated-species"] = node.get("name") elif node.tag == "tabulatedThermo": self.attribs["tabulated-thermo"] = self.get_tabulated_thermo(node) - elif node.tag == "chemicalPotential": - self.attribs["chemical-potential"] = get_float_or_quantity(node) transport_node = phase.find("transport") if transport_node is not None: diff --git a/interfaces/cython/cantera/ctml_writer.py b/interfaces/cython/cantera/ctml_writer.py index 4d0de8c8f..5c65bd1c8 100644 --- a/interfaces/cython/cantera/ctml_writer.py +++ b/interfaces/cython/cantera/ctml_writer.py @@ -2112,49 +2112,6 @@ class metal(phase): k['model'] = 'none' -class incompressible_solid(phase): - """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 = '', - species = '', - note = '', - density = None, - transport = 'None', - initial_state = None, - options = []): - - phase.__init__(self, name, 3, elements, species, note, 'none', - initial_state, options) - self._dens = density - self._pure = 0 - if self._dens is None: - raise CTI_Error('density must be specified.') - self._tr = transport - - def conc_dim(self): - return (1,-3) - - def build(self, p): - ph = phase.build(self, p) - e = ph.child("thermo") - e['model'] = 'Incompressible' - addFloat(e, 'density', self._dens, defunits = _umass+'/'+_ulen+'3') - if self._tr: - t = ph.addChild('transport') - t['model'] = self._tr - k = ph.addChild("kinetics") - k['model'] = 'none' - class IdealSolidSolution(phase): """An IdealSolidSolution phase.""" def __init__(self, diff --git a/interfaces/cython/cantera/onedim.py b/interfaces/cython/cantera/onedim.py index 40d8700f9..294c8b9a3 100644 --- a/interfaces/cython/cantera/onedim.py +++ b/interfaces/cython/cantera/onedim.py @@ -254,18 +254,6 @@ class FlameBase(Sim1D): def radiation_enabled(self, enable): self.flame.radiation_enabled = enable - def set_boundary_emissivities(self, e_left, e_right): - """ - .. deprecated:: 2.5 - - To be deprecated with version 2.5, and removed thereafter. - Replaced by property `boundary_emissivities`. - """ - warnings.warn("Method 'set_boundary_emissivities' to be removed after " - "Cantera 2.5. Replaced by property " - "'boundary_emissivities'", DeprecationWarning) - self.flame.boundary_emissivities = e_left, e_right - @property def boundary_emissivities(self): """ Set/get boundary emissivities. """ @@ -296,21 +284,6 @@ class FlameBase(Sim1D): """ Array containing the temperature [K] at each grid point. """ return self.profile(self.flame, 'T') - @property - def u(self): - """ - Array containing the velocity [m/s] normal to the flame at each point. - - .. deprecated:: 2.5 - - To be deprecated with version 2.5, and removed thereafter. - Replaced by property `velocity`. - """ - warnings.warn("Property 'u' to be removed after Cantera 2.5. " - "Replaced by property 'velocity'", - DeprecationWarning) - return self.profile(self.flame, 'velocity') - @property def velocity(self): """ @@ -318,21 +291,6 @@ class FlameBase(Sim1D): """ return self.profile(self.flame, 'velocity') - @property - def V(self): - """ - Array containing the tangential velocity gradient [1/s] at each point. - - .. deprecated:: 2.5 - - To be deprecated with version 2.5, and removed thereafter. - Replaced by property `spread_rate`. - """ - warnings.warn("Property 'V' to be removed after Cantera 2.5. " - "Replaced by property 'spread_rate'", - DeprecationWarning) - return self.profile(self.flame, 'spread_rate') - @property def spread_rate(self): """ diff --git a/interfaces/cython/cantera/onedim.pyx b/interfaces/cython/cantera/onedim.pyx index 456028a73..f09bf3248 100644 --- a/interfaces/cython/cantera/onedim.pyx +++ b/interfaces/cython/cantera/onedim.pyx @@ -563,18 +563,6 @@ cdef class _FlowBase(Domain1D): else: self.set_transient_tolerances(**tol) - def set_boundary_emissivities(self, e_left, e_right): - """ - .. deprecated:: 2.5 - - To be deprecated with version 2.5, and removed thereafter. - Replaced by property `boundary_emissivities`. - """ - warnings.warn("Method 'set_boundary_emissivities' to be removed after " - "Cantera 2.5. Replaced by property " - "'boundary_emissivities'", DeprecationWarning) - self.boundary_emissivities = e_left, e_right - property boundary_emissivities: """ Set/get boundary emissivities. """ def __get__(self): @@ -1389,21 +1377,6 @@ cdef class Sim1D: """ Set the maximum time step. """ self.sim.setMaxTimeStep(tsmax) - def set_fixed_temperature(self, T): - """ - Set the temperature used to fix the spatial location of a freely - propagating flame. - - .. deprecated:: 2.5 - - To be deprecated with version 2.5, and removed thereafter. - Replaced by property `fixed_temperature`. - """ - warnings.warn("Method 'set_fixed_temperature' to be removed after " - "Cantera 2.5. Replaced by property 'fixed_temperature'", - DeprecationWarning) - self.fixed_temperature = T - property fixed_temperature: """ Set the temperature used to fix the spatial location of a freely diff --git a/interfaces/cython/cantera/reactor.pyx b/interfaces/cython/cantera/reactor.pyx index 2bde1067d..16ddcb50f 100644 --- a/interfaces/cython/cantera/reactor.pyx +++ b/interfaces/cython/cantera/reactor.pyx @@ -53,7 +53,7 @@ cdef class ReactorBase: property type: """The type of the reactor.""" def __get__(self): - return pystr(self.rbase.typeStr()) + return pystr(self.rbase.type()) property name: """The name of the reactor.""" @@ -693,7 +693,7 @@ cdef class FlowDevice: property type: """The type of the flow device.""" def __get__(self): - return pystr(self.dev.typeStr()) + return pystr(self.dev.type()) def _install(self, ReactorBase upstream, ReactorBase downstream): """ @@ -715,20 +715,6 @@ cdef class FlowDevice: """ return self.dev.massFlowRate() - def mdot(self, double t=-999): - """ - The mass flow rate [kg/s] through this device at time *t* [s]. - - .. deprecated:: 2.5 - - To be removed after Cantera 2.5. Replaced with the - `mass_flow_rate` property. - """ - warnings.warn("To be removed after Cantera 2.5. " - "Replaced by property 'mass_flow_rate'", DeprecationWarning) - - return self.dev.massFlowRate(t) - def set_pressure_function(self, k): r""" Set the relationship between mass flow rate and the pressure drop across a @@ -834,27 +820,6 @@ cdef class MassFlowController(FlowDevice): self.mass_flow_coeff = 1. self.set_time_function(m) - def set_mass_flow_rate(self, m): - r""" - Set the mass flow rate [kg/s] through this controller to be either - a constant or an arbitrary function of time. See `Func1`. - - Note that depending on the argument type, this method either changes - the property `mass_flow_coeff` or calls the `set_time_function` method. - - >>> mfc.set_mass_flow_rate(0.3) - >>> mfc.set_mass_flow_rate(lambda t: 2.5 * exp(-10 * (t - 0.5)**2)) - - .. deprecated:: 2.5 - - To be deprecated with version 2.5, and removed thereafter. - Replaced by property `mass_flow_rate`. - """ - warnings.warn("To be removed after Cantera 2.5. " - "Replaced by property 'mass_flow_rate'", DeprecationWarning) - - self.mass_flow_rate = m - cdef class Valve(FlowDevice): r""" @@ -911,51 +876,6 @@ cdef class Valve(FlowDevice): def __set__(self, double value): (self.dev).setValveCoeff(value) - def set_valve_function(self, k): - r""" - Set the relationship between mass flow rate and the pressure drop across the - valve. The mass flow rate [kg/s] is calculated given the pressure drop [Pa]. - - >>> V = Valve(res1, reactor1) - >>> V.set_valve_function(lambda dP: (1e-5 * dP)**2) - - .. deprecated:: 2.5 - - To be deprecated with version 2.5, and removed thereafter. - Renamed to `set_pressure_function`. - """ - warnings.warn("To be removed after Cantera 2.5. " - "Renamed to 'set_pressure_function' instead", DeprecationWarning) - - self.set_pressure_function(k) - - def set_valve_coeff(self, k): - """ - Set the relationship between mass flow rate and the pressure drop across - the valve. If a number is given, it is the proportionality constant - [kg/s/Pa]. If a function is given, it should compute the mass flow - rate [kg/s] given the pressure drop [Pa]. - - >>> V = Valve(res1, reactor1) - >>> V.set_valve_coeff(1e-4) # Set the value of K to a constant - >>> V.set_valve_coeff(lambda dP: (1e-5 * dP)**2) # Set to a function - - .. deprecated:: 2.5 - - To be deprecated with version 2.5, and removed thereafter. - Functionality is now handled by property `valve_coeff` and - `set_pressure_function`. - """ - warnings.warn("To be removed after Cantera 2.5. " - "Use property 'valve_coeff' and/or function " - "'set_pressure_function' instead.", DeprecationWarning) - - if isinstance(k, _numbers.Real): - self.valve_coeff = k - else: - self.valve_coeff = 1. - self.set_pressure_function(k) - cdef class PressureController(FlowDevice): r""" @@ -999,20 +919,6 @@ cdef class PressureController(FlowDevice): def __set__(self, double value): (self.dev).setPressureCoeff(value) - def set_pressure_coeff(self, double k): - """ - Set the proportionality constant :math:`K_v` [kg/s/Pa] between the pressure - drop and the mass flow rate. - - .. deprecated:: 2.5 - - To be deprecated with version 2.5, and removed thereafter. - Replaced by property `pressure_coeff`. - """ - warnings.warn("To be removed after Cantera 2.5. " - "Use property 'pressure_coeff' instead", DeprecationWarning) - (self.dev).setPressureCoeff(k) - def set_master(self, FlowDevice d): """ Set the "master" `FlowDevice` used to compute this device's mass flow @@ -1102,20 +1008,6 @@ cdef class ReactorNet: def __set__(self, double t): self.net.setMaxTimeStep(t) - def set_max_time_step(self, double t): - """ - Set the maximum time step *t* [s] that the integrator is allowed - to use. - - .. deprecated:: 2.5 - - To be deprecated with version 2.5, and removed thereafter. - Replaced by property `max_time_step`. - """ - warnings.warn("To be removed after Cantera 2.5. " - "Use property 'max_time_step' instead", DeprecationWarning) - self.net.setMaxTimeStep(t) - property max_err_test_fails: """ The maximum number of error test failures permitted by the CVODES diff --git a/interfaces/cython/cantera/test/test_convert.py b/interfaces/cython/cantera/test/test_convert.py index 33f0dd64e..326d78e3f 100644 --- a/interfaces/cython/cantera/test/test_convert.py +++ b/interfaces/cython/cantera/test/test_convert.py @@ -1123,17 +1123,6 @@ class ctml2yamlTest(utilities.CanteraTest): self.checkThermo(ctmlGas, yamlGas, [300, 500, 1300, 2000]) self.checkKinetics(ctmlGas, yamlGas, [900, 1800], [2e5, 20e5]) - # @todo Remove after Cantera 2.5 - class FixedChemPotSSTP is deprecated - def test_fixed_chemical_potential_thermo(self): - ct.suppress_deprecation_warnings() - ctml2yaml.convert( - Path(self.test_data_dir).joinpath("LiFixed.xml"), - Path(self.test_work_dir).joinpath("LiFixed.yaml"), - ) - ctmlGas, yamlGas = self.checkConversion("LiFixed") - self.checkThermo(ctmlGas, yamlGas, [300, 500, 1300, 2000]) - ct.make_deprecation_warnings_fatal() - def test_water_IAPWS95_thermo(self): ctml2yaml.convert( Path(self.test_data_dir).joinpath("liquid-water.xml"), @@ -1259,22 +1248,17 @@ 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) - # Due to changes in how the species elements are specified, the - # composition of the species differs from XML to YAML (electrons are used - # to specify charge in YAML while the charge node is used in XML). - # Therefore, checkConversion won't work and we have to check a few things - # manually. There are also no reactions specified for these phases so don't - # need to do any checks for that. - 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() + ctmlPhase = ct.ThermoPhase("pdss_hkft.xml") + yamlPhase = ct.ThermoPhase("pdss_hkft.yaml") + # Due to changes in how the species elements are specified, the + # composition of the species differs from XML to YAML (electrons are used + # to specify charge in YAML while the charge node is used in XML). + # Therefore, checkConversion won't work and we have to check a few things + # manually. There are also no reactions specified for these phases so don't + # need to do any checks for that. + self.assertEqual(ctmlPhase.element_names, yamlPhase.element_names) + self.assertEqual(ctmlPhase.species_names, yamlPhase.species_names) + self.checkThermo(ctmlPhase, yamlPhase, [300, 500]) def test_lattice_solid(self): ctml2yaml.convert( diff --git a/interfaces/cython/cantera/test/test_onedim.py b/interfaces/cython/cantera/test/test_onedim.py index bd8192e82..b81474316 100644 --- a/interfaces/cython/cantera/test/test_onedim.py +++ b/interfaces/cython/cantera/test/test_onedim.py @@ -181,22 +181,6 @@ class TestFreeFlame(utilities.CanteraTest): self.assertNear(self.sim.fixed_temperature, tfixed) self.assertNear(self.sim.fixed_temperature_location, zfixed) - def test_deprecated(self): - Tin = 300 - p = ct.one_atm - reactants = 'H2:0.65, O2:0.5, AR:2' - self.create_sim(p, Tin, reactants, width=0.0001) - with self.assertWarnsRegex(DeprecationWarning, "Replaced by property"): - self.sim.flame.set_boundary_emissivities(0.5, 0.5) - with self.assertWarnsRegex(DeprecationWarning, "property 'velocity"): - self.sim.u - with self.assertWarnsRegex(DeprecationWarning, "property 'spread"): - self.sim.V - with self.assertRaisesRegex(ct.CanteraError, "renamed to 'velocity"): - self.sim.flame.component_index('u') - with self.assertRaisesRegex(ct.CanteraError, "renamed to 'spread_rate"): - self.sim.flame.component_index('V') - def test_auto_width(self): Tin = 300 p = ct.one_atm diff --git a/interfaces/cython/cantera/test/test_purefluid.py b/interfaces/cython/cantera/test/test_purefluid.py index 8913204f7..7708943af 100644 --- a/interfaces/cython/cantera/test/test_purefluid.py +++ b/interfaces/cython/cantera/test/test_purefluid.py @@ -82,12 +82,6 @@ class TestPureFluid(utilities.CanteraTest): with self.assertRaises(ValueError): self.water.Q = 0.3 - def test_X_deprecated(self): - with self.assertWarnsRegex(DeprecationWarning, "after Cantera 2.5"): - X = self.water.X - with self.assertWarnsRegex(DeprecationWarning, "after Cantera 2.5"): - self.water.TX = 300, 1 - def test_set_minmax(self): self.water.TP = self.water.min_temp, 101325 self.assertNear(self.water.T, self.water.min_temp) @@ -306,37 +300,6 @@ class TestPureFluid(utilities.CanteraTest): with self.assertRaisesRegex(ct.CanteraError, 'inconsistent'): self.water.TPQ = 700, 1e5, 0 # vapor fraction should be 1 (T > Tc) - def test_deprecated_X(self): - - with self.assertWarnsRegex(DeprecationWarning, "renamed to 'TQ'"): - self.water.TX = 400, 0.8 - with self.assertWarnsRegex(DeprecationWarning, "renamed to 'Q'"): - X = self.water.X - with self.assertWarnsRegex(DeprecationWarning, "renamed to 'Q'"): - self.water.X = X - with self.assertWarnsRegex(DeprecationWarning, "renamed to 'TPQ'"): - T, P, X = self.water.TPX - with self.assertWarnsRegex(DeprecationWarning, "renamed to 'TPQ'"): - self.water.TPX = T, P, X - with self.assertWarnsRegex(DeprecationWarning, "renamed to 'TQ'"): - T, X = self.water.TX - with self.assertWarnsRegex(DeprecationWarning, "renamed to 'TQ'"): - self.water.TX = T, X - with self.assertWarnsRegex(DeprecationWarning, "renamed to 'PQ'"): - P, X = self.water.PX - with self.assertWarnsRegex(DeprecationWarning, "renamed to 'PQ'"): - self.water.PX = P, X - with self.assertWarnsRegex(DeprecationWarning, "renamed to 'TDQ'"): - T, D, X = self.water.TDX - with self.assertWarnsRegex(DeprecationWarning, "renamed to 'UVQ'"): - U, V, X = self.water.UVX - with self.assertWarnsRegex(DeprecationWarning, "renamed to 'HPQ'"): - H, P, X = self.water.HPX - with self.assertWarnsRegex(DeprecationWarning, "renamed to 'SPQ'"): - S, P, X = self.water.SPX - with self.assertWarnsRegex(DeprecationWarning, "renamed to 'SVQ'"): - S, V, X = self.water.SVX - def test_phase_of_matter(self): self.water.TP = 300, 101325 self.assertEqual(self.water.phase_of_matter, "liquid") diff --git a/interfaces/cython/cantera/test/test_reactor.py b/interfaces/cython/cantera/test/test_reactor.py index 7747c1dda..638dbddef 100644 --- a/interfaces/cython/cantera/test/test_reactor.py +++ b/interfaces/cython/cantera/test/test_reactor.py @@ -150,9 +150,6 @@ class TestReactor(utilities.CanteraTest): dt_max = 0.07 t = tStart - with self.assertWarnsRegex(DeprecationWarning, "after Cantera 2.5"): - self.net.set_max_time_step(dt_max) - self.net.max_time_step = dt_max self.assertEqual(self.net.max_time_step, dt_max) self.net.set_initial_time(tStart) @@ -608,19 +605,6 @@ class TestReactor(utilities.CanteraTest): self.net.advance(0.02) self.assertNear(valve.mass_flow_rate, mdot()) - def test_valve_deprecations(self): - # Make sure Python deprecation warnings actually get displayed - - self.make_reactors() - valve = ct.Valve(self.r1, self.r2) - k = 2e-5 - - with self.assertWarnsRegex(DeprecationWarning, "after Cantera 2.5"): - valve.set_valve_coeff(k) - - with self.assertWarnsRegex(DeprecationWarning, "after Cantera 2.5"): - valve.set_valve_function(lambda t: t>.01) - def test_valve_errors(self): self.make_reactors() res = ct.Reservoir() @@ -685,18 +669,6 @@ class TestReactor(utilities.CanteraTest): dP = self.r1.thermo.P - outlet_reservoir.thermo.P self.assertNear(mdot(t) + pfunc(dP), pc.mass_flow_rate) - def test_pressure_controller_deprecations(self): - # Make sure Python deprecation warnings actually get displayed - - self.make_reactors() - res = ct.Reservoir(self.gas1) - mfc = ct.MassFlowController(res, self.r1, mdot=0.6) - - p = ct.PressureController(self.r1, self.r2, master=mfc, K=0.5) - - with self.assertWarnsRegex(DeprecationWarning, "after Cantera 2.5"): - p.set_pressure_coeff(2.) - def test_pressure_controller_errors(self): self.make_reactors() res = ct.Reservoir(self.gas1) diff --git a/interfaces/cython/cantera/test/test_thermo.py b/interfaces/cython/cantera/test/test_thermo.py index deaf5a61c..05d74c185 100644 --- a/interfaces/cython/cantera/test/test_thermo.py +++ b/interfaces/cython/cantera/test/test_thermo.py @@ -423,18 +423,6 @@ class TestThermoPhase(utilities.CanteraTest): self.assertEqual(self.phase.name, 'something') self.assertIn('something', self.phase.report()) - def test_phase(self): - self.assertEqual(self.phase.name, 'ohmech') - with self.assertWarnsRegex(DeprecationWarning, "after Cantera 2.5"): - self.assertEqual(self.phase.ID, 'ohmech') - - with self.assertWarnsRegex(DeprecationWarning, "after Cantera 2.5"): - self.phase.ID = 'something' - self.assertEqual(self.phase.name, 'something') - - with self.assertWarnsRegex(FutureWarning, "Keyword 'name' replaces 'phaseid'"): - gas = ct.Solution('h2o2.cti', phaseid='ohmech') - def test_badLength(self): X = np.zeros(5) with self.assertRaisesRegex(ValueError, 'incorrect length'): diff --git a/interfaces/cython/cantera/thermo.pyx b/interfaces/cython/cantera/thermo.pyx index ad413249b..0daad5d04 100644 --- a/interfaces/cython/cantera/thermo.pyx +++ b/interfaces/cython/cantera/thermo.pyx @@ -361,25 +361,6 @@ cdef class ThermoPhase(_SolutionBase): states = [pystr(s) for s in states] return {frozenset(k): k for k in states} - property ID: - """ - The identifier of the object. The default value corresponds to the - CTI/XML/YAML input file phase entry. - - .. deprecated:: 2.5 - - To be deprecated with version 2.5, and removed thereafter. - Usage merged with `name`. - """ - def __get__(self): - warnings.warn("To be removed after Cantera 2.5. " - "Use 'name' attribute instead", DeprecationWarning) - return pystr(self.base.name()) - def __set__(self, id_): - warnings.warn("To be removed after Cantera 2.5. " - "Use 'name' attribute instead", DeprecationWarning) - self.base.setName(stringify(id_)) - property basis: """ Determines whether intensive thermodynamic properties are treated on a @@ -419,7 +400,7 @@ cdef class ThermoPhase(_SolutionBase): def equilibrate(self, XY, solver='auto', double rtol=1e-9, int max_steps=1000, int max_iter=100, int estimate_equil=0, - int log_level=0, **kwargs): + int log_level=0): """ Set to a state of chemical equilibrium holding property pair *XY* constant. @@ -457,27 +438,6 @@ cdef class ThermoPhase(_SolutionBase): :param log_level: Set to a value greater than 0 to write diagnostic output. """ - if 'maxsteps' in kwargs: - max_steps = kwargs['maxsteps'] - warnings.warn( - "Keyword argument 'maxsteps' is deprecated and will be removed after " - "Cantera 2.5. Use argument 'max_steps' instead.", DeprecationWarning, - ) - - if 'maxiter' in kwargs: - max_iter = kwargs['maxiter'] - warnings.warn( - "Keyword argument 'maxiter' is deprecated and will be removed after " - "Cantera 2.5. Use argument 'max_iter' instead.", DeprecationWarning, - ) - - if 'loglevel' in kwargs: - log_level = kwargs['loglevel'] - warnings.warn( - "Keyword argument 'loglevel' is deprecated and will be removed after " - "Cantera 2.5. Use argument 'log_level' instead.", DeprecationWarning, - ) - self.thermo.equilibrate(stringify(XY.upper()), stringify(solver), rtol, max_steps, max_iter, estimate_equil, log_level) @@ -795,7 +755,7 @@ cdef class ThermoPhase(_SolutionBase): self.thermo.setEquivalenceRatio(phi, &f[0], &o[0], ThermoBasis.mass if basis == 'mass' else ThermoBasis.molar) - def set_mixture_fraction(self, mixture_fraction, fuel, oxidizer, basis='mole', mixFrac=None): + def set_mixture_fraction(self, mixture_fraction, fuel, oxidizer, basis='mole'): """ Set the composition to a mixture of ``fuel`` and ``oxidizer`` at the specified mixture fraction *mixture_fraction* (kg fuel / kg mixture), holding @@ -822,11 +782,6 @@ cdef class ThermoPhase(_SolutionBase): :param basis: determines if ``fuel`` and ``oxidizer`` are given in mole fractions (``basis='mole'``) or mass fractions (``basis='mass'``) """ - if mixFrac is not None: - warnings.warn("The 'mixFrac' argument is deprecated and will be " - "removed after 2.5. The argument can be replaced by " - "'mixture_fraction'.", DeprecationWarning) - mixture_fraction = mixFrac cdef np.ndarray[np.double_t, ndim=1] f = \ np.ascontiguousarray(self.__composition_to_array(fuel, basis), dtype=np.double) cdef np.ndarray[np.double_t, ndim=1] o = \ @@ -834,66 +789,6 @@ cdef class ThermoPhase(_SolutionBase): self.thermo.setMixtureFraction(mixture_fraction, &f[0], &o[0], ThermoBasis.mass if basis == 'mass' else ThermoBasis.molar) - def get_equivalence_ratio(self, oxidizers=[], ignore=[]): - """ - Get the composition of a fuel/oxidizer mixture. This gives the - equivalence ratio of an unburned mixture. This is not a quantity that is - conserved after oxidation. Considers the oxidation of C to CO2, H to H2O - and S to SO2. Other elements are assumed not to participate in oxidation - (that is, N ends up as N2). - - :param oxidizers: - List of oxidizer species names as strings. Default: with - ``oxidizers=[]``, every species that contains O but does not contain - H, C, or S is considered to be an oxidizer. - :param ignore: - List of species names as strings to ignore. - - >>> gas.set_equivalence_ratio(0.5, 'CH3:0.5, CH3OH:.5, N2:0.125', 'O2:0.21, N2:0.79, NO:0.01') - >>> gas.get_equivalence_ratio() - 0.5 - >>> gas.get_equivalence_ratio(['O2']) # Only consider O2 as the oxidizer instead of O2 and NO - 0.488095238095 - >>> gas.X = 'CH4:1, O2:2, NO:0.1' - >>> gas.get_equivalence_ratio(ignore=['NO']) - 1.0 - - .. deprecated:: 2.5 - - To be deprecated with version 2.5, and removed thereafter. - Replaced by function `equivalence_ratio`. - """ - warnings.warn("To be removed after Cantera 2.5. " - "Replaced by function 'equivalence_ratio'.", DeprecationWarning) - - if not oxidizers: - # Default behavior, find all possible oxidizers - oxidizers = [] - for s in self.species(): - if all(y not in s.composition for y in ['C', 'H', 'S']): - oxidizers.append(s.name) - - alpha = 0 - mol_O = 0 - for k, s in enumerate(self.species()): - if s.name in ignore: - continue - elif s.name in oxidizers: - mol_O += s.composition.get('O', 0) * self.X[k] - else: - nC = s.composition.get('C', 0) - nH = s.composition.get('H', 0) - nO = s.composition.get('O', 0) - nS = s.composition.get('S', 0) - - alpha += (2 * nC + nH / 2 + 2 * nS - nO) * self.X[k] - - if mol_O == 0: - return float('inf') - else: - return alpha / mol_O - - def equivalence_ratio(self, fuel=None, oxidizer=None, basis='mole'): """ Get the equivalence ratio of the current mixture, which is a @@ -1711,27 +1606,6 @@ cdef class PureFluid(ThermoPhase): or a fluid beyond its critical point. """ - property X: - """ - Get/Set vapor fraction (quality). Can be set only when in the two-phase - region. - - .. deprecated:: 2.5 - - Behavior changes after version 2.5, when `X` will refer to mole - fraction. Renamed to `Q`. - """ - def __get__(self): - warnings.warn("Behavior changes after Cantera 2.5, " - "when 'X' will refer to mole fraction. " - "Attribute renamed to 'Q'", DeprecationWarning) - return self.Q - def __set__(self, X): - warnings.warn("Behavior changes after Cantera 2.5, " - "when 'X' will refer to mole fraction. " - "Attribute renamed to 'Q'", DeprecationWarning) - self.Q = X - property Q: """ Get/Set vapor fraction (quality). Can be set only when in the two-phase @@ -1746,23 +1620,6 @@ cdef class PureFluid(ThermoPhase): 'two-phase region') self.thermo.setState_Psat(self.P, Q) - property TX: - """Get/Set the temperature [K] and vapor fraction of a two-phase state. - - .. deprecated:: 2.5 - - To be deprecated with version 2.5, and removed thereafter. - Renamed to `TQ`. - """ - def __get__(self): - warnings.warn("To be removed after Cantera 2.5. " - "Attribute renamed to 'TQ'", DeprecationWarning) - return self.TQ - def __set__(self, values): - warnings.warn("To be removed after Cantera 2.5. " - "Attribute renamed to 'TQ'", DeprecationWarning) - self.TQ = values - property TQ: """Get/Set the temperature [K] and vapor fraction of a two-phase state.""" def __get__(self): @@ -1772,23 +1629,6 @@ cdef class PureFluid(ThermoPhase): Q = values[1] if values[1] is not None else self.Q self.thermo.setState_Tsat(T, Q) - property PX: - """Get/Set the pressure [Pa] and vapor fraction of a two-phase state. - - .. deprecated:: 2.5 - - To be deprecated with version 2.5, and removed thereafter. - Renamed to `PQ`. - """ - def __get__(self): - warnings.warn("To be removed after Cantera 2.5. " - "Attribute renamed to 'PQ'", DeprecationWarning) - return self.PQ - def __set__(self, values): - warnings.warn("To be removed after Cantera 2.5. " - "Attribute renamed to 'PQ'", DeprecationWarning) - self.PQ = values - property PQ: """Get/Set the pressure [Pa] and vapor fraction of a two-phase state.""" def __get__(self): @@ -1879,22 +1719,6 @@ cdef class PureFluid(ThermoPhase): H = values[1] if values[1] is not None else self.h self.thermo.setState_SH(S/self._mass_factor(), H/self._mass_factor()) - property TDX: - """ - Get the temperature [K], density [kg/m^3 or kmol/m^3], and vapor - fraction. - - .. deprecated:: 2.5 - - Behavior changes after version 2.5, when `X` will refer to mole - fraction. Renamed to `TDQ`. - """ - def __get__(self): - warnings.warn("Behavior changes after Cantera 2.5, " - "when 'X' will refer to mole fraction. " - "Attribute renamed to 'TDQ'", DeprecationWarning) - return self.TDQ - property TDQ: """ Get the temperature [K], density [kg/m^3 or kmol/m^3], and vapor @@ -1903,29 +1727,6 @@ cdef class PureFluid(ThermoPhase): def __get__(self): return self.T, self.density, self.Q - property TPX: - """ - Get/Set the temperature [K], pressure [Pa], and vapor fraction of a - PureFluid. - - An Exception is raised if the thermodynamic state is not consistent. - - .. deprecated:: 2.5 - - Behavior changes after version 2.5, when `X` will refer to mole - fraction. Renamed to `TPQ`. - """ - def __get__(self): - warnings.warn("Behavior changes after Cantera 2.5, " - "when 'X' will refer to mole fraction. " - "Attribute renamed to 'TPQ'", DeprecationWarning) - return self.TPQ - def __set__(self, values): - warnings.warn("Behavior changes after Cantera 2.5, " - "when 'X' will refer to mole fraction. " - "Attribute renamed to 'TPQ'", DeprecationWarning) - self.TPQ = values - property TPQ: """ Get/Set the temperature [K], pressure [Pa], and vapor fraction of a @@ -1941,22 +1742,6 @@ cdef class PureFluid(ThermoPhase): Q = values[2] if values[2] is not None else self.Q self.thermo.setState_TPQ(T, P, Q) - property UVX: - """ - Get the internal energy [J/kg or J/kmol], specific volume - [m^3/kg or m^3/kmol], and vapor fraction. - - .. deprecated:: 2.5 - - Behavior changes after version 2.5, when `X` will refer to mole - fraction. Renamed to `UVQ`. - """ - def __get__(self): - warnings.warn("Behavior changes after Cantera 2.5, " - "when 'X' will refer to mole fraction. " - "Attribute renamed to 'UVQ'", DeprecationWarning) - return self.UVQ - property UVQ: """ Get the internal energy [J/kg or J/kmol], specific volume @@ -1965,40 +1750,11 @@ cdef class PureFluid(ThermoPhase): def __get__(self): return self.u, self.v, self.Q - property DPX: - """Get the density [kg/m^3], pressure [Pa], and vapor fraction. - - .. deprecated:: 2.5 - - Behavior changes after version 2.5, when `X` will refer to mole - fraction. Renamed to `DPQ`. - """ - def __get__(self): - warnings.warn("Behavior changes after Cantera 2.5, " - "when 'X' will refer to mole fraction. " - "Attribute renamed to 'DPQ'", DeprecationWarning) - return self.DPQ - property DPQ: """Get the density [kg/m^3], pressure [Pa], and vapor fraction.""" def __get__(self): return self.density, self.P, self.Q - property HPX: - """ - Get the enthalpy [J/kg or J/kmol], pressure [Pa] and vapor fraction. - - .. deprecated:: 2.5 - - Behavior changes after version 2.5, when `X` will refer to mole - fraction. Renamed to `HPQ`. - """ - def __get__(self): - warnings.warn("Behavior changes after Cantera 2.5, " - "when 'X' will refer to mole fraction. " - "Attribute renamed to 'HPQ'", DeprecationWarning) - return self.HPQ - property HPQ: """ Get the enthalpy [J/kg or J/kmol], pressure [Pa] and vapor fraction. @@ -2006,21 +1762,6 @@ cdef class PureFluid(ThermoPhase): def __get__(self): return self.h, self.P, self.Q - property SPX: - """ - Get the entropy [J/kg/K or J/kmol/K], pressure [Pa], and vapor fraction. - - .. deprecated:: 2.5 - - Behavior changes after version 2.5, when `X` will refer to mole - fraction. Renamed to `SPQ`. - """ - def __get__(self): - warnings.warn("Behavior changes after Cantera 2.5, " - "when 'X' will refer to mole fraction. " - "Attribute renamed to 'SPQ'", DeprecationWarning) - return self.SPQ - property SPQ: """ Get the entropy [J/kg/K or J/kmol/K], pressure [Pa], and vapor fraction. @@ -2028,22 +1769,6 @@ cdef class PureFluid(ThermoPhase): def __get__(self): return self.s, self.P, self.Q - property SVX: - """ - Get the entropy [J/kg/K or J/kmol/K], specific volume [m^3/kg or - m^3/kmol], and vapor fraction. - - .. deprecated:: 2.5 - - Behavior changes after version 2.5, when `X` will refer to mole - fraction. Renamed to `SVQ`. - """ - def __get__(self): - warnings.warn("Behavior changes after Cantera 2.5, " - "when 'X' will refer to mole fraction. " - "Attribute renamed to 'SVQ'", DeprecationWarning) - return self.SVQ - property SVQ: """ Get the entropy [J/kg/K or J/kmol/K], specific volume [m^3/kg or diff --git a/interfaces/matlab/toolbox/@FlowDevice/FlowDevice.m b/interfaces/matlab/toolbox/@FlowDevice/FlowDevice.m index 6d43010ad..f31eeb4cc 100644 --- a/interfaces/matlab/toolbox/@FlowDevice/FlowDevice.m +++ b/interfaces/matlab/toolbox/@FlowDevice/FlowDevice.m @@ -25,12 +25,6 @@ if nargin == 0 typ = 'MassFlowController'; end -if isa(typ, 'double') - warning('Definition via integer type to be deprecated after Cantera 2.5') - device_types = {'MassFlowController', 'PressureController', 'Valve'}; - typ = device_types(typ); -end - x.type = char(typ); x.index = flowdevicemethods(0, x.type); if x.index < 0 diff --git a/interfaces/matlab/toolbox/@FlowDevice/massFlowRate.m b/interfaces/matlab/toolbox/@FlowDevice/massFlowRate.m index dacd69ca8..8bd408c13 100644 --- a/interfaces/matlab/toolbox/@FlowDevice/massFlowRate.m +++ b/interfaces/matlab/toolbox/@FlowDevice/massFlowRate.m @@ -1,18 +1,10 @@ -function mdot = massFlowRate(f, time) -% MASSFLOWRATE Get the mass flow rate at a given time. -% mdot = massFlowRate(f, time) +function mdot = massFlowRate(f) +% MASSFLOWRATE Get the mass flow rate. +% mdot = massFlowRate(f) % :param f: % Instance of class :mat:func:`MassFlowController` -% :param time: -% Time at which the mass flow rate is desired % :return: -% The mass flow rate through the :mat:func:`FlowDevice` at the given time +% The mass flow rate through the :mat:func:`FlowDevice` at the current time % -if nargin == 1 - mdot = flowdevicemethods(21, f.index); -else - warning(['"time" argument to massFlowRate is deprecated and will be' ... - ' removed after Cantera 2.5.']) - mdot = flowdevicemethods(21, f.index, time); -end +mdot = flowdevicemethods(21, f.index); diff --git a/interfaces/matlab/toolbox/@Reactor/Reactor.m b/interfaces/matlab/toolbox/@Reactor/Reactor.m index 6741c6bdb..f10028b9d 100644 --- a/interfaces/matlab/toolbox/@Reactor/Reactor.m +++ b/interfaces/matlab/toolbox/@Reactor/Reactor.m @@ -40,14 +40,6 @@ elseif nargin > 2 error('too many arguments'); end -if isa(typ, 'double') - warning('Definition via integer type to be deprecated after Cantera 2.5') - reactor_types = {'Reservoir' 'Reactor' 'FlowReactor' ... - 'ConstPressureReactor' 'IdealGasReactor' ... - 'IdealGasConstPressureReactor'}; - typ = reactor_types(typ); -end - x.type = char(typ); x.index = reactormethods(0, x.type); if x.index < 0 diff --git a/interfaces/matlab/toolbox/IdealGasMix.m b/interfaces/matlab/toolbox/IdealGasMix.m deleted file mode 100644 index 92cba2fd3..000000000 --- a/interfaces/matlab/toolbox/IdealGasMix.m +++ /dev/null @@ -1,79 +0,0 @@ -function s = IdealGasMix(infile, b, c) -% IDEALGASMIX Create a mixture of ideal gases. -% s = IdealGasMix(infile, b, c) -% This function is deprecated and will be removed after Cantera 2.5. Please -% use :mat:func:`Solution` as a replacement. -% Create a :mat:func:`Solution` instance representing an ideal gas mixture. :: -% -% gas1 = IdealGasMix('yaml_file'[,'phase_name'[,'transport_model']]) -% gas2 = IdealGasMix('ck_file'[,'thermo_db'[,'tran_db']]) -% -% creates an object that represents an ideal gas mixture. The -% species in the mixture, their properties, and the reactions among -% the species, if any, are specified in file ``'yaml_file'`` and -% ``'ck_file'``. Examples:: -% -% g1a = IdealGasMix('mech.yaml') -% g1b = IdealGasMix('mech.yaml', 'phase_name', 'Multi') -% g2 = IdealGasMix('mech2.inp') -% g3 = IdealGasMix('mech3.inp', 'therm.dat') -% g4 = IdealGasMix('mech4.inp', 'therm.dat', 'tran.dat') -% -% Objects ``g1a`` and ``g1b`` are created from a YAML file. YAML files -% contain all data required to build the object, and do not require -% any additional database files. Objects ``g2``-``g4`` are created -% from CK-format input files. For ``g2``, ``'mech2.inp'`` contains all required -% species thermo data. File ``'mech3.inp'`` is missing some or all -% species thermo data, and requires database file ``'therm.dat'``. -% Object ``g4`` is created including transport data. -% -% Note that calling :mat:func:`IdealGasMix` with a CK-format input file -% also creates an equivalent CTI file that may be used in future -% calls. If the initial call includes a transport database, then -% the CTI file will contain transport data. -% -% See also: :mat:func:`ck2cti`, :mat:func:`Solution` -% -% :param infile: -% Input file, either YAML, CTI, CTML, or CHEMKIN format -% :param b: -% If a YAML, CTI, or CTML file is specified with ``infile``, this can be -% the name of the phase to be loaded from that file. If a CHEMKIN format file is -% specified with ``infile``, this is the filename of the -% thermodynamic database, if required. -% :param c: -% If a YAML, CTI, or CTML file is specified with ``infile``, this can be -% the transport modeling to be used. If a CHEMKIN format file is specified with -% ``infile``, this is the filename of the transport database, if required. -% :return: -% Instance of class :mat:func:`Solution` -% - -warning(['The function IdealGasMix is deprecated and will be removed after ' ... - 'Cantera 2.5. Please use Solution as a replacement.']) - -dotloc = strfind(infile, '.'); -if dotloc(end) > 1 - ext = infile(dotloc(end):end); - if strcmp(ext, '.cti') || strcmp(ext, '.xml') || ... - strcmp(ext, '.yaml') || strcmp(ext, '.yml') - if nargin == 1 - s = Solution(infile); - elseif nargin == 2 - s = Solution(infile, b); - elseif nargin == 3 - s = Solution(infile, b, c); - end - return - end -end - -if nargin == 1 - b = '-'; - c = '-'; -elseif nargin == 2 - c = '-'; -end -xml = ck2cti(infile, b, c); -s = Solution(xml); -set(s, 'P', oneatm); diff --git a/src/clib/ctreactor.cpp b/src/clib/ctreactor.cpp index 13df44541..4f6525e22 100644 --- a/src/clib/ctreactor.cpp +++ b/src/clib/ctreactor.cpp @@ -35,13 +35,8 @@ extern "C" { // reactor - //! @deprecated To be changed after Cantera 2.5. - int reactor_new(int type) + int reactor_new(const char* type) { - warn_deprecated("reactor_new(int)", - "To be changed after Cantera 2.5. " - "Argument changed to string instead of int; use" - "reactor_new2(char*) during transition."); try { ReactorBase* r = ReactorFactory::factory()->newReactor(type); return ReactorCabinet::add(r); @@ -350,12 +345,8 @@ extern "C" { // flow devices - int flowdev_new(int type) + int flowdev_new(const char* type) { - warn_deprecated("flowdev_new(int)", - "To be changed after Cantera 2.5. " - "Argument changed to string instead of int; use" - "flowdev_new2(char*) during transition."); try { FlowDevice* f = FlowDeviceFactory::factory()->newFlowDevice(type); return FlowDeviceCabinet::add(f); @@ -410,19 +401,7 @@ extern "C" { } } - double flowdev_massFlowRate(int i, double time) - { - try { - warn_deprecated("flowdev_massFlowRate(int i, double time)", - "To be changed after Cantera 2.5. 'time' argument will be " - "removed. Use flowdev_massFlowRate2(int i) during transition."); - return FlowDeviceCabinet::item(i).massFlowRate(time); - } catch (...) { - return handleAllExceptions(DERR, DERR); - } - } - - double flowdev_massFlowRate2(int i) + double flowdev_massFlowRate(int i) { try { return FlowDeviceCabinet::item(i).massFlowRate(); @@ -431,25 +410,14 @@ extern "C" { } } - int flowdev_setMassFlowRate(int i, double mdot) + double flowdev_massFlowRate2(int i) { - /* @deprecated To be removed after Cantera 2.5. */ try { - FlowDeviceCabinet::item(i).setMassFlowRate(mdot); - return 0; + warn_deprecated("flowdev_massFlowRate2(int i)", + "To be removed after Cantera 2.6. Use flowdev_massFlowRate(int i)."); + return FlowDeviceCabinet::item(i).massFlowRate(); } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - - int flowdev_setParameters(int i, int n, const double* v) - { - /* @deprecated To be removed after Cantera 2.5. */ - try { - FlowDeviceCabinet::item(i).setParameters(n, v); - return 0; - } catch (...) { - return handleAllExceptions(-1, ERR); + return handleAllExceptions(DERR, DERR); } } @@ -483,17 +451,6 @@ extern "C" { } } - int flowdev_setFunction(int i, int n) - { - /* @deprecated To be removed after Cantera 2.5. */ - try { - FlowDeviceCabinet::item(i).setFunction(&FuncCabinet::item(n)); - return 0; - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - int flowdev_setPressureFunction(int i, int n) { try { @@ -516,12 +473,8 @@ extern "C" { ///////////// Walls /////////////////////// - int wall_new(int type) + int wall_new(const char* type) { - warn_deprecated("wall_new(int)", - "To be changed after Cantera 2.5. " - "Argument changed to string instead of int; use" - "wall_new2(char*) during transition."); try { WallBase* w = WallFactory::factory()->newWall(type); return WallCabinet::add(w); diff --git a/src/equil/MultiPhase.cpp b/src/equil/MultiPhase.cpp index 3605269df..cf31d3748 100644 --- a/src/equil/MultiPhase.cpp +++ b/src/equil/MultiPhase.cpp @@ -773,14 +773,13 @@ void MultiPhase::getMoleFractions(doublereal* const x) const std::string MultiPhase::phaseName(const size_t iph) const { - const ThermoPhase* tptr = m_phase[iph]; - return tptr->id(); + return m_phase[iph]->name(); } int MultiPhase::phaseIndex(const std::string& pName) const { for (int iph = 0; iph < (int) nPhases(); iph++) { - if (m_phase[iph]->id() == pName) { + if (m_phase[iph]->name() == pName) { return iph; } } diff --git a/src/equil/vcs_VolPhase.cpp b/src/equil/vcs_VolPhase.cpp index 3f0f61dff..aa4a7df2d 100644 --- a/src/equil/vcs_VolPhase.cpp +++ b/src/equil/vcs_VolPhase.cpp @@ -886,7 +886,7 @@ size_t vcs_VolPhase::transferElementsFM(const ThermoPhase* const tPhase) } if (cne) { - std::string pname = tPhase->id(); + std::string pname = tPhase->name(); if (pname == "") { pname = fmt::format("phase{}", VP_ID_); } diff --git a/src/kinetics/FalloffFactory.cpp b/src/kinetics/FalloffFactory.cpp index b2ec78122..c9a580ac7 100644 --- a/src/kinetics/FalloffFactory.cpp +++ b/src/kinetics/FalloffFactory.cpp @@ -22,22 +22,6 @@ FalloffFactory::FalloffFactory() reg("SRI", []() { return new SRI(); }); } -Falloff* FalloffFactory::newFalloff(int type, const vector_fp& c) -{ - warn_deprecated("FalloffFactory::newFalloff", - "Instantiation using magic numbers is deprecated; use string " - "identifier instead. To be removed after Cantera 2.5."); - static const std::unordered_map types { - {SIMPLE_FALLOFF, "Simple"}, - {TROE_FALLOFF, "Troe"}, - {SRI_FALLOFF, "SRI"} - }; - - Falloff* f = create(types.at(type)); - f->init(c); - return f; -} - Falloff* FalloffFactory::newFalloff(const std::string& type, const vector_fp& c) { Falloff* f = create(type); @@ -45,12 +29,6 @@ Falloff* FalloffFactory::newFalloff(const std::string& type, const vector_fp& c) return f; } -shared_ptr newFalloff(int type, const vector_fp& c) -{ - shared_ptr f(FalloffFactory::factory()->newFalloff(type, c)); - return f; -} - shared_ptr newFalloff(const std::string& type, const vector_fp& c) { shared_ptr f(FalloffFactory::factory()->newFalloff(type, c)); diff --git a/src/kinetics/InterfaceKinetics.cpp b/src/kinetics/InterfaceKinetics.cpp index a4899d604..09cacb198 100644 --- a/src/kinetics/InterfaceKinetics.cpp +++ b/src/kinetics/InterfaceKinetics.cpp @@ -236,13 +236,10 @@ void InterfaceKinetics::applyVoltageKfwdCorrection(doublereal* const kf) for (size_t i = 0; i < m_beta.size(); i++) { size_t irxn = m_ctrxn[i]; - // If we calculate the BV form directly, we don't add the voltage - // correction to the forward reaction rate constants. - if (m_ctrxn_BVform[i] == 0) { - double eamod = m_beta[i] * deltaElectricEnergy_[irxn]; - if (eamod != 0.0) { - kf[irxn] *= exp(-eamod/thermo(reactionPhaseIndex()).RT()); - } + // Add the voltage correction to the forward reaction rate constants. + double eamod = m_beta[i] * deltaElectricEnergy_[irxn]; + if (eamod != 0.0) { + kf[irxn] *= exp(-eamod/thermo(reactionPhaseIndex()).RT()); } } } @@ -259,35 +256,12 @@ void InterfaceKinetics::convertExchangeCurrentDensityFormulation(doublereal* con // current density formulation format. int iECDFormulation = m_ctrxn_ecdf[i]; if (iECDFormulation) { - // If the BV form is to be converted into the normal form then we go - // through this process. If it isn't to be converted, then we don't - // go through this process. - // // We need to have the straight chemical reaction rate constant to // come out of this calculation. - if (m_ctrxn_BVform[i] == 0) { - // Calculate the term and modify the forward reaction - double tmp = exp(- m_beta[i] * m_deltaG0[irxn] - / thermo(reactionPhaseIndex()).RT()); - tmp *= 1.0 / m_ProdStanConcReac[irxn] / Faraday; - kfwd[irxn] *= tmp; - } - // If BVform is nonzero we don't need to do anything. - } else { - // kfwd[] is the chemical reaction rate constant - // - // If we are to calculate the BV form directly, then we will do the - // reverse. We will calculate the exchange current density - // formulation here and substitute it. - if (m_ctrxn_BVform[i] != 0) { - // Calculate the term and modify the forward reaction rate - // constant so that it's in the exchange current density - // formulation format - double tmp = exp(m_beta[i] * m_deltaG0[irxn] - * thermo(reactionPhaseIndex()).RT()); - tmp *= Faraday * m_ProdStanConcReac[irxn]; - kfwd[irxn] *= tmp; - } + double tmp = exp(- m_beta[i] * m_deltaG0[irxn] + / thermo(reactionPhaseIndex()).RT()); + tmp *= 1.0 / m_ProdStanConcReac[irxn] / Faraday; + kfwd[irxn] *= tmp; } } } @@ -548,33 +522,6 @@ bool InterfaceKinetics::addReaction(shared_ptr r_base) } else { m_ctrxn_ecdf.push_back(0); } - - if (r.reaction_type == BUTLERVOLMER_NOACTIVITYCOEFFS_RXN || - r.reaction_type == BUTLERVOLMER_RXN || - r.reaction_type == SURFACEAFFINITY_RXN || - r.reaction_type == GLOBAL_RXN) { - // Specify alternative forms of the electrochemical reaction - if (r.reaction_type == BUTLERVOLMER_RXN) { - m_ctrxn_BVform.push_back(1); - } else if (r.reaction_type == BUTLERVOLMER_NOACTIVITYCOEFFS_RXN) { - m_ctrxn_BVform.push_back(2); - } else { - // set the default to be the normal forward / reverse calculation method - m_ctrxn_BVform.push_back(0); - } - if (!r.orders.empty()) { - vector_fp orders(nTotalSpecies(), 0.0); - for (const auto& order : r.orders) { - orders[kineticsSpeciesIndex(order.first)] = order.second; - } - } - } else { - m_ctrxn_BVform.push_back(0); - if (re->film_resistivity > 0.0) { - throw CanteraError("InterfaceKinetics::addReaction", - "film resistivity set for elementary reaction"); - } - } } if (r.reversible) { @@ -842,41 +789,6 @@ void InterfaceKinetics::setPhaseStability(const size_t iphase, const int isStabl } } -void InterfaceKinetics::determineFwdOrdersBV(ElectrochemicalReaction& r, vector_fp& fwdFullOrders) -{ - // Start out with the full ROP orders vector. - // This vector will have the BV exchange current density orders in it. - fwdFullOrders.assign(nTotalSpecies(), 0.0); - for (const auto& order : r.orders) { - fwdFullOrders[kineticsSpeciesIndex(order.first)] = order.second; - } - - // forward and reverse beta values - double betaf = r.beta; - - // Loop over the reactants doing away with the BV terms. - // This should leave the reactant terms only, even if they are non-mass action. - for (const auto& sp : r.reactants) { - size_t k = kineticsSpeciesIndex(sp.first); - fwdFullOrders[k] += betaf * sp.second; - // just to make sure roundoff doesn't leave a term that should be zero (haven't checked this out yet) - if (abs(fwdFullOrders[k]) < 0.00001) { - fwdFullOrders[k] = 0.0; - } - } - - // Loop over the products doing away with the BV terms. - // This should leave the reactant terms only, even if they are non-mass action. - for (const auto& sp : r.products) { - size_t k = kineticsSpeciesIndex(sp.first); - fwdFullOrders[k] -= betaf * sp.second; - // just to make sure roundoff doesn't leave a term that should be zero (haven't checked this out yet) - if (abs(fwdFullOrders[k]) < 0.00001) { - fwdFullOrders[k] = 0.0; - } - } -} - void InterfaceKinetics::applyStickingCorrection(double T, double* kf) { if (m_stickingData.empty()) { diff --git a/src/kinetics/Reaction.cpp b/src/kinetics/Reaction.cpp index b6374ee21..66c5c0fde 100644 --- a/src/kinetics/Reaction.cpp +++ b/src/kinetics/Reaction.cpp @@ -268,8 +268,7 @@ InterfaceReaction::InterfaceReaction(const Composition& reactants_, } ElectrochemicalReaction::ElectrochemicalReaction() - : film_resistivity(0.0) - , beta(0.5) + : beta(0.5) , exchange_current_density_formulation(false) { } @@ -278,7 +277,6 @@ ElectrochemicalReaction::ElectrochemicalReaction(const Composition& reactants_, const Composition& products_, const Arrhenius& rate_) : InterfaceReaction(reactants_, products_, rate_) - , film_resistivity(0.0) , beta(0.5) , exchange_current_density_formulation(false) { @@ -794,9 +792,6 @@ void setupChebyshevReaction(ChebyshevReaction&R, const AnyMap& node, void setupInterfaceReaction(InterfaceReaction& R, const XML_Node& rxn_node) { - if (caseInsensitiveEquals(rxn_node["type"], "global")) { - R.reaction_type = GLOBAL_RXN; - } XML_Node& arr = rxn_node.child("rateCoeff").child("Arrhenius"); if (caseInsensitiveEquals(arr["type"], "stick")) { R.is_sticking_coefficient = true; @@ -867,26 +862,6 @@ void setupInterfaceReaction(InterfaceReaction& R, const AnyMap& node, void setupElectrochemicalReaction(ElectrochemicalReaction& R, const XML_Node& rxn_node) { - // Fix reaction_type for some specialized reaction types - std::string type = toLowerCopy(rxn_node["type"]); - if (type == "butlervolmer") { - R.reaction_type = BUTLERVOLMER_RXN; - warn_deprecated("reaction type 'ButlerVolmer'", - "To be removed after Cantera 2.5."); - } else if (type == "butlervolmer_noactivitycoeffs") { - R.reaction_type = BUTLERVOLMER_NOACTIVITYCOEFFS_RXN; - warn_deprecated("reaction type 'butlervolmer_noactivitycoeffs'", - "To be removed after Cantera 2.5."); - } else if (type == "surfaceaffinity") { - R.reaction_type = SURFACEAFFINITY_RXN; - warn_deprecated("reaction type 'surfaceaffinity'", - "To be removed after Cantera 2.5."); - } else if (type == "global") { - R.reaction_type = GLOBAL_RXN; - warn_deprecated("reaction type 'global'", - "To be removed after Cantera 2.5."); - } - XML_Node& rc = rxn_node.child("rateCoeff"); std::string rc_type = toLowerCopy(rc["type"]); if (rc_type == "exchangecurrentdensity") { @@ -903,63 +878,8 @@ void setupElectrochemicalReaction(ElectrochemicalReaction& R, R.beta = fpValueCheck(rc.child("electrochem")["beta"]); } - if (rxn_node.hasChild("filmResistivity")) { - warn_deprecated("reaction filmResistivity", - "Not implemented. To be removed after Cantera 2.5."); - } - getOptionalFloat(rxn_node, "filmResistivity", R.film_resistivity); setupInterfaceReaction(R, rxn_node); - // For Butler Volmer reactions, install the orders for the exchange current - if (R.reaction_type == BUTLERVOLMER_NOACTIVITYCOEFFS_RXN || - R.reaction_type == BUTLERVOLMER_RXN) { - if (!R.reversible) { - throw CanteraError("setupElectrochemicalReaction", - "A Butler-Volmer reaction must be reversible"); - } - - R.orders.clear(); - // Reaction orders based on species stoichiometric coefficients - R.allow_nonreactant_orders = true; - for (const auto& sp : R.reactants) { - R.orders[sp.first] += sp.second * (1.0 - R.beta); - } - for (const auto& sp : R.products) { - R.orders[sp.first] += sp.second * R.beta; - } - } - - // For affinity reactions, fill in the global reaction formulation terms - if (rxn_node.hasChild("reactionOrderFormulation")) { - warn_deprecated("reactionOrderFormulation", - "To be removed after Cantera 2.5."); - Composition initial_orders = R.orders; - R.orders.clear(); - R.allow_nonreactant_orders = true; - const XML_Node& rof_node = rxn_node.child("reactionOrderFormulation"); - if (caseInsensitiveEquals(rof_node["model"], "reactantorders")) { - R.orders = initial_orders; - } else if (caseInsensitiveEquals(rof_node["model"], "zeroorders")) { - for (const auto& sp : R.reactants) { - R.orders[sp.first] = 0.0; - } - } else if (caseInsensitiveEquals(rof_node["model"], "butlervolmerorders")) { - // Reaction orders based on provided reaction orders - for (const auto& sp : R.reactants) { - double c = getValue(initial_orders, sp.first, sp.second); - R.orders[sp.first] += c * (1.0 - R.beta); - } - for (const auto& sp : R.products) { - double c = getValue(initial_orders, sp.first, sp.second); - R.orders[sp.first] += c * R.beta; - } - } else { - throw CanteraError("setupElectrochemicalReaction", "unknown model " - "for reactionOrderFormulation XML_Node: '" + - rof_node["model"] + "'"); - } - } - // Override orders based on the node if (rxn_node.hasChild("orders")) { Composition orders = parseCompString(rxn_node.child("orders").value()); diff --git a/src/matlab/flowdevicemethods.cpp b/src/matlab/flowdevicemethods.cpp index d45587032..e58074fa1 100644 --- a/src/matlab/flowdevicemethods.cpp +++ b/src/matlab/flowdevicemethods.cpp @@ -42,17 +42,9 @@ void flowdevicemethods(int nlhs, mxArray* plhs[], m = getInt(prhs[4]); iok = flowdev_install(i, int(v), m); break; - case 3: - // @deprecated To be removed after Cantera 2.5. - iok = flowdev_setMassFlowRate(i, v); - break; case 4: iok = flowdev_setValveCoeff(i, v); break; - case 5: - // @deprecated To be removed after Cantera 2.5. - iok = flowdev_setFunction(i, int(v)); - break; case 7: iok = flowdev_setMaster(i, int(v)); break; diff --git a/src/oneD/StFlow.cpp b/src/oneD/StFlow.cpp index df9b1e7d6..b81595113 100644 --- a/src/oneD/StFlow.cpp +++ b/src/oneD/StFlow.cpp @@ -594,18 +594,8 @@ string StFlow::componentName(size_t n) const size_t StFlow::componentIndex(const std::string& name) const { - if (name=="u") { - warn_deprecated("StFlow::componentIndex", - "To be changed after Cantera 2.5. " - "Solution component 'u' renamed to 'velocity'"); + if (name=="velocity") { return 0; - } else if (name=="velocity") { - return 0; - } else if (name=="V") { - warn_deprecated("StFlow::componentIndex", - "To be changed after Cantera 2.5. " - "Solution component 'V' renamed to 'spread_rate'"); - return 1; } else if (name=="spread_rate") { return 1; } else if (name=="T") { diff --git a/src/thermo/BinarySolutionTabulatedThermo.cpp b/src/thermo/BinarySolutionTabulatedThermo.cpp index c43a17b67..aa7da5af5 100644 --- a/src/thermo/BinarySolutionTabulatedThermo.cpp +++ b/src/thermo/BinarySolutionTabulatedThermo.cpp @@ -75,8 +75,6 @@ void BinarySolutionTabulatedThermo::_updateThermo() const m_h0_RT[m_kk_tab] += m_h0_tab * rrt; m_s0_R[m_kk_tab] += m_s0_tab / GasConstant; for (size_t k = 0; k < m_kk; k++) { - double deltaE = rrt * m_pe[k]; - m_h0_RT[k] += deltaE; m_g0_RT[k] = m_h0_RT[k] - m_s0_R[k]; } m_tlast = tnow; diff --git a/src/thermo/ConstDensityThermo.cpp b/src/thermo/ConstDensityThermo.cpp deleted file mode 100644 index a4436d371..000000000 --- a/src/thermo/ConstDensityThermo.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/** - * @file ConstDensityThermo.cpp - * Declarations for a Thermo manager for incompressible ThermoPhases - * (see \ref thermoprops and \link Cantera::ConstDensityThermo ConstDensityThermo -\endlink). - */ - -// This file is part of Cantera. See License.txt in the top-level directory or -// at https://cantera.org/license.txt for license and copyright information. - -#include "cantera/thermo/ConstDensityThermo.h" -#include "cantera/base/ctml.h" - -namespace Cantera -{ - -doublereal ConstDensityThermo::enthalpy_mole() const -{ - doublereal p0 = refPressure(); - return RT() * mean_X(enthalpy_RT()) + (pressure() - p0)/molarDensity(); -} - -doublereal ConstDensityThermo::entropy_mole() const -{ - return GasConstant * (mean_X(entropy_R()) - sum_xlogx()); -} - -doublereal ConstDensityThermo::cp_mole() const -{ - return GasConstant * mean_X(cp_R()); -} - -doublereal ConstDensityThermo::cv_mole() const -{ - return cp_mole(); -} - -doublereal ConstDensityThermo::pressure() const -{ - return m_press; -} - -void ConstDensityThermo::setPressure(doublereal p) -{ - m_press = p; -} - -void ConstDensityThermo::getActivityConcentrations(doublereal* c) const -{ - getConcentrations(c); -} - -void ConstDensityThermo::getActivityCoefficients(doublereal* ac) const -{ - for (size_t k = 0; k < m_kk; k++) { - ac[k] = 1.0; - } -} - -doublereal ConstDensityThermo::standardConcentration(size_t k) const -{ - return density()/molecularWeight(k); -} - -void ConstDensityThermo::getChemPotentials(doublereal* mu) const -{ - doublereal vdp = (pressure() - refPressure())/ - molarDensity(); - const vector_fp& g_RT = gibbs_RT(); - for (size_t k = 0; k < m_kk; k++) { - double xx = std::max(SmallNumber, moleFraction(k)); - mu[k] = RT()*(g_RT[k] + log(xx)) + vdp; - } -} - - -void ConstDensityThermo::getStandardChemPotentials(doublereal* mu0) const -{ - getPureGibbs(mu0); -} - -bool ConstDensityThermo::addSpecies(shared_ptr spec) -{ - bool added = ThermoPhase::addSpecies(spec); - if (added) { - m_h0_RT.push_back(0.0); - m_g0_RT.push_back(0.0); - m_cp0_R.push_back(0.0); - m_s0_R.push_back(0.0); - } - return added; -} - -void ConstDensityThermo::_updateThermo() const -{ - doublereal tnow = temperature(); - if (m_tlast != tnow) { - m_spthermo.update(tnow, &m_cp0_R[0], &m_h0_RT[0], - &m_s0_R[0]); - m_tlast = tnow; - for (size_t k = 0; k < m_kk; k++) { - m_g0_RT[k] = m_h0_RT[k] - m_s0_R[k]; - } - m_tlast = tnow; - } -} - -void ConstDensityThermo::initThermo() -{ - if (m_input.hasKey("density")) { - assignDensity(m_input.convert("density", "kg/m^3")); - } - ThermoPhase::initThermo(); -} - -void ConstDensityThermo::setParametersFromXML(const XML_Node& eosdata) -{ - eosdata._require("model","Incompressible"); - doublereal rho = getFloat(eosdata, "density", "toSI"); - assignDensity(rho); -} - -} diff --git a/src/thermo/DebyeHuckel.cpp b/src/thermo/DebyeHuckel.cpp index eff489ec4..bbfb3efe4 100644 --- a/src/thermo/DebyeHuckel.cpp +++ b/src/thermo/DebyeHuckel.cpp @@ -115,30 +115,6 @@ void DebyeHuckel::calcDensity() Phase::assignDensity(dd); } -void DebyeHuckel::setDensity(doublereal rho) -{ - warn_deprecated("DebyeHuckel::setDensity", - "Overloaded function to be removed after Cantera 2.5. " - "Error will be thrown by Phase::setDensity instead"); - double dens = density(); - if (rho != dens) { - throw CanteraError("DebyeHuckel::setDensity", - "Density is not an independent variable"); - } -} - -void DebyeHuckel::setMolarDensity(const doublereal conc) -{ - warn_deprecated("DebyeHuckel::setMolarDensity", - "Overloaded function to be removed after Cantera 2.5. " - "Error will be thrown by Phase::setMolarDensity instead"); - double concI = molarDensity(); - if (conc != concI) { - throw CanteraError("DebyeHuckel::setMolarDensity", - "molarDensity/density is not an independent variable"); - } -} - // ------- Activities and Activity Concentrations void DebyeHuckel::getActivityConcentrations(doublereal* c) const diff --git a/src/thermo/FixedChemPotSSTP.cpp b/src/thermo/FixedChemPotSSTP.cpp deleted file mode 100644 index b47b71b95..000000000 --- a/src/thermo/FixedChemPotSSTP.cpp +++ /dev/null @@ -1,268 +0,0 @@ -/** - * @file FixedChemPotSSTP.cpp - * Definition file for the FixedChemPotSSTP class, which represents a fixed-composition - * incompressible substance with a constant chemical potential (see \ref thermoprops and - * class \link Cantera::FixedChemPotSSTP FixedChemPotSSTP\endlink) - */ - -// This file is part of Cantera. See License.txt in the top-level directory or -// at https://cantera.org/license.txt for license and copyright information. - -#include "cantera/thermo/FixedChemPotSSTP.h" -#include "cantera/thermo/ThermoFactory.h" -#include "cantera/thermo/SpeciesThermoFactory.h" -#include "cantera/thermo/SpeciesThermoInterpType.h" -#include "cantera/base/ctml.h" -#include "cantera/base/stringUtils.h" - -namespace Cantera -{ - -// ---- Constructors ------- - -FixedChemPotSSTP::FixedChemPotSSTP() : - chemPot_(0.0) -{ - warn_deprecated("class FixedChemPotSSTP", "To be removed after Cantera 2.5. " - "Use class StoichSubstance with a constant-cp species thermo model, " - "with 'h0' set to the desired chemical potential and 's0' set to 0."); -} - -FixedChemPotSSTP::FixedChemPotSSTP(const std::string& infile, const std::string& id_) : - chemPot_(0.0) -{ - warn_deprecated("class FixedChemPotSSTP", "To be removed after Cantera 2.5. " - "Use class StoichSubstance with a constant-cp species thermo model, " - "with 'h0' set to the desired chemical potential and 's0' set to 0."); - initThermoFile(infile, id_); -} -FixedChemPotSSTP::FixedChemPotSSTP(XML_Node& xmlphase, const std::string& id_) : - chemPot_(0.0) -{ - warn_deprecated("class FixedChemPotSSTP", "To be removed after Cantera 2.5. " - "Use class StoichSubstance with a constant-cp species thermo model, " - "with 'h0' set to the desired chemical potential and 's0' set to 0."); - importPhase(xmlphase, this); -} - -FixedChemPotSSTP::FixedChemPotSSTP(const std::string& Ename, doublereal val) : - chemPot_(0.0) -{ - warn_deprecated("class FixedChemPotSSTP", "To be removed after Cantera 2.5. " - "Use class StoichSubstance with a constant-cp species thermo model, " - "with 'h0' set to the desired chemical potential and 's0' set to 0."); - std::string pname = Ename + "Fixed"; - setName(pname); - setNDim(3); - addElement(Ename); - auto sp = make_shared(pname, parseCompString(Ename + ":1.0")); - double c[4] = {298.15, val, 0.0, 0.0}; - shared_ptr stit( - newSpeciesThermoInterpType("const_cp", 0.1, 1e30, OneAtm, c)); - sp->thermo = stit; - addSpecies(sp); - initThermo(); - m_p0 = OneAtm; - m_tlast = 298.15; - setChemicalPotential(val); - - // Create an XML_Node entry for this species - XML_Node s("species", 0); - s.addAttribute("name", pname); - std::string aaS = Ename + ":1"; - s.addChild("atomArray", aaS); - XML_Node& tt = s.addChild("thermo"); - XML_Node& ss = tt.addChild("Simple"); - ss.addAttribute("Pref", "1 bar"); - ss.addAttribute("Tmax", "5000."); - ss.addAttribute("Tmin", "100."); - ss.addChild("t0", "298.15"); - ss.addChild("cp0", "0.0"); - ss.addChild("h", fmt::format("{}", val)); - ss.addChild("s", "0.0"); - saveSpeciesData(0, &s); -} - -// ----- Mechanical Equation of State ------ - -doublereal FixedChemPotSSTP::pressure() const -{ - return m_press; -} - -void FixedChemPotSSTP::setPressure(doublereal p) -{ - m_press = p; -} - -doublereal FixedChemPotSSTP::isothermalCompressibility() const -{ - return 0.0; -} - -doublereal FixedChemPotSSTP::thermalExpansionCoeff() const -{ - return 0.0; -} - -// ---- Chemical Potentials and Activities ---- - -Units FixedChemPotSSTP::standardConcentrationUnits() const -{ - return Units(1.0); // dimensionless -} - -void FixedChemPotSSTP::getActivityConcentrations(doublereal* c) const -{ - c[0] = 1.0; -} - -doublereal FixedChemPotSSTP::standardConcentration(size_t k) const -{ - return 1.0; -} - -doublereal FixedChemPotSSTP::logStandardConc(size_t k) const -{ - return 0.0; -} - -// ---- Partial Molar Properties of the Solution ---- - -void FixedChemPotSSTP::getPartialMolarVolumes(doublereal* vbar) const -{ - vbar[0] = 0.0; -} - -// Properties of the Standard State of the Species in the Solution - -void FixedChemPotSSTP::getStandardChemPotentials(doublereal* mu0) const -{ - mu0[0] = chemPot_; -} - -void FixedChemPotSSTP::getEnthalpy_RT(doublereal* hrt) const -{ - hrt[0] = chemPot_ / RT(); -} - -void FixedChemPotSSTP::getEntropy_R(doublereal* sr) const -{ - sr[0] = 0.0; -} - -void FixedChemPotSSTP::getGibbs_RT(doublereal* grt) const -{ - grt[0] = chemPot_ / RT(); -} - -void FixedChemPotSSTP::getCp_R(doublereal* cpr) const -{ - cpr[0] = 0.0; -} - -void FixedChemPotSSTP::getIntEnergy_RT(doublereal* urt) const -{ - urt[0] = chemPot_; -} - -void FixedChemPotSSTP::getStandardVolumes(doublereal* vbar) const -{ - vbar[0] = 0.0; -} - -// ---- Thermodynamic Values for the Species Reference States ---- - -void FixedChemPotSSTP::getIntEnergy_RT_ref(doublereal* urt) const -{ - urt[0] = chemPot_; -} - -void FixedChemPotSSTP::getEnthalpy_RT_ref(doublereal* hrt) const -{ - hrt[0] = chemPot_ / RT(); -} - -void FixedChemPotSSTP::getEntropy_R_ref(doublereal* sr) const -{ - sr[0] = 0.0; -} - -void FixedChemPotSSTP::getGibbs_RT_ref(doublereal* grt) const -{ - grt[0] = chemPot_ / RT(); -} - -void FixedChemPotSSTP::getGibbs_ref(doublereal* g) const -{ - g[0] = chemPot_; -} - -void FixedChemPotSSTP::getCp_R_ref(doublereal* cpr) const -{ - cpr[0] = 0.0; -} - -// ---- Initialization and Internal functions - -void FixedChemPotSSTP::initThermoXML(XML_Node& phaseNode, const std::string& id_) -{ - // Find the Thermo XML node - if (!phaseNode.hasChild("thermo")) { - throw CanteraError("FixedChemPotSSTP::initThermoXML", "no thermo XML node"); - } - XML_Node& tnode = phaseNode.child("thermo"); - std::string model = tnode["model"]; - if (model != "StoichSubstance" && model != "FixedChemPot" && model != "StoichSubstanceSSTP") { - throw CanteraError("FixedChemPotSSTP::initThermoXML", - "thermo model attribute must be FixedChemPot or StoichSubstance or StoichSubstanceSSTP"); - } - - SingleSpeciesTP::initThermoXML(phaseNode, id_); - if (model == "FixedChemPot") { - double val = getFloat(tnode, "chemicalPotential", "toSI"); - chemPot_ = val; - } else { - _updateThermo(); - chemPot_ = (m_h0_RT - m_s0_R) * RT(); - } -} - -void FixedChemPotSSTP::initThermo() -{ - if (m_input.hasKey("chemical-potential")) { - chemPot_ = m_input.convert("chemical-potential", "J/kmol"); - } - SingleSpeciesTP::initThermo(); -} - -void FixedChemPotSSTP::setParameters(int n, doublereal* const c) -{ - chemPot_ = c[0]; -} - -void FixedChemPotSSTP::getParameters(int& n, doublereal* const c) const -{ - n = 1; - c[0] = chemPot_; -} - -void FixedChemPotSSTP::setParametersFromXML(const XML_Node& eosdata) -{ - std::string model = eosdata["model"]; - if (model != "StoichSubstance" && model != "FixedChemPot" && model != "StoichSubstanceSSTP") { - throw CanteraError("FixedChemPotSSTP::setParametersFromXML", - "thermo model attribute must be FixedChemPot or StoichSubstance or StoichSubstanceSSTP"); - } - if (model == "FixedChemPotSSTP") { - doublereal val = getFloat(eosdata, "chemicalPotential", "toSI"); - chemPot_ = val; - } -} - -void FixedChemPotSSTP::setChemicalPotential(doublereal chemPot) -{ - chemPot_ = chemPot; -} - -} diff --git a/src/thermo/HMWSoln.cpp b/src/thermo/HMWSoln.cpp index a7fb34359..fb5d99254 100644 --- a/src/thermo/HMWSoln.cpp +++ b/src/thermo/HMWSoln.cpp @@ -240,27 +240,6 @@ void HMWSoln::calcDensity() Phase::assignDensity(dd); } -void HMWSoln::setDensity(const doublereal rho) -{ - warn_deprecated("HMWSoln::setDensity", - "Overloaded function to be removed after Cantera 2.5. " - "Error will be thrown by Phase::setDensity instead"); - double dens_old = density(); - if (rho != dens_old) { - throw CanteraError("HMWSoln::setDensity", - "Density is not an independent variable"); - } -} - -void HMWSoln::setMolarDensity(const doublereal rho) -{ - warn_deprecated("HMWSoln::setMolarDensity", - "Overloaded function to be removed after Cantera 2.5. " - "Error will be thrown by Phase::setMolarDensity instead"); - throw CanteraError("HMWSoln::setMolarDensity", - "Density is not an independent variable"); -} - // ------- Activities and Activity Concentrations void HMWSoln::getActivityConcentrations(doublereal* c) const diff --git a/src/thermo/IdealMolalSoln.cpp b/src/thermo/IdealMolalSoln.cpp index 2fd941033..2144eecf1 100644 --- a/src/thermo/IdealMolalSoln.cpp +++ b/src/thermo/IdealMolalSoln.cpp @@ -139,28 +139,6 @@ doublereal IdealMolalSoln::thermalExpansionCoeff() const return 0.0; } -void IdealMolalSoln::setDensity(const doublereal rho) -{ - warn_deprecated("IdealMolalSoln::setDensity", - "Overloaded function to be removed after Cantera 2.5. " - "Error will be thrown by Phase::setDensity instead"); - if (rho != density()) { - throw CanteraError("IdealMolalSoln::setDensity", - "Density is not an independent variable"); - } -} - -void IdealMolalSoln::setMolarDensity(const doublereal conc) -{ - warn_deprecated("IdealMolalSoln::setMolarDensity", - "Overloaded function to be removed after Cantera 2.5. " - "Error will be thrown by Phase::setMolarDensity instead"); - if (conc != Phase::molarDensity()) { - throw CanteraError("IdealMolalSoln::setMolarDensity", - "molarDensity/density is not an independent variable"); - } -} - // ------- Activities and Activity Concentrations Units IdealMolalSoln::standardConcentrationUnits() const diff --git a/src/thermo/IdealSolidSolnPhase.cpp b/src/thermo/IdealSolidSolnPhase.cpp index 054607a2a..baa05c250 100644 --- a/src/thermo/IdealSolidSolnPhase.cpp +++ b/src/thermo/IdealSolidSolnPhase.cpp @@ -93,35 +93,12 @@ void IdealSolidSolnPhase::calcDensity() Phase::assignDensity(1.0/invDens); } -void IdealSolidSolnPhase::setDensity(const doublereal rho) -{ - // Unless the input density is exactly equal to the density calculated and - // stored in the State object, we throw an exception. This is because the - // density is NOT an independent variable. - warn_deprecated("IdealSolidSolnPhase::setDensity", - "Overloaded function to be removed after Cantera 2.5. " - "Error will be thrown by Phase::setDensity instead"); - if (std::abs(rho/density() - 1.0) > 1e-15) { - throw CanteraError("IdealSolidSolnPhase::setDensity", - "Density is not an independent variable"); - } -} - void IdealSolidSolnPhase::setPressure(doublereal p) { m_Pcurrent = p; calcDensity(); } -void IdealSolidSolnPhase::setMolarDensity(const doublereal n) -{ - warn_deprecated("IdealSolidSolnPhase::setMolarDensity", - "Overloaded function to be removed after Cantera 2.5. " - "Error will be thrown by Phase::setMolarDensity instead"); - throw CanteraError("IdealSolidSolnPhase::setMolarDensity", - "Density is not an independent variable"); -} - void IdealSolidSolnPhase::compositionChanged() { Phase::compositionChanged(); @@ -373,7 +350,6 @@ bool IdealSolidSolnPhase::addSpecies(shared_ptr spec) m_expg0_RT.push_back(0.0); m_cp0_R.push_back(0.0); m_s0_R.push_back(0.0); - m_pe.push_back(0.0);; m_pp.push_back(0.0); if (spec->input.hasKey("equation-of-state")) { auto& eos = spec->input["equation-of-state"].getMapWhere("model", "constant-volume"); @@ -391,9 +367,9 @@ bool IdealSolidSolnPhase::addSpecies(shared_ptr spec) "specification", spec->name); } m_speciesMolarVolume.push_back(mv); - } else if (spec->extra.hasKey("molar_volume")) { - // From XML - m_speciesMolarVolume.push_back(spec->extra["molar_volume"].asDouble()); + } else if (spec->input.hasKey("molar_volume")) { + // @Deprecated - remove this case for Cantera 3.0 with removal of the XML format + m_speciesMolarVolume.push_back(spec->input["molar_volume"].asDouble()); } else { throw CanteraError("IdealSolidSolnPhase::addSpecies", "Molar volume not specified for species '{}'", spec->name); @@ -505,10 +481,7 @@ void IdealSolidSolnPhase::_updateThermo() const // Update the thermodynamic functions of the reference state. m_spthermo.update(tnow, m_cp0_R.data(), m_h0_RT.data(), m_s0_R.data()); m_tlast = tnow; - doublereal rrt = 1.0 / RT(); for (size_t k = 0; k < m_kk; k++) { - double deltaE = rrt * m_pe[k]; - m_h0_RT[k] += deltaE; m_g0_RT[k] = m_h0_RT[k] - m_s0_R[k]; } m_tlast = tnow; diff --git a/src/thermo/IdealSolnGasVPSS.cpp b/src/thermo/IdealSolnGasVPSS.cpp index 5ab7773ca..141da4fde 100644 --- a/src/thermo/IdealSolnGasVPSS.cpp +++ b/src/thermo/IdealSolnGasVPSS.cpp @@ -1,7 +1,7 @@ /** * @file IdealSolnGasVPSS.cpp - * Definition file for a derived class of ThermoPhase that assumes either - * an ideal gas or ideal solution approximation and handles + * Definition file for a derived class of ThermoPhase that assumes + * an ideal solution approximation and handles * variable pressure standard state methods for calculating * thermodynamic properties (see \ref thermoprops and * class \link Cantera::IdealSolnGasVPSS IdealSolnGasVPSS\endlink). @@ -22,13 +22,11 @@ namespace Cantera { IdealSolnGasVPSS::IdealSolnGasVPSS() : - m_idealGas(-1), m_formGC(0) { } IdealSolnGasVPSS::IdealSolnGasVPSS(const std::string& infile, std::string id_) : - m_idealGas(0), m_formGC(0) { XML_Node* root = get_XML_File(infile); @@ -46,11 +44,6 @@ IdealSolnGasVPSS::IdealSolnGasVPSS(const std::string& infile, std::string id_) : void IdealSolnGasVPSS::setStandardConcentrationModel(const std::string& model) { - if (m_idealGas) { - throw CanteraError("IdealSolnGasVPSS::setStandardConcentrationModel", - "Standard concentration model not applicable for ideal gas"); - } - if (caseInsensitiveEquals(model, "unity")) { m_formGC = 0; } else if (caseInsensitiveEquals(model, "species-molar-volume") @@ -99,32 +92,17 @@ void IdealSolnGasVPSS::setPressure(doublereal p) void IdealSolnGasVPSS::calcDensity() { - // Calculate the molarVolume of the solution (m**3 kmol-1) - if (m_idealGas) { - double dens = m_Pcurrent * meanMolecularWeight() / RT(); - Phase::assignDensity(dens); - } else { - const doublereal* const dtmp = moleFractdivMMW(); - const vector_fp& vss = getStandardVolumes(); - double dens = 1.0 / dot(vss.begin(), vss.end(), dtmp); + const doublereal* const dtmp = moleFractdivMMW(); + const vector_fp& vss = getStandardVolumes(); + double dens = 1.0 / dot(vss.begin(), vss.end(), dtmp); - // Set the density in the parent State object directly - Phase::assignDensity(dens); - } -} - -doublereal IdealSolnGasVPSS::isothermalCompressibility() const -{ - if (m_idealGas) { - return 1.0 / m_Pcurrent; - } else { - throw NotImplementedError("IdealSolnGasVPSS::isothermalCompressibility"); - } + // Set the density in the parent State object directly + Phase::assignDensity(dens); } Units IdealSolnGasVPSS::standardConcentrationUnits() const { - if (m_idealGas || m_formGC != 0) { + if (m_formGC != 0) { return Units(1.0, 0, -3, 0, 0, 0, 1); } else { return Units(1.0); @@ -133,46 +111,38 @@ Units IdealSolnGasVPSS::standardConcentrationUnits() const void IdealSolnGasVPSS::getActivityConcentrations(doublereal* c) const { - if (m_idealGas) { - getConcentrations(c); - } else { - const vector_fp& vss = getStandardVolumes(); - switch (m_formGC) { - case 0: - for (size_t k = 0; k < m_kk; k++) { - c[k] = moleFraction(k); - } - break; - case 1: - for (size_t k = 0; k < m_kk; k++) { - c[k] = moleFraction(k) / vss[k]; - } - break; - case 2: - for (size_t k = 0; k < m_kk; k++) { - c[k] = moleFraction(k) / vss[0]; - } - break; + const vector_fp& vss = getStandardVolumes(); + switch (m_formGC) { + case 0: + for (size_t k = 0; k < m_kk; k++) { + c[k] = moleFraction(k); } + break; + case 1: + for (size_t k = 0; k < m_kk; k++) { + c[k] = moleFraction(k) / vss[k]; + } + break; + case 2: + for (size_t k = 0; k < m_kk; k++) { + c[k] = moleFraction(k) / vss[0]; + } + break; } } doublereal IdealSolnGasVPSS::standardConcentration(size_t k) const { - if (m_idealGas) { - return pressure() / RT(); - } else { - const vector_fp& vss = getStandardVolumes(); - switch (m_formGC) { - case 0: - return 1.0; - case 1: - return 1.0 / vss[k]; - case 2: - return 1.0/ vss[0]; - } - return 0.0; + const vector_fp& vss = getStandardVolumes(); + switch (m_formGC) { + case 0: + return 1.0; + case 1: + return 1.0 / vss[k]; + case 2: + return 1.0/ vss[0]; } + return 0.0; } void IdealSolnGasVPSS::getActivityCoefficients(doublereal* ac) const @@ -266,39 +236,13 @@ bool IdealSolnGasVPSS::addSpecies(shared_ptr spec) void IdealSolnGasVPSS::initThermo() { VPStandardStateTP::initThermo(); - if (m_input.hasKey("thermo")) { - const string& model = m_input["thermo"].asString(); - if (model == "ideal-solution-VPSS") { - setSolnMode(); - } else if (model == "ideal-gas-VPSS") { - setGasMode(); - } - } if (m_input.hasKey("standard-concentration-basis")) { setStandardConcentrationModel(m_input["standard-concentration-basis"].asString()); } - - if (m_idealGas == -1) { - throw CanteraError("IdealSolnGasVPSS::initThermo", - "solution / gas mode not set"); - } } void IdealSolnGasVPSS::initThermoXML(XML_Node& phaseNode, const std::string& id_) { - if (phaseNode.hasChild("thermo")) { - XML_Node& thermoNode = phaseNode.child("thermo"); - std::string model = thermoNode["model"]; - if (model == "IdealGasVPSS") { - setGasMode(); - } else if (model == "IdealSolnVPSS") { - setSolnMode(); - } else { - throw CanteraError("IdealSolnGasVPSS::initThermoXML", - "Unknown thermo model : " + model); - } - } - // Form of the standard concentrations. Must have one of: // // @@ -307,7 +251,7 @@ void IdealSolnGasVPSS::initThermoXML(XML_Node& phaseNode, const std::string& id_ if (phaseNode.hasChild("standardConc")) { XML_Node& scNode = phaseNode.child("standardConc"); setStandardConcentrationModel(scNode.attrib("model")); - } else if (!m_idealGas) { + } else { throw CanteraError("IdealSolnGasVPSS::initThermoXML", "Unspecified standardConc model"); } @@ -315,18 +259,4 @@ void IdealSolnGasVPSS::initThermoXML(XML_Node& phaseNode, const std::string& id_ VPStandardStateTP::initThermoXML(phaseNode, id_); } -void IdealSolnGasVPSS::setParametersFromXML(const XML_Node& thermoNode) -{ - VPStandardStateTP::setParametersFromXML(thermoNode); - std::string model = thermoNode["model"]; - if (model == "IdealGasVPSS") { - setGasMode(); - } else if (model == "IdealSolnVPSS") { - setSolnMode(); - } else { - throw CanteraError("IdealSolnGasVPSS::setParametersFromXML", - "Unknown thermo model : " + model); - } -} - } diff --git a/src/thermo/LatticePhase.cpp b/src/thermo/LatticePhase.cpp index 936c796db..7e5983fbe 100644 --- a/src/thermo/LatticePhase.cpp +++ b/src/thermo/LatticePhase.cpp @@ -253,9 +253,9 @@ bool LatticePhase::addSpecies(shared_ptr spec) } else if (eos.hasKey("molar-volume")) { mv = eos.convert("molar-volume", "m^3/kmol"); } - } else if (spec->extra.hasKey("molar_volume")) { - // from XML - mv = spec->extra["molar_volume"].asDouble(); + } else if (spec->input.hasKey("molar_volume")) { + // @Deprecated - remove this case for Cantera 3.0 with removal of the XML format + mv = spec->input["molar_volume"].asDouble(); } m_speciesMolarVolume.push_back(mv); } @@ -266,7 +266,8 @@ void LatticePhase::setSiteDensity(double sitedens) { m_site_density = sitedens; for (size_t k = 0; k < m_kk; k++) { - if (species(k)->extra.hasKey("molar_volume")) { + if (species(k)->input.hasKey("molar_volume")) { + // @Deprecated - remove this case for Cantera 3.0 with removal of the XML format continue; } else if (species(k)->input.hasKey("equation-of-state")) { auto& eos = species(k)->input["equation-of-state"].getMapWhere( diff --git a/src/thermo/MaskellSolidSolnPhase.cpp b/src/thermo/MaskellSolidSolnPhase.cpp index 639438ac4..32403fedd 100644 --- a/src/thermo/MaskellSolidSolnPhase.cpp +++ b/src/thermo/MaskellSolidSolnPhase.cpp @@ -59,21 +59,6 @@ doublereal MaskellSolidSolnPhase::entropy_mole() const // Mechanical Equation of State -void MaskellSolidSolnPhase::setDensity(const doublereal rho) -{ - // Unless the input density is exactly equal to the density calculated and - // stored in the State object, we throw an exception. This is because the - // density is NOT an independent variable. - warn_deprecated("MaskellSolidSolnPhase::setDensity", - "Overloaded function to be removed after Cantera 2.5. " - "Error will be thrown by Phase::setDensity instead"); - double dens = density(); - if (rho != dens) { - throw CanteraError("MaskellSolidSolnPhase::setDensity", - "Density is not an independent variable"); - } -} - void MaskellSolidSolnPhase::calcDensity() { const vector_fp& vbar = getStandardVolumes(); @@ -92,15 +77,6 @@ void MaskellSolidSolnPhase::setPressure(doublereal p) m_Pcurrent = p; } -void MaskellSolidSolnPhase::setMolarDensity(const doublereal n) -{ - warn_deprecated("MaskellSolidSolnPhase::setMolarDensity", - "Overloaded function to be removed after Cantera 2.5. " - "Error will be thrown by Phase::setMolarDensity instead"); - throw CanteraError("MaskellSolidSolnPhase::setMolarDensity", - "Density is not an independent variable"); -} - // Chemical Potentials and Activities void MaskellSolidSolnPhase::getActivityCoefficients(doublereal* ac) const diff --git a/src/thermo/PDSS_SSVol.cpp b/src/thermo/PDSS_SSVol.cpp index bc690b79a..9297cd38e 100644 --- a/src/thermo/PDSS_SSVol.cpp +++ b/src/thermo/PDSS_SSVol.cpp @@ -173,19 +173,6 @@ void PDSS_SSVol::setState_TP(doublereal temp, doublereal pres) setTemperature(temp); } -void PDSS_SSVol::setState_TR(doublereal temp, doublereal rho) -{ - setTemperature(temp); - warn_deprecated("PDSS_SSVol::setState_TR", - "Setter only changes temperature and " - "will be removed after Cantera 2.5."); - doublereal rhoStored = m_mw / m_Vss; - if (fabs(rhoStored - rho) / (rhoStored + rho) > 1.0E-4) { - throw CanteraError("PDSS_SSVol::setState_TR", - "Inconsistent supplied rho"); - } -} - doublereal PDSS_SSVol::satPressure(doublereal t) { return 1.0E-200; diff --git a/src/thermo/Phase.cpp b/src/thermo/Phase.cpp index 03ed524c5..b36033bb3 100644 --- a/src/thermo/Phase.cpp +++ b/src/thermo/Phase.cpp @@ -66,21 +66,6 @@ void Phase::setXMLdata(XML_Node& xmlPhase) } } -std::string Phase::id() const -{ - warn_deprecated("Phase::id", - "To be removed after Cantera 2.5. Usage merged with 'Phase::name'"); - return m_id; -} - -void Phase::setID(const std::string& id_) -{ - warn_deprecated("Phase::setID", - "To be removed after Cantera 2.5. Usage merged with 'Phase::setName'"); - m_id = id_; - m_name = id_; -} - std::string Phase::name() const { return m_name; @@ -208,21 +193,6 @@ size_t Phase::speciesIndex(const std::string& nameStr) const } else if (!m_caseSensitiveSpecies) { loc = findSpeciesLower(nameStr); } - if (loc == npos && nameStr.find(':') != npos) { - std::string pn; - std::string sn = parseSpeciesName(nameStr, pn); - if (pn == "" || pn == m_name || pn == m_id) { - warn_deprecated("Phase::speciesIndex", - "Retrieval of species indices via 'PhaseId:speciesName' or " - "'phaseName:speciesName' to be removed after Cantera 2.5."); - it = m_speciesIndices.find(nameStr); - if (it != m_speciesIndices.end()) { - return it->second; - } else if (!m_caseSensitiveSpecies) { - return findSpeciesLower(sn); - } - } - } return loc; } diff --git a/src/thermo/Species.cpp b/src/thermo/Species.cpp index 2c692fff7..eb43f5190 100644 --- a/src/thermo/Species.cpp +++ b/src/thermo/Species.cpp @@ -70,7 +70,7 @@ shared_ptr newSpecies(const XML_Node& species_node) // Extra data optionally used by LatticePhase const XML_Node* stdstate = species_node.findByName("standardState"); if (stdstate && stdstate->findByName("molarVolume")) { - s->extra["molar_volume"] = getFloat(*stdstate, "molarVolume", "toSI"); + s->input["molar_volume"] = getFloat(*stdstate, "molarVolume", "toSI"); } // Extra data possibly used by IonsFromNeutralVPSSTP diff --git a/src/thermo/ThermoFactory.cpp b/src/thermo/ThermoFactory.cpp index 183209590..f1a4c52a9 100644 --- a/src/thermo/ThermoFactory.cpp +++ b/src/thermo/ThermoFactory.cpp @@ -23,12 +23,10 @@ #include "cantera/thermo/IonsFromNeutralVPSSTP.h" #include "cantera/thermo/PureFluidPhase.h" #include "cantera/thermo/RedlichKwongMFTP.h" -#include "cantera/thermo/ConstDensityThermo.h" #include "cantera/thermo/SurfPhase.h" #include "cantera/thermo/EdgePhase.h" #include "cantera/thermo/MetalPhase.h" #include "cantera/thermo/StoichSubstance.h" -#include "cantera/thermo/FixedChemPotSSTP.h" #include "cantera/thermo/LatticeSolidPhase.h" #include "cantera/thermo/LatticePhase.h" #include "cantera/thermo/HMWSoln.h" @@ -51,8 +49,6 @@ ThermoFactory::ThermoFactory() { reg("ideal-gas", []() { return new IdealGasPhase(); }); addAlias("ideal-gas", "IdealGas"); - reg("constant-density", []() { return new ConstDensityThermo(); }); - addAlias("constant-density", "Incompressible"); reg("ideal-surface", []() { return new SurfPhase(); }); addAlias("ideal-surface", "Surface"); reg("edge", []() { return new EdgePhase(); }); @@ -82,8 +78,6 @@ ThermoFactory::ThermoFactory() reg("Margules", []() { return new MargulesVPSSTP(); }); reg("ions-from-neutral-molecule", []() { return new IonsFromNeutralVPSSTP(); }); addAlias("ions-from-neutral-molecule", "IonsFromNeutralMolecule"); - reg("fixed-chemical-potential", []() { return new FixedChemPotSSTP(); }); - addAlias("fixed-chemical-potential", "FixedChemPot"); reg("Redlich-Kister", []() { return new RedlichKisterVPSSTP(); }); reg("Redlich-Kwong", []() { return new RedlichKwongMFTP(); }); addAlias("Redlich-Kwong", "RedlichKwongMFTP"); diff --git a/src/transport/HighPressureGasTransport.cpp b/src/transport/HighPressureGasTransport.cpp index 1170399c7..71d11b332 100644 --- a/src/transport/HighPressureGasTransport.cpp +++ b/src/transport/HighPressureGasTransport.cpp @@ -16,7 +16,6 @@ #include "cantera/transport/HighPressureGasTransport.h" #include "cantera/numerics/ctlapack.h" #include "cantera/base/utilities.h" -#include "cantera/transport/TransportParams.h" #include "cantera/thermo/IdealGasPhase.h" #include "cantera/transport/TransportFactory.h" #include "cantera/base/stringUtils.h" diff --git a/src/transport/TransportFactory.cpp b/src/transport/TransportFactory.cpp index d7b58c120..93d3e7cb4 100644 --- a/src/transport/TransportFactory.cpp +++ b/src/transport/TransportFactory.cpp @@ -25,23 +25,6 @@ TransportFactory* TransportFactory::s_factory = 0; // declaration of static storage for the mutex std::mutex TransportFactory::transport_mutex; -//! Exception thrown if an error is encountered while reading the transport database -//! @deprecated Unused. To be removed after Cantera 2.5. -class TransportDBError : public CanteraError -{ -public: - //! Default constructor - /*! - * @param linenum inputs the line number - * @param msg String message to be sent to the user - */ - TransportDBError(size_t linenum, const std::string& msg) : - CanteraError("getTransportData", "error reading transport data: " + msg + "\n") { - warn_deprecated("class TransportDBError", - "Unused. To be removed after Cantera 2.5."); - } -}; - //////////////////// class TransportFactory methods ////////////// TransportFactory::TransportFactory() @@ -76,12 +59,8 @@ void TransportFactory::deleteFactory() } Transport* TransportFactory::newTransport(const std::string& transportModel, - thermo_t* phase, int log_level, int ndim) + thermo_t* phase, int log_level) { - if (ndim != -99) { - warn_deprecated("TransportFactory::newTransport", "The 'ndim' parameter" - " is unused and will be removed after Cantera 2.5."); - } vector_fp state; Transport* tr = 0; phase->saveState(state); @@ -114,10 +93,10 @@ Transport* TransportFactory::newTransport(thermo_t* phase, int log_level) return newTransport(transportModel, phase,log_level); } -Transport* newTransportMgr(const std::string& transportModel, thermo_t* thermo, int loglevel, int ndim) +Transport* newTransportMgr(const std::string& transportModel, thermo_t* thermo, int loglevel) { TransportFactory* f = TransportFactory::factory(); - return f->newTransport(transportModel, thermo, loglevel, ndim); + return f->newTransport(transportModel, thermo, loglevel); } Transport* newDefaultTransportMgr(thermo_t* thermo, int loglevel) diff --git a/src/transport/TransportParams.cpp b/src/transport/TransportParams.cpp deleted file mode 100644 index 7f131f798..000000000 --- a/src/transport/TransportParams.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @file TransportParams.cpp - * Class that holds the data that is read in from the XML file, and which is used for - * processing of the transport object - * (see \ref tranprops and \link Cantera::TransportParams TransportParams \endlink). - */ - -// This file is part of Cantera. See License.txt in the top-level directory or -// at https://cantera.org/license.txt for license and copyright information. - -#include "cantera/transport/TransportParams.h" - -using namespace std; - -namespace Cantera -{ - -TransportParams::TransportParams() : - nsp_(0), - thermo(0), - mw(0), - velocityBasis_(VB_MASSAVG), - tmax(1000000.), - tmin(10.), - mode_(0), - log_level(-1) -{ - warn_deprecated("class TransportParams", - "Unused. To be removed after Cantera 2.5"); -} - -} // End of namespace Cantera diff --git a/src/zeroD/FlowDevice.cpp b/src/zeroD/FlowDevice.cpp index 11ed774d1..662e6d22f 100644 --- a/src/zeroD/FlowDevice.cpp +++ b/src/zeroD/FlowDevice.cpp @@ -11,8 +11,7 @@ namespace Cantera { FlowDevice::FlowDevice() : m_mdot(Undef), m_pfunc(0), m_tfunc(0), - m_coeff(1.0), m_type(0), - m_nspin(0), m_nspout(0), + m_coeff(1.0), m_nspin(0), m_nspout(0), m_in(0), m_out(0) {} bool FlowDevice::install(ReactorBase& in, ReactorBase& out) diff --git a/src/zeroD/FlowDeviceFactory.cpp b/src/zeroD/FlowDeviceFactory.cpp index 5d2743db8..4050b873e 100644 --- a/src/zeroD/FlowDeviceFactory.cpp +++ b/src/zeroD/FlowDeviceFactory.cpp @@ -18,11 +18,6 @@ FlowDeviceFactory::FlowDeviceFactory() reg("MassFlowController", []() { return new MassFlowController(); }); reg("PressureController", []() { return new PressureController(); }); reg("Valve", []() { return new Valve(); }); - - // only used by clib - reg_type("MassFlowController", MFC_Type); - reg_type("PressureController", PressureController_Type); - reg_type("Valve", Valve_Type); } FlowDevice* FlowDeviceFactory::newFlowDevice(const std::string& flowDeviceType) @@ -30,14 +25,4 @@ FlowDevice* FlowDeviceFactory::newFlowDevice(const std::string& flowDeviceType) return create(flowDeviceType); } -FlowDevice* FlowDeviceFactory::newFlowDevice(int ir) -{ - try { - return create(m_types.at(ir)); - } catch (out_of_range&) { - throw CanteraError("FlowDeviceFactory::newFlowDevice", - "unknown flowDevice type!"); - } -} - } diff --git a/src/zeroD/ReactorFactory.cpp b/src/zeroD/ReactorFactory.cpp index 771ece1bc..14459d60d 100644 --- a/src/zeroD/ReactorFactory.cpp +++ b/src/zeroD/ReactorFactory.cpp @@ -28,14 +28,6 @@ ReactorFactory::ReactorFactory() reg("FlowReactor", []() { return new FlowReactor(); }); reg("IdealGasReactor", []() { return new IdealGasReactor(); }); reg("IdealGasConstPressureReactor", []() { return new IdealGasConstPressureReactor(); }); - - // only used by clib - reg_type("Reservoir", ReservoirType); - reg_type("Reactor", ReactorType); - reg_type("ConstPressureReactor", ConstPressureReactorType); - reg_type("FlowReactor", FlowReactorType); - reg_type("IdealGasReactor", IdealGasReactorType); - reg_type("IdealGasConstPressureReactor", IdealGasConstPressureReactorType); } ReactorBase* ReactorFactory::newReactor(const std::string& reactorType) @@ -43,14 +35,4 @@ ReactorBase* ReactorFactory::newReactor(const std::string& reactorType) return create(reactorType); } -ReactorBase* ReactorFactory::newReactor(int ir) -{ - try { - return create(m_types.at(ir)); - } catch (out_of_range&) { - throw CanteraError("ReactorFactory::newReactor", - "unknown reactor type!"); - } -} - } diff --git a/src/zeroD/ReactorNet.cpp b/src/zeroD/ReactorNet.cpp index e51627c71..d48a15623 100644 --- a/src/zeroD/ReactorNet.cpp +++ b/src/zeroD/ReactorNet.cpp @@ -90,7 +90,7 @@ void ReactorNet::initialize() writelog("Reactor {:d}: {:d} variables.\n", n, nv); writelog(" {:d} sensitivity params.\n", r.nSensParams()); } - if (r.typeStr() == "FlowReactor" && m_reactors.size() > 1) { + if (r.type() == "FlowReactor" && m_reactors.size() > 1) { throw CanteraError("ReactorNet::initialize", "FlowReactors must be used alone."); } diff --git a/src/zeroD/WallFactory.cpp b/src/zeroD/WallFactory.cpp index decac1b0b..8bb623fc7 100644 --- a/src/zeroD/WallFactory.cpp +++ b/src/zeroD/WallFactory.cpp @@ -16,9 +16,6 @@ std::mutex WallFactory::wall_mutex; WallFactory::WallFactory() { reg("Wall", []() { return new Wall(); }); - - // only used by clib - reg_type("Wall", WallType); } WallBase* WallFactory::newWall(const std::string& wallType) @@ -26,14 +23,4 @@ WallBase* WallFactory::newWall(const std::string& wallType) return create(wallType); } -WallBase* WallFactory::newWall(int ir) -{ - try { - return create(m_types.at(ir)); - } catch (out_of_range&) { - throw CanteraError("WallFactory::newWall", - "unknown wall type!"); - } -} - } diff --git a/src/zeroD/flowControllers.cpp b/src/zeroD/flowControllers.cpp index f40188195..d4d4b5c8e 100644 --- a/src/zeroD/flowControllers.cpp +++ b/src/zeroD/flowControllers.cpp @@ -11,7 +11,6 @@ namespace Cantera { MassFlowController::MassFlowController() : FlowDevice() { - m_type = MFC_Type; } void MassFlowController::setMassFlowRate(double mdot) @@ -36,7 +35,6 @@ void MassFlowController::updateMassFlowRate(double time) } PressureController::PressureController() : FlowDevice(), m_master(0) { - m_type = PressureController_Type; } void PressureController::updateMassFlowRate(double time) @@ -58,7 +56,6 @@ void PressureController::updateMassFlowRate(double time) } Valve::Valve() : FlowDevice() { - m_type = Valve_Type; } void Valve::updateMassFlowRate(double time) diff --git a/test/data/LiFixed.xml b/test/data/LiFixed.xml deleted file mode 100644 index 2b117a1e2..000000000 --- a/test/data/LiFixed.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - Li - - - LiFixed - - - -2.3E7 - - - - - - - - - - Li:1 - - - diff --git a/test/data/pdss_hkft.xml b/test/data/pdss_hkft.xml index 39b9e6444..bacb26536 100644 --- a/test/data/pdss_hkft.xml +++ b/test/data/pdss_hkft.xml @@ -1,23 +1,6 @@ - - - - Na Cl H O - - - H2O(L) Na+ Cl- H+ OH- - - - - - - Na Cl H O diff --git a/test/data/thermo-models.yaml b/test/data/thermo-models.yaml index bd5c91856..7c1f998ce 100644 --- a/test/data/thermo-models.yaml +++ b/test/data/thermo-models.yaml @@ -15,12 +15,6 @@ phases: transport: water species: [H2O(l)] -# @todo Remove after Cantera 2.5 - class FixedChemPotSSTP is deprecated -- name: Li-fixed - thermo: fixed-chemical-potential - species: [Li] - chemical-potential: -2.3e7 J/kmol - - name: molten-salt-Margules thermo: Margules species: [KCl(l), LiCl(l)] @@ -94,13 +88,6 @@ 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]}] - state: {T: 400, P: 5 atm, X: {H2: 0.01, O2: 0.99}} - - name: IdealSolnGas-liquid thermo: ideal-solution-VPSS standard-concentration-basis: unity @@ -188,12 +175,6 @@ phases: pure-fluid-name: carbondioxide state: {T: 275, vapor-fraction: 0.1} -- name: const-density - thermo: constant-density - density: 0.7 g/cm^3 - species: [NaCl(s), KCl(s)] - state: {T: 320, P: 1 atm} - - name: IdealSolidSolnPhase thermo: ideal-condensed standard-concentration-basis: unity @@ -264,9 +245,6 @@ species: - name: H2O(l) composition: {H: 2, O: 1} -- name: Li - composition: {Li: 1} - - name: KCl(l) composition: {K: 1, Cl: 1} thermo: diff --git a/test/general/test_containers.cpp b/test/general/test_containers.cpp index ec95d9b15..24695b026 100644 --- a/test/general/test_containers.cpp +++ b/test/general/test_containers.cpp @@ -372,11 +372,3 @@ TEST(AnyMap, missingKeyAt) EXPECT_THAT(ex.what(), ::testing::HasSubstr("Key 'spam' not found")); } } - -TEST(AnyMap, loadDeprecatedYaml) -{ - // The deprecation warning in this file is turned into an - // error by make_deprecation_warnings_fatal() called in main() - // for the test suite. - EXPECT_THROW(AnyMap::fromYamlFile("argon.yaml"), CanteraError); -} diff --git a/test/thermo/phaseConstructors.cpp b/test/thermo/phaseConstructors.cpp index c4c68b59e..19e0c21bb 100644 --- a/test/thermo/phaseConstructors.cpp +++ b/test/thermo/phaseConstructors.cpp @@ -4,7 +4,6 @@ #include "cantera/thermo/PDSS_ConstVol.h" #include "cantera/thermo/PDSS_Water.h" #include "cantera/thermo/PDSS_SSVol.h" -#include "cantera/thermo/FixedChemPotSSTP.h" #include "cantera/thermo/PureFluidPhase.h" #include "cantera/thermo/WaterSSTP.h" #include "cantera/thermo/RedlichKwongMFTP.h" @@ -77,32 +76,6 @@ shared_ptr make_const_cp_species(const std::string& name, return species; } -//! @todo Remove after Cantera 2.5 - class FixedChemPotSSTP is deprecated -class FixedChemPotSstpConstructorTest : public testing::Test -{ -}; - -TEST_F(FixedChemPotSstpConstructorTest, fromXML) -{ - suppress_deprecation_warnings(); - std::unique_ptr p(newPhase("../data/LiFixed.xml")); - ASSERT_EQ((int) p->nSpecies(), 1); - double mu; - p->getChemPotentials(&mu); - ASSERT_DOUBLE_EQ(-2.3e7, mu); - make_deprecation_warnings_fatal(); -} - -TEST_F(FixedChemPotSstpConstructorTest, SimpleConstructor) -{ - suppress_deprecation_warnings(); - FixedChemPotSSTP p("Li", -2.3e7); - ASSERT_EQ((int) p.nSpecies(), 1); - double mu; - p.getChemPotentials(&mu); - ASSERT_DOUBLE_EQ(-2.3e7, mu); - make_deprecation_warnings_fatal(); -} TEST(IonsFromNeutralConstructor, fromXML) { @@ -348,35 +321,6 @@ 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); - p.addSpecies(sO2); - std::unique_ptr pH2O(newPDSS("ideal-gas")); - std::unique_ptr pH2(newPDSS("ideal-gas")); - std::unique_ptr pO2(newPDSS("ideal-gas")); - p.installPDSS(0, std::move(pH2O)); - p.installPDSS(1, std::move(pH2)); - p.installPDSS(2, std::move(pO2)); - - p.setGasMode(); - EXPECT_THROW(p.setStandardConcentrationModel("unity"), CanteraError); - p.initThermo(); - - p.setState_TPX(400, 5*OneAtm, "H2:0.01, O2:0.99"); - p.equilibrate("HP"); - - 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) { PureFluidPhase p; @@ -527,7 +471,7 @@ TEST(LatticeSolidPhase, fromScratch) interstital->setName("Li7Si3_Interstitial"); auto sLii = make_const_cp_species("Li(i)", "Li:1", 298.15, 0, 2e4, 2e4); auto sVac = make_const_cp_species("V(i)", "", 298.15, 8.98e4, 0, 0); - sLii->extra["molar_volume"] = 0.2; + sLii->input["molar_volume"] = 0.2; interstital->setSiteDensity(10.46344); interstital->addSpecies(sLii); interstital->addSpecies(sVac); @@ -561,11 +505,11 @@ TEST(IdealSolidSolnPhase, fromScratch) // Regression test based fictitious XML input file IdealSolidSolnPhase p; auto sp1 = make_species("sp1", "C:2, H:2", o2_nasa_coeffs); - sp1->extra["molar_volume"] = 1.5; + sp1->input["molar_volume"] = 1.5; auto sp2 = make_species("sp2", "C:1", h2o_nasa_coeffs); - sp2->extra["molar_volume"] = 1.3; + sp2->input["molar_volume"] = 1.3; auto sp3 = make_species("sp3", "H:2", h2_nasa_coeffs); - sp3->extra["molar_volume"] = 0.1; + sp3->input["molar_volume"] = 0.1; for (auto& s : {sp1, sp2, sp3}) { p.addSpecies(s); } @@ -749,7 +693,6 @@ TEST(PDSS_SSVol, fromScratch) 62.8859}; auto sLi = make_shomate2_species("Li(L)", "Li:1", coeffs); p.addSpecies(sLi); - p.setSolnMode(); p.setStandardConcentrationModel("unity"); std::unique_ptr ss(new PDSS_SSVol()); double rho_coeffs[] = {536.504, -1.04279e-1, 3.84825e-6, -5.2853e-9}; diff --git a/test/thermo/thermoFromYaml.cpp b/test/thermo/thermoFromYaml.cpp index b3f3a3024..77c2260df 100644 --- a/test/thermo/thermoFromYaml.cpp +++ b/test/thermo/thermoFromYaml.cpp @@ -120,18 +120,6 @@ TEST(ThermoFromYaml, WaterSSTP) EXPECT_NEAR(thermo->enthalpy_mass(), -15649685.52296013, 1e-6); } -//! @todo Remove after Cantera 2.5 - class FixedChemPotSSTP is deprecated -TEST(ThermoFromYaml, FixedChemPot) -{ - suppress_deprecation_warnings(); - auto thermo = newThermo("thermo-models.yaml", "Li-fixed"); - EXPECT_EQ(thermo->nSpecies(), (size_t) 1); - double mu; - thermo->getChemPotentials(&mu); - EXPECT_DOUBLE_EQ(mu, -2.3e7); - make_deprecation_warnings_fatal(); -} - TEST(ThermoFromYaml, Margules) { auto thermo = newThermo("thermo-models.yaml", "molten-salt-Margules"); @@ -237,19 +225,6 @@ 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); - EXPECT_NEAR(thermo->moleFraction("H2"), 0.0, 1e-4); -} - TEST(ThermoFromYaml, IdealSolnGas_liquid) { auto thermo = newThermo("thermo-models.yaml", "IdealSolnGas-liquid"); @@ -384,14 +359,6 @@ TEST(ThermoFromYaml, PureFluid_Unknown) EXPECT_THROW(newPhase(phase, root), CanteraError); } -TEST(ThermoFromYaml, ConstDensityThermo) -{ - suppress_deprecation_warnings(); - auto thermo = newThermo("thermo-models.yaml", "const-density"); - EXPECT_DOUBLE_EQ(thermo->density(), 700.0); - make_deprecation_warnings_fatal(); -} - TEST(ThermoFromYaml, IdealSolidSolnPhase) { auto thermo = newThermo("thermo-models.yaml", "IdealSolidSolnPhase"); @@ -464,11 +431,3 @@ TEST(ThermoFromYaml, BinarySolutionTabulatedThermo) thermo->setMoleFractionsByName("Li[anode]: 0.55, V[anode]: 0.45"); EXPECT_NEAR(thermo->gibbs_mass(), -87066.246182649265, 1e-9); } - -TEST(ThermoFromYaml, DeprecatedPhase) -{ - // The deprecation warning in this file is turned into an - // error by make_deprecation_warnings_fatal() called in main() - // for the test suite. - EXPECT_THROW(newThermo("gri30.yaml", "gri30_mix"), CanteraError); -} diff --git a/test_problems/.gitignore b/test_problems/.gitignore index a460b83a4..9eef52347 100644 --- a/test_problems/.gitignore +++ b/test_problems/.gitignore @@ -15,7 +15,6 @@ VCSnonideal/NaCl_equil/vcs_equilibrate_res.csv VCSnonideal/LatticeSolid_LiSi/latticeSolid_LiSi VCSnonideal/LatticeSolid_LiSi/latsol VCSnonideal/LatticeSolid_LiSi/vcs_equilibrate_res.csv -VPsilane_test/VPsilane_test cathermo/DH_graph_1/DH_graph_1 cathermo/DH_graph_1/DH_graph_1.log cathermo/HMW_dupl_test/HMW_dupl_test diff --git a/test_problems/SConscript b/test_problems/SConscript index f49b0bc56..416713538 100644 --- a/test_problems/SConscript +++ b/test_problems/SConscript @@ -219,7 +219,6 @@ vcs_LiSi = CompileAndTest('VCS-LiSi', 'VCSnonideal/LatticeSolid_LiSi', 'latsol', Test('VCS-LiSi-verbose', 'VCSnonideal/LatticeSolid_LiSi', vcs_LiSi.program, 'verbose_blessed.txt', options='8', artifacts=['vcs_equilibrate_res.csv']) -CompileAndTest('VPsilane_test') CompileAndTest('clib', 'clib_test', 'clib_test', extensions=['^clib_test.c'], libs=['cantera_shared']) diff --git a/test_problems/VCSnonideal/LatticeSolid_LiSi/latsol.cpp b/test_problems/VCSnonideal/LatticeSolid_LiSi/latsol.cpp index 5e3360620..9b004257d 100644 --- a/test_problems/VCSnonideal/LatticeSolid_LiSi/latsol.cpp +++ b/test_problems/VCSnonideal/LatticeSolid_LiSi/latsol.cpp @@ -1,6 +1,5 @@ #include "cantera/thermo.h" #include "cantera/thermo/MargulesVPSSTP.h" -#include "cantera/thermo/FixedChemPotSSTP.h" #include "cantera/thermo/LatticeSolidPhase.h" #include "cantera/thermo/ConstCpPoly.h" #include "cantera/equil/vcs_MultiPhaseEquil.h" diff --git a/test_problems/VPsilane_test/output_blessed.txt b/test_problems/VPsilane_test/output_blessed.txt deleted file mode 100644 index 427b4364d..000000000 --- a/test_problems/VPsilane_test/output_blessed.txt +++ /dev/null @@ -1,65 +0,0 @@ -CanteraWarning: NasaPoly2::validate: -For species SI2H6, discontinuity in h/RT detected at Tmid = 1000.0 - Value computed using low-temperature polynomial: 19.832788750000002 - Value computed using high-temperature polynomial: 19.905538027666665 - -CanteraWarning: NasaPoly2::validate: -For species SI2H6, discontinuity in s/R detected at Tmid = 1000.0 - Value computed using low-temperature polynomial: 49.54934633430382 - Value computed using high-temperature polynomial: 49.72144349849784 - -CanteraWarning: NasaPoly2::validate: -For species SI3H8, discontinuity in h/RT detected at Tmid = 1000.0 - Value computed using low-temperature polynomial: 29.302814743333336 - Value computed using high-temperature polynomial: 29.429734298666666 - -CanteraWarning: NasaPoly2::validate: -For species SI3H8, discontinuity in s/R detected at Tmid = 1000.0 - Value computed using low-temperature polynomial: 65.97306778810605 - Value computed using high-temperature polynomial: 66.2781011692102 - -CanteraWarning: NasaPoly2::validate: -For species SI2, discontinuity in h/RT detected at Tmid = 1000.0 - Value computed using low-temperature polynomial: 74.01147672 - Value computed using high-temperature polynomial: 74.0386547703 - -CanteraWarning: NasaPoly2::validate: -For species SI2, discontinuity in s/R detected at Tmid = 1000.0 - Value computed using low-temperature polynomial: 32.881299760183126 - Value computed using high-temperature polynomial: 32.94888061232226 - - - silane: - - temperature 1500 K - pressure 100 Pa - density 1.8315e-05 kg/m^3 - mean mol. weight 2.2842 kg/kmol - phase of matter gas - - 1 kg 1 kmol - --------------- --------------- - enthalpy 1.7016e+07 3.8868e+07 J - internal energy 1.1556e+07 2.6397e+07 J - entropy 1.0386e+05 2.3724e+05 J/K - Gibbs function -1.3878e+08 -3.1699e+08 J - heat capacity c_p 14161 32347 J/K - heat capacity c_v 10521 24032 J/K - - mass frac. Y mole frac. X chem. pot. / RT - --------------- --------------- --------------- - H2 0.87852 0.99539 -25.528 - H 0.00024677 0.00055919 -12.764 - HE 0 0 - SIH4 1.4819e-06 1.0539e-07 -50.984 - SI 0.012968 0.0010547 0.071304 - SIH 0.00016057 1.2607e-05 -12.693 - SIH2 0.00015619 1.1852e-05 -25.456 - SIH3 1.6193e-06 1.189e-07 -38.22 - H3SISIH 1.8413e-10 6.9864e-12 -50.913 - SI2H6 4.5234e-13 1.6606e-14 -76.441 - H2SISIH2 4.7016e-09 1.7839e-10 -50.913 - SI3H8 2.8219e-19 6.982e-21 -101.9 - SI2 0.0029603 0.00012038 0.14261 - SI3 0.10498 0.0028461 0.21391 - diff --git a/test_problems/VPsilane_test/silane.xml b/test_problems/VPsilane_test/silane.xml deleted file mode 100644 index 5080f93a1..000000000 --- a/test_problems/VPsilane_test/silane.xml +++ /dev/null @@ -1,496 +0,0 @@ - - - - - Si H He - - H2 H HE SIH4 SI SIH SIH2 SIH3 H3SISIH SI2H6 - H2SISIH2 SI3H8 SI2 SI3 - - - - - - - - - - - - H:2 - - - - 2.344331120E+00, 7.980520750E-03, -1.947815100E-05, 2.015720940E-08, - -7.376117610E-12, -9.179351730E+02, 6.830102380E-01 - - - - 3.337279200E+00, -4.940247310E-05, 4.994567780E-07, -1.795663940E-10, - 2.002553760E-14, -9.501589220E+02, -3.205023310E+00 - - - - - - - H:1 - - - - 2.500000000E+00, 7.053328190E-13, -1.995919640E-15, 2.300816320E-18, - -9.277323320E-22, 2.547365990E+04, -4.466828530E-01 - - - - 2.500000010E+00, -2.308429730E-11, 1.615619480E-14, -4.735152350E-18, - 4.981973570E-22, 2.547365990E+04, -4.466829140E-01 - - - - - - - He:1 - - - - 2.500000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, - 0.000000000E+00, -7.453750000E+02, 9.153488000E-01 - - - - 2.500000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, - 0.000000000E+00, -7.453750000E+02, 9.153489000E-01 - - - - - - - H:4 Si:1 - - - - 1.451640400E+00, 1.398736300E-02, -4.234563900E-06, -2.360614200E-09, - 1.371208900E-12, 3.113410500E+03, 1.232185500E+01 - - - - 7.935938000E-01, 1.767189900E-02, -1.139800900E-05, 3.599260400E-09, - -4.524157100E-13, 3.198212700E+03, 1.524225700E+01 - - - - - - - Si:1 - - - - 3.179353700E+00, -2.764699200E-03, 4.478403800E-06, -3.283317700E-09, - 9.121363100E-13, 5.333903200E+04, 2.727320400E+00 - - - - 2.650601400E+00, -3.576385200E-04, 2.959229300E-07, -7.280482900E-11, - 5.796332900E-15, 5.343705400E+04, 5.220405700E+00 - - - - - - - H:1 Si:1 - - - - 3.836010000E+00, -2.702657000E-03, 6.849070000E-06, -5.424184000E-09, - 1.472131000E-12, 4.507593000E+04, 9.350778000E-01 - - - - 3.110430000E+00, 1.094946000E-03, 2.898629000E-08, -2.745104000E-10, - 7.051799000E-14, 4.516898000E+04, 4.193487000E+00 - - - - - - - H:2 Si:1 - - - - 3.475092000E+00, 2.139338000E-03, 7.672306000E-07, 5.217668000E-10, - -9.898824000E-13, 3.147397000E+04, 4.436585000E+00 - - - - 4.142390000E+00, 2.150191000E-03, -2.190730000E-07, -2.073725000E-10, - 4.741018000E-14, 3.110484000E+04, 2.930745000E-01 - - - - - - - H:3 Si:1 - - - - 2.946733000E+00, 6.466764000E-03, 5.991653000E-07, -2.218413000E-09, - 3.052670000E-13, 2.270173000E+04, 7.347948000E+00 - - - - 5.015906000E+00, 3.732750000E-03, -3.609053000E-07, -3.729193000E-10, - 8.468490000E-14, 2.190233000E+04, -4.291368000E+00 - - - - - - - H:4 Si:2 - - - - 3.698707000E+00, 1.870180000E-02, -1.430704000E-05, 6.005836000E-09, - -1.116293000E-12, 3.590825000E+04, 8.825191000E+00 - - - - 1.127202000E+01, 2.538145000E-03, -2.998472000E-07, -9.465367000E-11, - 1.855053000E-14, 3.297169000E+04, -3.264598000E+01 - - - - - - - H:6 Si:2 - - - - 6.734798300E-01, 4.093153100E-02, -4.484125500E-05, 2.995223200E-08, - -8.901085400E-12, 7.932787500E+03, 1.862740300E+01 - - - - 3.407493600E+00, 2.720647900E-02, -1.771320400E-05, 5.639117700E-09, - -7.137868200E-13, 7.532184200E+03, 6.132175400E+00 - - - - - - - H:4 Si:2 - - - - 5.133186000E+00, 1.252855000E-02, -4.620421000E-07, -6.606075000E-09, - 2.864345000E-12, 2.956915000E+04, 7.605133000E-01 - - - - 8.986817000E+00, 5.405047000E-03, -5.214022000E-07, -5.313742000E-10, - 1.188727000E-13, 2.832748000E+04, -2.004478000E+01 - - - - - - - H:8 Si:3 - - - - 7.719684600E-01, 6.344274000E-02, -7.672610900E-05, 5.454371500E-08, - -1.661172900E-11, 1.207126300E+04, 2.153250700E+01 - - - - 6.093334100E+00, 3.658011200E-02, -2.389236100E-05, 7.627193200E-09, - -9.676938400E-13, 1.129720500E+04, -2.747565400E+00 - - - - - - - Si:2 - - - - 2.967197600E+00, 6.311955800E-03, -1.097079000E-05, 8.927868000E-09, - -2.787368900E-12, 6.987073800E+04, 9.278950300E+00 - - - - 4.144677900E+00, 6.523467700E-04, -5.010852000E-07, 1.806284300E-10, - -2.516111100E-14, 6.969470700E+04, 3.862736600E+00 - - - - - - - Si:3 - - - - 4.597912900E+00, 1.071527400E-02, -1.610042200E-05, 1.096920700E-08, - -2.783287500E-12, 7.476632400E+04, 3.442167100E+00 - - - - 7.421336000E+00, -1.170994800E-04, 8.982077500E-08, 7.193596400E-12, - -2.567083700E-15, 7.414669900E+04, -1.036527400E+01 - - - - - - - - - SIH4 + H [=] SIH3 + H2 - - - 7.800000E+14 - 0 - 2260.000000 - - - SIH4:1 H:1 - H2:1 SIH3:1 - - - - - SIH4 + M [=] SIH3 + H + M - - - 3.910000E+15 - 0 - 89356.000000 - - - SIH4:1 - H:1 SIH3:1 - - - - - SIH3 + H [=] SIH2 + H2 - - - 7.800000E+14 - 0 - 2260.000000 - - - H:1 SIH3:1 - H2:1 SIH2:1 - - - - - SI + SI + M [=] SI2 + M - - - 2.470000E+16 - 0 - 1178.000000 - - - SI:2 - SI2:1 - - - - - SIH4 + SIH2 [=] H3SISIH + H2 - - - 1.300000E+13 - 0 - 0.000000 - - - SIH4:1 SIH2:1 - H2:1 H3SISIH:1 - - - - - SIH + H2 [=] SIH2 + H - - - 4.800000E+14 - 0 - 23.640000 - - - H2:1 SIH:1 - H:1 SIH2:1 - - - - - SIH + SIH4 [=] H3SISIH + H - - - 1.600000E+14 - 0 - 0.000000 - - - SIH4:1 SIH:1 - H:1 H3SISIH:1 - - - - - SI + H2 [=] SIH + H - - - 1.500000E+15 - 0 - 31.800000 - - - H2:1 SI:1 - H:1 SIH:1 - - - - - SIH4 (+ M) [=] SIH2 + H2 (+ M) - - - 3.119000E+09 - 1.669 - 54710.000000 - - - 5.214000E+29 - -3.5449999999999999 - 57550.000000 - - SI2H6:4 SIH4:4 - -0.4984 888.3 209.4 2760 - - SIH4:1 - H2:1 SIH2:1 - - - - - H3SISIH (+ M) [=] H2SISIH2 (+ M) - - - 2.540000E+13 - -0.22389999999999999 - 5381.000000 - - - 1.099000E+33 - -5.7649999999999997 - 9152.000000 - - SI2H6:4 SIH4:4 - -0.4202 214.5 103 136.3 - - H3SISIH:1 - H2SISIH2:1 - - - - - SI3H8 (+ M) [=] SIH4 + H3SISIH (+ M) - - - 3.730000E+12 - 0.99199999999999999 - 50850.000000 - - - 4.360000E+76 - -17.260000000000002 - 59303.000000 - - SI2H6:4 SIH4:4 - 0.4157 365.3 3102 9.724 - - SI3H8:1 - SIH4:1 H3SISIH:1 - - - - - SI3H8 (+ M) [=] SIH2 + SI2H6 (+ M) - - - 6.970000E+12 - 0.96909999999999996 - 52677.000000 - - - 1.730000E+69 - -15.07 - 60491.000000 - - SI2H6:4 SIH4:4 - -3.47e-05 442 2412 128.3 - - SI3H8:1 - SI2H6:1 SIH2:1 - - - - - SI2H6 (+ M) [=] H2 + H3SISIH (+ M) - - - 9.086000E+09 - 1.8340000000000001 - 54197.000000 - - - 1.945000E+44 - -7.7720000000000002 - 59023.000000 - - SI2H6:4 SIH4:4 - -0.1224 793.3 2400 11.39 - - SI2H6:1 - H2:1 H3SISIH:1 - - - - - SI2H6 (+ M) [=] SIH4 + SIH2 (+ M) - - - 1.810000E+10 - 1.7470000000000001 - 50203.000000 - - - 5.090000E+53 - -10.369999999999999 - 56034.000000 - - SI2H6:4 SIH4:4 - 4.375e-05 438.5 2726 438.2 - - SI2H6:1 - SIH4:1 SIH2:1 - - - diff --git a/test_problems/VPsilane_test/silane_equil.cpp b/test_problems/VPsilane_test/silane_equil.cpp deleted file mode 100644 index 98f0be48a..000000000 --- a/test_problems/VPsilane_test/silane_equil.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// This file is part of Cantera. See License.txt in the top-level directory or -// at https://cantera.org/license.txt for license and copyright information. - -#include "cantera/thermo/IdealSolnGasVPSS.h" -#include "cantera/thermo/ThermoFactory.h" - -#include - -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); - g->setState_TPX(1500.0, 100.0, "SIH4:0.01, H2:0.99"); - g->equilibrate("TP"); - cout << g->report(true, 0.0) << endl; - return 0; - } catch (CanteraError& err) { - std::cerr << err.what() << std::endl; - cerr << "program terminating." << endl; - return -1; - } -} diff --git a/test_problems/clib_test/clib_test.c b/test_problems/clib_test/clib_test.c index 24cb1a6a3..0294fa6fa 100644 --- a/test_problems/clib_test/clib_test.c +++ b/test_problems/clib_test/clib_test.c @@ -72,7 +72,7 @@ int main(int argc, char** argv) assert(ret == 0); printf("\ntime Temperature\n"); - int reactor = reactor_new2("IdealGasReactor"); + int reactor = reactor_new("IdealGasReactor"); int net = reactornet_new(); ret = reactor_setThermoMgr(reactor, thermo); assert(ret == 0); diff --git a/test_problems/surfSolverTest/surfaceSolver.cpp b/test_problems/surfSolverTest/surfaceSolver.cpp index c34d009b9..5bc9d5e7b 100644 --- a/test_problems/surfSolverTest/surfaceSolver.cpp +++ b/test_problems/surfSolverTest/surfaceSolver.cpp @@ -70,7 +70,7 @@ void printBulk(ostream& oooo, double x[MSSIZE]; double C[MSSIZE]; oooo.precision(3); - string bulkParticlePhaseName = bulkPhaseTP->id(); + string bulkParticlePhaseName = bulkPhaseTP->name(); bulkPhaseTP->getMoleFractions(x); bulkPhaseTP->getConcentrations(C); size_t kstart = iKin_ptr->kineticsSpeciesIndex(0, 1); @@ -113,7 +113,7 @@ void printSurf(ostream& oooo, ThermoPhase* surfPhaseTP, InterfaceKinetics* iKin_ptr, double* src) { double x[MSSIZE]; - string surfParticlePhaseName = surfPhaseTP->id(); + string surfParticlePhaseName = surfPhaseTP->name(); surfPhaseTP->getMoleFractions(x); size_t kstart = iKin_ptr->kineticsSpeciesIndex(0, 2); oooo << "Surface Phase: " << surfParticlePhaseName diff --git a/test_problems/surfSolverTest/surfaceSolver2.cpp b/test_problems/surfSolverTest/surfaceSolver2.cpp index 60746964f..26589cbd5 100644 --- a/test_problems/surfSolverTest/surfaceSolver2.cpp +++ b/test_problems/surfSolverTest/surfaceSolver2.cpp @@ -71,7 +71,7 @@ void printBulk(ostream& oooo,ThermoPhase* bulkPhaseTP, InterfaceKinetics* iKin_p double x[MSSIZE]; double C[MSSIZE]; oooo.precision(3); - string bulkParticlePhaseName = bulkPhaseTP->id(); + string bulkParticlePhaseName = bulkPhaseTP->name(); bulkPhaseTP->getMoleFractions(x); bulkPhaseTP->getConcentrations(C); size_t kstart = iKin_ptr->kineticsSpeciesIndex(0, 1); @@ -114,7 +114,7 @@ void printSurf(ostream& oooo, ThermoPhase* surfPhaseTP, { double x[MSSIZE]; oooo.precision(3); - string surfParticlePhaseName = surfPhaseTP->id(); + string surfParticlePhaseName = surfPhaseTP->name(); surfPhaseTP->getMoleFractions(x); size_t kstart = iKin_ptr->kineticsSpeciesIndex(0, 2); oooo << "Surface Phase: " << surfParticlePhaseName @@ -255,7 +255,7 @@ int main(int argc, char** argv) // (this is a made up problem btw to check the software capability) ThermoPhase* surfPhaseTP2 = newPhase(*xs); size_t nsp2 = surfPhaseTP2->nSpecies(); - string pname = surfPhaseTP2->id(); + string pname = surfPhaseTP2->name(); cout << "Number of species in 2nd surface phase, " << pname << " = " << nsp2 << endl;