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

Debye-Hückel model does not satisfy consistency relationship when using variable A_Debye and "dilute" approximation #1502

Open
speth opened this issue Jun 12, 2023 · 0 comments

Comments

@speth
Copy link
Member

speth commented Jun 12, 2023

Problem description

When using the the dilute limit form of the Debye-Hückel model with A_Debye as a function of T and P, the following thermodynamic identity is not satisfied: $$\left. \frac{\partial s}{\partial P}\right|_T = - \left. \frac{\partial v}{\partial T}\right|_P$$

Steps to reproduce

Create a phase definition by adding the following phase and species definitions to test/data/debye-huckel-all.yaml:

phases:
- name: debye-huckel-dilute-IAPWS
  elements: [O, H, C, E, Fe, Si, N, Na, Cl]
  species:
  species:
  - water_IAPWS: [H2O(L)]
  - species_waterSolution: [Na+, Cl-, H+, OH-, NaCl(aq), NaOH(aq), SiO2(aq),
      NaH3SiO4(aq), H3SiO4-]
  thermo: Debye-Huckel
  activity-data:
    model: dilute-limit
    A_Debye: variable
    B_Debye: 3.28640E9 kg^0.5/gmol^0.5/m
    max-ionic-strength: 3.0
    use-Helgeson-fixed-form: true
    default-ionic-radius: 3.5 angstrom
  state: {T: 300.0 K, P: 1.01325e+05 Pa, molalities: {Na+: 9.3549, Cl-: 9.3549, H+: 1.0499e-08,
      OH-: 1.3765e-06, NaCl(aq): 0.98492, NaOH(aq): 3.8836e-06, NaH3SiO4(aq): 6.8798e-05,
      SiO2(aq): 3.0179e-05, H3SiO4-: 1.0231e-06}}

water_IAPWS:
- name: H2O(L)
  composition: {H: 2, O: 1}
  equation-of-state:
    model: liquid-water-IAPWS95

Add a test case to consistency.cpp / consistency-cases.yaml to test the same states that are used for the other Debye-Huckel tests, then run the gtest test suite.

Behavior

In addition to the errors related to calculations of cp noted in #1500, which occur for any "form" of the model, in the dilute limit the following errors are also noted:

[ RUN      ] DebyeHuckelDilute_IAPWS/TestConsistency.dsdP_const_T_eq_minus_dV_dT_const_P/0
The difference between dsdP and -dvdT is 3.3643129666229918e-07, which exceeds tol, where
dsdP evaluates to -8.6653262251322138e-06,
-dvdT evaluates to -9.001757521794513e-06, and
tol evaluates to 9.001757521794514e-11.
[  FAILED  ] DebyeHuckelDilute_IAPWS/TestConsistency.dsdP_const_T_eq_minus_dV_dT_const_P/0

[ RUN      ] DebyeHuckelDilute_IAPWS/TestConsistency.dsdP_const_T_eq_minus_dV_dT_const_P/1
The difference between dsdP and -dvdT is 1.1736104129706076e-07, which exceeds tol, where
dsdP evaluates to -6.2996960828039867e-06,
-dvdT evaluates to -6.4170571241010475e-06, and
tol evaluates to 6.4170571241010481e-11.
[  FAILED  ] DebyeHuckelDilute_IAPWS/TestConsistency.dsdP_const_T_eq_minus_dV_dT_const_P/1

[ RUN      ] DebyeHuckelDilute_IAPWS/TestConsistency.dsdP_const_T_eq_minus_dV_dT_const_P/2
The difference between dsdP and -dvdT is 4.1357386968356715e-07, which exceeds tol, where
dsdP evaluates to -1.2342163995588498e-05,
-dvdT evaluates to -1.2755737865272065e-05, and
tol evaluates to 1.2755737865272067e-10.
[  FAILED  ] DebyeHuckelDilute_IAPWS/TestConsistency.dsdP_const_T_eq_minus_dV_dT_const_P/2

[ RUN      ] DebyeHuckelDilute_IAPWS/TestConsistency.dsdP_const_T_eq_minus_dV_dT_const_P/3
The difference between dsdP and -dvdT is 4.1030475777195397e-07, which exceeds tol, where
dsdP evaluates to -1.2281317817166268e-05,
-dvdT evaluates to -1.2691622574938222e-05, and
tol evaluates to 1.2691622574938223e-10.
[  FAILED  ] DebyeHuckelDilute_IAPWS/TestConsistency.dsdP_const_T_eq_minus_dV_dT_const_P/3\

This test succeeds with a relative tolerance of 1e-5 for all of the other variants of the Debye-Huckel model.

System information

  • Cantera version: main at 13cb334
  • OS: macOS 13.3

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant