diff --git a/include/cantera/Interface.h b/include/cantera/Interface.h index be4d991d5..325e21404 100644 --- a/include/cantera/Interface.h +++ b/include/cantera/Interface.h @@ -57,24 +57,6 @@ public: m_ok = true; } - Interface(const Interface& ii) : - SurfPhase(ii), - InterfaceKinetics(ii), - m_ok(ii.m_ok), - m_r(ii.m_r) { - } - - Interface& operator=(const Interface& right) { - if (this == &right) { - return *this; - } - SurfPhase::operator=(right); - InterfaceKinetics::operator=(right); - m_ok = right.m_ok; - m_r = right.m_r; - return *this; - } - //! Not operator bool operator!() { return !m_ok; diff --git a/include/cantera/base/Array.h b/include/cantera/base/Array.h index 26fd75bd7..3ab47cbe5 100644 --- a/include/cantera/base/Array.h +++ b/include/cantera/base/Array.h @@ -194,28 +194,6 @@ public: } } - //! Evaluate z = a*x + y. - /*! - * This function evaluates the AXPY operation, and stores the result in the - * object's Array2D object. It's assumed that all 3 objects have the same - * dimensions, but no error checking is done. - * - * @param a scalar to multiply x with - * @param x First Array2D object to be used - * @param y Second Array2D object to be used - * @deprecated Unused. To be removed after Cantera 2.3. - */ - void axpy(doublereal a, const Array2D& x, const Array2D& y) { - warn_deprecated("Array2D::axpy", - "Unused. To be removed after Cantera 2.3."); - auto b = begin(); - auto xb = x.begin(); - auto yb = y.begin(); - for (; b != end(); ++b, ++xb, ++yb) { - *b = a*(*xb) + *yb; - } - } - //! Set all of the entries to zero void zero() { m_data.assign(m_data.size(), 0.0); diff --git a/include/cantera/base/ctexceptions.h b/include/cantera/base/ctexceptions.h index 51b924cce..adce3296b 100644 --- a/include/cantera/base/ctexceptions.h +++ b/include/cantera/base/ctexceptions.h @@ -94,10 +94,6 @@ public: //! Get a description of the error const char* what() const throw(); - //! Function to put this error onto Cantera's error stack - //! @deprecated Unused. To be removed after Cantera 2.3. - void save(); - //! Method overridden by derived classes to format the error message virtual std::string getMessage() const; diff --git a/include/cantera/base/ctml.h b/include/cantera/base/ctml.h index 75c6344d9..2b74a2656 100644 --- a/include/cantera/base/ctml.h +++ b/include/cantera/base/ctml.h @@ -18,51 +18,6 @@ namespace Cantera { class Array2D; -//! const Specifying the CTML version number -/*! - * @deprecated Unused. To be removed after Cantera 2.3. - */ -const std::string CTML_Version = "1.4.1"; - -//! This function adds a child node with the name, "integer", with a value -//! consisting of a single integer -/*! - * This function will add a child node to the current XML node, with the name - * "integer". It will have a title attribute, and the body of the XML node will - * be filled out with a single integer - * - * Example: - * - * @code - * const XML_Node &node; - * std::string titleString = "maxIterations"; - * int value = 1000; - * std::string typeString = "optional"; - * std::string units = ""; - * addInteger(node, titleString, value, typeString, units); - * @endcode - * - * Creates the following the snippet in the XML file: - * - * - * - * 100 - * <\integer> - * <\parentNode> - * - * @param node reference to the XML_Node object of the parent XML element - * @param titleString String name of the title attribute - * @param value Value - single integer - * @param unitsString String name of the Units attribute. The default is to - * have an empty string. - * @param typeString String type. This is an optional parameter. The default - * is to have an empty string. - * @deprecated Unused. to be removed after Cantera 2.3. - */ -void addInteger(XML_Node& node, const std::string& titleString, - const int value, const std::string& unitsString="", - const std::string& typeString=""); - //! This function adds a child node with the name, "float", with a value //! consisting of a single floating point number /*! @@ -543,43 +498,6 @@ bool getOptionalFloat(const XML_Node& parent, const std::string& name, */ int getInteger(const XML_Node& parent, const std::string& name); -//! Get a floating-point value from a child element with a defined units field -/*! - * Returns a doublereal value for the child named 'name' of element 'parent'. - * 'type' must be supplied and match a known unit type. Note, it's an error - * for the child element not to exist. - * - * Example: - * - * @code - * const XML_Node &State_XMLNode; - * doublereal pres = OneAtm; - * if (state_XMLNode.hasChild("pressure")) { - * pres = getFloatDefaultUnits(State_XMLNode, "pressure", "Pa", "toSI"); - * } - * @endcode - * - * reads the corresponding XML file: - * - * - * 101325.0 - * <\state> - * - * @param parent reference to the XML_Node object of the parent XML element - * @param name Name of the XML child element - * @param defaultUnits Default units string to be found in the units attribute. - * If the units string in the XML field is equal to defaultUnits, - * no units conversion will be carried out. - * @param type String type. Currently known types are "toSI" and "actEnergy", - * and "" , for no conversion. The default value is "", - * which implies that no conversion is allowed. - * @deprecated Use getFloat and toSI directly. To be removed after Cantera 2.3. - */ -doublereal getFloatDefaultUnits(const XML_Node& parent, - const std::string& name, - const std::string& defaultUnits, - const std::string& type="toSI"); - //! Get an optional model name from a named child node. /*! * Returns the model name attribute for the child named 'nodeName' of element diff --git a/include/cantera/base/global.h b/include/cantera/base/global.h index 140026d21..fb3531b36 100644 --- a/include/cantera/base/global.h +++ b/include/cantera/base/global.h @@ -28,35 +28,6 @@ namespace Cantera class XML_Node; class Logger; - - -//! Return the number of errors that have been encountered so far -/*! - * @ingroup errorhandling - * @deprecated Unused. To be removed after Cantera 2.3. - */ -int nErrors(); - -//! @copydoc Application::Messages::lastErrorMessage -//! @deprecated Unused. To be removed after Cantera 2.3. -std::string lastErrorMessage(); - -//! @copydoc Application::Messages::addError -//! @deprecated Unused. To be removed after Cantera 2.3. -void setError(const std::string& r, const std::string& msg); - -//! @copydoc Application::Messages::getErrors -//! @deprecated Unused. To be removed after Cantera 2.3. -void showErrors(std::ostream& f); - -//! @copydoc Application::Messages::logErrors -//! @deprecated Unused. To be removed after Cantera 2.3. -void showErrors(); - -//! @copydoc Application::Messages::popError -//! @deprecated Unused. To be removed after Cantera 2.3. -void popError(); - /*! * @defgroup inputfiles Input File Handling * diff --git a/include/cantera/base/stringUtils.h b/include/cantera/base/stringUtils.h index 2f98df716..0063c39d7 100644 --- a/include/cantera/base/stringUtils.h +++ b/include/cantera/base/stringUtils.h @@ -20,29 +20,6 @@ namespace Cantera namespace ba = boost::algorithm; -//! Convert a double into a c++ string -/*! - * @param x double to be converted - * @param fmt Format to be used (printf style) - * @deprecated Unused. To be removed after Cantera 2.3. Use fmt::format instead - */ -std::string fp2str(const double x, const std::string& fmt="%g"); - -//! Convert an int to a string using a format converter -/*! - * @param n int to be converted - * @param fmt format converter for an int int the printf command - * @deprecated Unused. To be removed after Cantera 2.3. Use fmt::format instead - */ -std::string int2str(const int n, const std::string& fmt="%d"); - -//! Convert an unsigned integer to a string -/*! - * @param n int to be converted - * @deprecated Unused. To be removed after Cantera 2.3. Use fmt::format instead - */ -std::string int2str(const size_t n); - //! Convert a vector to a string (separated by commas) /*! * @param v vector to be converted @@ -52,16 +29,6 @@ std::string int2str(const size_t n); std::string vec2str(const vector_fp& v, const std::string& fmt="%g", const std::string& sep=", "); -//! Strip the leading and trailing white space from a string -/*! - * The command isprint() is used to determine printable characters. - * - * @param s Input string - * @returns a copy of the string, stripped of leading and trailing white space - * @deprecated Use `boost::algorithm::trim_copy` instead - */ -std::string stripws(const std::string& s); - //! Strip non-printing characters wherever they are /*! * @param s Input string @@ -69,15 +36,6 @@ std::string stripws(const std::string& s); */ std::string stripnonprint(const std::string& s); -//! Cast a copy of a string to lower case -/*! - * @param s Input string - * @returns a copy of the string, with all characters lowercase. - * @deprecated Use boost::algorithm::to_lower_copy instead. To be removed after - * Cantera 2.3. - */ -std::string lowercase(const std::string& s); - //! Parse a composition string into a map consisting of individual //! key:composition pairs. /*! @@ -161,15 +119,6 @@ doublereal fpValueCheck(const std::string& val); */ std::string parseSpeciesName(const std::string& nameStr, std::string& phaseName); -//! Line wrap a string via a copy operation -/*! - * @param s Input string to be line wrapped - * @param len Length at which to wrap. The default is 70. - * @deprecated Unused. To be removed after Cantera 2.3. - */ -std::string wrapString(const std::string& s, - const int len=70); - //! Interpret one or two token string as a single double /*! * This is similar to atof(). However, the second token is interpreted as an diff --git a/include/cantera/base/utilities.h b/include/cantera/base/utilities.h index 20f6290a2..8c3d6da24 100644 --- a/include/cantera/base/utilities.h +++ b/include/cantera/base/utilities.h @@ -481,37 +481,6 @@ R poly3(D x, R* c) return (((c[3]*x + c[2])*x + c[1])*x + c[0]); } -//! Templated deep copy of a std vector of pointers -/*! - * Performs a deep copy of a std vectors of pointers to an object. This template - * assumes that that the templated object has a functioning copy constructor. - * - * @param fromVec Vector of pointers to a templated class. This will be - * deep-copied to the other vector - * @param toVec Vector of pointers to a templated class. This will be - * overwritten and on return will be a copy of the fromVec - * @deprecated Used only in deprecated code. To be removed after Cantera 2.3. - */ -template -void deepStdVectorPointerCopy(const std::vector &fromVec, std::vector &toVec) -{ - warn_deprecated("deepStdVectorPointerCopy", "Used only in deprecated code." - " To be removed after Cantera 2.3."); - size_t is = toVec.size(); - for (size_t i = 0; i < is; i++) { - delete toVec[i]; - } - is = fromVec.size(); - toVec.resize(is); - for (size_t i = 0; i < is; i++) { - if (fromVec[i]) { - toVec[i] = new D(*fromVec[i]); - } else { - toVec[i] = 0; - } - } -} - //@} //! Check to see that a number is finite (not NaN, +Inf or -Inf) @@ -526,29 +495,10 @@ void checkFinite(const double tmp); */ void checkFinite(const std::string& name, double* values, size_t N); -//! Const accessor for a value in a std::map. -/*! - * This is a const alternative to operator[]. Roughly equivalent to the 'at' - * member function introduced in C++11. Throws std::out_of_range if the key - * does not exist. - * @deprecated Use `map.at(key)` instead. To be removed after Cantera 2.3. - */ -template -const U& getValue(const std::map& m, const T& key) { - warn_deprecated("getValue(map, key)", - "Use map.at(key) instead. To be removed after Cantera 2.3."); - typename std::map::const_iterator iter = m.find(key); - if (iter == m.end()) { - throw std::out_of_range("std::map: key not found"); - } else { - return iter->second; - } -} - //! Const accessor for a value in a std::map. /* - * Similar to the two-argument version of getValue, but returns *default_val* - * if the key is not found instead of throwing an exception. + * Similar to std::map.at(key), but returns *default_val* if the key is not + * found instead of throwing an exception. */ template const U& getValue(const std::map& m, const T& key, const U& default_val) { diff --git a/include/cantera/clib/ct.h b/include/cantera/clib/ct.h index bc2bb75f1..596ed8809 100644 --- a/include/cantera/clib/ct.h +++ b/include/cantera/clib/ct.h @@ -50,7 +50,7 @@ extern "C" { CANTERA_CAPI int thermo_print(int nth, int show_thermo, double threshold); CANTERA_CAPI double thermo_nAtoms(int n, size_t k, size_t m); CANTERA_CAPI int thermo_addElement(int n, const char* name, double weight); - CANTERA_CAPI int thermo_eosType(int n); + CANTERA_CAPI int thermo_getEosType(int n, size_t leneos, char* eos); CANTERA_CAPI double thermo_refPressure(int n); CANTERA_CAPI double thermo_minTemp(int n, int k); CANTERA_CAPI double thermo_maxTemp(int n, int k); @@ -131,7 +131,7 @@ extern "C" { CANTERA_CAPI int kin_setMultiplier(int n, int i, double v); CANTERA_CAPI int kin_isReversible(int n, int i); - CANTERA_CAPI int kin_type(int n); + CANTERA_CAPI int kin_getType(int n, size_t len, char* name); CANTERA_CAPI size_t kin_start(int n, int p); CANTERA_CAPI size_t kin_speciesIndex(int n, const char* nm, const char* ph); CANTERA_CAPI int kin_advanceCoverages(int n, double tstep); diff --git a/include/cantera/clib/ctreactor.h b/include/cantera/clib/ctreactor.h index 8fcea2b84..7bcbc37b3 100644 --- a/include/cantera/clib/ctreactor.h +++ b/include/cantera/clib/ctreactor.h @@ -41,7 +41,7 @@ extern "C" { CANTERA_CAPI int reactornet_setSensitivityTolerances(int i, double rtol, double atol); CANTERA_CAPI int reactornet_addreactor(int i, int n); CANTERA_CAPI int reactornet_advance(int i, double t); - CANTERA_CAPI double reactornet_step(int i, double t); + CANTERA_CAPI double reactornet_step(int i); CANTERA_CAPI double reactornet_time(int i); CANTERA_CAPI double reactornet_rtol(int i); CANTERA_CAPI double reactornet_atol(int i); @@ -59,7 +59,6 @@ extern "C" { CANTERA_CAPI int wall_new(int type); CANTERA_CAPI int wall_del(int i); CANTERA_CAPI int wall_install(int i, int n, int m); - CANTERA_CAPI int wall_setkinetics(int i, int n, int m); CANTERA_CAPI double wall_vdot(int i, double t); CANTERA_CAPI double wall_Q(int i, double t); CANTERA_CAPI double wall_area(int i); diff --git a/include/cantera/electrolyteThermo.h b/include/cantera/electrolyteThermo.h deleted file mode 100644 index 2aa2e78f1..000000000 --- a/include/cantera/electrolyteThermo.h +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @file electrolyteThermo.h - * - * Support for thermo property calculation from C++ application programs. - * This header file includes several headers from the Cantera kernel needed - * to evaluate thermo properties. - * @deprecated To be removed after Cantera 2.3. Include relevant headers directly. - */ - -#ifndef CT_ELECTROLYTETHERMO_INCL -#define CT_ELECTROLYTETHERMO_INCL - -#pragma message "Deprecated. electrolyteThermo.h will be removed after Cantera 2.3. Include relevant headers directly." - -#include "thermo/electrolytes.h" -#include "thermo/MolalityVPSSTP.h" -#include "thermo/VPStandardStateTP.h" -#include "thermo/IdealMolalSoln.h" -#include "thermo/WaterPropsIAPWS.h" -#include "thermo/WaterProps.h" -#include "thermo/PDSS.h" -#include "thermo/PDSS_Water.h" -#include "thermo/PDSS_HKFT.h" -#include "thermo/HMWSoln.h" -#include "thermo/DebyeHuckel.h" -#include "thermo/WaterSSTP.h" -#include "thermo/VPSSMgr_Water_HKFT.h" -#include "thermo/VPSSMgr_Water_ConstVol.h" - -#endif diff --git a/include/cantera/equil/vcs_MultiPhaseEquil.h b/include/cantera/equil/vcs_MultiPhaseEquil.h index a550edf1b..2ca4e52a4 100644 --- a/include/cantera/equil/vcs_MultiPhaseEquil.h +++ b/include/cantera/equil/vcs_MultiPhaseEquil.h @@ -76,33 +76,6 @@ public: virtual ~vcs_MultiPhaseEquil() {} - //! Return the index of the ith component - /*! - * Returns the index of the ith component in the equilibrium calculation. - * The index refers to the ordering of the species in the MultiPhase object. - * - * @param m Index of the component. Must be between 0 and the number of - * components, which can be obtained from the numComponents() command. - * @deprecated Unused. To be removed after Cantera 2.3. - */ - size_t component(size_t m) const; - - //! Get the stoichiometric reaction coefficients for a single - //! reaction index - /*! - * This returns a stoichiometric reaction vector for a single formation - * reaction for a noncomponent species. There are (nSpecies() - nComponents) - * formation reactions. Each formation reaction will have a value of 1.0 for - * the species that is being formed, and the other non-zero coefficients - * will all involve the components of the mixture. - * - * @param rxn Reaction number. - * @param nu Vector of coefficients for the formation reaction. Length is - * equal to the number of species in the MultiPhase object. - * @deprecated Unused. To be removed after Cantera 2.3. - */ - void getStoichVector(size_t rxn, vector_fp& nu); - //! return the number of iterations int iterations() const { return m_iter; @@ -264,22 +237,6 @@ public: int printLvl = 0, doublereal err = 1.0E-6, int maxsteps = VCS_MAXSTEPS, int logLevel = -99); - //! Determine the phase stability of a phase at the current conditions - /*! - * Equilibration of the solution is not done before the determination is - * made. - * - * @param iph Phase number to determine the equilibrium. If the phase - * has a non-zero mole number.... - * @param funcStab Value of the phase pop function - * @param printLvl Determines the amount of printing that gets sent to - * stdout from the vcs package (Note, you may have to compile with debug - * flags to get some printing). - * @param logLevel Determines the amount of printing to the output file. - * @deprecated Broken and unused. To be removed after Cantera 2.3. - */ - int determine_PhaseStability(int iph, double& funcStab, int printLvl= 0, int logLevel = -99); - //! Report the equilibrium answer in a comma separated table format /*! * This routine is used for in the test suite. @@ -289,22 +246,6 @@ public: */ void reportCSV(const std::string& reportFile); - //! reports the number of components in the equilibration problem - /*! - * @returns the number of components. If an equilibrium - * problem hasn't been solved yet, it returns -1. - * @deprecated Unused. To be removed after Cantera 2.3. - */ - size_t numComponents() const; - - //! Reports the number of element constraints in the equilibration problem - /*! - * @returns the number of element constraints. If an equilibrium problem - * hasn't been solved yet, it returns -1. - * @deprecated Unused. To be removed after Cantera 2.3. - */ - size_t numElemConstraints() const; - // Friend functions friend int vcs_Cantera_to_vprob(MultiPhase* mphase, VCS_PROB* vprob); friend int vcs_Cantera_update_vprob(MultiPhase* mphase, VCS_PROB* vprob); @@ -370,16 +311,6 @@ protected: VCS_SOLVE m_vsolve; }; -//! Global hook for turning on and off time printing. -/*! - * Default is to allow printing. But, you can assign this to zero globally to - * turn off all time printing. This is helpful for test suite purposes where - * you are interested in differences in text files. - * @deprecated Call `VCS_SOLVE::disable_timing()` instead. To be removed after - * Cantera 2.3. - */ -extern int vcs_timing_print_lvl; - } #endif diff --git a/include/cantera/equil/vcs_VolPhase.h b/include/cantera/equil/vcs_VolPhase.h index a32e3a1e0..e70ecca48 100644 --- a/include/cantera/equil/vcs_VolPhase.h +++ b/include/cantera/equil/vcs_VolPhase.h @@ -103,17 +103,6 @@ public: void elemResize(const size_t numElemConstraints); - //! Evaluate activity coefficients and return the kspec coefficient - /*! - * We carry out a calculation whenever #m_UpToDate_AC is false. Specifically - * whenever a phase goes zero, we do not carry out calculations on it. - * - * @param kspec species number - * @deprecated Unused. To be removed after Cantera 2.3. - */ - double AC_calc_one(size_t kspec) const; - - //! Set the moles and/or mole fractions within the phase /*! * @param molNum total moles in the phase @@ -449,14 +438,6 @@ public: */ int elementType(const size_t e) const; - //! Set the element Type of the element constraint with index \c e. - /*! - * @param e Element index - * @param eType type of the element. - * @deprecated Unused. To be removed after Cantera 2.3. - */ - void setElementType(const size_t e, const int eType); - //! Transfer all of the element information from the ThermoPhase object to //! the vcs_VolPhase object. /*! @@ -843,14 +824,6 @@ private: double Pres_; }; -//! Return a string representing the equation of state -/*! - * @param EOSType : integer value of the equation of state - * @return a string representing the EOS. The string is no more than 16 characters. - * @deprecated Use vcs_VolPhase::eos_name instead. To be removed after Cantera 2.3. - */ -std::string string16_EOSType(int EOSType); - } #endif diff --git a/include/cantera/equil/vcs_prob.h b/include/cantera/equil/vcs_prob.h index 6553e2555..a5af778c1 100644 --- a/include/cantera/equil/vcs_prob.h +++ b/include/cantera/equil/vcs_prob.h @@ -190,30 +190,6 @@ public: ~VCS_PROB(); - //! Resizes all of the phase lists within the structure - /*! - * Note, this doesn't change the number of phases in the problem. It will - * change #NPHASE0 if `nPhase` is greater than #NPHASE0. - * - * @param nPhase size to dimension all the phase lists to - * @param force If true, this will dimension the size to be equal to - * `nPhase` even if `nPhase` is less than the current value of NPHASE0 - * @deprecated Unused. To be removed after Cantera 2.3. - */ - void resizePhase(size_t nPhase, int force); - - //! Resizes all of the species lists within the structure - /*! - * Note, this doesn't change the number of species in the problem. - * It will change #NSPECIES0 if `nsp` is greater than #NSPECIES0. - * - * @param nsp size to dimension all the species lists to - * @param force If true, this will dimension the size to be equal to `nsp` - * even if `nsp` is less than the current value of #NSPECIES0 - * @deprecated Unused. To be removed after Cantera 2.3. - */ - void resizeSpecies(size_t nsp, int force); - //! Resizes all of the element lists within the structure /*! * Note, this doesn't change the number of element constraints in the diff --git a/include/cantera/equil/vcs_solve.h b/include/cantera/equil/vcs_solve.h index a7765a851..596ccc49b 100644 --- a/include/cantera/equil/vcs_solve.h +++ b/include/cantera/equil/vcs_solve.h @@ -118,9 +118,6 @@ public: */ int vcs_solve_TP(int print_lvl, int printDetails, int maxit); - //! @deprecated Broken and unused. To be removed after Cantera 2.3. - int vcs_PS(VCS_PROB* vprob, int iph, int printLvl, double& feStable); - /*! * We make decisions on the initial mole number, and major-minor status * here. We also fix up the total moles in a phase. @@ -244,88 +241,6 @@ public: */ bool vcs_evaluate_speciesType(); - //! We calculate the dimensionless chemical potentials of all species - //! in a single phase. - /*! - * Note, for multispecies phases which are currently zeroed out, the - * chemical potential is filled out with the standard chemical potential. - * - * For species in multispecies phases whose concentration is zero, we need - * to set the mole fraction to a very low value. Its chemical potential is - * then calculated using the #VCS_DELETE_MINORSPECIES_CUTOFF concentration - * to keep numbers positive. - * - * # Formula: - * - * ## Ideal Mixtures: - * - * m_feSpecies(I) = m_SSfeSpecies(I) + ln(z(I)) - ln(m_tPhaseMoles[iph]) - * + m_chargeSpecies[I] * Faraday_dim * m_phasePhi[iphase]; - * - * (This is equivalent to the adding the log of the mole fraction onto - * the standard chemical potential. ) - * - * ## Non-Ideal Mixtures: - * - * ### ActivityConvention = 0: molarity activity formulation - * - * m_feSpecies(I) = m_SSfeSpecies(I) - * + ln(ActCoeff[I] * z(I)) - ln(m_tPhaseMoles[iph]) - * + m_chargeSpecies[I] * Faraday_dim * m_phasePhi[iphase]; - * - * (This is equivalent to the adding the log of the mole fraction multiplied - * by the activity coefficient onto the standard chemical potential.) - * - * ### ActivityConvention = 1: molality activity formulation - * - * m_feSpecies(I) = m_SSfeSpecies(I) - * + ln(ActCoeff[I] * z(I)) - ln(m_tPhaseMoles[iph]) - * - ln(Mnaught * m_units) - * + m_chargeSpecies[I] * Faraday_dim * m_phasePhi[iphase]; - * - * Note: `m_SSfeSpecies(I)` is the molality based standard state. However, - * `ActCoeff[I]` is the molar based activity coefficient We have used the - * formulas: - * - * ActCoeff_M[I] = ActCoeff[I] / Xmol[N] - * - * where `Xmol[N]` is the mole fraction of the solvent and `ActCoeff_M[I]` - * is the molality based act coeff. - * - * Note: This is equivalent to the "normal" molality formulation: - * - * m_feSpecies(I) = m_SSfeSpecies(I) - * + ln(ActCoeff_M[I] * m(I)) - * + m_chargeSpecies[I] * Faraday_dim * m_phasePhi[iphase] - * - * where `m[I]` is the molality of the ith solute - * - * m[I] = Xmol[I] / ( Xmol[N] * Mnaught * m_units) - * - * `z(I)/tPhMoles_ptr[iph] = Xmol[i]` is the mole fraction of i in the phase. - * - * NOTE: As per the discussion in vcs_dfe(), for small species where the - * mole fraction is small: - * - * z(i) < VCS_DELETE_MINORSPECIES_CUTOFF - * - * The chemical potential is calculated as: - * - * m_feSpecies(I) = m_SSfeSpecies(I) - * + ln(ActCoeff[i](VCS_DELETE_MINORSPECIES_CUTOFF)) - * - * @param[in] iph Phase to be calculated - * @param[in] molNum Number of moles of species i (VCS species order) - * @param[out] ac Activity coefficients for species in phase (VCS - * species order) - * @param[out] mu_i Dimensionless chemical potentials for phase - * species (VCS species order) - * @deprecated Unused. To be removed after Cantera 2.3. - */ - void vcs_chemPotPhase(const int stateCalc, const size_t iph, const double* const molNum, - double* const ac, double* const mu_i, - const bool do_deleted = false); - //! Calculate the dimensionless chemical potentials of all species or //! of certain groups of species, at a fixed temperature and pressure. /*! @@ -412,15 +327,6 @@ public: */ void vcs_dfe(const int stateCalc, const int ll, const size_t lbot, const size_t ltop); - //! Print out a table of chemical potentials - /*! - * @param stateCalc Determines where to get the mole numbers from. - * - VCS_STATECALC_OLD -> from m_molNumSpecies_old - * - VCS_STATECALC_NEW -> from m_molNumSpecies_new - * @deprecated Unused. To be removed after Cantera 2.3. - */ - void vcs_printSpeciesChemPot(const int stateCalc) const; - //! This routine uploads the state of the system into all of the //! vcs_VolumePhase objects in the current problem. /*! @@ -446,17 +352,6 @@ public: */ bool vcs_popPhasePossible(const size_t iphasePop) const; - //! Determine the list of problems that need to be checked to see if there - //! are any phases pops - /*! - * This routine evaluates and fills in #phasePopProblemLists_. Need to - * work in species that are zeroed by element constraints. - * - * @returns the number of problems that must be checked. - * @deprecated Unused. To be removed after Cantera 2.3. - */ - int vcs_phasePopDeterminePossibleList(); - //! Decision as to whether a phase pops back into existence /*! * @param phasePopPhaseIDs Vector containing the phase ids of the phases @@ -548,28 +443,6 @@ public: void vcs_printDeltaG(const int stateCalc); - //! Calculate deltag of formation for all species in a single phase. - /*! - * Calculate deltag of formation for all species in a single phase. It is - * assumed that the fe[] is up to date for all species. However, if the - * phase is currently zeroed out, a subproblem is calculated to solve for - * AC[i] and pseudo-X[i] for that phase. - * - * @param iphase phase index of the phase to be calculated - * @param doDeleted boolean indicating whether to do deleted - * species or not - * @param stateCalc integer describing which set of free energies - * to use and where to stick the results. - * @param alterZeroedPhases boolean indicating whether we should - * add in a special section for zeroed phases. - * - * NOTE: this is currently not used used anywhere. - * It may be in the future? - * @deprecated Unused. To be removed after Cantera 2.3. - */ - void vcs_deltag_Phase(const size_t iphase, const bool doDeleted, - const int stateCalc, const bool alterZeroedPhases = true); - //! Swaps the indices for all of the global data for two species, k1 //! and k2. /*! @@ -584,51 +457,6 @@ public: */ void vcs_switch_pos(const bool ifunc, const size_t k1, const size_t k2); - //! Birth guess returns the number of moles of a species that is coming back - //! to life. - /*! - * Birth guess returns the number of moles of a species that is coming back - * to life. Note, this routine is not applicable if the whole phase is - * coming back to life, not just one species in that phase. - * - * Do a minor alt calculation. But, cap the mole numbers at 1.0E-15. For SS - * phases use VCS_DELETE_SPECIES_CUTOFF * 100. - * - * The routine makes sure the guess doesn't reduce the concentration of a - * component by more than 1/3. Note this may mean that the vlaue coming back - * from this routine is zero or a very small number. - * - * @param kspec Species number that is coming back to life - * @returns the number of kmol that the species should have. - * @deprecated Unused. To be removed after Cantera 2.3. - */ - double vcs_birthGuess(const int kspec); - - //! Routine that independently determines whether a phase should be popped - //! under the current conditions. - /* - * This is the main routine that solves for equilibrium at constant T and - * P using a variant of the VCS method. Nonideal phases can be - * accommodated as well. Any number of single-species phases and multi- - * species phases can be handled by the present version. - * - * @param print_lvl 1 -> Print results to standard output; -> don't - * report on anything - * @param printDetails 1 -> Print intermediate results. - * @param maxit Maximum number of iterations for the algorithm - * @return - * - 0 = Equilibrium Achieved - * - 1 = Range space error encountered. The element abundance criteria are - * only partially satisfied. Specifically, the first NC= (number of - * components) conditions are satisfied. However, the full NE (number of - * elements) conditions are not satisfied. The equilibrium condition is - * returned. - * - -1 = Maximum number of iterations is exceeded. Convergence was not - * found. - * @deprecated Broken and unused. To be removed after Cantera 2.3. - */ - int vcs_solve_phaseStability(const int iphase, int ifunc, double& funcval, int print_lvl); - //! Main program to test whether a deleted phase should be brought //! back into existence /*! @@ -811,33 +639,6 @@ public: */ void vcs_switch_elem_pos(size_t ipos, size_t jpos); - //! Calculates reaction adjustments using a full Hessian approximation - /*! - * This does what equation 6.4-16, p. 143 in Smith and Missen is supposed - * to do. However, a full matrix is formed and then solved via a conjugate - * gradient algorithm. No preconditioning is done. - * - * If special branching is warranted, then the program bails out. - * - * Output - * ------- - * DS(I) : reaction adjustment, where I refers to the Ith species - * Special branching occurs sometimes. This causes the component basis - * to be reevaluated - * return = 0 : normal return - * 1 : A single species phase species has been zeroed out - * in this routine. The species is a noncomponent - * 2 : Same as one but, the zeroed species is a component. - * - * Special attention is taken to flag cases where the direction of the - * update is contrary to the steepest descent rule. This is an important - * attribute of the regular vcs algorithm. We don't want to violate this. - * - * NOTE: currently this routine is not used. - * @deprecated Unused. To be removed after Cantera 2.3. - */ - int vcs_rxn_adj_cg(); - //! Calculates the diagonal contribution to the Hessian due to //! the dependence of the activity coefficients on the mole numbers. /*! @@ -865,21 +666,6 @@ public: */ void vcs_CalcLnActCoeffJac(const double* const moleSpeciesVCS); - //! A line search algorithm is carried out on one reaction - /*! - * In this routine we carry out a rough line search algorithm to make - * sure that the m_deltaGRxn_new doesn't switch signs prematurely. - * - * @param irxn Reaction number - * @param dx_orig Original step length - * @param ANOTE Output character string stating the conclusions of the - * line search - * @returns the optimized step length found by the search - * @deprecated Unused. To be removed after Cantera 2.3. - */ - double vcs_line_search(const size_t irxn, const double dx_orig, - char* const ANOTE=0); - //! Print out a report on the state of the equilibrium problem to //! standard output. /*! @@ -890,13 +676,6 @@ public: */ int vcs_report(int iconv); - //! Switch all species data back to the original order. - /*! - * This destroys the data based on reaction ordering. - * @deprecated Unused. To be removed after Cantera 2.3. - */ - int vcs_rearrange(); - //! Nondimensionalize the problem data /*! * Nondimensionalize the free energies using the divisor, R * T @@ -1158,47 +937,6 @@ private: */ int vcs_recheck_deleted(); - //! Recheck deletion condition for multispecies phases. - /*! - * We assume here that DG_i_0 has been calculated for deleted species - * correctly - * - * m_feSpecies(I) = m_SSfeSpecies(I) - * + ln(ActCoeff[I]) - * - ln(Mnaught * m_units) - * + m_chargeSpecies[I] * Faraday_dim * m_phasePhi[iphase]; - * - * sum_u = sum_j_comp [ sigma_i_j * u_j ] - * = u_i_O + log((AC_i * W_i)/m_tPhaseMoles_old) - * - * DG_i_0 = m_feSpecies(I) - sum_m{ a_i_m DG_m } - * - * by first evaluating: - * - * DG_i_O = u_i_O - sum_u. - * - * Then, the phase pops into existence iff - * - * phaseDG = 1.0 - sum_i{exp(-DG_i_O)} < 0.0 - * - * This formula works for both single species phases and for multispecies - * phases. It's an overkill for single species phases. - * - * @param iphase Phase index number - * @returns true if the phase is currently deleted but should be - * reinstated. Returns false otherwise. - * - * NOTE: this routine is currently not used in the code, and - * contains some basic changes that are incompatible. - * - * assumptions: - * 1. Vphase Existence is up to date - * 2. Vphase->IndSpecies is up to date - * 3. m_deltaGRxn_old[irxn] is up to date - * @deprecated Unused. To be removed after Cantera 2.3. - */ - bool recheck_deleted_phase(const int iphase); - //! Minor species alternative calculation /*! * This is based upon the following approximation: The mole fraction @@ -1267,10 +1005,6 @@ private: */ double l2normdg(double dg[]) const; - //! Print out and check the elemental abundance vector - //! @deprecated Unused. To be removed after Cantera 2.3. - void prneav() const; - void checkDelta1(double* const ds, double* const delTPhMoles, size_t kspec); //! Estimate equilibrium compositions @@ -1291,32 +1025,6 @@ private: //! Calculate the status of single species phases. void vcs_SSPhase(); - //! This function recalculates the deltaG for reaction, irxn - /*! - * This function recalculates the deltaG for reaction irxn, given the mole - * numbers in molNum. It uses the temporary space mu_i, to hold the - * recalculated chemical potentials. It only recalculates the chemical - * potentials for species in phases which participate in the irxn reaction. - * This function is used by the vcs_line_search algorithm() and should not - * be used widely due to the unknown state it leaves the system. - * - * @param[in] irxn Reaction number - * @param[in] molNum Current mole numbers of species to be used as input - * to the calculation (units = kmol), (length = totalNuMSpecies) - * @param[out] ac Activity coefficients (length = totalNumSpecies) Note - * this is only partially formed. Only species in phases that - * participate in the reaction will be updated - * @param[out] mu_i dimensionless chemical potentials (length - * totalNumSpecies) Note this is only partially formed. Only - * species in phases that participate in the reaction will be - * updated - * @returns the dimensionless deltaG of the reaction - * @deprecated Unused. To be removed after Cantera 2.3. - */ - double deltaG_Recalc_Rxn(const int stateCalc, - const size_t irxn, const double* const molNum, - double* const ac, double* const mu_i); - //! Delete memory that isn't just resizable STL containers /*! * This gets called by the destructor or by InitSizes(). diff --git a/include/cantera/equil/vcs_species_thermo.h b/include/cantera/equil/vcs_species_thermo.h index 8ab618594..fece78e95 100644 --- a/include/cantera/equil/vcs_species_thermo.h +++ b/include/cantera/equil/vcs_species_thermo.h @@ -86,51 +86,6 @@ public: //! Duplication function for derived classes. virtual VCS_SPECIES_THERMO* duplMyselfAsVCS_SPECIES_THERMO(); - - /** - * This function calculates the standard state Gibbs free energy - * for species, kspec, at the temperature TKelvin and pressure, Pres. - * - * @param kspec species global index - * @param TKelvin Temperature in Kelvin - * @param pres pressure in Pa - * @return standard state free energy in units of Kelvin. - * @deprecated Unused. To be removed after Cantera 2.3. - */ - virtual double GStar_R_calc(size_t kspec, double TKelvin, double pres); - - /** - * This function calculates the standard state Gibbs free energy for - * species, kspec, at the temperature TKelvin - * - * @param kglob species global index. - * @param TKelvin Temperature in Kelvin - * @return standard state free energy in Kelvin. - * @deprecated Unused. To be removed after Cantera 2.3. - */ - virtual double G0_R_calc(size_t kglob, double TKelvin); - - /** - * This function calculates the standard state molar volume for species, - * kspec, at the temperature TKelvin and pressure, Pres, - * - * @return standard state volume in m**3 / kmol - * @deprecated Unused. To be removed after Cantera 2.3. - */ - virtual double VolStar_calc(size_t kglob, double TKelvin, double Pres); - - /** - * This function evaluates the activity coefficient for species, kspec - * - * Note, T, P and mole fractions are obtained from the single private - * instance of VCS_SOLVE - * - * @param kspec index of the species in the global species list within - * VCS_SOLVE. Phase and local species id can be looked up within object. - * @return activity coefficient for species kspec - * @deprecated Unused. To be removed after Cantera 2.3. - */ - virtual double eval_ac(size_t kspec); }; } diff --git a/include/cantera/integrators.h b/include/cantera/integrators.h deleted file mode 100644 index 79ab687f7..000000000 --- a/include/cantera/integrators.h +++ /dev/null @@ -1,15 +0,0 @@ -/** - * @file integrators.h - * ODE integrators. Currently, the only integrator is CVODE. - * @deprecated To be removed after Cantera 2.3. Include relevant headers directly. - */ -#ifndef CT_INTEG_H_INCL -#define CT_INTEG_H_INCL - -#pragma message "Deprecated. integrators.h will be removed after Cantera 2.3. Include relevant headers directly." - -#include "numerics/Integrator.h" -#include "numerics/DAE_Solver.h" -#include "numerics/IDA_Solver.h" - -#endif diff --git a/include/cantera/kinetics/AqueousKinetics.h b/include/cantera/kinetics/AqueousKinetics.h index b1f92881e..679a86a63 100644 --- a/include/cantera/kinetics/AqueousKinetics.h +++ b/include/cantera/kinetics/AqueousKinetics.h @@ -34,25 +34,6 @@ public: /// Constructor. Creates an empty reaction mechanism. AqueousKinetics(thermo_t* thermo = 0); - //! Duplication routine for objects which inherit from Kinetics - /*! - * This virtual routine can be used to duplicate Kinetics objects - * inherited from Kinetics even if the application only has - * a pointer to Kinetics to work with. - * - * These routines are basically wrappers around the derived copy constructor. - * - * @param tpVector Vector of shallow pointers to ThermoPhase objects. this is the - * m_thermo vector within this object - */ - virtual Kinetics* duplMyselfAsKinetics(const std::vector & tpVector) const; - - virtual int type() const { - warn_deprecated("AqueousKinetics::type", - "To be removed after Cantera 2.3."); - return cAqueousKinetics; - } - virtual std::string kineticsType() const { return "Aqueous"; } diff --git a/include/cantera/kinetics/BulkKinetics.h b/include/cantera/kinetics/BulkKinetics.h index 5913dce2d..c95cc7424 100644 --- a/include/cantera/kinetics/BulkKinetics.h +++ b/include/cantera/kinetics/BulkKinetics.h @@ -22,7 +22,6 @@ class BulkKinetics : public Kinetics { public: BulkKinetics(thermo_t* thermo = 0); - virtual Kinetics* duplMyselfAsKinetics(const std::vector & tpVector) const; virtual bool isReversible(size_t i); diff --git a/include/cantera/kinetics/EdgeKinetics.h b/include/cantera/kinetics/EdgeKinetics.h index 629d3eb92..0f60e43e7 100644 --- a/include/cantera/kinetics/EdgeKinetics.h +++ b/include/cantera/kinetics/EdgeKinetics.h @@ -27,30 +27,6 @@ public: m_nDim = 1; } - EdgeKinetics(const EdgeKinetics& right) : - InterfaceKinetics(right) { - *this=right; - } - - EdgeKinetics& operator=(const EdgeKinetics& right) { - if (this != &right) { - InterfaceKinetics::operator=(right); - } - return *this; - } - - virtual Kinetics* duplMyselfAsKinetics(const std::vector & tpVector) const { - EdgeKinetics* iK = new EdgeKinetics(*this); - iK->assignShallowPointers(tpVector); - return iK; - } - - virtual int type() const { - warn_deprecated("EdgeKinetics::type", - "To be removed after Cantera 2.3."); - return cEdgeKinetics; - } - virtual std::string kineticsType() const { return "Edge"; } diff --git a/include/cantera/kinetics/GasKinetics.h b/include/cantera/kinetics/GasKinetics.h index 61b9b9f5b..eacffb913 100644 --- a/include/cantera/kinetics/GasKinetics.h +++ b/include/cantera/kinetics/GasKinetics.h @@ -35,14 +35,6 @@ public: */ GasKinetics(thermo_t* thermo = 0); - virtual Kinetics* duplMyselfAsKinetics(const std::vector & tpVector) const; - - virtual int type() const { - warn_deprecated("GasKinetics::type", - "To be removed after Cantera 2.3."); - return cGasKinetics; - } - virtual std::string kineticsType() const { return "Gas"; } diff --git a/include/cantera/kinetics/ImplicitSurfChem.h b/include/cantera/kinetics/ImplicitSurfChem.h index bc8f57b33..3c2603cc7 100644 --- a/include/cantera/kinetics/ImplicitSurfChem.h +++ b/include/cantera/kinetics/ImplicitSurfChem.h @@ -131,19 +131,6 @@ public: virtual void eval(doublereal t, doublereal* y, doublereal* ydot, doublereal* p); - //! Set the initial conditions for the solution vector - /*! - * Essentially calls getState() - * - * @param t0 Initial time - * @param leny Length of the solution vector - * @param y Value of the solution vector to be used. On output, this - * contains the initial value of the solution. - * @deprecated Use getState() instead. To be removed after Cantera 2.3. - */ - virtual void getInitialConditions(doublereal t0, - size_t leny, doublereal* y); - //! Get the current state of the solution vector /*! * @param y Value of the solution vector to be used. diff --git a/include/cantera/kinetics/InterfaceKinetics.h b/include/cantera/kinetics/InterfaceKinetics.h index 7ae672438..dc729b84f 100644 --- a/include/cantera/kinetics/InterfaceKinetics.h +++ b/include/cantera/kinetics/InterfaceKinetics.h @@ -9,7 +9,6 @@ #ifndef CT_IFACEKINETICS_H #define CT_IFACEKINETICS_H -#include "cantera/thermo/mix_defs.h" #include "Kinetics.h" #include "Reaction.h" #include "cantera/base/utilities.h" @@ -70,11 +69,6 @@ public: InterfaceKinetics(thermo_t* thermo = 0); virtual ~InterfaceKinetics(); - InterfaceKinetics(const InterfaceKinetics& right); - InterfaceKinetics& operator=(const InterfaceKinetics& right); - virtual Kinetics* duplMyselfAsKinetics(const std::vector & tpVector) const; - - virtual int type() const; virtual std::string kineticsType() const { return "Surf"; @@ -273,9 +267,6 @@ public: void setIOFlag(int ioFlag); - //! @deprecated To be removed after Cantera 2.3. - void checkPartialEquil(); - //! Update the standard state chemical potentials and species equilibrium //! constant entries /*! diff --git a/include/cantera/kinetics/Kinetics.h b/include/cantera/kinetics/Kinetics.h index c51bba3c7..e98c176eb 100644 --- a/include/cantera/kinetics/Kinetics.h +++ b/include/cantera/kinetics/Kinetics.h @@ -13,7 +13,6 @@ #include "cantera/thermo/ThermoPhase.h" #include "StoichManager.h" -#include "cantera/thermo/mix_defs.h" #include "cantera/kinetics/Reaction.h" #include "cantera/base/global.h" @@ -121,57 +120,9 @@ public: virtual ~Kinetics(); - //! @deprecated Copy constructor to be removed after Cantera 2.3 for all - //! classes derived from Kinetics. - Kinetics(const Kinetics&); - //! @deprecated Assignment operator to be removed after Cantera 2.3 for all - //! classes derived from Kinetics. - Kinetics& operator=(const Kinetics& right); - - //! Duplication routine for objects which inherit from Kinetics - /*! - * This function can be used to duplicate objects derived from Kinetics - * even if the application only has a pointer to Kinetics to work with. - * - * These routines are basically wrappers around the derived copy - * constructor. - * - * @param tpVector Vector of pointers to ThermoPhase objects. this is the - * #m_thermo vector within this object - * @deprecated To be removed after Cantera 2.3 for all classes derived from - * Kinetics. - */ - virtual Kinetics* duplMyselfAsKinetics(const std::vector & tpVector) const; - - //! Reassign the pointers within the Kinetics object - /*! - * This type or routine is necessary because the Kinetics object doesn't - * own the ThermoPhase objects. After a duplication, we need to point to - * different ThermoPhase objects. - * - * We check that the ThermoPhase objects are aligned in the same order and - * have the following identical properties to the ones that they are - * replacing: - * - * - ThermoPhase::id() - * - ThermoPhase::type() - * - ThermoPhase::nSpecies() - * - * @param tpVector Vector of pointers to ThermoPhase objects. this is the - * #m_thermo vector within this object - * @deprecated To be removed after Cantera 2.3 for all classes derived from - * Kinetics. - */ - virtual void assignShallowPointers(const std::vector & tpVector); - - //! Identifies the kinetics manager type. - /*! - * Each class derived from Kinetics should overload this method to return - * a unique integer. Standard values are defined in file mix_defs.h. - * @deprecated Use kineticsType() instead. To be removed after Cantera - * 2.3. - */ - virtual int type() const; + //! Kinetics objects are not copyable or assignable + Kinetics(const Kinetics&) = delete; + Kinetics& operator=(const Kinetics&)= delete; //! Identifies the Kinetics manager type. //! Each class derived from Kinetics should override this method to return @@ -748,17 +699,6 @@ public: */ virtual void resizeSpecies(); - /** - * Finish adding reactions and prepare for use. This method is called by - * importKinetics() after all reactions have been entered into the - * mechanism and before the mechanism is used to calculate reaction rates. - * The base class method does nothing, but derived classes may use this to - * perform any initialization (allocating arrays, etc.) that must be done - * after the reactions are entered. - * @deprecated No longer needed. To be removed after Cantera 2.3. - */ - virtual void finalize(); - /** * Add a single reaction to the mechanism. Derived classes should call the * base class method in addition to handling their own specialized behavior. @@ -835,17 +775,6 @@ public: //@} - /** - * Returns true if the kinetics manager has been properly initialized and - * finalized. - * @deprecated Object is always ready. To be removed after Cantera 2.3. - */ - virtual bool ready() const { - warn_deprecated("Kinetics::ready", - "Object is always ready. To be removed after Cantera 2.3."); - return true; - } - //! Check for unmarked duplicate reactions and unmatched marked duplicates /** * If `throw_err` is true, then an exception will be thrown if either any diff --git a/include/cantera/kinetics/KineticsFactory.h b/include/cantera/kinetics/KineticsFactory.h index 74a8793dd..61487b199 100644 --- a/include/cantera/kinetics/KineticsFactory.h +++ b/include/cantera/kinetics/KineticsFactory.h @@ -77,38 +77,20 @@ private: /** * Create a new kinetics manager. - * @deprecated The `KineticsFactory*` argument to this function is deprecated - * and will be removed after Cantera 2.3. */ -inline Kinetics* newKineticsMgr(XML_Node& phase, - std::vector th, KineticsFactory* f=0) +inline Kinetics* newKineticsMgr(XML_Node& phase, std::vector th) { - if (f == 0) { - f = KineticsFactory::factory(); - } else { - warn_deprecated("newKineticsMgr(XML_Node&, KineticsFactory*)", - "The `KineticsFactory*` argument to this function is deprecated and" - " will be removed after Cantera 2.3."); - } - return f->newKinetics(phase, th); + return KineticsFactory::factory()->newKinetics(phase, th); } /** * Create a new kinetics manager. - * @deprecated The `KineticsFactory*` argument to this function is deprecated - * and will be removed after Cantera 2.3. */ -inline Kinetics* newKineticsMgr(const std::string& model, KineticsFactory* f=0) +inline Kinetics* newKineticsMgr(const std::string& model) { - if (f == 0) { - f = KineticsFactory::factory(); - } else { - warn_deprecated("newKineticsMgr(string, KineticsFactory*)", - "The `KineticsFactory*` argument to this function is deprecated and" - " will be removed after Cantera 2.3."); - } - return f->newKinetics(model); + return KineticsFactory::factory()->newKinetics(model); } + } #endif diff --git a/include/cantera/numerics.h b/include/cantera/numerics.h deleted file mode 100644 index 115c87581..000000000 --- a/include/cantera/numerics.h +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @file numerics.h - * @deprecated To be removed after Cantera 2.3. Include relevant headers - * directly. - */ -#ifndef CT_NUM_H_INCL -#define CT_NUM_H_INCL - -#pragma message "Deprecated. numerics.h will be removed after Cantera 2.3. Include relevant headers directly." - -#include "numerics/DenseMatrix.h" -#include "numerics/BandMatrix.h" - -#endif diff --git a/include/cantera/numerics/BandMatrix.h b/include/cantera/numerics/BandMatrix.h index 1c04dfd03..0e7118049 100644 --- a/include/cantera/numerics/BandMatrix.h +++ b/include/cantera/numerics/BandMatrix.h @@ -123,18 +123,6 @@ public: virtual size_t nRows() const; - //! Return the size and structure of the matrix - /*! - * @param iStruct OUTPUT Pointer to a vector of ints that describe the - * structure of the matrix. - * - * istruct[0] = kl - * istruct[1] = ku - * @returns the number of rows and columns in the matrix. - * @deprecated Unused. To be removed after Cantera 2.3. - */ - virtual size_t nRowsAndStruct(size_t* const iStruct = 0) const; - //! Number of columns size_t nColumns() const; @@ -225,8 +213,6 @@ public: //! Returns the one norm of the matrix virtual doublereal oneNorm() const; - virtual GeneralMatrix* duplMyselfAsGeneralMatrix() const; - //! Return a pointer to the top of column j /*! * Column values are assumed to be contiguous in memory (LAPACK band matrix diff --git a/include/cantera/numerics/CVodesIntegrator.h b/include/cantera/numerics/CVodesIntegrator.h index ccc2bd361..2479b8c4c 100644 --- a/include/cantera/numerics/CVodesIntegrator.h +++ b/include/cantera/numerics/CVodesIntegrator.h @@ -16,18 +16,6 @@ namespace Cantera { -/** - * Exception thrown when a CVODES error is encountered. - * @deprecated Unused. To be removed after Cantera 2.3. - */ -class CVodesErr : public CanteraError -{ -public: - explicit CVodesErr(const std::string& msg) : CanteraError("CVodesIntegrator", msg) { - warn_deprecated("class CVodesErr", "To be removed after Cantera 2.3."); - } -}; - /** * Wrapper class for 'cvodes' integrator from LLNL. * diff --git a/include/cantera/numerics/DenseMatrix.h b/include/cantera/numerics/DenseMatrix.h index 12c92ff74..a1d6fe306 100644 --- a/include/cantera/numerics/DenseMatrix.h +++ b/include/cantera/numerics/DenseMatrix.h @@ -26,28 +26,6 @@ namespace Cantera * */ -//! Exception thrown when an LAPACK error is encountered associated with -//! inverting or solving a matrix -/*! - * A named error condition is used so that the calling code may differentiate - * this type of error from other error conditions. - */ -class CELapackError : public CanteraError -{ -public: - //! Constructor passes through to main Cantera error handler - /*! - * @param routine Name of calling routine - * @param msg Informative message - * @deprecated Unused. To be removed after Cantera 2.3. - */ - CELapackError(const std::string& routine, const std::string& msg) : - CanteraError(routine + " LAPACK ERROR", msg) { - warn_deprecated("class CELapackError", - "To be removed after Cantera 2.3."); - } -}; - //! A class for full (non-sparse) matrices with Fortran-compatible data storage, //! which adds matrix operations to class Array2D. /*! diff --git a/include/cantera/numerics/FuncEval.h b/include/cantera/numerics/FuncEval.h index af3ef0ccf..ddc755d55 100644 --- a/include/cantera/numerics/FuncEval.h +++ b/include/cantera/numerics/FuncEval.h @@ -49,17 +49,6 @@ public: */ int eval_nothrow(double t, double* y, double* ydot); - /** - * Fill the solution vector with the initial conditions - * at initial time t0. - * @deprecated Use getState() instead. To be removed after Cantera 2.3. - */ - virtual void getInitialConditions(double t0, size_t leny, double* y) { - warn_deprecated("FuncEval::getInitialConditions", - "Use getState instead. To be removed after Cantera 2.3."); - getState(y); - } - //! Fill in the vector *y* with the current state of the system virtual void getState(double* y) { throw NotImplementedError("FuncEval::getState"); diff --git a/include/cantera/numerics/GeneralMatrix.h b/include/cantera/numerics/GeneralMatrix.h index 12b2a0225..de079c1c7 100644 --- a/include/cantera/numerics/GeneralMatrix.h +++ b/include/cantera/numerics/GeneralMatrix.h @@ -22,23 +22,10 @@ class GeneralMatrix { public: //! Base Constructor - explicit GeneralMatrix(int matType=-1) : m_factored(false) { - if (matType != -1) { - warn_deprecated("GeneralMatrix", "Integer argument to constructor " - "is deprecated and will be removed after Cantera 2.3."); - } - } + GeneralMatrix() : m_factored(false) {} virtual ~GeneralMatrix() {} - //! Duplicator member function - /*! - * This function will duplicate the matrix given a generic GeneralMatrix - * - * @returns a pointer to the newly created object - */ - virtual GeneralMatrix* duplMyselfAsGeneralMatrix() const = 0; - //! Zero the matrix elements virtual void zero() = 0; @@ -110,15 +97,6 @@ public: //! Return the number of rows in the matrix virtual size_t nRows() const = 0; - //! Return the size and structure of the matrix - /*! - * @param iStruct OUTPUT Pointer to a vector of ints that describe the - * structure of the matrix. - * @returns the number of rows and columns in the matrix. - * @deprecated Unused. To be removed after Cantera 2.3. - */ - virtual size_t nRowsAndStruct(size_t* const iStruct = 0) const = 0; - //! clear the factored flag virtual void clearFactorFlag() { m_factored = 0; diff --git a/include/cantera/numerics/IDA_Solver.h b/include/cantera/numerics/IDA_Solver.h index 0775d256b..3b39db7e3 100644 --- a/include/cantera/numerics/IDA_Solver.h +++ b/include/cantera/numerics/IDA_Solver.h @@ -24,19 +24,6 @@ namespace Cantera { -/** - * Exception thrown when a IDA error is encountered. - * @deprecated Unused. To be removed after Cantera 2.3. - */ -class IDA_Err : public CanteraError -{ -public: - explicit IDA_Err(const std::string& msg) : CanteraError("IDA_Solver", msg) { - warn_deprecated("class IDA_Err", "To be removed after Cantera 2.3."); - } -}; - - class ResidData; /** diff --git a/include/cantera/numerics/ResidJacEval.h b/include/cantera/numerics/ResidJacEval.h index 06c5df50f..88b87f6e1 100644 --- a/include/cantera/numerics/ResidJacEval.h +++ b/include/cantera/numerics/ResidJacEval.h @@ -61,23 +61,6 @@ public: */ ResidJacEval(doublereal atol = 1.0e-13); - //! @deprecated To be removed after Cantera 2.3. - ResidJacEval(const ResidJacEval& right); - //! @deprecated To be removed after Cantera 2.3. - ResidJacEval& operator=(const ResidJacEval& right); - - //! Duplication routine for objects derived from residJacEval - /*! - * This virtual routine can be used to duplicate objects which inherit from - * ResidJacEval even if the application only has a pointer to ResidJacEval - * to work with. - * - * These routines are basically wrappers around the derived copy - * constructor. - * @deprecated To be removed after Cantera 2.3. - */ - virtual ResidJacEval* duplMyselfAsResidJacEval() const; - //! Return the number of equations in the equation system virtual int nEquations() const; diff --git a/include/cantera/numerics/RootFind.h b/include/cantera/numerics/RootFind.h deleted file mode 100644 index 782ade427..000000000 --- a/include/cantera/numerics/RootFind.h +++ /dev/null @@ -1,423 +0,0 @@ -/** - * @file RootFind.h Header file for implicit nonlinear solver of a one - * dimensional function (see \ref numerics and class \link - * Cantera::RootFind RootFind\endlink). - */ - -// This file is part of Cantera. See License.txt in the top-level directory or -// at http://www.cantera.org/license.txt for license and copyright information. - -#ifndef CT_ROOTFIND_H -#define CT_ROOTFIND_H -/** - * @defgroup solverGroup Solvers for Equation Systems - */ - -#include "ResidEval.h" - -namespace Cantera -{ - -//@{ -/// @name Constant which determines the return integer from the routine - -//! This means that the root solver was a success -#define ROOTFIND_SUCCESS 0 -//! This return value means that the root finder resolved a solution in the x -//! coordinate, however, convergence in F was not achieved. -/*! - * A common situation for this to happen is that f(x) is discontinuous about - * f(x) = f_0, where we seek the x where the function is equal to f_0. f(x) - * spans the f_0 while not being equal to f_0 anywhere. - */ -#define ROOTFIND_SUCCESS_XCONVERGENCEONLY 1 -//! This means that the root solver failed to achieve convergence -#define ROOTFIND_FAILEDCONVERGENCE -1 -//! This means that the input to the root solver was defective -#define ROOTFIND_BADINPUT -2 -//! This means that the rootfinder believes the solution is lower than xmin -#define ROOTFIND_SOLNLOWERTHANXMIN -3 -//! This means that the rootfinder believes the solution is higher than xmax -#define ROOTFIND_SOLNHIGHERTHANXMAX -4 -//@} - -//! Root finder for 1D problems -/*! - * @deprecated Unused. To be removed after Cantera 2.3. See - * boost::math::tools::toms748_solve for an alternative. - * - * The root finder solves a single nonlinear equation described below. - * - * \f[ - * f(x) = f_0 - * \f] - * - * \f$ f(x) \f$ is assumed to be single valued as a function of x.\f$ f(x) \f$ - * is not assumed to be continuous nor is its derivative assumed to be well - * formed. - * - * Root finders are significantly different in the sense that do not have to - * rely solely on Newton's method to find the answer to the problem. Instead - * they use a method to bound the solution between high and low values and then - * use a method to refine that bound. The eventual solution to the problem is - * presented as x_best and as a bound, delta_X, on the solution component. - * Because of this, they are far more stable for functions and Jacobians that - * have discontinuities or noise associated with them. - * - * The algorithm is a convolution of a local Secant method with an approach of - * finding a straddle in x. The Jacobian is never required. - * - * There is a general breakdown of the algorithm into stages. The first stage - * seeks to find a straddle of the function. The second stage seeks to reduce - * the bounds in x and f in order to satisfy the specification of the stopping - * criteria. In the last stage the algorithm seeks to find the base value of x - * that satisfies the original equation given what it current knows about the - * function. - * - * Globalization strategy - * - * Specifying the General Changes in x - * - * Supplying Hints with General Function Behavior Flags - * - * Stopping Criteria - * - * Specification of the Stopping Criteria - * - * Additional constraints - * - * Bounds Criteria For the Routine - * - * Example - * - * @code - * // Define a residual. The definition of a residual involves a lot more work than is shown here. - * ResidEval * ec; - * // Instantiate the root finder with the residual to be solved, ec. - * RootFind rf(&ec); - * // Set the relative and absolute tolerances for f and x. - * rf.setTol(1.0E-5, 1.0E-10, 1.0E-5, 1.0E-11); - * // Give a hint about the function's dependence on x. This is needed, for example, if the function has - * // flat regions. - * rf.setFuncIsGenerallyIncreasing(true); - * rf.setDeltaX(0.01); - * // Supply an initial guess for the solution - * double xbest = phiM; - * double oldP = printLvl_; - * // Set the print level for the solver. Zero produces no output. Two produces a summary table of each iteration. - * rf.setPrintLvl(2); - * // Define a minimum and maximum for the independent variable. - * double phimin = 1.3; - * double phimax = 2.2; - * // Define a maximum iteration number - * int itmax = 100; - * // Define the f_0 value, and on return will contain the actual value of f(x) obtained - * double currentObtained; - * // Call the solver - * status = rf.solve(phimin, phimax, 100, currentObtained, &xbest); - * if (status == 0) { - * if (printLvl_ > 1) { - * printf("Electrode::integrateConstantCurrent(): Volts (%g amps) = %g\n", currentObtained, xbest); - * } - * } else { - * if (printLvl_) { - * printf("Electrode::integrateConstantCurrent(): bad status = %d Volts (%g amps) = %g\n", - * status, currentObtained, xbest); - * } - * } - * @endcode - * - * @todo Noise - * @todo General Search to be done when all else fails - */ -class RootFind -{ -public: - //! Constructor for the object - /*! - * @param resid Pointer to the residual function to be used to calculate f(x) - */ - RootFind(ResidEval* resid); - - //! @deprecated To be removed after Cantera 2.3. - RootFind(const RootFind& r); - ~RootFind() {} - //! @deprecated To be removed after Cantera 2.3. - RootFind& operator=(const RootFind& right); - -private: - //! Calculate a deltaX from an input value of x - /*! - * This routine ensure that the deltaX will be greater or equal to - * DeltaXNorm_ or 1.0E-14 x - * - * @param x1 input value of x - */ - doublereal delXNonzero(doublereal x1) const; - - //! Calculate a deltaX from an input value of x - /*! - * This routine ensure that the deltaX will be greater or equal to - * DeltaXNorm_ or 1.0E-14 x or deltaXConverged_. - * - * @param x1 input value of x - */ - doublereal delXMeaningful(doublereal x1) const; - - //! Calculate a controlled, nonzero delta between two numbers - /*! - * The delta is designed to be greater than or equal to delXMeaningful(x) - * defined above with the same sign as the original delta. Therefore if you - * subtract it from either of the two original numbers, you get a different - * number. - * - * @param x2 first number - * @param x1 second number - */ - doublereal deltaXControlled(doublereal x2, doublereal x1) const; - - //! Function to decide whether two real numbers are the same or not - /*! - * A comparison is made between the two numbers to decide whether they are - * close to one another. This is defined as being within factor * - * delXMeaningful() of each other. - * - * The basic premise here is that if the two numbers are too close, the - * noise will prevent an accurate calculation of the function and its slope. - * - * @param x1 First number - * @param x2 second number - * @param factor Multiplicative factor to multiple deltaX with - * @returns a boolean indicating whether the two numbers are the same or not. - */ - bool theSame(doublereal x2, doublereal x1, doublereal factor = 1.0) const; - -public: - //! Using a line search method, find the root of a 1D function - /*! - * This routine solves the following equation. - * - * \f[ - * R(x) = f(x) - f_o = 0 - * \f] - * - * @param xmin Minimum value of x to be used. - * @param xmax Maximum value of x to be used - * @param itmax maximum number of iterations. Usually, it can be less than 50. - * @param funcTargetValue Value of \f$ f_o \f$ in the equation. On return, - * it contains the value of the function actually obtained. - * @param xbest Returns the x that satisfies the function On input, xbest - * should contain the best estimate of the solution. An - * attempt to find the solution near xbest is made. - * @return: - * 0 = ROOTFIND_SUCCESS Found function - * -1 = ROOTFIND_FAILEDCONVERGENCE Failed to find the answer - * -2 = ROOTFIND_BADINPUT Bad input was detected - */ - int solve(doublereal xmin, doublereal xmax, int itmax, doublereal& funcTargetValue, doublereal* xbest); - - //! Return the function value - /*! - * This routine evaluates the following equation. - * - * \f[ - * R(x) = f(x) - f_o = 0 - * \f] - * - * @param x Value of the independent variable - * - * @return The routine returns the value of \f$ R(x) \f$ - */ - doublereal func(doublereal x); - - //! Set the tolerance parameters for the rootfinder - /*! - * These tolerance parameters are used on the function value and the - * independent value to determine convergence - * - * @param rtolf Relative tolerance. The default is 10^-5 - * @param atolf absolute tolerance. The default is 10^-11 - * @param rtolx Relative tolerance. The default is 10^-5. Default parameter - * is 0.0, in which case rtolx is set equal to rtolf - * @param atolx absolute tolerance. The default is 10^-11. Default - * parameter is 0.0, in which case atolx is set equal to - * atolf - */ - void setTol(doublereal rtolf, doublereal atolf, doublereal rtolx = 0.0, doublereal atolx = 0.0); - - //! Set the print level from the rootfinder - /*! - * - 0: No printing of any kind - * - 1: Single print line indicating success or failure of the routine. - * - 2: Summary table printed at the end of the routine, with a convergence - * history - * - 3: Printouts during the iteration are added. Summary table is printed - * out at the end. if writeLogAllowed_ is turned on, a file is written - * out with the convergence history. - * - * @param printLvl integer value - */ - void setPrintLvl(int printLvl); - - //! Set the function behavior flag - /*! - * If this is true, the function is generally an increasing function of x. - * In particular, if the algorithm is seeking a higher value of f, it will - * look in the positive x direction. - * - * This type of function is needed because this algorithm must deal with - * regions of f(x) where f is not changing with x. - * - * @param value boolean value - */ - void setFuncIsGenerallyIncreasing(bool value); - - //! Set the function behavior flag - /*! - * If this is true, the function is generally a decreasing function of x. In - * particular, if the algorithm is seeking a higher value of f, it will look - * in the negative x direction. - * - * This type of function is needed because this algorithm must deal with - * regions of f(x) where f is not changing with x. - * - * @param value boolean value - */ - void setFuncIsGenerallyDecreasing(bool value); - - //! Set the minimum value of deltaX - /*! - * @param deltaXNorm - */ - void setDeltaX(doublereal deltaXNorm); - - //! Set the maximum value of deltaX - /*! - * @param deltaX - */ - void setDeltaXMax(doublereal deltaX); - - //! Print the iteration history table - void printTable(); - -public: - //! Pointer to the residual function evaluator - ResidEval* m_residFunc; - - //! Target value for the function. We seek the value of f that is equal to - //! this value - doublereal m_funcTargetValue; - - //! Absolute tolerance for the value of f - doublereal m_atolf; - - //! Absolute tolerance for the value of x - doublereal m_atolx; - - //! Relative tolerance for the value of f and x - doublereal m_rtolf; - - //! Relative tolerance for the value of x - doublereal m_rtolx; - - //! Maximum number of step sizes - doublereal m_maxstep; - -protected: - //! Print level. @see setPrintLvl - int printLvl; - -public: - //! Boolean to turn on the possibility of writing a log file. - bool writeLogAllowed_; - -protected: - //! Delta X norm. This is the nominal value of deltaX that will be used by - //! the program - doublereal DeltaXnorm_; - - //! Boolean indicating whether DeltaXnorm_ has been specified by the user or - //! not - int specifiedDeltaXnorm_; - - //! Delta X Max. - /*! - * This is the maximum value of deltaX that will be used by the program. - * Sometimes a large change in x causes problems. - */ - doublereal DeltaXMax_; - - //! Boolean indicating whether DeltaXMax_ has been specified by the user or - //! not - int specifiedDeltaXMax_; - - //! Boolean indicating whether the function is an increasing with x - bool FuncIsGenerallyIncreasing_; - - //! Boolean indicating whether the function is decreasing with x - bool FuncIsGenerallyDecreasing_; - - //! Value of delta X that is needed for convergence - /*! - * X will be considered as converged if we are within deltaXConverged_ of - * the solution The default is zero. - */ - doublereal deltaXConverged_; - - //! Internal variable tracking largest x tried. - doublereal x_maxTried_; - - //! Internal variable tracking f(x) of largest x tried. - doublereal fx_maxTried_; - - //! Internal variable tracking smallest x tried. - doublereal x_minTried_; - - //! Internal variable tracking f(x) of smallest x tried. - doublereal fx_minTried_; - - //! Structure containing the iteration history - struct rfTable { - //@{ - int its; - int TP_its; - double slope; - double xval; - double fval; - int foundPos; - int foundNeg; - double deltaXConverged; - double deltaFConverged; - double delX; - - std::string reasoning; - - void clear() { - its = 0; - TP_its = 0; - slope = -1.0E300; - xval = -1.0E300; - fval = -1.0E300; - reasoning = ""; - }; - - rfTable() : - its(-2), - TP_its(0), - slope(-1.0E300), - xval(-1.0E300), - fval(-1.0E300), - foundPos(0), - foundNeg(0), - deltaXConverged(-1.0E300), - deltaFConverged(-1.0E300), - delX(-1.0E300) { - }; - //@} - }; - - //! Vector of iteration histories - std::vector rfHistory_; -}; -} -#endif diff --git a/include/cantera/numerics/SquareMatrix.h b/include/cantera/numerics/SquareMatrix.h deleted file mode 100644 index d0adc4a7a..000000000 --- a/include/cantera/numerics/SquareMatrix.h +++ /dev/null @@ -1,130 +0,0 @@ -//! @file SquareMatrix.h Dense, Square (not sparse) matrices. - -// This file is part of Cantera. See License.txt in the top-level directory or -// at http://www.cantera.org/license.txt for license and copyright information. - -#ifndef CT_SQUAREMATRIX_H -#define CT_SQUAREMATRIX_H - -#include "DenseMatrix.h" -#include "GeneralMatrix.h" - -namespace Cantera -{ - -/** - * A class for full (non-sparse) matrices with Fortran-compatible data storage. - * Adds matrix inversion operations to this class from DenseMatrix. - * @deprecated Use class DenseMatrix instead. To be removed after Cantera 2.3. - */ -class SquareMatrix: public DenseMatrix, public GeneralMatrix -{ -public: - //! Base Constructor. - SquareMatrix(); - - //! Constructor. - /*! - * Create an \c n by \c n matrix, and initialize all elements to \c v. - * - * @param n size of the square matrix - * @param v initial value of all matrix components. - */ - SquareMatrix(size_t n, doublereal v = 0.0); - - SquareMatrix(const SquareMatrix& right); - SquareMatrix& operator=(const SquareMatrix& right); - - int solve(doublereal* b, size_t nrhs=1, size_t ldb=0); - - void resize(size_t n, size_t m, doublereal v = 0.0); - - //! Zero the matrix - void zero(); - - virtual void mult(const doublereal* b, doublereal* prod) const; - virtual void mult(const DenseMatrix& b, DenseMatrix& prod) const; - virtual void leftMult(const doublereal* const b, doublereal* const prod) const; - - int factor(); - virtual int factorQR(); - - virtual doublereal rcondQR(); - virtual doublereal rcond(doublereal a1norm); - - virtual doublereal oneNorm() const; - - //! Solves the linear problem Ax=b using the QR algorithm returning x in the - //! b spot - /*! - * @param b RHS to be solved. - */ - int solveQR(doublereal* b); - - //! set the factored flag - void setFactorFlag(); - - virtual void useFactorAlgorithm(int fAlgorithm); - - //! Returns the factor algorithm used - /*! - * 0 LU decomposition - * 1 QR decomposition - * - * This routine will always return 0 - */ - virtual int factorAlgorithm() const; - - virtual doublereal* ptrColumn(size_t j); - - virtual doublereal& operator()(size_t i, size_t j) { - return Array2D::operator()(i, j); - } - - virtual doublereal operator()(size_t i, size_t j) const { - return Array2D::operator()(i, j); - } - - virtual size_t nRows() const; - - //! Return the size and structure of the matrix - /*! - * This is inherited from GeneralMatrix - * - * @param iStruct OUTPUT Pointer to a vector of ints that describe the - * structure of the matrix. not used - * - * @returns the number of rows and columns in the matrix. - * @deprecated Unused. To be removed after Cantera 2.3. - */ - size_t nRowsAndStruct(size_t* const iStruct = 0) const; - - virtual GeneralMatrix* duplMyselfAsGeneralMatrix() const; - - virtual vector_fp::iterator begin(); - virtual vector_fp::const_iterator begin() const; - - virtual doublereal* const* colPts(); - - virtual size_t checkRows(doublereal& valueSmall) const; - virtual size_t checkColumns(doublereal& valueSmall) const; - - //! Work vector for QR algorithm - vector_fp tau; - - //! Work vector for QR algorithm - vector_fp work; - - //! Integer work vector for QR algorithms - vector_int iwork_; -protected: - //! 1-norm of the matrix. This is determined immediately before every - //! factorization - doublereal a1norm_; - - //! Use the QR algorithm to factor and invert the matrix - int useQR_; -}; -} - -#endif diff --git a/include/cantera/numerics/polyfit.h b/include/cantera/numerics/polyfit.h index d31d25b94..b6c0a88ae 100644 --- a/include/cantera/numerics/polyfit.h +++ b/include/cantera/numerics/polyfit.h @@ -32,13 +32,5 @@ namespace Cantera double polyfit(size_t n, size_t deg, const double* x, const double* y, const double* w, double* p); -//! Fits a polynomial function to a set of data points -/*! - * @deprecated The ndeg and eps arguments to polyfit are deprecated and unused. - * Use the form of polyfit with signature polyfit(n, deg, x, y, w, p). To be - * removed after Cantera 2.3. - */ -doublereal polyfit(int n, doublereal* x, doublereal* y, doublereal* w, - int maxdeg, int& ndeg, doublereal eps, doublereal* r); } #endif diff --git a/include/cantera/oneD/Domain1D.h b/include/cantera/oneD/Domain1D.h index f997b02af..4ee50c4d9 100644 --- a/include/cantera/oneD/Domain1D.h +++ b/include/cantera/oneD/Domain1D.h @@ -177,15 +177,6 @@ public: m_name[n] = name; } - //! @deprecated To be removed after Cantera 2.3 - void setComponentType(size_t n, int ctype) { - warn_deprecated("Domain1D::setComponentType", - "To be removed after Cantera 2.3."); - if (ctype == 0) { - setAlgebraic(n); - } - } - //! index of component with name \a name. size_t componentIndex(const std::string& name) const; @@ -288,16 +279,6 @@ public: */ void needJacUpdate(); - /*! - * Evaluate the steady-state residual at all points, even if in - * transient mode. Used only to print diagnostic output. - * @deprecated To be removed after Cantera 2.3 - */ - void evalss(doublereal* x, doublereal* r, integer* mask) { - warn_deprecated("Domain1D::evalss", "To be removed after Cantera 2.3"); - eval(npos,x,r,mask,0.0); - } - //! Evaluate the residual function at point j. If j == npos, //! evaluate the residual function at all points. /*! @@ -312,45 +293,10 @@ public: * state.) */ virtual void eval(size_t j, doublereal* x, doublereal* r, - integer* mask, doublereal rdt=0.0); - - //! @deprecated To be removed after Cantera 2.3. Derived classes should - //! implement eval() instead. - virtual doublereal residual(doublereal* x, size_t n, size_t j) { - warn_deprecated("Domain1D::residual", "To be removed after Cantera 2.3."); - throw CanteraError("Domain1D::residual","residual function must be overloaded in derived class "+id()); + integer* mask, doublereal rdt=0.0) { + throw NotImplementedError("Domain1D::eval"); } - //! @deprecated To be removed after Cantera 2.3 - int timeDerivativeFlag(size_t n) { - warn_deprecated("Domain1D::timeDerivativeFlag", - "To be removed after Cantera 2.3."); - return m_td[n]; - } - - //! @deprecated To be removed after Cantera 2.3 - void setAlgebraic(size_t n) { - warn_deprecated("Domain1D::setAlgebraic", - "To be removed after Cantera 2.3."); - m_td[n] = 0; - } - - //! @deprecated To be removed after Cantera 2.3 - virtual void update(doublereal* x) { - warn_deprecated("Domain1D::update", "To be removed after Cantera 2.3."); - } - - //! @deprecated To be removed after Cantera 2.3 - doublereal time() const { - warn_deprecated("Domain1D::time", "To be removed after Cantera 2.3."); - return m_time; - } - //! @deprecated To be removed after Cantera 2.3 - void incrementTime(doublereal dt) { - warn_deprecated("Domain1D::incrementTime", - "To be removed after Cantera 2.3."); - m_time += dt; - } size_t index(size_t n, size_t j) const { return m_nv*j + n; } @@ -468,25 +414,6 @@ public: } } - //! Specify descriptive text for this domain. - //! @deprecated To be removed after Cantera 2.3. - void setDesc(const std::string& s) { - warn_deprecated("Domain1D::setDesc", "To be removed after Cantera 2.3."); - m_desc = s; - } - - //! @deprecated To be removed after Cantera 2.3. - const std::string& desc() { - warn_deprecated("Domain1D::desc", "To be removed after Cantera 2.3."); - return m_desc; - } - - //! @deprecated To be removed after Cantera 2.3. - virtual void getTransientMask(integer* mask) { - warn_deprecated("Domain1D::getTransientMask", - "To be removed after Cantera 2.3."); - } - virtual void showSolution_s(std::ostream& s, const doublereal* x) {} //! Print the solution. @@ -554,7 +481,6 @@ protected: size_t m_nv; size_t m_points; vector_fp m_slast; - doublereal m_time; //!< @deprecated To be removed after Cantera 2.3. vector_fp m_max; vector_fp m_min; vector_fp m_rtol_ss, m_rtol_ts; @@ -579,7 +505,6 @@ protected: std::string m_id; std::string m_desc; std::unique_ptr m_refiner; - vector_int m_td; //!< @deprecated To be removed after Cantera 2.3. std::vector m_name; int m_bw; bool m_force_full_update; diff --git a/include/cantera/oneD/StFlow.h b/include/cantera/oneD/StFlow.h index 82be00005..84cb56e91 100644 --- a/include/cantera/oneD/StFlow.h +++ b/include/cantera/oneD/StFlow.h @@ -77,14 +77,6 @@ public: //! set the transport manager void setTransport(Transport& trans); - //! set the transport manager - /*! - * @deprecated The withSoret argument is deprecated and unused. - * Use the form of setTransport with signature setTransport(Transport& trans). - * To be removed after Cantera 2.3. - */ - void setTransport(Transport& trans, bool withSoret); - void enableSoret(bool withSoret); bool withSoret() const { return m_do_soret; diff --git a/include/cantera/surface.h b/include/cantera/surface.h deleted file mode 100644 index 71dc6cbc3..000000000 --- a/include/cantera/surface.h +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @file surface.h - * @deprecated To be removed after Cantera 2.3. - */ - -#ifndef CT_SURFACE_INCL -#define CT_SURFACE_INCL - -#pragma message "Deprecated. surface.h will be removed after Cantera 2.3. Include relevant headers directly." - -#include "thermo/SurfPhase.h" -#include "kinetics/InterfaceKinetics.h" - -#endif diff --git a/include/cantera/thermo/AdsorbateThermo.h b/include/cantera/thermo/AdsorbateThermo.h index fe298042b..750ba5f2d 100644 --- a/include/cantera/thermo/AdsorbateThermo.h +++ b/include/cantera/thermo/AdsorbateThermo.h @@ -38,13 +38,6 @@ namespace Cantera class Adsorbate : public SpeciesThermoInterpType { public: - //! Empty constructor - //! @deprecated Default constructor to be removed after Cantera 2.3. - Adsorbate() { - warn_deprecated("Adsorbate::Adsorbate()", - "Default constructor to be removed after Cantera 2.3."); - } - //! Full Constructor /*! * @param tlow output - Minimum temperature @@ -60,11 +53,6 @@ public: std::copy(coeffs+2, coeffs + 2 + m_freq.size(), m_freq.begin()); } - virtual SpeciesThermoInterpType* - duplMyselfAsSpeciesThermoInterpType() const { - return new Adsorbate(*this); - } - virtual int reportType() const { return ADSORBATE; } diff --git a/include/cantera/thermo/ConstCpPoly.h b/include/cantera/thermo/ConstCpPoly.h index 24483cc29..2a81f7af9 100644 --- a/include/cantera/thermo/ConstCpPoly.h +++ b/include/cantera/thermo/ConstCpPoly.h @@ -43,10 +43,6 @@ namespace Cantera class ConstCpPoly: public SpeciesThermoInterpType { public: - //! empty constructor - //! @deprecated To be removed after Cantera 2.3. - ConstCpPoly(); - //! Normal constructor /*! * @param tlow Minimum temperature @@ -62,9 +58,6 @@ public: */ ConstCpPoly(double tlow, double thigh, double pref, const double* coeffs); - virtual SpeciesThermoInterpType* - duplMyselfAsSpeciesThermoInterpType() const; - virtual int reportType() const { return CONSTANT_CP; } @@ -88,10 +81,6 @@ public: doublereal& pref, doublereal* const coeffs) const; - //! @deprecated To be removed after Cantera 2.3. Use - //! MultiSpeciesThermo::modifySpecies instead. - virtual void modifyParameters(doublereal* coeffs); - virtual doublereal reportHf298(doublereal* const h298 = 0) const; virtual void modifyOneHf298(const size_t k, const doublereal Hf298New); virtual void resetHf298(); diff --git a/include/cantera/thermo/ConstDensityThermo.h b/include/cantera/thermo/ConstDensityThermo.h index c154bbf01..e7fa51ed4 100644 --- a/include/cantera/thermo/ConstDensityThermo.h +++ b/include/cantera/thermo/ConstDensityThermo.h @@ -32,11 +32,6 @@ public: //! Constructor. ConstDensityThermo() {} - ConstDensityThermo(const ConstDensityThermo& right); - ConstDensityThermo& operator=(const ConstDensityThermo& right); - virtual ThermoPhase* duplMyselfAsThermoPhase() const; - - virtual int eosType() const; virtual std::string type() const { return "ConstDensity"; } diff --git a/include/cantera/thermo/DebyeHuckel.h b/include/cantera/thermo/DebyeHuckel.h index d99b7688c..f90d1eb64 100644 --- a/include/cantera/thermo/DebyeHuckel.h +++ b/include/cantera/thermo/DebyeHuckel.h @@ -566,9 +566,6 @@ public: //! Default Constructor DebyeHuckel(); - DebyeHuckel(const DebyeHuckel&); - DebyeHuckel& operator=(const DebyeHuckel&); - virtual ThermoPhase* duplMyselfAsThermoPhase() const; virtual ~DebyeHuckel(); //! Full constructor for creating the phase. @@ -588,7 +585,6 @@ public: //! @name Utilities //! @{ - virtual int eosType() const; virtual std::string type() const { return "DebyeHuckel"; } diff --git a/include/cantera/thermo/EdgePhase.h b/include/cantera/thermo/EdgePhase.h index 00bd8f610..e4ff5a47d 100644 --- a/include/cantera/thermo/EdgePhase.h +++ b/include/cantera/thermo/EdgePhase.h @@ -36,15 +36,6 @@ public: */ EdgePhase(doublereal n0=1.0); - EdgePhase(const EdgePhase& right); - EdgePhase& operator=(const EdgePhase& right); - virtual ThermoPhase* duplMyselfAsThermoPhase() const; - - virtual int eosType() const { - warn_deprecated("EdgePhase::eosType", - "To be removed after Cantera 2.3."); - return cEdge; - } virtual std::string type() const { return "Edge"; } diff --git a/include/cantera/thermo/Elements.h b/include/cantera/thermo/Elements.h index d45893388..b808c6caa 100644 --- a/include/cantera/thermo/Elements.h +++ b/include/cantera/thermo/Elements.h @@ -86,12 +86,6 @@ namespace Cantera //! stable state at 298.15 K and 1 bar. #define ENTROPY298_UNKNOWN -123456789. -//! Function to look up an atomic weight -/*! - * @deprecated Replaced with getElementWeight(). To be removed after Cantera 2.3 - */ -double LookupWtElements(const std::string& ename); - //! Get the atomic weight of an element. /*! * Get the atomic weight of an element defined in Cantera by its symbol diff --git a/include/cantera/thermo/FixedChemPotSSTP.h b/include/cantera/thermo/FixedChemPotSSTP.h index 402487780..660c37345 100644 --- a/include/cantera/thermo/FixedChemPotSSTP.h +++ b/include/cantera/thermo/FixedChemPotSSTP.h @@ -166,7 +166,6 @@ public: */ FixedChemPotSSTP(XML_Node& phaseRef, const std::string& id = ""); - //! Special constructor for the FixecChemPotSSTP class setting an element //! chemical potential directly /*! @@ -179,17 +178,6 @@ public: */ FixedChemPotSSTP(const std::string& Ename, doublereal chemPot); - FixedChemPotSSTP(const FixedChemPotSSTP& right); - FixedChemPotSSTP& operator=(const FixedChemPotSSTP& right); - virtual ThermoPhase* duplMyselfAsThermoPhase() const; - - /** - * Equation of state flag. - * - * Returns the value cStoichSubstance, defined in mix_defs.h. - * @deprecated To be removed after Cantera 2.3. - */ - virtual int eosType() const; virtual std::string type() const { return "FixedChemPot"; } diff --git a/include/cantera/thermo/GeneralSpeciesThermo.h b/include/cantera/thermo/GeneralSpeciesThermo.h deleted file mode 100644 index 00f17ec95..000000000 --- a/include/cantera/thermo/GeneralSpeciesThermo.h +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @file GeneralSpeciesThermo.h - * @deprecated To be removed after Cantera 2.3. - */ - -#ifndef CT_GENERALSPECIESTHERMO_H -#define CT_GENERALSPECIESTHERMO_H - -#pragma message "Deprecated. GeneralSpeciesThermo.h will be removed after Cantera 2.3. Use MultiSpeciesThermo.h instead." - -#include "cantera/base/ct_defs.h" -#include "MultiSpeciesThermo.h" - -namespace Cantera -{ - -//! @deprecated To be removed after Cantera 2.3. Use class MultiSpeciesThermo -//! instead. -class GeneralSpeciesThermo : public MultiSpeciesThermo -{ - GeneralSpeciesThermo() { - warn_deprecated("class GeneralSpeciesThermo", "To be removed after" - " Cantera 2.3. Use class MultiSpeciesThermo instead."); - } -}; - -} - -#endif diff --git a/include/cantera/thermo/GibbsExcessVPSSTP.h b/include/cantera/thermo/GibbsExcessVPSSTP.h index ed7367369..41f160d8c 100644 --- a/include/cantera/thermo/GibbsExcessVPSSTP.h +++ b/include/cantera/thermo/GibbsExcessVPSSTP.h @@ -89,9 +89,6 @@ public: GibbsExcessVPSSTP() {} - GibbsExcessVPSSTP(const GibbsExcessVPSSTP& b); - GibbsExcessVPSSTP& operator=(const GibbsExcessVPSSTP& b); - virtual ThermoPhase* duplMyselfAsThermoPhase() const; //! @} //! @} diff --git a/include/cantera/thermo/HMWSoln.h b/include/cantera/thermo/HMWSoln.h index 9d8f5da81..b986a2aa0 100644 --- a/include/cantera/thermo/HMWSoln.h +++ b/include/cantera/thermo/HMWSoln.h @@ -1147,6 +1147,7 @@ class HMWSoln : public MolalityVPSSTP public: //! Default Constructor HMWSoln(); + ~HMWSoln(); //! Construct and initialize an HMWSoln ThermoPhase object //! directly from an ASCII input file @@ -1170,51 +1171,9 @@ public: */ HMWSoln(XML_Node& phaseRef, const std::string& id = ""); - HMWSoln(const HMWSoln& right); - HMWSoln& operator=(const HMWSoln& right); - virtual ~HMWSoln(); - virtual ThermoPhase* duplMyselfAsThermoPhase() const; - - //! Import, construct, and initialize a HMWSoln phase - //! specification from an XML tree into the current object. - /* - * This routine is a precursor to constructPhaseXML(XML_Node*) - * routine, which does most of the work. - * - * @param inputfile XML file containing the description of the phase - * @param id Optional parameter identifying the name of the - * phase. If none is given, the first XML - * phase element will be used. - * @deprecated Use initThermoFile() instead. To be removed after Cantera 2.3. - */ - void constructPhaseFile(std::string inputFile, std::string id); - - //! Import and initialize a HMWSoln phase specification in an XML tree - //! into the current object. - /*! - * Here we read an XML description of the phase. We import descriptions of - * the elements that make up the species in a phase. We import information - * about the species, including their reference state thermodynamic - * polynomials. We then freeze the state of the species. - * - * Then, we read the species molar volumes from the XML tree to finish the - * initialization. - * - * @param phaseNode This object must be the phase node of a complete XML - * tree description of the phase, including all of the species - * data. In other words while "phase" must point to an XML phase - * object, it must have sibling nodes "speciesData" that - * describe the species in the phase. - * @param id ID of the phase. If nonnull, a check is done to see if - * phaseNode is pointing to the phase with the correct id. - * @deprecated Use importPhase() instead. To be removed after Cantera 2.3. - */ - void constructPhaseXML(XML_Node& phaseNode, std::string id); - //! @name Utilities //! @{ - virtual int eosType() const; virtual std::string type() const { return "HMWSoln"; } diff --git a/include/cantera/thermo/IdealGasPhase.h b/include/cantera/thermo/IdealGasPhase.h index 0ec41ced7..71f7e162d 100644 --- a/include/cantera/thermo/IdealGasPhase.h +++ b/include/cantera/thermo/IdealGasPhase.h @@ -11,7 +11,6 @@ #ifndef CT_IDEALGASPHASE_H #define CT_IDEALGASPHASE_H -#include "mix_defs.h" #include "ThermoPhase.h" namespace Cantera @@ -310,20 +309,6 @@ public: */ IdealGasPhase(XML_Node& phaseRef, const std::string& id = ""); - IdealGasPhase(const IdealGasPhase& right); - IdealGasPhase& operator=(const IdealGasPhase& right); - virtual ThermoPhase* duplMyselfAsThermoPhase() const; - - //! Equation of state flag. - /*! - * Returns the value cIdealGas, defined in mix_defs.h. - * @deprecated To be removed after Cantera 2.3. - */ - virtual int eosType() const { - warn_deprecated("IdealGasPhase::eosType", - "To be removed after Cantera 2.3."); - return cIdealGas; - } virtual std::string type() const { return "IdealGas"; } diff --git a/include/cantera/thermo/IdealMolalSoln.h b/include/cantera/thermo/IdealMolalSoln.h index 72e65001f..162e58255 100644 --- a/include/cantera/thermo/IdealMolalSoln.h +++ b/include/cantera/thermo/IdealMolalSoln.h @@ -87,10 +87,6 @@ public: /// Constructor IdealMolalSoln(); - IdealMolalSoln(const IdealMolalSoln&); - IdealMolalSoln& operator=(const IdealMolalSoln&); - virtual ThermoPhase* duplMyselfAsThermoPhase() const; - //! Constructor for phase initialization /*! * This constructor will initialize a phase, by reading the required diff --git a/include/cantera/thermo/IdealSolidSolnPhase.h b/include/cantera/thermo/IdealSolidSolnPhase.h index 8f7283203..98e737064 100644 --- a/include/cantera/thermo/IdealSolidSolnPhase.h +++ b/include/cantera/thermo/IdealSolidSolnPhase.h @@ -18,16 +18,6 @@ namespace Cantera { -/*! - * @name CONSTANTS - Models for the Standard State of IdealSolidSolnPhase's - * @deprecated To be removed after Cantera 2.3. - */ -//@{ -const int cIdealSolidSolnPhase0 = 5010; -const int cIdealSolidSolnPhase1 = 5011; -const int cIdealSolidSolnPhase2 = 5012; -//@} - /** * Class IdealSolidSolnPhase represents a condensed phase ideal solution * compound. The phase and the pure species phases which comprise the standard @@ -91,16 +81,6 @@ public: */ IdealSolidSolnPhase(XML_Node& root, const std::string& id="", int formCG=0); - IdealSolidSolnPhase(const IdealSolidSolnPhase&); - IdealSolidSolnPhase& operator=(const IdealSolidSolnPhase&); - virtual ThermoPhase* duplMyselfAsThermoPhase() const; - - /** - * Equation of state flag. Returns a value depending upon the value of - * #m_formGC, which is defined at instantiation. - * @deprecated To be removed after Cantera 2.3. - */ - virtual int eosType() const; virtual std::string type() const { return "IdealSolidSoln"; } @@ -332,20 +312,6 @@ public: */ virtual doublereal standardConcentration(size_t k) const; - /** - * The reference (ie standard) concentration \f$ C^0_k \f$ used to normalize - * the generalized concentration. In many cases, this quantity will be the - * same for all species in a phase. However, for this case, we will return a - * distinct concentration for each species. (clone of the standard - * concentration -> suggest changing the name). This is the inverse of the - * species molar volume. - * - * @deprecated Unused duplicate of standardConcentration. To be removed - * after Cantera 2.3. - * @param k Species index. - */ - virtual doublereal referenceConcentration(int k) const; - //! Get the array of species activity coefficients /*! * @param ac output vector of activity coefficients. Length: m_kk diff --git a/include/cantera/thermo/IdealSolnGasVPSS.h b/include/cantera/thermo/IdealSolnGasVPSS.h index 0a205f7f6..1e377809e 100644 --- a/include/cantera/thermo/IdealSolnGasVPSS.h +++ b/include/cantera/thermo/IdealSolnGasVPSS.h @@ -17,16 +17,6 @@ namespace Cantera { -/*! - * @name CONSTANTS - * Models for the Standard State of an IdealSolnPhase - * @deprecated To be removed after Cantera 2.3. - */ -//@{ -const int cIdealSolnGasPhaseG = 6009; -const int cIdealSolnGasPhase0 = 6010; -const int cIdealSolnGasPhase1 = 6011; -const int cIdealSolnGasPhase2 = 6012; /** * @ingroup thermoprops @@ -47,15 +37,10 @@ public: /// Create an object from an XML input file IdealSolnGasVPSS(const std::string& infile, std::string id=""); - IdealSolnGasVPSS(const IdealSolnGasVPSS&); - IdealSolnGasVPSS& operator=(const IdealSolnGasVPSS&); - virtual ThermoPhase* duplMyselfAsThermoPhase() const; - //@} //! @name Utilities (IdealSolnGasVPSS) //@{ - virtual int eosType() const; virtual std::string type() const { return "IdealSolnGas"; } diff --git a/include/cantera/thermo/IonsFromNeutralVPSSTP.h b/include/cantera/thermo/IonsFromNeutralVPSSTP.h index 582e7bdb2..cb4ae512c 100644 --- a/include/cantera/thermo/IonsFromNeutralVPSSTP.h +++ b/include/cantera/thermo/IonsFromNeutralVPSSTP.h @@ -114,60 +114,16 @@ public: IonsFromNeutralVPSSTP(XML_Node& phaseRoot, const std::string& id = "", ThermoPhase* neutralPhase = 0); - IonsFromNeutralVPSSTP(const IonsFromNeutralVPSSTP& b); - IonsFromNeutralVPSSTP& operator=(const IonsFromNeutralVPSSTP& b); virtual ~IonsFromNeutralVPSSTP(); - virtual ThermoPhase* duplMyselfAsThermoPhase() const; // @} - - /// The following methods are used in the process of constructing - /// the phase and setting its parameters from a specification in an - /// input file. - - //! Initialization of an IonsFromNeutralVPSSTP phase using an XML file - /*! - * This routine is a precursor to initThermo(XML_Node*) routine, which does - * most of the work. - * - * @param inputFile XML file containing the description of the phase - * @param id Optional parameter identifying the name of the phase. If none - * is given, the first XML phase element will be used. - * @deprecated Use initThermoFile() instead. To be removed after Cantera 2.3. - */ - void constructPhaseFile(std::string inputFile, std::string id); - - //! Import and initialize an IonsFromNeutralVPSSTP phase specification in an - //! XML tree into the current object. - /*! - * Here we read an XML description of the phase. We import descriptions of - * the elements that make up the species in a phase. We import information - * about the species, including their reference state thermodynamic - * polynomials. We then freeze the state of the species. - * - * Then, we read the species molar volumes from the XML tree to finish the - * initialization. - * - * @param phaseNode This object must be the phase node of a complete XML - * tree description of the phase, including all of the species - * data. In other words while "phase" must point to an XML phase - * object, it must have sibling nodes "speciesData" that - * describe the species in the phase. - * @param id ID of the phase. If nonnull, a check is done to see if - * phaseNode is pointing to the phase with the correct id. - * @deprecated Use importPhase() instead. To be removed after Cantera 2.3. - */ - void constructPhaseXML(XML_Node& phaseNode, std::string id); - //! @name Utilities //! @{ - virtual int eosType() const; virtual std::string type() const { return "IonsFromNeutral"; } - //! @} //! @name Molar Thermodynamic Properties //! @{ diff --git a/include/cantera/thermo/LatticePhase.h b/include/cantera/thermo/LatticePhase.h index fa56bd011..8d75c3379 100644 --- a/include/cantera/thermo/LatticePhase.h +++ b/include/cantera/thermo/LatticePhase.h @@ -11,7 +11,6 @@ #ifndef CT_LATTICE_H #define CT_LATTICE_H -#include "mix_defs.h" #include "ThermoPhase.h" namespace Cantera @@ -235,10 +234,6 @@ public: //! Base Empty constructor LatticePhase(); - LatticePhase(const LatticePhase& right); - LatticePhase& operator=(const LatticePhase& right); - virtual ThermoPhase* duplMyselfAsThermoPhase() const; - //! Full constructor for a lattice phase /*! * @param inputFile String name of the input file @@ -253,13 +248,6 @@ public: */ LatticePhase(XML_Node& phaseRef, const std::string& id = ""); - //! Equation of state flag. Returns the value cLattice - //! @deprecated To be removed after Cantera 2.3. - virtual int eosType() const { - warn_deprecated("LatticePhase::eosType", - "To be removed after Cantera 2.3."); - return cLattice; - } virtual std::string type() const { return "Lattice"; } diff --git a/include/cantera/thermo/LatticeSolidPhase.h b/include/cantera/thermo/LatticeSolidPhase.h index abfbe7f7a..6aa7f3fd5 100644 --- a/include/cantera/thermo/LatticeSolidPhase.h +++ b/include/cantera/thermo/LatticeSolidPhase.h @@ -107,22 +107,8 @@ class LatticeSolidPhase : public ThermoPhase public: //! Base empty constructor LatticeSolidPhase(); - - LatticeSolidPhase(const LatticeSolidPhase& right); - LatticeSolidPhase& operator=(const LatticeSolidPhase& right); virtual ~LatticeSolidPhase(); - virtual ThermoPhase* duplMyselfAsThermoPhase() const; - //! Equation of state type flag. - /*! - * Returns cLatticeSolid, listed in mix_defs.h. - * @deprecated To be removed after Cantera 2.3. - */ - virtual int eosType() const { - warn_deprecated("LatticeSolidPhase::eosType", - "To be removed after Cantera 2.3."); - return cLatticeSolid; - } virtual std::string type() const { return "LatticeSolid"; } diff --git a/include/cantera/thermo/MargulesVPSSTP.h b/include/cantera/thermo/MargulesVPSSTP.h index dc92137d5..fc1bd9655 100644 --- a/include/cantera/thermo/MargulesVPSSTP.h +++ b/include/cantera/thermo/MargulesVPSSTP.h @@ -241,10 +241,6 @@ public: */ MargulesVPSSTP(XML_Node& phaseRef, const std::string& id = ""); - MargulesVPSSTP(const MargulesVPSSTP& b); - MargulesVPSSTP& operator=(const MargulesVPSSTP& b); - virtual ThermoPhase* duplMyselfAsThermoPhase() const; - virtual std::string type() const { return "Margules"; } diff --git a/include/cantera/thermo/MaskellSolidSolnPhase.h b/include/cantera/thermo/MaskellSolidSolnPhase.h index 4083a0a01..22b2b7e1d 100644 --- a/include/cantera/thermo/MaskellSolidSolnPhase.h +++ b/include/cantera/thermo/MaskellSolidSolnPhase.h @@ -29,10 +29,6 @@ class MaskellSolidSolnPhase : public VPStandardStateTP public: MaskellSolidSolnPhase(); - MaskellSolidSolnPhase(const MaskellSolidSolnPhase&); - MaskellSolidSolnPhase& operator=(const MaskellSolidSolnPhase&); - virtual ThermoPhase* duplMyselfAsThermoPhase() const; - virtual std::string type() const { return "MaskellSolidsoln"; } diff --git a/include/cantera/thermo/MetalPhase.h b/include/cantera/thermo/MetalPhase.h index 610c80c5a..2cad63efb 100644 --- a/include/cantera/thermo/MetalPhase.h +++ b/include/cantera/thermo/MetalPhase.h @@ -8,7 +8,6 @@ #ifndef CT_METALPHASE_H #define CT_METALPHASE_H -#include "mix_defs.h" #include "ThermoPhase.h" #include "cantera/base/ctml.h" @@ -25,30 +24,8 @@ class MetalPhase : public ThermoPhase public: MetalPhase() {} - MetalPhase(const MetalPhase& right) { - *this = right; - } - - MetalPhase& operator=(const MetalPhase& right) { - if (&right != this) { - ThermoPhase::operator=(right); - m_press = right.m_press; - } - return *this; - } - - virtual ThermoPhase* duplMyselfAsThermoPhase() const { - MetalPhase* idg = new MetalPhase(*this); - return (ThermoPhase*) idg; - } - // Overloaded methods of class ThermoPhase - virtual int eosType() const { - warn_deprecated("MetalPhase::eosType", - "To be removed after Cantera 2.3."); - return cMetal; - } virtual std::string type() const { return "Metal"; } diff --git a/include/cantera/thermo/MetalSHEelectrons.h b/include/cantera/thermo/MetalSHEelectrons.h index ecbd00d59..5cbbbd24f 100644 --- a/include/cantera/thermo/MetalSHEelectrons.h +++ b/include/cantera/thermo/MetalSHEelectrons.h @@ -203,21 +203,6 @@ public: */ MetalSHEelectrons(XML_Node& phaseRef, const std::string& id = ""); - MetalSHEelectrons(const MetalSHEelectrons& right); - MetalSHEelectrons& operator=(const MetalSHEelectrons& right); - virtual ThermoPhase* duplMyselfAsThermoPhase() const; - - /** - * Equation of state flag. - * - * Returns the value cMetalSHEelectrons, defined in mix_defs.h. - * @deprecated To be removed after Cantera 2.3. - */ - virtual int eosType() const; - virtual std::string type() const { - return "MetalSHEelectrons"; - } - //! @name Mechanical Equation of State //! @{ diff --git a/include/cantera/thermo/MineralEQ3.h b/include/cantera/thermo/MineralEQ3.h index 99d444e04..ade9a154e 100644 --- a/include/cantera/thermo/MineralEQ3.h +++ b/include/cantera/thermo/MineralEQ3.h @@ -115,17 +115,6 @@ public: */ MineralEQ3(XML_Node& phaseRef, const std::string& id = ""); - MineralEQ3(const MineralEQ3& right); - MineralEQ3& operator=(const MineralEQ3& right); - virtual ThermoPhase* duplMyselfAsThermoPhase() const; - - /** - * Equation of state flag. - * - * Returns the value cStoichSubstance, defined in mix_defs.h. - * @deprecated To be removed after Cantera 2.3. - */ - virtual int eosType() const; virtual std::string type() const { return "MineralEQ3"; } diff --git a/include/cantera/thermo/MixedSolventElectrolyte.h b/include/cantera/thermo/MixedSolventElectrolyte.h index 0a89d6cef..689b19a23 100644 --- a/include/cantera/thermo/MixedSolventElectrolyte.h +++ b/include/cantera/thermo/MixedSolventElectrolyte.h @@ -240,10 +240,6 @@ public: */ MixedSolventElectrolyte(XML_Node& phaseRef, const std::string& id = ""); - MixedSolventElectrolyte(const MixedSolventElectrolyte& b); - MixedSolventElectrolyte& operator=(const MixedSolventElectrolyte& b); - virtual ThermoPhase* duplMyselfAsThermoPhase() const; - virtual std::string type() const { return "MixedSolventElectrolyte"; } diff --git a/include/cantera/thermo/MixtureFugacityTP.h b/include/cantera/thermo/MixtureFugacityTP.h index de9aa1d87..7444230cc 100644 --- a/include/cantera/thermo/MixtureFugacityTP.h +++ b/include/cantera/thermo/MixtureFugacityTP.h @@ -80,10 +80,6 @@ public: //! Constructor. MixtureFugacityTP(); - MixtureFugacityTP(const MixtureFugacityTP& b); - MixtureFugacityTP& operator=(const MixtureFugacityTP& b); - virtual ThermoPhase* duplMyselfAsThermoPhase() const; - //! @} //! @name Utilities //! @{ diff --git a/include/cantera/thermo/MolalityVPSSTP.h b/include/cantera/thermo/MolalityVPSSTP.h index f9b5c2580..9bd80ad31 100644 --- a/include/cantera/thermo/MolalityVPSSTP.h +++ b/include/cantera/thermo/MolalityVPSSTP.h @@ -191,10 +191,6 @@ public: */ MolalityVPSSTP(); - MolalityVPSSTP(const MolalityVPSSTP& b); - MolalityVPSSTP& operator=(const MolalityVPSSTP& b); - virtual ThermoPhase* duplMyselfAsThermoPhase() const; - //! @name Utilities //! @{ diff --git a/include/cantera/thermo/MolarityIonicVPSSTP.h b/include/cantera/thermo/MolarityIonicVPSSTP.h index 7e6a2076d..b05235b37 100644 --- a/include/cantera/thermo/MolarityIonicVPSSTP.h +++ b/include/cantera/thermo/MolarityIonicVPSSTP.h @@ -76,10 +76,6 @@ public: */ MolarityIonicVPSSTP(XML_Node& phaseRef, const std::string& id = ""); - MolarityIonicVPSSTP(const MolarityIonicVPSSTP& b); - MolarityIonicVPSSTP& operator=(const MolarityIonicVPSSTP& b); - virtual ThermoPhase* duplMyselfAsThermoPhase() const; - virtual std::string type() const { return "MolarityIonic"; } diff --git a/include/cantera/thermo/Mu0Poly.h b/include/cantera/thermo/Mu0Poly.h index 34f1e2127..26293024c 100644 --- a/include/cantera/thermo/Mu0Poly.h +++ b/include/cantera/thermo/Mu0Poly.h @@ -73,10 +73,6 @@ class XML_Node; class Mu0Poly: public SpeciesThermoInterpType { public: - //! Constructor - //! @deprecated Default constructor to be removed after Cantera 2.3. - Mu0Poly(); - //! Normal constructor /*! * In the constructor, we calculate and store the piecewise linear @@ -102,9 +98,6 @@ public: */ Mu0Poly(double tlow, double thigh, double pref, const double* coeffs); - virtual SpeciesThermoInterpType* - duplMyselfAsSpeciesThermoInterpType() const; - virtual int reportType() const { return MU0_INTERP; } @@ -128,10 +121,6 @@ public: doublereal& pref, doublereal* const coeffs) const; - //! @deprecated To be removed after Cantera 2.3. Use - //! MultiSpeciesThermo::modifySpecies instead. - virtual void modifyParameters(doublereal* coeffs); - protected: //! Number of intervals in the interpolating linear approximation. Number //! of points is one more than the number of intervals. diff --git a/include/cantera/thermo/MultiSpeciesThermo.h b/include/cantera/thermo/MultiSpeciesThermo.h index bb14b11a7..73e74efc0 100644 --- a/include/cantera/thermo/MultiSpeciesThermo.h +++ b/include/cantera/thermo/MultiSpeciesThermo.h @@ -49,21 +49,11 @@ public: //! Constructor MultiSpeciesThermo(); - //! @deprecated To be removed after Cantera 2.3. - MultiSpeciesThermo(const MultiSpeciesThermo& b); - //! @deprecated To be removed after Cantera 2.3. - MultiSpeciesThermo& operator=(const MultiSpeciesThermo& b); + // MultiSpeciesThermo objects are not copyable or assignable + MultiSpeciesThermo(const MultiSpeciesThermo& b) = delete; + MultiSpeciesThermo& operator=(const MultiSpeciesThermo& b) = delete; virtual ~MultiSpeciesThermo() {} - //! Duplication routine for objects derived from MultiSpeciesThermo - /*! - * This function can be used to duplicate objects derived from - * MultiSpeciesThermo even if the application only has a pointer to - * MultiSpeciesThermo to work with. - * @deprecated To be removed after Cantera 2.3. - */ - virtual MultiSpeciesThermo* duplMyselfAsSpeciesThermo() const; - //! Install a new species thermodynamic property parameterization for one //! species. /*! diff --git a/include/cantera/thermo/Nasa9Poly1.h b/include/cantera/thermo/Nasa9Poly1.h index 2c52989aa..8282bbd66 100644 --- a/include/cantera/thermo/Nasa9Poly1.h +++ b/include/cantera/thermo/Nasa9Poly1.h @@ -61,10 +61,6 @@ namespace Cantera class Nasa9Poly1 : public SpeciesThermoInterpType { public: - //! Empty constructor - //! @deprecated Default constructor to be removed after Cantera 2.3. - Nasa9Poly1(); - //! Normal constructor /*! * @param tlow Minimum temperature @@ -75,9 +71,6 @@ public: */ Nasa9Poly1(double tlow, double thigh, double pref, const double* coeffs); - virtual SpeciesThermoInterpType* - duplMyselfAsSpeciesThermoInterpType() const; - virtual int reportType() const; virtual size_t temperaturePolySize() const { return 7; } @@ -125,10 +118,6 @@ public: doublereal& pref, doublereal* const coeffs) const; - //! @deprecated To be removed after Cantera 2.3. Use - //! MultiSpeciesThermo::modifySpecies instead. - virtual void modifyParameters(doublereal* coeffs); - protected: //! array of polynomial coefficients vector_fp m_coeff; diff --git a/include/cantera/thermo/Nasa9PolyMultiTempRegion.h b/include/cantera/thermo/Nasa9PolyMultiTempRegion.h index 1f0269c64..5e153ebad 100644 --- a/include/cantera/thermo/Nasa9PolyMultiTempRegion.h +++ b/include/cantera/thermo/Nasa9PolyMultiTempRegion.h @@ -36,10 +36,6 @@ namespace Cantera class Nasa9PolyMultiTempRegion : public SpeciesThermoInterpType { public: - //! Empty constructor - //! @deprecated Default constructor to be removed after Cantera 2.3. - Nasa9PolyMultiTempRegion(); - //! Constructor used in templated instantiations /*! * @param regionPts Vector of pointers to Nasa9Poly1 objects. These objects @@ -53,13 +49,8 @@ public: */ Nasa9PolyMultiTempRegion(std::vector ®ionPts); - Nasa9PolyMultiTempRegion(const Nasa9PolyMultiTempRegion& b); - Nasa9PolyMultiTempRegion& operator=(const Nasa9PolyMultiTempRegion& b); virtual ~Nasa9PolyMultiTempRegion(); - virtual SpeciesThermoInterpType* - duplMyselfAsSpeciesThermoInterpType() const; - virtual int reportType() const; virtual size_t temperaturePolySize() const { return 7; } @@ -98,10 +89,6 @@ public: doublereal& pref, doublereal* const coeffs) const; - //! @deprecated To be removed after Cantera 2.3. Use - //! MultiSpeciesThermo::modifySpecies instead. - virtual void modifyParameters(doublereal* coeffs); - protected: //! Lower boundaries of each temperature regions vector_fp m_lowerTempBounds; diff --git a/include/cantera/thermo/NasaPoly1.h b/include/cantera/thermo/NasaPoly1.h index 131f2210e..252e3132c 100644 --- a/include/cantera/thermo/NasaPoly1.h +++ b/include/cantera/thermo/NasaPoly1.h @@ -45,14 +45,6 @@ namespace Cantera class NasaPoly1 : public SpeciesThermoInterpType { public: - //! Empty constructor - //! @deprecated Default constructor to be removed after Cantera 2.3. - NasaPoly1() - : m_coeff(7, 0.0) { - warn_deprecated("NasaPoly1::NasaPoly1()", - "Default constructor to be removed after Cantera 2.3."); - } - //! Normal constructor /*! * @param tlow Minimum temperature @@ -68,11 +60,6 @@ public: m_coeff5_orig = m_coeff[5]; } - virtual SpeciesThermoInterpType* - duplMyselfAsSpeciesThermoInterpType() const { - return new NasaPoly1(*this); - } - virtual int reportType() const { return NASA1; } @@ -140,14 +127,6 @@ public: std::copy(m_coeff.begin(), m_coeff.end(), coeffs); } - //! @deprecated To be removed after Cantera 2.3. Use - //! MultiSpeciesThermo::modifySpecies instead. - virtual void modifyParameters(doublereal* coeffs) { - warn_deprecated("NasaPoly1::modifyParameters", "To be removed after " - "Cantera 2.3. Use MultiSpeciesThermo::modifySpecies instead."); - std::copy(coeffs, coeffs+7, m_coeff.begin()); - } - virtual doublereal reportHf298(doublereal* const h298 = 0) const { double tt[6]; double temp = 298.15; diff --git a/include/cantera/thermo/NasaPoly2.h b/include/cantera/thermo/NasaPoly2.h index f22e277f6..59dcb8dba 100644 --- a/include/cantera/thermo/NasaPoly2.h +++ b/include/cantera/thermo/NasaPoly2.h @@ -48,15 +48,6 @@ namespace Cantera class NasaPoly2 : public SpeciesThermoInterpType { public: - //! Empty constructor - //! @deprecated Default constructor to be removed after Cantera 2.3. - NasaPoly2() - : m_midT(0.0), - m_coeff(15, 0.0) { - warn_deprecated("NasaPoly2::NasaPoly2()", - "Default constructor to be removed after Cantera 2.3."); - } - //! Full Constructor /*! * @param tlow output - Minimum temperature @@ -76,12 +67,6 @@ public: m_coeff(coeffs, coeffs + 15) { } - virtual SpeciesThermoInterpType* - duplMyselfAsSpeciesThermoInterpType() const { - NasaPoly2* np = new NasaPoly2(*this); - return (SpeciesThermoInterpType*) np; - } - virtual int reportType() const { return NASA2; } diff --git a/include/cantera/thermo/PDSS.h b/include/cantera/thermo/PDSS.h index 667c9cbb1..e369471af 100644 --- a/include/cantera/thermo/PDSS.h +++ b/include/cantera/thermo/PDSS.h @@ -11,7 +11,6 @@ #ifndef CT_PDSS_H #define CT_PDSS_H #include "cantera/base/ct_defs.h" -#include "mix_defs.h" namespace Cantera { @@ -192,36 +191,15 @@ public: */ PDSS(VPStandardStateTP* tp, size_t spindex); - //! @deprecated Copy constructor to be removed after Cantera 2.3 for all - //! classes derived from PDSS. - PDSS(const PDSS& b); - //! @deprecated Assignment operator to be removed after Cantera 2.3 for all - //! classes derived from PDSS. - PDSS& operator=(const PDSS& b); + // PDSS objects are not copyable or assignable + PDSS(const PDSS& b) = delete; + PDSS& operator=(const PDSS& b) = delete; virtual ~PDSS() {} - //! Duplication routine for objects which inherit from PDSS - /*! - * This function can be used to duplicate objects derived from PDSS even - * if the application only has a pointer to PDSS to work with. - * - * @return A pointer to the base PDSS object type - * @deprecated To be removed after Cantera 2.3 for all classes derived from - * PDSS. - */ - virtual PDSS* duplMyselfAsPDSS() const; - //! @} //! @name Utilities //! @{ - //! Returns the type of the standard state parameterization - /*! - * @return The integer # of the parameterization - * @deprecated To be removed after Cantera 2.3. - */ - PDSS_enumType reportPDSSType() const; - //! @} //! @name Molar Thermodynamic Properties of the Species Standard State in //! the Solution @@ -495,7 +473,7 @@ public: //! all of the parameters for the species, index. /*! * @param kindex Species index - * @param type Integer type of the standard type + * @param type Integer type of the standard type (unused) * @param c Vector of coefficients used to set the * parameters for the standard state. * @param minTemp output - Minimum temperature @@ -513,30 +491,9 @@ private: */ void initPtrs(); -public: - //! Initialize or Reinitialize all shallow pointers in the object - /*! - * This command is called to reinitialize all shallow pointers in the - * object. It's needed for the duplicator capability - * - * @param vptp_ptr Pointer to the Variable pressure ThermoPhase object - * @param vpssmgr_ptr Pointer to the variable pressure standard state - * calculator for this phase - * @param spthermo_ptr Pointer to the optional MultiSpeciesThermo object - * that will handle the calculation of the reference - * state thermodynamic coefficients. - * @deprecated To be removed after Cantera 2.3 for all classes derived from - * PDSS. - */ - virtual void initAllPtrs(VPStandardStateTP* vptp_ptr, VPSSMgr* vpssmgr_ptr, - MultiSpeciesThermo* spthermo_ptr); //@} protected: - //! Enumerated type describing the type of the PDSS object - //! @deprecated To be removed after Cantera 2.3. - PDSS_enumType m_pdssType; - //! Current temperature used by the PDSS object mutable doublereal m_temp; diff --git a/include/cantera/thermo/PDSS_ConstVol.h b/include/cantera/thermo/PDSS_ConstVol.h index e1c58eb6d..0f6409206 100644 --- a/include/cantera/thermo/PDSS_ConstVol.h +++ b/include/cantera/thermo/PDSS_ConstVol.h @@ -32,22 +32,6 @@ public: */ PDSS_ConstVol(VPStandardStateTP* tp, size_t spindex); - //! Constructor that initializes the object by examining the input file - //! of the ThermoPhase object - /*! - * This function calls the constructPDSSFile member function. - * - * @param tp Pointer to the ThermoPhase object pertaining to the phase - * @param spindex Species index of the species in the phase - * @param inputFile String name of the input file - * @param id String name of the phase in the input file. The default - * is the empty string, in which case the first phase in - * the file is used. - * @deprecated To be removed after Cantera 2.3. - */ - PDSS_ConstVol(VPStandardStateTP* tp, size_t spindex, - const std::string& inputFile, const std::string& id = ""); - //! Constructor that initializes the object by examining the input file //! of the ThermoPhase object /*! @@ -63,10 +47,6 @@ public: PDSS_ConstVol(VPStandardStateTP* vptp_ptr, size_t spindex, const XML_Node& speciesNode, const XML_Node& phaseRef, bool spInstalled); - PDSS_ConstVol(const PDSS_ConstVol& b); - PDSS_ConstVol& operator=(const PDSS_ConstVol& b); - virtual PDSS* duplMyselfAsPDSS() const; - //! @} //! @name Molar Thermodynamic Properties of the Species Standard State in //! the Solution @@ -113,22 +93,6 @@ public: virtual void initThermo(); - //! Initialization of a PDSS object using an input XML file. - /*! - * This routine is a precursor to constructPDSSXML(XML_Node*) routine, which - * does most of the work. - * - * @param vptp_ptr Pointer to the Variable pressure ThermoPhase object - * @param spindex Species index within the phase - * @param inputFile XML file containing the description of the phase - * @param id Optional parameter identifying the name of the phase. - * If none is given, the first XML phase element will be - * used. - * @deprecated To be removed after Cantera 2.3. - */ - void constructPDSSFile(VPStandardStateTP* vptp_ptr, size_t spindex, - const std::string& inputFile, const std::string& id); - //! Initialization of a PDSS object using an XML tree /*! * This routine is a driver for the initialization of the object. diff --git a/include/cantera/thermo/PDSS_HKFT.h b/include/cantera/thermo/PDSS_HKFT.h index b545714a2..0ba8c5f68 100644 --- a/include/cantera/thermo/PDSS_HKFT.h +++ b/include/cantera/thermo/PDSS_HKFT.h @@ -40,22 +40,6 @@ public: */ PDSS_HKFT(VPStandardStateTP* tp, size_t spindex); - //! Constructor that initializes the object by examining the input file - //! of the ThermoPhase object - /*! - * This function calls the constructPDSSFile member function. - * - * @param vptp_ptr Pointer to the ThermoPhase object pertaining to the phase - * @param spindex Species index of the species in the phase - * @param inputFile String name of the input file - * @param id String name of the phase in the input file. The default - * is the empty string, in which case the first phase in the - * file is used. - * @deprecated To be removed after Cantera 2.3. - */ - PDSS_HKFT(VPStandardStateTP* vptp_ptr, size_t spindex, - const std::string& inputFile, const std::string& id = ""); - //! Constructor that initializes the object by examining the input file //! of the ThermoPhase object /*! @@ -71,10 +55,7 @@ public: PDSS_HKFT(VPStandardStateTP* vptp_ptr, size_t spindex, const XML_Node& speciesNode, const XML_Node& phaseRef, bool spInstalled); - PDSS_HKFT(const PDSS_HKFT& b); - PDSS_HKFT& operator=(const PDSS_HKFT& b); virtual ~PDSS_HKFT(); - virtual PDSS* duplMyselfAsPDSS() const; //! @} //! @name Molar Thermodynamic Properties of the Solution @@ -128,22 +109,6 @@ public: virtual void initThermo(); - //! Initialization of a PDSS object using an input XML file. - /*! - * This routine is a precursor to constructPDSSXML(XML_Node*) - * routine, which does most of the work. - * - * @param vptp_ptr Pointer to the Variable pressure ThermoPhase object - * @param spindex Species index within the phase - * @param inputFile XML file containing the description of the phase - * @param id Optional parameter identifying the name of the - * phase. If none is given, the first XML - * phase element will be used. - * @deprecated To be removed after Cantera 2.3. - */ - void constructPDSSFile(VPStandardStateTP* vptp_ptr, size_t spindex, - const std::string& inputFile, const std::string& id); - //! Initialization of a PDSS object using an XML tree /*! * This routine is a driver for the initialization of the object. @@ -165,9 +130,6 @@ public: const XML_Node& speciesNode, const XML_Node& phaseNode, bool spInstalled); - virtual void initAllPtrs(VPStandardStateTP* vptp_ptr, VPSSMgr* vpssmgr_ptr, - MultiSpeciesThermo* spthermo_ptr); - //! This utility function reports back the type of parameterization and //! all of the parameters for the species, index. /*! diff --git a/include/cantera/thermo/PDSS_IdealGas.h b/include/cantera/thermo/PDSS_IdealGas.h index 96b9c00bd..d85d618bb 100644 --- a/include/cantera/thermo/PDSS_IdealGas.h +++ b/include/cantera/thermo/PDSS_IdealGas.h @@ -34,22 +34,6 @@ public: */ PDSS_IdealGas(VPStandardStateTP* tp, int spindex); - //! Constructor that initializes the object by examining the input file - //! of the ThermoPhase object - /*! - * This function calls the constructPDSSFile member function. - * - * @param tp Pointer to the ThermoPhase object pertaining to the phase - * @param spindex Species index of the species in the phase - * @param inputFile String name of the input file - * @param id String name of the phase in the input file. The default - * is the empty string, in which case the first phase in - * the file is used. - * @deprecated To be removed after Cantera 2.3. - */ - PDSS_IdealGas(VPStandardStateTP* tp, int spindex, - const std::string& inputFile, const std::string& id = ""); - //! Constructor that initializes the object by examining the input file //! of the ThermoPhase object /*! @@ -65,10 +49,6 @@ public: PDSS_IdealGas(VPStandardStateTP* vptp_ptr, size_t spindex, const XML_Node& speciesNode, const XML_Node& phaseRef, bool spInstalled); - PDSS_IdealGas(const PDSS_IdealGas& b); - PDSS_IdealGas& operator=(const PDSS_IdealGas& b); - virtual PDSS* duplMyselfAsPDSS() const; - //! @} //! @name Molar Thermodynamic Properties of the Species Standard State in the Solution //! @{ @@ -109,22 +89,6 @@ public: //! @name Initialization of the Object //! @{ - //! Initialization of a PDSS object using an input XML file. - /*! - * This routine is a precursor to constructPDSSXML(XML_Node*) - * routine, which does most of the work. - * - * @param vptp_ptr Pointer to the Variable pressure ThermoPhase object - * @param spindex Species index within the phase - * @param inputFile XML file containing the description of the phase - * @param id Optional parameter identifying the name of the - * phase. If none is given, the first XML - * phase element will be used. - * @deprecated To be removed after Cantera 2.3. - */ - void constructPDSSFile(VPStandardStateTP* vptp_ptr, size_t spindex, - const std::string& inputFile, const std::string& id); - //!Initialization of a PDSS object using an XML tree /*! * This routine is a driver for the initialization of the object. diff --git a/include/cantera/thermo/PDSS_IonsFromNeutral.h b/include/cantera/thermo/PDSS_IonsFromNeutral.h index fdabe3305..b127af575 100644 --- a/include/cantera/thermo/PDSS_IonsFromNeutral.h +++ b/include/cantera/thermo/PDSS_IonsFromNeutral.h @@ -45,22 +45,6 @@ public: */ PDSS_IonsFromNeutral(VPStandardStateTP* tp, size_t spindex); - //! Constructor that initializes the object by examining the input file - //! of the ThermoPhase object - /*! - * This function calls the constructPDSSFile member function. - * - * @param tp Pointer to the ThermoPhase object pertaining to the phase - * @param spindex Species index of the species in the phase - * @param inputFile String name of the input file - * @param id String name of the phase in the input file. The default - * is the empty string, in which case the first phase in the - * file is used. - * @deprecated To be removed after Cantera 2.3. - */ - PDSS_IonsFromNeutral(VPStandardStateTP* tp, size_t spindex, - const std::string& inputFile, const std::string& id = ""); - //! Constructor that initializes the object by examining the input file //! of the ThermoPhase object /*! @@ -76,12 +60,6 @@ public: PDSS_IonsFromNeutral(VPStandardStateTP* vptp_ptr, size_t spindex, const XML_Node& speciesNode, const XML_Node& phaseRef, bool spInstalled); - PDSS_IonsFromNeutral(const PDSS_IonsFromNeutral& b); - PDSS_IonsFromNeutral& operator=(const PDSS_IonsFromNeutral& b); - virtual PDSS* duplMyselfAsPDSS() const; - virtual void initAllPtrs(VPStandardStateTP* vptp_ptr, VPSSMgr* vpssmgr_ptr, - MultiSpeciesThermo* spthermo_ptr); - //! @} //! @name Molar Thermodynamic Properties of the Species Standard State in the Solution //! @{ @@ -133,22 +111,6 @@ public: //! @name Initialization of the Object //! @{ - //! Initialization of a PDSS object using an input XML file. - /*! - * This routine is a precursor to constructPDSSXML(XML_Node*) - * routine, which does most of the work. - * - * @param vptp_ptr Pointer to the Variable pressure ThermoPhase object - * @param spindex Species index within the phase - * @param inputFile XML file containing the description of the phase - * @param id Optional parameter identifying the name of the - * phase. If none is given, the first XML - * phase element will be used. - * @deprecated To be removed after Cantera 2.3. - */ - void constructPDSSFile(VPStandardStateTP* vptp_ptr, size_t spindex, - const std::string& inputFile, const std::string& id); - //! Initialization of a PDSS object using an XML tree /*! * This routine is a driver for the initialization of the object. diff --git a/include/cantera/thermo/PDSS_SSVol.h b/include/cantera/thermo/PDSS_SSVol.h index 8b37b2a3e..c89b42049 100644 --- a/include/cantera/thermo/PDSS_SSVol.h +++ b/include/cantera/thermo/PDSS_SSVol.h @@ -173,22 +173,6 @@ public: */ PDSS_SSVol(VPStandardStateTP* tp, size_t spindex); - //! Constructor that initializes the object by examining the input file - //! of the ThermoPhase object - /*! - * This function calls the constructPDSSFile member function. - * - * @param tp Pointer to the ThermoPhase object pertaining to the phase - * @param spindex Species index of the species in the phase - * @param inputFile String name of the input file - * @param id String name of the phase in the input file. The default - * is the empty string, in which case the first phase in the - * file is used. - * @deprecated To be removed after Cantera 2.3. - */ - PDSS_SSVol(VPStandardStateTP* tp, size_t spindex, - const std::string& inputFile, const std::string& id = ""); - //! Constructor that initializes the object by examining the input file //! of the ThermoPhase object /*! @@ -204,10 +188,6 @@ public: PDSS_SSVol(VPStandardStateTP* vptp_ptr, size_t spindex, const XML_Node& speciesNode, const XML_Node& phaseRef, bool spInstalled); - PDSS_SSVol(const PDSS_SSVol& b); - PDSS_SSVol& operator=(const PDSS_SSVol& b); - virtual PDSS* duplMyselfAsPDSS() const; - //! @} //! @name Molar Thermodynamic Properties of the Species Standard State in the Solution //! @{ @@ -258,22 +238,6 @@ private: virtual void initThermo(); - //! Initialization of a PDSS object using an input XML file. - /*! - * This routine is a precursor to constructPDSSXML(XML_Node*) - * routine, which does most of the work. - * - * @param vptp_ptr Pointer to the Variable pressure ThermoPhase object - * @param spindex Species index within the phase - * @param inputFile XML file containing the description of the phase - * @param id Optional parameter identifying the name of the - * phase. If none is given, the first XML - * phase element will be used. - * @deprecated To be removed after Cantera 2.3. - */ - void constructPDSSFile(VPStandardStateTP* vptp_ptr, size_t spindex, - const std::string& inputFile, const std::string& id); - //! Initialization of a PDSS object using an XML tree /*! * This routine is a driver for the initialization of the object. diff --git a/include/cantera/thermo/PDSS_Water.h b/include/cantera/thermo/PDSS_Water.h index 291d42ad0..92a81a09c 100644 --- a/include/cantera/thermo/PDSS_Water.h +++ b/include/cantera/thermo/PDSS_Water.h @@ -68,22 +68,6 @@ public: */ PDSS_Water(VPStandardStateTP* tp, int spindex); - //! Constructor that initializes the object by examining the input file - //! of the variable pressure ThermoPhase object - /*! - * This function calls the constructPDSSFile member function. - * - * @param tp Pointer to the variable pressure ThermoPhase object pertaining to the phase - * @param spindex Species index of the species in the phase - * @param inputFile String name of the input file - * @param id String name of the phase in the input file. The default - * is the empty string, in which case the first phase in the - * file is used. - * @deprecated To be removed after Cantera 2.3. - */ - PDSS_Water(VPStandardStateTP* tp, int spindex, - const std::string& inputFile, const std::string& id = ""); - //! Constructor that initializes the object by examining the input file //! of the variable pressure ThermoPhase object /*! @@ -98,10 +82,6 @@ public: PDSS_Water(VPStandardStateTP* tp, int spindex, const XML_Node& speciesNode, const XML_Node& phaseRef, bool spInstalled); - PDSS_Water(const PDSS_Water& b); - PDSS_Water& operator=(const PDSS_Water& b); - virtual PDSS* duplMyselfAsPDSS() const; - //! @} //! @name Molar Thermodynamic Properties of the Species Standard State in the Solution //! @{ @@ -206,23 +186,6 @@ public: //! Internal routine that initializes the underlying water model void constructSet(); - //! Initialization of a PDSS object using an - //! input XML file. - /*! - * This routine is a precursor to constructPDSSXML(XML_Node*) - * routine, which does most of the work. - * - * @param vptp_ptr Pointer to the Variable pressure ThermoPhase object - * @param spindex Species index within the phase - * @param inputFile XML file containing the description of the phase - * @param id Optional parameter identifying the name of the - * phase. If none is given, the first XML - * phase element will be used. - * @deprecated To be removed after Cantera 2.3. - */ - void constructPDSSFile(VPStandardStateTP* vptp_ptr, int spindex, - const std::string& inputFile, const std::string& id); - //!Initialization of a PDSS object using an XML tree /*! * This routine is a driver for the initialization of the diff --git a/include/cantera/thermo/Phase.h b/include/cantera/thermo/Phase.h index 9635b9479..745e4f434 100644 --- a/include/cantera/thermo/Phase.h +++ b/include/cantera/thermo/Phase.h @@ -99,8 +99,10 @@ public: Phase(); //!< Default constructor. virtual ~Phase(); - Phase(const Phase& right); - Phase& operator=(const Phase& right); + + // Phase objects are not copyable or assignable + Phase(const Phase&) = delete; + Phase& operator=(const Phase&) = delete; //! Returns a const reference to the XML_Node that describes the phase. /*! diff --git a/include/cantera/thermo/PhaseCombo_Interaction.h b/include/cantera/thermo/PhaseCombo_Interaction.h index 4312257b2..8f4e06a0a 100644 --- a/include/cantera/thermo/PhaseCombo_Interaction.h +++ b/include/cantera/thermo/PhaseCombo_Interaction.h @@ -332,14 +332,9 @@ public: */ PhaseCombo_Interaction(XML_Node& phaseRef, const std::string& id = ""); - PhaseCombo_Interaction(const PhaseCombo_Interaction& b); - PhaseCombo_Interaction& operator=(const PhaseCombo_Interaction& b); - virtual ThermoPhase* duplMyselfAsThermoPhase() const; - //! @name Utilities //! @{ - virtual int eosType() const; virtual std::string type() const { return "PhaseCombo_Interaction"; } diff --git a/include/cantera/thermo/PureFluidPhase.h b/include/cantera/thermo/PureFluidPhase.h index fb6c038b5..7328085dd 100644 --- a/include/cantera/thermo/PureFluidPhase.h +++ b/include/cantera/thermo/PureFluidPhase.h @@ -15,7 +15,6 @@ #define CT_EOS_TPX_H #include "ThermoPhase.h" -#include "mix_defs.h" #include "cantera/tpx/Sub.h" namespace Cantera @@ -34,17 +33,6 @@ public: //! Empty Base Constructor PureFluidPhase(); - PureFluidPhase(const PureFluidPhase& right); - PureFluidPhase& operator=(const PureFluidPhase& right); - virtual ThermoPhase* duplMyselfAsThermoPhase() const; - - //! Equation of state type - //! @deprecated To be removed after Cantera 2.3. - virtual int eosType() const { - warn_deprecated("PureFluidPhase::eosType", - "To be removed after Cantera 2.3."); - return cPureFluid; - } virtual std::string type() const { return "PureFluid"; } diff --git a/include/cantera/thermo/RedlichKisterVPSSTP.h b/include/cantera/thermo/RedlichKisterVPSSTP.h index 499745a5b..b518a1a53 100644 --- a/include/cantera/thermo/RedlichKisterVPSSTP.h +++ b/include/cantera/thermo/RedlichKisterVPSSTP.h @@ -241,10 +241,6 @@ public: */ RedlichKisterVPSSTP(XML_Node& phaseRef, const std::string& id = ""); - RedlichKisterVPSSTP(const RedlichKisterVPSSTP& b); - RedlichKisterVPSSTP& operator=(const RedlichKisterVPSSTP& b); - virtual ThermoPhase* duplMyselfAsThermoPhase() const; - virtual std::string type() const { return "RedlichKister"; } @@ -433,17 +429,6 @@ private: */ void s_update_dlnActCoeff_dlnX_diag() const; -public: - //! Utility routine that calculates a literature expression - /*! - * @param VintOut Output contribution to the voltage corresponding to - * nonideal term - * @param voltsOut Output contribution to the voltage corresponding to - * nonideal term and mf term - * @deprecated Probably broken. To be removed after Cantera 2.3. - */ - void Vint(double& VintOut, double& voltsOut); - protected: //! number of binary interaction expressions size_t numBinaryInteractions_; diff --git a/include/cantera/thermo/RedlichKwongMFTP.h b/include/cantera/thermo/RedlichKwongMFTP.h index 2d4452f89..8633ebf57 100644 --- a/include/cantera/thermo/RedlichKwongMFTP.h +++ b/include/cantera/thermo/RedlichKwongMFTP.h @@ -52,11 +52,6 @@ public: */ RedlichKwongMFTP(XML_Node& phaseRef, const std::string& id = ""); - RedlichKwongMFTP(const RedlichKwongMFTP& right); - RedlichKwongMFTP& operator=(const RedlichKwongMFTP& right); - virtual ThermoPhase* duplMyselfAsThermoPhase() const; - - virtual int eosType() const; virtual std::string type() const { return "RedlichKwong"; } diff --git a/include/cantera/thermo/SemiconductorPhase.h b/include/cantera/thermo/SemiconductorPhase.h deleted file mode 100644 index 37ce3b6f7..000000000 --- a/include/cantera/thermo/SemiconductorPhase.h +++ /dev/null @@ -1,145 +0,0 @@ -/** - * @file SemiconductorPhase.h - */ - -// This file is part of Cantera. See License.txt in the top-level directory or -// at http://www.cantera.org/license.txt for license and copyright information. - -#ifndef CT_SEMICONDPHASE_H -#define CT_SEMICONDPHASE_H - -#include "mix_defs.h" -#include "ThermoPhase.h" -#include "cantera/base/ctml.h" - -namespace Cantera -{ - -const int cElectron = 0; -const int cHole = 1; - -/** - * @ingroup thermoprops - * - * Class SemiconductorPhase represents electrons and holes in a semiconductor. - * @deprecated Broken and unused. To be removed after Cantera 2.3. - * - */ -class SemiconductorPhase : public ThermoPhase -{ -public: - SemiconductorPhase() { - warn_deprecated("class SemiconductorPhase", - "To be removed after Cantera 2.3."); - } - SemiconductorPhase(std::string infile, std::string id=""); - - SemiconductorPhase(const SemiconductorPhase& right) { - *this = right; - } - - SemiconductorPhase& operator=(const SemiconductorPhase& right) { - if (&right != this) { - ThermoPhase::operator=(right); - m_press = right.m_press; - } - return *this; - } - - virtual ThermoPhase* duplMyselfAsThermoPhase() const { - SemiconductorPhase* idg = new SemiconductorPhase(*this); - return (ThermoPhase*) idg; - } - - // Overloaded methods of class ThermoPhase - - virtual int eosType() const { - warn_deprecated("SemiconductorPhase::eosType", - "To be removed after Cantera 2.3."); - return cSemiconductor; - } - virtual std::string type() const { - return "Semiconductor"; - } - - virtual void setPressure(doublereal pres) { - m_press = pres; - } - virtual doublereal pressure() const { - return m_press; - } - - virtual void setParametersFromXML(const XML_Node& eosdata) { - eosdata._require("model","Semiconductor"); - doublereal rho = getFloat(eosdata, "density", "-"); - setDensity(rho); - m_bandgap = getFloat(eosdata, "bandgap", "-"); - doublereal e_mass = getFloat(eosdata, "electron_mass", "-"); - doublereal h_mass = getFloat(eosdata, "hole_mass", "-"); - doublereal e_donor = getFloat(eosdata, "donor_energy", "-"); - doublereal n_donor = getFloat(eosdata, "donor_concentration", "-"); - doublereal e_acceptor = getFloat(eosdata, "acceptor_energy", "-"); - doublereal n_acceptor = getFloat(eosdata, "acceptor_concentration", "-"); - setEffectiveMasses(e_mass, h_mass); - setDonorDoping(n_donor, e_donor); - setAcceptorDoping(n_acceptor, e_acceptor); - } - - void setEffectiveMasses(doublereal e_mass, doublereal h_mass) { - m_emass = e_mass; - m_hmass = h_mass; - } - - void setDonorDoping(doublereal n_donor, doublereal e_donor) { - m_ndonor = n_donor; - m_edonor = e_donor; - } - - void setAcceptorDoping(doublereal n_acceptor, doublereal e_acceptor) { - m_nacceptor = n_acceptor; - m_eacceptor = e_acceptor; - } - - doublereal effectiveMass_e() const { - return m_emass; - } - - doublereal effectiveMass_h() const { - return m_hmass; - } - - doublereal fermiLevel() const { - return m_fermi_level; - } - - virtual void getChemPotentials(doublereal* mu) const; - doublereal nc() const; - doublereal nv() const; - - /*! - * Energy at the top of the conduction band. By default, energies are - * referenced to this energy, and so this function simply returns zero. - */ - doublereal ec() const; - doublereal ev() const; - doublereal bandgap() const { - return m_bandgap; - } - -private: - doublereal m_press; - doublereal m_emass; - doublereal m_hmass; - doublereal m_ndonor; - doublereal m_edonor; - doublereal m_nacceptor; - doublereal m_eacceptor; - doublereal m_fermi_level; - doublereal m_bandgap; - mutable vector_fp m_work; - - void initLengths(); -}; -} - -#endif diff --git a/include/cantera/thermo/ShomatePoly.h b/include/cantera/thermo/ShomatePoly.h index afd920291..2fe80c4de 100644 --- a/include/cantera/thermo/ShomatePoly.h +++ b/include/cantera/thermo/ShomatePoly.h @@ -57,13 +57,6 @@ namespace Cantera class ShomatePoly : public SpeciesThermoInterpType { public: - //! Empty constructor - //! @deprecated Default constructor to be removed after Cantera 2.3. - ShomatePoly() { - warn_deprecated("ShomatePoly::ShomatePoly()", - "Default constructor to be removed after Cantera 2.3."); - } - //! Normal constructor /*! * @param tlow Minimum temperature @@ -85,11 +78,6 @@ public: m_coeff5_orig = m_coeff[5]; } - virtual SpeciesThermoInterpType* - duplMyselfAsSpeciesThermoInterpType() const { - return new ShomatePoly(*this); - } - virtual int reportType() const { return SHOMATE; } @@ -156,16 +144,6 @@ public: } } - //! @deprecated To be removed after Cantera 2.3. Use - //! MultiSpeciesThermo::modifySpecies instead. - virtual void modifyParameters(doublereal* coeffs) { - warn_deprecated("ShomatePoly::modifyParameters", "To be removed after " - "Cantera 2.3. Use MultiSpeciesThermo::modifySpecies instead."); - for (size_t i = 0; i < 7; i++) { - m_coeff[i] = coeffs[i] * 1000 / GasConstant; - } - } - virtual doublereal reportHf298(doublereal* const h298 = 0) const { double cp_R, h_RT, s_R; updatePropertiesTemp(298.15, &cp_R, &h_RT, &s_R); @@ -232,16 +210,6 @@ protected: class ShomatePoly2 : public SpeciesThermoInterpType { public: - //! Empty constructor - //! @deprecated Default constructor to be removed after Cantera 2.3. - ShomatePoly2() - : m_midT(0.0) - { - warn_deprecated("ShomatePoly2::ShomatePoly2()", - "Default constructor to be removed after Cantera 2.3."); - m_coeff.resize(15); - } - //! Normal constructor /*! * @param tlow Minimum temperature @@ -259,11 +227,6 @@ public: { } - virtual SpeciesThermoInterpType* - duplMyselfAsSpeciesThermoInterpType() const { - return new ShomatePoly2(*this); - } - virtual int reportType() const { return SHOMATE2; } @@ -311,24 +274,6 @@ public: } } - //! Modify parameters for the standard state - /*! - * Here, we take the tact that we will just regenerate the object. - * - * @param coeffs Vector of coefficients used to set the - * parameters for the standard state. - * @deprecated To be removed after Cantera 2.3. Use - * MultiSpeciesThermo::modifySpecies instead. - */ - virtual void modifyParameters(doublereal* coeffs) { - warn_deprecated("ShomatePoly2::modifyParameters", "To be removed after " - "Cantera 2.3. Use MultiSpeciesThermo::modifySpecies instead."); - std::copy(coeffs, coeffs + 15, m_coeff.begin()); - m_midT = coeffs[0]; - msp_low = ShomatePoly(m_lowT, m_midT, m_Pref, coeffs+1); - msp_high = ShomatePoly(m_midT, m_highT, m_Pref, coeffs+8); - } - virtual doublereal reportHf298(doublereal* const h298 = 0) const { doublereal h; if (298.15 <= m_midT) { diff --git a/include/cantera/thermo/SingleSpeciesTP.h b/include/cantera/thermo/SingleSpeciesTP.h index 8c848d108..ba84a946b 100644 --- a/include/cantera/thermo/SingleSpeciesTP.h +++ b/include/cantera/thermo/SingleSpeciesTP.h @@ -59,17 +59,6 @@ public: //! Base empty constructor. SingleSpeciesTP(); - SingleSpeciesTP(const SingleSpeciesTP& right); - SingleSpeciesTP& operator=(const SingleSpeciesTP& right); - virtual ThermoPhase* duplMyselfAsThermoPhase() const; - - /** - * Returns the equation of state type flag. This is a modified base class. - * Therefore, if not overridden in derived classes, this call will throw an - * exception. - * @deprecated To be removed after Cantera 2.3. - */ - virtual int eosType() const; virtual std::string type() const { return "SingleSpecies"; } diff --git a/include/cantera/thermo/Species.h b/include/cantera/thermo/Species.h index d774ee7e7..77b663d2a 100644 --- a/include/cantera/thermo/Species.h +++ b/include/cantera/thermo/Species.h @@ -29,10 +29,9 @@ public: Species(const std::string& name, const compositionMap& comp, double charge=0.0, double size=1.0); - //! @deprecated To be removed after Cantera 2.3. - Species(const Species& other); - //! @deprecated To be removed after Cantera 2.3. - Species& operator=(const Species& other); + //! Species objects are not copyable or assignable + Species(const Species&) = delete; + Species& operator=(const Species& other) = delete; ~Species(); //! The name of the species diff --git a/include/cantera/thermo/SpeciesThermo.h b/include/cantera/thermo/SpeciesThermo.h deleted file mode 100644 index 56921914b..000000000 --- a/include/cantera/thermo/SpeciesThermo.h +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @file SpeciesThermo.h - * @deprecated To be removed after Cantera 2.3. - */ - -#ifndef CT_SPECIESTHERMO_H -#define CT_SPECIESTHERMO_H - -#pragma message "Deprecated. SpeciesThermo.h will be removed after Cantera 2.3. Use MultiSpeciesThermo.h instead." - -#include "cantera/base/ct_defs.h" -#include "MultiSpeciesThermo.h" - -namespace Cantera -{ - -//! @deprecated To be removed after Cantera 2.3. Use class MultiSpeciesThermo -//! instead. -class SpeciesThermo : public MultiSpeciesThermo -{ - SpeciesThermo() { - warn_deprecated("class SpeciesThermo", "To be removed after Cantera 2.3. " - "Use class MultiSpeciesThermo instead."); - } -}; - -} - -#endif diff --git a/include/cantera/thermo/SpeciesThermoInterpType.h b/include/cantera/thermo/SpeciesThermoInterpType.h index b8f939fbd..561012913 100644 --- a/include/cantera/thermo/SpeciesThermoInterpType.h +++ b/include/cantera/thermo/SpeciesThermoInterpType.h @@ -124,20 +124,12 @@ public: SpeciesThermoInterpType(double tlow, double thigh, double pref); - //! @deprecated Copy constructor to be removed after Cantera 2.3 for all - //! classes derived from SpeciesThermoInterpType. - SpeciesThermoInterpType(const SpeciesThermoInterpType& b); - //! @deprecated Assignment operator to be removed after Cantera 2.3 for all - //! classes derived from SpeciesThermoInterpType. - SpeciesThermoInterpType& operator=(const SpeciesThermoInterpType& b); + // SpeciesThermoInterpType objects are not copyable or assignable + SpeciesThermoInterpType(const SpeciesThermoInterpType& b) = delete; + SpeciesThermoInterpType& operator=(const SpeciesThermoInterpType& b) = delete; virtual ~SpeciesThermoInterpType() {} - //! @deprecated To be removed after Cantera 2.3 for all classes derived - //! from SpeciesThermoInterpType. - virtual SpeciesThermoInterpType* - duplMyselfAsSpeciesThermoInterpType() const = 0; - //! Returns the minimum temperature that the thermo parameterization is //! valid virtual doublereal minTemp() const { @@ -224,19 +216,6 @@ public: doublereal& refPressure, doublereal* const coeffs) const = 0; - //! Modify parameters for the standard state - /*! - * @param coeffs Vector of coefficients used to set the parameters for the - * standard state. - * @deprecated To be removed after Cantera 2.3. Use - * MultiSpeciesThermo::modifySpecies instead. - */ - virtual void modifyParameters(doublereal* coeffs) { - warn_deprecated("SpeciesThermoInterpType::modifyParameters", "To be " - "removed after Cantera 2.3. Use MultiSpeciesThermo::modifySpecies " - "instead."); - } - //! Report the 298 K Heat of Formation of the standard state of one species //! (J kmol-1) /*! @@ -299,10 +278,6 @@ protected: class STITbyPDSS : public SpeciesThermoInterpType { public: - //! Constructor - //! @deprecated Default constructor to be removed after Cantera 2.3. - STITbyPDSS(); - //! Main Constructor /*! * @param vpssmgr_ptr Pointer to the Variable pressure standard state @@ -313,26 +288,6 @@ public: */ STITbyPDSS(VPSSMgr* vpssmgr_ptr, PDSS* PDSS_ptr); - STITbyPDSS(const STITbyPDSS& b); - - virtual SpeciesThermoInterpType* duplMyselfAsSpeciesThermoInterpType() const; - - //! Initialize and/or Reinitialize all the pointers for this object - /*! - * This routine is needed because the STITbyPDSS object doesn't own the - * underlying objects. Therefore, shallow copies during duplication - * operations may fail. - * - * @param speciesIndex species index for this object. Note, this must agree - * with what was internally set before. - * @param vpssmgr_ptr Pointer to the Variable pressure standard state - * manager that owns the PDSS object that will handle calls for this - * object - * @param PDSS_ptr Pointer to the PDSS object that handles calls for - * this object - */ - void initAllPtrs(size_t speciesIndex, VPSSMgr* vpssmgr_ptr, PDSS* PDSS_ptr); - virtual doublereal minTemp() const; virtual doublereal maxTemp() const; virtual doublereal refPressure() const; @@ -352,13 +307,6 @@ public: doublereal& refPressure, doublereal* const coeffs) const; - //! @deprecated To be removed after Cantera 2.3. Use - //! MultiSpeciesThermo::modifySpecies instead. - virtual void modifyParameters(doublereal* coeffs) { - warn_deprecated("STITbyPDSS::modifyParameters", "To be removed after " - "Cantera 2.3. Use MultiSpeciesThermo::modifySpecies instead."); - } - private: //! Pointer to the Variable pressure standard state manager that owns the //! PDSS object that will handle calls for this object diff --git a/include/cantera/thermo/StoichSubstance.h b/include/cantera/thermo/StoichSubstance.h index 141256039..b2f36ecfd 100644 --- a/include/cantera/thermo/StoichSubstance.h +++ b/include/cantera/thermo/StoichSubstance.h @@ -169,17 +169,6 @@ public: */ StoichSubstance(XML_Node& phaseRef, const std::string& id = ""); - StoichSubstance(const StoichSubstance& right); - StoichSubstance& operator=(const StoichSubstance& right); - virtual ThermoPhase* duplMyselfAsThermoPhase() const; - - /** - * Equation of state flag. - * - * Returns the value cStoichSubstance, defined in mix_defs.h. - * @deprecated To be removed after Cantera 2.3. - */ - virtual int eosType() const; virtual std::string type() const { return "StoichSubstance"; } diff --git a/include/cantera/thermo/StoichSubstanceSSTP.h b/include/cantera/thermo/StoichSubstanceSSTP.h deleted file mode 100644 index 193ea1da7..000000000 --- a/include/cantera/thermo/StoichSubstanceSSTP.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef CT_STOICHSUBSTANCESSTP_H -#define CT_STOICHSUBSTANCESSTP_H - -#include "StoichSubstance.h" - -#pragma message "cantera/thermo/StoichSubstanceSSTP.h and class StoichSubstanceSSTP are deprecated. Use StoichSubstance.h and class StoichSubstance instead. To be removed after Cantera 2.3." - -namespace Cantera { - typedef StoichSubstance StoichSubstanceSSTP; -} - -#endif diff --git a/include/cantera/thermo/SurfPhase.h b/include/cantera/thermo/SurfPhase.h index debe78135..d7b0561f7 100644 --- a/include/cantera/thermo/SurfPhase.h +++ b/include/cantera/thermo/SurfPhase.h @@ -12,7 +12,6 @@ #ifndef CT_SURFPHASE_H #define CT_SURFPHASE_H -#include "mix_defs.h" #include "ThermoPhase.h" namespace Cantera @@ -166,20 +165,6 @@ public: */ SurfPhase(XML_Node& xmlphase); - SurfPhase(const SurfPhase& right); - SurfPhase& operator=(const SurfPhase& right); - virtual ThermoPhase* duplMyselfAsThermoPhase() const; - - //! Equation of state type flag. - /*! - * Redefine this to return cSurf, listed in mix_defs.h. - * @deprecated To be removed after Cantera 2.3. - */ - virtual int eosType() const { - warn_deprecated("SurfPhase::eosType", - "To be removed after Cantera 2.3."); - return cSurf; - } virtual std::string type() const { return "Surf"; } diff --git a/include/cantera/thermo/ThermoFactory.h b/include/cantera/thermo/ThermoFactory.h index 7d4b78fb8..9b48b94f6 100644 --- a/include/cantera/thermo/ThermoFactory.h +++ b/include/cantera/thermo/ThermoFactory.h @@ -97,31 +97,12 @@ private: * @returns a pointer to a new ThermoPhase instance matching the model string. * Returns NULL if something went wrong. Throws an exception * UnknownThermoPhaseModel if the string wasn't matched. - * @deprecated The `ThermoFactory*` argument to this function is deprecated and - * will be removed after Cantera 2.3. */ -inline ThermoPhase* newThermoPhase(const std::string& model, - ThermoFactory* f=0) +inline ThermoPhase* newThermoPhase(const std::string& model) { - if (f == 0) { - f = ThermoFactory::factory(); - } else { - warn_deprecated("newThermoPhase(string, ThermoFactory*)", - "The `ThermoFactory*` argument to this function is deprecated and" - " will be removed after Cantera 2.3."); - } - return f->create(model); + return ThermoFactory::factory()->create(model); } -//! Translate the eosType id into a string -/*! - * @param ieos eosType id of the phase. This is unique for the phase - * @param length maximum length of the return string. Defaults to 100 - * @returns a string representation of the eosType id for a phase - * @deprecated To be removed after Cantera 2.3. - */ -std::string eosTypeString(int ieos, int length = 100); - //! Create a new ThermoPhase object and initializes it according to the XML tree /*! * This routine first looks up the identity of the model for the solution diff --git a/include/cantera/thermo/ThermoPhase.h b/include/cantera/thermo/ThermoPhase.h index c54124485..b06ed14e4 100644 --- a/include/cantera/thermo/ThermoPhase.h +++ b/include/cantera/thermo/ThermoPhase.h @@ -99,42 +99,9 @@ public: virtual ~ThermoPhase(); - //! @deprecated Copy constructor to be removed after Cantera 2.3 for all - //! classes derived from ThermoPhase. - ThermoPhase(const ThermoPhase& right); - //! @deprecated Assignment operator to be removed after Cantera 2.3 for all - //! classes derived from ThermoPhase. - ThermoPhase& operator=(const ThermoPhase& right); - - //! Duplication routine for objects which inherit from ThermoPhase. - /*! - * This virtual routine can be used to duplicate ThermoPhase objects - * inherited from ThermoPhase even if the application only has - * a pointer to ThermoPhase to work with. - * - * These routines are basically wrappers around the derived copy - * constructor. - * @deprecated To be removed after Cantera 2.3 for all classes derived from - * ThermoPhase. - */ - virtual ThermoPhase* duplMyselfAsThermoPhase() const; - //! @name Information Methods //! @{ - //! Equation of state type flag. - /*! - * The base class returns zero. Subclasses should define this to return a - * unique non-zero value. Constants defined for this purpose are listed in - * mix_defs.h. - * @deprecated To be removed after Cantera 2.3. Use `type()` instead. - */ - virtual int eosType() const { - warn_deprecated("ThermoPhase::eosType", - "To be removed after Cantera 2.3."); - return 0; - } - //! String indicating the thermodynamic model implemented. Usually //! corresponds to the name of the derived class, less any suffixes such as //! "Phase", TP", "VPSS", etc. @@ -737,23 +704,6 @@ public: throw NotImplementedError("ThermoPhase::getStandardVolumes_ref"); } - //! Sets the reference composition - /*! - * @param x Mole fraction vector to set the reference composition to. - * If this is zero, then the reference mole fraction - * is set to the current mole fraction vector. - * @deprecated Unused. To be removed after Cantera 2.3. - */ - virtual void setReferenceComposition(const doublereal* const x); - - //! Gets the reference composition - /*! - * The reference mole fraction is a safe mole fraction. - * @param x Mole fraction vector containing the reference composition. - * @deprecated Unused. To be removed after Cantera 2.3. - */ - virtual void getReferenceComposition(doublereal* const x) const; - // The methods below are not virtual, and should not be overloaded. //@} @@ -791,17 +741,6 @@ public: } //@} - //! Return the Gas Constant multiplied by the current temperature - /*! - * The units are Joules kmol-1. - * @deprecated use RT() instead. To be removed after Cantera 2.3. - */ - doublereal _RT() const { - warn_deprecated("ThermoPhase::_RT()", - "use RT() instead. To be removed after Cantera 2.3."); - return temperature() * GasConstant; - } - //! Return the Gas Constant multiplied by the current temperature /*! * The units are Joules kmol-1 @@ -1431,22 +1370,6 @@ public: //! data for this phase. const std::vector & speciesData() const; - //! Install a species thermodynamic property manager. - /*! - * The species thermodynamic property manager computes properties of the - * pure species for use in constructing solution properties. It is meant for - * internal use, and some classes derived from ThermoPhase may not use any - * species thermodynamic property manager. This method is called by function - * importPhase(). - * - * @param spthermo input pointer to the species thermodynamic property - * manager. - * - * @internal - * @deprecated Unused. To be removed after Cantera 2.3. - */ - void setSpeciesThermo(MultiSpeciesThermo* spthermo); - //! Return a changeable reference to the calculation manager for species //! reference-state thermodynamic properties /*! @@ -1511,15 +1434,6 @@ public: */ virtual void initThermo(); - //! Add in species from Slave phases - /*! - * This hook is used for cSS_CONVENTION_SLAVE phases - * - * @param phaseNode XML Element for the phase - * @deprecated Unused. To be removed after Cantera 2.3. - */ - virtual void installSlavePhases(XML_Node* phaseNode); - //! Set the equation of state parameters /*! * @internal The number and meaning of these depends on the subclass. @@ -1723,16 +1637,6 @@ protected: //! Contains the standard state convention int m_ssConvention; - //! Reference Mole Fraction Composition - /*! - * Occasionally, the need arises to find a safe mole fraction vector to - * initialize the object to. This contains such a vector. The algorithm - * will pick up the mole fraction vector that is applied from the state XML - * file in the input file - * @deprecated To be removed after Cantera 2.3. - */ - vector_fp xMol_Ref; - //! last value of the temperature processed by reference state mutable doublereal m_tlast; }; diff --git a/include/cantera/thermo/VPSSMgr.h b/include/cantera/thermo/VPSSMgr.h index 2906a6ce4..da785f04b 100644 --- a/include/cantera/thermo/VPSSMgr.h +++ b/include/cantera/thermo/VPSSMgr.h @@ -13,7 +13,6 @@ #ifndef CT_VPSSMGR_H #define CT_VPSSMGR_H -#include "mix_defs.h" #include "cantera/base/global.h" namespace Cantera @@ -239,21 +238,9 @@ public: virtual ~VPSSMgr() {} - //! @deprecated Copy constructor to be removed after Cantera 2.3 for all - //! classes derived from VPSSMgr. - VPSSMgr(const VPSSMgr& right); - //! @deprecated Assignment operator to be removed after Cantera 2.3 for all - //! classes derived from VPSSMgr. - VPSSMgr& operator=(const VPSSMgr& right); - - //! Duplication routine for objects which derive from VPSSMgr - /*! - * This function can be used to duplicate objects derived from VPSSMgr - * even if the application only has a pointer to VPSSMgr to work with. - * @deprecated To be removed after Cantera 2.3 for all classes derived from - * VPSSMgr. - */ - virtual VPSSMgr* duplMyselfAsVPSSMgr() const; + // VPSSMgr objects are not copyable or assignable + VPSSMgr(const VPSSMgr&) = delete; + VPSSMgr& operator=(const VPSSMgr&) = delete; //! @name Properties of the Standard State of the Species in the Solution //! @{ @@ -565,23 +552,6 @@ public: */ //@{ - //! This utility function reports the type of parameterization used for the - //! species with index number index. - /*! - * @param index Species index - * @deprecated To be removed after Cantera 2.3. - */ - virtual PDSS_enumType reportPDSSType(int index = -1) const; - - //! This utility function reports the type of manager for the calculation of - //! ss properties - /*! - * @returns an enum type called VPSSMgr_enumType, which is a list of the - * known VPSSMgr objects - * @deprecated Unused. To be removed after Cantera 2.3. - */ - virtual VPSSMgr_enumType reportVPSSMgrType() const; - //! Minimum temperature. /*! * If no argument is supplied, this method returns the minimum temperature @@ -684,19 +654,6 @@ public: virtual PDSS* createInstallPDSS(size_t k, const XML_Node& speciesNode, const XML_Node* const phaseNode_ptr); - //! Initialize the internal shallow pointers in this object - /*! - * There are a bunch of internal shallow pointers that point to the owning - * VPStandardStateTP and MultiSpeciesThermo objects. This function reinitializes - * them. This function is called like an onion. - * - * @param vp_ptr Pointer to the VPStandardStateTP standard state - * @param sp_ptr Pointer to the MultiSpeciesThermo standard state - * @deprecated To be removed after Cantera 2.3 for all classes derived from - * VPSSMgr. - */ - virtual void initAllPtrs(VPStandardStateTP* vp_ptr, MultiSpeciesThermo* sp_ptr); - //!@} protected: diff --git a/include/cantera/thermo/VPSSMgr_ConstVol.h b/include/cantera/thermo/VPSSMgr_ConstVol.h index 5edbce045..79899abe5 100644 --- a/include/cantera/thermo/VPSSMgr_ConstVol.h +++ b/include/cantera/thermo/VPSSMgr_ConstVol.h @@ -35,10 +35,6 @@ public: */ VPSSMgr_ConstVol(VPStandardStateTP* vp_ptr, MultiSpeciesThermo* spth); - VPSSMgr_ConstVol(const VPSSMgr_ConstVol& right); - VPSSMgr_ConstVol& operator=(const VPSSMgr_ConstVol& right); - virtual VPSSMgr* duplMyselfAsVPSSMgr() const; - /*! * @name Properties of the Standard State of the Species in the Solution * @@ -101,9 +97,6 @@ public: virtual PDSS* createInstallPDSS(size_t k, const XML_Node& speciesNode, const XML_Node* const phaseNode_ptr); //@} - - virtual PDSS_enumType reportPDSSType(int index = -1) const; - virtual VPSSMgr_enumType reportVPSSMgrType() const; }; } diff --git a/include/cantera/thermo/VPSSMgr_General.h b/include/cantera/thermo/VPSSMgr_General.h index 19972ba32..675083338 100644 --- a/include/cantera/thermo/VPSSMgr_General.h +++ b/include/cantera/thermo/VPSSMgr_General.h @@ -40,10 +40,6 @@ public: VPSSMgr_General(VPStandardStateTP* vp_ptr, MultiSpeciesThermo* spth); - VPSSMgr_General(const VPSSMgr_General& right); - VPSSMgr_General& operator=(const VPSSMgr_General& right); - virtual VPSSMgr* duplMyselfAsVPSSMgr() const; - protected: /*! * @name Properties of the Standard State of the Species in the Solution @@ -121,10 +117,6 @@ public: virtual PDSS* createInstallPDSS(size_t k, const XML_Node& speciesNode, const XML_Node* const phaseNode_ptr); - virtual PDSS_enumType reportPDSSType(int index = -1) const; - virtual VPSSMgr_enumType reportVPSSMgrType() const; - virtual void initAllPtrs(VPStandardStateTP* vp_ptr, MultiSpeciesThermo* sp_ptr); - private: //! Shallow pointers containing the PDSS objects for the species //! in this phase. This object doesn't own these pointers. diff --git a/include/cantera/thermo/VPSSMgr_IdealGas.h b/include/cantera/thermo/VPSSMgr_IdealGas.h index 4467803d5..e8a3f130c 100644 --- a/include/cantera/thermo/VPSSMgr_IdealGas.h +++ b/include/cantera/thermo/VPSSMgr_IdealGas.h @@ -37,10 +37,6 @@ public: */ VPSSMgr_IdealGas(VPStandardStateTP* vp_ptr, MultiSpeciesThermo* spth); - VPSSMgr_IdealGas(const VPSSMgr_IdealGas& right); - VPSSMgr_IdealGas& operator=(const VPSSMgr_IdealGas& right); - virtual VPSSMgr* duplMyselfAsVPSSMgr() const; - /*! @name Properties of the Standard State of the Species in the Solution * Within VPStandardStateTP, these properties are calculated via a common * routine, _updateStandardStateThermo(), which must be overloaded in @@ -76,10 +72,8 @@ public: */ virtual PDSS* createInstallPDSS(size_t k, const XML_Node& speciesNode, const XML_Node* const phaseNode_ptr); - - virtual PDSS_enumType reportPDSSType(int index = -1) const; - virtual VPSSMgr_enumType reportVPSSMgrType() const; }; + } #endif diff --git a/include/cantera/thermo/VPSSMgr_Water_ConstVol.h b/include/cantera/thermo/VPSSMgr_Water_ConstVol.h index c8dc5e497..4970a24cd 100644 --- a/include/cantera/thermo/VPSSMgr_Water_ConstVol.h +++ b/include/cantera/thermo/VPSSMgr_Water_ConstVol.h @@ -35,10 +35,6 @@ public: */ VPSSMgr_Water_ConstVol(VPStandardStateTP* vp_ptr, MultiSpeciesThermo* sp_ptr); - VPSSMgr_Water_ConstVol(const VPSSMgr_Water_ConstVol& right); - VPSSMgr_Water_ConstVol& operator=(const VPSSMgr_Water_ConstVol& right); - virtual VPSSMgr* duplMyselfAsVPSSMgr() const; - private: /*! * @name Properties of the Standard State of the Species in the Solution @@ -85,10 +81,6 @@ public: virtual PDSS* createInstallPDSS(size_t k, const XML_Node& speciesNode, const XML_Node* const phaseNode_ptr); - virtual PDSS_enumType reportPDSSType(int index = -1) const; - virtual VPSSMgr_enumType reportVPSSMgrType() const; - virtual void initAllPtrs(VPStandardStateTP* vp_ptr, MultiSpeciesThermo* sp_ptr); - private: //! Pointer to the Water PDSS object. /*! diff --git a/include/cantera/thermo/VPSSMgr_Water_HKFT.h b/include/cantera/thermo/VPSSMgr_Water_HKFT.h index 11c35c61a..96e36b180 100644 --- a/include/cantera/thermo/VPSSMgr_Water_HKFT.h +++ b/include/cantera/thermo/VPSSMgr_Water_HKFT.h @@ -34,10 +34,6 @@ public: VPSSMgr_Water_HKFT(VPStandardStateTP* vptp_ptr, MultiSpeciesThermo* spth); - VPSSMgr_Water_HKFT(const VPSSMgr_Water_HKFT& right); - VPSSMgr_Water_HKFT& operator=(const VPSSMgr_Water_HKFT& right); - virtual VPSSMgr* duplMyselfAsVPSSMgr() const; - /*! @name Thermodynamic Values for the Species Reference States * There are also temporary variables for holding the species reference- * state values of Cp, H, S, and V at the last temperature and reference @@ -84,15 +80,6 @@ private: //@} public: - /*! @name Utility Methods - Reports on various quantities - * The following methods are used in the process of reporting - * various states and attributes - */ - //@{ - virtual PDSS_enumType reportPDSSType(int index = -1) const; - virtual VPSSMgr_enumType reportVPSSMgrType() const; - //@} - /*! @name Initialization Methods - For Internal use (VPStandardState) * The following methods are used in the process of constructing * the phase and setting its parameters from a specification in an @@ -105,16 +92,6 @@ public: const XML_Node* const phaseNode_ptr); //@} - //! Initialize the internal shallow pointers in this object - /*! - * There are a bunch of internal shallow pointers that point to the owning - * VPStandardStateTP and MultiSpeciesThermo objects. This function reinitializes - * them. This function is called like an onion. - * - * @param vp_ptr Pointer to the VPStandardStateTP standard state - * @param sp_ptr Pointer to the MultiSpeciesThermo standard state - */ - virtual void initAllPtrs(VPStandardStateTP* vp_ptr, MultiSpeciesThermo* sp_ptr); private: //! Shallow pointer to the water object PDSS_Water* m_waterSS; diff --git a/include/cantera/thermo/VPStandardStateTP.h b/include/cantera/thermo/VPStandardStateTP.h index bc564a8ec..a6d0a4133 100644 --- a/include/cantera/thermo/VPStandardStateTP.h +++ b/include/cantera/thermo/VPStandardStateTP.h @@ -53,10 +53,6 @@ public: /// Constructor. VPStandardStateTP(); - VPStandardStateTP(const VPStandardStateTP& b); - VPStandardStateTP& operator=(const VPStandardStateTP& b); - virtual ThermoPhase* duplMyselfAsThermoPhase() const; - //@} //! @name Utilities (VPStandardStateTP) //@{ diff --git a/include/cantera/thermo/WaterProps.h b/include/cantera/thermo/WaterProps.h index cd9962962..f64f2f63f 100644 --- a/include/cantera/thermo/WaterProps.h +++ b/include/cantera/thermo/WaterProps.h @@ -108,9 +108,10 @@ public: */ WaterProps(PDSS_Water* wptr); - WaterProps(const WaterProps& b); + // WaterProps objects are not copyable or assignable + WaterProps(const WaterProps& b) = delete; + WaterProps& operator=(const WaterProps& b) = delete; virtual ~WaterProps(); - WaterProps& operator=(const WaterProps& b); //! Simple calculation of water density at atmospheric pressure. //! Valid up to boiling point. diff --git a/include/cantera/thermo/WaterPropsIAPWS.h b/include/cantera/thermo/WaterPropsIAPWS.h index 428dbc18d..b764d8bb4 100644 --- a/include/cantera/thermo/WaterPropsIAPWS.h +++ b/include/cantera/thermo/WaterPropsIAPWS.h @@ -160,8 +160,8 @@ public: //! Base constructor WaterPropsIAPWS(); - WaterPropsIAPWS(const WaterPropsIAPWS& right); - WaterPropsIAPWS& operator=(const WaterPropsIAPWS& right); + WaterPropsIAPWS(const WaterPropsIAPWS& right) = delete; + WaterPropsIAPWS& operator=(const WaterPropsIAPWS& right) = delete; //! Set the internal state of the object wrt temperature and density /*! diff --git a/include/cantera/thermo/WaterSSTP.h b/include/cantera/thermo/WaterSSTP.h index 405f1cb9d..bb56f3a6e 100644 --- a/include/cantera/thermo/WaterSSTP.h +++ b/include/cantera/thermo/WaterSSTP.h @@ -117,10 +117,6 @@ public: //! Base constructor WaterSSTP(); - WaterSSTP(const WaterSSTP&); - WaterSSTP& operator=(const WaterSSTP&); - virtual ThermoPhase* duplMyselfAsThermoPhase() const; - //! Full constructor for a water phase /*! * @param inputFile String name of the input file @@ -135,11 +131,6 @@ public: */ explicit WaterSSTP(XML_Node& phaseRef, const std::string& id = ""); - virtual int eosType() const { - warn_deprecated("WaterSSTP::eosType", - "To be removed after Cantera 2.3."); - return -1; - } virtual std::string type() const { return "Water"; } diff --git a/include/cantera/thermo/electrolytes.h b/include/cantera/thermo/electrolytes.h index eb3e72850..d7ee85c0b 100644 --- a/include/cantera/thermo/electrolytes.h +++ b/include/cantera/thermo/electrolytes.h @@ -34,20 +34,5 @@ const int cEST_nonpolarNeutral = 5; // Nonpolar neutral species. These // corrections applied to them to // account for salting-out effects -/** - * eosTypes returned for this ThermoPhase Object - * @deprecated To be removed after Cantera 2.3. - */ -const int cHMWSoln0 = 45010; -const int cHMWSoln1 = 45011; -const int cHMWSoln2 = 45012; - -/** - * eosTypes returned for this ThermoPhase Object - * @deprecated To be removed after Cantera 2.3. - */ -const int cDebyeHuckel0 = 46010; -const int cDebyeHuckel1 = 46011; -const int cDebyeHuckel2 = 46012; } #endif diff --git a/include/cantera/thermo/mix_defs.h b/include/cantera/thermo/mix_defs.h deleted file mode 100644 index c2608e66b..000000000 --- a/include/cantera/thermo/mix_defs.h +++ /dev/null @@ -1,149 +0,0 @@ -//! @file mix_defs.h -//! @deprecated All of the constants defined in this header are no longer used. -//! To be removed after Cantera 2.3. -#ifndef CT_MIX_DEFS_H -#define CT_MIX_DEFS_H - -namespace Cantera -{ - -/** - * This generic id is used as the default in virtual base classes that employ - * id's. It is used to indicate the lack of an inherited class that would define - * the id. - */ -const int cNone = 0; - -// species thermo types -const int cNASA = 1; -const int cShomate = 2; -const int cNASA96 = 3; -const int cHarmonicOsc = 4; - -/** - * Equation of state types: - * - * These types are used in the member function eosType() of the virtual base - * class ThermoPhase. They are used to distinguish different types of equation - * of states. Also, they may be used for upcasting from the ThermoPhase class. - * Their id's should be distinct. - * - * Users who wish to define their own equation of states which derive from - * ThermoPhase should define a unique id which doesn't conflict with those - * listed below. The Cantera Kernel however, will not be know about the class - * and will therefore not be able to initialize the class within its "factory" - * routines. - * @deprecated To be removed after Cantera 2.3. - */ -const int cIdealGas = 1; // IdealGasPhase in IdealGasPhase.h -const int cIncompressible = 2; // ConstDensityThermo in ConstDensityThermo.h -/// A surface phase. Used by class SurfPhase. -const int cSurf = 3; - -/// A metal phase. -const int cMetal = 4; // MetalPhase in MetalPhase.h -const int cStoichSubstance = 5; // StoichSubstance.h -const int cSemiconductor = 7; - -const int cMineralEQ3 = 8; // MineralEQ3 in MineralEQ3.h -const int cMetalSHEelectrons = 9; // SHE electrode electrons - -const int cLatticeSolid = 20; // LatticeSolidPhase.h -const int cLattice = 21; //LatticePhase.h - -// pure fluids with liquid/vapor eqs of state -const int cPureFluid = 10; - -/// An edge between two 2D surfaces -const int cEdge = 6; - -//! Stoichiometric compound with a constant chemical potential -const int cFixedChemPot = 70; - -/// Constant partial molar volume solution IdealSolidSolnPhase.h -const int cIdealSolidSolnPhase = 5009; - -const int cMaskellSolidSolnPhase = 5010; - -//! HMW - Strong electrolyte using the Pitzer formulation -const int cHMW = 40; - -//! DebyeHuckel - Weak electrolyte using various Debye-Huckel formulations -const int cDebyeHuckel = 50; - -//! IdealMolalSoln - molality based solution with molality-based act coeffs of 1 -const int cIdealMolalSoln = 60; - -const int cIdealSolnGasVPSS = 500; -const int cIdealSolnGasVPSS_iscv = 501; - -//! Fugacity Models -const int cMixtureFugacityTP = 700; -const int cRedlichKwongMFTP = 701; - -const int cMargulesVPSSTP = 301; - -const int cRedlichKisterVPSSTP = 303; - -const int cMolarityIonicVPSSTP = 401; -const int cMixedSolventElectrolyte = 402; - -const int cPhaseCombo_Interaction = 305; - -const int cIonsFromNeutral = 2000; - -//! Variable Pressure Standard State ThermoPhase objects -const int cVPSS_IdealGas = 1001; -const int cVPSS_ConstVol = 1002; -const int cVPSS_PureFluid = 1010; -const int cVPSS_HMW = 1040; -const int cVPSS_DebyeHuckel = 1050; -const int cVPSS_MolalSoln = 1060; - -//! Types of PDSS's -//! @deprecated Unused. To be removed after Cantera 2.3. -enum PDSS_enumType { - cPDSS_UNDEF = 100, - cPDSS_IDEALGAS, - cPDSS_CONSTVOL, - cPDSS_SSVOL, - cPDSS_MOLAL_CONSTVOL, - cPDSS_WATER, - cPDSS_MOLAL_HKFT, - cPDSS_IONSFROMNEUTRAL -}; - -//! enum for VPSSMgr types that are responsible for calculating the species -//! standard state and reference-state thermodynamic properties. -//! @deprecated Unused. To be removed after Cantera 2.3. -enum VPSSMgr_enumType { - cVPSSMGR_UNDEF = 1000, - //! Variable pressures SS calculator for ideal gas phases - cVPSSMGR_IDEALGAS, - //! Variable pressure SS calculate for phases consisting all species having - //! a constant molar volume property. This fits most solids. - cVPSSMGR_CONSTVOL, - cVPSSMGR_PUREFLUID, - //! Variable pressure SS calculate for phases consisting of real water - //! as the first species and species having a constant molar volume property - cVPSSMGR_WATER_CONSTVOL, - //! Variable pressure SS calculate for phases consisting of real water - //! as the first species and species obeying the HKFT standard state - cVPSSMGR_WATER_HKFT, - //! Variable pressure SS calculate for phases consisting of completing - //! general representations - cVPSSMGR_GENERAL -}; - - -// kinetic manager types -// @deprecated To be removed after Cantera 2.3. -const int cGasKinetics = 2; -const int cInterfaceKinetics = 4; -const int cLineKinetics = 5; -const int cEdgeKinetics = 6; -const int cSolidKinetics = 7; -const int cAqueousKinetics = 8; -} - -#endif diff --git a/include/cantera/transport/DustyGasTransport.h b/include/cantera/transport/DustyGasTransport.h index 629660b60..b0f66e7e0 100644 --- a/include/cantera/transport/DustyGasTransport.h +++ b/include/cantera/transport/DustyGasTransport.h @@ -69,32 +69,10 @@ public: */ DustyGasTransport(thermo_t* thermo=0); - DustyGasTransport(const DustyGasTransport& right); - - //! Assignment operator - /*! - * Warning -> Shallow pointer copies are made of m_thermo and m_gastran. - * gastran may not point to the correct object after this copy. - * The routine initialize() must be called after this routine to - * complete the copy. - * - * @param right Reference to DustyGasTransport object to be copied - * into the current one. - */ - DustyGasTransport& operator=(const DustyGasTransport& right); - - virtual Transport* duplMyselfAsTransport() const; - // overloaded base class methods virtual void setThermo(thermo_t& thermo); - virtual int model() const { - warn_deprecated("DustyGasTransport::model", - "To be removed after Cantera 2.3."); - return cDustyGasTransport; - } - virtual std::string transportType() const { return "DustyGas"; } diff --git a/include/cantera/transport/GasTransport.h b/include/cantera/transport/GasTransport.h index f735d494c..014295c95 100644 --- a/include/cantera/transport/GasTransport.h +++ b/include/cantera/transport/GasTransport.h @@ -22,9 +22,6 @@ class MMCollisionInt; class GasTransport : public Transport { public: - GasTransport(const GasTransport& right); - GasTransport& operator=(const GasTransport& right); - //! Viscosity of the mixture (kg /m /s) /*! * The viscosity is computed using the Wilke mixture rule (kg /m /s) diff --git a/include/cantera/transport/HighPressureGasTransport.h b/include/cantera/transport/HighPressureGasTransport.h index 3566fb7b9..e60c9ff03 100644 --- a/include/cantera/transport/HighPressureGasTransport.h +++ b/include/cantera/transport/HighPressureGasTransport.h @@ -45,17 +45,6 @@ protected: HighPressureGasTransport(thermo_t* thermo=0); public: - virtual int model() const { - warn_deprecated("HighPressureGasTransport::model", - "To be removed after Cantera 2.3."); - if (m_mode == CK_Mode) { - throw CanteraError("HighPressureGasTransport::model", - "CK_Mode not accepted"); - } else { - return cHighP; - } - } - virtual std::string transportType() const { return "HighPressureGas"; } diff --git a/include/cantera/transport/LiquidTransport.h b/include/cantera/transport/LiquidTransport.h index 1e9c2873c..2079a9fc8 100644 --- a/include/cantera/transport/LiquidTransport.h +++ b/include/cantera/transport/LiquidTransport.h @@ -88,9 +88,6 @@ public: */ LiquidTransport(thermo_t* thermo = 0, int ndim = 1); - LiquidTransport(const LiquidTransport& right); - LiquidTransport& operator=(const LiquidTransport& right); - virtual Transport* duplMyselfAsTransport() const; virtual ~LiquidTransport(); //! Initialize the transport object @@ -106,12 +103,6 @@ public: friend class TransportFactory; - virtual int model() const { - warn_deprecated("LiquidTransport::model", - "To be removed after Cantera 2.3."); - return cLiquidTransport; - } - virtual std::string transportType() const { return "Liquid"; } diff --git a/include/cantera/transport/LiquidTransportParams.h b/include/cantera/transport/LiquidTransportParams.h index 9595be363..e7269fb8e 100644 --- a/include/cantera/transport/LiquidTransportParams.h +++ b/include/cantera/transport/LiquidTransportParams.h @@ -25,8 +25,8 @@ class LiquidTransportParams : public TransportParams public: LiquidTransportParams(); ~LiquidTransportParams(); - LiquidTransportParams(const LiquidTransportParams& right); - LiquidTransportParams& operator=(const LiquidTransportParams& right); + LiquidTransportParams(const LiquidTransportParams& right) = delete; + LiquidTransportParams& operator=(const LiquidTransportParams& right) = delete; //! Species transport parameters std::vector LTData; diff --git a/include/cantera/transport/MixTransport.h b/include/cantera/transport/MixTransport.h index 001f5aad8..cab1a9234 100644 --- a/include/cantera/transport/MixTransport.h +++ b/include/cantera/transport/MixTransport.h @@ -59,20 +59,6 @@ public: //! Default constructor. MixTransport(); - MixTransport(const MixTransport& right); - MixTransport& operator=(const MixTransport& right); - virtual Transport* duplMyselfAsTransport() const; - - //! Return the model id for transport - /*! - * @return cMixtureAverage - */ - virtual int model() const { - warn_deprecated("MixTransport::model", - "To be removed after Cantera 2.3."); - return cMixtureAveraged; - } - virtual std::string transportType() const { return "Mix"; } diff --git a/include/cantera/transport/MultiTransport.h b/include/cantera/transport/MultiTransport.h index 54dec008f..ea9da5320 100644 --- a/include/cantera/transport/MultiTransport.h +++ b/include/cantera/transport/MultiTransport.h @@ -32,16 +32,6 @@ public: */ MultiTransport(thermo_t* thermo=0); - virtual int model() const { - warn_deprecated("MultiTransport::model", - "To be removed after Cantera 2.3."); - if (m_mode == CK_Mode) { - return CK_Multicomponent; - } else { - return cMulticomponent; - } - } - virtual std::string transportType() const { return "Multi"; } diff --git a/include/cantera/transport/SimpleTransport.h b/include/cantera/transport/SimpleTransport.h index bf38bb16f..b299c2153 100644 --- a/include/cantera/transport/SimpleTransport.h +++ b/include/cantera/transport/SimpleTransport.h @@ -196,9 +196,6 @@ public: */ SimpleTransport(thermo_t* thermo = 0, int ndim = 1); - SimpleTransport(const SimpleTransport& right); - SimpleTransport& operator=(const SimpleTransport& right); - virtual Transport* duplMyselfAsTransport() const; virtual ~SimpleTransport(); //! Initialize the transport object @@ -210,12 +207,6 @@ public: */ virtual bool initLiquid(LiquidTransportParams& tr); - virtual int model() const { - warn_deprecated("SimpleTransport::model", - "To be removed after Cantera 2.3."); - return cSimpleTransport; - } - virtual std::string transportType() const { return "Simple"; } diff --git a/include/cantera/transport/SolidTransport.h b/include/cantera/transport/SolidTransport.h index 78589c905..6065d4eec 100644 --- a/include/cantera/transport/SolidTransport.h +++ b/include/cantera/transport/SolidTransport.h @@ -31,15 +31,6 @@ class SolidTransport : public Transport { public: SolidTransport(); - SolidTransport(const SolidTransport& right); - SolidTransport& operator=(const SolidTransport& right); - virtual Transport* duplMyselfAsTransport() const; - - virtual int model() const { - warn_deprecated("SolidTransport::model", - "To be removed after Cantera 2.3."); - return cSolidTransport; - } virtual std::string transportType() const { return "Solid"; @@ -110,7 +101,6 @@ public: virtual void getMobilities(doublereal* const mobil); - //! @deprecated virtual void setParameters(const int n, const int k, const doublereal* const p); friend class TransportFactory; diff --git a/include/cantera/transport/TransportBase.h b/include/cantera/transport/TransportBase.h index 0d9744f8a..b7db63b1f 100644 --- a/include/cantera/transport/TransportBase.h +++ b/include/cantera/transport/TransportBase.h @@ -34,22 +34,6 @@ class SolidTransportData; const int CK_Mode = 10; -// types of transport models that can be constructed -// @deprecated To be removed after Cantera 2.3. -const int None = 199; -const int cMulticomponent = 200; -const int CK_Multicomponent = 202; -const int cMixtureAveraged = 210; -const int CK_MixtureAveraged = 211; -const int cHighP = 270; -const int cSolidTransport = 300; -const int cDustyGasTransport = 400; -const int cUserTransport = 500; -const int cFtnTransport = 600; -const int cLiquidTransport = 700; -const int cSimpleTransport = 770; -const int cRadiativeTransport = 800; -const int cWaterTransport = 721; //! \endcond //! The diffusion fluxes must be referenced to a particular reference @@ -164,39 +148,10 @@ public: Transport(thermo_t* thermo=0, size_t ndim = 1); virtual ~Transport() {} - //! @deprecated Copy constructor to be removed after Cantera 2.3 for all - //! classes derived from Transport. - Transport(const Transport& right); - //! @deprecated Assignment operator to be removed after Cantera 2.3 for all - //! classes derived from Transport. - Transport& operator=(const Transport& right); - //! Duplication routine for objects which inherit from Transport - /*! - * This virtual routine can be used to duplicate objects derived from - * Transport even if the application only has a pointer to Transport to work - * with. - * - * These routines are basically wrappers around the derived copy - * constructor. - * @deprecated To be removed after Cantera 2.3 for all classes derived from - * Transport. - */ - // Note ->need working copy constructors and operator=() functions for all first - virtual Transport* duplMyselfAsTransport() const; - - //! Transport model. - /*! - * The transport model is the set of equations used to compute the transport - * properties. This method returns an integer flag that identifies the - * transport model implemented. The base class returns 0. - * @deprecated Use `transportType()` instead. To be removed after Cantera - * 2.3. - */ - virtual int model() const { - warn_deprecated("Transport::model", "To be removed after Cantera 2.3."); - return 0; - } + // Transport objects are not copyable or assignable + Transport(const Transport&) = delete; + Transport& operator=(const Transport&) = delete; //! Identifies the Transport object type. Each derived class should override //! this method to return a meaningful identifier. @@ -683,7 +638,6 @@ public: * @param k Species index to set the parameters on * @param p Vector of parameters. The length of the vector varies with * the parameterization - * @deprecated */ virtual void setParameters(const int type, const int k, const doublereal* const p); diff --git a/include/cantera/transport/TransportFactory.h b/include/cantera/transport/TransportFactory.h index d5fbb553a..b14d2a756 100644 --- a/include/cantera/transport/TransportFactory.h +++ b/include/cantera/transport/TransportFactory.h @@ -54,13 +54,6 @@ public: //! Deletes the statically allocated factory instance. virtual void deleteFactory(); - //! Get the name of the transport model corresponding to the specified constant. - /*! - * @param model Integer representing the model name - * @deprecated To be removed after Cantera 2.3. - */ - static std::string modelName(int model); - //! Make one of several transport models, and return a base class pointer to it. /*! * This method operates at the level of a single transport property as a @@ -226,15 +219,6 @@ private: */ void setupSolidTransport(thermo_t* thermo, int log_level, SolidTransportData& trParam); - //! Mapping between between the string name for a transport model and the - //! integer name. - //! @deprecated To be removed after Cantera 2.3. - std::map m_models; - - //! Inverse mapping of transport models, from integer constant to string - //! @deprecated To be removed after Cantera 2.3. - std::map m_modelNames; - //! Mapping between between the string name //! for a transport property and the integer name. std::map m_tranPropMap; @@ -251,22 +235,6 @@ private: std::map m_CK_mode; }; -//! Create a new transport manager instance. -/*! - * @param transportModel String identifying the transport model to be - * instantiated, defaults to the empty string - * @param thermo ThermoPhase object associated with the phase, defaults - * to null pointer - * @param loglevel int containing the Loglevel, defaults to zero - * @param f optional pointer to the TransportFactory object - * @param ndim Number of dimensions for transport fluxes - * @deprecated Use the version which does not take a `TransportFactory*`.To be - * removed after Cantera 2.3. - * @ingroup tranprops - */ -Transport* newTransportMgr(const std::string& transportModel, thermo_t* thermo, int loglevel, - TransportFactory* f, int ndim=1); - Transport* newTransportMgr(const std::string& transportModel = "", thermo_t* thermo = 0, int loglevel = 0, int ndim=1); @@ -276,11 +244,9 @@ Transport* newTransportMgr(const std::string& transportModel = "", * @param loglevel int containing the Loglevel, defaults to zero * @param f pointer to the TransportFactory object if it's been allocated * @returns a transport manager for the phase - * @deprecated The `TransportFactory*` argument to this function is deprecated - * and will be removed after Cantera 2.3. * @ingroup tranprops */ -Transport* newDefaultTransportMgr(thermo_t* thermo, int loglevel = 0, TransportFactory* f = 0); +Transport* newDefaultTransportMgr(thermo_t* thermo, int loglevel = 0); } // End of namespace Cantera diff --git a/include/cantera/transport/WaterTransport.h b/include/cantera/transport/WaterTransport.h index b289b5949..785f0296b 100644 --- a/include/cantera/transport/WaterTransport.h +++ b/include/cantera/transport/WaterTransport.h @@ -40,16 +40,6 @@ public: */ WaterTransport(thermo_t* thermo = 0, int ndim = 1); - WaterTransport(const WaterTransport& right); - WaterTransport& operator=(const WaterTransport& right); - virtual Transport* duplMyselfAsTransport() const; - - virtual int model() const { - warn_deprecated("WaterTransport::model", - "To be removed after Cantera 2.3."); - return cWaterTransport; - } - virtual std::string transportType() const { return "Water"; } diff --git a/include/cantera/zeroD/ConstPressureReactor.h b/include/cantera/zeroD/ConstPressureReactor.h index a374f90b3..f791dabe3 100644 --- a/include/cantera/zeroD/ConstPressureReactor.h +++ b/include/cantera/zeroD/ConstPressureReactor.h @@ -28,9 +28,6 @@ public: return ConstPressureReactorType; } - //! @deprecated Use getState instead. To be removed after Cantera 2.3. - virtual void getInitialConditions(doublereal t0, size_t leny, - doublereal* y); virtual void getState(doublereal* y); virtual void initialize(doublereal t0 = 0.0); diff --git a/include/cantera/zeroD/FlowReactor.h b/include/cantera/zeroD/FlowReactor.h index 71623a05b..2e5164e5d 100644 --- a/include/cantera/zeroD/FlowReactor.h +++ b/include/cantera/zeroD/FlowReactor.h @@ -21,9 +21,6 @@ public: return FlowReactorType; } - //! @deprecated Use getState instead. To be removed after Cantera 2.3. - virtual void getInitialConditions(doublereal t0, size_t leny, - doublereal* y); virtual void getState(doublereal* y); virtual void initialize(doublereal t0 = 0.0); diff --git a/include/cantera/zeroD/IdealGasConstPressureReactor.h b/include/cantera/zeroD/IdealGasConstPressureReactor.h index c1034db36..9ca3b449c 100644 --- a/include/cantera/zeroD/IdealGasConstPressureReactor.h +++ b/include/cantera/zeroD/IdealGasConstPressureReactor.h @@ -29,9 +29,6 @@ public: virtual void setThermoMgr(ThermoPhase& thermo); - //! @deprecated Use getState instead. To be removed after Cantera 2.3. - virtual void getInitialConditions(doublereal t0, size_t leny, - doublereal* y); virtual void getState(doublereal* y); virtual void initialize(doublereal t0 = 0.0); diff --git a/include/cantera/zeroD/IdealGasReactor.h b/include/cantera/zeroD/IdealGasReactor.h index 71979333a..bc128bca0 100644 --- a/include/cantera/zeroD/IdealGasReactor.h +++ b/include/cantera/zeroD/IdealGasReactor.h @@ -27,9 +27,6 @@ public: virtual void setThermoMgr(ThermoPhase& thermo); - //! @deprecated Use getState instead. To be removed after Cantera 2.3. - virtual void getInitialConditions(doublereal t0, size_t leny, - doublereal* y); virtual void getState(doublereal* y); virtual void initialize(doublereal t0 = 0.0); diff --git a/include/cantera/zeroD/Reactor.h b/include/cantera/zeroD/Reactor.h index a56a7ed4d..705af9cac 100644 --- a/include/cantera/zeroD/Reactor.h +++ b/include/cantera/zeroD/Reactor.h @@ -55,22 +55,6 @@ public: void setKineticsMgr(Kinetics& kin); - //! Disable changes in reactor composition due to chemical reactions. - //! @deprecated Use setChemistry instead. To be removed after Cantera 2.3 - void disableChemistry() { - warn_deprecated("Reactor::disableChemistry", - "Use setChemistry instead. To be removed after Cantera 2.3"); - setChemistry(false); - } - - //! Enable changes in reactor composition due to chemical reactions. - //! @deprecated Use setChemistry instead. To be removed after Cantera 2.3 - void enableChemistry() { - warn_deprecated("Reactor::enableChemistry", - "Use setChemistry instead. To be removed after Cantera 2.3"); - setChemistry(true); - } - //! Enable or disable changes in reactor composition due to chemical reactions. void setChemistry(bool cflag = true) { m_chem = cflag; @@ -103,18 +87,6 @@ public: return m_nv; } - //! Called by ReactorNet to get the initial conditions. - /*! - * Essentially calls function getState() - * - * @param[in] t0 Time at which initial conditions are determined - * @param[in] leny Length of *y* (unused) - * @param[out] y state vector representing the initial state of the reactor - * @deprecated Use getState instead. To be removed after Cantera 2.3. - */ - virtual void getInitialConditions(doublereal t0, size_t leny, - doublereal* y); - //! Get the the current state of the reactor. /*! * @param[out] y state vector representing the initial state of the reactor diff --git a/include/cantera/zeroD/ReactorFactory.h b/include/cantera/zeroD/ReactorFactory.h index df638f7d4..3a00bfb94 100644 --- a/include/cantera/zeroD/ReactorFactory.h +++ b/include/cantera/zeroD/ReactorFactory.h @@ -43,19 +43,9 @@ private: }; //! Create a Reactor object of the specified type -//! @deprecated The `ReactorFactory*` argument to this function is deprecated and -//! will be removed after Cantera 2.3. -inline ReactorBase* newReactor(const std::string& model, - ReactorFactory* f=0) +inline ReactorBase* newReactor(const std::string& model) { - if (f == 0) { - f = ReactorFactory::factory(); - } else { - warn_deprecated("newReactor(string, ReactorFactory*)", - "The `ReactorFactory*` argument to this function is deprecated and" - " will be removed after Cantera 2.3."); - } - return f->newReactor(model); + return ReactorFactory::factory()->newReactor(model); } } diff --git a/include/cantera/zeroD/ReactorNet.h b/include/cantera/zeroD/ReactorNet.h index 1b459683c..e1b686600 100644 --- a/include/cantera/zeroD/ReactorNet.h +++ b/include/cantera/zeroD/ReactorNet.h @@ -81,9 +81,7 @@ public: void advance(doublereal time); //! Advance the state of all reactors in time. - //! @deprecated The *time* argument to this function is deprecated and will - //! be removed after Cantera 2.3. - double step(doublereal time=-999); + double step(); //@} @@ -163,9 +161,6 @@ public: virtual void eval(doublereal t, doublereal* y, doublereal* ydot, doublereal* p); - //! @deprecated Use getState instead. To be removed after Cantera 2.3. - virtual void getInitialConditions(doublereal t0, size_t leny, - doublereal* y); virtual void getState(doublereal* y); virtual size_t nparams() { diff --git a/include/cantera/zeroD/Wall.h b/include/cantera/zeroD/Wall.h index 35f0917e6..85a7b2bbe 100644 --- a/include/cantera/zeroD/Wall.h +++ b/include/cantera/zeroD/Wall.h @@ -141,85 +141,6 @@ public: return *m_right; } - //! Specify the heterogeneous reaction mechanisms for each side of the - //! wall. Passing a null pointer indicates that there is no reaction - //! mechanism for the corresponding wall surface. - //! @deprecated Use class ReactorSurface instead. To be removed after - //! Cantera 2.3. - void setKinetics(Kinetics* leftMechanism, - Kinetics* rightMechanism); - - //! Return a pointer to the surface phase object for the left - //! (`leftright=0`) or right (`leftright=1`) wall surface. - //! @deprecated Use class ReactorSurface instead. To be removed after - //! Cantera 2.3. - SurfPhase* surface(int leftright) { - return m_surf[leftright].thermo(); - } - - //! @deprecated Use class ReactorSurface instead. To be removed after - //! Cantera 2.3. - ReactorSurface* reactorSurface(int leftright) { - return &m_surf[leftright]; - } - - //! Return a pointer to the surface kinetics object for the left - //! (`leftright=0`) or right (`leftright=1`) wall surface. - //! @deprecated Use class ReactorSurface instead. To be removed after - //! Cantera 2.3. - Kinetics* kinetics(int leftright) { - return m_surf[leftright].kinetics(); - } - - //! Set the surface coverages on the left (`leftright = 0`) or right - //! (`leftright = 1`) surface to the values in array `cov`. - //! @deprecated Use class ReactorSurface instead. To be removed after - //! Cantera 2.3. - void setCoverages(int leftright, const doublereal* cov); - - //! Set the surface coverages on the left (`leftright = 0`) or right - //! (`leftright = 1`) surface to the values in array `cov`. - //! @deprecated Use class ReactorSurface instead. To be removed after - //! Cantera 2.3. - void setCoverages(int leftright, const compositionMap& cov); - - //! Set the surface coverages on the left (`leftright = 0`) or right - //! (`leftright = 1`) surface to the values in array `cov`. - //! @deprecated Use class ReactorSurface instead. To be removed after - //! Cantera 2.3. - void setCoverages(int leftright, const std::string& cov); - - //! Write the coverages of the left or right surface into array `cov`. - //! @deprecated Use class ReactorSurface instead. To be removed after - //! Cantera 2.3. - void getCoverages(int leftright, doublereal* cov); - - //! Set the coverages in the surface phase object to the values for this - //! wall surface. - //! @deprecated Use class ReactorSurface instead. To be removed after - //! Cantera 2.3. - void syncCoverages(int leftright); - - //! Number of sensitivity parameters associated with reactions on the left - //! (`lr = 0`) or right (`lr = 1`) side of the wall. - //! @deprecated Use class ReactorSurface instead. To be removed after - //! Cantera 2.3. - size_t nSensParams(int lr) const { - return m_surf[lr].nSensParams(); - } - - //! @deprecated Use class ReactorSurface instead. To be removed after - //! Cantera 2.3. - void addSensitivityReaction(int leftright, size_t rxn); - - //! @deprecated Use class ReactorSurface instead. To be removed after - //! Cantera 2.3. - void setSensitivityParameters(double* params); - - //! @deprecated Use class ReactorSurface instead. To be removed after - //! Cantera 2.3. - void resetSensitivityParameters(); - protected: ReactorBase* m_left; ReactorBase* m_right; diff --git a/interfaces/cython/cantera/_cantera.pxd b/interfaces/cython/cantera/_cantera.pxd index a1e4ae3c9..fff940177 100644 --- a/interfaces/cython/cantera/_cantera.pxd +++ b/interfaces/cython/cantera/_cantera.pxd @@ -567,7 +567,7 @@ cdef extern from "cantera/zeroD/ReactorNet.h": CxxReactorNet() void addReactor(CxxReactor&) void advance(double) except +translate_exception - double step(double) except +translate_exception + double step() except +translate_exception void reinitialize() except +translate_exception double time() void setInitialTime(double) @@ -631,8 +631,6 @@ cdef extern from "cantera/oneD/Domain1D.h": void setupGrid(size_t, double*) except +translate_exception void setID(string) string& id() - void setDesc(string) - string& desc() cdef extern from "cantera/oneD/Inlet1D.h": diff --git a/interfaces/cython/cantera/onedim.py b/interfaces/cython/cantera/onedim.py index 9b26a8f29..fdd32c821 100644 --- a/interfaces/cython/cantera/onedim.py +++ b/interfaces/cython/cantera/onedim.py @@ -583,15 +583,11 @@ class CounterflowDiffusionFlame(FlameBase): super(CounterflowDiffusionFlame, self).__init__( (self.fuel_inlet, self.flame, self.oxidizer_inlet), gas, grid) - def set_initial_guess(self, fuel=None, oxidizer=None, stoich=None): + def set_initial_guess(self): """ Set the initial guess for the solution. The initial guess is generated by assuming infinitely-fast chemistry. """ - if fuel is not None or oxidizer is not None or stoich is not None: - warnings.warn( - 'Arguments to CounterflowDiffusionFlame.set_initial_guess are ' - 'unused and deprecated and will be removed after Cantera 2.3.') super(CounterflowDiffusionFlame, self).set_initial_guess() diff --git a/interfaces/cython/cantera/onedim.pyx b/interfaces/cython/cantera/onedim.pyx index 7bbb8bcfe..3388ed47b 100644 --- a/interfaces/cython/cantera/onedim.pyx +++ b/interfaces/cython/cantera/onedim.pyx @@ -224,13 +224,6 @@ cdef class Domain1D: def __set__(self, name): self.domain.setID(stringify(name)) - property description: - """ A description of this domain """ - def __get__(self): - return pystr(self.domain.desc()) - def __set__(self, desc): - self.domain.setDesc(stringify(desc)) - def __reduce__(self): raise NotImplementedError('Domain1D object is not picklable') diff --git a/interfaces/cython/cantera/reactor.pyx b/interfaces/cython/cantera/reactor.pyx index a745abc5c..e94de3e11 100644 --- a/interfaces/cython/cantera/reactor.pyx +++ b/interfaces/cython/cantera/reactor.pyx @@ -371,58 +371,6 @@ cdef class FlowReactor(Reactor): return (self.reactor).distance() -cdef class WallSurface: - """ - Represents a wall surface in contact with the contents of a reactor. - - .. deprecated:: 2.2 - Use class ReactorSurface to implement reactor surface chemistry. To be - removed after Cantera 2.3. - """ - def __cinit__(self, Wall wall, int side): - self.wall = wall - self.cxxwall = &wall.wall - self.side = side - self._kinetics = None - - property kinetics: - """ - The `InterfaceKinetics` object used for calculating reaction - rates on this wall surface. - """ - def __get__(self): - return self._kinetics - def __set__(self, Kinetics k): - self._kinetics = k - self.wall._set_kinetics() - - property coverages: - """ - The fraction of sites covered by each surface species. - """ - def __get__(self): - if self._kinetics is None: - raise CanteraError('No kinetics manager present') - self.cxxwall.syncCoverages(self.side) - return self._kinetics.coverages - def __set__(self, coverages): - if self._kinetics is None: - raise CanteraError("Can't set coverages before assigning kinetics manager.") - - if isinstance(coverages, (dict, str, unicode, bytes)): - self.cxxwall.setCoverages(self.side, comp_map(coverages)) - return - - if len(coverages) != self._kinetics.n_species: - raise ValueError('Incorrect number of site coverages specified') - cdef np.ndarray[np.double_t, ndim=1] data = \ - np.ascontiguousarray(coverages, dtype=np.double) - self.cxxwall.setCoverages(self.side, &data[0]) - - def add_sensitivity_reaction(self, int m): - self.cxxwall.addSensitivityReaction(self.side, m) - - cdef class ReactorSurface: """ Represents a surface in contact with the contents of a reactor. @@ -532,7 +480,7 @@ cdef class Wall: # The signature of this function causes warnings for Sphinx documentation def __init__(self, left, right, *, name=None, A=None, K=None, U=None, - Q=None, velocity=None, kinetics=(None,None)): + Q=None, velocity=None): """ :param left: Reactor or reservoir on the left. Required. @@ -554,13 +502,6 @@ cdef class Wall: :param velocity: Wall velocity function :math:`v_0(t)` [m/s]. Default: :math:`v_0(t) = 0.0`. - :param kinetics: - Surface reaction mechanisms for the left-facing and right-facing - surface, respectively. These must be instances of class Kinetics, - or of a class derived from Kinetics, such as Interface. If - chemistry occurs on only one side, enter ``None`` for the - non-reactive side. *Deprecated. To be removed after - Cantera 2.3.* """ self.left_surface = WallSurface(self, 0) self.right_surface = WallSurface(self, 1) @@ -586,10 +527,6 @@ cdef class Wall: self.set_heat_flux(Q) if velocity is not None: self.set_velocity(velocity) - if kinetics[0] is not None: - self.left_surface.kinetics = kinetics[0] - if kinetics[1] is not None: - self.right_surface.kinetics = kinetics[1] def _install(self, ReactorBase left, ReactorBase right): """ @@ -688,18 +625,6 @@ cdef class Wall: """ return self.wall.Q(t) - def _set_kinetics(self): - """ - .. deprecated:: 2.2 - Use class ReactorSurface to implement reactor surface chemistry. To - be removed after Cantera 2.3. - """ - cdef CxxKinetics* L = (self.left_surface._kinetics.kinetics - if self.left_surface._kinetics else NULL) - cdef CxxKinetics* R = (self.right_surface._kinetics.kinetics - if self.right_surface._kinetics else NULL) - self.wall.setKinetics(L, R) - cdef class FlowDevice: """ @@ -925,16 +850,12 @@ cdef class ReactorNet: """ self.net.advance(t) - def step(self, double t=-999): + def step(self): """ Take a single internal time step. The time after taking the step is returned. - - .. deprecated:: 2.2 - The argument *t* is deprecated and will be removed after - Cantera 2.3. """ - return self.net.step(t) + return self.net.step() def reinitialize(self): """ diff --git a/interfaces/matlab/toolbox/1D/@Domain1D/z.m b/interfaces/matlab/toolbox/1D/@Domain1D/z.m deleted file mode 100644 index 8aadda3f8..000000000 --- a/interfaces/matlab/toolbox/1D/@Domain1D/z.m +++ /dev/null @@ -1,28 +0,0 @@ -function zz = z(d, n) -% Z Get the grid points. -% zz = z(d, n) -% This function is deprecated in favor of the function :mat:func:`gridPoints`, -% and will be removed after Cantera 2.3. -% -% :param d: -% Instance of class :mat:func:`Domain1D` -% :param n: -% Optional. Indices of grid points to get. -% Defaults to getting all of the grid points. -% :return: -% Vector of grid points. -% - -warning('This function is deprecated, and will be removed after Cantera 2.3. Use gridPoints instead.'); -if nargin == 1 - zz = zeros(1, nPoints(d)); - for i = 1:nPoints(d) - zz(i) = domain_methods(d.dom_id, 19, i); - end -else - m = length(n); - zz = zeros(1, m); - for i = 1:m - zz(i) = domain_methods(d.dom_id, 19, n(i)); - end -end diff --git a/interfaces/matlab/toolbox/@Kinetics/destruction_rates.m b/interfaces/matlab/toolbox/@Kinetics/destruction_rates.m deleted file mode 100644 index ed9683b57..000000000 --- a/interfaces/matlab/toolbox/@Kinetics/destruction_rates.m +++ /dev/null @@ -1,17 +0,0 @@ -function ddot = destruction_rates(a) -% DESTRUCTION_RATES Get the chemical destruction rates. -% ddot = destruction_rates(a) -% This function is deprecated in favor of the function -% :mat:func:`destructionRates` -% - -warning('This function is deprecated. Use destructionRates instead.') -ddot = destructionRates(a); -if nargout == 0 - figure - set(gcf, 'Name', 'Destruction Rates') - bar(ddot) - xlabel('Species Number') - ylabel('Destruction Rate (kmol/m^3/s)') - title('Species Chemical Destruction Rates') -end diff --git a/interfaces/matlab/toolbox/@Kinetics/hndl.m b/interfaces/matlab/toolbox/@Kinetics/hndl.m deleted file mode 100644 index d64bfb0be..000000000 --- a/interfaces/matlab/toolbox/@Kinetics/hndl.m +++ /dev/null @@ -1,9 +0,0 @@ -function i = hndl(k) -% HNDL Get the integer used to access kernel objects. -% i = hndl(k) -% Integer used to access kernel objects. Deprecated in favor of -% :mat:func:`kinetics_hndl`. -% - -warning('This function is deprecated in favor of kinetics_hndl.m') -i = k.id; diff --git a/interfaces/matlab/toolbox/@Reactor/hndl.m b/interfaces/matlab/toolbox/@Reactor/hndl.m deleted file mode 100644 index 591463309..000000000 --- a/interfaces/matlab/toolbox/@Reactor/hndl.m +++ /dev/null @@ -1,9 +0,0 @@ -function i = hndl(r) -% HNDL Get the integer used to access the kernel object. -% i = hndl(r) -% Integer used to access kernel objects. Deprecated in favor of -% :mat:func:`reactor_hndl`. -% - -warning('This function is deprecated in favor of reactor_hndl.m') -i = r.index; diff --git a/interfaces/matlab/toolbox/@ReactorNet/step.m b/interfaces/matlab/toolbox/@ReactorNet/step.m index ad9c2a9c9..8e53afbc6 100644 --- a/interfaces/matlab/toolbox/@ReactorNet/step.m +++ b/interfaces/matlab/toolbox/@ReactorNet/step.m @@ -1,4 +1,4 @@ -function t = step(r, tout) +function t = step(r) % STEP Take one internal time step. % t = step(r) % The integrator used to integrate the ODEs (CVODE) takes @@ -32,8 +32,5 @@ function t = step(r, tout) % :return: % Network time after the internal time step. Units: s % -if nargin == 1 - tout = -999; -end -t = reactornetmethods(21, reactornet_hndl(r), tout); +t = reactornetmethods(21, reactornet_hndl(r)); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/eosType.m b/interfaces/matlab/toolbox/@ThermoPhase/eosType.m index 3a9e88c8d..d576d4c8c 100644 --- a/interfaces/matlab/toolbox/@ThermoPhase/eosType.m +++ b/interfaces/matlab/toolbox/@ThermoPhase/eosType.m @@ -5,8 +5,7 @@ function e = eosType(tp) % Instance of class :mat:func:`ThermoPhase` (or another % object that derives from ThermoPhase) % :return: -% An integer flag identifying the type of equation of state. -% See the definitions in include/cantera/thermo/mix_defs.h +% An string identifying the equation of state. % -e = thermo_get(tp.tp_id, 18); +e = phase_get(tp.tp_id, 43); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/hndl.m b/interfaces/matlab/toolbox/@ThermoPhase/hndl.m deleted file mode 100644 index 1e210b920..000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/hndl.m +++ /dev/null @@ -1,8 +0,0 @@ -function i = hndl(p) -% HNDL Get the integer used to access the kernel object. -% i = hndl(p) -% Deprecated in favor of :mat:func:`thermo_hndl`. -% - -warning('This function is deprecated in favor of thermo_hndl.m') -i = p.tp_id; diff --git a/interfaces/matlab/toolbox/@ThermoPhase/isIdealGas.m b/interfaces/matlab/toolbox/@ThermoPhase/isIdealGas.m index fee1bb2bc..e4b43a87c 100644 --- a/interfaces/matlab/toolbox/@ThermoPhase/isIdealGas.m +++ b/interfaces/matlab/toolbox/@ThermoPhase/isIdealGas.m @@ -9,7 +9,7 @@ function v = isIdealGas(tp) % mixture, and false (0) otherwise. % -if eosType(tp) == 1 +if strcmp(eosType(tp), 'IdealGas') v = 1; else v = 0; diff --git a/interfaces/matlab/toolbox/@ThermoPhase/meanMolarMass.m b/interfaces/matlab/toolbox/@ThermoPhase/meanMolarMass.m deleted file mode 100644 index cc078fa5c..000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/meanMolarMass.m +++ /dev/null @@ -1,10 +0,0 @@ -function mmm = meanMolarMass(tp) -% MEANMOLARMASS Get the mean molecular weight. -% wtm = meanMolarMass(tp) -% Deprecated in favor of :mat:func:`meanMolecularWeight` -% -% See also: :mat:func:`meanMolecularWeight` -% - -warning('Deprecated in favor of meanMolecularWeight.m') -mmm = meanMolecularWeight(tp); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/molarMasses.m b/interfaces/matlab/toolbox/@ThermoPhase/molarMasses.m deleted file mode 100644 index 2084c430e..000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/molarMasses.m +++ /dev/null @@ -1,10 +0,0 @@ -function mm = molarMasses(tp) -% MOLARMASSES Get the molecular weights of all the species. -% x = molarMasses(a) -% Deprecated in favor of :mat:func:`molecularWeights` -% -% See also: :mat:func:`molecularWeights` -% - -warning('Deprecated in favor of molecularWeights.m') -mm = molecularWeights(tp); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/ph.m b/interfaces/matlab/toolbox/@ThermoPhase/ph.m deleted file mode 100644 index 53fb0f8b0..000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/ph.m +++ /dev/null @@ -1,11 +0,0 @@ -function i = ph(tp) -% PH Get the ph field of the phase. -% i = ph(tp) -% :param tp: -% Instance of class :mat:func:`ThermoPhase` (or another -% object that derives from ThermoPhase) -% :return: -% - -warning('method ph is deprecated.'); -i = tp.ph; diff --git a/interfaces/matlab/toolbox/@ThermoPhase/setState.m b/interfaces/matlab/toolbox/@ThermoPhase/setState.m deleted file mode 100644 index b99f96b8e..000000000 --- a/interfaces/matlab/toolbox/@ThermoPhase/setState.m +++ /dev/null @@ -1,19 +0,0 @@ -function setState(a, job, values) -% SETSTATE Set the state. -% a = setState(a,job,values) -% Deprecated in favor of :mat:func:`set` -% -% See also: :mat:func:`set` -% - -warning('deprecated in favor of set.m') -if nargin ~= 3 || ~isa(job, 'char') - error('Syntax error. Type "help setState" for more information.') -end - -switch job - case 'T' - setTemperature(a, values) - otherwise - error(['unknown flag: ' job]) -end diff --git a/interfaces/matlab/toolbox/@Transport/hndl.m b/interfaces/matlab/toolbox/@Transport/hndl.m deleted file mode 100644 index 9860a501b..000000000 --- a/interfaces/matlab/toolbox/@Transport/hndl.m +++ /dev/null @@ -1,9 +0,0 @@ -function n = hndl(a) -% HNDL Get the integer used to access the kernel object. -% n = hndl(a) -% Integer used to access kernel objects. Deprecated in favor of -% :mat:func:`trans_hndl`. -% - -warning('This function is deprecated in favor of trans_hndl') -n = a.id; diff --git a/interfaces/matlab/toolbox/@Wall/Wall.m b/interfaces/matlab/toolbox/@Wall/Wall.m index d5064a2ec..f575d56d7 100644 --- a/interfaces/matlab/toolbox/@Wall/Wall.m +++ b/interfaces/matlab/toolbox/@Wall/Wall.m @@ -1,6 +1,6 @@ -function x = Wall(left, right, area, k, u, q, v, kleft, kright) +function x = Wall(left, right, area, k, u, q, v) % WALL Wall class constructor. -% x = Wall(left, right, area, k, u, q, v, kleft, kright) +% x = Wall(left, right, area, k, u, q, v) % A Wall separates two reactors, or a reactor and a reservoir. A wall has a % finite area, may conduct heat between the two reactors on either % side, and may move like a piston. @@ -54,16 +54,6 @@ function x = Wall(left, right, area, k, u, q, v, kleft, kright) % :param v: % Velocity of the wall in m/s. Must be an instance of :mat:func:`Func`. See % :mat:func:`setVelocity` and :mat:func:`vdot`. Defaults to 0.0 if not specified. -% :param kleft: -% Surface reaction mechanisms for the left-facing surface. This must be an -% instance of class :mat:func:`Kinetics`, or of a class derived from Kinetics, -% such as :mat:func:`Interface`. This argument is deprecated. Use class -% :mat:func:`ReactorSurface` instead. To be removed after Cantera 2.3. -% :param kright: -% Surface reaction mechanisms for the right-facing surface. This must be an -% instance of class :mat:func:`Kinetics`, or of a class derived from Kinetics, -% such as :mat:func:`Interface`. This argument is deprecated. Use class -% :mat:func:`ReactorSurface` instead. To be removed after Cantera 2.3. % :return: % Instance of class :mat:func:`Wall` @@ -127,22 +117,3 @@ if nargin >= 7 warning('v was not an instance of Func and was not set') end end - -if nargin >= 8 - if ~isa(kleft, 'Kinetics') - kleft = 0; - end - if nargin == 9 - if ~isa(kright, 'Kinetics') - kright = 0; - end - else - kright = 0; - end - if ~isa(kleft, 'Kinetics') && ~isa(kright, 'Kinetics') - warning(['kleft and kright were not instances of class Kinetics ' ... - 'and so were not set']) - else - setKinetics(x, kleft, kright); - end -end diff --git a/interfaces/matlab/toolbox/@Wall/setKinetics.m b/interfaces/matlab/toolbox/@Wall/setKinetics.m deleted file mode 100644 index d675f3041..000000000 --- a/interfaces/matlab/toolbox/@Wall/setKinetics.m +++ /dev/null @@ -1,31 +0,0 @@ -function setKinetics(w, left, right) -% SETKINETICS Set the surface reaction mechanisms on a wall. -% setKinetics(w, left, right) -% Use class ReactorSurface instead. To be removed after Cantera 2.3. -% -% :param w: -% Instance of class :mat:func:`Wall` -% :param left: -% Instance of class :mat:func:`Kinetics` (or another object -% derived from Kinetics) to be used as the -% surface kinetics for the left side of the wall. Typically -% an instance of class :mat:func:`Interface` -% :param right: -% Instance of class :mat:func:`Kinetics` (or another object -% derived from Kinetics) to be used as the -% surface kinetics for the right side of the wall. Typically -% an instance of class :mat:func:`Interface` -% - -warning('This function is deprecated, and will be removed after Cantera 2.3. Use class ReactorSurface instead.'); - -ileft = 0; -iright = 0; -if isa(left, 'Kinetics') - ileft = kinetics_hndl(left); -end - -if isa(right,'Kinetics') - iright = kinetics_hndl(right); -end -wallmethods(12, wall_hndl(w), ileft, iright); diff --git a/interfaces/matlab/toolbox/@XML_Node/hndl.m b/interfaces/matlab/toolbox/@XML_Node/hndl.m deleted file mode 100644 index 106b7fa86..000000000 --- a/interfaces/matlab/toolbox/@XML_Node/hndl.m +++ /dev/null @@ -1,9 +0,0 @@ -function i = hndl(x) -% HNDL Get the integer used to access the kernel object. -% i = hndl(x) -% Integer used to access kernel objects. Deprecated in favor of -% :mat:func:`xml_hndl`. -% - -warning('This function is deprecated in favor of xml_hndl.m') -i = x.id; diff --git a/interfaces/matlab/toolbox/constants.m b/interfaces/matlab/toolbox/constants.m deleted file mode 100644 index 1be503cd1..000000000 --- a/interfaces/matlab/toolbox/constants.m +++ /dev/null @@ -1,16 +0,0 @@ -function [atm, r] = constants -% CONSTANTS Get the values of important constants. -% [atm,r] = constants -% Deprecated. To be removed after Cantera 2.3. Use :mat:func:`oneatm` and -% :mat:func:`gasconstant` instead. -% -% :return: -% If one output argument is given, returns one atmosphere in -% Pascals. If two output arguments are given, returns one -% atmosphere in Pascals and the universal gas constant in -% J/kmol-K. -% - -warning('This function is deprecated and will be removed after Cantera 2.3.'); -atm = 101325.0; -r = 8314.4621; diff --git a/interfaces/matlab/toolbox/importPhase.m b/interfaces/matlab/toolbox/importPhase.m deleted file mode 100644 index 363b70d0c..000000000 --- a/interfaces/matlab/toolbox/importPhase.m +++ /dev/null @@ -1,22 +0,0 @@ -function s = importPhase(file, name) -% IMPORTPHASE Import a phase from a CTI file -% s = importPhase(file, name) -% Deprecated. To be removed after Cantera 2.3. -% See :ref:`sec-phases`. -% -% See also: :mat:func:`Solution` -% -% :param file: -% CTI file containing phase definition -% :param name: -% Name of the phase -% :return: -% Instance of class :mat:func:`Solution` -% - -warning('This function is deprecated and will be removed after Cantera 2.3. Use Solution instead'); -if nargin == 1 - s = Solution(file); -elseif nargin == 2 - s = Solution(file, name); -end diff --git a/src/base/ctexceptions.cpp b/src/base/ctexceptions.cpp index 4ae0dad42..5038b95ad 100644 --- a/src/base/ctexceptions.cpp +++ b/src/base/ctexceptions.cpp @@ -22,15 +22,6 @@ CanteraError::CanteraError(const std::string& procedure) : { } -void CanteraError::save() -{ - warn_deprecated("CanteraError::save", "To be removed after Cantera 2.3."); - if (!saved_) { - Application::Instance()->addError(procedure_, getMessage()); - saved_ = true; - } -} - const char* CanteraError::what() const throw() { try { diff --git a/src/base/ctml.cpp b/src/base/ctml.cpp index 0c5d33b2a..30458ab57 100644 --- a/src/base/ctml.cpp +++ b/src/base/ctml.cpp @@ -16,20 +16,6 @@ namespace Cantera { std::string FP_Format = "%23.15E"; -void addInteger(XML_Node& node, const std::string& title, const int val, - const std::string& units, const std::string& type) -{ - warn_deprecated("addInteger", "Unused. To be removed after Cantera 2.3."); - XML_Node& f = node.addChild(title, val); - f.addAttribute("vtype", "integer"); - if (type != "") { - f.addAttribute("type",type); - } - if (units != "") { - f.addAttribute("units",units); - } -} - void addFloat(XML_Node& node, const std::string& title, const doublereal val, const std::string& units, const std::string& type, const doublereal minval, @@ -235,35 +221,6 @@ bool getOptionalFloat(const XML_Node& parent, return false; } -doublereal getFloatDefaultUnits(const XML_Node& parent, - const std::string& name, - const std::string& defaultUnits, - const std::string& type) -{ - warn_deprecated("getFloatDefaultUnits", - "Use getFloat and toSI directly. To be removed after Cantera 2.3."); - doublereal fctr = 1.0; - if (defaultUnits == "") { - throw CanteraError("getFloatDefaultUnits", - "need to supply an actual value of defaultUnits"); - } - if (type == "actEnergy") { - fctr = actEnergyToSI(defaultUnits); - } else if (type == "toSI") { - fctr = toSI(defaultUnits); - } else if (defaultUnits == "temperature") { - fctr = toSI(defaultUnits); - } else if (type == "density") { - fctr = toSI(defaultUnits); - } else if (type == "pressure") { - fctr = toSI(defaultUnits); - } else { - throw CanteraError("getFloatDefaultUnits", - "type of units must be supplied and understood"); - } - return getFloat(parent, name, type) / fctr; -} - bool getOptionalModel(const XML_Node& parent, const std::string& nodeName, std::string& modelName) { diff --git a/src/base/global.cpp b/src/base/global.cpp index 1ac081598..5a09a610e 100644 --- a/src/base/global.cpp +++ b/src/base/global.cpp @@ -117,40 +117,6 @@ void close_XML_File(const std::string& file) app()->close_XML_File(file); } -int nErrors() -{ - warn_deprecated("nErrors", "To be removed after Cantera 2.3"); - return app()->getErrorCount(); -} - -void popError() -{ - warn_deprecated("popError", "To be removed after Cantera 2.3"); - app()->popError(); -} - -string lastErrorMessage() -{ - warn_deprecated("lastErrorMessage", "To be removed after Cantera 2.3"); - return app()->lastErrorMessage(); -} - -void showErrors(std::ostream& f) -{ - warn_deprecated("showErrors", "To be removed after Cantera 2.3"); - app()->getErrors(f); -} - -void showErrors() -{ - app()->logErrors(); -} - -void setError(const std::string& r, const std::string& msg) -{ - app()->addError(r, msg); -} - void addDirectory(const std::string& dir) { app()->addDataDirectory(dir); diff --git a/src/base/stringUtils.cpp b/src/base/stringUtils.cpp index 71ed0d5a8..b9463d6a0 100644 --- a/src/base/stringUtils.cpp +++ b/src/base/stringUtils.cpp @@ -31,41 +31,6 @@ namespace ba = boost::algorithm; namespace Cantera { -std::string fp2str(const double x, const std::string& fmt) -{ - warn_deprecated("fp2str", "Unused. To be removed after Cantera 2.3. " - "Use fmt::format instead."); - char buf[64]; - int n = SNPRINTF(buf, 63, fmt.c_str(), x); - if (n > 0) { - buf[63] = '\0'; - return std::string(buf); - } - return std::string(" "); -} - -std::string int2str(const int n, const std::string& fmt) -{ - warn_deprecated("int2str", "Unused. To be removed after Cantera 2.3. " - "Use fmt::format instead."); - char buf[30]; - int m = SNPRINTF(buf, 30, fmt.c_str(), n); - if (m > 0) { - buf[29] = '\0'; - return std::string(buf); - } - return std::string(" "); -} - -std::string int2str(const size_t n) -{ - warn_deprecated("int2str", "Unused. To be removed after Cantera 2.3. " - "Use fmt::format instead."); - std::stringstream ss; - ss << n; - return ss.str(); -} - std::string vec2str(const vector_fp& v, const std::string& fmt, const std::string& sep) { @@ -81,25 +46,6 @@ std::string vec2str(const vector_fp& v, const std::string& fmt, return o.str(); } - -std::string lowercase(const std::string& s) -{ - warn_deprecated("lowercase", "Use boost::algorithm::to_lower_copy instead. " - "To be removed after Cantera 2.3."); - std::string lc(s); - for (size_t i = 0; i < s.size(); i++) { - lc[i] = (char) tolower(s[i]); - } - return lc; -} - -std::string stripws(const std::string& s) -{ - warn_deprecated("stripws", "Use boost::algorithm::trim_copy instead. " - "To be removed after Cantera 2.3."); - return ba::trim_copy(s); -} - std::string stripnonprint(const std::string& s) { std::string ss = ""; @@ -234,26 +180,6 @@ doublereal fpValueCheck(const std::string& val) return fpValue(str); } -std::string wrapString(const std::string& s, const int len) -{ - warn_deprecated("wrapString", "Unused. To be removed after Cantera 2.3."); - int count=0; - std::string r; - for (size_t n = 0; n < s.size(); n++) { - if (s[n] == '\n') { - count = 0; - } else { - count++; - } - if (count > len && s[n] == ' ') { - r += "\n "; - count = 0; - } - r += s[n]; - } - return r; -} - std::string parseSpeciesName(const std::string& nameStr, std::string& phaseName) { std::string s = ba::trim_copy(nameStr); diff --git a/src/clib/ct.cpp b/src/clib/ct.cpp index 263dac056..99e047a59 100644 --- a/src/clib/ct.cpp +++ b/src/clib/ct.cpp @@ -354,10 +354,10 @@ extern "C" { } } - int thermo_eosType(int n) + int thermo_getEosType(int n, size_t leneos, char* eos) { try { - return ThermoCabinet::item(n).eosType(); + return copyString(ThermoCabinet::item(n).type(), eos, leneos); } catch (...) { return handleAllExceptions(-1, ERR); } @@ -901,10 +901,10 @@ extern "C" { } //------------------------------------- - int kin_type(int n) + int kin_getType(int n, size_t lennm, char* nm) { try { - return KineticsCabinet::item(n).type(); + return copyString(KineticsCabinet::item(n).kineticsType(), nm, lennm); } catch (...) { return handleAllExceptions(-1, ERR); } diff --git a/src/clib/ctreactor.cpp b/src/clib/ctreactor.cpp index bd9df570e..de49a4336 100644 --- a/src/clib/ctreactor.cpp +++ b/src/clib/ctreactor.cpp @@ -301,10 +301,10 @@ extern "C" { } } - double reactornet_step(int i, double t) + double reactornet_step(int i) { try { - return NetworkCabinet::item(i).step(t); + return NetworkCabinet::item(i).step(); } catch (...) { return handleAllExceptions(DERR, DERR); } @@ -477,23 +477,6 @@ extern "C" { } } - int wall_setkinetics(int i, int n, int m) - { - try { - Kinetics* left=0, *right=0; - if (n > 0 && KineticsCabinet::item(n).type() == cInterfaceKinetics) { - left = &KineticsCabinet::item(n); - } - if (m > 0 && KineticsCabinet::item(m).type() == cInterfaceKinetics) { - right = &KineticsCabinet::item(m); - } - WallCabinet::item(i).setKinetics(left, right); - return 0; - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - double wall_vdot(int i, double t) { try { diff --git a/src/equil/vcs_MultiPhaseEquil.cpp b/src/equil/vcs_MultiPhaseEquil.cpp index 346a26de6..6ed8dc840 100644 --- a/src/equil/vcs_MultiPhaseEquil.cpp +++ b/src/equil/vcs_MultiPhaseEquil.cpp @@ -1072,137 +1072,4 @@ int vcs_Cantera_update_vprob(MultiPhase* mphase, VCS_PROB* vprob) return VCS_SUCCESS; } -void vcs_MultiPhaseEquil::getStoichVector(size_t rxn, vector_fp& nu) -{ - warn_deprecated("vcs_MultiPhaseEquil::getStoichVector", - "Unused. To be removed after Cantera 2.3."); - size_t nsp = m_vsolve.m_numSpeciesTot; - nu.resize(nsp, 0.0); - for (size_t i = 0; i < nsp; i++) { - nu[i] = 0.0; - } - size_t nc = numComponents(); - const std::vector& indSpecies = m_vsolve.m_speciesMapIndex; - if (rxn > nsp - nc) { - return; - } - size_t j = indSpecies[rxn + nc]; - nu[j] = 1.0; - for (size_t kc = 0; kc < nc; kc++) { - j = indSpecies[kc]; - nu[j] = m_vsolve.m_stoichCoeffRxnMatrix(kc,rxn); - } -} - -size_t vcs_MultiPhaseEquil::numComponents() const -{ - warn_deprecated("vcs_MultiPhaseEquil::numComponents", - "Unused. To be removed after Cantera 2.3."); - return m_vsolve.m_numComponents; -} - -size_t vcs_MultiPhaseEquil::numElemConstraints() const -{ - warn_deprecated("vcs_MultiPhaseEquil::numElemConstraints", - "Unused. To be removed after Cantera 2.3."); - return m_vsolve.m_numElemConstraints; -} - -size_t vcs_MultiPhaseEquil::component(size_t m) const -{ - warn_deprecated("vcs_MultiPhaseEquil::component", - "Unused. To be removed after Cantera 2.3."); - size_t nc = numComponents(); - if (m < nc) { - return m_vsolve.m_speciesMapIndex[m]; - } else { - return npos; - } -} - -int vcs_MultiPhaseEquil::determine_PhaseStability(int iph, double& funcStab, int printLvl, int loglevel) -{ - warn_deprecated("vcs_MultiPhaseEquil::determine_PhaseStability", - "Broken and unused. To be removed after Cantera 2.3."); - clockWC tickTock; - m_printLvl = printLvl; - m_vprob.m_printLvl = printLvl; - - // Extract the current state information from the MultiPhase object and - // Transfer it to VCS_PROB object. - int res = vcs_Cantera_update_vprob(m_mix, &m_vprob); - if (res != 0) { - plogf("problems\n"); - } - - // Check obvious bounds on the temperature and pressure - // NOTE, we may want to do more here with the real bounds - // given by the ThermoPhase objects. - double T = m_mix->temperature(); - if (T <= 0.0) { - throw CanteraError("vcs_MultiPhaseEquil::determine_PhaseStability", - "Temperature less than zero on input"); - } - double pres = m_mix->pressure(); - if (pres <= 0.0) { - throw CanteraError("vcs_MultiPhaseEquil::determine_PhaseStability", - "Pressure less than zero on input"); - } - - // Print out the problem specification from the point of - // view of the vprob object. - m_vprob.prob_report(m_printLvl); - - // Call the thermo Program - int iStable = m_vsolve.vcs_PS(&m_vprob, iph, printLvl, funcStab); - - // Transfer the information back to the MultiPhase object. Note we don't - // just call setMoles, because some multispecies solution phases may be - // zeroed out, and that would cause a problem for that routine. Also, the - // mole fractions of such zeroed out phases actually contain information - // about likely reemergent states. - m_mix->uploadMoleFractionsFromPhases(); - m_mix->getChemPotentials(m_vprob.m_gibbsSpecies.data()); - - double te = tickTock.secondsWC(); - if (printLvl > 0) { - plogf("\n Results from vcs_PS:\n"); - plogf("\n"); - plogf("Temperature = %g Kelvin\n", m_vprob.T); - plogf("Pressure = %g Pa\n", m_vprob.PresPA); - std::string sss = m_mix->phaseName(iph); - if (iStable) { - plogf("Phase %d named %s is stable, function value = %g > 0\n", iph, sss.c_str(), funcStab); - } else { - plogf("Phase %d named %s is not stable + function value = %g < 0\n", iph, sss.c_str(), funcStab); - } - plogf("\n"); - plogf("----------------------------------------" - "---------------------\n"); - plogf(" Name Mole_Number(kmol)"); - plogf(" Mole_Fraction Chem_Potential (J/kmol)\n"); - plogf("-------------------------------------------------------------\n"); - for (size_t i = 0; i < m_vprob.nspecies; i++) { - plogf("%-12s", m_vprob.SpName[i]); - if (m_vprob.SpeciesUnknownType[i] == VCS_SPECIES_TYPE_INTERFACIALVOLTAGE) { - plogf(" %15.3e %15.3e ", 0.0, m_vprob.mf[i]); - plogf("%15.3e\n", m_vprob.m_gibbsSpecies[i]); - } else { - plogf(" %15.3e %15.3e ", m_vprob.w[i], m_vprob.mf[i]); - if (m_vprob.w[i] <= 0.0) { - plogf("%15.3e\n", m_vprob.m_gibbsSpecies[i]); - } else { - plogf("%15.3e\n", m_vprob.m_gibbsSpecies[i]); - } - } - } - plogf("------------------------------------------" - "-------------------\n"); - if (printLvl > 2 && m_vsolve.m_timing_print_lvl > 0) { - plogf("Total time = %12.6e seconds\n", te); - } - } - return iStable; -} - } diff --git a/src/equil/vcs_VolPhase.cpp b/src/equil/vcs_VolPhase.cpp index 19e0b722f..fa0f2a7fc 100644 --- a/src/equil/vcs_VolPhase.cpp +++ b/src/equil/vcs_VolPhase.cpp @@ -10,7 +10,6 @@ #include "cantera/equil/vcs_solve.h" #include "cantera/thermo/ThermoPhase.h" -#include "cantera/thermo/mix_defs.h" #include "cantera/base/stringUtils.h" #include @@ -285,16 +284,6 @@ void vcs_VolPhase::_updateActCoeff() const m_UpToDate_AC = true; } -double vcs_VolPhase::AC_calc_one(size_t kspec) const -{ - warn_deprecated("vcs_VolPhase::AC_calc_one", - "Unused. To be removed after Cantera 2.3."); - if (! m_UpToDate_AC) { - _updateActCoeff(); - } - return ActCoeff[kspec]; -} - void vcs_VolPhase::_updateG0() const { TP_ptr->getGibbs_ref(&SS0ChemicalPotential[0]); @@ -808,42 +797,6 @@ void vcs_VolPhase::setMolesCurrent(int stateCalc) m_vcsStateStatus = stateCalc; } -std::string string16_EOSType(int EOSType) -{ - warn_deprecated("string16_EOSType", "Use vcs_VolPhase::eos_name instead." - " To be removed after Cantera 2.3."); - char st[32]; - st[16] = '\0'; - switch (EOSType) { - case VCS_EOS_CONSTANT: - sprintf(st,"Constant "); - break; - case VCS_EOS_IDEAL_GAS: - sprintf(st,"Ideal Gas "); - break; - case VCS_EOS_STOICH_SUB: - sprintf(st,"Stoich Sub "); - break; - case VCS_EOS_IDEAL_SOLN: - sprintf(st,"Ideal Soln "); - break; - case VCS_EOS_DEBEYE_HUCKEL: - sprintf(st,"Debeye Huckel "); - break; - case VCS_EOS_REDLICH_KWONG: - sprintf(st,"Redlick_Kwong "); - break; - case VCS_EOS_REGULAR_SOLN: - sprintf(st,"Regular Soln "); - break; - default: - sprintf(st,"UnkType: %-7d", EOSType); - break; - } - st[16] = '\0'; - return st; -} - bool vcs_VolPhase::isIdealSoln() const { return m_isIdealSoln; @@ -1093,13 +1046,6 @@ int vcs_VolPhase::elementType(const size_t e) const return m_elementType[e]; } -void vcs_VolPhase::setElementType(const size_t e, const int eType) -{ - warn_deprecated("vcs_VolPhase::setElementType", - "Unused. To be removed after Cantera 2.3."); - m_elementType[e] = eType; -} - const Array2D& vcs_VolPhase::getFormulaMatrix() const { return m_formulaMatrix; diff --git a/src/equil/vcs_phaseStability.cpp b/src/equil/vcs_phaseStability.cpp index b93f2202f..ed0fa14a4 100644 --- a/src/equil/vcs_phaseStability.cpp +++ b/src/equil/vcs_phaseStability.cpp @@ -106,103 +106,6 @@ bool VCS_SOLVE::vcs_popPhasePossible(const size_t iphasePop) const return false; } -int VCS_SOLVE::vcs_phasePopDeterminePossibleList() -{ - warn_deprecated("VCS_SOLVE::vcs_phasePopDeterminePossibleList", - "Unused. To be removed after Cantera 2.3."); - int nfound = 0; - phasePopProblemLists_.clear(); - - // This is a vector over each component. For zeroed components it lists the - // phases, which are currently zeroed, which have a species with a positive - // stoichiometric value wrt the component. Therefore, we could pop the - // component species and pop that phase at the same time if we considered no - // other factors than keeping the component mole number positive. - // - // It does not count species with positive stoichiometric values if that - // species already has a positive mole number. The phase is already popped. - std::vector< std::vector > zeroedComponentLinkedPhasePops(m_numComponents); - - // The logic below calculates zeroedComponentLinkedPhasePops - for (size_t j = 0; j < m_numComponents; j++) { - if (m_elType[j] == VCS_ELEM_TYPE_ABSPOS && m_molNumSpecies_old[j] <= 0.0) { - std::vector &jList = zeroedComponentLinkedPhasePops[j]; - size_t iph = m_phaseID[j]; - jList.push_back(iph); - for (size_t irxn = 0; irxn < m_numRxnTot; irxn++) { - size_t kspec = irxn + m_numComponents; - iph = m_phaseID[kspec]; - vcs_VolPhase* Vphase = m_VolPhaseList[iph]; - int existence = Vphase->exists(); - if (existence < 0 && m_stoichCoeffRxnMatrix(j,irxn) > 0.0 && - std::find(jList.begin(), jList.end(), iph) != jList.end()) { - jList.push_back(iph); - } - } - } - } - - // This is a vector over each zeroed phase For zeroed phases, it lists the - // components, which are currently zeroed, which have a species with a - // negative stoichiometric value wrt one or more species in the phase. Cut - // out components which have a pos stoichiometric value with another species - // in the phase. - std::vector< std::vector > zeroedPhaseLinkedZeroComponents(m_numPhases); - - // The logic below calculates zeroedPhaseLinkedZeroComponents - for (size_t iph = 0; iph < m_numPhases; iph++) { - std::vector &iphList = zeroedPhaseLinkedZeroComponents[iph]; - iphList.clear(); - vcs_VolPhase* Vphase = m_VolPhaseList[iph]; - if (Vphase->exists() < 0) { - size_t nsp = Vphase->nSpecies(); - for (size_t k = 0; k < nsp; k++) { - size_t kspec = Vphase->spGlobalIndexVCS(k); - size_t irxn = kspec - m_numComponents; - for (size_t j = 0; j < m_numComponents; j++) { - if (m_elType[j] == VCS_ELEM_TYPE_ABSPOS && m_molNumSpecies_old[j] <= 0.0 && m_stoichCoeffRxnMatrix(j,irxn) < 0.0) { - bool foundPos = false; - for (size_t kk = 0; kk < nsp; kk++) { - size_t kkspec = Vphase->spGlobalIndexVCS(kk); - if (kkspec >= m_numComponents) { - size_t iirxn = kkspec - m_numComponents; - if (m_stoichCoeffRxnMatrix(j,iirxn) > 0.0) { - foundPos = true; - } - } - } - if (!foundPos && std::find(iphList.begin(), iphList.end(), j) != iphList.end()) { - iphList.push_back(j); - } - } - } - } - } - } - - // Now fill in the phasePopProblemLists_ list. - for (size_t iph = 0; iph < m_numPhases; iph++) { - vcs_VolPhase* Vphase = m_VolPhaseList[iph]; - if (Vphase->exists() < 0) { - std::vector &iphList = zeroedPhaseLinkedZeroComponents[iph]; - std::vector popProblem(0); - popProblem.push_back(iph); - for (size_t i = 0; i < iphList.size(); i++) { - size_t j = iphList[i]; - std::vector &jList = zeroedComponentLinkedPhasePops[j]; - for (size_t jjl = 0; jjl < jList.size(); jjl++) { - size_t jph = jList[jjl]; - if (std::find(popProblem.begin(), popProblem.end(), jph) != popProblem.end()) { - popProblem.push_back(jph); - } - } - } - phasePopProblemLists_.push_back(popProblem); - } - } - return nfound; -} - size_t VCS_SOLVE::vcs_popPhaseID(std::vector & phasePopPhaseIDs) { size_t iphasePop = npos; diff --git a/src/equil/vcs_prob.cpp b/src/equil/vcs_prob.cpp index 2364d6d1d..9de361a4d 100644 --- a/src/equil/vcs_prob.cpp +++ b/src/equil/vcs_prob.cpp @@ -101,37 +101,6 @@ VCS_PROB::~VCS_PROB() } } -void VCS_PROB::resizePhase(size_t nPhase, int force) -{ - warn_deprecated("VCS_PROB::resizePhase", - "Unused. To be removed after Cantera 2.3."); - if (force || nPhase > NPHASE0) { - NPHASE0 = nPhase; - } -} - -void VCS_PROB::resizeSpecies(size_t nsp, int force) -{ - warn_deprecated("VCS_PROB::resizeSpecies", - "Unused. To be removed after Cantera 2.3."); - if (force || nsp > NSPECIES0) { - m_gibbsSpecies.resize(nsp, 0.0); - w.resize(nsp, 0.0); - mf.resize(nsp, 0.0); - FormulaMatrix.resize(nsp, NE0, 0.0); - SpeciesUnknownType.resize(nsp, VCS_SPECIES_TYPE_MOLNUM); - VolPM.resize(nsp, 0.0); - PhaseID.resize(nsp, 0); - SpName.resize(nsp, ""); - WtSpecies.resize(nsp, 0.0); - Charge.resize(nsp, 0.0); - NSPECIES0 = nsp; - if (nspecies > NSPECIES0) { - throw CanteraError("VCS_PROB::resizeSpecies", "shouldn't be here"); - } - } -} - void VCS_PROB::resizeElements(size_t nel, int force) { if (force || nel > NE0) { diff --git a/src/equil/vcs_rearrange.cpp b/src/equil/vcs_rearrange.cpp deleted file mode 100644 index 5a7b700e4..000000000 --- a/src/equil/vcs_rearrange.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @file vcs_rearrange.cpp - * implementation file for rearranging species. - */ - -// This file is part of Cantera. See License.txt in the top-level directory or -// at http://www.cantera.org/license.txt for license and copyright information. - -#include "cantera/equil/vcs_solve.h" - -namespace Cantera -{ -int VCS_SOLVE::vcs_rearrange() -{ - warn_deprecated("VCS_SOLVE::vcs_rearrange", - "Unused. To be removed after Cantera 2.3."); - size_t k1 = 0; - - // Loop over all of the species - for (size_t i = 0; i < m_numSpeciesTot; ++i) { - // Find the index of I in the index vector m_speciesIndexVector[]. Call - // it k1 and continue. - for (size_t j = 0; j < m_numSpeciesTot; ++j) { - size_t n = m_speciesMapIndex[j]; - k1 = j; - if (n == i) { - break; - } - } - - //Switch the species data back from k1 into i. because we loop over all - //species, reaction data are now permanently hosed. - vcs_switch_pos(false, i, k1); - } - return 0; -} - -} diff --git a/src/equil/vcs_rxnadj.cpp b/src/equil/vcs_rxnadj.cpp index d040e895b..0979527dd 100644 --- a/src/equil/vcs_rxnadj.cpp +++ b/src/equil/vcs_rxnadj.cpp @@ -298,162 +298,6 @@ size_t VCS_SOLVE::vcs_RxnStepSizes(int& forceComponentCalc, size_t& kSpecial) return iphDel; } -int VCS_SOLVE::vcs_rxn_adj_cg() -{ - warn_deprecated("VCS_SOLVE::vcs_rxn_adj_cg", - "Unused. To be removed after Cantera 2.3."); - int soldel = 0; - char ANOTE[128]; - plogf(" "); - for (size_t j = 0; j < 77; j++) { - plogf("-"); - } - plogf("\n --- Subroutine rxn_adj_cg() called\n"); - plogf(" --- Species Moles Rxn_Adjustment | Comment\n"); - - // Precalculation loop -> we calculate quantities based on loops over the - // number of species. We also evaluate whether the matrix is appropriate for - // this algorithm. If not, we bail out. - for (size_t irxn = 0; irxn < m_numRxnRdc; ++irxn) { - sprintf(ANOTE, "Normal Calc"); - - size_t kspec = m_indexRxnToSpecies[irxn]; - if (m_molNumSpecies_old[kspec] == 0.0 && (!m_SSPhase[kspec])) { - // MULTISPECIES PHASE WITH total moles equal to zero - // - // HKM -> the statement below presupposes units in m_deltaGRxn_new[]. - // It probably should be replaced with something more relative - if (m_deltaGRxn_new[irxn] < -1.0e-4) { - sprintf(ANOTE, "MultSpec: come alive DG = %11.3E", m_deltaGRxn_new[irxn]); - m_deltaMolNumSpecies[kspec] = 1.0e-10; - m_speciesStatus[kspec] = VCS_SPECIES_MAJOR; - --m_numRxnMinorZeroed; - } else { - sprintf(ANOTE, "MultSpec: still dead DG = %11.3E", m_deltaGRxn_new[irxn]); - m_deltaMolNumSpecies[kspec] = 0.0; - } - } else { - // REGULAR PROCESSING - // - // First take care of cases where we want to bail out. Don't bother - // if superconvergence has already been achieved in this mode. - if (fabs(m_deltaGRxn_new[irxn]) <= m_tolmaj2) { - sprintf(ANOTE, "Skipped: converged DG = %11.3E\n", m_deltaGRxn_new[irxn]); - plogf(" --- "); - plogf("%-12.12s", m_speciesName[kspec]); - plogf(" %12.4E %12.4E | %s\n", m_molNumSpecies_old[kspec], - m_deltaMolNumSpecies[kspec], ANOTE); - continue; - } - - // Don't calculate for minor or nonexistent species if their values - // are to be decreasing anyway. - if (m_speciesStatus[kspec] <= VCS_SPECIES_MINOR && m_deltaGRxn_new[irxn] >= 0.0) { - sprintf(ANOTE, "Skipped: IC = %3d and DG >0: %11.3E\n", m_speciesStatus[kspec], m_deltaGRxn_new[irxn]); - plogf(" --- "); - plogf("%-12.12s", m_speciesName[kspec]); - plogf(" %12.4E %12.4E | %s\n", m_molNumSpecies_old[kspec], - m_deltaMolNumSpecies[kspec], ANOTE); - continue; - } - - // Start of the regular processing - double s = (m_SSPhase[kspec]) ? 0.0 : 1.0 / m_molNumSpecies_old[kspec]; - for (size_t j = 0; j < m_numComponents; ++j) { - if (!m_SSPhase[j]) { - s += pow(m_stoichCoeffRxnMatrix(j,irxn), 2) / m_molNumSpecies_old[j]; - } - } - for (size_t j = 0; j < m_numPhases; j++) { - if (!m_VolPhaseList[j]->m_singleSpecies && m_tPhaseMoles_old[j] > 0.0) { - s -= pow(m_deltaMolNumPhase(j,irxn), 2) / m_tPhaseMoles_old[j]; - } - } - if (s != 0.0) { - m_deltaMolNumSpecies[kspec] = -m_deltaGRxn_new[irxn] / s; - } else { - // REACTION IS ENTIRELY AMONGST SINGLE SPECIES PHASES. DELETE - // ONE SOLID AND RECOMPUTE BASIS - // - // Either the species L will disappear or one of the component - // single species phases will disappear. The sign of DG(I) will - // indicate which way the reaction will go. Then, we need to - // follow the reaction to see which species will zero out first. - size_t k = npos; - double dss; - if (m_deltaGRxn_new[irxn] > 0.0) { - dss = m_molNumSpecies_old[kspec]; - k = kspec; - for (size_t j = 0; j < m_numComponents; ++j) { - if (m_stoichCoeffRxnMatrix(j,irxn) > 0.0) { - double xx = m_molNumSpecies_old[j] / m_stoichCoeffRxnMatrix(j,irxn); - if (xx < dss) { - dss = xx; - k = j; - } - } - } - dss = -dss; - } else { - dss = 1.0e10; - for (size_t j = 0; j < m_numComponents; ++j) { - if (m_stoichCoeffRxnMatrix(j,irxn) < 0.0) { - double xx = -m_molNumSpecies_old[j] / m_stoichCoeffRxnMatrix(j,irxn); - if (xx < dss) { - dss = xx; - k = j; - } - } - } - } - - // Here we adjust the mole fractions according to DSS and the - // stoichiometric array to take into account that we are - // eliminating the kth species. DSS contains the amount of moles - // of the kth species that needs to be added back into the - // component species. - if (dss != 0.0) { - m_molNumSpecies_old[kspec] += dss; - m_tPhaseMoles_old[m_phaseID[kspec]] += dss; - for (size_t j = 0; j < m_numComponents; ++j) { - m_molNumSpecies_old[j] += dss * m_stoichCoeffRxnMatrix(j,irxn); - m_tPhaseMoles_old[m_phaseID[j]] += dss * m_stoichCoeffRxnMatrix(j,irxn); - } - m_molNumSpecies_old[k] = 0.0; - m_tPhaseMoles_old[m_phaseID[k]] = 0.0; - plogf(" --- vcs_st2 Special section to delete "); - plogf("%-12.12s", m_speciesName[k]); - plogf("\n --- Immediate return - Restart iteration\n"); - - // We need to immediately recompute the component basis, - // because we just zeroed it out. - if (k != kspec) { - soldel = 2; - } else { - soldel = 1; - } - return soldel; - } - } - } // End of regular processing - plogf(" --- "); - plogf("%-12.12s", m_speciesName[kspec]); - plogf(" %12.4E %12.4E | %s\n", m_molNumSpecies_old[kspec], - m_deltaMolNumSpecies[kspec], ANOTE); - } // End of loop over non-component stoichiometric formation reactions - - // When we form the Hessian we must be careful to ensure that it is a - // symmetric positive definite matrix, still. This means zeroing out columns - // when we zero out rows as well. I suggest writing a small program to make - // sure of this property. - plogf(" "); - for (size_t j = 0; j < 77; j++) { - plogf("-"); - } - plogf("\n"); - return soldel; -} - double VCS_SOLVE::vcs_Hessian_diag_adj(size_t irxn, double hessianDiag_Ideal) { double diag = hessianDiag_Ideal; @@ -520,137 +364,4 @@ void VCS_SOLVE::vcs_CalcLnActCoeffJac(const double* const moleSpeciesVCS) } } -double VCS_SOLVE::deltaG_Recalc_Rxn(const int stateCalc, const size_t irxn, const double* const molNum, double* const ac, - double* const mu_i) -{ - warn_deprecated("VCS_SOLVE::deltaG_Recalc_Rxn", - "Unused. To be removed after Cantera 2.3."); - size_t kspec = irxn + m_numComponents; - for (size_t iphase = 0; iphase < m_numPhases; iphase++) { - if (m_phaseParticipation(iphase,irxn)) { - vcs_chemPotPhase(stateCalc, iphase, molNum, ac, mu_i); - } - } - double deltaG = mu_i[kspec]; - for (size_t k = 0; k < m_numComponents; k++) { - deltaG += m_stoichCoeffRxnMatrix(k,irxn) * mu_i[k]; - } - return deltaG; -} - -double VCS_SOLVE::vcs_line_search(const size_t irxn, const double dx_orig, char* const ANOTE) -{ - warn_deprecated("VCS_SOLVE::vcs_line_search", - "Unused. To be removed after Cantera 2.3."); - int its = 0; - size_t kspec = m_indexRxnToSpecies[irxn]; - const int MAXITS = 10; - double dx = dx_orig; - double* sc_irxn = m_stoichCoeffRxnMatrix.ptrColumn(irxn); - vector_fp& molNumBase = m_molNumSpecies_old; - vector_fp& acBase = m_actCoeffSpecies_old; - vector_fp& ac = m_actCoeffSpecies_new; - - // Calculate the deltaG value at the dx = 0.0 point - vcs_setFlagsVolPhases(false, VCS_STATECALC_OLD); - double deltaGOrig = deltaG_Recalc_Rxn(VCS_STATECALC_OLD, irxn, &molNumBase[0], &acBase[0], &m_feSpecies_old[0]); - double forig = fabs(deltaGOrig) + 1.0E-15; - if (deltaGOrig > 0.0) { - if (dx_orig > 0.0) { - dx = 0.0; - if (ANOTE) { - sprintf(ANOTE, "Rxn reduced to zero step size in line search: dx>0 dg > 0"); - } - return dx; - } - } else if (deltaGOrig < 0.0) { - if (dx_orig < 0.0) { - dx = 0.0; - if (ANOTE) { - sprintf(ANOTE, "Rxn reduced to zero step size in line search: dx<0 dg < 0"); - } - return dx; - } - } else if (deltaGOrig == 0.0) { - return 0.0; - } - if (dx_orig == 0.0) { - return 0.0; - } - - m_molNumSpecies_new = m_molNumSpecies_old; - double molSum = molNumBase[kspec]; - m_molNumSpecies_new[kspec] = molNumBase[kspec] + dx_orig; - for (size_t k = 0; k < m_numComponents; k++) { - m_molNumSpecies_new[k] = molNumBase[k] + sc_irxn[k] * dx_orig; - molSum += molNumBase[k]; - } - vcs_setFlagsVolPhases(false, VCS_STATECALC_NEW); - - double deltaG1 = deltaG_Recalc_Rxn(VCS_STATECALC_NEW, irxn, &m_molNumSpecies_new[0], - &ac[0], &m_feSpecies_new[0]); - - // If deltaG hasn't switched signs when going the full distance then we are - // heading in the appropriate direction, and we should accept the current - // full step size - if (deltaG1 * deltaGOrig > 0.0) { - dx = dx_orig; - goto finalize; - } - - // If we have decreased somewhat, the deltaG return after finding a better - // estimate for the line search. - if (fabs(deltaG1) < 0.8 * forig) { - if (deltaG1 * deltaGOrig < 0.0) { - double slope = (deltaG1 - deltaGOrig) / dx_orig; - dx = -deltaGOrig / slope; - } else { - dx = dx_orig; - } - goto finalize; - } - - dx = dx_orig; - for (its = 0; its < MAXITS; its++) { - // Calculate the approximation to the total Gibbs free energy at - // the dx *= 0.5 point - dx *= 0.5; - m_molNumSpecies_new[kspec] = molNumBase[kspec] + dx; - for (size_t k = 0; k < m_numComponents; k++) { - m_molNumSpecies_new[k] = molNumBase[k] + sc_irxn[k] * dx; - } - vcs_setFlagsVolPhases(false, VCS_STATECALC_NEW); - double deltaG = deltaG_Recalc_Rxn(VCS_STATECALC_NEW, irxn, &m_molNumSpecies_new[0], - &ac[0], &m_feSpecies_new[0]); - - // If deltaG hasn't switched signs when going the full distance then we - // are heading in the appropriate direction, and we should accept the - // current step - if (deltaG * deltaGOrig > 0.0) { - goto finalize; - } - - // If we have decreased somewhat, the deltaG return after finding - // a better estimate for the line search. - if (fabs(deltaG) / forig < (1.0 - 0.1 * dx / dx_orig)) { - if (deltaG * deltaGOrig < 0.0) { - double slope = (deltaG - deltaGOrig) / dx; - dx = -deltaGOrig / slope; - } - goto finalize; - } - } - -finalize: - vcs_setFlagsVolPhases(false, VCS_STATECALC_NEW); - if (its >= MAXITS) { - sprintf(ANOTE, "Rxn reduced to zero step size from %g to %g (MAXITS)", dx_orig, dx); - return dx; - } - if (dx != dx_orig) { - sprintf(ANOTE, "Line Search reduced step size from %g to %g", dx_orig, dx); - } - return dx; -} - } diff --git a/src/equil/vcs_solve_TP.cpp b/src/equil/vcs_solve_TP.cpp index c3d853df9..2efcc903c 100644 --- a/src/equil/vcs_solve_TP.cpp +++ b/src/equil/vcs_solve_TP.cpp @@ -1879,41 +1879,6 @@ int VCS_SOLVE::vcs_recheck_deleted() return npb; } -bool VCS_SOLVE::recheck_deleted_phase(const int iphase) -{ - warn_deprecated("VCS_SOLVE::recheck_deleted_phase", - "Unused. To be removed after Cantera 2.3."); - // Check first to see if the phase is in fact deleted - const vcs_VolPhase* Vphase = m_VolPhaseList[iphase]; - if (Vphase->exists() != VCS_PHASE_EXIST_NO) { - return false; - } - if (Vphase->exists() == VCS_PHASE_EXIST_ZEROEDPHASE) { - return false; - } - if (Vphase->m_singleSpecies) { - size_t kspec = Vphase->spGlobalIndexVCS(0); - size_t irxn = kspec + m_numComponents; - if (m_deltaGRxn_old[irxn] < 0.0) { - return true; - } - return false; - } - - double phaseDG = 1.0; - for (size_t kk = 0; kk < Vphase->nSpecies(); kk++) { - size_t kspec = Vphase->spGlobalIndexVCS(kk); - size_t irxn = kspec + m_numComponents; - m_deltaGRxn_old[irxn] = clip(m_deltaGRxn_old[irxn], -50.0, 50.0); - phaseDG -= exp(-m_deltaGRxn_old[irxn]); - } - - if (phaseDG < 0.0) { - return true; - } - return false; -} - size_t VCS_SOLVE::vcs_add_all_deleted() { if (m_numSpeciesRdc == m_numSpeciesTot) { @@ -2808,59 +2773,6 @@ int VCS_SOLVE::vcs_species_type(const size_t kspec) const return VCS_SPECIES_MINOR; } -void VCS_SOLVE::vcs_chemPotPhase(const int stateCalc, - const size_t iph, const double* const molNum, - double* const ac, double* const mu_i, - const bool do_deleted) -{ - warn_deprecated("VCS_SOLVE::vcs_chemPotPhase", - "Unused. To be removed after Cantera 2.3."); - vcs_VolPhase* Vphase = m_VolPhaseList[iph]; - size_t nkk = Vphase->nSpecies(); - double tMoles = TPhInertMoles[iph]; - for (size_t k = 0; k < nkk; k++) { - size_t kspec = Vphase->spGlobalIndexVCS(k); - tMoles += molNum[kspec]; - } - double tlogMoles = 0.0; - if (tMoles > 0.0) { - tlogMoles = log(tMoles); - } - - Vphase->setMolesFromVCS(stateCalc, molNum); - Vphase->sendToVCS_ActCoeff(stateCalc, ac); - - double phi = Vphase->electricPotential(); - double Faraday_phi = m_Faraday_dim * phi; - - for (size_t k = 0; k < nkk; k++) { - size_t kspec = Vphase->spGlobalIndexVCS(k); - if (kspec >= m_numComponents) { - if (!do_deleted && - (m_speciesStatus[kspec] == VCS_SPECIES_DELETED)) { - continue; - } - } - if (m_speciesUnknownType[kspec] == VCS_SPECIES_TYPE_INTERFACIALVOLTAGE) { - AssertThrowMsg(molNum[kspec] == phi, "VCS_SOLVE::vcs_chemPotPhase", - "We have an inconsistency!"); - AssertThrowMsg(m_chargeSpecies[kspec] == -1.0, "VCS_SOLVE::vcs_chemPotPhase", - "We have an unexpected situation!"); - mu_i[kspec] = m_SSfeSpecies[kspec] + m_chargeSpecies[kspec] * Faraday_phi; - } else { - if (m_SSPhase[kspec]) { - mu_i[kspec] = m_SSfeSpecies[kspec] + m_chargeSpecies[kspec] * Faraday_phi; - } else if (molNum[kspec] <= VCS_DELETE_MINORSPECIES_CUTOFF) { - mu_i[kspec] = m_SSfeSpecies[kspec] + log(ac[kspec] * VCS_DELETE_MINORSPECIES_CUTOFF) - - tlogMoles - m_lnMnaughtSpecies[kspec] + m_chargeSpecies[kspec] * Faraday_phi; - } else { - mu_i[kspec] = m_SSfeSpecies[kspec] + log(ac[kspec] * molNum[kspec]) - - tlogMoles - m_lnMnaughtSpecies[kspec] + m_chargeSpecies[kspec] * Faraday_phi; - } - } - } -} - void VCS_SOLVE::vcs_dfe(const int stateCalc, const int ll, const size_t lbot, const size_t ltop) { @@ -3088,122 +3000,6 @@ void VCS_SOLVE::vcs_dfe(const int stateCalc, } } -void VCS_SOLVE::vcs_printSpeciesChemPot(const int stateCalc) const -{ - warn_deprecated("VCS_SOLVE::vcs_printSpeciesChemPot", - "Unused. To be removed after Cantera 2.3."); - double mfValue = 1.0; - bool zeroedPhase = false; - - const double* molNum = &m_molNumSpecies_old[0]; - const double* actCoeff_ptr = &m_actCoeffSpecies_old[0]; - if (stateCalc == VCS_STATECALC_NEW) { - actCoeff_ptr = &m_actCoeffSpecies_new[0]; - molNum = &m_molNumSpecies_new[0]; - } - - double* tMoles = &m_TmpPhase[0]; - const double* tPhInertMoles = &TPhInertMoles[0]; - for (size_t iph = 0; iph < m_numPhases; iph++) { - tMoles[iph] = tPhInertMoles[iph]; - } - for (size_t kspec = 0; kspec < m_numSpeciesTot; kspec++) { - if (m_speciesUnknownType[kspec] != VCS_SPECIES_TYPE_INTERFACIALVOLTAGE) { - size_t iph = m_phaseID[kspec]; - tMoles[iph] += molNum[kspec]; - } - } - - double RT = m_temperature * GasConstant; - writelog(" --- CHEMICAL POT TABLE (J/kmol) Name PhID MolFR ChemoSS " - " logMF Gamma Elect extra ElectrChem\n"); - writelog(" "); - writeline('-', 132); - - for (size_t kspec = 0; kspec < m_numSpeciesTot; ++kspec) { - mfValue = 1.0; - size_t iphase = m_phaseID[kspec]; - const vcs_VolPhase* Vphase = m_VolPhaseList[iphase]; - if ((m_speciesStatus[kspec] == VCS_SPECIES_ZEROEDMS) || - (m_speciesStatus[kspec] == VCS_SPECIES_ZEROEDPHASE) || - (m_speciesStatus[kspec] == VCS_SPECIES_ZEROEDSS)) { - zeroedPhase = true; - } else { - zeroedPhase = false; - } - if (tMoles[iphase] > 0.0) { - if (molNum[kspec] <= VCS_DELETE_MINORSPECIES_CUTOFF) { - mfValue = VCS_DELETE_MINORSPECIES_CUTOFF / tMoles[iphase]; - } else { - mfValue = molNum[kspec]/tMoles[iphase]; - } - } else { - size_t klocal = m_speciesLocalPhaseIndex[kspec]; - mfValue = Vphase->moleFraction(klocal); - } - double volts = Vphase->electricPotential(); - double elect = m_chargeSpecies[kspec] * m_Faraday_dim * volts; - double comb = - m_lnMnaughtSpecies[kspec]; - double total = (m_SSfeSpecies[kspec] + log(mfValue) + elect + log(actCoeff_ptr[kspec]) + comb); - - if (zeroedPhase) { - writelog(" --- ** zp *** "); - } else { - writelog(" --- "); - } - writelogf("%-24.24s", m_speciesName[kspec]); - writelogf(" %3d", iphase); - writelogf(" % -12.4e", mfValue); - writelogf(" % -12.4e", m_SSfeSpecies[kspec] * RT); - writelogf(" % -12.4e", log(mfValue) * RT); - writelogf(" % -12.4e", log(actCoeff_ptr[kspec]) * RT); - writelogf(" % -12.4e", elect * RT); - writelogf(" % -12.4e", comb * RT); - writelogf(" % -12.4e\n", total *RT); - } - writelog(" "); - writeline('-', 132); -} - -void VCS_SOLVE::prneav() const -{ - warn_deprecated("VCS_SOLVE::prneav", - "Unused. To be removed after Cantera 2.3."); - vector_fp eav(m_numElemConstraints, 0.0); - - for (size_t j = 0; j < m_numElemConstraints; ++j) { - for (size_t i = 0; i < m_numSpeciesTot; ++i) { - if (m_speciesUnknownType[i] == VCS_SPECIES_TYPE_INTERFACIALVOLTAGE) { - eav[j] += m_formulaMatrix(i,j) * m_molNumSpecies_old[i]; - } - } - } - bool kerr = false; - plogf("--------------------------------------------------"); - plogf("ELEMENT ABUNDANCE VECTOR:\n"); - plogf(" Element Now Orignal Deviation Type\n"); - for (size_t j = 0; j < m_numElemConstraints; ++j) { - plogf(" "); - plogf("%-2.2s", m_elementName[j]); - plogf(" = %15.6E %15.6E %15.6E %3d\n", - eav[j], m_elemAbundancesGoal[j], eav[j] - m_elemAbundancesGoal[j], m_elType[j]); - if (m_elemAbundancesGoal[j] != 0.) { - if (fabs(eav[j] - m_elemAbundancesGoal[j]) > m_elemAbundancesGoal[j] * 5.0e-9) { - kerr = true; - } - } else { - if (fabs(eav[j]) > 1.0e-10) { - kerr = true; - } - } - } - if (kerr) { - plogf("Element abundance check failure\n"); - } - plogf("--------------------------------------------------"); - plogendl(); -} - double VCS_SOLVE::l2normdg(double dgLocal[]) const { if (m_numRxnRdc <= 0) { @@ -3664,117 +3460,6 @@ void VCS_SOLVE::vcs_printDeltaG(const int stateCalc) writeline('-', 132); } -void VCS_SOLVE::vcs_deltag_Phase(const size_t iphase, const bool doDeleted, - const int stateCalc, const bool alterZeroedPhases) -{ - warn_deprecated("VCS_SOLVE::vcs_deltag_Phase", - "Unused. To be removed after Cantera 2.3."); - double* feSpecies=0; - double* deltaGRxn=0; - double* actCoeffSpecies=0; - if (stateCalc == VCS_STATECALC_NEW) { - feSpecies = &m_feSpecies_new[0]; - deltaGRxn = &m_deltaGRxn_new[0]; - actCoeffSpecies = &m_actCoeffSpecies_new[0]; - } else if (stateCalc == VCS_STATECALC_OLD) { - feSpecies = &m_feSpecies_old[0]; - deltaGRxn = &m_deltaGRxn_old[0]; - actCoeffSpecies = &m_actCoeffSpecies_old[0]; - } else { - throw CanteraError("VCS_SOLVE::vcs_deltag_Phase", "bad stateCalc"); - } - - size_t irxnl = (doDeleted) ? m_numRxnTot : m_numRxnRdc; - vcs_VolPhase* vPhase = m_VolPhaseList[iphase]; - - if (m_debug_print_lvl >= 2) { - plogf(" --- Subroutine vcs_deltag_Phase called for phase %d\n", - iphase); - } - - if (vPhase->m_singleSpecies) { - // Single species Phase - size_t kspec = vPhase->spGlobalIndexVCS(0); - AssertThrowMsg(iphase == m_phaseID[kspec], "VCS_SOLVE::vcs_deltag_Phase", - "index error"); - if (kspec >= m_numComponents) { - size_t irxn = kspec - m_numComponents; - deltaGRxn[irxn] = feSpecies[kspec]; - for (size_t kcomp = 0; kcomp < m_numComponents; ++kcomp) { - deltaGRxn[irxn] += m_stoichCoeffRxnMatrix(kcomp,irxn) * feSpecies[kcomp]; - } - } - } else { - // Multispecies Phase - bool zeroedPhase = true; - for (size_t irxn = 0; irxn < irxnl; ++irxn) { - size_t kspec = m_indexRxnToSpecies[irxn]; - if (m_speciesUnknownType[kspec] != VCS_SPECIES_TYPE_INTERFACIALVOLTAGE && m_phaseID[kspec] == iphase) { - if (m_molNumSpecies_old[kspec] > 0.0) { - zeroedPhase = false; - } - deltaGRxn[irxn] = feSpecies[kspec]; - for (size_t kcomp = 0; kcomp < m_numComponents; ++kcomp) { - deltaGRxn[irxn] += m_stoichCoeffRxnMatrix(kcomp,irxn) * feSpecies[kcomp]; - } - } - } - - // MULTISPECIES PHASES WITH ZERO MOLES - // - // Massage the free energies for species with zero mole fractions in - // multispecies phases. This section implements the Equation 3.8-5 in - // Smith and Missen, p.59. A multispecies phase will exist iff - // - // 1 < sum_i(exp(-dg_i)/AC_i) - // - // If DG is negative then that species wants to be reintroduced into the - // calculation. For small dg_i, the expression below becomes: - // - // 1 - sum_i(exp(-dg_i)/AC_i) ~ sum_i((dg_i-1)/AC_i) + 1 - // - // HKM -> The ratio of mole fractions at the reinstatement time should - // be equal to the normalized weighting of exp(-dg_i) / AC_i. This - // should be implemented. - // - // HKM -> There is circular logic here. ActCoeff depends on the mole - // fractions of a phase that does not exist. In actuality the proto-mole - // fractions should be selected from the solution of a nonlinear problem - // with NsPhase unknowns - // - // X_i = exp(-dg[irxn]) / ActCoeff_i / denom - // - // where - // - // denom = sum_i[ exp(-dg[irxn]) / ActCoeff_i ] - // - // This can probably be solved by successive iteration. This should be - // implemented. - // - // Calculate dg[] for each species in a zeroed multispecies phase. All - // of the dg[]'s will be equal. If dg[] is negative, then the phase will - // come back into existence. - if (alterZeroedPhases && zeroedPhase) { - double phaseDG = 1.0; - for (size_t irxn = 0; irxn < irxnl; ++irxn) { - size_t kspec = m_indexRxnToSpecies[irxn]; - if (m_phaseID[kspec] == iphase) { - deltaGRxn[irxn] = clip(deltaGRxn[irxn], -50.0, 50.0); - phaseDG -= exp(-deltaGRxn[irxn])/actCoeffSpecies[kspec]; - } - } - - // Overwrite the individual dg's with the phase DG. - for (size_t irxn = 0; irxn < irxnl; ++irxn) { - size_t kspec = m_indexRxnToSpecies[irxn]; - if (m_phaseID[kspec] == iphase) { - deltaGRxn[irxn] = 1.0 - phaseDG; - } - } - } - } -} - void VCS_SOLVE::vcs_switch_pos(const bool ifunc, const size_t k1, const size_t k2) { if (k1 == k2) { @@ -3855,54 +3540,6 @@ void VCS_SOLVE::vcs_switch_pos(const bool ifunc, const size_t k1, const size_t k } } -double VCS_SOLVE::vcs_birthGuess(const int kspec) -{ - warn_deprecated("VCS_SOLVE::vcs_birthGuess", - "Unused. To be removed after Cantera 2.3."); - size_t irxn = kspec - m_numComponents; - double dx = 0.0; - if (m_speciesUnknownType[kspec] == VCS_SPECIES_TYPE_INTERFACIALVOLTAGE) { - return dx; - } - - // Check to make sure that species is zero in the solution vector - // If it isn't, we don't know what's happening - AssertThrowMsg(m_molNumSpecies_old[kspec] == 0.0, - "VCS_SOLVE::vcs_birthGuess", "we shouldn't be here"); - if (!m_SSPhase[kspec]) { - // Logic to handle species in multiple species phases. We cap the moles - // here at 1.0E-15 kmol. - bool soldel_ret; - double dxm = vcs_minor_alt_calc(kspec, irxn, &soldel_ret); - dx = std::min(VCS_DELETE_MINORSPECIES_CUTOFF + dxm, 1e-15); - } else { - // Logic to handle single species phases. There is no real way to - // estimate the moles. So we set it to a small number. - dx = 1.0E-30; - } - - // Check to see if the current value of the components allow the dx just - // estimated. If we are in danger of zeroing a component, only go 1/3 the - // way to zeroing the component with this dx. Note, this may mean that dx= 0 - // coming back from this routine. This evaluation should be respected. - double* sc_irxn = m_stoichCoeffRxnMatrix.ptrColumn(irxn); - for (size_t j = 0; j < m_numComponents; ++j) { - // Only loop over element constraints that involve positive def. constraints - if (m_speciesUnknownType[j] != VCS_SPECIES_TYPE_INTERFACIALVOLTAGE) { - if (m_molNumSpecies_old[j] > 0.0) { - double tmp = sc_irxn[j] * dx; - if (3.0*(-tmp) > m_molNumSpecies_old[j]) { - dx = std::min(dx, - 0.3333* m_molNumSpecies_old[j] / sc_irxn[j]); - } - } - if (m_molNumSpecies_old[j] <= 0.0 && sc_irxn[j] < 0.0) { - dx = 0.0; - } - } - } - return dx; -} - void VCS_SOLVE::vcs_setFlagsVolPhases(const bool upToDate, const int stateCalc) { if (!upToDate) { diff --git a/src/equil/vcs_solve_phaseStability.cpp b/src/equil/vcs_solve_phaseStability.cpp deleted file mode 100644 index 7cefb4009..000000000 --- a/src/equil/vcs_solve_phaseStability.cpp +++ /dev/null @@ -1,141 +0,0 @@ -//! @file vcs_solve_phaseStability.cpp - -// This file is part of Cantera. See License.txt in the top-level directory or -// at http://www.cantera.org/license.txt for license and copyright information. - -#include "cantera/equil/vcs_solve.h" -#include "cantera/equil/vcs_prob.h" - -using namespace std; - -namespace Cantera -{ - -int VCS_SOLVE::vcs_PS(VCS_PROB* vprob, int iphase, int printLvl, double& feStable) -{ - warn_deprecated("VCS_SOLVE::vcs_PS", - "Broken and unused. To be removed after Cantera 2.3."); - // ifunc determines the problem type - int ifunc = 0; - - // This function is called to create the private data using the public data. - size_t nspecies0 = vprob->nspecies + 10; - size_t nelements0 = vprob->ne; - size_t nphase0 = vprob->NPhase; - vcs_initSizes(nspecies0, nelements0, nphase0); - - if (ifunc < 0 || ifunc > 2) { - plogf("vcs: Unrecognized value of ifunc, %d: bailing!\n", - ifunc); - return VCS_PUB_BAD; - } - - // This function is called to copy the public data and the current problem - // specification into the current object's data structure. - int retn = vcs_prob_specifyFully(vprob); - if (retn != 0) { - plogf("vcs_pub_to_priv returned a bad status, %d: bailing!\n", - retn); - return retn; - } - - // Prep the problem data - // - adjust the identity of any phases - // - determine the number of components in the problem - retn = vcs_prep_oneTime(printLvl); - if (retn != 0) { - plogf("vcs_prep_oneTime returned a bad status, %d: bailing!\n", - retn); - return retn; - } - - // This function is called to copy the current problem into the current - // object's data structure. - retn = vcs_prob_specify(vprob); - if (retn != 0) { - plogf("vcs_prob_specify returned a bad status, %d: bailing!\n", - retn); - return retn; - } - - // Prep the problem data for this particular instantiation of the problem - retn = vcs_prep(); - if (retn != VCS_SUCCESS) { - plogf("vcs_prep returned a bad status, %d: bailing!\n", retn); - return retn; - } - - // Check to see if the current problem is well posed. - if (!vcs_wellPosed(vprob)) { - plogf("vcs has determined the problem is not well posed: Bailing\n"); - return VCS_PUB_BAD; - } - - // Store the temperature and pressure in the private global variables - m_temperature = vprob->T; - m_pressurePA = vprob->PresPA; - - // Evaluate the standard state free energies at the current temperatures and - // pressures. - vcs_evalSS_TP(printLvl, printLvl, m_temperature, m_pressurePA); - - // Prepare the problem data: nondimensionalize the free energies using the - // divisor, R * T - vcs_nondim_TP(); - - // Prep the fe field - vcs_fePrep_TP(); - - // Solve the problem at a fixed Temperature and Pressure (all information - // concerning Temperature and Pressure has already been derived. The free - // energies are now in dimensionless form.) - int iStab = vcs_solve_phaseStability(iphase, ifunc, feStable, printLvl); - - // Redimensionalize the free energies using the reverse of vcs_nondim to add - // back units. - vcs_redim_TP(); - - vcs_prob_update(vprob); - - // Return the convergence success flag. - return iStab; -} - -int VCS_SOLVE::vcs_solve_phaseStability(const int iph, const int ifunc, - double& funcVal, - int printLvl) -{ - warn_deprecated("VCS_SOLVE::vcs_solve_phaseStability", - "Broken and unused. To be removed after Cantera 2.3."); - double test = -1.0E-10; - bool usedZeroedSpecies; - - vector_fp sm(m_numElemConstraints*m_numElemConstraints, 0.0); - vector_fp ss(m_numElemConstraints, 0.0); - vector_fp sa(m_numElemConstraints, 0.0); - vector_fp aw(m_numSpeciesTot, 0.0); - vector_fp wx(m_numElemConstraints, 0.0); - - vcs_basopt(false, &aw[0], &sa[0], &sm[0], &ss[0], - test, &usedZeroedSpecies); - vcs_evaluate_speciesType(); - - vcs_dfe(VCS_STATECALC_OLD, 0, 0, m_numSpeciesRdc); - if (printLvl > 3) { - vcs_printSpeciesChemPot(VCS_STATECALC_OLD); - } - vcs_deltag(0, true, VCS_STATECALC_OLD); - - if (printLvl > 3) { - vcs_printDeltaG(VCS_STATECALC_OLD); - } - m_deltaGRxn_Deficient = m_deltaGRxn_old; - funcVal = vcs_phaseStabilityTest(iph); - if (funcVal > 0.0) { - return 1; - } else { - return 0; - } -} - -} diff --git a/src/equil/vcs_species_thermo.cpp b/src/equil/vcs_species_thermo.cpp index 85f75a18c..11d3844b8 100644 --- a/src/equil/vcs_species_thermo.cpp +++ b/src/equil/vcs_species_thermo.cpp @@ -41,53 +41,4 @@ VCS_SPECIES_THERMO* VCS_SPECIES_THERMO::duplMyselfAsVCS_SPECIES_THERMO() return new VCS_SPECIES_THERMO(*this); } -double VCS_SPECIES_THERMO::GStar_R_calc(size_t kglob, double TKelvin, - double pres) -{ - warn_deprecated("VCS_SPECIES_THERMO::GStar_R_calc", - "Unused. To be removed after Cantera 2.3."); - double fe = G0_R_calc(kglob, TKelvin); - OwningPhase->setState_TP(TKelvin, pres); - fe = OwningPhase->GStar_calc_one(IndexSpeciesPhase); - return fe / GasConstant; -} - -double VCS_SPECIES_THERMO::VolStar_calc(size_t kglob, double TKelvin, - double presPA) -{ - warn_deprecated("VCS_SPECIES_THERMO::VolStar_calc", - "Unused. To be removed after Cantera 2.3."); - OwningPhase->setState_TP(TKelvin, presPA); - return OwningPhase->VolStar_calc_one(IndexSpeciesPhase); -} - -double VCS_SPECIES_THERMO::G0_R_calc(size_t kglob, double TKelvin) -{ - warn_deprecated("VCS_SPECIES_THERMO::G0_R_calc", - "Unused. To be removed after Cantera 2.3."); - if (SS0_Model == VCS_SS0_CONSTANT) { - return SS0_feSave; - } - if (TKelvin == SS0_TSave) { - return SS0_feSave; - } - OwningPhase->setState_T(TKelvin); - double fe = OwningPhase->G0_calc_one(IndexSpeciesPhase); - fe /= GasConstant; - SS0_feSave = fe; - SS0_TSave = TKelvin; - return fe; -} - -double VCS_SPECIES_THERMO::eval_ac(size_t kglob) -{ - // Activity coefficients are frequently evaluated on a per phase basis. If - // they are, then the currPhAC[] boolean may be used to reduce repeated - // work. Just set currPhAC[iph], when the activity coefficients for all - // species in the phase are reevaluated. - warn_deprecated("VCS_SPECIES_THERMO::eval_ac", - "Unused. To be removed after Cantera 2.3."); - return OwningPhase->AC_calc_one(IndexSpeciesPhase); -} - } diff --git a/src/fortran/cantera.f90 b/src/fortran/cantera.f90 index b2dafe573..7cae91497 100644 --- a/src/fortran/cantera.f90 +++ b/src/fortran/cantera.f90 @@ -88,9 +88,9 @@ MODULE CANTERA MODULE PROCEDURE ctthermo_entropy_mole END INTERFACE entropy_mole - INTERFACE eosType - MODULE PROCEDURE ctthermo_eosType - END INTERFACE eosType + INTERFACE getEosType + MODULE PROCEDURE ctthermo_getEosType + END INTERFACE getEosType INTERFACE equilibrate MODULE PROCEDURE ctthermo_equilibrate @@ -240,9 +240,9 @@ MODULE CANTERA MODULE PROCEDURE ctkin_kineticsStart END INTERFACE kineticsStart - INTERFACE kineticsType - MODULE PROCEDURE ctkin_kineticsType - END INTERFACE kineticsType + INTERFACE getKineticsType + MODULE PROCEDURE ctkin_getKineticsType + END INTERFACE getKineticsType INTERFACE massFraction MODULE PROCEDURE ctthermo_massFraction diff --git a/src/fortran/cantera_kinetics.f90 b/src/fortran/cantera_kinetics.f90 index dfe03dee6..637c7c4cd 100644 --- a/src/fortran/cantera_kinetics.f90 +++ b/src/fortran/cantera_kinetics.f90 @@ -48,11 +48,12 @@ module cantera_kinetics phase%nrxn = kin_nreactions(phase%kin_id) end subroutine newKinetics - integer function ctkin_kineticsType(self) + subroutine ctkin_getKineticsType(self, nm) implicit none type(phase_t), intent(inout) :: self - ctkin_kineticsType = kin_type(self%kin_id) - end function ctkin_kineticsType + character*(*), intent(out) :: nm + self%err = kin_gettype(self%kin_id, nm) + end subroutine ctkin_getKineticsType integer function ctkin_kineticsStart(self, p) implicit none diff --git a/src/fortran/cantera_thermo.f90 b/src/fortran/cantera_thermo.f90 index 8b7cd538f..d5bf5cb96 100644 --- a/src/fortran/cantera_thermo.f90 +++ b/src/fortran/cantera_thermo.f90 @@ -236,11 +236,12 @@ contains ctthermo_natoms = phase_natoms(self%thermo_id, k, m) end function ctthermo_natoms - integer function ctthermo_eosType(self) + subroutine ctthermo_getEosType(self, nm) implicit none type(phase_t), intent(inout) :: self - ctthermo_eostype = th_eostype(self%thermo_id) - end function ctthermo_eostype + character*(*), intent(out) :: nm + self%err = th_geteostype(self%thermo_id, nm) + end subroutine ctthermo_getEosType double precision function ctthermo_enthalpy_mole(self) implicit none diff --git a/src/fortran/fct.cpp b/src/fortran/fct.cpp index 61e23084d..1eb8d398f 100644 --- a/src/fortran/fct.cpp +++ b/src/fortran/fct.cpp @@ -367,10 +367,10 @@ extern "C" { } } - integer th_eostype_(const integer* n) + integer th_geteostype_(const integer* n, char* buf, ftnlen lenbuf) { try { - return _fth(n)->eosType(); + return copyString(_fth(n)->type(), buf, lenbuf); } catch (...) { return handleAllExceptions(-1, ERR); } @@ -658,10 +658,10 @@ extern "C" { } //------------------------------------- - integer kin_type_(const integer* n) + integer kin_gettype_(const integer* n, char* buf, ftnlen buflen) { try { - return _fkin(n)->type(); + return copyString(_fkin(n)->kineticsType(), buf, buflen); } catch (...) { return handleAllExceptions(-1, ERR); } diff --git a/src/fortran/fct_interface.f90 b/src/fortran/fct_interface.f90 index 52bdc6677..4a9046f35 100644 --- a/src/fortran/fct_interface.f90 +++ b/src/fortran/fct_interface.f90 @@ -127,9 +127,10 @@ interface integer, intent(in) :: mxml end function newthermofromxml - integer function th_eostype(n) + integer function th_geteostype(n, buf) integer, intent(in) :: n - end function th_eostype + character*(*), intent(out) :: buf + end function th_geteostype double precision function th_enthalpy_mole(n) integer, intent(in) :: n @@ -261,9 +262,10 @@ interface integer, intent(in) :: neighbor4 end function newkineticsfromxml - integer function kin_type(n) + integer function kin_gettype(n, buf) integer, intent(in) :: n - end function kin_type + character*(*), intent(out) :: buf + end function kin_gettype integer function kin_start(n, p) integer, intent(in) :: n diff --git a/src/kinetics/AqueousKinetics.cpp b/src/kinetics/AqueousKinetics.cpp index 6dfc75a13..b12dc8706 100644 --- a/src/kinetics/AqueousKinetics.cpp +++ b/src/kinetics/AqueousKinetics.cpp @@ -20,13 +20,6 @@ AqueousKinetics::AqueousKinetics(thermo_t* thermo) : { } -Kinetics* AqueousKinetics::duplMyselfAsKinetics(const std::vector & tpVector) const -{ - AqueousKinetics* gK = new AqueousKinetics(*this); - gK->assignShallowPointers(tpVector); - return gK; -} - void AqueousKinetics::_update_rates_T() { doublereal T = thermo().temperature(); diff --git a/src/kinetics/BulkKinetics.cpp b/src/kinetics/BulkKinetics.cpp index 536c69f7e..5bbe02db7 100644 --- a/src/kinetics/BulkKinetics.cpp +++ b/src/kinetics/BulkKinetics.cpp @@ -16,13 +16,6 @@ BulkKinetics::BulkKinetics(thermo_t* thermo) : } } -Kinetics* BulkKinetics::duplMyselfAsKinetics(const std::vector & tpVector) const -{ - BulkKinetics* kin = new BulkKinetics(*this); - kin->assignShallowPointers(tpVector); - return kin; -} - bool BulkKinetics::isReversible(size_t i) { return std::find(m_revindex.begin(), m_revindex.end(), i) < m_revindex.end(); } diff --git a/src/kinetics/GasKinetics.cpp b/src/kinetics/GasKinetics.cpp index fb3c767f2..a72bec917 100644 --- a/src/kinetics/GasKinetics.cpp +++ b/src/kinetics/GasKinetics.cpp @@ -20,13 +20,6 @@ GasKinetics::GasKinetics(thermo_t* thermo) : { } -Kinetics* GasKinetics::duplMyselfAsKinetics(const std::vector & tpVector) const -{ - GasKinetics* gK = new GasKinetics(*this); - gK->assignShallowPointers(tpVector); - return gK; -} - void GasKinetics::update_rates_T() { doublereal T = thermo().temperature(); diff --git a/src/kinetics/ImplicitSurfChem.cpp b/src/kinetics/ImplicitSurfChem.cpp index 49d926640..92bdaf866 100644 --- a/src/kinetics/ImplicitSurfChem.cpp +++ b/src/kinetics/ImplicitSurfChem.cpp @@ -95,14 +95,6 @@ int ImplicitSurfChem::checkMatch(std::vector m_vec, ThermoPhase* t return retn; } -void ImplicitSurfChem::getInitialConditions(doublereal t0, size_t lenc, - doublereal* c) -{ - warn_deprecated("ImplicitSurfChem::getInitialConditions", - "Use getState instead. To be removed after Cantera 2.3."); - getState(c); -} - void ImplicitSurfChem::getState(doublereal* c) { size_t loc = 0; diff --git a/src/kinetics/InterfaceKinetics.cpp b/src/kinetics/InterfaceKinetics.cpp index 1d5a617a6..4b23d9c55 100644 --- a/src/kinetics/InterfaceKinetics.cpp +++ b/src/kinetics/InterfaceKinetics.cpp @@ -41,74 +41,6 @@ InterfaceKinetics::~InterfaceKinetics() delete m_integrator; } -InterfaceKinetics::InterfaceKinetics(const InterfaceKinetics& right) -{ - // Call the assignment operator - operator=(right); -} - -InterfaceKinetics& InterfaceKinetics::operator=(const InterfaceKinetics& right) -{ - // Check for self assignment. - if (this == &right) { - return *this; - } - - Kinetics::operator=(right); - - m_grt = right.m_grt; - m_revindex = right.m_revindex; - m_rates = right.m_rates; - m_redo_rates = right.m_redo_rates; - m_irrev = right.m_irrev; - m_conc = right.m_conc; - m_actConc = right.m_actConc; - m_mu0 = right.m_mu0; - m_mu = right.m_mu; - m_mu0_Kc = right.m_mu0_Kc; - m_phi = right.m_phi; - m_pot = right.m_pot; - deltaElectricEnergy_ = right.deltaElectricEnergy_; - m_surf = right.m_surf; //DANGER - shallow copy - m_integrator = right.m_integrator; //DANGER - shallow copy - m_beta = right.m_beta; - m_ctrxn = right.m_ctrxn; - m_ctrxn_BVform = right.m_ctrxn_BVform; - m_ctrxn_ecdf = right.m_ctrxn_ecdf; - m_StandardConc = right.m_StandardConc; - m_deltaG0 = right.m_deltaG0; - m_deltaG = right.m_deltaG; - m_ProdStanConcReac = right.m_ProdStanConcReac; - m_ROP_ok = right.m_ROP_ok; - m_temp = right.m_temp; - m_logtemp = right.m_logtemp; - m_has_coverage_dependence = right.m_has_coverage_dependence; - m_has_electrochem_rxns = right.m_has_electrochem_rxns; - m_has_exchange_current_density_formulation = right.m_has_exchange_current_density_formulation; - m_phaseExistsCheck = right.m_phaseExistsCheck; - m_phaseExists = right.m_phaseExists; - m_phaseIsStable = right.m_phaseIsStable; - m_rxnPhaseIsReactant = right.m_rxnPhaseIsReactant; - m_rxnPhaseIsProduct = right.m_rxnPhaseIsProduct; - m_ioFlag = right.m_ioFlag; - - return *this; -} - -int InterfaceKinetics::type() const -{ - warn_deprecated("InterfaceKinetics::type", - "To be removed after Cantera 2.3."); - return cInterfaceKinetics; -} - -Kinetics* InterfaceKinetics::duplMyselfAsKinetics(const std::vector & tpVector) const -{ - InterfaceKinetics* iK = new InterfaceKinetics(*this); - iK->assignShallowPointers(tpVector); - return iK; -} - void InterfaceKinetics::setElectricPotential(int n, doublereal V) { thermo(n).setElectricPotential(V); @@ -233,43 +165,6 @@ void InterfaceKinetics::updateMu0() } } -void InterfaceKinetics::checkPartialEquil() -{ - warn_deprecated("InterfaceKinetics::checkPartialEquil", - "To be removed after Cantera 2.3."); - // First task is update the electrical potentials from the Phases - _update_rates_phi(); - - vector_fp dmu(nTotalSpecies(), 0.0); - vector_fp rmu(std::max(nReactions(), 1), 0.0); - if (m_revindex.size() > 0) { - cout << "T = " << thermo(0).temperature() << " " << thermo(0).RT() << endl; - size_t nsp, ik=0; - doublereal delta; - for (size_t n = 0; n < nPhases(); n++) { - thermo(n).getChemPotentials(dmu.data() + m_start[n]); - nsp = thermo(n).nSpecies(); - for (size_t k = 0; k < nsp; k++) { - delta = Faraday * m_phi[n] * thermo(n).charge(k); - dmu[ik] += delta; - ik++; - } - } - - // compute Delta mu^ for all reversible reactions - getRevReactionDelta(dmu.data(), rmu.data()); - updateROP(); - for (size_t i = 0; i < m_revindex.size(); i++) { - size_t irxn = m_revindex[i]; - writelog("Reaction {} {}\n", - reactionString(irxn), rmu[irxn]/thermo(0).RT()); - writelogf("%12.6e %12.6e %12.6e %12.6e \n", - m_ropf[irxn], m_ropr[irxn], m_ropnet[irxn], - m_ropnet[irxn]/(m_ropf[irxn] + m_ropr[irxn])); - } - } -} - void InterfaceKinetics::getEquilibriumConstants(doublereal* kc) { updateMu0(); diff --git a/src/kinetics/Kinetics.cpp b/src/kinetics/Kinetics.cpp index cf722ae8a..55c55ba16 100644 --- a/src/kinetics/Kinetics.cpp +++ b/src/kinetics/Kinetics.cpp @@ -31,60 +31,6 @@ Kinetics::Kinetics() : Kinetics::~Kinetics() {} -Kinetics::Kinetics(const Kinetics& right) -{ - warn_deprecated("Kinetics copy constructor", "To be removed after" - " Cantera 2.3 for all classes derived from Kinetics."); - // Call the assignment operator - *this = right; -} - -Kinetics& Kinetics::operator=(const Kinetics& right) -{ - warn_deprecated("Kinetics assignment operator", "To be removed after" - " Cantera 2.3 for all classes derived from Kinetics."); - // Check for self assignment. - if (this == &right) { - return *this; - } - - m_reactantStoich = right.m_reactantStoich; - m_revProductStoich = right.m_revProductStoich; - m_irrevProductStoich = right.m_irrevProductStoich; - m_kk = right.m_kk; - m_perturb = right.m_perturb; - m_reactions = right.m_reactions; - m_thermo = right.m_thermo; // DANGER -> shallow pointer copy - m_start = right.m_start; - m_phaseindex = right.m_phaseindex; - m_surfphase = right.m_surfphase; - m_rxnphase = right.m_rxnphase; - m_mindim = right.m_mindim; - m_rfn = right.m_rfn; - m_rkcn = right.m_rkcn; - m_ropf = right.m_ropf; - m_ropr = right.m_ropr; - m_ropnet = right.m_ropnet; - m_skipUndeclaredSpecies = right.m_skipUndeclaredSpecies; - - return *this; -} - -Kinetics* Kinetics::duplMyselfAsKinetics(const std::vector & tpVector) const -{ - warn_deprecated("Kinetics::duplMyselfAsKinetics", - "To be removed after Cantera 2.3."); - Kinetics* ko = new Kinetics(*this); - ko->assignShallowPointers(tpVector); - return ko; -} - -int Kinetics::type() const -{ - warn_deprecated("Kinetics::type", "To be removed after Cantera 2.3."); - return 0; -} - void Kinetics::checkReactionIndex(size_t i) const { if (i >= nReactions()) { @@ -127,31 +73,6 @@ void Kinetics::checkSpeciesArraySize(size_t kk) const } } -void Kinetics::assignShallowPointers(const std::vector & tpVector) -{ - if (tpVector.size() != m_thermo.size()) { - throw CanteraError(" Kinetics::assignShallowPointers", - " Number of ThermoPhase objects arent't the same"); - } - for (size_t i = 0; i < tpVector.size(); i++) { - ThermoPhase* ntp = tpVector[i]; - ThermoPhase* otp = m_thermo[i]; - if (ntp->id() != otp->id()) { - throw CanteraError(" Kinetics::assignShallowPointers", - " id() of the ThermoPhase objects isn't the same"); - } - if (ntp->type() != otp->type()) { - throw CanteraError(" Kinetics::assignShallowPointers", - " type() of the ThermoPhase objects isn't the same"); - } - if (ntp->nSpecies() != otp->nSpecies()) { - throw CanteraError(" Kinetics::assignShallowPointers", - " Number of ThermoPhase objects isn't the same"); - } - m_thermo[i] = tpVector[i]; - } -} - std::pair Kinetics::checkDuplicates(bool throw_err) const { //! Map of (key indicating participating species) to reaction numbers @@ -533,12 +454,6 @@ void Kinetics::resizeSpecies() invalidateCache(); } -void Kinetics::finalize() -{ - warn_deprecated("Kinetics::finalize", - "No longer needed. To be removed after Cantera 2.3."); -} - bool Kinetics::addReaction(shared_ptr r) { r->validate(); diff --git a/src/matlab/phasemethods.cpp b/src/matlab/phasemethods.cpp index 06653c784..23777c37e 100644 --- a/src/matlab/phasemethods.cpp +++ b/src/matlab/phasemethods.cpp @@ -267,6 +267,13 @@ void phasemethods(int nlhs, mxArray* plhs[], iok = thermo_getName(ph, buflen, output_buf); } break; + case 43: + buflen = thermo_getEosType(ph, 0, 0); + if (buflen > 0) { + output_buf = (char*)mxCalloc(buflen, sizeof(char)); + iok = thermo_getEosType(ph, buflen, output_buf); + } + break; default: iok = -1; } diff --git a/src/matlab/reactornetmethods.cpp b/src/matlab/reactornetmethods.cpp index 37425911a..feeafaae0 100644 --- a/src/matlab/reactornetmethods.cpp +++ b/src/matlab/reactornetmethods.cpp @@ -72,7 +72,7 @@ void reactornetmethods(int nlhs, mxArray* plhs[], // options that return a value of type 'double' switch (job) { case 21: - r = reactornet_step(i, v); + r = reactornet_step(i); break; case 22: r = reactornet_time(i); diff --git a/src/matlab/thermomethods.cpp b/src/matlab/thermomethods.cpp index 8f7c98d52..386cf7603 100644 --- a/src/matlab/thermomethods.cpp +++ b/src/matlab/thermomethods.cpp @@ -173,9 +173,6 @@ static void thermoget(int nlhs, mxArray* plhs[], case 17: vv = thermo_maxTemp(n, -1); break; - case 18: - vv = double(thermo_eosType(n)); - break; case 19: vv = thermo_critTemperature(n); break; diff --git a/src/matlab/wallmethods.cpp b/src/matlab/wallmethods.cpp index d358c81d8..6feefb575 100644 --- a/src/matlab/wallmethods.cpp +++ b/src/matlab/wallmethods.cpp @@ -64,11 +64,6 @@ void wallmethods(int nlhs, mxArray* plhs[], case 11: iok = wall_ready(i); break; - case 12: - n = getInt(prhs[3]); - m = getInt(prhs[4]); - iok = wall_setkinetics(i, n, m); - break; case 13: iok = wall_setEmissivity(i, v); break; diff --git a/src/numerics/BandMatrix.cpp b/src/numerics/BandMatrix.cpp index c2ec04e7d..37053532f 100644 --- a/src/numerics/BandMatrix.cpp +++ b/src/numerics/BandMatrix.cpp @@ -175,17 +175,6 @@ size_t BandMatrix::nRows() const return m_n; } -size_t BandMatrix::nRowsAndStruct(size_t* const iStruct) const -{ - warn_deprecated("BandMatrix::nRowsAndStruct", - "To be removed after Cantera 2.3."); - if (iStruct) { - iStruct[0] = m_kl; - iStruct[1] = m_ku; - } - return m_n; -} - size_t BandMatrix::nColumns() const { return m_n; @@ -413,11 +402,6 @@ size_t BandMatrix::checkColumns(doublereal& valueSmall) const return jSmall; } -GeneralMatrix* BandMatrix::duplMyselfAsGeneralMatrix() const -{ - return new BandMatrix(*this); -} - doublereal* BandMatrix::ptrColumn(size_t j) { return m_colPtrs[j]; diff --git a/src/numerics/ResidJacEval.cpp b/src/numerics/ResidJacEval.cpp index 37e54f91c..61d679851 100644 --- a/src/numerics/ResidJacEval.cpp +++ b/src/numerics/ResidJacEval.cpp @@ -15,34 +15,6 @@ ResidJacEval::ResidJacEval(doublereal atol) : { } -ResidJacEval::ResidJacEval(const ResidJacEval& right) -{ - warn_deprecated("ResidJacEval copy constructor", - "To be removed after Cantera 2.3."); - *this = right; -} - -ResidJacEval& ResidJacEval::operator=(const ResidJacEval& right) -{ - warn_deprecated("ResidJacEval assignment operator", - "To be removed after Cantera 2.3."); - if (this == &right) { - return *this; - } - - ResidEval::operator=(right); - - m_atol = right.m_atol; - neq_ = right.neq_; - - return *this; -} - -ResidJacEval* ResidJacEval::duplMyselfAsResidJacEval() const -{ - return new ResidJacEval(*this); -} - int ResidJacEval::nEquations() const { return neq_; diff --git a/src/numerics/RootFind.cpp b/src/numerics/RootFind.cpp deleted file mode 100644 index c8449c339..000000000 --- a/src/numerics/RootFind.cpp +++ /dev/null @@ -1,1073 +0,0 @@ -//! @file: RootFind.cpp root finder for 1D problems - -// This file is part of Cantera. See License.txt in the top-level directory or -// at http://www.cantera.org/license.txt for license and copyright information. - -#include "cantera/numerics/RootFind.h" -#include "cantera/base/utilities.h" -#include "cantera/base/stringUtils.h" - -using namespace std; -namespace Cantera -{ - -//! Print out a form for the current function evaluation -/*! - * @param fp Pointer to the FILE object - * @param xval Current value of x - * @param fval Current value of f - * @param its Current iteration value - */ -static void print_funcEval(FILE* fp, doublereal xval, doublereal fval, int its) -{ - fprintf(fp,"\n"); - fprintf(fp,"...............................................................\n"); - fprintf(fp,".................. RootFind Function Evaluation ...............\n"); - fprintf(fp,".................. iteration = %5d ........................\n", its); - fprintf(fp,".................. value = %12.5g ......................\n", xval); - fprintf(fp,".................. funct = %12.5g ......................\n", fval); - fprintf(fp,"...............................................................\n"); - fprintf(fp,"\n"); -} - -RootFind::RootFind(ResidEval* resid) : - m_residFunc(resid), - m_funcTargetValue(0.0), - m_atolf(1.0E-11), - m_atolx(1.0E-11), - m_rtolf(1.0E-5), - m_rtolx(1.0E-5), - m_maxstep(1000), - printLvl(0), - writeLogAllowed_(false), - DeltaXnorm_(0.01), - specifiedDeltaXnorm_(0), - DeltaXMax_(1.0E6), - specifiedDeltaXMax_(0), - FuncIsGenerallyIncreasing_(false), - FuncIsGenerallyDecreasing_(false), - deltaXConverged_(0.0), - x_maxTried_(-1.0E300), - fx_maxTried_(0.0), - x_minTried_(1.0E300), - fx_minTried_(0.0) -{ - warn_deprecated("Unused. To be removed after Cantera 2.3. See " - "boost::math::tools::toms748_solve for an alternative."); -} - -RootFind::RootFind(const RootFind& r) : - m_residFunc(r.m_residFunc), - m_funcTargetValue(0.0), - m_atolf(1.0E-11), - m_atolx(1.0E-11), - m_rtolf(1.0E-5), - m_rtolx(1.0E-5), - m_maxstep(1000), - printLvl(0), - writeLogAllowed_(false), - DeltaXnorm_(0.01), - specifiedDeltaXnorm_(0), - DeltaXMax_(1.0E6), - specifiedDeltaXMax_(0), - FuncIsGenerallyIncreasing_(false), - FuncIsGenerallyDecreasing_(false), - deltaXConverged_(0.0), - x_maxTried_(-1.0E300), - fx_maxTried_(0.0), - x_minTried_(1.0E300), - fx_minTried_(0.0) -{ - warn_deprecated("RootFind copy constructor", - "To be removed after Cantera 2.3."); - *this = r; -} - -RootFind& RootFind::operator=(const RootFind& right) -{ - warn_deprecated("RootFind assignment operator", - "To be removed after Cantera 2.3."); - if (this == &right) { - return *this; - } - m_residFunc = right.m_residFunc; - m_funcTargetValue = right.m_funcTargetValue; - m_atolf = right.m_atolf; - m_atolx = right.m_atolx; - m_rtolf = right.m_rtolf; - m_rtolx = right.m_rtolx; - m_maxstep = right.m_maxstep; - printLvl = right.printLvl; - writeLogAllowed_ = right.writeLogAllowed_; - DeltaXnorm_ = right.DeltaXnorm_; - specifiedDeltaXnorm_ = right.specifiedDeltaXnorm_; - DeltaXMax_ = right.DeltaXMax_; - specifiedDeltaXMax_ = right.specifiedDeltaXMax_; - FuncIsGenerallyIncreasing_ = right.FuncIsGenerallyIncreasing_; - FuncIsGenerallyDecreasing_ = right.FuncIsGenerallyDecreasing_; - deltaXConverged_ = right.deltaXConverged_; - x_maxTried_ = right.x_maxTried_; - fx_maxTried_ = right.fx_maxTried_; - x_minTried_ = right.x_minTried_; - fx_minTried_ = right.fx_minTried_; - - return *this; -} - -doublereal RootFind::delXNonzero(doublereal x1) const -{ - doublereal deltaX = 1.0E-14 * fabs(x1); - doublereal delmin = DeltaXnorm_ * 1.0E-14; - if (delmin > deltaX) { - return delmin; - } - return deltaX; -} - -doublereal RootFind::delXMeaningful(doublereal x1) const -{ - doublereal del = delXNonzero(x1); - if (deltaXConverged_ > del) { - return deltaXConverged_; - } - return del; -} - -double RootFind::deltaXControlled(doublereal x2, doublereal x1) const -{ - doublereal sgnn = 1.0; - if (x1 > x2) { - sgnn = -1.0; - } - doublereal deltaX = x2 - x1; - doublereal x = fabs(x2) + fabs(x1); - doublereal deltaXm = delXNonzero(x); - if (fabs(deltaX) < deltaXm) { - deltaX = sgnn * deltaXm; - } - return deltaX; -} - -bool RootFind::theSame(doublereal x2, doublereal x1, doublereal factor) const -{ - doublereal x = fabs(x2) + fabs(x1); - doublereal deltaX = delXMeaningful(x); - doublereal deltaXSmall = factor * deltaX; - deltaXSmall = std::max(deltaXSmall , x * 1.0E-15); - if (fabs(x2 - x1) < deltaXSmall) { - return true; - } - return false; -} - -int RootFind::solve(doublereal xmin, doublereal xmax, int itmax, doublereal& funcTargetValue, doublereal* xbest) -{ - // We store the function target and then actually calculate a modified - // functional, func = eval(x1) - m_funcTargetValue = 0 - m_funcTargetValue = funcTargetValue; - - static int callNum = 0; - const char* stre = "RootFind ERROR: "; - const char* strw = "RootFind WARNING: "; - int converged = 0; - int bottomBump = 0; - int topBump = 0; - FILE* fp = 0; - int doFinalFuncCall = 0; - doublereal x1, x2, xnew, f1, f2, fnew, slope = 0; - doublereal deltaX2 = 0.0, deltaXnew = 0.0; - int posStraddle = 0; - int retn = ROOTFIND_FAILEDCONVERGENCE; - int foundPosF = 0; - int foundNegF = 0; - int foundStraddle = 0; - doublereal xPosF = 0.0; - doublereal fPosF = 1.0E300; - doublereal xNegF = 0.0; - doublereal fNegF = -1.0E300; - doublereal fnorm; // A valid norm for the making the function value dimensionless - doublereal xDelMin; - doublereal sgn; - doublereal fnoise = 0.0; - rfHistory_.clear(); - rfTable rfT; - rfT.clear(); - rfT.reasoning = "First Point: "; - - callNum++; - if (printLvl >= 3 && writeLogAllowed_) { - fp = fopen(fmt::format("RootFind_%d.log", callNum).c_str(), "w"); - fprintf(fp, " Iter TP_its xval Func_val | Reasoning\n"); - fprintf(fp, "-----------------------------------------------------" - "-------------------------------\n"); - } else if (printLvl >= 3) { - writelog("WARNING: RootFind: printlvl >= 3, but debug mode not turned on\n"); - } - if (xmax <= xmin) { - writelogf("%sxmin and xmax are bad: %g %g\n", stre, xmin, xmax); - funcTargetValue = func(*xbest); - return ROOTFIND_BADINPUT; - } - - // If the maximum step size has not been specified, set it here to 1/5 of - // the domain range of x. - if (!specifiedDeltaXMax_) { - DeltaXMax_ = 0.2 *(xmax - xmin); - } - - if (!specifiedDeltaXnorm_) { - DeltaXnorm_ = 0.2 * DeltaXMax_; - } else { - if (DeltaXnorm_ > DeltaXMax_) { - if (specifiedDeltaXnorm_) { - DeltaXMax_ = DeltaXnorm_; - } else { - DeltaXnorm_ = 0.5 * DeltaXMax_; - } - } - } - - // Calculate an initial value of deltaXConverged_ - deltaXConverged_ = m_rtolx * (*xbest) + m_atolx; - if (DeltaXnorm_ < deltaXConverged_) { - writelogf("%s DeltaXnorm_, %g, is too small compared to tols, increasing to %g\n", - stre, DeltaXnorm_, deltaXConverged_); - DeltaXnorm_ = deltaXConverged_; - } - - // Find the first function value f1 = func(x1), by using the value entered - // into xbest. Process it - x1 = *xbest; - if (x1 < xmin || x1 > xmax) { - x1 = (xmin + xmax) / 2.0; - rfT.reasoning += " x1 set middle between xmin and xmax because entrance is outside bounds."; - } else { - rfT.reasoning += " x1 set to entrance x."; - } - - x_maxTried_ = x1; - x_minTried_ = x1; - int its = 1; - f1 = func(x1); - - if (printLvl >= 3 && writeLogAllowed_) { - print_funcEval(fp, x1, f1, its); - fprintf(fp, "%-5d %-5d %-15.5E %-15.5E\n", -2, 0, x1, f1); - } - - if (f1 == 0.0) { - *xbest = x1; - return 0; - } else if (f1 > fnoise) { - foundPosF = 1; - xPosF = x1; - fPosF = f1; - } else if (f1 < -fnoise) { - foundNegF = 1; - xNegF = x1; - fNegF = f1; - } - rfT.its = its; - rfT.TP_its = 0; - rfT.xval = x1; - rfT.fval = f1; - rfT.foundPos = foundPosF; - rfT.foundNeg = foundNegF; - rfT.deltaXConverged = m_rtolx * (fabs(x1) + 0.001); - rfT.deltaFConverged = fabs(f1) * m_rtolf; - rfT.delX = xmax - xmin; - rfHistory_.push_back(rfT); - rfT.clear(); - - // Now, this is actually a tricky part of the algorithm - Find the x value - // for the second point. It's tricky because we don't have a valid idea of - // the scale of x yet - rfT.reasoning = "Second Point: "; - if (x1 == 0.0) { - x2 = x1 + 0.01 * DeltaXnorm_; - rfT.reasoning += "Set by DeltaXnorm_"; - } else { - x2 = x1 * 1.0001; - rfT.reasoning += "Set slightly higher."; - } - if (x2 > xmax) { - x2 = x1 - 0.01 * DeltaXnorm_; - rfT.reasoning += " - But adjusted to be within bounds"; - } - - // Find the second function value f2 = func(x2), Process it - deltaX2 = x2 - x1; - its++; - f2 = func(x2); - if (printLvl >= 3 && writeLogAllowed_) { - print_funcEval(fp, x2, f2, its); - fprintf(fp, "%-5d %-5d %-15.5E %-15.5E", -1, 0, x2, f2); - } - - // Calculate the norm of the function, this is the nominal value of f. We - // try to reduce the nominal value of f by rtolf, this is the main - // convergence requirement. - if (m_funcTargetValue != 0.0) { - fnorm = m_atolf + fabs(m_funcTargetValue); - } else { - fnorm = 0.5*(fabs(f1) + fabs(f2)) + fabs(m_funcTargetValue) + m_atolf; - } - fnoise = 1.0E-100; - if (f2 > fnoise) { - if (!foundPosF) { - foundPosF = 1; - xPosF = x2; - fPosF = f2; - } - } else if (f2 < - fnoise) { - if (!foundNegF) { - foundNegF = 1; - xNegF = x2; - fNegF = f2; - } - } else if (f2 == 0.0) { - *xbest = x2; - return ROOTFIND_SUCCESS; - } - rfT.its = its; - rfT.TP_its = 0; - rfT.xval = x2; - rfT.fval = f2; - rfT.foundPos = foundPosF; - rfT.foundNeg = foundNegF; - - // See if we have already achieved a straddle - foundStraddle = foundPosF && foundNegF; - if (foundStraddle) { - if (xPosF > xNegF) { - posStraddle = 1; - } else { - posStraddle = 0; - } - } - - bool useNextStrat = false; - bool slopePointingToHigher = true; - - // MAIN LOOP - while (!converged && its < itmax) { - // Find an estimate of the next point, xnew, to try based on a linear - // approximation from the last two points. - if (fabs(x2 - x1) < 1.0E-14) { - writelogf(" RootFind: we are here x2 = %g x1 = %g\n", x2, x1); - } - doublereal delXtmp = deltaXControlled(x2, x1); - slope = (f2 - f1) / delXtmp; - rfT.slope = slope; - rfHistory_.push_back(rfT); - rfT.clear(); - rfT.reasoning = ""; - if (fabs(slope) <= 1.0E-100) { - if (printLvl >= 2) { - writelogf("%s functions evals produced the same result, %g, at %g and %g\n", - strw, f2, x1, x2); - } - xnew = x2 + DeltaXnorm_; - slopePointingToHigher = true; - useNextStrat = true; - rfT.reasoning += "Slope is close to zero. "; - } else { - useNextStrat = false; - xnew = x2 - f2 / slope; - if (xnew > x2) { - slopePointingToHigher = true; - } else { - slopePointingToHigher = false; - } - rfT.reasoning += "Slope is good. "; - } - if (printLvl >= 3 && writeLogAllowed_) { - fprintf(fp, " | xlin = %-11.5E", xnew); - } - deltaXnew = xnew - x2; - - // If the suggested step size is too big, throw out step - if (!foundStraddle) { - if (fabs(xnew - x2) > DeltaXMax_) { - useNextStrat = true; - rfT.reasoning += "Too large change in xnew from slope. "; - } - if (fabs(deltaXnew) < fabs(deltaX2)) { - deltaXnew = 1.2 * deltaXnew; - xnew = x2 + deltaXnew; - } - } - - // If the slope can't be trusted using a different strategy for picking - // the next point - if (useNextStrat) { - rfT.reasoning += fmt::format("Using DeltaXnorm, {} and FuncIsGenerallyIncreasing hints. ", DeltaXnorm_); - if (f2 < 0.0) { - if (FuncIsGenerallyIncreasing_) { - if (slopePointingToHigher) { - xnew = std::min(x2 + 3.0*DeltaXnorm_, xnew); - } else { - xnew = x2 + DeltaXnorm_; - } - } else if (FuncIsGenerallyDecreasing_) { - if (!slopePointingToHigher) { - xnew = std::max(x2 - 3.0*DeltaXnorm_, xnew); - } else { - xnew = x2 - DeltaXnorm_; - } - } else { - if (slopePointingToHigher) { - xnew = x2 + DeltaXnorm_; - } else { - xnew = x2 - DeltaXnorm_; - } - } - } else { - if (FuncIsGenerallyDecreasing_) { - if (!slopePointingToHigher) { - xnew = std::max(x2 + 3.0*DeltaXnorm_, xnew); - } else { - xnew = x2 + DeltaXnorm_; - } - } else if (FuncIsGenerallyIncreasing_) { - if (! slopePointingToHigher) { - xnew = std::min(x2 - 3.0*DeltaXnorm_, xnew); - } else { - xnew = x2 - DeltaXnorm_; - } - } else { - if (slopePointingToHigher) { - xnew = x2 + DeltaXnorm_; - } else { - xnew = x2 - DeltaXnorm_; - } - } - } - } - - // Here, if we have a straddle, we purposefully overshoot the smaller - // side by 5%. Yes it does lead to more iterations. However, we're - // interested in bounding x, and not just doing Newton's method. - if (foundStraddle) { - double delta = fabs(x2 - x1); - if (fabs(xnew - x1) < .01 * delta) { - xnew = x1 + 0.01 * (x2 - x1); - } else if (fabs(xnew - x2) < .01 * delta) { - xnew = x1 + 0.01 * (x2 - x1); - } else if ((xnew > x1 && xnew < x2) || (xnew < x1 && xnew > x2)) { - if (fabs(xnew - x1) < fabs(x2 - xnew)) { - xnew = x1 + 20./19. * (xnew - x1); - } else { - xnew = x2 + 20./19. * (xnew - x2); - } - } - } - - // OK, we have an estimate xnew. Put heuristic bounds on the step jump - if ((xnew > x1 && xnew < x2) || (xnew < x1 && xnew > x2)) { - // If we are doing a jump in between the two previous points, make - // sure the new trial is no closer that 10% of the distances between - // x2-x1 to any of the original points. This is an important part of - // finding a good bound. - xDelMin = fabs(x2 - x1) / 10.; - if (fabs(xnew - x1) < xDelMin) { - xnew = x1 + sign(xnew-x1) * xDelMin; - if (printLvl >= 3 && writeLogAllowed_) { - fprintf(fp, " | x10%% = %-11.5E", xnew); - } - } - if (fabs(xnew - x2) < 0.1 * xDelMin) { - xnew = x2 + sign(xnew-x2) * 0.1 * xDelMin; - if (printLvl >= 3 && writeLogAllowed_) { - fprintf(fp, " | x10%% = %-11.5E", xnew); - } - } - } else { - // If we are venturing into new ground, only allow the step jump to - // increase by 50% at each iteration, unless the step jump is less - // than the user has said that it is ok to take - doublereal xDelMax = 1.5 * fabs(x2 - x1); - if (specifiedDeltaXnorm_ && 0.5 * DeltaXnorm_ > xDelMax) { - xDelMax = 0.5 *DeltaXnorm_; - } - if (fabs(xDelMax) < fabs(xnew - x2)) { - xnew = x2 + sign(xnew-x2) * xDelMax; - if (printLvl >= 3 && writeLogAllowed_) { - fprintf(fp, " | xlimitsize = %-11.5E", xnew); - } - } - - // If we are doing a jump outside the two previous points, make sure - // the new trial is no closer that 10% of the distances between - // x2-x1 to any of the original points. This is an important part of - // finding a good bound. - xDelMin = 0.1 * fabs(x2 - x1); - if (fabs(xnew - x2) < xDelMin) { - xnew = x2 + sign(xnew - x2) * xDelMin; - if (printLvl >= 3 && writeLogAllowed_) { - fprintf(fp, " | x10%% = %-11.5E", xnew); - } - } - if (fabs(xnew - x1) < xDelMin) { - xnew = x1 + sign(xnew - x1) * xDelMin; - if (printLvl >= 3 && writeLogAllowed_) { - fprintf(fp, " | x10%% = %-11.5E", xnew); - } - } - } - - // HKM -> Not sure this section is needed - if (foundStraddle) { - double xorig = xnew; - if (posStraddle) { - if (f2 > 0.0) { - if (xnew > x2) { - xnew = (xNegF + x2)/2; - } - if (xnew < xNegF) { - xnew = (xNegF + x2)/2; - } - } else { - if (xnew < x2) { - xnew = (xPosF + x2)/2; - } - if (xnew > xPosF) { - xnew = (xPosF + x2)/2; - } - } - } else { - if (f2 > 0.0) { - if (xnew < x2) { - xnew = (xNegF + x2)/2; - } - if (xnew > xNegF) { - xnew = (xNegF + x2)/2; - } - } else { - if (xnew > x2) { - xnew = (xPosF + x2)/2; - } - if (xnew < xPosF) { - xnew = (xPosF + x2)/2; - } - } - } - if (printLvl >= 3 && writeLogAllowed_ && xorig != xnew) { - fprintf(fp, " | xstraddle = %-11.5E", xnew); - } - } - - // Enforce a minimum stepsize if we haven't found a straddle. - deltaXnew = xnew - x2; - if (fabs(deltaXnew) < 1.2 * delXMeaningful(xnew) && !foundStraddle) { - sgn = 1.0; - if (x2 > xnew) { - sgn = -1.0; - } - deltaXnew = 1.2 * delXMeaningful(xnew) * sgn; - rfT.reasoning += fmt::format("Enforcing minimum stepsize from {} to {}", - xnew - x2, deltaXnew); - xnew = x2 + deltaXnew; - } - - // Guard against going above xmax or below xmin - if (xnew > xmax) { - topBump++; - if (topBump < 3) { - xnew = x2 + (xmax - x2) / 2.0; - rfT.reasoning += fmt::format("xval reduced to {} because predicted xnew was above max value of {}", xnew, xmax); - } else { - if (x2 == xmax || x1 == xmax) { - // we are here when we are bumping against the top limit. - // No further action is possible - retn = ROOTFIND_SOLNHIGHERTHANXMAX; - *xbest = xnew; - rfT.slope = slope; - rfT.reasoning += fmt::format("Giving up because we're at xmax and xnew point higher: {}", xnew); - goto done; - } else { - rfT.reasoning += fmt::format("xval reduced from {} to the max value, {}", xnew, xmax); - xnew = xmax; - } - } - if (printLvl >= 3 && writeLogAllowed_) { - fprintf(fp, " | xlimitmax = %-11.5E", xnew); - } - } - if (xnew < xmin) { - bottomBump++; - if (bottomBump < 3) { - rfT.reasoning += fmt::format("xnew increased from {} to {} because above min value of {}", - xnew, x2 - (x2 - xmin) / 2.0, xmin); - xnew = x2 - (x2 - xmin) / 2.0; - } else { - if (x2 == xmin || x1 == xmin) { - // we are here when we are bumping against the bottom limit. - // No further action is possible - retn = ROOTFIND_SOLNLOWERTHANXMIN; - *xbest = xnew; - rfT.slope = slope; - rfT.reasoning = fmt::format("Giving up because we're already at xmin and xnew points lower: {}", xnew); - goto done; - } else { - rfT.reasoning += fmt::format("xval increased from {} to the min value, {}", xnew, xmin); - xnew = xmin; - } - } - if (printLvl >= 3 && writeLogAllowed_) { - fprintf(fp, " | xlimitmin = %-11.5E", xnew); - } - } - - its++; - fnew = func(xnew); - - if (printLvl >= 3 && writeLogAllowed_) { - fprintf(fp,"\n"); - print_funcEval(fp, xnew, fnew, its); - fprintf(fp, "%-5d %-5d %-15.5E %-15.5E", its, 0, xnew, fnew); - } - rfT.xval = xnew; - rfT.fval = fnew; - rfT.its = its; - if (foundStraddle) { - if (posStraddle) { - if (fnew > 0.0) { - if (xnew < xPosF) { - xPosF = xnew; - fPosF = fnew; - } - } else { - if (xnew > xNegF) { - xNegF = xnew; - fNegF = fnew; - } - } - } else { - if (fnew > 0.0) { - if (xnew > xPosF) { - xPosF = xnew; - fPosF = fnew; - } - } else { - if (xnew < xNegF) { - xNegF = xnew; - fNegF = fnew; - } - } - } - } - - if (! foundStraddle) { - if (fnew > fnoise) { - if (!foundPosF) { - foundPosF = 1; - rfT.foundPos = 1; - xPosF = xnew; - fPosF = fnew; - foundStraddle = 1; - if (xPosF > xNegF) { - posStraddle = 1; - } else { - posStraddle = 0; - } - } - } else if (fnew < - fnoise) { - if (!foundNegF) { - foundNegF = 1; - rfT.foundNeg = 1; - xNegF = xnew; - fNegF = fnew; - foundStraddle = 1; - if (xPosF > xNegF) { - posStraddle = 1; - } else { - posStraddle = 0; - } - } - } - } - - x1 = x2; - f1 = f2; - - x2 = xnew; - f2 = fnew; - - // As we go on to new data points, we make sure that we have the best - // straddle of the solution with the choice of F1 and F2 when we do have - // a straddle to work with. - if (foundStraddle) { - bool foundBetterPos = false; - bool foundBetterNeg = false; - if (posStraddle) { - if (f2 > 0.0) { - if (xPosF < x2) { - foundBetterPos = false; - x2 = xPosF; - f2 = fPosF; - } - if (f1 > 0.0) { - if (foundBetterPos) { - x1 = xNegF; - f1 = fNegF; - } else { - if (x1 >= x2) { - x1 = xNegF; - f1 = fNegF; - } - } - } - } else { - if (xNegF > x2) { - foundBetterNeg = false; - x2 = xNegF; - f2 = fNegF; - } - if (f1 < 0.0) { - if (foundBetterNeg) { - x1 = xPosF; - f1 = fPosF; - } else { - if (x1 <= x2) { - x1 = xPosF; - f1 = fPosF; - } - } - } - } - } else { - if (f2 < 0.0) { - if (xNegF < x2) { - foundBetterNeg = false; - x2 = xNegF; - f2 = fNegF; - } - if (f1 < 0.0) { - if (foundBetterNeg) { - x1 = xPosF; - f1 = fPosF; - } else { - if (x1 >= x2) { - x1 = xPosF; - f1 = fPosF; - } - } - } - } else { - if (xPosF > x2) { - foundBetterPos = true; - x2 = xPosF; - f2 = fPosF; - } - if (f1 > 0.0) { - if (foundBetterNeg) { - x1 = xNegF; - f1 = fNegF; - } else { - if (x1 <= x2) { - x1 = xNegF; - f1 = fNegF; - } - } - } - } - } - AssertThrow((f1* f2 <= 0.0), "F1 and F2 aren't bounding"); - } - - deltaX2 = deltaXnew; - deltaXnew = x2 - x1; - deltaXConverged_ = 0.5 * deltaXConverged_ + 0.5 * (m_rtolx * 0.5 * (fabs(x2) + fabs(x1)) + m_atolx); - rfT.deltaXConverged = deltaXConverged_; - rfT.deltaFConverged = fnorm * m_rtolf; - if (foundStraddle) { - rfT.delX = std::max(fabs(deltaX2), fabs(deltaXnew)); - } else { - rfT.delX = std::max(fabs(deltaX2), fabs(deltaXnew)); - if (x2 < x1) { - rfT.delX = std::max(rfT.delX, x2 - xmin); - } else { - rfT.delX = std::max(rfT.delX, xmax - x2); - } - } - // Section To Determine CONVERGENCE criteria - doFinalFuncCall = 0; - if ((fabs(fnew / fnorm) < m_rtolf) && foundStraddle) { - if (fabs(deltaX2) < deltaXConverged_ && fabs(deltaXnew) < deltaXConverged_) { - converged = 1; - rfT.reasoning += "NormalConvergence"; - retn = ROOTFIND_SUCCESS; - } else if (fabs(slope) > 1.0E-100) { - double xdels = fabs(fnew / slope); - if (xdels < deltaXConverged_ * 0.3) { - converged = 1; - rfT.reasoning += "NormalConvergence-SlopelimitsDelX"; - doFinalFuncCall = 1; - retn = ROOTFIND_SUCCESS; - } - } - - // Check for excess convergence in the x coordinate - if (!converged && foundStraddle) { - doublereal denom = fabs(x1 - x2); - if (denom < 1.0E-200) { - retn = ROOTFIND_FAILEDCONVERGENCE; - converged = true; - rfT.reasoning += "ConvergenceFZero but X1X2Identical"; - } - if (theSame(x2, x1, 1.0E-2)) { - converged = true; - rfT.reasoning += " ConvergenceF and XSame"; - retn = ROOTFIND_SUCCESS; - } - } - } else { - // We are here when F is not converged, but we may want to end anyway - if (!converged && foundStraddle) { - doublereal denom = fabs(x1 - x2); - if (denom < 1.0E-200) { - retn = ROOTFIND_FAILEDCONVERGENCE; - converged = true; - rfT.reasoning += "FNotConverged but X1X2Identical"; - } - - // The premise here is that if x1 and x2 get close to one - // another, then the accuracy of the calculation gets destroyed. - if (theSame(x2, x1, 1.0E-5)) { - converged = true; - retn = ROOTFIND_SUCCESS_XCONVERGENCEONLY; - rfT.reasoning += "FNotConverged but XSame"; - } - } - } - } - -done: - if (converged) { - rfT.slope = slope; - rfHistory_.push_back(rfT); - rfT.clear(); - rfT.its = its; - AssertThrow((f1* f2 <= 0.0), "F1 and F2 aren't bounding"); - - double x_fpos = x2; - double x_fneg = x1; - if (f2 < 0.0) { - x_fpos = x1; - x_fneg = x2; - } - rfT.delX = fabs(x_fpos - x_fneg); - if (doFinalFuncCall || (fabs(f1) < 2.0 * fabs(f2))) { - double delXtmp = deltaXControlled(x2, x1); - slope = (f2 - f1) / delXtmp; - xnew = x2 - f2 / slope; - its++; - fnew = func(xnew); - if (fnew > 0.0) { - if (fabs(xnew - x_fneg) < fabs(x_fpos - x_fneg)) { - x_fpos = xnew; - rfT.delX = fabs(xnew - x_fneg); - } - } else { - if (fabs(xnew - x_fpos) < fabs(x_fpos - x_fneg)) { - x_fneg = xnew; - rfT.delX = fabs(xnew - x_fpos); - } - } - rfT.its = its; - if (fabs(fnew) < fabs(f2) && (fabs(fnew) < fabs(f1))) { - *xbest = xnew; - if (doFinalFuncCall) { - rfT.reasoning += "CONVERGENCE: Another Evaluation Requested"; - rfT.delX = fabs(xnew - x2); - } else { - rfT.reasoning += "CONVERGENCE: Another Evaluation done because f1 < f2"; - rfT.delX = fabs(xnew - x1); - } - rfT.fval = fnew; - rfT.xval = xnew; - x2 = xnew; - f2 = fnew; - } else if (fabs(f1) < fabs(f2)) { - rfT.its = its; - rfT.xval = xnew; - rfT.fval = fnew; - - rfT.slope = slope; - rfT.reasoning += "CONVERGENCE: Another Evaluation not as good as Second Point "; - rfHistory_.push_back(rfT); - rfT.clear(); - rfT.its = its; - std::swap(f1, f2); - std::swap(x1, x2); - *xbest = x2; - if (fabs(fnew) < fabs(f1) && f1 * fnew > 0.0) { - std::swap(f1, fnew); - std::swap(x1, xnew); - } - - rfT.its = its; - rfT.xval = *xbest; - rfT.fval = f2; - rfT.delX = fabs(x_fpos - x_fneg); - rfT.reasoning += "CONVERGENCE: NormalEnding -> Second point used"; - } else { - rfT.its = its; - rfT.xval = xnew; - rfT.fval = fnew; - - rfT.slope = slope; - rfT.reasoning += "CONVERGENCE: Another Evaluation not as good as First Point "; - rfHistory_.push_back(rfT); - rfT.clear(); - rfT.its = its; - *xbest = x2; - rfT.xval = *xbest; - rfT.fval = f2; - rfT.delX = fabs(x_fpos - x_fneg); - rfT.reasoning += "CONVERGENCE: NormalEnding -> Last point used"; - } - } else { - *xbest = x2; - rfT.xval = *xbest; - rfT.fval = f2; - rfT.delX = fabs(x2 - x1); - rfT.reasoning += "CONVERGENCE: NormalEnding -> Last point used"; - } - funcTargetValue = f2 + m_funcTargetValue; - rfT.slope = slope; - - if (printLvl >= 1) { - writelogf("RootFind success: convergence achieved\n"); - } - if (printLvl >= 3 && writeLogAllowed_) { - fprintf(fp, " | RootFind success in %d its, fnorm = %g\n", its, fnorm); - } - rfHistory_.push_back(rfT); - } else { - rfT.reasoning = "FAILED CONVERGENCE "; - rfT.slope = slope; - rfT.its = its; - if (retn == ROOTFIND_SOLNHIGHERTHANXMAX) { - if (printLvl >= 1) { - writelogf("RootFind ERROR: Soln probably lies higher than xmax, %g: best guess = %g\n", xmax, *xbest); - } - rfT.reasoning += fmt::format("Soln probably lies higher than xmax, {}: best guess = {}", xmax, *xbest); - } else if (retn == ROOTFIND_SOLNLOWERTHANXMIN) { - if (printLvl >= 1) { - writelogf("RootFind ERROR: Soln probably lies lower than xmin, %g: best guess = %g\n", xmin, *xbest); - } - rfT.reasoning += fmt::format("Soln probably lies lower than xmin, {}: best guess = {}", xmin, *xbest); - } else { - retn = ROOTFIND_FAILEDCONVERGENCE; - if (printLvl >= 1) { - writelogf("RootFind ERROR: maximum iterations exceeded without convergence, cause unknown\n"); - } - rfT.reasoning += "Maximum iterations exceeded without convergence, cause unknown"; - } - if (printLvl >= 3 && writeLogAllowed_) { - fprintf(fp, "\nRootFind failure in %d its\n", its); - } - - *xbest = x2; - funcTargetValue = f2 + m_funcTargetValue; - rfT.xval = *xbest; - rfT.fval = f2; - rfHistory_.push_back(rfT); - } - if (printLvl >= 3 && writeLogAllowed_) { - fclose(fp); - } - - if (printLvl >= 2) { - printTable(); - } - - return retn; -} - -doublereal RootFind::func(doublereal x) -{ - doublereal r; - checkFinite(x); - m_residFunc->evalSS(0.0, &x, &r); - checkFinite(r); - doublereal ff = r - m_funcTargetValue; - if (x >= x_maxTried_) { - x_maxTried_ = x; - fx_maxTried_ = ff; - } - if (x <= x_minTried_) { - x_minTried_ = x; - fx_minTried_ = ff; - } - return ff; -} - -void RootFind::setTol(doublereal rtolf, doublereal atolf, doublereal rtolx, doublereal atolx) -{ - m_atolf = atolf; - m_rtolf = rtolf; - if (rtolx <= 0.0) { - m_rtolx = atolf; - } else { - m_rtolx = rtolx; - } - if (atolx <= 0.0) { - m_atolx = atolf; - } else { - m_atolx = atolx; - } -} - -void RootFind::setPrintLvl(int printlvl) -{ - printLvl = printlvl; -} - -void RootFind::setFuncIsGenerallyIncreasing(bool value) -{ - if (value) { - FuncIsGenerallyDecreasing_ = false; - } - FuncIsGenerallyIncreasing_ = value; -} - -void RootFind::setFuncIsGenerallyDecreasing(bool value) -{ - if (value) { - FuncIsGenerallyIncreasing_ = false; - } - FuncIsGenerallyDecreasing_ = value; -} - -void RootFind::setDeltaX(doublereal deltaXNorm) -{ - DeltaXnorm_ = deltaXNorm; - specifiedDeltaXnorm_ = 1; -} - -void RootFind::setDeltaXMax(doublereal deltaX) -{ - DeltaXMax_ = deltaX; - specifiedDeltaXMax_ = 1; -} - -void RootFind::printTable() -{ - writelogf("\t----------------------------------------------------------------------------------------------------------------------------------------\n"); - writelogf("\t RootFinder Summary table: \n"); - writelogf("\t FTarget = %g\n", m_funcTargetValue); - writelogf("\t Iter | xval delX deltaXConv | slope | foundP foundN| F - F_targ deltaFConv | Reasoning\n"); - writelogf("\t----------------------------------------------------------------------------------------------------------------------------------------\n"); - for (int i = 0; i < (int) rfHistory_.size(); i++) { - struct rfTable rfT = rfHistory_[i]; - writelogf("\t %3d |%- 17.11E %- 13.7E %- 13.7E |%- 13.5E| %3d %3d | %- 12.5E %- 12.5E | %s \n", - rfT.its, rfT.xval, rfT.delX, rfT.deltaXConverged, rfT.slope, rfT.foundPos, rfT.foundNeg, rfT.fval, - rfT.deltaFConverged, rfT.reasoning); - } - writelogf("\t----------------------------------------------------------------------------------------------------------------------------------------\n"); -} - -} diff --git a/src/numerics/SquareMatrix.cpp b/src/numerics/SquareMatrix.cpp deleted file mode 100644 index 510934ffa..000000000 --- a/src/numerics/SquareMatrix.cpp +++ /dev/null @@ -1,382 +0,0 @@ -//! @file SquareMatrix.cpp - -// This file is part of Cantera. See License.txt in the top-level directory or -// at http://www.cantera.org/license.txt for license and copyright information. - -#include "cantera/base/stringUtils.h" -#include "cantera/numerics/SquareMatrix.h" -#if CT_USE_LAPACK - #include "cantera/numerics/ctlapack.h" -#endif - -using namespace std; - -namespace Cantera -{ - -SquareMatrix::SquareMatrix() : - a1norm_(0.0), - useQR_(0) -{ - warn_deprecated("class SquareMatrix", - "Use class DenseMatrix instead. To be removed after Cantera 2.3."); -} - -SquareMatrix::SquareMatrix(size_t n, doublereal v) : - DenseMatrix(n, n, v), - a1norm_(0.0), - useQR_(0) -{ - warn_deprecated("class SquareMatrix", - "Use class DenseMatrix instead. To be removed after Cantera 2.3."); -} - -SquareMatrix::SquareMatrix(const SquareMatrix& y) : - DenseMatrix(y), - GeneralMatrix(y), - a1norm_(y.a1norm_), - useQR_(y.useQR_) -{ -} - -SquareMatrix& SquareMatrix::operator=(const SquareMatrix& y) -{ - if (&y == this) { - return *this; - } - DenseMatrix::operator=(y); - GeneralMatrix::operator=(y); - a1norm_ = y.a1norm_; - useQR_ = y.useQR_; - return *this; -} - -int SquareMatrix::solve(doublereal* b, size_t nrhs, size_t ldb) -{ -#if CT_USE_LAPACK - if (useQR_) { - return solveQR(b); - } - int info=0; - - // Check to see whether the matrix has been factored. - if (!m_factored) { - int retn = factor(); - if (retn) { - return retn; - } - } - if (ldb == 0) { - ldb = nColumns(); - } - - // Solve the factored system - ct_dgetrs(ctlapack::NoTranspose, static_cast(nRows()), - nrhs, &*begin(), static_cast(nRows()), - ipiv().data(), b, ldb, info); - if (info != 0) { - if (m_printLevel) { - writelogf("SquareMatrix::solve(): DGETRS returned INFO = %d\n", info); - } - if (! m_useReturnErrorCode) { - throw CanteraError("SquareMatrix::solve()", "DGETRS returned INFO = {}", info); - } - } - return info; -#else - throw CanteraError("SquareMatrix::solve", - "Not Implemented when LAPACK is not available"); -#endif -} - -void SquareMatrix::zero() -{ - m_data.assign(m_data.size(), 0.0); -} - -void SquareMatrix::resize(size_t n, size_t m, doublereal v) -{ - DenseMatrix::resize(n, m, v); -} - -void SquareMatrix::mult(const doublereal* b, doublereal* prod) const -{ - DenseMatrix::mult(b, prod); -} - -void SquareMatrix::mult(const DenseMatrix& b, DenseMatrix& prod) const -{ - DenseMatrix::mult(b, prod); -} - -void SquareMatrix::leftMult(const doublereal* const b, doublereal* const prod) const -{ - DenseMatrix::leftMult(b, prod); -} - -int SquareMatrix::factor() -{ -#if CT_USE_LAPACK - if (useQR_) { - return factorQR(); - } - a1norm_ = ct_dlange('1', m_nrows, m_nrows, &*begin(), m_nrows, 0); - integer n = static_cast(nRows()); - int info=0; - m_factored = 1; - ct_dgetrf(n, n, &*begin(), static_cast(nRows()), ipiv().data(), info); - if (info != 0) { - if (m_printLevel) { - writelogf("SquareMatrix::factor(): DGETRS returned INFO = %d\n", info); - } - if (! m_useReturnErrorCode) { - throw CanteraError("SquareMatrix::factor()", "DGETRS returned INFO = {}", info); - } - } - return info; -#else - throw CanteraError("SquareMatrix::factor", - "Not Implemented when LAPACK is not available"); -#endif -} - -void SquareMatrix::setFactorFlag() -{ - m_factored = 1; -} - -int SquareMatrix::factorQR() -{ -#if CT_USE_LAPACK - if (tau.size() < m_nrows) { - tau.resize(m_nrows, 0.0); - work.resize(8 * m_nrows, 0.0); - } - a1norm_ = ct_dlange('1', m_nrows, m_nrows, &*begin(), m_nrows, work.data()); - int info = 0; - m_factored = 2; - size_t lwork = work.size(); - ct_dgeqrf(m_nrows, m_nrows, &*begin(), m_nrows, tau.data(), work.data(), lwork, info); - if (info != 0) { - if (m_printLevel) { - writelogf("SquareMatrix::factorQR(): DGEQRF returned INFO = %d\n", info); - } - if (! m_useReturnErrorCode) { - throw CanteraError("SquareMatrix::factorQR()", "DGEQRF returned INFO = {}", info); - } - } - size_t lworkOpt = static_cast(work[0]); - if (lworkOpt > lwork) { - work.resize(lworkOpt); - } - return info; -#else - throw CanteraError("SquareMatrix::factorQR", - "Not Implemented when LAPACK is not available"); -#endif -} - -int SquareMatrix::solveQR(doublereal* b) -{ -#if CT_USE_LAPACK - int info=0; - - // Check to see whether the matrix has been factored. - if (!m_factored) { - int retn = factorQR(); - if (retn) { - return retn; - } - } - - size_t lwork = work.size(); - if (lwork < m_nrows) { - work.resize(8 * m_nrows, 0.0); - lwork = 8 * m_nrows; - } - - // Solve the factored system - ct_dormqr(ctlapack::Left, ctlapack::Transpose, m_nrows, 1, m_nrows, &*begin(), m_nrows, tau.data(), b, m_nrows, - work.data(), lwork, info); - if (info != 0) { - if (m_printLevel) { - writelogf("SquareMatrix::solveQR(): DORMQR returned INFO = %d\n", info); - } - if (! m_useReturnErrorCode) { - throw CanteraError("SquareMatrix::solveQR()", "DORMQR returned INFO = {}", info); - } - } - size_t lworkOpt = static_cast(work[0]); - if (lworkOpt > lwork) { - work.resize(lworkOpt); - } - - char dd = 'N'; - ct_dtrtrs(ctlapack::UpperTriangular, ctlapack::NoTranspose, &dd, m_nrows, 1, &*begin(), m_nrows, b, - m_nrows, info); - if (info != 0) { - if (m_printLevel) { - writelogf("SquareMatrix::solveQR(): DTRTRS returned INFO = %d\n", info); - } - if (! m_useReturnErrorCode) { - throw CanteraError("SquareMatrix::solveQR()", "DTRTRS returned INFO = {}", info); - } - } - return info; -#else - throw CanteraError("SquareMatrix::solveQR", - "Not Implemented when LAPACK is not available"); -#endif -} - -doublereal SquareMatrix::rcond(doublereal anorm) -{ -#if CT_USE_LAPACK - if (iwork_.size() < m_nrows) { - iwork_.resize(m_nrows); - } - if (work.size() <4 * m_nrows) { - work.resize(4 * m_nrows); - } - doublereal rcond = 0.0; - if (m_factored != 1) { - throw CanteraError("SquareMatrix::rcond()", "matrix isn't factored correctly"); - } - - int rinfo = 0; - rcond = ct_dgecon('1', m_nrows, &*begin(), m_nrows, anorm, work.data(), - iwork_.data(), rinfo); - if (rinfo != 0) { - if (m_printLevel) { - writelogf("SquareMatrix::rcond(): DGECON returned INFO = %d\n", rinfo); - } - if (! m_useReturnErrorCode) { - throw CanteraError("SquareMatrix::rcond()", "DGECON returned INFO = {}", rinfo); - } - } - return rcond; -#else - throw CanteraError("SquareMatrix::rcond", - "Not Implemented when LAPACK is not available"); -#endif -} - -doublereal SquareMatrix::oneNorm() const -{ - return a1norm_; -} - -doublereal SquareMatrix::rcondQR() -{ -#if CT_USE_LAPACK - if (iwork_.size() < m_nrows) { - iwork_.resize(m_nrows); - } - if (work.size() <3 * m_nrows) { - work.resize(3 * m_nrows); - } - doublereal rcond = 0.0; - if (m_factored != 2) { - throw CanteraError("SquareMatrix::rcondQR()", "matrix isn't factored correctly"); - } - - int rinfo = 0; - rcond = ct_dtrcon(0, ctlapack::UpperTriangular, 0, m_nrows, &*begin(), m_nrows, work.data(), - iwork_.data(), rinfo); - if (rinfo != 0) { - if (m_printLevel) { - writelogf("SquareMatrix::rcondQR(): DTRCON returned INFO = %d\n", rinfo); - } - if (! m_useReturnErrorCode) { - throw CanteraError("SquareMatrix::rcondQR()", "DTRCON returned INFO = {}", rinfo); - } - } - return rcond; -#else - throw CanteraError("SquareMatrix::rcondQR", - "Not Implemented when LAPACK is not available"); -#endif -} - -void SquareMatrix::useFactorAlgorithm(int fAlgorithm) -{ - useQR_ = fAlgorithm; -} - -int SquareMatrix::factorAlgorithm() const -{ - return (int) useQR_; -} - -doublereal* SquareMatrix::ptrColumn(size_t j) -{ - return Array2D::ptrColumn(j); -} - -size_t SquareMatrix::nRows() const -{ - return m_nrows; -} - -size_t SquareMatrix::nRowsAndStruct(size_t* const iStruct) const -{ - warn_deprecated("SquareMatrix::nRowsAndStruct", - "To be removed after Cantera 2.3."); - return m_nrows; -} - -GeneralMatrix* SquareMatrix::duplMyselfAsGeneralMatrix() const -{ - return new SquareMatrix(*this); -} - -vector_fp::iterator SquareMatrix::begin() -{ - return m_data.begin(); -} - -vector_fp::const_iterator SquareMatrix::begin() const -{ - return m_data.begin(); -} - -doublereal* const* SquareMatrix::colPts() -{ - return DenseMatrix::colPts(); -} - -size_t SquareMatrix::checkRows(doublereal& valueSmall) const -{ - valueSmall = 1.0E300; - size_t iSmall = npos; - for (size_t i = 0; i < m_nrows; i++) { - double valueS = 0.0; - for (size_t j = 0; j < m_nrows; j++) { - valueS = std::max(fabs(value(i,j)), valueS); - } - if (valueS < valueSmall) { - iSmall = i; - valueSmall = valueS; - } - } - return iSmall; -} - -size_t SquareMatrix::checkColumns(doublereal& valueSmall) const -{ - valueSmall = 1.0E300; - size_t jSmall = npos; - for (size_t j = 0; j < m_nrows; j++) { - double valueS = 0.0; - for (size_t i = 0; i < m_nrows; i++) { - valueS = std::max(fabs(value(i,j)), valueS); - } - if (valueS < valueSmall) { - jSmall = j; - valueSmall = valueS; - } - } - return jSmall; -} - -} diff --git a/src/numerics/polyfit.cpp b/src/numerics/polyfit.cpp index e3bac1d51..e2b4fad89 100644 --- a/src/numerics/polyfit.cpp +++ b/src/numerics/polyfit.cpp @@ -11,17 +11,6 @@ namespace Cantera { -double polyfit(int n, double* xp, double* yp, double* wp, - int deg, int& ndeg, double eps, double* rp) -{ - warn_deprecated("polyfit(n, x, y, w, maxdeg, ndeg, eps, r", - "The ndeg and eps arguments to polyfit are deprecated and unused. Use " - "the form of polyfit with signature polyfit(n, deg, x, y, w, p). To be " - "removed after Cantera 2.3."); - ndeg = deg; - return polyfit(n, deg, xp, yp, wp, rp); -} - double polyfit(size_t n, size_t deg, const double* xp, const double* yp, const double* wp, double* pp) { diff --git a/src/oneD/Domain1D.cpp b/src/oneD/Domain1D.cpp index b33e31b14..c43be3623 100644 --- a/src/oneD/Domain1D.cpp +++ b/src/oneD/Domain1D.cpp @@ -17,7 +17,6 @@ namespace Cantera Domain1D::Domain1D(size_t nv, size_t points, double time) : m_rdt(0.0), m_nv(0), - m_time(time), m_container(0), m_index(npos), m_type(0), @@ -40,7 +39,6 @@ void Domain1D::resize(size_t nv, size_t np) m_refiner.reset(new Refiner(*this)); } m_nv = nv; - m_td.resize(m_nv, 1); m_name.resize(m_nv,""); m_max.resize(m_nv, 0.0); m_min.resize(m_nv, 0.0); @@ -109,54 +107,6 @@ void Domain1D::needJacUpdate() } } -void Domain1D::eval(size_t jg, doublereal* xg, doublereal* rg, - integer* mask, doublereal rdt) -{ - warn_deprecated("Domain1D::eval", - "Derived classes should implement eval directly. The 'residual' method" - " will be removed after Cantera 2.3."); - - if (jg != npos && (jg + 1 < firstPoint() || jg > lastPoint() + 1)) { - return; - } - - // if evaluating a Jacobian, compute the steady-state residual - if (jg != npos) { - rdt = 0.0; - } - - // start of local part of global arrays - doublereal* x = xg + loc(); - doublereal* rsd = rg + loc(); - integer* diag = mask + loc(); - - size_t jmin, jmax; - size_t jpt = jg - firstPoint(); - - if (jg == npos) { // evaluate all points - jmin = 0; - jmax = m_points - 1; - } else { // evaluate points for Jacobian - jmin = std::max(jpt, 1) - 1; - jmax = std::min(jpt+1,m_points-1); - } - - for (size_t j = jmin; j <= jmax; j++) { - if (j == 0 || j == m_points - 1) { - for (size_t i = 0; i < m_nv; i++) { - rsd[index(i,j)] = residual(x,i,j); - diag[index(i,j)] = 0; - } - } else { - for (size_t i = 0; i < m_nv; i++) { - rsd[index(i,j)] = residual(x,i,j) - - timeDerivativeFlag(i)*rdt*(value(x,i,j) - prevSoln(i,j)); - diag[index(i,j)] = timeDerivativeFlag(i); - } - } - } -} - XML_Node& Domain1D::save(XML_Node& o, const doublereal* const sol) { XML_Node& d = o.addChild("domain"); diff --git a/src/oneD/StFlow.cpp b/src/oneD/StFlow.cpp index 490bb0918..673fcae14 100644 --- a/src/oneD/StFlow.cpp +++ b/src/oneD/StFlow.cpp @@ -141,28 +141,6 @@ void StFlow::resetBadValues(double* xg) { } } -void StFlow::setTransport(Transport& trans, bool withSoret) -{ - m_trans = &trans; - m_do_soret = withSoret; - m_do_multicomponent = (m_trans->transportType() == "Multi"); - - m_diff.resize(m_nsp*m_points); - if (m_do_multicomponent) { - m_multidiff.resize(m_nsp*m_nsp*m_points); - m_dthermal.resize(m_nsp, m_points, 0.0); - } else if (withSoret) { - throw CanteraError("setTransport", - "Thermal diffusion (the Soret effect) " - "requires using a multicomponent transport model."); - } - - warn_deprecated("setTransport(Transport& trans, bool withSoret = false)", - "The withSoret argument is deprecated and unused. Use " - "the form of setTransport with signature setTransport(Transport& trans)." - "To be removed after Cantera 2.3."); -} - void StFlow::setTransport(Transport& trans) { m_trans = &trans; @@ -172,7 +150,7 @@ void StFlow::setTransport(Transport& trans) if (m_do_multicomponent) { m_multidiff.resize(m_nsp*m_nsp*m_points); m_dthermal.resize(m_nsp, m_points, 0.0); - } + } } void StFlow::enableSoret(bool withSoret) diff --git a/src/thermo/ConstCpPoly.cpp b/src/thermo/ConstCpPoly.cpp index 99c836b7a..b2cb5b4f1 100644 --- a/src/thermo/ConstCpPoly.cpp +++ b/src/thermo/ConstCpPoly.cpp @@ -12,16 +12,6 @@ namespace Cantera { -ConstCpPoly::ConstCpPoly() - : m_t0(0.0), - m_cp0_R(0.0), - m_h0_R(0.0), - m_s0_R(0.0), - m_logt0(0.0) -{ - warn_deprecated("ConstCpPoly::ConstCpPoly()", - "Default constructor to be removed after Cantera 2.3."); -} ConstCpPoly::ConstCpPoly(double tlow, double thigh, double pref, const double* coeffs) : @@ -35,12 +25,6 @@ ConstCpPoly::ConstCpPoly(double tlow, double thigh, double pref, m_h0_R_orig = m_h0_R; } -SpeciesThermoInterpType* -ConstCpPoly::duplMyselfAsSpeciesThermoInterpType() const -{ - return new ConstCpPoly(*this); -} - void ConstCpPoly::updateProperties(const doublereal* tt, doublereal* cp_R, doublereal* h_RT, @@ -82,17 +66,6 @@ void ConstCpPoly::reportParameters(size_t& n, int& type, coeffs[3] = m_cp0_R * GasConstant; } -void ConstCpPoly::modifyParameters(doublereal* coeffs) -{ - warn_deprecated("ConstCpPoly::modifyParameters", "To be removed after " - "Cantera 2.3. Use MultiSpeciesThermo::modifySpecies instead."); - m_t0 = coeffs[0]; - m_h0_R = coeffs[1] / GasConstant; - m_s0_R = coeffs[2] / GasConstant; - m_cp0_R = coeffs[3] / GasConstant; - m_logt0 = log(m_t0); -} - doublereal ConstCpPoly::reportHf298(doublereal* const h298) const { double temp = 298.15; diff --git a/src/thermo/ConstDensityThermo.cpp b/src/thermo/ConstDensityThermo.cpp index 4fe455136..60af0f624 100644 --- a/src/thermo/ConstDensityThermo.cpp +++ b/src/thermo/ConstDensityThermo.cpp @@ -8,45 +8,12 @@ // This file is part of Cantera. See License.txt in the top-level directory or // at http://www.cantera.org/license.txt for license and copyright information. -#include "cantera/thermo/mix_defs.h" #include "cantera/thermo/ConstDensityThermo.h" #include "cantera/base/ctml.h" namespace Cantera { -ConstDensityThermo::ConstDensityThermo(const ConstDensityThermo& right) -{ - *this = right; -} - -ConstDensityThermo& ConstDensityThermo::operator=(const ConstDensityThermo& right) -{ - if (&right == this) { - return *this; - } - - m_h0_RT = right.m_h0_RT; - m_cp0_R = right.m_cp0_R; - m_g0_RT = right.m_g0_RT; - m_s0_R = right.m_s0_R; - - return *this; - -} - -ThermoPhase* ConstDensityThermo::duplMyselfAsThermoPhase() const -{ - return new ConstDensityThermo(*this); -} - -int ConstDensityThermo::eosType() const -{ - warn_deprecated("ConstDensityThermo::eosType", - "To be removed after Cantera 2.3."); - return cIncompressible; -} - doublereal ConstDensityThermo::enthalpy_mole() const { doublereal p0 = m_spthermo->refPressure(); diff --git a/src/thermo/DebyeHuckel.cpp b/src/thermo/DebyeHuckel.cpp index 0c15b5680..b3569b536 100644 --- a/src/thermo/DebyeHuckel.cpp +++ b/src/thermo/DebyeHuckel.cpp @@ -73,92 +73,10 @@ DebyeHuckel::DebyeHuckel(XML_Node& phaseRoot, const std::string& id_) : importPhase(phaseRoot, this); } -DebyeHuckel::DebyeHuckel(const DebyeHuckel& b) : - m_formDH(DHFORM_DILUTE_LIMIT), - m_formGC(2), - m_IionicMolality(0.0), - m_maxIionicStrength(30.0), - m_useHelgesonFixedForm(false), - m_IionicMolalityStoich(0.0), - m_form_A_Debye(A_DEBYE_CONST), - m_A_Debye(1.172576), // units = sqrt(kg/gmol) - m_B_Debye(3.28640E9), // units = sqrt(kg/gmol) / m - m_waterSS(0), - m_densWaterSS(1000.) -{ - // Use the assignment operator to do the brunt of the work for the copy - // constructor. - *this = b; -} - -DebyeHuckel& DebyeHuckel::operator=(const DebyeHuckel& b) -{ - if (&b != this) { - MolalityVPSSTP::operator=(b); - m_formDH = b.m_formDH; - m_formGC = b.m_formGC; - m_Aionic = b.m_Aionic; - m_IionicMolality = b.m_IionicMolality; - m_maxIionicStrength = b.m_maxIionicStrength; - m_useHelgesonFixedForm= b.m_useHelgesonFixedForm; - m_IionicMolalityStoich= b.m_IionicMolalityStoich; - m_form_A_Debye = b.m_form_A_Debye; - m_A_Debye = b.m_A_Debye; - m_B_Debye = b.m_B_Debye; - m_B_Dot = b.m_B_Dot; - - // This is an internal shallow copy of the PDSS_Water pointer - m_waterSS = dynamic_cast(providePDSS(0)); - if (!m_waterSS) { - throw CanteraError("DebyeHuckel::operator=()", "Dynamic cast to waterPDSS failed"); - } - - m_densWaterSS = b.m_densWaterSS; - - if (b.m_waterProps) { - m_waterProps.reset(new WaterProps(m_waterSS)); - } - - m_tmpV = b.m_tmpV; - m_speciesCharge_Stoich= b.m_speciesCharge_Stoich; - m_Beta_ij = b.m_Beta_ij; - m_lnActCoeffMolal = b.m_lnActCoeffMolal; - m_d2lnActCoeffMolaldT2= b.m_d2lnActCoeffMolaldT2; - } - return *this; -} - DebyeHuckel::~DebyeHuckel() { } -ThermoPhase* DebyeHuckel::duplMyselfAsThermoPhase() const -{ - return new DebyeHuckel(*this); -} - -int DebyeHuckel::eosType() const -{ - warn_deprecated("DebyeHuckel::eosType", - "To be removed after Cantera 2.3."); - int res; - switch (m_formGC) { - case 0: - res = cDebyeHuckel0; - break; - case 1: - res = cDebyeHuckel1; - break; - case 2: - res = cDebyeHuckel2; - break; - default: - throw CanteraError("eosType", "Unknown type"); - break; - } - return res; -} - // -------- Molar Thermodynamic Properties of the Solution --------------- doublereal DebyeHuckel::enthalpy_mole() const diff --git a/src/thermo/Elements.cpp b/src/thermo/Elements.cpp index 5c4306521..34745d4c8 100644 --- a/src/thermo/Elements.cpp +++ b/src/thermo/Elements.cpp @@ -162,13 +162,6 @@ static struct isotopeWeightData isotopeWeightTable[] = { {"Tr", "tritium", 3.0, 1}, }; -double LookupWtElements(const std::string& ename) -{ - warn_deprecated("LookupWtElements", - "Use getElementWeight instead. To be removed after Cantera 2.3"); - return getElementWeight(ename); -} - double getElementWeight(const std::string& ename) { int numElements = numElementsDefined(); diff --git a/src/thermo/FixedChemPotSSTP.cpp b/src/thermo/FixedChemPotSSTP.cpp index 80fc97c9c..7907cb143 100644 --- a/src/thermo/FixedChemPotSSTP.cpp +++ b/src/thermo/FixedChemPotSSTP.cpp @@ -8,7 +8,6 @@ // This file is part of Cantera. See License.txt in the top-level directory or // at http://www.cantera.org/license.txt for license and copyright information. -#include "cantera/thermo/mix_defs.h" #include "cantera/thermo/FixedChemPotSSTP.h" #include "cantera/thermo/ThermoFactory.h" #include "cantera/thermo/SpeciesThermoFactory.h" @@ -73,35 +72,6 @@ FixedChemPotSSTP::FixedChemPotSSTP(const std::string& Ename, doublereal val) : saveSpeciesData(0, &s); } -FixedChemPotSSTP::FixedChemPotSSTP(const FixedChemPotSSTP& right) -{ - *this = right; -} - -FixedChemPotSSTP& FixedChemPotSSTP::operator=(const FixedChemPotSSTP& right) -{ - if (&right != this) { - SingleSpeciesTP::operator=(right); - - chemPot_ = right.chemPot_; - } - return *this; -} - -ThermoPhase* FixedChemPotSSTP::duplMyselfAsThermoPhase() const -{ - return new FixedChemPotSSTP(*this); -} - -// ---- Utilities ----- - -int FixedChemPotSSTP::eosType() const -{ - warn_deprecated("FixedChemPotSSTP::eosType", - "To be removed after Cantera 2.3."); - return cFixedChemPot; -} - // ----- Mechanical Equation of State ------ doublereal FixedChemPotSSTP::pressure() const diff --git a/src/thermo/GibbsExcessVPSSTP.cpp b/src/thermo/GibbsExcessVPSSTP.cpp index 9f16eea6a..03b61b412 100644 --- a/src/thermo/GibbsExcessVPSSTP.cpp +++ b/src/thermo/GibbsExcessVPSSTP.cpp @@ -21,35 +21,6 @@ using namespace std; namespace Cantera { -GibbsExcessVPSSTP::GibbsExcessVPSSTP(const GibbsExcessVPSSTP& b) -{ - GibbsExcessVPSSTP::operator=(b); -} - -GibbsExcessVPSSTP& GibbsExcessVPSSTP::operator=(const GibbsExcessVPSSTP& b) -{ - if (&b == this) { - return *this; - } - - VPStandardStateTP::operator=(b); - - moleFractions_ = b.moleFractions_; - lnActCoeff_Scaled_ = b.lnActCoeff_Scaled_; - dlnActCoeffdT_Scaled_ = b.dlnActCoeffdT_Scaled_; - d2lnActCoeffdT2_Scaled_ = b.d2lnActCoeffdT2_Scaled_; - dlnActCoeffdlnX_diag_ = b.dlnActCoeffdlnX_diag_; - dlnActCoeffdlnN_diag_ = b.dlnActCoeffdlnN_diag_; - dlnActCoeffdlnN_ = b.dlnActCoeffdlnN_; - - return *this; -} - -ThermoPhase* GibbsExcessVPSSTP::duplMyselfAsThermoPhase() const -{ - return new GibbsExcessVPSSTP(*this); -} - void GibbsExcessVPSSTP::compositionChanged() { Phase::compositionChanged(); diff --git a/src/thermo/HMWSoln.cpp b/src/thermo/HMWSoln.cpp index 02939a884..99116c5cb 100644 --- a/src/thermo/HMWSoln.cpp +++ b/src/thermo/HMWSoln.cpp @@ -69,6 +69,10 @@ HMWSoln::HMWSoln() : { } +HMWSoln::~HMWSoln() +{ +} + HMWSoln::HMWSoln(const std::string& inputFile, const std::string& id_) : m_formPitzer(PITZERFORM_BASE), m_formPitzerTemp(PITZER_TEMP_CONSTANT), @@ -161,235 +165,6 @@ HMWSoln::HMWSoln(XML_Node& phaseRoot, const std::string& id_) : importPhase(phaseRoot, this); } -HMWSoln::HMWSoln(const HMWSoln& b) : - m_formPitzer(PITZERFORM_BASE), - m_formPitzerTemp(PITZER_TEMP_CONSTANT), - m_formGC(2), - m_IionicMolality(0.0), - m_maxIionicStrength(100.0), - m_TempPitzerRef(298.15), - m_IionicMolalityStoich(0.0), - m_form_A_Debye(A_DEBYE_WATER), - m_A_Debye(1.172576), // units = sqrt(kg/gmol) - m_waterSS(0), - m_densWaterSS(1000.), - m_molalitiesAreCropped(false), - IMS_typeCutoff_(0), - IMS_X_o_cutoff_(0.2), - IMS_gamma_o_min_(1.0E-5), - IMS_gamma_k_min_(10.0), - IMS_cCut_(0.05), - IMS_slopefCut_(0.6), - IMS_slopegCut_(0.0), - IMS_dfCut_(0.0), - IMS_efCut_(0.0), - IMS_afCut_(0.0), - IMS_bfCut_(0.0), - IMS_dgCut_(0.0), - IMS_egCut_(0.0), - IMS_agCut_(0.0), - IMS_bgCut_(0.0), - MC_X_o_cutoff_(0.0), - MC_X_o_min_(0.0), - MC_slopepCut_(0.0), - MC_dpCut_(0.0), - MC_epCut_(0.0), - MC_apCut_(0.0), - MC_bpCut_(0.0), - MC_cpCut_(0.0), - CROP_ln_gamma_o_min(-6.0), - CROP_ln_gamma_o_max(3.0), - CROP_ln_gamma_k_min(-5.0), - CROP_ln_gamma_k_max(15.0), - m_last_is(-1.0), - m_debugCalc(0) -{ - // Use the assignment operator to do the brunt of the work for the copy - // constructor. - *this = b; -} - -HMWSoln& HMWSoln::operator=(const HMWSoln& b) -{ - if (&b != this) { - MolalityVPSSTP::operator=(b); - m_formPitzer = b.m_formPitzer; - m_formPitzerTemp = b.m_formPitzerTemp; - m_formGC = b.m_formGC; - m_Aionic = b.m_Aionic; - m_IionicMolality = b.m_IionicMolality; - m_maxIionicStrength = b.m_maxIionicStrength; - m_TempPitzerRef = b.m_TempPitzerRef; - m_IionicMolalityStoich= b.m_IionicMolalityStoich; - m_form_A_Debye = b.m_form_A_Debye; - m_A_Debye = b.m_A_Debye; - - // This is an internal shallow copy of the PDSS_Water pointer - m_waterSS = providePDSS(0); - if (!m_waterSS) { - throw CanteraError("HMWSoln::operator=()", "Dynamic cast to PDSS_Water failed"); - } - - m_densWaterSS = b.m_densWaterSS; - - m_waterProps = 0; - if (b.m_waterProps) { - m_waterProps.reset(new WaterProps(&dynamic_cast(*m_waterSS))); - } - - m_tmpV = b.m_tmpV; - m_speciesCharge_Stoich= b.m_speciesCharge_Stoich; - m_Beta0MX_ij = b.m_Beta0MX_ij; - m_Beta0MX_ij_L = b.m_Beta0MX_ij_L; - m_Beta0MX_ij_LL = b.m_Beta0MX_ij_LL; - m_Beta0MX_ij_P = b.m_Beta0MX_ij_P; - m_Beta0MX_ij_coeff = b.m_Beta0MX_ij_coeff; - m_Beta1MX_ij = b.m_Beta1MX_ij; - m_Beta1MX_ij_L = b.m_Beta1MX_ij_L; - m_Beta1MX_ij_LL = b.m_Beta1MX_ij_LL; - m_Beta1MX_ij_P = b.m_Beta1MX_ij_P; - m_Beta1MX_ij_coeff = b.m_Beta1MX_ij_coeff; - m_Beta2MX_ij = b.m_Beta2MX_ij; - m_Beta2MX_ij_L = b.m_Beta2MX_ij_L; - m_Beta2MX_ij_LL = b.m_Beta2MX_ij_LL; - m_Beta2MX_ij_P = b.m_Beta2MX_ij_P; - m_Beta2MX_ij_coeff = b.m_Beta2MX_ij_coeff; - m_Alpha1MX_ij = b.m_Alpha1MX_ij; - m_Alpha2MX_ij = b.m_Alpha2MX_ij; - m_CphiMX_ij = b.m_CphiMX_ij; - m_CphiMX_ij_L = b.m_CphiMX_ij_L; - m_CphiMX_ij_LL = b.m_CphiMX_ij_LL; - m_CphiMX_ij_P = b.m_CphiMX_ij_P; - m_CphiMX_ij_coeff = b.m_CphiMX_ij_coeff; - m_Theta_ij = b.m_Theta_ij; - m_Theta_ij_L = b.m_Theta_ij_L; - m_Theta_ij_LL = b.m_Theta_ij_LL; - m_Theta_ij_P = b.m_Theta_ij_P; - m_Theta_ij_coeff = b.m_Theta_ij_coeff; - m_Psi_ijk = b.m_Psi_ijk; - m_Psi_ijk_L = b.m_Psi_ijk_L; - m_Psi_ijk_LL = b.m_Psi_ijk_LL; - m_Psi_ijk_P = b.m_Psi_ijk_P; - m_Psi_ijk_coeff = b.m_Psi_ijk_coeff; - m_Lambda_nj = b.m_Lambda_nj; - m_Lambda_nj_L = b.m_Lambda_nj_L; - m_Lambda_nj_LL = b.m_Lambda_nj_LL; - m_Lambda_nj_P = b.m_Lambda_nj_P; - m_Lambda_nj_coeff = b.m_Lambda_nj_coeff; - - m_Mu_nnn = b.m_Mu_nnn; - m_Mu_nnn_L = b.m_Mu_nnn_L; - m_Mu_nnn_LL = b.m_Mu_nnn_LL; - m_Mu_nnn_P = b.m_Mu_nnn_P; - m_Mu_nnn_coeff = b.m_Mu_nnn_coeff; - - m_lnActCoeffMolal_Scaled = b.m_lnActCoeffMolal_Scaled; - m_lnActCoeffMolal_Unscaled = b.m_lnActCoeffMolal_Unscaled; - m_dlnActCoeffMolaldT_Scaled = b.m_dlnActCoeffMolaldT_Scaled; - m_dlnActCoeffMolaldT_Unscaled = b.m_dlnActCoeffMolaldT_Unscaled; - m_d2lnActCoeffMolaldT2_Scaled = b.m_d2lnActCoeffMolaldT2_Scaled; - m_d2lnActCoeffMolaldT2_Unscaled = b.m_d2lnActCoeffMolaldT2_Unscaled; - m_dlnActCoeffMolaldP_Scaled = b.m_dlnActCoeffMolaldP_Scaled; - m_dlnActCoeffMolaldP_Unscaled = b.m_dlnActCoeffMolaldP_Unscaled; - - m_molalitiesCropped = b.m_molalitiesCropped; - m_molalitiesAreCropped = b.m_molalitiesAreCropped; - m_CounterIJ = b.m_CounterIJ; - m_gfunc_IJ = b.m_gfunc_IJ; - m_g2func_IJ = b.m_g2func_IJ; - m_hfunc_IJ = b.m_hfunc_IJ; - m_h2func_IJ = b.m_h2func_IJ; - m_BMX_IJ = b.m_BMX_IJ; - m_BMX_IJ_L = b.m_BMX_IJ_L; - m_BMX_IJ_LL = b.m_BMX_IJ_LL; - m_BMX_IJ_P = b.m_BMX_IJ_P; - m_BprimeMX_IJ = b.m_BprimeMX_IJ; - m_BprimeMX_IJ_L = b.m_BprimeMX_IJ_L; - m_BprimeMX_IJ_LL = b.m_BprimeMX_IJ_LL; - m_BprimeMX_IJ_P = b.m_BprimeMX_IJ_P; - m_BphiMX_IJ = b.m_BphiMX_IJ; - m_BphiMX_IJ_L = b.m_BphiMX_IJ_L; - m_BphiMX_IJ_LL = b.m_BphiMX_IJ_LL; - m_BphiMX_IJ_P = b.m_BphiMX_IJ_P; - m_Phi_IJ = b.m_Phi_IJ; - m_Phi_IJ_L = b.m_Phi_IJ_L; - m_Phi_IJ_LL = b.m_Phi_IJ_LL; - m_Phi_IJ_P = b.m_Phi_IJ_P; - m_Phiprime_IJ = b.m_Phiprime_IJ; - m_PhiPhi_IJ = b.m_PhiPhi_IJ; - m_PhiPhi_IJ_L = b.m_PhiPhi_IJ_L; - m_PhiPhi_IJ_LL = b.m_PhiPhi_IJ_LL; - m_PhiPhi_IJ_P = b.m_PhiPhi_IJ_P; - m_CMX_IJ = b.m_CMX_IJ; - m_CMX_IJ_L = b.m_CMX_IJ_L; - m_CMX_IJ_LL = b.m_CMX_IJ_LL; - m_CMX_IJ_P = b.m_CMX_IJ_P; - m_gamma_tmp = b.m_gamma_tmp; - - IMS_lnActCoeffMolal_ = b.IMS_lnActCoeffMolal_; - IMS_typeCutoff_ = b.IMS_typeCutoff_; - IMS_X_o_cutoff_ = b.IMS_X_o_cutoff_; - IMS_gamma_o_min_ = b.IMS_gamma_o_min_; - IMS_gamma_k_min_ = b.IMS_gamma_k_min_; - IMS_cCut_ = b.IMS_cCut_; - IMS_slopefCut_ = b.IMS_slopefCut_; - IMS_dfCut_ = b.IMS_dfCut_; - IMS_efCut_ = b.IMS_efCut_; - IMS_afCut_ = b.IMS_afCut_; - IMS_bfCut_ = b.IMS_bfCut_; - IMS_slopegCut_ = b.IMS_slopegCut_; - IMS_dgCut_ = b.IMS_dgCut_; - IMS_egCut_ = b.IMS_egCut_; - IMS_agCut_ = b.IMS_agCut_; - IMS_bgCut_ = b.IMS_bgCut_; - MC_X_o_cutoff_ = b.MC_X_o_cutoff_; - MC_X_o_min_ = b.MC_X_o_min_; - MC_slopepCut_ = b.MC_slopepCut_; - MC_dpCut_ = b.MC_dpCut_; - MC_epCut_ = b.MC_epCut_; - MC_apCut_ = b.MC_apCut_; - MC_bpCut_ = b.MC_bpCut_; - MC_cpCut_ = b.MC_cpCut_; - CROP_ln_gamma_o_min = b.CROP_ln_gamma_o_min; - CROP_ln_gamma_o_max = b.CROP_ln_gamma_o_max; - CROP_ln_gamma_k_min = b.CROP_ln_gamma_k_min; - CROP_ln_gamma_k_max = b.CROP_ln_gamma_k_max; - CROP_speciesCropped_ = b.CROP_speciesCropped_; - m_debugCalc = b.m_debugCalc; - } - return *this; -} - -HMWSoln::~HMWSoln() -{ -} - -ThermoPhase* HMWSoln::duplMyselfAsThermoPhase() const -{ - return new HMWSoln(*this); -} - -int HMWSoln::eosType() const -{ - warn_deprecated("HMWSoln::eosType", - "To be removed after Cantera 2.3."); - int res; - switch (m_formGC) { - case 0: - res = cHMWSoln0; - break; - case 1: - res = cHMWSoln1; - break; - case 2: - res = cHMWSoln2; - break; - default: - throw CanteraError("eosType", "Unknown type"); - } - return res; -} - // -------- Molar Thermodynamic Properties of the Solution --------------- doublereal HMWSoln::enthalpy_mole() const diff --git a/src/thermo/HMWSoln_input.cpp b/src/thermo/HMWSoln_input.cpp index 012f17c0b..d1cc3d730 100644 --- a/src/thermo/HMWSoln_input.cpp +++ b/src/thermo/HMWSoln_input.cpp @@ -908,21 +908,6 @@ void HMWSoln::initThermo() initLengths(); } -void HMWSoln::constructPhaseFile(std::string inputFile, std::string id_) -{ - warn_deprecated("HMWSoln::constructPhaseFile", - "Use initThermoFile instead. To be removed after Cantera 2.3."); - - initThermoFile(inputFile, id_); -} - -void HMWSoln::constructPhaseXML(XML_Node& phaseNode, std::string id_) -{ - warn_deprecated("HMWSoln::constructPhaseXML", - "Use importPhase instead. To be removed after Cantera 2.3."); - importPhase(phaseNode, this); -} - void HMWSoln::initThermoXML(XML_Node& phaseNode, const std::string& id_) { if (id_.size() > 0) { diff --git a/src/thermo/IdealGasPhase.cpp b/src/thermo/IdealGasPhase.cpp index 1688dfd2a..5c4dba927 100644 --- a/src/thermo/IdealGasPhase.cpp +++ b/src/thermo/IdealGasPhase.cpp @@ -34,34 +34,6 @@ IdealGasPhase::IdealGasPhase(XML_Node& phaseRef, const std::string& id_) : importPhase(phaseRef, this); } -IdealGasPhase::IdealGasPhase(const IdealGasPhase& right) : - m_p0(right.m_p0) -{ - // Use the assignment operator to do the brunt of the work for the copy - // constructor. - *this = right; -} - -IdealGasPhase& IdealGasPhase::operator=(const IdealGasPhase& right) -{ - if (&right != this) { - ThermoPhase::operator=(right); - m_p0 = right.m_p0; - m_h0_RT = right.m_h0_RT; - m_cp0_R = right.m_cp0_R; - m_g0_RT = right.m_g0_RT; - m_s0_R = right.m_s0_R; - m_expg0_RT = right.m_expg0_RT; - m_pp = right.m_pp; - } - return *this; -} - -ThermoPhase* IdealGasPhase::duplMyselfAsThermoPhase() const -{ - return new IdealGasPhase(*this); -} - // Molar Thermodynamic Properties of the Solution ------------------ doublereal IdealGasPhase::entropy_mole() const diff --git a/src/thermo/IdealMolalSoln.cpp b/src/thermo/IdealMolalSoln.cpp index 45f45d6a5..1ea4fd5de 100644 --- a/src/thermo/IdealMolalSoln.cpp +++ b/src/thermo/IdealMolalSoln.cpp @@ -43,41 +43,6 @@ IdealMolalSoln::IdealMolalSoln() : { } -IdealMolalSoln::IdealMolalSoln(const IdealMolalSoln& b) : - MolalityVPSSTP(b) -{ - // Use the assignment operator to do the brunt of the work for the copy - // constructor. - *this = b; -} - -IdealMolalSoln& IdealMolalSoln::operator=(const IdealMolalSoln& b) -{ - if (&b != this) { - MolalityVPSSTP::operator=(b); - m_speciesMolarVolume = b.m_speciesMolarVolume; - m_formGC = b.m_formGC; - IMS_typeCutoff_ = b.IMS_typeCutoff_; - IMS_X_o_cutoff_ = b.IMS_X_o_cutoff_; - IMS_gamma_o_min_ = b.IMS_gamma_o_min_; - IMS_gamma_k_min_ = b.IMS_gamma_k_min_; - IMS_cCut_ = b.IMS_cCut_; - IMS_slopefCut_ = b.IMS_slopefCut_; - IMS_dfCut_ = b.IMS_dfCut_; - IMS_efCut_ = b.IMS_efCut_; - IMS_afCut_ = b.IMS_afCut_; - IMS_bfCut_ = b.IMS_bfCut_; - IMS_slopegCut_ = b.IMS_slopegCut_; - IMS_dgCut_ = b.IMS_dgCut_; - IMS_egCut_ = b.IMS_egCut_; - IMS_agCut_ = b.IMS_agCut_; - IMS_bgCut_ = b.IMS_bgCut_; - m_tmpV = b.m_tmpV; - IMS_lnActCoeffMolal_ = b.IMS_lnActCoeffMolal_; - } - return *this; -} - IdealMolalSoln::IdealMolalSoln(const std::string& inputFile, const std::string& id_) : MolalityVPSSTP(), @@ -123,11 +88,6 @@ IdealMolalSoln::IdealMolalSoln(XML_Node& root, const std::string& id_) : importPhase(root, this); } -ThermoPhase* IdealMolalSoln::duplMyselfAsThermoPhase() const -{ - return new IdealMolalSoln(*this); -} - doublereal IdealMolalSoln::enthalpy_mole() const { getPartialMolarEnthalpies(m_tmpV.data()); diff --git a/src/thermo/IdealSolidSolnPhase.cpp b/src/thermo/IdealSolidSolnPhase.cpp index fbc3f80f7..b93a2ffc8 100644 --- a/src/thermo/IdealSolidSolnPhase.cpp +++ b/src/thermo/IdealSolidSolnPhase.cpp @@ -56,58 +56,6 @@ IdealSolidSolnPhase::IdealSolidSolnPhase(XML_Node& root, const std::string& id_, importPhase(root, this); } -IdealSolidSolnPhase::IdealSolidSolnPhase(const IdealSolidSolnPhase& b) -{ - *this = b; -} - -IdealSolidSolnPhase& IdealSolidSolnPhase::operator=(const IdealSolidSolnPhase& b) -{ - if (this != &b) { - ThermoPhase::operator=(b); - - m_formGC = b.m_formGC; - m_Pref = b.m_Pref; - m_Pcurrent = b.m_Pcurrent; - m_speciesMolarVolume = b.m_speciesMolarVolume; - m_h0_RT = b.m_h0_RT; - m_cp0_R = b.m_cp0_R; - m_g0_RT = b.m_g0_RT; - m_s0_R = b.m_s0_R; - m_expg0_RT = b.m_expg0_RT; - m_pe = b.m_pe; - m_pp = b.m_pp; - } - return *this; -} - -ThermoPhase* IdealSolidSolnPhase::duplMyselfAsThermoPhase() const -{ - return new IdealSolidSolnPhase(*this); -} - -int IdealSolidSolnPhase::eosType() const -{ - warn_deprecated("EdgePhase::IdealSolidSolnPhase", - "To be removed after Cantera 2.3."); - integer res; - switch (m_formGC) { - case 0: - res = cIdealSolidSolnPhase0; - break; - case 1: - res = cIdealSolidSolnPhase1; - break; - case 2: - res = cIdealSolidSolnPhase2; - break; - default: - throw CanteraError("eosType", "Unknown type"); - break; - } - return res; -} - // Molar Thermodynamic Properties of the Solution doublereal IdealSolidSolnPhase::enthalpy_mole() const @@ -212,21 +160,6 @@ doublereal IdealSolidSolnPhase::standardConcentration(size_t k) const } return 0.0; } -doublereal IdealSolidSolnPhase::referenceConcentration(int k) const -{ - warn_deprecated("IdealSolidSolnPhase::referenceConcentration", - "Unused duplicate of standardConcentration. " - "To be removed after Cantera 2.3."); - switch (m_formGC) { - case 0: - return 1.0; - case 1: - return 1.0 / m_speciesMolarVolume[k]; - case 2: - return 1.0 / m_speciesMolarVolume[m_kk-1]; - } - return 0.0; -} void IdealSolidSolnPhase::getActivityCoefficients(doublereal* ac) const { diff --git a/src/thermo/IdealSolnGasVPSS.cpp b/src/thermo/IdealSolnGasVPSS.cpp index 87448823b..3aec9a8d5 100644 --- a/src/thermo/IdealSolnGasVPSS.cpp +++ b/src/thermo/IdealSolnGasVPSS.cpp @@ -43,42 +43,6 @@ IdealSolnGasVPSS::IdealSolnGasVPSS(const std::string& infile, std::string id_) : importPhase(*xphase, this); } -IdealSolnGasVPSS::IdealSolnGasVPSS(const IdealSolnGasVPSS& b) : - m_idealGas(0), - m_formGC(0) -{ - *this = b; -} - -IdealSolnGasVPSS& IdealSolnGasVPSS::operator=(const IdealSolnGasVPSS& b) -{ - if (&b != this) { - // Mostly, this is a passthrough to the underlying assignment operator - // for the ThermoPhae parent object. - VPStandardStateTP::operator=(b); - - // However, we have to handle data that we own. - m_idealGas = b.m_idealGas; - m_formGC = b.m_formGC; - } - return *this; -} - -ThermoPhase* IdealSolnGasVPSS::duplMyselfAsThermoPhase() const -{ - return new IdealSolnGasVPSS(*this); -} - -int IdealSolnGasVPSS::eosType() const -{ - warn_deprecated("EdgePhase::IdealSolnGasVPSS", - "To be removed after Cantera 2.3."); - if (m_idealGas) { - return cIdealSolnGasVPSS; - } - return cIdealSolnGasVPSS_iscv; -} - // ------------Molar Thermodynamic Properties ------------------------- doublereal IdealSolnGasVPSS::enthalpy_mole() const diff --git a/src/thermo/IonsFromNeutralVPSSTP.cpp b/src/thermo/IonsFromNeutralVPSSTP.cpp index 15bba53d1..d6c6489ea 100644 --- a/src/thermo/IonsFromNeutralVPSSTP.cpp +++ b/src/thermo/IonsFromNeutralVPSSTP.cpp @@ -50,7 +50,7 @@ IonsFromNeutralVPSSTP::IonsFromNeutralVPSSTP(const std::string& inputFile, if (neutralPhase) { IOwnNThermoPhase_ = false; } - constructPhaseFile(inputFile, id_); + initThermoFile(inputFile, id_); } IonsFromNeutralVPSSTP::IonsFromNeutralVPSSTP(XML_Node& phaseRoot, @@ -65,71 +65,7 @@ IonsFromNeutralVPSSTP::IonsFromNeutralVPSSTP(XML_Node& phaseRoot, if (neutralPhase) { IOwnNThermoPhase_ = false; } - constructPhaseXML(phaseRoot, id_); -} - -IonsFromNeutralVPSSTP::IonsFromNeutralVPSSTP(const IonsFromNeutralVPSSTP& b) : - ionSolnType_(cIonSolnType_SINGLEANION), - numNeutralMoleculeSpecies_(0), - indexSpecialSpecies_(npos), - indexSecondSpecialSpecies_(npos), - neutralMoleculePhase_(0), - geThermo(0), - IOwnNThermoPhase_(true) -{ - IonsFromNeutralVPSSTP::operator=(b); -} - -IonsFromNeutralVPSSTP& -IonsFromNeutralVPSSTP::operator=(const IonsFromNeutralVPSSTP& b) -{ - if (&b == this) { - return *this; - } - - // If we own the underlying neutral molecule phase, then we do a deep copy. - // If not, we do a shallow copy. We get a valid pointer for - // neutralMoleculePhase_ first, because we need it to assign the pointers - // within the PDSS_IonsFromNeutral object. which is done in the - // GibbsExcessVPSSTP::operator=(b) step. - if (IOwnNThermoPhase_) { - if (b.neutralMoleculePhase_) { - delete neutralMoleculePhase_; - neutralMoleculePhase_ = (b.neutralMoleculePhase_)->duplMyselfAsThermoPhase(); - } else { - neutralMoleculePhase_ = 0; - } - } else { - neutralMoleculePhase_ = b.neutralMoleculePhase_; - } - geThermo = dynamic_cast(neutralMoleculePhase_); - - GibbsExcessVPSSTP::operator=(b); - - ionSolnType_ = b.ionSolnType_; - numNeutralMoleculeSpecies_ = b.numNeutralMoleculeSpecies_; - indexSpecialSpecies_ = b.indexSpecialSpecies_; - indexSecondSpecialSpecies_ = b.indexSecondSpecialSpecies_; - fm_neutralMolec_ions_ = b.fm_neutralMolec_ions_; - fm_invert_ionForNeutral = b.fm_invert_ionForNeutral; - NeutralMolecMoleFractions_ = b.NeutralMolecMoleFractions_; - cationList_ = b.cationList_; - anionList_ = b.anionList_; - passThroughList_ = b.passThroughList_; - y_ = b.y_; - dlnActCoeff_NeutralMolecule_ = b.dlnActCoeff_NeutralMolecule_; - dX_NeutralMolecule_ = b.dX_NeutralMolecule_; - m_work = b.m_work; - IOwnNThermoPhase_ = b.IOwnNThermoPhase_; - moleFractionsTmp_ = b.moleFractionsTmp_; - muNeutralMolecule_ = b.muNeutralMolecule_; - lnActCoeff_NeutralMolecule_ = b.lnActCoeff_NeutralMolecule_; - dlnActCoeffdT_NeutralMolecule_ = b.dlnActCoeffdT_NeutralMolecule_; - dlnActCoeffdlnX_diag_NeutralMolecule_ = b.dlnActCoeffdlnX_diag_NeutralMolecule_; - dlnActCoeffdlnN_diag_NeutralMolecule_ = b.dlnActCoeffdlnN_diag_NeutralMolecule_; - dlnActCoeffdlnN_NeutralMolecule_ = b.dlnActCoeffdlnN_NeutralMolecule_; - - return *this; + importPhase(phaseRoot, this); } IonsFromNeutralVPSSTP::~IonsFromNeutralVPSSTP() @@ -140,34 +76,6 @@ IonsFromNeutralVPSSTP::~IonsFromNeutralVPSSTP() } } -ThermoPhase* IonsFromNeutralVPSSTP::duplMyselfAsThermoPhase() const -{ - return new IonsFromNeutralVPSSTP(*this); -} - -void IonsFromNeutralVPSSTP::constructPhaseFile(std::string inputFile, std::string id_) -{ - warn_deprecated("IonsFromNeutralVPSSTP::constructPhaseFile", - "Use initThermoFile instead. To be removed after Cantera 2.3."); - initThermoFile(inputFile, id_); -} - -void IonsFromNeutralVPSSTP::constructPhaseXML(XML_Node& phaseNode, std::string id_) -{ - warn_deprecated("IonsFromNeutralVPSSTP::constructPhaseXML", - "Use importPhase instead. To be removed after Cantera 2.3."); - importPhase(phaseNode, this); -} - -// -------------- Utilities ------------------------------- - -int IonsFromNeutralVPSSTP::eosType() const -{ - warn_deprecated("IonsFromNeutralVPSSTP::eosType", - "To be removed after Cantera 2.3."); - return cIonsFromNeutral; -} - // ------------ Molar Thermodynamic Properties ---------------------- doublereal IonsFromNeutralVPSSTP::enthalpy_mole() const diff --git a/src/thermo/LatticePhase.cpp b/src/thermo/LatticePhase.cpp index 7da31bd67..f6b96881a 100644 --- a/src/thermo/LatticePhase.cpp +++ b/src/thermo/LatticePhase.cpp @@ -26,32 +26,6 @@ LatticePhase::LatticePhase() : { } -LatticePhase::LatticePhase(const LatticePhase& right) : - m_Pref(OneAtm), - m_Pcurrent(OneAtm), - m_speciesMolarVolume(0), - m_site_density(0.0) -{ - *this = right; -} - -LatticePhase& LatticePhase::operator=(const LatticePhase& right) -{ - if (&right != this) { - ThermoPhase::operator=(right); - m_Pref = right.m_Pref; - m_Pcurrent = right.m_Pcurrent; - m_h0_RT = right.m_h0_RT; - m_cp0_R = right.m_cp0_R; - m_g0_RT = right.m_g0_RT; - m_s0_R = right.m_s0_R; - m_vacancy = right.m_vacancy; - m_speciesMolarVolume = right.m_speciesMolarVolume; - m_site_density = right.m_site_density; - } - return *this; -} - LatticePhase::LatticePhase(const std::string& inputFile, const std::string& id_) { initThermoFile(inputFile, id_); @@ -62,11 +36,6 @@ LatticePhase::LatticePhase(XML_Node& phaseRef, const std::string& id_) importPhase(phaseRef, this); } -ThermoPhase* LatticePhase::duplMyselfAsThermoPhase() const -{ - return new LatticePhase(*this); -} - doublereal LatticePhase::enthalpy_mole() const { return RT() * mean_X(enthalpy_RT_ref()) + diff --git a/src/thermo/LatticeSolidPhase.cpp b/src/thermo/LatticeSolidPhase.cpp index 4474d1250..3bac7f86d 100644 --- a/src/thermo/LatticeSolidPhase.cpp +++ b/src/thermo/LatticeSolidPhase.cpp @@ -27,28 +27,6 @@ LatticeSolidPhase::LatticeSolidPhase() : { } -LatticeSolidPhase::LatticeSolidPhase(const LatticeSolidPhase& right) : - m_press(-1.0), - m_molar_density(0.0) -{ - *this = right; -} - -LatticeSolidPhase& LatticeSolidPhase::operator=(const LatticeSolidPhase& right) -{ - if (&right != this) { - ThermoPhase::operator=(right); - m_tlast = right.m_tlast; - m_press = right.m_press; - m_molar_density = right.m_molar_density; - deepStdVectorPointerCopy(right.m_lattice, m_lattice); - m_x = right.m_x; - theta_ = right.theta_; - tmpV_ = right.tmpV_; - } - return *this; -} - LatticeSolidPhase::~LatticeSolidPhase() { // We own the sublattices. So we have to delete the sublattices @@ -58,11 +36,6 @@ LatticeSolidPhase::~LatticeSolidPhase() } } -ThermoPhase* LatticeSolidPhase::duplMyselfAsThermoPhase() const -{ - return new LatticeSolidPhase(*this); -} - doublereal LatticeSolidPhase::minTemp(size_t k) const { if (k != npos) { diff --git a/src/thermo/MargulesVPSSTP.cpp b/src/thermo/MargulesVPSSTP.cpp index 0e53e502a..17d61fc89 100644 --- a/src/thermo/MargulesVPSSTP.cpp +++ b/src/thermo/MargulesVPSSTP.cpp @@ -41,45 +41,6 @@ MargulesVPSSTP::MargulesVPSSTP(XML_Node& phaseRoot, const std::string& id_) : importPhase(phaseRoot, this); } -MargulesVPSSTP::MargulesVPSSTP(const MargulesVPSSTP& b) -{ - MargulesVPSSTP::operator=(b); -} - -MargulesVPSSTP& MargulesVPSSTP::operator=(const MargulesVPSSTP& b) -{ - if (&b == this) { - return *this; - } - - GibbsExcessVPSSTP::operator=(b); - - numBinaryInteractions_ = b.numBinaryInteractions_; - m_HE_b_ij = b.m_HE_b_ij; - m_HE_c_ij = b.m_HE_c_ij; - m_HE_d_ij = b.m_HE_d_ij; - m_SE_b_ij = b.m_SE_b_ij; - m_SE_c_ij = b.m_SE_c_ij; - m_SE_d_ij = b.m_SE_d_ij; - m_VHE_b_ij = b.m_VHE_b_ij; - m_VHE_c_ij = b.m_VHE_c_ij; - m_VHE_d_ij = b.m_VHE_d_ij; - m_VSE_b_ij = b.m_VSE_b_ij; - m_VSE_c_ij = b.m_VSE_c_ij; - m_VSE_d_ij = b.m_VSE_d_ij; - m_pSpecies_A_ij = b.m_pSpecies_A_ij; - m_pSpecies_B_ij = b.m_pSpecies_B_ij; - formMargules_ = b.formMargules_; - formTempModel_ = b.formTempModel_; - - return *this; -} - -ThermoPhase* MargulesVPSSTP::duplMyselfAsThermoPhase() const -{ - return new MargulesVPSSTP(*this); -} - // -- Activities, Standard States, Activity Concentrations ----------- void MargulesVPSSTP::getLnActivityCoefficients(doublereal* lnac) const diff --git a/src/thermo/MaskellSolidSolnPhase.cpp b/src/thermo/MaskellSolidSolnPhase.cpp index 09edd4b1a..e5c331703 100644 --- a/src/thermo/MaskellSolidSolnPhase.cpp +++ b/src/thermo/MaskellSolidSolnPhase.cpp @@ -29,33 +29,6 @@ MaskellSolidSolnPhase::MaskellSolidSolnPhase() : { } -MaskellSolidSolnPhase::MaskellSolidSolnPhase(const MaskellSolidSolnPhase& b) : - m_Pcurrent(OneAtm), - m_h0_RT(2), - m_cp0_R(2), - m_g0_RT(2), - m_s0_R(2), - h_mixing(0.0), - product_species_index(0), - reactant_species_index(1) -{ - *this = b; -} - -MaskellSolidSolnPhase& -MaskellSolidSolnPhase::operator=(const MaskellSolidSolnPhase& b) -{ - if (this != &b) { - VPStandardStateTP::operator=(b); - } - return *this; -} - -ThermoPhase* MaskellSolidSolnPhase::duplMyselfAsThermoPhase() const -{ - return new MaskellSolidSolnPhase(*this); -} - void MaskellSolidSolnPhase::getActivityConcentrations(doublereal* c) const { getActivityCoefficients(c); diff --git a/src/thermo/MetalSHEelectrons.cpp b/src/thermo/MetalSHEelectrons.cpp index 455503c8d..f163a6612 100644 --- a/src/thermo/MetalSHEelectrons.cpp +++ b/src/thermo/MetalSHEelectrons.cpp @@ -9,7 +9,6 @@ // This file is part of Cantera. See License.txt in the top-level directory or // at http://www.cantera.org/license.txt for license and copyright information. -#include "cantera/thermo/mix_defs.h" #include "cantera/base/ctml.h" #include "cantera/thermo/MetalSHEelectrons.h" #include "cantera/thermo/ThermoFactory.h" @@ -33,34 +32,6 @@ MetalSHEelectrons::MetalSHEelectrons(XML_Node& xmlphase, const std::string& id_) importPhase(xmlphase, this); } -MetalSHEelectrons::MetalSHEelectrons(const MetalSHEelectrons& right) -{ - operator=(right); -} - -MetalSHEelectrons& MetalSHEelectrons::operator=(const MetalSHEelectrons& right) -{ - if (&right != this) { - SingleSpeciesTP::operator=(right); - } - - return *this; -} - -ThermoPhase* MetalSHEelectrons::duplMyselfAsThermoPhase() const -{ - return new MetalSHEelectrons(*this); -} - -// ---- Utilities ----- - -int MetalSHEelectrons::eosType() const -{ - warn_deprecated("MetalSHEelectrons::eosType", - "To be removed after Cantera 2.3."); - return cMetalSHEelectrons; -} - // ----- Mechanical Equation of State ------ doublereal MetalSHEelectrons::pressure() const diff --git a/src/thermo/MineralEQ3.cpp b/src/thermo/MineralEQ3.cpp index 7afda21f8..8fa81e13e 100644 --- a/src/thermo/MineralEQ3.cpp +++ b/src/thermo/MineralEQ3.cpp @@ -9,7 +9,6 @@ // at http://www.cantera.org/license.txt for license and copyright information. #include "cantera/base/ctml.h" -#include "cantera/thermo/mix_defs.h" #include "cantera/thermo/MineralEQ3.h" #include "cantera/thermo/ThermoFactory.h" #include "cantera/base/stringUtils.h" @@ -31,44 +30,6 @@ MineralEQ3::MineralEQ3(XML_Node& xmlphase, const std::string& id_) importPhase(xmlphase, this); } -MineralEQ3::MineralEQ3(const MineralEQ3& right) -{ - *this = right; -} - -MineralEQ3& -MineralEQ3::operator=(const MineralEQ3& right) -{ - if (&right == this) { - return *this; - } - StoichSubstance::operator=(right); - m_Mu0_pr_tr = right.m_Mu0_pr_tr; - m_Entrop_pr_tr = right.m_Entrop_pr_tr; - m_deltaG_formation_pr_tr = right.m_deltaG_formation_pr_tr; - m_deltaH_formation_pr_tr = right.m_deltaH_formation_pr_tr; - m_V0_pr_tr = right.m_V0_pr_tr; - m_a = right.m_a; - m_b = right.m_b; - m_c = right.m_c; - - return *this; -} - -ThermoPhase* MineralEQ3::duplMyselfAsThermoPhase() const -{ - return new MineralEQ3(*this); -} - -// ---- Utilities ----- - -int MineralEQ3::eosType() const -{ - warn_deprecated("MineralEQ3::eosType", - "To be removed after Cantera 2.3."); - return cStoichSubstance; -} - // ----- Mechanical Equation of State ------ doublereal MineralEQ3::pressure() const diff --git a/src/thermo/MixedSolventElectrolyte.cpp b/src/thermo/MixedSolventElectrolyte.cpp index e2b004a38..609f771fa 100644 --- a/src/thermo/MixedSolventElectrolyte.cpp +++ b/src/thermo/MixedSolventElectrolyte.cpp @@ -40,46 +40,6 @@ MixedSolventElectrolyte::MixedSolventElectrolyte(XML_Node& phaseRoot, importPhase(phaseRoot, this); } -MixedSolventElectrolyte::MixedSolventElectrolyte(const MixedSolventElectrolyte& b) -{ - MixedSolventElectrolyte::operator=(b); -} - -MixedSolventElectrolyte& -MixedSolventElectrolyte::operator=(const MixedSolventElectrolyte& b) -{ - if (&b == this) { - return *this; - } - - MolarityIonicVPSSTP::operator=(b); - - numBinaryInteractions_ = b.numBinaryInteractions_; - m_HE_b_ij = b.m_HE_b_ij; - m_HE_c_ij = b.m_HE_c_ij; - m_HE_d_ij = b.m_HE_d_ij; - m_SE_b_ij = b.m_SE_b_ij; - m_SE_c_ij = b.m_SE_c_ij; - m_SE_d_ij = b.m_SE_d_ij; - m_VHE_b_ij = b.m_VHE_b_ij; - m_VHE_c_ij = b.m_VHE_c_ij; - m_VHE_d_ij = b.m_VHE_d_ij; - m_VSE_b_ij = b.m_VSE_b_ij; - m_VSE_c_ij = b.m_VSE_c_ij; - m_VSE_d_ij = b.m_VSE_d_ij; - m_pSpecies_A_ij = b.m_pSpecies_A_ij; - m_pSpecies_B_ij = b.m_pSpecies_B_ij; - formMargules_ = b.formMargules_; - formTempModel_ = b.formTempModel_; - - return *this; -} - -ThermoPhase* MixedSolventElectrolyte::duplMyselfAsThermoPhase() const -{ - return new MixedSolventElectrolyte(*this); -} - // - Activities, Standard States, Activity Concentrations ----------- void MixedSolventElectrolyte::getActivityCoefficients(doublereal* ac) const diff --git a/src/thermo/MixtureFugacityTP.cpp b/src/thermo/MixtureFugacityTP.cpp index 96eafe94c..22255c877 100644 --- a/src/thermo/MixtureFugacityTP.cpp +++ b/src/thermo/MixtureFugacityTP.cpp @@ -25,40 +25,6 @@ MixtureFugacityTP::MixtureFugacityTP() : { } -MixtureFugacityTP::MixtureFugacityTP(const MixtureFugacityTP& b) : - m_Pcurrent(-1.0), - iState_(FLUID_GAS), - forcedState_(FLUID_UNDEFINED), - m_Tlast_ref(-1.0) -{ - MixtureFugacityTP::operator=(b); -} - -MixtureFugacityTP& MixtureFugacityTP::operator=(const MixtureFugacityTP& b) -{ - if (&b != this) { - // Mostly, this is a passthrough to the underlying assignment operator - // for the ThermoPhase parent object. - ThermoPhase::operator=(b); - // However, we have to handle data that we own. - m_Pcurrent = b.m_Pcurrent; - moleFractions_ = b.moleFractions_; - iState_ = b.iState_; - forcedState_ = b.forcedState_; - m_Tlast_ref = b.m_Tlast_ref; - m_h0_RT = b.m_h0_RT; - m_cp0_R = b.m_cp0_R; - m_g0_RT = b.m_g0_RT; - m_s0_R = b.m_s0_R; - } - return *this; -} - -ThermoPhase* MixtureFugacityTP::duplMyselfAsThermoPhase() const -{ - return new MixtureFugacityTP(*this); -} - int MixtureFugacityTP::standardStateConvention() const { return cSS_CONVENTION_TEMPERATURE; diff --git a/src/thermo/MolalityVPSSTP.cpp b/src/thermo/MolalityVPSSTP.cpp index 6576cd2a1..18c8865f7 100644 --- a/src/thermo/MolalityVPSSTP.cpp +++ b/src/thermo/MolalityVPSSTP.cpp @@ -35,37 +35,6 @@ MolalityVPSSTP::MolalityVPSSTP() : m_chargeNeutralityNecessary = true; } -MolalityVPSSTP::MolalityVPSSTP(const MolalityVPSSTP& b) : - m_indexSolvent(b.m_indexSolvent), - m_pHScalingType(b.m_pHScalingType), - m_indexCLM(b.m_indexCLM), - m_xmolSolventMIN(b.m_xmolSolventMIN), - m_Mnaught(b.m_Mnaught), - m_molalities(b.m_molalities) -{ - *this = b; -} - -MolalityVPSSTP& MolalityVPSSTP::operator=(const MolalityVPSSTP& b) -{ - if (&b != this) { - VPStandardStateTP::operator=(b); - m_indexSolvent = b.m_indexSolvent; - m_pHScalingType = b.m_pHScalingType; - m_indexCLM = b.m_indexCLM; - m_weightSolvent = b.m_weightSolvent; - m_xmolSolventMIN = b.m_xmolSolventMIN; - m_Mnaught = b.m_Mnaught; - m_molalities = b.m_molalities; - } - return *this; -} - -ThermoPhase* MolalityVPSSTP::duplMyselfAsThermoPhase() const -{ - return new MolalityVPSSTP(*this); -} - // -------------- Utilities ------------------------------- void MolalityVPSSTP::setpHScale(const int pHscaleType) diff --git a/src/thermo/MolarityIonicVPSSTP.cpp b/src/thermo/MolarityIonicVPSSTP.cpp index d0a3e711e..68ba612e8 100644 --- a/src/thermo/MolarityIonicVPSSTP.cpp +++ b/src/thermo/MolarityIonicVPSSTP.cpp @@ -53,39 +53,6 @@ MolarityIonicVPSSTP::MolarityIonicVPSSTP(XML_Node& phaseRoot, importPhase(phaseRoot, this); } -MolarityIonicVPSSTP::MolarityIonicVPSSTP(const MolarityIonicVPSSTP& b) : - PBType_(PBTYPE_PASSTHROUGH), - numPBSpecies_(m_kk), - indexSpecialSpecies_(npos), - neutralPBindexStart(0) -{ - *this = b; -} - -MolarityIonicVPSSTP& MolarityIonicVPSSTP::operator=(const MolarityIonicVPSSTP& b) -{ - if (&b != this) { - GibbsExcessVPSSTP::operator=(b); - } - - PBType_ = b.PBType_; - numPBSpecies_ = b.numPBSpecies_; - indexSpecialSpecies_ = b.indexSpecialSpecies_; - PBMoleFractions_ = b.PBMoleFractions_; - cationList_ = b.cationList_; - anionList_ = b.anionList_; - passThroughList_ = b.passThroughList_; - neutralPBindexStart = b.neutralPBindexStart; - moleFractionsTmp_ = b.moleFractionsTmp_; - - return *this; -} - -ThermoPhase* MolarityIonicVPSSTP::duplMyselfAsThermoPhase() const -{ - return new MolarityIonicVPSSTP(*this); -} - // - Activities, Standard States, Activity Concentrations ----------- void MolarityIonicVPSSTP::getLnActivityCoefficients(doublereal* lnac) const diff --git a/src/thermo/Mu0Poly.cpp b/src/thermo/Mu0Poly.cpp index 0d906361a..86b2dce41 100644 --- a/src/thermo/Mu0Poly.cpp +++ b/src/thermo/Mu0Poly.cpp @@ -17,12 +17,6 @@ using namespace std; namespace Cantera { -Mu0Poly::Mu0Poly() : m_numIntervals(0), - m_H298(0.0) -{ - warn_deprecated("Mu0Poly::Mu0Poly()", - "Default constructor to be removed after Cantera 2.3."); -} Mu0Poly::Mu0Poly(double tlow, double thigh, double pref, const double* coeffs) : SpeciesThermoInterpType(tlow, thigh, pref), @@ -32,11 +26,6 @@ Mu0Poly::Mu0Poly(double tlow, double thigh, double pref, const double* coeffs) : processCoeffs(coeffs); } -SpeciesThermoInterpType* Mu0Poly::duplMyselfAsSpeciesThermoInterpType() const -{ - return new Mu0Poly(*this); -} - void Mu0Poly::updateProperties(const doublereal* tt, doublereal* cp_R, doublereal* h_RT, doublereal* s_R) const { @@ -84,13 +73,6 @@ void Mu0Poly::reportParameters(size_t& n, int& type, } } -void Mu0Poly::modifyParameters(doublereal* coeffs) -{ - warn_deprecated("Mu0Poly::modifyParameters", "To be removed after " - "Cantera 2.3. Use MultiSpeciesThermo::modifySpecies instead."); - processCoeffs(coeffs); -} - Mu0Poly* newMu0ThermoFromXML(const XML_Node& Mu0Node) { bool dimensionlessMu0Values = false; diff --git a/src/thermo/MultiSpeciesThermo.cpp b/src/thermo/MultiSpeciesThermo.cpp index 4c2fc4cc0..27cda86f7 100644 --- a/src/thermo/MultiSpeciesThermo.cpp +++ b/src/thermo/MultiSpeciesThermo.cpp @@ -23,62 +23,6 @@ MultiSpeciesThermo::MultiSpeciesThermo() : { } -MultiSpeciesThermo::MultiSpeciesThermo(const MultiSpeciesThermo& b) : - m_tpoly(b.m_tpoly), - m_speciesLoc(b.m_speciesLoc), - m_tlow_max(b.m_tlow_max), - m_thigh_min(b.m_thigh_min), - m_p0(b.m_p0) -{ - warn_deprecated("MultiSpeciesThermo copy constructor", - "To be removed after Cantera 2.3"); - m_sp.clear(); - // Copy SpeciesThermoInterpTypes from 'b' - for (const auto& sp : b.m_sp) { - for (size_t k = 0; k < sp.second.size(); k++) { - size_t i = sp.second[k].first; - shared_ptr spec( - sp.second[k].second->duplMyselfAsSpeciesThermoInterpType()); - m_sp[sp.first].emplace_back(i, spec); - } - } -} - -MultiSpeciesThermo& -MultiSpeciesThermo::operator=(const MultiSpeciesThermo& b) -{ - warn_deprecated("MultiSpeciesThermo assignment operator", - "To be removed after Cantera 2.3"); - if (&b == this) { - return *this; - } - - m_sp.clear(); - // Copy SpeciesThermoInterpType objects from 'b' - for (const auto& sp : b.m_sp) { - for (size_t k = 0; k < sp.second.size(); k++) { - size_t i = sp.second[k].first; - shared_ptr spec( - sp.second[k].second->duplMyselfAsSpeciesThermoInterpType()); - m_sp[sp.first].emplace_back(i, spec); - } - } - - m_tpoly = b.m_tpoly; - m_speciesLoc = b.m_speciesLoc; - m_tlow_max = b.m_tlow_max; - m_thigh_min = b.m_thigh_min; - m_p0 = b.m_p0; - return *this; -} - -MultiSpeciesThermo* MultiSpeciesThermo::duplMyselfAsSpeciesThermo() const -{ - warn_deprecated("MultiSpeciesThermo::duplMyselfAsSpeciesThermo", - "To be removed after Cantera 2.3"); - return new MultiSpeciesThermo(*this); -} - void MultiSpeciesThermo::install_STIT(size_t index, shared_ptr stit_ptr) { diff --git a/src/thermo/Nasa9Poly1.cpp b/src/thermo/Nasa9Poly1.cpp index 1b6c8ad05..9c2d309d4 100644 --- a/src/thermo/Nasa9Poly1.cpp +++ b/src/thermo/Nasa9Poly1.cpp @@ -16,13 +16,6 @@ namespace Cantera { -Nasa9Poly1::Nasa9Poly1() - : m_coeff(9, 0.0) -{ - warn_deprecated("Nasa9Poly1::Nasa9Poly1()", - "Default constructor to be removed after Cantera 2.3."); - m_Pref = 1.0e5; -} Nasa9Poly1::Nasa9Poly1(double tlow, double thigh, double pref, const double* coeffs) : @@ -31,11 +24,6 @@ Nasa9Poly1::Nasa9Poly1(double tlow, double thigh, double pref, { } -SpeciesThermoInterpType* Nasa9Poly1::duplMyselfAsSpeciesThermoInterpType() const -{ - return new Nasa9Poly1(*this); -} - int Nasa9Poly1::reportType() const { return NASA9; @@ -104,13 +92,4 @@ void Nasa9Poly1::reportParameters(size_t& n, int& type, } } -void Nasa9Poly1::modifyParameters(doublereal* coeffs) -{ - warn_deprecated("Nasa9Poly1::modifyParameters", "To be removed after " - "Cantera 2.3. Use MultiSpeciesThermo::modifySpecies instead."); - for (int i = 0; i < 9; i++) { - m_coeff[i] = coeffs[i]; - } -} - } diff --git a/src/thermo/Nasa9PolyMultiTempRegion.cpp b/src/thermo/Nasa9PolyMultiTempRegion.cpp index dc4003616..33844bacb 100644 --- a/src/thermo/Nasa9PolyMultiTempRegion.cpp +++ b/src/thermo/Nasa9PolyMultiTempRegion.cpp @@ -21,12 +21,6 @@ using namespace std; namespace Cantera { -Nasa9PolyMultiTempRegion::Nasa9PolyMultiTempRegion() : - m_currRegion(0) -{ - warn_deprecated("Nasa9PolyMultiTempRegion::Nasa9PolyMultiTempRegion()", - "Default constructor to be removed after Cantera 2.3."); -} Nasa9PolyMultiTempRegion::Nasa9PolyMultiTempRegion(vector& regionPts) : m_currRegion(0) @@ -58,42 +52,10 @@ Nasa9PolyMultiTempRegion::Nasa9PolyMultiTempRegion(vector& regionPt } } -Nasa9PolyMultiTempRegion::Nasa9PolyMultiTempRegion(const Nasa9PolyMultiTempRegion& b) : - SpeciesThermoInterpType(b), - m_lowerTempBounds(b.m_lowerTempBounds), - m_currRegion(b.m_currRegion) -{ - m_regionPts.resize(b.m_regionPts.size()); - for (size_t i = 0; i < m_regionPts.size(); i++) { - m_regionPts[i].reset(new Nasa9Poly1(*b.m_regionPts[i])); - } -} - -Nasa9PolyMultiTempRegion& -Nasa9PolyMultiTempRegion::operator=(const Nasa9PolyMultiTempRegion& b) -{ - if (&b != this) { - SpeciesThermoInterpType::operator=(b); - m_lowerTempBounds = b.m_lowerTempBounds; - m_currRegion = b.m_currRegion; - m_regionPts.resize(b.m_regionPts.size()); - for (size_t i = 0; i < m_regionPts.size(); i++) { - m_regionPts[i].reset(new Nasa9Poly1(*b.m_regionPts[i])); - } - } - return *this; -} - Nasa9PolyMultiTempRegion::~Nasa9PolyMultiTempRegion() { } -SpeciesThermoInterpType* -Nasa9PolyMultiTempRegion::duplMyselfAsSpeciesThermoInterpType() const -{ - return new Nasa9PolyMultiTempRegion(*this); -} - int Nasa9PolyMultiTempRegion::reportType() const { return NASA9MULTITEMP; @@ -169,15 +131,4 @@ void Nasa9PolyMultiTempRegion::reportParameters(size_t& n, int& type, } } -void Nasa9PolyMultiTempRegion::modifyParameters(doublereal* coeffs) -{ - warn_deprecated("Nasa9PolyMultiTempRegion::modifyParameters", "To be " - "removed after Cantera 2.3. Use MultiSpeciesThermo::modifySpecies instead."); - int index = 3; - for (size_t iReg = 0; iReg < m_regionPts.size(); iReg++) { - m_regionPts[iReg]->modifyParameters(coeffs + index); - index += 11; - } -} - } diff --git a/src/thermo/PDSS.cpp b/src/thermo/PDSS.cpp index e8b5a38f4..be43def6d 100644 --- a/src/thermo/PDSS.cpp +++ b/src/thermo/PDSS.cpp @@ -15,7 +15,6 @@ namespace Cantera { PDSS::PDSS() : - m_pdssType(cPDSS_UNDEF), m_temp(-1.0), m_pres(-1.0), m_p0(-1.0), @@ -40,7 +39,6 @@ PDSS::PDSS() : } PDSS::PDSS(VPStandardStateTP* tp, size_t spindex) : - m_pdssType(cPDSS_UNDEF), m_temp(-1.0), m_pres(-1.0), m_p0(-1.0), @@ -70,100 +68,6 @@ PDSS::PDSS(VPStandardStateTP* tp, size_t spindex) : } } -PDSS::PDSS(const PDSS& b) : - m_pdssType(cPDSS_UNDEF), - m_temp(-1.0), - m_pres(-1.0), - m_p0(-1.0), - m_minTemp(-1.0), - m_maxTemp(10000.0), - m_tp(0), - m_vpssmgr_ptr(0), - m_mw(b.m_mw), - m_spindex(b.m_spindex), - m_spthermo(b.m_spthermo), - m_h0_RT_ptr(b.m_h0_RT_ptr), - m_cp0_R_ptr(b.m_cp0_R_ptr), - m_s0_R_ptr(b.m_s0_R_ptr), - m_g0_RT_ptr(b.m_g0_RT_ptr), - m_V0_ptr(b.m_V0_ptr), - m_hss_RT_ptr(b.m_hss_RT_ptr), - m_cpss_R_ptr(b.m_cpss_R_ptr), - m_sss_R_ptr(b.m_sss_R_ptr), - m_gss_RT_ptr(b.m_gss_RT_ptr), - m_Vss_ptr(b.m_Vss_ptr) -{ - warn_deprecated("PDSS copy constructor", "To be removed after" - " Cantera 2.3 for all classes derived from PDSS."); - // Use the assignment operator to do the brunt of the work for the copy - // constructor. - *this = b; -} - -PDSS& PDSS::operator=(const PDSS& b) -{ - warn_deprecated("PDSS assignment operator", "To be removed after" - " Cantera 2.3 for all classes derived from PDSS."); - if (&b == this) { - return *this; - } - - m_pdssType = b.m_pdssType; - m_temp = b.m_temp; - m_pres = b.m_pres; - m_p0 = b.m_p0; - m_minTemp = b.m_minTemp; - m_maxTemp = b.m_maxTemp; - - // Pointers which are zero, are properly assigned in the function, - // initAllPtrs(). which must be called after the assignment operation. - m_tp = 0; - m_vpssmgr_ptr = 0; - m_mw = b.m_mw; - m_spindex = b.m_spindex; - m_spthermo = 0; - m_cp0_R_ptr = 0; - m_h0_RT_ptr = 0; - m_s0_R_ptr = 0; - m_g0_RT_ptr = 0; - m_V0_ptr = 0; - m_cpss_R_ptr = 0; - m_hss_RT_ptr = 0; - m_sss_R_ptr = 0; - m_gss_RT_ptr = 0; - m_Vss_ptr = 0; - - // Here we just fill these in so that local copies within the VPSS object work. - m_tp = b.m_tp; - m_vpssmgr_ptr = b.m_vpssmgr_ptr; - m_spthermo = b.m_spthermo; - m_cp0_R_ptr = b.m_cp0_R_ptr; - m_h0_RT_ptr = b.m_h0_RT_ptr; - m_s0_R_ptr = b.m_s0_R_ptr; - m_g0_RT_ptr = b.m_g0_RT_ptr; - m_V0_ptr = b.m_V0_ptr; - m_cpss_R_ptr = b.m_cpss_R_ptr; - m_hss_RT_ptr = b.m_hss_RT_ptr; - m_sss_R_ptr = b.m_sss_R_ptr; - m_gss_RT_ptr = b.m_gss_RT_ptr; - m_Vss_ptr = b.m_Vss_ptr; - - return *this; -} - -PDSS* PDSS::duplMyselfAsPDSS() const -{ - warn_deprecated("PDSS::duplMyselfAsPDSS", - "To be removed after Cantera 2.3."); - return new PDSS(*this); -} - -PDSS_enumType PDSS::reportPDSSType() const -{ - warn_deprecated("PDSS::reportPDSSType", "To be removed after Cantera 2.3."); - return m_pdssType; -} - void PDSS::initThermoXML(const XML_Node& phaseNode, const std::string& id) { AssertThrow(m_tp != 0, "PDSS::initThermoXML()"); @@ -181,17 +85,6 @@ void PDSS::initThermo() m_mw = m_tp->molecularWeight(m_spindex); } -void PDSS::initAllPtrs(VPStandardStateTP* tp, VPSSMgr* vpssmgr_ptr, - MultiSpeciesThermo* spthermo) -{ - warn_deprecated("PDSS::initAllPtrs", "To be removed after Cantera 2.3 " - "for all classes derived from PDSS."); - m_tp = tp; - m_vpssmgr_ptr = vpssmgr_ptr; - m_spthermo = spthermo; - initPtrs(); -} - void PDSS::initPtrs() { AssertThrow(m_vpssmgr_ptr->mPDSS_h0_RT.size() != 0, "PDSS::initPtrs()"); @@ -384,7 +277,7 @@ void PDSS::reportParams(size_t& kindex, int& type, doublereal& refPressure_) const { kindex = m_spindex; - type = m_pdssType; + type = 0; minTemp_ = m_minTemp; maxTemp_ = m_maxTemp; refPressure_ = m_p0; diff --git a/src/thermo/PDSS_ConstVol.cpp b/src/thermo/PDSS_ConstVol.cpp index 5dffbe928..7d776693c 100644 --- a/src/thermo/PDSS_ConstVol.cpp +++ b/src/thermo/PDSS_ConstVol.cpp @@ -18,17 +18,6 @@ namespace Cantera PDSS_ConstVol::PDSS_ConstVol(VPStandardStateTP* tp, size_t spindex) : PDSS(tp, spindex) { - m_pdssType = cPDSS_CONSTVOL; -} - -PDSS_ConstVol::PDSS_ConstVol(VPStandardStateTP* tp, size_t spindex, - const std::string& inputFile, const std::string& id) : - PDSS(tp, spindex) -{ - warn_deprecated("PDSS_ConstVol constructor from XML input file", - "To be removed after Cantera 2.3."); - m_pdssType = cPDSS_CONSTVOL; - constructPDSSFile(tp, spindex, inputFile, id); } PDSS_ConstVol::PDSS_ConstVol(VPStandardStateTP* tp, size_t spindex, @@ -37,33 +26,9 @@ PDSS_ConstVol::PDSS_ConstVol(VPStandardStateTP* tp, size_t spindex, bool spInstalled) : PDSS(tp, spindex) { - m_pdssType = cPDSS_CONSTVOL; constructPDSSXML(tp, spindex, speciesNode, phaseRoot, spInstalled); } -PDSS_ConstVol::PDSS_ConstVol(const PDSS_ConstVol& b) : - PDSS(b) -{ - // Use the assignment operator to do the brunt of the work for the copy - // constructor. - *this = b; -} - -PDSS_ConstVol& PDSS_ConstVol::operator=(const PDSS_ConstVol& b) -{ - if (&b == this) { - return *this; - } - PDSS::operator=(b); - m_constMolarVolume = b.m_constMolarVolume; - return *this; -} - -PDSS* PDSS_ConstVol::duplMyselfAsPDSS() const -{ - return new PDSS_ConstVol(*this); -} - void PDSS_ConstVol::constructPDSSXML(VPStandardStateTP* tp, size_t spindex, const XML_Node& speciesNode, const XML_Node& phaseNode, bool spInstalled) @@ -88,35 +53,6 @@ void PDSS_ConstVol::constructPDSSXML(VPStandardStateTP* tp, size_t spindex, m_constMolarVolume = getFloat(*ss, "molarVolume", "toSI"); } -void PDSS_ConstVol::constructPDSSFile(VPStandardStateTP* tp, size_t spindex, - const std::string& inputFile, - const std::string& id) -{ - warn_deprecated("PDSS_ConstVol::constructPDSSFile", - "To be removed after Cantera 2.3."); - if (inputFile.size() == 0) { - throw CanteraError("PDSS_ConstVol::initThermo", - "input file is null"); - } - - // The phase object automatically constructs an XML object. Use this object - // to store information. - XML_Node fxml; - fxml.build(findInputFile(inputFile)); - XML_Node* fxml_phase = findXMLPhase(&fxml, id); - if (!fxml_phase) { - throw CanteraError("PDSS_ConstVol::initThermo", - "ERROR: Can not find phase named " + - id + " in file named " + inputFile); - } - - XML_Node& speciesList = fxml_phase->child("speciesArray"); - XML_Node* speciesDB = get_XML_NameID("speciesData", speciesList["datasrc"], - &fxml_phase->root()); - const XML_Node* s = speciesDB->findByAttr("name", tp->speciesName(spindex)); - constructPDSSXML(tp, spindex, *s, *fxml_phase, true); -} - void PDSS_ConstVol::initThermoXML(const XML_Node& phaseNode, const std::string& id) { PDSS::initThermoXML(phaseNode, id); diff --git a/src/thermo/PDSS_HKFT.cpp b/src/thermo/PDSS_HKFT.cpp index d20a6ec2b..1780646e7 100644 --- a/src/thermo/PDSS_HKFT.cpp +++ b/src/thermo/PDSS_HKFT.cpp @@ -46,44 +46,10 @@ PDSS_HKFT::PDSS_HKFT(VPStandardStateTP* tp, size_t spindex) : m_charge_j(0.0) { m_pres = OneAtm; - m_pdssType = cPDSS_MOLAL_HKFT; m_presR_bar = OneAtm * 1.0E-5; m_presR_bar = 1.0; } -PDSS_HKFT::PDSS_HKFT(VPStandardStateTP* tp, size_t spindex, - const std::string& inputFile, const std::string& id) : - PDSS(tp, spindex), - m_waterSS(0), - m_densWaterSS(-1.0), - m_born_coeff_j(-1.0), - m_r_e_j(-1.0), - m_deltaG_formation_tr_pr(0.0), - m_deltaH_formation_tr_pr(0.0), - m_Mu0_tr_pr(0.0), - m_Entrop_tr_pr(0.0), - m_a1(0.0), - m_a2(0.0), - m_a3(0.0), - m_a4(0.0), - m_c1(0.0), - m_c2(0.0), - m_omega_pr_tr(0.0), - m_Y_pr_tr(0.0), - m_Z_pr_tr(0.0), - m_presR_bar(1.0), - m_domega_jdT_prtr(0.0), - m_charge_j(0.0) -{ - warn_deprecated("PDSS_HKFT constructor from XML input file", - "To be removed after Cantera 2.3."); - m_pres = OneAtm; - m_pdssType = cPDSS_MOLAL_HKFT; - m_presR_bar = OneAtm * 1.0E-5; - m_presR_bar = 1.0; - constructPDSSFile(tp, spindex, inputFile, id); -} - PDSS_HKFT::PDSS_HKFT(VPStandardStateTP* tp, size_t spindex, const XML_Node& speciesNode, const XML_Node& phaseRoot, bool spInstalled) : PDSS(tp, spindex), @@ -109,91 +75,16 @@ PDSS_HKFT::PDSS_HKFT(VPStandardStateTP* tp, size_t spindex, const XML_Node& spec m_charge_j(0.0) { m_pres = OneAtm; - m_pdssType = cPDSS_MOLAL_HKFT; m_presR_bar = OneAtm * 1.0E-5; m_presR_bar = 1.0; // We have to read the info from here constructPDSSXML(tp, spindex, speciesNode, phaseRoot, spInstalled); } -PDSS_HKFT::PDSS_HKFT(const PDSS_HKFT& b) : - PDSS(b), - m_waterSS(0), - m_densWaterSS(-1.0), - m_born_coeff_j(-1.0), - m_r_e_j(-1.0), - m_deltaG_formation_tr_pr(0.0), - m_deltaH_formation_tr_pr(0.0), - m_Mu0_tr_pr(0.0), - m_Entrop_tr_pr(0.0), - m_a1(0.0), - m_a2(0.0), - m_a3(0.0), - m_a4(0.0), - m_c1(0.0), - m_c2(0.0), - m_omega_pr_tr(0.0), - m_Y_pr_tr(0.0), - m_Z_pr_tr(0.0), - m_presR_bar(0.0), - m_domega_jdT_prtr(0.0), - m_charge_j(0.0) -{ - m_pdssType = cPDSS_MOLAL_HKFT; - m_presR_bar = OneAtm * 1.0E-5; - - // Use the assignment operator to do the brunt of the work for the copy - // constructor. - *this = b; -} - -PDSS_HKFT& PDSS_HKFT::operator=(const PDSS_HKFT& b) -{ - if (&b == this) { - return *this; - } - // Call the base class operator - PDSS::operator=(b); - - // Need to call initAllPtrs AFTER, to get the correct m_waterSS - m_waterSS = 0; - m_densWaterSS = b.m_densWaterSS; - // Need to call initAllPtrs AFTER, to get the correct m_waterProps - m_born_coeff_j = b.m_born_coeff_j; - m_r_e_j = b.m_r_e_j; - m_deltaG_formation_tr_pr = b.m_deltaG_formation_tr_pr; - m_deltaH_formation_tr_pr = b.m_deltaH_formation_tr_pr; - m_Mu0_tr_pr = b.m_Mu0_tr_pr; - m_Entrop_tr_pr = b.m_Entrop_tr_pr; - m_a1 = b.m_a1; - m_a2 = b.m_a2; - m_a3 = b.m_a3; - m_a4 = b.m_a4; - m_c1 = b.m_c1; - m_c2 = b.m_c2; - m_omega_pr_tr = b.m_omega_pr_tr; - m_Y_pr_tr = b.m_Y_pr_tr; - m_Z_pr_tr = b.m_Z_pr_tr; - m_presR_bar = b.m_presR_bar; - m_domega_jdT_prtr = b.m_domega_jdT_prtr; - m_charge_j = b.m_charge_j; - - // Here we just fill these in so that local copies within the VPSS object work. - m_waterSS = b.m_waterSS; - m_waterProps.reset(new WaterProps(m_waterSS)); - - return *this; -} - PDSS_HKFT::~PDSS_HKFT() { } -PDSS* PDSS_HKFT::duplMyselfAsPDSS() const -{ - return new PDSS_HKFT(*this); -} - doublereal PDSS_HKFT::enthalpy_mole() const { // Ok we may change this evaluation method in the future. @@ -442,14 +333,6 @@ void PDSS_HKFT::initThermo() } } -void PDSS_HKFT::initAllPtrs(VPStandardStateTP* vptp_ptr, VPSSMgr* vpssmgr_ptr, - MultiSpeciesThermo* spthermo_ptr) -{ - PDSS::initAllPtrs(vptp_ptr, vpssmgr_ptr, spthermo_ptr); - m_waterSS = &dynamic_cast(*m_tp->providePDSS(0)); - m_waterProps.reset(new WaterProps(m_waterSS)); -} - void PDSS_HKFT::constructPDSSXML(VPStandardStateTP* tp, size_t spindex, const XML_Node& speciesNode, const XML_Node& phaseNode, bool spInstalled) @@ -593,35 +476,6 @@ void PDSS_HKFT::constructPDSSXML(VPStandardStateTP* tp, size_t spindex, } } -void PDSS_HKFT::constructPDSSFile(VPStandardStateTP* tp, size_t spindex, - const std::string& inputFile, - const std::string& id) -{ - warn_deprecated("PDSS_HKFT::constructPDSSFile", - "To be removed after Cantera 2.3."); - if (inputFile.size() == 0) { - throw CanteraError("PDSS_HKFT::initThermo", - "input file is null"); - } - - // The phase object automatically constructs an XML object. Use this object - // to store information. - XML_Node fxml; - fxml.build(findInputFile(inputFile)); - XML_Node* fxml_phase = findXMLPhase(&fxml, id); - if (!fxml_phase) { - throw CanteraError("PDSS_HKFT::initThermo", - "ERROR: Can not find phase named " + - id + " in file named " + inputFile); - } - - XML_Node& speciesList = fxml_phase->child("speciesArray"); - XML_Node* speciesDB = get_XML_NameID("speciesData", speciesList["datasrc"], - &fxml_phase->root()); - const XML_Node* s = speciesDB->findByAttr("name", tp->speciesName(spindex)); - constructPDSSXML(tp, spindex, *s, *fxml_phase, true); -} - doublereal PDSS_HKFT::deltaH() const { doublereal pbar = m_pres * 1.0E-5; diff --git a/src/thermo/PDSS_IdealGas.cpp b/src/thermo/PDSS_IdealGas.cpp index ccef0749a..d14ebcab7 100644 --- a/src/thermo/PDSS_IdealGas.cpp +++ b/src/thermo/PDSS_IdealGas.cpp @@ -18,17 +18,6 @@ namespace Cantera PDSS_IdealGas::PDSS_IdealGas(VPStandardStateTP* tp, int spindex) : PDSS(tp, spindex) { - m_pdssType = cPDSS_IDEALGAS; -} - -PDSS_IdealGas::PDSS_IdealGas(VPStandardStateTP* tp, int spindex, - const std::string& inputFile, const std::string& id) : - PDSS(tp, spindex) -{ - warn_deprecated("PDSS_IdealGas constructor from XML input file", - "To be removed after Cantera 2.3."); - m_pdssType = cPDSS_IDEALGAS; - constructPDSSFile(tp, spindex, inputFile, id); } PDSS_IdealGas::PDSS_IdealGas(VPStandardStateTP* tp, size_t spindex, const XML_Node& speciesNode, @@ -38,61 +27,14 @@ PDSS_IdealGas::PDSS_IdealGas(VPStandardStateTP* tp, size_t spindex, const XML_No if (!spInstalled) { throw CanteraError("PDSS_IdealGas", "sp installing not done yet"); } - m_pdssType = cPDSS_IDEALGAS; constructPDSSXML(tp, spindex, phaseRoot, ""); } -PDSS_IdealGas::PDSS_IdealGas(const PDSS_IdealGas& b) : - PDSS(b) -{ - // Use the assignment operator to do the brunt of the work for the copy - // constructor. - *this = b; -} - -PDSS_IdealGas& PDSS_IdealGas::operator=(const PDSS_IdealGas& b) -{ - if (&b == this) { - return *this; - } - PDSS::operator=(b); - return *this; -} - -PDSS* PDSS_IdealGas::duplMyselfAsPDSS() const -{ - return new PDSS_IdealGas(*this); -} - void PDSS_IdealGas::constructPDSSXML(VPStandardStateTP* tp, size_t spindex, const XML_Node& phaseNode, const std::string& id) { } -void PDSS_IdealGas::constructPDSSFile(VPStandardStateTP* tp, size_t spindex, - const std::string& inputFile, - const std::string& id) -{ - warn_deprecated("PDSS_IdealGas::constructPDSSFile", - "To be removed after Cantera 2.3."); - if (inputFile.size() == 0) { - throw CanteraError("PDSS_IdealGas::constructPDSSFile", - "input file is null"); - } - - // The phase object automatically constructs an XML object. Use this object - // to store information. - XML_Node fxml; - fxml.build(findInputFile(inputFile)); - XML_Node* fxml_phase = findXMLPhase(&fxml, id); - if (!fxml_phase) { - throw CanteraError("PDSS_IdealGas::constructPDSSFile", - "ERROR: Can not find phase named " + - id + " in file named " + inputFile); - } - constructPDSSXML(tp, spindex, *fxml_phase, id); -} - void PDSS_IdealGas::initThermo() { PDSS::initThermo(); diff --git a/src/thermo/PDSS_IonsFromNeutral.cpp b/src/thermo/PDSS_IonsFromNeutral.cpp index c06a7ed7f..c3bcf29f9 100644 --- a/src/thermo/PDSS_IonsFromNeutral.cpp +++ b/src/thermo/PDSS_IonsFromNeutral.cpp @@ -23,21 +23,6 @@ PDSS_IonsFromNeutral::PDSS_IonsFromNeutral(VPStandardStateTP* tp, size_t spindex add2RTln2_(true), specialSpecies_(0) { - m_pdssType = cPDSS_IONSFROMNEUTRAL; -} - -PDSS_IonsFromNeutral::PDSS_IonsFromNeutral(VPStandardStateTP* tp, size_t spindex, - const std::string& inputFile, const std::string& id) : - PDSS(tp, spindex), - neutralMoleculePhase_(0), - numMult_(0), - add2RTln2_(true), - specialSpecies_(0) -{ - warn_deprecated("PDSS_IonsFromNeutral constructor from XML input file", - "To be removed after Cantera 2.3."); - m_pdssType = cPDSS_IONSFROMNEUTRAL; - constructPDSSFile(tp, spindex, inputFile, id); } PDSS_IonsFromNeutral::PDSS_IonsFromNeutral(VPStandardStateTP* tp, size_t spindex, const XML_Node& speciesNode, @@ -51,59 +36,10 @@ PDSS_IonsFromNeutral::PDSS_IonsFromNeutral(VPStandardStateTP* tp, size_t spindex if (!spInstalled) { throw CanteraError("PDSS_IonsFromNeutral", "sp installing not done yet"); } - m_pdssType = cPDSS_IONSFROMNEUTRAL; std::string id = ""; constructPDSSXML(tp, spindex, speciesNode, phaseRoot, id); } -PDSS_IonsFromNeutral::PDSS_IonsFromNeutral(const PDSS_IonsFromNeutral& b) : - PDSS(b) -{ - // Use the assignment operator to do the brunt of the work for the copy - // constructor. - *this = b; -} - -PDSS_IonsFromNeutral& PDSS_IonsFromNeutral::operator=(const PDSS_IonsFromNeutral& b) -{ - if (&b == this) { - return *this; - } - - PDSS::operator=(b); - - // The shallow pointer copy in the next step will be insufficient in most - // cases. However, its functionally the best we can do for this assignment - // operator. We fix up the pointer in the initAllPtrs() function. - neutralMoleculePhase_ = b.neutralMoleculePhase_; - - numMult_ = b.numMult_; - idNeutralMoleculeVec = b.idNeutralMoleculeVec; - factorVec = b.factorVec; - add2RTln2_ = b.add2RTln2_; - tmpNM = b.tmpNM; - specialSpecies_ = b.specialSpecies_; - - return *this; -} - -PDSS* PDSS_IonsFromNeutral::duplMyselfAsPDSS() const -{ - return new PDSS_IonsFromNeutral(*this); -} - -void PDSS_IonsFromNeutral::initAllPtrs(VPStandardStateTP* tp, VPSSMgr* vpssmgr_ptr, - MultiSpeciesThermo* spthermo) -{ - PDSS::initAllPtrs(tp, vpssmgr_ptr, spthermo); - - IonsFromNeutralVPSSTP* ionPhase = dynamic_cast(tp); - if (!ionPhase) { - throw CanteraError("PDSS_IonsFromNeutral::initAllPts", "Dynamic cast failed"); - } - neutralMoleculePhase_ = ionPhase->neutralMoleculePhase_; -} - void PDSS_IonsFromNeutral::constructPDSSXML(VPStandardStateTP* tp, size_t spindex, const XML_Node& speciesNode, const XML_Node& phaseNode, const std::string& id) @@ -155,34 +91,6 @@ void PDSS_IonsFromNeutral::constructPDSSXML(VPStandardStateTP* tp, size_t spinde } } -void PDSS_IonsFromNeutral::constructPDSSFile(VPStandardStateTP* tp, size_t spindex, - const std::string& inputFile, const std::string& id) -{ - warn_deprecated("PDSS_IonsFromNeutral::constructPDSSFile", - "To be removed after Cantera 2.3."); - if (inputFile.size() == 0) { - throw CanteraError("PDSS_IonsFromNeutral::constructPDSSFile", - "input file is null"); - } - - // The phase object automatically constructs an XML object. Use this object - // to store information. - XML_Node fxml; - fxml.build(findInputFile(inputFile)); - XML_Node* fxml_phase = findXMLPhase(&fxml, id); - if (!fxml_phase) { - throw CanteraError("PDSS_IonsFromNeutral::constructPDSSFile", - "ERROR: Can not find phase named " + - id + " in file named " + inputFile); - } - - XML_Node& speciesList = fxml_phase->child("speciesArray"); - XML_Node* speciesDB = get_XML_NameID("speciesData", speciesList["datasrc"], - &fxml_phase->root()); - const XML_Node* s = speciesDB->findByAttr("name", tp->speciesName(spindex)); - constructPDSSXML(tp, spindex, *s, *fxml_phase, id); -} - void PDSS_IonsFromNeutral::initThermo() { PDSS::initThermo(); diff --git a/src/thermo/PDSS_SSVol.cpp b/src/thermo/PDSS_SSVol.cpp index b0ed0eb84..ddcc72aee 100644 --- a/src/thermo/PDSS_SSVol.cpp +++ b/src/thermo/PDSS_SSVol.cpp @@ -20,24 +20,11 @@ PDSS_SSVol::PDSS_SSVol(VPStandardStateTP* tp, size_t spindex) : volumeModel_(SSVolume_Model::constant), m_constMolarVolume(-1.0) { - m_pdssType = cPDSS_SSVOL; TCoeff_[0] = 0.0; TCoeff_[1] = 0.0; TCoeff_[2] = 0.0; } -PDSS_SSVol::PDSS_SSVol(VPStandardStateTP* tp, - size_t spindex, const std::string& inputFile, const std::string& id) : - PDSS(tp, spindex), - volumeModel_(SSVolume_Model::constant), - m_constMolarVolume(-1.0) -{ - warn_deprecated("PDSS_SSVol constructor from XML input file", - "To be removed after Cantera 2.3."); - m_pdssType = cPDSS_SSVOL; - constructPDSSFile(tp, spindex, inputFile, id); -} - PDSS_SSVol::PDSS_SSVol(VPStandardStateTP* tp, size_t spindex, const XML_Node& speciesNode, const XML_Node& phaseRoot, @@ -46,37 +33,9 @@ PDSS_SSVol::PDSS_SSVol(VPStandardStateTP* tp, size_t spindex, volumeModel_(SSVolume_Model::constant), m_constMolarVolume(-1.0) { - m_pdssType = cPDSS_SSVOL; constructPDSSXML(tp, spindex, speciesNode, phaseRoot, spInstalled); } -PDSS_SSVol::PDSS_SSVol(const PDSS_SSVol& b) : - PDSS(b), - volumeModel_(SSVolume_Model::constant), - m_constMolarVolume(-1.0) -{ - // Use the assignment operator to do the brunt of the work for the copy - // constructor. - *this = b; -} - -PDSS_SSVol& PDSS_SSVol::operator=(const PDSS_SSVol& b) -{ - if (&b == this) { - return *this; - } - PDSS::operator=(b); - volumeModel_ = b.volumeModel_; - m_constMolarVolume = b.m_constMolarVolume; - TCoeff_ = b.TCoeff_; - return *this; -} - -PDSS* PDSS_SSVol::duplMyselfAsPDSS() const -{ - return new PDSS_SSVol(*this); -} - void PDSS_SSVol::constructPDSSXML(VPStandardStateTP* tp, size_t spindex, const XML_Node& speciesNode, const XML_Node& phaseNode, bool spInstalled) @@ -117,34 +76,6 @@ void PDSS_SSVol::constructPDSSXML(VPStandardStateTP* tp, size_t spindex, } } -void PDSS_SSVol::constructPDSSFile(VPStandardStateTP* tp, size_t spindex, - const std::string& inputFile, const std::string& id) -{ - warn_deprecated("PDSS_SSVol::constructPDSSFile", - "To be removed after Cantera 2.3."); - if (inputFile.size() == 0) { - throw CanteraError("PDSS_SSVol::initThermo", - "input file is null"); - } - - // The phase object automatically constructs an XML object. Use this object - // to store information. - XML_Node fxml; - fxml.build(findInputFile(inputFile)); - XML_Node* fxml_phase = findXMLPhase(&fxml, id); - if (!fxml_phase) { - throw CanteraError("PDSS_SSVol::initThermo", - "ERROR: Can not find phase named " + - id + " in file named " + inputFile); - } - - XML_Node& speciesList = fxml_phase->child("speciesArray"); - XML_Node* speciesDB = get_XML_NameID("speciesData", speciesList["datasrc"], - &fxml_phase->root()); - const XML_Node* s = speciesDB->findByAttr("name", tp->speciesName(spindex)); - constructPDSSXML(tp, spindex, *s, *fxml_phase, true); -} - void PDSS_SSVol::initThermoXML(const XML_Node& phaseNode, const std::string& id) { PDSS::initThermoXML(phaseNode, id); diff --git a/src/thermo/PDSS_Water.cpp b/src/thermo/PDSS_Water.cpp index 34655aae8..b46d43053 100644 --- a/src/thermo/PDSS_Water.cpp +++ b/src/thermo/PDSS_Water.cpp @@ -21,7 +21,6 @@ PDSS_Water::PDSS_Water() : m_verbose(0), m_allowGasPhase(false) { - m_pdssType = cPDSS_WATER; m_spthermo = 0; constructSet(); m_minTemp = 200.; @@ -38,33 +37,12 @@ PDSS_Water::PDSS_Water(VPStandardStateTP* tp, int spindex) : m_verbose(0), m_allowGasPhase(false) { - m_pdssType = cPDSS_WATER; m_spthermo = 0; constructSet(); m_minTemp = 200.; m_maxTemp = 10000.; } -PDSS_Water::PDSS_Water(VPStandardStateTP* tp, int spindex, - const std::string& inputFile, const std::string& id) : - PDSS(tp, spindex), - m_waterProps(&m_sub), - m_dens(1000.0), - m_iState(WATER_LIQUID), - EW_Offset(0.0), - SW_Offset(0.0), - m_verbose(0), - m_allowGasPhase(false) -{ - warn_deprecated("PDSS_Water constructor from XML input file", - "To be removed after Cantera 2.3."); - m_pdssType = cPDSS_WATER; - constructPDSSFile(tp, spindex, inputFile, id); - m_spthermo = 0; - m_minTemp = 200.; - m_maxTemp = 10000.; -} - PDSS_Water::PDSS_Water(VPStandardStateTP* tp, int spindex, const XML_Node& speciesNode, const XML_Node& phaseRoot, bool spInstalled) : @@ -77,7 +55,6 @@ PDSS_Water::PDSS_Water(VPStandardStateTP* tp, int spindex, m_verbose(0), m_allowGasPhase(false) { - m_pdssType = cPDSS_WATER; std::string id= ""; constructPDSSXML(tp, spindex, phaseRoot, id); initThermo(); @@ -86,75 +63,12 @@ PDSS_Water::PDSS_Water(VPStandardStateTP* tp, int spindex, m_maxTemp = 10000.; } -PDSS_Water::PDSS_Water(const PDSS_Water& b) : - PDSS(), - m_waterProps(&m_sub), - m_dens(1000.0), - m_iState(WATER_LIQUID), - EW_Offset(b.EW_Offset), - SW_Offset(b.SW_Offset), - m_verbose(b.m_verbose), - m_allowGasPhase(b.m_allowGasPhase) -{ - // Use the assignment operator to do the brunt of the work for the copy - // constructor. - *this = b; -} - -PDSS_Water& PDSS_Water::operator=(const PDSS_Water& b) -{ - if (&b == this) { - return *this; - } - // Call the base class operator - PDSS::operator=(b); - - m_sub = b.m_sub; - m_waterProps = b.m_waterProps; - m_dens = b.m_dens; - m_iState = b.m_iState; - EW_Offset = b.EW_Offset; - SW_Offset = b.SW_Offset; - m_verbose = b.m_verbose; - m_allowGasPhase = b.m_allowGasPhase; - - return *this; -} - -PDSS* PDSS_Water::duplMyselfAsPDSS() const -{ - return new PDSS_Water(*this); -} - void PDSS_Water::constructPDSSXML(VPStandardStateTP* tp, int spindex, const XML_Node& phaseNode, const std::string& id) { constructSet(); } -void PDSS_Water::constructPDSSFile(VPStandardStateTP* tp, int spindex, - const std::string& inputFile, const std::string& id) -{ - warn_deprecated("PDSS_Water::constructPDSSFile", - "To be removed after Cantera 2.3."); - if (inputFile.size() == 0) { - throw CanteraError("PDSS_Water::constructPDSSFile", - "input file is null"); - } - - // The phase object automatically constructs an XML object. Use this object - // to store information. - XML_Node fxml; - fxml.build(findInputFile(inputFile)); - XML_Node* fxml_phase = findXMLPhase(&fxml, id); - if (!fxml_phase) { - throw CanteraError("PDSS_Water::initThermo", - "ERROR: Can not find phase named " + - id + " in file named " + inputFile); - } - constructPDSSXML(tp, spindex, *fxml_phase, id); -} - void PDSS_Water::constructSet() { // Calculate the molecular weight. hard coded to Cantera's elements and diff --git a/src/thermo/Phase.cpp b/src/thermo/Phase.cpp index 0c1e3a9b4..d9c9a1a38 100644 --- a/src/thermo/Phase.cpp +++ b/src/thermo/Phase.cpp @@ -32,79 +32,6 @@ Phase::Phase() : { } -Phase::Phase(const Phase& right) : - m_kk(0), - m_ndim(3), - m_undefinedElementBehavior(right.m_undefinedElementBehavior), - m_xml(0), - m_id(""), - m_temp(0.001), - m_dens(0.001), - m_mmw(0.0), - m_stateNum(-1), - m_mm(0), - m_elem_type(0) -{ - // Use the assignment operator to do the actual copying - operator=(right); -} - -Phase& Phase::operator=(const Phase& right) -{ - // Check for self assignment. - if (this == &right) { - return *this; - } - - // Handle our own data - m_kk = right.m_kk; - m_ndim = right.m_ndim; - m_undefinedElementBehavior = right.m_undefinedElementBehavior; - m_temp = right.m_temp; - m_dens = right.m_dens; - m_mmw = right.m_mmw; - m_ym = right.m_ym; - m_y = right.m_y; - m_molwts = right.m_molwts; - m_rmolwts = right.m_rmolwts; - m_stateNum = -1; - - m_speciesNames = right.m_speciesNames; - m_speciesComp = right.m_speciesComp; - m_speciesCharge = right.m_speciesCharge; - m_speciesSize = right.m_speciesSize; - m_mm = right.m_mm; - m_atomicWeights = right.m_atomicWeights; - m_atomicNumbers = right.m_atomicNumbers; - m_elementNames = right.m_elementNames; - m_entropy298 = right.m_entropy298; - m_elem_type = right.m_elem_type; - - // This is a little complicated. -> Because we delete m_xml in the - // destructor, we own m_xml completely, and we need to have our own - // individual copies of the XML data tree in each object - if (m_xml) { - XML_Node* rroot = &m_xml->root(); - delete rroot; - m_xml = 0; - } - if (right.m_xml) { - XML_Node *rroot = &right.m_xml->root(); - XML_Node *root_xml = new XML_Node(); - rroot->copy(root_xml); - m_xml = findXMLPhase(root_xml, right.m_xml->id()); - if (!m_xml) { - throw CanteraError("Phase::operator=()", "Confused: Couldn't find original phase " + right.m_xml->id()); - } - if (&m_xml->root() != root_xml) { - throw CanteraError("Phase::operator=()", "confused: root changed"); - } - } - m_id = right.m_id; - m_name = right.m_name; - return *this; -} - Phase::~Phase() { if (m_xml) { diff --git a/src/thermo/PhaseCombo_Interaction.cpp b/src/thermo/PhaseCombo_Interaction.cpp index c342c9633..616afdffc 100644 --- a/src/thermo/PhaseCombo_Interaction.cpp +++ b/src/thermo/PhaseCombo_Interaction.cpp @@ -39,54 +39,6 @@ PhaseCombo_Interaction::PhaseCombo_Interaction(XML_Node& phaseRoot, importPhase(phaseRoot, this); } -PhaseCombo_Interaction::PhaseCombo_Interaction(const PhaseCombo_Interaction& b) -{ - PhaseCombo_Interaction::operator=(b); -} - -PhaseCombo_Interaction& PhaseCombo_Interaction::operator=(const PhaseCombo_Interaction& b) -{ - if (&b == this) { - return *this; - } - - GibbsExcessVPSSTP::operator=(b); - - numBinaryInteractions_ = b.numBinaryInteractions_; - m_HE_b_ij = b.m_HE_b_ij; - m_HE_c_ij = b.m_HE_c_ij; - m_HE_d_ij = b.m_HE_d_ij; - m_SE_b_ij = b.m_SE_b_ij; - m_SE_c_ij = b.m_SE_c_ij; - m_SE_d_ij = b.m_SE_d_ij; - m_VHE_b_ij = b.m_VHE_b_ij; - m_VHE_c_ij = b.m_VHE_c_ij; - m_VHE_d_ij = b.m_VHE_d_ij; - m_VSE_b_ij = b.m_VSE_b_ij; - m_VSE_c_ij = b.m_VSE_c_ij; - m_VSE_d_ij = b.m_VSE_d_ij; - m_pSpecies_A_ij = b.m_pSpecies_A_ij; - m_pSpecies_B_ij = b.m_pSpecies_B_ij; - formMargules_ = b.formMargules_; - formTempModel_ = b.formTempModel_; - - return *this; -} - -ThermoPhase* PhaseCombo_Interaction::duplMyselfAsThermoPhase() const -{ - return new PhaseCombo_Interaction(*this); -} - -// -------------- Utilities ------------------------------- - -int PhaseCombo_Interaction::eosType() const -{ - warn_deprecated("PhaseCombo_Interaction::eosType", - "To be removed after Cantera 2.3."); - return cPhaseCombo_Interaction; -} - // - Activities, Standard States, Activity Concentrations ----------- void PhaseCombo_Interaction::getActivityCoefficients(doublereal* ac) const diff --git a/src/thermo/PureFluidPhase.cpp b/src/thermo/PureFluidPhase.cpp index 621da2356..dd51006a0 100644 --- a/src/thermo/PureFluidPhase.cpp +++ b/src/thermo/PureFluidPhase.cpp @@ -29,31 +29,6 @@ PureFluidPhase::PureFluidPhase() : { } -PureFluidPhase::PureFluidPhase(const PureFluidPhase& right) : - m_subflag(0), - m_mw(-1.0), - m_verbose(false) -{ - *this = right; -} - -PureFluidPhase& PureFluidPhase::operator=(const PureFluidPhase& right) -{ - if (&right != this) { - ThermoPhase::operator=(right); - m_subflag = right.m_subflag; - m_sub.reset(tpx::GetSub(m_subflag)); - m_mw = right.m_mw; - m_verbose = right.m_verbose; - } - return *this; -} - -ThermoPhase* PureFluidPhase::duplMyselfAsThermoPhase() const -{ - return new PureFluidPhase(*this); -} - void PureFluidPhase::initThermo() { if (m_tpx_name != "") { diff --git a/src/thermo/RedlichKisterVPSSTP.cpp b/src/thermo/RedlichKisterVPSSTP.cpp index 27d7d02c9..8d352055d 100644 --- a/src/thermo/RedlichKisterVPSSTP.cpp +++ b/src/thermo/RedlichKisterVPSSTP.cpp @@ -43,40 +43,6 @@ RedlichKisterVPSSTP::RedlichKisterVPSSTP(XML_Node& phaseRoot, importPhase(phaseRoot, this); } -RedlichKisterVPSSTP::RedlichKisterVPSSTP(const RedlichKisterVPSSTP& b) : - numBinaryInteractions_(0), - formRedlichKister_(0), - formTempModel_(0) -{ - RedlichKisterVPSSTP::operator=(b); -} - -RedlichKisterVPSSTP& RedlichKisterVPSSTP::operator=(const RedlichKisterVPSSTP& b) -{ - if (&b == this) { - return *this; - } - - GibbsExcessVPSSTP::operator=(b); - - numBinaryInteractions_ = b.numBinaryInteractions_; - m_pSpecies_A_ij = b.m_pSpecies_A_ij; - m_pSpecies_B_ij = b.m_pSpecies_B_ij; - m_N_ij = b.m_N_ij; - m_HE_m_ij = b.m_HE_m_ij; - m_SE_m_ij = b.m_SE_m_ij; - formRedlichKister_ = b.formRedlichKister_; - formTempModel_ = b.formTempModel_; - dlnActCoeff_dX_ = b.dlnActCoeff_dX_; - - return *this; -} - -ThermoPhase* RedlichKisterVPSSTP::duplMyselfAsThermoPhase() const -{ - return new RedlichKisterVPSSTP(*this); -} - // - Activities, Standard States, Activity Concentrations ----------- void RedlichKisterVPSSTP::getLnActivityCoefficients(doublereal* lnac) const @@ -609,47 +575,4 @@ void RedlichKisterVPSSTP::readXMLBinarySpecies(XML_Node& xmLBinarySpecies) resizeNumInteractions(numBinaryInteractions_); } -void RedlichKisterVPSSTP::Vint(double& VintOut, double& voltsOut) -{ - warn_deprecated("RedlichKisterVPSSTP::Vint", - "To be removed after Cantera 2.3."); - double XA = 0; - doublereal T = temperature(); - double Volts = 0.0; - lnActCoeff_Scaled_.assign(m_kk, 0.0); - - for (size_t i = 0; i < numBinaryInteractions_; i++) { - size_t iA = m_pSpecies_A_ij[i]; - XA = moleFractions_[iA]; - if (XA <= 1.0E-14) { - XA = 1.0E-14; - } - if (XA >= (1.0 - 1.0E-14)) { - XA = 1.0 - 1.0E-14; - } - - size_t N = m_N_ij[i]; - vector_fp& he_vec = m_HE_m_ij[i]; - vector_fp& se_vec = m_SE_m_ij[i]; - double fac = 2.0 * XA - 1.0; - if (fabs(fac) < 1.0E-13) { - fac = 1.0E-13; - } - double polykp1 = fac; - double poly1mk = fac; - - for (size_t m = 0; m < N; m++) { - doublereal A_ge = he_vec[m] - T * se_vec[m]; - Volts += A_ge * (polykp1 - (2.0 * XA * m * (1.0-XA)) / poly1mk); - polykp1 *= fac; - poly1mk /= fac; - } - } - Volts /= Faraday; - - double termp = GasConstant * T * log((1.0 - XA)/XA) / Faraday; - VintOut = Volts; - voltsOut = Volts + termp; -} - } diff --git a/src/thermo/RedlichKwongMFTP.cpp b/src/thermo/RedlichKwongMFTP.cpp index 5e6550f27..c19fc72a0 100644 --- a/src/thermo/RedlichKwongMFTP.cpp +++ b/src/thermo/RedlichKwongMFTP.cpp @@ -4,7 +4,6 @@ // at http://www.cantera.org/license.txt for license and copyright information. #include "cantera/thermo/RedlichKwongMFTP.h" -#include "cantera/thermo/mix_defs.h" #include "cantera/thermo/ThermoFactory.h" #include "cantera/base/stringUtils.h" #include "cantera/base/ctml.h" @@ -56,58 +55,6 @@ RedlichKwongMFTP::RedlichKwongMFTP(XML_Node& phaseRefRoot, const std::string& id importPhase(phaseRefRoot, this); } -RedlichKwongMFTP::RedlichKwongMFTP(const RedlichKwongMFTP& b) : - m_formTempParam(0), - m_b_current(0.0), - m_a_current(0.0), - NSolns_(0), - dpdV_(0.0), - dpdT_(0.0) -{ - *this = b; -} - -RedlichKwongMFTP& RedlichKwongMFTP::operator=(const RedlichKwongMFTP& b) -{ - if (&b != this) { - // Mostly, this is a passthrough to the underlying assignment operator - // for the ThermoPhae parent object. - MixtureFugacityTP::operator=(b); - - // However, we have to handle data that we own. - m_formTempParam = b.m_formTempParam; - m_b_current = b.m_b_current; - m_a_current = b.m_a_current; - a_vec_Curr_ = b.a_vec_Curr_; - b_vec_Curr_ = b.b_vec_Curr_; - a_coeff_vec = b.a_coeff_vec; - - NSolns_ = b.NSolns_; - Vroot_[0] = b.Vroot_[0]; - Vroot_[1] = b.Vroot_[1]; - Vroot_[2] = b.Vroot_[2]; - m_pp = b.m_pp; - m_tmpV = b.m_tmpV; - m_partialMolarVolumes = b.m_partialMolarVolumes; - dpdV_ = b.dpdV_; - dpdT_ = b.dpdT_; - dpdni_ = b.dpdni_; - } - return *this; -} - -ThermoPhase* RedlichKwongMFTP::duplMyselfAsThermoPhase() const -{ - return new RedlichKwongMFTP(*this); -} - -int RedlichKwongMFTP::eosType() const -{ - warn_deprecated("RedlichKwongMFTP::eosType", - "To be removed after Cantera 2.3."); - return cRedlichKwongMFTP; -} - void RedlichKwongMFTP::setSpeciesCoeffs(const std::string& species, double a0, double a1, double b) { diff --git a/src/thermo/SemiconductorPhase.cpp b/src/thermo/SemiconductorPhase.cpp deleted file mode 100644 index 0903bbc97..000000000 --- a/src/thermo/SemiconductorPhase.cpp +++ /dev/null @@ -1,60 +0,0 @@ -//! @file SemiconductorPhase.cpp - -// This file is part of Cantera. See License.txt in the top-level directory or -// at http://www.cantera.org/license.txt for license and copyright information. - -#include "cantera/thermo/SemiconductorPhase.h" - -using namespace std; - -namespace Cantera -{ -static doublereal JoyceDixon(doublereal r) -{ - return log(r) + 1.0/sqrt(8.0)*r - (3.0/16.0 - sqrt(3.0)/9.0)*r*r; -} - -SemiconductorPhase::SemiconductorPhase(std::string infile, - std::string id_) { - warn_deprecated("class SemiconductorPhase", - "To be removed after Cantera 2.3."); -} - -void SemiconductorPhase::getChemPotentials(doublereal* mu) const -{ - getActivityConcentrations(m_work.data()); - mu[0] = ec() + RT()*(JoyceDixon(m_work[0]/nc())); - mu[1] = ev() + RT()*(log(m_work[1]/nv())); -} - -// units: kmol/m^3 -doublereal SemiconductorPhase::nc() const -{ - doublereal fctr = effectiveMass_e() * Boltzmann * temperature()/ - (2.0*Pi*Planck_bar*Planck_bar); - return 2.0*pow(fctr, 1.5)/Avogadro; -} - -doublereal SemiconductorPhase::nv() const -{ - doublereal fctr = effectiveMass_h() * Boltzmann * temperature()/ - (2.0*Pi*Planck_bar*Planck_bar); - return 2.0*pow(fctr, 1.5)/Avogadro; -} - -doublereal SemiconductorPhase::ev() const -{ - return 0.0; -} - -doublereal SemiconductorPhase::ec() const -{ - return ev() + bandgap(); -} - -// private -void SemiconductorPhase::initLengths() -{ - m_work.resize(nSpecies()); -} -} diff --git a/src/thermo/SingleSpeciesTP.cpp b/src/thermo/SingleSpeciesTP.cpp index dd93edace..8c7a709f2 100644 --- a/src/thermo/SingleSpeciesTP.cpp +++ b/src/thermo/SingleSpeciesTP.cpp @@ -22,38 +22,6 @@ SingleSpeciesTP::SingleSpeciesTP() : { } -SingleSpeciesTP::SingleSpeciesTP(const SingleSpeciesTP& right): - m_press(OneAtm), - m_p0(OneAtm) -{ - *this = right; -} - -SingleSpeciesTP& SingleSpeciesTP::operator=(const SingleSpeciesTP& right) -{ - if (&right != this) { - ThermoPhase::operator=(right); - m_press = right.m_press; - m_p0 = right.m_p0; - m_h0_RT = right.m_h0_RT; - m_cp0_R = right.m_cp0_R; - m_s0_R = right.m_s0_R; - } - return *this; -} - -ThermoPhase* SingleSpeciesTP::duplMyselfAsThermoPhase() const -{ - return new SingleSpeciesTP(*this); -} - -int SingleSpeciesTP::eosType() const -{ - warn_deprecated("SingleSpeciesTP::eosType", - "To be removed after Cantera 2.3."); - throw NotImplementedError("SingleSpeciesTP::eosType"); -} - // ------------ Molar Thermodynamic Properties -------------------- doublereal SingleSpeciesTP::enthalpy_mole() const diff --git a/src/thermo/Species.cpp b/src/thermo/Species.cpp index d41c68339..6590f73b7 100644 --- a/src/thermo/Species.cpp +++ b/src/thermo/Species.cpp @@ -32,38 +32,6 @@ Species::~Species() { } -Species::Species(const Species& other) - : name(other.name) - , composition(other.composition) - , charge(other.charge) - , size(other.size) - , transport(other.transport) -{ - warn_deprecated("Species copy constructor", - "To be removed after Cantera 2.3."); - if (other.thermo) { - thermo.reset(other.thermo->duplMyselfAsSpeciesThermoInterpType()); - } -} - -Species& Species::operator=(const Species& other) -{ - warn_deprecated("Species assignment operator", - "To be removed after Cantera 2.3."); - if (this == &other) { - return *this; - } - name = other.name; - composition = other.composition; - charge = other.charge; - size = other.size; - transport = other.transport; - if (other.thermo) { - thermo.reset(other.thermo->duplMyselfAsSpeciesThermoInterpType()); - } - return *this; -} - shared_ptr newSpecies(const XML_Node& species_node) { std::string name = species_node["name"]; diff --git a/src/thermo/SpeciesThermoInterpType.cpp b/src/thermo/SpeciesThermoInterpType.cpp index f89cfa2d5..b4e01fc91 100644 --- a/src/thermo/SpeciesThermoInterpType.cpp +++ b/src/thermo/SpeciesThermoInterpType.cpp @@ -28,27 +28,6 @@ SpeciesThermoInterpType::SpeciesThermoInterpType(double tlow, { } -SpeciesThermoInterpType::SpeciesThermoInterpType(const SpeciesThermoInterpType &b) : - m_lowT(b.m_lowT), - m_highT(b.m_highT), - m_Pref(b.m_Pref) -{ - warn_deprecated("SpeciesThermoInterpType copy constructor", - "To be removed after Cantera 2.3."); -} - -SpeciesThermoInterpType& SpeciesThermoInterpType::operator=(const SpeciesThermoInterpType& b) -{ - warn_deprecated("SpeciesThermoInterpType assignment operator", - "To be removed after Cantera 2.3."); - if (&b != this) { - m_lowT = b.m_lowT; - m_highT = b.m_highT; - m_Pref = b.m_Pref; - } - return *this; -} - void SpeciesThermoInterpType::updateProperties(const doublereal* tempPoly, doublereal* cp_R, doublereal* h_RT, doublereal* s_R) const { @@ -71,12 +50,6 @@ void SpeciesThermoInterpType::modifyOneHf298(const size_t k, //============================================================================= -STITbyPDSS::STITbyPDSS() -{ - warn_deprecated("STITbyPDSS::STITbyPDSS()", - "Default constructor to be removed after Cantera 2.3."); -} - STITbyPDSS::STITbyPDSS(VPSSMgr* vpssmgr_ptr, PDSS* PDSS_ptr) : SpeciesThermoInterpType(), m_vpssmgr_ptr(vpssmgr_ptr), @@ -84,25 +57,6 @@ STITbyPDSS::STITbyPDSS(VPSSMgr* vpssmgr_ptr, PDSS* PDSS_ptr) : { } -STITbyPDSS::STITbyPDSS(const STITbyPDSS& b) : - SpeciesThermoInterpType(b), - m_vpssmgr_ptr(b.m_vpssmgr_ptr), - m_PDSS_ptr(b.m_PDSS_ptr) -{ -} - -SpeciesThermoInterpType* STITbyPDSS::duplMyselfAsSpeciesThermoInterpType() const -{ - return new STITbyPDSS(*this); -} - -void STITbyPDSS::initAllPtrs(size_t speciesIndex, VPSSMgr* vpssmgr_ptr, - PDSS* PDSS_ptr) -{ - m_vpssmgr_ptr = vpssmgr_ptr; - m_PDSS_ptr = PDSS_ptr; -} - doublereal STITbyPDSS::minTemp() const { return m_PDSS_ptr->minTemp(); diff --git a/src/thermo/StoichSubstance.cpp b/src/thermo/StoichSubstance.cpp index e77a07976..59cd0f96f 100644 --- a/src/thermo/StoichSubstance.cpp +++ b/src/thermo/StoichSubstance.cpp @@ -9,7 +9,6 @@ // at http://www.cantera.org/license.txt for license and copyright information. #include "cantera/thermo/StoichSubstance.h" -#include "cantera/thermo/mix_defs.h" #include "cantera/thermo/ThermoFactory.h" #include "cantera/base/ctml.h" @@ -28,34 +27,6 @@ StoichSubstance::StoichSubstance(XML_Node& xmlphase, const std::string& id_) importPhase(xmlphase, this); } -StoichSubstance::StoichSubstance(const StoichSubstance& right) -{ - *this = right; -} - -StoichSubstance& -StoichSubstance::operator=(const StoichSubstance& right) -{ - if (&right != this) { - SingleSpeciesTP::operator=(right); - } - return *this; -} - -ThermoPhase* StoichSubstance::duplMyselfAsThermoPhase() const -{ - return new StoichSubstance(*this); -} - -// ---- Utilities ----- - -int StoichSubstance::eosType() const -{ - warn_deprecated("StoichSubstance::eosType", - "To be removed after Cantera 2.3."); - return cStoichSubstance; -} - // ----- Mechanical Equation of State ------ doublereal StoichSubstance::pressure() const diff --git a/src/thermo/SurfPhase.cpp b/src/thermo/SurfPhase.cpp index ea569f7ce..e4f2b3178 100644 --- a/src/thermo/SurfPhase.cpp +++ b/src/thermo/SurfPhase.cpp @@ -39,36 +39,6 @@ SurfPhase::SurfPhase(XML_Node& xmlphase) : importPhase(xmlphase, this); } -SurfPhase::SurfPhase(const SurfPhase& right) : - m_n0(right.m_n0), - m_logn0(right.m_logn0), - m_press(right.m_press) -{ - operator=(right); -} - -SurfPhase& SurfPhase::operator=(const SurfPhase& right) -{ - if (&right != this) { - ThermoPhase::operator=(right); - m_n0 = right.m_n0; - m_logn0 = right.m_logn0; - m_press = right.m_press; - m_h0 = right.m_h0; - m_s0 = right.m_s0; - m_cp0 = right.m_cp0; - m_mu0 = right.m_mu0; - m_work = right.m_work; - m_logsize = right.m_logsize; - } - return *this; -} - -ThermoPhase* SurfPhase::duplMyselfAsThermoPhase() const -{ - return new SurfPhase(*this); -} - doublereal SurfPhase::enthalpy_mole() const { if (m_n0 <= 0.0) { @@ -359,27 +329,6 @@ EdgePhase::EdgePhase(doublereal n0) : SurfPhase(n0) setNDim(1); } -EdgePhase::EdgePhase(const EdgePhase& right) : - SurfPhase(right.m_n0) -{ - setNDim(1); - *this = right; -} - -EdgePhase& EdgePhase::operator=(const EdgePhase& right) -{ - if (&right != this) { - SurfPhase::operator=(right); - setNDim(1); - } - return *this; -} - -ThermoPhase* EdgePhase::duplMyselfAsThermoPhase() const -{ - return new EdgePhase(*this); -} - void EdgePhase::setParametersFromXML(const XML_Node& eosdata) { eosdata._require("model","Edge"); diff --git a/src/thermo/ThermoFactory.cpp b/src/thermo/ThermoFactory.cpp index d470ac593..e743d6ed7 100644 --- a/src/thermo/ThermoFactory.cpp +++ b/src/thermo/ThermoFactory.cpp @@ -29,7 +29,6 @@ #include "cantera/thermo/SurfPhase.h" #include "cantera/thermo/EdgePhase.h" #include "cantera/thermo/MetalPhase.h" -#include "cantera/thermo/SemiconductorPhase.h" #include "cantera/thermo/StoichSubstance.h" #include "cantera/thermo/MineralEQ3.h" #include "cantera/thermo/MetalSHEelectrons.h" @@ -52,9 +51,6 @@ namespace Cantera ThermoFactory* ThermoFactory::s_factory = 0; std::mutex ThermoFactory::thermo_mutex; -//! Define the number of ThermoPhase types for use in this factory routine -static int ntypes = 27; - //! Define the string name of the ThermoPhase types that are handled by this factory routine static string _types[] = {"IdealGas", "Incompressible", "Surface", "Edge", "Metal", "StoichSubstance", @@ -67,18 +63,6 @@ static string _types[] = {"IdealGas", "Incompressible", "RedlichKwongMFTP", "MaskellSolidSolnPhase" }; -//! Define the integer id of the ThermoPhase types that are handled by this factory routine -static int _itypes[] = {cIdealGas, cIncompressible, - cSurf, cEdge, cMetal, cStoichSubstance, - cPureFluid, cLatticeSolid, cLattice, - cHMW, cIdealSolidSolnPhase, cDebyeHuckel, - cIdealMolalSoln, cVPSS_IdealGas, cIdealSolnGasVPSS_iscv, - cMineralEQ3, cMetalSHEelectrons, - cMargulesVPSSTP, cPhaseCombo_Interaction, cIonsFromNeutral, cFixedChemPot, - cMolarityIonicVPSSTP, cMixedSolventElectrolyte, cRedlichKisterVPSSTP, - cRedlichKwongMFTP, cRedlichKwongMFTP, cMaskellSolidSolnPhase - }; - ThermoFactory::ThermoFactory() { reg("IdealGas", []() { return new IdealGasPhase(); }); @@ -114,17 +98,6 @@ ThermoPhase* ThermoFactory::newThermoPhase(const std::string& model) return create(model); } -std::string eosTypeString(int ieos, int length) -{ - warn_deprecated("eosTypeString", "To be removed after Cantera 2.3."); - for (int n = 0; n < ntypes; n++) { - if (_itypes[n] == ieos) { - return _types[n]; - } - } - return "UnknownPhaseType"; -} - ThermoPhase* newPhase(XML_Node& xmlphase) { string model = xmlphase.child("thermo")["model"]; diff --git a/src/thermo/ThermoPhase.cpp b/src/thermo/ThermoPhase.cpp index 468b90e2d..4f486460d 100644 --- a/src/thermo/ThermoPhase.cpp +++ b/src/thermo/ThermoPhase.cpp @@ -42,64 +42,6 @@ ThermoPhase::~ThermoPhase() delete m_spthermo; } -ThermoPhase::ThermoPhase(const ThermoPhase& right) : - m_spthermo(new MultiSpeciesThermo()), - m_speciesData(0), - m_phi(0.0), - m_hasElementPotentials(false), - m_chargeNeutralityNecessary(false), - m_ssConvention(cSS_CONVENTION_TEMPERATURE) -{ - warn_deprecated("ThermoPhase copy constructor", "To be removed after" - " Cantera 2.3 for all classes derived from ThermoPhase."); - // Call the assignment operator - *this = right; -} - -ThermoPhase& ThermoPhase::operator=(const ThermoPhase& right) -{ - warn_deprecated("ThermoPhase assignment operator", "To be removed after" - " Cantera 2.3 for all classes derived from ThermoPhase."); - // Check for self assignment. - if (this == &right) { - return *this; - } - - // We need to destruct first - for (size_t k = 0; k < m_speciesData.size(); k++) { - delete m_speciesData[k]; - } - delete m_spthermo; - - // Call the base class assignment operator - Phase::operator=(right); - - // Pointer to the species thermodynamic property manager - // We own this, so we need to do a deep copy - m_spthermo = new MultiSpeciesThermo(*right.m_spthermo); - - // Do a deep copy of species Data, because we own this - m_speciesData.resize(m_kk); - for (size_t k = 0; k < m_kk; k++) { - m_speciesData[k] = new XML_Node(*(right.m_speciesData[k])); - } - - m_phi = right.m_phi; - m_lambdaRRT = right.m_lambdaRRT; - m_hasElementPotentials = right.m_hasElementPotentials; - m_chargeNeutralityNecessary = right.m_chargeNeutralityNecessary; - m_ssConvention = right.m_ssConvention; - m_tlast = right.m_tlast; - return *this; -} - -ThermoPhase* ThermoPhase::duplMyselfAsThermoPhase() const -{ - warn_deprecated("ThermoPhase::duplMyselfAsThermoPhase", - "To be removed after Cantera 2.3."); - return new ThermoPhase(*this); -} - void ThermoPhase::resetHf298(size_t k) { if (k != npos) { m_spthermo->resetHf298(k); @@ -633,16 +575,6 @@ void ThermoPhase::setState_SPorSV(double Starget, double p, } } -void ThermoPhase::setSpeciesThermo(MultiSpeciesThermo* spthermo) -{ - warn_deprecated("ThermoPhase::setSpeciesThermo", - "Unused. To be removed after Cantera 2.3."); - if (m_spthermo && m_spthermo != spthermo) { - delete m_spthermo; - } - m_spthermo = spthermo; -} - MultiSpeciesThermo& ThermoPhase::speciesThermo(int k) { if (!m_spthermo) { @@ -670,32 +602,6 @@ void ThermoPhase::initThermoXML(XML_Node& phaseNode, const std::string& id) if (phaseNode.hasChild("state")) { setStateFromXML(phaseNode.child("state")); } - xMol_Ref.resize(m_kk); - getMoleFractions(&xMol_Ref[0]); -} - -void ThermoPhase::setReferenceComposition(const doublereal* const x) -{ - warn_deprecated("ThermoPhase::setReferenceComposition", - "To be removed after Cantera 2.3."); - xMol_Ref.resize(m_kk); - if (x) { - copy(x, x + m_kk, xMol_Ref.begin()); - } else { - getMoleFractions(&xMol_Ref[0]); - } - double sum = accumulate(xMol_Ref.begin(), xMol_Ref.end(), -1.0); - if (fabs(sum) > 1.0E-11) { - throw CanteraError("ThermoPhase::setReferenceComposition", - "input mole fractions don't sum to 1.0"); - } -} - -void ThermoPhase::getReferenceComposition(doublereal* const x) const -{ - warn_deprecated("ThermoPhase::getReferenceComposition", - "To be removed after Cantera 2.3."); - copy(xMol_Ref.begin(), xMol_Ref.end(), x); } void ThermoPhase::initThermo() @@ -706,11 +612,6 @@ void ThermoPhase::initThermo() "Missing species thermo data"); } } -void ThermoPhase::installSlavePhases(XML_Node* phaseNode) -{ - warn_deprecated("ThermoPhase::installSlavePhases", - "Unused. To be removed after Cantera 2.3."); -} bool ThermoPhase::addSpecies(shared_ptr spec) { @@ -722,7 +623,6 @@ bool ThermoPhase::addSpecies(shared_ptr spec) if (added) { spec->thermo->validate(spec->name); m_spthermo->install_STIT(m_kk-1, spec->thermo); - xMol_Ref.push_back(0.0); } return added; } diff --git a/src/thermo/VPSSMgr.cpp b/src/thermo/VPSSMgr.cpp index 4b7107086..6a6f732aa 100644 --- a/src/thermo/VPSSMgr.cpp +++ b/src/thermo/VPSSMgr.cpp @@ -40,103 +40,6 @@ VPSSMgr::VPSSMgr(VPStandardStateTP* vptp_ptr, MultiSpeciesThermo* spthermo) : } } -VPSSMgr::VPSSMgr(const VPSSMgr& right) : - m_kk(0), - m_vptp_ptr(0), - m_spthermo(0), - m_tlast(-1.0), - m_plast(-1.0), - m_p0(-1.0), - m_minTemp(-1.0), - m_maxTemp(1.0E8), - m_useTmpRefStateStorage(false), - m_useTmpStandardStateStorage(false) -{ - warn_deprecated("VPSSMgr copy constructor", "To be removed after" - " Cantera 2.3 for all classes derived from VPSSMgr."); - *this = right; -} - -VPSSMgr& VPSSMgr::operator=(const VPSSMgr& right) -{ - warn_deprecated("VPSSMgr assignment operator", "To be removed after" - " Cantera 2.3 for all classes derived from VPSSMgr."); - if (&right == this) { - return *this; - } - m_kk = right.m_kk; - - // What we are doing here is to make a shallow copy of the VPStandardStateTP - // pointer in the "new" VPSSMgr object using the value from the "old" - // VPSSMgr object. This is not appropriate if we are making a copy of a - // ThermoPhase object and the VPSSMgr objects are owned by the ThermoPhase - // object. - // - // The new object will want to have a different value of m_vptp_ptr than the - // value this is being copied here. It will want to refer to the copy of the - // VPStandardStateTP object being made that will own the new VPSSMgr object. - // However, the assignment object is not the place to carry out this fixup. - // - // We will have to "fix" up the shallow copies later. - m_vptp_ptr = right.m_vptp_ptr; - m_spthermo = right.m_spthermo; - m_tlast = -1.0; - m_plast = -1.0; - m_p0 = right.m_p0; - m_minTemp = right.m_minTemp; - m_maxTemp = right.m_maxTemp; - m_useTmpRefStateStorage = right.m_useTmpRefStateStorage; - m_h0_RT = right.m_h0_RT; - m_cp0_R = right.m_cp0_R; - m_g0_RT = right.m_g0_RT; - m_s0_R = right.m_s0_R; - m_V0 = right.m_V0; - m_useTmpStandardStateStorage = right.m_useTmpStandardStateStorage; - m_hss_RT = right.m_hss_RT; - m_cpss_R = right.m_cpss_R; - m_gss_RT = right.m_gss_RT; - m_sss_R = right.m_sss_R; - m_Vss = right.m_Vss; - mPDSS_h0_RT = right.mPDSS_h0_RT; - mPDSS_cp0_R = right.mPDSS_cp0_R; - mPDSS_g0_RT = right.mPDSS_g0_RT; - mPDSS_s0_R = right.mPDSS_s0_R; - mPDSS_V0 = right.mPDSS_V0; - mPDSS_hss_RT = right.mPDSS_hss_RT; - mPDSS_cpss_R = right.mPDSS_cpss_R; - mPDSS_gss_RT = right.mPDSS_gss_RT; - mPDSS_sss_R = right.mPDSS_sss_R; - mPDSS_Vss = right.mPDSS_Vss; - - return *this; -} - -VPSSMgr* VPSSMgr::duplMyselfAsVPSSMgr() const -{ - warn_deprecated("VPSSMgr::duplMyselfAsVPSSMgr", "To be removed after" - " Cantera 2.3 for all classes derived from VPSSMgr."); - return new VPSSMgr(*this); -} - -void VPSSMgr::initAllPtrs(VPStandardStateTP* vp_ptr, - MultiSpeciesThermo* sp_ptr) -{ - warn_deprecated("VPSSMgr::initAllPtrs", "To be removed after Cantera 2.3 " - "for all classes derived from VPSSMgr."); - m_vptp_ptr = vp_ptr; - m_spthermo = sp_ptr; - - // Take care of STITTbyPDSS objects - for (size_t k = 0; k < m_kk; k++) { - SpeciesThermoInterpType* st = m_spthermo->provideSTIT(k); - STITbyPDSS* stpd = dynamic_cast(st); - if (stpd) { - PDSS* PDSS_ptr = vp_ptr->providePDSS(k); - stpd->initAllPtrs(k, this, PDSS_ptr); - } - } -} - // Standard States void VPSSMgr::getStandardChemPotentials(doublereal* mu) const @@ -415,14 +318,4 @@ doublereal VPSSMgr::refPressure(size_t k) const return m_p0; } -PDSS_enumType VPSSMgr::reportPDSSType(int index) const -{ - throw NotImplementedError("VPSSMgr::reportPDSSType()"); -} - -VPSSMgr_enumType VPSSMgr::reportVPSSMgrType() const -{ - throw NotImplementedError("VPSSMgr::reportVPSSType()"); -} - } diff --git a/src/thermo/VPSSMgrFactory.cpp b/src/thermo/VPSSMgrFactory.cpp index f773a4629..a3c29073c 100644 --- a/src/thermo/VPSSMgrFactory.cpp +++ b/src/thermo/VPSSMgrFactory.cpp @@ -207,31 +207,6 @@ void VPSSMgrFactory::deleteFactory() s_factory = 0; } -VPSSMgr_enumType -VPSSMgrFactory::VPSSMgr_StringConversion(const std::string& ssModel) const -{ - warn_deprecated("VPSSMgrFactory::VPSSMgr_StringConversion", - "To be removed after Cantera 2.3."); - std::string lssModel = ba::to_lower_copy(ssModel); - VPSSMgr_enumType type; - if (lssModel == "idealgas") { - type = cVPSSMGR_IDEALGAS; - } else if (lssModel == "constvol") { - type = cVPSSMGR_CONSTVOL; - } else if (lssModel == "purefuild") { - type = cVPSSMGR_PUREFLUID; - } else if (lssModel == "water_constvol") { - type = cVPSSMGR_WATER_CONSTVOL; - } else if (lssModel == "water_hkft") { - type = cVPSSMGR_WATER_HKFT; - } else if (lssModel == "general") { - type = cVPSSMGR_GENERAL; - } else { - type = cVPSSMGR_UNDEF; - } - return type; -} - VPSSMgr* VPSSMgrFactory::newVPSSMgr(VPStandardStateTP* vp_ptr, XML_Node* phaseNode_ptr, std::vector & spDataNodeList) @@ -297,49 +272,11 @@ VPSSMgr* VPSSMgrFactory::newVPSSMgr(VPStandardStateTP* vp_ptr, return new VPSSMgr_General(vp_ptr, spth); } -// I don't think this is currently used. However, this is a virtual -// function where additional capabilities may be added. -VPSSMgr* VPSSMgrFactory::newVPSSMgr(VPSSMgr_enumType type, - VPStandardStateTP* vp_ptr) -{ - warn_deprecated("VPSSMgrFactory::newVPSSMgr(VPSSMgr_enumType, VPStandardStateTP*)", - "To be removed after Cantera 2.3."); - static unordered_map types { - {cVPSSMGR_IDEALGAS, "idealgas"}, - {cVPSSMGR_CONSTVOL, "constvol"}, - {cVPSSMGR_WATER_CONSTVOL, "water_constvol"}, - {cVPSSMGR_WATER_HKFT, "water_hkft"}, - {cVPSSMGR_GENERAL, "general"} - }; - MultiSpeciesThermo& spthermoRef = vp_ptr->speciesThermo(); - return create(types.at(type), vp_ptr, &spthermoRef); -} - -// I don't think this is currently used -VPSSMgr* newVPSSMgr(VPSSMgr_enumType type, VPStandardStateTP* vp_ptr, - Cantera::VPSSMgrFactory* f) -{ - warn_deprecated("newVPSSMgr(VPSSMgr_enumType, VPStandardStateTP*, VPSSMgrFactory*)", - "To be removed after Cantera 2.3."); - if (f == 0) { - f = VPSSMgrFactory::factory(); - } - return f->newVPSSMgr(type, vp_ptr); -} - VPSSMgr* newVPSSMgr(VPStandardStateTP* tp_ptr, XML_Node* phaseNode_ptr, - std::vector & spDataNodeList, - VPSSMgrFactory* f) + std::vector & spDataNodeList) { - if (f == 0) { - f = VPSSMgrFactory::factory(); - } else { - warn_deprecated("newVPSSMgr(VPStandardStateTP*, XML_Node*, vector, VPSSMgrFactory*)", - "The `VPSSMgrFactory*` argument to this function is deprecated and" - " will be removed after Cantera 2.3."); - } - return f->newVPSSMgr(tp_ptr, phaseNode_ptr, spDataNodeList); + return VPSSMgrFactory::factory()->newVPSSMgr(tp_ptr, phaseNode_ptr, spDataNodeList); } } diff --git a/src/thermo/VPSSMgrFactory.h b/src/thermo/VPSSMgrFactory.h index 566734212..a97c76477 100644 --- a/src/thermo/VPSSMgrFactory.h +++ b/src/thermo/VPSSMgrFactory.h @@ -17,25 +17,6 @@ namespace Cantera { -//! Throw a named error for an unknown or missing vpss species thermo model. -/*! - * @ingroup mgrpdssthermocalc - */ -class UnknownVPSSMgrModel: public CanteraError -{ -public: - //! Constructor - /*! - * @param proc Function name error occurred. - * @param VPSSMgrModel Unrecognized species thermo calculator name - * @deprecated Unused. To be removed after Cantera 2.3. - */ - UnknownVPSSMgrModel(const std::string& proc, - const std::string& VPSSMgrModel) : - CanteraError(proc, "Specified VPSSMgr model " - + VPSSMgrModel + - " does not match any known type.") {} -}; //! Factory to build instances of classes that manage the //! standard-state thermodynamic properties of a set of species. @@ -83,25 +64,6 @@ public: */ void deleteFactory(); - //! String conversion to an enumType - /*! - * This routine is a string conversion. The string is obtained from the - * standardState model attribute and converted to a VPSSMgr_enumType type. - * - * @param ssModel String representing the VPSSMGr object - * @deprecated Unused. To be removed after Cantera 2.3. - */ - virtual VPSSMgr_enumType - VPSSMgr_StringConversion(const std::string& ssModel) const; - - //! Create a new species variable pressure standard state calculator - /*! - * @param type The enumerated type of the standard state calculator - * @param vp_ptr Variable pressure standard state ThermoPhase object - * that will be the owner. - */ - virtual VPSSMgr* newVPSSMgr(VPSSMgr_enumType type, VPStandardStateTP* vp_ptr); - //! Create a new species property manager for a group of species /*! * This routine will look through species nodes. It will discover what each @@ -138,26 +100,6 @@ private: // derives from VPSSMgrFactory. ////////////////////////////////////////////////////////////////// -//! Create a new species thermo manager instance, by specifying -//! the type and (optionally) a pointer to the factory to use to create it. -/*! - * This utility program will look through species nodes. It will discover what - * each species needs for its species property managers. Then, it will create - * and return the proper species property manager to use. - * - * These functions allow using a different factory class that - * derives from VPSSMgrFactory. - * - * @param type Species thermo type. - * @param vp_ptr Variable pressure standard state ThermoPhase object - * that will be the owner. - * @param f Pointer to a VPSSMgrFactory. optional parameter. - * Defaults to NULL. - * @deprecated Unused. To be removed after Cantera 2.3. - */ -VPSSMgr* newVPSSMgr(VPSSMgr_enumType type, - VPStandardStateTP* vp_ptr, VPSSMgrFactory* f=0); - //! Function to return VPSSMgr manager /*! * This utility program will look through species nodes. It will discover what @@ -172,15 +114,10 @@ VPSSMgr* newVPSSMgr(VPSSMgr_enumType type, * @param phaseNode_ptr Pointer to the ThermoPhase phase XML Node * @param spDataNodeList This vector contains a list * of species XML nodes that will be in the phase - * @param f Pointer to a VPSSMgrFactory. optional - * parameter. Defaults to NULL. - * @deprecated The `VPSSMgrFactory*` argument to this function is deprecated and - * will be removed after Cantera 2.3. */ VPSSMgr* newVPSSMgr(VPStandardStateTP* vp_ptr, XML_Node* phaseNode_ptr, - std::vector & spDataNodeList, - VPSSMgrFactory* f=0); + std::vector & spDataNodeList); } #endif diff --git a/src/thermo/VPSSMgr_ConstVol.cpp b/src/thermo/VPSSMgr_ConstVol.cpp index 07768b2f8..69c9b136d 100644 --- a/src/thermo/VPSSMgr_ConstVol.cpp +++ b/src/thermo/VPSSMgr_ConstVol.cpp @@ -27,28 +27,6 @@ VPSSMgr_ConstVol::VPSSMgr_ConstVol(VPStandardStateTP* vp_ptr, MultiSpeciesThermo m_useTmpStandardStateStorage = true; } -VPSSMgr_ConstVol::VPSSMgr_ConstVol(const VPSSMgr_ConstVol& right) : - VPSSMgr(right.m_vptp_ptr, right.m_spthermo) -{ - m_useTmpRefStateStorage = true; - m_useTmpStandardStateStorage = true; - *this = right; -} - -VPSSMgr_ConstVol& VPSSMgr_ConstVol::operator=(const VPSSMgr_ConstVol& b) -{ - if (&b == this) { - return *this; - } - VPSSMgr::operator=(b); - return *this; -} - -VPSSMgr* VPSSMgr_ConstVol::duplMyselfAsVPSSMgr() const -{ - return new VPSSMgr_ConstVol(*this); -} - /* * Note, this is equal to the reference state entropies * due to the zero volume expansivity: @@ -137,17 +115,4 @@ PDSS* VPSSMgr_ConstVol::createInstallPDSS(size_t k, const XML_Node& speciesNode, return new PDSS_ConstVol(m_vptp_ptr, k, speciesNode, *phaseNode_ptr, true); } -PDSS_enumType VPSSMgr_ConstVol::reportPDSSType(int k) const -{ - warn_deprecated("VPSSMgr_ConstVol::reportPDSSType", - "To be removed after Cantera 2.3."); - return cPDSS_CONSTVOL; -} - -VPSSMgr_enumType VPSSMgr_ConstVol::reportVPSSMgrType() const -{ - warn_deprecated("VPSSMgr_ConstVol::reportVPSSMgrType", - "To be removed after Cantera 2.3."); - return cVPSSMGR_CONSTVOL; -} } diff --git a/src/thermo/VPSSMgr_General.cpp b/src/thermo/VPSSMgr_General.cpp index 86534c217..6edf0e4bc 100644 --- a/src/thermo/VPSSMgr_General.cpp +++ b/src/thermo/VPSSMgr_General.cpp @@ -37,50 +37,6 @@ VPSSMgr_General::VPSSMgr_General(VPStandardStateTP* vp_ptr, m_useTmpRefStateStorage = true; } -VPSSMgr_General::VPSSMgr_General(const VPSSMgr_General& right) : - VPSSMgr(right.m_vptp_ptr, right.m_spthermo) -{ - m_useTmpStandardStateStorage = true; - m_useTmpRefStateStorage = true; - *this = right; -} - -VPSSMgr_General& VPSSMgr_General::operator=(const VPSSMgr_General& b) -{ - if (&b == this) { - return *this; - } - VPSSMgr::operator=(b); - - // Must fill in the shallow pointers. These must have already been - // transfered and stored in the owning VPStandardStateTP class. Note we are - // aware that at this point m_vptr_ptr may refer back to the wrong - // ThermoPhase object. However, the shallow copy performed here is - // consistent with the assignment operator's general functionality. - m_PDSS_ptrs.resize(m_kk); - for (size_t k = 0; k < m_kk; k++) { - m_PDSS_ptrs[k] = m_vptp_ptr->providePDSS(k); - } - return *this; -} - -VPSSMgr* VPSSMgr_General::duplMyselfAsVPSSMgr() const -{ - return new VPSSMgr_General(*this); -} - -void VPSSMgr_General::initAllPtrs(VPStandardStateTP* vp_ptr, MultiSpeciesThermo* sp_ptr) -{ - VPSSMgr::initAllPtrs(vp_ptr, sp_ptr); - - // Must fill in the shallow pointers. These must have already been - // transfered and stored in the owning VPStandardStateTP class. - m_PDSS_ptrs.resize(m_kk); - for (size_t k = 0; k < m_kk; k++) { - m_PDSS_ptrs[k] = m_vptp_ptr->providePDSS(k); - } -} - void VPSSMgr_General::_updateRefStateThermo() const { if (m_useTmpRefStateStorage) { @@ -197,17 +153,4 @@ PDSS* VPSSMgr_General::createInstallPDSS(size_t k, const XML_Node& speciesNode, return kPDSS; } -PDSS_enumType VPSSMgr_General::reportPDSSType(int k) const -{ - warn_deprecated("VPSSMgr_General::reportPDSSType", - "To be removed after Cantera 2.3."); - return m_PDSS_ptrs[k]->reportPDSSType(); -} - -VPSSMgr_enumType VPSSMgr_General::reportVPSSMgrType() const -{ - warn_deprecated("VPSSMgr_General::reportVPSSMgrType", - "To be removed after Cantera 2.3."); - return cVPSSMGR_GENERAL; -} } diff --git a/src/thermo/VPSSMgr_IdealGas.cpp b/src/thermo/VPSSMgr_IdealGas.cpp index f98183d5e..40d184256 100644 --- a/src/thermo/VPSSMgr_IdealGas.cpp +++ b/src/thermo/VPSSMgr_IdealGas.cpp @@ -28,28 +28,6 @@ VPSSMgr_IdealGas::VPSSMgr_IdealGas(VPStandardStateTP* vp_ptr, MultiSpeciesThermo m_useTmpStandardStateStorage = true; } -VPSSMgr_IdealGas::VPSSMgr_IdealGas(const VPSSMgr_IdealGas& right) : - VPSSMgr(right.m_vptp_ptr, right.m_spthermo) -{ - m_useTmpRefStateStorage = true; - m_useTmpStandardStateStorage = true; - *this = right; -} - -VPSSMgr_IdealGas& VPSSMgr_IdealGas::operator=(const VPSSMgr_IdealGas& b) -{ - if (&b == this) { - return *this; - } - VPSSMgr::operator=(b); - return *this; -} - -VPSSMgr* VPSSMgr_IdealGas::duplMyselfAsVPSSMgr() const -{ - return new VPSSMgr_IdealGas(*this); -} - void VPSSMgr_IdealGas::getIntEnergy_RT(doublereal* urt) const { getEnthalpy_RT(urt); @@ -102,18 +80,4 @@ PDSS* VPSSMgr_IdealGas::createInstallPDSS(size_t k, const XML_Node& speciesNode, return kPDSS; } -PDSS_enumType VPSSMgr_IdealGas::reportPDSSType(int k) const -{ - warn_deprecated("VPSSMgr_IdealGas::reportPDSSType", - "To be removed after Cantera 2.3."); - return cPDSS_IDEALGAS; -} - -VPSSMgr_enumType VPSSMgr_IdealGas::reportVPSSMgrType() const -{ - warn_deprecated("VPSSMgr_IdealGas::reportVPSSMgrType", - "To be removed after Cantera 2.3."); - return cVPSSMGR_IDEALGAS; -} - } diff --git a/src/thermo/VPSSMgr_Water_ConstVol.cpp b/src/thermo/VPSSMgr_Water_ConstVol.cpp index 3fab37d3c..a68dcd725 100644 --- a/src/thermo/VPSSMgr_Water_ConstVol.cpp +++ b/src/thermo/VPSSMgr_Water_ConstVol.cpp @@ -30,40 +30,6 @@ VPSSMgr_Water_ConstVol::VPSSMgr_Water_ConstVol(VPStandardStateTP* vp_ptr, m_useTmpStandardStateStorage = true; } -VPSSMgr_Water_ConstVol::VPSSMgr_Water_ConstVol(const VPSSMgr_Water_ConstVol& right) : - VPSSMgr(right.m_vptp_ptr, right.m_spthermo) -{ - m_useTmpRefStateStorage = true; - m_useTmpStandardStateStorage = true; - *this = right; -} - -VPSSMgr_Water_ConstVol& -VPSSMgr_Water_ConstVol::operator=(const VPSSMgr_Water_ConstVol& b) -{ - if (&b == this) { - return *this; - } - VPSSMgr::operator=(b); - return *this; -} - -VPSSMgr* VPSSMgr_Water_ConstVol::duplMyselfAsVPSSMgr() const -{ - return new VPSSMgr_Water_ConstVol(*this); -} - -void VPSSMgr_Water_ConstVol::initAllPtrs(VPStandardStateTP* vp_ptr, - MultiSpeciesThermo* sp_ptr) -{ - VPSSMgr::initAllPtrs(vp_ptr, sp_ptr); - m_waterSS = dynamic_cast(m_vptp_ptr->providePDSS(0)); - if (!m_waterSS) { - throw CanteraError("VPSSMgr_Water_ConstVol::initAllPtrs", - "bad dynamic cast"); - } -} - void VPSSMgr_Water_ConstVol::getEnthalpy_RT_ref(doublereal* hrt) const { // Everything should be OK except for the water SS @@ -263,17 +229,4 @@ PDSS* VPSSMgr_Water_ConstVol::createInstallPDSS(size_t k, return kPDSS; } -PDSS_enumType VPSSMgr_Water_ConstVol::reportPDSSType(int k) const -{ - warn_deprecated("VPSSMgr_Water_ConstVol::reportPDSSType", - "To be removed after Cantera 2.3."); - return cPDSS_UNDEF; -} - -VPSSMgr_enumType VPSSMgr_Water_ConstVol::reportVPSSMgrType() const -{ - warn_deprecated("VPSSMgr_Water_ConstVol::reportVPSSMgrType", - "To be removed after Cantera 2.3."); - return cVPSSMGR_WATER_CONSTVOL; -} } diff --git a/src/thermo/VPSSMgr_Water_HKFT.cpp b/src/thermo/VPSSMgr_Water_HKFT.cpp index 57d325e42..c3a4fe066 100644 --- a/src/thermo/VPSSMgr_Water_HKFT.cpp +++ b/src/thermo/VPSSMgr_Water_HKFT.cpp @@ -34,32 +34,6 @@ VPSSMgr_Water_HKFT::VPSSMgr_Water_HKFT(VPStandardStateTP* vp_ptr, m_useTmpStandardStateStorage = true; } -VPSSMgr_Water_HKFT::VPSSMgr_Water_HKFT(const VPSSMgr_Water_HKFT& right) : - VPSSMgr(right.m_vptp_ptr, right.m_spthermo), - m_waterSS(0), - m_tlastRef(-1.0) -{ - m_useTmpRefStateStorage = true; - m_useTmpStandardStateStorage = true; - *this = right; -} - -VPSSMgr_Water_HKFT& VPSSMgr_Water_HKFT::operator=(const VPSSMgr_Water_HKFT& b) -{ - if (&b == this) { - return *this; - } - VPSSMgr::operator=(b); - m_waterSS = &dynamic_cast(*m_vptp_ptr->providePDSS(0)); - m_tlastRef = -1.0; - return *this; -} - -VPSSMgr* VPSSMgr_Water_HKFT::duplMyselfAsVPSSMgr() const -{ - return new VPSSMgr_Water_HKFT(*this); -} - void VPSSMgr_Water_HKFT::getEnthalpy_RT_ref(doublereal* hrt) const { updateRefStateThermo(); @@ -252,28 +226,4 @@ PDSS* VPSSMgr_Water_HKFT::createInstallPDSS(size_t k, return kPDSS; } -void VPSSMgr_Water_HKFT::initAllPtrs(VPStandardStateTP* vp_ptr, - MultiSpeciesThermo* sp_ptr) -{ - VPSSMgr::initAllPtrs(vp_ptr, sp_ptr); - m_waterSS = dynamic_cast(m_vptp_ptr->providePDSS(0)); - if (!m_waterSS) { - throw CanteraError("VPSSMgr_Water_ConstVol::initAllPtrs", - "bad dynamic cast"); - } -} - -PDSS_enumType VPSSMgr_Water_HKFT::reportPDSSType(int k) const -{ - warn_deprecated("VPSSMgr_Water_HKFT::reportPDSSType", - "To be removed after Cantera 2.3."); - return cPDSS_UNDEF; -} - -VPSSMgr_enumType VPSSMgr_Water_HKFT::reportVPSSMgrType() const -{ - warn_deprecated("VPSSMgr_Water_HKFT::reportVPSSMgrType", - "To be removed after Cantera 2.3."); - return cVPSSMGR_WATER_HKFT; -} } diff --git a/src/thermo/VPStandardStateTP.cpp b/src/thermo/VPStandardStateTP.cpp index 231a8e7bb..a25d58fca 100644 --- a/src/thermo/VPStandardStateTP.cpp +++ b/src/thermo/VPStandardStateTP.cpp @@ -25,62 +25,6 @@ VPStandardStateTP::VPStandardStateTP() : { } -VPStandardStateTP::VPStandardStateTP(const VPStandardStateTP& b) : - m_Pcurrent(OneAtm), - m_Tlast_ss(-1.0), - m_Plast_ss(-1.0), - m_P0(OneAtm) -{ - VPStandardStateTP::operator=(b); -} - -VPStandardStateTP& VPStandardStateTP::operator=(const VPStandardStateTP& b) -{ - if (&b != this) { - // Mostly, this is a passthrough to the underlying assignment operator - // for the ThermoPhase parent object. - ThermoPhase::operator=(b); - - // However, we have to handle data that we own. - m_Pcurrent = b.m_Pcurrent; - m_Tlast_ss = b.m_Tlast_ss; - m_Plast_ss = b.m_Plast_ss; - m_P0 = b.m_P0; - - m_PDSS_storage.resize(m_kk); - for (size_t k = 0; k < m_kk; k++) { - m_PDSS_storage[k].reset(b.m_PDSS_storage[k]->duplMyselfAsPDSS()); - } - - // Duplicate the VPSS Manager object that conducts the calculations - m_VPSS_ptr.reset(b.m_VPSS_ptr->duplMyselfAsVPSSMgr()); - - // The VPSSMgr object contains shallow pointers. Whenever you have - // shallow pointers, they have to be fixed up to point to the correct - // objects referring back to this ThermoPhase's properties. - m_VPSS_ptr->initAllPtrs(this, m_spthermo); - - // The PDSS objects contains shallow pointers. Whenever you have shallow - // pointers, they have to be fixed up to point to the correct objects - // referring back to this ThermoPhase's properties. This function also - // sets m_VPSS_ptr so it occurs after m_VPSS_ptr is set. - for (size_t k = 0; k < m_kk; k++) { - m_PDSS_storage[k]->initAllPtrs(this, m_VPSS_ptr.get(), m_spthermo); - } - - // Ok, the VPSSMgr object is ready for business. We need to resync the - // temperature and the pressure of the new standard states with what is - // stored in this object. - m_VPSS_ptr->setState_TP(m_Tlast_ss, m_Plast_ss); - } - return *this; -} - -ThermoPhase* VPStandardStateTP::duplMyselfAsThermoPhase() const -{ - return new VPStandardStateTP(*this); -} - int VPStandardStateTP::standardStateConvention() const { return cSS_CONVENTION_VPSS; diff --git a/src/thermo/WaterProps.cpp b/src/thermo/WaterProps.cpp index e38326238..0244e7b8e 100644 --- a/src/thermo/WaterProps.cpp +++ b/src/thermo/WaterProps.cpp @@ -48,13 +48,6 @@ WaterProps::WaterProps(WaterPropsIAPWS* waterIAPWS) : } } -WaterProps::WaterProps(const WaterProps& b) : - m_waterIAPWS(0), - m_own_sub(false) -{ - *this = b; -} - WaterProps::~WaterProps() { if (m_own_sub) { @@ -62,26 +55,6 @@ WaterProps::~WaterProps() } } -WaterProps& WaterProps::operator=(const WaterProps& b) -{ - if (&b == this) { - return *this; - } - - if (m_own_sub) { - delete m_waterIAPWS; - } - if (b.m_own_sub) { - m_waterIAPWS = new WaterPropsIAPWS(); - m_own_sub = true; - } else { - m_waterIAPWS = b.m_waterIAPWS; - m_own_sub = false; - } - - return *this; -} - doublereal WaterProps::density_T(doublereal T, doublereal P, int ifunc) { static const doublereal Tc = T - 273.15; diff --git a/src/thermo/WaterPropsIAPWS.cpp b/src/thermo/WaterPropsIAPWS.cpp index 9d9d545ce..e772f8e86 100644 --- a/src/thermo/WaterPropsIAPWS.cpp +++ b/src/thermo/WaterPropsIAPWS.cpp @@ -42,26 +42,6 @@ WaterPropsIAPWS::WaterPropsIAPWS() : { } -WaterPropsIAPWS::WaterPropsIAPWS(const WaterPropsIAPWS& b) : - tau(b.tau), - delta(b.delta), - iState(b.iState) -{ - m_phi.tdpolycalc(tau, delta); -} - -WaterPropsIAPWS& WaterPropsIAPWS::operator=(const WaterPropsIAPWS& b) -{ - if (this == &b) { - return *this; - } - tau = b.tau; - delta = b.delta; - iState = b.iState; - m_phi.tdpolycalc(tau, delta); - return *this; -} - void WaterPropsIAPWS::calcDim(doublereal temperature, doublereal rho) { tau = T_c / temperature; diff --git a/src/thermo/WaterSSTP.cpp b/src/thermo/WaterSSTP.cpp index 35079fc8d..53de637f9 100644 --- a/src/thermo/WaterSSTP.cpp +++ b/src/thermo/WaterSSTP.cpp @@ -44,40 +44,6 @@ WaterSSTP::WaterSSTP(XML_Node& phaseRoot, const std::string& id) : importPhase(phaseRoot, this); } -WaterSSTP::WaterSSTP(const WaterSSTP& b) : - SingleSpeciesTP(b), - m_mw(b.m_mw), - EW_Offset(b.EW_Offset), - SW_Offset(b.SW_Offset), - m_ready(false), - m_allowGasPhase(b.m_allowGasPhase) -{ - m_waterProps.reset(new WaterProps(&m_sub)); - - // Use the assignment operator to do the brunt of the work for the copy - // constructor. - *this = b; -} - -WaterSSTP& WaterSSTP::operator=(const WaterSSTP& b) -{ - if (&b == this) { - return *this; - } - m_sub = b.m_sub; - m_waterProps.reset(new WaterProps(&m_sub)); - - m_mw = b.m_mw; - m_ready = b.m_ready; - m_allowGasPhase = b.m_allowGasPhase; - return *this; -} - -ThermoPhase* WaterSSTP::duplMyselfAsThermoPhase() const -{ - return new WaterSSTP(*this); -} - void WaterSSTP::initThermo() { SingleSpeciesTP::initThermo(); diff --git a/src/tpx/RedlichKwong.cpp b/src/tpx/RedlichKwong.cpp deleted file mode 100644 index eb71259cf..000000000 --- a/src/tpx/RedlichKwong.cpp +++ /dev/null @@ -1,76 +0,0 @@ -//! @file RedlichKwong.cpp - -// This file is part of Cantera. See License.txt in the top-level directory or -// at http://www.cantera.org/license.txt for license and copyright information. - -#include "RedlichKwong.h" - -namespace tpx -{ -double RedlichKwong::up() -{ - return -Pp()/Rho + hresid() + m_energy_offset; -} - -double RedlichKwong::hresid() -{ - double hh = m_b * (Rho/m_mw); - double hresid_mol_RT = z() - 1.0 - - (1.5*m_a/(m_b*8314.3*T*sqrt(T)))*log(1.0 + hh); - return 8314.3*T*hresid_mol_RT/m_mw; -} - -double RedlichKwong::sresid() -{ - double hh = m_b * (Rho/m_mw); - double sresid_mol_R = log(z()*(1.0 - hh)) - - (0.5*m_a/(m_b*8314.3*T*sqrt(T)))*log(1.0 + hh); - return 8314.3*sresid_mol_R/m_mw; -} - -double RedlichKwong::sp() -{ - const double Pref = 101325.0; - double rgas = 8314.3/m_mw; - double sr = sresid(); - double p = Pp(); - return rgas*(log(Pref/p)) + sr + m_entropy_offset; -} - -double RedlichKwong::z() -{ - return Pp()*m_mw/(Rho*8314.3*T); -} - -double RedlichKwong::Pp() -{ - double R = 8314.3; - double V = m_mw/Rho; - return R*T/(V - m_b) - m_a/(sqrt(T)*V*(V+m_b)); -} - -double RedlichKwong::Psat() -{ - double tt = m_tcrit/T; - double lpr = -0.8734*tt*tt - 3.4522*tt + 4.2918; - return m_pcrit*exp(lpr); -} - -double RedlichKwong::ldens() -{ - double c; - int i; - double sqt = sqrt(T); - double v = m_b, vnew; - double pp = Psat(); - double Rhsave = Rho; - for (i = 0; i < 50; i++) { - c = m_b*m_b + m_b*GasConstant*T/pp - m_a/(pp*sqt); - vnew = (1.0/c)*(v*v*v - GasConstant*T*v*v/pp - m_a*m_b/(pp*sqt)); - v = vnew; - } - Rho = Rhsave; - return m_mw/vnew; -} - -} diff --git a/src/tpx/RedlichKwong.h b/src/tpx/RedlichKwong.h deleted file mode 100644 index 08bea9845..000000000 --- a/src/tpx/RedlichKwong.h +++ /dev/null @@ -1,89 +0,0 @@ -//! @file RedlichKwong.h - -// This file is part of Cantera. See License.txt in the top-level directory or -// at http://www.cantera.org/license.txt for license and copyright information. - -#ifndef TPX_RK_H -#define TPX_RK_H - -#include "cantera/tpx/Sub.h" -#include "cantera/base/global.h" -#include - -namespace tpx -{ -const double GasConstant = 8314.3; - -//! @deprecated To be removed after Cantera 2.3. -class RedlichKwong : public Substance -{ - -public: - - RedlichKwong() { - Cantera::warn_deprecated("class RedlichKwong", - "To be removed after Cantera 2.3."); - setParameters(1.0, 1.0, 1.0); - m_name = "Redlich-Kwong"; - m_formula = "-"; - } - - void setParameters(double Tc, double Pc, double MolWt) { - m_tcrit = Tc; - m_pcrit = Pc; - m_mw = MolWt; - - // compute the a and b parameters - m_a = 0.42748*GasConstant*GasConstant*m_tcrit*m_tcrit*sqrt(m_tcrit)/m_pcrit; - m_b = 0.08664*GasConstant*m_tcrit/m_pcrit; - } - - double a() { - return m_a; - } - double b() { - return m_b; - } - - double MolWt() { - return m_mw; - } - double Tcrit() { - return m_tcrit; - } - double Pcrit() { - return m_pcrit; - } - double Vcrit() { - return 0.3592725*GasConstant*T/(m_mw*m_pcrit); - } - double Tmin() { - return 0.0; - } - double Tmax() { - return 1.0e10; - } - - double Pp(); - double up(); - double sp(); - double Psat(); - double dPsatdT(); - - // compressibility - double z(); - - // enthalpy departure - double hresid(); - - // entropy departure - double sresid(); - - double ldens(); - -protected: - double m_tcrit, m_pcrit, m_mw, m_a, m_b; -}; -} - -#endif // ! TPX_RK_H diff --git a/src/tpx/lk.cpp b/src/tpx/lk.cpp deleted file mode 100644 index 4ea4d6d94..000000000 --- a/src/tpx/lk.cpp +++ /dev/null @@ -1,169 +0,0 @@ -//! @file lk.cpp Lee-Kesler equation of state - -// This file is part of Cantera. See License.txt in the top-level directory or -// at http://www.cantera.org/license.txt for license and copyright information. - -#include "lk.h" -#include - -namespace tpx -{ - -static double b[2][4] = {{0.1181193, 0.265728, 0.154790, 0.030323}, - {0.2026579, 0.331511, 0.027655, 0.203488} -}; -static double c[2][4] = {{0.0236744, 0.0186984, 0.0, 0.042724}, - {0.0313385, 0.0503618, 0.016901, 0.041577} -}; -static double d[2][2] = {{1.55488e-5, 6.23689e-5},{4.8736e-5, 0.740336e-5}}; -static double beta[2] = {0.65392, 1.226}; -static double gamma[2] = {0.060167, 0.03754}; - -//--------------------------- member functions ------------------ - -double leekesler::W(int n, double egrho, double Gamma) -{ - return (n == 0 ? (1.0 - egrho)/(2.0*Gamma) : - (n*W(n-1, egrho, Gamma) - 0.5*pow(Rho,2*n)*egrho)/Gamma); -} - -double leekesler::up() -{ - return -(8314.3/Mw)*T*(1.0 + T*I()/Tcr); // + h_0(T) -} - -double leekesler::hdep() -{ - double tr = T/Tcr; - return tr*tr*I() + (1.0 - z())*tr; -} - -double leekesler::sdep() -{ - double tr = T/Tcr; - return tr*I() + J() - log(z()); -} - -double leekesler::sp() -{ - const double Pref = 101325.0; - double rgas = 8314.3/Mw; - return rgas*(log(Pref/(Rho*rgas*T)) - (T/Tcr)*I() - J()); -} - -double leekesler::I() // \int_0^\rho_r (1/\rho_r)(dZ/dT_r) d\rho_r -{ - double Bp, Cp, Dp; - double rtr = Tcr/T; - double rtr2 = rtr*rtr; - double rvr = 8314.3*Tcr*Rho/(Pcr*Mw); // 1/v_r^\prime - double rvr2 = rvr*rvr; - double egrho; - - egrho = exp(-gamma[Isr]*rvr2); - Bp = rtr2*b[Isr][1] + 2.0*rtr*rtr2*b[Isr][2] + 3.0*rtr2*rtr2*b[Isr][3]; - Cp = rtr2*c[Isr][1] - 3.0*c[Isr][2]*rtr2*rtr2; - Dp = -d[Isr][1]*rtr2; - double r = Bp*rvr + 0.5*rvr2*Cp + 0.2*pow(rvr,5)*Dp - - 3.0*c[Isr][3]*rtr2*rtr2*(beta[Isr]*W(0,egrho,gamma[Isr]) - + gamma[Isr]*W(1,egrho,gamma[Isr])); - return r; -} - -double leekesler::J() // \int_0^\rho_r (1/\rho_r)(Z - 1) d\rho_r -{ - double BB, CC, DD; - double rtr = Tcr/T; - double rtr2 = rtr*rtr; - double rvr = 8314.3*Tcr*Rho/(Pcr*Mw); // 1/v_r^\prime - double rvr2 = rvr*rvr; - double egrho; - - egrho = exp(-gamma[Isr]*rvr2); - BB = b[Isr][0] - rtr*(b[Isr][1] - + rtr*(b[Isr][2] + rtr*b[Isr][3])); - CC = c[Isr][0] - rtr*(c[Isr][1] - c[Isr][2]*rtr*rtr); - DD = d[Isr][0] + d[Isr][1]*rtr; - double r = BB*rvr + 0.5*rvr2*CC + 0.2*pow(rvr,5)*DD - + c[Isr][3]*rtr2*rtr*(beta[Isr]*W(0,egrho,gamma[Isr]) - + gamma[Isr]*W(1,egrho,gamma[Isr])); - return r; -} - -double leekesler::z() -{ - double zz, rvr2, BB, CC, DD, EE; - double rtr = Tcr/T; // 1/T_r - double rvr = Rho*8314.3*Tcr/(Pcr*Mw); - rvr2 = rvr*rvr; - BB = b[Isr][0] - rtr*(b[Isr][1] - + rtr*(b[Isr][2] + rtr*b[Isr][3])); - CC = c[Isr][0] - rtr*(c[Isr][1] - c[Isr][2]*rtr*rtr); - DD = d[Isr][0] + d[Isr][1]*rtr; - EE = exp(-gamma[Isr]*rvr2); - - zz = 1.0 + BB*rvr + CC*rvr2 + DD*pow(rvr,5) - + c[Isr][3]*pow(rtr,3)*rvr2* - (beta[Isr] + gamma[Isr]*rvr2)*EE; - return zz; -} - -double leekesler::Pp() -{ - return 8314.3*z()*Rho*T/Mw; -} - -double leekesler::Psat() -{ - double tr = 1.0 - Tcr/T; - double lpr; - - if (Isr == 0) { - lpr = 5.395743797*tr + 0.05524287*tr*tr + 0.06853005*tr*tr*tr; - } else { - lpr = 7.259961465*tr - 0.549206092*tr*tr + 0.177581752*tr*tr*tr; - } - return Pcr*exp(lpr); -} - -double leekesler::ldens() -{ - double x = 1.0 - T/Tcr; - - // for simple fluid - double rho_r; - if (Isr == 0) { - rho_r = 5.2307 + 15.16*x - 21.9778*x*x + 18.767*x*x*x; - } else { - rho_r = 6.166930606 + 17.42866964*x - 18.62589833*x*x - + 11.73957224*x*x*x; - rho_r *= 1.0; - } - return Pcr*rho_r*Mw/(8314.3*Tcr); -} - -double leekesler::Tcrit() -{ - return Tcr; -} -double leekesler::Pcrit() -{ - return Pcr; -} -double leekesler::Vcrit() -{ - return 0.2901*8314.3*Tcr/(Pcr*Mw); -} -double leekesler::Tmin() -{ - return -100.0; -} -double leekesler::Tmax() -{ - return 10000.0; -} -double leekesler::MolWt() -{ - return Mw; -} -} diff --git a/src/tpx/lk.h b/src/tpx/lk.h deleted file mode 100644 index c335dddb7..000000000 --- a/src/tpx/lk.h +++ /dev/null @@ -1,66 +0,0 @@ -//! @file lk.h Lee-Kesler equation of state - -// This file is part of Cantera. See License.txt in the top-level directory or -// at http://www.cantera.org/license.txt for license and copyright information. - -#ifndef TPX_LK_H -#define TPX_LK_H - -#include "cantera/tpx/Sub.h" -#include "cantera/base/global.h" - -namespace tpx -{ - -//! @deprecated To be removed after Cantera 2.3. -class leekesler : public Substance -{ -public: - leekesler(double tc = 1.0, double pc = 1.0, - double wt = 1.0, int itype = 0) { - Tcr = tc; - Cantera::warn_deprecated("class leekesler", - "To be removed after Cantera 2.3."); - Pcr = pc; - Mw = wt; - Isr = itype; // simple fluid or reference - m_name = "Lee-Kesler"; - m_formula = "---"; - } - - double MolWt(); - double Tcrit(); - double Pcrit(); - double Vcrit(); - double Tmin(); - double Tmax(); - - double Pp(); - double up(); - double sp(); - double Psat(); - double dPsatdT(); - - // compressibility - double z(); - - // enthalpy departure - double hdep(); - - // entropy departure - double sdep(); - - double ldens(); - -protected: - double Tcr, Pcr, Mw; - int Isr; - -private: - double W(int n, double egrho, double gamma); - double I(); - double J(); -}; -} - -#endif // ! TPX_LK_H diff --git a/src/tpx/utils.cpp b/src/tpx/utils.cpp index f3cc70c73..447782894 100644 --- a/src/tpx/utils.cpp +++ b/src/tpx/utils.cpp @@ -14,7 +14,6 @@ #include "Nitrogen.h" #include "Oxygen.h" #include "Water.h" -#include "RedlichKwong.h" namespace tpx { @@ -33,8 +32,6 @@ Substance* newSubstance(const std::string& name) return new oxygen; } else if (lcname == "hfc134a") { return new HFC134a; - } else if (lcname == "rk") { - return new RedlichKwong; } else if (lcname == "carbondioxide") { return new CarbonDioxide; } else if (lcname == "heptane") { @@ -59,8 +56,6 @@ Substance* GetSub(int isub) return new oxygen; } else if (isub == 5) { return new HFC134a; - } else if (isub == 6) { - return new RedlichKwong; } else if (isub == 7) { return new CarbonDioxide; } else if (isub == 8) { diff --git a/src/transport/DustyGasTransport.cpp b/src/transport/DustyGasTransport.cpp index 7c2b3615c..f2d8004b0 100644 --- a/src/transport/DustyGasTransport.cpp +++ b/src/transport/DustyGasTransport.cpp @@ -27,57 +27,6 @@ DustyGasTransport::DustyGasTransport(thermo_t* thermo) : { } -DustyGasTransport::DustyGasTransport(const DustyGasTransport& right) : - m_temp(-1.0), - m_gradP(0.0), - m_knudsen_ok(false), - m_bulk_ok(false), - m_porosity(0.0), - m_tortuosity(1.0), - m_pore_radius(0.0), - m_diam(0.0), - m_perm(-1.0) -{ - *this = right; -} - -DustyGasTransport& DustyGasTransport::operator=(const DustyGasTransport& right) -{ - if (&right == this) { - return *this; - } - Transport::operator=(right); - - m_mw = right.m_mw; - m_d = right.m_d; - m_x = right.m_x; - m_dk = right.m_dk; - m_temp = right.m_temp; - m_multidiff = right.m_multidiff; - m_spwork = right.m_spwork; - m_spwork2 = right.m_spwork2; - m_gradP = right.m_gradP; - m_knudsen_ok = right.m_knudsen_ok; - m_bulk_ok= right.m_bulk_ok; - m_porosity = right.m_porosity; - m_tortuosity = right.m_tortuosity; - m_pore_radius = right.m_pore_radius; - m_diam = right.m_diam; - m_perm = right.m_perm; - - // Warning -> gastran may not point to the correct object - // after this copy. The routine initialize() must be called - m_gastran.reset(right.m_gastran->duplMyselfAsTransport()); - - return *this; -} - -Transport* DustyGasTransport::duplMyselfAsTransport() const -{ - DustyGasTransport* tr = new DustyGasTransport(*this); - return dynamic_cast(tr); -} - void DustyGasTransport::setThermo(thermo_t& thermo) { Transport::setThermo(thermo); diff --git a/src/transport/GasTransport.cpp b/src/transport/GasTransport.cpp index 5375f9ab2..ca937607e 100644 --- a/src/transport/GasTransport.cpp +++ b/src/transport/GasTransport.cpp @@ -36,73 +36,6 @@ GasTransport::GasTransport(ThermoPhase* thermo) : { } -GasTransport::GasTransport(const GasTransport& right) : - m_viscmix(0.0), - m_visc_ok(false), - m_viscwt_ok(false), - m_spvisc_ok(false), - m_bindiff_ok(false), - m_mode(0), - m_polytempvec(5), - m_temp(-1.0), - m_kbt(0.0), - m_sqrt_kbt(0.0), - m_sqrt_t(0.0), - m_logt(0.0), - m_t14(0.0), - m_t32(0.0), - m_log_level(0) -{ -} - -GasTransport& GasTransport::operator=(const GasTransport& right) -{ - m_molefracs = right.m_molefracs; - m_viscmix = right.m_viscmix; - m_visc_ok = right.m_visc_ok; - m_viscwt_ok = right.m_viscwt_ok; - m_spvisc_ok = right.m_spvisc_ok; - m_bindiff_ok = right.m_bindiff_ok; - m_mode = right.m_mode; - m_phi = right.m_phi; - m_spwork = right.m_spwork; - m_visc = right.m_visc; - m_mw = right.m_mw; - m_wratjk = right.m_wratjk; - m_wratkj1 = right.m_wratkj1; - m_sqvisc = right.m_sqvisc; - m_polytempvec = right.m_polytempvec; - m_temp = right.m_temp; - m_kbt = right.m_kbt; - m_sqrt_kbt = right.m_sqrt_kbt; - m_sqrt_t = right.m_sqrt_t; - m_logt = right.m_logt; - m_t14 = right.m_t14; - m_t32 = right.m_t32; - m_diffcoeffs = right.m_diffcoeffs; - m_bdiff = right.m_bdiff; - m_condcoeffs = right.m_condcoeffs; - m_poly = right.m_poly; - m_omega22_poly = right.m_omega22_poly; - m_astar_poly = right.m_astar_poly; - m_bstar_poly = right.m_bstar_poly; - m_cstar_poly = right.m_cstar_poly; - m_zrot = right.m_zrot; - m_polar = right.m_polar; - m_alpha = right.m_alpha; - m_eps = right.m_eps; - m_sigma = right.m_sigma; - m_reducedMass = right.m_reducedMass; - m_diam = right.m_diam; - m_epsilon = right.m_epsilon; - m_dipole = right.m_dipole; - m_delta = right.m_delta; - m_w_ac = right.m_w_ac; - m_log_level = right.m_log_level; - - return *this; -} - void GasTransport::update_T() { if (m_thermo->nSpecies() != m_nsp) { diff --git a/src/transport/LiquidTransport.cpp b/src/transport/LiquidTransport.cpp index cbd68f01e..e80a34129 100644 --- a/src/transport/LiquidTransport.cpp +++ b/src/transport/LiquidTransport.cpp @@ -54,137 +54,6 @@ LiquidTransport::LiquidTransport(thermo_t* thermo, int ndim) : { } -LiquidTransport::LiquidTransport(const LiquidTransport& right) : - Transport(right.m_thermo, right.m_nDim), - m_nsp2(0), - m_viscMixModel(0), - m_ionCondMixModel(0), - m_lambdaMixModel(0), - m_diffMixModel(0), - m_radiusMixModel(0), - m_iStateMF(-1), - concTot_(0.0), - concTot_tran_(0.0), - dens_(0.0), - m_temp(-1.0), - m_press(-1.0), - m_lambda(-1.0), - m_viscmix(-1.0), - m_ionCondmix(-1.0), - m_visc_mix_ok(false), - m_visc_temp_ok(false), - m_visc_conc_ok(false), - m_ionCond_mix_ok(false), - m_ionCond_temp_ok(false), - m_ionCond_conc_ok(false), - m_mobRat_mix_ok(false), - m_mobRat_temp_ok(false), - m_mobRat_conc_ok(false), - m_selfDiff_mix_ok(false), - m_selfDiff_temp_ok(false), - m_selfDiff_conc_ok(false), - m_radi_mix_ok(false), - m_radi_temp_ok(false), - m_radi_conc_ok(false), - m_diff_mix_ok(false), - m_diff_temp_ok(false), - m_lambda_temp_ok(false), - m_lambda_mix_ok(false), - m_mode(-1000), - m_debug(false) -{ - /* - * Use the assignment operator to do the brunt - * of the work for the copy constructor. - */ - *this = right; -} - -LiquidTransport& LiquidTransport::operator=(const LiquidTransport& right) -{ - if (&right == this) { - return *this; - } - Transport::operator=(right); - m_nsp2 = right.m_nsp2; - m_mw = right.m_mw; - m_viscTempDep_Ns = right.m_viscTempDep_Ns; - m_ionCondTempDep_Ns = right.m_ionCondTempDep_Ns; - m_mobRatTempDep_Ns = right.m_mobRatTempDep_Ns; - m_selfDiffTempDep_Ns = right.m_selfDiffTempDep_Ns; - m_lambdaTempDep_Ns = right.m_lambdaTempDep_Ns; - m_diffTempDep_Ns = right.m_diffTempDep_Ns; - m_radiusTempDep_Ns = right.m_radiusTempDep_Ns; - m_hydrodynamic_radius = right.m_hydrodynamic_radius; - m_Grad_X = right.m_Grad_X; - m_Grad_T = right.m_Grad_T; - m_Grad_V = right.m_Grad_V; - m_Grad_mu = right.m_Grad_mu; - m_bdiff = right.m_bdiff; - m_viscSpecies = right.m_viscSpecies; - m_ionCondSpecies = right.m_ionCondSpecies; - m_mobRatSpecies = right.m_mobRatSpecies; - m_selfDiffSpecies = right.m_selfDiffSpecies; - m_hydrodynamic_radius = right.m_hydrodynamic_radius; - m_lambdaSpecies = right.m_lambdaSpecies; - m_viscMixModel = right.m_viscMixModel; - m_ionCondMixModel = right.m_ionCondMixModel; - m_mobRatMixModel = right.m_mobRatMixModel; - m_selfDiffMixModel = right.m_selfDiffMixModel; - m_lambdaMixModel = right.m_lambdaMixModel; - m_diffMixModel = right.m_diffMixModel; - m_iStateMF = -1; - m_massfracs = right.m_massfracs; - m_massfracs_tran = right.m_massfracs_tran; - m_molefracs = right.m_molefracs; - m_molefracs_tran = right.m_molefracs_tran; - m_concentrations = right.m_concentrations; - m_actCoeff = right.m_actCoeff; - m_Grad_lnAC = right.m_Grad_lnAC; - m_chargeSpecies = right.m_chargeSpecies; - m_B = right.m_B; - m_A = right.m_A; - m_temp = right.m_temp; - m_press = right.m_press; - m_flux = right.m_flux; - m_Vdiff = right.m_Vdiff; - m_lambda = right.m_lambda; - m_viscmix = right.m_viscmix; - m_ionCondmix = right.m_ionCondmix; - m_mobRatMix = right.m_mobRatMix; - m_selfDiffMix = right.m_selfDiffMix; - m_spwork = right.m_spwork; - m_visc_mix_ok = false; - m_visc_temp_ok = false; - m_visc_conc_ok = false; - m_ionCond_mix_ok = false; - m_ionCond_temp_ok = false; - m_ionCond_conc_ok = false; - m_mobRat_mix_ok = false; - m_mobRat_temp_ok = false; - m_mobRat_conc_ok = false; - m_selfDiff_mix_ok = false; - m_selfDiff_temp_ok = false; - m_selfDiff_conc_ok = false; - m_radi_mix_ok = false; - m_radi_temp_ok = false; - m_radi_conc_ok = false; - m_diff_mix_ok = false; - m_diff_temp_ok = false; - m_lambda_temp_ok = false; - m_lambda_mix_ok = false; - m_mode = right.m_mode; - m_debug = right.m_debug; - m_nDim = right.m_nDim; - - return *this; -} - -Transport* LiquidTransport::duplMyselfAsTransport() const -{ - return new LiquidTransport(*this); -} - LiquidTransport::~LiquidTransport() { //These are constructed in TransportFactory::newLTP diff --git a/src/transport/LiquidTransportParams.cpp b/src/transport/LiquidTransportParams.cpp index 66c28bd17..23f27633a 100644 --- a/src/transport/LiquidTransportParams.cpp +++ b/src/transport/LiquidTransportParams.cpp @@ -36,69 +36,4 @@ LiquidTransportParams::~LiquidTransportParams() delete hydroRadius; } -LiquidTransportParams::LiquidTransportParams(const LiquidTransportParams& right) : - viscosity(0), - thermalCond(0), - speciesDiffusivity(0), - electCond(0), - hydroRadius(0), - model_viscosity(LTI_MODEL_NOTSET), - model_speciesDiffusivity(LTI_MODEL_NOTSET), - model_hydroradius(LTI_MODEL_NOTSET), - compositionDepTypeDefault_(LTI_MODEL_NOTSET) -{ - operator=(right); -} - -LiquidTransportParams& LiquidTransportParams::operator=(const LiquidTransportParams& right) -{ - if (&right != this) { - return *this; - } - - LTData = right.LTData; - - delete viscosity; - if (right.viscosity) { - viscosity = new LiquidTranInteraction(*(right.viscosity)); - } - delete ionConductivity; - if (right.ionConductivity) { - ionConductivity = new LiquidTranInteraction(*(right.ionConductivity)); - } - deepStdVectorPointerCopy(right.mobilityRatio, mobilityRatio); - deepStdVectorPointerCopy(right.selfDiffusion, selfDiffusion); - - delete thermalCond; - if (right.thermalCond) { - thermalCond = new LiquidTranInteraction(*(right.thermalCond)); - } - delete speciesDiffusivity; - if (right.speciesDiffusivity) { - speciesDiffusivity = new LiquidTranInteraction(*(right.speciesDiffusivity)); - } - - delete electCond; - if (right.electCond) { - electCond = new LiquidTranInteraction(*(right.electCond)); - } - delete hydroRadius; - if (right.hydroRadius) { - hydroRadius = new LiquidTranInteraction(*(right.hydroRadius)); - } - model_viscosity = right.model_viscosity; - model_ionConductivity = right.model_ionConductivity; - deepStdVectorPointerCopy(right.model_mobilityRatio, model_mobilityRatio); - deepStdVectorPointerCopy(right.model_selfDiffusion, model_selfDiffusion); - thermalCond_Aij = right.thermalCond_Aij; - model_speciesDiffusivity = right.model_speciesDiffusivity; - diff_Dij = right.diff_Dij; - model_hydroradius = right.model_hydroradius; - radius_Aij = right.radius_Aij; - compositionDepTypeDefault_ = right.compositionDepTypeDefault_; - - throw CanteraError("LiquidTransportParams(const LiquidTransportParams &right)", "not tested"); - return *this; -} - } //namespace Cantera diff --git a/src/transport/MixTransport.cpp b/src/transport/MixTransport.cpp index 427371730..f1d1860ec 100644 --- a/src/transport/MixTransport.cpp +++ b/src/transport/MixTransport.cpp @@ -21,37 +21,6 @@ MixTransport::MixTransport() : { } -MixTransport::MixTransport(const MixTransport& right) : - GasTransport(right), - m_lambda(0.0), - m_spcond_ok(false), - m_condmix_ok(false), - m_debug(false) -{ - *this = right; -} - -MixTransport& MixTransport::operator=(const MixTransport& right) -{ - if (&right == this) { - return *this; - } - GasTransport::operator=(right); - - m_cond = right.m_cond; - m_lambda = right.m_lambda; - m_spcond_ok = right.m_spcond_ok; - m_condmix_ok = right.m_condmix_ok; - m_debug = right.m_debug; - - return *this; -} - -Transport* MixTransport::duplMyselfAsTransport() const -{ - return new MixTransport(*this); -} - void MixTransport::init(ThermoPhase* thermo, int mode, int log_level) { GasTransport::init(thermo, mode, log_level); diff --git a/src/transport/SimpleTransport.cpp b/src/transport/SimpleTransport.cpp index 7f7ea9c9d..a83b5250f 100644 --- a/src/transport/SimpleTransport.cpp +++ b/src/transport/SimpleTransport.cpp @@ -37,106 +37,6 @@ SimpleTransport::SimpleTransport(thermo_t* thermo, int ndim) : { } -SimpleTransport::SimpleTransport(const SimpleTransport& right) : - tempDepType_(0), - compositionDepType_(LTI_MODEL_SOLVENT), - useHydroRadius_(false), - doMigration_(0), - m_iStateMF(-1), - concTot_(0.0), - m_temp(-1.0), - m_press(-1.0), - m_lambda(-1.0), - m_viscmix(-1.0), - m_visc_mix_ok(false), - m_visc_temp_ok(false), - m_diff_mix_ok(false), - m_diff_temp_ok(false), - m_cond_temp_ok(false), - m_cond_mix_ok(false), - m_nDim(1) -{ - // Use the assignment operator to do the brunt of the work for the copy - // constructor. - *this = right; -} - -SimpleTransport& SimpleTransport::operator=(const SimpleTransport& right) -{ - if (&right == this) { - return *this; - } - Transport::operator=(right); - - tempDepType_ = right.tempDepType_; - compositionDepType_ = right.compositionDepType_; - useHydroRadius_ = right.useHydroRadius_; - doMigration_ = right.doMigration_; - m_mw = right.m_mw; - - m_coeffVisc_Ns = right.m_coeffVisc_Ns; - for (size_t k = 0; k duplMyselfAsLTPspecies(); - } - } - - m_coeffLambda_Ns = right.m_coeffLambda_Ns; - for (size_t k = 0; k < right.m_coeffLambda_Ns.size(); k++) { - if (right.m_coeffLambda_Ns[k]) { - m_coeffLambda_Ns[k] = (right.m_coeffLambda_Ns[k])->duplMyselfAsLTPspecies(); - } - } - - m_coeffDiff_Ns = right.m_coeffDiff_Ns; - for (size_t k = 0; k < right.m_coeffDiff_Ns.size(); k++) { - if (right.m_coeffDiff_Ns[k]) { - m_coeffDiff_Ns[k] = (right.m_coeffDiff_Ns[k])->duplMyselfAsLTPspecies(); - } - } - - m_coeffHydroRadius_Ns = right.m_coeffHydroRadius_Ns; - for (size_t k = 0; k < right.m_coeffHydroRadius_Ns.size(); k++) { - if (right.m_coeffHydroRadius_Ns[k]) { - m_coeffHydroRadius_Ns[k] = (right.m_coeffHydroRadius_Ns[k])->duplMyselfAsLTPspecies(); - } - } - - m_Grad_X = right.m_Grad_X; - m_Grad_T = right.m_Grad_T; - m_Grad_P = right.m_Grad_P; - m_Grad_V = right.m_Grad_V; - m_diffSpecies = right.m_diffSpecies; - m_viscSpecies = right.m_viscSpecies; - m_condSpecies = right.m_condSpecies; - m_iStateMF = -1; - m_molefracs = right.m_molefracs; - m_concentrations = right.m_concentrations; - concTot_ = right.concTot_; - meanMolecularWeight_ = right.meanMolecularWeight_; - dens_ = right.dens_; - m_chargeSpecies = right.m_chargeSpecies; - m_temp = right.m_temp; - m_press = right.m_press; - m_lambda = right.m_lambda; - m_viscmix = right.m_viscmix; - m_spwork = right.m_spwork; - m_visc_mix_ok = false; - m_visc_temp_ok = false; - m_diff_mix_ok = false; - m_diff_temp_ok = false; - m_cond_temp_ok = false; - m_cond_mix_ok = false; - m_nDim = right.m_nDim; - - return *this; -} - -Transport* SimpleTransport::duplMyselfAsTransport() const -{ - return new SimpleTransport(*this); -} - SimpleTransport::~SimpleTransport() { for (size_t k = 0; k < m_coeffVisc_Ns.size() ; k++) { diff --git a/src/transport/SolidTransport.cpp b/src/transport/SolidTransport.cpp index 7cc9bf979..a899b4bee 100644 --- a/src/transport/SolidTransport.cpp +++ b/src/transport/SolidTransport.cpp @@ -24,43 +24,6 @@ SolidTransport::SolidTransport() : { } -SolidTransport::SolidTransport(const SolidTransport& right) : - m_nmobile(0), - m_Alam(-1.0), - m_Nlam(0), - m_Elam(0) -{ - // Use the assignment operator to do the brunt of the work for the copy - // constructor. - *this = right; -} - -SolidTransport& SolidTransport::operator=(const SolidTransport& b) -{ - if (&b != this) { - return *this; - } - Transport::operator=(b); - - m_nmobile = b.m_nmobile; - m_Adiff = b.m_Adiff; - m_Ndiff = b.m_Ndiff; - m_Ediff = b.m_Ediff; - m_sp = b.m_sp; - m_Alam = b.m_Alam; - m_Nlam = b.m_Nlam; - m_Elam = b.m_Elam; - - return *this; - -} - -Transport* SolidTransport::duplMyselfAsTransport() const -{ - SolidTransport* tr = new SolidTransport(*this); - return dynamic_cast(tr); -} - bool SolidTransport::initSolid(SolidTransportData& tr) { m_thermo = tr.thermo; @@ -80,7 +43,6 @@ bool SolidTransport::initSolid(SolidTransportData& tr) void SolidTransport::setParameters(const int n, const int k, const doublereal* const p) { - warn_deprecated("SolidTransport::setParameters"); switch (n) { case 0: // set the Arrhenius parameters for the diffusion coefficient diff --git a/src/transport/TransportBase.cpp b/src/transport/TransportBase.cpp index 99ac0bcfa..5bd76732e 100644 --- a/src/transport/TransportBase.cpp +++ b/src/transport/TransportBase.cpp @@ -21,39 +21,6 @@ Transport::Transport(thermo_t* thermo, size_t ndim) : { } -Transport::Transport(const Transport& right) -{ - warn_deprecated("Transport copy constructor", "To be removed after" - " Cantera 2.3 for all classes derived from Transport."); - m_thermo = right.m_thermo; - m_ready = right.m_ready; - m_nsp = right.m_nsp; - m_nDim = right.m_nDim; - m_velocityBasis = right.m_velocityBasis; -} - -Transport& Transport::operator=(const Transport& right) -{ - warn_deprecated("Transport assignment operator", "To be removed after" - " Cantera 2.3 for all classes derived from Transport."); - if (&right != this) { - return *this; - } - m_thermo = right.m_thermo; - m_ready = right.m_ready; - m_nsp = right.m_nsp; - m_nDim = right.m_nDim; - m_velocityBasis = right.m_velocityBasis; - return *this; -} - -Transport* Transport::duplMyselfAsTransport() const -{ - warn_deprecated("Transport::duplMyselfAsTransport", - "To be removed after Cantera 2.3."); - return new Transport(*this); -} - bool Transport::ready() { return m_ready; diff --git a/src/transport/TransportFactory.cpp b/src/transport/TransportFactory.cpp index 2634f2ac9..63309063e 100644 --- a/src/transport/TransportFactory.cpp +++ b/src/transport/TransportFactory.cpp @@ -54,21 +54,6 @@ TransportFactory::TransportFactory() m_CK_mode["CK_Mix"] = true; m_CK_mode["CK_Multi"] = true; - m_models["Mix"] = cMixtureAveraged; - m_models["Multi"] = cMulticomponent; - m_models["Solid"] = cSolidTransport; - m_models["DustyGas"] = cDustyGasTransport; - m_models["CK_Multi"] = CK_Multicomponent; - m_models["CK_Mix"] = CK_MixtureAveraged; - m_models["Liquid"] = cLiquidTransport; - m_models["Simple"] = cSimpleTransport; - m_models["User"] = cUserTransport; - m_models["HighP"] = cHighP; - m_models["None"] = None; - for (const auto& model : m_models) { - m_modelNames[model.second] = model.first; - } - m_tranPropMap["viscosity"] = TP_VISCOSITY; m_tranPropMap["ionConductivity"] = TP_IONCONDUCTIVITY; m_tranPropMap["mobilityRatio"] = TP_MOBILITYRATIO; @@ -105,13 +90,6 @@ void TransportFactory::deleteFactory() s_factory = 0; } -std::string TransportFactory::modelName(int model) -{ - warn_deprecated("TransportFactory::modelName", - "To be removed after Cantera 2.3."); - return getValue(factory()->m_modelNames, model, ""); -} - LTPspecies* TransportFactory::newLTP(const XML_Node& trNode, const std::string& name, TransportPropertyType tp_ind, thermo_t* thermo) { @@ -590,33 +568,15 @@ void TransportFactory::getSolidTransportData(const XML_Node& transportNode, } } - -Transport* newTransportMgr(const std::string& transportModel, thermo_t* thermo, int loglevel, TransportFactory* f, int ndim) -{ - warn_deprecated("newTransportMgr(string, thermo_t*, int, TransportFactory*, int)", - "This overload is deprecated and will be removed after Cantera 2.3." - " Use the version that does not take a TransportFactory*."); - if (f == 0) { - f = TransportFactory::factory(); - } - return f->newTransport(transportModel, thermo, loglevel, ndim); -} - Transport* newTransportMgr(const std::string& transportModel, thermo_t* thermo, int loglevel, int ndim) { TransportFactory* f = TransportFactory::factory(); return f->newTransport(transportModel, thermo, loglevel, ndim); } -Transport* newDefaultTransportMgr(thermo_t* thermo, int loglevel, TransportFactory* f) +Transport* newDefaultTransportMgr(thermo_t* thermo, int loglevel) { - if (f == 0) { - f = TransportFactory::factory(); - } else { - warn_deprecated("newDefaultTransportMgr(ThermoPhase*, int, TransportFactory*)", - "The `TransportFactory*` argument to this function is deprecated" - " and will be removed after Cantera 2.3."); - } - return f->newTransport(thermo, loglevel); + return TransportFactory::factory()->newTransport(thermo, loglevel); } + } diff --git a/src/transport/WaterTransport.cpp b/src/transport/WaterTransport.cpp index 3ad46e5fc..1a9993166 100644 --- a/src/transport/WaterTransport.cpp +++ b/src/transport/WaterTransport.cpp @@ -19,31 +19,6 @@ WaterTransport::WaterTransport(thermo_t* thermo, int ndim) : initTP(); } -WaterTransport::WaterTransport(const WaterTransport& right) : - Transport(right.m_thermo, right.m_nDim) -{ - *this = right; -} - -WaterTransport& WaterTransport::operator=(const WaterTransport& right) -{ - if (&right != this) { - return *this; - } - Transport::operator=(right); - - // All pointers in this routine are shallow pointers. Therefore, it's - // ok just to reinitialize them - initTP(); - - return *this; -} - -Transport* WaterTransport::duplMyselfAsTransport() const -{ - return new WaterTransport(*this); -} - void WaterTransport::initTP() { // The expectation is that we have a VPStandardStateTP derived object diff --git a/src/zeroD/ConstPressureReactor.cpp b/src/zeroD/ConstPressureReactor.cpp index 3aa110d01..0c3eb4823 100644 --- a/src/zeroD/ConstPressureReactor.cpp +++ b/src/zeroD/ConstPressureReactor.cpp @@ -13,14 +13,6 @@ using namespace std; namespace Cantera { -void ConstPressureReactor::getInitialConditions(double t0, size_t leny, - double* y) -{ - warn_deprecated("ConstPressureReactor::getInitialConditions", - "Use getState instead. To be removed after Cantera 2.3."); - getState(y); -} - void ConstPressureReactor::getState(double* y) { if (m_thermo == 0) { @@ -133,19 +125,9 @@ size_t ConstPressureReactor::componentIndex(const string& nm) const size_t k = speciesIndex(nm); if (k != npos) { return k + 2; - } else if (nm == "m" || nm == "mass") { - if (nm == "m") { - warn_deprecated("ConstPressureReactor::componentIndex(\"m\")", - "Using the name 'm' for mass is deprecated, and will be " - "disabled after Cantera 2.3. Use 'mass' instead."); - } + } else if (nm == "mass") { return 0; - } else if (nm == "H" || nm == "enthalpy") { - if (nm == "H") { - warn_deprecated("ConstPressureReactor::componentIndex(\"H\")", - "Using the name 'H' for enthalpy is deprecated, and will be " - "disabled after Cantera 2.3. Use 'enthalpy' instead."); - } + } else if (nm == "enthalpy") { return 1; } else { return npos; diff --git a/src/zeroD/FlowReactor.cpp b/src/zeroD/FlowReactor.cpp index 6e728a5c6..a463c6ad4 100644 --- a/src/zeroD/FlowReactor.cpp +++ b/src/zeroD/FlowReactor.cpp @@ -23,13 +23,6 @@ FlowReactor::FlowReactor() : { } -void FlowReactor::getInitialConditions(double t0, size_t leny, double* y) -{ - warn_deprecated("FlowReactor::getInitialConditions", - "Use getState instead. To be removed after Cantera 2.3."); - getState(y); -} - void FlowReactor::getState(double* y) { if (m_thermo == 0) { diff --git a/src/zeroD/IdealGasConstPressureReactor.cpp b/src/zeroD/IdealGasConstPressureReactor.cpp index 260466599..772a6a733 100644 --- a/src/zeroD/IdealGasConstPressureReactor.cpp +++ b/src/zeroD/IdealGasConstPressureReactor.cpp @@ -22,15 +22,6 @@ void IdealGasConstPressureReactor::setThermoMgr(ThermoPhase& thermo) Reactor::setThermoMgr(thermo); } - -void IdealGasConstPressureReactor::getInitialConditions(double t0, size_t leny, - double* y) -{ - warn_deprecated("IdealGasConstPressureReactor::getInitialConditions", - "Use getState instead. To be removed after Cantera 2.3."); - getState(y); -} - void IdealGasConstPressureReactor::getState(double* y) { if (m_thermo == 0) { @@ -143,19 +134,9 @@ size_t IdealGasConstPressureReactor::componentIndex(const string& nm) const size_t k = speciesIndex(nm); if (k != npos) { return k + 2; - } else if (nm == "m" || nm == "mass") { - if (nm == "m") { - warn_deprecated("IdealGasConstPressureReactor::componentIndex(\"m\")", - "Using the name 'm' for mass is deprecated, and will be " - "disabled after Cantera 2.3. Use 'mass' instead."); - } + } else if (nm == "mass") { return 0; - } else if (nm == "T" || nm == "temperature") { - if (nm == "T") { - warn_deprecated("IdealGasConstPressureReactor::componentIndex(\"T\")", - "Using the name 'T' for temperature is deprecated, and will be " - "disabled after Cantera 2.3. Use 'temperature' instead."); - } + } else if (nm == "temperature") { return 1; } else { return npos; diff --git a/src/zeroD/IdealGasReactor.cpp b/src/zeroD/IdealGasReactor.cpp index cdfdfb270..05b407d22 100644 --- a/src/zeroD/IdealGasReactor.cpp +++ b/src/zeroD/IdealGasReactor.cpp @@ -23,13 +23,6 @@ void IdealGasReactor::setThermoMgr(ThermoPhase& thermo) Reactor::setThermoMgr(thermo); } -void IdealGasReactor::getInitialConditions(double t0, size_t leny, double* y) -{ - warn_deprecated("IdealGasReactor::getInitialConditions", - "Use getState instead. To be removed after Cantera 2.3."); - getState(y); -} - void IdealGasReactor::getState(double* y) { if (m_thermo == 0) { @@ -153,26 +146,11 @@ size_t IdealGasReactor::componentIndex(const string& nm) const size_t k = speciesIndex(nm); if (k != npos) { return k + 3; - } else if (nm == "m" || nm == "mass") { - if (nm == "m") { - warn_deprecated("IdealGasReactor::componentIndex(\"m\")", - "Using the name 'm' for mass is deprecated, and will be " - "disabled after Cantera 2.3. Use 'mass' instead."); - } + } else if (nm == "mass") { return 0; - } else if (nm == "V" || nm == "volume") { - if (nm == "V") { - warn_deprecated("IdealGasReactor::componentIndex(\"V\")", - "Using the name 'V' for volume is deprecated, and will be " - "disabled after Cantera 2.3. Use 'volume' instead."); - } + } else if (nm == "volume") { return 1; - } else if (nm == "T" || nm == "temperature") { - if (nm == "T") { - warn_deprecated("IdealGasReactor::componentIndex(\"T\")", - "Using the name 'T' for temperature is deprecated, and will be " - "disabled after Cantera 2.3. Use 'temperature' instead."); - } + } else if (nm == "temperature") { return 2; } else { return npos; diff --git a/src/zeroD/Reactor.cpp b/src/zeroD/Reactor.cpp index 306b0f167..82c87b4a0 100644 --- a/src/zeroD/Reactor.cpp +++ b/src/zeroD/Reactor.cpp @@ -37,13 +37,6 @@ void Reactor::setKineticsMgr(Kinetics& kin) } } -void Reactor::getInitialConditions(double t0, size_t leny, double* y) -{ - warn_deprecated("Reactor::getInitialConditions", - "Use getState instead. To be removed after Cantera 2.3."); - getState(y); -} - void Reactor::getState(double* y) { if (m_thermo == 0) { @@ -96,9 +89,6 @@ void Reactor::initialize(doublereal t0) for (size_t n = 0; n < m_wall.size(); n++) { Wall* W = m_wall[n]; W->initialize(); - if (W->kinetics(m_lr[n])) { - addSurface(W->reactorSurface(m_lr[n])); - } } m_nv = m_nsp + 3; @@ -352,26 +342,11 @@ size_t Reactor::componentIndex(const string& nm) const size_t k = speciesIndex(nm); if (k != npos) { return k + 3; - } else if (nm == "m" || nm == "mass") { - if (nm == "m") { - warn_deprecated("Reactor::componentIndex(\"m\")", - "Using the name 'm' for mass is deprecated, and will be " - "disabled after Cantera 2.3. Use 'mass' instead."); - } + } else if (nm == "mass") { return 0; - } else if (nm == "V" || nm == "volume") { - if (nm == "V") { - warn_deprecated("Reactor::componentIndex(\"V\")", - "Using the name 'V' for volume is deprecated, and will be " - "disabled after Cantera 2.3. Use 'volume' instead."); - } + } else if (nm == "volume") { return 1; - } else if (nm == "U" || nm == "int_energy") { - if (nm == "U") { - warn_deprecated("Reactor::componentIndex(\"U\")", - "Using the name 'U' for internal energy is deprecated, and " - "will be disabled after Cantera 2.3. Use 'int_energy' instead."); - } + } else if (nm == "int_energy") { return 2; } else { return npos; diff --git a/src/zeroD/ReactorNet.cpp b/src/zeroD/ReactorNet.cpp index d85da613c..590d51acb 100644 --- a/src/zeroD/ReactorNet.cpp +++ b/src/zeroD/ReactorNet.cpp @@ -136,12 +136,8 @@ void ReactorNet::advance(doublereal time) updateState(m_integ->solution()); } -double ReactorNet::step(doublereal time) +double ReactorNet::step() { - if (time != -999) { - warn_deprecated("ReactorNet::step(t)", "The argument to this function" - " is deprecated and will be removed after Cantera 2.3."); - } if (!m_init) { initialize(); } else if (!m_integrator_init) { @@ -215,13 +211,6 @@ void ReactorNet::updateState(doublereal* y) } } -void ReactorNet::getInitialConditions(double t0, size_t leny, double* y) -{ - warn_deprecated("ReactorNet::getInitialConditions", - "Use getState instead. To be removed after Cantera 2.3."); - getState(y); -} - void ReactorNet::getState(double* y) { for (size_t n = 0; n < m_reactors.size(); n++) { diff --git a/src/zeroD/Wall.cpp b/src/zeroD/Wall.cpp index faa29910e..a39251c6d 100644 --- a/src/zeroD/Wall.cpp +++ b/src/zeroD/Wall.cpp @@ -33,14 +33,6 @@ bool Wall::install(ReactorBase& rleft, ReactorBase& rright) return true; } -void Wall::setKinetics(Kinetics* left, Kinetics* right) -{ - warn_deprecated("Wall::setKinetics", "Use class ReactorSurface instead. " - "To be removed after Cantera 2.3."); - m_surf[0].setKinetics(left); - m_surf[1].setKinetics(right); -} - doublereal Wall::vdot(doublereal t) { double rate1 = m_k * m_area * (m_left->pressure() - m_right->pressure()); @@ -65,46 +57,4 @@ doublereal Wall::Q(doublereal t) return q1; } -void Wall::setCoverages(int leftright, const doublereal* cov) -{ - m_surf[leftright].setCoverages(cov); -} - -void Wall::setCoverages(int leftright, const compositionMap& cov) -{ - m_surf[leftright].setCoverages(cov); -} - -void Wall::setCoverages(int leftright, const std::string& cov) -{ - m_surf[leftright].setCoverages(cov); -} - -void Wall::getCoverages(int leftright, doublereal* cov) -{ - m_surf[leftright].getCoverages(cov); -} - -void Wall::syncCoverages(int leftright) -{ - m_surf[leftright].syncCoverages(); -} - -void Wall::addSensitivityReaction(int leftright, size_t rxn) -{ - m_surf[leftright].addSensitivityReaction(rxn); -} - -void Wall::setSensitivityParameters(double* params) -{ - m_surf[0].setSensitivityParameters(params); - m_surf[1].setSensitivityParameters(params); -} - -void Wall::resetSensitivityParameters() -{ - m_surf[0].resetSensitivityParameters(); - m_surf[1].resetSensitivityParameters(); -} - } diff --git a/test_problems/SConscript b/test_problems/SConscript index 083cccbbb..d11db5a88 100644 --- a/test_problems/SConscript +++ b/test_problems/SConscript @@ -177,10 +177,6 @@ Test('DH_graph_Pitzer', 'cathermo/DH_graph_1', artifacts=['DH_graph_1.log', dhGraph_name], arguments='DH_NaCl_Pitzer.xml') -CompileAndTest('HMW_dupl_test', 'cathermo/HMW_dupl_test', - 'HMW_dupl_test', 'output_blessed.txt', - artifacts=['DH_graph_1.log'], - arguments='HMW_NaCl_sp1977_alt.xml') CompileAndTest('HMW_graph_CpvT', 'cathermo/HMW_graph_CpvT', 'HMW_graph_CpvT', 'output_blessed.txt', extensions=['^HMW_graph_CpvT.cpp'], diff --git a/test_problems/cathermo/HMW_dupl_test/HMW_NaCl_sp1977_alt.xml b/test_problems/cathermo/HMW_dupl_test/HMW_NaCl_sp1977_alt.xml deleted file mode 100644 index 0e4b0e510..000000000 --- a/test_problems/cathermo/HMW_dupl_test/HMW_NaCl_sp1977_alt.xml +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - H2O(L) Cl- H+ Na+ OH- - - - 298.15 - 101325.0 - - Na+:6.0954 - Cl-:6.0954 - H+:2.1628E-9 - OH-:1.3977E-6 - - - - - - - - - - - - 0.0765, 0.008946, -3.3158E-6, - -777.03, -4.4706 - - 0.2664, 6.1608E-5, 1.0715E-6 , 0.0, 0.0 - 0.0 , 0.0, 0.0, 0.0, 0.0 - 0.00127, -4.655E-5, 0.0, - 33.317, 0.09421 - - 2.0 - - - - 0.1775, 0.0, 0.0, 0.0, 0.0 - 0.2945, 0.0, 0.0, 0.0, 0.0 - 0.0, 0.0, 0.0, 0.0, 0.0 - 0.0008, 0.0, 0.0, 0.0, 0.0 - 2.0 - - - - 0.0864, 0.0, 0.0, 0.0, 0.0 - 0.253, 0.0, 0.0, 0.0, 0.0 - 0.0, 0.0, 0.0, 0.0, 0.0 - 0.0044, 0.0, 0.0, 0.0, 0.0 - 2.0 - - - - -0.05 - - - - -0.05 - -0.006 - - - - 0.036 - - - - 0.036 - -0.004 - - - - H2O(L) - - O H C E Fe Si N Na Cl - - - - - - - - - - H:2 O:1 - - - - 7.255750050E+01, -6.624454020E-01, 2.561987460E-03, -4.365919230E-06, - 2.781789810E-09, -4.188654990E+04, -2.882801370E+02 - - - - - - - - - - - Na:1 E:-1 - +1 - - - - -57993.47558 , 305112.6040 , -592222.1591 , - 401977.9827 , 804.4195980 , 10625.24901 , - -133796.2298 - - - - - - - 0.00834 - - - - - - Cl:1 E:1 - -1 - - - - 0.00834 - - - - - 56696.2042 , -297835.978 , 581426.549 , - -401759.991 , -804.301136 , -10873.8257 , - 130650.697 - - - - - - - - H:1 E:-1 - +1 - - 0.0 - - - - 0.0 - 3 - - 0.0 , 0.0, 0.0 - - - 273.15, 298.15 , 623.15 - - - - - - - - O:1 H:1 E:1 - -1 - - - 0.00834 - - - - - 44674.99961 , -234943.0414 , 460522.8260 , - -320695.1836 , -638.5044716 , -8683.955813 , - 102874.2667 - - - - - - - - diff --git a/test_problems/cathermo/HMW_dupl_test/HMW_dupl_test.cpp b/test_problems/cathermo/HMW_dupl_test/HMW_dupl_test.cpp deleted file mode 100644 index e23786252..000000000 --- a/test_problems/cathermo/HMW_dupl_test/HMW_dupl_test.cpp +++ /dev/null @@ -1,257 +0,0 @@ -/** - * - * @file HMW_graph_1.cpp - */ - -#include "cantera/thermo.h" -#include "TemperatureTable.h" -#include "cantera/thermo/HMWSoln.h" - -#include - -using namespace std; -using namespace Cantera; - -int main(int argc, char** argv) -{ - suppress_deprecation_warnings(); - int retn = 0; - size_t i; - - try { - std::string iFile = (argc > 1) ? argv[1] : "HMW_NaCl.xml"; - double Cp0_R[20], pmCp[20]; - - HMWSoln* HMW = new HMWSoln(iFile, "NaCl_electrolyte"); - - /* - * Load in and initialize the - */ - ThermoPhase* solid = newPhase("NaCl_Solid.xml","NaCl(S)"); - - - size_t nsp = HMW->nSpecies(); - double mf[100]; - double moll[100]; - for (i = 0; i < 100; i++) { - mf[i] = 0.0; - } - - HMW->getMoleFractions(mf); - string sName; - - TemperatureTable TTable(15, false, 273.15, 25., 0, 0); - - - HMW->setState_TP(298.15, 1.01325E5); - - size_t i1 = HMW->speciesIndex("Na+"); - size_t i2 = HMW->speciesIndex("Cl-"); - for (i = 0; i < nsp; i++) { - moll[i] = 0.0; - } - HMW->setMolalities(moll); - - double Is = 0.0; - - /* - * Set the Pressure - */ - double pres = OneAtm; - - /* - * Fix the molality - */ - Is = 6.146; - moll[i1] = Is; - moll[i2] = Is; - HMW->setState_TPM(298.15, pres, moll); - double Xmol[30]; - HMW->getMoleFractions(Xmol); - - ThermoPhase* hmwtb = (ThermoPhase*)HMW; - - ThermoPhase* hmwtbDupl = hmwtb->duplMyselfAsThermoPhase(); - HMWSoln* HMW1 = HMW; - HMWSoln* HMW2 = dynamic_cast(hmwtbDupl); - - for (int itherms = 0; itherms < 2; itherms++) { - if (itherms ==0) { - HMW = HMW1; - } else { - HMW = HMW2; - } - - /* - * ThermoUnknowns - */ - double T; - - double Cp0_NaCl = 0.0, Cp0_Naplus = 0.0, Cp0_Clminus = 0.0, Delta_Cp0s = 0.0, Cp0_H2O = 0.0; - double Cp_NaCl = 0.0, Cp_Naplus = 0.0, Cp_Clminus = 0.0, Cp_H2O = 0.0; - double molarCp0; - printf("A_J/R: Comparison to Pitzer's book, p. 99, can be made.\n"); - printf(" Agreement is within 12 pc \n"); - printf("\n"); - - printf("Delta_Cp0: Heat Capacity of Solution per mole of salt (standard states)\n"); - printf(" rxn for the ss heat of soln: " - "NaCl(s) -> Na+(aq) + Cl-(aq)\n"); - - printf("\n"); - printf("Delta_Cps: Delta heat Capacity of Solution per mole of salt\n"); - printf(" rxn for heat of soln: " - " n1 H2O(l,pure) + n2 NaCl(s) -> n2 MX(aq) + n1 H2O(l) \n"); - printf(" Delta_Hs = (n1 h_H2O_bar + n2 h_MX_bar " - "- n1 h_H2O_0 - n2 h_MX_0)/n2\n"); - printf("\n"); - printf("phiJ: phiJ, calculated from the program, is checked\n"); - printf(" against analytical formula in J_standalone program.\n"); - printf(" (comparison against Eq. 12, Silvester and Pitzer)\n"); - - /* - * Create a Table of NaCl Enthalpy Properties as a Function - * of the Temperature - */ - printf("\n\n"); - printf(" T, Pres, Aphi, A_J/R," - " Delta_Cp0," - " Delta_Cps, J, phiJ," - " MolarCp, MolarCp0\n"); - printf(" Kelvin, bar, sqrt(kg/gmol), sqrt(kg/gmol)," - " kJ/gmolSalt," - " kJ/gmolSalt, kJ/gmolSoln, kJ/gmolSalt," - " kJ/gmol, kJ/gmol\n"); - for (i = 0; i < TTable.NPoints + 1; i++) { - if (i == TTable.NPoints) { - T = 323.15; - } else { - T = TTable.T[i]; - } - /* - * Make sure we are at the saturation pressure or above. - */ - pres = std::max(HMW->satPressure(T), OneAtm); - - HMW->setState_TPM(T, pres, moll); - - solid->setState_TP(T, pres); - - /* - * Get the Standard State DeltaH - */ - - solid->getCp_R(Cp0_R); - Cp0_NaCl = Cp0_R[0] * GasConstant * 1.0E-6; - - - HMW->getCp_R(Cp0_R); - Cp0_H2O = Cp0_R[0] * GasConstant * 1.0E-6; - Cp0_Naplus = Cp0_R[i1] * GasConstant * 1.0E-6; - Cp0_Clminus = Cp0_R[i2] * GasConstant * 1.0E-6; - /* - * Calculate the standard state heat of solution - * for NaCl(s) -> Na+ + Cl- - * units: kJ/gmolSalt - */ - - Delta_Cp0s = Cp0_Naplus + Cp0_Clminus - Cp0_NaCl; - - pmCp[0] = solid->cp_mole(); - - Cp_NaCl = pmCp[0] * 1.0E-6; - - - HMW->getPartialMolarCp(pmCp); - Cp_H2O = pmCp[0] * 1.0E-6; - Cp_Naplus = pmCp[i1] * 1.0E-6; - Cp_Clminus = pmCp[i2] * 1.0E-6; - - //double Delta_Cp_Salt = Cp_NaCl - (Cp_Naplus + Cp_Clminus); - - double molarCp = HMW->cp_mole() * 1.0E-6; - - /* - * Calculate the heat capacity of solution for the reaction - * NaCl(s) -> Na+ + Cl- - */ - double Delta_Cps = (Xmol[0] * Cp_H2O + - Xmol[i1] * Cp_Naplus + - Xmol[i2] * Cp_Clminus - - Xmol[0] * Cp0_H2O - - Xmol[i1] * Cp_NaCl); - Delta_Cps /= Xmol[i1]; - - - /* - * Calculate the relative heat capacity, J, from the - * partial molar quantities, units J/gmolSolutionK - */ - double J = (Xmol[0] * (Cp_H2O - Cp0_H2O) + - Xmol[i1] * (Cp_Naplus - Cp0_Naplus) + - Xmol[i2] * (Cp_Clminus - Cp0_Clminus)); - - /* - * Calculate the apparent relative molal heat capacity, phiJ, - * units of J/gmolSaltAddedK - */ - double phiJ = J / Xmol[i1]; - - - double Aphi = HMW->A_Debye_TP(T, pres) / 3.0; - double AJ = HMW->ADebye_J(T, pres); - - for (size_t k = 0; k < nsp; k++) { - Cp0_R[k] *= GasConstant * 1.0E-6; - } - - molarCp0 = 0.0; - for (size_t k = 0; k < nsp; k++) { - molarCp0 += Xmol[k] * Cp0_R[k]; - } - - if (i != TTable.NPoints+1) { - printf("%13.5f, %13.5f, %13.5f, %13.5f, %13.5f, %13.5f, " - "%13.5f, %13.5f, %13.5f, %13.5f\n", - T, pres*1.0E-5, Aphi, AJ/GasConstant, Delta_Cp0s, Delta_Cps, - J, phiJ, molarCp , molarCp0); - } - - } - - printf("Breakdown of Heat Capacity Calculation at 323.15 K, 1atm:\n"); - - printf(" Species MoleFrac Molal Cp0 " - " partCp (partCp - Cp0)\n"); - printf(" H2O(L)"); - printf("%13.5f %13.5f %13.5f %13.5f %13.5f\n", Xmol[0], moll[0], Cp0_H2O, Cp_H2O, Cp_H2O-Cp0_H2O); - printf(" Na+ "); - printf("%13.5f %13.5f %13.5f %13.5f %13.5f\n", Xmol[i1], moll[i1], - Cp0_Naplus, Cp_Naplus, Cp_Naplus-Cp0_Naplus); - printf(" Cl- "); - printf("%13.5f %13.5f %13.5f %13.5f %13.5f\n", Xmol[i2], moll[i2], - Cp0_Clminus, Cp_Clminus, Cp_Clminus-Cp0_Clminus); - - printf(" NaCl(s)"); - printf("%13.5f %13.5f %13.5f %13.5f\n", 1.0, - Cp0_NaCl, Cp_NaCl, Cp_NaCl-Cp0_NaCl); - - } - - delete HMW1; - HMW = 0; - delete hmwtbDupl; - hmwtbDupl = 0; - delete solid; - solid = 0; - appdelete(); - - - return retn; - - } catch (CanteraError& err) { - std::cout << err.what() << std::endl; - appdelete(); - return -1; - } -} diff --git a/test_problems/cathermo/HMW_dupl_test/NaCl_Solid.xml b/test_problems/cathermo/HMW_dupl_test/NaCl_Solid.xml deleted file mode 100644 index d711be8ff..000000000 --- a/test_problems/cathermo/HMW_dupl_test/NaCl_Solid.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - O H C Fe Ca N Na Cl - - NaCl(S) - - 2.165 - - - - - - - - - - - Na:1 Cl:1 - - - - 50.72389, 6.672267, -2.517167, - 10.15934, -0.200675, -427.2115, - 130.3973 - - - - 2.165 - - - - - diff --git a/test_problems/cathermo/HMW_dupl_test/README b/test_problems/cathermo/HMW_dupl_test/README deleted file mode 100644 index 8b70de261..000000000 --- a/test_problems/cathermo/HMW_dupl_test/README +++ /dev/null @@ -1,2 +0,0 @@ -Check on the duplication routines for HMWSoln -In other words, this checks whether duplMyselfAsThermoPhase() works. diff --git a/test_problems/cathermo/HMW_dupl_test/output_blessed.txt b/test_problems/cathermo/HMW_dupl_test/output_blessed.txt deleted file mode 100644 index 8c508532b..000000000 --- a/test_problems/cathermo/HMW_dupl_test/output_blessed.txt +++ /dev/null @@ -1,78 +0,0 @@ -A_J/R: Comparison to Pitzer's book, p. 99, can be made. - Agreement is within 12 pc - -Delta_Cp0: Heat Capacity of Solution per mole of salt (standard states) - rxn for the ss heat of soln: NaCl(s) -> Na+(aq) + Cl-(aq) - -Delta_Cps: Delta heat Capacity of Solution per mole of salt - rxn for heat of soln: n1 H2O(l,pure) + n2 NaCl(s) -> n2 MX(aq) + n1 H2O(l) - Delta_Hs = (n1 h_H2O_bar + n2 h_MX_bar - n1 h_H2O_0 - n2 h_MX_0)/n2 - -phiJ: phiJ, calculated from the program, is checked - against analytical formula in J_standalone program. - (comparison against Eq. 12, Silvester and Pitzer) - - - T, Pres, Aphi, A_J/R, Delta_Cp0, Delta_Cps, J, phiJ, MolarCp, MolarCp0 - Kelvin, bar, sqrt(kg/gmol), sqrt(kg/gmol), kJ/gmolSalt, kJ/gmolSalt, kJ/gmolSoln, kJ/gmolSalt, kJ/gmol, kJ/gmol - 273.15000, 1.01325, 0.37672, 4.08572, -0.15898, -0.03647, 0.01110, 0.12250, 0.06345, 0.05234 - 298.15000, 1.01325, 0.39145, 4.61223, -0.13080, -0.01996, 0.01005, 0.11084, 0.06444, 0.05439 - 323.15000, 1.01325, 0.41029, 5.50262, -0.11572, -0.01059, 0.00953, 0.10513, 0.06534, 0.05581 - 348.15000, 1.01325, 0.43327, 6.72552, -0.11377, -0.00869, 0.00953, 0.10508, 0.06573, 0.05620 - 373.15000, 1.01418, 0.46056, 8.35441, -0.12496, -0.01358, 0.01010, 0.11139, 0.06566, 0.05556 - 398.15000, 2.32238, 0.49245, 10.54375, -0.14929, -0.02376, 0.01138, 0.12553, 0.06531, 0.05393 - 423.15000, 4.76165, 0.52952, 13.58116, -0.18675, -0.03649, 0.01362, 0.15026, 0.06500, 0.05138 - 448.15000, 8.92602, 0.57255, 17.99600, -0.23734, -0.04670, 0.01728, 0.19064, 0.06527, 0.04799 - 473.15000, 15.54928, 0.62277, 24.82590, -0.30104, -0.04445, 0.02326, 0.25659, 0.06713, 0.04387 - 498.15000, 25.49724, 0.68204, 36.27336, -0.37783, -0.00866, 0.03346, 0.36917, 0.07268, 0.03921 - 523.15000, 39.76175, 0.75339, 57.51946, -0.46771, 0.11020, 0.05239, 0.57792, 0.08674, 0.03435 - 548.15000, 59.46393, 0.84221, 102.54121, -0.57066, 0.44582, 0.09214, 1.01648, 0.12209, 0.02995 - 573.15000, 85.87905, 0.95926, 217.12828, -0.68666, 1.43602, 0.19242, 2.12268, 0.21997, 0.02756 - 598.15000, 120.51014, 1.13024, 604.22923, -0.81569, 5.02135, 0.52912, 5.83705, 0.56094, 0.03182 - 623.15000, 165.29415, 1.43872, 2813.62087, -0.95774, 26.02033, 2.44552, 26.97807, 2.51297, 0.06745 - 323.15000, 1.01325, 0.41029, 5.50262, -0.11572, -0.01059, 0.00953, 0.10513, 0.06534, 0.05581 -Breakdown of Heat Capacity Calculation at 323.15 K, 1atm: - Species MoleFrac Molal Cp0 partCp (partCp - Cp0) - H2O(L) 0.81870 0.00000 0.07533 0.06959 -0.00574 - Na+ 0.09065 6.14600 0.02842 0.10688 0.07846 - Cl- 0.09065 6.14600 -0.09310 -0.01463 0.07846 - NaCl(s) 1.00000 0.05104 0.05104 0.00000 -A_J/R: Comparison to Pitzer's book, p. 99, can be made. - Agreement is within 12 pc - -Delta_Cp0: Heat Capacity of Solution per mole of salt (standard states) - rxn for the ss heat of soln: NaCl(s) -> Na+(aq) + Cl-(aq) - -Delta_Cps: Delta heat Capacity of Solution per mole of salt - rxn for heat of soln: n1 H2O(l,pure) + n2 NaCl(s) -> n2 MX(aq) + n1 H2O(l) - Delta_Hs = (n1 h_H2O_bar + n2 h_MX_bar - n1 h_H2O_0 - n2 h_MX_0)/n2 - -phiJ: phiJ, calculated from the program, is checked - against analytical formula in J_standalone program. - (comparison against Eq. 12, Silvester and Pitzer) - - - T, Pres, Aphi, A_J/R, Delta_Cp0, Delta_Cps, J, phiJ, MolarCp, MolarCp0 - Kelvin, bar, sqrt(kg/gmol), sqrt(kg/gmol), kJ/gmolSalt, kJ/gmolSalt, kJ/gmolSoln, kJ/gmolSalt, kJ/gmol, kJ/gmol - 273.15000, 1.01325, 0.37672, 4.08572, -0.15898, -0.03647, 0.01110, 0.12250, 0.06345, 0.05234 - 298.15000, 1.01325, 0.39145, 4.61223, -0.13080, -0.01996, 0.01005, 0.11084, 0.06444, 0.05439 - 323.15000, 1.01325, 0.41029, 5.50262, -0.11572, -0.01059, 0.00953, 0.10513, 0.06534, 0.05581 - 348.15000, 1.01325, 0.43327, 6.72552, -0.11377, -0.00869, 0.00953, 0.10508, 0.06573, 0.05620 - 373.15000, 1.01418, 0.46056, 8.35441, -0.12496, -0.01358, 0.01010, 0.11139, 0.06566, 0.05556 - 398.15000, 2.32238, 0.49245, 10.54375, -0.14929, -0.02376, 0.01138, 0.12553, 0.06531, 0.05393 - 423.15000, 4.76165, 0.52952, 13.58116, -0.18675, -0.03649, 0.01362, 0.15026, 0.06500, 0.05138 - 448.15000, 8.92602, 0.57255, 17.99600, -0.23734, -0.04670, 0.01728, 0.19064, 0.06527, 0.04799 - 473.15000, 15.54928, 0.62277, 24.82590, -0.30104, -0.04445, 0.02326, 0.25659, 0.06713, 0.04387 - 498.15000, 25.49724, 0.68204, 36.27336, -0.37783, -0.00866, 0.03346, 0.36917, 0.07268, 0.03921 - 523.15000, 39.76175, 0.75339, 57.51946, -0.46771, 0.11020, 0.05239, 0.57792, 0.08674, 0.03435 - 548.15000, 59.46393, 0.84221, 102.54121, -0.57066, 0.44582, 0.09214, 1.01648, 0.12209, 0.02995 - 573.15000, 85.87905, 0.95926, 217.12828, -0.68666, 1.43602, 0.19242, 2.12268, 0.21997, 0.02756 - 598.15000, 120.51014, 1.13024, 604.22923, -0.81569, 5.02135, 0.52912, 5.83705, 0.56094, 0.03182 - 623.15000, 165.29415, 1.43872, 2813.62087, -0.95774, 26.02033, 2.44552, 26.97807, 2.51297, 0.06745 - 323.15000, 1.01325, 0.41029, 5.50262, -0.11572, -0.01059, 0.00953, 0.10513, 0.06534, 0.05581 -Breakdown of Heat Capacity Calculation at 323.15 K, 1atm: - Species MoleFrac Molal Cp0 partCp (partCp - Cp0) - H2O(L) 0.81870 0.00000 0.07533 0.06959 -0.00574 - Na+ 0.09065 6.14600 0.02842 0.10688 0.07846 - Cl- 0.09065 6.14600 -0.09310 -0.01463 0.07846 - NaCl(s) 1.00000 0.05104 0.05104 0.00000