Files
cantera/test/data/consistency-cases.yaml

425 lines
16 KiB
YAML

# Parameters for test cases defined in test/thermo/consistency.cpp
#
# Each top-level entry here corresponds to a Googletest "test suite" instantiation,
# using the INSTANTIATE_TEST_SUITE_P macro.
#
# Each of these entries has two keys, 'setup' and 'states'. The 'setup' map defines the
# phase to be loaded, information on cases that are known to fail, and optional
# tolerance parameters that are used in some tests. Within the 'setup' map, the
# following keys are recognized:
# - file: the name of the input file, read from the usual data paths (which
# includes test/data when running the test suite)
# - phase: The name of the phase to read. Optional - by default, the first phase
# in the file is used.
# - known-failures: A map where the keys identify tests that should be skipped because
# they are known to fail and the values are messages to be printed in the test log
# explaining why the test has been skipped. The keys are regular expressions that are
# searched for in the test names (second argument to TEST_P) defined in
# consistency.cpp. The test name is suffixed with '/N' where 'N' is the (zero-indexed)
# index into the 'states' array and can be used to skip specific test instances. Where
# possible, known failures should reference GitHub Issue numbers documenting known
# errors. This mechanism is not used to handle test cases that raise
# NotImplementedError; Those tests should be skipped automatically.
# - atol: An absolute tolerance used for tests comparing molar energy-like quantities.
# Default 1.0e-5.
# - atol_v: An absolute tolerance used for tests comparing molar volumes.
# Default 1.0e-11.
# - rtol_fd: A relative tolerance used in some finite difference tests. Default 1.0e-6.
#
# The 'states' key defines a list of maps, where each map provides a complete state
# definition for the phase. The map is passed directly to ThermoPhase::setState(), and
# supports setting the state using any of the variables supported there.
ideal-gas-h2o2:
setup:
file: h2o2.yaml
atol_v: 5e-11 # finite difference noise floor in dh/dP for ideal gas
states:
- {T: 300, P: 101325, X: {H2: 0.1, O2: 0.7, H2O2: 0.1}}
- {T: 300, P: 101325, Y: {H2: 0.1, O2: 0.7, H2O2: 0.1}}
- {T: 400, density: 5 g/cm^3 , X: {H2: 0.1, O2: 0.7, H2O2: 0.1}}
redlich-kwong:
setup:
file: co2_RK_example.yaml
rtol_fd: 1e-5
states:
- {T: 300, P: 101325, X: {CO2: 0.7, CH4: 0.2, H2O: 0.1}}
- {T: 320, P: 200 bar, X: {CO2: 0.3, CH4: 0.5, H2O: 0.2}}
- {T: 600, P: 200 bar, X: {CO2: 0.4, CH4: 0.2, H2O: 0.4}}
peng-robinson:
setup:
file: co2_PR_example.yaml
rtol_fd: 1e-5
states:
- {T: 300, P: 101325, X: {CO2: 0.7, CH4: 0.2, H2O: 0.1}}
- {T: 320, P: 200 bar, X: {CO2: 0.3, CH4: 0.5, H2O: 0.2}}
- {T: 600, P: 200 bar, X: {CO2: 0.4, CH4: 0.2, H2O: 0.4}}
ideal-molal-solution:
setup:
file: thermo-models.yaml
phase: ideal-molal-aqueous
states:
- {T: 300, P: 101325, molalities: {CH4(aq): 0.01, H2S(aq): 0.03, CO2(aq): 0.1}}
- {T: 300, P: 2 atm, molalities: {CH4(aq): 0.1, H2S(aq): 0.01, CO2(aq): 0.1}}
- {T: 340, P: 5 atm, molalities: {CH4(aq): 0.1, H2S(aq): 0.01, CO2(aq): 0.1}}
ideal-condensed-1:
setup:
file: thermo-models.yaml
phase: IdealSolidSolnPhase
states:
- {T: 300, P: 0.1 atm, X: {sp1: 1.0}}
- {T: 300, P: 1 atm, X: {sp1: 0.6, sp2: 0.4}}
- {T: 400, P: 0.1 atm, X: {sp1: 0.01, sp2: 0.03, sp3: 0.94}}
- {T: 500, P: 2 bar, X: {sp1: 0.1, sp2: 0.89, sp3: 0.01}}
ideal-condensed-2:
setup:
file: thermo-models.yaml
phase: IdealSolidSolnPhase2
states:
- {T: 300, P: 0.1 atm, X: {sp1: 1.0}}
- {T: 400, P: 0.1 atm, X: {sp1: 0.01, sp2: 0.03, sp3: 0.94}}
- {T: 500, P: 2 bar, X: {sp1: 0.1, sp2: 0.89, sp3: 0.01}}
binary-solution-tabulated:
setup:
file: BinarySolutionTabulatedThermo.yaml
phase: anode
known-failures:
gibbs_duhem_const_T_P/[012]: >-
Model does not satisfy Gibbs-Duhem relation. See GitHub Issue #1928.
states:
- {T: 300, P: 1 atm, X: {"Li[anode]": 0.3, "V[anode]": 0.7}}
- {T: 320, P: 1 atm, X: {"Li[anode]": 0.3, "V[anode]": 0.7}}
- {T: 340, P: 10 atm, X: {"Li[anode]": 0.6, "V[anode]": 0.4}}
- {T: 300, P: 5 atm, X: {"Li[anode]": 0.0, "V[anode]": 1.0}}
- {T: 300, P: 1 atm, X: {"Li[anode]": 1.0, "V[anode]": 0.0}}
- {T: 300, P: 5 atm, X: {"Li[anode]": 1.0e-10, "V[anode]": 1.0}}
- {T: 300, P: 1 atm, X: {"Li[anode]": 1.0, "V[anode]": 1.0e-10}}
electron-cloud:
setup:
file: thermo-models.yaml
phase: Metal
known-failures:
v_eq_dgdP_const_T: Problematic handling of "density"; See GitHub Issue #2131.
dhdP_const_T_eq_v_minus_T_dvdT_const_P: >-
Problematic handling of "density"; See GitHub Issue #2131.
states:
- {T: 300, P: 1 atm}
- {T: 400, P: 1 atm}
- {T: 500, P: 10 atm}
# The Python test_purefluid.py test suite contains a much more extensive set of tests
# for the pure substance models
nitrogen-purefluid:
setup:
file: liquidvapor.yaml
phase: nitrogen
rtol_fd: 2e-3 # agreement for Maxwell relations is limited
known-failures:
cv_eq_.+/3: cv not defined in two-phase region
cp_eq_sum_cpk_Xk: cp is inf in the two-phase region
dsdP_const_T_eq_minus_dV_dT_const_P/3: Can't set TP in two-phase region
sk_eq_minus_dmu_k_dT_const_P_X/3:
Perturbing T crosses the saturation boundary in the two-phase region
vk_eq_dmu_k_dP_const_T_X/3:
Perturbing P crosses the saturation boundary in the two-phase region
v_eq_dgdP_const_T/3:
Perturbing P crosses the saturation boundary in the two-phase region
dhdP_const_T_eq_v_minus_T_dvdT_const_P/3:
Perturbing T or P crosses the saturation boundary in the two-phase region
states:
- {T: 300, P: 1 atm}
- {T: 70, P: 1 atm}
- {T: 80, P: 100 atm}
- {T: 80, density: 100 kg/m^3}
plasma:
setup:
file: oxygen-plasma.yaml
phase: isotropic-electron-energy-plasma
known-failures:
c_eq_sqrt_dP_drho_const_s/.+:
For now, `setState_SV` is not supported in PlasmaPhase.
cp_eq_dhdT/[345]:
The differential methods are not yet implemented for two-temperature systems.
cv_eq_dudT/[345]:
The differential methods are not yet implemented for two-temperature systems.
cp_eq_dsdT_const_p_times_T/[345]:
The differential methods are not yet implemented for two-temperature systems.
cv_eq_dsdT_const_v_times_T/[345]:
The differential methods are not yet implemented for two-temperature systems.
dSdv_const_T_eq_dPdT_const_V/[345]:
The differential methods are not yet implemented for two-temperature systems.
dsdP_const_T_eq_minus_dV_dT_const_P/[345]:
The differential methods are not yet implemented for two-temperature systems.
betaT_eq_minus_dmv_dP_const_T_div_mv/[345]:
The differential methods are not yet implemented for two-temperature systems.
v_eq_dgdP_const_T/[345]:
For two-temperature systems, const_T implies same temperature.
dhdP_const_T_eq_v_minus_T_dvdT_const_P/[012]:
dhdp = 0 while v-T*dvdT is really close to 0 (<3e-11), but not enough
relative to the acceptable error (1e-11). Skip for now.
dhdP_const_T_eq_v_minus_T_dvdT_const_P/[345]:
The differential methods are not yet implemented for two-temperature systems.
chem_potentials_to_activities/[345]:
For two-temperature plasma states, getActivities() is defined from the
activity concentrations used by kinetics, which are kept equal to true molar
concentrations. This differs from the activities implied by the current
chemical potential model when the standard concentration is based on the
gas temperature.
states:
# In the test cases below, set Te=T
- {T: 300, P: 1 atm, X: {O2: 1.0, O2-: 1e-5, E: 1e-5}, Te: 300}
- {T: 300, P: 1 atm, X: {E: 1.0}, Te: 300}
- {T: 3500, P: 10 atm, X: {O2: 1.0, O2-: 2e-5, E: 2e-5}, Te: 3500}
# In the test case below, set Te != T
- {T: 300, P: 1 atm, X: {O2: 1.0, O2-: 1e-5, E: 1e-5}, Te: 10000}
- {T: 300, P: 1 atm, X: {E: 1.0}, Te: 10000}
- {T: 3500, P: 10 atm, X: {O2: 1.0, O2-: 2e-5, E: 2e-5}, Te: 10000}
debye-huckel-dilute:
setup:
file: debye-huckel-all.yaml
phase: debye-huckel-dilute
states: &debye-huckel-states
- {T: 300, P: 1 atm,
molalities: {Na+: 9.3549, Cl-: 9.3549, H+: 1.05e-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}}
- {T: 300, P: 1 atm,
molalities: {Na+: 4.1, Cl-: 4.1, H+: 1.05e-07, OH-: 1.3765e-05,
NaCl(aq): 2.2, NaOH(aq): 3.8836e-03}}
- {T: 320, P: 1 atm,
molalities: {Na+: 9.3549, Cl-: 9.3549, H+: 1.05e-06, OH-: 2.0e-05,
NaCl(aq): 0.98492, NaOH(aq): 3.8836e-06}}
- {T: 320, P: 20 atm,
molalities: {Na+: 9.3549, Cl-: 9.3549, H+: 1.05e-08, OH-: 1.3765e-06,
NaCl(aq): 0.98492, NaOH(aq): 3.8836e-06}}
debye-huckel-dilute-IAPWS:
setup:
file: debye-huckel-all.yaml
phase: debye-huckel-dilute-IAPWS
rtol_fd: 1e-5 # Good finite difference results with IAPWS are challenging
states: *debye-huckel-states
debye-huckel-B-dot-ak:
setup:
file: debye-huckel-all.yaml
phase: debye-huckel-B-dot-ak
known-failures:
gibbs_duhem_const_T_P: >-
The B-dot model with per-ion size parameters (a_k) gives ionic activity
coefficients whose composition dependence is not balanced by a consistent
solvent (water) activity, so sum_k X_k dmu_k != 0. See GitHub Issue #2132.
dmu_k_dNj_eq_dmu_j_dNk_const_T_P: >-
Same root cause as gibbs_duhem_const_T_P: the B-dot model with per-ion
size parameters gives ionic activity coefficients that depend on all
ionic molalities via species-specific a_k radii, but the solvent activity
is not adjusted to compensate. The mu_k therefore do not derive from a
single G(T, P, N), so the composition Hessian is not symmetric.
See GitHub Issue #2132.
states: *debye-huckel-states
debye-huckel-B-dot-ak-IAPWS:
setup:
file: debye-huckel-all.yaml
phase: debye-huckel-B-dot-ak-IAPWS
rtol_fd: 1e-5 # Good finite difference results with IAPWS are challenging
known-failures:
gibbs_duhem_const_T_P: See GitHub Issue #2132.
dmu_k_dNj_eq_dmu_j_dNk_const_T_P: See GitHub Issue #2132.
states: *debye-huckel-states
debye-huckel-B-dot-a:
setup:
file: debye-huckel-all.yaml
phase: debye-huckel-B-dot-a
states: *debye-huckel-states
debye-huckel-B-dot-a-IAPWS:
setup:
file: debye-huckel-all.yaml
phase: debye-huckel-B-dot-a-IAPWS
rtol_fd: 1e-5 # Good finite difference results with IAPWS are challenging
states: *debye-huckel-states
debye-huckel-pitzer-beta_ij:
setup:
file: debye-huckel-all.yaml
phase: debye-huckel-pitzer-beta_ij
states: *debye-huckel-states
debye-huckel-pitzer-beta_ij-IAPWS:
setup:
file: debye-huckel-all.yaml
phase: debye-huckel-pitzer-beta_ij-IAPWS
rtol_fd: 1e-5 # Good finite difference results with IAPWS are challenging
states: *debye-huckel-states
debye-huckel-beta_ij:
setup:
file: debye-huckel-all.yaml
phase: debye-huckel-beta_ij
states: *debye-huckel-states
debye-huckel-beta_ij-IAPWS:
setup:
file: debye-huckel-all.yaml
phase: debye-huckel-beta_ij-IAPWS
rtol_fd: 1e-5 # Good finite difference results with IAPWS are challenging
states: *debye-huckel-states
margules:
setup:
file: LiKCl_liquid.yaml
states:
- {T: 900, P: 1 atm, X: {KCl(L): 0.2, LiCl(L): 0.8}}
- {T: 1000, P: 10 atm, X: {KCl(L): 0.99, LiCl(L): 0.01}}
- {T: 1400, P: 20 atm, X: {KCl(L): 2.0e-5, LiCl(L): 1}}
margules-with-excess-volume:
setup:
file: thermo-models.yaml
phase: ethanol-water-rough
states:
- {T: 298.15, P: 1 atm, X: {ethanol: 0.3, water: 0.7}}
- {T: 298.15, P: 1 atm, X: {ethanol: 0.5, water: 0.5}}
- {T: 308.15, P: 1 atm, X: {ethanol: 0.5, water: 0.5}}
margules-SSVol:
# Tests Margules phase with PDSS_SSVol species (T-dependent standard state
# volumes), exercising the thermalExpansionCoeff and cv implementations.
setup:
file: Li_Liquid.yaml
phase: Li(L)
states:
- {T: 300, P: 1 atm, X: {Li(L): 0.4, "Li(L)2": 0.6}}
- {T: 400, P: 10 atm, X: {Li(L): 0.9, "Li(L)2": 0.1}}
- {T: 500, P: 5 atm, X: {Li(L): 0.5, "Li(L)2": 0.5}}
fixed-stoichiometry:
setup:
file: thermo-models.yaml
phase: KCl(s)
states:
- {T: 300, P: 1 atm}
- {T: 300, P: 10 atm}
- {T: 500, P: 10 atm}
ideal-surface:
setup:
file: surface-phases.yaml
phase: Pt-surf
atol_v: 1e-7
states:
- {T: 800, P: 1 atm, coverages: {Pt(s): 0.5, H(s): 0.4, O(s): 0.1}}
- {T: 800, P: 5 atm, coverages: {H(s): 1.0}}
- {T: 300, P: 20 atm, coverages: {Pt(s): 1.0}}
- {T: 600, P: 5 atm, coverages: {Pt(s): 0.1, O(s): 0.9}}
ideal-edge:
setup:
file: surface-phases.yaml
phase: TPB
atol_v: 1e3 # site density of 5e-18 kmol/m = linear molar volume of 2e17 m/kmol
states:
- {T: 300, P: 1 atm}
- {T: 900, P: 20 atm}
coverage-dependent-surface:
setup:
file: copt_covdepsurf_example.yaml
phase: covdep
atol_v: 1e-7
known-failures:
gibbs_duhem_const_T_P: >-
The coverage-dependent enthalpy and entropy corrections are applied to
each species' chemical potential without the cross-species coupling
required for the mu_k to derive from a single Gibbs energy function, so
sum_k X_k dmu_k != 0. See GitHub Issue #2133.
dmu_k_dNj_eq_dmu_j_dNk_const_T_P: >-
Same root cause as gibbs_duhem_const_T_P: the coverage-dependent surface
chemical potentials are not consistent partial molar Gibbs energies of a single
G(T, P, N), so the composition Hessian is not symmetric. See GitHub Issue #2133.
states:
- {T: 700, P: 1 atm,
coverages: {Pt: 0.0, OC_Pt: 0.1, CO2_Pt: 0.5, C_Pt: 0.1, O_Pt: 0.3}}
- {T: 800, P: 5 atm,
coverages: {Pt: 0.12, OC_Pt: 0.07, CO2_Pt: 0.21, C_Pt: 0.17, O_Pt: 0.43}}
- {T: 300, P: 3 atm,
coverages: {Pt: 0.0, OC_Pt: 0.71, CO2_Pt: 0.08, C_Pt: 0.07, O_Pt: 0.14}}
- {T: 500, P: 10 atm,
coverages: {Pt: 0.0, OC_Pt: 0.0, CO2_Pt: 0.09, C_Pt: 0.81, O_Pt: 0.1}}
liquid-water-IAPWS95:
setup:
file: liquidvapor.yaml
phase: liquid-water-IAPWS95
rtol_fd: 5e-3 # Limited agreement for Maxwell relations
known-failures:
log_standard_concentrations: Not implemented
states:
- {T: 300, P: 1 atm}
- {T: 360, P: 1 atm}
- {T: 450, P: 100 atm}
ideal-solution-VPSS-simple:
setup:
file: IdealSolidSolnPhaseExample.yaml
phase: VpssSolidSolutionExample
states:
- {T: 300, P: 1 atm, X: {C2H2-graph: 0.2, C-graph: 0.5, H2-solute: 0.3}}
- {T: 400, P: 1 atm, X: {C2H2-graph: 1.0}}
- {T: 500, P: 10 atm, X: {C-graph: 0.6, H2-solute: 0.4}}
ideal-solution-VPSS-HKFT:
setup:
file: pdss_hkft.yaml
# Relax tolerances slightly to accommodate iterative solver accuracy in the
# implementation of WaterPropsIAPWSphi::dfind, and the coarser finite difference
# step used internally in PDSS_HKFT::dVdP() relative to the consistency test finite
# difference step.
rtol_fd: 1.5e-5 # limited by vk_eq_dmu_k_dP test for state 3
atol_c: 5e-14
states:
- {T: 300, P: 1 atm, X: {H2O(L): 0.9, Na+: 0.05, Cl-: 0.05, H+: 1e-7, OH-: 1e-7}}
- {T: 360, P: 5 atm, X: {H2O(L): 0.6, Na+: 0.2, Cl-: 0.2}}
- {T: 330, P: 10 atm, X: {H2O(L): 0.9, Na+: 0.05, Cl-: 0.05, H+: 1e-7, OH-: 1e-7}}
- {T: 320, P: 1 atm, X: {H2O(L): 1.0, Na+: 0.01, Cl-: 0.05, H+: 0.04}}
Redlich-Kister-LiC6:
setup:
file: thermo-models.yaml
phase: Redlich-Kister-LiC6
states:
- {T: 300, P: 1 atm, X: {Li(C6): 0.85, V(C6): 0.15}}
- {T: 440, P: 1 atm, X: {Li(C6): 0.75, V(C6): 0.25}}
- {T: 350, P: 10 atm, X: {Li(C6): 1.0, V(C6): 0.0}}
- {T: 350, P: 10 atm, X: {Li(C6): 0.0, V(C6): 1.0}}
Redlich-Kister-complex:
setup:
file: thermo-models.yaml
phase: Redlich-Kister-complex
rtol_fd: 3e-5 # Limited by state 2 due to PDSS finite difference sensitivity
states:
- {T: 900, P: 1 atm, X: {KCl(l): 0.85, LiCl(l): 0.15}}
- {T: 950, P: 10 atm, X: {KCl(l): 0.3, LiCl(l): 0.2, NaCl(s): 0.5}}
- {T: 950, P: 0.1 atm, X: {KCl(l): 0.05, LiCl(l): 0.0, NaCl(s): 0.95}}
HMW-electrolyte:
setup:
file: HMW_NaCl.yaml
rtol_fd: 4e-6 # internal numerical differentiation in ADebye limits Maxwell relation precision
states:
- {T: 300, P: 1 atm, molalities: {Na+: 9.4, Cl-: 9.4, H+: 1.05e-05, OH-: 1.0e-05}}
- {T: 330, P: 1 atm, molalities: {Na+: 9.4, Cl-: 9.4, H+: 1.05e-04, OH-: 1.0e-04}}
- {T: 330, P: 10 atm, molalities: {Na+: 5.0, Cl-: 4.8, H+: 1.0e-07, OH-: 0.2}}