diff --git a/include/cantera/base/Array.h b/include/cantera/base/Array.h index bc3d0b71e..4875cdec1 100644 --- a/include/cantera/base/Array.h +++ b/include/cantera/base/Array.h @@ -135,7 +135,7 @@ public: m_ncols++; m_data.resize(m_nrows*m_ncols); size_t m; - for (m = 0; m < m_nrows; m++) { + for (m = 0; m < m_nrows; m++) { value(m_ncols, m) = c[m]; } } @@ -152,7 +152,7 @@ public: m_ncols++; m_data.resize(m_nrows*m_ncols); size_t m; - for (m = 0; m < m_nrows; m++) { + for (m = 0; m < m_nrows; m++) { value(m_ncols, m) = c[m]; } } @@ -171,7 +171,7 @@ public: //! Get the nth row and return it in a vector /*! * @param n Index of the row to be returned. - * @param rw Return Vector for the operation. + * @param rw Return Vector for the operation. * Must have a length of m_ncols. */ void getRow(size_t n, doublereal* const rw) { @@ -277,7 +277,7 @@ public: //! Returns the value of a single matrix entry /*! - * This is a key entry. Returns the value of the matrix position (i,j) + * This is a key entry. Returns the value of the matrix position (i,j) * element. * * @param i The row index diff --git a/include/cantera/base/FactoryBase.h b/include/cantera/base/FactoryBase.h index 7e7676b58..4969d3d88 100644 --- a/include/cantera/base/FactoryBase.h +++ b/include/cantera/base/FactoryBase.h @@ -26,13 +26,13 @@ public: //! static function that deletes all factories //! in the internal registry maintained in a static variable static void deleteFactories() { - std::vector< FactoryBase* >::iterator iter ; + std::vector< FactoryBase* >::iterator iter; for (iter = s_vFactoryRegistry.begin(); iter != s_vFactoryRegistry.end(); ++iter) { - (*iter)->deleteFactory() ; + (*iter)->deleteFactory(); } - s_vFactoryRegistry.clear() ; + s_vFactoryRegistry.clear(); } protected: @@ -42,18 +42,18 @@ protected: * Adds the current object to the current static list */ FactoryBase() { - s_vFactoryRegistry.push_back(this) ; + s_vFactoryRegistry.push_back(this); } //! Virtual abstract function that deletes the factory /*! * This must be properly defined in child objects. */ - virtual void deleteFactory() = 0 ; + virtual void deleteFactory() = 0; private: //! statically held list of Factories. - static std::vector s_vFactoryRegistry ; + static std::vector s_vFactoryRegistry; }; } diff --git a/include/cantera/base/clockWC.h b/include/cantera/base/clockWC.h index 360e98a5c..b1d88ebb8 100644 --- a/include/cantera/base/clockWC.h +++ b/include/cantera/base/clockWC.h @@ -88,11 +88,11 @@ private: clock_t start_ticks; //! internal constant containing clock ticks per second - const double inv_clocks_per_sec; + const double inv_clocks_per_sec; //! internal constant containing the total number of ticks //! per rollover. - const double clock_width; + const double clock_width; }; } #endif diff --git a/include/cantera/base/config.h.in b/include/cantera/base/config.h.in index 21cdb8422..45a608fd2 100644 --- a/include/cantera/base/config.h.in +++ b/include/cantera/base/config.h.in @@ -27,9 +27,9 @@ // corresponding Fortran data types on your system. The defaults // are OK for most systems -typedef double doublereal; // Fortran double precision -typedef int integer; // Fortran integer -typedef int ftnlen; // Fortran hidden string length type +typedef double doublereal; // Fortran double precision +typedef int integer; // Fortran integer +typedef int ftnlen; // Fortran hidden string length type // Fortran compilers pass character strings in argument lists by // adding a hidden argument with the length of the string. Some diff --git a/include/cantera/base/ct_defs.h b/include/cantera/base/ct_defs.h index b83c2672c..59c63a983 100644 --- a/include/cantera/base/ct_defs.h +++ b/include/cantera/base/ct_defs.h @@ -80,7 +80,7 @@ const doublereal Planck = 6.62607009e-34; // J-s const doublereal Planck_bar = Planck / (2 * Pi); // m2-kg/s /// log(k/h) -const doublereal logBoltz_Planck = std::log(Boltzmann / Planck); // ln(k_B/h) +const doublereal logBoltz_Planck = std::log(Boltzmann / Planck); // ln(k_B/h) /// Stefan-Boltzmann constant const doublereal StefanBoltz = 5.670373e-8; @@ -154,9 +154,9 @@ typedef std::map Composition; //! Turn on the use of stl vectors for the basic array type within cantera //! Vector of doubles. -typedef std::vector vector_fp; +typedef std::vector vector_fp; //! Vector of ints -typedef std::vector vector_int; +typedef std::vector vector_int; //! A grouplist is a vector of groups of species typedef std::vector > grouplist_t; @@ -164,6 +164,6 @@ typedef std::vector > grouplist_t; //! index returned by functions to indicate "no position" const size_t npos = static_cast(-1); -} // namespace +} // namespace #endif diff --git a/include/cantera/base/ctexceptions.h b/include/cantera/base/ctexceptions.h index c0bc0f904..bbfae008b 100644 --- a/include/cantera/base/ctexceptions.h +++ b/include/cantera/base/ctexceptions.h @@ -39,7 +39,7 @@ namespace Cantera * * A group of defines may be used during debugging to assert * conditions which should be true. These are named AssertTrace(), - * AssertThrow(), and AssertThrowMsg(). Examples of their usage is + * AssertThrow(), and AssertThrowMsg(). Examples of their usage is * given below. * * @code @@ -200,7 +200,7 @@ public: /*! * This is a std:string containing the file name and the line number */ -#define STR_TRACE (std::string(__FILE__) + ":" + XSTR_TRACE_LINE(__LINE__)) +#define STR_TRACE (std::string(__FILE__) + ":" + XSTR_TRACE_LINE(__LINE__)) #ifdef NDEBUG #ifndef AssertTrace @@ -217,7 +217,7 @@ public: //! Assertion must be true or an error is thrown /*! * Assertion must be true or else a CanteraError is thrown. A diagnostic string containing the - * file and line number, indicating where the error + * file and line number, indicating where the error * occurred is added to the thrown object. * * @param expr Boolean expression that must be true diff --git a/include/cantera/base/ctml.h b/include/cantera/base/ctml.h index 81ade7bce..0ea1bac42 100644 --- a/include/cantera/base/ctml.h +++ b/include/cantera/base/ctml.h @@ -176,7 +176,7 @@ void addFloatArray(XML_Node& node, const std::string& titleString, * @code * const XML_Node &node; * std::string titleString = "additionalTemperatures"; - * int n = 3; + * int n = 3; * int Tcases[3] = [273.15, 298.15, 373.15]; * std::string typeString = "optional"; * std::string units = "Kelvin"; @@ -241,11 +241,11 @@ void addNamedFloatArray(XML_Node& parentNode, const std::string& name, const siz void addString(XML_Node& node, const std::string& titleString, const std::string& valueString, const std::string& typeString=""); -//! This function reads the current node or a child node of the current node +//! This function reads the current node or a child node of the current node //! with the default name, "floatArray", with a value field //! consisting of a comma separated list of floats /*! - * This function will read either the current XML node or a child node to the + * This function will read either the current XML node or a child node to the * current XML node, with the name "floatArray". It will have a title * attribute, and the body of the XML node will be filled out with a comma * separated list of doublereals. Get an array of floats from the XML Node. diff --git a/include/cantera/base/global.h b/include/cantera/base/global.h index ca4f199a5..98d2935db 100644 --- a/include/cantera/base/global.h +++ b/include/cantera/base/global.h @@ -7,7 +7,7 @@ * @ingroup utils * * These functions store - * some parameters in global storage that are accessible at all times + * some parameters in global storage that are accessible at all times * from the calling application. * Contains module definitions for * - inputfiles (see \ref inputfiles) @@ -115,7 +115,7 @@ void addDirectory(const std::string& dir); void appdelete(); //! @copydoc Application::thread_complete -void thread_complete() ; +void thread_complete(); //! Returns root directory where %Cantera is installed /*! diff --git a/include/cantera/base/logger.h b/include/cantera/base/logger.h index 57d8f4a79..85aa90b8a 100644 --- a/include/cantera/base/logger.h +++ b/include/cantera/base/logger.h @@ -22,7 +22,7 @@ namespace Cantera /// stream, but classes may be derived from Logger that implement /// other output options. This is important when Cantera is used /// in applications that do not display the standard output, such -/// as MATLAB. The Cantera MATLAB interface derives a class from +/// as MATLAB. The Cantera MATLAB interface derives a class from /// Logger that implements these methods with MATLAB-specific /// procedures, insuring that the messages will be passed through /// to the user. It would also be possible to derive a class that diff --git a/include/cantera/base/utilities.h b/include/cantera/base/utilities.h index d4fae6874..32bb6d76b 100644 --- a/include/cantera/base/utilities.h +++ b/include/cantera/base/utilities.h @@ -308,7 +308,7 @@ inline void sum_each(OutputIter x_begin, OutputIter x_end, * Example: * * \code - * vector x(3), y(20), ; + * vector x(3), y(20); * vector index(3); * index[0] = 9; * index[1] = 2; diff --git a/include/cantera/base/xml.h b/include/cantera/base/xml.h index 3eba6f203..e6b80ad7e 100644 --- a/include/cantera/base/xml.h +++ b/include/cantera/base/xml.h @@ -395,7 +395,7 @@ public: /*! * @param n Number of the child to return */ - XML_Node& child(const size_t n) const ; + XML_Node& child(const size_t n) const; //! Return an unchangeable reference to the vector of children of the current node /*! @@ -540,7 +540,7 @@ public: */ std::vector getChildren(const std::string& name) const; - //! Return a changeable reference to a child of the current node, named by the argument + //! Return a changeable reference to a child of the current node, named by the argument /*! * Note the underlying data allows for more than one XML element with the same name. * This routine returns the first child with the given name. @@ -709,7 +709,7 @@ protected: /*! * Search for a phase Node matching a name. * - * @param root Starting XML_Node* pointer for the search + * @param root Starting XML_Node* pointer for the search * @param phaseName Name of the phase to search for * * @return Returns the XML_Node pointer if the phase is found. diff --git a/include/cantera/equil/ChemEquil.h b/include/cantera/equil/ChemEquil.h index e4bfec3a6..bdb7f12b1 100644 --- a/include/cantera/equil/ChemEquil.h +++ b/include/cantera/equil/ChemEquil.h @@ -32,10 +32,10 @@ public: iterations(0), maxStepSize(10.0), propertyPair(TP), contin(false) {} - doublereal relTolerance; ///< Relative tolerance - doublereal absElemTol; ///< Abs Tol in element number - int maxIterations; ///< Maximum number of iterations - int iterations; ///< Iteration counter + doublereal relTolerance; ///< Relative tolerance + doublereal absElemTol; ///< Abs Tol in element number + int maxIterations; ///< Maximum number of iterations + int iterations; ///< Iteration counter /** * Maximum step size. Largest change in any element potential or @@ -77,7 +77,7 @@ class PropertyCalculator; * chemical equilibrium. Non-stoichiometric methods are faster * when they converge, but stoichiometric ones tend to be more * robust and can be used also for problems with multiple - * condensed phases. As expected, the ChemEquil solver is faster + * condensed phases. As expected, the ChemEquil solver is faster * than MultiPhaseEquil for many single-phase equilibrium * problems (particularly if there are only a few elements but * very many species), but can be less stable. Problem @@ -153,7 +153,7 @@ protected: * means that the 2 ThermoPhases have to have consist of the same * species and elements. */ - thermo_t* m_phase; + thermo_t* m_phase; //! number of atoms of element m in species k. doublereal nAtoms(size_t k, size_t m) const { @@ -183,7 +183,7 @@ protected: int setInitialMoles(thermo_t& s, vector_fp& elMoleGoal, int loglevel = 0); //! Generate a starting estimate for the element potentials. - int estimateElementPotentials(thermo_t& s, vector_fp& lambda, + int estimateElementPotentials(thermo_t& s, vector_fp& lambda, vector_fp& elMolesGoal, int loglevel = 0); /*! diff --git a/include/cantera/equil/MultiPhase.h b/include/cantera/equil/MultiPhase.h index 77aad5e79..70a90da75 100644 --- a/include/cantera/equil/MultiPhase.h +++ b/include/cantera/equil/MultiPhase.h @@ -629,7 +629,7 @@ private: std::map m_enamemap; //! Number of phases in the MultiPhase object - size_t m_np; + size_t m_np; //! Current value of the temperature (kelvin) doublereal m_temp; @@ -761,7 +761,7 @@ size_t BasisOptimize(int* usedZeroedSpecies, bool doFormRxn, * * Also, without perturbation of FormulaMatrix[], BasisOptimize[] would * produce a zero pivot because the matrix would be singular (unless the argon - * element column was already the last column of FormulaMatrix[]. + * element column was already the last column of FormulaMatrix[]. * * This routine borrows heavily from BasisOptimize algorithm. It finds nc * constraints which span the range space of the Component Formula matrix, and diff --git a/include/cantera/equil/MultiPhaseEquil.h b/include/cantera/equil/MultiPhaseEquil.h index 1ce7228ec..2b502a3cc 100644 --- a/include/cantera/equil/MultiPhaseEquil.h +++ b/include/cantera/equil/MultiPhaseEquil.h @@ -8,9 +8,9 @@ namespace Cantera { /*! - * Multiphase chemical equilibrium solver. Class MultiPhaseEquil is designed + * Multiphase chemical equilibrium solver. Class MultiPhaseEquil is designed * to be used to set a mixture containing one or more phases to a state of - * chemical equilibrium. It implements the VCS algorithm, described in Smith + * chemical equilibrium. It implements the VCS algorithm, described in Smith * and Missen, "Chemical Reaction Equilibrium." * * This class only handles chemical equilibrium at a specified temperature and diff --git a/include/cantera/equil/vcs_MultiPhaseEquil.h b/include/cantera/equil/vcs_MultiPhaseEquil.h index baf187e42..201d70f07 100644 --- a/include/cantera/equil/vcs_MultiPhaseEquil.h +++ b/include/cantera/equil/vcs_MultiPhaseEquil.h @@ -82,7 +82,7 @@ public: * number of components, which can be obtained from the * numComponents() command. */ - size_t component(size_t m) const ; + size_t component(size_t m) const; //! Get the stoichiometric reaction coefficients for a single //! reaction index @@ -260,7 +260,7 @@ public: * @param logLevel Determines the amount of printing to the output file. */ int equilibrate_TV(int XY, doublereal xtarget, - int estimateEquil = 0, + int estimateEquil = 0, int printLvl = 0, doublereal err = 1.0E-6, int maxsteps = VCS_MAXSTEPS, int logLevel = -99); @@ -276,7 +276,7 @@ public: * compile with debug flags to get some printing). * @param logLevel Determines the amount of printing to the output file. */ - int determine_PhaseStability(int iph, double& funcStab, int printLvl= 0, int logLevel = -99); + int determine_PhaseStability(int iph, double& funcStab, int printLvl= 0, int logLevel = -99); //! Report the equilibrium answer in a comma separated table format /*! @@ -303,7 +303,7 @@ public: // Friend functions friend int vcs_Cantera_to_vprob(MultiPhase* mphase, VCS_PROB* vprob); - friend int vcs_Cantera_update_vprob(MultiPhase* mphase, VCS_PROB* vprob); + friend int vcs_Cantera_update_vprob(MultiPhase* mphase, VCS_PROB* vprob); protected: //! Vector that takes into account of the current sorting of the species diff --git a/include/cantera/equil/vcs_SpeciesProperties.h b/include/cantera/equil/vcs_SpeciesProperties.h index 02f1ac782..e2aad611b 100644 --- a/include/cantera/equil/vcs_SpeciesProperties.h +++ b/include/cantera/equil/vcs_SpeciesProperties.h @@ -15,32 +15,32 @@ class vcs_VolPhase; class vcs_SpeciesProperties { public: - size_t IndexPhase; - size_t IndexSpeciesPhase; + size_t IndexPhase; + size_t IndexSpeciesPhase; vcs_VolPhase* OwningPhase; - size_t NumElements; + size_t NumElements; //! Name of the species std::string SpName; VCS_SPECIES_THERMO* SpeciesThermo; /* Pointer to the thermo structure for this species */ - double WtSpecies; /* Molecular Weight of the species (gm/mol) */ + double WtSpecies; /* Molecular Weight of the species (gm/mol) */ //! Column of the formula matrix, comprising the //! element composition of the species */ std::vector FormulaMatrixCol; - double Charge; /* Charge state of the species -> This may + double Charge; /* Charge state of the species -> This may be duplication of what's in the FormulaMatrixCol entries. However, it's prudent to separate it out. */ - int SurfaceSpecies; /* True if this species belongs to a surface phase */ + int SurfaceSpecies; /* True if this species belongs to a surface phase */ /* * Various Calculated Quantities that are appropriate to * keep copies of at this level. */ - double VolPM; /* Partial molar volume of the species */ + double VolPM; /* Partial molar volume of the species */ double ReferenceMoleFraction; /* Representative value of the mole fraction of this species in a phase. This value is used for convergence issues diff --git a/include/cantera/equil/vcs_VolPhase.h b/include/cantera/equil/vcs_VolPhase.h index 2d91af47c..ca520b214 100644 --- a/include/cantera/equil/vcs_VolPhase.h +++ b/include/cantera/equil/vcs_VolPhase.h @@ -20,8 +20,8 @@ namespace Cantera class ThermoPhase; //! Models for the standard state volume of each species -#define VCS_SSVOL_IDEALGAS 0 -#define VCS_SSVOL_CONSTANT 1 +#define VCS_SSVOL_IDEALGAS 0 +#define VCS_SSVOL_CONSTANT 1 /* * DEFINITIONS FOR THE vcs_VolPhase structure @@ -29,14 +29,14 @@ class ThermoPhase; * Equation of State Types * - Permissible values for the EqnState variable in CPC_PHASE structure */ -#define VCS_EOS_CONSTANT 0 -#define VCS_EOS_IDEAL_GAS 1 -#define VCS_EOS_STOICH_SUB 5 -#define VCS_EOS_IDEAL_SOLN 22 +#define VCS_EOS_CONSTANT 0 +#define VCS_EOS_IDEAL_GAS 1 +#define VCS_EOS_STOICH_SUB 5 +#define VCS_EOS_IDEAL_SOLN 22 #define VCS_EOS_DEBEYE_HUCKEL 23 #define VCS_EOS_REDLICK_KWONG 24 -#define VCS_EOS_REGULAR_SOLN 25 -#define VCS_EOS_UNK_CANTERA -1 +#define VCS_EOS_REGULAR_SOLN 25 +#define VCS_EOS_UNK_CANTERA -1 struct VCS_SPECIES; class vcs_SpeciesProperties; @@ -832,7 +832,7 @@ private: * - VCS_STATECALC_NEW * - VCS_STATECALC_TMP */ - int m_vcsStateStatus; + int m_vcsStateStatus; //! Value of the potential for the phase (Volts) double m_phi; diff --git a/include/cantera/equil/vcs_defs.h b/include/cantera/equil/vcs_defs.h index e7c016257..653da9a6c 100644 --- a/include/cantera/equil/vcs_defs.h +++ b/include/cantera/equil/vcs_defs.h @@ -17,14 +17,14 @@ namespace Cantera * ERROR CODES */ //@{ -#define VCS_SUCCESS 0 -#define VCS_NOMEMORY 1 +#define VCS_SUCCESS 0 +#define VCS_NOMEMORY 1 #define VCS_FAILED_CONVERGENCE -1 -#define VCS_SHOULDNT_BE_HERE -2 -#define VCS_PUB_BAD -3 -#define VCS_THERMO_OUTOFRANGE -4 -#define VCS_FAILED_LOOKUP -5 -#define VCS_MP_FAIL -6 +#define VCS_SHOULDNT_BE_HERE -2 +#define VCS_PUB_BAD -3 +#define VCS_THERMO_OUTOFRANGE -4 +#define VCS_FAILED_LOOKUP -5 +#define VCS_MP_FAIL -6 //@} /*! @@ -46,32 +46,32 @@ namespace Cantera //! Cutoff relative mole fraction value, //! below which species are deleted from the equilibrium problem. #ifndef VCS_RELDELETE_SPECIES_CUTOFF -#define VCS_RELDELETE_SPECIES_CUTOFF 1.0e-64 +#define VCS_RELDELETE_SPECIES_CUTOFF 1.0e-64 #endif //! Cutoff relative mole number value, //! below which species are deleted from the equilibrium problem. #ifndef VCS_DELETE_MINORSPECIES_CUTOFF -#define VCS_DELETE_MINORSPECIES_CUTOFF 1.0e-140 +#define VCS_DELETE_MINORSPECIES_CUTOFF 1.0e-140 #endif //! Relative value of multiphase species mole number for a //! multiphase species which is small. #ifndef VCS_SMALL_MULTIPHASE_SPECIES -#define VCS_SMALL_MULTIPHASE_SPECIES 1.0e-25 +#define VCS_SMALL_MULTIPHASE_SPECIES 1.0e-25 #endif -//! Cutoff relative moles below which a phase is deleted -//! from the equilibrium problem. +//! Cutoff relative moles below which a phase is deleted +//! from the equilibrium problem. #ifndef VCS_DELETE_PHASE_CUTOFF -#define VCS_DELETE_PHASE_CUTOFF 1.0e-13 +#define VCS_DELETE_PHASE_CUTOFF 1.0e-13 #endif //! Relative mole number of species in a phase that is created //! We want this to be comfortably larger than the VCS_DELETE_PHASE_CUTOFF value //! so that the phase can have a chance to survive. #ifndef VCS_POP_PHASE_MOLENUM -#define VCS_POP_PHASE_MOLENUM 1.0e-11 +#define VCS_POP_PHASE_MOLENUM 1.0e-11 #endif @@ -79,7 +79,7 @@ namespace Cantera //! comprises the bulk of an element's total concentration //! is deleted. #ifndef VCS_DELETE_ELEMENTABS_CUTOFF -#define VCS_DELETE_ELEMENTABS_CUTOFF 1.0e-280 +#define VCS_DELETE_ELEMENTABS_CUTOFF 1.0e-280 #endif //! Maximum steps in the inner loop @@ -94,9 +94,9 @@ namespace Cantera * @{ */ //! nondimensional -#define VCS_NONDIMENSIONAL_G 1 +#define VCS_NONDIMENSIONAL_G 1 //! dimensioned -#define VCS_DIMENSIONAL_G 0 +#define VCS_DIMENSIONAL_G 0 //@} @@ -112,24 +112,24 @@ namespace Cantera * An example of this would be a species that contains Ni. But, * the amount of Ni elements is exactly zero. */ -#define VCS_SPECIES_COMPONENT_STOICHZERO 3 +#define VCS_SPECIES_COMPONENT_STOICHZERO 3 //! Species is a component which can be nonzero -#define VCS_SPECIES_COMPONENT 2 +#define VCS_SPECIES_COMPONENT 2 //! Species is a major species /*! * A major species is either a species in a multicomponent phase with * significant concentration or it's a Stoich Phase */ -#define VCS_SPECIES_MAJOR 1 +#define VCS_SPECIES_MAJOR 1 //! Species is a major species /*! * A major species is either a species in a multicomponent phase with * significant concentration or it's a Stoich Phase */ -#define VCS_SPECIES_MINOR 0 +#define VCS_SPECIES_MINOR 0 //! Species lies in a multicomponent phase, with a small phase concentration /*! @@ -137,21 +137,21 @@ namespace Cantera * It concentration is currently very low, necessitating a * different method of calculation. */ -#define VCS_SPECIES_SMALLMS -1 +#define VCS_SPECIES_SMALLMS -1 //! Species lies in a multicomponent phase with concentration zero /*! * The species lies in a multicomponent phase which currently doesn't exist. * It concentration is currently zero. */ -#define VCS_SPECIES_ZEROEDMS -2 +#define VCS_SPECIES_ZEROEDMS -2 //! Species is a SS phase, that is currently zeroed out. /*! * The species lies in a single-species phase which * is currently zeroed out. */ -#define VCS_SPECIES_ZEROEDSS -3 +#define VCS_SPECIES_ZEROEDSS -3 //! Species has such a small mole fraction it is deleted even though its //! phase may possibly exist. @@ -160,14 +160,14 @@ namespace Cantera * that it best to throw the calculation of it out. * It will be added back in at the end of the calculation. */ -#define VCS_SPECIES_DELETED -4 +#define VCS_SPECIES_DELETED -4 //! Species refers to an electron in the metal. /*! * The unknown is equal to the electric potential of the phase * in which it exists. */ -#define VCS_SPECIES_INTERFACIALVOLTAGE -5 +#define VCS_SPECIES_INTERFACIALVOLTAGE -5 //! Species lies in a multicomponent phase that is zeroed atm /*! @@ -176,7 +176,7 @@ namespace Cantera * These species will formally always have zero mole numbers in the * solution vector. */ -#define VCS_SPECIES_ZEROEDPHASE -6 +#define VCS_SPECIES_ZEROEDPHASE -6 //! Species lies in a multicomponent phase that is active, but species concentration is zero /*! @@ -185,7 +185,7 @@ namespace Cantera * is a temporary condition that exists at the start of an equilibrium problem. * The species is soon "birthed" or "deleted". */ -#define VCS_SPECIES_ACTIVEBUTZERO -7 +#define VCS_SPECIES_ACTIVEBUTZERO -7 //! Species lies in a multicomponent phase that is active, //! but species concentration is zero due to stoich constraint @@ -196,7 +196,7 @@ namespace Cantera * An example of this would be a species that contains Ni. But, * the amount of Ni elements in the current problem statement is exactly zero. */ -#define VCS_SPECIES_STOICHZERO -8 +#define VCS_SPECIES_STOICHZERO -8 //@} @@ -206,26 +206,26 @@ namespace Cantera */ //@{ //! Always exists because it contains inerts which can't exist in any other phase -#define VCS_PHASE_EXIST_ALWAYS 3 +#define VCS_PHASE_EXIST_ALWAYS 3 //! Phase is a normal phase that currently exists -#define VCS_PHASE_EXIST_YES 2 +#define VCS_PHASE_EXIST_YES 2 //! Phase is a normal phase that exists in a small concentration /*! * Concentration is so small that it must be calculated using an alternate * method */ -#define VCS_PHASE_EXIST_MINORCONC 1 +#define VCS_PHASE_EXIST_MINORCONC 1 //! Phase doesn't currently exist in the mixture -#define VCS_PHASE_EXIST_NO 0 +#define VCS_PHASE_EXIST_NO 0 //! Phase currently is zeroed due to a programmatic issue /*! * We zero phases because we want to follow phase stability boundaries. */ -#define VCS_PHASE_EXIST_ZEROEDPHASE -6 +#define VCS_PHASE_EXIST_ZEROEDPHASE -6 //@} @@ -257,11 +257,11 @@ namespace Cantera @endverbatim * @{ */ -#define VCS_UNITS_KCALMOL -1 -#define VCS_UNITS_UNITLESS 0 -#define VCS_UNITS_KJMOL 1 -#define VCS_UNITS_KELVIN 2 -#define VCS_UNITS_MKS 3 +#define VCS_UNITS_KCALMOL -1 +#define VCS_UNITS_UNITLESS 0 +#define VCS_UNITS_KJMOL 1 +#define VCS_UNITS_KELVIN 2 +#define VCS_UNITS_MKS 3 //@} /*! @@ -275,7 +275,7 @@ namespace Cantera //! An element constraint that is current turned off -#define VCS_ELEM_TYPE_TURNEDOFF -1 +#define VCS_ELEM_TYPE_TURNEDOFF -1 //! Normal element constraint consisting of positive coefficients for the //! formula matrix. @@ -284,13 +284,13 @@ namespace Cantera * With this constraint, we may employ various strategies to handle * small values of the element number successfully. */ -#define VCS_ELEM_TYPE_ABSPOS 0 +#define VCS_ELEM_TYPE_ABSPOS 0 //! This refers to conservation of electrons /*! * Electrons may have positive or negative values in the Formula matrix. */ -#define VCS_ELEM_TYPE_ELECTRONCHARGE 1 +#define VCS_ELEM_TYPE_ELECTRONCHARGE 1 //! This refers to a charge neutrality of a single phase /*! @@ -328,7 +328,7 @@ namespace Cantera /*! * currently there are none */ -#define VCS_ELEM_TYPE_OTHERCONSTRAINT 6 +#define VCS_ELEM_TYPE_OTHERCONSTRAINT 6 //@} /*! @@ -336,7 +336,7 @@ namespace Cantera * @{ */ //! Unknown refers to mole number of a single species -#define VCS_SPECIES_TYPE_MOLNUM 0 +#define VCS_SPECIES_TYPE_MOLNUM 0 //! Unknown refers to the voltage level of a phase /*! @@ -356,20 +356,20 @@ namespace Cantera * @{ */ //! State Calculation is currently in an unknown state -#define VCS_STATECALC_UNKNOWN -1 +#define VCS_STATECALC_UNKNOWN -1 //! State Calculation based on the old or base mole numbers -#define VCS_STATECALC_OLD 0 +#define VCS_STATECALC_OLD 0 //! State Calculation based on the new or tentative mole numbers -#define VCS_STATECALC_NEW 1 +#define VCS_STATECALC_NEW 1 //! State Calculation based on tentative mole numbers //! for a phase which is currently zeroed, but is being //! evaluated for whether it should pop back into existence -#define VCS_STATECALC_PHASESTABILITY 2 +#define VCS_STATECALC_PHASESTABILITY 2 //! State Calculation based on a temporary set of mole numbers -#define VCS_STATECALC_TMP 3 +#define VCS_STATECALC_TMP 3 //@} } diff --git a/include/cantera/equil/vcs_internal.h b/include/cantera/equil/vcs_internal.h index 9e768631d..755a119b5 100644 --- a/include/cantera/equil/vcs_internal.h +++ b/include/cantera/equil/vcs_internal.h @@ -93,7 +93,7 @@ public: * - VCS_UNITS_UNITLESS: 1.0 K-1 * - VCS_UNITS_KJMOL: kJ gmol-1 K-1 * - VCS_UNITS_KELVIN: 1.0 K-1 - * - VCS_UNITS_MKS: joules kmol-1 K-1 = kg m2 s-2 kmol-1 K-1 + * - VCS_UNITS_MKS: joules kmol-1 K-1 = kg m2 s-2 kmol-1 K-1 */ double vcsUtil_gasConstant(int mu_units); diff --git a/include/cantera/equil/vcs_prob.h b/include/cantera/equil/vcs_prob.h index a2d3f9bcb..4d6fe43ef 100644 --- a/include/cantera/equil/vcs_prob.h +++ b/include/cantera/equil/vcs_prob.h @@ -182,7 +182,7 @@ public: //! Molecular weight of species /*! - * WtSpecies[k] = molecular weight of species in gm/mol + * WtSpecies[k] = molecular weight of species in gm/mol */ std::vector WtSpecies; @@ -195,7 +195,7 @@ public: // String containing the title of the run std::string Title; - //! Vector of pointers to thermo structures which identify the model and + //! Vector of pointers to thermo structures which identify the model and //! parameters for evaluating the thermodynamic functions for that //! particular species std::vector SpeciesThermo; diff --git a/include/cantera/equil/vcs_solve.h b/include/cantera/equil/vcs_solve.h index d9b2891a5..2f00242cb 100644 --- a/include/cantera/equil/vcs_solve.h +++ b/include/cantera/equil/vcs_solve.h @@ -112,7 +112,7 @@ public: * using a variant of the VCS method. Nonideal phases can be accommodated * as well. * - * Any number of single-species phases and multi-species phases + * 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; @@ -241,7 +241,7 @@ public: * across the interface on the SHE (standard hydrogen electrode) scale * (volts). * - #VCS_SPECIES_ZEROEDPHASE: Species lies in a multicomponent phase - * that is zeroed atm and will stay deleted due to a choice from a + * that is zeroed atm and will stay deleted due to a choice from a * higher level. These species will formally always have zero mole * numbers in the solution vector. * - #VCS_SPECIES_ACTIVEBUTZERO: The species lies in a multicomponent @@ -481,7 +481,7 @@ public: //! into existence /*! * Updates #m_deltaMolNumSpecies[irxn] : reaction adjustments, where irxn - * refers to the irxn'th species formation reaction. This adjustment is + * refers to the irxn'th species formation reaction. This adjustment is * for species irxn + M, where M is the number of components. * * @param iphasePop Phase id of the phase that will come into existence @@ -503,7 +503,7 @@ public: * ------- * m_deltaMolNumSpecies(irxn) : reaction adjustments, where irxn refers to * the irxn'th species formation reaction. - * This adjustment is for species irxn + M, + * This adjustment is for species irxn + M, * where M is the number of components. * * Special branching occurs sometimes. This causes the component basis @@ -532,7 +532,7 @@ public: * Formation reactions are * reactions which create each noncomponent species from the component * species. m_stoichCoeffRxnMatrix(jcomp,irxn) are the stoichiometric - * coefficients for these reactions. A stoichiometric coefficient of + * coefficients for these reactions. A stoichiometric coefficient of * one is assumed for species irxn in this reaction. * * @param l @@ -797,7 +797,7 @@ public: * actually contains argon. Then, nc < ne. Also, without perturbation of * FormulaMatrix[] vcs_basopt[] would produce a zero pivot because the * matrix would be singular (unless the argon element column was already - * the last column of FormulaMatrix[]. + * the last column of FormulaMatrix[]. * * This routine borrows heavily from vcs_basopt's algorithm. It finds nc * constraints which span the range space of the Component Formula matrix, @@ -848,7 +848,7 @@ public: * * NOTE: currently this routine is not used. */ - int vcs_rxn_adj_cg(); + int vcs_rxn_adj_cg(); //! Calculates the diagonal contribution to the Hessian due to //! the dependence of the activity coefficients on the mole numbers. @@ -947,7 +947,7 @@ public: * with significantly different total kmol numbers than one * the algorithm would have problems. */ - void vcs_nondim_TP(); + void vcs_nondim_TP(); //! Redimensionalize the problem data /*! @@ -957,7 +957,7 @@ public: * or in nondimensional form. This routine switches the data from * nondimensional form into dimensional form. */ - void vcs_redim_TP(); + void vcs_redim_TP(); //! Print the string representing the Chemical potential units /*! @@ -965,7 +965,7 @@ public: * * @param unitsFormat Integer representing the units system */ - void vcs_printChemPotUnits(int unitsFormat) const; + void vcs_printChemPotUnits(int unitsFormat) const; //! Computes the current elemental abundances vector /*! @@ -984,7 +984,7 @@ public: * definition. Satisfaction of extra constraints would have had to occur * in the problem specification. * - * The constraints should be broken up into 2 sections. If a constraint + * The constraints should be broken up into 2 sections. If a constraint * involves a formula matrix with positive and negative signs, and eaSet = * 0.0, then you can't expect that the sum will be zero. There may be * roundoff that inhibits this. However, if the formula matrix is all of @@ -1202,7 +1202,7 @@ private: * * Then, if TL is zero, the phase pops into existence if DG_i_O < 0. * Also, if the phase exists, then we check to see if the species - * can have a mole number larger than VCS_DELETE_SPECIES_CUTOFF + * can have a mole number larger than VCS_DELETE_SPECIES_CUTOFF * (default value = 1.0E-32). */ int vcs_recheck_deleted(); @@ -1354,7 +1354,7 @@ private: * @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 + * @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 @@ -1427,10 +1427,10 @@ private: std::vector m_wx; public: - //! value of the number of species used to malloc data structures + //! value of the number of species used to malloc data structures size_t NSPECIES0; - //! value of the number of phases used to malloc data structures + //! value of the number of phases used to malloc data structures size_t NPHASE0; //! Total number of species in the problems @@ -1531,7 +1531,7 @@ public: //! at the new tentatite T, P, and mole numbers. /*! * The first NC entries are for components. The following - * NR entries are for the current non-component species in the mechanism. + * NR entries are for the current non-component species in the mechanism. * Length = number of species */ std::vector m_feSpecies_new; @@ -1575,7 +1575,7 @@ public: */ Array2D m_deltaMolNumPhase; - //! This is 1 if the phase, iphase, participates in the formation reaction + //! This is 1 if the phase, iphase, participates in the formation reaction //! irxn, and zero otherwise. PhaseParticipation(iphase,irxn) Array2D m_phaseParticipation; @@ -1588,7 +1588,7 @@ public: //! Delta G(irxn) for the noncomponent species in the mechanism. /*! - * Computed by the subroutine deltaG. m_deltaGRxn is the free + * Computed by the subroutine deltaG. m_deltaGRxn is the free * energy change for the reaction which forms species K from the * component species. This vector has length equal to the number * of noncomponent species in the mechanism. It starts with @@ -1674,7 +1674,7 @@ public: std::vector m_deltaPhaseMoles; //! Temperature (Kelvin) - double m_temperature; + double m_temperature; //! Pressure (units are determined by m_VCS_UnitsFormat /*! @@ -1692,7 +1692,7 @@ public: //! Total kmoles of inert to add to each phase /*! - * TPhInertMoles[iph] = Total kmoles of inert to add to each phase + * TPhInertMoles[iph] = Total kmoles of inert to add to each phase * length = number of phases */ std::vector TPhInertMoles; @@ -1703,7 +1703,7 @@ public: //! Tolerance requirements for minor species double m_tolmin; - //! Below this, major species aren't refined any more + //! Below this, major species aren't refined any more double m_tolmaj2; //! Below this, minor species aren't refined any more @@ -1751,7 +1751,7 @@ public: std::vector m_elementMapIndex; //! Mapping between the species index for noncomponent species and the - //! full species index. + //! full species index. /*! * ir[irxn] = Mapping between the reaction index for noncomponent * formation reaction of a species and the full species @@ -1819,7 +1819,7 @@ public: /*! * The default is to have this unitless */ - char m_unitsState; + char m_unitsState; //! Multiplier for the mole numbers within the nondimensionless formulation /*! @@ -1830,7 +1830,7 @@ public: */ double m_totalMoleScale; - //! specifies the activity convention of the phase containing the species + //! specifies the activity convention of the phase containing the species /*! * * 0 = molar based * * 1 = molality based @@ -1848,7 +1848,7 @@ public: */ std::vector m_phaseActConvention; - //! specifies the ln(Mnaught) used to calculate the chemical potentials + //! specifies the ln(Mnaught) used to calculate the chemical potentials /*! * For molar based activity conventions this will be equal to 0.0. * length = number of species. @@ -1890,7 +1890,7 @@ public: std::vector > phasePopProblemLists_; //! Vector of pointers to thermostructures which identify the model - //! and parameters for evaluating the thermodynamic functions for that + //! and parameters for evaluating the thermodynamic functions for that //! particular species. /*! * SpeciesThermo[k] pointer to the thermo information for the kth species @@ -1900,7 +1900,7 @@ public: //! Choice of Hessians /*! * If this is true, then we will use a better approximation to the - * Hessian based on Jacobian of the ln(ActCoeff) with respect to mole + * Hessian based on Jacobian of the ln(ActCoeff) with respect to mole * numbers */ int m_useActCoeffJac; diff --git a/include/cantera/equil/vcs_species_thermo.h b/include/cantera/equil/vcs_species_thermo.h index c4b296d19..7e2ccb951 100644 --- a/include/cantera/equil/vcs_species_thermo.h +++ b/include/cantera/equil/vcs_species_thermo.h @@ -17,15 +17,15 @@ namespace Cantera class vcs_VolPhase; // Models for the species standard state Naught temperature dependence -#define VCS_SS0_NOTHANDLED -1 -#define VCS_SS0_CONSTANT 0 -//#define VCS_SS0_NASA_POLY 1 -#define VCS_SS0_CONSTANT_CP 2 +#define VCS_SS0_NOTHANDLED -1 +#define VCS_SS0_CONSTANT 0 +//#define VCS_SS0_NASA_POLY 1 +#define VCS_SS0_CONSTANT_CP 2 // Models for the species standard state extra pressure dependence -#define VCS_SSSTAR_NOTHANDLED -1 -#define VCS_SSSTAR_CONSTANT 0 -#define VCS_SSSTAR_IDEAL_GAS 1 +#define VCS_SSSTAR_NOTHANDLED -1 +#define VCS_SSSTAR_CONSTANT 0 +#define VCS_SSSTAR_IDEAL_GAS 1 /*! * Identifies the thermo model for the species. This structure is shared by @@ -51,7 +51,7 @@ public: //! Integer representing the models for the species standard state //! Naught temperature dependence. They are listed above and start //! with VCS_SS0_... - int SS0_Model; + int SS0_Model; //! Internal storage of the last calculation of the reference naught Gibbs //! free energy at SS0_TSave. (always in units of Kelvin) diff --git a/include/cantera/kinetics/AqueousKinetics.h b/include/cantera/kinetics/AqueousKinetics.h index b948e46ca..6775aa8a0 100644 --- a/include/cantera/kinetics/AqueousKinetics.h +++ b/include/cantera/kinetics/AqueousKinetics.h @@ -31,7 +31,7 @@ public: * 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. + * 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 diff --git a/include/cantera/kinetics/BulkKinetics.h b/include/cantera/kinetics/BulkKinetics.h index 28d7def1f..16f9b10a1 100644 --- a/include/cantera/kinetics/BulkKinetics.h +++ b/include/cantera/kinetics/BulkKinetics.h @@ -52,7 +52,7 @@ protected: //! Difference between the global reactants order and the global products //! order. Of type "double" to account for the fact that we can have real- //! valued stoichiometries. - vector_fp m_dn; + vector_fp m_dn; vector_fp m_conc; vector_fp m_grt; diff --git a/include/cantera/kinetics/FalloffMgr.h b/include/cantera/kinetics/FalloffMgr.h index a052ebc9b..cf69f9af7 100644 --- a/include/cantera/kinetics/FalloffMgr.h +++ b/include/cantera/kinetics/FalloffMgr.h @@ -24,7 +24,7 @@ public: //! Constructor. FalloffMgr() : m_worksize(0) { - m_factory = FalloffFactory::factory(); // RFB:TODO This raw pointer should be encapsulated + m_factory = FalloffFactory::factory(); // RFB:TODO This raw pointer should be encapsulated // because accessing a 'Singleton Factory' } diff --git a/include/cantera/kinetics/ImplicitSurfChem.h b/include/cantera/kinetics/ImplicitSurfChem.h index b9e06e3fb..00d4881be 100644 --- a/include/cantera/kinetics/ImplicitSurfChem.h +++ b/include/cantera/kinetics/ImplicitSurfChem.h @@ -217,7 +217,7 @@ protected: std::vector m_vecKinPtrs; //! Vector of number of species in each Surface Phase - std::vector m_nsp; + std::vector m_nsp; //! index of the surface phase in each InterfaceKinetics object std::vector m_surfindex; @@ -240,13 +240,13 @@ protected: size_t m_numBulkPhases; std::vector m_nspBulkPhases; - size_t m_numTotalBulkSpecies; + size_t m_numTotalBulkSpecies; size_t m_numTotalSpecies; std::vector pLocVec; //! Pointer to the CVODE integrator Integrator* m_integ; - doublereal m_atol, m_rtol; // tolerances + doublereal m_atol, m_rtol; // tolerances doublereal m_maxstep; //!< max step size vector_fp m_work; diff --git a/include/cantera/kinetics/InterfaceKinetics.h b/include/cantera/kinetics/InterfaceKinetics.h index 871cdb109..dcc4ab4f5 100644 --- a/include/cantera/kinetics/InterfaceKinetics.h +++ b/include/cantera/kinetics/InterfaceKinetics.h @@ -36,7 +36,7 @@ class ImplicitSurfChem; * information about the phases (i.e., temperature pressure, and mole * fraction). * - * The extrinsic specification of whether a phase exists or not must be + * The extrinsic specification of whether a phase exists or not must be * specified on top of the intrinsic calculation of the reaction rate. This * class carries a set of booleans indicating whether a phase in the * heterogeneous mechanism exists or not. @@ -113,7 +113,7 @@ public: * * units = J kmol-1 * - * @param deltaG Output vector of deltaG's for reactions Length: + * @param deltaG Output vector of deltaG's for reactions Length: * nReactions(). If 0, this updates the internally stored values only. */ virtual void getDeltaGibbs(doublereal* deltaG); @@ -283,7 +283,7 @@ public: //! When an electrode reaction rate is optionally specified in terms of its //! exchange current density, adjust kfwd to the standard reaction rate constant form and units. - //! When the BV reaction types are used, keep the exchange current density form. + //! When the BV reaction types are used, keep the exchange current density form. /*! * For a reaction rate constant that was given in units of Amps/m2 (exchange current * density formulation with iECDFormulation == true), convert the rate to @@ -498,7 +498,7 @@ protected: //! Electrochemical transfer coefficient for the forward direction /*! * Electrochemical transfer coefficient for all reactions that have transfer reactions - * the reaction is given by m_ctrxn[i] + * the reaction is given by m_ctrxn[i] */ vector_fp m_beta; diff --git a/include/cantera/kinetics/Kinetics.h b/include/cantera/kinetics/Kinetics.h index 8f7279b8b..8a06d844c 100644 --- a/include/cantera/kinetics/Kinetics.h +++ b/include/cantera/kinetics/Kinetics.h @@ -477,7 +477,7 @@ public: * * units = J kmol-1 * - * @param deltaG Output vector of deltaG's for reactions Length: + * @param deltaG Output vector of deltaG's for reactions Length: * nReactions(). */ virtual void getDeltaGibbs(doublereal* deltaG) { @@ -492,7 +492,7 @@ public: * * units = J kmol-1 * - * @param deltaM Output vector of deltaM's for reactions Length: + * @param deltaM Output vector of deltaM's for reactions Length: * nReactions(). */ virtual void getDeltaElectrochemPotentials(doublereal* deltaM) { @@ -947,7 +947,7 @@ protected: * for the species vector for the n'th phase in the kinetics * class. */ - std::vector m_start; + std::vector m_start; /** * Mapping of the phase id, i.e., the id attribute in the XML diff --git a/include/cantera/kinetics/KineticsFactory.h b/include/cantera/kinetics/KineticsFactory.h index 1ea6c13bb..094e2474f 100644 --- a/include/cantera/kinetics/KineticsFactory.h +++ b/include/cantera/kinetics/KineticsFactory.h @@ -39,8 +39,8 @@ public: virtual void deleteFactory() { ScopedLock lock(kinetics_mutex); - delete s_factory ; - s_factory = 0 ; + delete s_factory; + s_factory = 0; } /** diff --git a/include/cantera/kinetics/RateCoeffMgr.h b/include/cantera/kinetics/RateCoeffMgr.h index 7d6721968..1a01e5dce 100644 --- a/include/cantera/kinetics/RateCoeffMgr.h +++ b/include/cantera/kinetics/RateCoeffMgr.h @@ -76,8 +76,8 @@ public: } protected: - std::vector m_rates; - std::vector m_rxn; + std::vector m_rates; + std::vector m_rxn; //! map reaction number to index in m_rxn / m_rates std::map m_indices; diff --git a/include/cantera/kinetics/ReactionPath.h b/include/cantera/kinetics/ReactionPath.h index 2dc120172..88be82144 100644 --- a/include/cantera/kinetics/ReactionPath.h +++ b/include/cantera/kinetics/ReactionPath.h @@ -14,7 +14,7 @@ namespace Cantera { -enum flow_t { NetFlow, OneWayFlow }; +enum flow_t { NetFlow, OneWayFlow }; // forward references class Path; @@ -33,10 +33,10 @@ public: virtual ~SpeciesNode() {} // public attributes - size_t number; ///< Species number - std::string name; ///< Label on graph - doublereal value; ///< May be used to set node appearance - bool visible; ///< Visible on graph; + size_t number; ///< Species number + std::string name; ///< Label on graph + doublereal value; ///< May be used to set node appearance + bool visible; ///< Visible on graph; /** * @name References. @@ -44,10 +44,10 @@ public: * to another node. */ //@{ - Path* path(int n) { + Path* path(int n) { return m_paths[n]; } - const Path* path(int n) const { + const Path* path(int n) const { return m_paths[n]; } //@} @@ -269,8 +269,7 @@ public: std::string dashed_color; std::string element; std::string m_font; - doublereal threshold, - bold_min, dashed_max, label_min; + doublereal threshold, bold_min, dashed_max, label_min; doublereal x_size, y_size; std::string name, dot_options; flow_t flow_type; @@ -280,14 +279,14 @@ public: doublereal arrow_hue; protected: - doublereal m_flxmax; + doublereal m_flxmax; std::map > m_paths; std::map m_nodes; - std::vector m_pathlist; - std::vector m_include; - std::vector m_exclude; + std::vector m_pathlist; + std::vector m_include; + std::vector m_exclude; std::vector m_speciesNumber; - std::map m_rxns; + std::map m_rxns; size_t m_local; }; @@ -324,7 +323,7 @@ protected: std::vector > m_groups; std::vector m_sgroup; std::vector m_elementSymbols; - std::map > > m_transfer; + std::map > > m_transfer; std::vector m_determinate; Array2D m_atoms; std::map m_enamemap; diff --git a/include/cantera/kinetics/RxnRates.h b/include/cantera/kinetics/RxnRates.h index 57e7b9d35..3a482be66 100644 --- a/include/cantera/kinetics/RxnRates.h +++ b/include/cantera/kinetics/RxnRates.h @@ -47,7 +47,7 @@ public: //! Update concentration-dependent parts of the rate coefficient. /*! * For this class, there are no - * concentration-dependent parts, so this method does nothing. + * concentration-dependent parts, so this method does nothing. */ void update_C(const doublereal* c) { } diff --git a/include/cantera/kinetics/StoichManager.h b/include/cantera/kinetics/StoichManager.h index 2aadad3b1..67ce2c693 100644 --- a/include/cantera/kinetics/StoichManager.h +++ b/include/cantera/kinetics/StoichManager.h @@ -657,9 +657,9 @@ public: } private: - std::vector m_c1_list; - std::vector m_c2_list; - std::vector m_c3_list; + std::vector m_c1_list; + std::vector m_c2_list; + std::vector m_c3_list; std::vector m_cn_list; }; diff --git a/include/cantera/kinetics/reaction_defs.h b/include/cantera/kinetics/reaction_defs.h index 42270d198..f90dacf93 100644 --- a/include/cantera/kinetics/reaction_defs.h +++ b/include/cantera/kinetics/reaction_defs.h @@ -39,7 +39,7 @@ const int THREE_BODY_RXN = 2; * The general form for a gas-phase association or dissociation reaction, with a * pressure-dependent rate. Example: CH3 + H (+M) <-> CH4 (+M) */ -const int FALLOFF_RXN = 4; +const int FALLOFF_RXN = 4; /** * A pressure-dependent rate expression consisting of several Arrhenius rate @@ -61,7 +61,7 @@ const int CHEBYSHEV_RXN = 6; * a reaction intermediate. Example: Si + SiH4 (+M) <-> Si2H2 + H2 * (+M), which competes with Si + SiH4 (+M) <-> Si2H4 (+M). */ -const int CHEMACT_RXN = 8; +const int CHEMACT_RXN = 8; /** * A reaction occurring on a surface. @@ -69,7 +69,7 @@ const int CHEMACT_RXN = 8; * The dimensionality of the interface is a separate concept from the type * of the reaction. */ -const int SURFACE_RXN = 20; +const int SURFACE_RXN = 20; //! A reaction occurring on an interface, e.g a surface or edge. const int INTERFACE_RXN = 20; @@ -97,13 +97,13 @@ const int SURFACEAFFINITY_RXN = 27; * The dimensionality of the interface is a separate concept from the type * of the reaction. */ -const int EDGE_RXN = 22; +const int EDGE_RXN = 22; /** * A global reaction. These may have non-mass action reaction orders, * and are not allowed to be reversible. */ -const int GLOBAL_RXN = 30; +const int GLOBAL_RXN = 30; //@} @@ -133,7 +133,7 @@ const int CHEBYSHEV_REACTION_RATECOEFF_TYPE = 8; //@{ const int SIMPLE_FALLOFF = 100; const int TROE_FALLOFF = 110; -const int SRI_FALLOFF = 112; +const int SRI_FALLOFF = 112; //@} } diff --git a/include/cantera/kinetics/solveSP.h b/include/cantera/kinetics/solveSP.h index 8bd35bb12..3b06f4b83 100644 --- a/include/cantera/kinetics/solveSP.h +++ b/include/cantera/kinetics/solveSP.h @@ -123,7 +123,7 @@ namespace Cantera * values defined in @ref solvesp_methods. * * ### Pseudo time stepping algorithm: - * The time step is determined from sdot[], so so that the time step + * The time step is determined from sdot[], so that the time step * doesn't ever change the value of a variable by more than 100%. * * This algorithm does use a damped Newton's method to relax the equations. @@ -132,7 +132,7 @@ namespace Cantera * * `EXTRA_ACCURACY`: A constant that is the ratio of the required update norm * in this Newton iteration compared to that in the nonlinear solver. A value - * of 0.1 is used so surface species are safely overconverged. + * of 0.1 is used so surface species are safely overconverged. * * Functions called: * - `ct_dgetrf` -- First half of LAPACK direct solve of a full Matrix @@ -217,7 +217,7 @@ private: * @param netProdRateSolnSP Output variable. Net production rate of all * of the species in the solution vector. * @param XMolSolnSP output variable. Mole fraction of all of the species - * in the solution vector + * in the solution vector * @param label Output variable. Pointer to the value of the species * index (kindexSP) that is controlling the time step * @param label_old Output variable. Pointer to the value of the species @@ -288,8 +288,8 @@ private: * @param do_time Calculate a time dependent residual * @param deltaT Delta time for time dependent problem. */ - void fun_eval(doublereal* resid, const doublereal* CSolnSP, - const doublereal* CSolnOldSP, const bool do_time, const doublereal deltaT); + void fun_eval(doublereal* resid, const doublereal* CSolnSP, + const doublereal* CSolnOldSP, const bool do_time, const doublereal deltaT); //! Main routine that calculates the current residual and Jacobian /*! @@ -305,7 +305,7 @@ private: */ void resjac_eval(SquareMatrix& jac, doublereal* resid, doublereal* CSolnSP, - const doublereal* CSolnSPOld, const bool do_time, + const doublereal* CSolnSPOld, const bool do_time, const doublereal deltaT); //! Pointer to the manager of the implicit surface chemistry problem @@ -397,7 +397,7 @@ private: * This is equal to or less than the total number of volumetric phases in * all of the InterfaceKinetics objects. We usually do not include bulk * phases. Bulk phases are only included in the calculation when their - * domain isn't included in the underlying continuum model conservation + * domain isn't included in the underlying continuum model conservation * equation system. * * This is equal to 0, for the time being @@ -408,7 +408,7 @@ private: /*! * Length is number of bulk phases */ - std::vector m_numBulkSpecies; + std::vector m_numBulkSpecies; //! Total number of species in all bulk phases. /*! @@ -444,7 +444,7 @@ private: * varies from 0 to (num species in phase - 1) and `i` is the surface * phase index in the problem. Length is equal to #m_numSurfPhases. */ - std::vector m_spSurfLarge; + std::vector m_spSurfLarge; //! The absolute tolerance in real units. units are (kmol/m2) doublereal m_atol; diff --git a/include/cantera/numerics/BandMatrix.h b/include/cantera/numerics/BandMatrix.h index 03dfe7f7f..0e827628e 100644 --- a/include/cantera/numerics/BandMatrix.h +++ b/include/cantera/numerics/BandMatrix.h @@ -95,7 +95,7 @@ public: //! Return the value of element (i,j). /*! - * This method does not alter the array. + * This method does not alter the array. * @param i row * @param j column * @return Returns the value of the matrix entry @@ -299,7 +299,7 @@ protected: doublereal m_zero; //! Pivot vector - vector_int m_ipiv; + vector_int m_ipiv; //! Vector of column pointers std::vector m_colPtrs; diff --git a/include/cantera/numerics/CVodesIntegrator.h b/include/cantera/numerics/CVodesIntegrator.h index 481738d0b..eaadd2dd1 100644 --- a/include/cantera/numerics/CVodesIntegrator.h +++ b/include/cantera/numerics/CVodesIntegrator.h @@ -109,7 +109,7 @@ private: int m_maxsteps; int m_maxErrTestFails; FuncData* m_fdata; - N_Vector* m_yS; + N_Vector* m_yS; size_t m_np; int m_mupper, m_mlower; @@ -118,7 +118,7 @@ private: bool m_sens_ok; }; -} // namespace +} // namespace #else diff --git a/include/cantera/numerics/DAE_Solver.h b/include/cantera/numerics/DAE_Solver.h index 0faffc7ee..adef4fbea 100644 --- a/include/cantera/numerics/DAE_Solver.h +++ b/include/cantera/numerics/DAE_Solver.h @@ -239,7 +239,7 @@ protected: ResidJacEval& m_resid; //! Number of total equations in the system - integer m_neq; + integer m_neq; doublereal m_time; private: diff --git a/include/cantera/numerics/DenseMatrix.h b/include/cantera/numerics/DenseMatrix.h index c9c26dd20..0f2bc667b 100644 --- a/include/cantera/numerics/DenseMatrix.h +++ b/include/cantera/numerics/DenseMatrix.h @@ -54,7 +54,7 @@ public: * LAPACK is handled by either throwing an exception of type, CELapackError, or by * returning the error code condition to the calling routine. * - * The int variable, m_useReturnErrorCode, determines which method is used. + * The int variable, m_useReturnErrorCode, determines which method is used. * The default value of zero means that an exception is thrown. A value of 1 * means that a return code is used. * @@ -102,7 +102,7 @@ public: */ void resize(size_t n, size_t m, doublereal v = 0.0); - virtual doublereal* const* colPts(); + virtual doublereal* const* colPts(); //! Return a const vector of const pointers to the columns /*! @@ -148,7 +148,7 @@ public: protected: //! Vector of pivots. Length is equal to the max of m and n. - vector_int m_ipiv; + vector_int m_ipiv; //! Vector of column pointers std::vector m_colPts; diff --git a/include/cantera/numerics/Func1.h b/include/cantera/numerics/Func1.h index 21a31048a..c5505223c 100644 --- a/include/cantera/numerics/Func1.h +++ b/include/cantera/numerics/Func1.h @@ -339,7 +339,7 @@ public: m_f2 = &m_f2->duplicate(); m_f1->setParent(this); m_f2->setParent(this); - m_parent = 0; + m_parent = 0; return *this; } @@ -402,7 +402,7 @@ public: m_f2 = &m_f2->duplicate(); m_f1->setParent(this); m_f2->setParent(this); - m_parent = 0; + m_parent = 0; return *this; } @@ -463,7 +463,7 @@ public: m_f2 = &m_f2->duplicate(); m_f1->setParent(this); m_f2->setParent(this); - m_parent = 0; + m_parent = 0; return *this; } @@ -522,7 +522,7 @@ public: Func1::operator=(right); m_f1 = &m_f1->duplicate(); m_f1->setParent(this); - m_parent = 0; + m_parent = 0; return *this; } virtual int ID() const { @@ -597,7 +597,7 @@ public: Func1::operator=(right); m_f1 = &m_f1->duplicate(); m_f1->setParent(this); - m_parent = 0; + m_parent = 0; return *this; } @@ -658,7 +658,7 @@ public: m_f2 = &m_f2->duplicate(); m_f1->setParent(this); m_f2->setParent(this); - m_parent = 0; + m_parent = 0; return *this; } @@ -724,7 +724,7 @@ public: m_f2 = &m_f2->duplicate(); m_f1->setParent(this); m_f2->setParent(this); - m_parent = 0; + m_parent = 0; return *this; } @@ -791,10 +791,10 @@ public: return *this; } Func1::operator=(right); - m_A = right.m_A; - m_t0 = right.m_t0; - m_tau = right.m_tau; - m_parent = 0; + m_A = right.m_A; + m_t0 = right.m_t0; + m_tau = right.m_tau; + m_parent = 0; return *this; } @@ -836,9 +836,9 @@ public: return *this; } Func1::operator=(right); - m_cpoly = right.m_cpoly; - m_n = right.m_n; - m_parent = 0; + m_cpoly = right.m_cpoly; + m_n = right.m_n; + m_parent = 0; return *this; } @@ -896,11 +896,11 @@ public: } Func1::operator=(right); m_omega = right.m_omega; - m_a0_2 = right.m_a0_2; - m_ccos = right.m_ccos; - m_csin = right.m_csin; - m_n = right.m_n; - m_parent = 0; + m_a0_2 = right.m_a0_2; + m_ccos = right.m_ccos; + m_csin = right.m_csin; + m_n = right.m_n; + m_parent = 0; return *this; } @@ -960,11 +960,11 @@ public: return *this; } Func1::operator=(right); - m_n = right.m_n; - m_A = right.m_A; - m_b = right.m_b; - m_E = right.m_E; - m_parent = 0; + m_n = right.m_n; + m_A = right.m_A; + m_b = right.m_b; + m_E = right.m_E; + m_parent = 0; return *this; } diff --git a/include/cantera/numerics/IDA_Solver.h b/include/cantera/numerics/IDA_Solver.h index e57efd27a..0c3126cd5 100644 --- a/include/cantera/numerics/IDA_Solver.h +++ b/include/cantera/numerics/IDA_Solver.h @@ -15,10 +15,10 @@ #include "sundials/sundials_nvector.h" // These constants are defined internally in the IDA package, ida.c -#define IDA_NN 0 -#define IDA_SS 1 -#define IDA_SV 2 -#define IDA_WF 3 +#define IDA_NN 0 +#define IDA_SS 1 +#define IDA_SV 2 +#define IDA_WF 3 #define REAL_WORKSPACE_SIZE 0 @@ -83,7 +83,7 @@ public: //! Set the stop time /*! - * @param tstop the independent variable value past which the solution is not to proceed. + * @param tstop the independent variable value past which the solution is not to proceed. */ virtual void setStopTime(doublereal tstop); diff --git a/include/cantera/numerics/Integrator.h b/include/cantera/numerics/Integrator.h index 04b877882..5335f84d9 100644 --- a/include/cantera/numerics/Integrator.h +++ b/include/cantera/numerics/Integrator.h @@ -17,20 +17,20 @@ namespace Cantera { -const int DIAG = 1; +const int DIAG = 1; const int DENSE = 2; const int NOJAC = 4; -const int JAC = 8; -const int GMRES =16; -const int BAND =32; +const int JAC = 8; +const int GMRES = 16; +const int BAND = 32; /** * Specifies the method used to integrate the system of equations. * Not all methods are supported by all integrators. */ enum MethodType { - BDF_Method, /**< Backward Differentiation */ - Adams_Method /**< Adams */ + BDF_Method, /**< Backward Differentiation */ + Adams_Method /**< Adams */ }; //! Specifies the method used for iteration. @@ -212,6 +212,6 @@ private: // defined in ODE_integrators.cpp Integrator* newIntegrator(const std::string& itype); -} // namespace +} // namespace #endif diff --git a/include/cantera/numerics/ResidJacEval.h b/include/cantera/numerics/ResidJacEval.h index cead2a4da..f4624baf8 100644 --- a/include/cantera/numerics/ResidJacEval.h +++ b/include/cantera/numerics/ResidJacEval.h @@ -44,9 +44,9 @@ enum ResidEval_Type_Enum { //! Wrappers for the function evaluators for Nonlinear solvers and Time steppers /*! - * A class for full (non-sparse dense matrices with Fortran-compatible data storage. + * A class for full (non-sparse dense matrices with Fortran-compatible data storage. * The class adds support for identifying what types of calls are made to the residual - * evaluator by adding the ResidEval_Type_Enum class. + * evaluator by adding the ResidEval_Type_Enum class. */ class ResidJacEval : public ResidEval { @@ -106,7 +106,7 @@ public: const doublereal* const ydot, doublereal* const r); - virtual int getInitialConditions(const doublereal t0, doublereal* const y, doublereal* const ydot); + virtual int getInitialConditions(const doublereal t0, doublereal* const y, doublereal* const ydot); //! Filter the solution predictions /*! @@ -152,8 +152,8 @@ public: * 1 Means a successful operation * -0 or neg value Means an unsuccessful operation */ - virtual int evalTimeTrackingEqns(const doublereal t, const doublereal delta_t, const doublereal* const y, - const doublereal* const ydot); + virtual int evalTimeTrackingEqns(const doublereal t, const doublereal delta_t, const doublereal* const y, + const doublereal* const ydot); //! Evaluate any stopping criteria other than a final time limit /*! @@ -256,8 +256,8 @@ public: * 1 Means a successful operation * -0 or neg value Means an unsuccessful operation */ - virtual int matrixConditioning(doublereal* const matrix, const int nrows, - doublereal* const rhs); + virtual int matrixConditioning(doublereal* const matrix, const int nrows, + doublereal* const rhs); //! Calculate an analytical Jacobian and the residual at the current time and values. /*! @@ -287,7 +287,7 @@ public: * @param cj Coefficient of yprime used in the evaluation of the Jacobian * @param y Solution vector (input, do not modify) * @param ydot Rate of change of solution vector. (input, do not modify) - * @param jacobianColPts Pointer to the vector of pts to columns of the SquareMatrix + * @param jacobianColPts Pointer to the vector of pts to columns of the SquareMatrix * object to be calculated (output) * @param resid Value of the residual that is computed (output) * @return Returns a flag to indicate that operation is successful. diff --git a/include/cantera/numerics/RootFind.h b/include/cantera/numerics/RootFind.h index e764fb8ff..9da61e89b 100644 --- a/include/cantera/numerics/RootFind.h +++ b/include/cantera/numerics/RootFind.h @@ -26,7 +26,7 @@ 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 +#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. /*! @@ -36,13 +36,13 @@ namespace Cantera */ #define ROOTFIND_SUCCESS_XCONVERGENCEONLY 1 //! This means that the root solver failed to achieve convergence -#define ROOTFIND_FAILEDCONVERGENCE -1 +#define ROOTFIND_FAILEDCONVERGENCE -1 //! This means that the input to the root solver was defective -#define ROOTFIND_BADINPUT -2 +#define ROOTFIND_BADINPUT -2 //! This means that the rootfinder believes the solution is lower than xmin -#define ROOTFIND_SOLNLOWERTHANXMIN -3 +#define ROOTFIND_SOLNLOWERTHANXMIN -3 //! This means that the rootfinder believes the solution is higher than xmax -#define ROOTFIND_SOLNHIGHERTHANXMAX -4 +#define ROOTFIND_SOLNHIGHERTHANXMAX -4 //@} //! Root finder for 1D problems diff --git a/include/cantera/numerics/SquareMatrix.h b/include/cantera/numerics/SquareMatrix.h index a9e68e68e..d816115eb 100644 --- a/include/cantera/numerics/SquareMatrix.h +++ b/include/cantera/numerics/SquareMatrix.h @@ -108,7 +108,7 @@ public: virtual GeneralMatrix* duplMyselfAsGeneralMatrix() const; - virtual vector_fp::iterator begin(); + virtual vector_fp::iterator begin(); virtual vector_fp::const_iterator begin() const; virtual doublereal* const* colPts(); diff --git a/include/cantera/numerics/ctlapack.h b/include/cantera/numerics/ctlapack.h index 62429a6ff..520e70783 100644 --- a/include/cantera/numerics/ctlapack.h +++ b/include/cantera/numerics/ctlapack.h @@ -130,22 +130,22 @@ extern "C" { int _DSCAL_(integer* n, doublereal* da, doublereal* dx, integer* incx); int _DGEQRF_(const integer* m, const integer* n, doublereal* a, const integer* lda, - doublereal* tau, doublereal* work, const integer* lwork, integer* info); + doublereal* tau, doublereal* work, const integer* lwork, integer* info); #ifdef LAPACK_FTN_STRING_LEN_AT_END - int _DORMQR_(const char* side, const char* trans, const integer* m, const integer* n, + int _DORMQR_(const char* side, const char* trans, const integer* m, const integer* n, const integer* k, doublereal* a, const integer* lda, doublereal* tau, doublereal* c, const integer* ldc, - doublereal* work, const integer* lwork, integer* info, ftnlen sisize, ftnlen trsize); + doublereal* work, const integer* lwork, integer* info, ftnlen sisize, ftnlen trsize); #else int _DORMQR_(const char* side, ftnlen sisize, const char* trans, ftnlen trsize, const integer* m, const integer* n, const integer* k, doublereal* a, const integer* lda, doublereal* tau,doublereal* c, const integer* ldc, - doublereal* work, const integer* lwork, integer* info); + doublereal* work, const integer* lwork, integer* info); #endif #ifdef LAPACK_FTN_STRING_LEN_AT_END - int _DTRTRS_(const char* uplo, const char* trans, const char* diag, const integer* n, + int _DTRTRS_(const char* uplo, const char* trans, const char* diag, const integer* n, const integer* nrhs, doublereal* a, const integer* lda, doublereal* b, const integer* ldb, integer* info, ftnlen upsize, ftnlen trsize, ftnlen disize); @@ -157,7 +157,7 @@ extern "C" { #ifdef LAPACK_FTN_STRING_LEN_AT_END - int _DTRCON_(const char* norm, const char* uplo, const char* diag, const integer* n, + int _DTRCON_(const char* norm, const char* uplo, const char* diag, const integer* n, doublereal* a, const integer* lda, const doublereal* rcond, doublereal* work, const integer* iwork, integer* info, ftnlen nosize, ftnlen upsize, ftnlen disize); @@ -169,23 +169,23 @@ extern "C" { #ifdef LAPACK_FTN_STRING_LEN_AT_END - int _DPOTRF_(const char* uplo, const integer* n, doublereal* a, const integer* lda, integer* info, + int _DPOTRF_(const char* uplo, const integer* n, doublereal* a, const integer* lda, integer* info, ftnlen upsize); #else - int _DPOTRF_(const char* uplo, ftnlen upsize, const integer* n, doublereal* a, const integer* lda, + int _DPOTRF_(const char* uplo, ftnlen upsize, const integer* n, doublereal* a, const integer* lda, integer* info); #endif #ifdef LAPACK_FTN_STRING_LEN_AT_END - int _DPOTRS_(const char* uplo, const integer* n, const integer* nrhs, doublereal* a, const integer* lda, + int _DPOTRS_(const char* uplo, const integer* n, const integer* nrhs, doublereal* a, const integer* lda, doublereal* b, const integer* ldb, integer* info, ftnlen upsize); #else - int _DPOTRS_(const char* uplo, ftnlen upsize, const integer* n, const integer* nrhs, doublereal* a, const integer* lda, + int _DPOTRS_(const char* uplo, ftnlen upsize, const integer* n, const integer* nrhs, doublereal* a, const integer* lda, doublereal* b, const integer* ldb, integer* info); #endif #ifdef LAPACK_FTN_STRING_LEN_AT_END - int _DGECON_(const char* norm, const integer* n, doublereal* a, const integer* lda, + int _DGECON_(const char* norm, const integer* n, doublereal* a, const integer* lda, const doublereal* rnorm, const doublereal* rcond, doublereal* work, const integer* iwork, integer* info, ftnlen nosize); #else @@ -199,7 +199,7 @@ extern "C" { const integer* ipiv, const doublereal* anorm, const doublereal* rcond, doublereal* work, const integer* iwork, integer* info, ftnlen nosize); #else - int _DGBCON_(const char* norm, ftnlen nosize, const integer* n, integer* kl, integer* ku, doublereal* ab, const integer* ldab, + int _DGBCON_(const char* norm, ftnlen nosize, const integer* n, integer* kl, integer* ku, doublereal* ab, const integer* ldab, const integer* ipiv, const doublereal* anorm, const doublereal* rcond, doublereal* work, const integer* iwork, integer* info); #endif @@ -387,13 +387,13 @@ inline void ct_dormqr(ctlapack::side_t rlside, ctlapack::transpose_t trans, size integer f_ldc = static_cast(ldc); integer f_info = 0; #ifdef NO_FTN_STRING_LEN_AT_END - _DORMQR_(&side, &tr, &f_m, &f_n, &f_k, a, &f_lda, tau, c, &f_ldc, work, &f_lwork, &f_info); + _DORMQR_(&side, &tr, &f_m, &f_n, &f_k, a, &f_lda, tau, c, &f_ldc, work, &f_lwork, &f_info); #else ftnlen trsize = 1; #ifdef LAPACK_FTN_STRING_LEN_AT_END - _DORMQR_(&side, &tr, &f_m, &f_n, &f_k, a, &f_lda, tau, c, &f_ldc, work, &f_lwork, &f_info, trsize, trsize); + _DORMQR_(&side, &tr, &f_m, &f_n, &f_k, a, &f_lda, tau, c, &f_ldc, work, &f_lwork, &f_info, trsize, trsize); #else - _DORMQR_(&side, trsize, &tr, trsize, &f_m, &f_n, &f_k, a, &f_lda, tau, c, &f_ldc, work, &f_lwork, &f_info); + _DORMQR_(&side, trsize, &tr, trsize, &f_m, &f_n, &f_k, a, &f_lda, tau, c, &f_ldc, work, &f_lwork, &f_info); #endif #endif info = f_info; @@ -430,7 +430,7 @@ inline void ct_dtrtrs(ctlapack::upperlower_t uplot, ctlapack::transpose_t trans, * @param work Must be dimensioned equal to greater than 3N * @param iwork Must be dimensioned equal to or greater than N */ -inline doublereal ct_dtrcon(const char* norm, ctlapack::upperlower_t uplot, const char* diag, +inline doublereal ct_dtrcon(const char* norm, ctlapack::upperlower_t uplot, const char* diag, size_t n, doublereal* a, size_t lda, doublereal* work, int* iwork, int& info) { char uplo = upper_lower[uplot]; @@ -518,13 +518,13 @@ inline doublereal ct_dgecon(const char norm, size_t n, doublereal* a, size_t lda doublereal rcond; #ifdef NO_FTN_STRING_LEN_AT_END - _DGECON_(&cnorm, &f_n a, &f_lda, &anorm, &rcond, work, iwork, &f_info); + _DGECON_(&cnorm, &f_n a, &f_lda, &anorm, &rcond, work, iwork, &f_info); #else ftnlen trsize = 1; #ifdef LAPACK_FTN_STRING_LEN_AT_END - _DGECON_(&cnorm, &f_n, a, &f_lda, &anorm, &rcond, work, iwork, &f_info, trsize); + _DGECON_(&cnorm, &f_n, a, &f_lda, &anorm, &rcond, work, iwork, &f_info, trsize); #else - _DGECON_(&cnorm, trsize, &f_n, a, &f_lda, &anorm, &rcond, work, iwork, &f_info); + _DGECON_(&cnorm, trsize, &f_n, a, &f_lda, &anorm, &rcond, work, iwork, &f_info); #endif #endif info = f_info; @@ -573,13 +573,13 @@ inline doublereal ct_dlange(const char norm, size_t m, size_t n, doublereal* a, doublereal anorm; #ifdef NO_FTN_STRING_LEN_AT_END - anorm = _DLANGE_(&cnorm, &f_m, &f_n a, &f_lda, work); + anorm = _DLANGE_(&cnorm, &f_m, &f_n a, &f_lda, work); #else ftnlen trsize = 1; #ifdef LAPACK_FTN_STRING_LEN_AT_END - anorm = _DLANGE_(&cnorm, &f_m, &f_n, a, &f_lda, work, trsize); + anorm = _DLANGE_(&cnorm, &f_m, &f_n, a, &f_lda, work, trsize); #else - anorm = _DLANGE_(&cnorm, trsize, &f_m, &f_n, a, &f_lda, work); + anorm = _DLANGE_(&cnorm, trsize, &f_m, &f_n, a, &f_lda, work); #endif #endif return anorm; diff --git a/include/cantera/numerics/polyfit.h b/include/cantera/numerics/polyfit.h index 29885d44c..6d56682dc 100644 --- a/include/cantera/numerics/polyfit.h +++ b/include/cantera/numerics/polyfit.h @@ -18,12 +18,12 @@ namespace Cantera /*! * Given a collection of points X(I) and a set of values Y(I) which * correspond to some function or measurement at each of the X(I), - * subroutine DPOLFT computes the weighted least-squares polynomial + * subroutine DPOLFT computes the weighted least-squares polynomial * fits of all degrees up to some degree either specified by the user * or determined by the routine. The fits thus obtained are in - * orthogonal polynomial form. Subroutine DP1VLU may then be + * orthogonal polynomial form. Subroutine DP1VLU may then be * called to evaluate the fitted polynomials and any of their - * derivatives at any point. The subroutine DPCOEF may be used to + * derivatives at any point. The subroutine DPCOEF may be used to * express the polynomial fits as powers of (X-C) for any specified * point C. * @@ -34,34 +34,34 @@ namespace Cantera * distinct. There are n of them. * @param y array of corresponding function values. There are n of them * @param w array of positive values to be used as weights. If - * W[0] is negative, DPOLFT will set all the weights + * W[0] is negative, DPOLFT will set all the weights * to 1.0, which means unweighted least squares error * will be minimized. To minimize relative error, the * user should set the weights to: W(I) = 1.0/Y(I)**2, * I = 1,...,N . * @param maxdeg maximum degree to be allowed for polynomial fit. - * MAXDEG may be any non-negative integer less than N. - * Note -- MAXDEG cannot be equal to N-1 when a + * MAXDEG may be any non-negative integer less than N. + * Note -- MAXDEG cannot be equal to N-1 when a * statistical test is to be used for degree selection, - * i.e., when input value of EPS is negative. + * i.e., when input value of EPS is negative. * @param ndeg output degree of the fit computed. * @param eps Specifies the criterion to be used in determining * the degree of fit to be computed. - * (1) If EPS is input negative, DPOLFT chooses the + * (1) If EPS is input negative, DPOLFT chooses the * degree based on a statistical F test of * significance. One of three possible * significance levels will be used: .01, .05 or - * .10. If EPS=-1.0 , the routine will + * .10. If EPS=-1.0 , the routine will * automatically select one of these levels based * on the number of data points and the maximum - * degree to be considered. If EPS is input as + * degree to be considered. If EPS is input as * -.01, -.05, or -.10, a significance level of * .01, .05, or .10, respectively, will be used. - * (2) If EPS is set to 0., DPOLFT computes the - * polynomials of degrees 0 through MAXDEG . - * (3) If EPS is input positive, EPS is the RMS + * (2) If EPS is set to 0., DPOLFT computes the + * polynomials of degrees 0 through MAXDEG . + * (3) If EPS is input positive, EPS is the RMS * error tolerance which must be satisfied by the - * fitted polynomial. DPOLFT will increase the + * fitted polynomial. DPOLFT will increase the * degree of fit until this criterion is met or * until the maximum degree is reached. * @param r Output vector containing the first ndeg+1 Taylor coefficients diff --git a/include/cantera/oneD/Domain1D.h b/include/cantera/oneD/Domain1D.h index 161a0a677..d57d2c1ab 100644 --- a/include/cantera/oneD/Domain1D.h +++ b/include/cantera/oneD/Domain1D.h @@ -16,15 +16,15 @@ namespace Cantera { // domain types -const int cFlowType = 50; -const int cConnectorType = 100; -const int cSurfType = 102; -const int cInletType = 104; -const int cSymmType = 105; -const int cOutletType = 106; -const int cEmptyType = 107; -const int cOutletResType = 108; -const int cPorousType = 109; +const int cFlowType = 50; +const int cConnectorType = 100; +const int cSurfType = 102; +const int cInletType = 104; +const int cSymmType = 105; +const int cOutletType = 106; +const int cEmptyType = 107; +const int cOutletResType = 108; +const int cPorousType = 109; class MultiJac; class OneDim; diff --git a/include/cantera/oneD/MultiJac.h b/include/cantera/oneD/MultiJac.h index 78baf0777..79c2af23e 100644 --- a/include/cantera/oneD/MultiJac.h +++ b/include/cantera/oneD/MultiJac.h @@ -77,7 +77,7 @@ protected: */ OneDim* m_resid; - vector_fp m_r1; + vector_fp m_r1; doublereal m_rtol, m_atol; doublereal m_elapsed; vector_fp m_ssdiag; diff --git a/include/cantera/oneD/OneDim.h b/include/cantera/oneD/OneDim.h index 1103a523b..c50ded55e 100644 --- a/include/cantera/oneD/OneDim.h +++ b/include/cantera/oneD/OneDim.h @@ -253,21 +253,21 @@ public: protected: void evalSSJacobian(doublereal* x, doublereal* xnew); - doublereal m_tmin; // minimum timestep size - doublereal m_tmax; // maximum timestep size - doublereal m_tfactor; // factor time step is multiplied by + doublereal m_tmin; // minimum timestep size + doublereal m_tmax; // maximum timestep size + doublereal m_tfactor; // factor time step is multiplied by // if time stepping fails ( < 1 ) - MultiJac* m_jac; // Jacobian evaluator - MultiNewton* m_newt; // Newton iterator - doublereal m_rdt; // reciprocal of time step - bool m_jac_ok; // if true, Jacobian is current + MultiJac* m_jac; // Jacobian evaluator + MultiNewton* m_newt; // Newton iterator + doublereal m_rdt; // reciprocal of time step + bool m_jac_ok; // if true, Jacobian is current //! number of domains size_t m_nd; - size_t m_bw; // Jacobian bandwidth - size_t m_size; // solution vector size + size_t m_bw; // Jacobian bandwidth + size_t m_size; // solution vector size std::vector m_dom, m_connect, m_bulk; diff --git a/include/cantera/oneD/Sim1D.h b/include/cantera/oneD/Sim1D.h index f954e3e20..793853d15 100644 --- a/include/cantera/oneD/Sim1D.h +++ b/include/cantera/oneD/Sim1D.h @@ -54,7 +54,7 @@ public: * the leftmost grid point in the domain. * @param value the value. */ - void setValue(size_t dom, size_t comp, size_t localPoint, doublereal value); + void setValue(size_t dom, size_t comp, size_t localPoint, doublereal value); /** * Get one entry in the solution vector. diff --git a/include/cantera/oneD/StFlow.h b/include/cantera/oneD/StFlow.h index 37b479202..65f6cdaa9 100644 --- a/include/cantera/oneD/StFlow.h +++ b/include/cantera/oneD/StFlow.h @@ -18,11 +18,11 @@ namespace Cantera //------------------------------------------ // Offsets of solution components in the solution array. -const size_t c_offset_U = 0; // axial velocity -const size_t c_offset_V = 1; // strain rate -const size_t c_offset_T = 2; // temperature -const size_t c_offset_L = 3; // (1/r)dP/dr -const size_t c_offset_Y = 4; // mass fractions +const size_t c_offset_U = 0; // axial velocity +const size_t c_offset_V = 1; // strain rate +const size_t c_offset_T = 2; // temperature +const size_t c_offset_L = 3; // (1/r)dP/dr +const size_t c_offset_Y = 4; // mass fractions // Transport option flags const int c_Mixav_Transport = 0; @@ -318,7 +318,7 @@ protected: setGas(x,j); m_rho[j] = m_thermo->density(); m_wtm[j] = m_thermo->meanMolecularWeight(); - m_cp[j] = m_thermo->cp_mass(); + m_cp[j] = m_thermo->cp_mass(); } } @@ -428,7 +428,7 @@ protected: // member data //--------------------------------------------------------- - doublereal m_press; // pressure + doublereal m_press; // pressure // grid parameters vector_fp m_dz; diff --git a/include/cantera/thermo/ConstCpPoly.h b/include/cantera/thermo/ConstCpPoly.h index dd17a9756..0d0ac5e2c 100644 --- a/include/cantera/thermo/ConstCpPoly.h +++ b/include/cantera/thermo/ConstCpPoly.h @@ -70,7 +70,7 @@ public: //! Update the properties for this species, given a temperature polynomial /*! * This method is called with a pointer to an array containing the functions of - * temperature needed by this parameterization, and three pointers to arrays where the + * temperature needed by this parameterization, and three pointers to arrays where the * computed property values should be written. This method updates only one value in * each array. * diff --git a/include/cantera/thermo/ConstDensityThermo.h b/include/cantera/thermo/ConstDensityThermo.h index c11604b00..37c86aec6 100644 --- a/include/cantera/thermo/ConstDensityThermo.h +++ b/include/cantera/thermo/ConstDensityThermo.h @@ -148,7 +148,7 @@ public: //! state of the species at the current T and P of the solution /*! * Units are Joules/kmol - * @param gpure Output vector of standard state Gibbs free energies + * @param gpure Output vector of standard state Gibbs free energies * Length: m_kk. */ virtual void getPureGibbs(doublereal* gpure) const { @@ -159,7 +159,7 @@ public: //! Get the nondimensional Enthalpy functions for the species //! at their standard states at the current T and P of the solution. /*! - * @param hrt Output vector of nondimensional standard state enthalpies. + * @param hrt Output vector of nondimensional standard state enthalpies. * Length: m_kk. */ void getEnthalpy_RT(doublereal* hrt) const { @@ -170,7 +170,7 @@ public: //! Get the array of nondimensional Entropy functions for the //! standard state species at the current T and P of the solution. /*! - * @param sr Output vector of nondimensional standard state entropies. + * @param sr Output vector of nondimensional standard state entropies. * Length: m_kk. */ void getEntropy_R(doublereal* sr) const { @@ -307,19 +307,19 @@ public: protected: //! Temporary storage for dimensionless reference state enthalpies - mutable vector_fp m_h0_RT; + mutable vector_fp m_h0_RT; //! Temporary storage for dimensionless reference state heat capacities - mutable vector_fp m_cp0_R; + mutable vector_fp m_cp0_R; //! Temporary storage for dimensionless reference state Gibbs energies - mutable vector_fp m_g0_RT; + mutable vector_fp m_g0_RT; //! Temporary storage for dimensionless reference state entropies - mutable vector_fp m_s0_R; + mutable vector_fp m_s0_R; //! Temporary array containing internally calculated partial pressures - mutable vector_fp m_pp; + mutable vector_fp m_pp; //! Current pressure (Pa) doublereal m_press; diff --git a/include/cantera/thermo/DebyeHuckel.h b/include/cantera/thermo/DebyeHuckel.h index 9c70412e6..c57c23b55 100644 --- a/include/cantera/thermo/DebyeHuckel.h +++ b/include/cantera/thermo/DebyeHuckel.h @@ -28,18 +28,18 @@ namespace Cantera * These are possible formats for the molality-based activity coefficients. */ //@{ -#define DHFORM_DILUTE_LIMIT 0 -#define DHFORM_BDOT_AK 1 -#define DHFORM_BDOT_ACOMMON 2 -#define DHFORM_BETAIJ 3 +#define DHFORM_DILUTE_LIMIT 0 +#define DHFORM_BDOT_AK 1 +#define DHFORM_BDOT_ACOMMON 2 +#define DHFORM_BETAIJ 3 #define DHFORM_PITZER_BETAIJ 4 //@} /* * @name Acceptable ways to calculate the value of A_Debye */ //@{ -#define A_DEBYE_CONST 0 -#define A_DEBYE_WATER 1 +#define A_DEBYE_CONST 0 +#define A_DEBYE_WATER 1 //@} class WaterProps; @@ -108,7 +108,7 @@ class PDSS_Water; * all solutes. The molar volume for the water solvent, however, * is obtained from a pure water equation of state, waterSS. * Therefore, the water standard state varies with both T and P. - * It is an error to request standard state water properties at a T and P + * It is an error to request standard state water properties at a T and P * where the water phase is not a stable phase, i.e., beyond its * spinodal curve. * @@ -117,7 +117,7 @@ class PDSS_Water; *
* * Chemical potentials - * of the solutes, \f$ \mu_k \f$, and the solvent, \f$ \mu_o \f$, which are based + * of the solutes, \f$ \mu_k \f$, and the solvent, \f$ \mu_o \f$, which are based * on the molality form, have the following general format: * * \f[ @@ -785,7 +785,7 @@ public: /** * @} - * @name Activities, Standard States, and Activity Concentrations + * @name Activities, Standard States, and Activity Concentrations * * The activity \f$a_k\f$ of a species in solution is * related to the chemical potential by \f[ \mu_k = \mu_k^0(T) @@ -924,7 +924,7 @@ public: * \f] * * The reference-state pure-species entropies,\f$ \hat s^0_k(T) \f$, - * at the reference pressure, \f$ P_{ref} \f$, are computed by the + * at the reference pressure, \f$ P_{ref} \f$, are computed by the * species thermodynamic * property manager. They are polynomial functions of temperature. * @see SpeciesThermo @@ -1025,9 +1025,9 @@ public: * to see if phaseNode is pointing to the phase * with the correct id. */ - virtual void initThermoXML(XML_Node& phaseNode, const std::string& id); + virtual void initThermoXML(XML_Node& phaseNode, const std::string& id); - //! Return the Debye Huckel constant as a function of temperature + //! Return the Debye Huckel constant as a function of temperature //! and pressure (Units = sqrt(kg/gmol)) /*! * The default is to assume that it is constant, given @@ -1163,7 +1163,7 @@ private: //@} protected: - //! form of the Debye-Huckel parameterization used in the model. + //! form of the Debye-Huckel parameterization used in the model. /*! * The options are described at the top of this document, * and in the general documentation. @@ -1219,7 +1219,7 @@ protected: * - nonpolarNeutral * . */ - vector_int m_electrolyteSpeciesType; + vector_int m_electrolyteSpeciesType; /** * a_k = Size of the ionic species in the DH formulation @@ -1316,7 +1316,7 @@ protected: * in some formulations to extend DH to higher molalities. B_dot is * specific to the major ionic pair. */ - vector_fp m_B_Dot; + vector_fp m_B_Dot; /** * These are coefficients to describe the increase in activity coeff for @@ -1326,7 +1326,7 @@ protected: vector_fp m_npActCoeff; - //! Pointer to the Water standard state object + //! Pointer to the Water standard state object /*! * derived from the equation of state for water. */ @@ -1342,10 +1342,10 @@ protected: WaterProps* m_waterProps; //! Temporary array used in equilibrium calculations - mutable vector_fp m_pp; + mutable vector_fp m_pp; //! vector of size m_kk, used as a temporary holding area. - mutable vector_fp m_tmpV; + mutable vector_fp m_tmpV; /** * Stoichiometric species charge -> This is for calculations @@ -1359,7 +1359,7 @@ protected: * For species that aren't ion pairs, it's equal to the * m_speciesCharge[] value. */ - vector_fp m_speciesCharge_Stoich; + vector_fp m_speciesCharge_Stoich; /** * Array of 2D data used in the DHFORM_BETAIJ formulation diff --git a/include/cantera/thermo/Elements.h b/include/cantera/thermo/Elements.h index 1e38797f3..7682c0ac5 100644 --- a/include/cantera/thermo/Elements.h +++ b/include/cantera/thermo/Elements.h @@ -23,7 +23,7 @@ namespace Cantera */ //! An element constraint that is current turned off -#define CT_ELEM_TYPE_TURNEDOFF -1 +#define CT_ELEM_TYPE_TURNEDOFF -1 //! Normal element constraint consisting of positive coefficients for the //! formula matrix. @@ -32,13 +32,13 @@ namespace Cantera * With this constraint, we may employ various strategies to handle * small values of the element number successfully. */ -#define CT_ELEM_TYPE_ABSPOS 0 +#define CT_ELEM_TYPE_ABSPOS 0 //! This refers to conservation of electrons /*! * Electrons may have positive or negative values in the Formula matrix. */ -#define CT_ELEM_TYPE_ELECTRONCHARGE 1 +#define CT_ELEM_TYPE_ELECTRONCHARGE 1 //! This refers to a charge neutrality of a single phase /*! @@ -76,7 +76,7 @@ namespace Cantera /*! * currently there are none */ -#define CT_ELEM_TYPE_OTHERCONSTRAINT 6 +#define CT_ELEM_TYPE_OTHERCONSTRAINT 6 //@} //! Number indicating we don't know the entropy of the element in its most @@ -95,6 +95,6 @@ namespace Cantera //! @exception CanteraError If a match is not found, throws a CanteraError double LookupWtElements(const std::string& ename); -} // namespace +} // namespace #endif diff --git a/include/cantera/thermo/FixedChemPotSSTP.h b/include/cantera/thermo/FixedChemPotSSTP.h index 546ae3c00..6034a4ce8 100644 --- a/include/cantera/thermo/FixedChemPotSSTP.h +++ b/include/cantera/thermo/FixedChemPotSSTP.h @@ -61,7 +61,7 @@ namespace Cantera * R_s = k_s C_{gas} * \f] * where the units for \f$ R_s \f$ are kmol m-2 s-1. \f$ C_{gas} \f$ has units - * of kmol m-3. Therefore, the kinetic rate constant, \f$ k_s \f$, has + * of kmol m-3. Therefore, the kinetic rate constant, \f$ k_s \f$, has * units of m s-1. Nowhere does the concentration of the bulk phase * appear in the rate constant expression, since it's a stoichiometric * phase, and the activity is always equal to 1.0. @@ -176,7 +176,7 @@ public: /*! * @param right Object to be copied */ - FixedChemPotSSTP(const FixedChemPotSSTP& right); + FixedChemPotSSTP(const FixedChemPotSSTP& right); //! Special constructor for the FixecChemPotSSTP class setting an element chemical //! potential directly @@ -252,7 +252,7 @@ public: * \beta = \frac{1}{v}\left(\frac{\partial v}{\partial T}\right)_P * \f] */ - virtual doublereal thermalExpansionCoeff() const ; + virtual doublereal thermalExpansionCoeff() const; /** * @} @@ -343,7 +343,7 @@ public: //! Get the nondimensional Enthalpy functions for the species //! at their standard states at the current T and P of the solution. /*! - * @param hrt Output vector of nondimensional standard state enthalpies. + * @param hrt Output vector of nondimensional standard state enthalpies. * Length: m_kk. */ virtual void getEnthalpy_RT(doublereal* hrt) const; @@ -351,7 +351,7 @@ public: //! Get the array of nondimensional Entropy functions for the //! standard state species at the current T and P of the solution. /*! - * @param sr Output vector of nondimensional standard state entropies. + * @param sr Output vector of nondimensional standard state entropies. * Length: m_kk. */ virtual void getEntropy_R(doublereal* sr) const; @@ -373,7 +373,7 @@ public: */ virtual void getCp_R(doublereal* cpr) const; - //! Returns the vector of nondimensional Internal Energies of the standard + //! Returns the vector of nondimensional Internal Energies of the standard //! state species at the current T and P of the solution /*! * For an incompressible, @@ -448,10 +448,10 @@ public: * This function is resolved in this class. It is assumed that the m_spthermo species thermo * pointer is populated and yields the reference state. * - * @param g Output vector containing the reference state + * @param g Output vector containing the reference state * Gibbs Free energies. Length: m_kk. Units: J/kmol. */ - virtual void getGibbs_ref(doublereal* g) const; + virtual void getGibbs_ref(doublereal* g) const; /*! * Returns the vector of nondimensional diff --git a/include/cantera/thermo/GeneralSpeciesThermo.h b/include/cantera/thermo/GeneralSpeciesThermo.h index 28948f456..aefec16e0 100644 --- a/include/cantera/thermo/GeneralSpeciesThermo.h +++ b/include/cantera/thermo/GeneralSpeciesThermo.h @@ -43,7 +43,7 @@ public: */ GeneralSpeciesThermo& operator=(const GeneralSpeciesThermo& b); - virtual SpeciesThermo* duplMyselfAsSpeciesThermo() const ; + virtual SpeciesThermo* duplMyselfAsSpeciesThermo() const; virtual void install_STIT(size_t index, shared_ptr stit_ptr); diff --git a/include/cantera/thermo/GibbsExcessVPSSTP.h b/include/cantera/thermo/GibbsExcessVPSSTP.h index 7e90bbdda..78a73a4a6 100644 --- a/include/cantera/thermo/GibbsExcessVPSSTP.h +++ b/include/cantera/thermo/GibbsExcessVPSSTP.h @@ -122,7 +122,7 @@ public: */ GibbsExcessVPSSTP& operator=(const GibbsExcessVPSSTP& b); - //! Duplication routine for objects which inherit from ThermoPhase. + //! 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 @@ -285,7 +285,7 @@ public: * @param dlnActCoeffdlnN Output vector of derivatives of the * log Activity Coefficients. length = m_kk * m_kk */ - virtual void getdlnActCoeffdlnN(const size_t ld, doublereal* const dlnActCoeffdlnN) { + virtual void getdlnActCoeffdlnN(const size_t ld, doublereal* const dlnActCoeffdlnN) { throw NotImplementedError("GibbsExcessVPSSTP::getdlnActCoeffdlnN: " "nonzero and nonimplemented"); } @@ -479,7 +479,7 @@ protected: //! log of the activity coefficients of the species mutable std::vector dlnActCoeffdlnX_diag_; - //! Storage for the current derivative values of the gradients with respect to logarithm of the species mole number of the + //! Storage for the current derivative values of the gradients with respect to logarithm of the species mole number of the //! log of the activity coefficients of the species /*! * dlnActCoeffdlnN_(k, m) is the derivative of ln(gamma_k) wrt ln mole number of species m diff --git a/include/cantera/thermo/HMWSoln.h b/include/cantera/thermo/HMWSoln.h index 6a00afcd6..cbc93e606 100644 --- a/include/cantera/thermo/HMWSoln.h +++ b/include/cantera/thermo/HMWSoln.h @@ -63,9 +63,9 @@ namespace Cantera * q1(T - Tr) + q2(T**2 - Tr**2) */ //@{ -#define PITZER_TEMP_CONSTANT 0 -#define PITZER_TEMP_LINEAR 1 -#define PITZER_TEMP_COMPLEX1 2 +#define PITZER_TEMP_CONSTANT 0 +#define PITZER_TEMP_LINEAR 1 +#define PITZER_TEMP_COMPLEX1 2 //@} /* @@ -74,8 +74,8 @@ namespace Cantera * These defines determine the way A_Debye is calculated */ //@{ -#define A_DEBYE_CONST 0 -#define A_DEBYE_WATER 1 +#define A_DEBYE_CONST 0 +#define A_DEBYE_WATER 1 //@} class WaterProps; @@ -154,7 +154,7 @@ class WaterProps; * all solutes. The molar volume for the water solvent, however, * is obtained from a pure water equation of state, waterSS. * Therefore, the water standard state varies with both T and P. - * It is an error to request standard state water properties at a T and P + * It is an error to request standard state water properties at a T and P * where the water phase is not a stable phase, i.e., beyond its * spinodal curve. * @@ -163,7 +163,7 @@ class WaterProps; *
* * Chemical potentials - * of the solutes, \f$ \mu_k \f$, and the solvent, \f$ \mu_o \f$, which are based + * of the solutes, \f$ \mu_k \f$, and the solvent, \f$ \mu_o \f$, which are based * on the molality form, have the following general format: * * \f[ @@ -339,7 +339,7 @@ class WaterProps; * theory depends on the total ionic strength of the solution, and therefore, * \f$ \Phi_{c{c'}} \f$ and \f$ \Phi_{a{a'}} \f$ will depend on I, the * ionic strength. \f$ B_{ca}\f$ is a strong function of the - * total ionic strength, I, + * total ionic strength, I, * of the electrolyte. The rest of the coefficients are assumed to be independent of the * molalities or ionic strengths. However, all coefficients are potentially functions * of the temperature and pressure of the solution. @@ -399,7 +399,7 @@ class WaterProps; * solfates and other high-valence electrolytes which exhibit significant * association at low ionic strengths. * - * The \f$ \beta^{(0)}_{ca} \f$, \f$ \beta^{(1)}_{ca}\f$, \f$ \beta^{(2)}_{ca} \f$, + * The \f$ \beta^{(0)}_{ca} \f$, \f$ \beta^{(1)}_{ca}\f$, \f$ \beta^{(2)}_{ca} \f$, * and \f$ C_{ca} \f$ binary coefficients are referred to as ion-interaction or * Pitzer parameters. These Pitzer parameters may vary with temperature and pressure * but they do not depend on the ionic strength. Their values and temperature @@ -603,7 +603,7 @@ class WaterProps; * Therefore, * a formalism wherein all of the coefficients in the base theory have * temperature dependencies associated with them has been implemented - * within the HMWSoln object. Much of the formalism, however, + * within the HMWSoln object. Much of the formalism, however, * has been unexercised. * * In the HMWSoln object, the temperature dependence of the Pitzer @@ -633,7 +633,7 @@ class WaterProps; * \f$ C_{MX}\f$ * The specification of \f$ B_{MX}\f$ is a function of * \f$\beta^{(0)}_{MX} \f$, \f$\beta^{(1)}_{MX} \f$, - * \f$\beta^{(2)}_{MX} \f$, \f$\alpha^{(1)}_{MX} \f$, and + * \f$\beta^{(2)}_{MX} \f$, \f$\alpha^{(1)}_{MX} \f$, and * \f$\alpha^{(2)}_{MX} \f$. * \f$ C_{MX}\f$ is calculated from \f$C^{\phi}_{MX} \f$ * from the formula above. @@ -668,7 +668,7 @@ class WaterProps; * This same COMPLEX1 temperature * dependence given above is used for the following parameters: * \f$ \beta^{(0)}_{MX} \f$, \f$ \beta^{(1)}_{MX} \f$, - * \f$ \beta^{(2)}_{MX} \f$, \f$ \Theta_{cc'} \f$, \f$\Theta_{aa'} \f$, + * \f$ \beta^{(2)}_{MX} \f$, \f$ \Theta_{cc'} \f$, \f$\Theta_{aa'} \f$, * \f$ \Psi_{c{c'}a} \f$ and \f$ \Psi_{ca{a'}} \f$. * *

Like-Charged Binary Ion Parameters and the Mixing Parameters

@@ -723,7 +723,7 @@ class WaterProps; * * The \f$ \Theta_{ij} \f$ term is a constant that is specified * by the XML element thetaCation and - * thetaAnion , which + * thetaAnion , which * has the attribute cation1 , cation2 and * anion1 , anion2 respectively * to identify the interaction. No temperature or @@ -1084,7 +1084,7 @@ class WaterProps; * ThermoPhase *HMW = newPhase("HMW_NaCl.xml", "NaCl_electrolyte"); * @endcode * - * A new HMWSoln object may be created by the following code snippets: + * A new HMWSoln object may be created by the following code snippets: * * @code * HMWSoln *HMW = new HMWSoln("HMW_NaCl.xml", "NaCl_electrolyte"); @@ -1499,7 +1499,7 @@ public: /** * @} - * @name Activities, Standard States, and Activity Concentrations + * @name Activities, Standard States, and Activity Concentrations * * The activity \f$a_k\f$ of a species in solution is * related to the chemical potential by \f[ \mu_k = \mu_k^0(T) @@ -1512,7 +1512,7 @@ public: //! This method returns an array of generalized activity concentrations /*! - * The generalized activity concentrations, \f$ C_k^a\f$, are defined such that + * The generalized activity concentrations, \f$ C_k^a\f$, are defined such that * \f$ a_k = C^a_k / C^0_k, \f$ where \f$ C^0_k \f$ * is a standard concentration * defined below. These generalized concentrations are used @@ -1541,7 +1541,7 @@ public: * The standard concentration \f$ C^0_k \f$ used to normalize * the activity (i.e., generalized) concentration for use * - * We have set the standard concentration for all solute species in + * We have set the standard concentration for all solute species in * this phase equal to the default concentration of the solvent at the system temperature * and pressure multiplied by Mnaught (kg solvent / gmol solvent). The solvent * standard concentration is just equal to its standard state concentration. @@ -2094,7 +2094,7 @@ private: * - polarNeutral * - nonpolarNeutral . */ - vector_int m_electrolyteSpeciesType; + vector_int m_electrolyteSpeciesType; /** * a_k = Size of the ionic species in the DH formulation @@ -2196,10 +2196,10 @@ private: WaterProps* m_waterProps; //! Temporary array used in equilibrium calculations - mutable vector_fp m_pp; + mutable vector_fp m_pp; //! vector of size m_kk, used as a temporary holding area. - mutable vector_fp m_tmpV; + mutable vector_fp m_tmpV; /** * Stoichiometric species charge -> This is for calculations @@ -2213,7 +2213,7 @@ private: * For species that aren't ion pairs, its equal to the * m_speciesCharge[] value. */ - vector_fp m_speciesCharge_Stoich; + vector_fp m_speciesCharge_Stoich; /** * Array of 2D data used in the Pitzer/HMW formulation. @@ -2224,25 +2224,25 @@ private: * counterIJ where counterIJ = m_counterIJ[i][j] * is used to access this array. */ - mutable vector_fp m_Beta0MX_ij; + mutable vector_fp m_Beta0MX_ij; //! Derivative of Beta0_ij[i][j] wrt T /*! * vector index is counterIJ */ - mutable vector_fp m_Beta0MX_ij_L; + mutable vector_fp m_Beta0MX_ij_L; //! Derivative of Beta0_ij[i][j] wrt TT /*! * vector index is counterIJ */ - mutable vector_fp m_Beta0MX_ij_LL; + mutable vector_fp m_Beta0MX_ij_LL; //! Derivative of Beta0_ij[i][j] wrt P /*! * vector index is counterIJ */ - mutable vector_fp m_Beta0MX_ij_P; + mutable vector_fp m_Beta0MX_ij_P; //! Array of coefficients for Beta0, a variable in Pitzer's papers /*! @@ -2250,7 +2250,7 @@ private: * m_Beta0MX_ij_coeff.ptrColumn(counterIJ) is a double* containing * the vector of coefficients for the counterIJ interaction. */ - mutable Array2D m_Beta0MX_ij_coeff; + mutable Array2D m_Beta0MX_ij_coeff; /*! * Array of 2D data used in the Pitzer/HMW formulation. @@ -2287,7 +2287,7 @@ private: * m_Beta1MX_ij_coeff.ptrColumn(counterIJ) is a double* containing * the vector of coefficients for the counterIJ interaction. */ - mutable Array2D m_Beta1MX_ij_coeff; + mutable Array2D m_Beta1MX_ij_coeff; /** * Array of 2D data used in the Pitzer/HMW formulation. @@ -2327,7 +2327,7 @@ private: * This was added for the YMP database version of the code since it * contains temperature-dependent parameters for some 2-2 electrolytes. */ - mutable Array2D m_Beta2MX_ij_coeff; + mutable Array2D m_Beta2MX_ij_coeff; /** * Array of 2D data used in the Pitzer/HMW formulation. @@ -2494,16 +2494,16 @@ private: * index, i.e., n. The charged species occupy the j coordinate. * neutral, neutral interactions are also included here. */ - mutable Array2D m_Lambda_nj; + mutable Array2D m_Lambda_nj; - //! Derivative of Lambda_nj[i][j] wrt T. see m_Lambda_ij - mutable Array2D m_Lambda_nj_L; + //! Derivative of Lambda_nj[i][j] wrt T. see m_Lambda_ij + mutable Array2D m_Lambda_nj_L; - //! Derivative of Lambda_nj[i][j] wrt TT - mutable Array2D m_Lambda_nj_LL; + //! Derivative of Lambda_nj[i][j] wrt TT + mutable Array2D m_Lambda_nj_LL; - //! Derivative of Lambda_nj[i][j] wrt P - mutable Array2D m_Lambda_nj_P; + //! Derivative of Lambda_nj[i][j] wrt P + mutable Array2D m_Lambda_nj_P; //! Array of coefficients for Lambda_nj[i][j] in the Pitzer/HMW formulation. /*! @@ -2521,7 +2521,7 @@ private: * m_Lambda_ij_coeff.ptrColumn(n) is a double* containing * the vector of coefficients for the (i,j) interaction. */ - Array2D m_Lambda_nj_coeff; + Array2D m_Lambda_nj_coeff; //! Mu coefficient for the self-ternary neutral coefficient /*! @@ -2530,7 +2530,7 @@ private: * nnn interaction. This is a general interaction representing * neutral species interacting with itself. */ - mutable vector_fp m_Mu_nnn; + mutable vector_fp m_Mu_nnn; //! Mu coefficient temperature derivative for the self-ternary neutral coefficient /*! @@ -2539,7 +2539,7 @@ private: * nnn interaction. This is a general interaction representing * neutral species interacting with itself. */ - mutable vector_fp m_Mu_nnn_L; + mutable vector_fp m_Mu_nnn_L; //! Mu coefficient 2nd temperature derivative for the self-ternary neutral coefficient /*! @@ -2548,7 +2548,7 @@ private: * nnn interaction. This is a general interaction representing * neutral species interacting with itself. */ - mutable vector_fp m_Mu_nnn_LL; + mutable vector_fp m_Mu_nnn_LL; //! Mu coefficient pressure derivative for the self-ternary neutral coefficient /*! @@ -2557,10 +2557,10 @@ private: * nnn interaction. This is a general interaction representing * neutral species interacting with itself. */ - mutable vector_fp m_Mu_nnn_P; + mutable vector_fp m_Mu_nnn_P; //! Array of coefficients form_Mu_nnn term - Array2D m_Mu_nnn_coeff; + Array2D m_Mu_nnn_coeff; //! Logarithm of the activity coefficients on the molality //! scale. @@ -2843,7 +2843,7 @@ private: /*! * Normally these are all one. However, stability schemes will change that */ - mutable vector_fp IMS_lnActCoeffMolal_; + mutable vector_fp IMS_lnActCoeffMolal_; //! IMS Cutoff type int IMS_typeCutoff_; @@ -3181,10 +3181,10 @@ private: void readXMLCroppingCoefficients(const XML_Node& acNode); //! Precalculate the IMS Cutoff parameters for typeCutoff = 2 - void calcIMSCutoffParams_(); + void calcIMSCutoffParams_(); //! Calculate molality cut-off parameters - void calcMCCutoffParams_(); + void calcMCCutoffParams_(); //! Utility function to assign an integer value from a string //! for the ElectrolyteSpeciesType field. diff --git a/include/cantera/thermo/IdealGasPhase.h b/include/cantera/thermo/IdealGasPhase.h index d8dae66b8..ebce52665 100644 --- a/include/cantera/thermo/IdealGasPhase.h +++ b/include/cantera/thermo/IdealGasPhase.h @@ -464,7 +464,7 @@ public: setTemperature(p * meanMolecularWeight() / (GasConstant * rho)); } - //! Returns the isothermal compressibility. Units: 1/Pa. + //! Returns the isothermal compressibility. Units: 1/Pa. /** * The isothermal compressibility is defined as * \f[ @@ -539,7 +539,7 @@ public: //! Returns the standard concentration \f$ C^0_k \f$, which is used to normalize //! the generalized concentration. /*! - * This is defined as the concentration by which the generalized + * This is defined as the concentration by which the generalized * concentration is normalized to produce the activity. * In many cases, this quantity will be the same for all species in a phase. * Since the activity for an ideal gas mixture is @@ -630,7 +630,7 @@ public: //! Get the nondimensional Enthalpy functions for the species standard states //! at their standard states at the current T and P of the solution. /*! - * @param hrt Output vector of nondimensional standard state enthalpies. + * @param hrt Output vector of nondimensional standard state enthalpies. * Length: m_kk. */ virtual void getEnthalpy_RT(doublereal* hrt) const; @@ -638,7 +638,7 @@ public: //! Get the array of nondimensional Entropy functions for the //! species standard states at the current T and P of the solution. /*! - * @param sr Output vector of nondimensional standard state entropies. + * @param sr Output vector of nondimensional standard state entropies. * Length: m_kk. */ virtual void getEntropy_R(doublereal* sr) const; @@ -655,12 +655,12 @@ public: //! state of the species at the current T and P of the solution /*! * Units are Joules/kmol - * @param gpure Output vector of standard state Gibbs free energies + * @param gpure Output vector of standard state Gibbs free energies * Length: m_kk. */ virtual void getPureGibbs(doublereal* gpure) const; - //! Returns the vector of nondimensional Internal Energies of the standard + //! Returns the vector of nondimensional Internal Energies of the standard //! state species at the current T and P of the solution /*! * @param urt output vector of nondimensional standard state internal energies @@ -715,7 +715,7 @@ public: /*! * units = J/kmol * - * @param g Output vector containing the reference state + * @param g Output vector containing the reference state * Gibbs Free energies. Length: m_kk. Units: J/kmol. */ virtual void getGibbs_ref(doublereal* g) const; diff --git a/include/cantera/thermo/IdealMolalSoln.h b/include/cantera/thermo/IdealMolalSoln.h index fef577284..f73287d22 100644 --- a/include/cantera/thermo/IdealMolalSoln.h +++ b/include/cantera/thermo/IdealMolalSoln.h @@ -478,7 +478,7 @@ public: //! Partial molar heat capacity of the solution:. UnitsL J/kmol/K /*! - * The kth partial molar heat capacity is equal to + * The kth partial molar heat capacity is equal to * the temperature derivative of the partial molar * enthalpy of the kth species in the solution at constant * P and composition (p. 220 Smith and Van Ness). @@ -565,14 +565,14 @@ public: * * @param smv Output vector of species molar volumes. */ - void getSpeciesMolarVolumes(double* smv) const; + void getSpeciesMolarVolumes(double* smv) const; //@} protected: /** * Species molar volume \f$ m^3 kmol^{-1} \f$ */ - vector_fp m_speciesMolarVolume; + vector_fp m_speciesMolarVolume; /** * The standard concentrations can have three different forms @@ -596,18 +596,18 @@ private: /** * Temporary array used in equilibrium calculations */ - mutable vector_fp m_pp; + mutable vector_fp m_pp; /** * vector of size m_kk, used as a temporary holding area. */ - mutable vector_fp m_tmpV; + mutable vector_fp m_tmpV; //! Logarithm of the molal activity coefficients /*! * Normally these are all one. However, stability schemes will change that */ - mutable vector_fp IMS_lnActCoeffMolal_; + mutable vector_fp IMS_lnActCoeffMolal_; public: //! value of the solute mole fraction that centers the cutoff polynomials //! for the cutoff =1 process; diff --git a/include/cantera/thermo/IdealSolidSolnPhase.h b/include/cantera/thermo/IdealSolidSolnPhase.h index 0da0b407b..fb302b381 100644 --- a/include/cantera/thermo/IdealSolidSolnPhase.h +++ b/include/cantera/thermo/IdealSolidSolnPhase.h @@ -352,7 +352,7 @@ public: * kmol m-3. Rate constants must reflect this fact. * * On a general note, the following must be true. - * For an ideal solution, the generalized concentration must consist + * For an ideal solution, the generalized concentration must consist * of the mole fraction multiplied by a constant. The constant may be * fairly arbitrarily chosen, with differences adsorbed into the * reaction rate expression. 1/V_N, 1/V_k, or 1 are equally good, @@ -483,7 +483,7 @@ public: * \bar s_k(T,P) = \hat s^0_k(T) - R log(X_k) * \f] * The reference-state pure-species entropies,\f$ \hat s^{ref}_k(T) \f$, - * at the reference pressure, \f$ P_{ref} \f$, are computed by the + * at the reference pressure, \f$ P_{ref} \f$, are computed by the * species thermodynamic * property manager. They are polynomial functions of temperature. * @see SpeciesThermo @@ -846,34 +846,34 @@ protected: /** * Species molar volumes \f$ m^3 kmol^-1 \f$ */ - vector_fp m_speciesMolarVolume; + vector_fp m_speciesMolarVolume; //! Vector containing the species reference enthalpies at T = m_tlast - mutable vector_fp m_h0_RT; + mutable vector_fp m_h0_RT; /** * Vector containing the species reference constant pressure * heat capacities at T = m_tlast */ - mutable vector_fp m_cp0_R; + mutable vector_fp m_cp0_R; //! Vector containing the species reference Gibbs functions at T = m_tlast - mutable vector_fp m_g0_RT; + mutable vector_fp m_g0_RT; //! Vector containing the species reference entropies at T = m_tlast - mutable vector_fp m_s0_R; + mutable vector_fp m_s0_R; /** * Vector containing the species reference exp(-G/RT) functions * at T = m_tlast */ - mutable vector_fp m_expg0_RT; + mutable vector_fp m_expg0_RT; //! Vector of potential energies for the species. - mutable vector_fp m_pe; + mutable vector_fp m_pe; //! Temporary array used in equilibrium calculations - mutable vector_fp m_pp; + mutable vector_fp m_pp; private: /// @name Utility Functions diff --git a/include/cantera/thermo/IdealSolnGasVPSS.h b/include/cantera/thermo/IdealSolnGasVPSS.h index 0c7685d6e..2a5cf7acc 100644 --- a/include/cantera/thermo/IdealSolnGasVPSS.h +++ b/include/cantera/thermo/IdealSolnGasVPSS.h @@ -94,7 +94,7 @@ public: */ void setPressure(doublereal p); - //! Returns the isothermal compressibility. Units: 1/Pa. + //! Returns the isothermal compressibility. Units: 1/Pa. /*! * The isothermal compressibility is defined as * \f[ @@ -150,7 +150,7 @@ public: //! Returns the standard concentration \f$ C^0_k \f$, which is used to normalize //! the generalized concentration. /*! - * This is defined as the concentration by which the generalized + * This is defined as the concentration by which the generalized * concentration is normalized to produce the activity. * In many cases, this quantity will be the same for all species in a phase. * Since the activity for an ideal gas mixture is @@ -186,7 +186,7 @@ public: * getChemPotentials() and then dividing by RT. No need for child * classes to handle. * - * @param mu Output vector of non-dimensional species chemical potentials + * @param mu Output vector of non-dimensional species chemical potentials * Length: m_kk. */ void getChemPotentials_RT(doublereal* mu) const; diff --git a/include/cantera/thermo/IonsFromNeutralVPSSTP.h b/include/cantera/thermo/IonsFromNeutralVPSSTP.h index 4b901ac5c..ab8265811 100644 --- a/include/cantera/thermo/IonsFromNeutralVPSSTP.h +++ b/include/cantera/thermo/IonsFromNeutralVPSSTP.h @@ -362,7 +362,7 @@ public: * @param dlnActCoeffdlnN Output vector of derivatives of the * log Activity Coefficients. length = m_kk * m_kk */ - virtual void getdlnActCoeffdlnN(const size_t ld, doublereal* const dlnActCoeffdlnN) ; + virtual void getdlnActCoeffdlnN(const size_t ld, doublereal* const dlnActCoeffdlnN); //! @} //! Get the Salt Dissociation Coefficients @@ -393,7 +393,7 @@ public: * is charge neutrality. If there isn't, then it wouldn't * make much sense. * - * for the case of cIonSolnType_SINGLEANION, some slough + * for the case of cIonSolnType_SINGLEANION, some slough * in the charge neutrality is allowed. The cation number * is followed, while the difference in charge neutrality * is dumped into the anion mole number to fix the imbalance. @@ -453,7 +453,7 @@ public: * is charge neutrality. If there isn't, then it wouldn't * make much sense. * - * for the case of cIonSolnType_SINGLEANION, some slough + * for the case of cIonSolnType_SINGLEANION, some slough * in the charge neutrality is allowed. The cation number * is followed, while the difference in charge neutrality * is dumped into the anion mole number to fix the imbalance. @@ -660,7 +660,7 @@ protected: * * Thus, we formulate the neutral molecule mole fraction NeutralMolecMoleFractions_[] * vector from this association. We further assume that there are - * no other associations. If fm_invert_simple_ is not true, + * no other associations. If fm_invert_simple_ is not true, * then we need to do a formal inversion which takes a great * deal of time and is not currently implemented. */ diff --git a/include/cantera/thermo/LatticePhase.h b/include/cantera/thermo/LatticePhase.h index fb008fd84..ecd02b918 100644 --- a/include/cantera/thermo/LatticePhase.h +++ b/include/cantera/thermo/LatticePhase.h @@ -151,7 +151,7 @@ namespace Cantera * For example, a bulk-phase binary gas reaction between species j and k, producing * a new species l would have the * following equation for its rate of progress variable, \f$ R^1 \f$, which has - * units of kmol m-3 s-1. + * units of kmol m-3 s-1. * * \f[ * R^1 = k^1 C_j^a C_k^a = k^1 X_j X_k @@ -438,7 +438,7 @@ public: virtual void setConcentrations(const doublereal* const c); //@} - /// @name Activities, Standard States, and Activity Concentrations + /// @name Activities, Standard States, and Activity Concentrations /** * The activity \f$a_k\f$ of a species in solution is * related to the chemical potential by \f[ \mu_k = \mu_k^0(T) @@ -549,7 +549,7 @@ public: * \bar s_k(T,P) = \hat s^0_k(T) - R log(X_k) * \f] * The reference-state pure-species entropies,\f$ \hat s^{ref}_k(T) \f$, - * at the reference pressure, \f$ P_{ref} \f$, are computed by the + * at the reference pressure, \f$ P_{ref} \f$, are computed by the * species thermodynamic * property manager. They are polynomial functions of temperature. * @see SpeciesThermo @@ -638,7 +638,7 @@ public: * manager class (see ThermoPhase::m_spthermo). How to relate pressure * changes to the reference state thermodynamics is resolved at this level. * - * @param sr Output vector of nondimensional standard state entropies. + * @param sr Output vector of nondimensional standard state entropies. * Length: m_kk. */ virtual void getEntropy_R(doublereal* sr) const; @@ -723,7 +723,7 @@ public: /*! * units = J/kmol * - * @param g Output vector containing the reference state + * @param g Output vector containing the reference state * Gibbs Free energies. Length: m_kk. Units: J/kmol. */ virtual void getGibbs_ref(doublereal* g) const; @@ -793,7 +793,7 @@ public: * * @param n number of parameters. Must be one * @param c array of \a n coefficients - * c[0] = The bulk lattice density (kmol m-3) + * c[0] = The bulk lattice density (kmol m-3) */ virtual void setParameters(int n, doublereal* const c); @@ -873,7 +873,7 @@ protected: /** * Species molar volumes \f$ m^3 kmol^-1 \f$ */ - vector_fp m_speciesMolarVolume; + vector_fp m_speciesMolarVolume; //! Site Density of the lattice solid /*! diff --git a/include/cantera/thermo/LatticeSolidPhase.h b/include/cantera/thermo/LatticeSolidPhase.h index 9c451feb6..9e71816da 100644 --- a/include/cantera/thermo/LatticeSolidPhase.h +++ b/include/cantera/thermo/LatticeSolidPhase.h @@ -166,7 +166,7 @@ public: //! Returns the reference pressure in Pa. This function is a wrapper //! that calls the species thermo refPressure function. - virtual doublereal refPressure() const ; + virtual doublereal refPressure() const; //! This method returns the convention used in specification //! of the standard state, of which there are currently two, @@ -398,7 +398,7 @@ public: //! This method returns an array of generalized activity concentrations /*! * The generalized activity concentrations, - * \f$ C^a_k \f$, are defined such that \f$ a_k = C^a_k / + * \f$ C^a_k \f$, are defined such that \f$ a_k = C^a_k / * C^0_k, \f$ where \f$ C^0_k \f$ is a standard concentration * defined below and \f$ a_k \f$ are activities used in the * thermodynamic functions. These activity (or generalized) @@ -463,7 +463,7 @@ public: * \bar s_k(T,P) = \hat s^0_k(T) - R log(X_k) * \f] * The reference-state pure-species entropies,\f$ \hat s^{ref}_k(T) \f$, - * at the reference pressure, \f$ P_{ref} \f$, are computed by the + * at the reference pressure, \f$ P_{ref} \f$, are computed by the * species thermodynamic * property manager. They are polynomial functions of temperature. * @see SpeciesThermo @@ -564,7 +564,7 @@ public: * @param g Vector of Gibbs free energies of the reference state. * length = m_kk */ - virtual void getGibbs_ref(doublereal* g) const; + virtual void getGibbs_ref(doublereal* g) const; //! Initialize the ThermoPhase object after all species have been set up /*! @@ -588,7 +588,7 @@ public: //! Add in species from Slave phases /*! - * This hook is used for cSS_CONVENTION_SLAVE phases + * This hook is used for cSS_CONVENTION_SLAVE phases * * @param phaseNode XML_Node for the current phase */ diff --git a/include/cantera/thermo/MargulesVPSSTP.h b/include/cantera/thermo/MargulesVPSSTP.h index 37e8b97c5..2bf1b2d09 100644 --- a/include/cantera/thermo/MargulesVPSSTP.h +++ b/include/cantera/thermo/MargulesVPSSTP.h @@ -306,7 +306,7 @@ public: */ MargulesVPSSTP& operator=(const MargulesVPSSTP& b); - //! Duplication routine for objects which inherit from ThermoPhase. + //! 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 @@ -543,7 +543,7 @@ public: */ virtual void getdlnActCoeffdlnX_diag(doublereal* dlnActCoeffdlnX_diag) const; - //! Get the array of derivatives of the log activity coefficients wrt mole numbers - diagonal only + //! Get the array of derivatives of the log activity coefficients wrt mole numbers - diagonal only /*! * This function is a virtual method. For ideal mixtures * (unity activity coefficients), this can return zero. @@ -578,7 +578,7 @@ public: * @param dlnActCoeffdlnN Output vector of derivatives of the * log Activity Coefficients. length = m_kk * m_kk */ - virtual void getdlnActCoeffdlnN(const size_t ld, doublereal* const dlnActCoeffdlnN) ; + virtual void getdlnActCoeffdlnN(const size_t ld, doublereal* const dlnActCoeffdlnN); //@} @@ -639,7 +639,7 @@ private: */ void s_update_dlnActCoeff_dlnN_diag() const; - //! Update the derivative of the log of the activity coefficients wrt log(moles_m) + //! Update the derivative of the log of the activity coefficients wrt log(moles_m) /*! * This function will be called to update the internally stored * derivative of the natural logarithm of the activity coefficients diff --git a/include/cantera/thermo/MetalPhase.h b/include/cantera/thermo/MetalPhase.h index f6b740d0c..2cab28638 100644 --- a/include/cantera/thermo/MetalPhase.h +++ b/include/cantera/thermo/MetalPhase.h @@ -70,7 +70,7 @@ public: virtual void setPressure(doublereal pres) { m_press = pres; } - virtual doublereal pressure() const { + virtual doublereal pressure() const { return m_press; } diff --git a/include/cantera/thermo/MetalSHEelectrons.h b/include/cantera/thermo/MetalSHEelectrons.h index e84cd2d36..a1a1bc680 100644 --- a/include/cantera/thermo/MetalSHEelectrons.h +++ b/include/cantera/thermo/MetalSHEelectrons.h @@ -204,7 +204,7 @@ public: /*! * @param right Object to be copied */ - MetalSHEelectrons(const MetalSHEelectrons& right); + MetalSHEelectrons(const MetalSHEelectrons& right); //! Assignment operator /*! @@ -253,7 +253,7 @@ public: */ virtual void setPressure(doublereal p); - //! Returns the isothermal compressibility. Units: 1/Pa. + //! Returns the isothermal compressibility. Units: 1/Pa. /*! * The isothermal compressibility is defined as * \f[ @@ -269,7 +269,7 @@ public: * \beta = \frac{1}{v}\left(\frac{\partial v}{\partial T}\right)_P * \f] */ - virtual doublereal thermalExpansionCoeff() const ; + virtual doublereal thermalExpansionCoeff() const; //! @} //! @name Activities, Standard States, and Activity Concentrations @@ -342,7 +342,7 @@ public: //! Get the nondimensional Enthalpy functions for the species //! at their standard states at the current T and P of the solution. /*! - * @param hrt Output vector of nondimensional standard state enthalpies. + * @param hrt Output vector of nondimensional standard state enthalpies. * Length: m_kk. */ virtual void getEnthalpy_RT(doublereal* hrt) const; @@ -350,7 +350,7 @@ public: //! Get the array of nondimensional Entropy functions for the //! standard state species at the current T and P of the solution. /*! - * @param sr Output vector of nondimensional standard state entropies. + * @param sr Output vector of nondimensional standard state entropies. * Length: m_kk. */ virtual void getEntropy_R(doublereal* sr) const; @@ -372,7 +372,7 @@ public: */ virtual void getCp_R(doublereal* cpr) const; - //! Returns the vector of nondimensional Internal Energies of the standard + //! Returns the vector of nondimensional Internal Energies of the standard //! state species at the current T and P of the solution /*! * For an incompressible, diff --git a/include/cantera/thermo/MineralEQ3.h b/include/cantera/thermo/MineralEQ3.h index 2312fb6aa..56b57cf19 100644 --- a/include/cantera/thermo/MineralEQ3.h +++ b/include/cantera/thermo/MineralEQ3.h @@ -84,7 +84,7 @@ namespace Cantera * R_s = k_s C_{gas} * \f] * where the units for \f$ R_s \f$ are kmol m-2 s-1. \f$ C_{gas} \f$ has units - * of kmol m-3. Therefore, the kinetic rate constant, \f$ k_s \f$, has + * of kmol m-3. Therefore, the kinetic rate constant, \f$ k_s \f$, has * units of m s-1. Nowhere does the concentration of the bulk phase * appear in the rate constant expression, since it's a stoichiometric * phase and the activity is always equal to 1.0. @@ -118,7 +118,7 @@ public: /*! * @param right Object to be copied */ - MineralEQ3(const MineralEQ3& right); + MineralEQ3(const MineralEQ3& right); //! Assignment operator /*! @@ -165,7 +165,7 @@ public: */ virtual void setPressure(doublereal p); - //! Returns the isothermal compressibility. Units: 1/Pa. + //! Returns the isothermal compressibility. Units: 1/Pa. /*! * The isothermal compressibility is defined as * \f[ @@ -181,7 +181,7 @@ public: * \beta = \frac{1}{v}\left(\frac{\partial v}{\partial T}\right)_P * \f] */ - virtual doublereal thermalExpansionCoeff() const ; + virtual doublereal thermalExpansionCoeff() const; /** * @} @@ -256,7 +256,7 @@ public: //! Get the nondimensional Enthalpy functions for the species //! at their standard states at the current T and P of the solution. /*! - * @param hrt Output vector of nondimensional standard state enthalpies. + * @param hrt Output vector of nondimensional standard state enthalpies. * Length: m_kk. */ virtual void getEnthalpy_RT(doublereal* hrt) const; @@ -264,7 +264,7 @@ public: //! Get the array of nondimensional Entropy functions for the //! standard state species at the current T and P of the solution. /*! - * @param sr Output vector of nondimensional standard state entropies. + * @param sr Output vector of nondimensional standard state entropies. * Length: m_kk. */ virtual void getEntropy_R(doublereal* sr) const; @@ -286,7 +286,7 @@ public: */ virtual void getCp_R(doublereal* cpr) const; - //! Returns the vector of nondimensional Internal Energies of the standard + //! Returns the vector of nondimensional Internal Energies of the standard //! state species at the current T and P of the solution /*! * For an incompressible, diff --git a/include/cantera/thermo/MixedSolventElectrolyte.h b/include/cantera/thermo/MixedSolventElectrolyte.h index b683c9a73..7baa57f44 100644 --- a/include/cantera/thermo/MixedSolventElectrolyte.h +++ b/include/cantera/thermo/MixedSolventElectrolyte.h @@ -297,7 +297,7 @@ public: */ MixedSolventElectrolyte& operator=(const MixedSolventElectrolyte& b); - //! Duplication routine for objects which inherit from ThermoPhase. + //! 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 @@ -537,7 +537,7 @@ public: */ virtual void getdlnActCoeffdlnX_diag(doublereal* dlnActCoeffdlnX_diag) const; - //! Get the array of derivatives of the log activity coefficients wrt mole numbers - diagonal only + //! Get the array of derivatives of the log activity coefficients wrt mole numbers - diagonal only /*! * This function is a virtual method. For ideal mixtures * (unity activity coefficients), this can return zero. @@ -572,7 +572,7 @@ public: * @param dlnActCoeffdlnN Output vector of derivatives of the * log Activity Coefficients. length = m_kk * m_kk */ - virtual void getdlnActCoeffdlnN(const size_t ld, doublereal* const dlnActCoeffdlnN) ; + virtual void getdlnActCoeffdlnN(const size_t ld, doublereal* const dlnActCoeffdlnN); //@} private: @@ -632,7 +632,7 @@ private: */ void s_update_dlnActCoeff_dlnN_diag() const; - //! Update the derivative of the log of the activity coefficients wrt log(moles_m) + //! Update the derivative of the log of the activity coefficients wrt log(moles_m) /*! * This function will be called to update the internally stored * derivative of the natural logarithm of the activity coefficients diff --git a/include/cantera/thermo/MixtureFugacityTP.h b/include/cantera/thermo/MixtureFugacityTP.h index 3933002e4..fdc5f2cd4 100644 --- a/include/cantera/thermo/MixtureFugacityTP.h +++ b/include/cantera/thermo/MixtureFugacityTP.h @@ -24,17 +24,17 @@ namespace Cantera #define FLUID_UNSTABLE -4 #define FLUID_UNDEFINED -3 #define FLUID_SUPERCRIT -2 -#define FLUID_GAS -1 -#define FLUID_LIQUID_0 0 -#define FLUID_LIQUID_1 1 -#define FLUID_LIQUID_2 2 -#define FLUID_LIQUID_3 3 -#define FLUID_LIQUID_4 4 -#define FLUID_LIQUID_5 5 -#define FLUID_LIQUID_6 6 -#define FLUID_LIQUID_7 7 -#define FLUID_LIQUID_8 8 -#define FLUID_LIQUID_9 9 +#define FLUID_GAS -1 +#define FLUID_LIQUID_0 0 +#define FLUID_LIQUID_1 1 +#define FLUID_LIQUID_2 2 +#define FLUID_LIQUID_3 3 +#define FLUID_LIQUID_4 4 +#define FLUID_LIQUID_5 5 +#define FLUID_LIQUID_6 6 +#define FLUID_LIQUID_7 7 +#define FLUID_LIQUID_8 8 +#define FLUID_LIQUID_9 9 /** * @ingroup thermoprops @@ -169,7 +169,7 @@ public: * getChemPotentials() and then dividing by RT. No need for child * classes to handle. * - * @param mu Output vector of non-dimensional species chemical potentials + * @param mu Output vector of non-dimensional species chemical potentials * Length: m_kk. */ void getChemPotentials_RT(doublereal* mu) const; @@ -260,7 +260,7 @@ public: virtual void getIntEnergy_RT(doublereal* urt) const; //! Get the nondimensional Heat Capacities at constant - //! pressure for the standard state of the species at the current T and P. + //! pressure for the standard state of the species at the current T and P. /*! * For all objects with the Mixture Fugacity approximation, we define the * standard state as an ideal gas at the current temperature and pressure of the solution. @@ -423,7 +423,7 @@ public: } protected: - //! Updates the reference state thermodynamic functions at the current T of the solution. + //! Updates the reference state thermodynamic functions at the current T of the solution. /*! * This function must be called for every call to functions in this * class. It checks to see whether the temperature has changed and @@ -446,7 +446,7 @@ public: * variables for holding the species reference-state values of Cp, H, S, and V at the * last temperature and reference pressure called. These functions are not recalculated * if a new call is made using the previous temperature. - * All calculations are done within the routine _updateRefStateThermo(). + * All calculations are done within the routine _updateRefStateThermo(). */ //@{ @@ -549,9 +549,9 @@ public: */ //@{ - //! Set the initial state of the phase to the conditions specified in the state XML element. + //! Set the initial state of the phase to the conditions specified in the state XML element. /*! - * This method sets the temperature, pressure, and mole fraction vector to a set default value. + * This method sets the temperature, pressure, and mole fraction vector to a set default value. * * @param state An XML_Node object corresponding to * the "state" entry for this phase in the input file. @@ -615,7 +615,7 @@ protected: //! Calculate the value of z /*! * \f[ - * z = \frac{P v}{ R T} + * z = \frac{P v}{R T} * \f] * * returns the value of z @@ -714,7 +714,7 @@ public: * - WATER_LIQUID below the critical temperature but above the critical density * - WATER_SUPERCRIT above the critical temperature */ - int phaseState(bool checkState = false) const ; + int phaseState(bool checkState = false) const; //! Return the value of the density at the liquid spinodal point (on the liquid side) //! for the current temperature. @@ -791,7 +791,7 @@ protected: * * units = Pascals */ - doublereal m_Pcurrent; + doublereal m_Pcurrent; //! Storage for the current values of the mole fractions of the species /*! @@ -815,19 +815,19 @@ protected: mutable doublereal m_Tlast_ref; //! Temporary storage for log of p/rt - mutable doublereal m_logc0; + mutable doublereal m_logc0; //! Temporary storage for dimensionless reference state enthalpies - mutable vector_fp m_h0_RT; + mutable vector_fp m_h0_RT; //! Temporary storage for dimensionless reference state heat capacities - mutable vector_fp m_cp0_R; + mutable vector_fp m_cp0_R; //! Temporary storage for dimensionless reference state Gibbs energies - mutable vector_fp m_g0_RT; + mutable vector_fp m_g0_RT; //! Temporary storage for dimensionless reference state entropies - mutable vector_fp m_s0_R; + mutable vector_fp m_s0_R; spinodalFunc* fdpdv_; }; diff --git a/include/cantera/thermo/MolalityVPSSTP.h b/include/cantera/thermo/MolalityVPSSTP.h index c05b08ee1..a4b870f78 100644 --- a/include/cantera/thermo/MolalityVPSSTP.h +++ b/include/cantera/thermo/MolalityVPSSTP.h @@ -81,7 +81,7 @@ namespace Cantera * * The standard states for thermodynamic objects that derive from MolalityVPSSTP * are on the unit molality basis. Chemical potentials - * of the solutes, \f$ \mu_k \f$, and the solvent, \f$ \mu_o \f$, which are based + * of the solutes, \f$ \mu_k \f$, and the solvent, \f$ \mu_o \f$, which are based * on the molality form, have the following general format: * * \f[ @@ -103,7 +103,7 @@ namespace Cantera * \f] * * MolalityVPSSTP::osmoticCoefficient() returns the value of \f$ \phi \f$. - * Note there are a few of definitions of the osmotic coefficient floating + * Note there are a few of definitions of the osmotic coefficient floating * around. We use the one defined in * (Activity Coefficients in Electrolyte Solutions, K. S. Pitzer * CRC Press, Boca Raton, 1991, p. 85, Eqn. 28). This definition is most clearly @@ -470,7 +470,7 @@ public: //! Get the array of non-dimensional molality based //! activity coefficients at the current solution temperature, - //! pressure, and solution concentration. + //! pressure, and solution concentration. /*! * See Denbigh p. 278 for a thorough discussion. This class must be overwritten in * classes which derive from MolalityVPSSTP. This function takes over from the @@ -506,7 +506,7 @@ public: * \phi = \frac{- ln(a_o)}{\tilde{M}_o \sum_{i \ne o} m_i} * \f] * - * Note there are a few of definitions of the osmotic coefficient floating + * Note there are a few of definitions of the osmotic coefficient floating * around. We use the one defined in * (Activity Coefficients in Electrolyte Solutions, K. S. Pitzer * CRC Press, Boca Raton, 1991, p. 85, Eqn. 28). This definition is most clearly @@ -679,7 +679,7 @@ protected: //! Get the array of unscaled non-dimensional molality based //! activity coefficients at the current solution temperature, - //! pressure, and solution concentration. + //! pressure, and solution concentration. /*! * See Denbigh p. 278 for a thorough discussion. This class must be overwritten in * classes which derive from MolalityVPSSTP. This function takes over from the @@ -736,7 +736,7 @@ protected: * scaling. * Either PHSCALE_PITZER or PHSCALE_NBS */ - int m_pHScalingType; + int m_pHScalingType; //! Index of the phScale species /*! @@ -772,7 +772,7 @@ protected: * Note this vector is a mutable quantity. * units are (kg/kmol) */ - mutable vector_fp m_molalities; + mutable vector_fp m_molalities; }; @@ -819,7 +819,7 @@ const int PHSCALE_PITZER = 0; * This is the NBS pH scale, which is used in all conventional pH * measurements. and is based on the Bates-Guggenheim equations. */ -const int PHSCALE_NBS = 1; +const int PHSCALE_NBS = 1; } diff --git a/include/cantera/thermo/MolarityIonicVPSSTP.h b/include/cantera/thermo/MolarityIonicVPSSTP.h index 84e8c9e62..f8e820c79 100644 --- a/include/cantera/thermo/MolarityIonicVPSSTP.h +++ b/include/cantera/thermo/MolarityIonicVPSSTP.h @@ -91,7 +91,7 @@ public: /*! * @param b class to be copied */ - MolarityIonicVPSSTP(const MolarityIonicVPSSTP& b); + MolarityIonicVPSSTP(const MolarityIonicVPSSTP& b); /// Assignment operator /*! @@ -99,7 +99,7 @@ public: */ MolarityIonicVPSSTP& operator=(const MolarityIonicVPSSTP& b); - //! Duplication routine for objects which inherit from ThermoPhase. + //! 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 @@ -348,10 +348,10 @@ protected: mutable std::vector moleFractionsTmp_; }; -#define PBTYPE_PASSTHROUGH 0 -#define PBTYPE_SINGLEANION 1 -#define PBTYPE_SINGLECATION 2 -#define PBTYPE_MULTICATIONANION 3 +#define PBTYPE_PASSTHROUGH 0 +#define PBTYPE_SINGLEANION 1 +#define PBTYPE_SINGLECATION 2 +#define PBTYPE_MULTICATIONANION 3 } diff --git a/include/cantera/thermo/Mu0Poly.h b/include/cantera/thermo/Mu0Poly.h index fd4f5d117..d3cef03ec 100644 --- a/include/cantera/thermo/Mu0Poly.h +++ b/include/cantera/thermo/Mu0Poly.h @@ -31,7 +31,7 @@ class XML_Node; * The piece-wise constant heat capacity is calculated from the change in the chemical potential over each interval. * Once the heat capacity is known, the other thermodynamic functions may be determined. * The basic equation for going from temperature point 1 to temperature point 2 - * are as follows for \f$ T \f$, \f$ T_1 <= T <= T_2 \f$ + * are as follows for \f$ T \f$, \f$ T_1 <= T <= T_2 \f$ * * \f[ * \mu^o(T_1) = h^o(T_1) - T_1 * s^o(T_1) @@ -46,7 +46,7 @@ class XML_Node; * h^o(T_2) = h^o(T_1) + Cp^o(T_1)(T_2 - T_1) * \f] * - * Within each interval the following relations are used. For \f$ T \f$, \f$ T_1 <= T <= T_2 \f$ + * Within each interval the following relations are used. For \f$ T \f$, \f$ T_1 <= T <= T_2 \f$ * * \f[ * \mu^o(T) = \mu^o(T_1) + Cp^o(T_1)(T - T_1) - Cp^o(T_1)(T_2)ln(\frac{T}{T_1}) - s^o(T_1)(T - T_1) @@ -110,7 +110,7 @@ public: //! Update the properties for this species, given a temperature polynomial /*! * This method is called with a pointer to an array containing the functions of - * temperature needed by this parameterization, and three pointers to arrays where the + * temperature needed by this parameterization, and three pointers to arrays where the * computed property values should be written. This method updates only one value in * each array. * @@ -125,12 +125,12 @@ public: */ virtual void updateProperties(const doublereal* tPoly, doublereal* cp_R, doublereal* h_RT, - doublereal* s_R) const ; + doublereal* s_R) const; virtual void updatePropertiesTemp(const doublereal temp, doublereal* cp_R, doublereal* h_RT, - doublereal* s_R) const ; + doublereal* s_R) const; virtual void reportParameters(size_t& n, int& type, doublereal& tlow, doublereal& thigh, doublereal& pref, diff --git a/include/cantera/thermo/Nasa9Poly1.h b/include/cantera/thermo/Nasa9Poly1.h index dc9f21324..6b7add62e 100644 --- a/include/cantera/thermo/Nasa9Poly1.h +++ b/include/cantera/thermo/Nasa9Poly1.h @@ -95,7 +95,7 @@ public: //! Update the properties for this species, given a temperature polynomial /*! * This method is called with a pointer to an array containing the - * functions of temperature needed by this parameterization, and three + * functions of temperature needed by this parameterization, and three * pointers to arrays where the computed property values should be * written. This method updates only one value in each array. * diff --git a/include/cantera/thermo/Nasa9PolyMultiTempRegion.h b/include/cantera/thermo/Nasa9PolyMultiTempRegion.h index 1c3e4cf07..77106cf06 100644 --- a/include/cantera/thermo/Nasa9PolyMultiTempRegion.h +++ b/include/cantera/thermo/Nasa9PolyMultiTempRegion.h @@ -78,7 +78,7 @@ public: //! Update the properties for this species, given a temperature polynomial /*! * This method is called with a pointer to an array containing the - * functions of temperature needed by this parameterization, and three + * functions of temperature needed by this parameterization, and three * pointers to arrays where the computed property values should be * written. This method updates only one value in each array. * diff --git a/include/cantera/thermo/NasaPoly1.h b/include/cantera/thermo/NasaPoly1.h index 4d22b89ec..c69eda975 100644 --- a/include/cantera/thermo/NasaPoly1.h +++ b/include/cantera/thermo/NasaPoly1.h @@ -85,7 +85,7 @@ public: //! Update the properties for this species, given a temperature polynomial /*! * This method is called with a pointer to an array containing the - * functions of temperature needed by this parameterization, and three + * functions of temperature needed by this parameterization, and three * pointers to arrays where the computed property values should be * written. This method updates only one value in each array. * @@ -104,18 +104,18 @@ public: */ virtual void updateProperties(const doublereal* tt, doublereal* cp_R, doublereal* h_RT, doublereal* s_R) const { - doublereal ct0 = m_coeff[0]; // a0 - doublereal ct1 = m_coeff[1]*tt[0]; // a1 * T - doublereal ct2 = m_coeff[2]*tt[1]; // a2 * T^2 - doublereal ct3 = m_coeff[3]*tt[2]; // a3 * T^3 - doublereal ct4 = m_coeff[4]*tt[3]; // a4 * T^4 + doublereal ct0 = m_coeff[0]; // a0 + doublereal ct1 = m_coeff[1]*tt[0]; // a1 * T + doublereal ct2 = m_coeff[2]*tt[1]; // a2 * T^2 + doublereal ct3 = m_coeff[3]*tt[2]; // a3 * T^3 + doublereal ct4 = m_coeff[4]*tt[3]; // a4 * T^4 doublereal cp, h, s; cp = ct0 + ct1 + ct2 + ct3 + ct4; h = ct0 + 0.5*ct1 + 1.0/3.0*ct2 + 0.25*ct3 + 0.2*ct4 - + m_coeff[5]*tt[4]; // last term is a5/T + + m_coeff[5]*tt[4]; // last term is a5/T s = ct0*tt[5] + ct1 + 0.5*ct2 + 1.0/3.0*ct3 - +0.25*ct4 + m_coeff[6]; // last term is a6 + +0.25*ct4 + m_coeff[6]; // last term is a6 // return the computed properties for this species *cp_R = cp; @@ -156,14 +156,14 @@ public: double tt[6]; double temp = 298.15; updateTemperaturePoly(temp, tt); - doublereal ct0 = m_coeff[0]; // a0 - doublereal ct1 = m_coeff[1]*tt[0]; // a1 * T - doublereal ct2 = m_coeff[2]*tt[1]; // a2 * T^2 - doublereal ct3 = m_coeff[3]*tt[2]; // a3 * T^3 - doublereal ct4 = m_coeff[4]*tt[3]; // a4 * T^4 + doublereal ct0 = m_coeff[0]; // a0 + doublereal ct1 = m_coeff[1]*tt[0]; // a1 * T + doublereal ct2 = m_coeff[2]*tt[1]; // a2 * T^2 + doublereal ct3 = m_coeff[3]*tt[2]; // a3 * T^3 + doublereal ct4 = m_coeff[4]*tt[3]; // a4 * T^4 double h_RT = ct0 + 0.5*ct1 + 1.0/3.0*ct2 + 0.25*ct3 + 0.2*ct4 - + m_coeff[5]*tt[4]; // last t + + m_coeff[5]*tt[4]; // last t double h = h_RT * GasConstant * temp; if (h298) { diff --git a/include/cantera/thermo/NasaPoly2.h b/include/cantera/thermo/NasaPoly2.h index 29b720940..070e5efc4 100644 --- a/include/cantera/thermo/NasaPoly2.h +++ b/include/cantera/thermo/NasaPoly2.h @@ -92,7 +92,7 @@ public: //! Update the properties for this species, given a temperature polynomial /*! * This method is called with a pointer to an array containing the - * functions of temperature needed by this parameterization, and three + * functions of temperature needed by this parameterization, and three * pointers to arrays where the computed property values should be * written. This method updates only one value in each array. * @@ -162,7 +162,7 @@ public: double h = mnp_low.reportHf298(0); double hnew = h + delH; mnp_low.modifyOneHf298(k, hnew); - h = mnp_high.reportHf298(0); + h = mnp_high.reportHf298(0); hnew = h + delH; mnp_high.modifyOneHf298(k, hnew); } diff --git a/include/cantera/thermo/PDSS_HKFT.h b/include/cantera/thermo/PDSS_HKFT.h index caf1ae692..d09913ca9 100644 --- a/include/cantera/thermo/PDSS_HKFT.h +++ b/include/cantera/thermo/PDSS_HKFT.h @@ -105,7 +105,7 @@ public: * * Note this is just an extra routine to check the arithmetic * - * @return returns the species standard state enthalpy in J kmol-1 + * @return returns the species standard state enthalpy in J kmol-1 */ doublereal enthalpy_mole2() const; #endif @@ -326,7 +326,7 @@ private: //! Translate a Gibbs free energy of formation value to a NIST-based Chemical potential /*! * Internally, this function is used to translate the input value, - * m_deltaG_formation_tr_pr, to the internally stored value, m_Mu0_tr_pr. + * m_deltaG_formation_tr_pr, to the internally stored value, m_Mu0_tr_pr. */ void convertDGFormation(); diff --git a/include/cantera/thermo/PDSS_IonsFromNeutral.h b/include/cantera/thermo/PDSS_IonsFromNeutral.h index ee9d86ce8..3192db725 100644 --- a/include/cantera/thermo/PDSS_IonsFromNeutral.h +++ b/include/cantera/thermo/PDSS_IonsFromNeutral.h @@ -102,7 +102,7 @@ public: * \f] * * m is the neutral molecule species index. \f$ \alpha_{m , k} \f$ is the stoiciometric - * coefficient for the neutral molecule, m, that creates the thermodynamics for the ionic species k. + * coefficient for the neutral molecule, m, that creates the thermodynamics for the ionic species k. * A factor \f$ 2.0 \ln{2.0} \f$ is added to all ions except for the species ionic species, which in this * case is the single anion species, with species index sp. */ diff --git a/include/cantera/thermo/PDSS_SSVol.h b/include/cantera/thermo/PDSS_SSVol.h index 91a98289a..1b0a53247 100644 --- a/include/cantera/thermo/PDSS_SSVol.h +++ b/include/cantera/thermo/PDSS_SSVol.h @@ -304,7 +304,7 @@ private: private: //! Enumerated data type describing the type of volume model //! used to calculate the standard state volume of the species - SSVolume_Model_enumType volumeModel_; + SSVolume_Model_enumType volumeModel_; //! Value of the constant molar volume for the species /*! diff --git a/include/cantera/thermo/PDSS_Water.h b/include/cantera/thermo/PDSS_Water.h index deaa9c43c..90011654a 100644 --- a/include/cantera/thermo/PDSS_Water.h +++ b/include/cantera/thermo/PDSS_Water.h @@ -113,7 +113,7 @@ public: //! Duplication routine for objects which inherit from PDSS /*! - * This virtual routine can be used to duplicate PDSS objects + * This virtual routine can be used to duplicate PDSS objects * inherited from PDSS even if the application only has * a pointer to PDSS to work with. * @@ -186,7 +186,7 @@ public: */ virtual doublereal dthermalExpansionCoeffdT() const; - //! Returns the isothermal compressibility. Units: 1/Pa. + //! Returns the isothermal compressibility. Units: 1/Pa. /*! * The isothermal compressibility is defined as * \f[ diff --git a/include/cantera/thermo/Phase.h b/include/cantera/thermo/Phase.h index de690d06b..4226399da 100644 --- a/include/cantera/thermo/Phase.h +++ b/include/cantera/thermo/Phase.h @@ -232,7 +232,7 @@ public: //! @param m element index doublereal nAtoms(size_t k, size_t m) const; - //! Get a vector containing the atomic composition of species k + //! Get a vector containing the atomic composition of species k //! @param k species index //! @param atomArray vector containing the atomic number in the species. //! Length: m_mm diff --git a/include/cantera/thermo/PhaseCombo_Interaction.h b/include/cantera/thermo/PhaseCombo_Interaction.h index f79ef1442..8c172968a 100644 --- a/include/cantera/thermo/PhaseCombo_Interaction.h +++ b/include/cantera/thermo/PhaseCombo_Interaction.h @@ -370,7 +370,7 @@ public: */ PhaseCombo_Interaction& operator=(const PhaseCombo_Interaction& b); - //! Duplication routine for objects which inherit from ThermoPhase. + //! 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 @@ -618,7 +618,7 @@ public: */ virtual void getdlnActCoeffdlnX_diag(doublereal* dlnActCoeffdlnX_diag) const; - //! Get the array of derivatives of the log activity coefficients wrt mole numbers - diagonal only + //! Get the array of derivatives of the log activity coefficients wrt mole numbers - diagonal only /*! * This function is a virtual method. For ideal mixtures * (unity activity coefficients), this can return zero. @@ -714,7 +714,7 @@ private: */ void s_update_dlnActCoeff_dlnN_diag() const; - //! Update the derivative of the log of the activity coefficients wrt log(moles_m) + //! Update the derivative of the log of the activity coefficients wrt log(moles_m) /*! * This function will be called to update the internally stored * derivative of the natural logarithm of the activity coefficients diff --git a/include/cantera/thermo/PureFluidPhase.h b/include/cantera/thermo/PureFluidPhase.h index b3033df41..a3ca910dc 100644 --- a/include/cantera/thermo/PureFluidPhase.h +++ b/include/cantera/thermo/PureFluidPhase.h @@ -252,7 +252,7 @@ public: //! Get the nondimensional Enthalpy functions for the species //! at their standard states at the current T and P of the solution. /*! - * @param hrt Output vector of nondimensional standard state enthalpies. + * @param hrt Output vector of nondimensional standard state enthalpies. * Length: m_kk. */ virtual void getEnthalpy_RT(doublereal* hrt) const; @@ -260,7 +260,7 @@ public: //! Get the array of nondimensional Entropy functions for the //! standard state species at the current T and P of the solution. /*! - * @param sr Output vector of nondimensional standard state entropies. + * @param sr Output vector of nondimensional standard state entropies. * Length: m_kk. */ virtual void getEntropy_R(doublereal* sr) const; diff --git a/include/cantera/thermo/RedlichKisterVPSSTP.h b/include/cantera/thermo/RedlichKisterVPSSTP.h index b17d5e8dc..ab76821cf 100644 --- a/include/cantera/thermo/RedlichKisterVPSSTP.h +++ b/include/cantera/thermo/RedlichKisterVPSSTP.h @@ -39,7 +39,7 @@ namespace Cantera * The independent unknowns are pressure, temperature, and mass fraction. * * Several concepts are introduced. The first concept is there are temporary - * variables for holding the species standard state values of Cp, H, S, G, and V at the + * variables for holding the species standard state values of Cp, H, S, G, and V at the * last temperature and pressure called. These functions are not recalculated * if a new call is made using the previous temperature and pressure. Currently, * these variables and the calculation method are handled by the VPSSMgr class, @@ -136,7 +136,7 @@ namespace Cantera * \tilde{h}_k(T,P) = h^o_k(T,P) - R T^2 \frac{d \ln(\gamma_k)}{dT} * \f] * - * The partial molar volume for species k is + * The partial molar volume for species k is * * \f[ * \tilde V_k(T,P) = V^o_k(T,P) + R T \frac{d \ln(\gamma_k) }{dP} @@ -528,7 +528,7 @@ public: */ virtual void getdlnActCoeffdlnX_diag(doublereal* dlnActCoeffdlnX_diag) const; - //! Get the array of derivatives of the log activity coefficients wrt mole numbers - diagonal only + //! Get the array of derivatives of the log activity coefficients wrt mole numbers - diagonal only /*! * This function is a virtual method. For ideal mixtures * (unity activity coefficients), this can return zero. @@ -563,7 +563,7 @@ public: * @param dlnActCoeffdlnN Output vector of derivatives of the * log Activity Coefficients. length = m_kk * m_kk */ - virtual void getdlnActCoeffdlnN(const size_t ld, doublereal* const dlnActCoeffdlnN) ; + virtual void getdlnActCoeffdlnN(const size_t ld, doublereal* const dlnActCoeffdlnN); //@} @@ -624,7 +624,7 @@ public: * @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 */ - void Vint(double& VintOut, double& voltsOut) ; + void Vint(double& VintOut, double& voltsOut); #endif protected: @@ -654,7 +654,7 @@ protected: //! Entropy term for the binary mole fraction interaction of the //! excess Gibbs free energy expression - mutable std::vector< vector_fp> m_SE_m_ij; + mutable std::vector< vector_fp> m_SE_m_ij; //! form of the RedlichKister interaction expression /*! diff --git a/include/cantera/thermo/RedlichKwongMFTP.h b/include/cantera/thermo/RedlichKwongMFTP.h index 26c88ca7b..d0dbc05bb 100644 --- a/include/cantera/thermo/RedlichKwongMFTP.h +++ b/include/cantera/thermo/RedlichKwongMFTP.h @@ -111,7 +111,7 @@ public: /*! * Since the mass density, temperature, and mass fractions are stored, * this method uses these values to implement the - * mechanical equation of state \f$ P(T, \rho, Y_1, \dots, Y_K) \f$. + * mechanical equation of state \f$ P(T, \rho, Y_1, \dots, Y_K) \f$. * * \f[ * P = \frac{RT}{v-b_{mix}} - \frac{a_{mix}}{T^{0.5} v \left( v + b_{mix} \right) } @@ -224,7 +224,7 @@ public: //! Returns the standard concentration \f$ C^0_k \f$, which is used to normalize //! the generalized concentration. /*! - * This is defined as the concentration by which the generalized + * This is defined as the concentration by which the generalized * concentration is normalized to produce the activity. * In many cases, this quantity will be the same for all species in a phase. * Since the activity for an ideal gas mixture is @@ -261,7 +261,7 @@ public: * getChemPotentials() and then dividing by RT. No need for child * classes to handle. * - * @param mu Output vector of non-dimensional species chemical potentials + * @param mu Output vector of non-dimensional species chemical potentials * Length: m_kk. */ void getChemPotentials_RT(doublereal* mu) const; @@ -602,7 +602,7 @@ protected: vector_fp a_vec_Curr_; vector_fp b_vec_Curr_; - Array2D a_coeff_vec; + Array2D a_coeff_vec; vector_fp m_pc_Species; vector_fp m_tc_Species; diff --git a/include/cantera/thermo/SemiconductorPhase.h b/include/cantera/thermo/SemiconductorPhase.h index 37fd3895a..c3c2c58e2 100644 --- a/include/cantera/thermo/SemiconductorPhase.h +++ b/include/cantera/thermo/SemiconductorPhase.h @@ -57,7 +57,7 @@ public: virtual void setPressure(doublereal pres) { m_press = pres; } - virtual doublereal pressure() const { + virtual doublereal pressure() const { return m_press; } diff --git a/include/cantera/thermo/ShomatePoly.h b/include/cantera/thermo/ShomatePoly.h index 2fc91f3bc..cdd205377 100644 --- a/include/cantera/thermo/ShomatePoly.h +++ b/include/cantera/thermo/ShomatePoly.h @@ -103,7 +103,7 @@ public: //! Update the properties for this species, given a temperature polynomial /*! * This method is called with a pointer to an array containing the - * functions of temperature needed by this parameterization, and three + * functions of temperature needed by this parameterization, and three * pointers to arrays where the computed property values should be * written. This method updates only one value in each array. * @@ -123,13 +123,13 @@ public: virtual void updateProperties(const doublereal* tt, doublereal* cp_R, doublereal* h_RT, doublereal* s_R) const { - doublereal A = m_coeff[0]; - doublereal Bt = m_coeff[1]*tt[0]; - doublereal Ct2 = m_coeff[2]*tt[1]; - doublereal Dt3 = m_coeff[3]*tt[2]; - doublereal Etm2 = m_coeff[4]*tt[3]; - doublereal Ftm1 = m_coeff[5]*tt[5]; - doublereal G = m_coeff[6]; + doublereal A = m_coeff[0]; + doublereal Bt = m_coeff[1]*tt[0]; + doublereal Ct2 = m_coeff[2]*tt[1]; + doublereal Dt3 = m_coeff[3]*tt[2]; + doublereal Etm2 = m_coeff[4]*tt[3]; + doublereal Ftm1 = m_coeff[5]*tt[5]; + doublereal G = m_coeff[6]; *cp_R = A + Bt + Ct2 + Dt3 + Etm2; *h_RT = A + 0.5*Bt + 1.0/3.0*Ct2 + 0.25*Dt3 - Etm2 + Ftm1; @@ -316,7 +316,7 @@ public: virtual void modifyParameters(doublereal* coeffs) { std::copy(coeffs, coeffs + 15, m_coeff.begin()); m_midT = coeffs[0]; - msp_low = ShomatePoly(m_lowT, m_midT, m_Pref, coeffs+1); + msp_low = ShomatePoly(m_lowT, m_midT, m_Pref, coeffs+1); msp_high = ShomatePoly(m_midT, m_highT, m_Pref, coeffs+8); } @@ -339,7 +339,7 @@ public: double h = msp_low.reportHf298(0); double hnew = h + delH; msp_low.modifyOneHf298(k, hnew); - h = msp_high.reportHf298(0); + h = msp_high.reportHf298(0); hnew = h + delH; msp_high.modifyOneHf298(k, hnew); } diff --git a/include/cantera/thermo/SingleSpeciesTP.h b/include/cantera/thermo/SingleSpeciesTP.h index f515006d3..a11ec4973 100644 --- a/include/cantera/thermo/SingleSpeciesTP.h +++ b/include/cantera/thermo/SingleSpeciesTP.h @@ -72,7 +72,7 @@ public: /*! * @param right Object to be copied */ - SingleSpeciesTP(const SingleSpeciesTP& right); + SingleSpeciesTP(const SingleSpeciesTP& right); //! Assignment operator /*! @@ -189,10 +189,10 @@ public: //@} /// @name Partial Molar Properties of the Solution /// - /// These functions are resolved at this level, by reference - /// to the partial molar functions and standard state - /// functions for species 0. Derived classes don't need - /// to supply entries for these functions. + /// These functions are resolved at this level, by reference + /// to the partial molar functions and standard state + /// functions for species 0. Derived classes don't need + /// to supply entries for these functions. //@{ //! Get the array of non-dimensional species chemical potentials @@ -224,7 +224,7 @@ public: * This method adds a term \f$ Fz_k \phi_k \f$ to * each chemical potential. * - * This is resolved here. A single species phase + * This is resolved here. A single species phase * is not allowed to have anything other than a zero charge. * * @param mu On return, Contains the electrochemical potential of the single species @@ -356,7 +356,7 @@ public: * @param g Output vector containing the reference state * Gibbs Free energies. Length: m_kk. Units: J/kmol. */ - virtual void getGibbs_ref(doublereal* g) const; + virtual void getGibbs_ref(doublereal* g) const; /*! * Returns the vector of nondimensional @@ -481,11 +481,11 @@ protected: doublereal m_p0; //! Dimensionless enthalpy at the (mtlast, m_p0) - mutable vector_fp m_h0_RT; + mutable vector_fp m_h0_RT; //! Dimensionless heat capacity at the (mtlast, m_p0) - mutable vector_fp m_cp0_R; + mutable vector_fp m_cp0_R; //! Dimensionless entropy at the (mtlast, m_p0) - mutable vector_fp m_s0_R; + mutable vector_fp m_s0_R; /** * @internal diff --git a/include/cantera/thermo/SpeciesThermo.h b/include/cantera/thermo/SpeciesThermo.h index f36b19194..0668595a9 100644 --- a/include/cantera/thermo/SpeciesThermo.h +++ b/include/cantera/thermo/SpeciesThermo.h @@ -86,7 +86,7 @@ class SpeciesThermoInterpType; * The following classes inherit from SpeciesThermoInterpType. * * - NasaPoly1 in file NasaPoly1.h - * - This is a one zone model, consisting of a 7 + * - This is a one zone model, consisting of a 7 * coefficient NASA Polynomial format. * - NasaPoly2 in file NasaPoly2.h * - This is a two zone model, with each zone consisting of a 7 @@ -104,7 +104,7 @@ class SpeciesThermoInterpType; * at a set number of temperatures. Between each temperature * the heat capacity is treated as a constant. * - Nasa9Poly1 in file Nasa9Poly1.h - * - This is a one zone model, consisting of the 9 + * - This is a one zone model, consisting of the 9 * coefficient NASA Polynomial format. * - Nasa9PolyMultiTempRegion in file Nasa9PolyMultiTempRegion.h * - This is a multiple zone model, consisting of the 9 diff --git a/include/cantera/thermo/SpeciesThermoInterpType.h b/include/cantera/thermo/SpeciesThermoInterpType.h index 01cf6d2d9..db9823e44 100644 --- a/include/cantera/thermo/SpeciesThermoInterpType.h +++ b/include/cantera/thermo/SpeciesThermoInterpType.h @@ -76,7 +76,7 @@ class VPSSMgr; * The following classes inherit from SpeciesThermoInterpType. * * - NasaPoly1 in file NasaPoly1.h - * - This is a one zone model, consisting of a 7 + * - This is a one zone model, consisting of a 7 * coefficient NASA Polynomial format. * . * - NasaPoly2 in file NasaPoly2.h @@ -100,7 +100,7 @@ class VPSSMgr; * the heat capacity is treated as a constant. * . * - Nasa9Poly1 in file Nasa9Poly1.h - * - This is a one zone model, consisting of the 9 + * - This is a one zone model, consisting of the 9 * coefficient NASA Polynomial format. * . * - Nasa9PolyMultiTempRegion in file Nasa9PolyMultiTempRegion.h @@ -119,7 +119,7 @@ class VPSSMgr; * \link SpeciesThermoInterpType::updatePropertiesTemp() updatePropertiesTemp()\endlink. * The function calculates the values of Cp, H, and S for the specific * species pertaining to this class. It takes as its arguments the - * base pointer for the vector of Cp, H, and S values for all species + * base pointer for the vector of Cp, H, and S values for all species * in the phase. The offset for the species is known within the * object. * @@ -150,7 +150,7 @@ class VPSSMgr; * * @code * SpeciesThermoInterpType(int index, doublereal tlow, doublereal thigh, - * doublereal pref, const doublereal* coeffs) + * doublereal pref, const doublereal* coeffs) * @endcode * * @ingroup spthermo @@ -205,7 +205,7 @@ public: //! Update the properties for this species, given a temperature polynomial /*! * This method is called with a pointer to an array containing the functions - * of temperature needed by this parameterization, and three pointers to + * of temperature needed by this parameterization, and three pointers to * arrays where the computed property values should be written. This method * updates only one value in each array. * @@ -272,7 +272,7 @@ public: * the standard state of the species from its constituent elements in * their standard states at 298 K and 1 bar. * - * @param h298 If this is nonnull, the current value of the Heat of + * @param h298 If this is nonnull, the current value of the Heat of * Formation at 298K and 1 bar for species m_speciesIndex is * returned in h298[m_speciesIndex]. * @return Returns the current value of the Heat of Formation at 298K diff --git a/include/cantera/thermo/StoichSubstance.h b/include/cantera/thermo/StoichSubstance.h index 315649f94..03f17fc70 100644 --- a/include/cantera/thermo/StoichSubstance.h +++ b/include/cantera/thermo/StoichSubstance.h @@ -251,7 +251,7 @@ public: //! state of the species at the current T and P of the solution /*! * Units are Joules/kmol - * @param gpure Output vector of standard state Gibbs free energies + * @param gpure Output vector of standard state Gibbs free energies * Length: m_kk. */ virtual void getPureGibbs(doublereal* gpure) const; @@ -307,7 +307,7 @@ public: * Gibbs free energy, calculated from enthalpy and the * entropy, and the multiplying by RT. */ - virtual void getGibbs_ref(doublereal* g) const; + virtual void getGibbs_ref(doublereal* g) const; /** * Returns the vector of nondimensional @@ -344,9 +344,9 @@ protected: doublereal m_press; doublereal m_p0; - mutable vector_fp m_h0_RT; - mutable vector_fp m_cp0_R; - mutable vector_fp m_s0_R; + mutable vector_fp m_h0_RT; + mutable vector_fp m_cp0_R; + mutable vector_fp m_s0_R; private: void _updateThermo() const; diff --git a/include/cantera/thermo/StoichSubstanceSSTP.h b/include/cantera/thermo/StoichSubstanceSSTP.h index 7a6d73ac0..c50a3c1bf 100644 --- a/include/cantera/thermo/StoichSubstanceSSTP.h +++ b/include/cantera/thermo/StoichSubstanceSSTP.h @@ -83,7 +83,7 @@ namespace Cantera * R_s = k_s C_{gas} * \f] * where the units for \f$ R_s \f$ are kmol m-2 s-1. \f$ C_{gas} \f$ has units - * of kmol m-3. Therefore, the kinetic rate constant, \f$ k_s \f$, has + * of kmol m-3. Therefore, the kinetic rate constant, \f$ k_s \f$, has * units of m s-1. Nowhere does the concentration of the bulk phase * appear in the rate constant expression, since it's a stoichiometric * phase and the activity is always equal to 1.0. @@ -181,7 +181,7 @@ public: /*! * @param right Object to be copied */ - StoichSubstanceSSTP(const StoichSubstanceSSTP& right); + StoichSubstanceSSTP(const StoichSubstanceSSTP& right); //! Assignment operator /*! @@ -244,7 +244,7 @@ public: * \beta = \frac{1}{v}\left(\frac{\partial v}{\partial T}\right)_P * \f] */ - virtual doublereal thermalExpansionCoeff() const ; + virtual doublereal thermalExpansionCoeff() const; /** * @} @@ -349,7 +349,7 @@ public: */ virtual void getCp_R(doublereal* cpr) const; - //! Returns the vector of nondimensional Internal Energies of the standard + //! Returns the vector of nondimensional Internal Energies of the standard //! state species at the current T and P of the solution /*! * For an incompressible, diff --git a/include/cantera/thermo/SurfPhase.h b/include/cantera/thermo/SurfPhase.h index 6b4b36cd0..2f223e2d7 100644 --- a/include/cantera/thermo/SurfPhase.h +++ b/include/cantera/thermo/SurfPhase.h @@ -298,7 +298,7 @@ public: //! Return a vector of activity concentrations for each species /*! - * For this phase the activity concentrations,\f$ C^a_k \f$, are defined to be + * For this phase the activity concentrations,\f$ C^a_k \f$, are defined to be * equal to the actual concentrations, \f$ C^s_k \f$. * Activity concentrations are * @@ -428,7 +428,7 @@ public: //! Get the nondimensional Enthalpy functions for the species standard states //! at their standard states at the current T and P of the solution. /*! - * @param hrt Output vector of nondimensional standard state enthalpies. + * @param hrt Output vector of nondimensional standard state enthalpies. * Length: m_kk. */ virtual void getEnthalpy_RT(doublereal* hrt) const; @@ -436,7 +436,7 @@ public: //! Get the array of nondimensional Entropy functions for the //! species standard states at the current T and P of the solution. /*! - * @param sr Output vector of nondimensional standard state entropies. + * @param sr Output vector of nondimensional standard state entropies. * Length: m_kk. */ virtual void getEntropy_R(doublereal* sr) const; @@ -489,7 +489,7 @@ public: //! enthalpies of the reference state at the current temperature //! of the solution and the reference pressure for the species. /*! - * @param hrt Output vector of nondimensional standard state enthalpies. + * @param hrt Output vector of nondimensional standard state enthalpies. * Length: m_kk. */ virtual void getEnthalpy_RT_ref(doublereal* hrt) const; @@ -545,9 +545,9 @@ public: */ void setCoveragesNoNorm(const doublereal* theta); - //! Set the coverages from a string of colon-separated name:value pairs. + //! Set the coverages from a string of colon-separated name:value pairs. /*! - * @param cov String containing colon-separated name:value pairs + * @param cov String containing colon-separated name:value pairs */ void setCoveragesByName(const std::string& cov); @@ -574,26 +574,26 @@ protected: doublereal m_press; //! Temporary storage for the reference state enthalpies - mutable vector_fp m_h0; + mutable vector_fp m_h0; //! Temporary storage for the reference state entropies - mutable vector_fp m_s0; + mutable vector_fp m_s0; //! Temporary storage for the reference state heat capacities - mutable vector_fp m_cp0; + mutable vector_fp m_cp0; //! Temporary storage for the reference state Gibbs energies - mutable vector_fp m_mu0; + mutable vector_fp m_mu0; //! Temporary work array - mutable vector_fp m_work; + mutable vector_fp m_work; //! vector storing the log of the size of each species. /*! * The size of each species is defined as the number of surface * sites each species occupies. */ - mutable vector_fp m_logsize; + mutable vector_fp m_logsize; private: //! Update the species reference state thermodynamic functions diff --git a/include/cantera/thermo/ThermoPhase.h b/include/cantera/thermo/ThermoPhase.h index cd287dd23..618f93afc 100644 --- a/include/cantera/thermo/ThermoPhase.h +++ b/include/cantera/thermo/ThermoPhase.h @@ -21,9 +21,9 @@ namespace Cantera */ //@{ //! Standard state uses the molar convention -const int cAC_CONVENTION_MOLAR = 0; +const int cAC_CONVENTION_MOLAR = 0; //! Standard state uses the molality convention -const int cAC_CONVENTION_MOLALITY = 1; +const int cAC_CONVENTION_MOLALITY = 1; //@} /*! @@ -213,7 +213,7 @@ public: * Some phases must have zero net charge in order for their thermodynamics functions to be valid. * If this is so, then the value returned from this function is true. * If this is not the case, then this is false. Now, ideal gases have this parameter set to false, - * while solution with molality-based activity coefficients have this parameter set to true. + * while solution with molality-based activity coefficients have this parameter set to true. */ bool chargeNeutralityNecessary() const { return m_chargeNeutralityNecessary; @@ -269,7 +269,7 @@ public: throw NotImplementedError("ThermoPhase::pressure"); } - //! Returns the isothermal compressibility. Units: 1/Pa. + //! Returns the isothermal compressibility. Units: 1/Pa. /*! * The isothermal compressibility is defined as * \f[ @@ -334,7 +334,7 @@ public: * to the chemical potential by \f[ \mu_k = \mu_k^0(T,P) + * \hat R T \log a_k. \f] The quantity \f$\mu_k^0(T,P)\f$ is * the standard chemical potential at unit activity, - * which depends on temperature and pressure, + * which depends on temperature and pressure, * but not on composition. The activity is dimensionless. * @{ */ @@ -577,7 +577,7 @@ public: throw NotImplementedError("ThermoPhase::getdPartialMolarVolumes_dT"); } - //! Return an array of derivatives of partial molar volumes wrt pressure for the + //! Return an array of derivatives of partial molar volumes wrt pressure for the //! species in the mixture. Units: m^3/kmol. /*! * The derivative is at constant temperature @@ -610,7 +610,7 @@ public: //! Get the nondimensional Enthalpy functions for the species //! at their standard states at the current T and P of the solution. /*! - * @param hrt Output vector of nondimensional standard state enthalpies. + * @param hrt Output vector of nondimensional standard state enthalpies. * Length: m_kk. */ virtual void getEnthalpy_RT(doublereal* hrt) const { @@ -620,7 +620,7 @@ public: //! Get the array of nondimensional Entropy functions for the //! standard state species at the current T and P of the solution. /*! - * @param sr Output vector of nondimensional standard state entropies. + * @param sr Output vector of nondimensional standard state entropies. * Length: m_kk. */ virtual void getEntropy_R(doublereal* sr) const { @@ -648,7 +648,7 @@ public: throw NotImplementedError("ThermoPhase::getPureGibbs"); } - //! Returns the vector of nondimensional Internal Energies of the standard + //! Returns the vector of nondimensional Internal Energies of the standard //! state species at the current T and P of the solution /*! * @param urt output vector of nondimensional standard state internal energies @@ -743,7 +743,7 @@ public: /*! * units = J/kmol * - * @param g Output vector containing the reference state + * @param g Output vector containing the reference state * Gibbs Free energies. Length: m_kk. Units: J/kmol. */ virtual void getGibbs_ref(doublereal* g) const { @@ -1063,7 +1063,7 @@ public: * @param rho Density (kg/m^3) * @param p Pressure (Pa) */ - virtual void setState_RP(doublereal rho, doublereal p){ + virtual void setState_RP(doublereal rho, doublereal p) { throw NotImplementedError("ThermoPhase::setState_RP"); } @@ -1411,7 +1411,7 @@ public: virtual void initThermoFile(const std::string& inputFile, const std::string& id); - //!Import and initialize a ThermoPhase object using an XML tree. + //!Import and initialize a ThermoPhase object using an XML tree. /*! * @internal * @@ -1462,7 +1462,7 @@ public: //! Add in species from Slave phases /*! - * This hook is used for cSS_CONVENTION_SLAVE phases + * This hook is used for cSS_CONVENTION_SLAVE phases * * @param phaseNode XML Element for the phase */ diff --git a/include/cantera/thermo/VPSSMgr.h b/include/cantera/thermo/VPSSMgr.h index b896788d4..5662a8640 100644 --- a/include/cantera/thermo/VPSSMgr.h +++ b/include/cantera/thermo/VPSSMgr.h @@ -330,7 +330,7 @@ public: //! Get the nondimensional Heat Capacities at constant pressure for the //! standard state of the species at the current T and P. /*! - * This is redefined here to call the internal function, _updateStandardStateThermo(), + * This is redefined here to call the internal function, _updateStandardStateThermo(), * which calculates all standard state properties at the same time. * * @param cpr Output vector containing the the nondimensional Heat @@ -396,7 +396,7 @@ public: * of the reference state of the species * length = m_kk, units = dimensionless. */ - virtual void getGibbs_RT_ref(doublereal* grt) const ; + virtual void getGibbs_RT_ref(doublereal* grt) const; //! Return a reference to the vector of Gibbs free energies of the species @@ -413,7 +413,7 @@ public: * of the reference state of the species * length = m_kk, units = J/kmol. */ - virtual void getGibbs_ref(doublereal* g) const ; + virtual void getGibbs_ref(doublereal* g) const; /*! * Returns the vector of nondimensional entropies of the reference state @@ -424,7 +424,7 @@ public: * of the species in their reference states * length: m_kk, units: dimensionless. */ - virtual void getEntropy_R_ref(doublereal* er) const ; + virtual void getEntropy_R_ref(doublereal* er) const; /*! * Returns the vector of nondimensional constant pressure heat capacities @@ -435,7 +435,7 @@ public: * of the species in their reference states * length: m_kk, units: dimensionless. */ - virtual void getCp_R_ref(doublereal* cpr) const ; + virtual void getCp_R_ref(doublereal* cpr) const; //! Get the molar volumes of the species reference states at the current //! *T* and *P_ref* of the solution. @@ -445,7 +445,7 @@ public: * @param vol Output vector containing the standard state volumes. * Length: m_kk. */ - virtual void getStandardVolumes_ref(doublereal* vol) const ; + virtual void getStandardVolumes_ref(doublereal* vol) const; //@} /*! @name Setting the Internal State of the System @@ -535,7 +535,7 @@ protected: * functions for all of the species must be recalculated. * * This function is responsible for updating the following internal members, - * when m_useTmpStandardStateStorage is true. + * when m_useTmpStandardStateStorage is true. * * - m_hss_RT; * - m_cpss_R; @@ -576,7 +576,7 @@ public: /*! * @param index Species index */ - virtual PDSS_enumType reportPDSSType(int index = -1) const ; + virtual PDSS_enumType reportPDSSType(int index = -1) const; //! This utility function reports the type of manager //! for the calculation of ss properties @@ -584,7 +584,7 @@ public: * @return Returns an enum type called VPSSMgr_enumType, which is a list * of the known VPSSMgr objects */ - virtual VPSSMgr_enumType reportVPSSMgrType() const ; + virtual VPSSMgr_enumType reportVPSSMgrType() const; //! Minimum temperature. /*! @@ -595,7 +595,7 @@ public: * * @param k Species index */ - virtual doublereal minTemp(size_t k=npos) const ; + virtual doublereal minTemp(size_t k=npos) const; //! Maximum temperature. /*! @@ -619,7 +619,7 @@ public: * @param k Species index. Default is -1, which returns * the generic answer. */ - virtual doublereal refPressure(size_t k=npos) const ; + virtual doublereal refPressure(size_t k=npos) const; //@} /*! @name Initialization Methods - For Internal use @@ -674,7 +674,7 @@ public: * @param phaseNode_ptr Pointer to the XML Node corresponding * to the phase which owns the species */ - void installSTSpecies(size_t k, const XML_Node& speciesNode, + void installSTSpecies(size_t k, const XML_Node& speciesNode, const XML_Node* phaseNode_ptr); //! Install specific content for species k in the standard-state @@ -719,11 +719,11 @@ protected: //! The last temperature at which the standard state thermodynamic //! properties were calculated at. - mutable doublereal m_tlast; + mutable doublereal m_tlast; //! The last pressure at which the Standard State thermodynamic //! properties were calculated at. - mutable doublereal m_plast; + mutable doublereal m_plast; /*! * Reference pressure (Pa) must be the same for all species @@ -747,28 +747,28 @@ protected: * Vector containing the species reference enthalpies at T = m_tlast * and P = p_ref. */ - mutable vector_fp m_h0_RT; + mutable vector_fp m_h0_RT; /** * Vector containing the species reference constant pressure * heat capacities at T = m_tlast and P = p_ref. */ - mutable vector_fp m_cp0_R; + mutable vector_fp m_cp0_R; /** * Vector containing the species reference Gibbs functions - * at T = m_tlast and P = p_ref. + * at T = m_tlast and P = p_ref. */ - mutable vector_fp m_g0_RT; + mutable vector_fp m_g0_RT; /** * Vector containing the species reference entropies * at T = m_tlast and P = p_ref. */ - mutable vector_fp m_s0_R; + mutable vector_fp m_s0_R; //! Vector containing the species reference molar volumes - mutable vector_fp m_V0; + mutable vector_fp m_V0; /*! * boolean indicating whether temporary standard state storage is used @@ -780,101 +780,101 @@ protected: * Vector containing the species Standard State enthalpies at T = m_tlast * and P = m_plast. */ - mutable vector_fp m_hss_RT; + mutable vector_fp m_hss_RT; /** * Vector containing the species Standard State constant pressure * heat capacities at T = m_tlast and P = m_plast. */ - mutable vector_fp m_cpss_R; + mutable vector_fp m_cpss_R; /** * Vector containing the species Standard State Gibbs functions * at T = m_tlast and P = m_plast. */ - mutable vector_fp m_gss_RT; + mutable vector_fp m_gss_RT; /** * Vector containing the species Standard State entropies * at T = m_tlast and P = m_plast. */ - mutable vector_fp m_sss_R; + mutable vector_fp m_sss_R; /** * Vector containing the species standard state volumes * at T = m_tlast and P = m_plast */ - mutable vector_fp m_Vss; + mutable vector_fp m_Vss; //! species reference enthalpies - used by individual PDSS objects /*! * Vector containing the species reference enthalpies at T = m_tlast * and P = p_ref. */ - mutable vector_fp mPDSS_h0_RT; + mutable vector_fp mPDSS_h0_RT; //! species reference heat capacities - used by individual PDSS objects /** * Vector containing the species reference constant pressure * heat capacities at T = m_tlast and P = p_ref. */ - mutable vector_fp mPDSS_cp0_R; + mutable vector_fp mPDSS_cp0_R; //! species reference Gibbs free energies - used by individual PDSS objects /** * Vector containing the species reference Gibbs functions - * at T = m_tlast and P = p_ref. + * at T = m_tlast and P = p_ref. */ - mutable vector_fp mPDSS_g0_RT; + mutable vector_fp mPDSS_g0_RT; //! species reference entropies - used by individual PDSS objects /** * Vector containing the species reference entropies * at T = m_tlast and P = p_ref. */ - mutable vector_fp mPDSS_s0_R; + mutable vector_fp mPDSS_s0_R; //! species reference state molar Volumes - used by individual PDSS objects /** * Vector containing the rf molar volumes * at T = m_tlast and P = p_ref. */ - mutable vector_fp mPDSS_V0; + mutable vector_fp mPDSS_V0; //! species standard state enthalpies - used by individual PDSS objects /*! * Vector containing the species standard state enthalpies at T = m_tlast * and P = p_ref. */ - mutable vector_fp mPDSS_hss_RT; + mutable vector_fp mPDSS_hss_RT; //! species standard state heat capacities - used by individual PDSS objects /** * Vector containing the species standard state constant pressure * heat capacities at T = m_tlast and P = p_ref. */ - mutable vector_fp mPDSS_cpss_R; + mutable vector_fp mPDSS_cpss_R; //! species standard state Gibbs free energies - used by individual PDSS objects /** * Vector containing the species standard state Gibbs functions - * at T = m_tlast and P = p_ref. + * at T = m_tlast and P = p_ref. */ - mutable vector_fp mPDSS_gss_RT; + mutable vector_fp mPDSS_gss_RT; //! species standard state entropies - used by individual PDSS objects /** * Vector containing the species standard state entropies * at T = m_tlast and P = p_ref. */ - mutable vector_fp mPDSS_sss_R; + mutable vector_fp mPDSS_sss_R; //! species standard state molar Volumes - used by individual PDSS objects /** * Vector containing the ss molar volumes * at T = m_tlast and P = p_ref. */ - mutable vector_fp mPDSS_Vss; + mutable vector_fp mPDSS_Vss; friend class PDSS; }; diff --git a/include/cantera/thermo/VPSSMgr_ConstVol.h b/include/cantera/thermo/VPSSMgr_ConstVol.h index 9ebbb0c2f..f3626f80b 100644 --- a/include/cantera/thermo/VPSSMgr_ConstVol.h +++ b/include/cantera/thermo/VPSSMgr_ConstVol.h @@ -31,7 +31,7 @@ class VPSSMgr_ConstVol : public VPSSMgr public: //! Constructor /*! - * @param vp_ptr Pointer to the owning VPStandardStateTP object + * @param vp_ptr Pointer to the owning VPStandardStateTP object * for the phase. It's a requirement that this be * already malloced. * @param spth Pointer to the SpeciesThermo object for the @@ -68,13 +68,13 @@ protected: * state values of Cp, H, S, and V at the last temperature and reference * pressure called. These functions are not recalculated if a new call is * made using the previous temperature. All calculations are done within - * the routine _updateRefStateThermo(). _updateRefStateThermo() is + * the routine _updateRefStateThermo(). _updateRefStateThermo() is * defined in the parent object. */ //@{ - virtual void getGibbs_RT_ref(doublereal* grt) const ; - virtual void getStandardVolumes_ref(doublereal* vol) const ; + virtual void getGibbs_RT_ref(doublereal* grt) const; + virtual void getStandardVolumes_ref(doublereal* vol) const; //@} /*! @name Initialization Methods - For Internal use @@ -111,8 +111,8 @@ public: const XML_Node* const phaseNode_ptr); //@} - virtual PDSS_enumType reportPDSSType(int index = -1) const ; - virtual VPSSMgr_enumType reportVPSSMgrType() const ; + 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 6eed63d57..9c2614810 100644 --- a/include/cantera/thermo/VPSSMgr_General.h +++ b/include/cantera/thermo/VPSSMgr_General.h @@ -35,7 +35,7 @@ class VPSSMgr_General : public VPSSMgr public: //! Constructor /*! - * @param vp_ptr Pointer to the owning VPStandardStateTP object for the + * @param vp_ptr Pointer to the owning VPStandardStateTP object for the * phase. It's a requirement that this be already malloced. * @param spth Pointer to the SpeciesThermo object for the phase. It's * a requirement that this be already malloced. @@ -73,7 +73,7 @@ protected: * the routine _updateRefStateThermo(). */ //@{ - virtual void getGibbs_ref(doublereal* g) const ; + virtual void getGibbs_ref(doublereal* g) const; //@} /*! @name Initialization Methods - For Internal use @@ -125,11 +125,11 @@ public: * @param phaseNode_ptr pointer to the phase XML node * @return Returns the pointer to the malloced PDSS object */ - virtual PDSS* createInstallPDSS(size_t k, const XML_Node& speciesNode, + 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 PDSS_enumType reportPDSSType(int index = -1) const; + virtual VPSSMgr_enumType reportVPSSMgrType() const; virtual void initAllPtrs(VPStandardStateTP* vp_ptr, SpeciesThermo* sp_ptr); private: diff --git a/include/cantera/thermo/VPSSMgr_IdealGas.h b/include/cantera/thermo/VPSSMgr_IdealGas.h index 298afa7e9..ae0af2338 100644 --- a/include/cantera/thermo/VPSSMgr_IdealGas.h +++ b/include/cantera/thermo/VPSSMgr_IdealGas.h @@ -74,8 +74,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 ; + virtual PDSS_enumType reportPDSSType(int index = -1) const; + virtual VPSSMgr_enumType reportVPSSMgrType() const; }; } diff --git a/include/cantera/thermo/VPSSMgr_Water_ConstVol.h b/include/cantera/thermo/VPSSMgr_Water_ConstVol.h index cbcfcb3df..596d35be0 100644 --- a/include/cantera/thermo/VPSSMgr_Water_ConstVol.h +++ b/include/cantera/thermo/VPSSMgr_Water_ConstVol.h @@ -70,11 +70,11 @@ public: //@{ virtual void getEnthalpy_RT_ref(doublereal* hrt) const; - virtual void getGibbs_RT_ref(doublereal* grt) const ; - virtual void getGibbs_ref(doublereal* g) const ; - virtual void getEntropy_R_ref(doublereal* er) const ; - virtual void getCp_R_ref(doublereal* cpr) const ; - virtual void getStandardVolumes_ref(doublereal* vol) const ; + virtual void getGibbs_RT_ref(doublereal* grt) const; + virtual void getGibbs_ref(doublereal* g) const; + virtual void getEntropy_R_ref(doublereal* er) const; + virtual void getCp_R_ref(doublereal* cpr) const; + virtual void getStandardVolumes_ref(doublereal* vol) const; //! @} /*! @name Initialization Methods - For Internal use @@ -91,8 +91,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 ; + virtual PDSS_enumType reportPDSSType(int index = -1) const; + virtual VPSSMgr_enumType reportVPSSMgrType() const; virtual void initAllPtrs(VPStandardStateTP* vp_ptr, SpeciesThermo* sp_ptr); private: diff --git a/include/cantera/thermo/VPSSMgr_Water_HKFT.h b/include/cantera/thermo/VPSSMgr_Water_HKFT.h index 5fa540ef9..9258eb5e9 100644 --- a/include/cantera/thermo/VPSSMgr_Water_HKFT.h +++ b/include/cantera/thermo/VPSSMgr_Water_HKFT.h @@ -55,11 +55,11 @@ public: //@{ virtual void getEnthalpy_RT_ref(doublereal* hrt) const; - virtual void getGibbs_RT_ref(doublereal* grt) const ; - virtual void getGibbs_ref(doublereal* g) const ; - virtual void getEntropy_R_ref(doublereal* er) const ; - virtual void getCp_R_ref(doublereal* cpr) const ; - virtual void getStandardVolumes_ref(doublereal* vol) const ; + virtual void getGibbs_RT_ref(doublereal* grt) const; + virtual void getGibbs_ref(doublereal* g) const; + virtual void getEntropy_R_ref(doublereal* er) const; + virtual void getCp_R_ref(doublereal* cpr) const; + virtual void getStandardVolumes_ref(doublereal* vol) const; //@} virtual void setState_TP(doublereal T, doublereal P); @@ -96,8 +96,8 @@ public: * various states and attributes */ //@{ - virtual PDSS_enumType reportPDSSType(int index = -1) const ; - virtual VPSSMgr_enumType reportVPSSMgrType() const ; + virtual PDSS_enumType reportPDSSType(int index = -1) const; + virtual VPSSMgr_enumType reportVPSSMgrType() const; //@} /*! @name Initialization Methods - For Internal use (VPStandardState) diff --git a/include/cantera/thermo/VPStandardStateTP.h b/include/cantera/thermo/VPStandardStateTP.h index c07d78505..3cbe89a3e 100644 --- a/include/cantera/thermo/VPStandardStateTP.h +++ b/include/cantera/thermo/VPStandardStateTP.h @@ -127,7 +127,7 @@ public: * getChemPotentials() and then dividing by RT. No need for child * classes to handle. * - * @param mu Output vector of non-dimensional species chemical potentials + * @param mu Output vector of non-dimensional species chemical potentials * Length: m_kk. */ void getChemPotentials_RT(doublereal* mu) const; @@ -213,7 +213,7 @@ public: * pressure for the standard state of the species * at the current T and P. * - * This is redefined here to call the internal function, _updateStandardStateThermo(), + * This is redefined here to call the internal function, _updateStandardStateThermo(), * which calculates all standard state properties at the same time. * * @param cpr Output vector containing the @@ -229,7 +229,7 @@ public: /*! * units = m^3 / kmol * - * This is redefined here to call the internal function, _updateStandardStateThermo(), + * This is redefined here to call the internal function, _updateStandardStateThermo(), * which calculates all standard state properties at the same time. * * @param vol Output vector of species volumes. length = m_kk. @@ -335,10 +335,10 @@ protected: * @internal * * If m_useTmpStandardStateStorage is true, - * this function must be called for every call to functions in this class. + * this function must be called for every call to functions in this class. * * This function is responsible for updating the following internal members, - * when m_useTmpStandardStateStorage is true. + * when m_useTmpStandardStateStorage is true. * * - m_hss_RT; * - m_cpss_R; @@ -360,7 +360,7 @@ public: * variables for holding the species reference-state values of Cp, H, S, and V at the * last temperature and reference pressure called. These functions are not recalculated * if a new call is made using the previous temperature. - * All calculations are done within the routine _updateRefStateThermo(). + * All calculations are done within the routine _updateRefStateThermo(). */ //@{ @@ -499,7 +499,7 @@ public: */ VPSSMgr* provideVPSSMgr(); - void createInstallPDSS(size_t k, const XML_Node& s, const XML_Node* phaseNode_ptr); + void createInstallPDSS(size_t k, const XML_Node& s, const XML_Node* phaseNode_ptr); PDSS* providePDSS(size_t k); const PDSS* providePDSS(size_t k) const; @@ -512,14 +512,14 @@ protected: * * units = Pascals */ - doublereal m_Pcurrent; + doublereal m_Pcurrent; //! The last temperature at which the standard statethermodynamic properties were calculated at. - mutable doublereal m_Tlast_ss; + mutable doublereal m_Tlast_ss; //! The last pressure at which the Standard State thermodynamic //! properties were calculated at. - mutable doublereal m_Plast_ss; + mutable doublereal m_Plast_ss; /*! * Reference pressure (Pa) must be the same for all species diff --git a/include/cantera/thermo/WaterProps.h b/include/cantera/thermo/WaterProps.h index 1f90d1fbc..558b247f2 100644 --- a/include/cantera/thermo/WaterProps.h +++ b/include/cantera/thermo/WaterProps.h @@ -167,7 +167,7 @@ public: * * value at 25C and 1 atm, relEps = 78.38 */ - doublereal relEpsilon(doublereal T, doublereal P_pascal, int ifunc = 0); + doublereal relEpsilon(doublereal T, doublereal P_pascal, int ifunc = 0); //! ADebye calculates the value of A_Debye as a function //! of temperature and pressure according to relations diff --git a/include/cantera/thermo/WaterPropsIAPWS.h b/include/cantera/thermo/WaterPropsIAPWS.h index 58ea8f339..ab7a6603d 100644 --- a/include/cantera/thermo/WaterPropsIAPWS.h +++ b/include/cantera/thermo/WaterPropsIAPWS.h @@ -24,16 +24,16 @@ namespace Cantera * * WATER_UNSTABLELIQUID indicates that we are in the unstable region, inside the * spinodal curve where dpdrho < 0.0 amonst other properties. The difference - * between WATER_UNSTABLELIQUID and WATER_UNSTABLEGAS is that + * between WATER_UNSTABLELIQUID and WATER_UNSTABLEGAS is that * for WATER_UNSTABLELIQUID d2pdrho2 > 0 and dpdrho < 0.0 * for WATER_UNSTABLEGAS d2pdrho2 < 0 and dpdrho < 0.0 */ //@{ -#define WATER_GAS 0 -#define WATER_LIQUID 1 +#define WATER_GAS 0 +#define WATER_LIQUID 1 #define WATER_SUPERCRIT 2 -#define WATER_UNSTABLELIQUID 3 -#define WATER_UNSTABLEGAS 4 +#define WATER_UNSTABLELIQUID 3 +#define WATER_UNSTABLEGAS 4 //@} //! Class for calculating the equation of state of water. @@ -185,14 +185,14 @@ public: //! using the last temperature and density doublereal Gibbs() const; - //! Calculate the enthalpy in mks units of J kmol-1 + //! Calculate the enthalpy in mks units of J kmol-1 //! using the last temperature and density doublereal enthalpy() const; //! Calculate the internal energy in mks units of J kmol-1 doublereal intEnergy() const; - //! Calculate the entropy in mks units of J kmol-1 K-1 + //! Calculate the entropy in mks units of J kmol-1 K-1 doublereal entropy() const; //! Calculate the constant volume heat capacity in mks units of J kmol-1 K-1 @@ -387,7 +387,7 @@ public: * - WATER_LIQUID below the critical temperature but above the critical density * - WATER_SUPERCRIT above the critical temperature */ - int phaseState(bool checkState = false) const ; + int phaseState(bool checkState = false) const; //! Returns the critical temperature of water (Kelvin) /*! diff --git a/include/cantera/thermo/WaterPropsIAPWSphi.h b/include/cantera/thermo/WaterPropsIAPWSphi.h index 85ecb3bfc..3331dbde5 100644 --- a/include/cantera/thermo/WaterPropsIAPWSphi.h +++ b/include/cantera/thermo/WaterPropsIAPWSphi.h @@ -72,10 +72,10 @@ public: doublereal phi_tt(doublereal tau, doublereal delta); //! Internal check # 1 - void check1(); + void check1(); //! Internal check # 2 - void check2(); + void check2(); //! Calculate the dimensionless pressure at tau and delta; /*! diff --git a/include/cantera/thermo/WaterSSTP.h b/include/cantera/thermo/WaterSSTP.h index 597083129..0cd769f39 100644 --- a/include/cantera/thermo/WaterSSTP.h +++ b/include/cantera/thermo/WaterSSTP.h @@ -1,6 +1,6 @@ /** * @file WaterSSTP.h - * Declares a ThermoPhase class consisting of pure water (see \ref thermoprops + * Declares a ThermoPhase class consisting of pure water (see \ref thermoprops * and class \link Cantera::WaterSSTP WaterSSTP\endlink). */ /* @@ -49,7 +49,7 @@ class WaterProps; * specified so that the following properties hold: * * - Delta_Hfo_idealgas(298.15) = -241.826 kJ/gmol - * - So_idealgas(298.15, 1bar) = 188.835 J/gmolK + * - So_idealgas(298.15, 1bar) = 188.835 J/gmolK * * (From http://webbook.nist.gov) * @@ -291,10 +291,10 @@ public: * current temperature of the solution and the reference pressure for the * species. units = J/kmol * - * @param g Output vector containing the reference state + * @param g Output vector containing the reference state * Gibbs Free energies. Length: m_kk. Units: J/kmol. */ - virtual void getGibbs_ref(doublereal* g) const; + virtual void getGibbs_ref(doublereal* g) const; /*! * Returns the vector of nondimensional @@ -370,7 +370,7 @@ public: */ virtual void setDensity(const doublereal dens); - //!Import and initialize a ThermoPhase object using an XML tree. + //!Import and initialize a ThermoPhase object using an XML tree. /*! * @internal * @@ -465,7 +465,7 @@ private: */ doublereal SW_Offset; - //! Boolean is true if object has been properly initialized for calculation + //! Boolean is true if object has been properly initialized for calculation bool m_ready; /** diff --git a/include/cantera/thermo/electrolytes.h b/include/cantera/thermo/electrolytes.h index ffaf7ad6c..fff931d0a 100644 --- a/include/cantera/thermo/electrolytes.h +++ b/include/cantera/thermo/electrolytes.h @@ -16,9 +16,9 @@ namespace Cantera /** * Electrolyte species type */ -const int cEST_solvent = 0; // Solvent species (neutral) -const int cEST_chargedSpecies = 1; // Charged species (charged) -const int cEST_weakAcidAssociated = 2; // Species which can break +const int cEST_solvent = 0; // Solvent species (neutral) +const int cEST_chargedSpecies = 1; // Charged species (charged) +const int cEST_weakAcidAssociated = 2; // Species which can break // apart into charged species. // It may or may not be charged. // These may or may not be @@ -29,8 +29,8 @@ const int cEST_strongAcidAssociated = 3; // Species which always breaks // It may or may not be charged. // Normally, these aren't included // in the speciation vector. -const int cEST_polarNeutral = 4; // Polar neutral species -const int cEST_nonpolarNeutral = 5; // Nonpolar neutral species. These +const int cEST_polarNeutral = 4; // Polar neutral species +const int cEST_nonpolarNeutral = 5; // Nonpolar neutral species. These // usually have activity coefficnt // corrections applied to them to // account for salting-out effects diff --git a/include/cantera/thermo/mix_defs.h b/include/cantera/thermo/mix_defs.h index cedf5818e..e224f3e52 100644 --- a/include/cantera/thermo/mix_defs.h +++ b/include/cantera/thermo/mix_defs.h @@ -34,13 +34,13 @@ const int cHarmonicOsc = 4; * not be able to initialize the class within its "factory" * routines. */ -const int cIdealGas = 1; // IdealGasPhase in IdealGasPhase.h -const int cIncompressible = 2; // ConstDensityThermo in ConstDensityThermo.h +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 cMetal = 4; // MetalPhase in MetalPhase.h const int cStoichSubstance = 5; // StoichSubstance.h const int cSemiconductor = 7; @@ -92,12 +92,12 @@ 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_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; +const int cVPSS_MolalSoln = 1060; //! Types of general formulations for the specification of the standard state volume enum SSVolume_Model_enumType { diff --git a/include/cantera/thermo/speciesThermoTypes.h b/include/cantera/thermo/speciesThermoTypes.h index 1c5d1c11a..65d55e5c6 100644 --- a/include/cantera/thermo/speciesThermoTypes.h +++ b/include/cantera/thermo/speciesThermoTypes.h @@ -47,15 +47,15 @@ //! 7 coefficient NASA Polynomials //! This is implemented in the class NasaPoly1 in NasaPoly1.h -#define NASA1 256 +#define NASA1 256 //! 9 coefficient NASA Polynomials //! This is implemented in the class Nasa9Poly1 in Nasa9Poly1.h -#define NASA9 512 +#define NASA9 512 //! 9 coefficient NASA Polynomials in multiple temperature regions //! This is implemented in the class Nasa9PolyMultiTempRegion in Nasa9Poly1MultiTempRegion -#define NASA9MULTITEMP 513 +#define NASA9MULTITEMP 513 //! Surface Adsorbate Model for a species on a surface. //! This is implemented in the class Adsorbate. diff --git a/include/cantera/transport/DustyGasTransport.h b/include/cantera/transport/DustyGasTransport.h index f56e29ce8..1c96c3d5b 100644 --- a/include/cantera/transport/DustyGasTransport.h +++ b/include/cantera/transport/DustyGasTransport.h @@ -79,7 +79,7 @@ public: * @param right Reference to DustyGasTransport object to be copied * into the current one. */ - DustyGasTransport& operator=(const DustyGasTransport& right); + DustyGasTransport& operator=(const DustyGasTransport& right); virtual ~DustyGasTransport(); virtual Transport* duplMyselfAsTransport() const; @@ -111,7 +111,7 @@ public: * \f] * * @param state1 Array of temperature, density, and mass fractions for state 1. - * @param state2 Array of temperature, density, and mass fractions for state 2. + * @param state2 Array of temperature, density, and mass fractions for state 2. * @param delta Distance from state 1 to state 2 (m). * * @param fluxes Vector of species molar fluxes due to diffusional driving force @@ -255,7 +255,7 @@ private: * units kg /kmol * length = m_nsp; */ - vector_fp m_mw; + vector_fp m_mw; //! binary diffusion coefficients DenseMatrix m_d; @@ -287,13 +287,13 @@ private: * H_{k,k} = \frac{1}{\mathcal(D)^{knud}_{k}} + \sum_{j \ne k}^N{ \frac{X_j}{D_{k,j}} } * \f] */ - DenseMatrix m_multidiff; + DenseMatrix m_multidiff; //! work space of size m_nsp; - vector_fp m_spwork; + vector_fp m_spwork; //! work space of size m_nsp; - vector_fp m_spwork2; + vector_fp m_spwork2; //! Pressure Gradient doublereal m_gradP; diff --git a/include/cantera/transport/GasTransport.h b/include/cantera/transport/GasTransport.h index 227f26df3..3ae3dac74 100644 --- a/include/cantera/transport/GasTransport.h +++ b/include/cantera/transport/GasTransport.h @@ -321,8 +321,8 @@ protected: //! Polynomial fits to the binary diffusivity of each species /*! - * m_diffcoeff[ic] is vector of polynomial coefficients for species i - * species j that fits the binary diffusion coefficient. The relationship + * m_diffcoeff[ic] is vector of polynomial coefficients for species i + * species j that fits the binary diffusion coefficient. The relationship * between i j and ic is determined from the following algorithm: * * int ic = 0; diff --git a/include/cantera/transport/LTPspecies.h b/include/cantera/transport/LTPspecies.h index ae7f03a5c..e316d2680 100644 --- a/include/cantera/transport/LTPspecies.h +++ b/include/cantera/transport/LTPspecies.h @@ -87,7 +87,7 @@ public: * is creating a parameterization for (e.g., viscosity) * @param thermo const pointer to the ThermoPhase object, which is used to find the temperature. */ - LTPspecies(const XML_Node* const propNode = 0, const std::string name = "-", + LTPspecies(const XML_Node* const propNode = 0, const std::string name = "-", TransportPropertyType tp_ind = TP_UNKNOWN, const thermo_t* thermo = 0); //! Copy Constructor @@ -207,7 +207,7 @@ public: * @param thermo const pointer to the ThermoPhase object, which is used to find the temperature. */ LTPspecies_Const(const XML_Node& propNode, const std::string name, - TransportPropertyType tp_ind, const thermo_t* const thermo); + TransportPropertyType tp_ind, const thermo_t* const thermo); //! Copy Constructor /*! @@ -267,7 +267,7 @@ public: * * \endverbatim */ -class LTPspecies_Arrhenius : public LTPspecies +class LTPspecies_Arrhenius : public LTPspecies { public: //! Construct an LTPspecies object for a liquid transport property @@ -468,7 +468,7 @@ public: * @param thermo const pointer to the ThermoPhase object, which is used to find the temperature. */ LTPspecies_ExpT(const XML_Node& propNode, const std::string name, - TransportPropertyType tp_ind, const thermo_t* thermo); + TransportPropertyType tp_ind, const thermo_t* thermo); //! Copy Constructor /*! @@ -481,7 +481,7 @@ public: * @param right Object to be copied * @return returns a reference to the current object */ - LTPspecies_ExpT& operator=(const LTPspecies_ExpT& right); + LTPspecies_ExpT& operator=(const LTPspecies_ExpT& right); //! Duplicates the current object given the parent class reference /*! diff --git a/include/cantera/transport/LiquidTranInteraction.h b/include/cantera/transport/LiquidTranInteraction.h index c721c64bd..b0e6b51ca 100644 --- a/include/cantera/transport/LiquidTranInteraction.h +++ b/include/cantera/transport/LiquidTranInteraction.h @@ -1,7 +1,7 @@ /** * @file LiquidTranInteraction.h * Header file defining the class LiquidTranInteraction and classes which - * derive from LiquidTranInteraction. + * derive from LiquidTranInteraction. */ #ifndef CT_LIQUIDTRANINTERACTION_H @@ -121,9 +121,7 @@ public: virtual void init(const XML_Node& compModelNode = XML_Node(), thermo_t* thermo = 0); - virtual void setParameters(LiquidTransportParams& trParam) { - ; - } + virtual void setParameters(LiquidTransportParams& trParam) {} //! Return the mixture transport property value. //! (Must be implemented in subclasses.) @@ -152,14 +150,14 @@ protected: //! Matrix of interaction coefficients for polynomial in molefraction*weight of //! speciesA (no temperature dependence, dimensionless) - std::vector m_Aij; + std::vector m_Aij; //! Matrix of interaction coefficients for polynomial in molefraction*weight of //! speciesA (linear temperature dependence, units 1/K) - std::vector m_Bij; + std::vector m_Bij; //! Matrix of interactions (in energy units, 1/RT temperature dependence) - DenseMatrix m_Eij; + DenseMatrix m_Eij; //! Matrix of interaction coefficients for polynomial in molefraction*weight of //! speciesA (in energy units, 1/RT temperature dependence) @@ -170,7 +168,7 @@ protected: std::vector m_Sij; //! Matrix of interactions - DenseMatrix m_Dij; + DenseMatrix m_Dij; }; class LTI_Solvent : public LiquidTranInteraction @@ -184,7 +182,7 @@ public: * does not know what transport property it is at this point). */ doublereal getMixTransProp(doublereal* valueSpecies, doublereal* weightSpecies = 0); - doublereal getMixTransProp(std::vector LTPptrs) ; + doublereal getMixTransProp(std::vector LTPptrs); //! Return the matrix of binary interaction parameters. /** @@ -196,7 +194,7 @@ public: //! Simple mole fraction weighting of transport properties /** - * This model weights the transport property by the mole fractions. The + * This model weights the transport property by the mole fractions. The * overall formula for the mixture viscosity is * * \f[ @@ -217,7 +215,7 @@ public: * does not know what transport property it is at this point. */ doublereal getMixTransProp(doublereal* valueSpecies, doublereal* weightSpecies = 0); - doublereal getMixTransProp(std::vector LTPptrs) ; + doublereal getMixTransProp(std::vector LTPptrs); //! Return the matrix of binary interaction parameters. /** @@ -231,7 +229,7 @@ public: //! Simple mass fraction weighting of transport properties /*! - * This model weights the transport property by the mass fractions. The + * This model weights the transport property by the mass fractions. The * overall formula for the mixture viscosity is * * \f[ @@ -253,7 +251,7 @@ public: * does not know what transport property it is at this point. */ doublereal getMixTransProp(doublereal* valueSpecies, doublereal* weightSpecies = 0); - doublereal getMixTransProp(std::vector LTPptrs) ; + doublereal getMixTransProp(std::vector LTPptrs); //! Return the matrix of binary interaction parameters. /** @@ -318,7 +316,7 @@ public: * does not know what transport property it is at this point. */ doublereal getMixTransProp(doublereal* valueSpecies, doublereal* weightSpecies = 0); - doublereal getMixTransProp(std::vector LTPptrs) ; + doublereal getMixTransProp(std::vector LTPptrs); //! Return the matrix of binary interaction parameters. /** @@ -359,7 +357,7 @@ public: m_model = LTI_MODEL_PAIRWISE_INTERACTION; } - void setParameters(LiquidTransportParams& trParam) ; + void setParameters(LiquidTransportParams& trParam); //! Return the mixture transport property value. /** @@ -367,14 +365,14 @@ public: * does not know what transport property it is at this point. */ doublereal getMixTransProp(doublereal* valueSpecies, doublereal* weightSpecies = 0); - doublereal getMixTransProp(std::vector LTPptrs) ; + doublereal getMixTransProp(std::vector LTPptrs); //! Return the matrix of binary interaction parameters. /** * Takes the proper mixing rule for the binary interaction parameters * and calculates them */ - void getMatrixTransProp(DenseMatrix& mat, doublereal* speciesValues = 0) ; + void getMatrixTransProp(DenseMatrix& mat, doublereal* speciesValues = 0); protected: std::vector m_diagonals; @@ -457,7 +455,7 @@ public: m_model = LTI_MODEL_STEFANMAXWELL_PPN; } - void setParameters(LiquidTransportParams& trParam) ; + void setParameters(LiquidTransportParams& trParam); //! Return the mixture transport property value. /** @@ -465,14 +463,14 @@ public: * does not know what transport property it is at this point. */ doublereal getMixTransProp(doublereal* valueSpecies, doublereal* weightSpecies = 0); - doublereal getMixTransProp(std::vector LTPptrs) ; + doublereal getMixTransProp(std::vector LTPptrs); //! Return the matrix of binary interaction parameters. /** * Takes the proper mixing rule for the binary interaction parameters * and calculates them */ - void getMatrixTransProp(DenseMatrix& mat, doublereal* speciesValues = 0) ; + void getMatrixTransProp(DenseMatrix& mat, doublereal* speciesValues = 0); protected: doublereal m_ionCondMix; @@ -506,14 +504,14 @@ public: * transport property it is at this point. */ doublereal getMixTransProp(doublereal* valueSpecies, doublereal* weightSpecies = 0); - doublereal getMixTransProp(std::vector LTPptrs) ; + doublereal getMixTransProp(std::vector LTPptrs); //! Return the matrix of binary interaction parameters. /** * Takes the proper mixing rule for the binary interaction parameters * and calculates them */ - void getMatrixTransProp(DenseMatrix& mat, doublereal* speciesValues = 0) ; + void getMatrixTransProp(DenseMatrix& mat, doublereal* speciesValues = 0); protected: std::vector m_viscosity; @@ -522,7 +520,7 @@ protected: //! Simple mole fraction weighting of transport properties /** - * This model weights the transport property by the mole fractions. The + * This model weights the transport property by the mole fractions. The * overall formula for the mixture viscosity is * * \f[ \eta_{mix} = \sum_i X_i \eta_i @@ -542,7 +540,7 @@ public: * does not know what transport property it is at this point. */ doublereal getMixTransProp(doublereal* valueSpecies, doublereal* weightSpecies = 0); - doublereal getMixTransProp(std::vector LTPptrs) ; + doublereal getMixTransProp(std::vector LTPptrs); //! Return the matrix of binary interaction parameters. /** diff --git a/include/cantera/transport/LiquidTransport.h b/include/cantera/transport/LiquidTransport.h index 19b0a8355..564b9c1d9 100644 --- a/include/cantera/transport/LiquidTransport.h +++ b/include/cantera/transport/LiquidTransport.h @@ -60,7 +60,7 @@ namespace Cantera * various methods below. * * Within LiquidTransport, the state is presumed to be - * defined in terms of the species mole fraction, + * defined in terms of the species mole fraction, * temperature and pressure. Charged species are expected * and quantities like the electric current are computed * based on a combined electrochemical potential. @@ -83,7 +83,7 @@ public: LiquidTransport(thermo_t* thermo = 0, int ndim = 1); LiquidTransport(const LiquidTransport& right); - LiquidTransport& operator=(const LiquidTransport& right); + LiquidTransport& operator=(const LiquidTransport& right); virtual Transport* duplMyselfAsTransport() const; virtual ~LiquidTransport(); @@ -373,7 +373,7 @@ public: * \vec{i} = \sum_{i} z_i F \rho \vec{V_i} / W_i * \f] * where \f$ z_i \f$ is the charge on species i, - * \f$ F \f$ is Faradays constant, \f$ \rho \f$ is the density, + * \f$ F \f$ is Faradays constant, \f$ \rho \f$ is the density, * \f$ W_i \f$ is the molecular mass of species i. * The conductance, \f$ \kappa \f$ is obtained from * \f[ @@ -385,14 +385,14 @@ public: //! Compute the electric current density in A/m^2 /*! * The electric current is computed first by computing the - * species diffusive fluxes using the Stefan Maxwell solution + * species diffusive fluxes using the Stefan Maxwell solution * and then the current, \f$ \vec{i} \f$ by summing over * the charge-weighted fluxes according to * \f[ * \vec{i} = \sum_{i} z_i F \rho \vec{V_i} / W_i * \f] * where \f$ z_i \f$ is the charge on species i, - * \f$ F \f$ is Faradays constant, \f$ \rho \f$ is the density, + * \f$ F \f$ is Faradays constant, \f$ \rho \f$ is the density, * \f$ W_i \f$ is the molecular mass of species \c i. * * @param ndim The number of spatial dimensions (1, 2, or 3). @@ -470,10 +470,10 @@ public: * Flat vector with the m_nsp in the inner loop. * length = ldx * ndim */ - virtual void getSpeciesVdiffES(size_t ndim, const doublereal* grad_T, - int ldx, const doublereal* grad_X, - int ldf, const doublereal* grad_Phi, - doublereal* Vdiff) ; + virtual void getSpeciesVdiffES(size_t ndim, const doublereal* grad_T, + int ldx, const doublereal* grad_X, + int ldf, const doublereal* grad_Phi, + doublereal* Vdiff); //! Return the species diffusive mass fluxes wrt to //! the averaged velocity in [kmol/m^2/s]. @@ -916,7 +916,7 @@ private: //! Stefan-Maxwell diffusion coefficients DenseMatrix m_diff_Dij; - //! Hydrodynamic radius for each species expressed as an appropriate subclass of LTPspecies + //! Hydrodynamic radius for each species expressed as an appropriate subclass of LTPspecies /*! * These subclasses of LTPspecies evaluate the species-specific * transport properties according to the parameters parsed in @@ -936,7 +936,7 @@ private: LiquidTranInteraction* m_radiusMixModel; //! Species hydrodynamic radius - vector_fp m_hydrodynamic_radius; + vector_fp m_hydrodynamic_radius; //! Internal value of the gradient of the mole fraction vector /*! @@ -1028,7 +1028,7 @@ private: * * units m2/sec */ - DenseMatrix m_bdiff; + DenseMatrix m_bdiff; //! Internal value of the species viscosities /*! @@ -1081,7 +1081,7 @@ private: * * Length = number of species */ - vector_fp m_lambdaSpecies; + vector_fp m_lambdaSpecies; //! State of the mole fraction vector. int m_iStateMF; @@ -1168,7 +1168,7 @@ private: vector_fp m_actCoeff; //! RHS to the Stefan-Maxwell equation - DenseMatrix m_B; + DenseMatrix m_B; //! Matrix for the Stefan-Maxwell equation. DenseMatrix m_A; @@ -1215,7 +1215,7 @@ private: /*! * Length is equal to m_nsp */ - vector_fp m_spwork; + vector_fp m_spwork; private: //! Boolean indicating that the top-level mixture viscosity is current diff --git a/include/cantera/transport/LiquidTransportParams.h b/include/cantera/transport/LiquidTransportParams.h index 6c25c55a7..9f96ddec4 100644 --- a/include/cantera/transport/LiquidTransportParams.h +++ b/include/cantera/transport/LiquidTransportParams.h @@ -53,19 +53,19 @@ public: //! the calculation of each species' self diffusion coefficient for the phase std::vector selfDiffusion; - //! Pointer to the LiquidTranInteraction object which handles the + //! Pointer to the LiquidTranInteraction object which handles the //! calculation of the mixture thermal conductivity for the phase LiquidTranInteraction* thermalCond; - //! Pointer to the LiquidTranInteraction object which handles the + //! Pointer to the LiquidTranInteraction object which handles the //! calculation of the species diffusivity for the phase LiquidTranInteraction* speciesDiffusivity; - //! Pointer to the LiquidTranInteraction object which handles the + //! Pointer to the LiquidTranInteraction object which handles the //! calculation of the electrical conductivity for the phase LiquidTranInteraction* electCond; - //! Pointer to the LiquidTranInteraction object which handles the + //! Pointer to the LiquidTranInteraction object which handles the //! calculation of the hydrodynamic radius for the phase /*! * @note I don't understand at the moment how one can define a @@ -98,7 +98,7 @@ public: * \f[ \eta_{mix} = \sum_i X_i \eta_i * + \sum_i \sum_j X_i X_j A_{i,j} \f]. */ - DenseMatrix thermalCond_Aij; + DenseMatrix thermalCond_Aij; //! Model for species interaction effects for mass diffusivity //! Takes enum LiquidTranMixingModel @@ -111,7 +111,7 @@ public: * LTI_MODEL_STEFANMAXWELL_PPN. These provide species interaction * coefficients associated with the Stefan-Maxwell formulation. */ - DenseMatrix diff_Dij; + DenseMatrix diff_Dij; //! Model for species interaction effects for hydrodynamic radius //! Takes enum LiquidTranMixingModel @@ -121,7 +121,7 @@ public: /** * Not yet implemented */ - DenseMatrix radius_Aij; + DenseMatrix radius_Aij; //! Default composition dependence of the transport properties /*! diff --git a/include/cantera/transport/MixTransport.h b/include/cantera/transport/MixTransport.h index 58107ebb4..42553732c 100644 --- a/include/cantera/transport/MixTransport.h +++ b/include/cantera/transport/MixTransport.h @@ -58,7 +58,7 @@ public: MixTransport(); MixTransport(const MixTransport& right); - MixTransport& operator=(const MixTransport& right); + MixTransport& operator=(const MixTransport& right); virtual Transport* duplMyselfAsTransport() const; //! Return the model id for transport diff --git a/include/cantera/transport/MultiTransport.h b/include/cantera/transport/MultiTransport.h index 86fd926e5..141bc500a 100644 --- a/include/cantera/transport/MultiTransport.h +++ b/include/cantera/transport/MultiTransport.h @@ -55,7 +55,7 @@ public: virtual void getMultiDiffCoeffs(const size_t ld, doublereal* const d); - //! Get the species diffusive mass fluxes wrt to the mass averaged velocity, + //! Get the species diffusive mass fluxes wrt to the mass averaged velocity, //! given the gradients in mole fraction and temperature /*! * Units for the returned fluxes are kg m-2 s-1. @@ -75,7 +75,7 @@ public: * length = ldx * ndim */ virtual void getSpeciesFluxes(size_t ndim, const doublereal* const grad_T, - size_t ldx, const doublereal* const grad_X, + size_t ldx, const doublereal* const grad_X, size_t ldf, doublereal* const fluxes); //! Get the molar diffusional fluxes [kmol/m^2/s] of the species, given the thermodynamic @@ -131,28 +131,28 @@ protected: doublereal m_thermal_tlast; //! Dense matrix for astar - DenseMatrix m_astar; + DenseMatrix m_astar; //! Dense matrix for bstar - DenseMatrix m_bstar; + DenseMatrix m_bstar; //! Dense matrix for cstar - DenseMatrix m_cstar; + DenseMatrix m_cstar; //! Dense matrix for omega22 - DenseMatrix m_om22; + DenseMatrix m_om22; - vector_fp m_cinternal; + vector_fp m_cinternal; - vector_fp m_sqrt_eps_k; + vector_fp m_sqrt_eps_k; DenseMatrix m_log_eps_k; - vector_fp m_frot_298; - vector_fp m_rotrelax; + vector_fp m_frot_298; + vector_fp m_rotrelax; doublereal m_lambda; // L matrix quantities - DenseMatrix m_Lmatrix; + DenseMatrix m_Lmatrix; SquareMatrix m_aa; vector_fp m_a; vector_fp m_b; diff --git a/include/cantera/transport/SimpleTransport.h b/include/cantera/transport/SimpleTransport.h index 65dae559a..5800903fb 100644 --- a/include/cantera/transport/SimpleTransport.h +++ b/include/cantera/transport/SimpleTransport.h @@ -126,7 +126,7 @@ namespace Cantera * \mu^e_k = \frac{F D_k}{R T} * \f] * - * The diffusion coefficients, \f$ D_k \f$ , is calculated from a call to the mixture diffusion + * The diffusion coefficients, \f$ D_k \f$ , is calculated from a call to the mixture diffusion * coefficient routine. * *

Species Diffusive Fluxes

@@ -193,7 +193,7 @@ public: SimpleTransport(thermo_t* thermo = 0, int ndim = 1); SimpleTransport(const SimpleTransport& right); - SimpleTransport& operator=(const SimpleTransport& right); + SimpleTransport& operator=(const SimpleTransport& right); virtual Transport* duplMyselfAsTransport() const; virtual ~SimpleTransport(); @@ -272,7 +272,7 @@ public: * * Controlling update boolean = m_condmix_ok * - * Units are in W/m/K or equivalently kg m / s3 / K + * Units are in W/m/K or equivalently kg m / s3 / K * * Solvent-only: * \f[ @@ -370,8 +370,8 @@ public: * length = ldx * ndim */ virtual void getSpeciesVdiffES(size_t ndim, const doublereal* grad_T, - int ldx, const doublereal* grad_X, - int ldf, const doublereal* grad_Phi, + int ldx, const doublereal* grad_X, + int ldf, const doublereal* grad_Phi, doublereal* Vdiff); //! Get the species diffusive mass fluxes wrt to the specified solution averaged velocity, @@ -526,19 +526,19 @@ private: /*! * Length is Equal to the number of species in the mechanism. */ - vector_fp m_mw; + vector_fp m_mw; //! Pure species viscosities in Arrhenius temperature-dependent form. - std::vector m_coeffVisc_Ns; + std::vector m_coeffVisc_Ns; //! Pure species thermal conductivities in Arrhenius temperature-dependent form. - std::vector m_coeffLambda_Ns; + std::vector m_coeffLambda_Ns; //! Pure species viscosities in Arrhenius temperature-dependent form. - std::vector m_coeffDiff_Ns; + std::vector m_coeffDiff_Ns; //! Hydrodynamic radius in LTPspecies form - std::vector m_coeffHydroRadius_Ns; + std::vector m_coeffHydroRadius_Ns; //! Internal value of the gradient of the mole fraction vector /*! @@ -619,7 +619,7 @@ private: * * controlling update boolean -> m_cond_temp_ok */ - vector_fp m_condSpecies; + vector_fp m_condSpecies; //! State of the mole fraction vector. int m_iStateMF; @@ -685,7 +685,7 @@ private: /*! * Length is equal to m_nsp */ - vector_fp m_spwork; + vector_fp m_spwork; vector_fp m_fluxes; diff --git a/include/cantera/transport/SolidTransport.h b/include/cantera/transport/SolidTransport.h index c45e2a64a..6323ee571 100644 --- a/include/cantera/transport/SolidTransport.h +++ b/include/cantera/transport/SolidTransport.h @@ -22,7 +22,7 @@ class SolidTransport : public Transport public: SolidTransport(); SolidTransport(const SolidTransport& right); - SolidTransport& operator=(const SolidTransport& right); + SolidTransport& operator=(const SolidTransport& right); virtual Transport* duplMyselfAsTransport() const; virtual int model() const { @@ -35,7 +35,7 @@ public: * The ionConductivity calculation is handled by subclasses of * LTPspecies as specified in the input file. */ - virtual doublereal ionConductivity() ; + virtual doublereal ionConductivity(); //! Returns the thermal conductivity of the phase /*! diff --git a/include/cantera/transport/Tortuosity.h b/include/cantera/transport/Tortuosity.h index 407885dac..db40716b3 100644 --- a/include/cantera/transport/Tortuosity.h +++ b/include/cantera/transport/Tortuosity.h @@ -72,7 +72,7 @@ public: protected: //! Bruggeman exponent: power to which the tortuosity depends on the volume fraction - double expBrug_ ; + double expBrug_; }; @@ -80,11 +80,11 @@ protected: * appropriate for porous media where percolation theory applies. * It is derived from the Tortuosity class. */ -class TortuosityPercolation : public Tortuosity +class TortuosityPercolation : public Tortuosity { public: //! Default constructor uses Bruggeman exponent of 1.5 - TortuosityPercolation(double percolationThreshold = 0.4, double conductivityExponent = 2.0) : percolationThreshold_(percolationThreshold), conductivityExponent_(conductivityExponent) { + TortuosityPercolation(double percolationThreshold = 0.4, double conductivityExponent = 2.0) : percolationThreshold_(percolationThreshold), conductivityExponent_(conductivityExponent) { } //! The tortuosity factor models the effective increase in the @@ -147,7 +147,7 @@ class TortuosityMaxwell : public Tortuosity { public: //! Default constructor uses Bruggeman exponent of 1.5 - TortuosityMaxwell(double relativeConductivites = 0.0) : relativeConductivites_(relativeConductivites) { + TortuosityMaxwell(double relativeConductivites = 0.0) : relativeConductivites_(relativeConductivites) { } //! The tortuosity factor models the effective increase in the @@ -175,7 +175,7 @@ public: } protected: - //! Relative conductivities of the dispersed and continuous phases, + //! Relative conductivities of the dispersed and continuous phases, //! `relativeConductivites_` \f$ = \kappa_d / \kappa_0 \f$. double relativeConductivites_; }; diff --git a/include/cantera/transport/TransportBase.h b/include/cantera/transport/TransportBase.h index 876375f41..77e7ec47a 100644 --- a/include/cantera/transport/TransportBase.h +++ b/include/cantera/transport/TransportBase.h @@ -36,20 +36,20 @@ class SolidTransportData; const int CK_Mode = 10; // types of transport models that can be constructed -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; +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 @@ -172,7 +172,7 @@ public: virtual ~Transport() {} Transport(const Transport& right); - Transport& operator=(const Transport& right); + Transport& operator=(const Transport& right); //! Duplication routine for objects which inherit from Transport /*! @@ -292,7 +292,7 @@ public: * * k = j * nsp + i * - * The size of mobRat must be at least equal to nsp*nsp + * The size of mobRat must be at least equal to nsp*nsp */ virtual void mobilityRatio(double* mobRat) { throw NotImplementedError("Transport::mobilityRatio"); @@ -412,7 +412,7 @@ public: //! Compute the mixture electrical conductivity (S m-1) at the current //! conditions of the phase (Siemens m-1) /*! - * The electrical conductivity, \f$ \sigma \f$, relates the electric + * The electrical conductivity, \f$ \sigma \f$, relates the electric * current density, J, to the electric field, E. * * \f[ @@ -424,7 +424,7 @@ public: * * The conductivity is the reciprocal of the resistivity. * - * The units are Siemens m-1, where 1 S = 1 A / volt = 1 s^3 A^2 /kg /m^2 + * The units are Siemens m-1, where 1 S = 1 A / volt = 1 s^3 A^2 /kg /m^2 */ virtual doublereal getElectricConduct() { throw NotImplementedError("Transport::getElectricConduct"); @@ -613,7 +613,7 @@ public: * coefficients. Dimension dt at least as large as the number of * species. Units are kg/m/s. */ - virtual void getThermalDiffCoeffs(doublereal* const dt) { + virtual void getThermalDiffCoeffs(doublereal* const dt) { throw NotImplementedError("Transport::getThermalDiffCoeffs"); } @@ -781,10 +781,10 @@ protected: //@} //! pointer to the object representing the phase - thermo_t* m_thermo; + thermo_t* m_thermo; //! true if finalize has been called - bool m_ready; + bool m_ready; //! Number of species size_t m_nsp; diff --git a/include/cantera/transport/TransportFactory.h b/include/cantera/transport/TransportFactory.h index 0dec21aaa..7311bf199 100644 --- a/include/cantera/transport/TransportFactory.h +++ b/include/cantera/transport/TransportFactory.h @@ -61,7 +61,7 @@ public: //! 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 + * This method operates at the level of a single transport property as a * function of temperature and possibly composition. It's a factory for * LTPspecies classes. * @@ -153,7 +153,7 @@ private: /*! * Given a vector of pointers to species XML data bases * and a list of species names, this method constructs the LiquidTransport - * Params object containing the transport data for these species. + * Params object containing the transport data for these species. * * It is an error to not find a "transport" XML element within each of the species * XML elements listed in the names vector. @@ -250,7 +250,7 @@ private: * * @ingroup tranprops */ -Transport* newTransportMgr(const std::string& transportModel = "", thermo_t* thermo = 0, int loglevel = 0, +Transport* newTransportMgr(const std::string& transportModel = "", thermo_t* thermo = 0, int loglevel = 0, TransportFactory* f = 0, int ndim=1); //! Create a new transport manager instance. @@ -263,7 +263,7 @@ Transport* newTransportMgr(const std::string& transportModel = "", thermo_t* th * * @ingroup tranprops */ -Transport* newDefaultTransportMgr(thermo_t* thermo, int loglevel = 0, TransportFactory* f = 0); +Transport* newDefaultTransportMgr(thermo_t* thermo, int loglevel = 0, TransportFactory* f = 0); } // End of namespace Cantera diff --git a/include/cantera/transport/WaterTransport.h b/include/cantera/transport/WaterTransport.h index f635f28dd..6eae10a12 100644 --- a/include/cantera/transport/WaterTransport.h +++ b/include/cantera/transport/WaterTransport.h @@ -10,13 +10,13 @@ namespace Cantera { //! @{ -const int LVISC_CONSTANT = 0; -const int LVISC_WILKES = 1; -const int LVISC_MIXTUREAVG = 2; +const int LVISC_CONSTANT = 0; +const int LVISC_WILKES = 1; +const int LVISC_MIXTUREAVG = 2; -const int LDIFF_MIXDIFF_UNCORRECTED = 0; -const int LDIFF_MIXDIFF_FLUXCORRECTED = 1; -const int LDIFF_MULTICOMP_STEFANMAXWELL = 2; +const int LDIFF_MIXDIFF_UNCORRECTED = 0; +const int LDIFF_MIXDIFF_FLUXCORRECTED = 1; +const int LDIFF_MULTICOMP_STEFANMAXWELL = 2; //! @} class WaterProps; @@ -37,7 +37,7 @@ public: WaterTransport(thermo_t* thermo = 0, int ndim = 1); WaterTransport(const WaterTransport& right); - WaterTransport& operator=(const WaterTransport& right); + WaterTransport& operator=(const WaterTransport& right); virtual Transport* duplMyselfAsTransport() const; virtual int model() const { diff --git a/include/cantera/zeroD/FlowDevice.h b/include/cantera/zeroD/FlowDevice.h index c4c2f828a..c38d04c3e 100644 --- a/include/cantera/zeroD/FlowDevice.h +++ b/include/cantera/zeroD/FlowDevice.h @@ -14,7 +14,7 @@ namespace Cantera { class Func1; -class ReactorBase; // forward reference +class ReactorBase; // forward reference const int MFC_Type = 1; const int PressureController_Type = 2; diff --git a/include/cantera/zeroD/Reactor.h b/include/cantera/zeroD/Reactor.h index c838f9b06..7eb2c0058 100644 --- a/include/cantera/zeroD/Reactor.h +++ b/include/cantera/zeroD/Reactor.h @@ -178,7 +178,7 @@ protected: virtual void getSurfaceInitialConditions(double* y); //! Pointer to the homogeneous Kinetics object that handles the reactions - Kinetics* m_kin; + Kinetics* m_kin; doublereal m_vdot; //!< net rate of volume change from moving walls [m^3/s] doublereal m_Q; //!< net heat transfer through walls [W] diff --git a/include/cantera/zeroD/ReactorBase.h b/include/cantera/zeroD/ReactorBase.h index 856397f9b..124647495 100644 --- a/include/cantera/zeroD/ReactorBase.h +++ b/include/cantera/zeroD/ReactorBase.h @@ -216,7 +216,7 @@ protected: //! Number of homogeneous species in the mixture size_t m_nsp; - thermo_t* m_thermo; + thermo_t* m_thermo; doublereal m_vol; doublereal m_enthalpy; doublereal m_intEnergy; diff --git a/samples/cxx/NASA_coeffs/NASA_coeffs.cpp b/samples/cxx/NASA_coeffs/NASA_coeffs.cpp index 0fe687582..59923dc20 100644 --- a/samples/cxx/NASA_coeffs/NASA_coeffs.cpp +++ b/samples/cxx/NASA_coeffs/NASA_coeffs.cpp @@ -1,4 +1,4 @@ -#include "cantera/IdealGasMix.h" // defines class IdealGasMix +#include "cantera/IdealGasMix.h" // defines class IdealGasMix #include diff --git a/samples/cxx/bvp/BoundaryValueProblem.h b/samples/cxx/bvp/BoundaryValueProblem.h index a3410ac83..b9b7b4fce 100644 --- a/samples/cxx/bvp/BoundaryValueProblem.h +++ b/samples/cxx/bvp/BoundaryValueProblem.h @@ -13,10 +13,10 @@ namespace BVP { // default grid refinement parameters -const double max_grid_ratio = 4.0; ///< max ratio of neighboring grid intervals -const double max_delta = 0.01; ///< max difference in function values -const double max_delta_slope = 0.02; ///< max difference in slopes -const double prune = 0.000; ///< don't remove grid points +const double max_grid_ratio = 4.0; ///< max ratio of neighboring grid intervals +const double max_delta = 0.01; ///< max difference in function values +const double max_delta_slope = 0.02; ///< max difference in slopes +const double prune = 0.000; ///< don't remove grid points /** * Used to specify component-specific options for method @@ -27,12 +27,12 @@ const double prune = 0.000; ///< don't remove grid points class Component { public: - double lower; ///< lower bound - double upper; ///< upper bound - double rtol; ///< relative error tolerance - double atol; ///< absolute error tolerance - bool refine; ///< make this component active for grid refinement - std::string name; ///< component name + double lower; ///< lower bound + double upper; ///< upper bound + double rtol; ///< relative error tolerance + double atol; ///< absolute error tolerance + bool refine; ///< make this component active for grid refinement + std::string name; ///< component name /** * Constructor. Sets default values. @@ -195,9 +195,9 @@ public: } protected: - Cantera::Domain1D* m_left; ///< dummy terminator + Cantera::Domain1D* m_left; ///< dummy terminator Cantera::Domain1D* m_right; ///< dummy terminator - Cantera::Sim1D* m_sim; ///< controller for solution + Cantera::Sim1D* m_sim; ///< controller for solution /** * True if n is the index of the left-most grid point (zero), diff --git a/samples/cxx/bvp/blasius.cpp b/samples/cxx/bvp/blasius.cpp index 0895f0f3d..33eacb7ac 100644 --- a/samples/cxx/bvp/blasius.cpp +++ b/samples/cxx/bvp/blasius.cpp @@ -32,7 +32,7 @@ public: A.rtol = 1.0e-12; A.atol = 1.0e-15; A.name = "zeta"; - setComponent(0, A); // zeta will be component 0 + setComponent(0, A); // zeta will be component 0 BVP::Component B; B.lower = -200.0; @@ -40,7 +40,7 @@ public: B.rtol = 1.0e-12; B.atol = 1.0e-15; B.name = "u"; - setComponent(1, B); // u will be component 1 + setComponent(1, B); // u will be component 1 } // destructor diff --git a/samples/cxx/demo.cpp b/samples/cxx/demo.cpp index 92f22c030..b04714303 100644 --- a/samples/cxx/demo.cpp +++ b/samples/cxx/demo.cpp @@ -1,8 +1,8 @@ /////////////////////////////////////////////////////////////////////// // -// This demonstration program builds an object representing a -// reacting gas mixture, and uses it to compute thermodynamic -// properties, chemical equilibrium, and transport properties. +// This demonstration program builds an object representing a +// reacting gas mixture, and uses it to compute thermodynamic +// properties, chemical equilibrium, and transport properties. // /////////////////////////////////////////////////////////////////////// @@ -11,8 +11,8 @@ // provide a simplified interface to the Cantera header files. If you need // to include core headers directly, use the format "cantera/module/*.h". -#include "cantera/IdealGasMix.h" // defines class IdealGasMix -#include "cantera/transport.h" // transport properties +#include "cantera/IdealGasMix.h" // defines class IdealGasMix +#include "cantera/transport.h" // transport properties #include // All Cantera kernel names are in namespace Cantera. You can either @@ -33,7 +33,7 @@ void demoprog() gas.setState_TPX(temp, pres, "H2:1, O2:1, AR:2"); - // Thermodynamic properties + // Thermodynamic properties printf("\n\nInitial state:\n\n"); printf( @@ -62,7 +62,7 @@ void demoprog() gas.enthalpy_mole(), gas.entropy_mole(), gas.cp_mole()); - // Reaction information + // Reaction information int irxns = gas.nReactions(); vector_fp qf(irxns); diff --git a/samples/cxx/flamespeed/flamespeed.cpp b/samples/cxx/flamespeed/flamespeed.cpp index 2111ba9a0..9af2edac9 100644 --- a/samples/cxx/flamespeed/flamespeed.cpp +++ b/samples/cxx/flamespeed/flamespeed.cpp @@ -122,8 +122,8 @@ int flamespeed(double phi) locs.resize(3); value.resize(3); - //ramp values from inlet to adiabatic flame conditions - // over 70% of domain and then level off at equilibrium + // ramp values from inlet to adiabatic flame conditions + // over 70% of domain and then level off at equilibrium double z1=0.7; double uout; diff --git a/samples/cxx/kinetics1/example_utils.h b/samples/cxx/kinetics1/example_utils.h index 6eeed7526..c9d79efe7 100644 --- a/samples/cxx/kinetics1/example_utils.h +++ b/samples/cxx/kinetics1/example_utils.h @@ -37,9 +37,9 @@ void makeDataLabels(const G& gas, V& names) int nsp = gas.nSpecies(); names.resize(nsp + 4); names[0] = "time (s)"; - names[1] = "Temperature (K)"; - names[2] = "Density (kg/m3)"; - names[3] = "Pressure (Pa)"; + names[1] = "Temperature (K)"; + names[2] = "Density (kg/m3)"; + names[3] = "Pressure (Pa)"; int k; for (k = 0; k < nsp; k++) { names[4+k] = gas.speciesName(k); diff --git a/samples/cxx/kinetics1/kinetics1.cpp b/samples/cxx/kinetics1/kinetics1.cpp index 137be9405..0c787d734 100644 --- a/samples/cxx/kinetics1/kinetics1.cpp +++ b/samples/cxx/kinetics1/kinetics1.cpp @@ -1,8 +1,8 @@ ///////////////////////////////////////////////////////////// // -// zero-dimensional kinetics example program +// zero-dimensional kinetics example program // -// copyright California Institute of Technology 2002 +// copyright California Institute of Technology 2002 // ///////////////////////////////////////////////////////////// @@ -37,8 +37,8 @@ int kinetics1(int np, void* p) // quantities needed. r.insert(gas); - double dt = 1.e-5; // interval at which output is written - int nsteps = 100; // number of intervals + double dt = 1.e-5; // interval at which output is written + int nsteps = 100; // number of intervals // create a 2D array to hold the output variables, // and store the values for the initial state @@ -51,14 +51,14 @@ int kinetics1(int np, void* p) sim.addReactor(r); // main loop - clock_t t0 = clock(); // save start time + clock_t t0 = clock(); // save start time for (int i = 1; i <= nsteps; i++) { double tm = i*dt; sim.advance(tm); cout << "time = " << tm << " s" << endl; saveSoln(tm, gas, soln); } - clock_t t1 = clock(); // save end time + clock_t t1 = clock(); // save end time // make a Tecplot data file and an Excel spreadsheet diff --git a/samples/cxx/rankine/rankine.cpp b/samples/cxx/rankine/rankine.cpp index 2fdd691ee..695834db9 100644 --- a/samples/cxx/rankine/rankine.cpp +++ b/samples/cxx/rankine/rankine.cpp @@ -1,6 +1,6 @@ // An open Rankine cycle -#include "cantera/PureFluid.h" // defines class Water +#include "cantera/PureFluid.h" // defines class Water #include using namespace Cantera; @@ -33,9 +33,9 @@ void printStates() int openRankine(int np, void* p) { - double etap = 0.6; // pump isentropic efficiency - double etat = 0.8; // turbine isentropic efficiency - double phigh = 8.0e5; // high pressure + double etap = 0.6; // pump isentropic efficiency + double etat = 0.8; // turbine isentropic efficiency + double phigh = 8.0e5; // high pressure Water w; diff --git a/samples/f77/demo_ftnlib.cpp b/samples/f77/demo_ftnlib.cpp index 55c2c6131..aa98bfa8b 100644 --- a/samples/f77/demo_ftnlib.cpp +++ b/samples/f77/demo_ftnlib.cpp @@ -90,11 +90,11 @@ extern "C" { delete _trans; _trans = newTransportMgr(trmodel,_gas,1); } catch (CanteraError& err) { - _trans = newTransportMgr("",_gas,1); + _trans = newTransportMgr("",_gas,1); } } - /// integer function nElements() + /// integer function nElements() integer nelements_() { return _gas->nElements(); diff --git a/src/base/application.cpp b/src/base/application.cpp index 394024b88..18d17ca39 100644 --- a/src/base/application.cpp +++ b/src/base/application.cpp @@ -108,17 +108,17 @@ void Application::Messages::addError(const std::string& r, const std::string& ms int Application::Messages::getErrorCount() { - return static_cast(errorMessage.size()) ; + return static_cast(errorMessage.size()); } void Application::Messages::setLogger(Logger* _logwriter) { if (logwriter == _logwriter) { - return ; + return; } if (logwriter != 0) { delete logwriter; - logwriter = 0 ; + logwriter = 0; } logwriter = _logwriter; } @@ -141,23 +141,23 @@ static mutex_t msg_mutex; Application::Messages* Application::ThreadMessages::operator ->() { ScopedLock msgLock(msg_mutex); - cthreadId_t curId = getThisThreadId() ; - threadMsgMap_t::iterator iter = m_threadMsgMap.find(curId) ; + cthreadId_t curId = getThisThreadId(); + threadMsgMap_t::iterator iter = m_threadMsgMap.find(curId); if (iter != m_threadMsgMap.end()) { return iter->second.get(); } - pMessages_t pMsgs(new Messages()) ; - m_threadMsgMap.insert(std::pair< cthreadId_t, pMessages_t >(curId, pMsgs)) ; - return pMsgs.get() ; + pMessages_t pMsgs(new Messages()); + m_threadMsgMap.insert(std::pair< cthreadId_t, pMessages_t >(curId, pMsgs)); + return pMsgs.get(); } void Application::ThreadMessages::removeThreadMessages() { ScopedLock msgLock(msg_mutex); - cthreadId_t curId = getThisThreadId() ; - threadMsgMap_t::iterator iter = m_threadMsgMap.find(curId) ; + cthreadId_t curId = getThisThreadId(); + threadMsgMap_t::iterator iter = m_threadMsgMap.find(curId); if (iter != m_threadMsgMap.end()) { - m_threadMsgMap.erase(iter) ; + m_threadMsgMap.erase(iter); } } #endif // THREAD_SAFE_CANTERA @@ -173,7 +173,7 @@ Application::Application() : // output / standard error setDefaultDirectories(); #if defined(THREAD_SAFE_CANTERA) - Unit::units() ; + Unit::units(); #endif } @@ -219,7 +219,7 @@ void Application::warn_deprecated(const std::string& method, void Application::thread_complete() { #if defined(THREAD_SAFE_CANTERA) - pMessenger.removeThreadMessages() ; + pMessenger.removeThreadMessages(); #endif } @@ -333,8 +333,8 @@ long int Application::readStringRegistryKey(const std::string& keyName, const st void Application::Messages::popError() { if (!errorMessage.empty()) { - errorRoutine.pop_back() ; - errorMessage.pop_back() ; + errorRoutine.pop_back(); + errorMessage.pop_back(); } } diff --git a/src/base/application.h b/src/base/application.h index a7c0f36b3..a750ac811 100644 --- a/src/base/application.h +++ b/src/base/application.h @@ -69,7 +69,7 @@ protected: /*! * @ingroup errorhandling */ - int getErrorCount() ; + int getErrorCount(); //! Discard the last error message /*! @@ -79,7 +79,7 @@ protected: * * @ingroup errorhandling */ - void popError() ; + void popError(); //! Retrieve the last error message in a string /*! @@ -88,7 +88,7 @@ protected: * * @ingroup errorhandling */ - std::string lastErrorMessage() ; + std::string lastErrorMessage(); //! Prints all of the error messages to an ostream /*! @@ -102,7 +102,7 @@ protected: * * @ingroup errorhandling */ - void getErrors(std::ostream& f) ; + void getErrors(std::ostream& f); //! Prints all of the error messages using writelog /*! @@ -143,7 +143,7 @@ protected: * @see Logger. * @ingroup textlogs */ - void setLogger(Logger* logwriter) ; + void setLogger(Logger* logwriter); protected: //! Current list of error messages @@ -154,11 +154,11 @@ protected: //! Current pointer to the logwriter Logger* logwriter; - } ; + }; #ifdef THREAD_SAFE_CANTERA //! Typedef for thread specific messages - typedef boost::shared_ptr< Messages > pMessages_t ; + typedef boost::shared_ptr< Messages > pMessages_t; //! Class that stores thread messages for each thread, and retrieves them //! based on the thread id. @@ -178,12 +178,12 @@ protected: void removeThreadMessages(); //! Typedef for map between a thread and the message - typedef std::map< cthreadId_t, pMessages_t > threadMsgMap_t ; + typedef std::map< cthreadId_t, pMessages_t > threadMsgMap_t; private: //! Thread Msg Map - threadMsgMap_t m_threadMsgMap ; - } ; + threadMsgMap_t m_threadMsgMap; + }; #endif protected: @@ -209,32 +209,32 @@ public: //! @copydoc Messages::addError void addError(const std::string& r, const std::string& msg) { - pMessenger->addError(r, msg) ; + pMessenger->addError(r, msg); } //! @copydoc Messages::getErrorCount int getErrorCount() { - return pMessenger->getErrorCount() ; + return pMessenger->getErrorCount(); } //! @copydoc Messages::popError void popError() { - pMessenger->popError() ; + pMessenger->popError(); } //! @copydoc Messages::lastErrorMessage std::string lastErrorMessage() { - return pMessenger->lastErrorMessage() ; + return pMessenger->lastErrorMessage(); } //! @copydoc Messages::getErrors void getErrors(std::ostream& f) { - pMessenger->getErrors(f) ; + pMessenger->getErrors(f); } //! @copydoc Messages::logErrors void logErrors() { - pMessenger->logErrors() ; + pMessenger->logErrors(); } //! Add a directory to the data file search path. @@ -243,7 +243,7 @@ public: * * @param dir String name for the directory to be added to the search path */ - void addDataDirectory(const std::string& dir) ; + void addDataDirectory(const std::string& dir); //! Find an input file. /*! @@ -270,7 +270,7 @@ public: * * @ingroup inputfiles */ - std::string findInputFile(const std::string& name) ; + std::string findInputFile(const std::string& name); //! Return a pointer to the XML tree for a Cantera input file. /*! @@ -282,7 +282,7 @@ public: * @param file String containing the relative or absolute file name * @param debug Debug flag */ - XML_Node* get_XML_File(const std::string& file, int debug=0) ; + XML_Node* get_XML_File(const std::string& file, int debug=0); //! Read a CTI or CTML string and fill up an XML tree. /*! @@ -301,7 +301,7 @@ public: * * @param file String containing the relative or absolute file name */ - void close_XML_File(const std::string& file) ; + void close_XML_File(const std::string& file); #ifdef _WIN32 long int readStringRegistryKey(const std::string& keyName, const std::string& valueName, @@ -342,7 +342,7 @@ public: * version of Cantera has not been specifically compiled for thread safety * this function does nothing. */ - void thread_complete() ; + void thread_complete(); protected: //! Set the default directories for input files. @@ -386,14 +386,14 @@ protected: bool m_suppress_deprecation_warnings; #if defined(THREAD_SAFE_CANTERA) - ThreadMessages pMessenger ; + ThreadMessages pMessenger; #else - std::auto_ptr pMessenger ; + std::auto_ptr pMessenger; #endif private: //! Pointer to the single Application instance - static Application* s_app ; + static Application* s_app; }; } diff --git a/src/base/ct2ctml.cpp b/src/base/ct2ctml.cpp index fae0d35a0..99220822f 100644 --- a/src/base/ct2ctml.cpp +++ b/src/base/ct2ctml.cpp @@ -60,7 +60,7 @@ void ct2ctml(const char* file, const int debug) // For Windows, make the path POSIX compliant so code looking for directory // separators is simpler. Just look for '/' not both '/' and '\\' std::replace_if(out_name.begin(), out_name.end(), - std::bind2nd(std::equal_to(), '\\'), '/') ; + std::bind2nd(std::equal_to(), '\\'), '/'); #endif size_t idir = out_name.rfind('/'); if (idir != npos) { diff --git a/src/base/ctml.cpp b/src/base/ctml.cpp index 74243611b..fcb9706cf 100644 --- a/src/base/ctml.cpp +++ b/src/base/ctml.cpp @@ -215,14 +215,14 @@ doublereal getFloatCurrent(const XML_Node& node, const std::string& type) } else if (type != "" && units != "") { fctr = toSI(units); #ifdef DEBUG_MODE - writelog("\nWarning: conversion toSI() was done on node value " + node.name() + + writelog("\nWarning: conversion toSI() was done on node value " + node.name() + "but wasn't explicitly requested. Type was \"" + type + "\"\n"); #endif #ifdef DEBUG_MODE_MORE } else if (type == "" && units != "") { // Note, below currently produces a lot of output due to transport blocks. // This needs to be addressed. - writelog("\nWarning: XML node " + node.name() + + writelog("\nWarning: XML node " + node.name() + "has a units attribute, \"" + units + "\"," "but no conversion was done because the getFloat() command didn't have a type\n"); #endif diff --git a/src/base/global.cpp b/src/base/global.cpp index ccdfb954e..6df7aad3f 100644 --- a/src/base/global.cpp +++ b/src/base/global.cpp @@ -16,7 +16,7 @@ namespace Cantera //! Return a pointer to the application object static Application* app() { - return Application::Instance() ; + return Application::Instance(); } // **************** Text Logging **************** @@ -24,7 +24,7 @@ static Application* app() void setLogger(Logger* logwriter) { try { - app()->setLogger(logwriter) ; + app()->setLogger(logwriter); } catch (std::bad_alloc) { logwriter->error("bad alloc thrown by app()"); } @@ -37,20 +37,20 @@ void writelog(const std::string& msg) void writelogf(const char* fmt,...) { - enum { BUFSIZE = 2048 } ; - char sbuf[BUFSIZE] ; + enum { BUFSIZE = 2048 }; + char sbuf[BUFSIZE]; - va_list args ; - va_start(args, fmt) ; + va_list args; + va_start(args, fmt); #ifdef _MSC_VER - _vsnprintf(sbuf, BUFSIZE, fmt, args) ; + _vsnprintf(sbuf, BUFSIZE, fmt, args); #else - vsprintf(sbuf, fmt, args) ; + vsprintf(sbuf, fmt, args); #endif - writelog(sbuf) ; - va_end(args) ; + writelog(sbuf); + va_end(args); } void writelogendl() @@ -86,19 +86,19 @@ mutex_t Unit::units_mutex; void appdelete() { - Application::ApplicationDestroy() ; + Application::ApplicationDestroy(); FactoryBase::deleteFactories(); Unit::deleteUnit(); } void thread_complete() { - app()->thread_complete() ; + app()->thread_complete(); } XML_Node* get_XML_File(const std::string& file, int debug) { - XML_Node* xtmp = app()->get_XML_File(file, debug) ; + XML_Node* xtmp = app()->get_XML_File(file, debug); return xtmp; } @@ -109,7 +109,7 @@ XML_Node* get_XML_from_string(const std::string& text) void close_XML_File(const std::string& file) { - app()->close_XML_File(file) ; + app()->close_XML_File(file); } int nErrors() @@ -119,37 +119,37 @@ int nErrors() void popError() { - app()->popError() ; + app()->popError(); } string lastErrorMessage() { - return app()->lastErrorMessage() ; + return app()->lastErrorMessage(); } void showErrors(std::ostream& f) { - app()->getErrors(f) ; + app()->getErrors(f); } void showErrors() { - app()->logErrors() ; + app()->logErrors(); } void setError(const std::string& r, const std::string& msg) { - app()->addError(r, msg) ; + app()->addError(r, msg); } void addDirectory(const std::string& dir) { - app()->addDataDirectory(dir) ; + app()->addDataDirectory(dir); } std::string findInputFile(const std::string& name) { - return app()->findInputFile(name) ; + return app()->findInputFile(name); } doublereal toSI(const std::string& unit) diff --git a/src/base/stringUtils.cpp b/src/base/stringUtils.cpp index 0cd26b87e..432e77b01 100644 --- a/src/base/stringUtils.cpp +++ b/src/base/stringUtils.cpp @@ -257,7 +257,7 @@ std::string parseSpeciesName(const std::string& nameStr, std::string& phaseName) if (icolon != std::string::npos) { phaseName = s.substr(0, icolon); s = s.substr(icolon+1, s.size()); - icolon = s.find(':'); + icolon = s.find(':'); if (icolon != std::string::npos) { throw CanteraError("parseSpeciesName()", "two colons in name: " + nameStr); } diff --git a/src/base/units.h b/src/base/units.h index d558d42ee..d143b3eee 100644 --- a/src/base/units.h +++ b/src/base/units.h @@ -64,7 +64,7 @@ public: * Return the multiplier required to convert a dimensional quantity * with units specified by string 'units' to SI units. * The list of recognized units is stored as a stl map - * called m_u[] and m_act_u for activity + * called m_u[] and m_act_u for activity * coefficients. These maps are initialized with likely values. * * @param units_ String containing the units description @@ -165,74 +165,74 @@ private: m_u["1"] = 1.0; // length - m_u["m"] = 1.0; - m_u["cm"] = 0.01; - m_u["km"] = 1.0e3; - m_u["mm"] = 1.0e-3; - m_u["micron"] = 1.0e-6; - m_u["nm"] = 1.0e-9; - m_u["A"] = 1.0e-10; - m_u["Angstrom"] = 1.0e-10; - m_u["Angstroms"] = 1.0e-10; + m_u["m"] = 1.0; + m_u["cm"] = 0.01; + m_u["km"] = 1.0e3; + m_u["mm"] = 1.0e-3; + m_u["micron"] = 1.0e-6; + m_u["nm"] = 1.0e-9; + m_u["A"] = 1.0e-10; + m_u["Angstrom"] = 1.0e-10; + m_u["Angstroms"] = 1.0e-10; // energy - m_u["J"] = 1.0; - m_u["kJ"] = 1.0e3; - m_u["cal"] = 4.184; - m_u["kcal"] = 4184.0; - m_u["eV"] = Faraday; //1.60217733e-19; + m_u["J"] = 1.0; + m_u["kJ"] = 1.0e3; + m_u["cal"] = 4.184; + m_u["kcal"] = 4184.0; + m_u["eV"] = Faraday; //1.60217733e-19; // resistance - m_u["ohm"] = 1.0; + m_u["ohm"] = 1.0; // quantity - m_u["mol"] = 1.0e-3; - m_u["gmol"] = 1.0e-3; - m_u["mole"] = 1.0e-3; - m_u["kmol"] = 1.0; - m_u["kgmol"] = 1.0; - m_u["molec"] = 1.0/Avogadro; + m_u["mol"] = 1.0e-3; + m_u["gmol"] = 1.0e-3; + m_u["mole"] = 1.0e-3; + m_u["kmol"] = 1.0; + m_u["kgmol"] = 1.0; + m_u["molec"] = 1.0/Avogadro; // temperature - m_u["K"] = 1.0; - m_u["C"] = 1.0; - m_u["Kelvin"] = 1.0; + m_u["K"] = 1.0; + m_u["C"] = 1.0; + m_u["Kelvin"] = 1.0; // mass - m_u["gm"] = 1.0e-3; - m_u["g"] = 1.0e-3; - m_u["kg"] = 1.0; + m_u["gm"] = 1.0e-3; + m_u["g"] = 1.0e-3; + m_u["kg"] = 1.0; // pressure - m_u["atm"] = 1.01325e5; - m_u["bar"] = 1.0e5; - m_u["Pa"] = 1.0; + m_u["atm"] = 1.01325e5; + m_u["bar"] = 1.0e5; + m_u["Pa"] = 1.0; // time - m_u["s"] = 1.0; - m_u["min"] = 60.0; - m_u["hr"] = 3600.0; - m_u["ms"] = 0.001; + m_u["s"] = 1.0; + m_u["min"] = 60.0; + m_u["hr"] = 3600.0; + m_u["ms"] = 0.001; // electric potential - m_u["volt"] = 1.0; + m_u["volt"] = 1.0; // charge - m_u["coulomb"] = 1.0; + m_u["coulomb"] = 1.0; /* // frequency - Took frequency out to reevaluate it. Inverse cm is probably the wrong default unit - m_u["hZ"] = 0.01/(lightSpeed); - m_u["cm^-1"] = 1.0; - m_u["m^-1"] = 0.1; - m_u["cm-1"] = m_u["cm^-1"]; - m_u["m-1"] = m_u["m^-1"]; + m_u["hZ"] = 0.01/(lightSpeed); + m_u["cm^-1"] = 1.0; + m_u["m^-1"] = 0.1; + m_u["cm-1"] = m_u["cm^-1"]; + m_u["m-1"] = m_u["m^-1"]; m_u["wavenumbers"] = m_u["cm^-1"]; */ // viscosity m_u["Pa-s"] = 1; - m_u["poise"] = 0.1; + m_u["poise"] = 0.1; m_u["centipoise"] = 0.001; m_u["P"] = 0.1; m_u["cP"] = 0.001; @@ -247,8 +247,8 @@ private: m_u["cc"] = 1.0e-6; m_act_u["eV"] = m_u["eV"]; // /m_u["molec"]; - m_act_u["K"] = GasConstant; - m_act_u["Kelvin"] = GasConstant; + m_act_u["K"] = GasConstant; + m_act_u["Kelvin"] = GasConstant; m_act_u["Dimensionless"] = (GasConstant * 273.15); } }; diff --git a/src/base/xml.cpp b/src/base/xml.cpp index 2c0b97755..29efeee48 100644 --- a/src/base/xml.cpp +++ b/src/base/xml.cpp @@ -241,7 +241,7 @@ std::string XML_Reader::readTag(std::map& attribs) { string name, tag = ""; bool incomment = false; - char ch = '-'; + char ch = '-'; while (true) { if (m_s.eof() || (getchr(ch), ch == '<')) { break; @@ -396,7 +396,7 @@ void XML_Node::addComment(const std::string& comment) XML_Node& XML_Node::mergeAsChild(XML_Node& node) { m_children.push_back(&node); - m_childindex.insert(pair(node.name(), m_children.back())); + m_childindex.insert(pair(node.name(), m_children.back())); node.setRoot(root()); node.setParent(this); return *m_children.back(); @@ -461,7 +461,7 @@ std::string XML_Node::value() const return m_value; } -doublereal XML_Node::fp_value() const +doublereal XML_Node::fp_value() const { return fpValueCheck(m_value); } diff --git a/src/equil/BasisOptimize.cpp b/src/equil/BasisOptimize.cpp index b31ef5898..fdf5ccf1c 100644 --- a/src/equil/BasisOptimize.cpp +++ b/src/equil/BasisOptimize.cpp @@ -28,7 +28,7 @@ size_t BasisOptimize(int* usedZeroedSpecies, bool doFormRxn, MultiPhase* mphase, std::vector& orderVectorElements, vector_fp& formRxnMatrix) { - size_t j, jj, k=0, kk, l, i, jl, ml; + size_t j, jj, k=0, kk, l, i, jl, ml; std::string ename; std::string sname; /* diff --git a/src/equil/ChemEquil.cpp b/src/equil/ChemEquil.cpp index 6dcefbc07..b79ebcf9c 100644 --- a/src/equil/ChemEquil.cpp +++ b/src/equil/ChemEquil.cpp @@ -306,7 +306,7 @@ int ChemEquil::estimateElementPotentials(thermo_t& s, vector_fp& lambda_RT, for (size_t m = 0; m < m_nComponents; m++) { lambda_RT[m_orderVectorElements[m]] = b[m]; } - for (size_t m = m_nComponents; m < m_mm; m++) { + for (size_t m = m_nComponents; m < m_mm; m++) { lambda_RT[m_orderVectorElements[m]] = 0.0; } @@ -320,7 +320,7 @@ int ChemEquil::estimateElementPotentials(thermo_t& s, vector_fp& lambda_RT, tmp += nAtoms(isp, n) * lambda_RT[n]; } writelogf("%3d %16s %10.5g %10.5g %10.5g\n", - m, sname.c_str(), mu_RT[isp], tmp, tmp - mu_RT[isp]); + m, sname.c_str(), mu_RT[isp], tmp, tmp - mu_RT[isp]); } writelog(" id ElName Lambda_RT\n"); @@ -426,9 +426,9 @@ int ChemEquil::equilibrate(thermo_t& s, const char* XYstr, size_t mm = m_mm; size_t nvar = mm + 1; - DenseMatrix jac(nvar, nvar); // Jacobian - vector_fp x(nvar, -102.0); // solution vector - vector_fp res_trial(nvar, 0.0); // residual + DenseMatrix jac(nvar, nvar); // Jacobian + vector_fp x(nvar, -102.0); // solution vector + vector_fp res_trial(nvar, 0.0); // residual /* * Replace one of the element abundance fraction equations @@ -617,8 +617,8 @@ int ChemEquil::equilibrate(thermo_t& s, const char* XYstr, above[mm] = log(s.maxTemp() + 25.0); below[mm] = log(s.minTemp() - 25.0); - vector_fp grad(nvar, 0.0); // gradient of f = F*F/2 - vector_fp oldx(nvar, 0.0); // old solution + vector_fp grad(nvar, 0.0); // gradient of f = F*F/2 + vector_fp oldx(nvar, 0.0); // old solution vector_fp oldresid(nvar, 0.0); doublereal f, oldf; doublereal fctr = 1.0, newval; @@ -634,7 +634,7 @@ int ChemEquil::equilibrate(thermo_t& s, const char* XYstr, deltay = (yy - yval)/yval; bool passThis = true; for (m = 0; m < nvar; m++) { - double tval = options.relTolerance; + double tval = options.relTolerance; if (m < mm) { /* * Special case convergence requirements for electron element. @@ -1001,7 +1001,7 @@ int ChemEquil::estimateEP_Brinkley(thermo_t& s, vector_fp& x, for (m = 0; m < m_mm; m++) { elMolesTotal += elMoles[m]; for (k = 0; k < m_kk; k++) { - eMolesFix[m] += nAtoms(k,m) * n_i[k]; + eMolesFix[m] += nAtoms(k,m) * n_i[k]; } } @@ -1094,7 +1094,7 @@ int ChemEquil::estimateEP_Brinkley(thermo_t& s, vector_fp& x, writelog(" Species: Calculated_Moles Calculated_Mole_Fraction\n"); for (k = 0; k < m_kk; k++) { string nnn = s.speciesName(k); - writelogf("%15s: %10.5g %10.5g\n", nnn.c_str(), n_i_calc[k], Xmol_i_calc[k]); + writelogf("%15s: %10.5g %10.5g\n", nnn.c_str(), n_i_calc[k], Xmol_i_calc[k]); } writelogf("%15s: %10.5g\n", "Total Molar Sum", n_t_calc); writelogf("(iter %d) element moles bal: Goal Calculated\n", iter); @@ -1185,7 +1185,7 @@ int ChemEquil::estimateEP_Brinkley(thermo_t& s, vector_fp& x, for (m = 0; m < m_mm; m++) { size_t kMSp = npos; size_t kMSp2 = npos; - int nSpeciesWithElem = 0; + int nSpeciesWithElem = 0; for (k = 0; k < m_kk; k++) { if (n_i_calc[k] > nCutoff && fabs(nAtoms(k,m)) > 0.001) { nSpeciesWithElem++; @@ -1193,7 +1193,7 @@ int ChemEquil::estimateEP_Brinkley(thermo_t& s, vector_fp& x, kMSp2 = k; double factor = fabs(nAtoms(kMSp,m) / nAtoms(kMSp2,m)); for (n = 0; n < m_mm; n++) { - if (fabs(factor * nAtoms(kMSp2,n) - nAtoms(kMSp,n)) > 1.0E-8) { + if (fabs(factor * nAtoms(kMSp2,n) - nAtoms(kMSp,n)) > 1.0E-8) { lumpSum[m] = 0; break; } @@ -1453,7 +1453,7 @@ int ChemEquil::estimateEP_Brinkley(thermo_t& s, vector_fp& x, string eee = s.elementName(m); writelogf(" %5s %10.5g %10.5g %10.5g\n", eee.c_str(), x_old[m], x[m], resid[m]); } - writelogf(" n_t %10.5g %10.5g %10.5g \n", x_old[m_mm], n_t, exp(resid[m_mm])); + writelogf(" n_t %10.5g %10.5g %10.5g \n", x_old[m_mm], n_t, exp(resid[m_mm])); } } if (DEBUG_MODE_ENABLED && ChemEquil_print_lvl > 0) { diff --git a/src/equil/MultiPhase.cpp b/src/equil/MultiPhase.cpp index af9d82dbe..c01541097 100644 --- a/src/equil/MultiPhase.cpp +++ b/src/equil/MultiPhase.cpp @@ -498,7 +498,7 @@ void MultiPhase::setState_TP(const doublereal T, const doublereal Pres) if (!m_init) { init(); } - m_temp = T; + m_temp = T; m_press = Pres; updatePhases(); } @@ -506,7 +506,7 @@ void MultiPhase::setState_TP(const doublereal T, const doublereal Pres) void MultiPhase::setState_TPMoles(const doublereal T, const doublereal Pres, const doublereal* n) { - m_temp = T; + m_temp = T; m_press = Pres; setMoles(n); } @@ -584,8 +584,8 @@ double MultiPhase::equilibrate_MultiPhaseEquil(int XY, doublereal err, return err; } else if (XY == HP) { h0 = enthalpy(); - Tlow = 0.5*m_Tmin; // lower bound on T - Thigh = 2.0*m_Tmax; // upper bound on T + Tlow = 0.5*m_Tmin; // lower bound on T + Thigh = 2.0*m_Tmax; // upper bound on T for (n = 0; n < maxiter; n++) { // if 'strt' is false, the current composition will be used as // the starting estimate; otherwise it will be estimated @@ -659,7 +659,7 @@ double MultiPhase::equilibrate_MultiPhaseEquil(int XY, doublereal err, "No convergence for T"); } else if (XY == SP) { s0 = entropy(); - Tlow = 1.0; // lower bound on T + Tlow = 1.0; // lower bound on T Thigh = 1.0e6; // upper bound on T for (n = 0; n < maxiter; n++) { MultiPhaseEquil e(this, strt); diff --git a/src/equil/MultiPhaseEquil.cpp b/src/equil/MultiPhaseEquil.cpp index 00c4175b0..d90af79b2 100644 --- a/src/equil/MultiPhaseEquil.cpp +++ b/src/equil/MultiPhaseEquil.cpp @@ -485,7 +485,7 @@ doublereal MultiPhaseEquil::stepComposition(int loglevel) // goes away. First we'll determine an upper bound on omega, // such that all if (m_dsoln[k] == 1) { - if ((m_moles[k] > MAJOR_THRESHOLD) || (ik < m_nel)) { + if ((m_moles[k] > MAJOR_THRESHOLD) || (ik < m_nel)) { if (m_moles[k] < MAJOR_THRESHOLD) { m_force = true; } @@ -720,7 +720,7 @@ void MultiPhaseEquil::reportCSV(const std::string& reportFile) vol = 0.0; for (size_t iphase = 0; iphase < nphase; iphase++) { - istart = m_mix->speciesIndex(0, iphase); + istart = m_mix->speciesIndex(0, iphase); ThermoPhase& tref = m_mix->phase(iphase); nSpecies = tref.nSpecies(); VolPM.resize(nSpecies, 0.0); @@ -742,7 +742,7 @@ void MultiPhaseEquil::reportCSV(const std::string& reportFile) fprintf(FP,"Total Volume = %11.5g m**3\n", vol); for (size_t iphase = 0; iphase < nphase; iphase++) { - istart = m_mix->speciesIndex(0, iphase); + istart = m_mix->speciesIndex(0, iphase); ThermoPhase& tref = m_mix->phase(iphase); ThermoPhase* tp = &tref; tp->getMoleFractions(&mf[istart]); @@ -790,7 +790,7 @@ void MultiPhaseEquil::reportCSV(const std::string& reportFile) mf[istart + k], molalities[k], ac[k], activity[k], mu0[k]*1.0E-6, mu[k]*1.0E-6, mf[istart + k] * TMolesPhase, - VolPM[k], VolPhaseVolumes); + VolPM[k], VolPhaseVolumes); } } else { if (iphase == 0) { @@ -811,10 +811,10 @@ void MultiPhaseEquil::reportCSV(const std::string& reportFile) "%11.3e, %11.3e,% 11.3e, %11.3e, %11.3e\n", sName.c_str(), phaseName.c_str(), TMolesPhase, - mf[istart + k], molalities[k], ac[k], + mf[istart + k], molalities[k], ac[k], activity[k], mu0[k]*1.0E-6, mu[k]*1.0E-6, mf[istart + k] * TMolesPhase, - VolPM[k], VolPhaseVolumes); + VolPM[k], VolPhaseVolumes); } } } diff --git a/src/equil/vcs_MultiPhaseEquil.cpp b/src/equil/vcs_MultiPhaseEquil.cpp index 75aee1f77..e1dd20180 100644 --- a/src/equil/vcs_MultiPhaseEquil.cpp +++ b/src/equil/vcs_MultiPhaseEquil.cpp @@ -408,13 +408,13 @@ int vcs_MultiPhaseEquil::equilibrate(int XY, int estimateEquil, } else { xtarget = m_mix->IntEnergy(); } - double Tlow = 0.5 * m_mix->minTemp(); + double Tlow = 0.5 * m_mix->minTemp(); double Thigh = 2.0 * m_mix->maxTemp(); return equilibrate_HP(xtarget, XY, Tlow, Thigh, estimateEquil, printLvl, err, maxsteps, loglevel); } else if (XY == SP) { xtarget = m_mix->entropy(); - double Tlow = 0.5 * m_mix->minTemp(); + double Tlow = 0.5 * m_mix->minTemp(); double Thigh = 2.0 * m_mix->maxTemp(); return equilibrate_SP(xtarget, Tlow, Thigh, estimateEquil, printLvl, err, maxsteps, loglevel); @@ -524,7 +524,7 @@ int vcs_MultiPhaseEquil::equilibrate_TP(int estimateEquil, plogf("\nVCS FAILED TO CONVERGE!\n"); } plogf("\n"); - plogf("Temperature = %g Kelvin\n", m_vprob.T); + plogf("Temperature = %g Kelvin\n", m_vprob.T); plogf("Pressure = %g Pa\n", m_vprob.PresPA); plogf("\n"); plogf("----------------------------------------" @@ -676,7 +676,7 @@ void vcs_MultiPhaseEquil::reportCSV(const std::string& reportFile) mf[istart + k], molalities[k], ac[k], activity[k], mu0[k]*1.0E-6, mu[k]*1.0E-6, mf[istart + k] * TMolesPhase, - VolPM[k], VolPhaseVolumes); + VolPM[k], VolPhaseVolumes); } } else { if (iphase == 0) { @@ -697,10 +697,10 @@ void vcs_MultiPhaseEquil::reportCSV(const std::string& reportFile) "%11.3e, %11.3e,% 11.3e, %11.3e, %11.3e\n", sName.c_str(), phaseName.c_str(), TMolesPhase, - mf[istart + k], molalities[k], ac[k], + mf[istart + k], molalities[k], ac[k], activity[k], mu0[k]*1.0E-6, mu[k]*1.0E-6, mf[istart + k] * TMolesPhase, - VolPM[k], VolPhaseVolumes); + VolPM[k], VolPhaseVolumes); } } @@ -726,7 +726,7 @@ void vcs_MultiPhaseEquil::reportCSV(const std::string& reportFile) * HKM -> Work on transferring the current value of the voltages into the * equilibrium problem. */ -int vcs_Cantera_to_vprob(MultiPhase* mphase, VCS_PROB* vprob) +int vcs_Cantera_to_vprob(MultiPhase* mphase, VCS_PROB* vprob) { VCS_SPECIES_THERMO* ts_ptr = 0; @@ -738,17 +738,17 @@ int vcs_Cantera_to_vprob(MultiPhase* mphase, VCS_PROB* vprob) // Problem type has yet to be worked out. vprob->prob_type = 0; - vprob->nspecies = totNumSpecies; - vprob->ne = 0; - vprob->NPhase = totNumPhases; - vprob->m_VCS_UnitsFormat = VCS_UNITS_MKS; + vprob->nspecies = totNumSpecies; + vprob->ne = 0; + vprob->NPhase = totNumPhases; + vprob->m_VCS_UnitsFormat = VCS_UNITS_MKS; // Set the initial estimate to a machine generated estimate for now // We will work out the details later. - vprob->iest = -1; - vprob->T = mphase->temperature(); - vprob->PresPA = mphase->pressure(); - vprob->Vol = mphase->volume(); - vprob->Title = "MultiPhase Object"; + vprob->iest = -1; + vprob->T = mphase->temperature(); + vprob->PresPA = mphase->pressure(); + vprob->Vol = mphase->volume(); + vprob->Title = "MultiPhase Object"; int printLvl = vprob->m_printLvl; @@ -823,7 +823,7 @@ int vcs_Cantera_to_vprob(MultiPhase* mphase, VCS_PROB* vprob) case cStoichSubstance: VolPhase->m_eqnState = VCS_EOS_STOICH_SUB; break; - case cPureFluid: + case cPureFluid: if (printLvl > 1) { plogf("cPureFluid not recognized yet by VCSnonideal\n"); } @@ -964,17 +964,17 @@ int vcs_Cantera_to_vprob(MultiPhase* mphase, VCS_PROB* vprob) double c[4]; double minTemp, maxTemp, refPressure; sp.reportParams(k, spType, c, minTemp, maxTemp, refPressure); - ts_ptr->SS0_Model = VCS_SS0_CONSTANT; - ts_ptr->SS0_T0 = c[0]; - ts_ptr->SS0_H0 = c[1]; - ts_ptr->SS0_S0 = c[2]; + ts_ptr->SS0_Model = VCS_SS0_CONSTANT; + ts_ptr->SS0_T0 = c[0]; + ts_ptr->SS0_H0 = c[1]; + ts_ptr->SS0_S0 = c[2]; ts_ptr->SS0_Cp0 = c[3]; if (gasPhase) { ts_ptr->SSStar_Model = VCS_SSSTAR_IDEAL_GAS; - ts_ptr->SSStar_Vol_Model = VCS_SSVOL_IDEALGAS; + ts_ptr->SSStar_Vol_Model = VCS_SSVOL_IDEALGAS; } else { ts_ptr->SSStar_Model = VCS_SSSTAR_CONSTANT; - ts_ptr->SSStar_Vol_Model = VCS_SSVOL_CONSTANT; + ts_ptr->SSStar_Vol_Model = VCS_SSVOL_CONSTANT; } } else { if (vprob->m_printLvl > 2) { @@ -1063,9 +1063,9 @@ int vcs_Cantera_to_vprob(MultiPhase* mphase, VCS_PROB* vprob) plogf("%16s %5d %16s", vprob->SpName[i].c_str(), iphase, VolPhase->PhaseName.c_str()); if (vprob->SpeciesUnknownType[i] == VCS_SPECIES_TYPE_INTERFACIALVOLTAGE) { - plogf(" Volts = %-10.5g\n", vprob->w[i]); + plogf(" Volts = %-10.5g\n", vprob->w[i]); } else { - plogf(" %-10.5g\n", vprob->w[i]); + plogf(" %-10.5g\n", vprob->w[i]); } } @@ -1081,10 +1081,10 @@ int vcs_Cantera_to_vprob(MultiPhase* mphase, VCS_PROB* vprob) vcs_VolPhase* VolPhase = vprob->VPhaseList[iphase]; std::string sEOS = string16_EOSType(VolPhase->m_eqnState); plogf("%16s %5d %5d %8d %16s %8d %16e ", VolPhase->PhaseName.c_str(), - VolPhase->VP_ID_, VolPhase->m_singleSpecies, - VolPhase->m_gasPhase, sEOS.c_str(), + VolPhase->VP_ID_, VolPhase->m_singleSpecies, + VolPhase->m_gasPhase, sEOS.c_str(), VolPhase->nSpecies(), VolPhase->totalMolesInert()); - plogf("%16e\n", VolPhase->totalMoles()); + plogf("%16e\n", VolPhase->totalMoles()); } writeline('=', 80, true, true); @@ -1106,10 +1106,10 @@ int vcs_Cantera_update_vprob(MultiPhase* mphase, VCS_PROB* vprob) vprob->prob_type = 0; // Whether we have an estimate or not gets overwritten on // the call to the equilibrium solver. - vprob->iest = -1; - vprob->T = mphase->temperature(); - vprob->PresPA = mphase->pressure(); - vprob->Vol = mphase->volume(); + vprob->iest = -1; + vprob->T = mphase->temperature(); + vprob->PresPA = mphase->pressure(); + vprob->Vol = mphase->volume(); for (size_t iphase = 0; iphase < totNumPhases; iphase++) { ThermoPhase* tPhase = &mphase->phase(iphase); @@ -1182,9 +1182,9 @@ int vcs_Cantera_update_vprob(MultiPhase* mphase, VCS_PROB* vprob) plogf("%16s %5d %16s", vprob->SpName[i].c_str(), iphase, VolPhase->PhaseName.c_str()); if (vprob->SpeciesUnknownType[i] == VCS_SPECIES_TYPE_INTERFACIALVOLTAGE) { - plogf(" Volts = %-10.5g\n", vprob->w[i]); + plogf(" Volts = %-10.5g\n", vprob->w[i]); } else { - plogf(" %-10.5g\n", vprob->w[i]); + plogf(" %-10.5g\n", vprob->w[i]); } } @@ -1200,10 +1200,10 @@ int vcs_Cantera_update_vprob(MultiPhase* mphase, VCS_PROB* vprob) vcs_VolPhase* VolPhase = vprob->VPhaseList[iphase]; std::string sEOS = string16_EOSType(VolPhase->m_eqnState); plogf("%16s %5d %5d %8d %16s %8d %16e ", VolPhase->PhaseName.c_str(), - VolPhase->VP_ID_, VolPhase->m_singleSpecies, - VolPhase->m_gasPhase, sEOS.c_str(), + VolPhase->VP_ID_, VolPhase->m_singleSpecies, + VolPhase->m_gasPhase, sEOS.c_str(), VolPhase->nSpecies(), VolPhase->totalMolesInert()); - plogf("%16e\n", VolPhase->totalMoles()); + plogf("%16e\n", VolPhase->totalMoles()); } writeline('=', 80, true, true); @@ -1312,7 +1312,7 @@ int vcs_MultiPhaseEquil::determine_PhaseStability(int iph, double& funcStab, int if (printLvl > 0) { plogf("\n Results from vcs_PS:\n"); plogf("\n"); - plogf("Temperature = %g Kelvin\n", m_vprob.T); + 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) { diff --git a/src/equil/vcs_SpeciesProperties.cpp b/src/equil/vcs_SpeciesProperties.cpp index 23315fa9a..f7fccf762 100644 --- a/src/equil/vcs_SpeciesProperties.cpp +++ b/src/equil/vcs_SpeciesProperties.cpp @@ -43,16 +43,16 @@ vcs_SpeciesProperties& vcs_SpeciesProperties::operator=(const vcs_SpeciesProperties& b) { if (&b != this) { - IndexPhase = b.IndexPhase; - IndexSpeciesPhase = b.IndexSpeciesPhase; - OwningPhase = b.OwningPhase; - NumElements = b.NumElements; - SpName = b.SpName; - WtSpecies = b.WtSpecies; - FormulaMatrixCol = b.FormulaMatrixCol; - Charge = b.Charge; - SurfaceSpecies = b.SurfaceSpecies; - VolPM = b.VolPM; + IndexPhase = b.IndexPhase; + IndexSpeciesPhase = b.IndexSpeciesPhase; + OwningPhase = b.OwningPhase; + NumElements = b.NumElements; + SpName = b.SpName; + WtSpecies = b.WtSpecies; + FormulaMatrixCol = b.FormulaMatrixCol; + Charge = b.Charge; + SurfaceSpecies = b.SurfaceSpecies; + VolPM = b.VolPM; ReferenceMoleFraction = b.ReferenceMoleFraction; } return *this; diff --git a/src/equil/vcs_TP.cpp b/src/equil/vcs_TP.cpp index 0bf247fa9..803bcc533 100644 --- a/src/equil/vcs_TP.cpp +++ b/src/equil/vcs_TP.cpp @@ -42,7 +42,7 @@ int VCS_SOLVE::vcs_TP(int ipr, int ip1, int maxit, double T_arg, double pres_arg * (all information concerning Temperature and Pressure has already * been derived. The free energies are now in dimensionless form.) */ - iconv = vcs_solve_TP(ipr, ip1, maxit); + iconv = vcs_solve_TP(ipr, ip1, maxit); /* * Redimensionalize the free energies using @@ -76,7 +76,7 @@ int VCS_SOLVE::vcs_evalSS_TP(int ipr, int ip1, double Temp, double pres) if (m_VCS_UnitsFormat == VCS_UNITS_UNITLESS) { for (size_t i = 0; i < m_numSpeciesTot; ++i) { - m_SSfeSpecies[i] /= Temp; + m_SSfeSpecies[i] /= Temp; } } return VCS_SUCCESS; diff --git a/src/equil/vcs_VolPhase.cpp b/src/equil/vcs_VolPhase.cpp index 82c4112c7..0af9649e3 100644 --- a/src/equil/vcs_VolPhase.cpp +++ b/src/equil/vcs_VolPhase.cpp @@ -111,15 +111,15 @@ vcs_VolPhase& vcs_VolPhase::operator=(const vcs_VolPhase& b) // operator but is true for a copy constructor // m_owningSolverObject = b.m_owningSolverObject; - VP_ID_ = b.VP_ID_; - m_singleSpecies = b.m_singleSpecies; - m_gasPhase = b.m_gasPhase; - m_eqnState = b.m_eqnState; + VP_ID_ = b.VP_ID_; + m_singleSpecies = b.m_singleSpecies; + m_gasPhase = b.m_gasPhase; + m_eqnState = b.m_eqnState; ChargeNeutralityElement = b.ChargeNeutralityElement; - p_VCS_UnitsFormat = b.p_VCS_UnitsFormat; + p_VCS_UnitsFormat = b.p_VCS_UnitsFormat; p_activityConvention= b.p_activityConvention; m_numSpecies = b.m_numSpecies; - m_numElemConstraints = b.m_numElemConstraints; + m_numElemConstraints = b.m_numElemConstraints; m_elementNames.resize(b.m_numElemConstraints); for (size_t e = 0; e < b.m_numElemConstraints; e++) { m_elementNames[e] = b.m_elementNames[e]; @@ -128,12 +128,12 @@ vcs_VolPhase& vcs_VolPhase::operator=(const vcs_VolPhase& b) m_elementType = b.m_elementType; m_formulaMatrix = b.m_formulaMatrix; m_speciesUnknownType = b.m_speciesUnknownType; - m_elemGlobalIndex = b.m_elemGlobalIndex; - PhaseName = b.PhaseName; - m_totalMolesInert = b.m_totalMolesInert; - m_isIdealSoln = b.m_isIdealSoln; - m_existence = b.m_existence; - m_MFStartIndex = b.m_MFStartIndex; + m_elemGlobalIndex = b.m_elemGlobalIndex; + PhaseName = b.PhaseName; + m_totalMolesInert = b.m_totalMolesInert; + m_isIdealSoln = b.m_isIdealSoln; + m_existence = b.m_existence; + m_MFStartIndex = b.m_MFStartIndex; /* * Do a shallow copy because we haven' figured this out. */ @@ -141,7 +141,7 @@ vcs_VolPhase& vcs_VolPhase::operator=(const vcs_VolPhase& b) for (size_t k = 0; k < old_num; k++) { if (ListSpeciesPtr[k]) { - delete ListSpeciesPtr[k]; + delete ListSpeciesPtr[k]; ListSpeciesPtr[k] = 0; } } @@ -157,29 +157,29 @@ vcs_VolPhase& vcs_VolPhase::operator=(const vcs_VolPhase& b) * duplicateMyselfAsThermoPhase() call here. This will * have to be looked into. */ - TP_ptr = b.TP_ptr; - v_totalMoles = b.v_totalMoles; + TP_ptr = b.TP_ptr; + v_totalMoles = b.v_totalMoles; Xmol_ = b.Xmol_; creationMoleNumbers_ = b.creationMoleNumbers_; creationGlobalRxnNumbers_ = b.creationGlobalRxnNumbers_; - m_phiVarIndex = b.m_phiVarIndex; - m_totalVol = b.m_totalVol; + m_phiVarIndex = b.m_phiVarIndex; + m_totalVol = b.m_totalVol; SS0ChemicalPotential = b.SS0ChemicalPotential; StarChemicalPotential = b.StarChemicalPotential; StarMolarVol = b.StarMolarVol; PartialMolarVol = b.PartialMolarVol; ActCoeff = b.ActCoeff; np_dLnActCoeffdMolNumber = b.np_dLnActCoeffdMolNumber; - m_vcsStateStatus = b.m_vcsStateStatus; - m_phi = b.m_phi; - m_UpToDate = false; - m_UpToDate_AC = false; - m_UpToDate_VolStar = false; - m_UpToDate_VolPM = false; - m_UpToDate_GStar = false; - m_UpToDate_G0 = false; - Temp_ = b.Temp_; - Pres_ = b.Pres_; + m_vcsStateStatus = b.m_vcsStateStatus; + m_phi = b.m_phi; + m_UpToDate = false; + m_UpToDate_AC = false; + m_UpToDate_VolStar = false; + m_UpToDate_VolPM = false; + m_UpToDate_GStar = false; + m_UpToDate_G0 = false; + Temp_ = b.Temp_; + Pres_ = b.Pres_; setState_TP(Temp_, Pres_); _updateMoleFractionDependencies(); @@ -263,13 +263,13 @@ void vcs_VolPhase::resize(const size_t phaseNum, const size_t nspecies, np_dLnActCoeffdMolNumber.resize(nspecies, nspecies, 0.0); m_speciesUnknownType.resize(nspecies, VCS_SPECIES_TYPE_MOLNUM); - m_UpToDate = false; - m_vcsStateStatus = VCS_STATECALC_OLD; - m_UpToDate_AC = false; - m_UpToDate_VolStar = false; - m_UpToDate_VolPM = false; - m_UpToDate_GStar = false; - m_UpToDate_G0 = false; + m_UpToDate = false; + m_vcsStateStatus = VCS_STATECALC_OLD; + m_UpToDate_AC = false; + m_UpToDate_VolStar = false; + m_UpToDate_VolPM = false; + m_UpToDate_GStar = false; + m_UpToDate_G0 = false; elemResize(numElem); } @@ -593,11 +593,11 @@ void vcs_VolPhase::setState_TP(const double temp, const double pres) TP_ptr->setState_TP(temp, pres); Temp_ = temp; Pres_ = pres; - m_UpToDate_AC = false; + m_UpToDate_AC = false; m_UpToDate_VolStar = false; - m_UpToDate_VolPM = false; - m_UpToDate_GStar = false; - m_UpToDate_G0 = false; + m_UpToDate_VolPM = false; + m_UpToDate_GStar = false; + m_UpToDate_G0 = false; } void vcs_VolPhase::setState_T(const double temp) @@ -749,7 +749,7 @@ void vcs_VolPhase::setPtrThermoPhase(ThermoPhase* tp_ptr) m_phi = TP_ptr->electricPotential(); size_t nsp = TP_ptr->nSpecies(); size_t nelem = TP_ptr->nElements(); - if (nsp != m_numSpecies) { + if (nsp != m_numSpecies) { if (m_numSpecies != 0) { plogf("Warning Nsp != NVolSpeces: %d %d \n", nsp, m_numSpecies); } @@ -826,7 +826,7 @@ void vcs_VolPhase::setTotalMoles(const double totalMols) fp2str(totalMols) + " " + fp2str(m_totalMolesInert)); } else { if (m_singleSpecies && (m_phiVarIndex == 0)) { - m_existence = VCS_PHASE_EXIST_ALWAYS; + m_existence = VCS_PHASE_EXIST_ALWAYS; } else { if (totalMols > 0.0) { m_existence = VCS_PHASE_EXIST_YES; @@ -862,7 +862,7 @@ std::string string16_EOSType(int EOSType) case VCS_EOS_IDEAL_GAS: sprintf(st,"Ideal Gas "); break; - case VCS_EOS_STOICH_SUB: + case VCS_EOS_STOICH_SUB: sprintf(st,"Stoich Sub "); break; case VCS_EOS_IDEAL_SOLN: @@ -906,7 +906,7 @@ void vcs_VolPhase::setPhiVarIndex(size_t phiVarIndex) vcs_SpeciesProperties* vcs_VolPhase::speciesProperty(const size_t kindex) { - return ListSpeciesPtr[kindex]; + return ListSpeciesPtr[kindex]; } int vcs_VolPhase::exists() const diff --git a/src/equil/vcs_elem.cpp b/src/equil/vcs_elem.cpp index 8f5e3d0e7..c3037c744 100644 --- a/src/equil/vcs_elem.cpp +++ b/src/equil/vcs_elem.cpp @@ -278,7 +278,7 @@ int VCS_SOLVE::vcs_elcorr(double aa[], double x[]) m_molNumSpecies_old[i] = tmp; } else { if (m_SSPhase[i]) { - m_molNumSpecies_old[i] = 0.0; + m_molNumSpecies_old[i] = 0.0; } else { m_molNumSpecies_old[i] = m_molNumSpecies_old[i] * 0.0001; } @@ -291,7 +291,7 @@ int VCS_SOLVE::vcs_elcorr(double aa[], double x[]) m_molNumSpecies_old[i] = tmp; } else { if (m_SSPhase[i]) { - m_molNumSpecies_old[i] = 0.0; + m_molNumSpecies_old[i] = 0.0; } else { m_molNumSpecies_old[i] = m_molNumSpecies_old[i] * 0.0001; } @@ -382,7 +382,7 @@ int VCS_SOLVE::vcs_elcorr(double aa[], double x[]) (m_elType[i] == VCS_ELEM_TYPE_ABSPOS && m_elemAbundancesGoal[i] == 0.0)) { for (size_t kspec = 0; kspec < m_numSpeciesRdc; kspec++) { if (m_elemAbundances[i] > 0.0 && m_formulaMatrix(kspec,i) < 0.0) { - m_molNumSpecies_old[kspec] -= m_elemAbundances[i] / m_formulaMatrix(kspec,i) ; + m_molNumSpecies_old[kspec] -= m_elemAbundances[i] / m_formulaMatrix(kspec,i); m_molNumSpecies_old[kspec] = std::max(m_molNumSpecies_old[kspec], 0.0); vcs_elab(); break; @@ -424,14 +424,14 @@ int VCS_SOLVE::vcs_elcorr(double aa[], double x[]) for (size_t kspec = 0; kspec < m_numSpeciesRdc; kspec++) { if (m_molNumSpecies_old[kspec] > 0.0 || useZeroed) { if (dev < 0.0 && m_formulaMatrix(kspec,i) < 0.0) { - double delta = dev / m_formulaMatrix(kspec,i) ; + double delta = dev / m_formulaMatrix(kspec,i); m_molNumSpecies_old[kspec] += delta; m_molNumSpecies_old[kspec] = std::max(m_molNumSpecies_old[kspec], 0.0); vcs_elab(); break; } if (dev > 0.0 && m_formulaMatrix(kspec,i) > 0.0) { - double delta = dev / m_formulaMatrix(kspec,i) ; + double delta = dev / m_formulaMatrix(kspec,i); m_molNumSpecies_old[kspec] += delta; m_molNumSpecies_old[kspec] = std::max(m_molNumSpecies_old[kspec], 0.0); vcs_elab(); diff --git a/src/equil/vcs_inest.cpp b/src/equil/vcs_inest.cpp index 0d4167e1d..79f1bb3c5 100644 --- a/src/equil/vcs_inest.cpp +++ b/src/equil/vcs_inest.cpp @@ -50,7 +50,7 @@ void VCS_SOLVE::vcs_inest(double* const aw, double* const sa, double* const sm, if (m_elementActive[j]) { double tmp = 0.0; for (size_t kspec = 0; kspec < nspecies; ++kspec) { - tmp += m_formulaMatrix(kspec,j) * m_molNumSpecies_old[kspec]; + tmp += m_formulaMatrix(kspec,j) * m_molNumSpecies_old[kspec]; } plogf("%s ", pprefix); plogf(" %-9.9s", m_elementName[j].c_str()); @@ -384,7 +384,7 @@ int VCS_SOLVE::vcs_inest_TP() plogendl(); } vcs_elcorr(&sm[0], &aw[0]); - rangeCheck = vcs_elabcheck(1); + rangeCheck = vcs_elabcheck(1); if (!vcs_elabcheck(0)) { plogf("%sInitial guess still fails element abundance equations\n", pprefix); diff --git a/src/equil/vcs_nondim.cpp b/src/equil/vcs_nondim.cpp index 79e24c692..606a1ec4a 100644 --- a/src/equil/vcs_nondim.cpp +++ b/src/equil/vcs_nondim.cpp @@ -65,7 +65,7 @@ void VCS_SOLVE::vcs_nondim_TP() for (size_t i = 0; i < m_numSpeciesTot; ++i) { /* * Modify the standard state and total chemical potential data, - * FF(I), to make it dimensionless, i.e., mu / RT. + * FF(I), to make it dimensionless, i.e., mu / RT. * Thus, we may divide it by the temperature. */ m_SSfeSpecies[i] *= tf; @@ -74,7 +74,7 @@ void VCS_SOLVE::vcs_nondim_TP() m_feSpecies_old[i] *= tf; } - m_Faraday_dim = vcs_nondim_Farad(m_VCS_UnitsFormat, m_temperature); + m_Faraday_dim = vcs_nondim_Farad(m_VCS_UnitsFormat, m_temperature); /* * Scale the total moles if necessary: @@ -107,9 +107,9 @@ void VCS_SOLVE::vcs_nondim_TP() // Determine the scale of the problem if (tmole_orig > 1.0E4) { - m_totalMoleScale = tmole_orig / 1.0E4; + m_totalMoleScale = tmole_orig / 1.0E4; } else if (tmole_orig < 1.0E-4) { - m_totalMoleScale = tmole_orig / 1.0E-4; + m_totalMoleScale = tmole_orig / 1.0E-4; } else { m_totalMoleScale = 1.0; } @@ -150,7 +150,7 @@ void VCS_SOLVE::vcs_redim_TP() for (size_t i = 0; i < m_numSpeciesTot; ++i) { /* * Modify the standard state and total chemical potential data, - * FF(I), to make it have units, i.e. mu = RT * mu_star + * FF(I), to make it have units, i.e. mu = RT * mu_star */ m_SSfeSpecies[i] *= tf; m_deltaGRxn_new[i] *= tf; diff --git a/src/equil/vcs_phaseStability.cpp b/src/equil/vcs_phaseStability.cpp index 788182427..a9a62d942 100644 --- a/src/equil/vcs_phaseStability.cpp +++ b/src/equil/vcs_phaseStability.cpp @@ -101,7 +101,7 @@ bool VCS_SOLVE::vcs_popPhasePossible(const size_t iphasePop) const return false; } -int VCS_SOLVE::vcs_phasePopDeterminePossibleList() +int VCS_SOLVE::vcs_phasePopDeterminePossibleList() { int nfound = 0; phasePopProblemLists_.clear(); @@ -126,7 +126,7 @@ int VCS_SOLVE::vcs_phasePopDeterminePossibleList() 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; + size_t kspec = irxn + m_numComponents; iph = m_phaseID[kspec]; vcs_VolPhase* Vphase = m_VolPhaseList[iph]; int existence = Vphase->exists(); @@ -146,7 +146,7 @@ int VCS_SOLVE::vcs_phasePopDeterminePossibleList() std::vector< std::vector > zeroedPhaseLinkedZeroComponents(m_numPhases); std::vector linkedPhases; /* - * The logic below calculates zeroedPhaseLinkedZeroComponents + * The logic below calculates zeroedPhaseLinkedZeroComponents */ for (size_t iph = 0; iph < m_numPhases; iph++) { std::vector &iphList = zeroedPhaseLinkedZeroComponents[iph]; @@ -162,7 +162,7 @@ int VCS_SOLVE::vcs_phasePopDeterminePossibleList() 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); + size_t kkspec = Vphase->spGlobalIndexVCS(kk); if (kkspec >= m_numComponents) { size_t iirxn = kkspec - m_numComponents; if (m_stoichCoeffRxnMatrix(j,iirxn) > 0.0) { @@ -180,7 +180,7 @@ int VCS_SOLVE::vcs_phasePopDeterminePossibleList() } /* - * Now fill in the phasePopProblemLists_ list. + * Now fill in the phasePopProblemLists_ list. */ for (size_t iph = 0; iph < m_numPhases; iph++) { vcs_VolPhase* Vphase = m_VolPhaseList[iph]; @@ -395,13 +395,13 @@ int VCS_SOLVE::vcs_popPhaseRxnStepSizes(const size_t iphasePop) for (size_t k = 0; k < Vphase->nSpecies(); k++) { kspec = Vphase->spGlobalIndexVCS(k); - double delmol = deltaMolNumPhase * X_est[k]; + double delmol = deltaMolNumPhase * X_est[k]; if (kspec >= m_numComponents) { irxn = kspec - m_numComponents; for (size_t j = 0; j < m_numComponents; ++j) { double stoicC = m_stoichCoeffRxnMatrix(j,irxn); if (stoicC != 0.0 && m_elType[j] == VCS_ELEM_TYPE_ABSPOS) { - molNumSpecies_tmp[j] += stoicC * delmol; + molNumSpecies_tmp[j] += stoicC * delmol; } } } @@ -505,7 +505,7 @@ double VCS_SOLVE::vcs_phaseStabilityTest(const size_t iph) } for (size_t k = 0; k < m_numComponents; k++) { - m_feSpecies_Deficient[k] = m_feSpecies_old[k]; + m_feSpecies_Deficient[k] = m_feSpecies_old[k]; } normUpdate = 0.1 * vcs_l2norm(fracDelta_new); damp = 1.0E-2; @@ -528,7 +528,7 @@ double VCS_SOLVE::vcs_phaseStabilityTest(const size_t iph) } } bool converged = false; - for (int its = 0; its < 200 && (!converged); its++) { + for (int its = 0; its < 200 && (!converged); its++) { dampOld = damp; normUpdateOld = normUpdate; fracDelta_old = fracDelta_new; @@ -540,11 +540,11 @@ double VCS_SOLVE::vcs_phaseStabilityTest(const size_t iph) size_t kc = componentList[i]; size_t kc_spec = Vphase->spGlobalIndexVCS(kc); fracDelta_old[kc] = 0.0; - for (size_t k = 0; k < nsp; k++) { + for (size_t k = 0; k < nsp; k++) { size_t kspec = Vphase->spGlobalIndexVCS(k); if (kspec >= m_numComponents) { size_t irxn = kspec - m_numComponents; - fracDelta_old[kc] += m_stoichCoeffRxnMatrix(kc_spec,irxn) * fracDelta_old[k]; + fracDelta_old[kc] += m_stoichCoeffRxnMatrix(kc_spec,irxn) * fracDelta_old[k]; } } } @@ -595,7 +595,7 @@ double VCS_SOLVE::vcs_phaseStabilityTest(const size_t iph) for (size_t i = 0; i < componentList.size(); i++) { size_t kc_spec = Vphase->spGlobalIndexVCS(componentList[i]); - for (size_t k = 0; k < Vphase->nSpecies(); k++) { + for (size_t k = 0; k < Vphase->nSpecies(); k++) { size_t kspec = Vphase->spGlobalIndexVCS(k); if (kspec >= m_numComponents) { size_t irxn = kspec - m_numComponents; @@ -621,7 +621,7 @@ double VCS_SOLVE::vcs_phaseStabilityTest(const size_t iph) size_t irxn = kspec - m_numComponents; double deltaGRxn = clip(m_deltaGRxn_Deficient[irxn], -50.0, 50.0); E_phi[k] = std::exp(-deltaGRxn) / m_actCoeffSpecies_new[kspec]; - sum += E_phi[k]; + sum += E_phi[k]; funcPhaseStability += E_phi[k]; } else { E_phi[k] = 0.0; @@ -633,7 +633,7 @@ double VCS_SOLVE::vcs_phaseStabilityTest(const size_t iph) */ for (size_t k = 0; k < nsp; k++) { size_t kspec = Vphase->spGlobalIndexVCS(k); - double b = E_phi[k] / sum * (1.0 - sum_Xcomp); + double b = E_phi[k] / sum * (1.0 - sum_Xcomp); if (kspec >= m_numComponents) { fracDelta_raw[k] = b; } diff --git a/src/equil/vcs_prep.cpp b/src/equil/vcs_prep.cpp index 8bc6f5195..5d351af5c 100644 --- a/src/equil/vcs_prep.cpp +++ b/src/equil/vcs_prep.cpp @@ -83,7 +83,7 @@ int VCS_SOLVE::vcs_prep_oneTime(int printLvl) for (size_t kspec = 0; kspec < m_numSpeciesTot; ++kspec) { size_t pID = m_phaseID[kspec]; size_t spPhIndex = m_speciesLocalPhaseIndex[kspec]; - vcs_VolPhase* vPhase = m_VolPhaseList[pID]; + vcs_VolPhase* vPhase = m_VolPhaseList[pID]; vcs_SpeciesProperties* spProp = vPhase->speciesProperty(spPhIndex); double sz = 0.0; size_t eSize = spProp->FormulaMatrixCol.size(); @@ -119,7 +119,7 @@ int VCS_SOLVE::vcs_prep_oneTime(int printLvl) double test = -1.0e-10; bool modifiedSoln = false; if (m_doEstimateEquil < 0) { - double sum = 0.0; + double sum = 0.0; for (size_t kspec = 0; kspec < m_numSpeciesTot; ++kspec) { if (m_speciesUnknownType[kspec] == VCS_SPECIES_TYPE_MOLNUM) { sum += fabs(m_molNumSpecies_old[kspec]); diff --git a/src/equil/vcs_prob.cpp b/src/equil/vcs_prob.cpp index 1543146cd..0562036ec 100644 --- a/src/equil/vcs_prob.cpp +++ b/src/equil/vcs_prob.cpp @@ -51,12 +51,12 @@ VCS_PROB::VCS_PROB(size_t nsp, size_t nel, size_t nph) : throw CanteraError("VCS_PROB::VCS_PROB", "number of species is zero or neg"); } - NE0 = ne; + NE0 = ne; if (ne <= 0) { throw CanteraError("VCS_PROB::VCS_PROB", "number of elements is zero or neg"); } - NPHASE0 = NPhase; + NPHASE0 = NPhase; if (NPhase <= 0) { throw CanteraError("VCS_PROB::VCS_PROB", "number of phases is zero or neg"); @@ -190,7 +190,7 @@ void VCS_PROB::prob_report(int print_lvl) plogf("%16s %5d %16s", SpName[i].c_str(), PhaseID[i], Vphase->PhaseName.c_str()); if (iest >= 0) { - plogf(" %-10.5g", w[i]); + plogf(" %-10.5g", w[i]); } else { plogf(" N/A"); } @@ -221,7 +221,7 @@ void VCS_PROB::prob_report(int print_lvl) plogf("%16s %8d %16e ", EOS_cstr.c_str(), Vphase->nSpecies(), Vphase->totalMolesInert()); if (iest >= 0) { - plogf("%16e\n", Vphase->totalMoles()); + plogf("%16e\n", Vphase->totalMoles()); } else { plogf(" N/A\n"); } @@ -441,7 +441,7 @@ void VCS_PROB::reportCSV(const std::string& reportFile) mf[istart + k], molalities[k], ac[k], activity[k], mu0[k]*1.0E-6, mu[k]*1.0E-6, mf[istart + k] * TMolesPhase, - volPM[k], VolPhaseVolumes); + volPM[k], VolPhaseVolumes); } } else { if (iphase == 0) { @@ -462,10 +462,10 @@ void VCS_PROB::reportCSV(const std::string& reportFile) "%11.3e, %11.3e,% 11.3e, %11.3e, %11.3e\n", sName.c_str(), phaseName.c_str(), TMolesPhase, - mf[istart + k], molalities[k], ac[k], + mf[istart + k], molalities[k], ac[k], activity[k], mu0[k]*1.0E-6, mu[k]*1.0E-6, mf[istart + k] * TMolesPhase, - volPM[k], VolPhaseVolumes); + volPM[k], VolPhaseVolumes); } } diff --git a/src/equil/vcs_report.cpp b/src/equil/vcs_report.cpp index 04e8d91ef..381693b48 100644 --- a/src/equil/vcs_report.cpp +++ b/src/equil/vcs_report.cpp @@ -128,7 +128,7 @@ int VCS_SOLVE::vcs_report(int iconv) m_VolPhaseList[i]->PhaseName.c_str()); } plogf("%14.7E %14.7E %12.4E\n", TPhInertMoles[i] * molScale, - TPhInertMoles[i] / m_tPhaseMoles_old[i], 0.0); + TPhInertMoles[i] / m_tPhaseMoles_old[i], 0.0); } } if (m_numSpeciesRdc != nspecies) { @@ -218,7 +218,7 @@ int VCS_SOLVE::vcs_report(int iconv) vcs_VolPhase* VPhase = m_VolPhaseList[iphase]; plogf("%-12.12s |",VPhase->PhaseName.c_str()); plogf("%10.3e |", m_tPhaseMoles_old[iphase]*molScale); - totalMoles += m_tPhaseMoles_old[iphase]; + totalMoles += m_tPhaseMoles_old[iphase]; if (m_tPhaseMoles_old[iphase] != VPhase->totalMoles() && !vcs_doubleEqual(m_tPhaseMoles_old[iphase], VPhase->totalMoles())) { throw CanteraError("VCS_SOLVE::vcs_report", "we have a problem"); @@ -376,7 +376,7 @@ void VCS_SOLVE::vcs_TCounters_report(int timing_print_lvl) m_VCount->T_Calls_vcs_TP, m_VCount->T_Its, m_VCount->T_Time_vcs_TP); plogf(" vcs_inest: %5d %11.5E\n", - m_VCount->T_Calls_Inest, m_VCount->T_Time_inest); + m_VCount->T_Calls_Inest, m_VCount->T_Time_inest); plogf(" vcs_TotalTime: %11.5E\n", m_VCount->T_Time_vcs); } else { diff --git a/src/equil/vcs_setMolesLinProg.cpp b/src/equil/vcs_setMolesLinProg.cpp index 5c69b08cc..5f90e744f 100644 --- a/src/equil/vcs_setMolesLinProg.cpp +++ b/src/equil/vcs_setMolesLinProg.cpp @@ -57,8 +57,8 @@ int VCS_SOLVE::vcs_setMolesLinProg() std::vector wx(m_numElemConstraints, 0.0); std::vector aw(m_numSpeciesTot, 0.0); - for (ik = 0; ik < m_numSpeciesTot; ik++) { - if (m_speciesUnknownType[ik] != VCS_SPECIES_INTERFACIALVOLTAGE) { + for (ik = 0; ik < m_numSpeciesTot; ik++) { + if (m_speciesUnknownType[ik] != VCS_SPECIES_INTERFACIALVOLTAGE) { m_molNumSpecies_old[ik] = max(0.0, m_molNumSpecies_old[ik]); } } @@ -114,7 +114,7 @@ int VCS_SOLVE::vcs_setMolesLinProg() } // fwd or rev direction. // idir > 0 implies increasing the current species - // idir < 0 implies decreasing the current species + // idir < 0 implies decreasing the current species idir = (dg_rt < 0.0 ? 1 : -1); if (idir < 0) { dxi_min = m_molNumSpecies_old[ik]; @@ -143,7 +143,7 @@ int VCS_SOLVE::vcs_setMolesLinProg() // Redo the iteration, if a component went from positive to zero on this step. double dsLocal = idir*dxi_min; m_molNumSpecies_old[ik] += dsLocal; - m_molNumSpecies_old[ik] = max(0.0, m_molNumSpecies_old[ik]); + m_molNumSpecies_old[ik] = max(0.0, m_molNumSpecies_old[ik]); for (size_t jcomp = 0; jcomp < m_numComponents; jcomp++) { bool full = false; if (m_molNumSpecies_old[jcomp] > 1.0E-15) { diff --git a/src/equil/vcs_solve.cpp b/src/equil/vcs_solve.cpp index 1b859488a..295ba912a 100644 --- a/src/equil/vcs_solve.cpp +++ b/src/equil/vcs_solve.cpp @@ -145,11 +145,11 @@ void VCS_SOLVE::vcs_initSizes(const size_t nspecies0, const size_t nelements, m_SSPhase.resize(2*nspecies0, 0); m_phaseID.resize(nspecies0, 0); - m_numElemConstraints = nelements; + m_numElemConstraints = nelements; m_elementName.resize(nelements, std::string("")); m_speciesName.resize(nspecies0, std::string("")); m_elType.resize(nelements, VCS_ELEM_TYPE_ABSPOS); - m_elementActive.resize(nelements, 1); + m_elementActive.resize(nelements, 1); /* * Malloc space for activity coefficients for all species * -> Set it equal to one. @@ -185,7 +185,7 @@ void VCS_SOLVE::vcs_initSizes(const size_t nspecies0, const size_t nelements, * Malloc space for counters kept within vcs * */ - m_VCount = new VCS_COUNTERS(); + m_VCount = new VCS_COUNTERS(); vcs_counters_init(1); if (vcs_timing_print_lvl == 0) { @@ -228,7 +228,7 @@ int VCS_SOLVE::vcs(VCS_PROB* vprob, int ifunc, int ipr, int ip1, int maxit) int retn = 0, iconv = 0; clockWC tickTock; - int iprintTime = std::max(ipr, ip1); + int iprintTime = std::max(ipr, ip1); iprintTime = std::min(iprintTime, m_timing_print_lvl); if (ifunc > 2) { @@ -361,7 +361,7 @@ int VCS_SOLVE::vcs_prob_specifyFully(const VCS_PROB* pub) * First Check to see whether we have room for the current problem * size */ - size_t nspecies = pub->nspecies; + size_t nspecies = pub->nspecies; if (NSPECIES0 < nspecies) { plogf("%sPrivate Data is dimensioned too small\n", ser); return VCS_PUB_BAD; @@ -634,7 +634,7 @@ int VCS_SOLVE::vcs_prob_specifyFully(const VCS_PROB* pub) } for (size_t i = 0; i < nelements; i++) { - if (m_elType[i] == VCS_ELEM_TYPE_CHARGENEUTRALITY) { + if (m_elType[i] == VCS_ELEM_TYPE_CHARGENEUTRALITY) { if (m_elemAbundancesGoal[i] != 0.0) { if (fabs(m_elemAbundancesGoal[i]) > 1.0E-9) { throw CanteraError("VCS_SOLVE::vcs_prob_specifyFully", @@ -877,9 +877,9 @@ int VCS_SOLVE::vcs_prob_update(VCS_PROB* pub) pub->VolPM[i] = m_PMVolumeSpecies[k1]; } - pub->T = m_temperature; + pub->T = m_temperature; pub->PresPA = m_pressurePA; - pub->Vol = m_totalVol; + pub->Vol = m_totalVol; size_t kT = 0; for (size_t iph = 0; iph < pub->NPhase; iph++) { vcs_VolPhase* pubPhase = pub->VPhaseList[iph]; @@ -912,7 +912,7 @@ int VCS_SOLVE::vcs_prob_update(VCS_PROB* pub) fp2str(pub->mf[kT]) + " " + fp2str(vPhase->molefraction(k))); } if (pubPhase->speciesUnknownType(k) != VCS_SPECIES_TYPE_INTERFACIALVOLTAGE) { - sumMoles += pub->w[kT]; + sumMoles += pub->w[kT]; } } if (! vcs_doubleEqual(sumMoles, vPhase->totalMoles())) { @@ -922,7 +922,7 @@ int VCS_SOLVE::vcs_prob_update(VCS_PROB* pub) } } - pub->m_Iterations = m_VCount->Its; + pub->m_Iterations = m_VCount->Its; pub->m_NumBasisOptimizations = m_VCount->Basis_Opts; return VCS_SUCCESS; } diff --git a/src/equil/vcs_solve_TP.cpp b/src/equil/vcs_solve_TP.cpp index 2fd3eb77d..ecb2d1205 100644 --- a/src/equil/vcs_solve_TP.cpp +++ b/src/equil/vcs_solve_TP.cpp @@ -538,7 +538,7 @@ void VCS_SOLVE::solve_tp_inner(size_t& iti, size_t& it1, plogendl(); } for (size_t k = 0; k < m_numSpeciesTot; k++) { - m_molNumSpecies_new[k] = m_molNumSpecies_old[k] + m_deltaMolNumSpecies[k]; + m_molNumSpecies_new[k] = m_molNumSpecies_old[k] + m_deltaMolNumSpecies[k]; size_t iph = m_phaseID[k]; m_tPhaseMoles_new[iph] += m_deltaMolNumSpecies[k]; } @@ -597,8 +597,8 @@ void VCS_SOLVE::solve_tp_inner(size_t& iti, size_t& it1, if (iphasePop != npos) { if (iph == iphasePop) { - dx = m_deltaMolNumSpecies[kspec]; - m_molNumSpecies_new[kspec] = m_molNumSpecies_old[kspec] + m_deltaMolNumSpecies[kspec]; + dx = m_deltaMolNumSpecies[kspec]; + m_molNumSpecies_new[kspec] = m_molNumSpecies_old[kspec] + m_deltaMolNumSpecies[kspec]; if (DEBUG_MODE_ENABLED) { sprintf(ANOTE, "Phase pop"); } @@ -873,7 +873,7 @@ void VCS_SOLVE::solve_tp_inner(size_t& iti, size_t& it1, if (sc_irxn[j] != 0.0) { m_wx[j] = m_molNumSpecies_old[j] + sc_irxn[j] * dx; if (m_wx[j] <= m_molNumSpecies_old[j] * 0.01 - 1.0E-150) { - dx = std::max(dx, m_molNumSpecies_old[j] * -0.99 / sc_irxn[j]); + dx = std::max(dx, m_molNumSpecies_old[j] * -0.99 / sc_irxn[j]); } } else { m_wx[j] = m_molNumSpecies_old[j]; @@ -900,7 +900,7 @@ void VCS_SOLVE::solve_tp_inner(size_t& iti, size_t& it1, /* * Change the base mole numbers for the iteration. * We need to do this here, because we have decided - * to eliminate the phase in this special section + * to eliminate the phase in this special section * outside the main loop. */ m_molNumSpecies_new[kspec] = 0.0; @@ -1124,7 +1124,7 @@ void VCS_SOLVE::solve_tp_inner(size_t& iti, size_t& it1, plogf(" FINAL KMOLES INIT_DEL_G/RT TENT_DEL_G/RT FINAL_DELTA_G/RT\n"); for (size_t i = 0; i < m_numComponents; ++i) { plogf(" --- %-12.12s", m_speciesName[i].c_str()); - plogf(" %14.6E %14.6E %14.6E\n", m_molNumSpecies_old[i], + plogf(" %14.6E %14.6E %14.6E\n", m_molNumSpecies_old[i], m_molNumSpecies_old[i] + m_deltaMolNumSpecies[i], m_molNumSpecies_new[i]); } for (size_t kspec = m_numComponents; kspec < m_numSpeciesRdc; ++kspec) { @@ -1262,7 +1262,7 @@ void VCS_SOLVE::solve_tp_inner(size_t& iti, size_t& it1, * We delete multiphases, when the total moles in the multiphase * is reduced below a relative threshold. * Set microscopic multispecies phases with total relative - * number of moles less than VCS_DELETE_PHASE_CUTOFF to + * number of moles less than VCS_DELETE_PHASE_CUTOFF to * absolute zero. */ bool justDeletedMultiPhase = false; @@ -1313,7 +1313,7 @@ void VCS_SOLVE::solve_tp_inner(size_t& iti, size_t& it1, vcs_elcorr(&m_sm[0], &m_wx[0]); vcs_setFlagsVolPhases(false, VCS_STATECALC_OLD); vcs_dfe(VCS_STATECALC_OLD, 0, 0, m_numSpeciesRdc); - vcs_deltag(0, true, VCS_STATECALC_OLD); + vcs_deltag(0, true, VCS_STATECALC_OLD); uptodate_minors = true; } else if (DEBUG_MODE_ENABLED && m_debug_print_lvl >= 2) { plogf(" - passed"); @@ -1406,7 +1406,7 @@ void VCS_SOLVE::solve_tp_inner(size_t& iti, size_t& it1, } else if (speciesType == VCS_SPECIES_MAJOR) { if (m_speciesStatus[kspec] != VCS_SPECIES_MAJOR) { if (DEBUG_MODE_ENABLED && m_debug_print_lvl >= 2) { - if (m_speciesStatus[kspec] == VCS_SPECIES_MINOR) { + if (m_speciesStatus[kspec] == VCS_SPECIES_MINOR) { plogf(" --- Noncomponent turned from minor to major: "); } else if (kspec < m_numComponents) { plogf(" --- Component turned into a major: "); @@ -1526,7 +1526,7 @@ void VCS_SOLVE::solve_tp_equilib_check(bool& allMinorZeroedSpecies, vcs_updateVP(VCS_STATECALC_OLD); vcs_elab(); - /* LEC is only true when we are near the end game */ + /* LEC is only true when we are near the end game */ if (lec) { if (!giveUpOnElemAbund) { if (DEBUG_MODE_ENABLED && m_debug_print_lvl >= 2) { @@ -1655,7 +1655,7 @@ double VCS_SOLVE::vcs_minor_alt_calc(size_t kspec, size_t irxn, bool* do_delete, double molNum_kspec_new; double wTrial, tmp; double dg_irxn = m_deltaGRxn_old[irxn]; - doublereal s; + doublereal s; size_t iph = m_phaseID[kspec]; *do_delete = false; @@ -1698,13 +1698,13 @@ double VCS_SOLVE::vcs_minor_alt_calc(size_t kspec, size_t irxn, bool* do_delete, */ a = clip(w_kspec * s, -1.0+1e-8, 100.0); tmp = clip(-dg_irxn / (1.0 + a), -200.0, 200.0); - wTrial = w_kspec * exp(tmp); + wTrial = w_kspec * exp(tmp); molNum_kspec_new = wTrial; if (wTrial > 100. * w_kspec) { double molNumMax = 0.0001 * m_tPhaseMoles_old[iph]; if (molNumMax < 100. * w_kspec) { - molNumMax = 100. * w_kspec; + molNumMax = 100. * w_kspec; } if (wTrial > molNumMax) { molNum_kspec_new = molNumMax; @@ -1981,8 +1981,8 @@ bool VCS_SOLVE::vcs_delete_multiphase(const size_t iph) plogf(" --- delta attempted: %g achieved: %g " " Zeroing it manually\n", dx, dxTent); } - m_molNumSpecies_old[kspec] = 0.0; - m_molNumSpecies_new[kspec] = 0.0; + m_molNumSpecies_old[kspec] = 0.0; + m_molNumSpecies_new[kspec] = 0.0; m_deltaMolNumSpecies[kspec] = 0.0; // recover the total phase moles. vcs_tmoles(); @@ -1990,8 +1990,8 @@ bool VCS_SOLVE::vcs_delete_multiphase(const size_t iph) /* * Set the mole number of that species to zero. */ - m_molNumSpecies_old[kspec] = 0.0; - m_molNumSpecies_new[kspec] = 0.0; + m_molNumSpecies_old[kspec] = 0.0; + m_molNumSpecies_new[kspec] = 0.0; m_deltaMolNumSpecies[kspec] = 0.0; } /* @@ -2008,7 +2008,7 @@ bool VCS_SOLVE::vcs_delete_multiphase(const size_t iph) if (m_phaseID[kcomp] == iph) { if (DEBUG_MODE_ENABLED && m_debug_print_lvl >= 2) { plogf(" --- delete_multiphase One of the species is a component %d - %s with mole number %g\n", - kcomp, m_speciesName[kcomp].c_str(), m_molNumSpecies_old[kcomp]); + kcomp, m_speciesName[kcomp].c_str(), m_molNumSpecies_old[kcomp]); } if (m_molNumSpecies_old[kcomp] != 0.0) { for (size_t kspec = m_numComponents; kspec < m_numSpeciesRdc; ++kspec) { @@ -2019,7 +2019,7 @@ bool VCS_SOLVE::vcs_delete_multiphase(const size_t iph) if (dxWant + m_molNumSpecies_old[kspec] < 0.0) { dxPerm = -m_molNumSpecies_old[kspec]; } - for (size_t jcomp = 0; kcomp < m_numComponents; ++kcomp) { + for (size_t jcomp = 0; kcomp < m_numComponents; ++kcomp) { if (jcomp != kcomp) { if (m_phaseID[jcomp] == iph) { dxPerm = 0.0; @@ -2045,7 +2045,7 @@ bool VCS_SOLVE::vcs_delete_multiphase(const size_t iph) if (m_molNumSpecies_old[kcomp] != 0.0) { if (DEBUG_MODE_ENABLED && m_debug_print_lvl >= 2) { plogf(" --- delete_multiphase One of the species is a component %d - %s still with mole number %g\n", - kcomp, m_speciesName[kcomp].c_str(), m_molNumSpecies_old[kcomp]); + kcomp, m_speciesName[kcomp].c_str(), m_molNumSpecies_old[kcomp]); plogf(" --- zeroing it \n"); } m_molNumSpecies_old[kcomp] = 0.0; @@ -2065,7 +2065,7 @@ bool VCS_SOLVE::vcs_delete_multiphase(const size_t iph) */ for (size_t kspec = m_numSpeciesRdc; kspec < m_numSpeciesTot; ++kspec) { if (m_phaseID[kspec] == iph) { - m_molNumSpecies_old[kspec] = 0.0; + m_molNumSpecies_old[kspec] = 0.0; m_molNumSpecies_new[kspec] = 0.0; m_deltaMolNumSpecies[kspec] = 0.0; m_speciesStatus[kspec] = VCS_SPECIES_ZEROEDMS; @@ -2148,7 +2148,7 @@ int VCS_SOLVE::vcs_recheck_deleted() * * Then, if TL is zero, the phase pops into existence if DG_i_O < 0. * Also, if the phase exists, then we check to see if the species - * can have a mole number larger than VCS_DELETE_SPECIES_CUTOFF + * can have a mole number larger than VCS_DELETE_SPECIES_CUTOFF * (default value = 1.0E-32). * * HKM: @@ -2202,7 +2202,7 @@ bool VCS_SOLVE::recheck_deleted_phase(const int iphase) } double phaseDG = 1.0; - for (size_t kk = 0; kk < Vphase->nSpecies(); kk++) { + 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); @@ -2259,7 +2259,7 @@ size_t VCS_SOLVE::vcs_add_all_deleted() size_t kspec = m_indexRxnToSpecies[irxn]; size_t iph = m_phaseID[kspec]; if (m_tPhaseMoles_old[iph] > 0.0) { - double dx = m_molNumSpecies_new[kspec]; + double dx = m_molNumSpecies_new[kspec]; retn = delta_species(kspec, &dx); if (retn == 0) { if (DEBUG_MODE_ENABLED && m_debug_print_lvl) { @@ -2531,7 +2531,7 @@ int VCS_SOLVE::vcs_basopt(const bool doJustComponents, double aw[], double sa[], * that those modes will never be allowed to grow. You want to have the * best chance that the component will grow positively. * - * Suppose you start with CH4, N2, as the only species with nonzero compositions. + * Suppose you start with CH4, N2, as the only species with nonzero compositions. * You have the following abundances: * * Abundances: @@ -2788,7 +2788,7 @@ L_END_LOOP: * was just wrong -> hopefully it didn't blow up. Redo the problem. * Search for inactive E */ - juse = npos; + juse = npos; jlose = npos; for (size_t j = 0; j < m_numElemConstraints; j++) { if (!m_elementActive[j] && !strcmp(m_elementName[j].c_str(), "E")) { @@ -2894,14 +2894,14 @@ L_END_LOOP: sum = m_formulaMatrix(k,juse); for (size_t n = 0; n < ncTrial; n++) { double numElements = m_formulaMatrix(n,juse); - double coeff = m_stoichCoeffRxnMatrix(n,i); + double coeff = m_stoichCoeffRxnMatrix(n,i); sum += coeff * numElements; } } else { sum = m_formulaMatrix(k,j); for (size_t n = 0; n < ncTrial; n++) { double numElements = m_formulaMatrix(n,j); - double coeff = m_stoichCoeffRxnMatrix(n,i); + double coeff = m_stoichCoeffRxnMatrix(n,i); sum += coeff * numElements; } } @@ -3029,7 +3029,7 @@ int VCS_SOLVE::vcs_species_type(const size_t kspec) const { // ---------- Treat special cases first --------------------- if (m_speciesUnknownType[kspec] == VCS_SPECIES_TYPE_INTERFACIALVOLTAGE) { - return VCS_SPECIES_INTERFACIALVOLTAGE; + return VCS_SPECIES_INTERFACIALVOLTAGE; } size_t iph = m_phaseID[kspec]; @@ -3087,7 +3087,7 @@ int VCS_SOLVE::vcs_species_type(const size_t kspec) const if (DEBUG_MODE_ENABLED && m_debug_print_lvl >= 2) { plogf(" --- %s is prevented from popping into existence because" " a needed component to be consumed, %s, has a zero mole number\n", - m_speciesName[kspec].c_str(), m_speciesName[j].c_str()); + m_speciesName[kspec].c_str(), m_speciesName[j].c_str()); } if (m_SSPhase[kspec]) { return VCS_SPECIES_ZEROEDSS; @@ -3103,7 +3103,7 @@ int VCS_SOLVE::vcs_species_type(const size_t kspec) const plogf(" --- %s is prevented from popping into existence because" " a needed component %s is in a zeroed-phase that would be " "popped into existence at the same time\n", - m_speciesName[kspec].c_str(), m_speciesName[j].c_str()); + m_speciesName[kspec].c_str(), m_speciesName[j].c_str()); } if (m_SSPhase[kspec]) { return VCS_SPECIES_ZEROEDSS; @@ -3429,7 +3429,7 @@ void VCS_SOLVE::vcs_dfe(const int stateCalc, - tlogMoles[m_phaseID[kspec]] - m_lnMnaughtSpecies[kspec] + m_chargeSpecies[kspec] * m_Faraday_dim * m_phasePhi[iphase]; } else { - feSpecies[kspec] = m_SSfeSpecies[kspec] - m_lnMnaughtSpecies[kspec] + feSpecies[kspec] = m_SSfeSpecies[kspec] - m_lnMnaughtSpecies[kspec] + m_chargeSpecies[kspec] * m_Faraday_dim * m_phasePhi[iphase]; } } else { @@ -3456,7 +3456,7 @@ void VCS_SOLVE::vcs_dfe(const int stateCalc, AssertThrowMsg(m_chargeSpecies[kspec] == -1.0, "VCS_SOLVE::vcs_dfe", "We have an unexpected situation!"); feSpecies[kspec] = m_SSfeSpecies[kspec] - + m_chargeSpecies[kspec] * m_Faraday_dim * m_phasePhi[iphase]; ; + + m_chargeSpecies[kspec] * m_Faraday_dim * m_phasePhi[iphase]; } else { if (m_SSPhase[kspec]) { feSpecies[kspec] = m_SSfeSpecies[kspec] @@ -3490,7 +3490,7 @@ void VCS_SOLVE::vcs_dfe(const int stateCalc, } } -void VCS_SOLVE::vcs_printSpeciesChemPot(const int stateCalc) const +void VCS_SOLVE::vcs_printSpeciesChemPot(const int stateCalc) const { double mfValue = 1.0; bool zeroedPhase = false; @@ -3524,7 +3524,7 @@ void VCS_SOLVE::vcs_printSpeciesChemPot(const int stateCalc) const mfValue = 1.0; size_t iphase = m_phaseID[kspec]; const vcs_VolPhase* Vphase = m_VolPhaseList[iphase]; - if ((m_speciesStatus[kspec] == VCS_SPECIES_ZEROEDMS) || + if ((m_speciesStatus[kspec] == VCS_SPECIES_ZEROEDMS) || (m_speciesStatus[kspec] == VCS_SPECIES_ZEROEDPHASE) || (m_speciesStatus[kspec] == VCS_SPECIES_ZEROEDSS)) { zeroedPhase = true; @@ -3772,13 +3772,13 @@ void VCS_SOLVE::vcs_deltag(const int l, const bool doDeleted, double* molNumSpecies; double* actCoeffSpecies; if (vcsState == VCS_STATECALC_NEW) { - deltaGRxn = &m_deltaGRxn_new[0]; - feSpecies = &m_feSpecies_new[0]; + deltaGRxn = &m_deltaGRxn_new[0]; + feSpecies = &m_feSpecies_new[0]; molNumSpecies = &m_molNumSpecies_new[0]; actCoeffSpecies = &m_actCoeffSpecies_new[0]; } else if (vcsState == VCS_STATECALC_OLD) { - deltaGRxn = &m_deltaGRxn_old[0]; - feSpecies = &m_feSpecies_old[0]; + deltaGRxn = &m_deltaGRxn_old[0]; + feSpecies = &m_feSpecies_old[0]; molNumSpecies = &m_molNumSpecies_old[0]; actCoeffSpecies = &m_actCoeffSpecies_old[0]; } else { @@ -3900,7 +3900,7 @@ void VCS_SOLVE::vcs_deltag(const int l, const bool doDeleted, * This can probably be solved by successive iteration. * This should be implemented. */ - if (alterZeroedPhases && false) { + if (alterZeroedPhases && false) { for (size_t iph = 0; iph < m_numPhases; iph++) { bool lneed = false; vcs_VolPhase* Vphase = m_VolPhaseList[iph]; @@ -3948,7 +3948,7 @@ void VCS_SOLVE::vcs_deltag(const int l, const bool doDeleted, } } -void VCS_SOLVE::vcs_printDeltaG(const int stateCalc) +void VCS_SOLVE::vcs_printDeltaG(const int stateCalc) { double* deltaGRxn = &m_deltaGRxn_old[0]; double* feSpecies = &m_feSpecies_old[0]; @@ -3956,8 +3956,8 @@ void VCS_SOLVE::vcs_printDeltaG(const int stateCalc) const double* tPhMoles_ptr = &m_tPhaseMoles_old[0]; const double* actCoeff_ptr = &m_actCoeffSpecies_old[0]; if (stateCalc == VCS_STATECALC_NEW) { - deltaGRxn = &m_deltaGRxn_new[0]; - feSpecies = &m_feSpecies_new[0]; + deltaGRxn = &m_deltaGRxn_new[0]; + feSpecies = &m_feSpecies_new[0]; molNumSpecies = &m_molNumSpecies_new[0]; actCoeff_ptr = &m_actCoeffSpecies_new[0]; tPhMoles_ptr = &m_tPhaseMoles_new[0]; @@ -4011,7 +4011,7 @@ void VCS_SOLVE::vcs_printDeltaG(const int stateCalc) double mfValue = 1.0; size_t iphase = m_phaseID[kspec]; const vcs_VolPhase* Vphase = m_VolPhaseList[iphase]; - if ((m_speciesStatus[kspec] == VCS_SPECIES_ZEROEDMS) || + if ((m_speciesStatus[kspec] == VCS_SPECIES_ZEROEDMS) || (m_speciesStatus[kspec] == VCS_SPECIES_ZEROEDPHASE) || (m_speciesStatus[kspec] == VCS_SPECIES_ZEROEDSS)) { zeroedPhase = true; @@ -4033,8 +4033,8 @@ void VCS_SOLVE::vcs_printDeltaG(const int stateCalc) } else { printf(" --- "); } - double feFull = feSpecies[kspec]; - if ((m_speciesStatus[kspec] == VCS_SPECIES_ZEROEDMS) || + double feFull = feSpecies[kspec]; + if ((m_speciesStatus[kspec] == VCS_SPECIES_ZEROEDMS) || (m_speciesStatus[kspec] == VCS_SPECIES_ZEROEDPHASE)) { feFull += log(actCoeff_ptr[kspec]) + log(mfValue); } @@ -4274,7 +4274,7 @@ void VCS_SOLVE::vcs_switch_pos(const bool ifunc, const size_t k1, const size_t k std::swap(m_phaseParticipation(iph,i1), m_phaseParticipation(iph,i2)); } - std::swap(m_deltaGRxn_new[i1], m_deltaGRxn_new[i2]); + std::swap(m_deltaGRxn_new[i1], m_deltaGRxn_new[i2]); std::swap(m_deltaGRxn_old[i1], m_deltaGRxn_old[i2]); std::swap(m_deltaGRxn_tmp[i1], m_deltaGRxn_tmp[i2]); } diff --git a/src/equil/vcs_solve_phaseStability.cpp b/src/equil/vcs_solve_phaseStability.cpp index 24cc5b7b5..ca1bb8ed5 100644 --- a/src/equil/vcs_solve_phaseStability.cpp +++ b/src/equil/vcs_solve_phaseStability.cpp @@ -115,7 +115,7 @@ int VCS_SOLVE::vcs_PS(VCS_PROB* vprob, int iphase, int printLvl, double& feStabl * (all information concerning Temperature and Pressure has already * been derived. The free energies are now in dimensionless form.) */ - iStab = vcs_solve_phaseStability(iphase, ifunc, feStable, printLvl); + iStab = vcs_solve_phaseStability(iphase, ifunc, feStable, printLvl); /* * Redimensionalize the free energies using diff --git a/src/equil/vcs_species_thermo.cpp b/src/equil/vcs_species_thermo.cpp index cabac81d6..d77dc004c 100644 --- a/src/equil/vcs_species_thermo.cpp +++ b/src/equil/vcs_species_thermo.cpp @@ -62,21 +62,21 @@ VCS_SPECIES_THERMO& VCS_SPECIES_THERMO::operator=(const VCS_SPECIES_THERMO& b) { if (&b != this) { - IndexPhase = b.IndexPhase; - IndexSpeciesPhase = b.IndexSpeciesPhase; - OwningPhase = b.OwningPhase; - SS0_Model = b.SS0_Model; - SS0_feSave = b.SS0_feSave; - SS0_TSave = b.SS0_TSave; - SS0_T0 = b.SS0_T0; - SS0_H0 = b.SS0_H0; - SS0_S0 = b.SS0_S0; - SS0_Cp0 = b.SS0_Cp0; - SS0_Pref = b.SS0_Pref; - SSStar_Model = b.SSStar_Model; - SSStar_Vol_Model = b.SSStar_Vol_Model; - SSStar_Vol0 = b.SSStar_Vol0; - m_VCS_UnitsFormat = b.m_VCS_UnitsFormat; + IndexPhase = b.IndexPhase; + IndexSpeciesPhase = b.IndexSpeciesPhase; + OwningPhase = b.OwningPhase; + SS0_Model = b.SS0_Model; + SS0_feSave = b.SS0_feSave; + SS0_TSave = b.SS0_TSave; + SS0_T0 = b.SS0_T0; + SS0_H0 = b.SS0_H0; + SS0_S0 = b.SS0_S0; + SS0_Cp0 = b.SS0_Cp0; + SS0_Pref = b.SS0_Pref; + SSStar_Model = b.SSStar_Model; + SSStar_Vol_Model = b.SSStar_Vol_Model; + SSStar_Vol0 = b.SSStar_Vol0; + m_VCS_UnitsFormat = b.m_VCS_UnitsFormat; } return *this; } diff --git a/src/fortran/fct.cpp b/src/fortran/fct.cpp index 750b19f87..8595d0181 100644 --- a/src/fortran/fct.cpp +++ b/src/fortran/fct.cpp @@ -1065,7 +1065,7 @@ extern "C" { r = &root->root(); } std::string srcS = f2string(src, lensrc); - std::string idS = f2string(id, lenid); + std::string idS = f2string(id, lenid); if (srcS != "") { x = get_XML_Node(srcS, r); } else { diff --git a/src/kinetics/BulkKinetics.cpp b/src/kinetics/BulkKinetics.cpp index 3d1fd796e..ecccf47e6 100644 --- a/src/kinetics/BulkKinetics.cpp +++ b/src/kinetics/BulkKinetics.cpp @@ -98,7 +98,7 @@ void BulkKinetics::getRevRateConstants(doublereal* krev, bool doIrreversible) if (doIrreversible) { getEquilibriumConstants(&m_ropnet[0]); for (size_t i = 0; i < nReactions(); i++) { - krev[i] /= m_ropnet[i]; + krev[i] /= m_ropnet[i]; } } else { // m_rkcn[] is zero for irreversible reactions diff --git a/src/kinetics/Falloff.cpp b/src/kinetics/Falloff.cpp index a0978bba9..d57769311 100644 --- a/src/kinetics/Falloff.cpp +++ b/src/kinetics/Falloff.cpp @@ -26,7 +26,7 @@ void Troe::init(const vector_fp& c) "Incorrect number of parameters. 3 or 4 required. Received " + int2str(c.size()) + "."); } - m_a = c[0]; + m_a = c[0]; if (c[1] == 0.0) { m_rt3 = 1000.; } else { diff --git a/src/kinetics/ImplicitSurfChem.cpp b/src/kinetics/ImplicitSurfChem.cpp index c946bf4a0..b0f37eecc 100644 --- a/src/kinetics/ImplicitSurfChem.cpp +++ b/src/kinetics/ImplicitSurfChem.cpp @@ -149,7 +149,7 @@ void ImplicitSurfChem::updateState(doublereal* c) void ImplicitSurfChem::eval(doublereal time, doublereal* y, doublereal* ydot, doublereal* p) { - updateState(y); // synchronize the surface state(s) with y + updateState(y); // synchronize the surface state(s) with y doublereal rs0, sum; size_t loc, kstart; for (size_t n = 0; n < m_nsurf; n++) { @@ -206,7 +206,7 @@ void ImplicitSurfChem::solvePseudoSteadyStateProblem(int ifuncOverride, InterfaceKinetics* ik = m_vecKinPtrs[0]; ThermoPhase& tp = ik->thermo(0); doublereal TKelvin = tp.temperature(); - doublereal PGas = tp.pressure(); + doublereal PGas = tp.pressure(); /* * Make sure that there is a common temperature and * pressure for all ThermoPhase objects belonging to the @@ -266,7 +266,7 @@ void ImplicitSurfChem::getConcSpecies(doublereal* const vecConcSpecies) const TP_ptr->getConcentrations(vecConcSpecies + kstart); } kstart = m_nv; - for (size_t ip = 0; ip < m_numBulkPhases; ip++) { + for (size_t ip = 0; ip < m_numBulkPhases; ip++) { ThermoPhase* TP_ptr = m_bulkPhases[ip]; TP_ptr->getConcentrations(vecConcSpecies + kstart); kstart += TP_ptr->nSpecies(); @@ -282,7 +282,7 @@ void ImplicitSurfChem::setConcSpecies(const doublereal* const vecConcSpecies) TP_ptr->setConcentrations(vecConcSpecies + kstart); } kstart = m_nv; - for (size_t ip = 0; ip < m_numBulkPhases; ip++) { + for (size_t ip = 0; ip < m_numBulkPhases; ip++) { ThermoPhase* TP_ptr = m_bulkPhases[ip]; TP_ptr->setConcentrations(vecConcSpecies + kstart); kstart += TP_ptr->nSpecies(); diff --git a/src/kinetics/InterfaceKinetics.cpp b/src/kinetics/InterfaceKinetics.cpp index 9dbbb3fce..b33470a3d 100644 --- a/src/kinetics/InterfaceKinetics.cpp +++ b/src/kinetics/InterfaceKinetics.cpp @@ -64,47 +64,47 @@ InterfaceKinetics& InterfaceKinetics::operator=(const InterfaceKinetics& right) 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_nirrev = right.m_nirrev; - m_nrev = right.m_nrev; - 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_E = right.m_E; - 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_logp0 = right.m_logp0; - m_logc0 = right.m_logc0; - m_ROP_ok = right.m_ROP_ok; - m_temp = right.m_temp; - m_logtemp = right.m_logtemp; - m_finalized = right.m_finalized; + 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_nirrev = right.m_nirrev; + m_nrev = right.m_nrev; + 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_E = right.m_E; + 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_logp0 = right.m_logp0; + m_logc0 = right.m_logc0; + m_ROP_ok = right.m_ROP_ok; + m_temp = right.m_temp; + m_logtemp = right.m_logtemp; + m_finalized = right.m_finalized; 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; + 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; } @@ -392,7 +392,7 @@ void InterfaceKinetics::convertExchangeCurrentDensityFormulation(doublereal* con size_t irxn = m_ctrxn[i]; // Determine whether the reaction rate constant is in an exchange current density formulation format. - int iECDFormulation = m_ctrxn_ecdf[i]; + int iECDFormulation = m_ctrxn_ecdf[i]; if (iECDFormulation) { // If the BV form is to be converted into the normal form then we go through this process. // If it isn't to be converted, then we don't go through this process. @@ -402,7 +402,7 @@ void InterfaceKinetics::convertExchangeCurrentDensityFormulation(doublereal* con // Calculate the term and modify the forward reaction double tmp = exp(- m_beta[i] * m_deltaG0[irxn] * rrt); double tmp2 = m_ProdStanConcReac[irxn]; - tmp *= 1.0 / tmp2 / Faraday; + tmp *= 1.0 / tmp2 / Faraday; kfwd[irxn] *= tmp; } // If BVform is nonzero we don't need to do anything. @@ -508,7 +508,7 @@ void InterfaceKinetics::updateROP() */ if (m_phaseExistsCheck) { for (size_t j = 0; j != nReactions(); ++j) { - if ((m_ropr[j] > m_ropf[j]) && (m_ropr[j] > 0.0)) { + if ((m_ropr[j] > m_ropf[j]) && (m_ropr[j] > 0.0)) { for (size_t p = 0; p < nPhases(); p++) { if (m_rxnPhaseIsProduct[j][p] && !m_phaseExists[p]) { m_ropnet[j] = 0.0; diff --git a/src/kinetics/Kinetics.cpp b/src/kinetics/Kinetics.cpp index 9ddff7265..847451664 100644 --- a/src/kinetics/Kinetics.cpp +++ b/src/kinetics/Kinetics.cpp @@ -48,15 +48,15 @@ Kinetics& Kinetics::operator=(const Kinetics& right) 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_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_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_rgroups = right.m_rgroups; m_pgroups = right.m_pgroups; m_rfn = right.m_rfn; diff --git a/src/kinetics/ReactionPath.cpp b/src/kinetics/ReactionPath.cpp index 86f1a0516..78f758dbb 100644 --- a/src/kinetics/ReactionPath.cpp +++ b/src/kinetics/ReactionPath.cpp @@ -238,7 +238,7 @@ void ReactionPathDiagram::exportToDot(ostream& s) if (scale <= 0.0) { for (i1 = 0; i1 < nNodes(); i1++) { k1 = m_speciesNumber[i1]; - node(k1)->visible = false; + node(k1)->visible = false; for (i2 = i1+1; i2 < nNodes(); i2++) { k2 = m_speciesNumber[i2]; flx = netFlow(k1, k2); @@ -279,8 +279,8 @@ void ReactionPathDiagram::exportToDot(ostream& s) // is greater than the threshold if (flxratio >= threshold) { // make nodes visible - node(kbegin)->visible = true; - node(kend)->visible = true; + node(kbegin)->visible = true; + node(kend)->visible = true; s << "s" << kbegin << " -> s" << kend; s << "[fontname=\""+m_font+"\", style=\"setlinewidth("; @@ -292,7 +292,7 @@ void ReactionPathDiagram::exportToDot(ostream& s) s << ", arrowsize=" << std::min(6.0, 0.5*lwidth); } else { - s << arrow_width << ")\""; + s << arrow_width << ")\""; s << ", arrowsize=" << flxratio + 1; } @@ -403,7 +403,7 @@ void ReactionPathDiagram::linkNodes(size_t k1, size_t k2, size_t rxn, doublereal value, string legend) { SpeciesNode* begin = m_nodes[k1]; - SpeciesNode* end = m_nodes[k2]; + SpeciesNode* end = m_nodes[k2]; Path* ff = m_paths[k1][k2]; if (!ff) { ff= new Path(begin, end); @@ -423,7 +423,7 @@ std::vector ReactionPathDiagram::species() int ReactionPathBuilder::findGroups(ostream& logfile, Kinetics& s) { m_groups.resize(m_nr); - for (size_t i = 0; i < m_nr; i++) { // loop over reactions + for (size_t i = 0; i < m_nr; i++) { // loop over reactions logfile << endl << "Reaction " << i+1 << ": " << s.reactionString(i); @@ -628,7 +628,7 @@ int ReactionPathBuilder::init(ostream& logfile, Kinetics& kin) m_ropf.resize(m_nr); m_ropr.resize(m_nr); m_determinate.resize(m_nr); - m_x.resize(m_ns); // not currently used ? + m_x.resize(m_ns); // not currently used ? m_elatoms.resize(m_nel, m_nr); size_t nr, np, n, k; @@ -703,12 +703,12 @@ int ReactionPathBuilder::init(ostream& logfile, Kinetics& kin) for (size_t m = 0; m < m_nel; m++) { nar = 0; nap = 0; - for (size_t j = 0; j < nr; j++) { + for (size_t j = 0; j < nr; j++) { if (m_atoms(m_reac[i][j],m) > 0) { nar++; } } - for (size_t j = 0; j < np; j++) { + for (size_t j = 0; j < np; j++) { if (m_atoms(m_prod[i][j],m) > 0) { nap++; } @@ -803,7 +803,7 @@ int ReactionPathBuilder::build(Kinetics& s, const string& element, // element m, and both are allowed to appear in // the diagram if ((kkr != kkp) && (m_atoms(kkr,m) > 0 - && m_atoms(kkp,m) > 0) + && m_atoms(kkp,m) > 0) && status[kkr] >= 0 && status[kkp] >= 0) { // if neither species contains the full // number of atoms of element m in the diff --git a/src/kinetics/solveSP.cpp b/src/kinetics/solveSP.cpp index 9161cbaba..7dd02d5d1 100644 --- a/src/kinetics/solveSP.cpp +++ b/src/kinetics/solveSP.cpp @@ -83,7 +83,7 @@ solveSP::solveSP(ImplicitSurfChem* surfChemPtr, int bulkFunc) : m_maxTotSpecies = 0; for (size_t n = 0; n < m_numSurfPhases; n++) { - size_t tsp = m_objects[n]->nTotalSpecies(); + size_t tsp = m_objects[n]->nTotalSpecies(); m_maxTotSpecies = std::max(m_maxTotSpecies, tsp); } m_maxTotSpecies = std::max(m_maxTotSpecies, m_neq); @@ -134,15 +134,15 @@ int solveSP::solveSurfProb(int ifunc, doublereal time_scale, doublereal TKelvin, int info = 0; int label_t=-1; /* Species IDs for time control */ int label_d = -1; /* Species IDs for damping control */ - int label_t_old=-1; - doublereal label_factor = 1.0; + int label_t_old=-1; + doublereal label_factor = 1.0; int iter=0; // iteration number on numlinear solver int iter_max=1000; // maximum number of nonlinear iterations doublereal deltaT = 1.0E-10; // Delta time step doublereal damp=1.0, tmp; // Weighted L2 norm of the residual. Currently, this is only // used for IO purposes. It doesn't control convergence. - doublereal resid_norm; + doublereal resid_norm; doublereal inv_t = 0.0; doublereal t_real = 0.0, update_norm = 1.0E6; bool do_time = false, not_converged = true; @@ -161,7 +161,7 @@ int solveSP::solveSurfProb(int ifunc, doublereal time_scale, doublereal TKelvin, */ size_t loc = 0; for (size_t n = 0; n < m_numSurfPhases; n++) { - SurfPhase* sf_ptr = m_ptrsSurfPhase[n]; + SurfPhase* sf_ptr = m_ptrsSurfPhase[n]; sf_ptr->getConcentrations(DATA_PTR(m_numEqn1)); size_t nsp = m_nSpeciesSurfPhase[n]; for (size_t k = 0; k 2.0*inv_t) { - inv_t = 2.0*inv_t; + inv_t = 2.0*inv_t; } else { inv_t = tmp; } @@ -333,7 +333,7 @@ int solveSP::solveSurfProb(int ifunc, doublereal time_scale, doublereal TKelvin, } if (m_ioflag) { - printIteration(m_ioflag, damp, label_d, label_t, inv_t, t_real, iter, + printIteration(m_ioflag, damp, label_d, label_t, inv_t, t_real, iter, update_norm, resid_norm, do_time); } @@ -343,7 +343,7 @@ int solveSP::solveSurfProb(int ifunc, doublereal time_scale, doublereal TKelvin, if (do_time) { if (t_real > time_scale || (resid_norm < 1.0e-7 && - update_norm*time_scale/t_real < EXTRA_ACCURACY)) { + update_norm*time_scale/t_real < EXTRA_ACCURACY)) { do_time = false; } } else { @@ -374,7 +374,7 @@ int solveSP::solveSurfProb(int ifunc, doublereal time_scale, doublereal TKelvin, false, deltaT); resid_norm = calcWeightedNorm(DATA_PTR(m_wtResid), DATA_PTR(m_resid), m_neq); - printIteration(m_ioflag, damp, label_d, label_t, inv_t, t_real, iter, + printIteration(m_ioflag, damp, label_d, label_t, inv_t, t_real, iter, update_norm, resid_norm, do_time, true); } @@ -433,7 +433,7 @@ void solveSP::evalSurfLarge(const doublereal* CSolnSP) } void solveSP::fun_eval(doublereal* resid, const doublereal* CSoln, - const doublereal* CSolnOld, const bool do_time, + const doublereal* CSolnOld, const bool do_time, const doublereal deltaT) { size_t isp, nsp, kstart, k, kindexSP, kins, kspecial; @@ -606,7 +606,7 @@ void solveSP::resjac_eval(SquareMatrix& jac, static doublereal calc_damping(doublereal x[], doublereal dxneg[], size_t dim, int* label) { const doublereal APPROACH = 0.80; - doublereal damp = 1.0, xnew, xtop, xbot; + doublereal damp = 1.0, xnew, xtop, xbot; static doublereal damp_old = 1.0; *label = -1; @@ -629,7 +629,7 @@ static doublereal calc_damping(doublereal x[], doublereal dxneg[], size_t dim, i } else if (xnew < xbot) { damp = APPROACH * x[i] / dxneg[i]; *label = int(i); - } else if (xnew > 3.0*std::max(x[i], 1.0E-10)) { + } else if (xnew > 3.0*std::max(x[i], 1.0E-10)) { damp = - 2.0 * std::max(x[i], 1.0E-10) / dxneg[i]; *label = int(i); } @@ -654,7 +654,7 @@ static doublereal calc_damping(doublereal x[], doublereal dxneg[], size_t dim, i } /* calc_damping */ /* - * This function calculates the norm of an update, dx[], + * This function calculates the norm of an update, dx[], * based on the weighted values of x. */ static doublereal calcWeightedNorm(const doublereal wtX[], const doublereal dx[], size_t dim) @@ -718,7 +718,7 @@ doublereal solveSP::calc_t(doublereal netProdRateSolnSP[], doublereal* label_factor, int ioflag) { size_t k, isp, nsp, kstart; - doublereal inv_timeScale = 1.0E-10; + doublereal inv_timeScale = 1.0E-10; doublereal sden, tmp; size_t kindexSP = 0; *label = 0; diff --git a/src/matlab/onedimmethods.cpp b/src/matlab/onedimmethods.cpp index 6c7840cff..45c405cc7 100644 --- a/src/matlab/onedimmethods.cpp +++ b/src/matlab/onedimmethods.cpp @@ -140,7 +140,7 @@ void onedimmethods(int nlhs, mxArray* plhs[], case 18: checkNArgs(4, nrhs); nm = getString(prhs[3]); - vv = (double) domain_componentIndex(dom, nm) ; + vv = (double) domain_componentIndex(dom, nm); if (vv >= 0.0) { vv += 1.0; } @@ -217,7 +217,7 @@ void onedimmethods(int nlhs, mxArray* plhs[], case 53: checkNArgs(4, nrhs); grid = mxGetPr(prhs[3]); - npts = mxGetM(prhs[3]) * mxGetN(prhs[3]); + npts = mxGetM(prhs[3]) * mxGetN(prhs[3]); iok = domain_setupGrid(dom, npts, grid); break; case 54: diff --git a/src/matlab/phasemethods.cpp b/src/matlab/phasemethods.cpp index a28b2f097..9d74fe9a5 100644 --- a/src/matlab/phasemethods.cpp +++ b/src/matlab/phasemethods.cpp @@ -10,7 +10,7 @@ void phasemethods(int nlhs, mxArray* plhs[], { double vv = 0.0; int iok=0, k; - int ph = getInt(prhs[1]); + int ph = getInt(prhs[1]); int job = getInt(prhs[2]); char* input_buf; diff --git a/src/matlab/thermomethods.cpp b/src/matlab/thermomethods.cpp index 5a8e42459..56112a53d 100644 --- a/src/matlab/thermomethods.cpp +++ b/src/matlab/thermomethods.cpp @@ -152,7 +152,7 @@ static void thermoget(int nlhs, mxArray* plhs[], vv = double(th_eosType(n)); break; case 19: - vv = th_critTemperature(n); + vv = th_critTemperature(n); break; case 20: vv = th_critPressure(n); diff --git a/src/numerics/BandMatrix.cpp b/src/numerics/BandMatrix.cpp index 5d1fc2da4..9199cba05 100644 --- a/src/numerics/BandMatrix.cpp +++ b/src/numerics/BandMatrix.cpp @@ -190,7 +190,7 @@ size_t BandMatrix::ldim() const return 2*m_kl + m_ku + 1; } -vector_int& BandMatrix::ipiv() +vector_int& BandMatrix::ipiv() { return m_ipiv; } @@ -279,7 +279,7 @@ int BandMatrix::solve(doublereal* b, size_t nrhs, size_t ldb) return info; } -vector_fp::iterator BandMatrix::begin() +vector_fp::iterator BandMatrix::begin() { m_factored = false; return data.begin(); @@ -314,7 +314,7 @@ ostream& operator<<(ostream& s, const BandMatrix& m) return s; } -doublereal BandMatrix::rcond(doublereal a1norm) +doublereal BandMatrix::rcond(doublereal a1norm) { int printLevel = 0; int useReturnErrorCode = 0; @@ -356,7 +356,7 @@ doublereal BandMatrix::oneNorm() const doublereal value = 0.0; for (int j = 0; j < (int) m_n; j++) { doublereal sum = 0.0; - doublereal* colP = m_colPtrs[j]; + doublereal* colP = m_colPtrs[j]; for (int i = j - ku; i <= j + kl; i++) { sum += fabs(colP[kl + ku + i - j]); } diff --git a/src/numerics/CVodeInt.cpp b/src/numerics/CVodeInt.cpp index 1be2ef73c..55eaeddbf 100644 --- a/src/numerics/CVodeInt.cpp +++ b/src/numerics/CVodeInt.cpp @@ -190,12 +190,12 @@ void CVodeInt::setIterator(IterType t) void CVodeInt::initialize(double t0, FuncEval& func) { m_neq = int(func.neq()); - m_t0 = t0; + m_t0 = t0; if (m_y) { - N_VFree(m_y); // free solution vector if already allocated + N_VFree(m_y); // free solution vector if already allocated } - m_y = N_VNew(m_neq, 0); // allocate solution vector + m_y = N_VNew(m_neq, 0); // allocate solution vector // check abs tolerance array size if (m_itol == 1 && m_nabs < m_neq) { throw CVodeErr("not enough absolute tolerance values specified."); @@ -205,7 +205,7 @@ void CVodeInt::initialize(double t0, FuncEval& func) // set options m_iopt[MXSTEP] = m_maxsteps; m_iopt[MAXORD] = m_maxord; - m_ropt[HMAX] = m_hmax; + m_ropt[HMAX] = m_hmax; if (m_cvode_mem) { CVodeFree(m_cvode_mem); @@ -246,13 +246,13 @@ void CVodeInt::initialize(double t0, FuncEval& func) void CVodeInt::reinitialize(double t0, FuncEval& func) { - m_t0 = t0; + m_t0 = t0; func.getInitialConditions(m_t0, m_neq, N_VDATA(m_y)); // set options m_iopt[MXSTEP] = m_maxsteps; m_iopt[MAXORD] = m_maxord; - m_ropt[HMAX] = m_hmax; + m_ropt[HMAX] = m_hmax; // pass a pointer to func in m_data m_data = (void*)&func; diff --git a/src/numerics/CVodeInt.h b/src/numerics/CVodeInt.h index d65d34f85..db7acc038 100644 --- a/src/numerics/CVodeInt.h +++ b/src/numerics/CVodeInt.h @@ -83,6 +83,6 @@ private: void* m_data; }; -} // namespace +} // namespace #endif // CT_CVODE diff --git a/src/numerics/CVodesIntegrator.cpp b/src/numerics/CVodesIntegrator.cpp index c1a7f45e0..3cb3e5c80 100644 --- a/src/numerics/CVodesIntegrator.cpp +++ b/src/numerics/CVodesIntegrator.cpp @@ -268,7 +268,7 @@ void CVodesIntegrator::sensInit(double t0, FuncEval& func) void CVodesIntegrator::initialize(double t0, FuncEval& func) { m_neq = func.neq(); - m_t0 = t0; + m_t0 = t0; m_time = t0; if (m_y) { @@ -345,7 +345,7 @@ void CVodesIntegrator::initialize(double t0, FuncEval& func) void CVodesIntegrator::reinitialize(double t0, FuncEval& func) { - m_t0 = t0; + m_t0 = t0; m_time = t0; func.getInitialConditions(m_t0, static_cast(m_neq), NV_DATA_S(m_y)); diff --git a/src/numerics/DenseMatrix.cpp b/src/numerics/DenseMatrix.cpp index af7ea43c8..5fb5e868e 100644 --- a/src/numerics/DenseMatrix.cpp +++ b/src/numerics/DenseMatrix.cpp @@ -73,12 +73,12 @@ void DenseMatrix::resize(size_t n, size_t m, doublereal v) } } -doublereal* const* DenseMatrix::colPts() +doublereal* const* DenseMatrix::colPts() { return &m_colPts[0]; } -const doublereal* const* DenseMatrix::const_colPts() const +const doublereal* const* DenseMatrix::const_colPts() const { return &m_colPts[0]; } @@ -211,7 +211,7 @@ int invert(DenseMatrix& A, size_t nn) vector_fp work(n); integer lwork = static_cast(work.size()); ct_dgetri(n, A.ptrColumn(0), static_cast(A.nRows()), - &A.ipiv()[0], &work[0], lwork, info); + &A.ipiv()[0], &work[0], lwork, info); if (info != 0) { if (A.m_printLevel) { writelogf("invert(DenseMatrix& A, int nn): DGETRS returned INFO = %d\n", info); diff --git a/src/numerics/Func1.cpp b/src/numerics/Func1.cpp index 0520acaf5..74a9d9612 100644 --- a/src/numerics/Func1.cpp +++ b/src/numerics/Func1.cpp @@ -28,10 +28,10 @@ Func1& Func1::operator=(const Func1& right) if (&right == this) { return *this; } - m_c = right.m_c; - m_f1 = right.m_f1; - m_f2 = right.m_f2; - m_parent = right.m_parent; + m_c = right.m_c; + m_f1 = right.m_f1; + m_f2 = right.m_f2; + m_parent = right.m_parent; return *this; } @@ -141,7 +141,7 @@ void Func1::setParent(Func1* p) string Sin1::write(const string& arg) const { - string c = ""; + string c = ""; if (m_c != 1.0) { c = fp2str(m_c); } @@ -165,7 +165,7 @@ Func1& Cos1::derivative() const std::string Cos1::write(const std::string& arg) const { - string c = ""; + string c = ""; if (m_c != 1.0) { c = fp2str(m_c); } @@ -186,7 +186,7 @@ Func1& Exp1::derivative() const std::string Exp1::write(const std::string& arg) const { - string c = ""; + string c = ""; if (m_c != 1.0) { c = fp2str(m_c); } @@ -216,7 +216,7 @@ string Func1::write(const std::string& arg) const string Pow1::write(const std::string& arg) const { - string c = ""; + string c = ""; if (m_c == 0.5) { return "\\sqrt{" + arg + "}"; } diff --git a/src/numerics/IDA_Solver.cpp b/src/numerics/IDA_Solver.cpp index c81100338..7ef771f9a 100644 --- a/src/numerics/IDA_Solver.cpp +++ b/src/numerics/IDA_Solver.cpp @@ -72,7 +72,7 @@ extern "C" { Cantera::ResidJacEval* f = d->m_func; Cantera::IDA_Solver* s = d->m_solver; double delta_t = s->getCurrentStepFromIDA(); - // TODO evaluate evalType. Assumed to be Base_ResidEval + // TODO evaluate evalType. Assumed to be Base_ResidEval int retn = 0; int flag = f->evalResidNJ(t, delta_t, ydata, ydotdata, rdata); if (flag < 0) { @@ -96,18 +96,18 @@ extern "C" { * In the case of a recoverable error return, the integrator will * attempt to recover by reducing the stepsize (which changes cj). */ - static int ida_jacobian(sd_size_t nrows, realtype t, realtype c_j, N_Vector y, N_Vector ydot, N_Vector r, - DlsMat Jac, void* f_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) + static int ida_jacobian(sd_size_t nrows, realtype t, realtype c_j, N_Vector y, N_Vector ydot, N_Vector r, + DlsMat Jac, void* f_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { - doublereal* ydata = NV_DATA_S(y); + doublereal* ydata = NV_DATA_S(y); doublereal* ydotdata = NV_DATA_S(ydot); - doublereal* rdata = NV_DATA_S(r); + doublereal* rdata = NV_DATA_S(r); Cantera::ResidData* d = (Cantera::ResidData*) f_data; Cantera::ResidJacEval* f = d->m_func; doublereal* const* colPts = Jac->cols; Cantera::IDA_Solver* s = d->m_solver; double delta_t = s->getCurrentStepFromIDA(); - f->evalJacobianDP(t, delta_t, c_j, ydata, ydotdata, colPts, rdata); + f->evalJacobianDP(t, delta_t, c_j, ydata, ydotdata, colPts, rdata); return 0; } } @@ -457,7 +457,7 @@ void IDA_Solver::init(doublereal t0) } } -void IDA_Solver::correctInitial_Y_given_Yp(doublereal* y, doublereal* yp, doublereal tout) +void IDA_Solver::correctInitial_Y_given_Yp(doublereal* y, doublereal* yp, doublereal tout) { int icopt = IDA_Y_INIT; doublereal tout1 = tout; @@ -482,7 +482,7 @@ void IDA_Solver::correctInitial_Y_given_Yp(doublereal* y, doublereal* yp, doubl doublereal* yyp = NV_DATA_S(m_ydot); for (int i = 0; i < m_neq; i++) { - y[i] = yy[i]; + y[i] = yy[i]; yp[i] = yyp[i]; } } @@ -512,7 +512,7 @@ void IDA_Solver::correctInitial_YaYp_given_Yd(doublereal* y, doublereal* yp, dou doublereal* yyp = NV_DATA_S(m_ydot); for (int i = 0; i < m_neq; i++) { - y[i] = yy[i]; + y[i] = yy[i]; yp[i] = yyp[i]; } } @@ -534,7 +534,7 @@ int IDA_Solver::solve(double tout) flag = IDASolve(m_ida_mem, tout, &tretn, m_y, m_ydot, IDA_ONE_STEP); if (flag < 0) { throw IDA_Err(" IDA error encountered."); - } else if (flag == IDA_TSTOP_RETURN) { + } else if (flag == IDA_TSTOP_RETURN) { // we've reached our goal, and have actually integrated past it } else if (flag == IDA_ROOT_RETURN) { // not sure what to do with this yet @@ -563,7 +563,7 @@ double IDA_Solver::step(double tout) flag = IDASolve(m_ida_mem, tout, &t, m_y, m_ydot, IDA_ONE_STEP); if (flag < 0) { throw IDA_Err(" IDA error encountered."); - } else if (flag == IDA_TSTOP_RETURN) { + } else if (flag == IDA_TSTOP_RETURN) { // we've reached our goal, and have actually integrated past it } else if (flag == IDA_ROOT_RETURN) { // not sure what to do with this yet diff --git a/src/numerics/ResidJacEval.cpp b/src/numerics/ResidJacEval.cpp index 82ffb617e..c933b3157 100644 --- a/src/numerics/ResidJacEval.cpp +++ b/src/numerics/ResidJacEval.cpp @@ -35,7 +35,7 @@ ResidJacEval& ResidJacEval::operator=(const ResidJacEval& right) ResidEval::operator=(right); m_atol = right.m_atol; - neq_ = right.neq_; + neq_ = right.neq_; return *this; } diff --git a/src/numerics/RootFind.cpp b/src/numerics/RootFind.cpp index 9975cd41b..5d5c7f0d1 100644 --- a/src/numerics/RootFind.cpp +++ b/src/numerics/RootFind.cpp @@ -105,19 +105,19 @@ RootFind& RootFind::operator=(const RootFind& right) m_rtolf = right.m_rtolf; m_rtolx = right.m_rtolx; m_maxstep = right.m_maxstep; - printLvl = right.printLvl; + printLvl = right.printLvl; writeLogAllowed_ = right.writeLogAllowed_; - DeltaXnorm_ = right.DeltaXnorm_; + DeltaXnorm_ = right.DeltaXnorm_; specifiedDeltaXnorm_ = right.specifiedDeltaXnorm_; - DeltaXMax_ = right.DeltaXMax_; + 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_; + 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; } @@ -196,7 +196,7 @@ int RootFind::solve(doublereal xmin, doublereal xmax, int itmax, doublereal& fun 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 fnorm; /* A valid norm for the making the function value dimensionless */ doublereal xDelMin; doublereal sgn; doublereal fnoise = 0.0; @@ -248,8 +248,8 @@ int RootFind::solve(doublereal xmin, doublereal xmax, int itmax, doublereal& fun 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_; + stre, DeltaXnorm_, deltaXConverged_); + DeltaXnorm_ = deltaXConverged_; } /* @@ -304,7 +304,7 @@ int RootFind::solve(doublereal xmin, doublereal xmax, int itmax, doublereal& fun */ rfT.reasoning = "Second Point: "; if (x1 == 0.0) { - x2 = x1 + 0.01 * DeltaXnorm_; + x2 = x1 + 0.01 * DeltaXnorm_; rfT.reasoning += "Set by DeltaXnorm_"; } else { x2 = x1 * 1.0001; @@ -316,7 +316,7 @@ int RootFind::solve(doublereal xmin, doublereal xmax, int itmax, doublereal& fun } /* - * Find the second function value f2 = func(x2), Process it + * Find the second function value f2 = func(x2), Process it */ deltaX2 = x2 - x1; its++; @@ -395,7 +395,7 @@ int RootFind::solve(doublereal xmin, doublereal xmax, int itmax, doublereal& fun writelogf("%s functions evals produced the same result, %g, at %g and %g\n", strw, f2, x1, x2); } - xnew = x2 + DeltaXnorm_; + xnew = x2 + DeltaXnorm_; slopePointingToHigher = true; useNextStrat = true; rfT.reasoning += "Slope is close to zero. "; @@ -510,7 +510,7 @@ int RootFind::solve(doublereal xmin, doublereal xmax, int itmax, doublereal& fun } } if (fabs(xnew - x2) < 0.1 * xDelMin) { - xnew = x2 + sign(xnew-x2) * 0.1 * xDelMin; + xnew = x2 + sign(xnew-x2) * 0.1 * xDelMin; if (DEBUG_MODE_ENABLED && printLvl >= 3 && writeLogAllowed_) { fprintf(fp, " | x10%% = %-11.5E", xnew); } @@ -523,7 +523,7 @@ int RootFind::solve(doublereal xmin, doublereal xmax, int itmax, doublereal& fun */ doublereal xDelMax = 1.5 * fabs(x2 - x1); if (specifiedDeltaXnorm_ && 0.5 * DeltaXnorm_ > xDelMax) { - xDelMax = 0.5 *DeltaXnorm_ ; + xDelMax = 0.5 *DeltaXnorm_; } if (fabs(xDelMax) < fabs(xnew - x2)) { xnew = x2 + sign(xnew-x2) * xDelMax; @@ -573,14 +573,14 @@ int RootFind::solve(doublereal xmin, doublereal xmax, int itmax, doublereal& fun } } else { if (f2 > 0.0) { - if (xnew < x2) { + if (xnew < x2) { xnew = (xNegF + x2)/2; } if (xnew > xNegF) { xnew = (xNegF + x2)/2; } } else { - if (xnew > x2) { + if (xnew > x2) { xnew = (xPosF + x2)/2; } if (xnew < xPosF) { @@ -821,8 +821,8 @@ int RootFind::solve(doublereal xmin, doublereal xmax, int itmax, doublereal& fun 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; + rfT.deltaXConverged = deltaXConverged_; + rfT.deltaFConverged = fnorm * m_rtolf; if (foundStraddle) { rfT.delX = std::max(fabs(deltaX2), fabs(deltaXnew)); } else { @@ -1003,7 +1003,7 @@ done: writelogf("RootFind ERROR: Soln probably lies higher than xmax, %g: best guess = %g\n", xmax, *xbest); } rfT.reasoning += "Soln probably lies higher than xmax, " + fp2str(xmax) + ": best guess = " + fp2str(*xbest); - } else if (retn == ROOTFIND_SOLNLOWERTHANXMIN) { + } else if (retn == ROOTFIND_SOLNLOWERTHANXMIN) { if (printLvl >= 1) { writelogf("RootFind ERROR: Soln probably lies lower than xmin, %g: best guess = %g\n", xmin, *xbest); } @@ -1046,7 +1046,7 @@ doublereal RootFind::func(doublereal x) if (DEBUG_MODE_ENABLED) { checkFinite(r); } - doublereal ff = r - m_funcTargetValue; + doublereal ff = r - m_funcTargetValue; if (x >= x_maxTried_) { x_maxTried_ = x; fx_maxTried_ = ff; diff --git a/src/numerics/SquareMatrix.cpp b/src/numerics/SquareMatrix.cpp index 10cf1f26f..4b4688e55 100644 --- a/src/numerics/SquareMatrix.cpp +++ b/src/numerics/SquareMatrix.cpp @@ -98,7 +98,7 @@ 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 +void SquareMatrix::mult(const doublereal* b, doublereal* prod) const { DenseMatrix::mult(b, prod); } @@ -108,7 +108,7 @@ void SquareMatrix::mult(const DenseMatrix& b, DenseMatrix& prod) const DenseMatrix::mult(b, prod); } -void SquareMatrix::leftMult(const doublereal* const b, doublereal* const prod) const +void SquareMatrix::leftMult(const doublereal* const b, doublereal* const prod) const { DenseMatrix::leftMult(b, prod); } @@ -141,7 +141,7 @@ void SquareMatrix::setFactorFlag() int SquareMatrix::factorQR() { - if (tau.size() < m_nrows) { + if (tau.size() < m_nrows) { tau.resize(m_nrows, 0.0); work.resize(8 * m_nrows, 0.0); } @@ -203,7 +203,7 @@ int SquareMatrix::solveQR(doublereal* b) } char dd = 'N'; - ct_dtrtrs(ctlapack::UpperTriangular, ctlapack::NoTranspose, &dd, m_nrows, 1, &*begin(), m_nrows, b, + ct_dtrtrs(ctlapack::UpperTriangular, ctlapack::NoTranspose, &dd, m_nrows, 1, &*begin(), m_nrows, b, m_nrows, info); if (info != 0) { if (m_printLevel) { @@ -262,7 +262,7 @@ doublereal SquareMatrix::rcondQR() } int rinfo = 0; - rcond = ct_dtrcon(0, ctlapack::UpperTriangular, 0, m_nrows, &*begin(), m_nrows, DATA_PTR(work), + rcond = ct_dtrcon(0, ctlapack::UpperTriangular, 0, m_nrows, &*begin(), m_nrows, DATA_PTR(work), DATA_PTR(iwork_), rinfo); if (rinfo != 0) { if (m_printLevel) { @@ -290,7 +290,7 @@ doublereal* SquareMatrix::ptrColumn(size_t j) return Array2D::ptrColumn(j); } -size_t SquareMatrix::nRows() const +size_t SquareMatrix::nRows() const { return m_nrows; } @@ -315,7 +315,7 @@ vector_fp::const_iterator SquareMatrix::begin() const return m_data.begin(); } -doublereal* const* SquareMatrix::colPts() +doublereal* const* SquareMatrix::colPts() { return DenseMatrix::colPts(); } diff --git a/src/numerics/funcs.cpp b/src/numerics/funcs.cpp index 3eecf0ce5..7d6ddba95 100644 --- a/src/numerics/funcs.cpp +++ b/src/numerics/funcs.cpp @@ -54,12 +54,12 @@ doublereal linearInterp(doublereal x, const vector_fp& xpts, /*! * Given a collection of points X(I) and a set of values Y(I) which * correspond to some function or measurement at each of the X(I), - * subroutine DPOLFT computes the weighted least-squares polynomial + * subroutine DPOLFT computes the weighted least-squares polynomial * fits of all degrees up to some degree either specified by the user * or determined by the routine. The fits thus obtained are in - * orthogonal polynomial form. Subroutine DP1VLU may then be + * orthogonal polynomial form. Subroutine DP1VLU may then be * called to evaluate the fitted polynomials and any of their - * derivatives at any point. The subroutine DPCOEF may be used to + * derivatives at any point. The subroutine DPCOEF may be used to * express the polynomial fits as powers of (X-C) for any specified * point C. * @@ -70,34 +70,34 @@ doublereal linearInterp(doublereal x, const vector_fp& xpts, * distinct. There are n of them. * @param y array of corresponding function values. There are n of them * @param w array of positive values to be used as weights. If - * W[0] is negative, DPOLFT will set all the weights + * W[0] is negative, DPOLFT will set all the weights * to 1.0, which means unweighted least squares error * will be minimized. To minimize relative error, the * user should set the weights to: W(I) = 1.0/Y(I)**2, * I = 1,...,N . * @param maxdeg maximum degree to be allowed for polynomial fit. - * MAXDEG may be any non-negative integer less than N. - * Note -- MAXDEG cannot be equal to N-1 when a + * MAXDEG may be any non-negative integer less than N. + * Note -- MAXDEG cannot be equal to N-1 when a * statistical test is to be used for degree selection, - * i.e., when input value of EPS is negative. + * i.e., when input value of EPS is negative. * @param ndeg output degree of the fit computed. * @param eps Specifies the criterion to be used in determining * the degree of fit to be computed. - * (1) If EPS is input negative, DPOLFT chooses the + * (1) If EPS is input negative, DPOLFT chooses the * degree based on a statistical F test of * significance. One of three possible * significance levels will be used: .01, .05 or - * .10. If EPS=-1.0 , the routine will + * .10. If EPS=-1.0 , the routine will * automatically select one of these levels based * on the number of data points and the maximum - * degree to be considered. If EPS is input as + * degree to be considered. If EPS is input as * -.01, -.05, or -.10, a significance level of * .01, .05, or .10, respectively, will be used. - * (2) If EPS is set to 0., DPOLFT computes the - * polynomials of degrees 0 through MAXDEG . - * (3) If EPS is input positive, EPS is the RMS + * (2) If EPS is set to 0., DPOLFT computes the + * polynomials of degrees 0 through MAXDEG . + * (3) If EPS is input positive, EPS is the RMS * error tolerance which must be satisfied by the - * fitted polynomial. DPOLFT will increase the + * fitted polynomial. DPOLFT will increase the * degree of fit until this criterion is met or * until the maximum degree is reached. * @param r Output vector containing the first LL+1 Taylor coefficients diff --git a/src/oneD/Domain1D.cpp b/src/oneD/Domain1D.cpp index 5951673d7..f7dd6caae 100644 --- a/src/oneD/Domain1D.cpp +++ b/src/oneD/Domain1D.cpp @@ -64,13 +64,13 @@ void Domain1D::eval(size_t jg, doublereal* xg, doublereal* rg, doublereal* rsd = rg + loc(); integer* diag = mask + loc(); - size_t jmin, jmax, jpt, j, i; + size_t jmin, jmax, jpt, j, i; jpt = jg - firstPoint(); - if (jg == npos) { // evaluate all points + if (jg == npos) { // evaluate all points jmin = 0; jmax = m_points - 1; - } else { // evaluate points for Jacobian + } else { // evaluate points for Jacobian jmin = std::max(jpt, 1) - 1; jmax = std::min(jpt+1,m_points-1); } diff --git a/src/oneD/MultiNewton.cpp b/src/oneD/MultiNewton.cpp index eef1ed9e6..d18cf33b6 100644 --- a/src/oneD/MultiNewton.cpp +++ b/src/oneD/MultiNewton.cpp @@ -151,7 +151,7 @@ const size_t NDAMP = 7; MultiNewton::MultiNewton(int sz) : m_maxAge(5) { - m_n = sz; + m_n = sz; m_elapsed = 0.0; } diff --git a/src/oneD/Sim1D.cpp b/src/oneD/Sim1D.cpp index 976880b97..d6c0a2ad3 100644 --- a/src/oneD/Sim1D.cpp +++ b/src/oneD/Sim1D.cpp @@ -47,7 +47,7 @@ void Sim1D::setInitialGuess(const std::string& component, vector_fp& locs, vecto } } -void Sim1D::setValue(size_t dom, size_t comp, size_t localPoint, doublereal value) +void Sim1D::setValue(size_t dom, size_t comp, size_t localPoint, doublereal value) { size_t iloc = domain(dom).loc() + domain(dom).index(comp, localPoint); AssertThrowMsg(iloc < m_x.size(), "Sim1D::setValue", diff --git a/src/oneD/StFlow.cpp b/src/oneD/StFlow.cpp index a05d9842c..ee18fa5c0 100644 --- a/src/oneD/StFlow.cpp +++ b/src/oneD/StFlow.cpp @@ -34,7 +34,7 @@ StFlow::StFlow(IdealGasPhase* ph, size_t nsp, size_t points) : m_thermo = ph; if (ph == 0) { - return; // used to create a dummy object + return; // used to create a dummy object } size_t nsp2 = m_thermo->nSpecies(); @@ -109,7 +109,7 @@ void StFlow::resize(size_t ncomponents, size_t points) m_visc.resize(m_points, 0.0); m_tcon.resize(m_points, 0.0); - if (m_transport_option == c_Mixav_Transport) { + if (m_transport_option == c_Mixav_Transport) { m_diff.resize(m_nsp*m_points); } else { m_multidiff.resize(m_nsp*m_nsp*m_points); @@ -238,10 +238,10 @@ void StFlow::eval(size_t jg, doublereal* xg, integer* diag = diagg + loc(); size_t jmin, jmax; - if (jg == npos) { // evaluate all points + if (jg == npos) { // evaluate all points jmin = 0; jmax = m_points - 1; - } else { // evaluate points for Jacobian + } else { // evaluate points for Jacobian size_t jpt = (jg == 0) ? 0 : jg - firstPoint(); jmin = std::max(jpt, 1) - 1; jmax = std::min(jpt+1,m_points-1); @@ -434,9 +434,8 @@ void StFlow::eval(size_t jg, doublereal* xg, dtdzj = dTdz(x,j); sum2 *= GasConstant * dtdzj; - rsd[index(c_offset_T, j)] = - - m_cp[j]*rho_u(x,j)*dtdzj - - divHeatFlux(x,j) - sum - sum2; + rsd[index(c_offset_T, j)] = - m_cp[j]*rho_u(x,j)*dtdzj + - divHeatFlux(x,j) - sum - sum2; rsd[index(c_offset_T, j)] /= (m_rho[j]*m_cp[j]); rsd[index(c_offset_T, j)] -= rdt*(T(x,j) - T_prev(j)); rsd[index(c_offset_T, j)] -= (m_qdotRadiation[j] / (m_rho[j] * m_cp[j])); @@ -689,7 +688,7 @@ void StFlow::restore(const XML_Node& dom, doublereal* soln, int loglevel) soln[index(0,j)] = x[j]; } } else if (nm == "z") { - ; // already read grid + ; // already read grid } else if (nm == "V") { writelog("radial velocity ", loglevel >= 2); if (x.size() != np) { @@ -1010,4 +1009,4 @@ XML_Node& FreeFlame::save(XML_Node& o, const doublereal* const sol) return flow; } -} // namespace +} // namespace diff --git a/src/oneD/boundaries1D.cpp b/src/oneD/boundaries1D.cpp index 193185971..8d3d1c96d 100644 --- a/src/oneD/boundaries1D.cpp +++ b/src/oneD/boundaries1D.cpp @@ -357,8 +357,8 @@ void Symm1D::eval(size_t jg, doublereal* xg, doublereal* rg, integer* diagg, db = diag + 1; db[1] = 0; db[2] = 0; - rb[1] = xb[1] - xb[1 + nc]; // zero dV/dz - rb[2] = xb[2] - xb[2 + nc]; // zero dT/dz + rb[1] = xb[1] - xb[1 + nc]; // zero dV/dz + rb[2] = xb[2] - xb[2 + nc]; // zero dT/dz } if (m_flow_left) { @@ -368,8 +368,8 @@ void Symm1D::eval(size_t jg, doublereal* xg, doublereal* rg, integer* diagg, db = diag - nc; db[1] = 0; db[2] = 0; - rb[1] = xb[1] - xb[1 - nc]; // zero dV/dz - rb[2] = xb[2] - xb[2 - nc]; // zero dT/dz + rb[1] = xb[1] - xb[1 - nc]; // zero dV/dz + rb[2] = xb[2] - xb[2 - nc]; // zero dT/dz } } @@ -458,7 +458,7 @@ void Outlet1D::eval(size_t jg, doublereal* xg, doublereal* rg, integer* diagg, rb[0] = xb[3]; } - rb[2] = xb[2] - xb[2 - nc]; // zero T gradient + rb[2] = xb[2] - xb[2 - nc]; // zero T gradient for (k = 5; k < nc; k++) { rb[k] = xb[k] - xb[k - nc]; // zero mass fraction gradient db[k] = 0; @@ -587,11 +587,11 @@ void OutletRes1D::eval(size_t jg, doublereal* xg, doublereal* rg, if (!m_flow_left->fixed_mdot()) { ; } else { - rb[0] = xb[3]; // zero Lambda + rb[0] = xb[3]; // zero Lambda } rb[2] = xb[2] - m_temp; // zero dT/dz for (k = 5; k < nc; k++) { - rb[k] = xb[k] - m_yres[k-4]; // fixed Y + rb[k] = xb[k] - m_yres[k-4]; // fixed Y db[k] = 0; } } @@ -674,14 +674,14 @@ void Surf1D::eval(size_t jg, doublereal* xg, doublereal* rg, if (m_flow_right) { rb = r + 1; xb = x + 1; - rb[2] = xb[2] - x[0]; // specified T + rb[2] = xb[2] - x[0]; // specified T } if (m_flow_left) { nc = m_flow_left->nComponents(); rb = r - nc; xb = x - nc; - rb[2] = xb[2] - x[0]; // specified T + rb[2] = xb[2] - x[0]; // specified T } } @@ -801,7 +801,7 @@ void ReactingSurf1D::eval(size_t jg, doublereal* xg, doublereal* rg, if (m_flow_right) { rb = r + 1; xb = x + 1; - rb[2] = xb[2] - x[0]; // specified T + rb[2] = xb[2] - x[0]; // specified T } size_t nc; if (m_flow_left) { @@ -809,7 +809,7 @@ void ReactingSurf1D::eval(size_t jg, doublereal* xg, doublereal* rg, const doublereal* mwleft = DATA_PTR(m_phase_left->molecularWeights()); rb =r - nc; xb = x - nc; - rb[2] = xb[2] - x[0]; // specified T + rb[2] = xb[2] - x[0]; // specified T for (size_t nl = 1; nl < m_left_nsp; nl++) { rb[4+nl] += m_work[nl]*mwleft[nl]; } diff --git a/src/oneD/refine.cpp b/src/oneD/refine.cpp index 6bdc44867..600daf72f 100644 --- a/src/oneD/refine.cpp +++ b/src/oneD/refine.cpp @@ -239,7 +239,7 @@ int Refiner::getNewGrid(int n, const doublereal* z, } if (m_loc.empty()) { - copy(z, z + n, zn); + copy(z, z + n, zn); return 0; } diff --git a/src/thermo/ConstCpPoly.cpp b/src/thermo/ConstCpPoly.cpp index 141e5c05b..dc8bcb19b 100644 --- a/src/thermo/ConstCpPoly.cpp +++ b/src/thermo/ConstCpPoly.cpp @@ -24,8 +24,8 @@ ConstCpPoly::ConstCpPoly(double tlow, double thigh, double pref, SpeciesThermoInterpType(tlow, thigh, pref) { m_t0 = coeffs[0]; - m_h0_R = coeffs[1] / GasConstant; - m_s0_R = coeffs[2] / GasConstant; + m_h0_R = coeffs[1] / GasConstant; + m_s0_R = coeffs[2] / GasConstant; m_cp0_R = coeffs[3] / GasConstant; m_logt0 = log(m_t0); } @@ -46,7 +46,7 @@ void ConstCpPoly::updateProperties(const doublereal* tt, doublereal rt = 1.0/t; *cp_R = m_cp0_R; *h_RT = rt*(m_h0_R + (t - m_t0) * m_cp0_R); - *s_R = m_s0_R + m_cp0_R * (logt - m_logt0); + *s_R = m_s0_R + m_cp0_R * (logt - m_logt0); } void ConstCpPoly::updatePropertiesTemp(const doublereal temp, @@ -58,7 +58,7 @@ void ConstCpPoly::updatePropertiesTemp(const doublereal temp, doublereal rt = 1.0/temp; *cp_R = m_cp0_R; *h_RT = rt*(m_h0_R + (temp - m_t0) * m_cp0_R); - *s_R = m_s0_R + m_cp0_R * (logt - m_logt0); + *s_R = m_s0_R + m_cp0_R * (logt - m_logt0); } void ConstCpPoly::reportParameters(size_t& n, int& type, @@ -80,8 +80,8 @@ void ConstCpPoly::reportParameters(size_t& n, int& type, void ConstCpPoly::modifyParameters(doublereal* coeffs) { m_t0 = coeffs[0]; - m_h0_R = coeffs[1] / GasConstant; - m_s0_R = coeffs[2] / GasConstant; + m_h0_R = coeffs[1] / GasConstant; + m_s0_R = coeffs[2] / GasConstant; m_cp0_R = coeffs[3] / GasConstant; m_logt0 = log(m_t0); } diff --git a/src/thermo/ConstDensityThermo.cpp b/src/thermo/ConstDensityThermo.cpp index bb4bd9000..00379e5a0 100644 --- a/src/thermo/ConstDensityThermo.cpp +++ b/src/thermo/ConstDensityThermo.cpp @@ -24,11 +24,11 @@ ConstDensityThermo& ConstDensityThermo::operator=(const ConstDensityThermo& righ 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; - m_pp = right.m_pp; + 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_pp = right.m_pp; return *this; diff --git a/src/thermo/DebyeHuckel.cpp b/src/thermo/DebyeHuckel.cpp index d755e4740..c59b96c16 100644 --- a/src/thermo/DebyeHuckel.cpp +++ b/src/thermo/DebyeHuckel.cpp @@ -35,8 +35,8 @@ DebyeHuckel::DebyeHuckel() : 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_A_Debye(1.172576), // units = sqrt(kg/gmol) + m_B_Debye(3.28640E9), // units = sqrt(kg/gmol) / m m_waterSS(0), m_densWaterSS(1000.), m_waterProps(0) @@ -56,8 +56,8 @@ DebyeHuckel::DebyeHuckel(const std::string& inputFile, 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_A_Debye(1.172576), // units = sqrt(kg/gmol) + m_B_Debye(3.28640E9), // units = sqrt(kg/gmol) / m m_waterSS(0), m_densWaterSS(1000.), m_waterProps(0) @@ -77,8 +77,8 @@ DebyeHuckel::DebyeHuckel(XML_Node& phaseRoot, const std::string& id_) : 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_A_Debye(1.172576), // units = sqrt(kg/gmol) + m_B_Debye(3.28640E9), // units = sqrt(kg/gmol) / m m_waterSS(0), m_densWaterSS(1000.), m_waterProps(0) @@ -98,8 +98,8 @@ DebyeHuckel::DebyeHuckel(const DebyeHuckel& b) : 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_A_Debye(1.172576), // units = sqrt(kg/gmol) + m_B_Debye(3.28640E9), // units = sqrt(kg/gmol) / m m_waterSS(0), m_densWaterSS(1000.), m_waterProps(0) @@ -115,27 +115,27 @@ 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_npActCoeff = b.m_npActCoeff; - m_IionicMolality = b.m_IionicMolality; - m_maxIionicStrength = b.m_maxIionicStrength; + m_formDH = b.m_formDH; + m_formGC = b.m_formGC; + m_Aionic = b.m_Aionic; + m_npActCoeff = b.m_npActCoeff; + 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; - m_npActCoeff = b.m_npActCoeff; + 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; + m_npActCoeff = b.m_npActCoeff; // This is an internal shallow copy of the PDSS_Water pointer - m_waterSS = dynamic_cast(providePDSS(0)) ; + m_waterSS = dynamic_cast(providePDSS(0)); if (!m_waterSS) { throw CanteraError("DebyHuckel::operator=()", "Dynamic cast to waterPDSS failed"); } - m_densWaterSS = b.m_densWaterSS; + m_densWaterSS = b.m_densWaterSS; delete m_waterProps; m_waterProps = 0; @@ -143,11 +143,11 @@ DebyeHuckel& DebyeHuckel::operator=(const DebyeHuckel& b) m_waterProps = new WaterProps(m_waterSS); } - m_pp = b.m_pp; - m_tmpV = b.m_tmpV; + m_pp = b.m_pp; + 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_Beta_ij = b.m_Beta_ij; + m_lnActCoeffMolal = b.m_lnActCoeffMolal; m_d2lnActCoeffMolaldT2= b.m_d2lnActCoeffMolaldT2; } return *this; @@ -578,7 +578,7 @@ void DebyeHuckel::initThermoXML(XML_Node& phaseNode, const std::string& id_) if (formString == "Dilute_limit") { m_formDH = DHFORM_DILUTE_LIMIT; } else if (formString == "Bdot_with_variable_a") { - m_formDH = DHFORM_BDOT_AK ; + m_formDH = DHFORM_BDOT_AK; } else if (formString == "Bdot_with_common_a") { m_formDH = DHFORM_BDOT_ACOMMON; } else if (formString == "Beta_ij") { @@ -678,7 +678,7 @@ void DebyeHuckel::initThermoXML(XML_Node& phaseNode, const std::string& id_) const vector&sss = speciesNames(); for (size_t k = 0; k < m_kk; k++) { - XML_Node* s = speciesDB->findByAttr("name", sss[k]); + XML_Node* s = speciesDB->findByAttr("name", sss[k]); if (!s) { throw CanteraError("DebyeHuckel::initThermoXML", "Species Data Base " + sss[k] + " not found"); @@ -687,7 +687,7 @@ void DebyeHuckel::initThermoXML(XML_Node& phaseNode, const std::string& id_) if (!ss) { throw CanteraError("DebyeHuckel::initThermoXML", "Species " + sss[k] + - " standardState XML block not found"); + " standardState XML block not found"); } std::string modelStringa = ss->attrib("model"); if (modelStringa == "") { @@ -703,7 +703,7 @@ void DebyeHuckel::initThermoXML(XML_Node& phaseNode, const std::string& id_) /* * Initialize the water standard state model */ - m_waterSS = dynamic_cast(providePDSS(0)) ; + m_waterSS = dynamic_cast(providePDSS(0)); if (!m_waterSS) { throw CanteraError("HMWSoln::installThermoXML", "Dynamic cast to PDSS_Water failed"); @@ -1187,7 +1187,7 @@ double DebyeHuckel::_lnactivityWaterHelgesonFixedForm() const } } if (sum > 2.0 * m_maxIionicStrength) { - sum = 2.0 * m_maxIionicStrength; + sum = 2.0 * m_maxIionicStrength; }; return - m_Mnaught * sum * oc; } @@ -1220,13 +1220,12 @@ void DebyeHuckel::s_update_lnMolalityActCoeff() const m_IionicMolalityStoich = 0.0; for (size_t k = 0; k < m_kk; k++) { z_k = m_speciesCharge[k]; - zs_k1 = m_speciesCharge_Stoich[k]; + zs_k1 = m_speciesCharge_Stoich[k]; if (z_k == zs_k1) { m_IionicMolalityStoich += m_molalities[k] * z_k * z_k; } else { zs_k2 = z_k - zs_k1; - m_IionicMolalityStoich - += m_molalities[k] * (zs_k1 * zs_k1 + zs_k2 * zs_k2); + m_IionicMolalityStoich += m_molalities[k] * (zs_k1 * zs_k1 + zs_k2 * zs_k2); } } m_IionicMolalityStoich /= 2.0; @@ -1305,7 +1304,7 @@ void DebyeHuckel::s_update_lnMolalityActCoeff() const for (size_t k = 0; k < m_kk; k++) { z_k = m_speciesCharge[k]; if ((k != m_indexSolvent) && (z_k != 0.0)) { - tmp += m_B_Dot[k] * m_molalities[k]; + tmp += m_B_Dot[k] * m_molalities[k]; } } lnActivitySolvent -= @@ -1343,7 +1342,7 @@ void DebyeHuckel::s_update_lnMolalityActCoeff() const for (size_t k = 0; k < m_kk; k++) { z_k = m_speciesCharge[k]; if ((k != m_indexSolvent) && (z_k != 0.0)) { - tmp += m_B_Dot[k] * m_molalities[k]; + tmp += m_B_Dot[k] * m_molalities[k]; } } lnActivitySolvent -= @@ -1362,7 +1361,7 @@ void DebyeHuckel::s_update_lnMolalityActCoeff() const m_lnActCoeffMolal[k] = - z_k * z_k * numTmp / (1.0 + denomTmp); for (size_t j = 0; j < m_kk; j++) { - double beta = m_Beta_ij.value(k, j); + double beta = m_Beta_ij.value(k, j); m_lnActCoeffMolal[k] += 2.0 * m_molalities[j] * beta; } } @@ -1440,7 +1439,7 @@ void DebyeHuckel::s_update_dlnMolalityActCoeff_dT() const { double z_k, coeff, tmp, y, yp1, sigma, tmpLn; // First we store dAdT explicitly here - double dAdT = dA_DebyedT_TP(); + double dAdT = dA_DebyedT_TP(); if (dAdT == 0.0) { for (size_t k = 0; k < m_kk; k++) { m_dlnActCoeffMolaldT[k] = 0.0; @@ -1453,7 +1452,7 @@ void DebyeHuckel::s_update_dlnMolalityActCoeff_dT() const */ double xmolSolvent = moleFraction(m_indexSolvent); xmolSolvent = std::max(8.689E-3, xmolSolvent); - double sqrtI = sqrt(m_IionicMolality); + double sqrtI = sqrt(m_IionicMolality); double numdAdTTmp = dAdT * sqrtI; double denomTmp = m_B_Debye * sqrtI; double d_lnActivitySolvent_dT = 0; @@ -1466,7 +1465,7 @@ void DebyeHuckel::s_update_dlnMolalityActCoeff_dT() const } d_lnActivitySolvent_dT = 2.0 / 3.0 * dAdT * m_Mnaught * m_IionicMolality * sqrt(m_IionicMolality); - m_dlnActCoeffMolaldT[m_indexSolvent] = d_lnActivitySolvent_dT; + m_dlnActCoeffMolaldT[m_indexSolvent] = d_lnActivitySolvent_dT; break; case DHFORM_BDOT_AK: @@ -1560,7 +1559,7 @@ void DebyeHuckel::s_update_dlnMolalityActCoeff_dT() const void DebyeHuckel::s_update_d2lnMolalityActCoeff_dT2() const { double z_k, coeff, tmp, y, yp1, sigma, tmpLn; - double dAdT = dA_DebyedT_TP(); + double dAdT = dA_DebyedT_TP(); double d2AdT2 = d2A_DebyedT2_TP(); if (d2AdT2 == 0.0 && dAdT == 0.0) { for (size_t k = 0; k < m_kk; k++) { @@ -1575,7 +1574,7 @@ void DebyeHuckel::s_update_d2lnMolalityActCoeff_dT2() const */ double xmolSolvent = moleFraction(m_indexSolvent); xmolSolvent = std::max(8.689E-3, xmolSolvent); - double sqrtI = sqrt(m_IionicMolality); + double sqrtI = sqrt(m_IionicMolality); double numd2AdT2Tmp = d2AdT2 * sqrtI; double denomTmp = m_B_Debye * sqrtI; @@ -1679,7 +1678,7 @@ void DebyeHuckel::s_update_dlnMolalityActCoeff_dP() const { double z_k, coeff, tmp, y, yp1, sigma, tmpLn; int est; - double dAdP = dA_DebyedP_TP(); + double dAdP = dA_DebyedP_TP(); if (dAdP == 0.0) { for (size_t k = 0; k < m_kk; k++) { m_dlnActCoeffMolaldP[k] = 0.0; @@ -1692,7 +1691,7 @@ void DebyeHuckel::s_update_dlnMolalityActCoeff_dP() const */ double xmolSolvent = moleFraction(m_indexSolvent); xmolSolvent = std::max(8.689E-3, xmolSolvent); - double sqrtI = sqrt(m_IionicMolality); + double sqrtI = sqrt(m_IionicMolality); double numdAdPTmp = dAdP * sqrtI; double denomTmp = m_B_Debye * sqrtI; diff --git a/src/thermo/Elements.cpp b/src/thermo/Elements.cpp index a465aeebc..2d5af415c 100644 --- a/src/thermo/Elements.cpp +++ b/src/thermo/Elements.cpp @@ -25,8 +25,8 @@ namespace Cantera * This structure was picked because it's simple, compact, and extensible. */ struct awData { - char name[4]; //!< Null Terminated name, First letter capitalized - double atomicWeight; //!< atomic weight in kg / kg-mol + char name[4]; //!< Null Terminated name, First letter capitalized + double atomicWeight; //!< atomic weight in kg / kg-mol }; /*! diff --git a/src/thermo/FixedChemPotSSTP.cpp b/src/thermo/FixedChemPotSSTP.cpp index fbaf9e0b4..93aa33264 100644 --- a/src/thermo/FixedChemPotSSTP.cpp +++ b/src/thermo/FixedChemPotSSTP.cpp @@ -112,7 +112,7 @@ FixedChemPotSSTP::FixedChemPotSSTP(const std::string& Ename, doublereal val) : saveSpeciesData(0, &s); } -FixedChemPotSSTP::FixedChemPotSSTP(const FixedChemPotSSTP& right) +FixedChemPotSSTP::FixedChemPotSSTP(const FixedChemPotSSTP& right) { *this = right; } diff --git a/src/thermo/GibbsExcessVPSSTP.cpp b/src/thermo/GibbsExcessVPSSTP.cpp index 9a99afd87..18484f9ea 100644 --- a/src/thermo/GibbsExcessVPSSTP.cpp +++ b/src/thermo/GibbsExcessVPSSTP.cpp @@ -36,14 +36,14 @@ GibbsExcessVPSSTP& GibbsExcessVPSSTP::operator=(const GibbsExcessVPSSTP& b) VPStandardStateTP::operator=(b); - moleFractions_ = b.moleFractions_; - lnActCoeff_Scaled_ = b.lnActCoeff_Scaled_; - dlnActCoeffdT_Scaled_ = b.dlnActCoeffdT_Scaled_; - d2lnActCoeffdT2_Scaled_ = b.d2lnActCoeffdT2_Scaled_; + 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_; - m_pp = b.m_pp; + dlnActCoeffdlnN_ = b.dlnActCoeffdlnN_; + m_pp = b.m_pp; return *this; } @@ -204,7 +204,7 @@ void GibbsExcessVPSSTP::initThermo() getMoleFractions(DATA_PTR(moleFractions_)); } -void GibbsExcessVPSSTP::initLengths() +void GibbsExcessVPSSTP::initLengths() { moleFractions_.resize(m_kk); lnActCoeff_Scaled_.resize(m_kk); diff --git a/src/thermo/HMWSoln.cpp b/src/thermo/HMWSoln.cpp index fc93828d4..3b103eeb0 100644 --- a/src/thermo/HMWSoln.cpp +++ b/src/thermo/HMWSoln.cpp @@ -37,7 +37,7 @@ HMWSoln::HMWSoln() : 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_A_Debye(1.172576), // units = sqrt(kg/gmol) m_waterSS(0), m_densWaterSS(1000.), m_waterProps(0), @@ -87,7 +87,7 @@ HMWSoln::HMWSoln(const std::string& inputFile, const std::string& id_) : 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_A_Debye(1.172576), // units = sqrt(kg/gmol) m_waterSS(0), m_densWaterSS(1000.), m_waterProps(0), @@ -138,7 +138,7 @@ HMWSoln::HMWSoln(XML_Node& phaseRoot, const std::string& id_) : 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_A_Debye(1.172576), // units = sqrt(kg/gmol) m_waterSS(0), m_densWaterSS(1000.), m_waterProps(0), @@ -189,7 +189,7 @@ HMWSoln::HMWSoln(const HMWSoln& b) : 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_A_Debye(1.172576), // units = sqrt(kg/gmol) m_waterSS(0), m_densWaterSS(1000.), m_waterProps(0), @@ -235,16 +235,16 @@ 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_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; + 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); @@ -252,7 +252,7 @@ HMWSoln& HMWSoln::operator=(const HMWSoln& b) throw CanteraError("HMWSoln::operator=()", "Dynamic cast to PDSS_Water failed"); } - m_densWaterSS = b.m_densWaterSS; + m_densWaterSS = b.m_densWaterSS; delete m_waterProps; m_waterProps = 0; @@ -260,126 +260,126 @@ HMWSoln& HMWSoln::operator=(const HMWSoln& b) m_waterProps = new WaterProps(dynamic_cast(m_waterSS)); } - m_pp = b.m_pp; - m_tmpV = b.m_tmpV; + m_pp = b.m_pp; + 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_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_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_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_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; + 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; + 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; } @@ -891,7 +891,7 @@ double HMWSoln::dA_DebyedP_TP(double tempArg, double presArg) const dAdP = cached.value; } else { dAdP = m_waterProps->ADebye(T, P, 3); - cached.value = dAdP; + cached.value = dAdP; } break; default: @@ -1122,13 +1122,12 @@ void HMWSoln::s_update_lnMolalityActCoeff() const m_IionicMolalityStoich = 0.0; for (size_t k = 0; k < m_kk; k++) { double z_k = charge(k); - double zs_k1 = m_speciesCharge_Stoich[k]; + double zs_k1 = m_speciesCharge_Stoich[k]; if (z_k == zs_k1) { m_IionicMolalityStoich += m_molalities[k] * z_k * z_k; } else { double zs_k2 = z_k - zs_k1; - m_IionicMolalityStoich - += m_molalities[k] * (zs_k1 * zs_k1 + zs_k2 * zs_k2); + m_IionicMolalityStoich += m_molalities[k] * (zs_k1 * zs_k1 + zs_k2 * zs_k2); } } @@ -1260,15 +1259,15 @@ void HMWSoln::calcMolalitiesCropped() const for (size_t i = 0; i < m_kk; i++) { double charge_i = charge(i); if (charge_i < 0.0) { - double anion_contrib = - m_molalitiesCropped[i] * charge_i; - anion_charge += anion_contrib ; + double anion_contrib = - m_molalitiesCropped[i] * charge_i; + anion_charge += anion_contrib; if (anion_contrib > anion_contrib_max) { anion_contrib_max = anion_contrib; anion_contrib_max_i = i; } } else if (charge_i > 0.0) { double cation_contrib = m_molalitiesCropped[i] * charge_i; - cation_charge += cation_contrib ; + cation_charge += cation_contrib; if (cation_contrib > cation_contrib_max) { cation_contrib_max = cation_contrib; cation_contrib_max_i = i; @@ -1278,7 +1277,7 @@ void HMWSoln::calcMolalitiesCropped() const double total_charge = cation_charge - anion_charge; if (total_charge > 1.0E-8) { double desiredCrop = total_charge/charge(cation_contrib_max_i); - double maxCrop = 0.66 * m_molalitiesCropped[cation_contrib_max_i]; + double maxCrop = 0.66 * m_molalitiesCropped[cation_contrib_max_i]; if (desiredCrop < maxCrop) { m_molalitiesCropped[cation_contrib_max_i] -= desiredCrop; break; @@ -1287,7 +1286,7 @@ void HMWSoln::calcMolalitiesCropped() const } } else if (total_charge < -1.0E-8) { double desiredCrop = total_charge/charge(anion_contrib_max_i); - double maxCrop = 0.66 * m_molalitiesCropped[anion_contrib_max_i]; + double maxCrop = 0.66 * m_molalitiesCropped[anion_contrib_max_i]; if (desiredCrop < maxCrop) { m_molalitiesCropped[anion_contrib_max_i] -= desiredCrop; break; @@ -1310,10 +1309,10 @@ void HMWSoln::calcMolalitiesCropped() const m_molalitiesAreCropped = true; double poly = MC_apCut_ + MC_bpCut_ * xmolSolvent + MC_dpCut_* xmolSolvent * xmolSolvent; - double p = xmolSolvent + MC_epCut_ + exp(- xmolSolvent/ MC_cpCut_) * poly; + double p = xmolSolvent + MC_epCut_ + exp(- xmolSolvent/ MC_cpCut_) * poly; double denomInv = 1.0/ (m_Mnaught * p); for (size_t k = 0; k < m_kk; k++) { - m_molalitiesCropped[k] = molF[k] * denomInv ; + m_molalitiesCropped[k] = molF[k] * denomInv; } // Do a further check to see if the Ionic strength is below a max value @@ -1398,21 +1397,21 @@ void HMWSoln::s_updatePitzer_CoeffWRTemp(int doDerivs) const + beta0MX_coeff[1]*tlin; m_Beta0MX_ij_L[counterIJ] = beta0MX_coeff[1]; m_Beta0MX_ij_LL[counterIJ] = 0.0; - m_Beta1MX_ij[counterIJ] = beta1MX_coeff[0] + m_Beta1MX_ij[counterIJ] = beta1MX_coeff[0] + beta1MX_coeff[1]*tlin; m_Beta1MX_ij_L[counterIJ] = beta1MX_coeff[1]; m_Beta1MX_ij_LL[counterIJ] = 0.0; - m_Beta2MX_ij[counterIJ] = beta2MX_coeff[0] + m_Beta2MX_ij[counterIJ] = beta2MX_coeff[0] + beta2MX_coeff[1]*tlin; - m_Beta2MX_ij_L[counterIJ] = beta2MX_coeff[1]; + m_Beta2MX_ij_L[counterIJ] = beta2MX_coeff[1]; m_Beta2MX_ij_LL[counterIJ] = 0.0; - m_CphiMX_ij[counterIJ] = CphiMX_coeff[0] + m_CphiMX_ij[counterIJ] = CphiMX_coeff[0] + CphiMX_coeff[1]*tlin; - m_CphiMX_ij_L[counterIJ] = CphiMX_coeff[1]; - m_CphiMX_ij_LL[counterIJ] = 0.0; - m_Theta_ij[counterIJ] = Theta_coeff[0] + Theta_coeff[1]*tlin; - m_Theta_ij_L[counterIJ] = Theta_coeff[1]; - m_Theta_ij_LL[counterIJ] = 0.0; + m_CphiMX_ij_L[counterIJ] = CphiMX_coeff[1]; + m_CphiMX_ij_LL[counterIJ] = 0.0; + m_Theta_ij[counterIJ] = Theta_coeff[0] + Theta_coeff[1]*tlin; + m_Theta_ij_L[counterIJ] = Theta_coeff[1]; + m_Theta_ij_LL[counterIJ] = 0.0; break; case PITZER_TEMP_COMPLEX1: @@ -1441,23 +1440,23 @@ void HMWSoln::s_updatePitzer_CoeffWRTemp(int doDerivs) const + Theta_coeff[2]*tquad + Theta_coeff[3]*tinv + Theta_coeff[4]*tln; - m_Beta0MX_ij_L[counterIJ] = beta0MX_coeff[1] + m_Beta0MX_ij_L[counterIJ] = beta0MX_coeff[1] + beta0MX_coeff[2]*twoT - beta0MX_coeff[3]*invT2 + beta0MX_coeff[4]*invT; - m_Beta1MX_ij_L[counterIJ] = beta1MX_coeff[1] + m_Beta1MX_ij_L[counterIJ] = beta1MX_coeff[1] + beta1MX_coeff[2]*twoT - beta1MX_coeff[3]*invT2 + beta1MX_coeff[4]*invT; - m_Beta2MX_ij_L[counterIJ] = beta2MX_coeff[1] + m_Beta2MX_ij_L[counterIJ] = beta2MX_coeff[1] + beta2MX_coeff[2]*twoT - beta2MX_coeff[3]*invT2 + beta2MX_coeff[4]*invT; - m_CphiMX_ij_L[counterIJ] = CphiMX_coeff[1] + m_CphiMX_ij_L[counterIJ] = CphiMX_coeff[1] + CphiMX_coeff[2]*twoT - CphiMX_coeff[3]*invT2 + CphiMX_coeff[4]*invT; - m_Theta_ij_L[counterIJ] = Theta_coeff[1] + m_Theta_ij_L[counterIJ] = Theta_coeff[1] + Theta_coeff[2]*twoT - Theta_coeff[3]*invT2 + Theta_coeff[4]*invT; @@ -1502,9 +1501,9 @@ void HMWSoln::s_updatePitzer_CoeffWRTemp(int doDerivs) const m_Lambda_nj(i,j) = Lambda_coeff[0]; break; case PITZER_TEMP_LINEAR: - m_Lambda_nj(i,j) = Lambda_coeff[0] + Lambda_coeff[1]*tlin; - m_Lambda_nj_L(i,j) = Lambda_coeff[1]; - m_Lambda_nj_LL(i,j) = 0.0; + m_Lambda_nj(i,j) = Lambda_coeff[0] + Lambda_coeff[1]*tlin; + m_Lambda_nj_L(i,j) = Lambda_coeff[1]; + m_Lambda_nj_LL(i,j) = 0.0; break; case PITZER_TEMP_COMPLEX1: m_Lambda_nj(i,j) = Lambda_coeff[0] @@ -1531,9 +1530,9 @@ void HMWSoln::s_updatePitzer_CoeffWRTemp(int doDerivs) const m_Mu_nnn[i] = Mu_coeff[0]; break; case PITZER_TEMP_LINEAR: - m_Mu_nnn[i] = Mu_coeff[0] + Mu_coeff[1]*tlin; - m_Mu_nnn_L[i] = Mu_coeff[1]; - m_Mu_nnn_LL[i] = 0.0; + m_Mu_nnn[i] = Mu_coeff[0] + Mu_coeff[1]*tlin; + m_Mu_nnn_L[i] = Mu_coeff[1]; + m_Mu_nnn_LL[i] = 0.0; break; case PITZER_TEMP_COMPLEX1: m_Mu_nnn[i] = Mu_coeff[0] @@ -1560,7 +1559,7 @@ void HMWSoln::s_updatePitzer_CoeffWRTemp(int doDerivs) const for (size_t i = 1; i < m_kk; i++) { for (size_t j = 1; j < m_kk; j++) { for (size_t k = 1; k < m_kk; k++) { - size_t n = i * m_kk *m_kk + j * m_kk + k ; + size_t n = i * m_kk *m_kk + j * m_kk + k; const double* Psi_coeff = m_Psi_ijk_coeff.ptrColumn(n); m_Psi_ijk[n] = Psi_coeff[0]; } @@ -1571,11 +1570,11 @@ void HMWSoln::s_updatePitzer_CoeffWRTemp(int doDerivs) const for (size_t i = 1; i < m_kk; i++) { for (size_t j = 1; j < m_kk; j++) { for (size_t k = 1; k < m_kk; k++) { - size_t n = i * m_kk *m_kk + j * m_kk + k ; + size_t n = i * m_kk *m_kk + j * m_kk + k; const double* Psi_coeff = m_Psi_ijk_coeff.ptrColumn(n); - m_Psi_ijk[n] = Psi_coeff[0] + Psi_coeff[1]*tlin; - m_Psi_ijk_L[n] = Psi_coeff[1]; - m_Psi_ijk_LL[n] = 0.0; + m_Psi_ijk[n] = Psi_coeff[0] + Psi_coeff[1]*tlin; + m_Psi_ijk_L[n] = Psi_coeff[1]; + m_Psi_ijk_LL[n] = 0.0; } } } @@ -1584,7 +1583,7 @@ void HMWSoln::s_updatePitzer_CoeffWRTemp(int doDerivs) const for (size_t i = 1; i < m_kk; i++) { for (size_t j = 1; j < m_kk; j++) { for (size_t k = 1; k < m_kk; k++) { - size_t n = i * m_kk *m_kk + j * m_kk + k ; + size_t n = i * m_kk *m_kk + j * m_kk + k; const double* Psi_coeff = m_Psi_ijk_coeff.ptrColumn(n); m_Psi_ijk[n] = Psi_coeff[0] + Psi_coeff[1]*tlin @@ -1626,14 +1625,14 @@ void HMWSoln::s_updatePitzer_lnMolalityActCoeff() const * These are data inputs about the Pitzer correlation. They come * from the input file for the Pitzer model. */ - const double* beta0MX = DATA_PTR(m_Beta0MX_ij); - const double* beta1MX = DATA_PTR(m_Beta1MX_ij); - const double* beta2MX = DATA_PTR(m_Beta2MX_ij); - const double* CphiMX = DATA_PTR(m_CphiMX_ij); - const double* thetaij = DATA_PTR(m_Theta_ij); - const double* alpha1MX = DATA_PTR(m_Alpha1MX_ij); - const double* alpha2MX = DATA_PTR(m_Alpha2MX_ij); - const double* psi_ijk = DATA_PTR(m_Psi_ijk); + const double* beta0MX = DATA_PTR(m_Beta0MX_ij); + const double* beta1MX = DATA_PTR(m_Beta1MX_ij); + const double* beta2MX = DATA_PTR(m_Beta2MX_ij); + const double* CphiMX = DATA_PTR(m_CphiMX_ij); + const double* thetaij = DATA_PTR(m_Theta_ij); + const double* alpha1MX = DATA_PTR(m_Alpha1MX_ij); + const double* alpha2MX = DATA_PTR(m_Alpha2MX_ij); + const double* psi_ijk = DATA_PTR(m_Psi_ijk); double* gamma_Unscaled = DATA_PTR(m_gamma_tmp); /* * Local variables defined by Coltrin @@ -1654,17 +1653,17 @@ void HMWSoln::s_updatePitzer_lnMolalityActCoeff() const */ double molalitysumUncropped = 0.0; - double* gfunc = DATA_PTR(m_gfunc_IJ); - double* g2func = DATA_PTR(m_g2func_IJ); - double* hfunc = DATA_PTR(m_hfunc_IJ); - double* h2func = DATA_PTR(m_h2func_IJ); - double* BMX = DATA_PTR(m_BMX_IJ); - double* BprimeMX = DATA_PTR(m_BprimeMX_IJ); - double* BphiMX = DATA_PTR(m_BphiMX_IJ); - double* Phi = DATA_PTR(m_Phi_IJ); - double* Phiprime = DATA_PTR(m_Phiprime_IJ); - double* Phiphi = DATA_PTR(m_PhiPhi_IJ); - double* CMX = DATA_PTR(m_CMX_IJ); + double* gfunc = DATA_PTR(m_gfunc_IJ); + double* g2func = DATA_PTR(m_g2func_IJ); + double* hfunc = DATA_PTR(m_hfunc_IJ); + double* h2func = DATA_PTR(m_h2func_IJ); + double* BMX = DATA_PTR(m_BMX_IJ); + double* BprimeMX = DATA_PTR(m_BprimeMX_IJ); + double* BphiMX = DATA_PTR(m_BphiMX_IJ); + double* Phi = DATA_PTR(m_Phi_IJ); + double* Phiprime = DATA_PTR(m_Phiprime_IJ); + double* Phiphi = DATA_PTR(m_PhiPhi_IJ); + double* CMX = DATA_PTR(m_CMX_IJ); if (DEBUG_MODE_ENABLED && m_debugCalc) { printf("\n Debugging information from hmw_act \n"); @@ -1681,7 +1680,7 @@ void HMWSoln::s_updatePitzer_lnMolalityActCoeff() const // ionic strength Is += charge(n) * charge(n) * molality[n]; // total molar charge - molarcharge += fabs(charge(n)) * molality[n]; + molarcharge += fabs(charge(n)) * molality[n]; molalitysumUncropped += m_molalities[n]; } Is *= 0.5; @@ -1750,7 +1749,7 @@ void HMWSoln::s_updatePitzer_lnMolalityActCoeff() const */ double x1 = sqrtIs * alpha1MX[counterIJ]; if (x1 > 1.0E-100) { - gfunc[counterIJ] = 2.0*(1.0-(1.0 + x1) * exp(-x1)) / (x1 * x1); + gfunc[counterIJ] = 2.0*(1.0-(1.0 + x1) * exp(-x1)) / (x1 * x1); hfunc[counterIJ] = -2.0 * (1.0-(1.0 + x1 + 0.5 * x1 * x1) * exp(-x1)) / (x1 * x1); } else { @@ -1761,7 +1760,7 @@ void HMWSoln::s_updatePitzer_lnMolalityActCoeff() const if (beta2MX[counterIJ] != 0.0) { double x2 = sqrtIs * alpha2MX[counterIJ]; if (x2 > 1.0E-100) { - g2func[counterIJ] = 2.0*(1.0-(1.0 + x2) * exp(-x2)) / (x2 * x2); + g2func[counterIJ] = 2.0*(1.0-(1.0 + x2) * exp(-x2)) / (x2 * x2); h2func[counterIJ] = -2.0 * (1.0-(1.0 + x2 + 0.5 * x2 * x2) * exp(-x2)) / (x2 * x2); } else { @@ -1805,13 +1804,13 @@ void HMWSoln::s_updatePitzer_lnMolalityActCoeff() const * and the other is negative */ if (charge(i)*charge(j) < 0.0) { - BMX[counterIJ] = beta0MX[counterIJ] + BMX[counterIJ] = beta0MX[counterIJ] + beta1MX[counterIJ] * gfunc[counterIJ] + beta2MX[counterIJ] * g2func[counterIJ]; if (DEBUG_MODE_ENABLED && m_debugCalc) { printf("%d %g: %g %g %g %g\n", - (int) counterIJ, BMX[counterIJ], beta0MX[counterIJ], + (int) counterIJ, BMX[counterIJ], beta0MX[counterIJ], beta1MX[counterIJ], beta2MX[counterIJ], gfunc[counterIJ]); } if (Is > 1.0E-150) { @@ -1820,11 +1819,11 @@ void HMWSoln::s_updatePitzer_lnMolalityActCoeff() const } else { BprimeMX[counterIJ] = 0.0; } - BphiMX[counterIJ] = BMX[counterIJ] + Is*BprimeMX[counterIJ]; + BphiMX[counterIJ] = BMX[counterIJ] + Is*BprimeMX[counterIJ]; } else { - BMX[counterIJ] = 0.0; + BMX[counterIJ] = 0.0; BprimeMX[counterIJ] = 0.0; - BphiMX[counterIJ] = 0.0; + BphiMX[counterIJ] = 0.0; } if (DEBUG_MODE_ENABLED && m_debugCalc) { std::string sni = speciesName(i); @@ -1897,9 +1896,9 @@ void HMWSoln::s_updatePitzer_lnMolalityActCoeff() const Phiprime[counterIJ] = etheta_prime[z1][z2]; Phiphi[counterIJ] = Phi[counterIJ] + Is * Phiprime[counterIJ]; } else { - Phi[counterIJ] = 0.0; + Phi[counterIJ] = 0.0; Phiprime[counterIJ] = 0.0; - Phiphi[counterIJ] = 0.0; + Phiphi[counterIJ] = 0.0; } if (DEBUG_MODE_ENABLED && m_debugCalc) { std::string sni = speciesName(i); @@ -2504,16 +2503,16 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dT() const "Wrong index solvent value!"); } - const double* molality = DATA_PTR(m_molalitiesCropped); - const double* beta0MX_L = DATA_PTR(m_Beta0MX_ij_L); - const double* beta1MX_L = DATA_PTR(m_Beta1MX_ij_L); - const double* beta2MX_L = DATA_PTR(m_Beta2MX_ij_L); - const double* CphiMX_L = DATA_PTR(m_CphiMX_ij_L); - const double* thetaij_L = DATA_PTR(m_Theta_ij_L); - const double* alpha1MX = DATA_PTR(m_Alpha1MX_ij); - const double* alpha2MX = DATA_PTR(m_Alpha2MX_ij); - const double* psi_ijk_L = DATA_PTR(m_Psi_ijk_L); - double* d_gamma_dT_Unscaled = DATA_PTR(m_gamma_tmp); + const double* molality = DATA_PTR(m_molalitiesCropped); + const double* beta0MX_L = DATA_PTR(m_Beta0MX_ij_L); + const double* beta1MX_L = DATA_PTR(m_Beta1MX_ij_L); + const double* beta2MX_L = DATA_PTR(m_Beta2MX_ij_L); + const double* CphiMX_L = DATA_PTR(m_CphiMX_ij_L); + const double* thetaij_L = DATA_PTR(m_Theta_ij_L); + const double* alpha1MX = DATA_PTR(m_Alpha1MX_ij); + const double* alpha2MX = DATA_PTR(m_Alpha2MX_ij); + const double* psi_ijk_L = DATA_PTR(m_Psi_ijk_L); + double* d_gamma_dT_Unscaled = DATA_PTR(m_gamma_tmp); /* * Local variables defined by Coltrin */ @@ -2533,17 +2532,17 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dT() const */ double molalitysum = 0.0; - double* gfunc = DATA_PTR(m_gfunc_IJ); - double* g2func = DATA_PTR(m_g2func_IJ); - double* hfunc = DATA_PTR(m_hfunc_IJ); - double* h2func = DATA_PTR(m_h2func_IJ); - double* BMX_L = DATA_PTR(m_BMX_IJ_L); + double* gfunc = DATA_PTR(m_gfunc_IJ); + double* g2func = DATA_PTR(m_g2func_IJ); + double* hfunc = DATA_PTR(m_hfunc_IJ); + double* h2func = DATA_PTR(m_h2func_IJ); + double* BMX_L = DATA_PTR(m_BMX_IJ_L); double* BprimeMX_L= DATA_PTR(m_BprimeMX_IJ_L); - double* BphiMX_L = DATA_PTR(m_BphiMX_IJ_L); - double* Phi_L = DATA_PTR(m_Phi_IJ_L); - double* Phiprime = DATA_PTR(m_Phiprime_IJ); - double* Phiphi_L = DATA_PTR(m_PhiPhi_IJ_L); - double* CMX_L = DATA_PTR(m_CMX_IJ_L); + double* BphiMX_L = DATA_PTR(m_BphiMX_IJ_L); + double* Phi_L = DATA_PTR(m_Phi_IJ_L); + double* Phiprime = DATA_PTR(m_Phiprime_IJ); + double* Phiphi_L = DATA_PTR(m_PhiPhi_IJ_L); + double* CMX_L = DATA_PTR(m_CMX_IJ_L); if (DEBUG_MODE_ENABLED && m_debugCalc) { printf("\n Debugging information from " @@ -2561,7 +2560,7 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dT() const // ionic strength Is += charge(n) * charge(n) * molality[n]; // total molar charge - molarcharge += fabs(charge(n)) * molality[n]; + molarcharge += fabs(charge(n)) * molality[n]; molalitysum += molality[n]; } Is *= 0.5; @@ -2629,7 +2628,7 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dT() const */ double x1 = sqrtIs * alpha1MX[counterIJ]; if (x1 > 1.0E-100) { - gfunc[counterIJ] = 2.0*(1.0-(1.0 + x1) * exp(-x1)) / (x1 * x1); + gfunc[counterIJ] = 2.0*(1.0-(1.0 + x1) * exp(-x1)) / (x1 * x1); hfunc[counterIJ] = -2.0 * (1.0-(1.0 + x1 + 0.5 * x1 *x1) * exp(-x1)) / (x1 * x1); } else { @@ -2640,7 +2639,7 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dT() const if (beta2MX_L[counterIJ] != 0.0) { double x2 = sqrtIs * alpha2MX[counterIJ]; if (x2 > 1.0E-100) { - g2func[counterIJ] = 2.0*(1.0-(1.0 + x2) * exp(-x2)) / (x2 * x2); + g2func[counterIJ] = 2.0*(1.0-(1.0 + x2) * exp(-x2)) / (x2 * x2); h2func[counterIJ] = -2.0 * (1.0-(1.0 + x2 + 0.5 * x2 * x2) * exp(-x2)) / (x2 * x2); } else { @@ -2684,13 +2683,13 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dT() const * and the other is negative */ if (charge(i)*charge(j) < 0.0) { - BMX_L[counterIJ] = beta0MX_L[counterIJ] + BMX_L[counterIJ] = beta0MX_L[counterIJ] + beta1MX_L[counterIJ] * gfunc[counterIJ] + beta2MX_L[counterIJ] * gfunc[counterIJ]; if (DEBUG_MODE_ENABLED && m_debugCalc) { printf("%d %g: %g %g %g %g\n", - (int) counterIJ, BMX_L[counterIJ], beta0MX_L[counterIJ], - beta1MX_L[counterIJ], beta2MX_L[counterIJ], gfunc[counterIJ]); + (int) counterIJ, BMX_L[counterIJ], beta0MX_L[counterIJ], + beta1MX_L[counterIJ], beta2MX_L[counterIJ], gfunc[counterIJ]); } if (Is > 1.0E-150) { BprimeMX_L[counterIJ] = (beta1MX_L[counterIJ] * hfunc[counterIJ]/Is + @@ -2700,9 +2699,9 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dT() const } BphiMX_L[counterIJ] = BMX_L[counterIJ] + Is*BprimeMX_L[counterIJ]; } else { - BMX_L[counterIJ] = 0.0; + BMX_L[counterIJ] = 0.0; BprimeMX_L[counterIJ] = 0.0; - BphiMX_L[counterIJ] = 0.0; + BphiMX_L[counterIJ] = 0.0; } if (DEBUG_MODE_ENABLED && m_debugCalc) { std::string sni = speciesName(i); @@ -2772,9 +2771,9 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dT() const Phiprime[counterIJ] = 0.0; Phiphi_L[counterIJ] = Phi_L[counterIJ] + Is * Phiprime[counterIJ]; } else { - Phi_L[counterIJ] = 0.0; + Phi_L[counterIJ] = 0.0; Phiprime[counterIJ] = 0.0; - Phiphi_L[counterIJ] = 0.0; + Phiphi_L[counterIJ] = 0.0; } if (DEBUG_MODE_ENABLED && m_debugCalc) { std::string sni = speciesName(i); @@ -3261,15 +3260,15 @@ void HMWSoln::s_updatePitzer_d2lnMolalityActCoeff_dT2() const "Wrong index solvent value!"); } - const double* molality = DATA_PTR(m_molalitiesCropped); - const double* beta0MX_LL= DATA_PTR(m_Beta0MX_ij_LL); - const double* beta1MX_LL= DATA_PTR(m_Beta1MX_ij_LL); - const double* beta2MX_LL= DATA_PTR(m_Beta2MX_ij_LL); - const double* CphiMX_LL = DATA_PTR(m_CphiMX_ij_LL); - const double* thetaij_LL= DATA_PTR(m_Theta_ij_LL); - const double* alpha1MX = DATA_PTR(m_Alpha1MX_ij); - const double* alpha2MX = DATA_PTR(m_Alpha2MX_ij); - const double* psi_ijk_LL= DATA_PTR(m_Psi_ijk_LL); + const double* molality = DATA_PTR(m_molalitiesCropped); + const double* beta0MX_LL = DATA_PTR(m_Beta0MX_ij_LL); + const double* beta1MX_LL = DATA_PTR(m_Beta1MX_ij_LL); + const double* beta2MX_LL = DATA_PTR(m_Beta2MX_ij_LL); + const double* CphiMX_LL = DATA_PTR(m_CphiMX_ij_LL); + const double* thetaij_LL = DATA_PTR(m_Theta_ij_LL); + const double* alpha1MX = DATA_PTR(m_Alpha1MX_ij); + const double* alpha2MX = DATA_PTR(m_Alpha2MX_ij); + const double* psi_ijk_LL = DATA_PTR(m_Psi_ijk_LL); /* * Local variables defined by Coltrin @@ -3290,17 +3289,17 @@ void HMWSoln::s_updatePitzer_d2lnMolalityActCoeff_dT2() const */ double molalitysum = 0.0; - double* gfunc = DATA_PTR(m_gfunc_IJ); - double* g2func = DATA_PTR(m_g2func_IJ); - double* hfunc = DATA_PTR(m_hfunc_IJ); - double* h2func = DATA_PTR(m_h2func_IJ); - double* BMX_LL = DATA_PTR(m_BMX_IJ_LL); - double* BprimeMX_LL=DATA_PTR(m_BprimeMX_IJ_LL); - double* BphiMX_LL= DATA_PTR(m_BphiMX_IJ_LL); - double* Phi_LL = DATA_PTR(m_Phi_IJ_LL); - double* Phiprime = DATA_PTR(m_Phiprime_IJ); - double* Phiphi_LL= DATA_PTR(m_PhiPhi_IJ_LL); - double* CMX_LL = DATA_PTR(m_CMX_IJ_LL); + double* gfunc = DATA_PTR(m_gfunc_IJ); + double* g2func = DATA_PTR(m_g2func_IJ); + double* hfunc = DATA_PTR(m_hfunc_IJ); + double* h2func = DATA_PTR(m_h2func_IJ); + double* BMX_LL = DATA_PTR(m_BMX_IJ_LL); + double* BprimeMX_LL = DATA_PTR(m_BprimeMX_IJ_LL); + double* BphiMX_LL = DATA_PTR(m_BphiMX_IJ_LL); + double* Phi_LL = DATA_PTR(m_Phi_IJ_LL); + double* Phiprime = DATA_PTR(m_Phiprime_IJ); + double* Phiphi_LL = DATA_PTR(m_PhiPhi_IJ_LL); + double* CMX_LL = DATA_PTR(m_CMX_IJ_LL); if (DEBUG_MODE_ENABLED && m_debugCalc) { printf("\n Debugging information from " @@ -3318,7 +3317,7 @@ void HMWSoln::s_updatePitzer_d2lnMolalityActCoeff_dT2() const // ionic strength Is += charge(n) * charge(n) * molality[n]; // total molar charge - molarcharge += fabs(charge(n)) * molality[n]; + molarcharge += fabs(charge(n)) * molality[n]; molalitysum += molality[n]; } Is *= 0.5; @@ -3386,7 +3385,7 @@ void HMWSoln::s_updatePitzer_d2lnMolalityActCoeff_dT2() const */ double x1 = sqrtIs * alpha1MX[counterIJ]; if (x1 > 1.0E-100) { - gfunc[counterIJ] = 2.0*(1.0-(1.0 + x1) * exp(-x1)) / (x1 *x1); + gfunc[counterIJ] = 2.0*(1.0-(1.0 + x1) * exp(-x1)) / (x1 *x1); hfunc[counterIJ] = -2.0* (1.0-(1.0 + x1 + 0.5*x1 * x1) * exp(-x1)) / (x1 * x1); } else { @@ -3397,7 +3396,7 @@ void HMWSoln::s_updatePitzer_d2lnMolalityActCoeff_dT2() const if (beta2MX_LL[counterIJ] != 0.0) { double x2 = sqrtIs * alpha2MX[counterIJ]; if (x2 > 1.0E-100) { - g2func[counterIJ] = 2.0*(1.0-(1.0 + x2) * exp(-x2)) / (x2 * x2); + g2func[counterIJ] = 2.0*(1.0-(1.0 + x2) * exp(-x2)) / (x2 * x2); h2func[counterIJ] = -2.0 * (1.0-(1.0 + x2 + 0.5 * x2 * x2) * exp(-x2)) / (x2 * x2); } else { @@ -3440,12 +3439,12 @@ void HMWSoln::s_updatePitzer_d2lnMolalityActCoeff_dT2() const * and the other is negative */ if (charge(i)*charge(j) < 0.0) { - BMX_LL[counterIJ] = beta0MX_LL[counterIJ] + BMX_LL[counterIJ] = beta0MX_LL[counterIJ] + beta1MX_LL[counterIJ] * gfunc[counterIJ] + beta2MX_LL[counterIJ] * g2func[counterIJ]; if (DEBUG_MODE_ENABLED && m_debugCalc) { printf("%d %g: %g %g %g %g\n", - (int) counterIJ, BMX_LL[counterIJ], beta0MX_LL[counterIJ], + (int) counterIJ, BMX_LL[counterIJ], beta0MX_LL[counterIJ], beta1MX_LL[counterIJ], beta2MX_LL[counterIJ], gfunc[counterIJ]); } if (Is > 1.0E-150) { @@ -3456,9 +3455,9 @@ void HMWSoln::s_updatePitzer_d2lnMolalityActCoeff_dT2() const } BphiMX_LL[counterIJ] = BMX_LL[counterIJ] + Is*BprimeMX_LL[counterIJ]; } else { - BMX_LL[counterIJ] = 0.0; + BMX_LL[counterIJ] = 0.0; BprimeMX_LL[counterIJ] = 0.0; - BphiMX_LL[counterIJ] = 0.0; + BphiMX_LL[counterIJ] = 0.0; } if (DEBUG_MODE_ENABLED && m_debugCalc) { std::string sni = speciesName(i); @@ -3527,9 +3526,9 @@ void HMWSoln::s_updatePitzer_d2lnMolalityActCoeff_dT2() const Phiprime[counterIJ] = 0.0; Phiphi_LL[counterIJ] = Phi_LL[counterIJ]; } else { - Phi_LL[counterIJ] = 0.0; + Phi_LL[counterIJ] = 0.0; Phiprime[counterIJ] = 0.0; - Phiphi_LL[counterIJ] = 0.0; + Phiphi_LL[counterIJ] = 0.0; } if (DEBUG_MODE_ENABLED && m_debugCalc) { std::string sni = speciesName(i); @@ -4010,15 +4009,15 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dP() const "Wrong index solvent value!"); } - const double* molality = DATA_PTR(m_molalitiesCropped); - const double* beta0MX_P = DATA_PTR(m_Beta0MX_ij_P); - const double* beta1MX_P = DATA_PTR(m_Beta1MX_ij_P); - const double* beta2MX_P = DATA_PTR(m_Beta2MX_ij_P); - const double* CphiMX_P = DATA_PTR(m_CphiMX_ij_P); - const double* thetaij_P = DATA_PTR(m_Theta_ij_P); - const double* alpha1MX = DATA_PTR(m_Alpha1MX_ij); - const double* alpha2MX = DATA_PTR(m_Alpha2MX_ij); - const double* psi_ijk_P = DATA_PTR(m_Psi_ijk_P); + const double* molality = DATA_PTR(m_molalitiesCropped); + const double* beta0MX_P = DATA_PTR(m_Beta0MX_ij_P); + const double* beta1MX_P = DATA_PTR(m_Beta1MX_ij_P); + const double* beta2MX_P = DATA_PTR(m_Beta2MX_ij_P); + const double* CphiMX_P = DATA_PTR(m_CphiMX_ij_P); + const double* thetaij_P = DATA_PTR(m_Theta_ij_P); + const double* alpha1MX = DATA_PTR(m_Alpha1MX_ij); + const double* alpha2MX = DATA_PTR(m_Alpha2MX_ij); + const double* psi_ijk_P = DATA_PTR(m_Psi_ijk_P); /* * Local variables defined by Coltrin @@ -4039,17 +4038,17 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dP() const */ double molalitysum = 0.0; - double* gfunc = DATA_PTR(m_gfunc_IJ); - double* g2func = DATA_PTR(m_g2func_IJ); - double* hfunc = DATA_PTR(m_hfunc_IJ); - double* h2func = DATA_PTR(m_h2func_IJ); - double* BMX_P = DATA_PTR(m_BMX_IJ_P); - double* BprimeMX_P= DATA_PTR(m_BprimeMX_IJ_P); - double* BphiMX_P = DATA_PTR(m_BphiMX_IJ_P); - double* Phi_P = DATA_PTR(m_Phi_IJ_P); - double* Phiprime = DATA_PTR(m_Phiprime_IJ); - double* Phiphi_P = DATA_PTR(m_PhiPhi_IJ_P); - double* CMX_P = DATA_PTR(m_CMX_IJ_P); + double* gfunc = DATA_PTR(m_gfunc_IJ); + double* g2func = DATA_PTR(m_g2func_IJ); + double* hfunc = DATA_PTR(m_hfunc_IJ); + double* h2func = DATA_PTR(m_h2func_IJ); + double* BMX_P = DATA_PTR(m_BMX_IJ_P); + double* BprimeMX_P = DATA_PTR(m_BprimeMX_IJ_P); + double* BphiMX_P = DATA_PTR(m_BphiMX_IJ_P); + double* Phi_P = DATA_PTR(m_Phi_IJ_P); + double* Phiprime = DATA_PTR(m_Phiprime_IJ); + double* Phiphi_P = DATA_PTR(m_PhiPhi_IJ_P); + double* CMX_P = DATA_PTR(m_CMX_IJ_P); double currTemp = temperature(); double currPres = pressure(); @@ -4070,7 +4069,7 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dP() const // ionic strength Is += charge(n) * charge(n) * molality[n]; // total molar charge - molarcharge += fabs(charge(n)) * molality[n]; + molarcharge += fabs(charge(n)) * molality[n]; molalitysum += molality[n]; } Is *= 0.5; @@ -4139,7 +4138,7 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dP() const */ double x1 = sqrtIs * alpha1MX[counterIJ]; if (x1 > 1.0E-100) { - gfunc[counterIJ] = 2.0*(1.0-(1.0 + x1) * exp(-x1)) / (x1 * x1); + gfunc[counterIJ] = 2.0*(1.0-(1.0 + x1) * exp(-x1)) / (x1 * x1); hfunc[counterIJ] = -2.0* (1.0-(1.0 + x1 + 0.5 * x1 * x1) * exp(-x1)) / (x1 * x1); } else { @@ -4150,7 +4149,7 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dP() const if (beta2MX_P[counterIJ] != 0.0) { double x2 = sqrtIs * alpha2MX[counterIJ]; if (x2 > 1.0E-100) { - g2func[counterIJ] = 2.0*(1.0-(1.0 + x2) * exp(-x2)) / (x2 * x2); + g2func[counterIJ] = 2.0*(1.0-(1.0 + x2) * exp(-x2)) / (x2 * x2); h2func[counterIJ] = -2.0 * (1.0-(1.0 + x2 + 0.5 * x2 * x2) * exp(-x2)) / (x2 * x2); } else { @@ -4194,12 +4193,12 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dP() const * and the other is negative */ if (charge(i)*charge(j) < 0.0) { - BMX_P[counterIJ] = beta0MX_P[counterIJ] + BMX_P[counterIJ] = beta0MX_P[counterIJ] + beta1MX_P[counterIJ] * gfunc[counterIJ] + beta2MX_P[counterIJ] * g2func[counterIJ]; if (DEBUG_MODE_ENABLED && m_debugCalc) { printf("%d %g: %g %g %g %g\n", - (int) counterIJ, BMX_P[counterIJ], beta0MX_P[counterIJ], + (int) counterIJ, BMX_P[counterIJ], beta0MX_P[counterIJ], beta1MX_P[counterIJ], beta2MX_P[counterIJ], gfunc[counterIJ]); } if (Is > 1.0E-150) { @@ -4210,9 +4209,9 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dP() const } BphiMX_P[counterIJ] = BMX_P[counterIJ] + Is*BprimeMX_P[counterIJ]; } else { - BMX_P[counterIJ] = 0.0; + BMX_P[counterIJ] = 0.0; BprimeMX_P[counterIJ] = 0.0; - BphiMX_P[counterIJ] = 0.0; + BphiMX_P[counterIJ] = 0.0; } if (DEBUG_MODE_ENABLED && m_debugCalc) { std::string sni = speciesName(i); @@ -4281,9 +4280,9 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dP() const Phiprime[counterIJ] = 0.0; Phiphi_P[counterIJ] = Phi_P[counterIJ] + Is * Phiprime[counterIJ]; } else { - Phi_P[counterIJ] = 0.0; + Phi_P[counterIJ] = 0.0; Phiprime[counterIJ] = 0.0; - Phiphi_P[counterIJ] = 0.0; + Phiphi_P[counterIJ] = 0.0; } if (DEBUG_MODE_ENABLED && m_debugCalc) { std::string sni = speciesName(i); @@ -4490,7 +4489,7 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dP() const */ n = m_kk*j + k; size_t counterIJ2 = m_CounterIJ[n]; - sum4 += fabs(charge(i))* + sum4 += fabs(charge(i))* molality[j]*molality[k]*CMX_P[counterIJ2]; } } @@ -4536,7 +4535,7 @@ void HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dP() const double sum1 = 0.0; double sum3 = 0.0; for (size_t j = 1; j < m_kk; j++) { - sum1 += molality[j]*2.0*m_Lambda_nj_P(i,j); + sum1 += molality[j]*2.0*m_Lambda_nj_P(i,j); /* * Zeta term -> we piggyback on the psi term */ @@ -4741,7 +4740,7 @@ void HMWSoln::calc_lambdas(double is) const * aphi is the Debye-Huckel constant at 25 C */ double c1 = 4.581, c2 = 0.7237, c3 = 0.0120, c4 = 0.528; - double aphi = 0.392; /* Value at 25 C */ + double aphi = 0.392; /* Value at 25 C */ if (DEBUG_MODE_ENABLED && m_debugCalc) { printf(" Is = %g\n", is); } @@ -4766,15 +4765,15 @@ void HMWSoln::calc_lambdas(double is) const /* * calculate Xmn (A1) from Harvie, Weare (1980). */ - double x = 6.0* zprod * aphi * sqrt(is); /* eqn 23 */ + double x = 6.0* zprod * aphi * sqrt(is); /* eqn 23 */ - double jfunc = x / (4.0 + c1*pow(x,-c2)*exp(-c3*pow(x,c4))); /* eqn 47 */ + double jfunc = x / (4.0 + c1*pow(x,-c2)*exp(-c3*pow(x,c4))); /* eqn 47 */ double t = c3 * c4 * pow(x,c4); double dj = c1* pow(x,(-c2-1.0)) * (c2+t) * exp(-c3*pow(x,c4)); double jprime = (jfunc/x)*(1.0 + jfunc*dj); - elambda[ij] = zprod*jfunc / (4.0*is); /* eqn 14 */ + elambda[ij] = zprod*jfunc / (4.0*is); /* eqn 14 */ elambda1[ij] = (3.0*zprod*zprod*aphi*jprime/(4.0*sqrt(is)) - elambda[ij])/is; if (DEBUG_MODE_ENABLED && m_debugCalc) { @@ -4811,14 +4810,14 @@ void HMWSoln::calc_thetas(int z1, int z2, /* * Actually calculate the interaction. */ - double f1 = (double)i / (2.0 * j); - double f2 = (double)j / (2.0 * i); + double f1 = (double)i / (2.0 * j); + double f2 = (double)j / (2.0 * i); *etheta = elambda[i*j] - f1*elambda[j*j] - f2*elambda[i*i]; *etheta_prime = elambda1[i*j] - f1*elambda1[j*j] - f2*elambda1[i*i]; } } -void HMWSoln::s_updateIMS_lnMolalityActCoeff() const +void HMWSoln::s_updateIMS_lnMolalityActCoeff() const { /* * Calculate the molalities. Currently, the molalities @@ -4852,24 +4851,24 @@ void HMWSoln::s_updateIMS_lnMolalityActCoeff() const /* * If we are in the middle region, calculate the connecting polynomials */ - double xminus = xmolSolvent - IMS_X_o_cutoff_/2.0; + double xminus = xmolSolvent - IMS_X_o_cutoff_/2.0; double xminus2 = xminus * xminus; double xminus3 = xminus2 * xminus; double x_o_cut2 = IMS_X_o_cutoff_ * IMS_X_o_cutoff_; - double x_o_cut3 = x_o_cut2 * IMS_X_o_cutoff_; + double x_o_cut3 = x_o_cut2 * IMS_X_o_cutoff_; - double h2 = 3.5 * xminus2 / IMS_X_o_cutoff_ - 2.0 * xminus3 / x_o_cut2; - double h2_prime = 7.0 * xminus / IMS_X_o_cutoff_ - 6.0 * xminus2 / x_o_cut2; + double h2 = 3.5 * xminus2 / IMS_X_o_cutoff_ - 2.0 * xminus3 / x_o_cut2; + double h2_prime = 7.0 * xminus / IMS_X_o_cutoff_ - 6.0 * xminus2 / x_o_cut2; - double h1 = (1.0 - 3.0 * xminus2 / x_o_cut2 + 2.0 * xminus3/ x_o_cut3); - double h1_prime = (- 6.0 * xminus / x_o_cut2 + 6.0 * xminus2/ x_o_cut3); + double h1 = (1.0 - 3.0 * xminus2 / x_o_cut2 + 2.0 * xminus3/ x_o_cut3); + double h1_prime = (- 6.0 * xminus / x_o_cut2 + 6.0 * xminus2/ x_o_cut3); double h1_g = h1 / IMS_gamma_o_min_; - double h1_g_prime = h1_prime / IMS_gamma_o_min_; + double h1_g_prime = h1_prime / IMS_gamma_o_min_; double alpha = 1.0 / (exp(1.0) * IMS_gamma_k_min_); double h1_f = h1 * alpha; - double h1_f_prime = h1_prime * alpha; + double h1_f_prime = h1_prime * alpha; double f = h2 + h1_f; double f_prime = h2_prime + h1_f_prime; @@ -4899,13 +4898,13 @@ void HMWSoln::s_updateIMS_lnMolalityActCoeff() const double xoverc = xmolSolvent/IMS_cCut_; double eterm = std::exp(-xoverc); - double fptmp = IMS_bfCut_ - IMS_afCut_ / IMS_cCut_ - IMS_bfCut_*xoverc + double fptmp = IMS_bfCut_ - IMS_afCut_ / IMS_cCut_ - IMS_bfCut_*xoverc + 2.0*IMS_dfCut_*xmolSolvent - IMS_dfCut_*xmolSolvent*xoverc; double f_prime = 1.0 + eterm*fptmp; double f = xmolSolvent + IMS_efCut_ + eterm * (IMS_afCut_ + xmolSolvent * (IMS_bfCut_ + IMS_dfCut_*xmolSolvent)); - double gptmp = IMS_bgCut_ - IMS_agCut_ / IMS_cCut_ - IMS_bgCut_*xoverc + double gptmp = IMS_bgCut_ - IMS_agCut_ / IMS_cCut_ - IMS_bgCut_*xoverc + 2.0*IMS_dgCut_*xmolSolvent - IMS_dgCut_*xmolSolvent*xoverc; double g_prime = 1.0 + eterm*gptmp; double g = xmolSolvent + IMS_egCut_ @@ -4950,7 +4949,7 @@ void HMWSoln::printCoeffs() const std::string sni = speciesName(i); for (size_t j = i+1; j < m_kk; j++) { std::string snj = speciesName(j); - size_t n = i * m_kk + j; + size_t n = i * m_kk + j; size_t ct = m_CounterIJ[n]; printf(" %-16s %-16s %9.5f %9.5f %9.5f %9.5f %9.5f %9.5f \n", sni.c_str(), snj.c_str(), @@ -5058,7 +5057,7 @@ doublereal HMWSoln::s_NBS_CLM_lnMolalityActCoeff() const doublereal sqrtIs = sqrt(m_IionicMolality); doublereal A = A_Debye_TP(); doublereal lnGammaClMs2 = - A * sqrtIs /(1.0 + 1.5 * sqrtIs); - return lnGammaClMs2; + return lnGammaClMs2; } doublereal HMWSoln::s_NBS_CLM_dlnMolalityActCoeff_dT() const diff --git a/src/thermo/HMWSoln_input.cpp b/src/thermo/HMWSoln_input.cpp index fe2bc638c..df8a4ffff 100644 --- a/src/thermo/HMWSoln_input.cpp +++ b/src/thermo/HMWSoln_input.cpp @@ -111,7 +111,7 @@ void HMWSoln::readXMLBinarySalt(XML_Node& BinSalt) } m_Beta0MX_ij[counter] = vParams[0]; m_Beta0MX_ij_coeff(0,counter) = m_Beta0MX_ij[counter]; - } else if (m_formPitzerTemp == PITZER_TEMP_LINEAR) { + } else if (m_formPitzerTemp == PITZER_TEMP_LINEAR) { if (nParamsFound != 2) { throw CanteraError("HMWSoln::readXMLBinarySalt::beta0 for " + ispName + "::" + jspName, @@ -120,7 +120,7 @@ void HMWSoln::readXMLBinarySalt(XML_Node& BinSalt) m_Beta0MX_ij_coeff(0,counter) = vParams[0]; m_Beta0MX_ij_coeff(1,counter) = vParams[1]; m_Beta0MX_ij[counter] = vParams[0]; - } else if (m_formPitzerTemp == PITZER_TEMP_COMPLEX1) { + } else if (m_formPitzerTemp == PITZER_TEMP_COMPLEX1) { if (nParamsFound != 5) { throw CanteraError("HMWSoln::readXMLBinarySalt::beta0 for " + ispName + "::" + jspName, @@ -146,7 +146,7 @@ void HMWSoln::readXMLBinarySalt(XML_Node& BinSalt) } m_Beta1MX_ij[counter] = vParams[0]; m_Beta1MX_ij_coeff(0,counter) = m_Beta1MX_ij[counter]; - } else if (m_formPitzerTemp == PITZER_TEMP_LINEAR) { + } else if (m_formPitzerTemp == PITZER_TEMP_LINEAR) { if (nParamsFound != 2) { throw CanteraError("HMWSoln::readXMLBinarySalt::beta1 for " + ispName + "::" + jspName, @@ -155,7 +155,7 @@ void HMWSoln::readXMLBinarySalt(XML_Node& BinSalt) m_Beta1MX_ij_coeff(0,counter) = vParams[0]; m_Beta1MX_ij_coeff(1,counter) = vParams[1]; m_Beta1MX_ij[counter] = vParams[0]; - } else if (m_formPitzerTemp == PITZER_TEMP_COMPLEX1) { + } else if (m_formPitzerTemp == PITZER_TEMP_COMPLEX1) { if (nParamsFound != 5) { throw CanteraError("HMWSoln::readXMLBinarySalt::beta1 for " + ispName + "::" + jspName, @@ -178,7 +178,7 @@ void HMWSoln::readXMLBinarySalt(XML_Node& BinSalt) } m_Beta2MX_ij[counter] = vParams[0]; m_Beta2MX_ij_coeff(0,counter) = m_Beta2MX_ij[counter]; - } else if (m_formPitzerTemp == PITZER_TEMP_LINEAR) { + } else if (m_formPitzerTemp == PITZER_TEMP_LINEAR) { if (nParamsFound != 2) { throw CanteraError("HMWSoln::readXMLBinarySalt::beta2 for " + ispName + "::" + jspName, @@ -187,7 +187,7 @@ void HMWSoln::readXMLBinarySalt(XML_Node& BinSalt) m_Beta2MX_ij_coeff(0,counter) = vParams[0]; m_Beta2MX_ij_coeff(1,counter) = vParams[1]; m_Beta2MX_ij[counter] = vParams[0]; - } else if (m_formPitzerTemp == PITZER_TEMP_COMPLEX1) { + } else if (m_formPitzerTemp == PITZER_TEMP_COMPLEX1) { if (nParamsFound != 5) { throw CanteraError("HMWSoln::readXMLBinarySalt::beta2 for " + ispName + "::" + jspName, @@ -213,7 +213,7 @@ void HMWSoln::readXMLBinarySalt(XML_Node& BinSalt) } m_CphiMX_ij[counter] = vParams[0]; m_CphiMX_ij_coeff(0,counter) = m_CphiMX_ij[counter]; - } else if (m_formPitzerTemp == PITZER_TEMP_LINEAR) { + } else if (m_formPitzerTemp == PITZER_TEMP_LINEAR) { if (nParamsFound != 2) { throw CanteraError("HMWSoln::readXMLBinarySalt::Cphi for " + ispName + "::" + jspName, @@ -222,7 +222,7 @@ void HMWSoln::readXMLBinarySalt(XML_Node& BinSalt) m_CphiMX_ij_coeff(0,counter) = vParams[0]; m_CphiMX_ij_coeff(1,counter) = vParams[1]; m_CphiMX_ij[counter] = vParams[0]; - } else if (m_formPitzerTemp == PITZER_TEMP_COMPLEX1) { + } else if (m_formPitzerTemp == PITZER_TEMP_COMPLEX1) { if (nParamsFound != 5) { throw CanteraError("HMWSoln::readXMLBinarySalt::Cphi for " + ispName + "::" + jspName, @@ -300,7 +300,7 @@ void HMWSoln::readXMLThetaAnion(XML_Node& BinSalt) } m_Theta_ij_coeff(0,counter) = vParams[0]; m_Theta_ij[counter] = vParams[0]; - } else if (m_formPitzerTemp == PITZER_TEMP_LINEAR) { + } else if (m_formPitzerTemp == PITZER_TEMP_LINEAR) { if (nParamsFound != 2) { throw CanteraError("HMWSoln::readXMLThetaAnion::Theta for " + ispName + "::" + jspName, @@ -309,7 +309,7 @@ void HMWSoln::readXMLThetaAnion(XML_Node& BinSalt) m_Theta_ij_coeff(0,counter) = vParams[0]; m_Theta_ij_coeff(1,counter) = vParams[1]; m_Theta_ij[counter] = vParams[0]; - } else if (m_formPitzerTemp == PITZER_TEMP_COMPLEX1) { + } else if (m_formPitzerTemp == PITZER_TEMP_COMPLEX1) { if (nParamsFound == 1) { vParams.resize(5, 0.0); nParamsFound = 5; @@ -379,7 +379,7 @@ void HMWSoln::readXMLThetaCation(XML_Node& BinSalt) } m_Theta_ij_coeff(0,counter) = vParams[0]; m_Theta_ij[counter] = vParams[0]; - } else if (m_formPitzerTemp == PITZER_TEMP_LINEAR) { + } else if (m_formPitzerTemp == PITZER_TEMP_LINEAR) { if (nParamsFound != 2) { throw CanteraError("HMWSoln::readXMLThetaCation::Theta for " + ispName + "::" + jspName, @@ -388,7 +388,7 @@ void HMWSoln::readXMLThetaCation(XML_Node& BinSalt) m_Theta_ij_coeff(0,counter) = vParams[0]; m_Theta_ij_coeff(1,counter) = vParams[1]; m_Theta_ij[counter] = vParams[0]; - } else if (m_formPitzerTemp == PITZER_TEMP_COMPLEX1) { + } else if (m_formPitzerTemp == PITZER_TEMP_COMPLEX1) { if (nParamsFound == 1) { vParams.resize(5, 0.0); nParamsFound = 5; @@ -473,7 +473,7 @@ void HMWSoln::readXMLPsiCommonCation(XML_Node& BinSalt) if (nodeName == "psi") { getFloatArray(xmlChild, vParams, false, "", stemp); size_t nParamsFound = vParams.size(); - n = iSpecies * m_kk *m_kk + jSpecies * m_kk + kSpecies ; + n = iSpecies * m_kk *m_kk + jSpecies * m_kk + kSpecies; if (m_formPitzerTemp == PITZER_TEMP_CONSTANT) { if (nParamsFound != 1) { @@ -483,7 +483,7 @@ void HMWSoln::readXMLPsiCommonCation(XML_Node& BinSalt) } m_Psi_ijk_coeff(0,n) = vParams[0]; m_Psi_ijk[n] = vParams[0]; - } else if (m_formPitzerTemp == PITZER_TEMP_LINEAR) { + } else if (m_formPitzerTemp == PITZER_TEMP_LINEAR) { if (nParamsFound != 2) { throw CanteraError("HMWSoln::readXMLPsiCation::Psi for " + kName + "::" + iName + "::" + jName, @@ -491,8 +491,8 @@ void HMWSoln::readXMLPsiCommonCation(XML_Node& BinSalt) } m_Psi_ijk_coeff(0,n) = vParams[0]; m_Psi_ijk_coeff(1,n) = vParams[1]; - m_Psi_ijk[n] = vParams[0]; - } else if (m_formPitzerTemp == PITZER_TEMP_COMPLEX1) { + m_Psi_ijk[n] = vParams[0]; + } else if (m_formPitzerTemp == PITZER_TEMP_COMPLEX1) { if (nParamsFound == 1) { vParams.resize(5, 0.0); nParamsFound = 5; @@ -508,31 +508,31 @@ void HMWSoln::readXMLPsiCommonCation(XML_Node& BinSalt) } // fill in the duplicate entries - n = iSpecies * m_kk *m_kk + kSpecies * m_kk + jSpecies ; + n = iSpecies * m_kk *m_kk + kSpecies * m_kk + jSpecies; for (size_t j = 0; j < nParamsFound; j++) { m_Psi_ijk_coeff(j, n) = vParams[j]; } m_Psi_ijk[n] = vParams[0]; - n = jSpecies * m_kk *m_kk + iSpecies * m_kk + kSpecies ; + n = jSpecies * m_kk *m_kk + iSpecies * m_kk + kSpecies; for (size_t j = 0; j < nParamsFound; j++) { m_Psi_ijk_coeff(j, n) = vParams[j]; } m_Psi_ijk[n] = vParams[0]; - n = jSpecies * m_kk *m_kk + kSpecies * m_kk + iSpecies ; + n = jSpecies * m_kk *m_kk + kSpecies * m_kk + iSpecies; for (size_t j = 0; j < nParamsFound; j++) { m_Psi_ijk_coeff(j, n) = vParams[j]; } m_Psi_ijk[n] = vParams[0]; - n = kSpecies * m_kk *m_kk + jSpecies * m_kk + iSpecies ; + n = kSpecies * m_kk *m_kk + jSpecies * m_kk + iSpecies; for (size_t j = 0; j < nParamsFound; j++) { m_Psi_ijk_coeff(j, n) = vParams[j]; } m_Psi_ijk[n] = vParams[0]; - n = kSpecies * m_kk *m_kk + iSpecies * m_kk + jSpecies ; + n = kSpecies * m_kk *m_kk + iSpecies * m_kk + jSpecies; for (size_t j = 0; j < nParamsFound; j++) { m_Psi_ijk_coeff(j, n) = vParams[j]; } @@ -607,7 +607,7 @@ void HMWSoln::readXMLPsiCommonAnion(XML_Node& BinSalt) if (nodeName == "psi") { getFloatArray(xmlChild, vParams, false, "", stemp); size_t nParamsFound = vParams.size(); - n = iSpecies * m_kk *m_kk + jSpecies * m_kk + kSpecies ; + n = iSpecies * m_kk *m_kk + jSpecies * m_kk + kSpecies; if (m_formPitzerTemp == PITZER_TEMP_CONSTANT) { if (nParamsFound != 1) { @@ -617,7 +617,7 @@ void HMWSoln::readXMLPsiCommonAnion(XML_Node& BinSalt) } m_Psi_ijk_coeff(0,n) = vParams[0]; m_Psi_ijk[n] = vParams[0]; - } else if (m_formPitzerTemp == PITZER_TEMP_LINEAR) { + } else if (m_formPitzerTemp == PITZER_TEMP_LINEAR) { if (nParamsFound != 2) { throw CanteraError("HMWSoln::readXMLPsiAnion::Psi for " + kName + "::" + iName + "::" + jName, @@ -625,8 +625,8 @@ void HMWSoln::readXMLPsiCommonAnion(XML_Node& BinSalt) } m_Psi_ijk_coeff(0,n) = vParams[0]; m_Psi_ijk_coeff(1,n) = vParams[1]; - m_Psi_ijk[n] = vParams[0]; - } else if (m_formPitzerTemp == PITZER_TEMP_COMPLEX1) { + m_Psi_ijk[n] = vParams[0]; + } else if (m_formPitzerTemp == PITZER_TEMP_COMPLEX1) { if (nParamsFound == 1) { vParams.resize(5, 0.0); nParamsFound = 5; @@ -642,31 +642,31 @@ void HMWSoln::readXMLPsiCommonAnion(XML_Node& BinSalt) } // fill in the duplicate entries - n = iSpecies * m_kk *m_kk + kSpecies * m_kk + jSpecies ; + n = iSpecies * m_kk *m_kk + kSpecies * m_kk + jSpecies; for (size_t j = 0; j < nParamsFound; j++) { m_Psi_ijk_coeff(j, n) = vParams[j]; } m_Psi_ijk[n] = vParams[0]; - n = jSpecies * m_kk *m_kk + iSpecies * m_kk + kSpecies ; + n = jSpecies * m_kk *m_kk + iSpecies * m_kk + kSpecies; for (size_t j = 0; j < nParamsFound; j++) { m_Psi_ijk_coeff(j, n) = vParams[j]; } m_Psi_ijk[n] = vParams[0]; - n = jSpecies * m_kk *m_kk + kSpecies * m_kk + iSpecies ; + n = jSpecies * m_kk *m_kk + kSpecies * m_kk + iSpecies; for (size_t j = 0; j < nParamsFound; j++) { m_Psi_ijk_coeff(j, n) = vParams[j]; } m_Psi_ijk[n] = vParams[0]; - n = kSpecies * m_kk *m_kk + jSpecies * m_kk + iSpecies ; + n = kSpecies * m_kk *m_kk + jSpecies * m_kk + iSpecies; for (size_t j = 0; j < nParamsFound; j++) { m_Psi_ijk_coeff(j, n) = vParams[j]; } m_Psi_ijk[n] = vParams[0]; - n = kSpecies * m_kk *m_kk + iSpecies * m_kk + jSpecies ; + n = kSpecies * m_kk *m_kk + iSpecies * m_kk + jSpecies; for (size_t j = 0; j < nParamsFound; j++) { m_Psi_ijk_coeff(j, n) = vParams[j]; } @@ -725,7 +725,7 @@ void HMWSoln::readXMLLambdaNeutral(XML_Node& BinSalt) } m_Lambda_nj_coeff(0,nCount) = vParams[0]; m_Lambda_nj(iSpecies,jSpecies) = vParams[0]; - } else if (m_formPitzerTemp == PITZER_TEMP_LINEAR) { + } else if (m_formPitzerTemp == PITZER_TEMP_LINEAR) { if (nParamsFound != 2) { throw CanteraError("HMWSoln::readXMLLambdaNeutral::Lambda for " + iName + "::" + jName, @@ -734,7 +734,7 @@ void HMWSoln::readXMLLambdaNeutral(XML_Node& BinSalt) m_Lambda_nj_coeff(0,nCount) = vParams[0]; m_Lambda_nj_coeff(1,nCount) = vParams[1]; m_Lambda_nj(iSpecies, jSpecies) = vParams[0]; - } else if (m_formPitzerTemp == PITZER_TEMP_COMPLEX1) { + } else if (m_formPitzerTemp == PITZER_TEMP_COMPLEX1) { if (nParamsFound == 1) { vParams.resize(5, 0.0); nParamsFound = 5; @@ -793,7 +793,7 @@ void HMWSoln::readXMLMunnnNeutral(XML_Node& BinSalt) } m_Mu_nnn_coeff(0,iSpecies) = vParams[0]; m_Mu_nnn[iSpecies] = vParams[0]; - } else if (m_formPitzerTemp == PITZER_TEMP_LINEAR) { + } else if (m_formPitzerTemp == PITZER_TEMP_LINEAR) { if (nParamsFound != 2) { throw CanteraError("HMWSoln::readXMLMunnnNeutral::Munnn for " + iName, "wrong number of params found"); @@ -801,7 +801,7 @@ void HMWSoln::readXMLMunnnNeutral(XML_Node& BinSalt) m_Mu_nnn_coeff(0, iSpecies) = vParams[0]; m_Mu_nnn_coeff(1, iSpecies) = vParams[1]; m_Mu_nnn[iSpecies] = vParams[0]; - } else if (m_formPitzerTemp == PITZER_TEMP_COMPLEX1) { + } else if (m_formPitzerTemp == PITZER_TEMP_COMPLEX1) { if (nParamsFound == 1) { vParams.resize(5, 0.0); nParamsFound = 5; @@ -850,7 +850,7 @@ void HMWSoln::readXMLZetaCation(const XML_Node& BinSalt) return; } if (charge(iSpecies) != 0.0) { - throw CanteraError("HMWSoln::readXMLZetaCation", "neutral charge problem"); + throw CanteraError("HMWSoln::readXMLZetaCation", "neutral charge problem"); } size_t jSpecies = speciesIndex(jName); @@ -876,7 +876,7 @@ void HMWSoln::readXMLZetaCation(const XML_Node& BinSalt) if (nodeName == "zeta") { getFloatArray(xmlChild, vParams, false, "", "zeta"); size_t nParamsFound = vParams.size(); - size_t n = iSpecies * m_kk *m_kk + jSpecies * m_kk + kSpecies ; + size_t n = iSpecies * m_kk *m_kk + jSpecies * m_kk + kSpecies; if (m_formPitzerTemp == PITZER_TEMP_CONSTANT) { if (nParamsFound != 1) { @@ -886,7 +886,7 @@ void HMWSoln::readXMLZetaCation(const XML_Node& BinSalt) } m_Psi_ijk_coeff(0,n) = vParams[0]; m_Psi_ijk[n] = vParams[0]; - } else if (m_formPitzerTemp == PITZER_TEMP_LINEAR) { + } else if (m_formPitzerTemp == PITZER_TEMP_LINEAR) { if (nParamsFound != 2) { throw CanteraError("HMWSoln::readXMLZetaCation::Zeta for " + iName + "::" + jName + "::" + kName, @@ -894,8 +894,8 @@ void HMWSoln::readXMLZetaCation(const XML_Node& BinSalt) } m_Psi_ijk_coeff(0,n) = vParams[0]; m_Psi_ijk_coeff(1,n) = vParams[1]; - m_Psi_ijk[n] = vParams[0]; - } else if (m_formPitzerTemp == PITZER_TEMP_COMPLEX1) { + m_Psi_ijk[n] = vParams[0]; + } else if (m_formPitzerTemp == PITZER_TEMP_COMPLEX1) { if (nParamsFound == 1) { vParams.resize(5, 0.0); nParamsFound = 5; @@ -1254,7 +1254,7 @@ void HMWSoln::initThermoXML(XML_Node& phaseNode, const std::string& id_) const vector&sss = speciesNames(); for (size_t k = 0; k < m_kk; k++) { - XML_Node* s = speciesDB->findByAttr("name", sss[k]); + XML_Node* s = speciesDB->findByAttr("name", sss[k]); if (!s) { throw CanteraError("HMWSoln::initThermoXML", "Species Data Base " + sss[k] + " not found"); @@ -1263,7 +1263,7 @@ void HMWSoln::initThermoXML(XML_Node& phaseNode, const std::string& id_) if (!ss) { throw CanteraError("HMWSoln::initThermoXML", "Species " + sss[k] + - " standardState XML block not found"); + " standardState XML block not found"); } string modelStringa = ss->attrib("model"); if (modelStringa == "") { @@ -1279,7 +1279,7 @@ void HMWSoln::initThermoXML(XML_Node& phaseNode, const std::string& id_) * Store a local pointer to the water standard state model. * -> We've hardcoded it to a PDSS_Water model, so this is ok. */ - m_waterSS = dynamic_cast(providePDSS(0)) ; + m_waterSS = dynamic_cast(providePDSS(0)); if (!m_waterSS) { throw CanteraError("HMWSoln::initThermoXML", "Dynamic cast to PDSS_Water failed"); @@ -1403,7 +1403,7 @@ void HMWSoln::initThermoXML(XML_Node& phaseNode, const std::string& id_) } if (jmap != npos) { const XML_Node& sp = *xspecies[jmap]; - getOptionalFloat(sp, "stoichIsMods", m_speciesCharge_Stoich[k]); + getOptionalFloat(sp, "stoichIsMods", m_speciesCharge_Stoich[k]); } } @@ -1550,13 +1550,13 @@ void HMWSoln::initThermoXML(XML_Node& phaseNode, const std::string& id_) if (kHp != npos) { if (mf[kHp] > sum * 1.1) { mf[kHp] -= sum; - mf[0] += sum; + mf[0] += sum; notDone = false; } else { if (sum > 0.0) { mf[kHp] *= 0.5; - mf[0] += mf[kHp]; - sum -= mf[kHp]; + mf[0] += mf[kHp]; + sum -= mf[kHp]; } } } @@ -1564,13 +1564,13 @@ void HMWSoln::initThermoXML(XML_Node& phaseNode, const std::string& id_) if (kOHm != npos) { if (mf[kOHm] > -sum * 1.1) { mf[kOHm] += sum; - mf[0] -= sum; + mf[0] -= sum; notDone = false; } else { if (sum < 0.0) { mf[kOHm] *= 0.5; - mf[0] += mf[kOHm]; - sum += mf[kOHm]; + mf[0] += mf[kOHm]; + sum += mf[kOHm]; } } } @@ -1592,15 +1592,15 @@ void HMWSoln::initThermoXML(XML_Node& phaseNode, const std::string& id_) } } -void HMWSoln::calcIMSCutoffParams_() +void HMWSoln::calcIMSCutoffParams_() { - IMS_afCut_ = 1.0 / (std::exp(1.0) * IMS_gamma_k_min_); + IMS_afCut_ = 1.0 / (std::exp(1.0) * IMS_gamma_k_min_); IMS_efCut_ = 0.0; bool converged = false; double oldV = 0.0; for (int its = 0; its < 100 && !converged; its++) { oldV = IMS_efCut_; - IMS_afCut_ = 1.0 / (std::exp(1.0) * IMS_gamma_k_min_) -IMS_efCut_; + IMS_afCut_ = 1.0 / (std::exp(1.0) * IMS_gamma_k_min_) -IMS_efCut_; IMS_bfCut_ = IMS_afCut_ / IMS_cCut_ + IMS_slopefCut_ - 1.0; IMS_dfCut_ = ((- IMS_afCut_/IMS_cCut_ + IMS_bfCut_ - IMS_bfCut_*IMS_X_o_cutoff_/IMS_cCut_) / @@ -1622,7 +1622,7 @@ void HMWSoln::calcIMSCutoffParams_() IMS_egCut_ = 0.0; for (int its = 0; its < 100 && !converged; its++) { oldV = IMS_egCut_; - double lng_0 = -log(IMS_gamma_o_min_) - f_prime_0 / f_0; + double lng_0 = -log(IMS_gamma_o_min_) - f_prime_0 / f_0; IMS_agCut_ = exp(lng_0) - IMS_egCut_; IMS_bgCut_ = IMS_agCut_ / IMS_cCut_ + IMS_slopegCut_ - 1.0; IMS_dgCut_ = ((- IMS_agCut_/IMS_cCut_ + IMS_bgCut_ - IMS_bgCut_*IMS_X_o_cutoff_/IMS_cCut_) @@ -1641,7 +1641,7 @@ void HMWSoln::calcIMSCutoffParams_() } } -void HMWSoln::calcMCCutoffParams_() +void HMWSoln::calcMCCutoffParams_() { MC_X_o_min_ = 0.35; MC_X_o_cutoff_ = 0.6; diff --git a/src/thermo/IdealMolalSoln.cpp b/src/thermo/IdealMolalSoln.cpp index 943d8cc86..ce66b1f9e 100644 --- a/src/thermo/IdealMolalSoln.cpp +++ b/src/thermo/IdealMolalSoln.cpp @@ -59,26 +59,26 @@ 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_pp = b.m_pp; - m_tmpV = b.m_tmpV; - IMS_lnActCoeffMolal_ = b.IMS_lnActCoeffMolal_; + 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_pp = b.m_pp; + m_tmpV = b.m_tmpV; + IMS_lnActCoeffMolal_ = b.IMS_lnActCoeffMolal_; } return *this; } @@ -528,7 +528,7 @@ void IdealMolalSoln::initThermoXML(XML_Node& phaseNode, const std::string& id_) IMS_typeCutoff_ = 1; } else { throw CanteraError("IdealMolalSoln::initThermoXML", - "Unknown idealMolalSolnCutoff form: " + modelString); + "Unknown idealMolalSolnCutoff form: " + modelString); } if (ccNode.hasChild("gamma_o_limit")) { @@ -584,7 +584,7 @@ void IdealMolalSoln::initThermoXML(XML_Node& phaseNode, const std::string& id_) const std::vector &sss = speciesNames(); for (size_t k = 0; k < m_kk; k++) { - XML_Node* s = speciesDB->findByAttr("name", sss[k]); + XML_Node* s = speciesDB->findByAttr("name", sss[k]); XML_Node* ss = s->findByName("standardState"); m_speciesMolarVolume[k] = getFloat(*ss, "molarVolume", "toSI"); } @@ -609,7 +609,7 @@ void IdealMolalSoln::initThermoXML(XML_Node& phaseNode, const std::string& id_) * ------------ Private and Restricted Functions ------------------ */ -void IdealMolalSoln::s_updateIMS_lnMolalityActCoeff() const +void IdealMolalSoln::s_updateIMS_lnMolalityActCoeff() const { /* * Calculate the molalities. Currently, the molalities @@ -645,24 +645,24 @@ void IdealMolalSoln::s_updateIMS_lnMolalityActCoeff() const /* * If we are in the middle region, calculate the connecting polynomials */ - double xminus = xmolSolvent - IMS_X_o_cutoff_/2.0; + double xminus = xmolSolvent - IMS_X_o_cutoff_/2.0; double xminus2 = xminus * xminus; double xminus3 = xminus2 * xminus; double x_o_cut2 = IMS_X_o_cutoff_ * IMS_X_o_cutoff_; - double x_o_cut3 = x_o_cut2 * IMS_X_o_cutoff_; + double x_o_cut3 = x_o_cut2 * IMS_X_o_cutoff_; - double h2 = 3.5 * xminus2 / IMS_X_o_cutoff_ - 2.0 * xminus3 / x_o_cut2; - double h2_prime = 7.0 * xminus / IMS_X_o_cutoff_ - 6.0 * xminus2 / x_o_cut2; + double h2 = 3.5 * xminus2 / IMS_X_o_cutoff_ - 2.0 * xminus3 / x_o_cut2; + double h2_prime = 7.0 * xminus / IMS_X_o_cutoff_ - 6.0 * xminus2 / x_o_cut2; - double h1 = (1.0 - 3.0 * xminus2 / x_o_cut2 + 2.0 * xminus3/ x_o_cut3); - double h1_prime = (- 6.0 * xminus / x_o_cut2 + 6.0 * xminus2/ x_o_cut3); + double h1 = (1.0 - 3.0 * xminus2 / x_o_cut2 + 2.0 * xminus3/ x_o_cut3); + double h1_prime = (- 6.0 * xminus / x_o_cut2 + 6.0 * xminus2/ x_o_cut3); double h1_g = h1 / IMS_gamma_o_min_; - double h1_g_prime = h1_prime / IMS_gamma_o_min_; + double h1_g_prime = h1_prime / IMS_gamma_o_min_; double alpha = 1.0 / (exp(1.0) * IMS_gamma_k_min_); double h1_f = h1 * alpha; - double h1_f_prime = h1_prime * alpha; + double h1_f_prime = h1_prime * alpha; double f = h2 + h1_f; double f_prime = h2_prime + h1_f_prime; @@ -692,12 +692,12 @@ void IdealMolalSoln::s_updateIMS_lnMolalityActCoeff() const double xoverc = xmolSolvent/IMS_cCut_; double eterm = std::exp(-xoverc); - double fptmp = IMS_bfCut_ - IMS_afCut_ / IMS_cCut_ - IMS_bfCut_*xoverc + double fptmp = IMS_bfCut_ - IMS_afCut_ / IMS_cCut_ - IMS_bfCut_*xoverc + 2.0*IMS_dfCut_*xmolSolvent - IMS_dfCut_*xmolSolvent*xoverc; double f_prime = 1.0 + eterm*fptmp; double f = xmolSolvent + IMS_efCut_ + eterm * (IMS_afCut_ + xmolSolvent * (IMS_bfCut_ + IMS_dfCut_*xmolSolvent)); - double gptmp = IMS_bgCut_ - IMS_agCut_ / IMS_cCut_ - IMS_bgCut_*xoverc + double gptmp = IMS_bgCut_ - IMS_agCut_ / IMS_cCut_ - IMS_bgCut_*xoverc + 2.0*IMS_dgCut_*xmolSolvent - IMS_dgCut_*xmolSolvent*xoverc; double g_prime = 1.0 + eterm*gptmp; double g = xmolSolvent + IMS_egCut_ + eterm * (IMS_agCut_ + xmolSolvent * (IMS_bgCut_ + IMS_dgCut_*xmolSolvent)); @@ -727,14 +727,14 @@ void IdealMolalSoln::initLengths() IMS_lnActCoeffMolal_.resize(m_kk); } -void IdealMolalSoln::calcIMSCutoffParams_() +void IdealMolalSoln::calcIMSCutoffParams_() { - IMS_afCut_ = 1.0 / (std::exp(1.0) * IMS_gamma_k_min_); + IMS_afCut_ = 1.0 / (std::exp(1.0) * IMS_gamma_k_min_); IMS_efCut_ = 0.0; bool converged = false; for (int its = 0; its < 100 && !converged; its++) { double oldV = IMS_efCut_; - IMS_afCut_ = 1.0 / (std::exp(1.0) * IMS_gamma_k_min_) - IMS_efCut_; + IMS_afCut_ = 1.0 / (std::exp(1.0) * IMS_gamma_k_min_) - IMS_efCut_; IMS_bfCut_ = IMS_afCut_ / IMS_cCut_ + IMS_slopefCut_ - 1.0; IMS_dfCut_ = ((- IMS_afCut_/IMS_cCut_ + IMS_bfCut_ - IMS_bfCut_*IMS_X_o_cutoff_/IMS_cCut_) / @@ -756,7 +756,7 @@ void IdealMolalSoln::calcIMSCutoffParams_() IMS_egCut_ = 0.0; for (int its = 0; its < 100 && !converged; its++) { double oldV = IMS_egCut_; - double lng_0 = -log(IMS_gamma_o_min_) - f_prime_0 / f_0; + double lng_0 = -log(IMS_gamma_o_min_) - f_prime_0 / f_0; IMS_agCut_ = exp(lng_0) - IMS_egCut_; IMS_bgCut_ = IMS_agCut_ / IMS_cCut_ + IMS_slopegCut_ - 1.0; IMS_dgCut_ = ((- IMS_agCut_/IMS_cCut_ + IMS_bgCut_ - IMS_bgCut_*IMS_X_o_cutoff_/IMS_cCut_) diff --git a/src/thermo/IdealSolidSolnPhase.cpp b/src/thermo/IdealSolidSolnPhase.cpp index 7093c32b4..bce4887b1 100644 --- a/src/thermo/IdealSolidSolnPhase.cpp +++ b/src/thermo/IdealSolidSolnPhase.cpp @@ -68,17 +68,17 @@ 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_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; + 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; } @@ -273,7 +273,7 @@ doublereal IdealSolidSolnPhase::logStandardConc(size_t k) const res = log(1.0/m_speciesMolarVolume[k]); break; case 2: - res = log(1.0/m_speciesMolarVolume[m_kk-1]); + res = log(1.0/m_speciesMolarVolume[m_kk-1]); break; default: throw CanteraError("eosType", "Unknown type"); @@ -538,7 +538,7 @@ void IdealSolidSolnPhase::initThermoXML(XML_Node& phaseNode, const std::string& &phaseNode.root()); for (size_t k = 0; k < m_kk; k++) { - XML_Node* s = speciesDB->findByAttr("name", speciesName(k)); + XML_Node* s = speciesDB->findByAttr("name", speciesName(k)); XML_Node* ss = s->findByName("standardState"); m_speciesMolarVolume[k] = getFloat(*ss, "molarVolume", "toSI"); } @@ -590,7 +590,7 @@ void IdealSolidSolnPhase::setToEquilState(const doublereal* lambda_RT) double IdealSolidSolnPhase::speciesMolarVolume(int k) const { - return m_speciesMolarVolume[k]; + return m_speciesMolarVolume[k]; } void IdealSolidSolnPhase::getSpeciesMolarVolumes(doublereal* smv) const @@ -618,4 +618,4 @@ void IdealSolidSolnPhase::_updateThermo() const } } -} // end namespace Cantera +} // end namespace Cantera diff --git a/src/thermo/IdealSolnGasVPSS.cpp b/src/thermo/IdealSolnGasVPSS.cpp index 5eb1088dc..dbe7ae29f 100644 --- a/src/thermo/IdealSolnGasVPSS.cpp +++ b/src/thermo/IdealSolnGasVPSS.cpp @@ -64,7 +64,7 @@ IdealSolnGasVPSS& IdealSolnGasVPSS::operator=(const IdealSolnGasVPSS& b) * However, we have to handle data that we own. */ m_idealGas = b.m_idealGas; - m_formGC = b.m_formGC; + m_formGC = b.m_formGC; } return *this; } @@ -101,7 +101,7 @@ doublereal IdealSolnGasVPSS::entropy_mole() const doublereal IdealSolnGasVPSS::cp_mole() const { updateStandardStateThermo(); - return GasConstant * mean_X(m_VPSS_ptr->cp_R()); + return GasConstant * mean_X(m_VPSS_ptr->cp_R()); } doublereal IdealSolnGasVPSS::cv_mole() const diff --git a/src/thermo/IonsFromNeutralVPSSTP.cpp b/src/thermo/IonsFromNeutralVPSSTP.cpp index 44451d911..ae1970b92 100644 --- a/src/thermo/IonsFromNeutralVPSSTP.cpp +++ b/src/thermo/IonsFromNeutralVPSSTP.cpp @@ -105,33 +105,33 @@ IonsFromNeutralVPSSTP::operator=(const IonsFromNeutralVPSSTP& b) if (IOwnNThermoPhase_) { if (b.neutralMoleculePhase_) { delete neutralMoleculePhase_; - neutralMoleculePhase_ = (b.neutralMoleculePhase_)->duplMyselfAsThermoPhase(); + neutralMoleculePhase_ = (b.neutralMoleculePhase_)->duplMyselfAsThermoPhase(); } else { - neutralMoleculePhase_ = 0; + neutralMoleculePhase_ = 0; } } else { - neutralMoleculePhase_ = b.neutralMoleculePhase_; + 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_; + 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_; - IOwnNThermoPhase_ = b.IOwnNThermoPhase_; - moleFractionsTmp_ = b.moleFractionsTmp_; - muNeutralMolecule_ = b.muNeutralMolecule_; + dX_NeutralMolecule_ = b.dX_NeutralMolecule_; + 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_; @@ -226,7 +226,7 @@ void IonsFromNeutralVPSSTP::constructPhaseXML(XML_Node& phaseNode, std::string i * Create the neutralMolecule ThermoPhase if we haven't already */ if (!neutralMoleculePhase_) { - neutralMoleculePhase_ = newPhase(*neut_ptr); + neutralMoleculePhase_ = newPhase(*neut_ptr); } /* @@ -352,7 +352,7 @@ void IonsFromNeutralVPSSTP::getChemPotentials(doublereal* mu) const icat = passThroughList_[k]; jNeut = fm_invert_ionForNeutral[icat]; xx = std::max(SmallNumber, moleFractions_[icat]); - mu[icat] = muNeutralMolecule_[jNeut] + RT_ * (lnActCoeff_NeutralMolecule_[jNeut] + log(xx)); + mu[icat] = muNeutralMolecule_[jNeut] + RT_ * (lnActCoeff_NeutralMolecule_[jNeut] + log(xx)); } break; @@ -493,7 +493,7 @@ void IonsFromNeutralVPSSTP::calcIonMoleFractions(doublereal* const mf) const /* * Use the formula matrix to calculate the relative mole numbers. */ - for (size_t jNeut = 0; jNeut < numNeutralMoleculeSpecies_; jNeut++) { + for (size_t jNeut = 0; jNeut < numNeutralMoleculeSpecies_; jNeut++) { for (size_t k = 0; k < m_kk; k++) { double fmij = fm_neutralMolec_ions_[k + jNeut * m_kk]; mf[k] += fmij * NeutralMolecMoleFractions_[jNeut]; @@ -527,7 +527,7 @@ void IonsFromNeutralVPSSTP::calcNeutralMoleculeMoleFractions() const for (size_t k = 0; k < m_kk; k++) { sum += moleFractions_[k]; } - if (fabs(sum) > 1.0E-11) { + if (fabs(sum) > 1.0E-11) { throw CanteraError("IonsFromNeutralVPSSTP::calcNeutralMoleculeMoleFractions", "molefracts don't sum to one: " + fp2str(sum)); } @@ -550,13 +550,13 @@ void IonsFromNeutralVPSSTP::calcNeutralMoleculeMoleFractions() const icat = cationList_[k]; jNeut = fm_invert_ionForNeutral[icat]; if (jNeut != npos) { - fmij = fm_neutralMolec_ions_[icat + jNeut * m_kk]; + fmij = fm_neutralMolec_ions_[icat + jNeut * m_kk]; AssertTrace(fmij != 0.0); NeutralMolecMoleFractions_[jNeut] += moleFractions_[icat] / fmij; } } - for (size_t k = 0; k < passThroughList_.size(); k++) { + for (size_t k = 0; k < passThroughList_.size(); k++) { icat = passThroughList_[k]; jNeut = fm_invert_ionForNeutral[icat]; fmij = fm_neutralMolec_ions_[ icat + jNeut * m_kk]; @@ -567,9 +567,9 @@ void IonsFromNeutralVPSSTP::calcNeutralMoleculeMoleFractions() const for (size_t k = 0; k < m_kk; k++) { moleFractionsTmp_[k] = moleFractions_[k]; } - for (jNeut = 0; jNeut < numNeutralMoleculeSpecies_; jNeut++) { + for (jNeut = 0; jNeut < numNeutralMoleculeSpecies_; jNeut++) { for (size_t k = 0; k < m_kk; k++) { - fmij = fm_neutralMolec_ions_[k + jNeut * m_kk]; + fmij = fm_neutralMolec_ions_[k + jNeut * m_kk]; moleFractionsTmp_[k] -= fmij * NeutralMolecMoleFractions_[jNeut]; } } @@ -600,10 +600,10 @@ void IonsFromNeutralVPSSTP::calcNeutralMoleculeMoleFractions() const } break; - case cIonSolnType_SINGLECATION: + case cIonSolnType_SINGLECATION: throw CanteraError("IonsFromNeutralVPSSTP::calcNeutralMoleculeMoleFractions", "Unknown type"); break; - case cIonSolnType_MULTICATIONANION: + case cIonSolnType_MULTICATIONANION: throw CanteraError("IonsFromNeutralVPSSTP::calcNeutralMoleculeMoleFractions", "Unknown type"); break; default: @@ -637,7 +637,7 @@ void IonsFromNeutralVPSSTP::getNeutralMoleculeMoleGrads(const doublereal* const size_t icat = cationList_[k]; size_t jNeut = fm_invert_ionForNeutral[icat]; if (jNeut != npos) { - double fmij = fm_neutralMolec_ions_[icat + jNeut * m_kk]; + double fmij = fm_neutralMolec_ions_[icat + jNeut * m_kk]; AssertTrace(fmij != 0.0); const doublereal temp = 1.0/fmij; dy[jNeut] += dx[icat] * temp; @@ -645,7 +645,7 @@ void IonsFromNeutralVPSSTP::getNeutralMoleculeMoleGrads(const doublereal* const } } - for (size_t k = 0; k < passThroughList_.size(); k++) { + for (size_t k = 0; k < passThroughList_.size(); k++) { size_t icat = passThroughList_[k]; size_t jNeut = fm_invert_ionForNeutral[icat]; double fmij = fm_neutralMolec_ions_[ icat + jNeut * m_kk]; @@ -667,11 +667,11 @@ void IonsFromNeutralVPSSTP::getNeutralMoleculeMoleGrads(const doublereal* const break; - case cIonSolnType_SINGLECATION: + case cIonSolnType_SINGLECATION: throw CanteraError("IonsFromNeutralVPSSTP::getNeutralMoleculeMoleGrads", "Unknown type"); break; - case cIonSolnType_MULTICATIONANION: + case cIonSolnType_MULTICATIONANION: throw CanteraError("IonsFromNeutralVPSSTP::getNeutralMoleculeMoleGrads", "Unknown type"); break; @@ -727,9 +727,9 @@ void IonsFromNeutralVPSSTP::initThermo() GibbsExcessVPSSTP::initThermo(); } -void IonsFromNeutralVPSSTP::initLengths() +void IonsFromNeutralVPSSTP::initLengths() { - numNeutralMoleculeSpecies_ = neutralMoleculePhase_->nSpecies(); + numNeutralMoleculeSpecies_ = neutralMoleculePhase_->nSpecies(); moleFractions_.resize(m_kk); fm_neutralMolec_ions_.resize(numNeutralMoleculeSpecies_ * m_kk); fm_invert_ionForNeutral.resize(m_kk); @@ -758,10 +758,10 @@ void IonsFromNeutralVPSSTP::initLengths() * @param elemVectorI * @param nElementsI */ -static double factorOverlap(const std::vector& elnamesVN , +static double factorOverlap(const std::vector& elnamesVN , const std::vector& elemVectorN, const size_t nElementsN, - const std::vector& elnamesVI , + const std::vector& elnamesVI , const std::vector& elemVectorI, const size_t nElementsI) { @@ -825,7 +825,7 @@ void IonsFromNeutralVPSSTP::initThermoXML(XML_Node& phaseNode, const std::string * Create the neutralMolecule ThermoPhase if we haven't already */ if (!neutralMoleculePhase_) { - neutralMoleculePhase_ = newPhase(*neut_ptr); + neutralMoleculePhase_ = newPhase(*neut_ptr); } cationList_.clear(); @@ -864,20 +864,20 @@ void IonsFromNeutralVPSSTP::initThermoXML(XML_Node& phaseNode, const std::string } } - size_t nElementsN = neutralMoleculePhase_->nElements(); - const std::vector& elnamesVN = neutralMoleculePhase_->elementNames(); + size_t nElementsN = neutralMoleculePhase_->nElements(); + const std::vector& elnamesVN = neutralMoleculePhase_->elementNames(); std::vector elemVectorN(nElementsN); std::vector elemVectorN_orig(nElementsN); - size_t nElementsI = nElements(); - const std::vector& elnamesVI = elementNames(); + size_t nElementsI = nElements(); + const std::vector& elnamesVI = elementNames(); std::vector elemVectorI(nElementsI); vector fm_tmp(m_kk); - for (size_t k = 0; k < m_kk; k++) { + for (size_t k = 0; k < m_kk; k++) { fm_invert_ionForNeutral[k] = npos; } - for (size_t jNeut = 0; jNeut < numNeutralMoleculeSpecies_; jNeut++) { + for (size_t jNeut = 0; jNeut < numNeutralMoleculeSpecies_; jNeut++) { for (size_t m = 0; m < nElementsN; m++) { elemVectorN[m] = neutralMoleculePhase_->nAtoms(jNeut, m); } @@ -901,7 +901,7 @@ void IonsFromNeutralVPSSTP::initThermoXML(XML_Node& phaseNode, const std::string } } } - fm_neutralMolec_ions_[indexSpecialSpecies_ + jNeut * m_kk ] += fac; + fm_neutralMolec_ions_[indexSpecialSpecies_ + jNeut * m_kk ] += fac; for (size_t k = 0; k < m_kk; k++) { for (size_t m = 0; m < nElementsI; m++) { @@ -932,7 +932,7 @@ void IonsFromNeutralVPSSTP::initThermoXML(XML_Node& phaseNode, const std::string "Simple formula matrix generation failed, one cation is shared between two salts"); } } - fm_neutralMolec_ions_[k + jNeut * m_kk] += fac; + fm_neutralMolec_ions_[k + jNeut * m_kk] += fac; } // Ok check the work @@ -981,7 +981,7 @@ void IonsFromNeutralVPSSTP::s_update_lnActCoeff() const lnActCoeff_Scaled_[icat]= 0.0; // Do the list of neutral molecules - for (size_t k = 0; k < passThroughList_.size(); k++) { + for (size_t k = 0; k < passThroughList_.size(); k++) { icat = passThroughList_[k]; jNeut = fm_invert_ionForNeutral[icat]; lnActCoeff_Scaled_[icat] = lnActCoeff_NeutralMolecule_[jNeut]; @@ -1089,7 +1089,7 @@ void IonsFromNeutralVPSSTP::s_update_dlnActCoeffdT() const dlnActCoeffdT_Scaled_[icat]= 0.0; // Do the list of neutral molecules - for (size_t k = 0; k < passThroughList_.size(); k++) { + for (size_t k = 0; k < passThroughList_.size(); k++) { icat = passThroughList_[k]; jNeut = fm_invert_ionForNeutral[icat]; dlnActCoeffdT_Scaled_[icat] = dlnActCoeffdT_NeutralMolecule_[jNeut]; @@ -1140,7 +1140,7 @@ void IonsFromNeutralVPSSTP::s_update_dlnActCoeff_dlnX_diag() const dlnActCoeffdlnX_diag_[icat]= 0.0; // Do the list of neutral molecules - for (size_t k = 0; k < passThroughList_.size(); k++) { + for (size_t k = 0; k < passThroughList_.size(); k++) { icat = passThroughList_[k]; jNeut = fm_invert_ionForNeutral[icat]; dlnActCoeffdlnX_diag_[icat] = dlnActCoeffdlnX_diag_NeutralMolecule_[jNeut]; @@ -1234,7 +1234,7 @@ void IonsFromNeutralVPSSTP::s_update_dlnActCoeff_dlnN() const kcat = cationList_[k]; kNeut = fm_invert_ionForNeutral[kcat]; - fmij = fm_neutralMolec_ions_[kcat + kNeut * m_kk]; + fmij = fm_neutralMolec_ions_[kcat + kNeut * m_kk]; dlnActCoeffdlnN_diag_[kcat] = dlnActCoeffdlnN_diag_NeutralMolecule_[kNeut]/fmij; mcat = cationList_[m]; @@ -1247,7 +1247,7 @@ void IonsFromNeutralVPSSTP::s_update_dlnActCoeff_dlnN() const for (size_t m = 0; m < passThroughList_.size(); m++) { mcat = passThroughList_[m]; mNeut = fm_invert_ionForNeutral[mcat]; - dlnActCoeffdlnN_(kcat, mcat) = dlnActCoeffdlnN_NeutralMolecule_(kNeut, mNeut) / fmij; + dlnActCoeffdlnN_(kcat, mcat) = dlnActCoeffdlnN_NeutralMolecule_(kNeut, mNeut) / fmij; } } @@ -1260,7 +1260,7 @@ void IonsFromNeutralVPSSTP::s_update_dlnActCoeff_dlnN() const } // Do the list of neutral molecules - for (size_t k = 0; k < passThroughList_.size(); k++) { + for (size_t k = 0; k < passThroughList_.size(); k++) { kcat = passThroughList_[k]; kNeut = fm_invert_ionForNeutral[kcat]; dlnActCoeffdlnN_diag_[kcat] = dlnActCoeffdlnN_diag_NeutralMolecule_[kNeut]; @@ -1268,13 +1268,13 @@ void IonsFromNeutralVPSSTP::s_update_dlnActCoeff_dlnN() const for (size_t m = 0; m < m_kk; m++) { mcat = passThroughList_[m]; mNeut = fm_invert_ionForNeutral[mcat]; - dlnActCoeffdlnN_(kcat, mcat) = dlnActCoeffdlnN_NeutralMolecule_(kNeut, mNeut); + dlnActCoeffdlnN_(kcat, mcat) = dlnActCoeffdlnN_NeutralMolecule_(kNeut, mNeut); } for (size_t m = 0; m < cationList_.size(); m++) { mcat = cationList_[m]; mNeut = fm_invert_ionForNeutral[mcat]; - dlnActCoeffdlnN_(kcat, mcat) = dlnActCoeffdlnN_NeutralMolecule_(kNeut,mNeut); + dlnActCoeffdlnN_(kcat, mcat) = dlnActCoeffdlnN_NeutralMolecule_(kNeut,mNeut); } } break; diff --git a/src/thermo/LatticePhase.cpp b/src/thermo/LatticePhase.cpp index bfacf251d..2513b4979 100644 --- a/src/thermo/LatticePhase.cpp +++ b/src/thermo/LatticePhase.cpp @@ -35,13 +35,13 @@ 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_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; } @@ -322,7 +322,7 @@ void LatticePhase::initThermoXML(XML_Node& phaseNode, const std::string& id_) for (size_t k = 0; k < m_kk; k++) { m_speciesMolarVolume[k] = m_site_density; - XML_Node* s = speciesDB->findByAttr("name", speciesName(k)); + XML_Node* s = speciesDB->findByAttr("name", speciesName(k)); if (!s) { throw CanteraError(" LatticePhase::initThermoXML", "database problems"); } diff --git a/src/thermo/LatticeSolidPhase.cpp b/src/thermo/LatticeSolidPhase.cpp index ed2bfe7e5..d59adc77f 100644 --- a/src/thermo/LatticeSolidPhase.cpp +++ b/src/thermo/LatticeSolidPhase.cpp @@ -135,7 +135,7 @@ doublereal LatticeSolidPhase::entropy_mole() const doublereal LatticeSolidPhase::gibbs_mole() const { _updateThermo(); - doublereal sum = 0.0; + doublereal sum = 0.0; for (size_t n = 0; n < m_nlattice; n++) { sum += theta_[n] * m_lattice[n]->gibbs_mole(); } @@ -179,7 +179,7 @@ doublereal LatticeSolidPhase::logStandardConc(size_t k) const return 0.0; } -void LatticeSolidPhase::setPressure(doublereal p) +void LatticeSolidPhase::setPressure(doublereal p) { m_press = p; for (size_t n = 0; n < m_nlattice; n++) { @@ -188,7 +188,7 @@ void LatticeSolidPhase::setPressure(doublereal p) calcDensity(); } -doublereal LatticeSolidPhase::calcDensity() +doublereal LatticeSolidPhase::calcDensity() { double sum = 0.0; for (size_t n = 0; n < m_nlattice; n++) { @@ -202,7 +202,7 @@ void LatticeSolidPhase::setMoleFractions(const doublereal* const x) { size_t strt = 0; for (size_t n = 0; n < m_nlattice; n++) { - size_t nsp = m_lattice[n]->nSpecies(); + size_t nsp = m_lattice[n]->nSpecies(); m_lattice[n]->setMoleFractions(x + strt); strt += nsp; } @@ -219,7 +219,7 @@ void LatticeSolidPhase::getMoleFractions(doublereal* const x) const // the ifdef block should be the way we calculate this.!!!!! Phase::getMoleFractions(x); for (size_t n = 0; n < m_nlattice; n++) { - size_t nsp = m_lattice[n]->nSpecies(); + size_t nsp = m_lattice[n]->nSpecies(); double sum = 0.0; for (size_t k = 0; k < nsp; k++) { sum += (x + strt)[k]; @@ -249,7 +249,7 @@ void LatticeSolidPhase::getChemPotentials(doublereal* mu) const _updateThermo(); size_t strt = 0; for (size_t n = 0; n < m_nlattice; n++) { - size_t nlsp = m_lattice[n]->nSpecies(); + size_t nlsp = m_lattice[n]->nSpecies(); m_lattice[n]->getChemPotentials(mu+strt); strt += nlsp; } @@ -260,7 +260,7 @@ void LatticeSolidPhase::getPartialMolarEnthalpies(doublereal* hbar) const _updateThermo(); size_t strt = 0; for (size_t n = 0; n < m_nlattice; n++) { - size_t nlsp = m_lattice[n]->nSpecies(); + size_t nlsp = m_lattice[n]->nSpecies(); m_lattice[n]->getPartialMolarEnthalpies(hbar + strt); strt += nlsp; } @@ -271,7 +271,7 @@ void LatticeSolidPhase::getPartialMolarEntropies(doublereal* sbar) const _updateThermo(); size_t strt = 0; for (size_t n = 0; n < m_nlattice; n++) { - size_t nlsp = m_lattice[n]->nSpecies(); + size_t nlsp = m_lattice[n]->nSpecies(); m_lattice[n]->getPartialMolarEntropies(sbar + strt); strt += nlsp; } @@ -282,7 +282,7 @@ void LatticeSolidPhase::getPartialMolarCp(doublereal* cpbar) const _updateThermo(); size_t strt = 0; for (size_t n = 0; n < m_nlattice; n++) { - size_t nlsp = m_lattice[n]->nSpecies(); + size_t nlsp = m_lattice[n]->nSpecies(); m_lattice[n]->getPartialMolarCp(cpbar + strt); strt += nlsp; } @@ -293,7 +293,7 @@ void LatticeSolidPhase::getPartialMolarVolumes(doublereal* vbar) const _updateThermo(); size_t strt = 0; for (size_t n = 0; n < m_nlattice; n++) { - size_t nlsp = m_lattice[n]->nSpecies(); + size_t nlsp = m_lattice[n]->nSpecies(); m_lattice[n]->getPartialMolarVolumes(vbar + strt); strt += nlsp; } @@ -354,7 +354,7 @@ void LatticeSolidPhase::installSlavePhases(XML_Node* phaseNode) string econ = "LC_" + int2str(n) + "_" + id(); size_t m = addElement(econ, 0.0, 0, 0.0, CT_ELEM_TYPE_LATTICERATIO); size_t mm = nElements(); - size_t nsp0 = m_lattice[0]->nSpecies(); + size_t nsp0 = m_lattice[0]->nSpecies(); for (size_t k = 0; k < nsp0; k++) { m_speciesComp[k * mm + m] = -theta_[0]; } @@ -458,7 +458,7 @@ void LatticeSolidPhase::modifyOneHf298SS(const size_t k, const doublereal Hf298N for (size_t n = 0; n < m_nlattice; n++) { if (lkstart_[n+1] < k) { size_t kk = k-lkstart_[n]; - SpeciesThermo& l_spthermo = m_lattice[n]->speciesThermo(); + SpeciesThermo& l_spthermo = m_lattice[n]->speciesThermo(); l_spthermo.modifyOneHf298(kk, Hf298New); } } diff --git a/src/thermo/MargulesVPSSTP.cpp b/src/thermo/MargulesVPSSTP.cpp index 8629bc064..9165dc2f0 100644 --- a/src/thermo/MargulesVPSSTP.cpp +++ b/src/thermo/MargulesVPSSTP.cpp @@ -55,23 +55,23 @@ MargulesVPSSTP& MargulesVPSSTP::operator=(const MargulesVPSSTP& b) 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_; + 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; } @@ -260,9 +260,9 @@ void MargulesVPSSTP::getPartialMolarVolumes(doublereal* vbar) const */ getStandardVolumes(vbar); - for (size_t i = 0; i < numBinaryInteractions_; i++) { - size_t iA = m_pSpecies_A_ij[i]; - size_t iB = m_pSpecies_B_ij[i]; + for (size_t i = 0; i < numBinaryInteractions_; i++) { + size_t iA = m_pSpecies_A_ij[i]; + size_t iB = m_pSpecies_B_ij[i]; double XA = moleFractions_[iA]; double XB = moleFractions_[iB]; double g0 = (m_VHE_b_ij[i] - T * m_VSE_b_ij[i]); @@ -284,7 +284,7 @@ void MargulesVPSSTP::initThermo() GibbsExcessVPSSTP::initThermo(); } -void MargulesVPSSTP::initLengths() +void MargulesVPSSTP::initLengths() { dlnActCoeffdlnN_.resize(m_kk, m_kk); } @@ -351,9 +351,9 @@ void MargulesVPSSTP::s_update_lnActCoeff() const double T = temperature(); double invRT = 1.0 / (GasConstant*T); lnActCoeff_Scaled_.assign(m_kk, 0.0); - for (size_t i = 0; i < numBinaryInteractions_; i++) { - size_t iA = m_pSpecies_A_ij[i]; - size_t iB = m_pSpecies_B_ij[i]; + for (size_t i = 0; i < numBinaryInteractions_; i++) { + size_t iA = m_pSpecies_A_ij[i]; + size_t iB = m_pSpecies_B_ij[i]; double g0 = (m_HE_b_ij[i] - T * m_SE_b_ij[i]) * invRT; double g1 = (m_HE_c_ij[i] - T * m_SE_c_ij[i]) * invRT; double XA = moleFractions_[iA]; @@ -375,9 +375,9 @@ void MargulesVPSSTP::s_update_dlnActCoeff_dT() const doublereal invRTT = 1.0 / GasConstant*invT*invT; dlnActCoeffdT_Scaled_.assign(m_kk, 0.0); d2lnActCoeffdT2_Scaled_.assign(m_kk, 0.0); - for (size_t i = 0; i < numBinaryInteractions_; i++) { - size_t iA = m_pSpecies_A_ij[i]; - size_t iB = m_pSpecies_B_ij[i]; + for (size_t i = 0; i < numBinaryInteractions_; i++) { + size_t iA = m_pSpecies_A_ij[i]; + size_t iB = m_pSpecies_B_ij[i]; double XA = moleFractions_[iA]; double XB = moleFractions_[iB]; double g0 = -m_HE_b_ij[i] * invRTT; @@ -414,7 +414,7 @@ void MargulesVPSSTP::getd2lnActCoeffdT2(doublereal* d2lnActCoeffdT2) const } } -void MargulesVPSSTP::getdlnActCoeffds(const doublereal dTds, const doublereal* const dXds, +void MargulesVPSSTP::getdlnActCoeffds(const doublereal dTds, const doublereal* const dXds, doublereal* dlnActCoeffds) const { double T = temperature(); @@ -424,9 +424,9 @@ void MargulesVPSSTP::getdlnActCoeffds(const doublereal dTds, const doublereal* dlnActCoeffds[iK] = 0.0; } - for (size_t i = 0; i < numBinaryInteractions_; i++) { - size_t iA = m_pSpecies_A_ij[i]; - size_t iB = m_pSpecies_B_ij[i]; + for (size_t i = 0; i < numBinaryInteractions_; i++) { + size_t iA = m_pSpecies_A_ij[i]; + size_t iB = m_pSpecies_B_ij[i]; double XA = moleFractions_[iA]; double XB = moleFractions_[iB]; double dXA = dXds[iA]; @@ -453,7 +453,7 @@ void MargulesVPSSTP::s_update_dlnActCoeff_dlnN_diag() const for (size_t iK = 0; iK < m_kk; iK++) { double XK = moleFractions_[iK]; - for (size_t i = 0; i < numBinaryInteractions_; i++) { + for (size_t i = 0; i < numBinaryInteractions_; i++) { size_t iA = m_pSpecies_A_ij[i]; size_t iB = m_pSpecies_B_ij[i]; size_t delAK = 0; @@ -489,7 +489,7 @@ void MargulesVPSSTP::s_update_dlnActCoeff_dlnN() const for (size_t iK = 0; iK < m_kk; iK++) { for (size_t iM = 0; iM < m_kk; iM++) { double XM = moleFractions_[iM]; - for (size_t i = 0; i < numBinaryInteractions_; i++) { + for (size_t i = 0; i < numBinaryInteractions_; i++) { size_t iA = m_pSpecies_A_ij[i]; size_t iB = m_pSpecies_B_ij[i]; double delAK = 0.0; @@ -525,9 +525,9 @@ void MargulesVPSSTP::s_update_dlnActCoeff_dlnX_diag() const dlnActCoeffdlnX_diag_.assign(m_kk, 0.0); doublereal RT = GasConstant * T; - for (size_t i = 0; i < numBinaryInteractions_; i++) { - size_t iA = m_pSpecies_A_ij[i]; - size_t iB = m_pSpecies_B_ij[i]; + for (size_t i = 0; i < numBinaryInteractions_; i++) { + size_t iA = m_pSpecies_A_ij[i]; + size_t iB = m_pSpecies_B_ij[i]; doublereal XA = moleFractions_[iA]; doublereal XB = moleFractions_[iB]; diff --git a/src/thermo/MaskellSolidSolnPhase.cpp b/src/thermo/MaskellSolidSolnPhase.cpp index c9df9cdbb..996f14f7d 100644 --- a/src/thermo/MaskellSolidSolnPhase.cpp +++ b/src/thermo/MaskellSolidSolnPhase.cpp @@ -151,7 +151,7 @@ void MaskellSolidSolnPhase::getActivityCoefficients(doublereal* ac) const const doublereal r = moleFraction(product_species_index); const doublereal pval = p(r); const doublereal rfm = r * fm(r); - const doublereal A = (std::pow(1 - rfm, pval) * std::pow(rfm, pval) * std::pow(r - rfm, 1 - pval)) / + const doublereal A = (std::pow(1 - rfm, pval) * std::pow(rfm, pval) * std::pow(r - rfm, 1 - pval)) / (std::pow(1 - r - rfm, 1 + pval) * (1 - r)); const doublereal B = pval * h_mixing / (GasConstant * temperature()); cached.value[product_species_index] = A * std::exp(B); @@ -169,7 +169,7 @@ void MaskellSolidSolnPhase::getChemPotentials(doublereal* mu) const const doublereal RT = GasConstant * temperature(); const doublereal DgbarDr = pval * h_mixing + GasConstant * temperature() * - std::log( (std::pow(1 - rfm, pval) * std::pow(rfm, pval) * std::pow(r - rfm, 1 - pval) * r) / + std::log( (std::pow(1 - rfm, pval) * std::pow(rfm, pval) * std::pow(r - rfm, 1 - pval) * r) / (std::pow(1 - r - rfm, 1 + pval) * (1 - r)) ); mu[product_species_index] = RT * m_g0_RT[product_species_index] + DgbarDr; mu[reactant_species_index] = RT * m_g0_RT[reactant_species_index] - DgbarDr; @@ -320,4 +320,4 @@ doublereal MaskellSolidSolnPhase::p(const doublereal r) const return (1 - 2*r) / std::sqrt(sval*sval - 4 * sval * r + 4 * sval * r * r); } -} // end namespace Cantera +} // end namespace Cantera diff --git a/src/thermo/MetalSHEelectrons.cpp b/src/thermo/MetalSHEelectrons.cpp index e7d11fc99..fd33ddbd0 100644 --- a/src/thermo/MetalSHEelectrons.cpp +++ b/src/thermo/MetalSHEelectrons.cpp @@ -69,7 +69,7 @@ MetalSHEelectrons::MetalSHEelectrons(XML_Node& xmlphase, const std::string& id_) importPhase(xmlphase, this); } -MetalSHEelectrons::MetalSHEelectrons(const MetalSHEelectrons& right) : +MetalSHEelectrons::MetalSHEelectrons(const MetalSHEelectrons& right) : xdef_(0) { operator=(right); diff --git a/src/thermo/MineralEQ3.cpp b/src/thermo/MineralEQ3.cpp index 1a7c871c5..8889bbdb7 100644 --- a/src/thermo/MineralEQ3.cpp +++ b/src/thermo/MineralEQ3.cpp @@ -61,7 +61,7 @@ MineralEQ3::MineralEQ3(XML_Node& xmlphase, const std::string& id_) importPhase(xmlphase, this); } -MineralEQ3::MineralEQ3(const MineralEQ3& right) +MineralEQ3::MineralEQ3(const MineralEQ3& right) { *this = right; } @@ -77,10 +77,10 @@ MineralEQ3::operator=(const MineralEQ3& right) 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; + 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; } @@ -156,7 +156,7 @@ void MineralEQ3::getEnthalpy_RT(doublereal* hrt) const { getEnthalpy_RT_ref(hrt); doublereal RT = GasConstant * temperature(); - doublereal presCorrect = (m_press - m_p0) / molarDensity(); + doublereal presCorrect = (m_press - m_p0) / molarDensity(); hrt[0] += presCorrect / RT; } diff --git a/src/thermo/MixedSolventElectrolyte.cpp b/src/thermo/MixedSolventElectrolyte.cpp index 8355b4ce1..ecf66ef69 100644 --- a/src/thermo/MixedSolventElectrolyte.cpp +++ b/src/thermo/MixedSolventElectrolyte.cpp @@ -59,23 +59,23 @@ MixedSolventElectrolyte::operator=(const MixedSolventElectrolyte& b) 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_; + 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; } @@ -264,9 +264,9 @@ void MixedSolventElectrolyte::getPartialMolarVolumes(doublereal* vbar) const for (size_t iK = 0; iK < m_kk; iK++) { int delAK = 0; int delBK = 0; - for (size_t i = 0; i < numBinaryInteractions_; i++) { - size_t iA = m_pSpecies_A_ij[i]; - size_t iB = m_pSpecies_B_ij[i]; + for (size_t i = 0; i < numBinaryInteractions_; i++) { + size_t iA = m_pSpecies_A_ij[i]; + size_t iB = m_pSpecies_B_ij[i]; if (iA==iK) { delAK = 1; @@ -291,7 +291,7 @@ void MixedSolventElectrolyte::initThermo() MolarityIonicVPSSTP::initThermo(); } -void MixedSolventElectrolyte::initLengths() +void MixedSolventElectrolyte::initLengths() { dlnActCoeffdlnN_.resize(m_kk, m_kk); } @@ -354,9 +354,9 @@ void MixedSolventElectrolyte::s_update_lnActCoeff() const double RT = GasConstant*T; lnActCoeff_Scaled_.assign(m_kk, 0.0); for (size_t iK = 0; iK < m_kk; iK++) { - for (size_t i = 0; i < numBinaryInteractions_; i++) { - size_t iA = m_pSpecies_A_ij[i]; - size_t iB = m_pSpecies_B_ij[i]; + for (size_t i = 0; i < numBinaryInteractions_; i++) { + size_t iA = m_pSpecies_A_ij[i]; + size_t iB = m_pSpecies_B_ij[i]; int delAK = 0; int delBK = 0; if (iA==iK) { @@ -380,9 +380,9 @@ void MixedSolventElectrolyte::s_update_dlnActCoeff_dT() const dlnActCoeffdT_Scaled_.assign(m_kk, 0.0); d2lnActCoeffdT2_Scaled_.assign(m_kk, 0.0); for (size_t iK = 0; iK < m_kk; iK++) { - for (size_t i = 0; i < numBinaryInteractions_; i++) { - size_t iA = m_pSpecies_A_ij[i]; - size_t iB = m_pSpecies_B_ij[i]; + for (size_t i = 0; i < numBinaryInteractions_; i++) { + size_t iA = m_pSpecies_A_ij[i]; + size_t iB = m_pSpecies_B_ij[i]; int delAK = 0; int delBK = 0; if (iA==iK) { @@ -417,7 +417,7 @@ void MixedSolventElectrolyte::getd2lnActCoeffdT2(doublereal* d2lnActCoeffdT2) co } } -void MixedSolventElectrolyte::getdlnActCoeffds(const doublereal dTds, const doublereal* const dXds, +void MixedSolventElectrolyte::getdlnActCoeffds(const doublereal dTds, const doublereal* const dXds, doublereal* dlnActCoeffds) const { double T = temperature(); @@ -426,9 +426,9 @@ void MixedSolventElectrolyte::getdlnActCoeffds(const doublereal dTds, const dou for (size_t iK = 0; iK < m_kk; iK++) { dlnActCoeffds[iK] = 0.0; - for (size_t i = 0; i < numBinaryInteractions_; i++) { - size_t iA = m_pSpecies_A_ij[i]; - size_t iB = m_pSpecies_B_ij[i]; + for (size_t i = 0; i < numBinaryInteractions_; i++) { + size_t iA = m_pSpecies_A_ij[i]; + size_t iB = m_pSpecies_B_ij[i]; int delAK = 0; int delBK = 0; @@ -458,9 +458,9 @@ void MixedSolventElectrolyte::s_update_dlnActCoeff_dlnN_diag() const for (size_t iK = 0; iK < m_kk; iK++) { double XK = moleFractions_[iK]; - for (size_t i = 0; i < numBinaryInteractions_; i++) { - size_t iA = m_pSpecies_A_ij[i]; - size_t iB = m_pSpecies_B_ij[i]; + for (size_t i = 0; i < numBinaryInteractions_; i++) { + size_t iA = m_pSpecies_A_ij[i]; + size_t iB = m_pSpecies_B_ij[i]; int delAK = 0; int delBK = 0; @@ -493,9 +493,9 @@ void MixedSolventElectrolyte::s_update_dlnActCoeff_dlnN() const for (size_t iK = 0; iK < m_kk; iK++) { for (size_t iM = 0; iM < m_kk; iM++) { double XM = moleFractions_[iM]; - for (size_t i = 0; i < numBinaryInteractions_; i++) { - size_t iA = m_pSpecies_A_ij[i]; - size_t iB = m_pSpecies_B_ij[i]; + for (size_t i = 0; i < numBinaryInteractions_; i++) { + size_t iA = m_pSpecies_A_ij[i]; + size_t iB = m_pSpecies_B_ij[i]; double delAK = 0.0; double delBK = 0.0; double delAM = 0.0; @@ -529,9 +529,9 @@ void MixedSolventElectrolyte::s_update_dlnActCoeff_dlnX_diag() const dlnActCoeffdlnX_diag_.assign(m_kk, 0); doublereal RT = GasConstant * T; - for (size_t i = 0; i < numBinaryInteractions_; i++) { - size_t iA = m_pSpecies_A_ij[i]; - size_t iB = m_pSpecies_B_ij[i]; + for (size_t i = 0; i < numBinaryInteractions_; i++) { + size_t iA = m_pSpecies_A_ij[i]; + size_t iB = m_pSpecies_B_ij[i]; double XA = moleFractions_[iA]; double XB = moleFractions_[iB]; double g0 = (m_HE_b_ij[i] - T * m_SE_b_ij[i]) / RT; diff --git a/src/thermo/MixtureFugacityTP.cpp b/src/thermo/MixtureFugacityTP.cpp index 1fa2d66e1..19428e2d2 100644 --- a/src/thermo/MixtureFugacityTP.cpp +++ b/src/thermo/MixtureFugacityTP.cpp @@ -49,16 +49,16 @@ MixtureFugacityTP& MixtureFugacityTP::operator=(const MixtureFugacityTP& b) /* * However, we have to handle data that we own. */ - m_Pcurrent = b.m_Pcurrent; + m_Pcurrent = b.m_Pcurrent; moleFractions_ = b.moleFractions_; - iState_ = b.iState_; - forcedState_ = b.forcedState_; - m_Tlast_ref = b.m_Tlast_ref; - m_logc0 = b.m_logc0; - 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; + iState_ = b.iState_; + forcedState_ = b.forcedState_; + m_Tlast_ref = b.m_Tlast_ref; + m_logc0 = b.m_logc0; + 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; } @@ -73,17 +73,17 @@ int MixtureFugacityTP::standardStateConvention() const return cSS_CONVENTION_TEMPERATURE; } -void MixtureFugacityTP::setForcedSolutionBranch(int solnBranch) +void MixtureFugacityTP::setForcedSolutionBranch(int solnBranch) { forcedState_ = solnBranch; } -int MixtureFugacityTP::forcedSolutionBranch() const +int MixtureFugacityTP::forcedSolutionBranch() const { return forcedState_; } -int MixtureFugacityTP::reportSolnBranchActual() const +int MixtureFugacityTP::reportSolnBranchActual() const { return iState_; } @@ -353,7 +353,7 @@ void MixtureFugacityTP::setState_TP(doublereal t, doublereal pres) updateMixingExpressions(); m_Pcurrent = pres; - if (forcedState_ == FLUID_UNDEFINED) { + if (forcedState_ == FLUID_UNDEFINED) { double rhoNow = Phase::density(); double rho = densityCalc(t, pres, iState_, rhoNow); if (rho > 0.0) { @@ -569,7 +569,7 @@ doublereal MixtureFugacityTP::densityCalc(doublereal TKelvin, doublereal presPa, /* * Dampen and crop the update */ - doublereal dpdV = dpdVBase; + doublereal dpdV = dpdVBase; if (n < 10) { dpdV = dpdVBase * 1.5; } @@ -648,7 +648,7 @@ int MixtureFugacityTP::spinodalFunc::evalSS(const doublereal t, const doublereal } int MixtureFugacityTP::corr0(doublereal TKelvin, doublereal pres, doublereal& densLiqGuess, - doublereal& densGasGuess, doublereal& liqGRT, doublereal& gasGRT) + doublereal& densGasGuess, doublereal& liqGRT, doublereal& gasGRT) { int retn = 0; doublereal densLiq = densityCalc(TKelvin, pres, FLUID_LIQUID_0, densLiqGuess); @@ -660,7 +660,7 @@ int MixtureFugacityTP::corr0(doublereal TKelvin, doublereal pres, doublereal& de liqGRT = gibbs_mole() / _RT(); } - doublereal densGas = densityCalc(TKelvin, pres, FLUID_GAS, densGasGuess); + doublereal densGas = densityCalc(TKelvin, pres, FLUID_GAS, densGasGuess); if (densGas <= 0.0) { if (retn == -1) { throw CanteraError("MixtureFugacityTP::corr0", @@ -709,7 +709,7 @@ int MixtureFugacityTP::phaseState(bool checkState) const double dpdv = dpdVCalc(t, molarVol, presCalc); if (dpdv < 0.0) { - state = iStateGuess; + state = iStateGuess; } else { state = FLUID_UNSTABLE; } @@ -777,11 +777,11 @@ doublereal MixtureFugacityTP::calculatePsat(doublereal TKelvin, doublereal& mola */ doublereal presLiquid = 0.; doublereal presGas; - doublereal presBase = pres; + doublereal presBase = pres; bool foundLiquid = false; bool foundGas = false; - doublereal densLiquid = densityCalc(TKelvin, presBase, FLUID_LIQUID_0, RhoLiquidGood); + doublereal densLiquid = densityCalc(TKelvin, presBase, FLUID_LIQUID_0, RhoLiquidGood); if (densLiquid > 0.0) { foundLiquid = true; presLiquid = pres; @@ -921,7 +921,7 @@ doublereal MixtureFugacityTP::calculatePsat(doublereal TKelvin, doublereal& mola pres = critPressure(); setState_TP(TKelvin, pres); molarVolGas = mw / density(); - molarVolLiquid = molarVolGas; + molarVolLiquid = molarVolGas; setState_TR(tempSave, densSave); } return pres; @@ -944,7 +944,7 @@ void MixtureFugacityTP::_updateReferenceStateThermo() const // If the temperature has changed since the last time these // properties were computed, recompute them. if (m_Tlast_ref != Tnow) { - m_spthermo->update(Tnow, &m_cp0_R[0], &m_h0_RT[0], &m_s0_R[0]); + m_spthermo->update(Tnow, &m_cp0_R[0], &m_h0_RT[0], &m_s0_R[0]); m_Tlast_ref = Tnow; // update the species Gibbs functions diff --git a/src/thermo/MolalityVPSSTP.cpp b/src/thermo/MolalityVPSSTP.cpp index f041d18c6..9a7046b69 100644 --- a/src/thermo/MolalityVPSSTP.cpp +++ b/src/thermo/MolalityVPSSTP.cpp @@ -59,13 +59,13 @@ 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; + 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; } @@ -82,7 +82,7 @@ ThermoPhase* MolalityVPSSTP::duplMyselfAsThermoPhase() const void MolalityVPSSTP::setpHScale(const int pHscaleType) { m_pHScalingType = pHscaleType; - if (pHscaleType != PHSCALE_PITZER && pHscaleType != PHSCALE_NBS) { + if (pHscaleType != PHSCALE_PITZER && pHscaleType != PHSCALE_NBS) { throw CanteraError("MolalityVPSSTP::setpHScale", "Unknown scale type: " + int2str(pHscaleType)); } @@ -111,7 +111,7 @@ size_t MolalityVPSSTP::solventIndex() const return m_indexSolvent; } -void MolalityVPSSTP::setMoleFSolventMin(doublereal xmolSolventMIN) +void MolalityVPSSTP::setMoleFSolventMin(doublereal xmolSolventMIN) { if (xmolSolventMIN <= 0.0) { throw CanteraError("MolalityVPSSTP::setSolute ", "trouble"); @@ -444,7 +444,7 @@ size_t MolalityVPSSTP::findCLMIndex() const // Initialize lengths of local variables after all species have // been identified. -void MolalityVPSSTP::initLengths() +void MolalityVPSSTP::initLengths() { m_molalities.resize(m_kk); } diff --git a/src/thermo/MolarityIonicVPSSTP.cpp b/src/thermo/MolarityIonicVPSSTP.cpp index 710891efe..01549169c 100644 --- a/src/thermo/MolarityIonicVPSSTP.cpp +++ b/src/thermo/MolarityIonicVPSSTP.cpp @@ -70,15 +70,15 @@ MolarityIonicVPSSTP& MolarityIonicVPSSTP::operator=(const MolarityIonicVPSSTP& b 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_; + 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; } @@ -255,7 +255,7 @@ void MolarityIonicVPSSTP::calcPseudoBinaryMoleFractions() const moleFractionsTmp_[cationList_[kMax]] -= sum / m_speciesCharge[kMax]; sum = 0.0; for (size_t k = 0; k < cationList_.size(); k++) { - sum += moleFractionsTmp_[k]; + sum += moleFractionsTmp_[k]; } for (size_t k = 0; k < cationList_.size(); k++) { moleFractionsTmp_[k]/= sum; @@ -265,7 +265,7 @@ void MolarityIonicVPSSTP::calcPseudoBinaryMoleFractions() const for (size_t k = 0; k < cationList_.size(); k++) { PBMoleFractions_[k] = moleFractionsTmp_[cationList_[k]]; } - for (size_t k = 0; k < passThroughList_.size(); k++) { + for (size_t k = 0; k < passThroughList_.size(); k++) { PBMoleFractions_[neutralPBindexStart + k] = moleFractions_[passThroughList_[k]]; } @@ -298,7 +298,7 @@ void MolarityIonicVPSSTP::s_update_dlnActCoeff_dT() const { } -void MolarityIonicVPSSTP::s_update_dlnActCoeff_dX_() const +void MolarityIonicVPSSTP::s_update_dlnActCoeff_dX_() const { } @@ -335,7 +335,7 @@ void MolarityIonicVPSSTP::initThermo() } } -void MolarityIonicVPSSTP::initLengths() +void MolarityIonicVPSSTP::initLengths() { moleFractionsTmp_.resize(m_kk); } diff --git a/src/thermo/Mu0Poly.cpp b/src/thermo/Mu0Poly.cpp index 30a1a66f5..0533148a6 100644 --- a/src/thermo/Mu0Poly.cpp +++ b/src/thermo/Mu0Poly.cpp @@ -32,13 +32,13 @@ SpeciesThermoInterpType* Mu0Poly::duplMyselfAsSpeciesThermoInterpType() const return new Mu0Poly(*this); } -void Mu0Poly::updateProperties(const doublereal* tt, doublereal* cp_R, - doublereal* h_RT, doublereal* s_R) const +void Mu0Poly::updateProperties(const doublereal* tt, doublereal* cp_R, + doublereal* h_RT, doublereal* s_R) const { size_t j = m_numIntervals; double T = *tt; for (size_t i = 0; i < m_numIntervals; i++) { - double T2 = m_t0_int[i+1]; + double T2 = m_t0_int[i+1]; if (T <=T2) { j = i; break; @@ -48,7 +48,7 @@ void Mu0Poly::updateProperties(const doublereal* tt, doublereal* cp_R, double cp_Rj = m_cp0_R_int[j]; *cp_R = cp_Rj; *h_RT = (m_h0_R_int[j] + (T - T1) * cp_Rj)/T; - *s_R = m_s0_R_int[j] + cp_Rj * (log(T/T1)); + *s_R = m_s0_R_int[j] + cp_Rj * (log(T/T1)); } void Mu0Poly::updatePropertiesTemp(const doublereal T, @@ -140,7 +140,7 @@ Mu0Poly* newMu0ThermoFromXML(const XML_Node& Mu0Node) c[0] = static_cast(numPoints); c[1] = h298; for (size_t i = 0; i < numPoints; i++) { - c[2+i*2] = cTemperatures[i]; + c[2+i*2] = cTemperatures[i]; c[2+i*2+1] = cValues[i]; } @@ -156,7 +156,7 @@ void Mu0Poly::processCoeffs(const doublereal* coeffs) "nPoints must be >= 2"); } m_numIntervals = nPoints - 1; - m_H298 = coeffs[1] / GasConstant; + m_H298 = coeffs[1] / GasConstant; size_t iT298 = 0; /* * Resize according to the number of points @@ -175,7 +175,7 @@ void Mu0Poly::processCoeffs(const doublereal* coeffs) for (size_t i = 0, iindex = 2; i < nPoints; i++) { double T1 = coeffs[iindex]; m_t0_int[i] = T1; - m_mu0_R_int[i] = coeffs[iindex+1] / GasConstant; + m_mu0_R_int[i] = coeffs[iindex+1] / GasConstant; if (T1 == 298.15) { iT298 = i; ifound = true; @@ -220,7 +220,7 @@ void Mu0Poly::processCoeffs(const doublereal* coeffs) double T2 = m_t0_int[i+1]; double s2 = m_s0_R_int[i+1]; double deltaMu = m_mu0_R_int[i+1] - m_mu0_R_int[i]; - double deltaT = T2 - T1; + double deltaT = T2 - T1; double cpi = (deltaMu - T1 * s2 + T2 * s2) / (deltaT - T1 * log(T2/T1)); m_cp0_R_int[i] = cpi; m_h0_R_int[i] = m_h0_R_int[i+1] - cpi * deltaT; diff --git a/src/thermo/Nasa9Poly1.cpp b/src/thermo/Nasa9Poly1.cpp index c157e12eb..54a706afc 100644 --- a/src/thermo/Nasa9Poly1.cpp +++ b/src/thermo/Nasa9Poly1.cpp @@ -40,13 +40,13 @@ int Nasa9Poly1::reportType() const void Nasa9Poly1::updateTemperaturePoly(double T, double* T_poly) const { - T_poly[0] = T; - T_poly[1] = T * T; - T_poly[2] = T_poly[1] * T; - T_poly[3] = T_poly[2] * T; - T_poly[4] = 1.0 / T; - T_poly[5] = T_poly[4] / T; - T_poly[6] = std::log(T); + T_poly[0] = T; + T_poly[1] = T * T; + T_poly[2] = T_poly[1] * T; + T_poly[3] = T_poly[2] * T; + T_poly[4] = 1.0 / T; + T_poly[5] = T_poly[4] / T; + T_poly[6] = std::log(T); } void Nasa9Poly1::updateProperties(const doublereal* tt, @@ -54,19 +54,19 @@ void Nasa9Poly1::updateProperties(const doublereal* tt, doublereal* s_R) const { - doublereal ct0 = m_coeff[0] * tt[5]; // a0 / (T^2) - doublereal ct1 = m_coeff[1] * tt[4]; // a1 / T - doublereal ct2 = m_coeff[2]; // a2 - doublereal ct3 = m_coeff[3] * tt[0]; // a3 * T - doublereal ct4 = m_coeff[4] * tt[1]; // a4 * T^2 - doublereal ct5 = m_coeff[5] * tt[2]; // a5 * T^3 - doublereal ct6 = m_coeff[6] * tt[3]; // a6 * T^4 + doublereal ct0 = m_coeff[0] * tt[5]; // a0 / (T^2) + doublereal ct1 = m_coeff[1] * tt[4]; // a1 / T + doublereal ct2 = m_coeff[2]; // a2 + doublereal ct3 = m_coeff[3] * tt[0]; // a3 * T + doublereal ct4 = m_coeff[4] * tt[1]; // a4 * T^2 + doublereal ct5 = m_coeff[5] * tt[2]; // a5 * T^3 + doublereal ct6 = m_coeff[6] * tt[3]; // a6 * T^4 doublereal cpdivR = ct0 + ct1 + ct2 + ct3 + ct4 + ct5 + ct6; - doublereal hdivRT = -ct0 + tt[6]*ct1 + ct2 + 0.5*ct3 + 1.0/3.0*ct4 - + 0.25*ct5 + 0.2*ct6 + m_coeff[7] * tt[4]; - doublereal sdivR = -0.5*ct0 - ct1 + tt[6]*ct2 + ct3 + 0.5*ct4 - + 1.0/3.0*ct5 + 0.25*ct6 + m_coeff[8]; + doublereal hdivRT = -ct0 + tt[6]*ct1 + ct2 + 0.5*ct3 + 1.0/3.0*ct4 + + 0.25*ct5 + 0.2*ct6 + m_coeff[7] * tt[4]; + doublereal sdivR = -0.5*ct0 - ct1 + tt[6]*ct2 + ct3 + 0.5*ct4 + + 1.0/3.0*ct5 + 0.25*ct6 + m_coeff[8]; // return the computed properties for this species *cp_R = cpdivR; diff --git a/src/thermo/Nasa9PolyMultiTempRegion.cpp b/src/thermo/Nasa9PolyMultiTempRegion.cpp index a22202c18..e8852e7bf 100644 --- a/src/thermo/Nasa9PolyMultiTempRegion.cpp +++ b/src/thermo/Nasa9PolyMultiTempRegion.cpp @@ -110,13 +110,13 @@ int Nasa9PolyMultiTempRegion::reportType() const void Nasa9PolyMultiTempRegion::updateTemperaturePoly(double T, double* T_poly) const { - T_poly[0] = T; - T_poly[1] = T * T; - T_poly[2] = T_poly[1] * T; - T_poly[3] = T_poly[2] * T; - T_poly[4] = 1.0 / T; - T_poly[5] = T_poly[4] / T; - T_poly[6] = std::log(T); + T_poly[0] = T; + T_poly[1] = T * T; + T_poly[2] = T_poly[1] * T; + T_poly[3] = T_poly[2] * T; + T_poly[4] = 1.0 / T; + T_poly[5] = T_poly[4] / T; + T_poly[6] = std::log(T); } void Nasa9PolyMultiTempRegion::updateProperties(const doublereal* tt, diff --git a/src/thermo/PDSS.cpp b/src/thermo/PDSS.cpp index 7c0f2911c..f5bac312f 100644 --- a/src/thermo/PDSS.cpp +++ b/src/thermo/PDSS.cpp @@ -107,47 +107,47 @@ PDSS& PDSS::operator=(const PDSS& b) 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; + 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; + 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; + 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; } @@ -165,7 +165,7 @@ PDSS_enumType PDSS::reportPDSSType() const void PDSS::initThermoXML(const XML_Node& phaseNode, const std::string& id) { AssertThrow(m_tp != 0, "PDSS::initThermoXML()"); - m_p0 = m_vpssmgr_ptr->refPressure(m_spindex); + m_p0 = m_vpssmgr_ptr->refPressure(m_spindex); m_minTemp = m_vpssmgr_ptr->minTemp(m_spindex); m_maxTemp = m_vpssmgr_ptr->maxTemp(m_spindex); } @@ -191,17 +191,17 @@ void PDSS::initAllPtrs(VPStandardStateTP* tp, VPSSMgr* vpssmgr_ptr, void PDSS::initPtrs() { AssertThrow(m_vpssmgr_ptr->mPDSS_h0_RT.size() != 0, "PDSS::initPtrs()"); - m_h0_RT_ptr = &m_vpssmgr_ptr->mPDSS_h0_RT[0]; - m_cp0_R_ptr = &m_vpssmgr_ptr->mPDSS_cp0_R[0]; - m_s0_R_ptr = &m_vpssmgr_ptr->mPDSS_s0_R[0]; - m_g0_RT_ptr = &m_vpssmgr_ptr->mPDSS_g0_RT[0]; - m_V0_ptr = &m_vpssmgr_ptr->mPDSS_V0[0]; + m_h0_RT_ptr = &m_vpssmgr_ptr->mPDSS_h0_RT[0]; + m_cp0_R_ptr = &m_vpssmgr_ptr->mPDSS_cp0_R[0]; + m_s0_R_ptr = &m_vpssmgr_ptr->mPDSS_s0_R[0]; + m_g0_RT_ptr = &m_vpssmgr_ptr->mPDSS_g0_RT[0]; + m_V0_ptr = &m_vpssmgr_ptr->mPDSS_V0[0]; - m_hss_RT_ptr = &m_vpssmgr_ptr->mPDSS_hss_RT[0]; - m_cpss_R_ptr = &m_vpssmgr_ptr->mPDSS_cpss_R[0]; - m_sss_R_ptr = &m_vpssmgr_ptr->mPDSS_sss_R[0]; - m_gss_RT_ptr = &m_vpssmgr_ptr->mPDSS_gss_RT[0]; - m_Vss_ptr = &m_vpssmgr_ptr->mPDSS_Vss[0]; + m_hss_RT_ptr = &m_vpssmgr_ptr->mPDSS_hss_RT[0]; + m_cpss_R_ptr = &m_vpssmgr_ptr->mPDSS_cpss_R[0]; + m_sss_R_ptr = &m_vpssmgr_ptr->mPDSS_sss_R[0]; + m_gss_RT_ptr = &m_vpssmgr_ptr->mPDSS_gss_RT[0]; + m_Vss_ptr = &m_vpssmgr_ptr->mPDSS_Vss[0]; } doublereal PDSS::enthalpy_mole() const diff --git a/src/thermo/PDSS_ConstVol.cpp b/src/thermo/PDSS_ConstVol.cpp index cb4e6e98b..07a6a736a 100644 --- a/src/thermo/PDSS_ConstVol.cpp +++ b/src/thermo/PDSS_ConstVol.cpp @@ -39,7 +39,7 @@ PDSS_ConstVol::PDSS_ConstVol(VPStandardStateTP* tp, size_t spindex, PDSS(tp, spindex) { m_pdssType = cPDSS_CONSTVOL; - constructPDSSXML(tp, spindex, speciesNode, phaseRoot, spInstalled) ; + constructPDSSXML(tp, spindex, speciesNode, phaseRoot, spInstalled); } PDSS_ConstVol::PDSS_ConstVol(const PDSS_ConstVol& b) : @@ -58,7 +58,7 @@ PDSS_ConstVol& PDSS_ConstVol::operator=(const PDSS_ConstVol& b) return *this; } PDSS::operator=(b); - m_constMolarVolume = b.m_constMolarVolume; + m_constMolarVolume = b.m_constMolarVolume; return *this; } @@ -121,7 +121,7 @@ void PDSS_ConstVol::constructPDSSFile(VPStandardStateTP* tp, size_t spindex, 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)); + const XML_Node* s = speciesDB->findByAttr("name", tp->speciesName(spindex)); constructPDSSXML(tp, spindex, *s, *fxml_phase, true); } @@ -170,7 +170,7 @@ doublereal PDSS_ConstVol::cp_R() const doublereal PDSS_ConstVol::cv_mole() const { - return (cp_mole() - m_V0_ptr[m_spindex]); + return (cp_mole() - m_V0_ptr[m_spindex]); } doublereal PDSS_ConstVol::molarVolume() const @@ -212,7 +212,7 @@ void PDSS_ConstVol::setPressure(doublereal p) { m_pres = p; doublereal del_pRT = (m_pres - m_p0) / (GasConstant * m_temp); - m_hss_RT_ptr[m_spindex] = m_h0_RT_ptr[m_spindex] + del_pRT * m_Vss_ptr[m_spindex]; + m_hss_RT_ptr[m_spindex] = m_h0_RT_ptr[m_spindex] + del_pRT * m_Vss_ptr[m_spindex]; m_gss_RT_ptr[m_spindex] = m_hss_RT_ptr[m_spindex] - m_sss_R_ptr[m_spindex]; } @@ -221,12 +221,12 @@ void PDSS_ConstVol::setTemperature(doublereal temp) m_temp = temp; m_spthermo->update_one(m_spindex, temp, m_cp0_R_ptr, m_h0_RT_ptr, m_s0_R_ptr); - m_g0_RT_ptr[m_spindex] = m_h0_RT_ptr[m_spindex] - m_s0_R_ptr[m_spindex]; + m_g0_RT_ptr[m_spindex] = m_h0_RT_ptr[m_spindex] - m_s0_R_ptr[m_spindex]; doublereal del_pRT = (m_pres - m_p0) / (GasConstant * m_temp); - m_hss_RT_ptr[m_spindex] = m_h0_RT_ptr[m_spindex] + del_pRT * m_Vss_ptr[m_spindex]; - m_cpss_R_ptr[m_spindex] = m_cp0_R_ptr[m_spindex]; + m_hss_RT_ptr[m_spindex] = m_h0_RT_ptr[m_spindex] + del_pRT * m_Vss_ptr[m_spindex]; + m_cpss_R_ptr[m_spindex] = m_cp0_R_ptr[m_spindex]; m_sss_R_ptr[m_spindex] = m_s0_R_ptr[m_spindex]; m_gss_RT_ptr[m_spindex] = m_hss_RT_ptr[m_spindex] - m_sss_R_ptr[m_spindex]; } diff --git a/src/thermo/PDSS_HKFT.cpp b/src/thermo/PDSS_HKFT.cpp index 1aea7efbe..962acdf9e 100644 --- a/src/thermo/PDSS_HKFT.cpp +++ b/src/thermo/PDSS_HKFT.cpp @@ -167,33 +167,33 @@ PDSS_HKFT& PDSS_HKFT::operator=(const PDSS_HKFT& b) PDSS::operator=(b); //! Need to call initAllPtrs AFTER, to get the correct m_waterSS - m_waterSS = 0; - m_densWaterSS = b.m_densWaterSS; + m_waterSS = 0; + m_densWaterSS = b.m_densWaterSS; //! Need to call initAllPtrs AFTER, to get the correct m_waterProps delete m_waterProps; - m_waterProps = 0; - 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; + m_waterProps = 0; + 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 = new WaterProps(m_waterSS); + m_waterSS = b.m_waterSS; + m_waterProps = new WaterProps(m_waterSS); return *this; } @@ -263,14 +263,14 @@ doublereal PDSS_HKFT::cp_mole() const doublereal r_e_j = r_e_j_pr_tr + fabs(m_charge_j) * gval; doublereal dr_e_jdT = fabs(m_charge_j) * dgvaldT; - doublereal d2r_e_jdT2 = fabs(m_charge_j) * d2gvaldT2; + doublereal d2r_e_jdT2 = fabs(m_charge_j) * d2gvaldT2; doublereal r_e_j2 = r_e_j * r_e_j; doublereal charge2 = m_charge_j * m_charge_j; doublereal r_e_H = 3.082 + gval; doublereal r_e_H2 = r_e_H * r_e_H; omega_j = nu * (charge2 / r_e_j - m_charge_j / r_e_H); - domega_jdT = nu * (-(charge2 / r_e_j2 * dr_e_jdT) + domega_jdT = nu * (-(charge2 / r_e_j2 * dr_e_jdT) +(m_charge_j / r_e_H2 * dgvaldT)); d2omega_jdT2 = nu * (2.0*charge2*dr_e_jdT*dr_e_jdT/(r_e_j2*r_e_j) - charge2*d2r_e_jdT2/r_e_j2 -2.0*m_charge_j*dgvaldT*dgvaldT/(r_e_H2*r_e_H) + m_charge_j*d2gvaldT2 /r_e_H2); @@ -287,7 +287,7 @@ doublereal PDSS_HKFT::cp_mole() const doublereal yterm = 2.0 * m_temp * Y * domega_jdT; doublereal xterm = omega_j * m_temp * X; doublereal otterm = m_temp * d2omega_jdT2 * (Z + 1.0); - doublereal rterm = - m_domega_jdT_prtr * (m_Z_pr_tr + 1.0); + doublereal rterm = - m_domega_jdT_prtr * (m_Z_pr_tr + 1.0); doublereal Cp_calgmol = c1term + c2term + a3term + a4term + yterm + xterm + otterm + rterm; @@ -297,7 +297,7 @@ doublereal PDSS_HKFT::cp_mole() const return Cp; } -doublereal PDSS_HKFT::molarVolume() const +doublereal PDSS_HKFT::molarVolume() const { // Initially do all calculations in (cal/gmol/Pa) @@ -316,7 +316,7 @@ doublereal PDSS_HKFT::molarVolume() const doublereal charge2 = m_charge_j * m_charge_j; doublereal r_e_j_pr_tr = charge2 / (m_omega_pr_tr/nu + m_charge_j/3.082); - doublereal gval = gstar(m_temp, m_pres, 0); + doublereal gval = gstar(m_temp, m_pres, 0); doublereal dgvaldP = gstar(m_temp, m_pres, 3); doublereal r_e_j = r_e_j_pr_tr + fabs(m_charge_j) * gval; @@ -324,7 +324,7 @@ doublereal PDSS_HKFT::molarVolume() const omega_j = nu * (charge2 / r_e_j - m_charge_j / r_e_H); doublereal dr_e_jdP = fabs(m_charge_j) * dgvaldP; - domega_jdP = - nu * (charge2 / (r_e_j * r_e_j) * dr_e_jdP) + domega_jdP = - nu * (charge2 / (r_e_j * r_e_j) * dr_e_jdP) + nu * m_charge_j / (r_e_H * r_e_H) * dgvaldP; } @@ -334,7 +334,7 @@ doublereal PDSS_HKFT::molarVolume() const doublereal Z = -1.0 / relepsilon; doublereal wterm = - domega_jdP * (Z + 1.0); doublereal qterm = - omega_j * Q; - doublereal molVol_calgmolPascal = a1term + a2term + a3term + a4term + wterm + qterm; + doublereal molVol_calgmolPascal = a1term + a2term + a3term + a4term + wterm + qterm; // Convert to m**3 / kmol from (cal/gmol/Pa) return molVol_calgmolPascal * 4.184 * 1.0E3; @@ -402,7 +402,7 @@ void PDSS_HKFT::initThermo() m_waterSS = dynamic_cast(m_tp->providePDSS(0)); /* - * Section to initialize m_Z_pr_tr and m_Y_pr_tr + * Section to initialize m_Z_pr_tr and m_Y_pr_tr */ m_temp = 273.15 + 25.; m_pres = OneAtm; @@ -456,7 +456,7 @@ void PDSS_HKFT::initThermo() doublereal dgvaldT = gstar(m_temp, m_pres, 1); doublereal r_e_j = r_e_j_pr_tr + fabs(m_charge_j) * gval; doublereal dr_e_jdT = fabs(m_charge_j) * dgvaldT; - m_domega_jdT_prtr = - nu * (m_charge_j * m_charge_j / (r_e_j * r_e_j) * dr_e_jdT) + m_domega_jdT_prtr = - nu * (m_charge_j * m_charge_j / (r_e_j * r_e_j) * dr_e_jdT) + nu * m_charge_j / (3.082 + gval) / (3.082 + gval) * dgvaldT; } } @@ -464,7 +464,7 @@ void PDSS_HKFT::initThermo() void PDSS_HKFT::initAllPtrs(VPStandardStateTP* vptp_ptr, VPSSMgr* vpssmgr_ptr, SpeciesThermo* spthermo_ptr) { - PDSS::initAllPtrs(vptp_ptr, vpssmgr_ptr, spthermo_ptr); + PDSS::initAllPtrs(vptp_ptr, vpssmgr_ptr, spthermo_ptr); m_waterSS = dynamic_cast(m_tp->providePDSS(0)); delete m_waterProps; m_waterProps = new WaterProps(m_waterSS); @@ -596,12 +596,12 @@ void PDSS_HKFT::constructPDSSXML(VPStandardStateTP* tp, size_t spindex, } if (hasDGO == 0) { doublereal DHjmol = m_deltaH_formation_tr_pr * 1.0E3 * 4.184; - m_Mu0_tr_pr = DHjmol - 298.15 * (m_Entrop_tr_pr * 1.0E3 * 4.184); - m_deltaG_formation_tr_pr = m_Mu0_tr_pr / (1.0E3 * 4.184); - double tmp = m_Mu0_tr_pr; + m_Mu0_tr_pr = DHjmol - 298.15 * (m_Entrop_tr_pr * 1.0E3 * 4.184); + m_deltaG_formation_tr_pr = m_Mu0_tr_pr / (1.0E3 * 4.184); + double tmp = m_Mu0_tr_pr; m_charge_j = m_tp->charge(m_spindex); convertDGFormation(); - double totalSum = m_Mu0_tr_pr - tmp; + double totalSum = m_Mu0_tr_pr - tmp; m_Mu0_tr_pr = tmp; m_deltaG_formation_tr_pr = (m_Mu0_tr_pr - totalSum)/ (1.0E3 * 4.184); } @@ -643,7 +643,7 @@ void PDSS_HKFT::constructPDSSFile(VPStandardStateTP* tp, size_t spindex, 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)); + const XML_Node* s = speciesDB->findByAttr("name", tp->speciesName(spindex)); constructPDSSXML(tp, spindex, *s, *fxml_phase, true); } @@ -659,7 +659,7 @@ doublereal PDSS_HKFT::deltaH() const doublereal a3term = m_a3 * a3tmp * (pbar - m_presR_bar); doublereal a4term = m_a4 * a3tmp * log((2600. + pbar)/(2600. + m_presR_bar)); doublereal omega_j; - doublereal domega_jdT; + doublereal domega_jdT; if (m_charge_j == 0.0) { omega_j = m_omega_pr_tr; domega_jdT = 0.0; @@ -671,7 +671,7 @@ doublereal PDSS_HKFT::deltaH() const doublereal dgvaldT = gstar(m_temp, m_pres, 1); doublereal dr_e_jdT = fabs(m_charge_j) * dgvaldT; omega_j = nu * (m_charge_j * m_charge_j / r_e_j - m_charge_j / (3.082 + gval)); - domega_jdT = - nu * (m_charge_j * m_charge_j / (r_e_j * r_e_j) * dr_e_jdT) + domega_jdT = - nu * (m_charge_j * m_charge_j / (r_e_j * r_e_j) * dr_e_jdT) + nu * m_charge_j / (3.082 + gval) / (3.082 + gval) * dgvaldT; } @@ -681,13 +681,13 @@ doublereal PDSS_HKFT::deltaH() const doublereal Y = drelepsilondT / (relepsilon * relepsilon); doublereal Z = -1.0 / relepsilon; - doublereal yterm = m_temp * omega_j * Y; + doublereal yterm = m_temp * omega_j * Y; doublereal yrterm = - 298.15 * m_omega_pr_tr * m_Y_pr_tr; - doublereal wterm = - omega_j * (Z + 1.0); + doublereal wterm = - omega_j * (Z + 1.0); doublereal wrterm = + m_omega_pr_tr * (m_Z_pr_tr + 1.0); - doublereal otterm = m_temp * domega_jdT * (Z + 1.0); + doublereal otterm = m_temp * domega_jdT * (Z + 1.0); doublereal otrterm = - m_temp * m_domega_jdT_prtr * (m_Z_pr_tr + 1.0); doublereal deltaH_calgmol = c1term + a1term + a2term + c2term + a3term + a4term @@ -701,7 +701,7 @@ doublereal PDSS_HKFT::deltaH() const doublereal PDSS_HKFT::deltaG() const { doublereal pbar = m_pres * 1.0E-5; - doublereal sterm = - m_Entrop_tr_pr * (m_temp - 298.15); + doublereal sterm = - m_Entrop_tr_pr * (m_temp - 298.15); doublereal c1term = -m_c1 * (m_temp * log(m_temp/298.15) - (m_temp - 298.15)); doublereal a1term = m_a1 * (pbar - m_presR_bar); doublereal a2term = m_a2 * log((2600. + pbar)/(2600. + m_presR_bar)); @@ -755,7 +755,7 @@ doublereal PDSS_HKFT::deltaS() const doublereal r_e_j = r_e_j_pr_tr + fabs(m_charge_j) * gval; doublereal dr_e_jdT = fabs(m_charge_j) * dgvaldT; omega_j = nu * (m_charge_j * m_charge_j / r_e_j - m_charge_j / (3.082 + gval)); - domega_jdT = - nu * (m_charge_j * m_charge_j / (r_e_j * r_e_j) * dr_e_jdT) + domega_jdT = - nu * (m_charge_j * m_charge_j / (r_e_j * r_e_j) * dr_e_jdT) + nu * m_charge_j / (3.082 + gval) / (3.082 + gval) * dgvaldT; } @@ -767,7 +767,7 @@ doublereal PDSS_HKFT::deltaS() const doublereal wrterm = - m_omega_pr_tr * m_Y_pr_tr; doublereal otterm = domega_jdT * (Z + 1.0); doublereal otrterm = - m_domega_jdT_prtr * (m_Z_pr_tr + 1.0); - doublereal deltaS_calgmol = c1term + c2term + a3term + a4term + wterm + wrterm + otterm + otrterm; + doublereal deltaS_calgmol = c1term + c2term + a3term + a4term + wterm + wrterm + otterm + otrterm; // Convert to Joules / kmol return deltaS_calgmol * 1.0E3 * 4.184; @@ -775,11 +775,11 @@ doublereal PDSS_HKFT::deltaS() const doublereal PDSS_HKFT::ag(const doublereal temp, const int ifunc) const { - static doublereal ag_coeff[3] = { -2.037662, 5.747000E-3, -6.557892E-6}; + static doublereal ag_coeff[3] = { -2.037662, 5.747000E-3, -6.557892E-6}; if (ifunc == 0) { return ag_coeff[0] + ag_coeff[1] * temp + ag_coeff[2] * temp * temp; } else if (ifunc == 1) { - return ag_coeff[1] + ag_coeff[2] * 2.0 * temp; + return ag_coeff[1] + ag_coeff[2] * 2.0 * temp; } if (ifunc != 2) { return 0.0; @@ -789,7 +789,7 @@ doublereal PDSS_HKFT::ag(const doublereal temp, const int ifunc) const doublereal PDSS_HKFT::bg(const doublereal temp, const int ifunc) const { - static doublereal bg_coeff[3] = { 6.107361, -1.074377E-2, 1.268348E-5}; + static doublereal bg_coeff[3] = { 6.107361, -1.074377E-2, 1.268348E-5}; if (ifunc == 0) { return bg_coeff[0] + bg_coeff[1] * temp + bg_coeff[2] * temp * temp; } else if (ifunc == 1) { @@ -852,7 +852,7 @@ doublereal PDSS_HKFT::g(const doublereal temp, const doublereal pres, const int } else if (ifunc == 1 || ifunc == 2) { doublereal afuncdT = ag(temp, 1); doublereal bfuncdT = bg(temp, 1); - doublereal alpha = m_waterSS->thermalExpansionCoeff(); + doublereal alpha = m_waterSS->thermalExpansionCoeff(); doublereal fac1 = afuncdT * gval / afunc; doublereal fac2 = bfuncdT * gval * log(1.0 - dens); @@ -868,7 +868,7 @@ doublereal PDSS_HKFT::g(const doublereal temp, const doublereal pres, const int doublereal dfac1dT = dgdt * afuncdT / afunc + afuncdT2 * gval / afunc - afuncdT * afuncdT * gval / (afunc * afunc); doublereal ddensdT = - alpha * dens; - doublereal dfac2dT = bfuncdT2 * gval * log(1.0 - dens) + doublereal dfac2dT = bfuncdT2 * gval * log(1.0 - dens) + bfuncdT * dgdt * log(1.0 - dens) - bfuncdT * gval /(1.0 - dens) * ddensdT; doublereal dalphadT = m_waterSS->dthermalExpansionCoeffdT(); @@ -880,7 +880,7 @@ doublereal PDSS_HKFT::g(const doublereal temp, const doublereal pres, const int return dfac1dT + dfac2dT + dfac3dT; } else if (ifunc == 3) { - doublereal beta = m_waterSS->isothermalCompressibility(); + doublereal beta = m_waterSS->isothermalCompressibility(); return - bfunc * gval * dens * beta / (1.0 - dens); } else { throw CanteraError("HKFT_PDSS::g", "unimplemented"); @@ -946,12 +946,12 @@ void PDSS_HKFT::reportParams(size_t& kindex, int& type, c[1] = m_deltaH_formation_tr_pr; c[2] = m_Mu0_tr_pr; c[3] = m_Entrop_tr_pr; - c[4] = m_a1; - c[5] = m_a2; - c[6] = m_a3; - c[7] = m_a4; - c[8] = m_c1; - c[9] = m_c2; + c[4] = m_a1; + c[5] = m_a2; + c[6] = m_a3; + c[7] = m_a4; + c[8] = m_c1; + c[9] = m_c2; c[10] = m_omega_pr_tr; } diff --git a/src/thermo/PDSS_IdealGas.cpp b/src/thermo/PDSS_IdealGas.cpp index d1c8bf913..71830ad05 100644 --- a/src/thermo/PDSS_IdealGas.cpp +++ b/src/thermo/PDSS_IdealGas.cpp @@ -198,10 +198,10 @@ void PDSS_IdealGas::setTemperature(doublereal temp) m_temp = temp; m_spthermo->update_one(m_spindex, temp, m_cp0_R_ptr, m_h0_RT_ptr, m_s0_R_ptr); - m_g0_RT_ptr[m_spindex] = m_h0_RT_ptr[m_spindex] - m_s0_R_ptr[m_spindex]; + m_g0_RT_ptr[m_spindex] = m_h0_RT_ptr[m_spindex] - m_s0_R_ptr[m_spindex]; m_V0_ptr[m_spindex] = GasConstant * m_temp / m_p0; - m_hss_RT_ptr[m_spindex] = m_h0_RT_ptr[m_spindex]; - m_cpss_R_ptr[m_spindex] = m_cp0_R_ptr[m_spindex]; + m_hss_RT_ptr[m_spindex] = m_h0_RT_ptr[m_spindex]; + m_cpss_R_ptr[m_spindex] = m_cp0_R_ptr[m_spindex]; m_sss_R_ptr[m_spindex] = m_s0_R_ptr[m_spindex] + log(m_pres/m_p0); m_gss_RT_ptr[m_spindex] = m_hss_RT_ptr[m_spindex] - m_sss_R_ptr[m_spindex]; m_Vss_ptr[m_spindex] = GasConstant * m_temp / m_pres; @@ -213,7 +213,7 @@ void PDSS_IdealGas::setState_TP(doublereal temp, doublereal pres) setTemperature(temp); } -void PDSS_IdealGas::setState_TR(doublereal temp, doublereal rho) +void PDSS_IdealGas::setState_TR(doublereal temp, doublereal rho) { m_pres = GasConstant * temp * rho / m_mw; setTemperature(temp); diff --git a/src/thermo/PDSS_IonsFromNeutral.cpp b/src/thermo/PDSS_IonsFromNeutral.cpp index e83826baf..9bc9adb6a 100644 --- a/src/thermo/PDSS_IonsFromNeutral.cpp +++ b/src/thermo/PDSS_IonsFromNeutral.cpp @@ -81,14 +81,14 @@ PDSS_IonsFromNeutral& PDSS_IonsFromNeutral::operator=(const PDSS_IonsFromNeutral * functionally the best we can do for this assignment operator. We fix up the pointer in the * initAllPtrs() function. */ - neutralMoleculePhase_ = b.neutralMoleculePhase_; + neutralMoleculePhase_ = b.neutralMoleculePhase_; - numMult_ = b.numMult_; - idNeutralMoleculeVec = b.idNeutralMoleculeVec; - factorVec = b.factorVec; - add2RTln2_ = b.add2RTln2_; - tmpNM = b.tmpNM; - specialSpecies_ = b.specialSpecies_; + numMult_ = b.numMult_; + idNeutralMoleculeVec = b.idNeutralMoleculeVec; + factorVec = b.factorVec; + add2RTln2_ = b.add2RTln2_; + tmpNM = b.tmpNM; + specialSpecies_ = b.specialSpecies_; return *this; } @@ -138,13 +138,13 @@ void PDSS_IonsFromNeutral::constructPDSSXML(VPStandardStateTP* tp, size_t spinde std::vector key; std::vector val; - numMult_ = getPairs(*nsm, key, val); + numMult_ = getPairs(*nsm, key, val); idNeutralMoleculeVec.resize(numMult_); factorVec.resize(numMult_); tmpNM.resize(neutralMoleculePhase_->nSpecies()); for (size_t i = 0; i < numMult_; i++) { idNeutralMoleculeVec[i] = neutralMoleculePhase_->speciesIndex(key[i]); - factorVec[i] = fpValueCheck(val[i]); + factorVec[i] = fpValueCheck(val[i]); } specialSpecies_ = 0; const XML_Node* ss = tn->findByName("specialSpecies"); @@ -223,7 +223,7 @@ doublereal PDSS_IonsFromNeutral::entropy_R() const neutralMoleculePhase_->getEntropy_R(DATA_PTR(tmpNM)); doublereal val = 0.0; for (size_t i = 0; i < numMult_; i++) { - size_t jNeut = idNeutralMoleculeVec[i]; + size_t jNeut = idNeutralMoleculeVec[i]; val += factorVec[i] * tmpNM[jNeut]; } if (add2RTln2_) { @@ -237,7 +237,7 @@ doublereal PDSS_IonsFromNeutral::gibbs_RT() const neutralMoleculePhase_->getGibbs_RT(DATA_PTR(tmpNM)); doublereal val = 0.0; for (size_t i = 0; i < numMult_; i++) { - size_t jNeut = idNeutralMoleculeVec[i]; + size_t jNeut = idNeutralMoleculeVec[i]; val += factorVec[i] * tmpNM[jNeut]; } if (add2RTln2_) { @@ -251,7 +251,7 @@ doublereal PDSS_IonsFromNeutral::cp_R() const neutralMoleculePhase_->getCp_R(DATA_PTR(tmpNM)); doublereal val = 0.0; for (size_t i = 0; i < numMult_; i++) { - size_t jNeut = idNeutralMoleculeVec[i]; + size_t jNeut = idNeutralMoleculeVec[i]; val += factorVec[i] * tmpNM[jNeut]; } return val; @@ -262,7 +262,7 @@ doublereal PDSS_IonsFromNeutral::molarVolume() const neutralMoleculePhase_->getStandardVolumes(DATA_PTR(tmpNM)); doublereal val = 0.0; for (size_t i = 0; i < numMult_; i++) { - size_t jNeut = idNeutralMoleculeVec[i]; + size_t jNeut = idNeutralMoleculeVec[i]; val += factorVec[i] * tmpNM[jNeut]; } return val; @@ -278,7 +278,7 @@ doublereal PDSS_IonsFromNeutral::gibbs_RT_ref() const neutralMoleculePhase_->getGibbs_RT_ref(DATA_PTR(tmpNM)); doublereal val = 0.0; for (size_t i = 0; i < numMult_; i++) { - size_t jNeut = idNeutralMoleculeVec[i]; + size_t jNeut = idNeutralMoleculeVec[i]; val += factorVec[i] * tmpNM[jNeut]; } if (add2RTln2_) { @@ -292,7 +292,7 @@ doublereal PDSS_IonsFromNeutral::enthalpy_RT_ref() const neutralMoleculePhase_->getEnthalpy_RT_ref(DATA_PTR(tmpNM)); doublereal val = 0.0; for (size_t i = 0; i < numMult_; i++) { - size_t jNeut = idNeutralMoleculeVec[i]; + size_t jNeut = idNeutralMoleculeVec[i]; val += factorVec[i] * tmpNM[jNeut]; } return val; @@ -303,7 +303,7 @@ doublereal PDSS_IonsFromNeutral::entropy_R_ref() const neutralMoleculePhase_->getEntropy_R_ref(DATA_PTR(tmpNM)); doublereal val = 0.0; for (size_t i = 0; i < numMult_; i++) { - size_t jNeut = idNeutralMoleculeVec[i]; + size_t jNeut = idNeutralMoleculeVec[i]; val += factorVec[i] * tmpNM[jNeut]; } if (add2RTln2_) { @@ -317,7 +317,7 @@ doublereal PDSS_IonsFromNeutral::cp_R_ref() const neutralMoleculePhase_->getCp_R_ref(DATA_PTR(tmpNM)); doublereal val = 0.0; for (size_t i = 0; i < numMult_; i++) { - size_t jNeut = idNeutralMoleculeVec[i]; + size_t jNeut = idNeutralMoleculeVec[i]; val += factorVec[i] * tmpNM[jNeut]; } return val; @@ -328,7 +328,7 @@ doublereal PDSS_IonsFromNeutral::molarVolume_ref() const neutralMoleculePhase_->getStandardVolumes_ref(DATA_PTR(tmpNM)); doublereal val = 0.0; for (size_t i = 0; i < numMult_; i++) { - size_t jNeut = idNeutralMoleculeVec[i]; + size_t jNeut = idNeutralMoleculeVec[i]; val += factorVec[i] * tmpNM[jNeut]; } return val; diff --git a/src/thermo/PDSS_SSVol.cpp b/src/thermo/PDSS_SSVol.cpp index 722fd31c8..03ce974ef 100644 --- a/src/thermo/PDSS_SSVol.cpp +++ b/src/thermo/PDSS_SSVol.cpp @@ -48,7 +48,7 @@ PDSS_SSVol::PDSS_SSVol(VPStandardStateTP* tp, size_t spindex, m_constMolarVolume(-1.0) { m_pdssType = cPDSS_SSVOL; - constructPDSSXML(tp, spindex, speciesNode, phaseRoot, spInstalled) ; + constructPDSSXML(tp, spindex, speciesNode, phaseRoot, spInstalled); } PDSS_SSVol::PDSS_SSVol(const PDSS_SSVol& b) : @@ -198,7 +198,7 @@ doublereal PDSS_SSVol::cp_R() const doublereal PDSS_SSVol::cv_mole() const { - return (cp_mole() - m_V0_ptr[m_spindex]); + return (cp_mole() - m_V0_ptr[m_spindex]); } doublereal PDSS_SSVol::molarVolume() const @@ -242,15 +242,15 @@ void PDSS_SSVol::calcMolarVolume() const m_Vss_ptr[m_spindex] = m_constMolarVolume; } else if (volumeModel_ == cSSVOLUME_TPOLY) { m_Vss_ptr[m_spindex] = TCoeff_[0] + m_temp * (TCoeff_[1] + m_temp * (TCoeff_[2] + m_temp * TCoeff_[3])); - dVdT_ = TCoeff_[1] + 2.0 * m_temp * TCoeff_[2] + 3.0 * m_temp * m_temp * TCoeff_[3]; - d2VdT2_ = 2.0 * TCoeff_[2] + 6.0 * m_temp * TCoeff_[3]; - } else if (volumeModel_ == cSSVOLUME_DENSITY_TPOLY) { - doublereal dens = TCoeff_[0] + m_temp * (TCoeff_[1] + m_temp * (TCoeff_[2] + m_temp * TCoeff_[3])); + dVdT_ = TCoeff_[1] + 2.0 * m_temp * TCoeff_[2] + 3.0 * m_temp * m_temp * TCoeff_[3]; + d2VdT2_ = 2.0 * TCoeff_[2] + 6.0 * m_temp * TCoeff_[3]; + } else if (volumeModel_ == cSSVOLUME_DENSITY_TPOLY) { + doublereal dens = TCoeff_[0] + m_temp * (TCoeff_[1] + m_temp * (TCoeff_[2] + m_temp * TCoeff_[3])); m_Vss_ptr[m_spindex] = m_mw / dens; doublereal dens2 = dens * dens; - doublereal ddensdT = TCoeff_[1] + 2.0 * m_temp * TCoeff_[2] + 3.0 * m_temp * m_temp * TCoeff_[3]; + doublereal ddensdT = TCoeff_[1] + 2.0 * m_temp * TCoeff_[2] + 3.0 * m_temp * m_temp * TCoeff_[3]; doublereal d2densdT2 = 2.0 * TCoeff_[2] + 6.0 * m_temp * TCoeff_[3]; - dVdT_ = - m_mw / dens2 * ddensdT; + dVdT_ = - m_mw / dens2 * ddensdT; d2VdT2_ = 2.0 * m_mw / (dens2 * dens) * ddensdT * ddensdT - m_mw / dens2 * d2densdT2; } else { throw CanteraError("PDSS_SSVol::calcMolarVolume", "unimplemented"); @@ -268,7 +268,7 @@ void PDSS_SSVol::setPressure(doublereal p) m_cpss_R_ptr[m_spindex] = m_cp0_R_ptr[m_spindex]; } else { doublereal del_pRT = deltaP / (GasConstant * m_temp); - doublereal sV_term = - deltaP / GasConstant * dVdT_; + doublereal sV_term = - deltaP / GasConstant * dVdT_; m_hss_RT_ptr[m_spindex] = m_h0_RT_ptr[m_spindex] + sV_term + del_pRT * m_Vss_ptr[m_spindex]; m_sss_R_ptr[m_spindex] = m_s0_R_ptr[m_spindex] + sV_term; m_gss_RT_ptr[m_spindex] = m_hss_RT_ptr[m_spindex] - m_sss_R_ptr[m_spindex]; @@ -281,7 +281,7 @@ void PDSS_SSVol::setTemperature(doublereal temp) m_temp = temp; m_spthermo->update_one(m_spindex, temp, m_cp0_R_ptr, m_h0_RT_ptr, m_s0_R_ptr); calcMolarVolume(); - m_g0_RT_ptr[m_spindex] = m_h0_RT_ptr[m_spindex] - m_s0_R_ptr[m_spindex]; + m_g0_RT_ptr[m_spindex] = m_h0_RT_ptr[m_spindex] - m_s0_R_ptr[m_spindex]; doublereal deltaP = m_pres - m_p0; if (fabs(deltaP) < 1.0E-10) { m_hss_RT_ptr[m_spindex] = m_h0_RT_ptr[m_spindex]; @@ -290,7 +290,7 @@ void PDSS_SSVol::setTemperature(doublereal temp) m_cpss_R_ptr[m_spindex] = m_cp0_R_ptr[m_spindex]; } else { doublereal del_pRT = deltaP / (GasConstant * m_temp); - doublereal sV_term = - deltaP / GasConstant * dVdT_; + doublereal sV_term = - deltaP / GasConstant * dVdT_; m_hss_RT_ptr[m_spindex] = m_h0_RT_ptr[m_spindex] + sV_term + del_pRT * m_Vss_ptr[m_spindex]; m_sss_R_ptr[m_spindex] = m_s0_R_ptr[m_spindex] + sV_term; m_gss_RT_ptr[m_spindex] = m_hss_RT_ptr[m_spindex] - m_sss_R_ptr[m_spindex]; diff --git a/src/thermo/PDSS_Water.cpp b/src/thermo/PDSS_Water.cpp index bafd0fc8b..2debfed2e 100644 --- a/src/thermo/PDSS_Water.cpp +++ b/src/thermo/PDSS_Water.cpp @@ -80,7 +80,7 @@ PDSS_Water::PDSS_Water(VPStandardStateTP* tp, int spindex, { m_pdssType = cPDSS_WATER; std::string id= ""; - constructPDSSXML(tp, spindex, phaseRoot, id) ; + constructPDSSXML(tp, spindex, phaseRoot, id); initThermo(); m_spthermo = 0; m_minTemp = 200.; @@ -116,11 +116,11 @@ PDSS_Water& PDSS_Water::operator=(const PDSS_Water& 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_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; @@ -185,12 +185,12 @@ void PDSS_Water::constructSet() m_pres = presLow; SW_Offset = 0.0; doublereal s = entropy_mole(); - s -= GasConstant * log(oneBar/presLow); + s -= GasConstant * log(oneBar/presLow); if (s != 188.835E3) { SW_Offset = 188.835E3 - s; } s = entropy_mole(); - s -= GasConstant * log(oneBar/presLow); + s -= GasConstant * log(oneBar/presLow); doublereal h = enthalpy_mole(); if (h != -241.826E6) { @@ -237,7 +237,7 @@ doublereal PDSS_Water::cv_mole() const return m_sub.cv(); } -doublereal PDSS_Water::molarVolume() const +doublereal PDSS_Water::molarVolume() const { return m_sub.molarVolume(); } diff --git a/src/thermo/Phase.cpp b/src/thermo/Phase.cpp index 230fc18e5..503ffa059 100644 --- a/src/thermo/Phase.cpp +++ b/src/thermo/Phase.cpp @@ -72,12 +72,12 @@ Phase& Phase::operator=(const Phase& right) 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; + 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 @@ -101,8 +101,8 @@ Phase& Phase::operator=(const Phase& right) throw CanteraError("Phase::operator=()", "confused: root changed"); } } - m_id = right.m_id; - m_name = right.m_name; + m_id = right.m_id; + m_name = right.m_name; return *this; } @@ -600,7 +600,7 @@ void Phase::getMassFractions(doublereal* const y) const doublereal Phase::concentration(const size_t k) const { checkSpeciesIndex(k); - return m_y[k] * m_dens * m_rmolwts[k] ; + return m_y[k] * m_dens * m_rmolwts[k]; } void Phase::getConcentrations(doublereal* const c) const @@ -743,7 +743,7 @@ size_t Phase::addElement(const std::string& symbol, doublereal weight, for (size_t k = 0; k < m_kk; k++) { size_t m_old = m_mm - 1; for (size_t m = 0; m < m_old; m++) { - m_speciesComp[k * m_mm + m] = old[k * (m_old) + m]; + m_speciesComp[k * m_mm + m] = old[k * (m_old) + m]; } m_speciesComp[k * (m_mm) + (m_mm-1)] = 0.0; } diff --git a/src/thermo/PhaseCombo_Interaction.cpp b/src/thermo/PhaseCombo_Interaction.cpp index d57808bc0..90644a8da 100644 --- a/src/thermo/PhaseCombo_Interaction.cpp +++ b/src/thermo/PhaseCombo_Interaction.cpp @@ -54,23 +54,23 @@ PhaseCombo_Interaction& PhaseCombo_Interaction::operator=(const PhaseCombo_Inter 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_; + 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; } @@ -267,9 +267,9 @@ void PhaseCombo_Interaction::getPartialMolarVolumes(doublereal* vbar) const for (size_t iK = 0; iK < m_kk; iK++) { int delAK = 0; int delBK = 0; - for (size_t i = 0; i < numBinaryInteractions_; i++) { - size_t iA = m_pSpecies_A_ij[i]; - size_t iB = m_pSpecies_B_ij[i]; + for (size_t i = 0; i < numBinaryInteractions_; i++) { + size_t iA = m_pSpecies_A_ij[i]; + size_t iB = m_pSpecies_B_ij[i]; if (iA==iK) { delAK = 1; @@ -292,7 +292,7 @@ void PhaseCombo_Interaction::initThermo() GibbsExcessVPSSTP::initThermo(); } -void PhaseCombo_Interaction::initLengths() +void PhaseCombo_Interaction::initLengths() { dlnActCoeffdlnN_.resize(m_kk, m_kk); } @@ -367,9 +367,9 @@ void PhaseCombo_Interaction::s_update_lnActCoeff() const /* * Then add in the Margules interaction terms. that's it! */ - for (size_t i = 0; i < numBinaryInteractions_; i++) { - size_t iA = m_pSpecies_A_ij[i]; - size_t iB = m_pSpecies_B_ij[i]; + for (size_t i = 0; i < numBinaryInteractions_; i++) { + size_t iA = m_pSpecies_A_ij[i]; + size_t iB = m_pSpecies_B_ij[i]; int delAK = 0; int delBK = 0; if (iA==iK) { @@ -392,9 +392,9 @@ void PhaseCombo_Interaction::s_update_dlnActCoeff_dT() const dlnActCoeffdT_Scaled_.assign(m_kk, 0.0); d2lnActCoeffdT2_Scaled_.assign(m_kk, 0.0); for (size_t iK = 0; iK < m_kk; iK++) { - for (size_t i = 0; i < numBinaryInteractions_; i++) { - size_t iA = m_pSpecies_A_ij[i]; - size_t iB = m_pSpecies_B_ij[i]; + for (size_t i = 0; i < numBinaryInteractions_; i++) { + size_t iA = m_pSpecies_A_ij[i]; + size_t iB = m_pSpecies_B_ij[i]; int delAK = 0; int delBK = 0; if (iA==iK) { @@ -429,7 +429,7 @@ void PhaseCombo_Interaction::getd2lnActCoeffdT2(doublereal* d2lnActCoeffdT2) con } } -void PhaseCombo_Interaction::getdlnActCoeffds(const doublereal dTds, const doublereal* const dXds, +void PhaseCombo_Interaction::getdlnActCoeffds(const doublereal dTds, const doublereal* const dXds, doublereal* dlnActCoeffds) const { doublereal T = temperature(); @@ -447,9 +447,9 @@ void PhaseCombo_Interaction::getdlnActCoeffds(const doublereal dTds, const doub dlnActCoeffds[iK] += - 1.0 / xx; } - for (size_t i = 0; i < numBinaryInteractions_; i++) { - size_t iA = m_pSpecies_A_ij[i]; - size_t iB = m_pSpecies_B_ij[i]; + for (size_t i = 0; i < numBinaryInteractions_; i++) { + size_t iA = m_pSpecies_A_ij[i]; + size_t iB = m_pSpecies_B_ij[i]; int delAK = 0; int delBK = 0; @@ -489,9 +489,9 @@ void PhaseCombo_Interaction::s_update_dlnActCoeff_dlnN_diag() const dlnActCoeffdlnN_diag_[iK] = - 1.0 + xx; } - for (size_t i = 0; i < numBinaryInteractions_; i++) { - size_t iA = m_pSpecies_A_ij[i]; - size_t iB = m_pSpecies_B_ij[i]; + for (size_t i = 0; i < numBinaryInteractions_; i++) { + size_t iA = m_pSpecies_A_ij[i]; + size_t iB = m_pSpecies_B_ij[i]; int delAK = 0; int delBK = 0; @@ -535,9 +535,9 @@ void PhaseCombo_Interaction::s_update_dlnActCoeff_dlnN() const dlnActCoeffdlnN_(iK,iM) += - delKM/XM + 1.0; } - for (size_t i = 0; i < numBinaryInteractions_; i++) { - size_t iA = m_pSpecies_A_ij[i]; - size_t iB = m_pSpecies_B_ij[i]; + for (size_t i = 0; i < numBinaryInteractions_; i++) { + size_t iA = m_pSpecies_A_ij[i]; + size_t iB = m_pSpecies_B_ij[i]; double delAK = 0.0; double delBK = 0.0; double delAM = 0.0; @@ -569,9 +569,9 @@ void PhaseCombo_Interaction::s_update_dlnActCoeff_dlnX_diag() const { doublereal T = temperature(); dlnActCoeffdlnX_diag_.assign(m_kk, 0.0); - for (size_t i = 0; i < numBinaryInteractions_; i++) { - size_t iA = m_pSpecies_A_ij[i]; - size_t iB = m_pSpecies_B_ij[i]; + for (size_t i = 0; i < numBinaryInteractions_; i++) { + size_t iA = m_pSpecies_A_ij[i]; + size_t iB = m_pSpecies_B_ij[i]; double XA = moleFractions_[iA]; double XB = moleFractions_[iB]; diff --git a/src/thermo/PureFluidPhase.cpp b/src/thermo/PureFluidPhase.cpp index f509b3434..014fff7c7 100644 --- a/src/thermo/PureFluidPhase.cpp +++ b/src/thermo/PureFluidPhase.cpp @@ -40,10 +40,10 @@ PureFluidPhase& PureFluidPhase::operator=(const PureFluidPhase& right) if (&right != this) { ThermoPhase::operator=(right); delete m_sub; - m_subflag = right.m_subflag; - m_sub = tpx::GetSub(m_subflag); - m_mw = right.m_mw; - m_verbose = right.m_verbose; + m_subflag = right.m_subflag; + m_sub = tpx::GetSub(m_subflag); + m_mw = right.m_mw; + m_verbose = right.m_verbose; } return *this; } @@ -172,32 +172,32 @@ tpx::Substance& PureFluidPhase::TPX_Substance() return *m_sub; } -void PureFluidPhase::getPartialMolarEnthalpies(doublereal* hbar) const +void PureFluidPhase::getPartialMolarEnthalpies(doublereal* hbar) const { hbar[0] = enthalpy_mole(); } -void PureFluidPhase::getPartialMolarEntropies(doublereal* sbar) const +void PureFluidPhase::getPartialMolarEntropies(doublereal* sbar) const { sbar[0] = entropy_mole(); } -void PureFluidPhase::getPartialMolarIntEnergies(doublereal* ubar) const +void PureFluidPhase::getPartialMolarIntEnergies(doublereal* ubar) const { ubar[0] = intEnergy_mole(); } -void PureFluidPhase::getPartialMolarCp(doublereal* cpbar) const +void PureFluidPhase::getPartialMolarCp(doublereal* cpbar) const { cpbar[0] = cp_mole(); } -void PureFluidPhase::getPartialMolarVolumes(doublereal* vbar) const +void PureFluidPhase::getPartialMolarVolumes(doublereal* vbar) const { vbar[0] = 1.0 / molarDensity(); } -void PureFluidPhase::getActivityConcentrations(doublereal* c) const +void PureFluidPhase::getActivityConcentrations(doublereal* c) const { c[0] = 1.0; } @@ -207,12 +207,12 @@ doublereal PureFluidPhase::standardConcentration(size_t k) const return 1.0; } -void PureFluidPhase::getActivities(doublereal* a) const +void PureFluidPhase::getActivities(doublereal* a) const { a[0] = 1.0; } -void PureFluidPhase::getStandardChemPotentials(doublereal* mu) const +void PureFluidPhase::getStandardChemPotentials(doublereal* mu) const { mu[0] = gibbs_mole(); } @@ -227,7 +227,7 @@ void PureFluidPhase::getEntropy_R(doublereal* sr) const sr[0] = entropy_mole() / GasConstant; } -void PureFluidPhase::getGibbs_RT(doublereal* grt) const +void PureFluidPhase::getGibbs_RT(doublereal* grt) const { grt[0] = gibbs_mole() / _RT(); } @@ -243,7 +243,7 @@ void PureFluidPhase::getEnthalpy_RT_ref(doublereal* hrt) const } -void PureFluidPhase::getGibbs_RT_ref(doublereal* grt) const +void PureFluidPhase::getGibbs_RT_ref(doublereal* grt) const { double psave = pressure(); double t = temperature(); diff --git a/src/thermo/RedlichKisterVPSSTP.cpp b/src/thermo/RedlichKisterVPSSTP.cpp index 14915330a..b880d6102 100644 --- a/src/thermo/RedlichKisterVPSSTP.cpp +++ b/src/thermo/RedlichKisterVPSSTP.cpp @@ -61,15 +61,15 @@ RedlichKisterVPSSTP& RedlichKisterVPSSTP::operator=(const RedlichKisterVPSSTP& b 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_; + 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; } @@ -262,7 +262,7 @@ void RedlichKisterVPSSTP::initThermo() GibbsExcessVPSSTP::initThermo(); } -void RedlichKisterVPSSTP::initLengths() +void RedlichKisterVPSSTP::initLengths() { dlnActCoeffdlnN_.resize(m_kk, m_kk); } @@ -328,9 +328,9 @@ void RedlichKisterVPSSTP::s_update_lnActCoeff() const * within the routine. There is a severe problem with roundoff error in these calculations. The * dimensionless terms help. */ - for (size_t i = 0; i < numBinaryInteractions_; i++) { - size_t iA = m_pSpecies_A_ij[i]; - size_t iB = m_pSpecies_B_ij[i]; + for (size_t i = 0; i < numBinaryInteractions_; i++) { + size_t iA = m_pSpecies_A_ij[i]; + size_t iB = m_pSpecies_B_ij[i]; double XA = moleFractions_[iA]; double XB = moleFractions_[iB]; doublereal deltaX = XA - XB; @@ -343,7 +343,7 @@ void RedlichKisterVPSSTP::s_update_lnActCoeff() const doublereal sumMm1 = 0.0; doublereal sum2 = 0.0; for (size_t m = 0; m < N; m++) { - doublereal A_ge = (he_vec[m] - T * se_vec[m]) / (GasConstant * T); + doublereal A_ge = (he_vec[m] - T * se_vec[m]) / (GasConstant * T); sum += A_ge * poly; sum2 += A_ge * (m + 1) * poly; poly *= deltaX; @@ -357,7 +357,7 @@ void RedlichKisterVPSSTP::s_update_lnActCoeff() const for (size_t k = 0; k < m_kk; k++) { if (iA == k) { lnActCoeff_Scaled_[k] += (oneMXA * XB * sum) + (XA * XB * sumMm1 * (oneMXA + XB)); - } else if (iB == k) { + } else if (iB == k) { lnActCoeff_Scaled_[k] += (oneMXB * XA * sum) + (XA * XB * sumMm1 * (-oneMXB - XA)); } else { lnActCoeff_Scaled_[k] += -(XA * XB * sum2); @@ -372,9 +372,9 @@ void RedlichKisterVPSSTP::s_update_dlnActCoeff_dT() const dlnActCoeffdT_Scaled_.assign(m_kk, 0.0); d2lnActCoeffdT2_Scaled_.assign(m_kk, 0.0); - for (size_t i = 0; i < numBinaryInteractions_; i++) { - size_t iA = m_pSpecies_A_ij[i]; - size_t iB = m_pSpecies_B_ij[i]; + for (size_t i = 0; i < numBinaryInteractions_; i++) { + size_t iA = m_pSpecies_A_ij[i]; + size_t iB = m_pSpecies_B_ij[i]; double XA = moleFractions_[iA]; double XB = moleFractions_[iB]; doublereal deltaX = XA - XB; @@ -400,7 +400,7 @@ void RedlichKisterVPSSTP::s_update_dlnActCoeff_dT() const for (size_t k = 0; k < m_kk; k++) { if (iA == k) { dlnActCoeffdT_Scaled_[k] += (oneMXA * XB * sum) + (XA * XB * sumMm1 * (oneMXA + XB)); - } else if (iB == k) { + } else if (iB == k) { dlnActCoeffdT_Scaled_[k] += (oneMXB * XA * sum) + (XA * XB * sumMm1 * (-oneMXB - XA)); } else { dlnActCoeffdT_Scaled_[k] += -(XA * XB * sum2); @@ -430,9 +430,9 @@ void RedlichKisterVPSSTP::s_update_dlnActCoeff_dX_() const doublereal T = temperature(); dlnActCoeff_dX_.zero(); - for (size_t i = 0; i < numBinaryInteractions_; i++) { - size_t iA = m_pSpecies_A_ij[i]; - size_t iB = m_pSpecies_B_ij[i]; + for (size_t i = 0; i < numBinaryInteractions_; i++) { + size_t iA = m_pSpecies_A_ij[i]; + size_t iB = m_pSpecies_B_ij[i]; double XA = moleFractions_[iA]; double XB = moleFractions_[iB]; doublereal deltaX = XA - XB; @@ -448,12 +448,12 @@ void RedlichKisterVPSSTP::s_update_dlnActCoeff_dX_() const doublereal sum2Mm1 = 0.0; doublereal sumMm2 = 0.0; for (size_t m = 0; m < N; m++) { - doublereal A_ge = he_vec[m] - T * se_vec[m]; + doublereal A_ge = he_vec[m] - T * se_vec[m]; sum += A_ge * poly; sum2 += A_ge * (m + 1) * poly; poly *= deltaX; if (m >= 1) { - sumMm1 += (A_ge * polyMm1 * m); + sumMm1 += (A_ge * polyMm1 * m); sum2Mm1 += (A_ge * polyMm1 * m * (1.0 + m)); polyMm1 *= deltaX; } @@ -472,7 +472,7 @@ void RedlichKisterVPSSTP::s_update_dlnActCoeff_dX_() const dlnActCoeff_dX_(k, iB) += ((1.0 - XA) * sum - (1.0 - XA) * XB * sumMm1 + XA * sumMm1 * (1.0 + 2.0 * XB - XA) - XA * XB * sumMm2 * (1.0 - XA + XB)); - } else if (iB == k) { + } else if (iB == k) { dlnActCoeff_dX_(k, iA) += ((1.0 - XB) * sum + (1.0 - XA) * XB * sumMm1 + XB * sumMm1 * (1.0 - 2.0 * XA + XB) + XA * XB * sumMm2 * (1.0 - XA + XB)); @@ -481,8 +481,8 @@ void RedlichKisterVPSSTP::s_update_dlnActCoeff_dX_() const + XA * sumMm1 * (XB - XA - (1.0 - XB)) - XA * XB * sumMm2 * (-XA - (1.0 - XB))); } else { - dlnActCoeff_dX_(k, iA) += (- XB * sum2 - XA * XB * sum2Mm1); - dlnActCoeff_dX_(k, iB) += (- XA * sum2 + XA * XB * sum2Mm1); + dlnActCoeff_dX_(k, iA) += (- XB * sum2 - XA * XB * sum2Mm1); + dlnActCoeff_dX_(k, iB) += (- XA * sum2 + XA * XB * sum2Mm1); } } } @@ -628,8 +628,8 @@ void RedlichKisterVPSSTP::Vint(double& VintOut, double& voltsOut) 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]; + 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; @@ -658,7 +658,7 @@ void RedlichKisterVPSSTP::Vint(double& VintOut, double& voltsOut) Volts /= Faraday; double termp = GasConstant * T * log((1.0 - XA)/XA) / Faraday; - VintOut = Volts; + VintOut = Volts; voltsOut = Volts + termp; } #endif diff --git a/src/thermo/RedlichKwongMFTP.cpp b/src/thermo/RedlichKwongMFTP.cpp index 763b5af23..136babef9 100644 --- a/src/thermo/RedlichKwongMFTP.cpp +++ b/src/thermo/RedlichKwongMFTP.cpp @@ -123,8 +123,8 @@ RedlichKwongMFTP& RedlichKwongMFTP::operator=(const RedlichKwongMFTP& b) 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_pp = b.m_pp; + m_tmpV = b.m_tmpV; m_partialMolarVolumes = b.m_partialMolarVolumes; dpdV_ = b.dpdV_; dpdT_ = b.dpdT_; @@ -158,7 +158,7 @@ doublereal RedlichKwongMFTP::enthalpy_mole() const doublereal RedlichKwongMFTP::entropy_mole() const { _updateReferenceStateThermo(); - doublereal sr_ideal = GasConstant * (mean_X(m_s0_R) + doublereal sr_ideal = GasConstant * (mean_X(m_s0_R) - sum_xlogx() - std::log(pressure()/m_spthermo->refPressure())); doublereal sr_nonideal = sresid(); return sr_ideal + sr_nonideal; @@ -299,7 +299,7 @@ void RedlichKwongMFTP::getActivityCoefficients(doublereal* ac) const + rt * log(mv / vmb) + rt * b_vec_Curr_[k] / vmb - 2.0 * m_pp[k] / (m_b_current * sqt) * log(vpb/mv) - + m_a_current * b_vec_Curr_[k] / (m_b_current * m_b_current * sqt) * log(vpb/mv) + + m_a_current * b_vec_Curr_[k] / (m_b_current * m_b_current * sqt) * log(vpb/mv) - m_a_current / (m_b_current * sqt) * (b_vec_Curr_[k]/vpb) ); } @@ -351,7 +351,7 @@ void RedlichKwongMFTP::getChemPotentials(doublereal* mu) const + rt * log(mv / vmb) + rt * b_vec_Curr_[k] / vmb - 2.0 * m_pp[k] / (m_b_current * sqt) * log(vpb/mv) - + m_a_current * b_vec_Curr_[k] / (m_b_current * m_b_current * sqt) * log(vpb/mv) + + m_a_current * b_vec_Curr_[k] / (m_b_current * m_b_current * sqt) * log(vpb/mv) - m_a_current / (m_b_current * sqt) * (b_vec_Curr_[k]/vpb) ); } @@ -392,14 +392,14 @@ void RedlichKwongMFTP::getPartialMolarEnthalpies(doublereal* hbar) const m_tmpV[k] = 0.0; for (size_t i = 0; i < m_kk; i++) { size_t counter = k + m_kk*i; - m_tmpV[k] += 2.0 * moleFractions_[i] * TKelvin * a_coeff_vec(1,counter) - 3.0 * moleFractions_[i] * a_vec_Curr_[counter]; + m_tmpV[k] += 2.0 * moleFractions_[i] * TKelvin * a_coeff_vec(1,counter) - 3.0 * moleFractions_[i] * a_vec_Curr_[counter]; } } pressureDerivatives(); doublereal fac2 = mv + TKelvin * dpdT_ / dpdV_; for (size_t k = 0; k < m_kk; k++) { - double hE_v = (mv * dpdni_[k] - rt - b_vec_Curr_[k]/ (m_b_current * m_b_current * sqt) * log(vpb/mv)*fac + double hE_v = (mv * dpdni_[k] - rt - b_vec_Curr_[k]/ (m_b_current * m_b_current * sqt) * log(vpb/mv)*fac + 1.0 / (m_b_current * sqt) * log(vpb/mv) * m_tmpV[k] + b_vec_Curr_[k] / vpb / (m_b_current * sqt) * fac); hbar[k] = hbar[k] + hE_v; @@ -437,7 +437,7 @@ void RedlichKwongMFTP::getPartialMolarEntropies(doublereal* sbar) const } doublereal dadt = da_dt(); - doublereal fac = dadt - m_a_current / (2.0 * TKelvin); + doublereal fac = dadt - m_a_current / (2.0 * TKelvin); doublereal vmb = mv - m_b_current; doublereal vpb = mv + m_b_current; for (size_t k = 0; k < m_kk; k++) { @@ -448,8 +448,8 @@ void RedlichKwongMFTP::getPartialMolarEntropies(doublereal* sbar) const + m_pp[k]/(m_b_current * TKelvin * sqt) * log(vpb/mv) - 2.0 * m_tmpV[k]/(m_b_current * sqt) * log(vpb/mv) + b_vec_Curr_[k] / (m_b_current * m_b_current * sqt) * log(vpb/mv) * fac - - 1.0 / (m_b_current * sqt) * b_vec_Curr_[k] / vpb * fac - ) ; + - 1.0 / (m_b_current * sqt) * b_vec_Curr_[k] / vpb * fac + ); } pressureDerivatives(); @@ -498,9 +498,9 @@ void RedlichKwongMFTP::getPartialMolarVolumes(doublereal* vbar) const doublereal vpb = mv + m_b_current; for (size_t k = 0; k < m_kk; k++) { doublereal num = (rt + rt * m_b_current/ vmb + rt * b_vec_Curr_[k] / vmb - + rt * m_b_current * b_vec_Curr_[k] /(vmb * vmb) + + rt * m_b_current * b_vec_Curr_[k] /(vmb * vmb) - 2.0 * m_pp[k] / (sqt * vpb) - + m_a_current * b_vec_Curr_[k] / (sqt * vpb * vpb) + + m_a_current * b_vec_Curr_[k] / (sqt * vpb * vpb) ); doublereal denom = (m_Pcurrent + rt * m_b_current/(vmb * vmb) - m_a_current / (sqt * vpb * vpb) ); @@ -718,9 +718,9 @@ void RedlichKwongMFTP::initThermoXML(XML_Node& phaseNode, const std::string& id) } for (size_t i = 0; i < m_kk; i++) { - double a0coeff = a_coeff_vec(0, i*m_kk + i); - double aTcoeff = a_coeff_vec(1, i*m_kk + i); - double ai = a0coeff + aTcoeff * 500.; + double a0coeff = a_coeff_vec(0, i*m_kk + i); + double aTcoeff = a_coeff_vec(1, i*m_kk + i); + double ai = a0coeff + aTcoeff * 500.; double bi = b_vec_Curr_[i]; calcCriticalConditions(ai, bi, a0coeff, aTcoeff, m_pc_Species[i], m_tc_Species[i], m_vc_Species[i]); } @@ -894,7 +894,7 @@ doublereal RedlichKwongMFTP::sresid() const doublereal T = temperature(); doublereal sqT = sqrt(T); doublereal fac = dadt - m_a_current / (2.0 * T); - double sresid_mol_R = log(zz*(1.0 - hh)) + log(1.0 + hh) * fac / (sqT * GasConstant * m_b_current); + double sresid_mol_R = log(zz*(1.0 - hh)) + log(1.0 + hh) * fac / (sqT * GasConstant * m_b_current); return GasConstant * sresid_mol_R; } @@ -997,7 +997,7 @@ doublereal RedlichKwongMFTP::densityCalc(doublereal TKelvin, doublereal presPa, return -2.0; } } else if (NSolns_ == -1) { - if (phaseRequested >= FLUID_LIQUID_0 || phaseRequested == FLUID_UNDEFINED || phaseRequested == FLUID_SUPERCRIT) { + if (phaseRequested >= FLUID_LIQUID_0 || phaseRequested == FLUID_UNDEFINED || phaseRequested == FLUID_SUPERCRIT) { molarVolLast = Vroot_[0]; } else if (TKelvin > tcrit) { molarVolLast = Vroot_[0]; @@ -1011,7 +1011,7 @@ doublereal RedlichKwongMFTP::densityCalc(doublereal TKelvin, doublereal presPa, return mmw / molarVolLast; } -doublereal RedlichKwongMFTP::densSpinodalLiquid() const +doublereal RedlichKwongMFTP::densSpinodalLiquid() const { if (NSolns_ != 3) { return critDensity(); @@ -1049,7 +1049,7 @@ doublereal RedlichKwongMFTP::densSpinodalGas() const double funcNeeded = 0.0; int status = rf.solve(vmin, vmax, 100, funcNeeded, &vbest); if (status != ROOTFIND_SUCCESS) { - throw CanteraError(" RedlichKwongMFTP::densSpinodalGas() ", "didn't converge"); + throw CanteraError(" RedlichKwongMFTP::densSpinodalGas() ", "didn't converge"); } doublereal mmw = meanMolecularWeight(); return mmw / vbest; @@ -1063,7 +1063,7 @@ doublereal RedlichKwongMFTP::pressureCalc(doublereal TKelvin, doublereal molarVo return pres; } -doublereal RedlichKwongMFTP::dpdVCalc(doublereal TKelvin, doublereal molarVol, doublereal& presCalc) const +doublereal RedlichKwongMFTP::dpdVCalc(doublereal TKelvin, doublereal molarVol, doublereal& presCalc) const { doublereal sqt = sqrt(TKelvin); presCalc = GasConstant * TKelvin / (molarVol - m_b_current) @@ -1076,7 +1076,7 @@ doublereal RedlichKwongMFTP::dpdVCalc(doublereal TKelvin, doublereal molarVol, return dpdv; } -void RedlichKwongMFTP::pressureDerivatives() const +void RedlichKwongMFTP::pressureDerivatives() const { doublereal TKelvin = temperature(); doublereal mv = molarVolume(); @@ -1088,7 +1088,7 @@ void RedlichKwongMFTP::pressureDerivatives() const doublereal vmb = mv - m_b_current; doublereal dadt = da_dt(); doublereal fac = dadt - m_a_current/(2.0 * TKelvin); - dpdT_ = (GasConstant / vmb - fac / (sqt * mv * vpb)); + dpdT_ = (GasConstant / vmb - fac / (sqt * mv * vpb)); } void RedlichKwongMFTP::updateMixingExpressions() @@ -1113,7 +1113,7 @@ void RedlichKwongMFTP::updateAB() for (size_t i = 0; i < m_kk; i++) { m_b_current += moleFractions_[i] * b_vec_Curr_[i]; for (size_t j = 0; j < m_kk; j++) { - m_a_current += a_vec_Curr_[i * m_kk + j] * moleFractions_[i] * moleFractions_[j]; + m_a_current += a_vec_Curr_[i * m_kk + j] * moleFractions_[i] * moleFractions_[j]; } } } @@ -1128,7 +1128,7 @@ void RedlichKwongMFTP::calculateAB(doublereal temp, doublereal& aCalc, doublerea for (size_t j = 0; j < m_kk; j++) { size_t counter = i * m_kk + j; doublereal a_vec_Curr = a_coeff_vec(0,counter) + a_coeff_vec(1,counter) * temp; - aCalc += a_vec_Curr * moleFractions_[i] * moleFractions_[j]; + aCalc += a_vec_Curr * moleFractions_[i] * moleFractions_[j]; } } } else { @@ -1137,7 +1137,7 @@ void RedlichKwongMFTP::calculateAB(doublereal temp, doublereal& aCalc, doublerea for (size_t j = 0; j < m_kk; j++) { size_t counter = i * m_kk + j; doublereal a_vec_Curr = a_coeff_vec(0,counter); - aCalc += a_vec_Curr * moleFractions_[i] * moleFractions_[j]; + aCalc += a_vec_Curr * moleFractions_[i] * moleFractions_[j]; } } } @@ -1150,7 +1150,7 @@ doublereal RedlichKwongMFTP::da_dt() const for (size_t i = 0; i < m_kk; i++) { for (size_t j = 0; j < m_kk; j++) { size_t counter = i * m_kk + j; - dadT+= a_coeff_vec(1,counter) * moleFractions_[i] * moleFractions_[j]; + dadT+= a_coeff_vec(1,counter) * moleFractions_[i] * moleFractions_[j]; } } } @@ -1185,7 +1185,7 @@ void RedlichKwongMFTP::calcCriticalConditions(doublereal a, doublereal b, double tc = pow(tmp, pp); for (int j = 0; j < 10; j++) { sqrttc = sqrt(tc); - f = omega_a * b * GasConstant * tc * sqrttc / omega_b - aT_coeff * tc - a0_coeff; + f = omega_a * b * GasConstant * tc * sqrttc / omega_b - aT_coeff * tc - a0_coeff; dfdt = 1.5 * omega_a * b * GasConstant * sqrttc / omega_b - aT_coeff; deltatc = - f / dfdt; tc += deltatc; @@ -1206,7 +1206,7 @@ int RedlichKwongMFTP::NicholsSolve(double TKelvin, double pres, doublereal a, do Vroot[1] = 0.0; Vroot[2] = 0.0; if (TKelvin <= 0.0) { - throw CanteraError("RedlichKwongMFTP::NicholsSolve()", "neg temperature"); + throw CanteraError("RedlichKwongMFTP::NicholsSolve()", "neg temperature"); } /* * Derive the coefficients of the cubic polynomial to solve. @@ -1219,9 +1219,9 @@ int RedlichKwongMFTP::NicholsSolve(double TKelvin, double pres, doublereal a, do double tmp = a * omega_b / (b * omega_a * GasConstant); double pp = 2./3.; - double tc = pow(tmp, pp); + double tc = pow(tmp, pp); double pc = omega_b * GasConstant * tc / b; - double vc = omega_vc * GasConstant * tc / pc; + double vc = omega_vc * GasConstant * tc / pc; // Derive the center of the cubic, x_N doublereal xN = - bn /(3 * an); @@ -1237,7 +1237,7 @@ int RedlichKwongMFTP::NicholsSolve(double TKelvin, double pres, doublereal a, do if (fabs(ratio2) < 1.0E-5 && fabs(ratio3) < 1.0E-5) { doublereal zz = 1.0; for (int i = 0; i < 10; i++) { - doublereal znew = zz / (zz - ratio2) - ratio3 / (zz + ratio1); + doublereal znew = zz / (zz - ratio2) - ratio3 / (zz + ratio1); doublereal deltaz = znew - zz; zz = znew; if (fabs(deltaz) < 1.0E-14) { @@ -1301,7 +1301,7 @@ int RedlichKwongMFTP::NicholsSolve(double TKelvin, double pres, doublereal a, do Vroot[0] = alpha; Vroot[1] = 0.0; Vroot[2] = 0.0; - tmp = an * Vroot[0] * Vroot[0] * Vroot[0] + bn * Vroot[0] * Vroot[0] + cn * Vroot[0] + dn; + tmp = an * Vroot[0] * Vroot[0] * Vroot[0] + bn * Vroot[0] * Vroot[0] + cn * Vroot[0] + dn; } else if (desc < 0.0) { doublereal tmp = - yN/h; doublereal val = acos(tmp); @@ -1315,7 +1315,7 @@ int RedlichKwongMFTP::NicholsSolve(double TKelvin, double pres, doublereal a, do Vroot[2] = alpha; for (int i = 0; i < 3; i++) { - tmp = an * Vroot[i] * Vroot[i] * Vroot[i] + bn * Vroot[i] * Vroot[i] + cn * Vroot[i] + dn; + tmp = an * Vroot[i] * Vroot[i] * Vroot[i] + bn * Vroot[i] * Vroot[i] + cn * Vroot[i] + dn; if (fabs(tmp) > 1.0E-4) { for (int j = 0; j < 3; j++) { if (j != i && fabs(Vroot[i] - Vroot[j]) < 1.0E-4 * (fabs(Vroot[i]) + fabs(Vroot[j]))) { @@ -1340,7 +1340,7 @@ int RedlichKwongMFTP::NicholsSolve(double TKelvin, double pres, doublereal a, do throw CanteraError("RedlichKwongMFTP::NicholsSolve()", "unexpected"); } Vroot[1] = xN + delta; - Vroot[0] = xN - 2.0*delta; // liquid phase root + Vroot[0] = xN - 2.0*delta; // liquid phase root } else { tmp = pow(yN/(2*an), 1./3.); if (fabs(tmp - delta) > 1.0E-9) { @@ -1348,11 +1348,11 @@ int RedlichKwongMFTP::NicholsSolve(double TKelvin, double pres, doublereal a, do } delta = -delta; Vroot[0] = xN + delta; - Vroot[1] = xN - 2.0*delta; // gas phase root + Vroot[1] = xN - 2.0*delta; // gas phase root } } for (int i = 0; i < 2; i++) { - tmp = an * Vroot[i] * Vroot[i] * Vroot[i] + bn * Vroot[i] * Vroot[i] + cn * Vroot[i] + dn; + tmp = an * Vroot[i] * Vroot[i] * Vroot[i] + bn * Vroot[i] * Vroot[i] + cn * Vroot[i] + dn; } } @@ -1362,17 +1362,17 @@ int RedlichKwongMFTP::NicholsSolve(double TKelvin, double pres, doublereal a, do double res, dresdV = 0.0; for (int i = 0; i < nSolnValues; i++) { for (int n = 0; n < 20; n++) { - res = an * Vroot[i] * Vroot[i] * Vroot[i] + bn * Vroot[i] * Vroot[i] + cn * Vroot[i] + dn; + res = an * Vroot[i] * Vroot[i] * Vroot[i] + bn * Vroot[i] * Vroot[i] + cn * Vroot[i] + dn; if (fabs(res) < 1.0E-14) { break; } - dresdV = 3.0 * an * Vroot[i] * Vroot[i] + 2.0 * bn * Vroot[i] + cn; + dresdV = 3.0 * an * Vroot[i] * Vroot[i] + 2.0 * bn * Vroot[i] + cn; double del = - res / dresdV; Vroot[i] += del; if (fabs(del) / (fabs(Vroot[i]) + fabs(del)) < 1.0E-14) { break; } - double res2 = an * Vroot[i] * Vroot[i] * Vroot[i] + bn * Vroot[i] * Vroot[i] + cn * Vroot[i] + dn; + double res2 = an * Vroot[i] * Vroot[i] * Vroot[i] + bn * Vroot[i] * Vroot[i] + cn * Vroot[i] + dn; if (fabs(res2) < fabs(res)) { continue; } else { diff --git a/src/thermo/SingleSpeciesTP.cpp b/src/thermo/SingleSpeciesTP.cpp index 37b42ae48..9782ea53b 100644 --- a/src/thermo/SingleSpeciesTP.cpp +++ b/src/thermo/SingleSpeciesTP.cpp @@ -35,11 +35,11 @@ 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; + 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; } diff --git a/src/thermo/SpeciesThermoFactory.cpp b/src/thermo/SpeciesThermoFactory.cpp index b46ffd869..53eac0431 100644 --- a/src/thermo/SpeciesThermoFactory.cpp +++ b/src/thermo/SpeciesThermoFactory.cpp @@ -337,7 +337,7 @@ static SpeciesThermoInterpType* newNasa9ThermoFromXML( } if (nRegions == 0) { throw CanteraError("newNasa9ThermoFromXML", "zero regions found"); - } else if (nRegions == 1) { + } else if (nRegions == 1) { return regionPtrs[0]; } else { return new Nasa9PolyMultiTempRegion(regionPtrs); diff --git a/src/thermo/SpeciesThermoInterpType.cpp b/src/thermo/SpeciesThermoInterpType.cpp index 2a88eebd2..5d6390852 100644 --- a/src/thermo/SpeciesThermoInterpType.cpp +++ b/src/thermo/SpeciesThermoInterpType.cpp @@ -86,49 +86,49 @@ void STITbyPDSS::initAllPtrs(size_t speciesIndex, VPSSMgr* vpssmgr_ptr, m_PDSS_ptr = PDSS_ptr; } -doublereal STITbyPDSS::minTemp() const +doublereal STITbyPDSS::minTemp() const { return m_PDSS_ptr->minTemp(); } -doublereal STITbyPDSS::maxTemp() const +doublereal STITbyPDSS::maxTemp() const { return m_PDSS_ptr->maxTemp(); } -doublereal STITbyPDSS::refPressure() const +doublereal STITbyPDSS::refPressure() const { return m_PDSS_ptr->refPressure(); } -int STITbyPDSS::reportType() const +int STITbyPDSS::reportType() const { return PDSS_TYPE; } -void STITbyPDSS::updateProperties(const doublereal* tempPoly, - doublereal* cp_R, doublereal* h_RT, - doublereal* s_R) const +void STITbyPDSS::updateProperties(const doublereal* tempPoly, + doublereal* cp_R, doublereal* h_RT, + doublereal* s_R) const { doublereal T = tempPoly[0]; updatePropertiesTemp(T, cp_R, h_RT, s_R); } -void STITbyPDSS::updatePropertiesTemp(const doublereal temp, - doublereal* cp_R, - doublereal* h_RT, - doublereal* s_R) const +void STITbyPDSS::updatePropertiesTemp(const doublereal temp, + doublereal* cp_R, + doublereal* h_RT, + doublereal* s_R) const { m_PDSS_ptr->setTemperature(temp); *h_RT = m_PDSS_ptr->enthalpy_RT_ref(); *cp_R = m_PDSS_ptr->cp_R_ref(); - *s_R = m_PDSS_ptr->entropy_R_ref(); + *s_R = m_PDSS_ptr->entropy_R_ref(); } -void STITbyPDSS::reportParameters(size_t& index, int& type, - doublereal& minTemp, doublereal& maxTemp, - doublereal& refPressure, - doublereal* const coeffs) const +void STITbyPDSS::reportParameters(size_t& index, int& type, + doublereal& minTemp, doublereal& maxTemp, + doublereal& refPressure, + doublereal* const coeffs) const { index = 0; type = PDSS_TYPE; diff --git a/src/thermo/StoichSubstance.cpp b/src/thermo/StoichSubstance.cpp index 685498ebe..e2486be45 100644 --- a/src/thermo/StoichSubstance.cpp +++ b/src/thermo/StoichSubstance.cpp @@ -28,11 +28,11 @@ StoichSubstance& StoichSubstance::operator=(const StoichSubstance& 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; + 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; } @@ -131,7 +131,7 @@ doublereal StoichSubstance::logStandardConc(size_t k) const return 0.0; } -void StoichSubstance::getStandardChemPotentials(doublereal* mu0) const +void StoichSubstance::getStandardChemPotentials(doublereal* mu0) const { mu0[0] = gibbs_mole(); } @@ -188,7 +188,7 @@ void StoichSubstance::getEntropy_R(doublereal* sr) const void StoichSubstance::getGibbs_RT(doublereal* grt) const { - grt[0] = gibbs_mole() / (GasConstant * temperature()); + grt[0] = gibbs_mole() / (GasConstant * temperature()); } void StoichSubstance::getPureGibbs(doublereal* gpure) const diff --git a/src/thermo/StoichSubstanceSSTP.cpp b/src/thermo/StoichSubstanceSSTP.cpp index 37bf736bd..584c3fafb 100644 --- a/src/thermo/StoichSubstanceSSTP.cpp +++ b/src/thermo/StoichSubstanceSSTP.cpp @@ -58,7 +58,7 @@ StoichSubstanceSSTP::StoichSubstanceSSTP(XML_Node& xmlphase, const std::string& importPhase(xmlphase, this); } -StoichSubstanceSSTP::StoichSubstanceSSTP(const StoichSubstanceSSTP& right) +StoichSubstanceSSTP::StoichSubstanceSSTP(const StoichSubstanceSSTP& right) { *this = right; } @@ -142,7 +142,7 @@ void StoichSubstanceSSTP::getStandardChemPotentials(doublereal* mu0) const void StoichSubstanceSSTP::getEnthalpy_RT(doublereal* hrt) const { getEnthalpy_RT_ref(hrt); - doublereal presCorrect = (m_press - m_p0) / molarDensity(); + doublereal presCorrect = (m_press - m_p0) / molarDensity(); hrt[0] += presCorrect / (GasConstant * temperature()); } diff --git a/src/thermo/SurfPhase.cpp b/src/thermo/SurfPhase.cpp index 780d5f05c..6df6468d5 100644 --- a/src/thermo/SurfPhase.cpp +++ b/src/thermo/SurfPhase.cpp @@ -1,7 +1,7 @@ /** * @file SurfPhase.cpp * Definitions for a simple thermodynamic model of a surface phase - * derived from ThermoPhase, assuming an ideal solution model + * derived from ThermoPhase, assuming an ideal solution model * (see \ref thermoprops and class * \link Cantera::SurfPhase SurfPhase\endlink). */ @@ -69,15 +69,15 @@ 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; + 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; } diff --git a/src/thermo/ThermoFactory.cpp b/src/thermo/ThermoFactory.cpp index d829e011a..c23d5594d 100644 --- a/src/thermo/ThermoFactory.cpp +++ b/src/thermo/ThermoFactory.cpp @@ -73,16 +73,16 @@ static string _types[] = {"IdealGas", "Incompressible", }; //! 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 - }; +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 + }; ThermoPhase* ThermoFactory::newThermoPhase(const std::string& model) { @@ -338,7 +338,7 @@ void importPhase(XML_Node& phase, ThermoPhase* th) } th->setNDim(idim); } else { - th->setNDim(3); // default + th->setNDim(3); // default } // Set equation of state parameters. The parameters are @@ -435,7 +435,7 @@ void importPhase(XML_Node& phase, ThermoPhase* th) // for those species in a single vector. This is where we decide what // species are to be included in the phase. // The logic is complicated enough that we put it in a separate routine. - std::vector spDataNodeList; + std::vector spDataNodeList; std::vector spNamesList; std::vector spRuleList; formSpeciesXMLNodeList(spDataNodeList, spNamesList, spRuleList, diff --git a/src/thermo/VPSSMgr.cpp b/src/thermo/VPSSMgr.cpp index 8f0ff8b86..50df91c95 100644 --- a/src/thermo/VPSSMgr.cpp +++ b/src/thermo/VPSSMgr.cpp @@ -62,7 +62,7 @@ VPSSMgr& VPSSMgr::operator=(const VPSSMgr& right) if (&right == this) { return *this; } - m_kk = right.m_kk; + 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" @@ -76,35 +76,35 @@ VPSSMgr& VPSSMgr::operator=(const VPSSMgr& right) * * 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; + 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; } @@ -369,7 +369,7 @@ void VPSSMgr::initThermoXML(XML_Node& phaseNode, const std::string& id) } } -void VPSSMgr::installSTSpecies(size_t k, const XML_Node& s, +void VPSSMgr::installSTSpecies(size_t k, const XML_Node& s, const XML_Node* phaseNode_ptr) { shared_ptr stit(newSpeciesThermoInterpType(s.child("thermo"))); diff --git a/src/thermo/VPSSMgrFactory.cpp b/src/thermo/VPSSMgrFactory.cpp index 31f8afb36..ead0cccdf 100644 --- a/src/thermo/VPSSMgrFactory.cpp +++ b/src/thermo/VPSSMgrFactory.cpp @@ -93,7 +93,7 @@ static void getVPSSMgrTypes(std::vector & spDataNodeList, ssModel == "constantVolume") { has_nasa_constVol++; } else if (ssModel == "temperature_polynomial" || - ssModel == "density_temperature_polynomial" || + ssModel == "density_temperature_polynomial" || ssModel == "constant") { has_other++; } else { @@ -109,7 +109,7 @@ static void getVPSSMgrTypes(std::vector & spDataNodeList, ssModel == "constantVolume") { has_shomate_constVol++; } else if (ssModel == "temperature_polynomial" || - ssModel == "density_temperature_polynomial" || + ssModel == "density_temperature_polynomial" || ssModel == "constant") { has_other++; } else { @@ -125,7 +125,7 @@ static void getVPSSMgrTypes(std::vector & spDataNodeList, ssModel == "constantVolume") { has_simple_constVol++; } else if (ssModel == "temperature_polynomial" || - ssModel == "density_temperature_polynomial" || + ssModel == "density_temperature_polynomial" || ssModel == "constant") { has_other++; } else { @@ -253,15 +253,15 @@ VPSSMgr* VPSSMgrFactory::newVPSSMgr(VPStandardStateTP* vp_ptr, if (iwater == 1) { if (ihptx == 0) { - if (inasaIG || ishomateIG || isimpleIG) { + if (inasaIG || ishomateIG || isimpleIG) { throw CanteraError("newVPSSMgr", "Ideal gas with liquid water"); } else { return new VPSSMgr_Water_ConstVol(vp_ptr, spth); } } else { - if (inasaIG || ishomateIG || isimpleIG) { + if (inasaIG || ishomateIG || isimpleIG) { throw CanteraError("newVPSSMgr", "Ideal gas with liquid water"); - } else if (inasaCV || ishomateCV || isimpleCV) { + } else if (inasaCV || ishomateCV || isimpleCV) { return new VPSSMgr_General(vp_ptr, spth); } else { return new VPSSMgr_Water_HKFT(vp_ptr, spth); diff --git a/src/thermo/VPSSMgrFactory.h b/src/thermo/VPSSMgrFactory.h index 795685308..808fad9a6 100644 --- a/src/thermo/VPSSMgrFactory.h +++ b/src/thermo/VPSSMgrFactory.h @@ -34,7 +34,7 @@ public: */ UnknownVPSSMgrModel(const std::string& proc, const std::string& VPSSMgrModel) : - CanteraError(proc, "Specified VPSSMgr model " + CanteraError(proc, "Specified VPSSMgr model " + VPSSMgrModel + " does not match any known type.") {} }; @@ -96,7 +96,7 @@ public: //! 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 + * standardState model attribute and converted to a VPSSMgr_enumType * type. * * @param ssModel String representing the VPSSMGr object diff --git a/src/thermo/VPSSMgr_ConstVol.cpp b/src/thermo/VPSSMgr_ConstVol.cpp index 8434c9d84..d4e183727 100644 --- a/src/thermo/VPSSMgr_ConstVol.cpp +++ b/src/thermo/VPSSMgr_ConstVol.cpp @@ -25,7 +25,7 @@ namespace Cantera VPSSMgr_ConstVol::VPSSMgr_ConstVol(VPStandardStateTP* vp_ptr, SpeciesThermo* spth) : VPSSMgr(vp_ptr, spth) { - m_useTmpRefStateStorage = true; + m_useTmpRefStateStorage = true; m_useTmpStandardStateStorage = true; } @@ -61,10 +61,10 @@ void VPSSMgr_ConstVol::_updateStandardStateThermo() doublereal del_pRT = (m_plast - m_p0) / (GasConstant * m_tlast); for (size_t k = 0; k < m_kk; k++) { - m_hss_RT[k] = m_h0_RT[k] + del_pRT * m_Vss[k]; - m_cpss_R[k] = m_cp0_R[k]; - m_sss_R[k] = m_s0_R[k]; - m_gss_RT[k] = m_hss_RT[k] - m_sss_R[k]; + m_hss_RT[k] = m_h0_RT[k] + del_pRT * m_Vss[k]; + m_cpss_R[k] = m_cp0_R[k]; + m_sss_R[k] = m_s0_R[k]; + m_gss_RT[k] = m_hss_RT[k] - m_sss_R[k]; // m_Vss[k] constant } } @@ -146,6 +146,6 @@ PDSS_enumType VPSSMgr_ConstVol::reportPDSSType(int k) const VPSSMgr_enumType VPSSMgr_ConstVol::reportVPSSMgrType() const { - return cVPSSMGR_CONSTVOL; + return cVPSSMGR_CONSTVOL; } } diff --git a/src/thermo/VPSSMgr_General.cpp b/src/thermo/VPSSMgr_General.cpp index dd7fccc80..30436d236 100644 --- a/src/thermo/VPSSMgr_General.cpp +++ b/src/thermo/VPSSMgr_General.cpp @@ -92,10 +92,10 @@ void VPSSMgr_General::_updateRefStateThermo() const PDSS* kPDSS = m_PDSS_ptrs[k]; kPDSS->setState_TP(m_tlast, m_plast); m_h0_RT[k] = kPDSS->enthalpy_RT_ref(); - m_s0_R[k] = kPDSS->entropy_R_ref(); + m_s0_R[k] = kPDSS->entropy_R_ref(); m_g0_RT[k] = m_h0_RT[k] - m_s0_R[k]; m_cp0_R[k] = kPDSS->cp_R_ref(); - m_V0[k] = kPDSS->molarVolume_ref(); + m_V0[k] = kPDSS->molarVolume_ref(); } } } @@ -106,10 +106,10 @@ void VPSSMgr_General::_updateStandardStateThermo() PDSS* kPDSS = m_PDSS_ptrs[k]; kPDSS->setState_TP(m_tlast, m_plast); m_hss_RT[k] = kPDSS->enthalpy_RT(); - m_sss_R[k] = kPDSS->entropy_R(); + m_sss_R[k] = kPDSS->entropy_R(); m_gss_RT[k] = m_hss_RT[k] - m_sss_R[k]; m_cpss_R[k] = kPDSS->cp_R(); - m_Vss[k] = kPDSS->molarVolume(); + m_Vss[k] = kPDSS->molarVolume(); } } @@ -128,7 +128,7 @@ void VPSSMgr_General::getGibbs_ref(doublereal* g) const PDSS* kPDSS = m_PDSS_ptrs[k]; kPDSS->setState_TP(m_tlast, m_plast); double h0_RT = kPDSS->enthalpy_RT_ref(); - double s0_R = kPDSS->entropy_R_ref(); + double s0_R = kPDSS->entropy_R_ref(); g[k] = GasConstant * m_tlast * (h0_RT - s0_R); } } @@ -216,10 +216,10 @@ PDSS* VPSSMgr_General::createInstallPDSS(size_t k, const XML_Node& speciesNode, PDSS_enumType VPSSMgr_General::reportPDSSType(int k) const { - return m_PDSS_ptrs[k]->reportPDSSType(); + return m_PDSS_ptrs[k]->reportPDSSType(); } -VPSSMgr_enumType VPSSMgr_General::reportVPSSMgrType() const +VPSSMgr_enumType VPSSMgr_General::reportVPSSMgrType() const { return cVPSSMGR_GENERAL; } diff --git a/src/thermo/VPSSMgr_IdealGas.cpp b/src/thermo/VPSSMgr_IdealGas.cpp index 049b41867..c63a507ac 100644 --- a/src/thermo/VPSSMgr_IdealGas.cpp +++ b/src/thermo/VPSSMgr_IdealGas.cpp @@ -71,9 +71,9 @@ void VPSSMgr_IdealGas::_updateStandardStateThermo() doublereal v = temperature() *GasConstant /m_plast; for (size_t k = 0; k < m_kk; k++) { - m_hss_RT[k] = m_h0_RT[k]; + m_hss_RT[k] = m_h0_RT[k]; m_cpss_R[k] = m_cp0_R[k]; - m_sss_R[k] = m_s0_R[k] - pp; + m_sss_R[k] = m_s0_R[k] - pp; m_gss_RT[k] = m_hss_RT[k] - m_sss_R[k]; m_Vss[k] = v; } diff --git a/src/thermo/VPSSMgr_Water_ConstVol.cpp b/src/thermo/VPSSMgr_Water_ConstVol.cpp index 75900a4f4..ff1db0dc9 100644 --- a/src/thermo/VPSSMgr_Water_ConstVol.cpp +++ b/src/thermo/VPSSMgr_Water_ConstVol.cpp @@ -30,7 +30,7 @@ VPSSMgr_Water_ConstVol::VPSSMgr_Water_ConstVol(VPStandardStateTP* vp_ptr, VPSSMgr(vp_ptr, spth), m_waterSS(0) { - m_useTmpRefStateStorage = true; + m_useTmpRefStateStorage = true; m_useTmpStandardStateStorage = true; } @@ -156,10 +156,10 @@ void VPSSMgr_Water_ConstVol::_updateRefStateThermo() const } m_waterSS->setState_TP(m_tlast, m_p0); m_h0_RT[0] = (m_waterSS->enthalpy_mole()) / (GasConstant * m_tlast); - m_s0_R[0] = (m_waterSS->entropy_mole()) / GasConstant; + m_s0_R[0] = (m_waterSS->entropy_mole()) / GasConstant; m_cp0_R[0] = (m_waterSS->cp_mole()) / GasConstant; m_g0_RT[0] = (m_hss_RT[0] - m_sss_R[0]); - m_V0[0] = m_vptp_ptr->molecularWeight(0) / (m_waterSS->density()); + m_V0[0] = m_vptp_ptr->molecularWeight(0) / (m_waterSS->density()); m_waterSS->setState_TP(m_tlast, m_plast); } @@ -168,10 +168,10 @@ void VPSSMgr_Water_ConstVol::_updateStandardStateThermo() doublereal del_pRT = (m_plast - OneAtm) / (GasConstant * m_tlast); for (size_t k = 1; k < m_kk; k++) { - m_hss_RT[k] = m_h0_RT[k] + del_pRT * m_Vss[k]; - m_cpss_R[k] = m_cp0_R[k]; - m_sss_R[k] = m_s0_R[k]; - m_gss_RT[k] = m_hss_RT[k] - m_sss_R[k]; + m_hss_RT[k] = m_h0_RT[k] + del_pRT * m_Vss[k]; + m_cpss_R[k] = m_cp0_R[k]; + m_sss_R[k] = m_s0_R[k]; + m_gss_RT[k] = m_hss_RT[k] - m_sss_R[k]; // m_Vss[k] constant PDSS* kPDSS = m_vptp_ptr->providePDSS(k); kPDSS->setState_TP(m_tlast, m_plast); @@ -179,10 +179,10 @@ void VPSSMgr_Water_ConstVol::_updateStandardStateThermo() // Do the water m_waterSS->setState_TP(m_tlast, m_plast); m_hss_RT[0] = (m_waterSS->enthalpy_mole()) / (GasConstant * m_tlast); - m_sss_R[0] = (m_waterSS->entropy_mole()) / GasConstant; - m_cpss_R[0] = (m_waterSS->cp_mole()) / GasConstant; + m_sss_R[0] = (m_waterSS->entropy_mole()) / GasConstant; + m_cpss_R[0] = (m_waterSS->cp_mole()) / GasConstant; m_gss_RT[0] = (m_hss_RT[0] - m_sss_R[0]); - m_Vss[0] = (m_vptp_ptr->molecularWeight(0) / m_waterSS->density()); + m_Vss[0] = (m_vptp_ptr->molecularWeight(0) / m_waterSS->density()); } void VPSSMgr_Water_ConstVol::initThermoXML(XML_Node& phaseNode, @@ -199,7 +199,7 @@ void VPSSMgr_Water_ConstVol::initThermoXML(XML_Node& phaseNode, } m_waterSS->setState_TP(300., OneAtm); - m_Vss[0] = (m_waterSS->density()) / m_vptp_ptr->molecularWeight(0); + m_Vss[0] = (m_waterSS->density()) / m_vptp_ptr->molecularWeight(0); for (size_t k = 1; k < m_kk; k++) { const XML_Node* s = speciesDB->findByAttr("name", m_vptp_ptr->speciesName(k)); diff --git a/src/thermo/VPSSMgr_Water_HKFT.cpp b/src/thermo/VPSSMgr_Water_HKFT.cpp index e37945103..47dd36854 100644 --- a/src/thermo/VPSSMgr_Water_HKFT.cpp +++ b/src/thermo/VPSSMgr_Water_HKFT.cpp @@ -33,7 +33,7 @@ VPSSMgr_Water_HKFT::VPSSMgr_Water_HKFT(VPStandardStateTP* vp_ptr, m_waterSS(0), m_tlastRef(-1.0) { - m_useTmpRefStateStorage = true; + m_useTmpRefStateStorage = true; m_useTmpStandardStateStorage = true; } @@ -142,19 +142,19 @@ void VPSSMgr_Water_HKFT::_updateRefStateThermo() const m_p0 = m_waterSS->pref_safe(m_tlast); m_waterSS->setState_TP(m_tlast, m_p0); m_h0_RT[0] = (m_waterSS->enthalpy_mole()) / (GasConstant * m_tlast); - m_s0_R[0] = (m_waterSS->entropy_mole()) / GasConstant; + m_s0_R[0] = (m_waterSS->entropy_mole()) / GasConstant; m_cp0_R[0] = (m_waterSS->cp_mole()) / GasConstant; m_g0_RT[0] = (m_hss_RT[0] - m_sss_R[0]); - m_V0[0] = (m_waterSS->density()) / m_vptp_ptr->molecularWeight(0); + m_V0[0] = (m_waterSS->density()) / m_vptp_ptr->molecularWeight(0); PDSS* ps; for (size_t k = 1; k < m_kk; k++) { ps = m_vptp_ptr->providePDSS(k); ps->setState_TP(m_tlast, m_p0); - m_cp0_R[k] = ps->cp_R(); - m_s0_R[k] = ps->entropy_mole() / GasConstant; - m_g0_RT[k] = ps->gibbs_RT(); - m_h0_RT[k] = m_g0_RT[k] + m_s0_R[k]; - m_V0[k] = ps->molarVolume(); + m_cp0_R[k] = ps->cp_R(); + m_s0_R[k] = ps->entropy_mole() / GasConstant; + m_g0_RT[k] = ps->gibbs_RT(); + m_h0_RT[k] = m_g0_RT[k] + m_s0_R[k]; + m_V0[k] = ps->molarVolume(); } m_waterSS->setState_TP(m_tlast, m_plast); @@ -169,19 +169,19 @@ void VPSSMgr_Water_HKFT::_updateStandardStateThermo() // Do the water m_waterSS->setState_TP(m_tlast, m_plast); m_hss_RT[0] = (m_waterSS->enthalpy_mole()) / (GasConstant * m_tlast); - m_sss_R[0] = (m_waterSS->entropy_mole()) / GasConstant; - m_cpss_R[0] = (m_waterSS->cp_mole()) / GasConstant; + m_sss_R[0] = (m_waterSS->entropy_mole()) / GasConstant; + m_cpss_R[0] = (m_waterSS->cp_mole()) / GasConstant; m_gss_RT[0] = (m_hss_RT[0] - m_sss_R[0]); - m_Vss[0] = (m_vptp_ptr->molecularWeight(0)) / (m_waterSS->density()); + m_Vss[0] = (m_vptp_ptr->molecularWeight(0)) / (m_waterSS->density()); for (size_t k = 1; k < m_kk; k++) { PDSS* ps = m_vptp_ptr->providePDSS(k); ps->setState_TP(m_tlast, m_plast); - m_cpss_R[k] = ps->cp_R(); - m_sss_R[k] = ps->entropy_R(); - m_gss_RT[k] = ps->gibbs_RT(); - m_hss_RT[k] = m_gss_RT[k] + m_sss_R[k]; - m_Vss[k] = ps->molarVolume(); + m_cpss_R[k] = ps->cp_R(); + m_sss_R[k] = ps->entropy_R(); + m_gss_RT[k] = ps->gibbs_RT(); + m_hss_RT[k] = m_gss_RT[k] + m_sss_R[k]; + m_Vss[k] = ps->molarVolume(); } } @@ -193,7 +193,7 @@ void VPSSMgr_Water_HKFT::initThermoXML(XML_Node& phaseNode, XML_Node* speciesDB = get_XML_NameID("speciesData", speciesList["datasrc"], &phaseNode.root()); m_waterSS->setState_TP(300., OneAtm); - m_Vss[0] = (m_waterSS->density()) / m_vptp_ptr->molecularWeight(0); + m_Vss[0] = (m_waterSS->density()) / m_vptp_ptr->molecularWeight(0); for (size_t k = 1; k < m_kk; k++) { string name = m_vptp_ptr->speciesName(k); diff --git a/src/thermo/VPStandardStateTP.cpp b/src/thermo/VPStandardStateTP.cpp index ffeac6cf7..4c293285a 100644 --- a/src/thermo/VPStandardStateTP.cpp +++ b/src/thermo/VPStandardStateTP.cpp @@ -52,10 +52,10 @@ VPStandardStateTP& VPStandardStateTP::operator=(const VPStandardStateTP& 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_Pcurrent = b.m_Pcurrent; + m_Tlast_ss = b.m_Tlast_ss; + m_Plast_ss = b.m_Plast_ss; + m_P0 = b.m_P0; /* * Duplicate the pdss objects @@ -309,7 +309,7 @@ void VPStandardStateTP::setState_TP(doublereal t, doublereal pres) calcDensity(); } -void VPStandardStateTP::createInstallPDSS(size_t k, const XML_Node& s, +void VPStandardStateTP::createInstallPDSS(size_t k, const XML_Node& s, const XML_Node* phaseNode_ptr) { if (m_PDSS_storage.size() < k+1) { diff --git a/src/thermo/WaterProps.cpp b/src/thermo/WaterProps.cpp index 3c01ccfa5..cc0c6dce1 100644 --- a/src/thermo/WaterProps.cpp +++ b/src/thermo/WaterProps.cpp @@ -126,7 +126,7 @@ doublereal WaterProps::density_T(doublereal T, doublereal P, int ifunc) return 0.0; } else if (ifunc == 2) { doublereal t3t3 = tmp3 * tmp3; - doublereal d2rhodT2 = 1000./U2 * + doublereal d2rhodT2 = 1000./U2 * ((-4.0*tmp4-2.0*tmp1)/tmp3 + (2.0*t4t4 + 4.0*tmp1*tmp4)/t3t3 - 2.0*tmp1 * t4t4/(t3t3*tmp3)); @@ -155,7 +155,7 @@ doublereal WaterProps::relEpsilon(doublereal T, doublereal P_pascal, doublereal Pbar = P_pascal * 1.0E-5; doublereal tmpBpar = B + Pbar; doublereal tmpB1000 = B + 1000.0; - doublereal ltmp = log(tmpBpar/tmpB1000); + doublereal ltmp = log(tmpBpar/tmpB1000); doublereal epsRel = eps1000 + C * ltmp; if (ifunc == 1 || ifunc == 2) { @@ -167,12 +167,12 @@ doublereal WaterProps::relEpsilon(doublereal T, doublereal P_pascal, if (ifunc == 1) { return deps1000dT + dCdT * ltmp + C * dltmpdT; } - doublereal T3 = T2 * T; + doublereal T3 = T2 * T; doublereal d2CdT2 = - 2.0 * dCdT / tmpC; - doublereal d2BdT2 = 2.0 * U8 / (T3); + doublereal d2BdT2 = 2.0 * U8 / (T3); doublereal d2ltmpdT2 = (d2BdT2*(1.0/tmpBpar - 1.0/tmpB1000) + dBdT*dBdT*(1.0/(tmpB1000*tmpB1000) - 1.0/(tmpBpar*tmpBpar))); - doublereal d2eps1000dT2 = (deps1000dT * (U2 + 2.0 * U3 * T) + eps1000 * (2.0 * U3)); + doublereal d2eps1000dT2 = (deps1000dT * (U2 + 2.0 * U3 * T) + eps1000 * (2.0 * U3)); if (ifunc == 2) { doublereal d2epsReldT2 = (d2eps1000dT2 + d2CdT2 * ltmp + 2.0 * dCdT * dltmpdT @@ -181,7 +181,7 @@ doublereal WaterProps::relEpsilon(doublereal T, doublereal P_pascal, } } if (ifunc == 3) { - doublereal dltmpdP = 1.0E-5 / tmpBpar; + doublereal dltmpdP = 1.0E-5 / tmpBpar; return C * dltmpdP; } return epsRel; @@ -219,7 +219,7 @@ doublereal WaterProps::ADebye(doublereal T, doublereal P_input, int ifunc) * calculate d(lnV)/dT _constantP, i.e., the cte */ doublereal cte = coeffThermalExp_IAPWS(T, P); - doublereal contrib2 = - A_Debye * (0.5 * cte); + doublereal contrib2 = - A_Debye * (0.5 * cte); dAdT += contrib2; if (ifunc == 1) { @@ -239,7 +239,7 @@ doublereal WaterProps::ADebye(doublereal T, doublereal P_input, int ifunc) (d2epsRelWaterdT2 - depsRelWaterdT * depsRelWaterdT / epsRelWater)); doublereal deltaT = -0.1; doublereal Tdel = T + deltaT; - doublereal cte_del = coeffThermalExp_IAPWS(Tdel, P); + doublereal cte_del = coeffThermalExp_IAPWS(Tdel, P); doublereal dctedT = (cte_del - cte) / Tdel; doublereal contrib3 = 0.5 * (-(dAdT * cte) -(A_Debye * dctedT)); d2AdT2 += contrib3; @@ -259,7 +259,7 @@ doublereal WaterProps::ADebye(doublereal T, doublereal P_input, int ifunc) if (ifunc == 3) { doublereal dAdP = 0.0; doublereal depsRelWaterdP = relEpsilon(T, P, 3); - dAdP -= A_Debye * (1.5 * depsRelWaterdP / epsRelWater); + dAdP -= A_Debye * (1.5 * depsRelWaterdP / epsRelWater); doublereal kappa = isothermalCompressibility_IAPWS(T,P); dAdP += A_Debye * (0.5 * kappa); return dAdP; @@ -313,13 +313,13 @@ static const doublereal Hij[6][7] = { { 0.1885447, 0.0 , 0., 0. , 0., 0., 0.}, }; -static const doublereal rhoStar = 317.763; // kg / m3 -static const doublereal presStar = 22.115E6; // Pa +static const doublereal rhoStar = 317.763; // kg / m3 +static const doublereal presStar = 22.115E6; // Pa doublereal WaterProps::viscosityWater() const { - static const doublereal TStar = 647.27; // Kelvin - static const doublereal muStar = 55.071E-6; //Pa s + static const doublereal TStar = 647.27; // Kelvin + static const doublereal muStar = 55.071E-6; //Pa s doublereal temp = m_waterIAPWS->temperature(); doublereal dens = m_waterIAPWS->density(); @@ -354,7 +354,7 @@ doublereal WaterProps::viscosityWater() const // Apply the near-critical point corrections if necessary doublereal mu2bar = 1.0; if (tbar >= 0.9970 && tbar <= 1.0082 && rhobar >= 0.755 && rhobar <= 1.290) { - doublereal drhodp = 1.0 / m_waterIAPWS->dpdrho(); + doublereal drhodp = 1.0 / m_waterIAPWS->dpdrho(); drhodp *= presStar / rhoStar; doublereal xsi = rhobar * drhodp; if (xsi >= 21.93) { @@ -414,7 +414,7 @@ doublereal WaterProps::thermalConductivityWater() const Lji[4][0]*rfac4 + Lji[4][1]*tfac1*rfac4 + Lji[4][2]*tfac2*rfac4 + Lji[5][0]*rfac5 + Lji[5][1]*tfac1*rfac5 + Lji[5][2]*tfac2*rfac5 ); - doublereal lambda1bar = exp(rhobar * sum); + doublereal lambda1bar = exp(rhobar * sum); doublereal mu0bar = std::sqrt(tbar) / (H[0] + H[1]/tbar + H[2]/tbar2 + H[3]/tbar3); doublereal tfac5 = tfac4 * tfac1; doublereal rfac6 = rfac5 * rfac1; @@ -428,7 +428,7 @@ doublereal WaterProps::thermalConductivityWater() const ); doublereal mu1bar = std::exp(rhobar * sum); doublereal t2r2 = tbar * tbar / (rhobar * rhobar); - doublereal drhodp = 1.0 / m_waterIAPWS->dpdrho(); + doublereal drhodp = 1.0 / m_waterIAPWS->dpdrho(); drhodp *= presStar / rhoStar; doublereal xsi = rhobar * drhodp; doublereal xsipow = std::pow(xsi, 0.4678); @@ -447,8 +447,8 @@ doublereal WaterProps::thermalConductivityWater() const */ doublereal beta = m_waterIAPWS->coeffPresExp(); doublereal dpdT_const_rho = beta * GasConstant * dens / 18.015268; - dpdT_const_rho *= Tstar / presstar; - doublereal lambda2bar = 0.0013848 / (mu0bar * mu1bar) * t2r2 * dpdT_const_rho * dpdT_const_rho * + dpdT_const_rho *= Tstar / presstar; + doublereal lambda2bar = 0.0013848 / (mu0bar * mu1bar) * t2r2 * dpdT_const_rho * dpdT_const_rho * xsipow * sqrt(rhobar) * exp(-18.66*temp2 - rho4); return (lambda0bar * lambda1bar + lambda2bar) * lambdastar; } diff --git a/src/thermo/WaterPropsIAPWS.cpp b/src/thermo/WaterPropsIAPWS.cpp index 38056de4a..b6b3a23ac 100644 --- a/src/thermo/WaterPropsIAPWS.cpp +++ b/src/thermo/WaterPropsIAPWS.cpp @@ -22,7 +22,7 @@ namespace Cantera const doublereal T_c = 647.096; //! Critical Pressure (Pascals) static const doublereal P_c = 22.064E6; -//! Value of the Density at the critical point (kg m-3) +//! Value of the Density at the critical point (kg m-3) const doublereal Rho_c = 322.; //! Molecular Weight of water that is consistent with the paper (kg kmol-1) static const doublereal M_water = 18.015268; @@ -34,7 +34,7 @@ static const doublereal M_water = 18.015268; * * The Ratio of R/M = 0.46151805 kJ kg-1 K-1 , which is Eqn. (6.3) in the paper. */ -static const doublereal Rgas = 8.314371E3; // Joules kmol-1 K-1 +static const doublereal Rgas = 8.314371E3; // Joules kmol-1 K-1 // Base constructor WaterPropsIAPWS::WaterPropsIAPWS() : @@ -92,7 +92,7 @@ void WaterPropsIAPWS::calcDim(doublereal temperature, doublereal rho) } } -doublereal WaterPropsIAPWS::helmholtzFE() const +doublereal WaterPropsIAPWS::helmholtzFE() const { doublereal retn = m_phi->phi(tau, delta); doublereal temperature = T_c/tau; @@ -100,7 +100,7 @@ doublereal WaterPropsIAPWS::helmholtzFE() const return retn * RT; } -doublereal WaterPropsIAPWS::pressure() const +doublereal WaterPropsIAPWS::pressure() const { doublereal retn = m_phi->pressureM_rhoRT(tau, delta); doublereal rho = delta * Rho_c; @@ -303,7 +303,7 @@ doublereal WaterPropsIAPWS::Gibbs() const return gRT * Rgas * temperature; } -void WaterPropsIAPWS::corr(doublereal temperature, doublereal pressure, +void WaterPropsIAPWS::corr(doublereal temperature, doublereal pressure, doublereal& densLiq, doublereal& densGas, doublereal& delGRT) { densLiq = density(temperature, pressure, WATER_LIQUID, densLiq); @@ -313,7 +313,7 @@ void WaterPropsIAPWS::corr(doublereal temperature, doublereal pressure, + fp2str(temperature) + " " + fp2str(pressure)); } setState_TR(temperature, densLiq); - doublereal gibbsLiqRT = m_phi->gibbs_RT(); + doublereal gibbsLiqRT = m_phi->gibbs_RT(); densGas = density(temperature, pressure, WATER_GAS, densGas); if (densGas <= 0.0) { @@ -476,13 +476,13 @@ doublereal WaterPropsIAPWS::densSpinodalWater() const slope = -dpdrho_new; // shouldn't be here for liquid spinodal } - doublereal delta_rho = - dpdrho_new / slope; + doublereal delta_rho = - dpdrho_new / slope; if (delta_rho > 0.0) { delta_rho = std::min(delta_rho, dens_new * 0.1); } else { delta_rho = std::max(delta_rho, - dens_new * 0.1); } - doublereal dens_est = dens_new + delta_rho; + doublereal dens_est = dens_new + delta_rho; if (dens_est < rho_low) { dens_est = 0.5 * (rho_low + dens_new); } @@ -499,7 +499,7 @@ doublereal WaterPropsIAPWS::densSpinodalWater() const dpdrho_new = dpdrho(); if (dpdrho_new > 0.0) { rho_high = std::min(dens_new, rho_high); - } else if (dpdrho_new < 0.0) { + } else if (dpdrho_new < 0.0) { rho_low = std::max(rho_low, dens_new); } else { conv = true; @@ -570,7 +570,7 @@ doublereal WaterPropsIAPWS::densSpinodalSteam() const } else { delta_rho = std::max(delta_rho, - dens_new * 0.1); } - doublereal dens_est = dens_new + delta_rho; + doublereal dens_est = dens_new + delta_rho; if (dens_est < rho_low) { dens_est = 0.5 * (rho_low + dens_new); } @@ -586,7 +586,7 @@ doublereal WaterPropsIAPWS::densSpinodalSteam() const dpdrho_new = dpdrho(); if (dpdrho_new < 0.0) { rho_high = std::min(dens_new, rho_high); - } else if (dpdrho_new > 0.0) { + } else if (dpdrho_new > 0.0) { rho_low = std::max(rho_low, dens_new); } else { conv = true; @@ -618,7 +618,7 @@ void WaterPropsIAPWS::setState_TR(doublereal temperature, doublereal rho) doublereal WaterPropsIAPWS::enthalpy() const { doublereal temperature = T_c/tau; - doublereal hRT = m_phi->enthalpy_RT(); + doublereal hRT = m_phi->enthalpy_RT(); return hRT * Rgas * temperature; } @@ -641,7 +641,7 @@ doublereal WaterPropsIAPWS::cv() const return cvR * Rgas; } -doublereal WaterPropsIAPWS::cp() const +doublereal WaterPropsIAPWS::cp() const { doublereal cpR = m_phi->cp_R(); return cpR * Rgas; diff --git a/src/thermo/WaterPropsIAPWSphi.cpp b/src/thermo/WaterPropsIAPWSphi.cpp index 401e1a574..74de71723 100644 --- a/src/thermo/WaterPropsIAPWSphi.cpp +++ b/src/thermo/WaterPropsIAPWSphi.cpp @@ -31,8 +31,8 @@ using std::fabs; * in dimensionless units. */ // \cond -static const doublereal T_c = 647.096; // Kelvin -static const doublereal Rho_c = 322.; // kg m-3 +static const doublereal T_c = 647.096; // Kelvin +static const doublereal Rho_c = 322.; // kg m-3 // \endcond /* @@ -44,10 +44,10 @@ static const doublereal Rho_c = 322.; // kg m-3 * There may be a slight error here somehow. */ // \cond -static const doublereal ni0[9] = { +static const doublereal ni0[9] = { 0.0, -8.32044648201 - 0.000000001739715, - 6.6832105268 + 0.000000000793232, + 6.6832105268 + 0.000000000793232, 3.00632, 0.012436, 0.97315, @@ -56,7 +56,7 @@ static const doublereal ni0[9] = { 0.24873 }; -static const doublereal gammi0[9] = { +static const doublereal gammi0[9] = { 0.0, 0.0, 0.0, @@ -69,81 +69,81 @@ static const doublereal gammi0[9] = { }; static const int ciR[56] = { - 0, // 0 - 0, // 1 + 0, // 0 + 0, // 1 0, 0, 0, - 0, // 5 + 0, // 5 0, 0, 1, 1, - 1, // 10 + 1, // 10 1, 1, 1, 1, - 1, // 15 + 1, // 15 1, 1, 1, 1, - 1, // 20 + 1, // 20 1, 1, 2, 2, - 2, // 25 + 2, // 25 2, 2, 2, 2, - 2, // 30 + 2, // 30 2, 2, 2, 2, - 2, // 35 + 2, // 35 2, 2, 2, 2, - 2, // 40 + 2, // 40 2, 2, 3, 3, - 3, // 45 + 3, // 45 3, 4, 6, 6, - 6, // 50 + 6, // 50 6, 0, 0, 0, - 0 // 55 + 0 // 55 }; static const int diR[55] = { - 0, // 0 - 1, // 1 + 0, // 0 + 1, // 1 1, 1, 2, - 2, // 5 + 2, // 5 3, 4, 1, 1, - 1, // 10 + 1, // 10 2, 2, 3, 4, - 4, // 15 + 4, // 15 5, 7, 9, @@ -153,17 +153,17 @@ static const int diR[55] = { 15, 1, 2, - 2, // 25 + 2, // 25 2, 3, 4, 4, - 4, // 30 + 4, // 30 5, 6, 6, 7, - 9, // 35 + 9, // 35 9, 9, 9, @@ -173,28 +173,28 @@ static const int diR[55] = { 12, 3, 4, - 4, // 45 + 4, // 45 5, 14, 3, 6, - 6, // 50 + 6, // 50 6, 3, 3, - 3 // 54 + 3 // 54 }; static const int tiR[55] = { - 0, // 0 - 0, // 1 + 0, // 0 + 0, // 1 0, 0, 0, - 0, // 5 + 0, // 5 0, 0, - 4, // 8 + 4, // 8 6, 12, // 10 1, @@ -206,22 +206,22 @@ static const int tiR[55] = { 3, 4, 11, - 4, // 20 + 4, // 20 13, 1, 7, 1, - 9, // 25 + 9, // 25 10, 10, 3, 7, - 10, // 30 + 10, // 30 10, 6, 10, 10, - 1, // 35 + 1, // 35 2, 3, 4, @@ -231,33 +231,33 @@ static const int tiR[55] = { 8, 16, 22, - 23, // 45 + 23, // 45 23, 10, 50, 44, - 46, // 50 + 46, // 50 50, 0, 1, - 4 // 54 + 4 // 54 }; -static const doublereal ni[57] = { +static const doublereal ni[57] = { +0.0, +0.12533547935523E-1, // 1 - +0.78957634722828E1, // 2 - -0.87803203303561E1, // 3 - +0.31802509345418E0, // 4 - -0.26145533859358E0, // 5 + +0.78957634722828E1, // 2 + -0.87803203303561E1, // 3 + +0.31802509345418E0, // 4 + -0.26145533859358E0, // 5 -0.78199751687981E-2, // 6 +0.88089493102134E-2, // 7 - -0.66856572307965E0, // 8 - +0.20433810950965, // 9 + -0.66856572307965E0, // 8 + +0.20433810950965, // 9 -0.66212605039687E-4, // 10 - -0.19232721156002E0, // 11 - -0.25709043003438E0, // 12 - +0.16074868486251E0, // 13 + -0.19232721156002E0, // 11 + -0.25709043003438E0, // 12 + +0.16074868486251E0, // 13 -0.40092828925807E-1, // 14 +0.39343422603254E-6, // 15 -0.75941377088144E-5, // 16 @@ -267,17 +267,17 @@ static const doublereal ni[57] = { +0.36582165144204E-6, // 20 -0.13251180074668E-11,// 21 -0.62639586912454E-9, // 22 - -0.10793600908932E0, // 23 + -0.10793600908932E0, // 23 +0.17611491008752E-1, // 24 - +0.22132295167546E0, // 25 - -0.40247669763528E0, // 26 - +0.58083399985759E0, // 27 + +0.22132295167546E0, // 25 + -0.40247669763528E0, // 26 + +0.58083399985759E0, // 27 +0.49969146990806E-2, // 28 -0.31358700712549E-1, // 29 - -0.74315929710341E0, // 30 - +0.47807329915480E0, // 31 + -0.74315929710341E0, // 30 + +0.47807329915480E0, // 31 +0.20527940895948E-1, // 32 - -0.13636435110343E0, // 33 + -0.13636435110343E0, // 33 +0.14180634400617E-1, // 34 +0.83326504880713E-2, // 35 -0.29052336009585E-1, // 36 @@ -293,71 +293,71 @@ static const doublereal ni[57] = { +0.22446277332006E-1, // 46 -0.62689710414685E-4, // 47 -0.55711118565645E-9, // 48 - -0.19905718354408E0, // 49 - +0.31777497330738E0, // 50 - -0.11841182425981E0, // 51 - -0.31306260323435E2, // 52 - +0.31546140237781E2, // 53 - -0.25213154341695E4, // 54 - -0.14874640856724E0, // 55 - +0.31806110878444E0 // 56 + -0.19905718354408E0, // 49 + +0.31777497330738E0, // 50 + -0.11841182425981E0, // 51 + -0.31306260323435E2, // 52 + +0.31546140237781E2, // 53 + -0.25213154341695E4, // 54 + -0.14874640856724E0, // 55 + +0.31806110878444E0 // 56 }; -static const doublereal alphai[3] = { +static const doublereal alphai[3] = { +20., +20., +20. }; -static const doublereal betai[3] = { +static const doublereal betai[3] = { +150., +150., +250. }; -static const doublereal gammai[3] = { +static const doublereal gammai[3] = { +1.21, +1.21, +1.25 }; -static const doublereal epsi[3] = { +static const doublereal epsi[3] = { +1.0, +1.0, +1.0 }; -static const doublereal ai[2] = { +static const doublereal ai[2] = { +3.5, +3.5 }; -static const doublereal bi[2] = { +static const doublereal bi[2] = { +0.85, +0.95 }; -static const doublereal Bi[2] = { +static const doublereal Bi[2] = { +0.2, +0.2 }; -static const doublereal Ci[2] = { +static const doublereal Ci[2] = { +28.0, +32.0 }; -static const doublereal Di[2] = { +static const doublereal Di[2] = { +700., +800. }; -static const doublereal Ai[2] = { +static const doublereal Ai[2] = { +0.32, +0.32 }; -static const doublereal Bbetai[2] = { +static const doublereal Bbetai[2] = { +0.3, +0.3 }; @@ -376,51 +376,51 @@ WaterPropsIAPWSphi::WaterPropsIAPWSphi() : } } -void WaterPropsIAPWSphi::intCheck(doublereal tau, doublereal delta) +void WaterPropsIAPWSphi::intCheck(doublereal tau, doublereal delta) { tdpolycalc(tau, delta); - doublereal nau = phi0(); - doublereal res = phiR(); - doublereal res_d = phiR_d(); - doublereal nau_d = phi0_d(); - doublereal res_dd = phiR_dd(); - doublereal nau_dd = phi0_dd(); - doublereal res_t = phiR_t(); - doublereal nau_t = phi0_t(); - doublereal res_tt = phiR_tt(); - doublereal nau_tt = phi0_tt(); - doublereal res_dt = phiR_dt(); - doublereal nau_dt = phi0_dt(); + doublereal nau = phi0(); + doublereal res = phiR(); + doublereal res_d = phiR_d(); + doublereal nau_d = phi0_d(); + doublereal res_dd = phiR_dd(); + doublereal nau_dd = phi0_dd(); + doublereal res_t = phiR_t(); + doublereal nau_t = phi0_t(); + doublereal res_tt = phiR_tt(); + doublereal nau_tt = phi0_tt(); + doublereal res_dt = phiR_dt(); + doublereal nau_dt = phi0_dt(); - std::printf("nau = %20.12e\t\tres = %20.12e\n", nau, res); - std::printf("nau_d = %20.12e\t\tres_d = %20.12e\n", nau_d, res_d); + std::printf("nau = %20.12e\t\tres = %20.12e\n", nau, res); + std::printf("nau_d = %20.12e\t\tres_d = %20.12e\n", nau_d, res_d); printf("nau_dd = %20.12e\t\tres_dd = %20.12e\n", nau_dd, res_dd); - printf("nau_t = %20.12e\t\tres_t = %20.12e\n", nau_t, res_t); + printf("nau_t = %20.12e\t\tres_t = %20.12e\n", nau_t, res_t); printf("nau_tt = %20.12e\t\tres_tt = %20.12e\n", nau_tt, res_tt); printf("nau_dt = %20.12e\t\tres_dt = %20.12e\n", nau_dt, res_dt); } void WaterPropsIAPWSphi::check1() { - doublereal T = 500.; - doublereal rho = 838.025; - doublereal tau = T_c/T; - doublereal delta = rho / Rho_c; + doublereal T = 500.; + doublereal rho = 838.025; + doublereal tau = T_c/T; + doublereal delta = rho / Rho_c; printf(" T = 500 K, rho = 838.025 kg m-3\n"); intCheck(tau, delta); } void WaterPropsIAPWSphi::check2() { - doublereal T = 647; - doublereal rho = 358.0; - doublereal tau = T_c/T; - doublereal delta = rho / Rho_c; + doublereal T = 647; + doublereal rho = 358.0; + doublereal tau = T_c/T; + doublereal delta = rho / Rho_c; printf(" T = 647 K, rho = 358.0 kg m-3\n"); intCheck(tau, delta); } -void WaterPropsIAPWSphi::tdpolycalc(doublereal tau, doublereal delta) +void WaterPropsIAPWSphi::tdpolycalc(doublereal tau, doublereal delta) { if ((tau != TAUsave) || 1) { TAUsave = tau; @@ -439,11 +439,11 @@ void WaterPropsIAPWSphi::tdpolycalc(doublereal tau, doublereal delta) } } -doublereal WaterPropsIAPWSphi::phi0() const +doublereal WaterPropsIAPWSphi::phi0() const { - doublereal tau = TAUsave; - doublereal delta = DELTAsave; - doublereal retn = log(delta) + ni0[1] + ni0[2]*tau + ni0[3]*log(tau); + doublereal tau = TAUsave; + doublereal delta = DELTAsave; + doublereal retn = log(delta) + ni0[1] + ni0[2]*tau + ni0[3]*log(tau); retn += ni0[4] * log(1.0 - exp(-gammi0[4]*tau)); retn += ni0[5] * log(1.0 - exp(-gammi0[5]*tau)); @@ -453,23 +453,23 @@ doublereal WaterPropsIAPWSphi::phi0() const return retn; } -doublereal WaterPropsIAPWSphi::phiR() const +doublereal WaterPropsIAPWSphi::phiR() const { - doublereal tau = TAUsave; - doublereal delta = DELTAsave; + doublereal tau = TAUsave; + doublereal delta = DELTAsave; int i, j; /* * Write out the first seven polynomials in the expression */ - doublereal T375 = pow(tau, 0.375); - doublereal val = (ni[1] * delta / TAUsqrt + - ni[2] * delta * TAUsqrt * T375 + - ni[3] * delta * tau + - ni[4] * DELTAp[2] * TAUsqrt + - ni[5] * DELTAp[2] * T375 * T375 + - ni[6] * DELTAp[3] * T375 + - ni[7] * DELTAp[4] * tau); + doublereal T375 = pow(tau, 0.375); + doublereal val = (ni[1] * delta / TAUsqrt + + ni[2] * delta * TAUsqrt * T375 + + ni[3] * delta * tau + + ni[4] * DELTAp[2] * TAUsqrt + + ni[5] * DELTAp[2] * T375 * T375 + + ni[6] * DELTAp[3] * T375 + + ni[7] * DELTAp[4] * tau); /* * Next, do polynomial contributions 8 to 51 */ @@ -482,8 +482,8 @@ doublereal WaterPropsIAPWSphi::phiR() const */ for (j = 0; j < 3; j++) { i = 52 + j; - doublereal dtmp = delta - epsi[j]; - doublereal ttmp = tau - gammai[j]; + doublereal dtmp = delta - epsi[j]; + doublereal ttmp = tau - gammai[j]; val += (ni[i] * DELTAp[diR[i]] * TAUp[tiR[i]] * exp(-alphai[j]*dtmp*dtmp - betai[j]*ttmp*ttmp)); } @@ -493,50 +493,50 @@ doublereal WaterPropsIAPWSphi::phiR() const */ for (j = 0; j < 2; j++) { i = 55 + j; - doublereal deltam1 = delta - 1.0; - doublereal dtmp2 = deltam1 * deltam1; - doublereal atmp = 0.5 / Bbetai[j]; - doublereal theta = (1.0 - tau) + Ai[j] * pow(dtmp2, atmp); - doublereal triag = theta * theta + Bi[j] * pow(dtmp2, ai[j]); - doublereal ttmp = tau - 1.0; - doublereal triagtmp = pow(triag, bi[j]); - doublereal phi = exp(-Ci[j]*dtmp2 - Di[j]*ttmp*ttmp); + doublereal deltam1 = delta - 1.0; + doublereal dtmp2 = deltam1 * deltam1; + doublereal atmp = 0.5 / Bbetai[j]; + doublereal theta = (1.0 - tau) + Ai[j] * pow(dtmp2, atmp); + doublereal triag = theta * theta + Bi[j] * pow(dtmp2, ai[j]); + doublereal ttmp = tau - 1.0; + doublereal triagtmp = pow(triag, bi[j]); + doublereal phi = exp(-Ci[j]*dtmp2 - Di[j]*ttmp*ttmp); val += (ni[i] * triagtmp * delta * phi); } return val; } -doublereal WaterPropsIAPWSphi::phi(doublereal tau, doublereal delta) +doublereal WaterPropsIAPWSphi::phi(doublereal tau, doublereal delta) { tdpolycalc(tau, delta); - doublereal nau = phi0(); - doublereal res = phiR(); + doublereal nau = phi0(); + doublereal res = phiR(); return nau + res; } -doublereal WaterPropsIAPWSphi::phiR_d() const +doublereal WaterPropsIAPWSphi::phiR_d() const { - doublereal tau = TAUsave; - doublereal delta = DELTAsave; + doublereal tau = TAUsave; + doublereal delta = DELTAsave; int i, j; /* * Write out the first seven polynomials in the expression */ - doublereal T375 = pow(tau, 0.375); - doublereal val = (ni[1] / TAUsqrt + - ni[2] * TAUsqrt * T375 + - ni[3] * tau + - ni[4] * 2.0 * delta * TAUsqrt + - ni[5] * 2.0 * delta * T375 * T375 + - ni[6] * 3.0 * DELTAp[2] * T375 + - ni[7] * 4.0 * DELTAp[3] * tau); + doublereal T375 = pow(tau, 0.375); + doublereal val = (ni[1] / TAUsqrt + + ni[2] * TAUsqrt * T375 + + ni[3] * tau + + ni[4] * 2.0 * delta * TAUsqrt + + ni[5] * 2.0 * delta * T375 * T375 + + ni[6] * 3.0 * DELTAp[2] * T375 + + ni[7] * 4.0 * DELTAp[3] * tau); /* * Next, do polynomial contributions 8 to 51 */ for (i = 8; i <= 51; i++) { - val += ((ni[i] * exp(-DELTAp[ciR[i]]) * DELTAp[diR[i] - 1] * + val += ((ni[i] * exp(-DELTAp[ciR[i]]) * DELTAp[diR[i] - 1] * TAUp[tiR[i]]) * (diR[i] - ciR[i]* DELTAp[ciR[i]])); } @@ -545,9 +545,9 @@ doublereal WaterPropsIAPWSphi::phiR_d() const */ for (j = 0; j < 3; j++) { i = 52 + j; - doublereal dtmp = delta - epsi[j]; - doublereal ttmp = tau - gammai[j]; - doublereal tmp = (ni[i] * DELTAp[diR[i]] * TAUp[tiR[i]] * + doublereal dtmp = delta - epsi[j]; + doublereal ttmp = tau - gammai[j]; + doublereal tmp = (ni[i] * DELTAp[diR[i]] * TAUp[tiR[i]] * exp(-alphai[j]*dtmp*dtmp - betai[j]*ttmp*ttmp)); val += tmp * (diR[i]/delta - 2.0 * alphai[j] * dtmp); } @@ -557,72 +557,72 @@ doublereal WaterPropsIAPWSphi::phiR_d() const */ for (j = 0; j < 2; j++) { i = 55 + j; - doublereal deltam1 = delta - 1.0; - doublereal dtmp2 = deltam1 * deltam1; - doublereal atmp = 0.5 / Bbetai[j]; - doublereal theta = (1.0 - tau) + Ai[j] * pow(dtmp2, atmp); - doublereal triag = theta * theta + Bi[j] * pow(dtmp2, ai[j]); - doublereal ttmp = tau - 1.0; - doublereal triagtmp = pow(triag, bi[j]); - doublereal triagtmpm1 = pow(triag, bi[j]-1.0); - doublereal atmpM1 = atmp - 1.0; - doublereal ptmp = pow(dtmp2,atmpM1); - doublereal p2tmp = pow(dtmp2, ai[j]-1.0); - doublereal dtriagddelta = + doublereal deltam1 = delta - 1.0; + doublereal dtmp2 = deltam1 * deltam1; + doublereal atmp = 0.5 / Bbetai[j]; + doublereal theta = (1.0 - tau) + Ai[j] * pow(dtmp2, atmp); + doublereal triag = theta * theta + Bi[j] * pow(dtmp2, ai[j]); + doublereal ttmp = tau - 1.0; + doublereal triagtmp = pow(triag, bi[j]); + doublereal triagtmpm1 = pow(triag, bi[j]-1.0); + doublereal atmpM1 = atmp - 1.0; + doublereal ptmp = pow(dtmp2,atmpM1); + doublereal p2tmp = pow(dtmp2, ai[j]-1.0); + doublereal dtriagddelta = deltam1 *(Ai[j] * theta * 2.0 / Bbetai[j] * ptmp + 2.0*Bi[j]*ai[j]*p2tmp); - doublereal phi = exp(-Ci[j]*dtmp2 - Di[j]*ttmp*ttmp); - doublereal dphiddelta = -2.0*Ci[j]*deltam1*phi; - doublereal dtriagtmpddelta = bi[j] * triagtmpm1 * dtriagddelta; - doublereal tmp = ni[i] * (triagtmp * (phi + delta*dphiddelta) + + doublereal phi = exp(-Ci[j]*dtmp2 - Di[j]*ttmp*ttmp); + doublereal dphiddelta = -2.0*Ci[j]*deltam1*phi; + doublereal dtriagtmpddelta = bi[j] * triagtmpm1 * dtriagddelta; + doublereal tmp = ni[i] * (triagtmp * (phi + delta*dphiddelta) + dtriagtmpddelta * delta * phi); val += tmp; } return val; } -doublereal WaterPropsIAPWSphi::phi0_d() const +doublereal WaterPropsIAPWSphi::phi0_d() const { - doublereal delta = DELTAsave; + doublereal delta = DELTAsave; return 1.0/delta; } -doublereal WaterPropsIAPWSphi::phi_d(doublereal tau, doublereal delta) +doublereal WaterPropsIAPWSphi::phi_d(doublereal tau, doublereal delta) { tdpolycalc(tau, delta); - doublereal nau = phi0_d(); - doublereal res = phiR_d(); + doublereal nau = phi0_d(); + doublereal res = phiR_d(); return nau + res; } -doublereal WaterPropsIAPWSphi::pressureM_rhoRT(doublereal tau, doublereal delta) +doublereal WaterPropsIAPWSphi::pressureM_rhoRT(doublereal tau, doublereal delta) { tdpolycalc(tau, delta); - doublereal res = phiR_d(); + doublereal res = phiR_d(); return 1.0 + delta * res; } -doublereal WaterPropsIAPWSphi::phiR_dd() const +doublereal WaterPropsIAPWSphi::phiR_dd() const { - doublereal tau = TAUsave; - doublereal delta = DELTAsave; + doublereal tau = TAUsave; + doublereal delta = DELTAsave; int i, j; - doublereal atmp; + doublereal atmp; /* * Write out the first seven polynomials in the expression */ - doublereal T375 = pow(tau, 0.375); - doublereal val = (ni[4] * 2.0 * TAUsqrt + - ni[5] * 2.0 * T375 * T375 + - ni[6] * 6.0 * delta * T375 + - ni[7] * 12.0 * DELTAp[2] * tau); + doublereal T375 = pow(tau, 0.375); + doublereal val = (ni[4] * 2.0 * TAUsqrt + + ni[5] * 2.0 * T375 * T375 + + ni[6] * 6.0 * delta * T375 + + ni[7] * 12.0 * DELTAp[2] * tau); /* * Next, do polynomial contributions 8 to 51 */ for (i = 8; i <= 51; i++) { - doublereal dtmp = DELTAp[ciR[i]]; - doublereal tmp = ni[i] * exp(-dtmp) * TAUp[tiR[i]]; + doublereal dtmp = DELTAp[ciR[i]]; + doublereal tmp = ni[i] * exp(-dtmp) * TAUp[tiR[i]]; if (diR[i] == 1) { atmp = 1.0/delta; } else { @@ -638,14 +638,14 @@ doublereal WaterPropsIAPWSphi::phiR_dd() const */ for (j = 0; j < 3; j++) { i = 52 + j; - doublereal dtmp = delta - epsi[j]; - doublereal ttmp = tau - gammai[j]; - doublereal tmp = (ni[i] * TAUp[tiR[i]] * - exp(-alphai[j]*dtmp*dtmp - betai[j]*ttmp*ttmp)); - doublereal deltmp = DELTAp[diR[i]]; - doublereal deltmpM1 = deltmp/delta; - doublereal deltmpM2 = deltmpM1 / delta; - doublereal d2tmp = dtmp * dtmp; + doublereal dtmp = delta - epsi[j]; + doublereal ttmp = tau - gammai[j]; + doublereal tmp = (ni[i] * TAUp[tiR[i]] * + exp(-alphai[j]*dtmp*dtmp - betai[j]*ttmp*ttmp)); + doublereal deltmp = DELTAp[diR[i]]; + doublereal deltmpM1 = deltmp/delta; + doublereal deltmpM2 = deltmpM1 / delta; + doublereal d2tmp = dtmp * dtmp; val += tmp * (-2.0*alphai[j]*deltmp + 4.0 * alphai[j] * alphai[j] * deltmp * d2tmp - @@ -658,34 +658,34 @@ doublereal WaterPropsIAPWSphi::phiR_dd() const */ for (j = 0; j < 2; j++) { i = 55 + j; - doublereal deltam1 = delta - 1.0; - doublereal dtmp2 = deltam1 * deltam1; + doublereal deltam1 = delta - 1.0; + doublereal dtmp2 = deltam1 * deltam1; atmp = 0.5 / Bbetai[j]; - doublereal theta = (1.0 - tau) + Ai[j] * pow(dtmp2, atmp); - doublereal triag = theta * theta + Bi[j] * pow(dtmp2, ai[j]); - doublereal ttmp = tau - 1.0; - doublereal triagtmp = pow(triag, bi[j]); - doublereal triagtmpm1 = pow(triag, bi[j]-1.0); - doublereal atmpM1 = atmp - 1.0; - doublereal ptmp = pow(dtmp2,atmpM1); - doublereal p2tmp = pow(dtmp2, ai[j]-1.0); - doublereal dtriagddelta = + doublereal theta = (1.0 - tau) + Ai[j] * pow(dtmp2, atmp); + doublereal triag = theta * theta + Bi[j] * pow(dtmp2, ai[j]); + doublereal ttmp = tau - 1.0; + doublereal triagtmp = pow(triag, bi[j]); + doublereal triagtmpm1 = pow(triag, bi[j]-1.0); + doublereal atmpM1 = atmp - 1.0; + doublereal ptmp = pow(dtmp2,atmpM1); + doublereal p2tmp = pow(dtmp2, ai[j]-1.0); + doublereal dtriagddelta = deltam1 *(Ai[j] * theta * 2.0 / Bbetai[j] * ptmp + 2.0*Bi[j]*ai[j]*p2tmp); - doublereal phi = exp(-Ci[j]*dtmp2 - Di[j]*ttmp*ttmp); - doublereal dphiddelta = -2.0*Ci[j]*deltam1*phi; - doublereal dtriagtmpddelta = bi[j] * triagtmpm1 * dtriagddelta; - doublereal d2phiddelta2 = 2.0 * Ci[j] * phi * (2.0*Ci[j]*dtmp2 - 1.0); - doublereal pptmp = ptmp / dtmp2; - doublereal d2triagddelta2 = dtriagddelta / deltam1; + doublereal phi = exp(-Ci[j]*dtmp2 - Di[j]*ttmp*ttmp); + doublereal dphiddelta = -2.0*Ci[j]*deltam1*phi; + doublereal dtriagtmpddelta = bi[j] * triagtmpm1 * dtriagddelta; + doublereal d2phiddelta2 = 2.0 * Ci[j] * phi * (2.0*Ci[j]*dtmp2 - 1.0); + doublereal pptmp = ptmp / dtmp2; + doublereal d2triagddelta2 = dtriagddelta / deltam1; d2triagddelta2 += dtmp2 *(4.0*Bi[j]*ai[j]*(ai[j]-1.0)*pow(dtmp2,ai[j]-2.0) + 2.0*Ai[j]*Ai[j]/(Bbetai[j]*Bbetai[j])*ptmp*ptmp + Ai[j]*theta*4.0/Bbetai[j]*(atmp-1.0)*pptmp); - doublereal d2triagtmpd2delta = + doublereal d2triagtmpd2delta = bi[j] * (triagtmpm1 * d2triagddelta2 + (bi[j]-1.0)*triagtmpm1/triag*dtriagddelta*dtriagddelta); - doublereal ctmp = (triagtmp * (2.0*dphiddelta + delta*d2phiddelta2) + + doublereal ctmp = (triagtmp * (2.0*dphiddelta + delta*d2phiddelta2) + 2.0*dtriagtmpddelta*(phi + delta * dphiddelta) + d2triagtmpd2delta * delta * phi); val += ni[i] * ctmp; @@ -693,40 +693,40 @@ doublereal WaterPropsIAPWSphi::phiR_dd() const return val; } -doublereal WaterPropsIAPWSphi::phi0_dd() const +doublereal WaterPropsIAPWSphi::phi0_dd() const { - doublereal delta = DELTAsave; + doublereal delta = DELTAsave; return -1.0/(delta*delta); } -doublereal WaterPropsIAPWSphi::phi_dd(doublereal tau, doublereal delta) +doublereal WaterPropsIAPWSphi::phi_dd(doublereal tau, doublereal delta) { tdpolycalc(tau, delta); - doublereal nau = phi0_dd(); - doublereal res = phiR_dd(); + doublereal nau = phi0_dd(); + doublereal res = phiR_dd(); return nau + res; } -doublereal WaterPropsIAPWSphi::dimdpdrho(doublereal tau, doublereal delta) +doublereal WaterPropsIAPWSphi::dimdpdrho(doublereal tau, doublereal delta) { tdpolycalc(tau, delta); - doublereal res1 = phiR_d(); - doublereal res2 = phiR_dd(); + doublereal res1 = phiR_d(); + doublereal res2 = phiR_dd(); return 1.0 + delta * (2.0*res1 + delta*res2); } -doublereal WaterPropsIAPWSphi::dimdpdT(doublereal tau, doublereal delta) +doublereal WaterPropsIAPWSphi::dimdpdT(doublereal tau, doublereal delta) { tdpolycalc(tau, delta); - doublereal res1 = phiR_d(); - doublereal res2 = phiR_dt(); + doublereal res1 = phiR_d(); + doublereal res2 = phiR_dt(); return (1.0 + delta * res1) - tau * delta * (res2); } -doublereal WaterPropsIAPWSphi::phi0_t() const +doublereal WaterPropsIAPWSphi::phi0_t() const { - doublereal tau = TAUsave; - doublereal retn = ni0[2] + ni0[3]/tau; + doublereal tau = TAUsave; + doublereal retn = ni0[2] + ni0[3]/tau; retn += (ni0[4] * gammi0[4] * (1.0/(1.0 - exp(-gammi0[4]*tau)) - 1.0)); retn += (ni0[5] * gammi0[5] * (1.0/(1.0 - exp(-gammi0[5]*tau)) - 1.0)); retn += (ni0[6] * gammi0[6] * (1.0/(1.0 - exp(-gammi0[6]*tau)) - 1.0)); @@ -735,18 +735,18 @@ doublereal WaterPropsIAPWSphi::phi0_t() const return retn; } -doublereal WaterPropsIAPWSphi::phiR_t() const +doublereal WaterPropsIAPWSphi::phiR_t() const { - doublereal tau = TAUsave; - doublereal delta = DELTAsave; + doublereal tau = TAUsave; + doublereal delta = DELTAsave; int i, j; - doublereal atmp, tmp; + doublereal atmp, tmp; /* * Write out the first seven polynomials in the expression */ - doublereal T375 = pow(tau, 0.375); - doublereal val = ((-0.5) *ni[1] * delta / TAUsqrt / tau + + doublereal T375 = pow(tau, 0.375); + doublereal val = ((-0.5) *ni[1] * delta / TAUsqrt / tau + ni[2] * delta * 0.875 / TAUsqrt * T375 + ni[3] * delta + ni[4] * DELTAp[2] * 0.5 / TAUsqrt + @@ -766,8 +766,8 @@ doublereal WaterPropsIAPWSphi::phiR_t() const */ for (j = 0; j < 3; j++) { i = 52 + j; - doublereal dtmp = delta - epsi[j]; - doublereal ttmp = tau - gammai[j]; + doublereal dtmp = delta - epsi[j]; + doublereal ttmp = tau - gammai[j]; tmp = (ni[i] * DELTAp[diR[i]] * TAUp[tiR[i]] * exp(-alphai[j]*dtmp*dtmp - betai[j]*ttmp*ttmp)); val += tmp *(tiR[i]/tau - 2.0 * betai[j]*ttmp); @@ -778,34 +778,34 @@ doublereal WaterPropsIAPWSphi::phiR_t() const */ for (j = 0; j < 2; j++) { i = 55 + j; - doublereal deltam1 = delta - 1.0; - doublereal dtmp2 = deltam1 * deltam1; + doublereal deltam1 = delta - 1.0; + doublereal dtmp2 = deltam1 * deltam1; atmp = 0.5 / Bbetai[j]; - doublereal theta = (1.0 - tau) + Ai[j] * pow(dtmp2, atmp); - doublereal triag = theta * theta + Bi[j] * pow(dtmp2, ai[j]); - doublereal ttmp = tau - 1.0; - doublereal triagtmp = pow(triag, bi[j]); - doublereal phi = exp(-Ci[j]*dtmp2 - Di[j]*ttmp*ttmp); - doublereal dtriagtmpdtau = -2.0*theta * bi[j] * triagtmp / triag; - doublereal dphidtau = - 2.0 * Di[j] * ttmp * phi; + doublereal theta = (1.0 - tau) + Ai[j] * pow(dtmp2, atmp); + doublereal triag = theta * theta + Bi[j] * pow(dtmp2, ai[j]); + doublereal ttmp = tau - 1.0; + doublereal triagtmp = pow(triag, bi[j]); + doublereal phi = exp(-Ci[j]*dtmp2 - Di[j]*ttmp*ttmp); + doublereal dtriagtmpdtau = -2.0*theta * bi[j] * triagtmp / triag; + doublereal dphidtau = - 2.0 * Di[j] * ttmp * phi; val += ni[i] * delta * (dtriagtmpdtau * phi + triagtmp * dphidtau); } return val; } -doublereal WaterPropsIAPWSphi::phi_t(doublereal tau, doublereal delta) +doublereal WaterPropsIAPWSphi::phi_t(doublereal tau, doublereal delta) { tdpolycalc(tau, delta); - doublereal nau = phi0_t(); - doublereal res = phiR_t(); + doublereal nau = phi0_t(); + doublereal res = phiR_t(); return nau + res; } -doublereal WaterPropsIAPWSphi::phi0_tt() const +doublereal WaterPropsIAPWSphi::phi0_tt() const { - doublereal tau = TAUsave; - doublereal tmp, itmp; - doublereal retn = - ni0[3]/(tau * tau); + doublereal tau = TAUsave; + doublereal tmp, itmp; + doublereal retn = - ni0[3]/(tau * tau); for (int i = 4; i <= 8; i++) { tmp = exp(-gammi0[i]*tau); itmp = 1.0 - tmp; @@ -814,22 +814,22 @@ doublereal WaterPropsIAPWSphi::phi0_tt() const return retn; } -doublereal WaterPropsIAPWSphi::phiR_tt() const +doublereal WaterPropsIAPWSphi::phiR_tt() const { - doublereal tau = TAUsave; - doublereal delta = DELTAsave; + doublereal tau = TAUsave; + doublereal delta = DELTAsave; int i, j; - doublereal atmp, tmp; + doublereal atmp, tmp; /* * Write out the first seven polynomials in the expression */ - doublereal T375 = pow(tau, 0.375); - doublereal val = ((-0.5) * (-1.5) * ni[1] * delta / (TAUsqrt * tau * tau) + - ni[2] * delta * 0.875 * (-0.125) * T375 / (TAUsqrt * tau) + - ni[4] * DELTAp[2] * 0.5 * (-0.5)/ (TAUsqrt * tau) + - ni[5] * DELTAp[2] * 0.75 *(-0.25) * T375 * T375 / (tau * tau) + - ni[6] * DELTAp[3] * 0.375 *(-0.625) * T375 / (tau * tau)); + doublereal T375 = pow(tau, 0.375); + doublereal val = ((-0.5) * (-1.5) * ni[1] * delta / (TAUsqrt * tau * tau) + + ni[2] * delta * 0.875 * (-0.125) * T375 / (TAUsqrt * tau) + + ni[4] * DELTAp[2] * 0.5 * (-0.5)/ (TAUsqrt * tau) + + ni[5] * DELTAp[2] * 0.75 *(-0.25) * T375 * T375 / (tau * tau) + + ni[6] * DELTAp[3] * 0.375 *(-0.625) * T375 / (tau * tau)); /* * Next, do polynomial contributions 8 to 51 */ @@ -845,8 +845,8 @@ doublereal WaterPropsIAPWSphi::phiR_tt() const */ for (j = 0; j < 3; j++) { i = 52 + j; - doublereal dtmp = delta - epsi[j]; - doublereal ttmp = tau - gammai[j]; + doublereal dtmp = delta - epsi[j]; + doublereal ttmp = tau - gammai[j]; tmp = (ni[i] * DELTAp[diR[i]] * TAUp[tiR[i]] * exp(-alphai[j]*dtmp*dtmp - betai[j]*ttmp*ttmp)); atmp = tiR[i]/tau - 2.0 * betai[j]*ttmp; @@ -858,21 +858,21 @@ doublereal WaterPropsIAPWSphi::phiR_tt() const */ for (j = 0; j < 2; j++) { i = 55 + j; - doublereal deltam1 = delta - 1.0; - doublereal dtmp2 = deltam1 * deltam1; + doublereal deltam1 = delta - 1.0; + doublereal dtmp2 = deltam1 * deltam1; atmp = 0.5 / Bbetai[j]; - doublereal theta = (1.0 - tau) + Ai[j] * pow(dtmp2, atmp); - doublereal triag = theta * theta + Bi[j] * pow(dtmp2, ai[j]); - doublereal ttmp = tau - 1.0; - doublereal triagtmp = pow(triag, bi[j]); - doublereal triagtmpM1 = triagtmp / triag; - doublereal phi = exp(-Ci[j]*dtmp2 - Di[j]*ttmp*ttmp); - doublereal dtriagtmpdtau = -2.0*theta * bi[j] * triagtmp / triag; - doublereal dphidtau = - 2.0 * Di[j] * ttmp * phi; - doublereal d2triagtmpdtau2 = + doublereal theta = (1.0 - tau) + Ai[j] * pow(dtmp2, atmp); + doublereal triag = theta * theta + Bi[j] * pow(dtmp2, ai[j]); + doublereal ttmp = tau - 1.0; + doublereal triagtmp = pow(triag, bi[j]); + doublereal triagtmpM1 = triagtmp / triag; + doublereal phi = exp(-Ci[j]*dtmp2 - Di[j]*ttmp*ttmp); + doublereal dtriagtmpdtau = -2.0*theta * bi[j] * triagtmp / triag; + doublereal dphidtau = - 2.0 * Di[j] * ttmp * phi; + doublereal d2triagtmpdtau2 = (2 * bi[j] * triagtmpM1 + - 4 * theta * theta * bi[j] * (bi[j]-1.0) * triagtmpM1 / triag); - doublereal d2phidtau2 = 2.0*Di[j]*phi *(2.0*Di[j]*ttmp*ttmp - 1.0); + 4 * theta * theta * bi[j] * (bi[j]-1.0) * triagtmpM1 / triag); + doublereal d2phidtau2 = 2.0*Di[j]*phi *(2.0*Di[j]*ttmp*ttmp - 1.0); tmp = (d2triagtmpdtau2 * phi + 2 * dtriagtmpdtau * dphidtau + triagtmp * d2phidtau2); @@ -882,41 +882,41 @@ doublereal WaterPropsIAPWSphi::phiR_tt() const return val; } -doublereal WaterPropsIAPWSphi::phi_tt(doublereal tau, doublereal delta) +doublereal WaterPropsIAPWSphi::phi_tt(doublereal tau, doublereal delta) { tdpolycalc(tau, delta); - doublereal nau = phi0_tt(); - doublereal res = phiR_tt(); + doublereal nau = phi0_tt(); + doublereal res = phiR_tt(); return nau + res; } -doublereal WaterPropsIAPWSphi::phi0_dt() const +doublereal WaterPropsIAPWSphi::phi0_dt() const { return 0.0; } -doublereal WaterPropsIAPWSphi::phiR_dt() const +doublereal WaterPropsIAPWSphi::phiR_dt() const { - doublereal tau = TAUsave; - doublereal delta = DELTAsave; + doublereal tau = TAUsave; + doublereal delta = DELTAsave; int i, j; - doublereal tmp; + doublereal tmp; /* * Write out the first seven polynomials in the expression */ - doublereal T375 = pow(tau, 0.375); - doublereal val = (ni[1] * (-0.5) / (TAUsqrt * tau) + - ni[2] * (0.875) * T375 / TAUsqrt + - ni[3] + - ni[4] * 2.0 * delta * (0.5) / TAUsqrt + - ni[5] * 2.0 * delta * (0.75) * T375 * T375 / tau + - ni[6] * 3.0 * DELTAp[2] * 0.375 * T375 / tau + - ni[7] * 4.0 * DELTAp[3]); + doublereal T375 = pow(tau, 0.375); + doublereal val = (ni[1] * (-0.5) / (TAUsqrt * tau) + + ni[2] * (0.875) * T375 / TAUsqrt + + ni[3] + + ni[4] * 2.0 * delta * (0.5) / TAUsqrt + + ni[5] * 2.0 * delta * (0.75) * T375 * T375 / tau + + ni[6] * 3.0 * DELTAp[2] * 0.375 * T375 / tau + + ni[7] * 4.0 * DELTAp[3]); /* * Next, do polynomial contributions 8 to 51 */ for (i = 8; i <= 51; i++) { - tmp = (ni[i] * tiR[i] * exp(-DELTAp[ciR[i]]) * DELTAp[diR[i] - 1] * + tmp = (ni[i] * tiR[i] * exp(-DELTAp[ciR[i]]) * DELTAp[diR[i] - 1] * TAUp[tiR[i] - 1]); val += tmp * (diR[i] - ciR[i] * DELTAp[ciR[i]]); } @@ -926,12 +926,12 @@ doublereal WaterPropsIAPWSphi::phiR_dt() const */ for (j = 0; j < 3; j++) { i = 52 + j; - doublereal dtmp = delta - epsi[j]; - doublereal ttmp = tau - gammai[j]; + doublereal dtmp = delta - epsi[j]; + doublereal ttmp = tau - gammai[j]; tmp = (ni[i] * DELTAp[diR[i]] * TAUp[tiR[i]] * exp(-alphai[j]*dtmp*dtmp - betai[j]*ttmp*ttmp)); val += tmp * ((diR[i]/delta - 2.0 * alphai[j] * dtmp) * - (tiR[i]/tau - 2.0 * betai[j] * ttmp)); + (tiR[i]/tau - 2.0 * betai[j] * ttmp)); } /* @@ -939,63 +939,63 @@ doublereal WaterPropsIAPWSphi::phiR_dt() const */ for (j = 0; j < 2; j++) { i = 55 + j; - doublereal deltam1 = delta - 1.0; - doublereal dtmp2 = deltam1 * deltam1; - doublereal atmp = 0.5 / Bbetai[j]; - doublereal theta = (1.0 - tau) + Ai[j] * pow(dtmp2, atmp); - doublereal triag = theta * theta + Bi[j] * pow(dtmp2, ai[j]); - doublereal ttmp = tau - 1.0; - doublereal triagtmp = pow(triag, bi[j]); - doublereal triagtmpm1 = pow(triag, bi[j]-1.0); - doublereal atmpM1 = atmp - 1.0; - doublereal ptmp = pow(dtmp2,atmpM1); - doublereal p2tmp = pow(dtmp2, ai[j]-1.0); - doublereal dtriagddelta = + doublereal deltam1 = delta - 1.0; + doublereal dtmp2 = deltam1 * deltam1; + doublereal atmp = 0.5 / Bbetai[j]; + doublereal theta = (1.0 - tau) + Ai[j] * pow(dtmp2, atmp); + doublereal triag = theta * theta + Bi[j] * pow(dtmp2, ai[j]); + doublereal ttmp = tau - 1.0; + doublereal triagtmp = pow(triag, bi[j]); + doublereal triagtmpm1 = pow(triag, bi[j]-1.0); + doublereal atmpM1 = atmp - 1.0; + doublereal ptmp = pow(dtmp2,atmpM1); + doublereal p2tmp = pow(dtmp2, ai[j]-1.0); + doublereal dtriagddelta = deltam1 *(Ai[j] * theta * 2.0 / Bbetai[j] * ptmp + 2.0*Bi[j]*ai[j]*p2tmp); - doublereal phi = exp(-Ci[j]*dtmp2 - Di[j]*ttmp*ttmp); - doublereal dphiddelta = -2.0*Ci[j]*deltam1*phi; - doublereal dtriagtmpddelta = bi[j] * triagtmpm1 * dtriagddelta; - doublereal dtriagtmpdtau = -2.0*theta * bi[j] * triagtmp / triag; - doublereal dphidtau = - 2.0 * Di[j] * ttmp * phi; - doublereal d2phiddeltadtau = 4.0 * Ci[j] * Di[j] * deltam1 * ttmp * phi; - doublereal d2triagtmpddeltadtau = + doublereal phi = exp(-Ci[j]*dtmp2 - Di[j]*ttmp*ttmp); + doublereal dphiddelta = -2.0*Ci[j]*deltam1*phi; + doublereal dtriagtmpddelta = bi[j] * triagtmpm1 * dtriagddelta; + doublereal dtriagtmpdtau = -2.0*theta * bi[j] * triagtmp / triag; + doublereal dphidtau = - 2.0 * Di[j] * ttmp * phi; + doublereal d2phiddeltadtau = 4.0 * Ci[j] * Di[j] * deltam1 * ttmp * phi; + doublereal d2triagtmpddeltadtau = (-Ai[j] * bi[j] * 2.0 / Bbetai[j] * triagtmpm1 * deltam1 * ptmp -2.0 * theta * bi[j] * (bi[j] - 1.0) * triagtmpm1 / triag * dtriagddelta); - doublereal tmp = ni[i] * (triagtmp * (dphidtau + delta*d2phiddeltadtau) + - delta * dtriagtmpddelta * dphidtau + - dtriagtmpdtau * (phi + delta * dphiddelta) + - d2triagtmpddeltadtau * delta * phi); + doublereal tmp = ni[i] * (triagtmp * (dphidtau + delta*d2phiddeltadtau) + + delta * dtriagtmpddelta * dphidtau + + dtriagtmpdtau * (phi + delta * dphiddelta) + + d2triagtmpddeltadtau * delta * phi); val += tmp; } return val; } -doublereal WaterPropsIAPWSphi::dfind(doublereal p_red, doublereal tau, doublereal deltaGuess) +doublereal WaterPropsIAPWSphi::dfind(doublereal p_red, doublereal tau, doublereal deltaGuess) { - doublereal dd = deltaGuess; + doublereal dd = deltaGuess; bool conv = false; - doublereal deldd = dd; - doublereal pcheck = 1.0E-30 + 1.0E-8 * p_red; + doublereal deldd = dd; + doublereal pcheck = 1.0E-30 + 1.0E-8 * p_red; for (int n = 0; n < 200; n++) { /* * Calculate the internal polynomials, and then calculate the * phi deriv functions needed by this routine. */ tdpolycalc(tau, dd); - doublereal q1 = phiR_d(); - doublereal q2 = phiR_dd(); + doublereal q1 = phiR_d(); + doublereal q2 = phiR_dd(); /* * Calculate the predicted reduced pressure, pred0, based on the * current tau and dd. */ - doublereal pred0 = dd + dd * dd * q1; + doublereal pred0 = dd + dd * dd * q1; /* * Calculate the derivative of the predicted reduced pressure * wrt the reduced density, dd, This is dpddelta */ - doublereal dpddelta = 1.0 + 2.0 * dd * q1 + dd * dd * q2; + doublereal dpddelta = 1.0 + 2.0 * dd * q1 + dd * dd * q2; /* * If dpddelta is negative, then we are in the middle of the * 2 phase region, beyond the stability curve. We need to adjust @@ -1021,7 +1021,7 @@ doublereal WaterPropsIAPWSphi::dfind(doublereal p_red, doublereal tau, double /* * Dampen and crop the update */ - doublereal dpdx = dpddelta; + doublereal dpdx = dpddelta; if (n < 10) { dpdx = dpddelta * 1.1; } @@ -1060,59 +1060,59 @@ doublereal WaterPropsIAPWSphi::dfind(doublereal p_red, doublereal tau, double return dd; } -doublereal WaterPropsIAPWSphi::gibbs_RT() const +doublereal WaterPropsIAPWSphi::gibbs_RT() const { - doublereal delta = DELTAsave; - doublereal rd = phiR_d(); + doublereal delta = DELTAsave; + doublereal rd = phiR_d(); return 1.0 + phi0() + phiR() + delta * rd; } -doublereal WaterPropsIAPWSphi::enthalpy_RT() const +doublereal WaterPropsIAPWSphi::enthalpy_RT() const { - doublereal delta = DELTAsave; - doublereal tau = TAUsave; - doublereal rd = phiR_d(); - doublereal nt = phi0_t(); - doublereal rt = phiR_t(); + doublereal delta = DELTAsave; + doublereal tau = TAUsave; + doublereal rd = phiR_d(); + doublereal nt = phi0_t(); + doublereal rt = phiR_t(); return 1.0 + tau * (nt + rt) + delta * rd; } -doublereal WaterPropsIAPWSphi::entropy_R() const +doublereal WaterPropsIAPWSphi::entropy_R() const { - doublereal tau = TAUsave; - doublereal nt = phi0_t(); - doublereal rt = phiR_t(); - doublereal p0 = phi0(); - doublereal pR = phiR(); + doublereal tau = TAUsave; + doublereal nt = phi0_t(); + doublereal rt = phiR_t(); + doublereal p0 = phi0(); + doublereal pR = phiR(); return tau * (nt + rt) - p0 - pR; } -doublereal WaterPropsIAPWSphi::intEnergy_RT() const +doublereal WaterPropsIAPWSphi::intEnergy_RT() const { - doublereal tau = TAUsave; - doublereal nt = phi0_t(); - doublereal rt = phiR_t(); + doublereal tau = TAUsave; + doublereal nt = phi0_t(); + doublereal rt = phiR_t(); return tau * (nt + rt); } -doublereal WaterPropsIAPWSphi::cv_R() const +doublereal WaterPropsIAPWSphi::cv_R() const { - doublereal tau = TAUsave; - doublereal ntt = phi0_tt(); - doublereal rtt = phiR_tt(); + doublereal tau = TAUsave; + doublereal ntt = phi0_tt(); + doublereal rtt = phiR_tt(); return - tau * tau * (ntt + rtt); } -doublereal WaterPropsIAPWSphi::cp_R() const +doublereal WaterPropsIAPWSphi::cp_R() const { - doublereal tau = TAUsave; - doublereal delta = DELTAsave; - doublereal cvR = cv_R(); - doublereal rd = phiR_d(); - doublereal rdd = phiR_dd(); - doublereal rdt = phiR_dt(); - doublereal num = (1.0 + delta * rd - delta * tau * rdt); - doublereal cpR = cvR + (num * num / + doublereal tau = TAUsave; + doublereal delta = DELTAsave; + doublereal cvR = cv_R(); + doublereal rd = phiR_d(); + doublereal rdd = phiR_dd(); + doublereal rdt = phiR_dt(); + doublereal num = (1.0 + delta * rd - delta * tau * rdt); + doublereal cpR = cvR + (num * num / (1.0 + 2.0 * delta * rd + delta * delta * rdd)); return cpR; } diff --git a/src/thermo/WaterSSTP.cpp b/src/thermo/WaterSSTP.cpp index 071b7e0ab..f6fc66c74 100644 --- a/src/thermo/WaterSSTP.cpp +++ b/src/thermo/WaterSSTP.cpp @@ -1,6 +1,6 @@ /** * @file WaterSSTP.cpp - * Definitions for a ThermoPhase class consisting of pure water (see \ref thermoprops + * Definitions for a ThermoPhase class consisting of pure water (see \ref thermoprops * and class \link Cantera::WaterSSTP WaterSSTP\endlink). */ /* @@ -65,7 +65,7 @@ WaterSSTP::WaterSSTP(const WaterSSTP& b) : m_allowGasPhase(b.m_allowGasPhase) { m_sub = new WaterPropsIAPWS(*(b.m_sub)); - m_waterProps = new WaterProps(m_sub); + m_waterProps = new WaterProps(m_sub); /* * Use the assignment operator to do the brunt @@ -154,12 +154,12 @@ void WaterSSTP::initThermoXML(XML_Node& phaseNode, const std::string& id) setTemperature(T); SW_Offset = 0.0; doublereal s = entropy_mole(); - s -= GasConstant * log(oneBar/presLow); + s -= GasConstant * log(oneBar/presLow); if (s != 188.835E3) { SW_Offset = 188.835E3 - s; } s = entropy_mole(); - s -= GasConstant * log(oneBar/presLow); + s -= GasConstant * log(oneBar/presLow); doublereal h = enthalpy_mole(); if (h != -241.826E6) { @@ -175,7 +175,7 @@ void WaterSSTP::initThermoXML(XML_Node& phaseNode, const std::string& id) double rho0 = m_sub->density(298.15, OneAtm, WATER_LIQUID); setDensity(rho0); - m_waterProps = new WaterProps(m_sub); + m_waterProps = new WaterProps(m_sub); /* * We have to do something with the thermo function here. diff --git a/src/tpx/CarbonDioxide.cpp b/src/tpx/CarbonDioxide.cpp index 3fd457744..d8b56bd14 100644 --- a/src/tpx/CarbonDioxide.cpp +++ b/src/tpx/CarbonDioxide.cpp @@ -16,18 +16,18 @@ namespace tpx /* * Carbon Dioxide constants */ -static const double Tmn = 216.54; // [K] minimum temperature for which calculations are valid -static const double Tmx = 1500.0; // [K] maximum temperature for which calculations are valid -static const double Tc=304.21; // [K] critical temperature -static const double Roc=464.00; // [kg/m^3] critical density -static const double To=216.54; // [K] reference Temperature -static const double R=188.918; // [] gas constant for CO2 J/kg/K -static const double Gamma=5.0E-6; // [??] -static const double u0=3.2174105E5; // [] internal energy at To -static const double s0=2.1396056E3; // [] entropy at To -static const double Tp=250; // [K] ?? -static const double Pc=7.38350E6; // [Pa] critical pressure -static const double M=44.01; // [kg/kmol] molar density +static const double Tmn = 216.54; // [K] minimum temperature for which calculations are valid +static const double Tmx = 1500.0; // [K] maximum temperature for which calculations are valid +static const double Tc=304.21; // [K] critical temperature +static const double Roc=464.00; // [kg/m^3] critical density +static const double To=216.54; // [K] reference Temperature +static const double R=188.918; // [] gas constant for CO2 J/kg/K +static const double Gamma=5.0E-6; // [??] +static const double u0=3.2174105E5; // [] internal energy at To +static const double s0=2.1396056E3; // [] entropy at To +static const double Tp=250; // [K] ?? +static const double Pc=7.38350E6; // [Pa] critical pressure +static const double M=44.01; // [kg/kmol] molar density // array Acarbdi is used by the function named Pp static const double Acarbdi[]= { @@ -87,31 +87,31 @@ static const double G[]= { double CarbonDioxide::C(int j,double Tinverse, double T2inverse, double T3inverse, double T4inverse) { switch (j) { - case 0 : - return Acarbdi[0]*T + - Acarbdi[1] + - Acarbdi[2] * Tinverse + - Acarbdi[3] * T2inverse + - Acarbdi[4] * T3inverse ; - case 1 : - return Acarbdi[5] *T + - Acarbdi[6] + - Acarbdi[7] * Tinverse ; - case 2 : + case 0: + return Acarbdi[0]*T + + Acarbdi[1] + + Acarbdi[2] * Tinverse + + Acarbdi[3] * T2inverse + + Acarbdi[4] * T3inverse; + case 1: + return Acarbdi[5] *T + + Acarbdi[6] + + Acarbdi[7] * Tinverse; + case 2: return Acarbdi[8]*T + Acarbdi[9]; - case 3 : - return Acarbdi[10]*T + Acarbdi[11]; - case 4 : + case 3: + return Acarbdi[10]*T + Acarbdi[11]; + case 4: return Acarbdi[12]; - case 5 : - return Acarbdi[13] *T2inverse + - Acarbdi[14] *T3inverse + - Acarbdi[15] *T4inverse; - case 6 : - return Acarbdi[16] *T2inverse + - Acarbdi[17] *T3inverse + - Acarbdi[18] *T4inverse; - default : + case 5: + return Acarbdi[13] *T2inverse + + Acarbdi[14] *T3inverse + + Acarbdi[15] *T4inverse; + case 6: + return Acarbdi[16] *T2inverse + + Acarbdi[17] *T3inverse + + Acarbdi[18] *T4inverse; + default: return 0.0; } } @@ -119,31 +119,31 @@ double CarbonDioxide::C(int j,double Tinverse, double T2inverse, double T3invers inline double CarbonDioxide::Cprime(int j, double T2inverse, double T3inverse, double T4inverse) { switch (j) { - case 0 : - return Acarbdi[0] + - - Acarbdi[2] * T2inverse + - -2 * Acarbdi[3] * T3inverse + - -3 * Acarbdi[4] * T4inverse ; - case 1 : - return Acarbdi[5] - - Acarbdi[7] * T2inverse; - case 2 : - return Acarbdi[8] ; - case 3 : - return Acarbdi[10] ; - case 4 : - return 0; - case 5 : + case 0: + return Acarbdi[0] + + - Acarbdi[2] * T2inverse + + -2 * Acarbdi[3] * T3inverse + + -3 * Acarbdi[4] * T4inverse; + case 1: + return Acarbdi[5] - + Acarbdi[7] * T2inverse; + case 2: + return Acarbdi[8]; + case 3: + return Acarbdi[10]; + case 4: + return 0; + case 5: return - -2 *Acarbdi[13] *T3inverse + - -3 *Acarbdi[14] *T4inverse + + -2 *Acarbdi[13] *T3inverse + + -3 *Acarbdi[14] *T4inverse + -4 *Acarbdi[15]* pow(T,-5); - case 6 : + case 6: return - -2 *Acarbdi[16] *T3inverse + - -3 *Acarbdi[17] *T4inverse + + -2 *Acarbdi[16] *T3inverse + + -3 *Acarbdi[17] *T4inverse + -4 *Acarbdi[18] *pow(T,-5); - default : + default: return 0.0; } } diff --git a/src/tpx/CarbonDioxide.h b/src/tpx/CarbonDioxide.h index c0f88fbc7..371c496c7 100644 --- a/src/tpx/CarbonDioxide.h +++ b/src/tpx/CarbonDioxide.h @@ -56,13 +56,13 @@ private: double C(int jm, double, double, double, double); //! Derivative of C(i) - double Cprime(int i, double, double, double); + double Cprime(int i, double, double, double); /*! * I = integral from o-rho { 1/(rho^2) * H(i, rho) d rho } * ( see section 2 of Reynolds TPSI ) */ - double I(int i, double, double); + double I(int i, double, double); /*! * H returns a multiplier in each term of the sum in P-3. This is used in diff --git a/src/tpx/Heptane.cpp b/src/tpx/Heptane.cpp index b2c330354..25fb6f9a2 100644 --- a/src/tpx/Heptane.cpp +++ b/src/tpx/Heptane.cpp @@ -14,18 +14,18 @@ namespace tpx { // Heptane constants -static const double Tmn = 182.56; // [K] minimum temperature for which calculations are valid -static const double Tmx = 1000.0; // [K] maximum temperature for which calculations are valid -static const double Tc=537.68; // [K] critical temperature -static const double Roc=197.60; // [kg/m^3] critical density -static const double To=300; // [K] reference Temperature -static const double R=82.99504; // [J/(kg*K)] gas constant (for this substance) -static const double Gamma=9.611604E-6; // [??] -static const double u0=3.4058439E5; // [] internal energy at To -static const double s0=1.1080254E3; // [] entropy at To -static const double Tp=400; // [K] ?? -static const double Pc=2.6199E6; // [Pa] critical pressure -static const double M=100.20; // [kg/kmol] molar density +static const double Tmn = 182.56; // [K] minimum temperature for which calculations are valid +static const double Tmx = 1000.0; // [K] maximum temperature for which calculations are valid +static const double Tc=537.68; // [K] critical temperature +static const double Roc=197.60; // [kg/m^3] critical density +static const double To=300; // [K] reference Temperature +static const double R=82.99504; // [J/(kg*K)] gas constant (for this substance) +static const double Gamma=9.611604E-6; // [??] +static const double u0=3.4058439E5; // [] internal energy at To +static const double s0=1.1080254E3; // [] entropy at To +static const double Tp=400; // [K] ?? +static const double Pc=2.6199E6; // [Pa] critical pressure +static const double M=100.20; // [kg/kmol] molar density // array Ahept is used by the function Pp static const double Ahept[]= { @@ -76,41 +76,41 @@ static const double G[]= { double Heptane::C(int j,double Tinverse, double T2inverse, double T3inverse, double T4inverse) { switch (j) { - case 0 : - return Ahept[0] * R * T - - Ahept[1] - - Ahept[2] * T2inverse + - Ahept[3] * T3inverse - - Ahept[4] * T4inverse; - case 1 : - return Ahept[5] * R * T - - Ahept[6] - - Ahept[7] * Tinverse; - case 2 : - return Ahept[9] * (Ahept[6] + Ahept[7] * Tinverse); - case 3 : - return Ahept[8] * T2inverse; - default : - return 0.0; + case 0: + return Ahept[0] * R * T - + Ahept[1] - + Ahept[2] * T2inverse + + Ahept[3] * T3inverse - + Ahept[4] * T4inverse; + case 1: + return Ahept[5] * R * T - + Ahept[6] - + Ahept[7] * Tinverse; + case 2: + return Ahept[9] * (Ahept[6] + Ahept[7] * Tinverse); + case 3: + return Ahept[8] * T2inverse; + default: + return 0.0; } } inline double Heptane::Cprime(int j, double T2inverse, double T3inverse, double T4inverse) { switch (j) { - case 0 : - return Ahept[0] * R - - -2 * Ahept[2] * T3inverse + - -3 * Ahept[3] * T4inverse - - -4 * Ahept[4] * pow(T, -5.0); - case 1 : - return Ahept[5] * R - - -1 * Ahept[7] * T2inverse; - case 2 : - return Ahept[9] * (-1 * Ahept[7] * T2inverse); - case 3 : - return -2 * Ahept[8] * T3inverse; - default : + case 0: + return Ahept[0] * R - + -2 * Ahept[2] * T3inverse + + -3 * Ahept[3] * T4inverse - + -4 * Ahept[4] * pow(T, -5.0); + case 1: + return Ahept[5] * R - + -1 * Ahept[7] * T2inverse; + case 2: + return Ahept[9] * (-1 * Ahept[7] * T2inverse); + case 3: + return -2 * Ahept[8] * T3inverse; + default: return 0.0; } } diff --git a/src/tpx/Heptane.h b/src/tpx/Heptane.h index 19b0cea10..38f206442 100644 --- a/src/tpx/Heptane.h +++ b/src/tpx/Heptane.h @@ -54,13 +54,13 @@ private: double C(int jm, double, double, double, double); //! derivative of C(i) - double Cprime(int i, double, double, double); + double Cprime(int i, double, double, double); /*! * I = integral from o-rho { 1/(rho^2) * H(i, rho) d rho } * ( see section 2 of Reynolds TPSI ) */ - double I(int i, double, double); + double I(int i, double, double); /*! * H returns a multiplier in each term of the sum in P-2. diff --git a/src/tpx/Hydrogen.cpp b/src/tpx/Hydrogen.cpp index 46d0ad0d1..a7f573b18 100644 --- a/src/tpx/Hydrogen.cpp +++ b/src/tpx/Hydrogen.cpp @@ -16,14 +16,14 @@ Roc= 31.36, To = 13.8, Tt = 13.8, Pt = 7042.09, -R = 4124.299539, +R = 4124.299539, Gamma = 1.008854772e-3, u0 = 3.9275114e5, s0 = 2.3900333e4, T1 = 35, T2 = 400, -alpha = 1.5814454428, //to be used with psat -alpha1 = .3479; //to be used with ldens +alpha = 1.5814454428, //to be used with psat +alpha1 = .3479; //to be used with ldens static const double Ahydro[] = { 1.150470519352900e1, 1.055427998826072e3, -1.270685949968568e4, @@ -54,35 +54,35 @@ static const double Ghydro[]= { double hydrogen::C(int i, double rt, double rt2) { switch (i) { - case 0 : + case 0: return Ahydro[0] * T + Ahydro[1] * sqrt(T) + Ahydro[2] + (Ahydro[3] + Ahydro[4] * rt) * rt; - case 1 : + case 1: return Ahydro[5] * T + Ahydro[6] + rt * (Ahydro[7] + Ahydro[8] * rt); - case 2 : + case 2: return Ahydro[9] * T + Ahydro[10] + Ahydro[11] * rt; - case 3 : + case 3: return Ahydro[12]; - case 4 : + case 4: return rt*(Ahydro[13] + Ahydro[14]*rt); - case 5 : + case 5: return Ahydro[15]*rt; - case 6 : + case 6: return rt*(Ahydro[16] + Ahydro[17]*rt); - case 7 : + case 7: return Ahydro[18]*rt2; - case 8 : + case 8: return rt2*(Ahydro[19] + Ahydro[20]*rt); - case 9 : + case 9: return rt2*(Ahydro[21] + Ahydro[22]*rt2); - case 10 : + case 10: return rt2*(Ahydro[23] + Ahydro[24]*rt); - case 11 : + case 11: return rt2*(Ahydro[25] + Ahydro[26]*rt2); - case 12 : + case 12: return rt2*(Ahydro[27] + Ahydro[28]*rt); - case 13 : + case 13: return rt2*(Ahydro[29] + Ahydro[30]*rt + Ahydro[31]*rt2); - default : + default: return 0.0; } } @@ -90,35 +90,35 @@ double hydrogen::C(int i, double rt, double rt2) double hydrogen::Cprime(int i, double rt, double rt2, double rt3) { switch (i) { - case 0 : + case 0: return Ahydro[0] + 0.5*Ahydro[1]/sqrt(T) - (Ahydro[3] + 2.0*Ahydro[4]*rt)*rt2; - case 1 : + case 1: return Ahydro[5] - rt2*(Ahydro[7] + 2.0*Ahydro[8]*rt); - case 2 : + case 2: return Ahydro[9] - Ahydro[11]*rt2; - case 3 : + case 3: return 0.0; - case 4 : + case 4: return -rt2*(Ahydro[13] + 2.0*Ahydro[14]*rt); - case 5 : + case 5: return -Ahydro[15]*rt2; - case 6 : + case 6: return -rt2*(Ahydro[16] + 2.0*Ahydro[17]*rt); - case 7 : + case 7: return -2.0*Ahydro[18]*rt3; - case 8 : + case 8: return -rt3*(2.0*Ahydro[19] + 3.0*Ahydro[20]*rt); - case 9 : + case 9: return -rt3*(2.0*Ahydro[21] + 4.0*Ahydro[22]*rt2); - case 10 : + case 10: return -rt3*(2.0*Ahydro[23] + 3.0*Ahydro[24]*rt); - case 11 : + case 11: return -rt3*(2.0*Ahydro[25] + 4.0*Ahydro[26]*rt2); - case 12 : + case 12: return -rt3*(2.0*Ahydro[27] + 3.0*Ahydro[28]*rt); - case 13 : + case 13: return -rt3*(2.0*Ahydro[29] + 3.0*Ahydro[30]*rt + 4.0*Ahydro[31]*rt2); - default : + default: return 0.0; } } diff --git a/src/tpx/Methane.cpp b/src/tpx/Methane.cpp index a5288afed..278beec5f 100644 --- a/src/tpx/Methane.cpp +++ b/src/tpx/Methane.cpp @@ -49,35 +49,35 @@ static const double Gmeth[]= double methane::C(int i, double rt, double rt2) { switch (i) { - case 0 : + case 0: return Ameth[0] * T + Ameth[1] * sqrt(T) + Ameth[2] + (Ameth[3] + Ameth[4] * rt) * rt; - case 1 : + case 1: return Ameth[5] * T + Ameth[6] + rt * (Ameth[7] + Ameth[8] * rt); - case 2 : + case 2: return Ameth[9] * T + Ameth[10] + Ameth[11] * rt; - case 3 : + case 3: return Ameth[12]; - case 4 : + case 4: return rt*(Ameth[13] + Ameth[14]*rt); - case 5 : + case 5: return Ameth[15]*rt; - case 6 : + case 6: return rt*(Ameth[16] + Ameth[17]*rt); - case 7 : + case 7: return Ameth[18]*rt2; - case 8 : + case 8: return rt2*(Ameth[19] + Ameth[20]*rt); - case 9 : + case 9: return rt2*(Ameth[21] + Ameth[22]*rt2); - case 10 : + case 10: return rt2*(Ameth[23] + Ameth[24]*rt); - case 11 : + case 11: return rt2*(Ameth[25] + Ameth[26]*rt2); - case 12 : + case 12: return rt2*(Ameth[27] + Ameth[28]*rt); - case 13 : + case 13: return rt2*(Ameth[29] + Ameth[30]*rt + Ameth[31]*rt2); - default : + default: return 0.0; } } @@ -85,35 +85,35 @@ double methane::C(int i, double rt, double rt2) double methane::Cprime(int i, double rt, double rt2, double rt3) { switch (i) { - case 0 : + case 0: return Ameth[0] + 0.5*Ameth[1]/sqrt(T) - (Ameth[3] + 2.0*Ameth[4]*rt)*rt2; - case 1 : + case 1: return Ameth[5] - rt2*(Ameth[7] + 2.0*Ameth[8]*rt); - case 2 : + case 2: return Ameth[9] - Ameth[11]*rt2; - case 3 : + case 3: return 0.0; - case 4 : + case 4: return -rt2*(Ameth[13] + 2.0*Ameth[14]*rt); - case 5 : + case 5: return -Ameth[15]*rt2; - case 6 : + case 6: return -rt2*(Ameth[16] + 2.0*Ameth[17]*rt); - case 7 : + case 7: return -2.0*Ameth[18]*rt3; - case 8 : + case 8: return -rt3*(2.0*Ameth[19] + 3.0*Ameth[20]*rt); - case 9 : + case 9: return -rt3*(2.0*Ameth[21] + 4.0*Ameth[22]*rt2); - case 10 : + case 10: return -rt3*(2.0*Ameth[23] + 3.0*Ameth[24]*rt); - case 11 : + case 11: return -rt3*(2.0*Ameth[25] + 4.0*Ameth[26]*rt2); - case 12 : + case 12: return -rt3*(2.0*Ameth[27] + 3.0*Ameth[28]*rt); - case 13 : + case 13: return -rt3*(2.0*Ameth[29] + 3.0*Ameth[30]*rt + 4.0*Ameth[31]*rt2); - default : + default: return 0.0; } } diff --git a/src/tpx/Nitrogen.cpp b/src/tpx/Nitrogen.cpp index c92fabfc6..9bb46e518 100644 --- a/src/tpx/Nitrogen.cpp +++ b/src/tpx/Nitrogen.cpp @@ -6,7 +6,7 @@ using namespace Cantera; namespace tpx { -static const double M = 28.01348, +static const double M = 28.01348, Tmn = 63.15, Tmx = 2000.0, Tc = 126.200, @@ -55,36 +55,36 @@ static const double Gnn[] = { double nitrogen::C(int i, double rt, double rt2) { switch (i) { - case 0 : + case 0: return Ann[0] * T + Ann[1] * sqrt(T) + Ann[2] + (Ann[3] + Ann[4] * rt) * rt; - case 1 : + case 1: return Ann[5] * T + Ann[6] + rt * (Ann[7] + Ann[8] * rt); - case 2 : + case 2: return Ann[9] * T + Ann[10] + Ann[11] * rt; - case 3 : + case 3: return Ann[12]; - case 4 : + case 4: return rt*(Ann[13] + Ann[14]*rt); - case 5 : + case 5: return Ann[15]*rt; - case 6 : + case 6: return rt*(Ann[16] + Ann[17]*rt); - case 7 : + case 7: return Ann[18]*rt2; - case 8 : + case 8: return rt2*(Ann[19] + Ann[20]*rt); - case 9 : + case 9: return rt2*(Ann[21] + Ann[22]*rt2); - case 10 : + case 10: return rt2*(Ann[23] + Ann[24]*rt); - case 11 : + case 11: return rt2*(Ann[25] + Ann[26]*rt2); - case 12 : + case 12: return rt2*(Ann[27] + Ann[28]*rt); - case 13 : + case 13: return rt2*(Ann[29] + Ann[30]*rt + Ann[31]*rt2); - default : + default: return 0.0; } } @@ -92,35 +92,35 @@ double nitrogen::C(int i, double rt, double rt2) double nitrogen::Cprime(int i, double rt, double rt2, double rt3) { switch (i) { - case 0 : + case 0: return Ann[0] + 0.5*Ann[1]/sqrt(T) - (Ann[3] + 2.0*Ann[4]*rt)*rt2; - case 1 : + case 1: return Ann[5] - rt2*(Ann[7] + 2.0*Ann[8]*rt); - case 2 : + case 2: return Ann[9] - Ann[11]*rt2; - case 3 : + case 3: return 0.0; - case 4 : + case 4: return -rt2*(Ann[13] + 2.0*Ann[14]*rt); - case 5 : + case 5: return -Ann[15]*rt2; - case 6 : + case 6: return -rt2*(Ann[16] + 2.0*Ann[17]*rt); - case 7 : + case 7: return -2.0*Ann[18]*rt3; - case 8 : + case 8: return -rt3*(2.0*Ann[19] + 3.0*Ann[20]*rt); - case 9 : + case 9: return -rt3*(2.0*Ann[21] + 4.0*Ann[22]*rt2); - case 10 : + case 10: return -rt3*(2.0*Ann[23] + 3.0*Ann[24]*rt); - case 11 : + case 11: return -rt3*(2.0*Ann[25] + 4.0*Ann[26]*rt2); - case 12 : + case 12: return -rt3*(2.0*Ann[27] + 3.0*Ann[28]*rt); - case 13 : + case 13: return -rt3*(2.0*Ann[29] + 3.0*Ann[30]*rt + 4.0*Ann[31]*rt2); - default : + default: return 0.0; } } diff --git a/src/tpx/Oxygen.cpp b/src/tpx/Oxygen.cpp index cbf27e1b7..e9ef405ed 100644 --- a/src/tpx/Oxygen.cpp +++ b/src/tpx/Oxygen.cpp @@ -52,35 +52,35 @@ static const double Goxy[] = { double oxygen::C(int i, double rt, double rt2) { switch (i) { - case 0 : + case 0: return Aoxy[0] * T + Aoxy[1] * sqrt(T) + Aoxy[2] + (Aoxy[3] + Aoxy[4] * rt) * rt; - case 1 : + case 1: return Aoxy[5] * T + Aoxy[6] + rt * (Aoxy[7] + Aoxy[8] * rt); - case 2 : + case 2: return Aoxy[9] * T + Aoxy[10] + Aoxy[11] * rt; - case 3 : + case 3: return Aoxy[12]; - case 4 : + case 4: return rt*(Aoxy[13] + Aoxy[14]*rt); - case 5 : + case 5: return Aoxy[15]*rt; - case 6 : + case 6: return rt*(Aoxy[16] + Aoxy[17]*rt); - case 7 : + case 7: return Aoxy[18]*rt2; - case 8 : + case 8: return rt2*(Aoxy[19] + Aoxy[20]*rt); - case 9 : + case 9: return rt2*(Aoxy[21] + Aoxy[22]*rt2); - case 10 : + case 10: return rt2*(Aoxy[23] + Aoxy[24]*rt); - case 11 : + case 11: return rt2*(Aoxy[25] + Aoxy[26]*rt2); - case 12 : + case 12: return rt2*(Aoxy[27] + Aoxy[28]*rt); - case 13 : + case 13: return rt2*(Aoxy[29] + Aoxy[30]*rt + Aoxy[31]*rt2); - default : + default: return 0.0; } } @@ -88,35 +88,35 @@ double oxygen::C(int i, double rt, double rt2) double oxygen::Cprime(int i, double rt, double rt2, double rt3) { switch (i) { - case 0 : + case 0: return Aoxy[0] + 0.5*Aoxy[1]/sqrt(T) - (Aoxy[3] + 2.0*Aoxy[4]*rt)*rt2; - case 1 : + case 1: return Aoxy[5] - rt2*(Aoxy[7] + 2.0*Aoxy[8]*rt); - case 2 : + case 2: return Aoxy[9] - Aoxy[11]*rt2; - case 3 : + case 3: return 0.0; - case 4 : + case 4: return -rt2*(Aoxy[13] + 2.0*Aoxy[14]*rt); - case 5 : + case 5: return -Aoxy[15]*rt2; - case 6 : + case 6: return -rt2*(Aoxy[16] + 2.0*Aoxy[17]*rt); - case 7 : + case 7: return -2.0*Aoxy[18]*rt3; - case 8 : + case 8: return -rt3*(2.0*Aoxy[19] + 3.0*Aoxy[20]*rt); - case 9 : + case 9: return -rt3*(2.0*Aoxy[21] + 4.0*Aoxy[22]*rt2); - case 10 : + case 10: return -rt3*(2.0*Aoxy[23] + 3.0*Aoxy[24]*rt); - case 11 : + case 11: return -rt3*(2.0*Aoxy[25] + 4.0*Aoxy[26]*rt2); - case 12 : + case 12: return -rt3*(2.0*Aoxy[27] + 3.0*Aoxy[28]*rt); - case 13 : + case 13: return -rt3*(2.0*Aoxy[29] + 3.0*Aoxy[30]*rt + 4.0*Aoxy[31]*rt2); - default : + default: return 0.0; } } diff --git a/src/tpx/RedlichKwong.cpp b/src/tpx/RedlichKwong.cpp index 9860f2f05..f7fea325f 100644 --- a/src/tpx/RedlichKwong.cpp +++ b/src/tpx/RedlichKwong.cpp @@ -11,16 +11,16 @@ double RedlichKwong::up() 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); + 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); + 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; } diff --git a/src/tpx/Water.cpp b/src/tpx/Water.cpp index 379835e6b..a4565ae79 100644 --- a/src/tpx/Water.cpp +++ b/src/tpx/Water.cpp @@ -162,7 +162,7 @@ double water::Psat() "Temperature out of range. T = " + fp2str(T)); } for (int i=1; i<=8; i++) { - sum += F[i-1]*pow(aww*(T-Tp),double(i-1)); // DGG mod + sum += F[i-1]*pow(aww*(T-Tp),double(i-1)); // DGG mod } log = (Tc/T-1)*sum; return exp(log)*Pc; diff --git a/src/tpx/lk.cpp b/src/tpx/lk.cpp index fea8c7c11..6d573ca8d 100644 --- a/src/tpx/lk.cpp +++ b/src/tpx/lk.cpp @@ -26,7 +26,7 @@ double leekesler::W(int n, double egrho, double Gamma) double leekesler::up() { - return -(8314.3/Mw)*T*(1.0 + T*I()/Tcr); // + h_0(T) + return -(8314.3/Mw)*T*(1.0 + T*I()/Tcr); // + h_0(T) } double leekesler::hdep() @@ -48,12 +48,12 @@ double leekesler::sp() 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 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 rvr = 8314.3*Tcr*Rho/(Pcr*Mw); // 1/v_r^\prime double rvr2 = rvr*rvr; double egrho; @@ -67,12 +67,12 @@ double leekesler::I() // \int_0^\rho_r (1/\rho_r)(dZ/dT_r) d\rho_r return r; } -double leekesler::J() // \int_0^\rho_r (1/\rho_r)(Z - 1) d\rho_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 rvr = 8314.3*Tcr*Rho/(Pcr*Mw); // 1/v_r^\prime double rvr2 = rvr*rvr; double egrho; @@ -90,7 +90,7 @@ double leekesler::J() // \int_0^\rho_r (1/\rho_r)(Z - 1) d\rho_r double leekesler::z() { double zz, rvr2, BB, CC, DD, EE; - double rtr = Tcr/T; // 1/T_r + 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] diff --git a/src/tpx/lk.h b/src/tpx/lk.h index 92dab75d4..b8690e0fd 100644 --- a/src/tpx/lk.h +++ b/src/tpx/lk.h @@ -15,7 +15,7 @@ public: Tcr = tc; Pcr = pc; Mw = wt; - Isr = itype; // simple fluid or reference + Isr = itype; // simple fluid or reference m_name = "Lee-Kesler"; m_formula = "---"; } diff --git a/src/transport/DustyGasTransport.cpp b/src/transport/DustyGasTransport.cpp index b38af5a07..cc04d3a17 100644 --- a/src/transport/DustyGasTransport.cpp +++ b/src/transport/DustyGasTransport.cpp @@ -45,7 +45,7 @@ DustyGasTransport::DustyGasTransport(const DustyGasTransport& right) : *this = right; } -DustyGasTransport& DustyGasTransport::operator=(const DustyGasTransport& right) +DustyGasTransport& DustyGasTransport::operator=(const DustyGasTransport& right) { if (&right == this) { return *this; @@ -106,7 +106,7 @@ void DustyGasTransport::initialize(ThermoPhase* phase, Transport* gastr) // make a local copy of the molecular weights m_mw.resize(m_nsp); - copy(m_thermo->molecularWeights().begin(), m_thermo->molecularWeights().end(), m_mw.begin()); + copy(m_thermo->molecularWeights().begin(), m_thermo->molecularWeights().end(), m_mw.begin()); m_multidiff.resize(m_nsp, m_nsp); m_d.resize(m_nsp, m_nsp); @@ -304,17 +304,17 @@ void DustyGasTransport::setMeanPoreRadius(doublereal rbar) m_knudsen_ok = false; } -void DustyGasTransport::setMeanParticleDiameter(doublereal dbar) +void DustyGasTransport::setMeanParticleDiameter(doublereal dbar) { m_diam = dbar; } -void DustyGasTransport::setPermeability(doublereal B) +void DustyGasTransport::setPermeability(doublereal B) { m_perm = B; } -Transport& DustyGasTransport::gasTransport() +Transport& DustyGasTransport::gasTransport() { return *m_gastran; } diff --git a/src/transport/GasTransport.cpp b/src/transport/GasTransport.cpp index e4711d7af..cd56de129 100644 --- a/src/transport/GasTransport.cpp +++ b/src/transport/GasTransport.cpp @@ -329,7 +329,7 @@ void GasTransport::getMixDiffCoeffsMass(doublereal* const d) } sum1 *= p; sum2 *= p * m_molefracs[k] / (mmw - m_mw[k]*m_molefracs[k]); - d[k] = 1.0 / (sum1 + sum2); + d[k] = 1.0 / (sum1 + sum2); } } } @@ -400,7 +400,7 @@ void GasTransport::setupMM() for (size_t i = 0; i < m_nsp; i++) { for (size_t j = i; j < m_nsp; j++) { // the reduced mass - m_reducedMass(i,j) = mw[i] * mw[j] / (Avogadro * (mw[i] + mw[j])); + m_reducedMass(i,j) = mw[i] * mw[j] / (Avogadro * (mw[i] + mw[j])); // hard-sphere diameter for (i,j) collisions m_diam(i,j) = 0.5*(m_sigma[i] + m_sigma[j]); @@ -418,8 +418,8 @@ void GasTransport::setupMM() // reduced dipole moment delta* (nondimensional) double d = m_diam(i,j); - m_delta(i,j) = 0.5 * m_dipole(i,j)*m_dipole(i,j) - / (4 * Pi * epsilon_0 * m_epsilon(i,j) * d * d * d); + m_delta(i,j) = 0.5 * m_dipole(i,j)*m_dipole(i,j) + / (4 * Pi * epsilon_0 * m_epsilon(i,j) * d * d * d); makePolarCorrections(i, j, f_eps, f_sigma); m_diam(i,j) *= f_sigma; m_epsilon(i,j) *= f_eps; @@ -428,8 +428,8 @@ void GasTransport::setupMM() m_reducedMass(j,i) = m_reducedMass(i,j); m_diam(j,i) = m_diam(i,j); m_epsilon(j,i) = m_epsilon(i,j); - m_dipole(j,i) = m_dipole(i,j); - m_delta(j,i) = m_delta(i,j); + m_dipole(j,i) = m_dipole(i,j); + m_delta(j,i) = m_delta(i,j); } } @@ -496,13 +496,13 @@ void GasTransport::makePolarCorrections(size_t i, size_t j, // corrections to the effective diameter and well depth // if one is polar and one is non-polar - size_t kp = (m_polar[i] ? i : j); // the polar one - size_t knp = (i == kp ? j : i); // the nonpolar one + size_t kp = (m_polar[i] ? i : j); // the polar one + size_t knp = (i == kp ? j : i); // the nonpolar one double d3np, d3p, alpha_star, mu_p_star, xi; d3np = pow(m_sigma[knp],3); - d3p = pow(m_sigma[kp],3); + d3p = pow(m_sigma[kp],3); alpha_star = m_alpha[knp]/d3np; - mu_p_star = m_dipole(kp,kp)/sqrt(4 * Pi * epsilon_0 * d3p * m_eps[kp]); + mu_p_star = m_dipole(kp,kp)/sqrt(4 * Pi * epsilon_0 * d3p * m_eps[kp]); xi = 1.0 + 0.25 * alpha_star * mu_p_star * mu_p_star * sqrt(m_eps[kp]/m_eps[knp]); f_sigma = pow(xi, -1.0/6.0); @@ -525,7 +525,7 @@ void GasTransport::fitCollisionIntegrals(MMCollisionInt& integrals) } vector_fp fitlist; for (size_t i = 0; i < m_nsp; i++) { - for (size_t j = i; j < m_nsp; j++) { + for (size_t j = i; j < m_nsp; j++) { // Chemkin fits only delta* = 0 if (m_mode != CK_Mode) { dstar = m_delta(i,j); @@ -733,7 +733,7 @@ void GasTransport::fitProperties(MMCollisionInt& integrals) mxerr = 0.0, mxrelerr = 0.0; vector_fp diff(np + 1); double eps, sigma; - for (size_t k = 0; k < m_nsp; k++) { + for (size_t k = 0; k < m_nsp; k++) { for (size_t j = k; j < m_nsp; j++) { for (size_t n = 0; n < np; n++) { double t = m_thermo->minTemp() + dt*n; diff --git a/src/transport/HighPressureGasTransport.cpp b/src/transport/HighPressureGasTransport.cpp index 0d3027ad5..eed66e07f 100755 --- a/src/transport/HighPressureGasTransport.cpp +++ b/src/transport/HighPressureGasTransport.cpp @@ -243,7 +243,7 @@ void HighPressureGasTransport::getMultiDiffCoeffs(const size_t ld, doublereal* c m_bdiff(i,j) *= P_corr_ij; } } - m_bindiff_ok = false; // m_bdiff is overwritten by the above routine. + m_bindiff_ok = false; // m_bdiff is overwritten by the above routine. // Having corrected m_bdiff for pressure and concentration effects, the // routine now procedes the same as in the low-pressure case: @@ -260,7 +260,7 @@ void HighPressureGasTransport::getMultiDiffCoeffs(const size_t ld, doublereal* c throw CanteraError("HighPressureGasTransport::getMultiDiffCoeffs", string(" invert returned ierr = ")+int2str(ierr)); } - m_l0000_ok = false; // matrix is overwritten by inverse + m_l0000_ok = false; // matrix is overwritten by inverse m_lmatrix_soln_ok = false; doublereal pres = m_thermo->pressure(); @@ -302,8 +302,8 @@ doublereal HighPressureGasTransport::viscosity() Tr = tKelvin/Tc; Zc = Zcrit_i(i); Tc_mix += Tc*molefracs[i]; - Pc_mix_n += molefracs[i]*Zc; //numerator - Pc_mix_d += molefracs[i]*Vcrit_i(i); //denominator + Pc_mix_n += molefracs[i]*Zc; //numerator + Pc_mix_d += molefracs[i]*Vcrit_i(i); //denominator // Need to calculate ratio of heaviest to lightest species: if (m_mw[i] > MW_H) { @@ -359,7 +359,7 @@ doublereal HighPressureGasTransport::viscosity() + 0.340*exp(-4.058*Tr_mix)+0.018)*FP_mix_o*FQ_mix_o; // Calculate Z2m: - if (Tr_mix <= 1.0){ + if (Tr_mix <= 1.0) { if (Pr_mix < Pvp_mix/Pc_mix) { doublereal alpha = 3.262 + 14.98*pow(Pr_mix,5.508); doublereal beta = 1.390 + 5.746*Pr_mix; diff --git a/src/transport/LTPspecies.cpp b/src/transport/LTPspecies.cpp index a71d078ce..c821f0784 100644 --- a/src/transport/LTPspecies.cpp +++ b/src/transport/LTPspecies.cpp @@ -1,6 +1,6 @@ /** * @file LTPspecies.cpp \ - * definitions for the LTPspecies objects and its children, which is the virtual base class + * definitions for the LTPspecies objects and its children, which is the virtual base class * for describing temperature dependence of submodels for transport parameters * (see \ref tranprops and \link Cantera::LTPspecies LTPspecies \endlink) . */ @@ -71,11 +71,11 @@ LTPspecies& LTPspecies::operator=(const LTPspecies& right) { if (&right != this) { m_speciesName = right.m_speciesName; - m_property = right.m_property; - m_model = right.m_model; - m_coeffs = right.m_coeffs; - m_thermo = right.m_thermo; - m_mixWeight = right.m_mixWeight; + m_property = right.m_property; + m_model = right.m_model; + m_coeffs = right.m_coeffs; + m_thermo = right.m_thermo; + m_mixWeight = right.m_mixWeight; } return *this; } @@ -142,7 +142,7 @@ doublereal LTPspecies_Const::getSpeciesTransProp() } LTPspecies_Arrhenius::LTPspecies_Arrhenius(const XML_Node& propNode, const std::string name, - TransportPropertyType tp_ind, const thermo_t* thermo) : + TransportPropertyType tp_ind, const thermo_t* thermo) : LTPspecies(&propNode, name, tp_ind, thermo) { m_model = LTP_TD_ARRHENIUS; @@ -169,9 +169,9 @@ LTPspecies_Arrhenius& LTPspecies_Arrhenius::operator=(const LTPspecies_Arrhenius { if (&right != this) { LTPspecies::operator=(right); - m_temp = right.m_temp; - m_logt = right.m_logt; - m_prop = right.m_prop; + m_temp = right.m_temp; + m_logt = right.m_logt; + m_prop = right.m_prop; m_logProp = right.m_logProp; } return *this; @@ -196,9 +196,9 @@ doublereal LTPspecies_Arrhenius::getSpeciesTransProp() m_logt = log(m_temp); //For viscosity the sign convention on positive activation energy is swithced if (m_property == TP_VISCOSITY) { - m_logProp = m_coeffs[3] + m_coeffs[1] * m_logt + m_coeffs[2] / m_temp ; + m_logProp = m_coeffs[3] + m_coeffs[1] * m_logt + m_coeffs[2] / m_temp; } else { - m_logProp = m_coeffs[3] + m_coeffs[1] * m_logt - m_coeffs[2] / m_temp ; + m_logProp = m_coeffs[3] + m_coeffs[1] * m_logt - m_coeffs[2] / m_temp; } m_prop = exp(m_logProp); } @@ -225,8 +225,8 @@ LTPspecies_Poly& LTPspecies_Poly::operator=(const LTPspecies_Poly& right) { if (&right != this) { LTPspecies::operator=(right); - m_temp = right.m_temp; - m_prop = right.m_prop; + m_temp = right.m_temp; + m_prop = right.m_prop; } return *this; } @@ -272,8 +272,8 @@ LTPspecies_ExpT& LTPspecies_ExpT::operator=(const LTPspecies_ExpT& right) { if (&right != this) { LTPspecies::operator=(right); - m_temp = right.m_temp; - m_prop = right.m_prop; + m_temp = right.m_temp; + m_prop = right.m_prop; } return *this; } diff --git a/src/transport/LiquidTranInteraction.cpp b/src/transport/LiquidTranInteraction.cpp index 58a976784..ef23a13ef 100644 --- a/src/transport/LiquidTranInteraction.cpp +++ b/src/transport/LiquidTranInteraction.cpp @@ -91,7 +91,7 @@ void LiquidTranInteraction::init(const XML_Node& compModelNode, "Unknown species " + speciesA); } size_t jSpecies = m_thermo->speciesIndex(speciesB); - if (jSpecies == npos) { + if (jSpecies == npos) { throw CanteraError("TransportFactory::getLiquidInteractionsTransportData", "Unknown species " + speciesB); } @@ -99,7 +99,7 @@ void LiquidTranInteraction::init(const XML_Node& compModelNode, if (xmlChild.hasChild("Eij")) { m_Eij(iSpecies,jSpecies) = getFloat(xmlChild, "Eij", "actEnergy"); m_Eij(iSpecies,jSpecies) /= GasConstant; - m_Eij(jSpecies,iSpecies) = m_Eij(iSpecies,jSpecies) ; + m_Eij(jSpecies,iSpecies) = m_Eij(iSpecies,jSpecies); } if (xmlChild.hasChild("Aij")) { @@ -117,7 +117,7 @@ void LiquidTranInteraction::init(const XML_Node& compModelNode, if (xmlChild.hasChild("Bij")) { vector_fp poly; - getFloatArray(xmlChild, poly, true, "toSI", "Bij"); + getFloatArray(xmlChild, poly, true, "toSI", "Bij"); while (m_Bij.size() < poly.size()) { DenseMatrix* bTemp = new DenseMatrix(); bTemp->resize(nsp, nsp, 0.0); @@ -158,28 +158,28 @@ void LiquidTranInteraction::init(const XML_Node& compModelNode, if (xmlChild.hasChild("Dij")) { m_Dij(iSpecies,jSpecies) = getFloat(xmlChild, "Dij", "toSI"); - m_Dij(jSpecies,iSpecies) = m_Dij(iSpecies,jSpecies) ; + m_Dij(jSpecies,iSpecies) = m_Dij(iSpecies,jSpecies); } } } LiquidTranInteraction::LiquidTranInteraction(const LiquidTranInteraction& right) { - *this = right; //use assignment operator to do other work + *this = right; //use assignment operator to do other work } LiquidTranInteraction& LiquidTranInteraction::operator=(const LiquidTranInteraction& right) { if (&right != this) { - m_model = right.m_model; - m_property = right.m_property; - m_thermo = right.m_thermo; - m_Aij = right.m_Aij; - m_Bij = right.m_Bij; - m_Eij = right.m_Eij; - m_Hij = right.m_Hij; - m_Sij = right.m_Sij; - m_Dij = right.m_Dij; + m_model = right.m_model; + m_property = right.m_property; + m_thermo = right.m_thermo; + m_Aij = right.m_Aij; + m_Bij = right.m_Bij; + m_Eij = right.m_Eij; + m_Hij = right.m_Hij; + m_Sij = right.m_Sij; + m_Dij = right.m_Dij; } return *this; } @@ -422,10 +422,10 @@ doublereal LTI_Log_MoleFracs::getMixTransProp(std::vector LTPptrs) value += log(LTPptrs[i]->getSpeciesTransProp()) * molefracs[i]; for (size_t j = 0; j < nsp; j++) { for (size_t k = 0; k < m_Hij.size(); k++) { - value += molefracs[i]*molefracs[j]*(*m_Hij[k])(i,j)/temp*pow(molefracs[i], (int) k); + value += molefracs[i]*molefracs[j]*(*m_Hij[k])(i,j)/temp*pow(molefracs[i], (int) k); } for (size_t k = 0; k < m_Sij.size(); k++) { - value -= molefracs[i]*molefracs[j]*(*m_Sij[k])(i,j)*pow(molefracs[i], (int) k); + value -= molefracs[i]*molefracs[j]*(*m_Sij[k])(i,j)*pow(molefracs[i], (int) k); } } } @@ -482,7 +482,7 @@ void LTI_Pairwise_Interaction::getMatrixTransProp(DenseMatrix& mat, doublereal* for (size_t i = 0; i < nsp; i++) { if (mat(i,i) == 0.0 && m_diagonals[i]) { - mat(i,i) = 1.0 / m_diagonals[i]->getSpeciesTransProp() ; + mat(i,i) = 1.0 / m_diagonals[i]->getSpeciesTransProp(); } } } @@ -512,7 +512,7 @@ void LTI_StefanMaxwell_PPN::setParameters(LiquidTransportParams& trParam) for (size_t k = 0; k < nsp; k++) { LiquidTransportData& ltd = trParam.LTData[k]; - m_ionCondSpecies[k] = ltd.ionConductivity; + m_ionCondSpecies[k] = ltd.ionConductivity; for (size_t j = 0; j < nsp2; j++) { m_mobRatSpecies[j][k] = ltd.mobilityRatio[j]; } @@ -644,8 +644,8 @@ void LTI_StokesEinstein::setParameters(LiquidTransportParams& trParam) m_hydroRadius.resize(nsp, 0); for (size_t k = 0; k < nsp; k++) { LiquidTransportData& ltd = trParam.LTData[k]; - m_viscosity[k] = ltd.viscosity; - m_hydroRadius[k] = ltd.hydroRadius; + m_viscosity[k] = ltd.viscosity; + m_hydroRadius[k] = ltd.hydroRadius; } } @@ -657,8 +657,8 @@ void LTI_StokesEinstein::getMatrixTransProp(DenseMatrix& mat, doublereal* specie vector_fp radiusSpec(nsp); for (size_t k = 0; k < nsp; k++) { - viscSpec[k] = m_viscosity[k]->getSpeciesTransProp() ; - radiusSpec[k] = m_hydroRadius[k]->getSpeciesTransProp() ; + viscSpec[k] = m_viscosity[k]->getSpeciesTransProp(); + radiusSpec[k] = m_hydroRadius[k]->getSpeciesTransProp(); } mat.resize(nsp,nsp, 0.0); diff --git a/src/transport/LiquidTransport.cpp b/src/transport/LiquidTransport.cpp index 191edd955..cd753098e 100644 --- a/src/transport/LiquidTransport.cpp +++ b/src/transport/LiquidTransport.cpp @@ -104,76 +104,76 @@ LiquidTransport& LiquidTransport::operator=(const LiquidTransport& right) 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_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; + 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; } @@ -217,7 +217,7 @@ bool LiquidTransport::initLiquid(LiquidTransportParams& tr) // Transfer quantitities from the database to the Transport object m_thermo = tr.thermo; m_velocityBasis = tr.velocityBasis_; - m_nsp = m_thermo->nSpecies(); + m_nsp = m_thermo->nSpecies(); m_nsp2 = m_nsp*m_nsp; // Resize the local storage according to the number of species @@ -263,12 +263,12 @@ bool LiquidTransport::initLiquid(LiquidTransportParams& tr) //for each species, assign viscosity model and coefficients for (size_t k = 0; k < m_nsp; k++) { LiquidTransportData& ltd = tr.LTData[k]; - m_viscTempDep_Ns[k] = ltd.viscosity; + m_viscTempDep_Ns[k] = ltd.viscosity; ltd.viscosity = 0; - m_ionCondTempDep_Ns[k] = ltd.ionConductivity; + m_ionCondTempDep_Ns[k] = ltd.ionConductivity; ltd.ionConductivity = 0; for (size_t j = 0; j < m_nsp2; j++) { - m_mobRatTempDep_Ns[j][k] = ltd.mobilityRatio[j]; + m_mobRatTempDep_Ns[j][k] = ltd.mobilityRatio[j]; ltd.mobilityRatio[j] = 0; } for (size_t j = 0; j < m_nsp; j++) { @@ -334,7 +334,7 @@ bool LiquidTransport::initLiquid(LiquidTransportParams& tr) //It is updated in updateDiff_T() m_diffMixModel->getMatrixTransProp(m_bdiff); - m_mode = tr.mode_; + m_mode = tr.mode_; m_massfracs.resize(m_nsp, 0.0); m_massfracs_tran.resize(m_nsp, 0.0); m_molefracs.resize(m_nsp, 0.0); @@ -358,24 +358,24 @@ bool LiquidTransport::initLiquid(LiquidTransportParams& tr) m_Vdiff.resize(m_nsp, m_nDim, 0.0); // set all flags to false - 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_temp_ok = false; - m_radi_conc_ok = false; + 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_temp_ok = false; + m_radi_conc_ok = false; m_lambda_temp_ok = false; - m_lambda_mix_ok = false; - m_diff_temp_ok = false; - m_diff_mix_ok = false; + m_lambda_mix_ok = false; + m_diff_temp_ok = false; + m_diff_mix_ok = false; return true; } @@ -537,7 +537,7 @@ void LiquidTransport::getMobilities(doublereal* const mobil) } } -void LiquidTransport::getFluidMobilities(doublereal* const mobil_f) +void LiquidTransport::getFluidMobilities(doublereal* const mobil_f) { getMixDiffCoeffs(DATA_PTR(m_spwork)); doublereal c1 = 1.0 / (GasConstant * m_temp); @@ -593,7 +593,7 @@ doublereal LiquidTransport::getElectricConduct() for (size_t i = 0; i < 1; i++) { current = 0.0; for (size_t k = 0; k < m_nsp; k++) { - current += m_chargeSpecies[k] * Faraday * fluxes[k] / m_mw[k]; + current += m_chargeSpecies[k] * Faraday * fluxes[k] / m_mw[k]; } //divide by unit potential gradient current /= - gradV[i]; @@ -728,21 +728,21 @@ bool LiquidTransport::update_T() m_temp = t; // temperature has changed so temp flags are flipped - m_visc_temp_ok = false; - m_ionCond_temp_ok = false; - m_mobRat_temp_ok = false; - m_selfDiff_temp_ok = false; - m_radi_temp_ok = false; - m_diff_temp_ok = false; - m_lambda_temp_ok = false; + m_visc_temp_ok = false; + m_ionCond_temp_ok = false; + m_mobRat_temp_ok = false; + m_selfDiff_temp_ok = false; + m_radi_temp_ok = false; + m_diff_temp_ok = false; + m_lambda_temp_ok = false; // temperature has changed, so polynomial temperature // interpolations will need to be reevaluated. // This means that many concentration - m_visc_conc_ok = false; - m_ionCond_conc_ok = false; - m_mobRat_conc_ok = false; - m_selfDiff_conc_ok = false; + m_visc_conc_ok = false; + m_ionCond_conc_ok = false; + m_mobRat_conc_ok = false; + m_selfDiff_conc_ok = false; // Mixture stuff needs to be evaluated m_visc_mix_ok = false; @@ -780,7 +780,7 @@ bool LiquidTransport::update_C() concTot_ += m_concentrations[k]; } dens_ = m_thermo->density(); - meanMolecularWeight_ = m_thermo->meanMolecularWeight(); + meanMolecularWeight_ = m_thermo->meanMolecularWeight(); concTot_tran_ *= concTot_; } if (qReturn) { @@ -809,7 +809,7 @@ bool LiquidTransport::update_C() void LiquidTransport::updateCond_T() { for (size_t k = 0; k < m_nsp; k++) { - m_lambdaSpecies[k] = m_lambdaTempDep_Ns[k]->getSpeciesTransProp() ; + m_lambdaSpecies[k] = m_lambdaTempDep_Ns[k]->getSpeciesTransProp(); } m_lambda_temp_ok = true; m_lambda_mix_ok = false; @@ -830,7 +830,7 @@ void LiquidTransport::updateViscosities_C() void LiquidTransport::updateViscosity_T() { for (size_t k = 0; k < m_nsp; k++) { - m_viscSpecies[k] = m_viscTempDep_Ns[k]->getSpeciesTransProp() ; + m_viscSpecies[k] = m_viscTempDep_Ns[k]->getSpeciesTransProp(); } m_visc_temp_ok = true; m_visc_mix_ok = false; @@ -844,7 +844,7 @@ void LiquidTransport::updateIonConductivity_C() void LiquidTransport::updateIonConductivity_T() { for (size_t k = 0; k < m_nsp; k++) { - m_ionCondSpecies[k] = m_ionCondTempDep_Ns[k]->getSpeciesTransProp() ; + m_ionCondSpecies[k] = m_ionCondTempDep_Ns[k]->getSpeciesTransProp(); } m_ionCond_temp_ok = true; m_ionCond_mix_ok = false; @@ -875,7 +875,7 @@ void LiquidTransport::updateSelfDiffusion_T() { for (size_t k = 0; k < m_nsp2; k++) { for (size_t j = 0; j < m_nsp; j++) { - m_selfDiffSpecies(k,j) = m_selfDiffTempDep_Ns[k][j]->getSpeciesTransProp() ; + m_selfDiffSpecies(k,j) = m_selfDiffTempDep_Ns[k][j]->getSpeciesTransProp(); } } m_selfDiff_temp_ok = true; @@ -890,7 +890,7 @@ void LiquidTransport::updateHydrodynamicRadius_C() void LiquidTransport::updateHydrodynamicRadius_T() { for (size_t k = 0; k < m_nsp; k++) { - m_hydrodynamic_radius[k] = m_radiusTempDep_Ns[k]->getSpeciesTransProp() ; + m_hydrodynamic_radius[k] = m_radiusTempDep_Ns[k]->getSpeciesTransProp(); } m_radi_temp_ok = true; m_radi_mix_ok = false; @@ -921,7 +921,7 @@ void LiquidTransport::stefan_maxwell_solve() m_A.resize(m_nsp, m_nsp, 0.0); //! grab a local copy of the molecular weights - const vector_fp& M = m_thermo->molecularWeights(); + const vector_fp& M = m_thermo->molecularWeights(); //! grad a local copy of the ion molar volume (inverse total ion concentration) const doublereal vol = m_thermo->molarVolume(); @@ -935,7 +935,7 @@ void LiquidTransport::stefan_maxwell_solve() } double T = m_thermo->temperature(); - update_Grad_lnAC() ; + update_Grad_lnAC(); m_thermo->getActivityCoefficients(DATA_PTR(m_actCoeff)); /* @@ -965,7 +965,7 @@ void LiquidTransport::stefan_maxwell_solve() for (size_t a = 0; a < m_nDim; a++) { for (size_t i = 0; i < m_nsp; i++) { m_Grad_mu[a*m_nsp + i] = - m_chargeSpecies[i] * Faraday * m_Grad_V[a] + m_chargeSpecies[i] * Faraday * m_Grad_V[a] + GasConstant * T * m_Grad_lnAC[a*m_nsp+i]; } } @@ -990,7 +990,7 @@ void LiquidTransport::stefan_maxwell_solve() double condSum1; const doublereal invRT = 1.0 / (GasConstant * T); switch (m_nDim) { - case 1: /* 1-D approximation */ + case 1: /* 1-D approximation */ m_B(0,0) = 0.0; //equation for the reference velocity for (size_t j = 0; j < m_nsp; j++) { @@ -1017,8 +1017,8 @@ void LiquidTransport::stefan_maxwell_solve() for (size_t j = 0; j < m_nsp; j++) { if (j != i) { tmp = m_molefracs_tran[j] * m_bdiff(i,j); - m_A(i,i) -= tmp; - m_A(i,j) = tmp; + m_A(i,i) -= tmp; + m_A(i,j) = tmp; } } } @@ -1030,7 +1030,7 @@ void LiquidTransport::stefan_maxwell_solve() condSum1 -= Faraday*m_chargeSpecies[i]*m_B(i,0)*m_molefracs_tran[i]/vol; } break; - case 2: /* 2-D approximation */ + case 2: /* 2-D approximation */ m_B(0,0) = 0.0; m_B(0,1) = 0.0; //equation for the reference velocity @@ -1053,14 +1053,14 @@ void LiquidTransport::stefan_maxwell_solve() } } for (size_t i = 1; i < m_nsp; i++) { - m_B(i,0) = m_Grad_mu[i] * invRT; - m_B(i,1) = m_Grad_mu[m_nsp + i] * invRT; + m_B(i,0) = m_Grad_mu[i] * invRT; + m_B(i,1) = m_Grad_mu[m_nsp + i] * invRT; m_A(i,i) = 0.0; for (size_t j = 0; j < m_nsp; j++) { if (j != i) { - tmp = m_molefracs_tran[j] * m_bdiff(i,j); - m_A(i,i) -= tmp; - m_A(i,j) = tmp; + tmp = m_molefracs_tran[j] * m_bdiff(i,j); + m_A(i,i) -= tmp; + m_A(i,j) = tmp; } } } @@ -1068,7 +1068,7 @@ void LiquidTransport::stefan_maxwell_solve() //! invert and solve the system Ax = b. Answer is in m_B solve(m_A, m_B); break; - case 3: /* 3-D approximation */ + case 3: /* 3-D approximation */ m_B(0,0) = 0.0; m_B(0,1) = 0.0; m_B(0,2) = 0.0; @@ -1092,15 +1092,15 @@ void LiquidTransport::stefan_maxwell_solve() } } for (size_t i = 1; i < m_nsp; i++) { - m_B(i,0) = m_Grad_mu[i] * invRT; - m_B(i,1) = m_Grad_mu[m_nsp + i] * invRT; + m_B(i,0) = m_Grad_mu[i] * invRT; + m_B(i,1) = m_Grad_mu[m_nsp + i] * invRT; m_B(i,2) = m_Grad_mu[2*m_nsp + i] * invRT; m_A(i,i) = 0.0; for (size_t j = 0; j < m_nsp; j++) { if (j != i) { - tmp = m_molefracs_tran[j] * m_bdiff(i,j); - m_A(i,i) -= tmp; - m_A(i,j) = tmp; + tmp = m_molefracs_tran[j] * m_bdiff(i,j); + m_A(i,i) -= tmp; + m_A(i,j) = tmp; } } } diff --git a/src/transport/LiquidTransportData.cpp b/src/transport/LiquidTransportData.cpp index 49539660b..85000a484 100644 --- a/src/transport/LiquidTransportData.cpp +++ b/src/transport/LiquidTransportData.cpp @@ -35,7 +35,7 @@ LiquidTransportData& LiquidTransportData::operator=(const LiquidTransportData& r { if (&right != this) { // These are all shallow pointer copies - yes, yes, yes horrible crime. - speciesName = right.speciesName; + speciesName = right.speciesName; if (right.hydroRadius) { hydroRadius = (right.hydroRadius)->duplMyselfAsLTPspecies(); } @@ -61,7 +61,7 @@ LiquidTransportData& LiquidTransportData::operator=(const LiquidTransportData& r } if (right.thermalCond) { - thermalCond = (right.thermalCond)->duplMyselfAsLTPspecies(); + thermalCond = (right.thermalCond)->duplMyselfAsLTPspecies(); } if (right.electCond) { electCond = (right.electCond)->duplMyselfAsLTPspecies(); diff --git a/src/transport/LiquidTransportParams.cpp b/src/transport/LiquidTransportParams.cpp index bb1b84a43..23068c1bc 100644 --- a/src/transport/LiquidTransportParams.cpp +++ b/src/transport/LiquidTransportParams.cpp @@ -55,7 +55,7 @@ LiquidTransportParams::LiquidTransportParams(const LiquidTransportParams& right) operator=(right); } -LiquidTransportParams& LiquidTransportParams::operator=(const LiquidTransportParams& right) +LiquidTransportParams& LiquidTransportParams::operator=(const LiquidTransportParams& right) { if (&right != this) { return *this; diff --git a/src/transport/MMCollisionInt.cpp b/src/transport/MMCollisionInt.cpp index 79fe1a8bb..3a29a62ac 100644 --- a/src/transport/MMCollisionInt.cpp +++ b/src/transport/MMCollisionInt.cpp @@ -234,14 +234,14 @@ void MMCollisionInt::init(doublereal tsmin, doublereal tsmax, int log_level) m_nmin = 0; m_nmax = 36; } - if (DEBUG_MODE_ENABLED && m_loglevel > 0) { + if (DEBUG_MODE_ENABLED && m_loglevel > 0) { writelogf("T*_min = %g\n", tstar[m_nmin + 1]); writelogf("T*_max = %g\n", tstar[m_nmax + 1]); } m_logTemp.resize(37); doublereal rmserr, e22 = 0.0, ea = 0.0, eb = 0.0, ec = 0.0; - if (DEBUG_MODE_ENABLED && m_loglevel > 0) { + if (DEBUG_MODE_ENABLED && m_loglevel > 0) { writelog("Collision integral fits at each tabulated T* vs. delta*.\n" "These polynomial fits are used to interpolate between " "columns (delta*)\n in the Monchick and Mason tables." diff --git a/src/transport/MMCollisionInt.h b/src/transport/MMCollisionInt.h index 856d1286b..b99abd900 100644 --- a/src/transport/MMCollisionInt.h +++ b/src/transport/MMCollisionInt.h @@ -33,7 +33,7 @@ public: * @param loglevel Set the loglevel for the object. The default * loglevel is zero, indicating no output. */ - void init(doublereal tsmin, doublereal tsmax, int loglevel = 0); + void init(doublereal tsmin, doublereal tsmax, int loglevel = 0); doublereal omega22(double ts, double deltastar); doublereal astar(double ts, double deltastar); @@ -49,10 +49,10 @@ public: private: doublereal fitDelta(int table, int ntstar, int degree, doublereal* c); - std::vector m_o22poly; - std::vector m_apoly; - std::vector m_bpoly; - std::vector m_cpoly; + std::vector m_o22poly; + std::vector m_apoly; + std::vector m_bpoly; + std::vector m_cpoly; static doublereal delta[8]; static doublereal tstar22[37]; @@ -76,7 +76,7 @@ private: static doublereal cstar_table[39*8]; //! Log temp - vector_fp m_logTemp; + vector_fp m_logTemp; int m_nmin; int m_nmax; diff --git a/src/transport/MixTransport.cpp b/src/transport/MixTransport.cpp index c9d8c4be2..211aa814d 100644 --- a/src/transport/MixTransport.cpp +++ b/src/transport/MixTransport.cpp @@ -29,7 +29,7 @@ MixTransport::MixTransport(const MixTransport& right) : *this = right; } -MixTransport& MixTransport::operator=(const MixTransport& right) +MixTransport& MixTransport::operator=(const MixTransport& right) { if (&right == this) { return *this; @@ -103,7 +103,7 @@ void MixTransport::getSpeciesFluxes(size_t ndim, const doublereal* const grad_T, update_C(); getMixDiffCoeffs(DATA_PTR(m_spwork)); const vector_fp& mw = m_thermo->molecularWeights(); - const doublereal* y = m_thermo->massFractions(); + const doublereal* y = m_thermo->massFractions(); doublereal rhon = m_thermo->molarDensity(); vector_fp sum(ndim,0.0); for (size_t n = 0; n < ndim; n++) { diff --git a/src/transport/MultiTransport.cpp b/src/transport/MultiTransport.cpp index 228859013..4f6d79619 100644 --- a/src/transport/MultiTransport.cpp +++ b/src/transport/MultiTransport.cpp @@ -405,7 +405,7 @@ void MultiTransport::getMultiDiffCoeffs(const size_t ld, doublereal* const d) throw CanteraError("MultiTransport::getMultiDiffCoeffs", string(" invert returned ierr = ")+int2str(ierr)); } - m_l0000_ok = false; // matrix is overwritten by inverse + m_l0000_ok = false; // matrix is overwritten by inverse m_lmatrix_soln_ok = false; doublereal prefactor = 16.0 * m_temp @@ -428,7 +428,7 @@ void MultiTransport::update_T() GasTransport::update_T(); // temperature has changed, so polynomial fits will need to be // redone, and the L matrix reevaluated. - m_abc_ok = false; + m_abc_ok = false; m_lmatrix_soln_ok = false; m_l0000_ok = false; } @@ -477,7 +477,7 @@ void MultiTransport::updateThermal_T() m_bstar(i,j) = poly8(z, DATA_PTR(m_bstar_poly[ipoly])); m_cstar(i,j) = poly8(z, DATA_PTR(m_cstar_poly[ipoly])); } - m_om22(j,i) = m_om22(i,j); + m_om22(j,i) = m_om22(i,j); m_astar(j,i) = m_astar(i,j); m_bstar(j,i) = m_bstar(i,j); m_cstar(j,i) = m_cstar(i,j); @@ -529,7 +529,7 @@ void MultiTransport::eval_L0000(const doublereal* const x) { doublereal prefactor = 16.0*m_temp/25.0; doublereal sum; - for (size_t i = 0; i < m_nsp; i++) { + for (size_t i = 0; i < m_nsp; i++) { // subtract-off the k=i term to account for the first delta // function in Eq. (12.121) sum = -x[i]/m_bdiff(i,i); @@ -587,20 +587,20 @@ void MultiTransport::eval_L1010(const doublereal* x) for (size_t j = 0; j < m_nsp; j++) { // get constant terms that depend on just species "j" - constant1 = prefactor*x[j]; - wjsq = m_mw[j]*m_mw[j]; - constant2 = 13.75*wjsq; - constant3 = m_crot[j]/m_rotrelax[j]; - constant4 = 7.5*wjsq; - fourmj = 4.0*m_mw[j]; - threemjsq = 3.0*m_mw[j]*m_mw[j]; - sum = 0.0; + constant1 = prefactor*x[j]; + wjsq = m_mw[j]*m_mw[j]; + constant2 = 13.75*wjsq; + constant3 = m_crot[j]/m_rotrelax[j]; + constant4 = 7.5*wjsq; + fourmj = 4.0*m_mw[j]; + threemjsq = 3.0*m_mw[j]*m_mw[j]; + sum = 0.0; for (size_t i = 0; i < m_nsp; i++) { sumwij = m_mw[i] + m_mw[j]; term1 = m_bdiff(i,j) * sumwij*sumwij; term2 = fourmj*m_astar(i,j)*(1.0 + fiveover3pi* (constant3 + - (m_crot[i]/m_rotrelax[i]))); // see Eq. (12.125) + (m_crot[i]/m_rotrelax[i]))); // see Eq. (12.125) m_Lmatrix(i+m_nsp,j+m_nsp) = constant1*x[i]*m_mw[i] /(m_mw[j]*term1) * (constant2 - threemjsq*m_bstar(i,j) @@ -657,7 +657,7 @@ void MultiTransport::eval_L0100() size_t n2 = 2*m_nsp; for (size_t j = 0; j < m_nsp; j++) { for (size_t i = 0; i < m_nsp; i++) { - m_Lmatrix(i+n2,j) = 0.0; // see Eq. (12.123) + m_Lmatrix(i+n2,j) = 0.0; // see Eq. (12.123) } } } @@ -667,7 +667,7 @@ void MultiTransport::eval_L0110() size_t n2 = 2*m_nsp; for (size_t j = 0; j < m_nsp; j++) { for (size_t i = 0; i < m_nsp; i++) { - m_Lmatrix(i+n2,j+m_nsp) = m_Lmatrix(j+m_nsp,i+n2); // see Eq. (12.123) + m_Lmatrix(i+n2,j+m_nsp) = m_Lmatrix(j+m_nsp,i+n2); // see Eq. (12.123) } } } diff --git a/src/transport/SimpleTransport.cpp b/src/transport/SimpleTransport.cpp index 6bff5d739..ffc5a43e5 100644 --- a/src/transport/SimpleTransport.cpp +++ b/src/transport/SimpleTransport.cpp @@ -66,11 +66,11 @@ SimpleTransport& SimpleTransport::operator=(const SimpleTransport& right) } Transport::operator=(right); - tempDepType_ = right.tempDepType_; - compositionDepType_ = right.compositionDepType_; - useHydroRadius_ = right.useHydroRadius_; - doMigration_ = right.doMigration_; - m_mw = right.m_mw; + 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 nSpecies(); + m_nsp = m_thermo->nSpecies(); /* * Read the transport block in the phase XML Node @@ -242,12 +242,12 @@ bool SimpleTransport::initLiquid(LiquidTransportParams& tr) m_Grad_V.resize(m_nDim, 0.0); // set all flags to false - m_visc_mix_ok = false; - m_visc_temp_ok = false; + m_visc_mix_ok = false; + m_visc_temp_ok = false; m_cond_temp_ok = false; - m_cond_mix_ok = false; - m_diff_temp_ok = false; - m_diff_mix_ok = false; + m_cond_mix_ok = false; + m_diff_temp_ok = false; + m_diff_mix_ok = false; return true; } @@ -317,7 +317,7 @@ void SimpleTransport::getMobilities(doublereal* const mobil) } } -void SimpleTransport::getFluidMobilities(doublereal* const mobil_f) +void SimpleTransport::getFluidMobilities(doublereal* const mobil_f) { getMixDiffCoeffs(DATA_PTR(m_spwork)); doublereal c1 = 1.0 / (GasConstant * m_temp); @@ -392,13 +392,13 @@ void SimpleTransport::getSpeciesVdiff(size_t ndim, { set_Grad_T(grad_T); set_Grad_X(grad_X); - const doublereal* y = m_thermo->massFractions(); + const doublereal* y = m_thermo->massFractions(); const doublereal rho = m_thermo->density(); getSpeciesFluxesExt(m_nsp, DATA_PTR(Vdiff)); for (size_t n = 0; n < m_nDim; n++) { for (size_t k = 0; k < m_nsp; k++) { if (y[k] > 1.0E-200) { - Vdiff[n * m_nsp + k] *= 1.0 / (rho * y[k]); + Vdiff[n * m_nsp + k] *= 1.0 / (rho * y[k]); } else { Vdiff[n * m_nsp + k] = 0.0; } @@ -407,20 +407,20 @@ void SimpleTransport::getSpeciesVdiff(size_t ndim, } void SimpleTransport::getSpeciesVdiffES(size_t ndim, const doublereal* grad_T, - int ldx, const doublereal* grad_X, - int ldf, const doublereal* grad_Phi, + int ldx, const doublereal* grad_X, + int ldf, const doublereal* grad_Phi, doublereal* Vdiff) { set_Grad_T(grad_T); set_Grad_X(grad_X); set_Grad_V(grad_Phi); - const doublereal* y = m_thermo->massFractions(); + const doublereal* y = m_thermo->massFractions(); const doublereal rho = m_thermo->density(); getSpeciesFluxesExt(m_nsp, DATA_PTR(Vdiff)); for (size_t n = 0; n < m_nDim; n++) { for (size_t k = 0; k < m_nsp; k++) { if (y[k] > 1.0E-200) { - Vdiff[n * m_nsp + k] *= 1.0 / (rho * y[k]); + Vdiff[n * m_nsp + k] *= 1.0 / (rho * y[k]); } else { Vdiff[n * m_nsp + k] = 0.0; } @@ -428,7 +428,7 @@ void SimpleTransport::getSpeciesVdiffES(size_t ndim, const doublereal* grad_T, } } -void SimpleTransport::getSpeciesFluxes(size_t ndim, const doublereal* const grad_T, +void SimpleTransport::getSpeciesFluxes(size_t ndim, const doublereal* const grad_T, size_t ldx, const doublereal* const grad_X, size_t ldf, doublereal* const fluxes) { @@ -446,12 +446,12 @@ void SimpleTransport::getSpeciesFluxesExt(size_t ldf, doublereal* fluxes) getMixDiffCoeffs(DATA_PTR(m_spwork)); const vector_fp& mw = m_thermo->molecularWeights(); - const doublereal* y = m_thermo->massFractions(); + const doublereal* y = m_thermo->massFractions(); doublereal concTotal = m_thermo->molarDensity(); // Unroll wrt ndim if (doMigration_) { - double FRT = ElectronCharge / (Boltzmann * m_temp); + double FRT = ElectronCharge / (Boltzmann * m_temp); for (size_t n = 0; n < m_nDim; n++) { rhoVc[n] = 0.0; for (size_t k = 0; k < m_nsp; k++) { @@ -547,7 +547,7 @@ bool SimpleTransport::update_C() concTot_ += m_concentrations[k]; } dens_ = m_thermo->density(); - meanMolecularWeight_ = m_thermo->meanMolecularWeight(); + meanMolecularWeight_ = m_thermo->meanMolecularWeight(); } if (qReturn) { return false; @@ -579,7 +579,7 @@ void SimpleTransport::updateDiff_T() double visc = viscosity(); double RT = GasConstant * m_temp; for (size_t k = 0; k < m_nsp; k++) { - double rad = m_coeffHydroRadius_Ns[k]->getSpeciesTransProp() ; + double rad = m_coeffHydroRadius_Ns[k]->getSpeciesTransProp(); m_diffSpecies[k] = RT / (6.0 * Pi * visc * rad); } } else { @@ -626,7 +626,7 @@ bool SimpleTransport::update_T() // interpolations will need to be reevaluated. // Set all of these flags to false m_visc_mix_ok = false; - m_visc_temp_ok = false; + m_visc_temp_ok = false; m_cond_temp_ok = false; m_cond_mix_ok = false; m_diff_mix_ok = false; diff --git a/src/transport/SolidTransport.cpp b/src/transport/SolidTransport.cpp index 5010aa6aa..19beef4be 100644 --- a/src/transport/SolidTransport.cpp +++ b/src/transport/SolidTransport.cpp @@ -42,7 +42,7 @@ SolidTransport& SolidTransport::operator=(const SolidTransport& b) } Transport::operator=(b); - m_nmobile = b.m_nmobile; + m_nmobile = b.m_nmobile; m_Adiff = b.m_Adiff; m_Ndiff = b.m_Ndiff; m_Ediff = b.m_Ediff; @@ -65,9 +65,9 @@ bool SolidTransport::initSolid(SolidTransportData& tr) { m_thermo = tr.thermo; tr.thermo = 0; - m_ionConductivity = tr.ionConductivity; + m_ionConductivity = tr.ionConductivity; tr.ionConductivity = 0; - m_electConductivity = tr.electConductivity; + m_electConductivity = tr.electConductivity; tr.electConductivity = 0; m_thermalConductivity = tr.thermalConductivity; tr.thermalConductivity = 0; diff --git a/src/transport/SolidTransportData.cpp b/src/transport/SolidTransportData.cpp index a0f3f1838..aa0b44410 100644 --- a/src/transport/SolidTransportData.cpp +++ b/src/transport/SolidTransportData.cpp @@ -34,13 +34,13 @@ SolidTransportData& SolidTransportData::operator=(const SolidTransportData& righ { if (&right != this) { // These are all shallow pointer copies - yes, yes, yes horrible crime. - speciesName = right.speciesName; + speciesName = right.speciesName; if (right.ionConductivity) { ionConductivity = (right.ionConductivity)->duplMyselfAsLTPspecies(); } if (right.thermalConductivity) { - thermalConductivity = (right.thermalConductivity)->duplMyselfAsLTPspecies(); + thermalConductivity = (right.thermalConductivity)->duplMyselfAsLTPspecies(); } if (right.electConductivity) { electConductivity = (right.electConductivity)->duplMyselfAsLTPspecies(); diff --git a/src/transport/TransportBase.cpp b/src/transport/TransportBase.cpp index 329027d8a..d862611c2 100644 --- a/src/transport/TransportBase.cpp +++ b/src/transport/TransportBase.cpp @@ -19,10 +19,10 @@ Transport::Transport(thermo_t* thermo, size_t ndim) : Transport::Transport(const Transport& right) { - m_thermo = right.m_thermo; - m_ready = right.m_ready; - m_nsp = right.m_nsp; - m_nDim = right.m_nDim; + 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; } @@ -31,10 +31,10 @@ Transport& Transport::operator=(const Transport& right) 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_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; } diff --git a/src/transport/TransportFactory.cpp b/src/transport/TransportFactory.cpp index 2388b2d92..304073238 100644 --- a/src/transport/TransportFactory.cpp +++ b/src/transport/TransportFactory.cpp @@ -37,7 +37,7 @@ public: * @param msg String message to be sent to the user */ TransportDBError(size_t linenum, const std::string& msg) : - CanteraError("getTransportData", "error reading transport data: " + msg + "\n") { + CanteraError("getTransportData", "error reading transport data: " + msg + "\n") { } }; @@ -330,7 +330,7 @@ void TransportFactory::setupSolidTransport(thermo_t* thermo, int log_level, } } -void TransportFactory::initLiquidTransport(Transport* tran, +void TransportFactory::initLiquidTransport(Transport* tran, thermo_t* thermo, int log_level) { @@ -340,7 +340,7 @@ void TransportFactory::initLiquidTransport(Transport* tran, tran->initLiquid(trParam); } -void TransportFactory::initSolidTransport(Transport* tran, +void TransportFactory::initSolidTransport(Transport* tran, thermo_t* thermo, int log_level) { @@ -396,10 +396,10 @@ void TransportFactory::getLiquidSpeciesTransportData(const std::vectorspeciesIndex(specName.c_str()); - data.selfDiffusion[index] = newLTP(propSpecNode, name, m_tranPropMap[nodeName], temp_thermo); + data.selfDiffusion[index] = newLTP(propSpecNode, name, m_tranPropMap[nodeName], temp_thermo); }; }; break; @@ -466,7 +466,7 @@ void TransportFactory::getLiquidSpeciesTransportData(const std::vectorsecond; diff --git a/src/transport/WaterTransport.cpp b/src/transport/WaterTransport.cpp index 661e60fc7..1aebd0f7e 100644 --- a/src/transport/WaterTransport.cpp +++ b/src/transport/WaterTransport.cpp @@ -21,7 +21,7 @@ WaterTransport::WaterTransport(const WaterTransport& right) : *this = right; } -WaterTransport& WaterTransport::operator=(const WaterTransport& right) +WaterTransport& WaterTransport::operator=(const WaterTransport& right) { if (&right != this) { return *this; @@ -35,7 +35,7 @@ WaterTransport& WaterTransport::operator=(const WaterTransport& right) return *this; } -Transport* WaterTransport::duplMyselfAsTransport() const +Transport* WaterTransport::duplMyselfAsTransport() const { return new WaterTransport(*this); } diff --git a/src/zeroD/FlowReactor.cpp b/src/zeroD/FlowReactor.cpp index 9ef906380..ed6515e5a 100644 --- a/src/zeroD/FlowReactor.cpp +++ b/src/zeroD/FlowReactor.cpp @@ -46,9 +46,9 @@ void FlowReactor::initialize(doublereal t0) void FlowReactor::updateState(doublereal* y) { - // Set the mass fractions and density of the mixture. - m_dist = y[0]; - m_speed = y[1]; + // Set the mass fractions and density of the mixture. + m_dist = y[0]; + m_speed = y[1]; doublereal* mss = y + 2; m_thermo->setMassFractions(mss); doublereal rho = m_rho0 * m_speed0/m_speed; @@ -95,7 +95,7 @@ void FlowReactor::evalEqs(doublereal time, doublereal* y, const doublereal* mw = DATA_PTR(m_thermo->molecularWeights()); if (m_chem) { - m_kin->getNetProductionRates(ydot+2); // "omega dot" + m_kin->getNetProductionRates(ydot+2); // "omega dot" } else { fill(ydot + 2, ydot + 2 + m_nsp, 0.0); } diff --git a/src/zeroD/ReactorFactory.cpp b/src/zeroD/ReactorFactory.cpp index ad781c394..bafdf456d 100644 --- a/src/zeroD/ReactorFactory.cpp +++ b/src/zeroD/ReactorFactory.cpp @@ -25,10 +25,10 @@ static string _types[] = {"Reservoir", "Reactor", "ConstPressureReactor", }; // these constants are defined in ReactorBase.h -static int _itypes[] = {ReservoirType, ReactorType, ConstPressureReactorType, - FlowReactorType, IdealGasReactorType, - IdealGasConstPressureReactorType - }; +static int _itypes[] = {ReservoirType, ReactorType, ConstPressureReactorType, + FlowReactorType, IdealGasReactorType, + IdealGasConstPressureReactorType + }; /** * This method returns a new instance of a subclass of ThermoPhase diff --git a/test_problems/cathermo/HMW_dupl_test/HMW_dupl_test.cpp b/test_problems/cathermo/HMW_dupl_test/HMW_dupl_test.cpp index 9948ffbd2..d3bbe3b12 100644 --- a/test_problems/cathermo/HMW_dupl_test/HMW_dupl_test.cpp +++ b/test_problems/cathermo/HMW_dupl_test/HMW_dupl_test.cpp @@ -145,7 +145,7 @@ int main(int argc, char** argv) HMW->getCp_R(Cp0_R); - Cp0_H2O = Cp0_R[0] * GasConstant * 1.0E-6; + 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; /* @@ -162,8 +162,8 @@ int main(int argc, char** argv) HMW->getPartialMolarCp(pmCp); - Cp_H2O = pmCp[0] * 1.0E-6; - Cp_Naplus = pmCp[i1] * 1.0E-6; + 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); @@ -174,7 +174,7 @@ int main(int argc, char** argv) * Calculate the heat capacity of solution for the reaction * NaCl(s) -> Na+ + Cl- */ - double Delta_Cps = (Xmol[0] * Cp_H2O + + double Delta_Cps = (Xmol[0] * Cp_H2O + Xmol[i1] * Cp_Naplus + Xmol[i2] * Cp_Clminus - Xmol[0] * Cp0_H2O @@ -186,7 +186,7 @@ int main(int argc, char** argv) * Calculate the relative heat capacity, J, from the * partial molar quantities, units J/gmolSolutionK */ - double J = (Xmol[0] * (Cp_H2O - Cp0_H2O) + + double J = (Xmol[0] * (Cp_H2O - Cp0_H2O) + Xmol[i1] * (Cp_Naplus - Cp0_Naplus) + Xmol[i2] * (Cp_Clminus - Cp0_Clminus)); @@ -223,17 +223,17 @@ int main(int argc, char** argv) 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("%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); + 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); + 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); + Cp0_NaCl, Cp_NaCl, Cp_NaCl-Cp0_NaCl); } diff --git a/test_problems/cathermo/HMW_graph_CpvT/Cp_standalone.cpp b/test_problems/cathermo/HMW_graph_CpvT/Cp_standalone.cpp index e7de6b7c9..3eea6ada4 100644 --- a/test_problems/cathermo/HMW_graph_CpvT/Cp_standalone.cpp +++ b/test_problems/cathermo/HMW_graph_CpvT/Cp_standalone.cpp @@ -58,7 +58,7 @@ double Beta1(double temp, int ifunc) double retn; double tref = 298.15; if (ifunc == 0) { - retn = q6 + q9 * (temp - tref) + retn = q6 + q9 * (temp - tref) + q10 * (temp * temp - tref * tref); } else if (ifunc == 1) { retn = q9 + 2.0 * q10 * temp; @@ -86,7 +86,7 @@ double Cphi(double temp, int ifunc) + q13 / temp + q14; } else if (ifunc == 2) { retn = + 2.0 * q12 / (temp * temp * temp) - - q13 / (temp * temp) ; + - q13 / (temp * temp); } else { exit(-1); } @@ -147,8 +147,8 @@ void calc(double temp, double Iionic) double Cppmx = 0.5 * sqrt(vm * vx) * cphiprime2; - double Bmx = Bppmx + 2.0 / temp * Bpmx; - double Cmx = Cppmx + 2.0 / temp * Cpmx; + double Bmx = Bppmx + 2.0 / temp * Bpmx; + double Cmx = Cppmx + 2.0 / temp * Cpmx; double phiJ = v * zm * zx * (A_J/(2.*b)) * log(1 + 1.2 * sqrtI) - 2 * vm * vx * GasConst * temp * temp * (m * Bmx + m * m * Cmx); diff --git a/test_problems/cathermo/HMW_graph_CpvT/HMW_graph_CpvT.cpp b/test_problems/cathermo/HMW_graph_CpvT/HMW_graph_CpvT.cpp index d053993b0..ef2c7eabf 100644 --- a/test_problems/cathermo/HMW_graph_CpvT/HMW_graph_CpvT.cpp +++ b/test_problems/cathermo/HMW_graph_CpvT/HMW_graph_CpvT.cpp @@ -150,7 +150,7 @@ int main(int argc, char** argv) HMW->getPartialMolarCp(pmCp); - Cp_H2O = pmCp[0] * 1.0E-6; + Cp_H2O = pmCp[0] * 1.0E-6; Cp_Naplus = pmCp[i1] * 1.0E-6; Cp_Clminus = pmCp[i2] * 1.0E-6; @@ -160,7 +160,7 @@ int main(int argc, char** argv) * Calculate the heat capacity of solution for the reaction * NaCl(s) -> Na+ + Cl- */ - double Delta_Cps = (Xmol[0] * Cp_H2O + + double Delta_Cps = (Xmol[0] * Cp_H2O + Xmol[i1] * Cp_Naplus + Xmol[i2] * Cp_Clminus - Xmol[0] * Cp0_H2O @@ -172,7 +172,7 @@ int main(int argc, char** argv) * Calculate the relative heat capacity, J, from the * partial molar quantities, units J/gmolSolutionK */ - double J = (Xmol[0] * (Cp_H2O - Cp0_H2O) + + double J = (Xmol[0] * (Cp_H2O - Cp0_H2O) + Xmol[i1] * (Cp_Naplus - Cp0_Naplus) + Xmol[i2] * (Cp_Clminus - Cp0_Clminus)); @@ -199,7 +199,7 @@ int main(int argc, char** argv) if (i != TTable.NPoints+1) { printf("%13.5g, %13.5g, %13.5g, %13.5g, %13.5g, %13.5g, " "%13.5g, %13.5g, %13.5g, %13.5g\n", - T, pres*1.0E-5, Aphi, AJ/GasConstant, Delta_Cp0s, Delta_Cps, + T, pres*1.0E-5, Aphi, AJ/GasConstant, Delta_Cp0s, Delta_Cps, J, phiJ, molarCp , molarCp0); } @@ -210,17 +210,17 @@ int main(int argc, char** argv) printf(" Species MoleFrac Molal Cp0 " " partCp (partCp - Cp0)\n"); printf(" H2O(L)"); - printf("%13.5g %13.5g %13.5g %13.5g %13.5g\n", Xmol[0], moll[0], Cp0_H2O , Cp_H2O, Cp_H2O-Cp0_H2O); + printf("%13.5g %13.5g %13.5g %13.5g %13.5g\n", Xmol[0], moll[0], Cp0_H2O, Cp_H2O, Cp_H2O-Cp0_H2O); printf(" Na+ "); printf("%13.5g %13.5g %13.5g %13.5g %13.5g\n", Xmol[i1], moll[i1], - Cp0_Naplus , Cp_Naplus, Cp_Naplus -Cp0_Naplus); + Cp0_Naplus, Cp_Naplus, Cp_Naplus-Cp0_Naplus); printf(" Cl- "); printf("%13.5g %13.5g %13.5g %13.5g %13.5g\n", Xmol[i2], moll[i2], - Cp0_Clminus , Cp_Clminus, Cp_Clminus - Cp0_Clminus); + Cp0_Clminus, Cp_Clminus, Cp_Clminus-Cp0_Clminus); printf(" NaCl(s)"); printf("%13.5g %13.5g %13.5g %13.5g\n", 1.0, - Cp0_NaCl , Cp_NaCl, Cp_NaCl - Cp0_NaCl); + Cp0_NaCl, Cp_NaCl, Cp_NaCl-Cp0_NaCl); delete HMW; diff --git a/test_problems/cathermo/HMW_graph_GvT/Gex_standalone.cpp b/test_problems/cathermo/HMW_graph_GvT/Gex_standalone.cpp index a250531a0..f4059dbf1 100644 --- a/test_problems/cathermo/HMW_graph_GvT/Gex_standalone.cpp +++ b/test_problems/cathermo/HMW_graph_GvT/Gex_standalone.cpp @@ -23,7 +23,7 @@ double Beta1(double temp) double q9 = 6.1608E-5; double q10 = 1.0715E-6; double tref = 298.15; - return q6 + q9 * (temp - tref) + return q6 + q9 * (temp - tref) + q10 * (temp * temp - tref * tref); } diff --git a/test_problems/cathermo/HMW_graph_HvT/HMW_graph_HvT.cpp b/test_problems/cathermo/HMW_graph_HvT/HMW_graph_HvT.cpp index 0ae544f29..89251093d 100644 --- a/test_problems/cathermo/HMW_graph_HvT/HMW_graph_HvT.cpp +++ b/test_problems/cathermo/HMW_graph_HvT/HMW_graph_HvT.cpp @@ -151,12 +151,12 @@ int main(int argc, char** argv) solid->getPartialMolarEnthalpies(pmEnth); H_NaCl = pmEnth[0] * 1.0E-6; HMW->getPartialMolarEnthalpies(pmEnth); - H_H2O = pmEnth[0] * 1.0E-6; + H_H2O = pmEnth[0] * 1.0E-6; H_Naplus = pmEnth[i1] * 1.0E-6; H_Clminus = pmEnth[i2] * 1.0E-6; molarEnth = HMW->enthalpy_mole() * 1.0E-6; - double Delta_Hs = (Xmol[0] * H_H2O + + double Delta_Hs = (Xmol[0] * H_H2O + Xmol[i1] * H_Naplus + Xmol[i2] * H_Clminus - Xmol[0] * H0_H2O @@ -167,7 +167,7 @@ int main(int argc, char** argv) * Calculate the relative enthalpy, L, from the * partial molar quantities. units kJ/gmolSolution */ - double L = (Xmol[0] * (H_H2O - H0_H2O) + + double L = (Xmol[0] * (H_H2O - H0_H2O) + Xmol[i1] * (H_Naplus - H0_Naplus) + Xmol[i2] * (H_Clminus - H0_Clminus)); diff --git a/test_problems/cathermo/HMW_graph_VvT/HMW_graph_VvT.cpp b/test_problems/cathermo/HMW_graph_VvT/HMW_graph_VvT.cpp index cc1371c1d..d11b3faea 100644 --- a/test_problems/cathermo/HMW_graph_VvT/HMW_graph_VvT.cpp +++ b/test_problems/cathermo/HMW_graph_VvT/HMW_graph_VvT.cpp @@ -158,7 +158,7 @@ int main(int argc, char** argv) * Calculate the delta volume of solution for the reaction * NaCl(s) -> Na+ + Cl- */ - double Delta_Vs = (Xmol[0] * V_H2O + + double Delta_Vs = (Xmol[0] * V_H2O + Xmol[i1] * V_Naplus + Xmol[i2] * V_Clminus - Xmol[0] * V0_H2O @@ -170,7 +170,7 @@ int main(int argc, char** argv) * Calculate the apparent molar volume, J, from the * partial molar quantities, units m3/kmol */ - double Vex = (Xmol[0] * (V_H2O - V0_H2O) + + double Vex = (Xmol[0] * (V_H2O - V0_H2O) + Xmol[i1] * (V_Naplus - V0_Naplus) + Xmol[i2] * (V_Clminus - V0_Clminus)); diff --git a/test_problems/cathermo/HMW_graph_VvT/V_standalone.cpp b/test_problems/cathermo/HMW_graph_VvT/V_standalone.cpp index a417b5893..acd41a5d4 100644 --- a/test_problems/cathermo/HMW_graph_VvT/V_standalone.cpp +++ b/test_problems/cathermo/HMW_graph_VvT/V_standalone.cpp @@ -90,7 +90,7 @@ double Cphi(double temp, int ifunc) + q13 / temp + q14; } else if (ifunc == 2) { retn = + 2.0 * q12 / (temp * temp * temp) - - q13 / (temp * temp) ; + - q13 / (temp * temp); } else if (ifunc == 3) { retn = 0.0; } else { diff --git a/test_problems/shared/TemperatureTable.h b/test_problems/shared/TemperatureTable.h index 7799c9a9f..902166e49 100644 --- a/test_problems/shared/TemperatureTable.h +++ b/test_problems/shared/TemperatureTable.h @@ -5,7 +5,7 @@ */ #ifndef TEMPERATURE_TABLE_H -#define TEMPERATURE_TABLE_H +#define TEMPERATURE_TABLE_H #include #include @@ -24,7 +24,7 @@ class TemperatureTable public: size_t NPoints; - bool Include298; + bool Include298; double Tlow; //!< Min temperature for thermo data fit double Thigh; //!< Max temperature for thermo table double DeltaT; @@ -87,7 +87,7 @@ public: * * return the array value in the vector */ - double operator[](const int i) { + double operator[](const int i) { return T[i]; } /***********************************************************************/