diff --git a/Cantera/src/thermo/IdealMolalSoln.cpp b/Cantera/src/thermo/IdealMolalSoln.cpp index 438972494..15c3f3722 100644 --- a/Cantera/src/thermo/IdealMolalSoln.cpp +++ b/Cantera/src/thermo/IdealMolalSoln.cpp @@ -33,7 +33,6 @@ namespace Cantera { { } - /** * Copy Constructor: * @@ -105,7 +104,19 @@ namespace Cantera { // -------- Molar Thermodynamic Properties of the Solution --------------- // /** - * Molar enthalpy of the solution. Units: J/kmol. + * Molar enthalpy of the solution: Units: J/kmol. + * + * Returns the amount of enthalpy per mole of solution. + * For an ideal molal solution, + * \f[ + * \bar{h}(T, P, X_k) = \sum_k X_k \bar{h}_k(T) + * \f] + * The formula is written in terms of the partial molar enthalpies. + * \f$ \bar{h}_k(T, p, m_k) \f$. + * See the partial molar enthalpy function, getPartialMolarEnthalpies(), + * for details. + * + * Units: J/kmol */ doublereal IdealMolalSoln::enthalpy_mole() const { getPartialMolarEnthalpies(DATA_PTR(m_tmpV)); @@ -115,33 +126,77 @@ namespace Cantera { } /** - * Molar internal energy of the solution. Units: J/kmol. + * Molar internal energy of the solution: Units: J/kmol. + * + * Returns the amount of internal energy per mole of solution. + * For an ideal molal solution, + * \f[ + * \bar{u}(T, P, X_k) = \sum_k X_k \bar{u}_k(T) + * \f] + * The formula is written in terms of the partial molar internal energy. + * \f$ \bar{u}_k(T, p, m_k) \f$. */ doublereal IdealMolalSoln::intEnergy_mole() const { getPartialMolarEnthalpies(DATA_PTR(m_tmpV)); return mean_X(DATA_PTR(m_tmpV)); } + /** + * Molar entropy of the solution: Units J/kmol/K. + * + * Returns the amount of entropy per mole of solution. + * For an ideal molal solution, + * \f[ + * \bar{s}(T, P, X_k) = \sum_k X_k \bar{s}_k(T) + * \f] + * The formula is written in terms of the partial molar entropies. + * \f$ \bar{s}_k(T, p, m_k) \f$. + * See the partial molar entropies function, getPartialMolarEntropies(), + * for details. + * + * Units: J/kmol/K. + */ doublereal IdealMolalSoln::entropy_mole() const { getPartialMolarEntropies(DATA_PTR(m_tmpV)); return mean_X(DATA_PTR(m_tmpV)); } - /// Molar Gibbs function. Units: J/kmol. + /** + * Molar Gibbs function for the solution: Units J/kmol. + * + * Returns the gibbs free energy of the solution per mole + * of the solution. + * + * \f[ + * \bar{g}(T, P, X_k) = \sum_k X_k \mu_k(T) + * \f] + * + * Units: J/kmol + */ doublereal IdealMolalSoln::gibbs_mole() const { getChemPotentials(DATA_PTR(m_tmpV)); return mean_X(DATA_PTR(m_tmpV)); } - /// Molar heat capacity at constant pressure. Units: J/kmol/K. + /** + * Molar heat capacity at constant pressure: Units: J/kmol/K. + * * \f[ + * \bar{c}_p(T, P, X_k) = \sum_k X_k \bar{c}_{p,k}(T) + * \f] + * + * Units: J/kmol/K + */ doublereal IdealMolalSoln::cp_mole() const { getPartialMolarCp(DATA_PTR(m_tmpV)); double val = mean_X(DATA_PTR(m_tmpV)); return val; } - - /// Molar heat capacity at constant volume. Units: J/kmol/K. + /** + * Molar heat capacity at constant volume: Units: J/kmol/K. + * NOT IMPLEMENTED. + * Units: J/kmol/K + */ doublereal IdealMolalSoln::cv_mole() const { return err("not implemented"); } @@ -234,15 +289,15 @@ namespace Cantera { // /** - * This method returns an array of generalized concentrations - * \f$ C_k\f$ that are defined such that - * \f$ a_k = C_k / C^0_k, \f$ where \f$ C^0_k \f$ + * This method returns an array of activity concentrations \f$ C^a_k\f$. + * \f$ C^a_k\f$ are defined such that + * \f$ a_k = C^a_k / C^s_k, \f$ where \f$ C^s_k \f$ * is a standard concentration - * defined below. These generalized concentrations are used + * defined below. These activity concentrations are used * by kinetics manager classes to compute the forward and * reverse rates of elementary reactions. * - * @param c Array of generalized concentrations. The + * @param c Array of activity concentrations. The * units depend upon the implementation of the * reaction rate expressions within the phase. */ @@ -263,21 +318,16 @@ namespace Cantera { } /** - * The standard concentration \f$ C^0_k \f$ used to normalize - * the generalized concentration. In many cases, this quantity + * The standard concentration \f$ C^s_k \f$ used to normalize + * the activity concentration. In many cases, this quantity * will be the same for all species in a phase - for example, - * for an ideal gas \f$ C^0_k = P/\hat R T \f$. For this + * for an ideal gas \f$ C^s_k = P/\hat R T \f$. For this * reason, this method returns a single value, instead of an * array. However, for phases in which the standard * concentration is species-specific (e.g. surface species of * different sizes), this method may be called with an * optional parameter indicating the species. * - * For the time being we will use the concentration of pure - * solvent for the the standard concentration of all species. - * This has the effect of making reaction rates - * based on the molality of species proportional to the - * molality of the species. */ doublereal IdealMolalSoln::standardConcentration(int k) const { double c0, mvSolvent; @@ -393,22 +443,27 @@ namespace Cantera { // // ------ Partial Molar Properties of the Solution ----------------- // + /** - * Get the species chemical potentials. Units: J/kmol. + * Get the species chemical potentials: Units: J/kmol. * * This function returns a vector of chemical potentials of the * species in solution. * * \f[ - * \mu_k = \mu^{o}_k(T,P) + R T ln(m_k / m_units) + * \mu_k = \mu^{o}_k(T,P) + R T \ln(\frac{m_k}{m^\Delta}) * \f] - * - * where m_units is equal to 1 gmol kg-1 - * * \f[ - * \mu_solvent = \mu^{o}_solvent(T,P) + - * R T ((X_solvent - 1.0) / X_solvent) + * \mu_w = \mu^{o}_w(T,P) + + * R T ((X_w - 1.0) / X_w) * \f] + * + * \f$ w \f$ refers to the solvent species. + * \f$ X_w \f$ is the mole fraction of the solvent. + * \f$ m_k \f$ is the molality of the kth solute. + * \f$ m^\Delta is 1 gmol solute per kg solvent. \f$ + * + * Units: J/kmol. */ void IdealMolalSoln::getChemPotentials(doublereal* mu) const{ double xx; @@ -447,12 +502,12 @@ namespace Cantera { /** * Returns an array of partial molar enthalpies for the species - * in the mixture. - * Units (J/kmol) + * in the mixture: Units (J/kmol). + * * For this phase, the partial molar enthalpies are equal to the * SS species enthalpies * \f[ - * \bar h_k(T,P) = \hat h^{0}_k(T,P) + * \bar{h}_k(T,P) = \hat h^{0}_k(T,P) * \f] * * note hbar = ubar + T d(ubar/dT) @@ -467,31 +522,28 @@ namespace Cantera { } /** - * - * getPartialMolarEntropies() (virtual, const) - * * Returns an array of partial molar entropies of the species in the - * solution. Units: J/kmol. + * solution: Units: J/kmol. * * Maxwell's equations provide an insight in how to calculate this * (p.215 Smith and Van Ness) - * - * d(chemPot_i)/dT = -sbar_i - * - * + * \f[ + * \frac{d(\mu_k)}{dT} = -\bar{s}_i + * \f] * For this phase, the partial molar entropies are equal to the - * SS species entropies plus the ideal solution contribution. + * standard state species entropies plus the ideal molal solution contribution. * - * \f[ - * \bar s_k(T,P) = \hat s^0_k(T) - R log( molality[k] / m_units) + * \f[ + * \bar{s}_k(T,P) = s^0_k(T) - R log( m_k ) * \f] * \f[ - * \bar s_solvent(T,P) = \hat s^0_solvent(T) - * - R ((xmolSolvent - 1.0) / xmolSolvent) + * \bar{s}_w(T,P) = s^0_w(T) - R ((X_w - 1.0) / X_w) * \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 + * The subscript, w, refers to the solvent species. \f$ X_w \f$ is + * the mole fraction of solvent. + * The reference-state pure-species entropies,\f$ s^0_k(T) \f$, + * at the reference pressure, \f$ P_{ref} \f$, are computed by the * species thermodynamic * property manager. They are polynomial functions of temperature. * @see SpeciesThermo @@ -513,24 +565,33 @@ namespace Cantera { } /** - * returns an array of partial molar volumes of the species - * in the solution. Units: m^3 kmol-1. + * Returns an array of partial molar volumes of the species + * in the solution: Units: m^3 kmol-1. * * For this solution, the partial molar volumes are equal to the * constant species molar volumes. + * + * Units: m^3 kmol-1. */ void IdealMolalSoln::getPartialMolarVolumes(doublereal* vbar) const { getStandardVolumes(vbar); } - /* - * Partial molar heat capacity of the solution: - * The kth partial molar heat capacity is equal to + /** + * Partial molar heat capacity of the solution: Units: J/kmol/K. + * + * 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). + * \f[ + * \bar{Cp}_k(T,P) = {Cp}^0_k(T) + * \f] * - * Cp = -T d2(chemPot_i)/dT2 + * For this solution, this is equal to the reference state + * heat capacities. + * + * Units: J/kmol/K */ void IdealMolalSoln::getPartialMolarCp(doublereal* cpbar) const { /* @@ -549,10 +610,7 @@ namespace Cantera { * in the Solution ------------------ */ - /** - * getStandardChemPotentials() (virtual, const) - * - * + /** * Get the standard state chemical potentials of the species. * This is the array of chemical potentials at unit activity * (Mole fraction scale) @@ -600,9 +658,6 @@ namespace Cantera { } /** - * - * getPureGibbs() - * * Get the Gibbs functions for the pure species * at the current T and P of the solution. * We assume an incompressible constant partial molar @@ -610,9 +665,11 @@ namespace Cantera { * \f[ * \mu^0_k(T,p) = \mu^{ref}_k(T) + (P - P_{ref}) * V_k * \f] - * where \f$V_k\f$ is the molar volume of pure species k<\I>. + * where \f$V_k\f$ is the molar volume of pure species k. * \f$ u^{ref}_k(T)\f$ is the chemical potential of pure - * species k<\I> at the reference pressure, \f$P_{ref}\f$. + * species k at the reference pressure, \f$P_{ref}\f$. + * + * Units: J/kmol */ void IdealMolalSoln::getPureGibbs(doublereal* gpure) const { getGibbs_ref(gpure); @@ -626,9 +683,6 @@ namespace Cantera { } /** - * - * getEnthalpy_RT() (virtual, const) - * * Get the array of nondimensional Enthalpy functions for the ss * species at the current T and P of the solution. * We assume an incompressible constant partial molar @@ -636,9 +690,11 @@ namespace Cantera { * \f[ * h^0_k(T,P) = h^{ref}_k(T) + (P - P_{ref}) * V_k * \f] - * where \f$V_k\f$ is the molar volume of SS species k<\I>. + * where \f$V_k\f$ is the molar volume of SS species k. * \f$ h^{ref}_k(T)\f$ is the enthalpy of the SS - * species k<\I> at the reference pressure, \f$P_{ref}\f$. + * species k at the reference pressure, \f$P_{ref}\f$. + * + * Units: dimensionless. */ void IdealMolalSoln:: getEnthalpy_RT(doublereal* hrt) const { @@ -654,15 +710,19 @@ namespace Cantera { } /** - * getEntropy_R() (virtual, const) - * * Get the nondimensional Entropies for the species - * standard states at the current T and P of the solution. + * standard states: Units: J/kmol/K * * Note, this is equal to the reference state entropies - * due to the zero volume expansivity: + * due to the zero volume expansivity. * i.e., (dS/dp)_T = (dV/dT)_P = 0.0 * + * \f[ + * S^0_k(T,P) = S^{ref}_k(T) + * \f] + * + * Units: dimensionless + * * @param sr Vector of length m_kk, which on return sr[k] * will contain the nondimensional * standard state entropy of species k. @@ -675,8 +735,8 @@ namespace Cantera { /** * Get the nondimensional heat capacity at constant pressure * function for the species - * standard states at the current T and P of the solution. - * \f[ + * standard states: Units J/kmol/K + * \f[ * Cp^0_k(T,P) = Cp^{ref}_k(T) * \f] * where \f$V_k\f$ is the molar volume of pure species k. @@ -695,7 +755,12 @@ namespace Cantera { * Get the molar volumes of each species in their standard * states at the current * T and P of the solution. - * units = m^3 / kmol + * + * \f[ + * V^0_k(T,P) = V^{ref}_k() + * \f] + + * Units = m^3 / kmol */ void IdealMolalSoln::getStandardVolumes(doublereal *vol) const { copy(m_speciesMolarVolume.begin(), @@ -714,9 +779,10 @@ namespace Cantera { */ /** - * Initialization of an IdealSolidSolnPhase phase: - * Note this function is pretty much useless because it doesn't - * get the xml tree passed to it. Suggest a change. + * Initialization routine for an IdealMolalSoln phase: + * + * This is a virtual routine. This routine will call initThermo() + * for the parent class as well. */ void IdealMolalSoln::initThermo() { initLengths(); @@ -724,13 +790,13 @@ namespace Cantera { } /** - * Initialization of an IdealSolidSolnPhase phase using an + * Initialization of an IdealMolalSoln phase using an * xml file * - * This routine is a precursor to initThermo(XML_Node*) + * This routine is a precursor to constructPhaseFile(XML_Node*) * routine, which does most of the work. * - * @param infile XML file containing the description of the + * @param inputFile XML file containing the description of the * phase * * @param id Optional parameter identifying the name of the @@ -740,7 +806,7 @@ namespace Cantera { void IdealMolalSoln::constructPhaseFile(string inputFile, string id) { if (inputFile.size() == 0) { - throw CanteraError("IdealSolidSolnPhase::constructPhaseFile", + throw CanteraError("IdealMolalSoln::constructPhaseFile", "input file is null"); } string path = findInputFile(inputFile); @@ -769,7 +835,7 @@ namespace Cantera { } /** - * Import and initialize an IdealSolidSolnPhase phase + * Import and initialize an IdealMolalSoln phase * specification in an XML tree into the current object. * Here we read an XML description of the phase. * We import descriptions of the elements that make up the @@ -816,22 +882,17 @@ namespace Cantera { */ bool m_ok = importPhase(phaseNode, this); if (!m_ok) { - throw CanteraError("constructPhaseXML","importPhase failed "); + throw CanteraError("IdealMolalSoln::constructPhaseXML","importPhase failed "); } } /** - * Import and initialize an IdealSolidSolnPhase phase + * Import and initialize an IdealMolalSoln phase * specification in an XML tree into the current object. - * Here we read an XML description of the phase. - * We import descriptions of the elements that make up the - * species in a phase. - * We import information about the species, including their - * reference state thermodynamic polynomials. We then freeze - * the state of the species. * - * Then, we read the species molar volumes from the xml - * tree to finish the initialization. + * This routine is called from importPhase() to finish + * up the initialization of the thermo object. It reads in the + * species molar volumes. * * @param phaseNode This object must be the phase node of a * complete XML tree @@ -842,7 +903,7 @@ namespace Cantera { * the species in the phase. * @param id ID of the phase. If nonnull, a check is done * to see if phaseNode is pointing to the phase - * with the correct id. + * with the correct id. */ void IdealMolalSoln::initThermoXML(XML_Node& phaseNode, string id) { @@ -854,7 +915,7 @@ namespace Cantera { if (id.size() > 0) { string idp = phaseNode.id(); if (idp != id) { - throw CanteraError("initThermo", + throw CanteraError("IdealMolalSoln::initThermo", "phasenode and Id are incompatible"); } } @@ -1002,7 +1063,9 @@ namespace Cantera { } /** - * This internal function adjusts the lengths of arrays + * This internal function adjusts the lengths of arrays. + * + * This function is not virtual nor is it inherited */ void IdealMolalSoln::initLengths() { m_kk = nSpecies(); diff --git a/Cantera/src/thermo/IdealMolalSoln.h b/Cantera/src/thermo/IdealMolalSoln.h index 5b6222889..16621544d 100644 --- a/Cantera/src/thermo/IdealMolalSoln.h +++ b/Cantera/src/thermo/IdealMolalSoln.h @@ -22,12 +22,59 @@ namespace Cantera { - /** - * @defgroup thermoprops Thermodynamic Properties - * - * These classes are used to compute thermodynamic properties. - */ + /** \addtogroup thermoprops */ + /* @{ */ + + /** + * This phase is based upon the mixing-rule assumption that + * all molality-based activity coefficients are equal + * to one. + * + * This is a full instanteation of a ThermoPhase object. + * The assumption is that the molality-based activity + * coefficient is equal to one. This also implies that + * the osmotic coefficient is equal to one. + * + * Note, this does not mean that the solution is an + * ideal solution. In fact, there is a singularity in + * the formulation as + * the solvent concentration goes to zero. + * + * The mechanical equation of state is currently assumed to + * be that of an incompressible solution. This may change + * in the future. Each species has its own molar volume. + * The molar volume is a constant. + * + * Class IdealMolalSoln represents a condensed phase. + * The phase and the pure species phases which + * comprise the standard states of the species are assumed to have + * zero volume expansivity and zero isothermal compressibility. + * Each species does, however, have constant but distinct partial + * molar volumes equal to their pure species molar volumes. + * The class derives from class ThermoPhase, + * and overloads the virtual methods defined there with ones that + * use expressions appropriate for incompressible mixtures. + * + * The standard concentrations can have three different forms + * depending on the value of the member attribute m_formGC, which + * is supplied in the XML file. + * + * + * + * + * + * + *
m_formGC ActivityConc StandardConc
0 \f$ {m_k}/ { m^{\Delta}}\f$ \f$ 1.0 \f$
1 \f$ m_k / (m^{\Delta} V_k)\f$ \f$ 1.0 / V_k \f$
2 \f$ m_k / (m^{\Delta} V^0_0)\f$ \f$ 1.0 / V^0_0\f$
+ * + * \f$ V^0_0 \f$ is the solvent standard molar volume. \f$ m^{\Delta} \f$ is a constant equal to a + * molality of \f$ 1.0 \quad\mbox{gm kmol}^{-1} \f$. + * + * The current default is to have mformGC = 2. + * + * The value and form of the activity concentration will affect + * reaction rate constants involving species in this phase. + */ class IdealMolalSoln : public MolalityVPSSTP { public: @@ -60,52 +107,28 @@ namespace Cantera { */ virtual int eosType() const { return 0; } - /** * @} * @name Molar Thermodynamic Properties of the Solution --------------- * @{ */ - /// Molar enthalpy. Units: J/kmol. - /** - * Molar enthalpy of the solution. Units: J/kmol. - */ + //Molar enthalpy. Units: J/kmol. virtual doublereal enthalpy_mole() const; - /// Molar internal energy. Units: J/kmol. - /** - * Molar internal energy of the solution. Units: J/kmol. - */ + // Molar internal energy. Units: J/kmol. virtual doublereal intEnergy_mole() const; - /// Molar entropy. Units: J/kmol/K. - /** - * Molar entropy of the solution. Units: J/kmol/K. - * For an ideal, constant partial molar volume solution mixture with - * pure species phases which exhibit zero volume expansivity: - * \f[ - * \hat s(T, P, X_k) = \sum_k X_k \hat s^0_k(T) - * - \hat R \sum_k X_k log(X_k) - * \f] - * The reference-state pure-species entropies - * \f$ \hat s^0_k(T,p_{ref}) \f$ are computed by the - * species thermodynamic - * property manager. The pure species entropies are independent of - * temperature since the volume expansivities are equal to zero. - * @see SpeciesThermo - */ + // Molar entropy. Units: J/kmol/K. virtual doublereal entropy_mole() const; - /// Molar Gibbs function. Units: J/kmol. - + // Molar Gibbs function. Units: J/kmol. virtual doublereal gibbs_mole() const; - /// Molar heat capacity at constant pressure. Units: J/kmol/K. - + // Molar heat capacity at constant pressure. Units: J/kmol/K. virtual doublereal cp_mole() const; - /// Molar heat capacity at constant volume. Units: J/kmol/K. + // Molar heat capacity at constant volume. Units: J/kmol/K. virtual doublereal cv_mole() const; //@} @@ -121,7 +144,7 @@ namespace Cantera { */ - /** + /* * Pressure. Units: Pa. * For this incompressible system, we return the internally storred * independent value of the pressure. @@ -137,8 +160,7 @@ namespace Cantera { m_Pcurrent = p; } - - /** + /* * Calculate the density of the mixture using the partial * molar volumes and mole fractions as input * @@ -163,7 +185,7 @@ namespace Cantera { */ void calcDensity(); - /** + /* * Overwritten setDensity() function is necessary because the * density is not an indendent variable. * @@ -181,7 +203,7 @@ namespace Cantera { */ void setDensity(doublereal rho); - /** + /* * Overwritten setMolarDensity() function is necessary because the * density is not an indendent variable. * @@ -192,7 +214,7 @@ namespace Cantera { */ void setMolarDensity(doublereal rho); - /** + /* * The isothermal compressibility. Units: 1/Pa. * The isothermal compressibility is defined as * \f[ @@ -201,7 +223,7 @@ namespace Cantera { */ virtual doublereal isothermalCompressibility() const; - /** + /* * The thermal expansion coefficient. Units: 1/K. * The thermal expansion coefficient is defined as * @@ -222,7 +244,7 @@ namespace Cantera { * @{ */ - /** + /* * Set the potential energy of species k to pe. * Units: J/kmol. * This function must be reimplemented in inherited classes @@ -232,7 +254,7 @@ namespace Cantera { err("setPotentialEnergy"); } - /** + /* * Get the potential energy of species k. * Units: J/kmol. * This function must be reimplemented in inherited classes @@ -242,7 +264,7 @@ namespace Cantera { return err("potentialEnergy"); } - /** + /* * Set the electric potential of this phase (V). * This is used by classes InterfaceKinetics and EdgeKinetics to * compute the rates of charge-transfer reactions, and in computing @@ -268,7 +290,7 @@ namespace Cantera { * @{ */ - /** + /* * This method returns an array of generalized concentrations * \f$ C_k\f$ that are defined such that * \f$ a_k = C_k / C^0_k, \f$ where \f$ C^0_k \f$ @@ -283,7 +305,7 @@ namespace Cantera { */ virtual void getActivityConcentrations(doublereal* c) const; - /** + /* * The standard concentration \f$ C^0_k \f$ used to normalize * the generalized concentration. In many cases, this quantity * will be the same for all species in a phase - for example, @@ -302,7 +324,7 @@ namespace Cantera { */ virtual doublereal logStandardConc(int k=0) const; - /** + /* * Returns the units of the standard and generalized * concentrations Note they have the same units, as their * ratio is defined to be equal to the activity of the kth @@ -323,7 +345,7 @@ namespace Cantera { virtual void getUnitsStandardConc(double *uA, int k = 0, int sizeUA = 6); - /** + /* * Get the array of non-dimensional activities at * the current solution temperature, pressure, and * solution concentration. @@ -332,7 +354,7 @@ namespace Cantera { */ virtual void getActivities(doublereal* ac) const; - /** + /* * Get the array of non-dimensional molality-based * activity coefficients at the current solution temperature, * pressure, and solution concentration. @@ -348,25 +370,13 @@ namespace Cantera { /// @name Partial Molar Properties of the Solution ----------------- //@{ - - /** - * Get the species chemical potentials. Units: J/kmol. - * - * This function returns a vector of chemical potentials of the - * species in solution. - * \f[ - * \mu_k = \mu^{ref}_k(T) + V_k * (p - p_o) + R T ln(X_k) - * \f] - * or another way to phrase this is - * \f[ - * \mu_k = \mu^o_k(T,p) + R T ln(X_k) - * \f] - * where \f$ \mu^o_k(T,p) = \mu^{ref}_k(T) + V_k * (p - p_o)\f$ - */ + // Get the species chemical potentials: Units: J/kmol. + // This is also the partial molar gibbs free energies. virtual void getChemPotentials(doublereal* mu) const; /** - * Get the species electrochemical potentials. + * Get the species electrochemical potentials: Units: J/kmol. + * * These are partial molar quantities. * This method adds a term \f$ Fz_k \phi_k \f$ to the * to each chemical potential. @@ -381,7 +391,7 @@ namespace Cantera { } } - /** + /* * Returns an array of partial molar enthalpies for the species * in the mixture. * Units (J/kmol) @@ -398,44 +408,16 @@ namespace Cantera { */ virtual void getPartialMolarEnthalpies(doublereal* hbar) const; - /** + /* * getPartialMolarEntropies() (virtual, const) * * Returns an array of partial molar entropies of the species in the * solution. Units: J/kmol. * - * Maxwell's equations provide an insight in how to calculate this - * (p.215 Smith and Van Ness) - * - * d(chemPot_i)/dT = -sbar_i - * - * - * For this phase, the partial molar entropies are equal to the - * SS species entropies plus the ideal solution contribution.following - * contribution: - * \f[ - * \bar s_k(T,P) = \hat s^0_k(T) - R log(M0 * molality[k]) - * \f] - * \f[ - * \bar s_solvent(T,P) = \hat s^0_solvent(T) - * - R ((xmolSolvent - 1.0) / xmolSolvent) - * \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 - * species thermodynamic - * property manager. They are polynomial functions of temperature. - * @see SpeciesThermo */ virtual void getPartialMolarEntropies(doublereal* sbar) const; - /** - * returns an array of partial molar volumes of the species - * in the solution. Units: m^3 kmol-1. - * - * For this solution, thepartial molar volumes are equal to the - * constant species molar volumes. - */ + // partial molar volumes of the species Units: m^3 kmol-1. virtual void getPartialMolarVolumes(doublereal* vbar) const; /* @@ -454,7 +436,7 @@ namespace Cantera { // in the Solution -- //@{ - /** + /* * Get the standard state chemical potentials of the species. * This is the array of chemical potentials at unit activity * \f$ \mu^0_k(T,P) \f$. @@ -468,7 +450,7 @@ namespace Cantera { */ virtual void getStandardChemPotentials(doublereal* mu) const; - /** + /* * Get the nondimensional gibbs function for the species * standard states at the current T and P of the solution. * @@ -485,13 +467,13 @@ namespace Cantera { */ virtual void getGibbs_RT(doublereal* grt) const; - /** + /* * Get the nondimensional Gibbs functions for the standard * state of the species at the current T and P. */ virtual void getPureGibbs(doublereal* gpure) const; - /** + /* * * getEnthalpy_RT() (virtual, const) * @@ -502,13 +484,13 @@ namespace Cantera { * \f[ * h^0_k(T,P) = h^{ref}_k(T) + (P - P_{ref}) * V_k * \f] - * where \f$V_k\f$ is the molar volume of SS species k<\I>. + * where \f$V_k\f$ is the molar volume of SS species k. * \f$ h^{ref}_k(T)\f$ is the enthalpy of the SS - * species k<\I> at the reference pressure, \f$P_{ref}\f$. + * species k at the reference pressure, \f$P_{ref}\f$. */ virtual void getEnthalpy_RT(doublereal* hrt) const; - /** + /* * Get the nondimensional Entropies for the species * standard states at the current T and P of the solution. * @@ -522,10 +504,10 @@ namespace Cantera { */ virtual void getEntropy_R(doublereal* sr) const; - /** + /* * Get the nondimensional heat capacity at constant pressure * function for the species - * standard states at the current T and P of the solution. + * standard states at the current T and P of the solution. * \f[ * Cp^0_k(T,P) = Cp^{ref}_k(T) * \f] @@ -539,7 +521,7 @@ namespace Cantera { */ virtual void getCp_R(doublereal* cpr) const; - /** + /* * Get the molar volumes of each species in their standard * states at the current * T and P of the solution. @@ -589,6 +571,8 @@ namespace Cantera { * \f$ \lambda_m \f$ is the element potential of element m. The * temperature is unchanged. Any phase (ideal or not) that * implements this method can be equilibrated by ChemEquil. + * + * Not implemented. */ virtual void setToEquilState(const doublereal* lambda_RT) { err("setToEquilState"); @@ -612,13 +596,13 @@ namespace Cantera { * Set equation of state parameters. The number and meaning of * these depends on the subclass. * @param n number of parameters - * @param c array of \i n coefficients + * @param c array of n coefficients * */ virtual void setParameters(int n, doublereal* c); virtual void getParameters(int &n, doublereal * const c); - /** + /* * Set equation of state parameter values from XML * entries. This method is called by function importPhase in * file importCTML.cpp when processing a phase definition in @@ -637,17 +621,27 @@ namespace Cantera { //@{ - /// Critical temperature (K). + /** + * Critical temperature (K). + * Not implemented for this phase type. + */ virtual doublereal critTemperature() const { err("critTemperature"); return -1.0; } - /// Critical pressure (Pa). + /** + * Critical pressure (Pa). + * + * Not implemented for this phase type. + */ virtual doublereal critPressure() const { err("critPressure"); return -1.0; } - /// Critical density (kg/m3). + /** + * Critical density (kg/m3). + * Not implemented for this phase type. + */ virtual doublereal critDensity() const { err("critDensity"); return -1.0; } @@ -703,10 +697,7 @@ namespace Cantera { */ SpeciesThermo& speciesThermo() { return *m_spthermo; } - - - - /** + /* * initThermo() (virtual from ThermoPhase) * * This internal routine is responsible for setting up @@ -714,7 +705,7 @@ namespace Cantera { */ virtual void initThermo(); - /** + /* * constructPhaseFile (virtual from here) * * Initialization of an IdealSolidSolnPhase phase using an @@ -732,7 +723,7 @@ namespace Cantera { */ virtual void constructPhaseFile(string infile, string id=""); - /** + /* * constructPhaseXML (virtual from here) * * This is the main routine for constructing the phase. @@ -752,7 +743,7 @@ namespace Cantera { */ virtual void constructPhaseXML(XML_Node& phaseNode, string id); - /** + /* * initThermoXML (virtual from ThermoPhase) * * @@ -773,35 +764,46 @@ namespace Cantera { */ virtual void initThermoXML(XML_Node& phaseNode, string id=""); - - - /** + /* * Report the molar volume of species k * * units - \f$ m^3 kmol^-1 \f$ */ double speciesMolarVolume(int k) const; - /** + /* * Fill in a return vector containing the species molar volumes * units - \f$ m^3 kmol^-1 \f$ */ void getSpeciesMolarVolumes(double *smv) const; //@} - - - protected: /** * Species molar volume \f$ m^3 kmol^-1 \f$ */ array_fp m_speciesMolarVolume; - /* - * Current pressure in Pascal + + /** + * Current pressure in Pascal. + * + * This is an independent variable in the problem. */ double m_Pcurrent; - int m_formGC; + + /** + * The standard concentrations can have three different forms + * depending on the value of the member attribute m_formGC, which + * is supplied in the XML file. + * + * + * + * + * + * + *
m_formGC ActivityConc StandardConc
0 \f$ {m_k}/ { m^{\Delta}}\f$ \f$ 1.0 \f$
1 \f$ m_k / (m^{\Delta} V_k)\f$ \f$ 1.0 / V_k \f$
2 \f$ m_k / (m^{\Delta} V^0_0)\f$ \f$ 1.0 / V^0_0\f$
+ */ + int m_formGC; /** * Vector containing the species reference exp(-G/RT) functions @@ -831,6 +833,7 @@ namespace Cantera { void initLengths(); }; + /* @} */ } #endif diff --git a/Cantera/src/thermo/IdealSolidSolnPhase.cpp b/Cantera/src/thermo/IdealSolidSolnPhase.cpp index 7cdf830e3..48a78baad 100644 --- a/Cantera/src/thermo/IdealSolidSolnPhase.cpp +++ b/Cantera/src/thermo/IdealSolidSolnPhase.cpp @@ -1297,7 +1297,7 @@ namespace Cantera { return m_speciesMolarVolume[k]; } - /************************************************************************ + /** * * getSpeciesMolarVolumes(): * diff --git a/Cantera/src/thermo/IdealSolidSolnPhase.h b/Cantera/src/thermo/IdealSolidSolnPhase.h index 74bf25b7a..68485a2e5 100644 --- a/Cantera/src/thermo/IdealSolidSolnPhase.h +++ b/Cantera/src/thermo/IdealSolidSolnPhase.h @@ -80,6 +80,8 @@ namespace Cantera { * 2 X_k / V_N 1.0 / V_N * * + * @param formCG This parameter initializes the m_formGC variable. The default + * is a value of 0. */ IdealSolidSolnPhase(int formCG=0); @@ -102,6 +104,8 @@ namespace Cantera { * for this phase * @param id The name of this phase. This is used to look up * the phase in the XML datafile. + * @param formCG This parameter initializes the m_formGC variable. The default + * is a value of 0. */ IdealSolidSolnPhase(string infile, string id="", int formCG=0); @@ -126,7 +130,8 @@ namespace Cantera { * named phase with id, "id", on input to this routine. * @param id The name of this phase. This is used to look up * the phase in the XML datafile. - * + * @param formCG This parameter initializes the m_formGC variable. The default + * is a value of 0. */ IdealSolidSolnPhase(XML_Node& root, string id="", int formCG=0); @@ -893,9 +898,6 @@ namespace Cantera { * * @param lambda_RT vector of non-dimensional element potentials * \f$ \lambda_m/RT \f$. - * @param t temperature in K. - * @param work. Temporary work space. Must be dimensioned at least - * as large as the number of species. * */ virtual void setToEquilState(const doublereal* lambda_RT); @@ -909,10 +911,12 @@ namespace Cantera { double speciesMolarVolume(int k) const; /** - * Fill in a return vector containing the species molar volumes + * Fill in a return vector containing the species molar volumes. + * * units - \f$ m^3 kmol^-1 \f$ */ - void getSpeciesMolarVolumes(double *smv) const; + void getSpeciesMolarVolumes(doublereal *smv) const; + //@} protected: diff --git a/Cantera/src/thermo/MolalityVPSSTP.h b/Cantera/src/thermo/MolalityVPSSTP.h index 20cfa5db0..afd86b1dd 100644 --- a/Cantera/src/thermo/MolalityVPSSTP.h +++ b/Cantera/src/thermo/MolalityVPSSTP.h @@ -32,8 +32,9 @@ namespace Cantera { /** * MolalityVPSSTP is a derived class of ThermoPhase that handles * variable pressure standard state methods for calculating - * thermodynamic properties that are further based upon activities - * based on the molality scale. These include most of the methods + * thermodynamic properties that are further based on + * molality-scaled activities. + * These include most of the methods * for calculating liquid electrolyte thermodynamics. */ class MolalityVPSSTP : public VPStandardStateTP { @@ -395,8 +396,8 @@ namespace Cantera { * XML block. The solvent concentration is then set * to everything else. * - * @param eosdata An XML_Node object corresponding to - * the "thermo" entry for this phase in the input file. + * @param state An XML_Node object corresponding to + * the "state" entry for this phase in the input file. * */ virtual void setStateFromXML(const XML_Node& state);