mirror of
https://github.com/Cantera/cantera.git
synced 2025-02-25 18:55:29 -06:00
Remove deprecated code marked for removal after Cantera 2.5
This commit is contained in:
committed by
Bryan W. Weber
parent
aae64d9b7b
commit
daf7d4d575
@@ -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'],
|
||||
|
||||
@@ -35,9 +35,6 @@ Phases of Matter
|
||||
.. autoclass:: metal
|
||||
:no-undoc-members:
|
||||
|
||||
.. autoclass:: incompressible_solid
|
||||
:no-undoc-members:
|
||||
|
||||
.. autoclass:: lattice
|
||||
:no-undoc-members:
|
||||
|
||||
|
||||
@@ -65,11 +65,9 @@ and optionally reactions that can take place in that phase. The fields of a
|
||||
- :ref:`constant-density <sec-yaml-constant-density>`
|
||||
- :ref:`Debye-Huckel <sec-yaml-Debye-Huckel>`
|
||||
- :ref:`edge <sec-yaml-edge>`
|
||||
- :ref:`fixed-chemical-potential <sec-yaml-fixed-chemical-potential>`
|
||||
- :ref:`fixed-stoichiometry <sec-yaml-fixed-stoichiometry>`
|
||||
- :ref:`HMW-electrolyte <sec-yaml-HMW-electrolyte>`
|
||||
- :ref:`ideal-gas <sec-yaml-ideal-gas>`
|
||||
- :ref:`ideal-gas-VPSS <sec-yaml-ideal-gas-VPSS>`
|
||||
- :ref:`ideal-molal-solution <sec-yaml-ideal-molal-solution>`
|
||||
- :ref:`ideal-condensed <sec-yaml-ideal-condensed>`
|
||||
- :ref:`ideal-solution-VPSS <sec-yaml-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 <https://cantera.org/documentation/dev/doxygen/html/d6/db0/classCantera_1_1FixedChemPotSSTP.html#details>`__.
|
||||
|
||||
.. 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 <https://cantera.org/documentation/dev/doxygen/html/d7/dfa/classCantera_1_1IdealGasPhase.html#details>`__.
|
||||
|
||||
.. _sec-yaml-ideal-gas-VPSS:
|
||||
|
||||
``ideal-gas-VPSS``
|
||||
------------------
|
||||
|
||||
The ideal gas model, using variable pressure standard state methods as
|
||||
`described here <https://cantera.org/documentation/dev/doxygen/html/dc/ddb/classCantera_1_1IdealSolnGasVPSS.html#details>`__.
|
||||
|
||||
.. deprecated:: 2.5
|
||||
Use the ``ideal-gas`` model instead.
|
||||
|
||||
|
||||
.. _sec-yaml-ideal-molal-solution:
|
||||
|
||||
|
||||
@@ -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<ThermoPhase*> 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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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<ThermoPhase*> 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<ThermoPhase*> phases)
|
||||
{
|
||||
warn_deprecated("importInterface", "To be removed after Cantera 2.5. "
|
||||
"Replaceable with Solution.");
|
||||
return new Interface(infile, id, phases);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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<class T> struct timesConstant : public std::unary_function<T, double> {
|
||||
//! 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<class InputIter, class OutputIter>
|
||||
*
|
||||
* 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<class InputIter, class OutputIter>
|
||||
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<class InputIter>
|
||||
*
|
||||
* 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<class InputIter>
|
||||
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<class InputIter, class OutputIter>
|
||||
*
|
||||
* 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<class InputIter, class OutputIter>
|
||||
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<class InputIter, class OutputIter>
|
||||
*
|
||||
* 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<class InputIter, class OutputIter>
|
||||
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<class InputIter, class OutputIter>
|
||||
*
|
||||
* @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<class InputIter, class OutputIter>
|
||||
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<class InputIter, class OutputIter, class IndexIter>
|
||||
*
|
||||
* 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<class InputIter, class OutputIter, class IndexIter>
|
||||
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<class InputIter, class RandAccessIter, class IndexIter>
|
||||
*
|
||||
* 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<class InputIter, class RandAccessIter, class IndexIter>
|
||||
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<class InputIter>
|
||||
*
|
||||
* 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<class InputIter>
|
||||
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<class InputIter1, class InputIter2>
|
||||
*
|
||||
* 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<class InputIter1, class InputIter2>
|
||||
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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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<Falloff> newFalloff(int type, const vector_fp& c);
|
||||
|
||||
//! @copydoc FalloffFactory::newFalloff
|
||||
shared_ptr<Falloff> newFalloff(const std::string& type, const vector_fp& c);
|
||||
|
||||
|
||||
@@ -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<size_t> 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<size_t> m_ctrxn_BVform;
|
||||
|
||||
//! Vector of booleans indicating whether the charge transfer reaction rate constant
|
||||
//! is described by an exchange current density rate constant expression
|
||||
/*!
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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() {}
|
||||
|
||||
|
||||
@@ -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;
|
||||
//@}
|
||||
}
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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<Species> 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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
* <?xml version="1.0"?>
|
||||
* <ctml>
|
||||
* <validate reactions="yes" species="yes"/>
|
||||
*
|
||||
* <!-- phase NaCl(S) -->
|
||||
* <phase dim="3" id="LiFixed">
|
||||
* <elementArray datasrc="elements.xml">
|
||||
* Li
|
||||
* </elementArray>
|
||||
* <speciesArray datasrc="#species_Li(Fixed)">
|
||||
* LiFixed
|
||||
* </speciesArray>
|
||||
* <thermo model="FixedChemPot">
|
||||
* <chemicalPotential units="J/kmol"> -2.3E7 </chemicalPotential>
|
||||
* </thermo>
|
||||
* <transport model="None"/>
|
||||
* <kinetics model="none"/>
|
||||
* </phase>
|
||||
*
|
||||
* <!-- species definitions -->
|
||||
* <speciesData id="species_Li(Fixed)">
|
||||
* <species name="LiFixed">
|
||||
* <atomArray> Li:1 </atomArray>
|
||||
* <thermo>
|
||||
* <Shomate Pref="1 bar" Tmax="1075.0" Tmin="250.0">
|
||||
* <floatArray size="7">
|
||||
* 50.72389, 6.672267, -2.517167,
|
||||
* 10.15934, -0.200675, -427.2115,
|
||||
* 130.3973
|
||||
* </floatArray>
|
||||
* </Shomate>
|
||||
* </thermo>
|
||||
* </species>
|
||||
* </speciesData>
|
||||
* </ctml>
|
||||
* @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
|
||||
* <phase id="stoichsolid" >
|
||||
* <thermo model="FixedChemPot">
|
||||
* <chemicalPotential units="J/kmol"> -2.7E7 </chemicalPotential>
|
||||
* </thermo>
|
||||
* </phase>
|
||||
* @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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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<Species> 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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
//@}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -54,10 +54,6 @@ public:
|
||||
//! Thermodynamic data for the species
|
||||
shared_ptr<SpeciesThermoInterpType> 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;
|
||||
};
|
||||
|
||||
@@ -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.
|
||||
/*!
|
||||
|
||||
@@ -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
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<int, std::string> m_types;
|
||||
|
||||
private:
|
||||
static FlowDeviceFactory* s_factory;
|
||||
static std::mutex flowDevice_mutex;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<int, std::string> m_types;
|
||||
|
||||
private:
|
||||
static ReactorFactory* s_factory;
|
||||
static std::mutex reactor_mutex;
|
||||
|
||||
@@ -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) {}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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<int, std::string> m_types;
|
||||
|
||||
private:
|
||||
static WallFactory* s_factory;
|
||||
static std::mutex wall_mutex;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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):
|
||||
"""
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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):
|
||||
(<CxxValve*>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):
|
||||
(<CxxPressureController*>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)
|
||||
(<CxxPressureController*>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
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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'):
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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_);
|
||||
}
|
||||
|
||||
@@ -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<int, std::string> 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<Falloff> newFalloff(int type, const vector_fp& c)
|
||||
{
|
||||
shared_ptr<Falloff> f(FalloffFactory::factory()->newFalloff(type, c));
|
||||
return f;
|
||||
}
|
||||
|
||||
shared_ptr<Falloff> newFalloff(const std::string& type, const vector_fp& c)
|
||||
{
|
||||
shared_ptr<Falloff> f(FalloffFactory::factory()->newFalloff(type, c));
|
||||
|
||||
@@ -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<Reaction> 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()) {
|
||||
|
||||
@@ -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 <orders> node
|
||||
if (rxn_node.hasChild("orders")) {
|
||||
Composition orders = parseCompString(rxn_node.child("orders").value());
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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") {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<Species> 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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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<Species>(pname, parseCompString(Ename + ":1.0"));
|
||||
double c[4] = {298.15, val, 0.0, 0.0};
|
||||
shared_ptr<SpeciesThermoInterpType> 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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<Species> 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<Species> 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;
|
||||
|
||||
@@ -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<Species> 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:
|
||||
//
|
||||
// <standardConc model="unity" />
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -253,9 +253,9 @@ bool LatticePhase::addSpecies(shared_ptr<Species> 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(
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ shared_ptr<Species> 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
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
@@ -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)
|
||||
|
||||
@@ -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!");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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!");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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.");
|
||||
}
|
||||
|
||||
@@ -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!");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<ctml>
|
||||
<validate reactions="yes" species="yes"/>
|
||||
|
||||
<phase dim="3" id="LiFixed">
|
||||
<elementArray datasrc="elements.xml">
|
||||
Li
|
||||
</elementArray>
|
||||
<speciesArray datasrc="#species_Li(Fixed)">
|
||||
LiFixed
|
||||
</speciesArray>
|
||||
<thermo model="FixedChemPot">
|
||||
<chemicalPotential units="J/kmol"> -2.3E7 </chemicalPotential>
|
||||
</thermo>
|
||||
<transport model="None"/>
|
||||
<kinetics model="none"/>
|
||||
</phase>
|
||||
|
||||
<!-- species definitions -->
|
||||
<speciesData id="species_Li(Fixed)">
|
||||
|
||||
<species name="LiFixed">
|
||||
<atomArray> Li:1 </atomArray>
|
||||
</species>
|
||||
</speciesData>
|
||||
</ctml>
|
||||
@@ -1,23 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<ctml>
|
||||
<validate reaction="yes" species="yes"/>
|
||||
<!-- Clearly, using an IdealGas-type phase is not appropriate
|
||||
for a liquid water solvent. However, it seems to load
|
||||
correctly and I needed a place to test the conversion of
|
||||
these phase thermo types so \shrug
|
||||
-->
|
||||
<phase dim="3" id="vpss_gas_pdss_hkft_phase">
|
||||
<elementArray datasrc="elements.xml">
|
||||
Na Cl H O
|
||||
</elementArray>
|
||||
<speciesArray datasrc="#species_data">
|
||||
H2O(L) Na+ Cl- H+ OH-
|
||||
</speciesArray>
|
||||
<thermo model="IdealGasVPSS"/>
|
||||
<transport model="None"/>
|
||||
<kinetics model="none"/>
|
||||
</phase>
|
||||
|
||||
<phase dim="3" id="vpss_soln_pdss_hkft_phase">
|
||||
<elementArray datasrc="elements.xml">
|
||||
Na Cl H O
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user