diff --git a/Cantera/python/src/pycantera.cpp b/Cantera/python/src/pycantera.cpp index 87f1308c9..dc9655c5b 100644 --- a/Cantera/python/src/pycantera.cpp +++ b/Cantera/python/src/pycantera.cpp @@ -22,7 +22,6 @@ #include "numarray/arrayobject.h" #else #ifdef HAS_NUMPY -//#include "numpy/libnumarray.h" #include "numpy/arrayobject.h" #else // Create a compilation error to cause the program to bomb diff --git a/Cantera/src/base/Array.h b/Cantera/src/base/Array.h old mode 100755 new mode 100644 diff --git a/Cantera/src/base/config.h b/Cantera/src/base/config.h old mode 100755 new mode 100644 diff --git a/Cantera/src/base/ct_defs.h b/Cantera/src/base/ct_defs.h old mode 100755 new mode 100644 diff --git a/Cantera/src/base/ctexceptions.h b/Cantera/src/base/ctexceptions.h old mode 100755 new mode 100644 diff --git a/Cantera/src/base/ctml.cpp b/Cantera/src/base/ctml.cpp old mode 100755 new mode 100644 index 9e0cf934b..640cfa5dd --- a/Cantera/src/base/ctml.cpp +++ b/Cantera/src/base/ctml.cpp @@ -831,10 +831,12 @@ namespace ctml { return x; } - // This function reads a child node with the default name, "floatArray", with a value + // 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 a child node to the current XML node, with 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. diff --git a/Cantera/src/base/ctml.h b/Cantera/src/base/ctml.h old mode 100755 new mode 100644 index 5cfe45417..2fe84d95b --- a/Cantera/src/base/ctml.h +++ b/Cantera/src/base/ctml.h @@ -311,10 +311,12 @@ namespace ctml { const std::string &valueString, const std::string typeString=""); - //! This function reads a child node with the default name, "floatArray", with a value + //! 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 a child node to the current XML node, with 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. diff --git a/Cantera/src/base/global.h b/Cantera/src/base/global.h old mode 100755 new mode 100644 diff --git a/Cantera/src/base/misc.cpp b/Cantera/src/base/misc.cpp old mode 100755 new mode 100644 diff --git a/Cantera/src/base/plots.cpp b/Cantera/src/base/plots.cpp old mode 100755 new mode 100644 diff --git a/Cantera/src/base/plots.h b/Cantera/src/base/plots.h old mode 100755 new mode 100644 diff --git a/Cantera/src/base/stringUtils.cpp b/Cantera/src/base/stringUtils.cpp old mode 100755 new mode 100644 diff --git a/Cantera/src/base/stringUtils.h b/Cantera/src/base/stringUtils.h old mode 100755 new mode 100644 diff --git a/Cantera/src/base/utilities.h b/Cantera/src/base/utilities.h old mode 100755 new mode 100644 diff --git a/Cantera/src/base/vec_functions.h b/Cantera/src/base/vec_functions.h old mode 100755 new mode 100644 diff --git a/Cantera/src/base/xml.cpp b/Cantera/src/base/xml.cpp old mode 100755 new mode 100644 diff --git a/Cantera/src/base/xml.h b/Cantera/src/base/xml.h old mode 100755 new mode 100644 diff --git a/Cantera/src/oneD/Resid1D.h b/Cantera/src/oneD/Resid1D.h index 58f089ba7..871d28dfa 100644 --- a/Cantera/src/oneD/Resid1D.h +++ b/Cantera/src/oneD/Resid1D.h @@ -12,7 +12,9 @@ #ifndef CT_RESID1D_H #define CT_RESID1D_H - +/* + * NOTE: I don't think this file is used any longer. Thus, this is deprecated. + */ #include "../ctexceptions.h" #include "../xml.h" #include "refine.h" diff --git a/Cantera/src/thermo/PDSS.h b/Cantera/src/thermo/PDSS.h index 0ca22eb30..fa0bd9008 100644 --- a/Cantera/src/thermo/PDSS.h +++ b/Cantera/src/thermo/PDSS.h @@ -65,8 +65,8 @@ namespace Cantera { * but specifies the thermodynamics functions at all pressures. * * Class PDSS is the base class - * for a family of classes that compute properties of all - * species in a phase in their standard states, for a range of temperatures + * for a family of classes that compute properties of a single + * species in a phase at its standard states, for a range of temperatures * and pressures. * * Phases which use the %VPSSMGr class must have their respective @@ -115,7 +115,7 @@ namespace Cantera { * to complete the representation. * . * - * - PDSS_Water_ + * - PDSS_Water * - standardState model = "Water" * - This model assumes that * Species 0 is assumed to be water, and a real equation @@ -668,13 +668,13 @@ namespace Cantera { //! State of the system - pressure mutable doublereal m_pres; - //! reference state pressure of the species. + //! Reference state pressure of the species. doublereal m_p0; - //! minimum temperature + //! Minimum temperature doublereal m_minTemp; - //! maximum temperature + //! Maximum temperature doublereal m_maxTemp; //! Thermophase which this species belongs to. diff --git a/Cantera/src/thermo/PDSS_SSVol.cpp b/Cantera/src/thermo/PDSS_SSVol.cpp index 98e1b95b6..71ae96fd0 100644 --- a/Cantera/src/thermo/PDSS_SSVol.cpp +++ b/Cantera/src/thermo/PDSS_SSVol.cpp @@ -96,7 +96,7 @@ namespace Cantera { return (PDSS *) idg; } - /** + /* * constructPDSSXML: * * Initialization of a PDSS_SSVol object using an @@ -137,14 +137,14 @@ namespace Cantera { int num = getFloatArray(*ss, TCoeff_, true, "", "volumeTemperaturePolynomial"); if (num != 4) { throw CanteraError("PDSS_SSVol::constructPDSSXML", - " Didn't get 3 density polynomial numbers for species " + speciesNode.name()); + " Didn't get 4 density polynomial numbers for species " + speciesNode.name()); } } else if (model == "density_temperature_polynomial") { volumeModel_ = cSSVOLUME_DENSITY_TPOLY; int num = getFloatArray(*ss, TCoeff_, true, "", "densityTemperaturePolynomial"); if (num != 4) { throw CanteraError("PDSS_SSVol::constructPDSSXML", - " Didn't get 3 density polynomial numbers for species " + speciesNode.name()); + " Didn't get 4 density polynomial numbers for species " + speciesNode.name()); } } else { throw CanteraError("PDSS_SSVol::constructPDSSXML", @@ -155,7 +155,7 @@ namespace Cantera { } - /** + /* * constructPDSSFile(): * * Initialization of a PDSS_SSVol object using an @@ -237,7 +237,6 @@ namespace Cantera { return (val); } - doublereal PDSS_SSVol::intEnergy_mole() const { doublereal pVRT = (m_pres * m_Vss_ptr[m_spindex]) / (GasConstant * m_temp); diff --git a/Cantera/src/thermo/PDSS_SSVol.h b/Cantera/src/thermo/PDSS_SSVol.h index a2755fbf0..d750d400c 100644 --- a/Cantera/src/thermo/PDSS_SSVol.h +++ b/Cantera/src/thermo/PDSS_SSVol.h @@ -26,8 +26,141 @@ namespace Cantera { //! Class for pressure dependent standard states that uses a standard state volume //! model of some sort. /*! + * Class PDSS_SSVol is an implementation class that compute the properties of a single + * species in a phase at its standard states, for a range of temperatures + * and pressures. This particular class assumes that the calculation of the + * thermodynamics functions can be separated into a temperature polynomial representation + * for thermo functions that can be handled bey a SimpleThermo object and + * a separate calculation for the standard state volume. + * The Models include a cubic polynomial in temperature for either + * the standard state volume or the standard state density. + * The manager uses a SimpleThermo object to handle the + * calculation of the reference state. This object then adds the + * pressure dependencies and the volume terms to these thermo functions + * to complete the representation. * + * The class includes the following models for the representation of the + * standard state volume: * + * - Constant Volume + * - This standard state model is invoked with the keyword "constant_incompressible" + * or "constant". The standard state volume is considered constant. + * \f[ + * V^o_k(T,P) = a_0 + * \f] + * . + * + * - Temperature polynomial for the standard state volume + * - This standard state model is invoked with the keyword "temperature_polynomial". + * The standard state volume is considered a function of temperature only. + * \f[ + * V^o_k(T,P) = a_0 + a_1 T + a_2 T^2 + a_3 T^3 + a_4 T^4 + * \f] + * . + * + * - Temperature polynomial for the standard state density + * - This standard state model is invoked with the keyword "density_temperature_polynomial". + * The standard state density, which is the inverse of the volume, + * is considered a function of temperature only. + * \f[ + * {\rho}^o_k(T,P) = \frac{M_k}{V^o_k(T,P)} = a_0 + a_1 T + a_2 T^2 + a_3 T^3 + a_4 T^4 + * \f] + * . + * . + * + * Specification of Species Standard %State Properties + * + * The standard molar Gibbs free energy for species k is determined from the enthalpy + * and entropy expressions + * + * \f[ + * G^o_k(T,P) = H^o_k(T,P) - S^o_k(T,P) + * \f] + * + * The enthalpy is calculated mostly from the %SpeciesThermo object's enthalpy evalulator. The + * dependence on pressure originates from the Maxwell relation + * + * \f[ + * {\left(\frac{dH^o_k}{dP}\right)}_T = T {\left(\frac{dS^o_k}{dP}\right)}_T + V^o_k + * \f] + * which is equal to + * + * \f[ + * {\left(\frac{dH^o_k}{dP}\right)}_T = V^o_k - T {\left(\frac{dV^o_k}{dT}\right)}_P + * \f] + * + * The entropy is calculated mostly from the %SpeciesThermo objects entropy evalulator. The + * dependence on pressure originates from the Maxwell relation: + * + * \f[ + * {\left(\frac{dS^o_k}{dP}\right)}_T = - {\left(\frac{dV^o_k}{dT}\right)}_P + * \f] + * + * The standard state constant-pressure heat capacity expression is obtained from taking the + * temperature derivative of the Maxwell relation involving the enthalpy given above + * to yield an expression for the pressure dependence of the heat capacity. + * + * \f[ + * {\left(\frac{d{C}^o_{p,k}}{dP}\right)}_T = - T {\left(\frac{{d}^2{V}^o_k}{{dT}^2}\right)}_T + * \f] + * + * The standard molar Internal Energy for species k is determined from the following + * relation. + * + * \f[ + * U^o_k(T,P) = H^o_k(T,P) - p V^o_k + * \f] + * + * XML Example + * + * An example of the specification of a standard state for the LiCl molten salt + * which employs a constant molar volume expression. + * + @verbatim + + + Li:1 Cl:1 + + 0.02048004 + + + + + 73.18025, -9.047232, -0.316390, + 0.079587, 0.013594, -417.1314, + 157.6711 + + + + + + @endverbatim + * + * An example of the specification of a standard state for the LiCl molten salt + * which has a temperature dependent standard state volume. + * + @verbatim + + + Li:1 Cl:1 + + + 1.98715, -5.890906E-4, 0.0, 0.0 + + + + + + 73.18025, -9.047232, -0.316390, + 0.079587, 0.013594, -417.1314, + 157.6711 + + + + + + @endverbatim + * * * @ingroup pdssthermo */ diff --git a/Cantera/src/thermo/SimpleThermo.h b/Cantera/src/thermo/SimpleThermo.h index 2a548c739..e0536259f 100644 --- a/Cantera/src/thermo/SimpleThermo.h +++ b/Cantera/src/thermo/SimpleThermo.h @@ -52,7 +52,7 @@ namespace Cantera { public: //! Initialized to the type of parameterization - /*! + /*!A * Note, this value is used in some template functions. For this object the * value is SIMPLE. */ diff --git a/Cantera/src/thermo/State.cpp b/Cantera/src/thermo/State.cpp index 5fcdbbfa8..6191ce6bd 100644 --- a/Cantera/src/thermo/State.cpp +++ b/Cantera/src/thermo/State.cpp @@ -196,22 +196,22 @@ namespace Cantera { return density()/meanMolecularWeight(); } - void State::setConcentrations(const doublereal* const c) { + void State::setConcentrations(const doublereal* const conc) { int k; doublereal sum = 0.0, norm = 0.0; for (k = 0; k != m_kk; ++k) { - sum += c[k]*m_molwts[k]; - norm += c[k]; + sum += conc[k]*m_molwts[k]; + norm += conc[k]; } m_mmw = sum/norm; setDensity(sum); doublereal rsum = 1.0/sum; for (k = 0; k != m_kk; ++k) { - m_ym[k] = c[k] * rsum; + m_ym[k] = conc[k] * rsum; m_y[k] = m_ym[k] * m_molwts[k]; } - //! Call a routine to determin whether state has changed. + // Call a routine to determine whether state has changed. stateMFChangeCalc(); } diff --git a/Cantera/src/thermo/State.h b/Cantera/src/thermo/State.h index 4d403d4aa..d05941add 100644 --- a/Cantera/src/thermo/State.h +++ b/Cantera/src/thermo/State.h @@ -215,28 +215,29 @@ namespace Cantera { * @param k Index of species */ doublereal concentration(const int k) const; - //! Set the concentrations to the specified values within the //! phase. - /* + /*! * We set the concentrations here and therefore we set the * overall density of the phase. We hold the temperature constant * during this operation. Therefore, we have possibly changed * the pressure of the phase by calling this routine. * - * @param c The input vector to this routine is in dimensional - * units. For volumetric phases c[k] is the - * concentration of the kth species in kmol/m3. - * For surface phases, c[k] is the concentration - * in kmol/m2. The length of the vector is the number - * of species in the phase. + * @param conc The input vector to this routine is in dimensional + * units. For volumetric phases c[k] is the + * concentration of the kth species in kmol/m3. + * For surface phases, c[k] is the concentration + * in kmol/m2. The length of the vector is the number + * of species in the phase. */ - virtual void setConcentrations(const doublereal* const c); + virtual void setConcentrations(const doublereal* const conc); - /** - * Returns a read-only pointer to the start of the - * massFraction array + //! Returns a read-only pointer to the start of the + //! massFraction array + /*! + * The pointer returned is readonly + * @return returns a pointer to a vector of doubles of length m_kk. */ const doublereal* massFractions() const { return &m_y[0]; diff --git a/test_problems/fracCoeff/fracCoeff.cpp b/test_problems/fracCoeff/fracCoeff.cpp index ffbdae7c4..e32e1aded 100644 --- a/test_problems/fracCoeff/fracCoeff.cpp +++ b/test_problems/fracCoeff/fracCoeff.cpp @@ -169,6 +169,13 @@ int main(int argc, char** argv) { printf("Kc[0] = %g\n", kc[0]); printf("Kc[1] = %g\n", kc[1]); + + delete(iKin_ptr); + iKin_ptr = 0; + delete(gasTP); + delete(xc); + appdelete(); + } catch (CanteraError) {