Cantera  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IdealMolalSoln.h
Go to the documentation of this file.
1 /**
2  * @file IdealMolalSoln.h
3  * ThermoPhase object for the ideal molal equation of
4  * state (see \ref thermoprops
5  * and class \link Cantera::IdealMolalSoln IdealMolalSoln\endlink).
6  *
7  * Header file for a derived class of ThermoPhase that handles
8  * variable pressure standard state methods for calculating
9  * thermodynamic properties that are further based upon
10  * activities on the molality scale. The Ideal molal
11  * solution assumes that all molality-based activity
12  * coefficients are equal to one. This turns out to be highly
13  * nonlinear in the limit of the solvent mole fraction going
14  * to zero.
15  */
16 /*
17  * Copyright (2006) Sandia Corporation. Under the terms of
18  * Contract DE-AC04-94AL85000 with Sandia Corporation, the
19  * U.S. Government retains certain rights in this software.
20  */
21 #ifndef CT_IDEALMOLALSOLN_H
22 #define CT_IDEALMOLALSOLN_H
23 
24 #include "MolalityVPSSTP.h"
25 
26 namespace Cantera
27 {
28 
29 /** \addtogroup thermoprops */
30 /* @{
31  */
32 
33 /**
34  * This phase is based upon the mixing-rule assumption that
35  * all molality-based activity coefficients are equal
36  * to one.
37  *
38  * This is a full instantiation of a ThermoPhase object.
39  * The assumption is that the molality-based activity
40  * coefficient is equal to one. This also implies that
41  * the osmotic coefficient is equal to one.
42  *
43  * Note, this does not mean that the solution is an
44  * ideal solution. In fact, there is a singularity in
45  * the formulation as
46  * the solvent concentration goes to zero.
47  *
48  * The mechanical equation of state is currently assumed to
49  * be that of an incompressible solution. This may change
50  * in the future. Each species has its own molar volume.
51  * The molar volume is a constant.
52  *
53  * Class IdealMolalSoln represents a condensed phase.
54  * The phase and the pure species phases which
55  * comprise the standard states of the species are assumed to have
56  * zero volume expansivity and zero isothermal compressibility.
57  * Each species does, however, have constant but distinct partial
58  * molar volumes equal to their pure species molar volumes.
59  * The class derives from class ThermoPhase,
60  * and overloads the virtual methods defined there with ones that
61  * use expressions appropriate for incompressible mixtures.
62  *
63  * The standard concentrations can have three different forms
64  * depending on the value of the member attribute m_formGC, which
65  * is supplied in the XML file.
66  *
67  * <TABLE>
68  * <TR><TD> m_formGC </TD><TD> ActivityConc </TD><TD> StandardConc </TD></TR>
69  * <TR><TD> 0 </TD><TD> \f$ {m_k}/ { m^{\Delta}}\f$ </TD><TD> \f$ 1.0 \f$ </TD></TR>
70  * <TR><TD> 1 </TD><TD> \f$ m_k / (m^{\Delta} V_k)\f$ </TD><TD> \f$ 1.0 / V_k \f$ </TD></TR>
71  * <TR><TD> 2 </TD><TD> \f$ m_k / (m^{\Delta} V^0_0)\f$</TD><TD> \f$ 1.0 / V^0_0\f$ </TD></TR>
72  * </TABLE>
73  *
74  * \f$ V^0_0 \f$ is the solvent standard molar volume. \f$ m^{\Delta} \f$ is a constant equal to a
75  * molality of \f$ 1.0 \quad\mbox{gm kmol}^{-1} \f$.
76  *
77  * The current default is to have mformGC = 2.
78  *
79  * The value and form of the activity concentration will affect
80  * reaction rate constants involving species in this phase.
81  *
82  * <thermo model="IdealMolalSoln">
83  * <standardConc model="solvent_volume" />
84  * <solvent> H2O(l) </solvent>
85  * <activityCoefficients model="IdealMolalSoln" >
86  * <idealMolalSolnCutoff model="polyExp">
87  * <gamma_O_limit> 1.0E-5 </gamma_O_limit>
88  * <gamma_k_limit> 1.0E-5 <gamma_k_limit>
89  * <X_o_cutoff> 0.20 </X_o_cutoff>
90  * <C_0_param> 0.05 </C_0_param>
91  * <slope_f_limit> 0.6 </slope_f_limit>
92  * <slope_g_limit> 0.0 </slope_g_limit>
93  * </idealMolalSolnCutoff>
94  * </activityCoefficients>
95  * </thermo>
96  */
98 {
99 public:
100 
101  /// Constructor
102  IdealMolalSoln();
103 
104  //! Copy Constructor
106 
107  //! Assignment operator
109 
110  //! Constructor for phase initialization
111  /*!
112  * This constructor will initialize a phase, by reading the required
113  * information from an input file.
114  *
115  * @param inputFile Name of the Input file that contains information about the phase
116  * @param id id of the phase within the input file
117  */
118  IdealMolalSoln(const std::string& inputFile, const std::string& id = "");
119 
120  //! Constructor for phase initialization
121  /*!
122  * This constructor will initialize a phase, by reading the required
123  * information from XML_Node tree.
124  *
125  * @param phaseRef reference for an XML_Node tree that contains
126  * the information necessary to initialize the phase.
127  * @param id id of the phase within the input file
128  */
129  IdealMolalSoln(XML_Node& phaseRef, const std::string& id = "");
130 
131  //! Duplication function
132  /*!
133  * This virtual function is used to create a duplicate of the
134  * current phase. It's used to duplicate the phase when given
135  * a ThermoPhase pointer to the phase.
136  *
137  * @return It returns a ThermoPhase pointer.
138  */
140 
141  //! @}
142  //! @name Molar Thermodynamic Properties of the Solution
143  //! @{
144 
145  //! Molar enthalpy of the solution. Units: J/kmol.
146  /*!
147  * Returns the amount of enthalpy per mole of solution.
148  * For an ideal molal solution,
149  * \f[
150  * \bar{h}(T, P, X_k) = \sum_k X_k \bar{h}_k(T)
151  * \f]
152  * The formula is written in terms of the partial molar enthalpies.
153  * \f$ \bar{h}_k(T, p, m_k) \f$.
154  * See the partial molar enthalpy function, getPartialMolarEnthalpies(),
155  * for details.
156  *
157  * Units: J/kmol
158  */
159  virtual doublereal enthalpy_mole() const;
160 
161  //! Molar internal energy of the solution: Units: J/kmol.
162  /*!
163  * Returns the amount of internal energy per mole of solution.
164  * For an ideal molal solution,
165  * \f[
166  * \bar{u}(T, P, X_k) = \sum_k X_k \bar{u}_k(T)
167  * \f]
168  * The formula is written in terms of the partial molar internal energy.
169  * \f$ \bar{u}_k(T, p, m_k) \f$.
170  */
171  virtual doublereal intEnergy_mole() const;
172 
173  //! Molar entropy of the solution. Units: J/kmol/K.
174  /*!
175  * Returns the amount of entropy per mole of solution.
176  * For an ideal molal solution,
177  * \f[
178  * \bar{s}(T, P, X_k) = \sum_k X_k \bar{s}_k(T)
179  * \f]
180  * The formula is written in terms of the partial molar entropies.
181  * \f$ \bar{s}_k(T, p, m_k) \f$.
182  * See the partial molar entropies function, getPartialMolarEntropies(),
183  * for details.
184  *
185  * Units: J/kmol/K.
186  */
187  virtual doublereal entropy_mole() const;
188 
189  //! Molar Gibbs function for the solution: Units J/kmol.
190  /*!
191  * Returns the Gibbs free energy of the solution per mole of the solution.
192  *
193  * \f[
194  * \bar{g}(T, P, X_k) = \sum_k X_k \mu_k(T)
195  * \f]
196  *
197  * Units: J/kmol
198  */
199  virtual doublereal gibbs_mole() const;
200 
201  //! Molar heat capacity of the solution at constant pressure. Units: J/kmol/K.
202  /*!
203  * \f[
204  * \bar{c}_p(T, P, X_k) = \sum_k X_k \bar{c}_{p,k}(T)
205  * \f]
206  *
207  * Units: J/kmol/K
208  */
209  virtual doublereal cp_mole() const;
210 
211  //! Molar heat capacity of the solution at constant volume. Units: J/kmol/K.
212  /*!
213  * NOT IMPLEMENTED.
214  */
215  virtual doublereal cv_mole() const;
216 
217  //@}
218  /** @name Mechanical Equation of State Properties
219  *
220  * In this equation of state implementation, the density is a
221  * function only of the mole fractions. Therefore, it can't be
222  * an independent variable. Instead, the pressure is used as the
223  * independent variable. Functions which try to set the thermodynamic
224  * state by calling setDensity() may cause an exception to be
225  * thrown.
226  */
227  //@{
228 
229  /**
230  * Set the pressure at constant temperature. Units: Pa.
231  * This method sets a constant within the object.
232  * The mass density is not a function of pressure.
233  *
234  * @param p Input Pressure
235  */
236  virtual void setPressure(doublereal p);
237 
238 protected:
239  /**
240  * Calculate the density of the mixture using the partial
241  * molar volumes and mole fractions as input
242  *
243  * The formula for this is
244  *
245  * \f[
246  * \rho = \frac{\sum_k{X_k W_k}}{\sum_k{X_k V_k}}
247  * \f]
248  *
249  * where \f$X_k\f$ are the mole fractions, \f$W_k\f$ are
250  * the molecular weights, and \f$V_k\f$ are the pure species
251  * molar volumes.
252  *
253  * Note, the basis behind this formula is that in an ideal
254  * solution the partial molar volumes are equal to the pure
255  * species molar volumes. We have additionally specified
256  * in this class that the pure species molar volumes are
257  * independent of temperature and pressure.
258  */
259  void calcDensity();
260 
261 public:
262  /**
263  * Overwritten setDensity() function is necessary because the
264  * density is not an independent variable.
265  *
266  * This function will now throw an error condition
267  *
268  * @internal May have to adjust the strategy here to make
269  * the eos for these materials slightly compressible, in order
270  * to create a condition where the density is a function of
271  * the pressure.
272  *
273  * This function will now throw an error condition.
274  *
275  * @param rho Input Density
276  */
277  void setDensity(const doublereal rho);
278 
279  /**
280  * Overwritten setMolarDensity() function is necessary because the
281  * density is not an independent variable.
282  *
283  * This function will now throw an error condition.
284  *
285  * @param rho Input Density
286  */
287  void setMolarDensity(const doublereal rho);
288 
289  //! Set the temperature (K) and pressure (Pa)
290  /*!
291  * Set the temperature and pressure.
292  *
293  * @param t Temperature (K)
294  * @param p Pressure (Pa)
295  */
296  virtual void setState_TP(doublereal t, doublereal p);
297 
298  //! The isothermal compressibility. Units: 1/Pa.
299  /*!
300  * The isothermal compressibility is defined as
301  * \f[
302  * \kappa_T = -\frac{1}{v}\left(\frac{\partial v}{\partial P}\right)_T
303  * \f]
304  *
305  * It's equal to zero for this model, since the molar volume
306  * doesn't change with pressure or temperature.
307  */
308  virtual doublereal isothermalCompressibility() const;
309 
310  //! The thermal expansion coefficient. Units: 1/K.
311  /*!
312  * The thermal expansion coefficient is defined as
313  *
314  * \f[
315  * \beta = \frac{1}{v}\left(\frac{\partial v}{\partial T}\right)_P
316  * \f]
317  *
318  * It's equal to zero for this model, since the molar volume
319  * doesn't change with pressure or temperature.
320  */
321  virtual doublereal thermalExpansionCoeff() const;
322 
323  /**
324  * @}
325  * @name Activities and Activity Concentrations
326  *
327  * The activity \f$a_k\f$ of a species in solution is
328  * related to the chemical potential by \f[ \mu_k = \mu_k^0(T)
329  * + \hat R T \log a_k. \f] The quantity \f$\mu_k^0(T)\f$ is
330  * the chemical potential at unit activity, which depends only
331  * on temperature and the pressure.
332  * @{
333  */
334 
335  /*!
336  * This method returns an array of generalized concentrations
337  * \f$ C_k\f$ that are defined such that
338  * \f$ a_k = C_k / C^0_k, \f$ where \f$ C^0_k \f$
339  * is a standard concentration
340  * defined below. These generalized concentrations are used
341  * by kinetics manager classes to compute the forward and
342  * reverse rates of elementary reactions.
343  *
344  * @param c Array of generalized concentrations. The
345  * units depend upon the implementation of the
346  * reaction rate expressions within the phase.
347  */
348  virtual void getActivityConcentrations(doublereal* c) const;
349 
350  /**
351  * The standard concentration \f$ C^0_k \f$ used to normalize
352  * the generalized concentration. In many cases, this quantity
353  * will be the same for all species in a phase - for example,
354  * for an ideal gas \f$ C^0_k = P/\hat R T \f$. For this
355  * reason, this method returns a single value, instead of an
356  * array. However, for phases in which the standard
357  * concentration is species-specific (e.g. surface species of
358  * different sizes), this method may be called with an
359  * optional parameter indicating the species.
360  *
361  * @param k Species index
362  */
363  virtual doublereal standardConcentration(size_t k=0) const;
364 
365  /*!
366  * Returns the units of the standard and generalized
367  * concentrations Note they have the same units, as their
368  * ratio is defined to be equal to the activity of the kth
369  * species in the solution, which is unitless.
370  *
371  * This routine is used in print out applications where the
372  * units are needed. Usually, MKS units are assumed throughout
373  * the program and in the XML input files.
374  *
375  * @param uA Output vector containing the units
376  * uA[0] = kmol units - default = 1
377  * uA[1] = m units - default = -nDim(), the number of spatial
378  * dimensions in the Phase class.
379  * uA[2] = kg units - default = 0;
380  * uA[3] = Pa(pressure) units - default = 0;
381  * uA[4] = Temperature units - default = 0;
382  * uA[5] = time units - default = 0
383  * @param k species index. Defaults to 0.
384  * @param sizeUA output int containing the size of the vector.
385  * Currently, this is equal to 6.
386  * @deprecated To be removed after Cantera 2.2.
387  */
388  virtual void getUnitsStandardConc(double* uA, int k = 0,
389  int sizeUA = 6) const;
390 
391  /*!
392  * Get the array of non-dimensional activities at
393  * the current solution temperature, pressure, and
394  * solution concentration.
395  *
396  * (note solvent is on molar scale)
397  *
398  * @param ac Output activity coefficients.
399  * Length: m_kk.
400  */
401  virtual void getActivities(doublereal* ac) const;
402 
403  /*!
404  * Get the array of non-dimensional molality-based
405  * activity coefficients at the current solution temperature,
406  * pressure, and solution concentration.
407  *
408  *
409  * (note solvent is on molar scale. The solvent molar
410  * based activity coefficient is returned).
411  *
412  * @param acMolality Output Molality-based activity coefficients.
413  * Length: m_kk.
414  */
415  virtual void
416  getMolalityActivityCoefficients(doublereal* acMolality) const;
417 
418  //@}
419  /// @name Partial Molar Properties of the Solution
420  //@{
421 
422  //!Get the species chemical potentials: Units: J/kmol.
423  /*!
424  * This function returns a vector of chemical potentials of the
425  * species in solution.
426  *
427  * \f[
428  * \mu_k = \mu^{o}_k(T,P) + R T \ln(\frac{m_k}{m^\Delta})
429  * \f]
430  * \f[
431  * \mu_w = \mu^{o}_w(T,P) +
432  * R T ((X_w - 1.0) / X_w)
433  * \f]
434  *
435  * \f$ w \f$ refers to the solvent species.
436  * \f$ X_w \f$ is the mole fraction of the solvent.
437  * \f$ m_k \f$ is the molality of the kth solute.
438  * \f$ m^\Delta \f$ is 1 gmol solute per kg solvent.
439  *
440  * Units: J/kmol.
441  *
442  * @param mu Output vector of species chemical potentials.
443  * Length: m_kk.
444  */
445  virtual void getChemPotentials(doublereal* mu) const;
446 
447  //! Returns an array of partial molar enthalpies for the species in the mixture.
448  /*!
449  * Units (J/kmol)
450  * For this phase, the partial molar enthalpies are equal to the
451  * species standard state enthalpies.
452  * \f[
453  * \bar h_k(T,P) = \hat h^{ref}_k(T) + (P - P_{ref}) \hat V^0_k
454  * \f]
455  * The reference-state pure-species enthalpies, \f$ \hat h^{ref}_k(T) \f$,
456  * at the reference pressure,\f$ P_{ref} \f$,
457  * are computed by the species thermodynamic
458  * property manager. They are polynomial functions of temperature.
459  * @see SpeciesThermo
460  *
461  * @param hbar Output vector of partial molar enthalpies.
462  * Length: m_kk.
463  */
464  virtual void getPartialMolarEnthalpies(doublereal* hbar) const;
465 
466  //! Returns an array of partial molar entropies of the species in the solution. Units: J/kmol.
467  /*!
468  *
469  * Maxwell's equations provide an insight in how to calculate this
470  * (p.215 Smith and Van Ness)
471  * \f[
472  * \frac{d(\mu_k)}{dT} = -\bar{s}_i
473  * \f]
474  * For this phase, the partial molar entropies are equal to the
475  * standard state species entropies plus the ideal molal solution contribution.
476  *
477  * \f[
478  * \bar{s}_k(T,P) = s^0_k(T) - R \ln( \frac{m_k}{m^{\triangle}} )
479  * \f]
480  * \f[
481  * \bar{s}_w(T,P) = s^0_w(T) - R ((X_w - 1.0) / X_w)
482  * \f]
483  *
484  * The subscript, w, refers to the solvent species. \f$ X_w \f$ is
485  * the mole fraction of solvent.
486  * The reference-state pure-species entropies,\f$ s^0_k(T) \f$,
487  * at the reference pressure, \f$ P_{ref} \f$, are computed by the
488  * species thermodynamic
489  * property manager. They are polynomial functions of temperature.
490  * @see SpeciesThermo
491  *
492  * @param sbar Output vector of partial molar entropies.
493  * Length: m_kk.
494  */
495  virtual void getPartialMolarEntropies(doublereal* sbar) const;
496 
497  // partial molar volumes of the species Units: m^3 kmol-1.
498  /*!
499  * For this solution, the partial molar volumes are equal to the
500  * constant species molar volumes.
501  *
502  * Units: m^3 kmol-1.
503  * @param vbar Output vector of partial molar volumes.
504  */
505  virtual void getPartialMolarVolumes(doublereal* vbar) const;
506 
507 
508  //! Partial molar heat capacity of the solution:. UnitsL J/kmol/K
509  /*!
510  * The kth partial molar heat capacity is equal to
511  * the temperature derivative of the partial molar
512  * enthalpy of the kth species in the solution at constant
513  * P and composition (p. 220 Smith and Van Ness).
514  * \f[
515  * \bar{Cp}_k(T,P) = {Cp}^0_k(T)
516  * \f]
517  *
518  * For this solution, this is equal to the reference state
519  * heat capacities.
520  *
521  * Units: J/kmol/K
522  *
523  * @param cpbar Output vector of partial molar heat capacities.
524  * Length: m_kk.
525  */
526  virtual void getPartialMolarCp(doublereal* cpbar) const;
527 
528  //!@}
529  //! @name Chemical Equilibrium
530  //! @{
531 
532  /**
533  * This method is used by the ChemEquil equilibrium solver.
534  * It sets the state such that the chemical potentials satisfy
535  * \f[ \frac{\mu_k}{\hat R T} = \sum_m A_{k,m}
536  * \left(\frac{\lambda_m} {\hat R T}\right) \f] where
537  * \f$ \lambda_m \f$ is the element potential of element m. The
538  * temperature is unchanged. Any phase (ideal or not) that
539  * implements this method can be equilibrated by ChemEquil.
540  *
541  * Not implemented.
542  *
543  * @param lambda_RT vector of Nondimensional element potentials.
544  */
545  virtual void setToEquilState(const doublereal* lambda_RT) {
546  throw NotImplementedError("IdealMolalSoln::setToEquilState");
547  }
548 
549  //@}
550 
551  /*
552  * -------------- Utilities -------------------------------
553  */
554 
555  //! Initialization routine for an IdealMolalSoln phase.
556  /*!
557  * This internal routine is responsible for setting up
558  * the internal storage. This is reimplemented from the ThermoPhase
559  * class.
560  */
561  virtual void initThermo();
562 
563  //! Import and initialize an IdealMolalSoln phase
564  //! specification in an XML tree into the current object.
565  /*!
566  * This routine is called from importPhase() to finish
567  * up the initialization of the thermo object. It reads in the
568  * species molar volumes.
569  *
570  * @param phaseNode This object must be the phase node of a
571  * complete XML tree
572  * description of the phase, including all of the
573  * species data. In other words while "phase" must
574  * point to an XML phase object, it must have
575  * sibling nodes "speciesData" that describe
576  * the species in the phase.
577  * @param id ID of the phase. If nonnull, a check is done
578  * to see if phaseNode is pointing to the phase
579  * with the correct id.
580  */
581  virtual void initThermoXML(XML_Node& phaseNode, const std::string& id="");
582 
583  //! Report the molar volume of species k
584  /*!
585  * units - \f$ m^3 kmol^{-1} \f$
586  *
587  * @param k Species index.
588  */
589  double speciesMolarVolume(int k) const;
590 
591  /*!
592  * Fill in a return vector containing the species molar volumes
593  * units - \f$ m^3 kmol^{-1} \f$
594  *
595  * @param smv Output vector of species molar volumes.
596  */
597  void getSpeciesMolarVolumes(double* smv) const;
598  //@}
599 
600 protected:
601  /**
602  * Species molar volume \f$ m^3 kmol^{-1} \f$
603  */
605 
606  /**
607  * The standard concentrations can have three different forms
608  * depending on the value of the member attribute m_formGC, which
609  * is supplied in the XML file.
610  *
611  * <TABLE>
612  * <TR><TD> m_formGC </TD><TD> ActivityConc </TD><TD> StandardConc </TD></TR>
613  * <TR><TD> 0 </TD><TD> \f$ {m_k}/ { m^{\Delta}}\f$ </TD><TD> \f$ 1.0 \f$ </TD></TR>
614  * <TR><TD> 1 </TD><TD> \f$ m_k / (m^{\Delta} V_k)\f$ </TD><TD> \f$ 1.0 / V_k \f$ </TD></TR>
615  * <TR><TD> 2 </TD><TD> \f$ m_k / (m^{\Delta} V^0_0)\f$</TD><TD> \f$ 1.0 / V^0_0\f$ </TD></TR>
616  * </TABLE>
617  */
618  int m_formGC;
619 
620 public:
621  //! Cutoff type
623 
624 private:
625  /**
626  * Temporary array used in equilibrium calculations
627  */
628  mutable vector_fp m_pp;
629 
630  /**
631  * vector of size m_kk, used as a temporary holding area.
632  */
633  mutable vector_fp m_tmpV;
634 
635  //! Logarithm of the molal activity coefficients
636  /*!
637  * Normally these are all one. However, stability schemes will change that
638  */
640 public:
641  //! value of the solute mole fraction that centers the cutoff polynomials
642  //! for the cutoff =1 process;
643  doublereal IMS_X_o_cutoff_;
644 
645  //! gamma_o value for the cutoff process at the zero solvent point
646  doublereal IMS_gamma_o_min_;
647 
648  //! gamma_k minimum for the cutoff process at the zero solvent point
649  doublereal IMS_gamma_k_min_;
650 
651  //! Parameter in the polyExp cutoff treatment
652  /*!
653  * This is the slope of the f function at the zero solvent point
654  * Default value is 0.6
655  */
656  doublereal IMS_slopefCut_;
657 
658  //! Parameter in the polyExp cutoff treatment
659  /*!
660  * This is the slope of the g function at the zero solvent point
661  * Default value is 0.0
662  */
663  doublereal IMS_slopegCut_;
664 
665  //! @name Parameters in the polyExp cutoff treatment having to do with rate of exp decay
666  //! @{
667  doublereal IMS_cCut_;
668  doublereal IMS_dfCut_;
669  doublereal IMS_efCut_;
670  doublereal IMS_afCut_;
671  doublereal IMS_bfCut_;
672  doublereal IMS_dgCut_;
673  doublereal IMS_egCut_;
674  doublereal IMS_agCut_;
675  doublereal IMS_bgCut_;
676  //! @}
677 
678 private:
679  //! This function will be called to update the internally stored
680  //! natural logarithm of the molality activity coefficients
681  /*!
682  * Normally the solutes are all zero. However, sometimes they are not,
683  * due to stability schemes.
684  *
685  * gamma_k_molar = gamma_k_molal / Xmol_solvent
686  *
687  * gamma_o_molar = gamma_o_molal
688  */
689  void s_updateIMS_lnMolalityActCoeff() const;
690 
691  //! This internal function adjusts the lengths of arrays.
692  /*!
693  * This function is not virtual nor is it inherited
694  */
695  void initLengths();
696 
697  //! Calculate parameters for cutoff treatments of activity coefficients
698  /*!
699  * Some cutoff treatments for the activity coefficients
700  * actually require some calculations to create a consistent treatment.
701  *
702  * This routine is called during the setup to calculate these parameters
703  */
704  void calcIMSCutoffParams_();
705 };
706 
707 /* @} */
708 }
709 
710 #endif
IdealMolalSoln & operator=(const IdealMolalSoln &)
Assignment operator.
virtual void setToEquilState(const doublereal *lambda_RT)
This method is used by the ChemEquil equilibrium solver.
virtual void setPressure(doublereal p)
Set the pressure at constant temperature.
virtual void setState_TP(doublereal t, doublereal p)
Set the temperature (K) and pressure (Pa)
An error indicating that an unimplemented function has been called.
Definition: ctexceptions.h:213
doublereal IMS_slopefCut_
Parameter in the polyExp cutoff treatment.
double speciesMolarVolume(int k) const
Report the molar volume of species k.
doublereal IMS_slopegCut_
Parameter in the polyExp cutoff treatment.
IdealMolalSoln()
Constructor.
virtual void getPartialMolarVolumes(doublereal *vbar) const
virtual doublereal enthalpy_mole() const
Molar enthalpy of the solution. Units: J/kmol.
virtual void getActivityConcentrations(doublereal *c) const
vector_fp m_tmpV
vector of size m_kk, used as a temporary holding area.
virtual doublereal standardConcentration(size_t k=0) const
The standard concentration used to normalize the generalized concentration.
Class XML_Node is a tree-based representation of the contents of an XML file.
Definition: xml.h:100
ThermoPhase * duplMyselfAsThermoPhase() const
Duplication function.
doublereal IMS_gamma_k_min_
gamma_k minimum for the cutoff process at the zero solvent point
void setDensity(const doublereal rho)
Overwritten setDensity() function is necessary because the density is not an independent variable...
void initLengths()
This internal function adjusts the lengths of arrays.
void setMolarDensity(const doublereal rho)
Overwritten setMolarDensity() function is necessary because the density is not an independent variabl...
doublereal IMS_gamma_o_min_
gamma_o value for the cutoff process at the zero solvent point
vector_fp m_pp
Temporary array used in equilibrium calculations.
vector_fp m_speciesMolarVolume
Species molar volume .
Header for intermediate ThermoPhase object for phases which employ molality based activity coefficien...
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.
virtual doublereal gibbs_mole() const
Molar Gibbs function for the solution: Units J/kmol.
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:97
virtual void getChemPotentials(doublereal *mu) const
Get the species chemical potentials: Units: J/kmol.
virtual void getActivities(doublereal *ac) const
virtual doublereal isothermalCompressibility() const
The isothermal compressibility. Units: 1/Pa.
virtual void getUnitsStandardConc(double *uA, int k=0, int sizeUA=6) const
virtual doublereal cv_mole() const
Molar heat capacity of the solution at constant volume. Units: J/kmol/K.
void s_updateIMS_lnMolalityActCoeff() const
This function will be called to update the internally stored natural logarithm of the molality activi...
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id="")
Import and initialize an IdealMolalSoln phase specification in an XML tree into the current object...
virtual doublereal entropy_mole() const
Molar entropy of the solution. Units: J/kmol/K.
virtual void getPartialMolarEntropies(doublereal *sbar) const
Returns an array of partial molar entropies of the species in the solution. Units: J/kmol...
virtual doublereal cp_mole() const
Molar heat capacity of the solution at constant pressure. Units: J/kmol/K.
void getSpeciesMolarVolumes(double *smv) const
virtual doublereal intEnergy_mole() const
Molar internal energy of the solution: Units: J/kmol.
virtual void getPartialMolarCp(doublereal *cpbar) const
Partial molar heat capacity of the solution:. UnitsL J/kmol/K.
int IMS_typeCutoff_
Cutoff type.
int m_formGC
The standard concentrations can have three different forms depending on the value of the member attri...
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
Definition: ct_defs.h:157
virtual void initThermo()
Initialization routine for an IdealMolalSoln phase.
virtual void getMolalityActivityCoefficients(doublereal *acMolality) const
void calcDensity()
Calculate the density of the mixture using the partial molar volumes and mole fractions as input...
This phase is based upon the mixing-rule assumption that all molality-based activity coefficients are...
void calcIMSCutoffParams_()
Calculate parameters for cutoff treatments of activity coefficients.
doublereal IMS_X_o_cutoff_
value of the solute mole fraction that centers the cutoff polynomials for the cutoff =1 process; ...
virtual doublereal thermalExpansionCoeff() const
The thermal expansion coefficient. Units: 1/K.
vector_fp IMS_lnActCoeffMolal_
Logarithm of the molal activity coefficients.