Skip to content

Commit 4c8f9e9

Browse files
ischoeglspeth
authored andcommitted
[CI] Cover partial thermo properties in clib
1 parent cc9c5f5 commit 4c8f9e9

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

test/clib/test_clib.cpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,32 @@ TEST(ct, thermo)
208208
double T = thermo_temperature(thermo);
209209
ASSERT_GT(T, 2200);
210210
ASSERT_LT(T, 2300);
211+
212+
size_t ns = thermo_nSpecies(thermo);
213+
vector<double> work(ns);
214+
vector<double> X(ns);
215+
thermo_getMoleFractions(thermo, ns, X.data());
216+
double prod;
217+
218+
thermo_getPartialMolarEnthalpies(thermo, ns, work.data());
219+
prod = std::inner_product(X.begin(), X.end(), work.begin(), 0.0);
220+
ASSERT_NEAR(prod, thermo_enthalpy_mole(thermo), 1e-6);
221+
222+
thermo_getPartialMolarEntropies(thermo, ns, work.data());
223+
prod = std::inner_product(X.begin(), X.end(), work.begin(), 0.0);
224+
ASSERT_NEAR(prod, thermo_entropy_mole(thermo), 1e-6);
225+
226+
thermo_getPartialMolarIntEnergies(thermo, ns, work.data());
227+
prod = std::inner_product(X.begin(), X.end(), work.begin(), 0.0);
228+
ASSERT_NEAR(prod, thermo_intEnergy_mole(thermo), 1e-6);
229+
230+
thermo_getPartialMolarCp(thermo, ns, work.data());
231+
prod = std::inner_product(X.begin(), X.end(), work.begin(), 0.0);
232+
ASSERT_NEAR(prod, thermo_cp_mole(thermo), 1e-6);
233+
234+
thermo_getPartialMolarVolumes(thermo, ns, work.data());
235+
prod = std::inner_product(X.begin(), X.end(), work.begin(), 0.0);
236+
ASSERT_NEAR(prod, 1./thermo_molarDensity(thermo), 1e-6);
211237
}
212238

213239
TEST(ct, kinetics)

0 commit comments

Comments
 (0)