Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HMW Electrolyte has discrepancies in specific heat, activity coefficients #1324

Open
speth opened this issue Jun 7, 2022 · 0 comments
Open

Comments

@speth
Copy link
Member

speth commented Jun 7, 2022

Problem description

The HMWSoln class (YAML phase name HMW-electrolyte displays some small discrepancies in calculations involving specific heats and entropy derivatives. There are also some major discrepancies in the molarity-based activity coefficients.

Steps to reproduce

import cantera as ct
p = ct.Solution('test/data/HMW_NaCl.yaml')
s = ct.SolutionArray(p, 3)
T = 330
P = 10 * ct.one_atm
dT = T * 1e-6
dP = P * 1e-6
s.TPX = [T, T+dT, T], [P, P, P+dP], [55, 5.0, 4.8, 1e-7, 0.2]

print('cp_mole:', s.cp_mole[0])
print('cp from h:', (s.enthalpy_mole[1] - s.enthalpy_mole[0])/dT)
print('cp from s:', (s.entropy_mole[1] - s.entropy_mole[0])/dT * T)

print('ds/dP|T:', (s.entropy_mole[2] - s.entropy_mole[0])/dP)
print('-dv/dT|P:', -(s.volume_mole[1] - s.volume_mole[0])/dT)
print('activities', p.activities)
print('X * gamma ', p.X * p.activity_coefficients)

Behavior

Output:

cp_mole: 60099.47245958206
cp from h: 59694.77052038366
cp from s: 59695.02446532715

ds/dP|T: -9.795058221764663e-06
-dv/dT|P: -9.923389540644756e-06

activities [7.43182302e-01 1.03517736e+01 1.10237209e+01 1.23344100e-07 3.43606673e-02]
X * gamma  [7.43182302e-01 1.86487202e-01 1.98592331e-01 2.22204396e-09 6.19007422e-04]

System information

  • Cantera version: 2.6.0 or main at 1ab81ac

Additional context

This was discovered as part of #1299, which implements Cantera/enhancements#114.

@ischoegl ischoegl moved this to In Progress in Cantera 3.0 Release Planning Jul 3, 2022
@ischoegl ischoegl moved this from In Progress to Todo in Cantera 3.0 Release Planning Jul 3, 2022
@speth speth moved this from Todo to Deferred in Cantera 3.0 Release Planning Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

1 participant