You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The molar activity coefficients (returned by getActivityCoefficients) for phases that use molalities internally (those derived from the MolalityVPSSTP class) are not correct.
Steps to reproduce
For the Debye-Huckel model:
>>>p=ct.Solution('test/data/debye-huckel-all.yaml', 'debye-huckel-dilute')
>>>p()
debye-huckel-dilute:
temperature300Kpressure101325Padensity55.9229kg/m^3meanmol. weight21.3322amupotential0VpH8.8611kg1kmol-----------------------enthalpy-1.22199e+07-2.607e+08Jinternalenergy-1.22217e+07-2.607e+08Jentropy4194.418.948e+04J/KGibbsfunction-1.34782e+07-2.875e+08Jheatcapacityc_p1581713.374e+06J/Kheatcapacityc_v<notimplemented>XMolalitiesChem.Pot. ChemPotSSActCoeffMolal
(J/kmol) (J/kmol)
-------------------------------------------------------------H2O(L) 0.73811555.5093-3.07518e+08-3.06815e+081.02227Na+0.1243939.3549-2.57445e+08-2.57956e+080.131209Cl-0.1243939.3549-1.83605e+08-1.84117e+080.131209H+1.39607e-101.0499e-08-5.08919e+0700.131209OH-1.83035e-081.3765e-06-2.65584e+08-2.26855e+080.131209NaCl(aq) 0.01309660.98492-4.32958e+08-4.3292e+081NaOH(aq) 5.16408e-083.8836e-06-5.14827e+08-4.83751e+081SiO2(aq) 4.01294e-073.0179e-05-9.25875e+08-8.99913e+081NaH3SiO4(aq) 9.14817e-076.8798e-05-1.74563e+09-1.72172e+091H3SiO4-1.36043e-081.0231e-06-1.50517e+09-1.4657e+090.131209>>>p.activitiesarray([7.54555306e-01, 1.22745026e+00, 1.22744995e+00, 1.37756687e-09,
1.80609658e-07, 9.84920000e-01, 3.88360000e-06, 3.01790000e-05,
6.87980000e-05, 1.34240277e-07])
>>>0.131209*9.3549# molal activity coefficient times molality for Na+1.2274470741# matches reported activity>>>p.activity_coefficients*p.X# should equal the activities, but doesn'tarray([7.54555306e-01, 2.21125165e-02, 2.21125109e-02, 2.48168672e-11,
3.25368299e-09, 1.77433338e-02, 6.99630540e-08, 5.43674685e-07,
1.23939597e-06, 2.41833859e-09])
Likewise for IdealMolalSoln:
>>>p=ct.Solution('test/data/thermo-models.yaml', 'ideal-molal-aqueous')
>>>p()
ideal-molal-aqueous:
temperature298.15Kpressure101325Padensity12.0577kg/m^3meanmol. weight18.07amupotential0V1kg1kmol-----------------------enthalpy0.0007350170.01328Jinternalenergy-8403.38-1.518e+05Jentropy5.1817793.63J/KGibbsfunction-2.15747e+06-3.899e+07Jheatcapacityc_p1595.82.884e+04J/Kheatcapacityc_v<notimplemented>XMolalitiesChem.Pot. ChemPotSSActCoeffMolal
(J/kmol) (J/kmol)
-------------------------------------------------------------H2O(l) 0.99748455.5093-3.89686e+07-3.89623e+070.999997CO2(aq) 0.001796970.1-4.46703e+07-3.89623e+071H2S(aq) 0.000539090.03-4.76549e+07-3.89623e+071CH4(aq) 0.0001796970.01-5.03783e+07-3.89623e+071>>>p.activitiesarray([0.99748108, 0.1 , 0.03 , 0.01 ]) # equals molal activity coeff times molality, except for solvent>>>p.activity_coefficientsarray([0.99999682, 1.0025221 , 1.0025221 , 1.0025221 ]) # not just returning molality based coefficients>>>p.activity_coefficients*p.Xarray([9.97481078e-01, 1.80150000e-03, 5.40450000e-04, 1.80150000e-04]) # should equal activities, but don't
Problem description
The molar activity coefficients (returned by
getActivityCoefficients
) for phases that use molalities internally (those derived from theMolalityVPSSTP
class) are not correct.Steps to reproduce
For the Debye-Huckel model:
Likewise for
IdealMolalSoln
:System information
main
at 1ab81acAdditional context
This was discovered as part of #1299, which implements Cantera/enhancements#114.
The text was updated successfully, but these errors were encountered: