From cfe5824a7d30dfe7ae29d067909eaf4ec99de028 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Mon, 16 Jul 2012 22:18:35 +0000 Subject: [PATCH] Removed some deprecated code --- include/cantera/equil/vcs_VolPhase.h | 10 --- include/cantera/kinetics/Kinetics.h | 5 +- include/cantera/kinetics/RateCoeffMgr.h | 1 - include/cantera/thermo/ConstDensityThermo.h | 17 ----- include/cantera/thermo/GeneralSpeciesThermo.h | 9 --- include/cantera/thermo/HMWSoln.h | 13 ---- include/cantera/thermo/Phase.h | 27 +------- include/cantera/thermo/SimpleThermo.h | 25 ------- include/cantera/thermo/SpeciesThermo.h | 9 --- include/cantera/thermo/SpeciesThermoFactory.h | 19 +----- .../cantera/thermo/SpeciesThermoInterpType.h | 1 + include/cantera/thermo/SpeciesThermoMgr.h | 46 ------------- include/cantera/thermo/ThermoPhase.h | 16 ----- include/cantera/thermo/speciesThermoTypes.h | 24 ------- include/cantera/transport/MultiTransport.h | 66 +------------------ include/cantera/transport/TransportBase.h | 2 - samples/cxx/NASA_coeffs/NASA_coeffs.cpp | 9 --- src/equil/vcs_MultiPhaseEquil.cpp | 1 + src/equil/vcs_VolPhase.cpp | 3 - src/equil/vcs_equilibrate.cpp | 1 + src/thermo/ConstDensityThermo.cpp | 2 - src/thermo/GeneralSpeciesThermo.cpp | 16 ----- src/thermo/HMWSoln.cpp | 15 ----- src/thermo/Mu0Poly.cpp | 1 + src/thermo/NasaThermo.h | 34 ---------- src/thermo/Phase.cpp | 36 ++-------- src/thermo/ShomateThermo.h | 29 -------- src/thermo/SpeciesThermoFactory.cpp | 32 +-------- src/thermo/ThermoFactory.cpp | 6 +- src/thermo/ThermoPhase.cpp | 5 -- src/transport/MultiTransport.cpp | 59 +---------------- 31 files changed, 20 insertions(+), 519 deletions(-) diff --git a/include/cantera/equil/vcs_VolPhase.h b/include/cantera/equil/vcs_VolPhase.h index 5b0b190f4..3b7be7ad4 100644 --- a/include/cantera/equil/vcs_VolPhase.h +++ b/include/cantera/equil/vcs_VolPhase.h @@ -654,16 +654,6 @@ public: */ size_t VP_ID_; - //! ID of the surface or volume domain in which the - //! this phase exists - /*! - * This ventures into the idea of installing a physical location - * into a thermodynamics program. This unknown is currently not - * being used. - * @deprecated - */ - int Domain_ID; - //! If true, this phase consists of a single species bool m_singleSpecies; diff --git a/include/cantera/kinetics/Kinetics.h b/include/cantera/kinetics/Kinetics.h index 20df7c9f7..bc7f1851e 100644 --- a/include/cantera/kinetics/Kinetics.h +++ b/include/cantera/kinetics/Kinetics.h @@ -1043,9 +1043,8 @@ protected: //! Phase Index where reactions are assumed to be taking place /*! - * We calculate this by assuming that the phase with the lowest dimensionality is the phase where reactions - * are taking place - * @deprecated + * We calculate this by assuming that the phase with the lowest + * dimensionality is the phase where reactions are taking place. */ size_t m_rxnphase; diff --git a/include/cantera/kinetics/RateCoeffMgr.h b/include/cantera/kinetics/RateCoeffMgr.h index 9e46225e2..6f53c1c74 100644 --- a/include/cantera/kinetics/RateCoeffMgr.h +++ b/include/cantera/kinetics/RateCoeffMgr.h @@ -109,7 +109,6 @@ public: protected: std::vector m_rates; std::vector m_rxn; - vector_fp m_const; //!< @deprecated not used }; diff --git a/include/cantera/thermo/ConstDensityThermo.h b/include/cantera/thermo/ConstDensityThermo.h index a708e6013..c6620822b 100644 --- a/include/cantera/thermo/ConstDensityThermo.h +++ b/include/cantera/thermo/ConstDensityThermo.h @@ -282,17 +282,6 @@ public: return m_g0_RT; } - //! Returns a reference to the vector of exponentials of the nondimensional - //! Gibbs Free Energies of the reference state at the current temperature - //! of the solution and the reference pressure for the species. - const vector_fp& expGibbs_RT() const { - _updateThermo(); - for (size_t k = 0; k != m_kk; k++) { - m_expg0_RT[k] = std::exp(m_g0_RT[k]); - } - return m_expg0_RT; - } - //! Returns a reference to the vector of nondimensional //! entropies of the reference state at the current temperature //! of the solution and the reference pressure for each species. @@ -444,12 +433,6 @@ protected: //! Temporary storage for dimensionless reference state entropies mutable vector_fp m_s0_R; - //! currently unsed - /*! - * @deprecated - */ - mutable vector_fp m_expg0_RT; - //! Currently unused /* * @deprecated diff --git a/include/cantera/thermo/GeneralSpeciesThermo.h b/include/cantera/thermo/GeneralSpeciesThermo.h index 997666952..2feab4881 100644 --- a/include/cantera/thermo/GeneralSpeciesThermo.h +++ b/include/cantera/thermo/GeneralSpeciesThermo.h @@ -205,15 +205,6 @@ public: doublereal& maxTemp, doublereal& refPressure) const; - //! Modify parameters for the standard state - /*! - * @param index Species index - * @param c Vector of coefficients used to set the - * parameters for the standard state. - * @deprecated - */ - DEPRECATED(virtual void modifyParams(size_t index, doublereal* c)); - #ifdef H298MODIFY_CAPABILITY virtual doublereal reportOneHf298(int k) const; diff --git a/include/cantera/thermo/HMWSoln.h b/include/cantera/thermo/HMWSoln.h index 15a843d64..5e19f96ab 100644 --- a/include/cantera/thermo/HMWSoln.h +++ b/include/cantera/thermo/HMWSoln.h @@ -2128,19 +2128,6 @@ public: */ virtual void initThermoXML(XML_Node& phaseNode, std::string id); - //! Report the molar volume of species k - /*! - * - * units - \f$ m^3 kmol^-1 \f$ - * - * @param k species index - * - * @deprecated - * The getPartialMolarVolumes() expression is more precise. - */ - DEPRECATED(double speciesMolarVolume(int k) const); - - //! Value of the Debye Huckel constant as a function of temperature //! and pressure. /*! diff --git a/include/cantera/thermo/Phase.h b/include/cantera/thermo/Phase.h index a0cd57f68..fc2cbb15c 100644 --- a/include/cantera/thermo/Phase.h +++ b/include/cantera/thermo/Phase.h @@ -380,25 +380,10 @@ public: //! @return Returns the molecular weight of species \c k. doublereal molecularWeight(size_t k) const; - //! Return the Molar mass of species \c k - //! Alternate name for molecular weight. - //! @param k index for species - //! @return Return the molar mass of species k kg/kmol. - //! @deprecated use molecularWeight instead - doublereal molarMass(size_t k) const { - return molecularWeight(k); - } - //! Copy the vector of molecular weights into vector weights. //! @param weights Output vector of molecular weights (kg/kmol) void getMolecularWeights(vector_fp& weights) const; - //! Copy the vector of molecular weights into array weights. - //! @param iwt Unused. - //! @param weights Output array of molecular weights (kg/kmol) - //! @deprecated - DEPRECATED(void getMolecularWeights(int iwt, doublereal* weights) const); - //! Copy the vector of molecular weights into array weights. //! @param weights Output array of molecular weights (kg/kmol) void getMolecularWeights(doublereal* weights) const; @@ -698,17 +683,10 @@ public: virtual bool ready() const; //! Return the State Mole Fraction Number - DEPRECATED(int stateMFNumber() const) { + int stateMFNumber() const { return m_stateNum; } - //! Every time the mole fractions have changed, this routine will increment - //! the stateMFNumber - //! @param forceChange If this is true then the stateMFNumber always - //! changes. This defaults to false. - //! @deprecated - DEPRECATED(void stateMFChangeCalc(bool forceChange = false)); - protected: //! @internal Initialize. //! Make a local copy of the vector of molecular weights, and resize the @@ -740,8 +718,8 @@ protected: vector_fp m_speciesSize; vector_fp m_speciesCharge; //!< Vector of species charges. length m_kk. -private: +private: XML_Node* m_xml; //!< XML node containing the XML info for this phase //! ID of the phase. This is the value of the ID attribute of the XML @@ -774,7 +752,6 @@ private: //! State Change variable. Whenever the mole fraction vector changes, //! this int is incremented. - //! @deprecated int m_stateNum; //! Boolean indicating whether the number of species has been frozen. diff --git a/include/cantera/thermo/SimpleThermo.h b/include/cantera/thermo/SimpleThermo.h index 0318bbbd9..c61af9baa 100644 --- a/include/cantera/thermo/SimpleThermo.h +++ b/include/cantera/thermo/SimpleThermo.h @@ -348,31 +348,6 @@ public: } } - //! Modify parameters for the standard state - /*! - * The thermo parameterization for a single species is overwritten. - * - * @param index Species index - * @param c Vector of coefficients used to set the - * parameters for the standard state. - * Must be length >= 4. - * @deprecated - */ - DEPRECATED(virtual void modifyParams(size_t index, doublereal* c)) { - size_t loc = m_loc[index]; - if (loc == npos) { - throw CanteraError("SimpleThermo::modifyParams", - "modifying parameters for species which hasn't been set yet"); - } - /* - * Change the data - */ - m_t0[loc] = c[0]; - m_h0_R[loc] = c[1] / GasConstant; - m_s0_R[loc] = c[2] / GasConstant; - m_cp0_R[loc] = c[3] / GasConstant; - } - #ifdef H298MODIFY_CAPABILITY virtual doublereal reportOneHf298(int k) const { diff --git a/include/cantera/thermo/SpeciesThermo.h b/include/cantera/thermo/SpeciesThermo.h index 42c8c27e8..6f00c7a3f 100644 --- a/include/cantera/thermo/SpeciesThermo.h +++ b/include/cantera/thermo/SpeciesThermo.h @@ -354,15 +354,6 @@ public: doublereal& maxTemp, doublereal& refPressure) const =0; - //! Modify parameters for the standard state - /*! - * @param index Species index - * @param c Vector of coefficients used to set the - * parameters for the standard state. - * @deprecated - */ - DEPRECATED(virtual void modifyParams(size_t index, doublereal* c)) = 0; - #ifdef H298MODIFY_CAPABILITY //! Report the 298 K Heat of Formation of the standard state of one species (J kmol-1) /*! diff --git a/include/cantera/thermo/SpeciesThermoFactory.h b/include/cantera/thermo/SpeciesThermoFactory.h index 2a20f8f9e..46ce29680 100644 --- a/include/cantera/thermo/SpeciesThermoFactory.h +++ b/include/cantera/thermo/SpeciesThermoFactory.h @@ -147,22 +147,6 @@ public: */ SpeciesThermo* newSpeciesThermo(std::vector & spDataNodeList) const; - //! Create a new species property manager for the reference state - /*! - * This routine will look through species nodes. It will discover what - * each species needs for its species property managers. Then, - * it will malloc and return the proper species property manager to use. - * - * - * @param spDataNodeList This vector contains a list - * of species XML nodes that will be in the phase - * - * @return Returns the pointer to the newly malloced - * species property manager for the reference state - * @deprecated Essentially never used - */ - DEPRECATED(SpeciesThermo* newSpeciesThermoOpt(std::vector & spDataNodeList) const); - //! Install a species thermodynamic property parameterization //! for the reference state for one species into a species thermo manager. /*! @@ -274,10 +258,9 @@ SpeciesThermo* newSpeciesThermoMgr(std::string& stype, * * @param f Pointer to a SpeciesThermoFactory. optional parameter. * Defaults to NULL. - * @param opt Boolean defaults to false. */ SpeciesThermo* newSpeciesThermoMgr(std::vector spDataNodeList, - SpeciesThermoFactory* f=0, bool opt=false); + SpeciesThermoFactory* f=0); } diff --git a/include/cantera/thermo/SpeciesThermoInterpType.h b/include/cantera/thermo/SpeciesThermoInterpType.h index 81e1a4afa..5364622fa 100644 --- a/include/cantera/thermo/SpeciesThermoInterpType.h +++ b/include/cantera/thermo/SpeciesThermoInterpType.h @@ -7,6 +7,7 @@ // Copyright 2001 California Institute of Technology +#include "cantera/base/ct_defs.h" #include "speciesThermoTypes.h" #ifndef CT_SPECIESTHERMOINTERPTYPE_H diff --git a/include/cantera/thermo/SpeciesThermoMgr.h b/include/cantera/thermo/SpeciesThermoMgr.h index b981f1587..1fee5c6ea 100644 --- a/include/cantera/thermo/SpeciesThermoMgr.h +++ b/include/cantera/thermo/SpeciesThermoMgr.h @@ -21,29 +21,6 @@ namespace Cantera { /////////////////////// Exceptions ////////////////////////////// -//! Exception thrown if species reference pressures don't match. -/*! - * @ingroup mgrsrefcalc - * @deprecated unused - */ -class RefPressureMismatch : public CanteraError -{ -public: - //! constructor - /*! - * @param proc name of the procecdure - * @param prnew reference pressure - * @param prold old reference pressure - */ - RefPressureMismatch(std::string proc, doublereal prnew, - doublereal prold) : CanteraError(proc, - "Species reference pressure (" - + fp2str(prnew) + ") does not match previously-defined " - + "reference pressure (" + fp2str(prold) + ")") {} - //! destructor - virtual ~RefPressureMismatch() throw() {} -}; - //! Unknown species thermo manager string error /*! * @ingroup mgrsrefcalc @@ -250,15 +227,6 @@ public: doublereal& maxTemp, doublereal& refPressure) const; - //! Modify parameters for the standard state - /*! - * @param index Species index - * @param c Vector of coefficients used to set the - * parameters for the standard state. - * @deprecated - */ - DEPRECATED(virtual void modifyParams(size_t index, doublereal* c)); - #ifdef H298MODIFY_CAPABILITY virtual doublereal reportOneHf298(int k) const { @@ -374,19 +342,5 @@ SpeciesThermoDuo::reportParams(size_t index, int& type, } } -template -void -SpeciesThermoDuo::modifyParams(size_t index, doublereal* c) -{ - int ctype = reportType(index); - if (ctype == m_thermo1.ID) { - m_thermo1.modifyParams(index, c); - } else if (ctype == m_thermo2.ID) { - m_thermo2.modifyParams(index, c); - } else { - throw CanteraError("modifyParams", "confused"); - } -} - } #endif diff --git a/include/cantera/thermo/ThermoPhase.h b/include/cantera/thermo/ThermoPhase.h index 67ecffe6a..c24b33c5f 100644 --- a/include/cantera/thermo/ThermoPhase.h +++ b/include/cantera/thermo/ThermoPhase.h @@ -362,11 +362,6 @@ public: return -1.0; } - /// @deprecated - virtual void updateDensity() { - deprecatedMethod("ThermoPhase","updateDensity",""); - } - /** * @} * @name Electric Potential @@ -1669,17 +1664,6 @@ private: //! typedef for the ThermoPhase class typedef ThermoPhase thermo_t; -//! Format a summary of the mixture state for output. -/*! - * @param th ThermoPhase object to create a report about - * @param show_thermo Boolean indicating whether the thermo functions - * of the phase should be written out - * - * @return Returns a string containing the report - * @deprecated use "th.report(show_thermo)" instead - */ -DEPRECATED(std::string report(const ThermoPhase& th, const bool show_thermo = true)); - } #endif diff --git a/include/cantera/thermo/speciesThermoTypes.h b/include/cantera/thermo/speciesThermoTypes.h index 5865bee9e..ed45d6000 100644 --- a/include/cantera/thermo/speciesThermoTypes.h +++ b/include/cantera/thermo/speciesThermoTypes.h @@ -9,10 +9,6 @@ #ifndef SPECIES_THERMO_TYPES_H #define SPECIES_THERMO_TYPES_H -#include "cantera/base/ct_defs.h" -#include "cantera/base/global.h" -#include "cantera/base/stringUtils.h" - //! Constant Cp #define CONSTANT_CP 1 @@ -72,26 +68,6 @@ //! A general object is called with the pressure set at the reference state. #define PDSS_TYPE 37 -namespace Cantera -{ - -//! Error for unknown thermo parameterization -struct UnknownThermoParam { - //! Constructor - /*! - * @param thermotype Integer specifying the thermo parameterization - * - * @deprecated This class is unused? - */ - DEPRECATED(UnknownThermoParam(int thermotype)) { - writelog(std::string("\n ### ERROR ### \n") + - "Unknown species thermo parameterization (" - + int2str(thermotype) + ")\n\n"); - } -}; - -} - #endif diff --git a/include/cantera/transport/MultiTransport.h b/include/cantera/transport/MultiTransport.h index cef714555..43e17e394 100644 --- a/include/cantera/transport/MultiTransport.h +++ b/include/cantera/transport/MultiTransport.h @@ -19,52 +19,7 @@ namespace Cantera { -//==================================================================================================================== -//! Transport solve options -//! @deprecated GMRES option is unimplemented. -enum TRANSOLVE_TYPE { - //! Solve the dense matrix via a gmres iteration - TRANSOLVE_GMRES = 1, - //! Solve the dense matrix via an LU gauss elimination - TRANSOLVE_LU -}; -//==================================================================================================================== class GasTransportParams; -//==================================================================================================================== -//! Class L_Matrix is used to represent the "L" matrix. -/*! - * This class is used instead of DenseMatrix so that a version of mult can be - * used that knows about the structure of the L matrix, - * specifically that the upper-right and lower-left blocks are - * zero. - * @ingroup transportProps - */ -class L_Matrix : public DenseMatrix -{ -public: - - //! default constructor - L_Matrix() {} - - //! destructor - virtual ~L_Matrix() {} - - //! Conduct a multiply with the Dense matrix - /*! - * This method is used by GMRES to multiply the L matrix by a - * vector b. The L matrix has a 3x3 block structure, where each - * block is a K x K matrix. The elements of the upper-right and - * lower-left blocks are all zero. This method is defined so - * that the multiplication only involves the seven non-zero - * blocks. - * - * @param b - * @param prod - * @deprecated GMRES method is not implemented - */ - DEPRECATED(virtual void mult(const doublereal* b, doublereal* prod) const); -}; - //==================================================================================================================== //! Class MultiTransport implements multicomponent transport @@ -178,21 +133,6 @@ public: const doublereal* state2, doublereal delta, doublereal* fluxes); - //! Set the solution method for inverting the L matrix - /*! - * @param method enum TRANSOLVE_TYPE Either use direct or TRANSOLVE_GMRES - * @deprecated GMRES option is unimplemented. - */ - DEPRECATED(virtual void setSolutionMethod(TRANSOLVE_TYPE method)); - - //! Set the options for the GMRES solution - /*! - * @param m set the mgmres param - * @param eps Set the eps parameter - * @deprecated GMRES option is unimplemented. - */ - DEPRECATED(virtual void setOptions_GMRES(int m, doublereal eps)); - //! Initialize the transport operator with parameters from GasTransportParams object /*! * @param tr input GasTransportParams object @@ -262,16 +202,12 @@ private: doublereal m_lambda; // L matrix quantities - L_Matrix m_Lmatrix; + DenseMatrix m_Lmatrix; DenseMatrix m_aa; //DenseMatrix m_Lmatrix; vector_fp m_a; vector_fp m_b; - bool m_gmres; //!< @deprecated - int m_mgmres; //!< @deprecated - doublereal m_eps_gmres; //!< @deprecated - // work space vector_fp m_spwork1, m_spwork2, m_spwork3; diff --git a/include/cantera/transport/TransportBase.h b/include/cantera/transport/TransportBase.h index 2e9f06a3c..509a207ed 100644 --- a/include/cantera/transport/TransportBase.h +++ b/include/cantera/transport/TransportBase.h @@ -336,8 +336,6 @@ public: * k = j * nsp + i * * The size of mobRat must be at least equal to nsp*nsp - * - * @deprecated This doesn't seem to be the essential input; it should just be the mobility. */ DEPRECATED(virtual void mobilityRatio(double* mobRat)) { err("mobilityRatio"); diff --git a/samples/cxx/NASA_coeffs/NASA_coeffs.cpp b/samples/cxx/NASA_coeffs/NASA_coeffs.cpp index 4b0942066..976d44d15 100644 --- a/samples/cxx/NASA_coeffs/NASA_coeffs.cpp +++ b/samples/cxx/NASA_coeffs/NASA_coeffs.cpp @@ -61,15 +61,6 @@ void demoprog() } printf("\n "); - // modify coefficient A6 of the low-temperature polynomial - // Note that since we are not modifying the high-temperature - // polynomial, a warning will be printed about a discontinuity - // in enthalpy at Tmid. - c[LOW_A6] += 1.0e4; - sp.modifyParams(n, c); - - sp.reportParams(n, type, c, minTemp, maxTemp, refPressure); - // print the modified NASA coefficients printf("\n\n %s (modified):", gas.speciesName(n).c_str()); printf("\n "); diff --git a/src/equil/vcs_MultiPhaseEquil.cpp b/src/equil/vcs_MultiPhaseEquil.cpp index ea91b7076..e266d84c1 100644 --- a/src/equil/vcs_MultiPhaseEquil.cpp +++ b/src/equil/vcs_MultiPhaseEquil.cpp @@ -20,6 +20,7 @@ #include "cantera/base/ct_defs.h" #include "cantera/thermo/mix_defs.h" #include "cantera/base/clockWC.h" +#include "cantera/base/stringUtils.h" #include "cantera/thermo/ThermoPhase.h" #include "cantera/thermo/speciesThermoTypes.h" #include "cantera/thermo/IdealSolidSolnPhase.h" diff --git a/src/equil/vcs_VolPhase.cpp b/src/equil/vcs_VolPhase.cpp index 47267089a..036e56b55 100644 --- a/src/equil/vcs_VolPhase.cpp +++ b/src/equil/vcs_VolPhase.cpp @@ -33,7 +33,6 @@ namespace VCSnonideal vcs_VolPhase::vcs_VolPhase(VCS_SOLVE* owningSolverObject) : m_owningSolverObject(0), VP_ID_(npos), - Domain_ID(-1), m_singleSpecies(true), m_gasPhase(false), m_eqnState(VCS_EOS_CONSTANT), @@ -97,7 +96,6 @@ vcs_VolPhase::~vcs_VolPhase() vcs_VolPhase::vcs_VolPhase(const vcs_VolPhase& b) : m_owningSolverObject(b.m_owningSolverObject), VP_ID_(b.VP_ID_), - Domain_ID(b.Domain_ID), m_singleSpecies(b.m_singleSpecies), m_gasPhase(b.m_gasPhase), m_eqnState(b.m_eqnState), @@ -152,7 +150,6 @@ vcs_VolPhase& vcs_VolPhase::operator=(const vcs_VolPhase& b) // m_owningSolverObject = b.m_owningSolverObject; VP_ID_ = b.VP_ID_; - Domain_ID = b.Domain_ID; m_singleSpecies = b.m_singleSpecies; m_gasPhase = b.m_gasPhase; m_eqnState = b.m_eqnState; diff --git a/src/equil/vcs_equilibrate.cpp b/src/equil/vcs_equilibrate.cpp index 72f35939e..e6053a539 100644 --- a/src/equil/vcs_equilibrate.cpp +++ b/src/equil/vcs_equilibrate.cpp @@ -18,6 +18,7 @@ #include "cantera/equil/equil.h" #include "cantera/base/ct_defs.h" +#include "cantera/base/stringUtils.h" #include "cantera/thermo/mix_defs.h" #include "cantera/thermo/speciesThermoTypes.h" #include "cantera/thermo/IdealSolidSolnPhase.h" diff --git a/src/thermo/ConstDensityThermo.cpp b/src/thermo/ConstDensityThermo.cpp index 7f9c96c23..b138c97ce 100644 --- a/src/thermo/ConstDensityThermo.cpp +++ b/src/thermo/ConstDensityThermo.cpp @@ -44,7 +44,6 @@ ConstDensityThermo& ConstDensityThermo::operator=(const ConstDensityThermo& righ 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_pe = right.m_pe; m_pp = right.m_pp; @@ -167,7 +166,6 @@ void ConstDensityThermo::initThermo() m_h0_RT.resize(m_kk); m_g0_RT.resize(m_kk); - m_expg0_RT.resize(m_kk); m_cp0_R.resize(m_kk); m_s0_R.resize(m_kk); m_pe.resize(m_kk, 0.0); diff --git a/src/thermo/GeneralSpeciesThermo.cpp b/src/thermo/GeneralSpeciesThermo.cpp index 2964c00cc..0e0fd2aba 100644 --- a/src/thermo/GeneralSpeciesThermo.cpp +++ b/src/thermo/GeneralSpeciesThermo.cpp @@ -292,22 +292,6 @@ reportParams(size_t index, int& type, doublereal* const c, } } -//! Modify parameters for the standard state -/*! - * @param index Species index - * @param c Vector of coefficients used to set the - * parameters for the standard state. - */ -void GeneralSpeciesThermo:: -modifyParams(size_t index, doublereal* c) -{ - SpeciesThermoInterpType* sp = m_sp[index]; - if (sp) { - sp->modifyParameters(c); - } -} - - /** * Return the lowest temperature at which the thermodynamic * parameterization is valid. If no argument is supplied, the diff --git a/src/thermo/HMWSoln.cpp b/src/thermo/HMWSoln.cpp index 8f07a1761..f519d7798 100644 --- a/src/thermo/HMWSoln.cpp +++ b/src/thermo/HMWSoln.cpp @@ -1425,21 +1425,6 @@ doublereal HMWSoln::satPressure(doublereal t) const return pres; } -/* - * Report the molar volume of species k - * - * units - \f$ m^3 kmol^-1 \f$ - */ -double HMWSoln::speciesMolarVolume(int k) const -{ - double vol = m_speciesSize[k]; - if (k == 0) { - double dd = m_waterSS->density(); - vol = molecularWeight(0)/dd; - } - return vol; -} - /* * A_Debye_TP() (virtual) * diff --git a/src/thermo/Mu0Poly.cpp b/src/thermo/Mu0Poly.cpp index 5a7fe2778..56ac1d295 100644 --- a/src/thermo/Mu0Poly.cpp +++ b/src/thermo/Mu0Poly.cpp @@ -11,6 +11,7 @@ #include "cantera/thermo/SpeciesThermo.h" #include "cantera/base/xml.h" #include "cantera/base/ctml.h" +#include "cantera/base/stringUtils.h" using namespace std; using namespace ctml; diff --git a/src/thermo/NasaThermo.h b/src/thermo/NasaThermo.h index 1704d8718..bbe07fbf9 100644 --- a/src/thermo/NasaThermo.h +++ b/src/thermo/NasaThermo.h @@ -426,40 +426,6 @@ public: } } - //! Modify parameters for the standard state - /*! - * This utility function modifies the array of coefficients. - * The array is the same as that returned by reportParams, so - * a call can first be made to reportParams to populate the - * array, and then modifyParams can be called to alter - * selected values. For the NASA object, there are 15 - * coefficients. - - * @param index Species index - * @param c Vector of coefficients used to set the - * parameters for the standard state. - */ - virtual void modifyParams(size_t index, doublereal* c) { - int type = reportType(index); - if (type == NASA) { - size_t grp = m_group_map[index]; - size_t pos = m_posInGroup_map[index]; - std::vector &mlg = m_low[grp-1]; - std::vector &mhg = m_high[grp-1]; - NasaPoly1* lowPoly = &(mlg[pos]); - NasaPoly1* highPoly = &(mhg[pos]); - doublereal tmid = lowPoly->maxTemp(); - if (c[0] != tmid) { - throw CanteraError(" ", "Tmid cannot be changed"); - } - lowPoly->modifyParameters(c + 1); - highPoly->modifyParameters(c + 8); - checkContinuity(m_name[index], c[0], c + 1, c + 8); - } else { - throw CanteraError(" ", "confused"); - } - } - #ifdef H298MODIFY_CAPABILITY virtual doublereal reportOneHf298(const int k) const { diff --git a/src/thermo/Phase.cpp b/src/thermo/Phase.cpp index cabf21b33..786b576e3 100644 --- a/src/thermo/Phase.cpp +++ b/src/thermo/Phase.cpp @@ -112,16 +112,6 @@ Phase::~Phase() } } -inline void Phase::stateMFChangeCalc(bool forcerChange) -{ - // Right now we assume that the mole fractions have changed every time - // the function is called - m_stateNum++; - if (m_stateNum > 1000000) { - m_stateNum = -10000000; - } -} - XML_Node& Phase::xml() { return *m_xml; @@ -342,9 +332,7 @@ void Phase::setMoleFractions(const doublereal* const x) * Calculate the normalized molecular weight */ m_mmw = sum/norm; - - // Call a routine to determine whether state has changed. - stateMFChangeCalc(); + m_stateNum++; } void Phase::setMoleFractions_NoNorm(const doublereal* const x) @@ -354,9 +342,7 @@ void Phase::setMoleFractions_NoNorm(const doublereal* const x) transform(x, x + m_kk, m_ym.begin(), timesConstant(rmmw)); transform(m_ym.begin(), m_ym.begin() + m_kk, m_molwts.begin(), m_y.begin(), multiplies()); - - // Call a routine to determine whether state has changed. - stateMFChangeCalc(); + m_stateNum++; } void Phase::setMoleFractionsByName(compositionMap& xMap) @@ -395,9 +381,7 @@ void Phase::setMassFractions(const doublereal* const y) transform(m_y.begin(), m_y.end(), m_rmolwts.begin(), m_ym.begin(), multiplies()); m_mmw = 1.0 / accumulate(m_ym.begin(), m_ym.end(), 0.0); - - // Call a routine to determine whether state has changed. - stateMFChangeCalc(); + m_stateNum++; } void Phase::setMassFractions_NoNorm(const doublereal* const y) @@ -408,9 +392,7 @@ void Phase::setMassFractions_NoNorm(const doublereal* const y) multiplies()); sum = accumulate(m_ym.begin(), m_ym.end(), 0.0); m_mmw = 1.0/sum; - - // Call a routine to determine whether state has changed. - stateMFChangeCalc(); + m_stateNum++; } void Phase::setMassFractionsByName(compositionMap& yMap) @@ -518,12 +500,6 @@ void Phase::getMolecularWeights(vector_fp& weights) const copy(mw.begin(), mw.end(), weights.begin()); } -void Phase::getMolecularWeights(int iwt, doublereal* weights) const -{ - const vector_fp& mw = molecularWeights(); - copy(mw.begin(), mw.end(), weights); -} - void Phase::getMolecularWeights(doublereal* weights) const { const vector_fp& mw = molecularWeights(); @@ -619,9 +595,7 @@ void Phase::setConcentrations(const doublereal* const conc) m_ym[k] = m_y[k] * rsum; m_y[k] = m_ym[k] * m_molwts[k]; // m_y is now the mass fraction } - - // Call a routine to determine whether state has changed. - stateMFChangeCalc(); + m_stateNum++; } doublereal Phase::molarDensity() const diff --git a/src/thermo/ShomateThermo.h b/src/thermo/ShomateThermo.h index ed7c7c765..7c808b217 100644 --- a/src/thermo/ShomateThermo.h +++ b/src/thermo/ShomateThermo.h @@ -425,35 +425,6 @@ public: } } - //! Modify parameters for the standard state - /*! - * @param index Species index - * @param c Vector of coefficients used to set the - * parameters for the standard state. - */ - virtual void modifyParams(size_t index, doublereal* c) { - int type = reportType(index); - if (type == SHOMATE) { - size_t grp = m_group_map[index]; - size_t pos = m_posInGroup_map[index]; - std::vector &mlg = m_low[grp-1]; - std::vector &mhg = m_high[grp-1]; - ShomatePoly* lowPoly = &(mlg[pos]); - ShomatePoly* highPoly = &(mhg[pos]); - doublereal tmid = lowPoly->maxTemp(); - if (fabs(c[0] - tmid) > 0.001) { - throw CanteraError("modifyParams", "can't change mid temp"); - } - - lowPoly->modifyParameters(c + 1); - - highPoly->modifyParameters(c + 8); - - } else { - throw CanteraError(" ", "confused"); - } - } - #ifdef H298MODIFY_CAPABILITY virtual doublereal reportOneHf298(int k) const { diff --git a/src/thermo/SpeciesThermoFactory.cpp b/src/thermo/SpeciesThermoFactory.cpp index 2e077e832..0e063c7b7 100644 --- a/src/thermo/SpeciesThermoFactory.cpp +++ b/src/thermo/SpeciesThermoFactory.cpp @@ -166,28 +166,6 @@ SpeciesThermo* SpeciesThermoFactory::newSpeciesThermo(std::vector & s + SHOMATE*ishomate + SIMPLE*isimple); } - -/* - * @todo is this used? - */ -SpeciesThermo* SpeciesThermoFactory:: -newSpeciesThermoOpt(std::vector & spDataNodeList) const -{ - int inasa = 0, ishomate = 0, isimple = 0, iother = 0; - try { - getSpeciesThermoTypes(spDataNodeList, inasa, ishomate, isimple, iother); - } catch (UnknownSpeciesThermoModel) { - iother = 1; - popError(); - } - - if (iother) { - return new GeneralSpeciesThermo(); - } - return newSpeciesThermo(NASA*inasa - + SHOMATE*ishomate + SIMPLE*isimple); -} - SpeciesThermo* SpeciesThermoFactory::newSpeciesThermo(int type) const { switch (type) { @@ -908,18 +886,12 @@ SpeciesThermo* newSpeciesThermoMgr(std::string& stype, * @param opt Boolean defaults to false. */ SpeciesThermo* newSpeciesThermoMgr(std::vector spData_nodes, - SpeciesThermoFactory* f, bool opt) + SpeciesThermoFactory* f) { if (f == 0) { f = SpeciesThermoFactory::factory(); } - SpeciesThermo* sptherm; - if (opt) { - sptherm = f->newSpeciesThermoOpt(spData_nodes); - } else { - sptherm = f->newSpeciesThermo(spData_nodes); - } - return sptherm; + return f->newSpeciesThermo(spData_nodes); } } diff --git a/src/thermo/ThermoFactory.cpp b/src/thermo/ThermoFactory.cpp index dae88014d..8c20d470a 100644 --- a/src/thermo/ThermoFactory.cpp +++ b/src/thermo/ThermoFactory.cpp @@ -49,9 +49,10 @@ #include "cantera/thermo/IdealMolalSoln.h" #include "cantera/thermo/MolarityIonicVPSSTP.h" #include "cantera/thermo/MixedSolventElectrolyte.h" - #include "cantera/thermo/IdealSolnGasVPSS.h" +#include "cantera/base/stringUtils.h" + #include using namespace std; @@ -64,9 +65,6 @@ ThermoFactory* ThermoFactory::s_factory = 0; mutex_t ThermoFactory::thermo_mutex; //! Define the number of %ThermoPhase types for use in this factory routine -/*! - * @deprecated This entire structure could be replaced with a std::map - */ static int ntypes = 23; //! Define the string name of the %ThermoPhase types that are handled by this factory routine diff --git a/src/thermo/ThermoPhase.cpp b/src/thermo/ThermoPhase.cpp index 4c4321efa..1af6388be 100644 --- a/src/thermo/ThermoPhase.cpp +++ b/src/thermo/ThermoPhase.cpp @@ -1501,9 +1501,4 @@ void ThermoPhase::reportCSV(std::ofstream& csvFile) const } } -std::string report(const ThermoPhase& th, const bool show_thermo) -{ - return th.report(show_thermo); -} - } diff --git a/src/transport/MultiTransport.cpp b/src/transport/MultiTransport.cpp index e819e723a..4e9734953 100644 --- a/src/transport/MultiTransport.cpp +++ b/src/transport/MultiTransport.cpp @@ -53,33 +53,6 @@ inline doublereal Frot(doublereal tr, doublereal sqtr) return 1.0 + c1*sqtr + c2*tr + c3*sqtr*tr; } - -/** - * This method is used by GMRES to multiply the L matrix by a - * vector b. The L matrix has a 3x3 block structure, where each - * block is a K x K matrix. The elements of the upper-right and - * lower-left blocks are all zero. This method is defined so - * that the multiplication only involves the seven non-zero - * blocks. - */ -void L_Matrix::mult(const doublereal* b, doublereal* prod) const -{ - integer n = static_cast(nRows())/3; - integer n2 = 2*n; - integer n3 = 3*n; - ct_dgemv(ctlapack::ColMajor, ctlapack::NoTranspose, n, n2, 1.0, - DATA_PTR(data()), static_cast(nRows()), b, 1, 0.0, prod, 1); - ct_dgemv(ctlapack::ColMajor, ctlapack::NoTranspose, n, n3, 1.0, - DATA_PTR(data()) + n, static_cast(nRows()), - b, 1, 0.0, prod+n, 1); - ct_dgemv(ctlapack::ColMajor, ctlapack::NoTranspose, n, n, 1.0, - DATA_PTR(data()) + n*n3 + n2, static_cast(nRows()), - b + n, 1, 0.0, prod+n2, 1); - for (int i = 0; i < n; i++) { - prod[i + n2] += b[i + n2] * value(i + n2, i + n2); - } -} - //////////////////// class MultiTransport methods ////////////// MultiTransport::MultiTransport(thermo_t* thermo) @@ -132,13 +105,6 @@ bool MultiTransport::initGas(GasTransportParams& tr) m_thermal_tlast = 0.0; - // use LU decomposition by default - m_gmres = false; - - // default GMRES parameters - m_mgmres = 100; - m_eps_gmres = 1.e-4; - // some work space m_spwork1.resize(m_nsp); m_spwork2.resize(m_nsp); @@ -546,30 +512,7 @@ void MultiTransport::getMolarFluxes(const doublereal* const state1, fluxes[k] /= m_mw[k]; } } -//==================================================================================================================== -// Set the solution method for inverting the L matrix -/* - * @param method enum TRANSOLVE_TYPE Either use direct or TRANSOLVE_GMRES - */ -void MultiTransport::setSolutionMethod(TRANSOLVE_TYPE method) -{ - if (method == TRANSOLVE_GMRES) { - m_gmres = true; - } else { - m_gmres = false; - } -} -//==================================================================================================================== -void MultiTransport::setOptions_GMRES(int m, doublereal eps) -{ - if (m > 0) { - m_mgmres = m; - } - if (eps > 0.0) { - m_eps_gmres = eps; - } -} -//==================================================================================================================== + void MultiTransport::getMultiDiffCoeffs(const size_t ld, doublereal* const d) { doublereal p = pressure_ig();