Skip to content

Commit

Permalink
[Test] Add SRK example input file and set up thermo consistency tests
Browse files Browse the repository at this point in the history
  • Loading branch information
corykinney committed Jan 13, 2023
1 parent f323fa5 commit b02fa1a
Show file tree
Hide file tree
Showing 3 changed files with 144 additions and 0 deletions.
129 changes: 129 additions & 0 deletions test/data/co2_SRK_example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
units: {length: cm, quantity: mol, activation-energy: cal/mol}

phases:
- name: CO2-PR
species: [CO2, H2O, H2, CO, CH4, O2, N2]
thermo: Soave-Redlich-Kwong
kinetics: gas
reactions: all
state: {T: 300, P: 1 atm, mole-fractions: {CO2: 0.99, H2: 0.01}}


species:
- name: CO2
composition: {C: 1, O: 2}
thermo:
model: NASA7
temperature-ranges: [200.0, 1000.0, 3500.0]
data:
- [2.35677352, 8.98459677e-03, -7.12356269e-06, 2.45919022e-09, -1.43699548e-13,
-4.83719697e+04, 9.90105222]
- [3.85746029, 4.41437026e-03, -2.21481404e-06, 5.23490188e-10, -4.72084164e-14,
-4.8759166e+04, 2.27163806]
note: L7/88
equation-of-state:
model: Soave-Redlich-Kwong
a: 3.700552E+11
b: 29.6547
acentric-factor: 0.228
- name: H2O
composition: {H: 2, O: 1}
thermo:
model: NASA7
temperature-ranges: [200.0, 1000.0, 3500.0]
data:
- [4.19864056, -2.0364341e-03, 6.52040211e-06, -5.48797062e-09, 1.77197817e-12,
-3.02937267e+04, -0.849032208]
- [3.03399249, 2.17691804e-03, -1.64072518e-07, -9.7041987e-11, 1.68200992e-14,
-3.00042971e+04, 4.9667701]
note: L8/89
equation-of-state:
model: Soave-Redlich-Kwong
a: 5.608487E+11
b: 21.1282
acentric-factor: 0.344
- name: H2
composition: {H: 2}
thermo:
model: NASA7
temperature-ranges: [200.0, 1000.0, 3500.0]
data:
- [2.34433112, 7.98052075e-03, -1.9478151e-05, 2.01572094e-08, -7.37611761e-12,
-917.935173, 0.683010238]
- [3.3372792, -4.94024731e-05, 4.99456778e-07, -1.79566394e-10, 2.00255376e-14,
-950.158922, -3.20502331]
note: TPIS78
equation-of-state:
model: Soave-Redlich-Kwong
a: 2.494771E+10
b: 18.4290
acentric-factor: -0.22
- name: CO
composition: {C: 1, O: 1}
thermo:
model: NASA7
temperature-ranges: [200.0, 1000.0, 3500.0]
data:
- [3.57953347, -6.1035368e-04, 1.01681433e-06, 9.07005884e-10, -9.04424499e-13,
-1.4344086e+04, 3.50840928]
- [2.71518561, 2.06252743e-03, -9.98825771e-07, 2.30053008e-10, -2.03647716e-14,
-1.41518724e+04, 7.81868772]
note: TPIS79
equation-of-state:
model: Soave-Redlich-Kwong
a: 1.502575E+11
b: 27.4578
acentric-factor: 0.049
- name: CH4
composition: {C: 1, H: 4}
thermo:
model: NASA7
temperature-ranges: [200.0, 1000.0, 3500.0]
data:
- [5.14987613, -0.0136709788, 4.91800599e-05, -4.84743026e-08, 1.66693956e-11,
-1.02466476e+04, -4.64130376]
- [0.074851495, 0.0133909467, -5.73285809e-06, 1.22292535e-09, -1.0181523e-13,
-9468.34459, 18.437318]
note: L8/88
equation-of-state:
model: Soave-Redlich-Kwong
a: 2.333891E+11
b: 29.8499
acentric-factor: 0.01
- name: O2
composition: {O: 2}
thermo:
model: NASA7
temperature-ranges: [200.0, 1000.0, 3500.0]
data:
- [3.78245636, -2.99673416e-03, 9.84730201e-06, -9.68129509e-09, 3.24372837e-12,
-1063.94356, 3.65767573]
- [3.28253784, 1.48308754e-03, -7.57966669e-07, 2.09470555e-10, -2.16717794e-14,
-1088.45772, 5.45323129]
note: TPIS89
equation-of-state:
model: Soave-Redlich-Kwong
a: 1.400265E+11
b: 22.0823
acentric-factor: 0.022
- name: N2
composition: {N: 2}
thermo:
model: NASA7
temperature-ranges: [300.0, 1000.0, 5000.0]
data:
- [3.298677, 1.4082404e-03, -3.963222e-06, 5.641515e-09, -2.444854e-12,
-1020.8999, 3.950372]
- [2.92664, 1.4879768e-03, -5.68476e-07, 1.0097038e-10, -6.753351e-15,
-922.7977, 5.980528]
note: '121286'
equation-of-state:
model: Soave-Redlich-Kwong
a: 1.388390E+11
b: 31.2734
acentric-factor: 0.04


reactions:
- equation: CO2 + H2 <=> CO + H2O # Reaction 1
rate-constant: {A: 1.2E+3, b: 0, Ea: 0}
9 changes: 9 additions & 0 deletions test/data/consistency-cases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ peng-robinson:
- {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}}

soave-redlich-kwong:
setup:
file: co2_SRK_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
Expand Down
6 changes: 6 additions & 0 deletions test/thermo/consistency.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,12 @@ INSTANTIATE_TEST_SUITE_P(PengRobinson, TestConsistency,
testing::ValuesIn(getStates("peng-robinson")))
);

INSTANTIATE_TEST_SUITE_P(SoaveRedlichKwong, TestConsistency,
testing::Combine(
testing::Values(getSetup("soave-redlich-kwong")),
testing::ValuesIn(getStates("soave-redlich-kwong")))
);

INSTANTIATE_TEST_SUITE_P(IdealMolalSolution, TestConsistency,
testing::Combine(
testing::Values(getSetup("ideal-molal-solution")),
Expand Down

0 comments on commit b02fa1a

Please sign in to comment.