Cantera  2.3.0
PhaseCombo_Interaction.h
Go to the documentation of this file.
1 /**
2  * @file PhaseCombo_Interaction.h
3  * Header for intermediate ThermoPhase object for phases which
4  * employ the Margules Gibbs free energy formulation and eliminates the ideal mixing term.
5  * (see \ref thermoprops
6  * and class \link Cantera::PhaseCombo_Interaction PhaseCombo_Interaction\endlink).
7  */
8 
9 // This file is part of Cantera. See License.txt in the top-level directory or
10 // at http://www.cantera.org/license.txt for license and copyright information.
11 
12 #ifndef CT_PHASECOMBO_INTERACTION_H
13 #define CT_PHASECOMBO_INTERACTION_H
14 
15 #include "GibbsExcessVPSSTP.h"
16 
17 namespace Cantera
18 {
19 
20 //! PhaseCombo_Interaction is a derived class of GibbsExcessVPSSTP that employs
21 //! the Margules approximation for the excess Gibbs free energy while
22 //! eliminating the entropy of mixing term.
23 /*!
24  * @attention This class currently does not have any test cases or examples. Its
25  * implementation may be incomplete, and future changes to Cantera may
26  * unexpectedly cause this class to stop working. If you use this class,
27  * please consider contributing examples or test cases. In the absence of
28  * new tests or examples, this class may be deprecated and removed in a
29  * future version of Cantera. See
30  * https://github.com/Cantera/cantera/issues/267 for additional information.
31  *
32  * PhaseCombo_Interaction derives from class GibbsExcessVPSSTP which is derived
33  * from VPStandardStateTP, and overloads the virtual methods defined there with
34  * ones that use expressions appropriate for the Margules Excess Gibbs free
35  * energy approximation. The reader should refer to the MargulesVPSSTP class for
36  * information on that class. This class in addition adds a term to the activity
37  * coefficient that eliminates the ideal solution mixing term within the
38  * chemical potential. This is a very radical thing to do, but it is supported
39  * by experimental evidence under some conditions.
40  *
41  * The independent unknowns are pressure, temperature, and mass fraction.
42  *
43  * This class is introduced to represent specific conditions observed in thermal
44  * batteries. HOwever, it may be physically motivated to represent conditions
45  * where there may be a mixture of compounds that are not "mixed" at the
46  * molecular level. Therefore, there is no mixing term.
47  *
48  * The lack of a mixing term has profound effects. First, the mole fraction of a
49  * species can now be identically zero due to thermodynamic considerations. The
50  * phase behaves more like a series of phases. That's why we named it
51  * PhaseCombo.
52  *
53  * ## Specification of Species Standard State Properties
54  *
55  * All species are defined to have standard states that depend upon both the
56  * temperature and the pressure. The Margules approximation assumes symmetric
57  * standard states, where all of the standard state assume that the species are
58  * in pure component states at the temperature and pressure of the solution. I
59  * don't think it prevents, however, some species from being dilute in the
60  * solution.
61  *
62  * ## Specification of Solution Thermodynamic Properties
63  *
64  * The molar excess Gibbs free energy is given by the following formula which is
65  * a sum over interactions *i*. Each of the interactions are binary interactions
66  * involving two of the species in the phase, denoted, *Ai* and *Bi*. This is
67  * the generalization of the Margules formulation for a phase that has more than
68  * 2 species. The second term in the excess Gibbs free energy is a negation of
69  * the ideal solution's mixing term.
70  *
71  * \f[
72  * G^E = \sum_i \left( H_{Ei} - T S_{Ei} \right) - \sum_i \left( n_i R T \ln{X_i} \right)
73  * \f]
74  * \f[
75  * H^E_i = n X_{Ai} X_{Bi} \left( h_{o,i} + h_{1,i} X_{Bi} \right)
76  * \f]
77  * \f[
78  * S^E_i = n X_{Ai} X_{Bi} \left( s_{o,i} + s_{1,i} X_{Bi} \right)
79  * \f]
80  *
81  * where n is the total moles in the solution. The activity of a species defined
82  * in the phase is given by an excess Gibbs free energy formulation.
83  *
84  * \f[
85  * a_k = \gamma_k X_k
86  * \f]
87  *
88  * where
89  *
90  * \f[
91  * R T \ln( \gamma_k )= \frac{d(n G^E)}{d(n_k)}\Bigg|_{n_i}
92  * \f]
93  *
94  * Taking the derivatives results in the following expression
95  *
96  * \f[
97  * R T \ln( \gamma_k )= \sum_i \left( \left( \delta_{Ai,k} X_{Bi} + \delta_{Bi,k} X_{Ai} - X_{Ai} X_{Bi} \right)
98  * \left( g^E_{o,i} + g^E_{1,i} X_{Bi} \right) +
99  * \left( \delta_{Bi,k} - X_{Bi} \right) X_{Ai} X_{Bi} g^E_{1,i} \right) - RT \ln{X_k}
100  * \f]
101  *
102  * where \f$ g^E_{o,i} = h_{o,i} - T s_{o,i} \f$ and
103  * \f$ g^E_{1,i} = h_{1,i} - T s_{1,i} \f$ and where \f$ X_k \f$ is the mole
104  * fraction of species *k*.
105  *
106  * This object inherits from the class VPStandardStateTP. Therefore, the
107  * specification and calculation of all standard state and reference state
108  * values are handled at that level. Various functional forms for the standard
109  * state are permissible. The chemical potential for species *k* is equal to
110  *
111  * \f[
112  * \mu_k(T,P) = \mu^o_k(T, P) + R T \ln(\gamma_k X_k)
113  * \f]
114  *
115  * The partial molar entropy for species *k* is given by the following relation,
116  *
117  * \f[
118  * \tilde{s}_k(T,P) = s^o_k(T,P) - R \ln( \gamma_k X_k )
119  * - R T \frac{d \ln(\gamma_k) }{dT}
120  * \f]
121  *
122  * The partial molar enthalpy for species *k* is given by
123  *
124  * \f[
125  * \tilde{h}_k(T,P) = h^o_k(T,P) - R T^2 \frac{d \ln(\gamma_k)}{dT}
126  * \f]
127  *
128  * The partial molar volume for species *k* is
129  *
130  * \f[
131  * \tilde V_k(T,P) = V^o_k(T,P) + R T \frac{d \ln(\gamma_k) }{dP}
132  * \f]
133  *
134  * The partial molar Heat Capacity for species *k* is
135  *
136  * \f[
137  * \tilde{C}_{p,k}(T,P) = C^o_{p,k}(T,P) - 2 R T \frac{d \ln( \gamma_k )}{dT}
138  * - R T^2 \frac{d^2 \ln(\gamma_k) }{{dT}^2}
139  * \f]
140  *
141  * ## %Application within Kinetics Managers
142  *
143  * \f$ C^a_k\f$ are defined such that \f$ a_k = C^a_k / C^s_k, \f$ where
144  * \f$ C^s_k \f$ is a standard concentration defined below and \f$ a_k \f$ are
145  * activities used in the thermodynamic functions. These activity (or
146  * generalized) concentrations are used by kinetics manager classes to compute
147  * the forward and reverse rates of elementary reactions. The activity
148  * concentration,\f$ C^a_k \f$,is given by the following expression.
149  *
150  * \f[
151  * C^a_k = C^s_k X_k = \frac{P}{R T} X_k
152  * \f]
153  *
154  * The standard concentration for species *k* is independent of *k* and equal to
155  *
156  * \f[
157  * C^s_k = C^s = \frac{P}{R T}
158  * \f]
159  *
160  * For example, a bulk-phase binary gas reaction between species j and k,
161  * producing a new gas species l would have the following equation for its rate
162  * of progress variable, \f$ R^1 \f$, which has units of kmol m-3 s-1.
163  *
164  * \f[
165  * R^1 = k^1 C_j^a C_k^a = k^1 (C^s a_j) (C^s a_k)
166  * \f]
167  *
168  * where
169  *
170  * \f[
171  * C_j^a = C^s a_j \mbox{\quad and \quad} C_k^a = C^s a_k
172  * \f]
173  *
174  * \f$ C_j^a \f$ is the activity concentration of species j, and \f$ C_k^a \f$
175  * is the activity concentration of species k. \f$ C^s \f$ is the standard
176  * concentration. \f$ a_j \f$ is the activity of species j which is equal to the
177  * mole fraction of j.
178  *
179  * The reverse rate constant can then be obtained from the law of microscopic
180  * reversibility and the equilibrium expression for the system.
181  *
182  * \f[
183  * \frac{a_j a_k}{ a_l} = K_a^{o,1} = \exp(\frac{\mu^o_l - \mu^o_j - \mu^o_k}{R T} )
184  * \f]
185  *
186  * \f$ K_a^{o,1} \f$ is the dimensionless form of the equilibrium constant,
187  * associated with the pressure dependent standard states \f$ \mu^o_l(T,P) \f$
188  * and their associated activities, \f$ a_l \f$, repeated here:
189  *
190  * \f[
191  * \mu_l(T,P) = \mu^o_l(T, P) + R T \log(a_l)
192  * \f]
193  *
194  * We can switch over to expressing the equilibrium constant in terms of the
195  * reference state chemical potentials
196  *
197  * \f[
198  * K_a^{o,1} = \exp(\frac{\mu^{ref}_l - \mu^{ref}_j - \mu^{ref}_k}{R T} ) * \frac{P_{ref}}{P}
199  * \f]
200  *
201  * The concentration equilibrium constant, \f$ K_c \f$, may be obtained by
202  * changing over to activity concentrations. When this is done:
203  *
204  * \f[
205  * \frac{C^a_j C^a_k}{ C^a_l} = C^o K_a^{o,1} = K_c^1 =
206  * \exp(\frac{\mu^{ref}_l - \mu^{ref}_j - \mu^{ref}_k}{R T} ) * \frac{P_{ref}}{RT}
207  * \f]
208  *
209  * Kinetics managers will calculate the concentration equilibrium constant,
210  * \f$ K_c \f$, using the second and third part of the above expression as a
211  * definition for the concentration equilibrium constant.
212  *
213  * For completeness, the pressure equilibrium constant may be obtained as well
214  *
215  * \f[
216  * \frac{P_j P_k}{ P_l P_{ref}} = K_p^1 = \exp(\frac{\mu^{ref}_l - \mu^{ref}_j - \mu^{ref}_k}{R T} )
217  * \f]
218  *
219  * \f$ K_p \f$ is the simplest form of the equilibrium constant for ideal gases.
220  * However, it isn't necessarily the simplest form of the equilibrium constant
221  * for other types of phases; \f$ K_c \f$ is used instead because it is
222  * completely general.
223  *
224  * The reverse rate of progress may be written down as
225  * \f[
226  * R^{-1} = k^{-1} C_l^a = k^{-1} (C^o a_l)
227  * \f]
228  *
229  * where we can use the concept of microscopic reversibility to write the
230  * reverse rate constant in terms of the forward reate constant and the
231  * concentration equilibrium constant, \f$ K_c \f$.
232  *
233  * \f[
234  * k^{-1} = k^1 K^1_c
235  * \f]
236  *
237  * \f$k^{-1} \f$ has units of s-1.
238  *
239  * ## Instantiation of the Class
240  *
241  * The constructor for this phase is located in the default ThermoFactory for
242  * %Cantera. A new PhaseCombo_Interaction object may be created by the following
243  * code snippet:
244  *
245  * @code
246  * XML_Node *xc = get_XML_File("LiFeS_X_combo.xml");
247  * XML_Node * const xs = xc->findNameID("phase", "LiFeS_X");
248  * ThermoPhase *l_tp = newPhase(*xs);
249  * PhaseCombo_Interaction *LiFeS_X_solid = dynamic_cast <PhaseCombo_Interaction *>(l_tp);
250  * @endcode
251  *
252  * or by the following code
253  *
254  * @code
255  * std::string id = "LiFeS_X";
256  * Cantera::ThermoPhase *LiFeS_X_Phase = Cantera::newPhase("LiFeS_X_combo.xml", id);
257  * PhaseCombo_Interaction *LiFeS_X_solid = dynamic_cast <PhaseCombo_Interaction *>(l_tp);
258  * @endcode
259  *
260  * or by the following constructor:
261  *
262  * @code
263  * XML_Node *xc = get_XML_File("LiFeS_X_combo.xml");
264  * XML_Node * const xs = xc->findNameID("phase", "LiFeS_X");
265  * PhaseCombo_Interaction *LiFeS_X_solid = new PhaseCombo_Interaction(*xs);
266  * @endcode
267  *
268  * ## XML Example
269  *
270  * An example of an XML Element named phase setting up a PhaseCombo_Interaction
271  * object named LiFeS_X is given below.
272  *
273  * @code
274  * <phase dim="3" id="LiFeS_X">
275  * <elementArray datasrc="elements.xml">
276  * Li Fe S
277  * </elementArray>
278  * <speciesArray datasrc="#species_LiFeS">
279  * LiTFe1S2(S) Li2Fe1S2(S)
280  * </speciesArray>
281  * <thermo model="PhaseCombo_Interaction">
282  * <activityCoefficients model="Margules" TempModel="constant">
283  * <binaryNeutralSpeciesParameters speciesA="LiTFe1S2(S)" speciesB="Li2Fe1S2(S)">
284  * <excessEnthalpy model="poly_Xb" terms="2" units="kJ/mol">
285  * 84.67069219, -269.1959421
286  * </excessEnthalpy>
287  * <excessEntropy model="poly_Xb" terms="2" units="J/mol/K">
288  * 100.7511565, -361.4222659
289  * </excessEntropy>
290  * <excessVolume_Enthalpy model="poly_Xb" terms="2" units="ml/mol">
291  * 0, 0
292  * </excessVolume_Enthalpy>
293  * <excessVolume_Entropy model="poly_Xb" terms="2" units="ml/mol/K">
294  * 0, 0
295  * </excessVolume_Entropy>
296  * </binaryNeutralSpeciesParameters>
297  * </activityCoefficients>
298  * </thermo>
299  * <transport model="none"/>
300  * <kinetics model="none"/>
301  * </phase>
302  * @endcode
303  *
304  * The model attribute "PhaseCombo_Interaction" of the thermo XML element
305  * identifies the phase as being of the type handled by the
306  * PhaseCombo_Interaction object.
307  *
308  * @ingroup thermoprops
309  */
311 {
312 public:
313  //! Constructor
315 
316  //! Construct and initialize a PhaseCombo_Interaction ThermoPhase object
317  //! directly from an XML input file
318  /*!
319  * @param inputFile Name of the input file containing the phase XML data
320  * to set up the object
321  * @param id ID of the phase in the input file. Defaults to the
322  * empty string.
323  */
324  PhaseCombo_Interaction(const std::string& inputFile, const std::string& id = "");
325 
326  //! Construct and initialize a PhaseCombo_Interaction ThermoPhase object
327  //! directly from an XML database
328  /*!
329  * @param phaseRef XML phase node containing the description of the phase
330  * @param id id attribute containing the name of the phase.
331  * (default is the empty string)
332  */
333  PhaseCombo_Interaction(XML_Node& phaseRef, const std::string& id = "");
334 
336  PhaseCombo_Interaction& operator=(const PhaseCombo_Interaction& b);
337  virtual ThermoPhase* duplMyselfAsThermoPhase() const;
338 
339  //! @name Utilities
340  //! @{
341 
342  virtual int eosType() const;
343  virtual std::string type() const {
344  return "PhaseCombo_Interaction";
345  }
346 
347  //! @}
348  //! @name Molar Thermodynamic Properties
349  //! @{
350 
351  virtual doublereal enthalpy_mole() const;
352  virtual doublereal entropy_mole() const;
353  virtual doublereal cp_mole() const;
354  virtual doublereal cv_mole() const;
355 
356  /**
357  * @}
358  * @name Activities, Standard States, and Activity Concentrations
359  *
360  * The activity \f$a_k\f$ of a species in solution is related to the
361  * chemical potential by \f[ \mu_k = \mu_k^0(T) + \hat R T \log a_k. \f] The
362  * quantity \f$\mu_k^0(T,P)\f$ is the chemical potential at unit activity,
363  * which depends only on temperature and pressure.
364  * @{
365  */
366 
367  virtual void getActivityCoefficients(doublereal* ac) const;
368 
369  //@}
370  /// @name Partial Molar Properties of the Solution
371  //@{
372 
373  virtual void getChemPotentials(doublereal* mu) const;
374 
375  //! Returns an array of partial molar enthalpies for the species in the
376  //! mixture.
377  /*!
378  * Units (J/kmol)
379  *
380  * For this phase, the partial molar enthalpies are equal to the standard
381  * state enthalpies modified by the derivative of the molality-based
382  * activity coefficient wrt temperature
383  *
384  * \f[
385  * \bar h_k(T,P) = h^o_k(T,P) - R T^2 \frac{d \ln(\gamma_k)}{dT}
386  * \f]
387  *
388  * @param hbar Vector of returned partial molar enthalpies
389  * (length m_kk, units = J/kmol)
390  */
391  virtual void getPartialMolarEnthalpies(doublereal* hbar) const;
392 
393  //! Returns an array of partial molar entropies for the species in the
394  //! mixture.
395  /*!
396  * Units (J/kmol)
397  *
398  * For this phase, the partial molar enthalpies are equal to the standard
399  * state enthalpies modified by the derivative of the activity coefficient
400  * wrt temperature
401  *
402  * \f[
403  * \bar s_k(T,P) = s^o_k(T,P) - R T^2 \frac{d \ln(\gamma_k)}{dT}
404  * - R \ln( \gamma_k X_k)
405  * - R T \frac{d \ln(\gamma_k) }{dT}
406  * \f]
407  *
408  * @param sbar Vector of returned partial molar entropies
409  * (length m_kk, units = J/kmol/K)
410  */
411  virtual void getPartialMolarEntropies(doublereal* sbar) const;
412 
413  //! Returns an array of partial molar entropies for the species in the
414  //! mixture.
415  /*!
416  * Units (J/kmol)
417  *
418  * For this phase, the partial molar enthalpies are equal to the standard
419  * state enthalpies modified by the derivative of the activity coefficient
420  * wrt temperature
421  *
422  * \f[
423  * ???????????????
424  * \bar s_k(T,P) = s^o_k(T,P) - R T^2 \frac{d \ln(\gamma_k)}{dT}
425  * - R \ln( \gamma_k X_k)
426  * - R T \frac{d \ln(\gamma_k) }{dT}
427  * ???????????????
428  * \f]
429  *
430  * @param cpbar Vector of returned partial molar heat capacities
431  * (length m_kk, units = J/kmol/K)
432  */
433  virtual void getPartialMolarCp(doublereal* cpbar) const;
434 
435  //! Return an array of partial molar volumes for the species in the mixture.
436  //! Units: m^3/kmol.
437  /*!
438  * Frequently, for this class of thermodynamics representations, the excess
439  * Volume due to mixing is zero. Here, we set it as a default. It may be
440  * overridden in derived classes.
441  *
442  * @param vbar Output vector of species partial molar volumes.
443  * Length = m_kk. units are m^3/kmol.
444  */
445  virtual void getPartialMolarVolumes(doublereal* vbar) const;
446 
447  //! Get the array of temperature second derivatives of the log activity
448  //! coefficients
449  /*!
450  * units = 1/Kelvin
451  *
452  * @param d2lnActCoeffdT2 Output vector of temperature 2nd derivatives of
453  * the log Activity Coefficients. length = m_kk
454  */
455  virtual void getd2lnActCoeffdT2(doublereal* d2lnActCoeffdT2) const;
456 
457  virtual void getdlnActCoeffdT(doublereal* dlnActCoeffdT) const;
458 
459  /// @}
460  /// @name Initialization
461  /// The following methods are used in the process of constructing
462  /// the phase and setting its parameters from a specification in an
463  /// input file. They are not normally used in application programs.
464  /// To see how they are used, see importPhase().
465  /// @{
466 
467  virtual void initThermo();
468  virtual void initThermoXML(XML_Node& phaseNode, const std::string& id);
469 
470  //! @}
471  //! @name Derivatives of Thermodynamic Variables needed for Applications
472  //! @{
473 
474  virtual void getdlnActCoeffds(const doublereal dTds, const doublereal* const dXds, doublereal* dlnActCoeffds) const;
475  virtual void getdlnActCoeffdlnX_diag(doublereal* dlnActCoeffdlnX_diag) const;
476  virtual void getdlnActCoeffdlnN_diag(doublereal* dlnActCoeffdlnN_diag) const;
477  virtual void getdlnActCoeffdlnN(const size_t ld, doublereal* const dlnActCoeffdlnN);
478 
479  //@}
480 
481 private:
482  //! Process an XML node called "binaryNeutralSpeciesParameters"
483  /*!
484  * This node contains all of the parameters necessary to describe the
485  * Margules model for a particular binary interaction. This function reads
486  * the XML file and writes the coefficients it finds to an internal data
487  * structures.
488  *
489  * @param xmlBinarySpecies Reference to the XML_Node named
490  * "binaryNeutralSpeciesParameters" containing the binary interaction
491  */
492  void readXMLBinarySpecies(XML_Node& xmlBinarySpecies);
493 
494  //! Resize internal arrays within the object that depend upon the number of
495  //! binary Margules interaction terms
496  /*!
497  * @param num Number of binary Margules interaction terms
498  */
499  void resizeNumInteractions(const size_t num);
500 
501  //! Initialize lengths of local variables after all species have been
502  //! identified.
503  void initLengths();
504 
505  //! Update the activity coefficients
506  /*!
507  * This function will be called to update the internally stored natural
508  * logarithm of the activity coefficients
509  */
510  void s_update_lnActCoeff() const;
511 
512  //! Update the derivative of the log of the activity coefficients wrt T
513  /*!
514  * This function will be called to update the internally stored derivative
515  * of the natural logarithm of the activity coefficients wrt temperature.
516  */
517  void s_update_dlnActCoeff_dT() const;
518 
519  //! Update the derivative of the log of the activity coefficients wrt
520  //! log(mole fraction)
521  /*!
522  * This function will be called to update the internally stored derivative
523  * of the natural logarithm of the activity coefficients wrt logarithm of
524  * the mole fractions.
525  */
526  void s_update_dlnActCoeff_dlnX_diag() const;
527 
528  //! Update the derivative of the log of the activity coefficients wrt
529  //! log(moles) - diagonal only
530  /*!
531  * This function will be called to update the internally stored diagonal
532  * entries for the derivative of the natural logarithm of the activity
533  * coefficients wrt logarithm of the moles.
534  */
535  void s_update_dlnActCoeff_dlnN_diag() const;
536 
537  //! Update the derivative of the log of the activity coefficients wrt
538  //! log(moles_m)
539  /*!
540  * This function will be called to update the internally stored derivative
541  * of the natural logarithm of the activity coefficients wrt logarithm of
542  * the mole number of species
543  */
544  void s_update_dlnActCoeff_dlnN() const;
545 
546 protected:
547  //! number of binary interaction expressions
549 
550  //! Enthalpy term for the binary mole fraction interaction of the excess
551  //! Gibbs free energy expression
553 
554  //! Enthalpy term for the ternary mole fraction interaction of the excess
555  //! Gibbs free energy expression
557 
558  //! Enthalpy term for the quaternary mole fraction interaction of the excess
559  //! Gibbs free energy expression
561 
562  //! Entropy term for the binary mole fraction interaction of the excess
563  //! Gibbs free energy expression
565 
566  //! Entropy term for the ternary mole fraction interaction of the excess
567  //! Gibbs free energy expression
569 
570  //! Entropy term for the quaternary mole fraction interaction of the excess
571  //! Gibbs free energy expression
573 
574  //! Enthalpy term for the binary mole fraction interaction of the excess
575  //! Gibbs free energy expression
577 
578  //! Enthalpy term for the ternary mole fraction interaction of the excess
579  //! Gibbs free energy expression
581 
582  //! Enthalpy term for the quaternary mole fraction interaction of the excess
583  //! Gibbs free energy expression
585 
586  //! Entropy term for the binary mole fraction interaction of the excess
587  //! Gibbs free energy expression
589 
590  //! Entropy term for the ternary mole fraction interaction of the excess
591  //! Gibbs free energy expression
593 
594  //! Entropy term for the quaternary mole fraction interaction of the excess
595  //! Gibbs free energy expression
597 
598  //! vector of species indices representing species A in the interaction
599  /*!
600  * Each Margules excess Gibbs free energy term involves two species, A and
601  * B. This vector identifies species A.
602  */
603  std::vector<size_t> m_pSpecies_A_ij;
604 
605  //! vector of species indices representing species B in the interaction
606  /*!
607  * Each Margules excess Gibbs free energy term involves two species, A and
608  * B. This vector identifies species B.
609  */
610  std::vector<size_t> m_pSpecies_B_ij;
611 
612  //! form of the Margules interaction expression
613  /*!
614  * Currently there is only one form.
615  */
617 
618  //! form of the temperature dependence of the Margules interaction expression
619  /*!
620  * Currently there is only one form -> constant wrt temperature.
621  */
623 };
624 
625 }
626 
627 #endif
void s_update_dlnActCoeff_dlnX_diag() const
Update the derivative of the log of the activity coefficients wrt log(mole fraction) ...
vector_fp m_VSE_b_ij
Entropy term for the binary mole fraction interaction of the excess Gibbs free energy expression...
virtual void getd2lnActCoeffdT2(doublereal *d2lnActCoeffdT2) const
Get the array of temperature second derivatives of the log activity coefficients. ...
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.
int formTempModel_
form of the temperature dependence of the Margules interaction expression
vector_fp m_VHE_c_ij
Enthalpy term for the ternary mole fraction interaction of the excess Gibbs free energy expression...
virtual void getdlnActCoeffdlnN(const size_t ld, doublereal *const dlnActCoeffdlnN)
Get the array of derivatives of the log activity coefficients with respect to the log of the species ...
void initLengths()
Initialize lengths of local variables after all species have been identified.
virtual void getdlnActCoeffdlnX_diag(doublereal *dlnActCoeffdlnX_diag) const
Get the array of ln mole fraction derivatives of the log activity coefficients - diagonal component o...
Class XML_Node is a tree-based representation of the contents of an XML file.
Definition: xml.h:97
vector_fp m_HE_d_ij
Enthalpy term for the quaternary mole fraction interaction of the excess Gibbs free energy expression...
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Import and initialize a ThermoPhase object using an XML tree.
int formMargules_
form of the Margules interaction expression
void resizeNumInteractions(const size_t num)
Resize internal arrays within the object that depend upon the number of binary Margules interaction t...
virtual void getdlnActCoeffds(const doublereal dTds, const doublereal *const dXds, doublereal *dlnActCoeffds) const
Get the change in activity coefficients wrt changes in state (temp, mole fraction, etc) along a line in parameter space or along a line in physical space.
virtual doublereal cp_mole() const
Molar heat capacity at constant pressure. Units: J/kmol/K.
virtual void getActivityCoefficients(doublereal *ac) const
Get the array of non-dimensional molar-based activity coefficients at the current solution temperatur...
std::vector< size_t > m_pSpecies_A_ij
vector of species indices representing species A in the interaction
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:93
virtual void getdlnActCoeffdlnN_diag(doublereal *dlnActCoeffdlnN_diag) const
Get the array of log species mole number derivatives of the log activity coefficients.
virtual void getPartialMolarCp(doublereal *cpbar) const
Returns an array of partial molar entropies for the species in the mixture.
void readXMLBinarySpecies(XML_Node &xmlBinarySpecies)
Process an XML node called "binaryNeutralSpeciesParameters".
virtual doublereal entropy_mole() const
Molar entropy. Units: J/kmol/K.
virtual doublereal enthalpy_mole() const
Molar enthalpy. Units: J/kmol.
virtual void getdlnActCoeffdT(doublereal *dlnActCoeffdT) const
Get the array of temperature derivatives of the log activity coefficients.
vector_fp m_VSE_d_ij
Entropy term for the quaternary mole fraction interaction of the excess Gibbs free energy expression...
vector_fp m_VHE_d_ij
Enthalpy term for the quaternary mole fraction interaction of the excess Gibbs free energy expression...
virtual void getPartialMolarEntropies(doublereal *sbar) const
Returns an array of partial molar entropies for the species in the mixture.
vector_fp m_HE_b_ij
Enthalpy term for the binary mole fraction interaction of the excess Gibbs free energy expression...
Header for intermediate ThermoPhase object for phases which employ Gibbs excess free energy based for...
virtual std::string type() const
String indicating the thermodynamic model implemented.
virtual void getPartialMolarVolumes(doublereal *vbar) const
Return an array of partial molar volumes for the species in the mixture.
std::vector< size_t > m_pSpecies_B_ij
vector of species indices representing species B in the interaction
vector_fp m_VSE_c_ij
Entropy term for the ternary mole fraction interaction of the excess Gibbs free energy expression...
size_t numBinaryInteractions_
number of binary interaction expressions
vector_fp m_SE_c_ij
Entropy term for the ternary mole fraction interaction of the excess Gibbs free energy expression...
virtual ThermoPhase * duplMyselfAsThermoPhase() const
Duplication routine for objects which inherit from ThermoPhase.
void s_update_dlnActCoeff_dlnN_diag() const
Update the derivative of the log of the activity coefficients wrt log(moles) - diagonal only...
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
PhaseCombo_Interaction is a derived class of GibbsExcessVPSSTP that employs the Margules approximatio...
void s_update_dlnActCoeff_dT() const
Update the derivative of the log of the activity coefficients wrt T.
virtual doublereal cv_mole() const
Molar heat capacity at constant volume. Units: J/kmol/K.
vector_fp m_SE_d_ij
Entropy term for the quaternary mole fraction interaction of the excess Gibbs free energy expression...
virtual void getChemPotentials(doublereal *mu) const
Get the species chemical potentials. Units: J/kmol.
vector_fp m_SE_b_ij
Entropy term for the binary mole fraction interaction of the excess Gibbs free energy expression...
Namespace for the Cantera kernel.
Definition: application.cpp:29
vector_fp m_HE_c_ij
Enthalpy term for the ternary mole fraction interaction of the excess Gibbs free energy expression...
vector_fp m_VHE_b_ij
Enthalpy term for the binary mole fraction interaction of the excess Gibbs free energy expression...
void s_update_lnActCoeff() const
Update the activity coefficients.
void s_update_dlnActCoeff_dlnN() const
Update the derivative of the log of the activity coefficients wrt log(moles_m)
virtual int eosType() const
Equation of state type flag.