Cantera  4.0.0a1
Loading...
Searching...
No Matches
RedlichKwongMFTP.h
Go to the documentation of this file.
1//! @file RedlichKwongMFTP.h
2
3// This file is part of Cantera. See License.txt in the top-level directory or
4// at https://cantera.org/license.txt for license and copyright information.
5
6#ifndef CT_REDLICHKWONGMFTP_H
7#define CT_REDLICHKWONGMFTP_H
8
9#include "MixtureFugacityTP.h"
10#include "cantera/base/Array.h"
11
12namespace Cantera
13{
14/**
15 * # Implementation of a multi-species Redlich-Kwong equation of state
16 *
17 * The equation of state is
18 * @f[
19 * P(T,v,\mathbf{X}) = \frac{RT}{v-b} - \frac{a}{\sqrt{T} v (v+b)}
20 * @f]
21 * with mole-fraction mixing rules
22 * @f[
23 * a = \sum_i \sum_j X_i X_j a_{ij}(T),\qquad
24 * b = \sum_i X_i b_i
25 * @f]
26 * and (in the present model) linear temperature dependence
27 * @f[
28 * a_{ij}(T)=a_{ij,0}+a_{ij,1}T.
29 * @f]
30 *
31 * ## Notation used in property derivations {#redlich-Kwong-notation}
32 *
33 * Several equation of state derivatives are used in calculating the thermodynamic
34 * properties of the mixture. These include:
35 * @f[
36 * P_T = \frac{R}{v-b}
37 * - \frac{1}{\sqrt{T} v(v+b)}
38 * \left(\frac{\partial a}{\partial T} - \frac{a}{2T}\right)
39 * @f]
40 * @f[
41 * P_v = -\frac{RT}{(v-b)^2} + \frac{a(2v+b)}{\sqrt{T} v^2(v+b)^2}
42 * @f]
43 * @f[
44 * v_T = -\frac{P_T}{P_v},\qquad
45 * v_{TT} = -\frac{P_{TT} + 2 P_{Tv} v_T + P_{vv} v_T^2}{P_v}.
46 * @f]
47 *
48 * where subscript notation such as @f$P_T@f$, @f$P_{Tv}@f$, and @f$v_{TT}@f$ denote
49 * partial derivatives with composition and the remaining state variable held fixed.
50 *
51 * The following shorthand is used in some property calculations:
52 * @f[
53 * A_k = \sum_i X_i a_{ki},\qquad
54 * A'_k = \sum_i X_i \frac{d a_{ki}}{dT},\qquad
55 * S_k = 2T A'_k - 3A_k
56 * @f]
57 * @f[
58 * F = T\frac{da}{dT} - \frac{3}{2}a,\qquad
59 * L = \ln \left(\frac{v+b}{v}\right),\qquad
60 * C = -\frac{L}{b} + \frac{1}{v+b}.
61 * @f]
62 *
63 * @ingroup thermoprops
64 */
66{
67public:
68 //! Construct a RedlichKwongMFTP object from an input file
69 /*!
70 * @param infile Name of the input file containing the phase definition.
71 * If blank, an empty phase will be created.
72 * @param id name (ID) of the phase in the input file. If empty, the
73 * first phase definition in the input file will be used.
74 */
75 explicit RedlichKwongMFTP(const string& infile="", const string& id="");
76
77 string type() const override {
78 return "Redlich-Kwong";
79 }
80
81 //! @name Molar Thermodynamic properties
82 //! @{
83 double cp_mole() const override;
84 double cv_mole() const override;
85 //! @}
86 //! @name Mechanical Properties
87 //! @{
88
89 //! Return the thermodynamic pressure (Pa).
90 /*!
91 * Since the mass density, temperature, and mass fractions are stored,
92 * this method uses these values to implement the
93 * mechanical equation of state @f$ P(T, \rho, Y_1, \dots, Y_K) @f$.
94 *
95 * @f[
96 * P = \frac{RT}{v-b_{mix}} - \frac{a_{mix}}{T^{0.5} v \left( v + b_{mix} \right) }
97 * @f]
98 */
99 double pressure() const override;
100
101 //! @}
102
103public:
104
105 //! Returns the standard concentration @f$ C^0_k @f$, which is used to
106 //! normalize the generalized concentration.
107 /*!
108 * This is defined as the concentration by which the generalized
109 * concentration is normalized to produce the activity. In many cases, this
110 * quantity will be the same for all species in a phase. Since the activity
111 * for an ideal gas mixture is simply the mole fraction, for an ideal gas
112 * @f$ C^0_k = P/\hat R T @f$.
113 *
114 * @param k Optional parameter indicating the species. The default is to
115 * assume this refers to species 0.
116 * @return
117 * Returns the standard Concentration in units of m3 kmol-1.
118 */
119 double standardConcentration(size_t k=0) const override;
120
121 //! Get the array of non-dimensional activity coefficients at the current
122 //! solution temperature, pressure, and solution concentration.
123 /*!
124 * For all objects with the Mixture Fugacity approximation, we define the
125 * standard state as an ideal gas at the current temperature and pressure of
126 * the solution. The activities are based on this standard state.
127 *
128 * @param ac Output vector of activity coefficients. Length: m_kk.
129 */
130 void getActivityCoefficients(span<double> ac) const override;
131
132 //! @name Partial Molar Properties of the Solution
133 //! @{
134
135 void getChemPotentials(span<double> mu) const override;
136
137 //! Return partial molar enthalpies @f$ \bar{h}_k @f$ (J/kmol).
138 /*!
139 * The partial molar enthalpies for the Redlich-Kwong equation of state are:
140 * @f[
141 * \bar{h}_k = h_k^\t{ref} + h^E_k
142 * - \left(v - T \left.\frac{\partial v}{\partial T}\right|_{P,\mathbf{X}}\right)
143 * \left(\frac{\partial P}{\partial n_k}\right)_{T,V,n_j}
144 * @f]
145 * where the implementation starts from the ideal-gas reference values
146 * @f$ h_k^\t{ref}(T) @f$ and adds a constant volume departure term
147 * @f$ h^E_k @f$ and a final term to adjust to constant pressure.
148 *
149 * Here,
150 * @f[
151 * \left(\frac{\partial P}{\partial n_k}\right)_{T,V,n_j} =
152 * \frac{RT}{v-b} + \frac{RT b_k}{(v-b)^2}
153 * - \frac{2 A_k}{v(v+b) \sqrt{T}} + \frac{a b_k}{v(v+b)^2 \sqrt{T}},
154 * @f]
155 * and the intermediate departure term is
156 * @f[
157 * h^E_k = v\left(\frac{\partial P}{\partial n_k}\right)_{T,V,n_j}
158 * - RT - \frac{b_k}{b^2\sqrt{T}} L F + \frac{1}{b\sqrt{T}} L S_k
159 * + \frac{b_k}{(v+b)b\sqrt{T}} F
160 * @f]
161 * where
162 * @f[
163 * L = \ln \left(\frac{v+b}{v}\right),\quad
164 * F = T\left.\frac{\partial a}{\partial T}\right|_{\mathbf{X}} - \frac{3}{2}a,\quad
165 * S_k = 2T A'_k - 3A_k.
166 * @f]
167 */
168 void getPartialMolarEnthalpies(span<double> hbar) const override;
169 void getPartialMolarEntropies(span<double> sbar) const override;
170 void getPartialMolarIntEnergies(span<double> ubar) const override;
171
172 //! Get the species molar internal energies associated with the derivatives
173 //! of total internal energy at constant volume [J/kmol].
174 /*!
175 * This method computes
176 * @f[
177 * \tilde{u}_k = \frac{\partial U}{\partial n_k}\Bigg|_{T,V,n_{j\ne k}}
178 * = u_k^\t{ref} + \frac{1}{b\sqrt{T}} \left(L S_k + b_k F C\right)
179 * @f]
180 * Where @f$ L, S_k, F, @f$ and @f$ C @f$ are defined in the
181 * [notation section](#redlich-Kwong-notation) and @f$ u_k^\t{ref} @f$ is the
182 * ideal-gas reference internal energy.
183 *
184 * For non-ideal phases like Redlich-Kwong, these are distinct from the
185 * partial molar internal energies
186 * @f$ \bar{u}_k = \left(\partial U/\partial n_k\right)_{T,P,n_{j\ne k}} @f$
187 * calculated by the getPartialMolarIntEnergies() method.
188 */
189 void getPartialMolarIntEnergies_TV(span<double> utilde) const override;
190
191 //! Get the partial molar heat capacities at constant pressure [J/kmol/K].
192 /*!
193 * The partial molar heat capacities at constant pressure are defined as
194 * @f[
195 * \bar{c}_{p,k} = \left(\partial \bar{h}_k / \partial T\right)_{P,\mathbf{X}}
196 * @f]
197 * Expanding this expression via the chain rule at constant pressure and composition
198 * gives:
199 * @f[
200 * \bar{c}_{p,k} = c_{p,k}^\t{ref}
201 * + \frac{d h^{E,v}_k}{dT}\Bigg|_{P,\mathbf{X}}
202 * + T v_{TT} \Pi_k
203 * - \left(v - T v_T\right)\frac{d\Pi_k}{dT}\Bigg|_{P,\mathbf{X}},
204 * @f]
205 * where
206 * @f[
207 * \Pi_k \equiv \left(\frac{\partial P}{\partial n_k}\right)_{T,V,n_j}
208 * @f]
209 * and @f$ v_T @f$ and @f$ v_{TT} @f$ are the partial derivatives of the molar
210 * volume as given in the [notation section](#redlich-Kwong-notation).
211 *
212 * The derivative of the intermediate departure term can be expanded as
213 * @f{eqnarray*}{
214 * \frac{d h^{E,v}_k}{dT}\Bigg|_{P,\mathbf{X}}
215 * &=& v_T \Pi_k + v \frac{d\Pi_k}{dT}\Bigg|_{P,\mathbf{X}} - R
216 * - \frac{b_k}{b^2}\frac{d}{dT}\left(\frac{L F}{\sqrt{T}}\right)\Bigg|_{P,\mathbf{X}} \\
217 * &+& \frac{1}{b}\frac{d}{dT}\left(\frac{L S_k}{\sqrt{T}}\right)\Bigg|_{P,\mathbf{X}}
218 * + \frac{b_k}{b}\frac{d}{dT}\left(\frac{F}{(v+b)\sqrt{T}}\right)\Bigg|_{P,\mathbf{X}}.
219 * @f}
220 *
221 * The temperature derivatives appearing here are path derivatives at constant
222 * pressure and composition, and include both explicit temperature dependence and
223 * implicit dependence through @f$ v(T)\vert_{P,\mathbf{X}} @f$. These terms are
224 * computed as:
225 * @f[
226 * \frac{d}{dT}\left(\frac{L F}{\sqrt{T}}\right)\Bigg|_{P,\mathbf{X}}
227 * = \frac{1}{\sqrt{T}}\left(L_T F + L F_T - \frac{L F}{2T}\right),
228 * \qquad
229 *
230 * @f]
231 * @f[
232 * \frac{d}{dT}\left(\frac{L S_k}{\sqrt{T}}\right)\Bigg|_{P,\mathbf{X}}
233 * = \frac{1}{\sqrt{T}}\left(L_T S_k + L S_{k,T} - \frac{L S_k}{2T}\right),
234 * @f]
235 * @f[
236 * \frac{d}{dT}\left(\frac{F}{(v+b)\sqrt{T}}\right)\Bigg|_{P,\mathbf{X}}
237 * = \frac{F_T}{(v+b)\sqrt{T}}
238 * - \frac{F v_T}{(v+b)^2\sqrt{T}}
239 * - \frac{F}{2T(v+b)\sqrt{T}}
240 * @f]
241 * where
242 * @f[
243 * L_T \equiv \frac{dL}{dT}\Bigg|_{P,\mathbf{X}} = -\frac{b v_T}{v(v+b)},
244 * @f]
245 * @f[
246 * F_T \equiv \frac{dF}{dT}\Bigg|_{P,\mathbf{X}}
247 * =-\frac{1}{2}\frac{\partial a}{\partial T}\Bigg|_{\mathbf{X}},\t{ and}
248 * @f]
249 * @f[
250 * S_{k,T} \equiv \frac{dS_k}{dT}\Bigg|_{P,\mathbf{X}} = -A'_k.
251 * @f]
252 */
253 void getPartialMolarCp(span<double> cpbar) const override;
254
255 //! Get the species molar heat capacities associated with the constant volume
256 //! partial molar internal energies [J/kmol/K].
257 /*!
258 * This method computes
259 * @f[
260 * \tilde{c}_{v,k}
261 * = \left(\partial \tilde{u}_k/\partial T\right)_{V,\mathbf{n}}.
262 * @f]
263 * where @f$ \tilde{u}_k @f$ are the species molar internal energies computed at
264 * constant volume as in getPartialMolarIntEnergies_TV().
265 *
266 * Using the [previously-introduced notation](#redlich-Kwong-notation),
267 * @f[
268 * \tilde{u}_k = u_k^\t{ref}(T) + \frac{1}{b\sqrt{T}} \left(L S_k + b_k F C\right),
269 * @f]
270 * At constant volume and composition, @f$ L @f$ and @f$ C @f$ are constant and only
271 * @f$ F @f$ and @f$ S_k @f$ contribute temperature derivatives. Defining
272 * @f[
273 * \tilde{u}_k^E \equiv \frac{L S_k + b_k F C}{b\sqrt{T}},
274 * @f]
275 * Then
276 * @f[
277 * \tilde{c}_{v,k}
278 * = c_{v,k}^\t{ref}(T) + \frac{d\tilde{u}_k^E}{dT}\Bigg|_{V,\mathbf{n}}
279 * @f]
280 * where @f$ c_{v,k}^\t{ref} @f$ are the ideal gas specific heat capacities and
281 * @f[
282 * \frac{d\tilde{u}_k^E}{dT}\Bigg|_{V,\mathbf{n}} =
283 * \frac{1}{b\sqrt{T}} \left( L \frac{dS_k}{dT}\Bigg|_{\mathbf{X}}
284 * + b_k C \frac{dF}{dT}\Bigg|_{\mathbf{X}} \right)
285 * - \frac{\tilde{u}_k^E}{2T}.
286 * @f]
287 * For the temperature-dependent form @f$ a_{ij}(T)=a_{ij,0}+a_{ij,1}T @f$
288 * used here:
289 * @f[
290 * \frac{dA_k}{dT}\Bigg|_{\mathbf{X}} = A'_k,\qquad
291 * \frac{dS_k}{dT}\Bigg|_{\mathbf{X}} = -A'_k,\qquad
292 * \frac{dF}{dT}\Bigg|_{\mathbf{X}} = -\frac{1}{2}
293 * \left.\frac{\partial a}{\partial T}\right|_{\mathbf{X}}.
294 * @f]
295 */
296 void getPartialMolarCv_TV(span<double> cvtilde) const override;
297 void getPartialMolarVolumes(span<double> vbar) const override;
298 //! @}
299
300public:
301 //! @name Initialization Methods - For Internal use
302 //!
303 //! The following methods are used in the process of constructing
304 //! the phase and setting its parameters from a specification in an
305 //! input file. They are not normally used in application programs.
306 //! To see how they are used, see importPhase().
307 //! @{
308
309 bool addSpecies(shared_ptr<Species> spec) override;
310 void initThermo() override;
311 void getSpeciesParameters(const string& name, AnyMap& speciesNode) const override;
312
313 //! Set the pure fluid interaction parameters for a species
314 /*!
315 * The "a" parameter for species *i* in the Redlich-Kwong model is assumed
316 * to be a linear function of temperature:
317 * @f[ a = a_0 + a_1 T @f]
318 *
319 * @param species Name of the species
320 * @param a0 constant term in the expression for the "a" parameter
321 * of the specified species [Pa-m^6/kmol^2]
322 * @param a1 temperature-proportional term in the expression for the
323 * "a" parameter of the specified species [Pa-m^6/kmol^2/K]
324 * @param b "b" parameter in the Redlich-Kwong model [m^3/kmol]
325 */
326 void setSpeciesCoeffs(const string& species, double a0, double a1, double b);
327
328 //! Set values for the interaction parameter between two species
329 /*!
330 * The "a" parameter for interactions between species *i* and *j* is
331 * assumed by default to be computed as:
332 * @f[ a_{ij} = \sqrt(a_{i,0} a_{j,0}) + \sqrt(a_{i,1} a_{j,1}) T @f]
333 *
334 * This function overrides the defaults with the specified parameters:
335 * @f[ a_{ij} = a_{ij,0} + a_{ij,1} T @f]
336 *
337 * @param species_i Name of one species
338 * @param species_j Name of the other species
339 * @param a0 constant term in the "a" expression [Pa-m^6/kmol^2]
340 * @param a1 temperature-proportional term in the "a" expression
341 * [Pa-m^6/kmol^2/K]
342 */
343 void setBinaryCoeffs(const string& species_i,
344 const string& species_j, double a0, double a1);
345 //! @}
346
347protected:
348 // Special functions inherited from MixtureFugacityTP
349 double sresid() const override;
350 double hresid() const override;
351
352public:
353 double liquidVolEst(double TKelvin, double& pres) const override;
354 double densityCalc(double T, double pressure, int phase, double rhoguess) override;
355 double dpdVCalc(double TKelvin, double molarVol, double& presCalc) const override;
356
357 double isothermalCompressibility() const override;
358 double thermalExpansionCoeff() const override;
359 double internalPressure() const override;
360 double soundSpeed() const override;
361
362 //! Calculate dpdV and dpdT at the current conditions
363 /*!
364 * These are stored internally.
365 */
366 void pressureDerivatives() const;
367
368 //! Update the a and b parameters
369 /*!
370 * The a and the b parameters depend on the mole fraction and the
371 * temperature. This function updates the internal numbers based on the
372 * state of the object.
373 */
374 void updateMixingExpressions() override;
375
376 //! Calculate the a and the b parameters given the temperature
377 /*!
378 * This function doesn't change the internal state of the object, so it is a
379 * const function. It does use the stored mole fractions in the object.
380 *
381 * @param temp Temperature (TKelvin)
382 * @param aCalc (output) Returns the a value
383 * @param bCalc (output) Returns the b value.
384 */
385 void calculateAB(double temp, double& aCalc, double& bCalc) const;
386
387 // Special functions not inherited from MixtureFugacityTP
388
389 double da_dt() const;
390
391 void calcCriticalConditions(double& pc, double& tc, double& vc) const override;
392
393 //! Prepare variables and call the function to solve the cubic equation of state
394 int solveCubic(double T, double pres, double a, double b, span<double> Vroot) const;
395
396protected:
397 //! Form of the temperature parameterization
398 /*!
399 * - 0 = There is no temperature parameterization of a or b
400 * - 1 = The a_ij parameter is a linear function of the temperature
401 */
403
404 //! Value of b in the equation of state
405 /*!
406 * m_b is a function of the temperature and the mole fraction.
407 */
408 double m_b_current = 0.0;
409
410 //! Value of a in the equation of state
411 /*!
412 * a_b is a function of the temperature and the mole fraction.
413 */
414 double m_a_current = 0.0;
415
416 vector<double> a_vec_Curr_;
417 vector<double> b_vec_Curr_;
418
419 Array2D a_coeff_vec;
420
421 //! Explicitly-specified binary interaction parameters
422 map<string, map<string, pair<double, double>>> m_binaryParameters;
423
424 enum class CoeffSource { EoS, CritProps, Database };
425 //! For each species, specifies the source of the a and b coefficients
426 vector<CoeffSource> m_coeffSource;
427
428 int NSolns_ = 0;
429
430 double Vroot_[3] = {0.0, 0.0, 0.0};
431
432 //! Temporary storage - length = m_kk.
433 mutable vector<double> m_pp;
434
435 // Partial molar volumes of the species
436 mutable vector<double> m_partialMolarVolumes;
437
438 mutable vector<double> m_dAkdT; //!< Temporary storage for dA_k/dT; length #m_kk.
439
440 //! The derivative of the pressure wrt the volume
441 /*!
442 * Calculated at the current conditions. temperature and mole number kept
443 * constant
444 */
445 mutable double dpdV_ = 0.0;
446
447 //! The derivative of the pressure wrt the temperature
448 /*!
449 * Calculated at the current conditions. Total volume and mole number kept
450 * constant
451 */
452 mutable double dpdT_ = 0.0;
453
454 //! Vector of derivatives of pressure wrt mole number
455 /*!
456 * Calculated at the current conditions. Total volume, temperature and
457 * other mole number kept constant
458 */
459 mutable vector<double> dpdni_;
460
461private:
462 //! Omega constant for a -> value of a in terms of critical properties
463 /*!
464 * this was calculated from a small nonlinear solve
465 */
466 static const double omega_a;
467
468 //! Omega constant for b
469 static const double omega_b;
470
471 //! Omega constant for the critical molar volume
472 static const double omega_vc;
473};
474}
475
476#endif
Header file for class Cantera::Array2D.
Header file for a derived class of ThermoPhase that handles non-ideal mixtures based on the fugacity ...
A map of string keys to values whose type can vary at runtime.
Definition AnyMap.h:431
A class for 2D arrays stored in column-major (Fortran-compatible) form.
Definition Array.h:32
This is a filter class for ThermoPhase that implements some preparatory steps for efficiently handlin...
shared_ptr< Species > species(const string &name) const
Return the Species object for the named species.
Definition Phase.cpp:881
string name() const
Return the name of the phase.
Definition Phase.cpp:20
double dpdT_
The derivative of the pressure wrt the temperature.
void calculateAB(double temp, double &aCalc, double &bCalc) const
Calculate the a and the b parameters given the temperature.
double thermalExpansionCoeff() const override
Return the volumetric thermal expansion coefficient. Units: 1/K.
void setBinaryCoeffs(const string &species_i, const string &species_j, double a0, double a1)
Set values for the interaction parameter between two species.
vector< double > m_dAkdT
Temporary storage for dA_k/dT; length m_kk.
double sresid() const override
Calculate the deviation terms for the total entropy of the mixture from the ideal gas mixture.
void getPartialMolarEnthalpies(span< double > hbar) const override
Return partial molar enthalpies (J/kmol).
double soundSpeed() const override
Return the speed of sound. Units: m/s.
double pressure() const override
Return the thermodynamic pressure (Pa).
int m_formTempParam
Form of the temperature parameterization.
void getSpeciesParameters(const string &name, AnyMap &speciesNode) const override
Get phase-specific parameters of a Species object such that an identical one could be reconstructed a...
void getPartialMolarCp(span< double > cpbar) const override
Get the partial molar heat capacities at constant pressure [J/kmol/K].
static const double omega_b
Omega constant for b.
vector< double > m_pp
Temporary storage - length = m_kk.
void getActivityCoefficients(span< double > ac) const override
Get the array of non-dimensional activity coefficients at the current solution temperature,...
string type() const override
String indicating the thermodynamic model implemented.
void initThermo() override
Initialize the ThermoPhase object after all species have been set up.
void getPartialMolarIntEnergies_TV(span< double > utilde) const override
Get the species molar internal energies associated with the derivatives of total internal energy at c...
double internalPressure() const override
Return the internal pressure [Pa].
double cv_mole() const override
Molar heat capacity at constant volume and composition [J/kmol/K].
void pressureDerivatives() const
Calculate dpdV and dpdT at the current conditions.
double isothermalCompressibility() const override
Returns the isothermal compressibility. Units: 1/Pa.
double hresid() const override
Calculate the deviation terms for the total enthalpy of the mixture from the ideal gas mixture.
static const double omega_a
Omega constant for a -> value of a in terms of critical properties.
double liquidVolEst(double TKelvin, double &pres) const override
Estimate for the molar volume of the liquid.
void getPartialMolarCv_TV(span< double > cvtilde) const override
Get the species molar heat capacities associated with the constant volume partial molar internal ener...
double dpdVCalc(double TKelvin, double molarVol, double &presCalc) const override
Calculate the pressure and the pressure derivative given the temperature and the molar volume.
static const double omega_vc
Omega constant for the critical molar volume.
vector< CoeffSource > m_coeffSource
For each species, specifies the source of the a and b coefficients.
void updateMixingExpressions() override
Update the a and b parameters.
double cp_mole() const override
Molar heat capacity at constant pressure and composition [J/kmol/K].
void getPartialMolarVolumes(span< double > vbar) const override
Return an array of partial molar volumes for the species in the mixture.
double m_a_current
Value of a in the equation of state.
void getPartialMolarEntropies(span< double > sbar) const override
Returns an array of partial molar entropies of the species in the solution.
double standardConcentration(size_t k=0) const override
Returns the standard concentration , which is used to normalize the generalized concentration.
double dpdV_
The derivative of the pressure wrt the volume.
bool addSpecies(shared_ptr< Species > spec) override
Add a Species to this Phase.
double m_b_current
Value of b in the equation of state.
void getChemPotentials(span< double > mu) const override
Get the species chemical potentials. Units: J/kmol.
int solveCubic(double T, double pres, double a, double b, span< double > Vroot) const
Prepare variables and call the function to solve the cubic equation of state.
double densityCalc(double T, double pressure, int phase, double rhoguess) override
Calculates the density given the temperature and the pressure and a guess at the density.
vector< double > dpdni_
Vector of derivatives of pressure wrt mole number.
map< string, map< string, pair< double, double > > > m_binaryParameters
Explicitly-specified binary interaction parameters.
void setSpeciesCoeffs(const string &species, double a0, double a1, double b)
Set the pure fluid interaction parameters for a species.
void getPartialMolarIntEnergies(span< double > ubar) const override
Return an array of partial molar internal energies for the species in the mixture.
Namespace for the Cantera kernel.
Definition AnyMap.cpp:595