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