10 #include "gtest/gtest.h" 15 TEST(GeochemicalDatabaseReaderTest, filename)
22 TEST(GeochemicalDatabaseReaderTest, faultyDB)
31 catch (
const std::exception &
err)
33 const std::string msg =
"The MOOSE database database/faultydbs/missing_header.json does not " 34 "have a required \"Header\" field";
36 std::size_t pos = std::string(
err.what()).find(msg);
37 ASSERT_TRUE(pos != std::string::npos);
41 TEST(GeochemicalDatabaseReaderTest, getActivityModel)
48 TEST(GeochemicalDatabaseReaderTest, getFugacityModel)
55 TEST(GeochemicalDatabaseReaderTest, getLogKModel)
63 EXPECT_EQ(database2.getLogKModel(),
"fourth-order");
67 EXPECT_EQ(database3.getLogKModel(),
"piecewise-linear");
70 TEST(GeochemicalDatabaseReaderTest, getTemperatures)
78 std::vector<Real> temperature_points_gold{0.0, 25.0, 60.0, 100.0, 150.0, 200.0, 250.0, 300.0};
79 EXPECT_EQ(temperature_points, temperature_points_gold);
82 TEST(GeochemicalDatabaseReaderTest, getPressures)
90 std::vector<Real> pressure_points_gold{
91 1.0134, 1.0134, 1.0134, 1.0134, 4.7600, 15.5490, 39.7760, 85.9270};
92 EXPECT_EQ(pressure_points, pressure_points_gold);
95 TEST(GeochemicalDatabaseReaderTest, getDebyeHuckel)
103 std::vector<Real> adh_gold{.4913, .5092, .5450, .5998, .6898, .8099, .9785, 1.2555};
104 std::vector<Real> bdh_gold{.3247, .3283, .3343, .3422, .3533, .3655, .3792, .3965};
105 std::vector<Real> bdot_gold{.0174, .0410, .0440, .0460, .0470, .0470, .0340, 0.0000};
107 EXPECT_EQ(dh.adh, adh_gold);
108 EXPECT_EQ(dh.bdh, bdh_gold);
109 EXPECT_EQ(dh.bdot, bdot_gold);
112 TEST(GeochemicalDatabaseReaderTest, getNeutralSpeciesActivity)
120 auto ns = nsa[
"co2"];
121 std::vector<Real> a_gold{.1224, .1127, .09341, .08018, .08427, .09892, .1371, .1967};
122 std::vector<Real> b_gold{-.004679, -.01049, -.0036, -.001503, -.01184, -.0104, -.007086, -.01809};
123 std::vector<Real> c_gold{
124 -0.0004114, 0.001545, 9.609e-05, 0.0005009, 0.003118, 0.001386, -0.002887, -0.002497};
125 std::vector<Real> d_gold(8);
127 EXPECT_EQ(ns.a, a_gold);
128 EXPECT_EQ(ns.b, b_gold);
129 EXPECT_EQ(ns.c, c_gold);
130 EXPECT_TRUE(ns.d.empty());
133 a_gold = {1.4203, 1.45397, 1.5012, 1.5551, 1.6225, 1.6899, 1.7573, 1.8247};
134 b_gold = {0.0177, 0.022357, 0.0289, 0.036478, 0.045891, 0.0553, 0.0647, 0.0741};
135 c_gold = {0.0103, 0.0093804, 0.008, 0.0064366, 0.0045221, 0.0026, 0.0006, -0.0013};
136 d_gold = {-0.0005, -0.0005362, -0.0006, -0.0007132, -0.0008312, -0.0009, -0.0011, -0.0012};
138 EXPECT_EQ(ns.a, a_gold);
139 EXPECT_EQ(ns.b, b_gold);
140 EXPECT_EQ(ns.c, c_gold);
141 EXPECT_EQ(ns.d, d_gold);
148 FAIL() <<
"Missing expected exception.";
150 catch (
const std::exception & e)
152 std::string msg(e.what());
153 ASSERT_TRUE(msg.find(
"No neutral species activity coefficients in database") !=
155 <<
"Failed with unexpected error message: " << msg;
159 TEST(GeochemicalDatabaseReaderTest, getElements)
168 EXPECT_EQ(el.name,
"Silver");
169 EXPECT_EQ(el.molecular_weight, 107.8680);
173 EXPECT_EQ(el.name,
"Aluminum");
174 EXPECT_EQ(el.molecular_weight, 26.9815);
177 TEST(GeochemicalDatabaseReaderTest, getBasisSpecies)
182 std::vector<std::string> bs_names{
"Ca++",
"HCO3-",
"H+"};
188 std::vector<std::string> bs_names_returned;
190 bs_names_returned.push_back(
b.first);
192 std::sort(bs_names_returned.begin(), bs_names_returned.end());
193 std::sort(bs_names.begin(), bs_names.end());
194 EXPECT_EQ(bs_names_returned, bs_names);
197 auto species = bs[
"Ca++"];
199 std::map<std::string, Real> els_gold = {{
"Ca", 1}};
200 EXPECT_EQ(species.radius, 6);
201 EXPECT_EQ(species.charge, 2);
202 EXPECT_EQ(species.molecular_weight, 40.08);
203 EXPECT_EQ(species.elements, els_gold);
205 species = bs[
"HCO3-"];
207 els_gold = {{
"C", 1}, {
"H", 1}, {
"O", 3}};
208 EXPECT_EQ(species.radius, 4.5);
209 EXPECT_EQ(species.charge, -1);
210 EXPECT_EQ(species.molecular_weight, 61.0171);
211 EXPECT_EQ(species.elements, els_gold);
215 els_gold = {{
"H", 1}};
216 EXPECT_EQ(species.radius, 9);
217 EXPECT_EQ(species.charge, 1);
218 EXPECT_EQ(species.molecular_weight, 1.0079);
219 EXPECT_EQ(species.elements, els_gold);
225 FAIL() <<
"Missing expected exception.";
227 catch (
const std::exception & e)
229 std::string msg(e.what());
230 ASSERT_TRUE(msg.find(
"does_not_exist does not exist in database database/moose_testdb.json") !=
232 <<
"Failed with unexpected error message: " << msg;
236 TEST(GeochemicalDatabaseReaderTest, getEquilibriumSpecies)
241 std::vector<std::string> ss_names{
"CO2(aq)",
"CO3--",
"CaCO3",
"CaOH+",
"OH-"};
247 std::vector<std::string> ss_names_returned;
249 ss_names_returned.push_back(s.first);
251 std::sort(ss_names_returned.begin(), ss_names_returned.end());
252 std::sort(ss_names.begin(), ss_names.end());
253 EXPECT_EQ(ss_names_returned, ss_names);
256 auto sspecies = ss[
"CO2(aq)"];
257 std::vector<Real> logk_gold{
258 -6.5570, -6.3660, -6.3325, -6.4330, -6.7420, -7.1880, -7.7630, -8.4650};
259 std::map<std::string, Real> bs_gold = {{
"H2O", -1}, {
"H+", 1}, {
"HCO3-", 1}};
261 EXPECT_EQ(sspecies.radius, 4);
262 EXPECT_EQ(sspecies.charge, 0);
263 EXPECT_EQ(sspecies.molecular_weight, 44.0098);
264 EXPECT_EQ(sspecies.basis_species, bs_gold);
265 EXPECT_EQ(sspecies.equilibrium_const, logk_gold);
267 sspecies = ss[
"CO3--"];
268 logk_gold = {10.6169, 10.3439, 10.2092, 10.2793, 10.5131, 10.8637, 11.2860, 11.6319};
269 bs_gold = {{
"H+", -1}, {
"HCO3-", 1}};
271 EXPECT_EQ(sspecies.radius, 4.5);
272 EXPECT_EQ(sspecies.charge, -2);
273 EXPECT_EQ(sspecies.molecular_weight, 60.0092);
274 EXPECT_EQ(sspecies.basis_species, bs_gold);
275 EXPECT_EQ(sspecies.equilibrium_const, logk_gold);
277 sspecies = ss[
"CaCO3"];
278 logk_gold = {7.5520, 7.1280, 6.7340, 6.4350, 6.1810, 5.9320, 5.5640, 4.7890};
279 bs_gold = {{
"Ca++", 1}, {
"HCO3-", 1}, {
"H+", -1}};
281 EXPECT_EQ(sspecies.radius, 4);
282 EXPECT_EQ(sspecies.charge, 0);
283 EXPECT_EQ(sspecies.molecular_weight, 100.0892);
284 EXPECT_EQ(sspecies.basis_species, bs_gold);
285 EXPECT_EQ(sspecies.equilibrium_const, logk_gold);
287 sspecies = ss[
"CaOH+"];
288 logk_gold = {13.7095, 12.6887, 11.5069, 10.4366, 9.3958, 8.5583, 7.8155, 7.0306};
289 bs_gold = {{
"Ca++", 1}, {
"H2O", 1}, {
"H+", -1}};
291 EXPECT_EQ(sspecies.radius, 4);
292 EXPECT_EQ(sspecies.charge, 1);
293 EXPECT_EQ(sspecies.molecular_weight, 57.0873);
294 EXPECT_EQ(sspecies.basis_species, bs_gold);
295 EXPECT_EQ(sspecies.equilibrium_const, logk_gold);
297 sspecies = ss[
"OH-"];
298 logk_gold = {14.9325, 13.9868, 13.0199, 12.2403, 11.5940, 11.2191, 11.0880, 1001.2844};
299 bs_gold = {{
"H2O", 1}, {
"H+", -1}};
301 EXPECT_EQ(sspecies.radius, 3.5);
302 EXPECT_EQ(sspecies.charge, -1);
303 EXPECT_EQ(sspecies.molecular_weight, 17.0073);
304 EXPECT_EQ(sspecies.basis_species, bs_gold);
305 EXPECT_EQ(sspecies.equilibrium_const, logk_gold);
311 FAIL() <<
"Missing expected exception.";
313 catch (
const std::exception & e)
315 std::string msg(e.what());
316 ASSERT_TRUE(msg.find(
"does_not_exist does not exist in database database/moose_testdb.json") !=
318 <<
"Failed with unexpected error message: " << msg;
322 TEST(GeochemicalDatabaseReaderTest, getMineralSpecies)
327 std::vector<std::string> ms_names{
"Calcite",
"Fe(OH)3(ppd)"};
333 std::vector<std::string> ms_names_returned;
335 ms_names_returned.push_back(s.first);
337 std::sort(ms_names_returned.begin(), ms_names_returned.end());
338 std::sort(ms_names.begin(), ms_names.end());
339 EXPECT_EQ(ms_names_returned, ms_names);
341 auto mspecies = ms[
"Calcite"];
342 std::vector<Real> logk_gold = {2.0683, 1.7130, 1.2133, .6871, .0762, -.5349, -1.2301, -2.2107};
343 std::map<std::string, Real> bs_gold = {{
"Ca++", 1}, {
"H+", -1}, {
"HCO3-", 1}};
345 EXPECT_EQ(mspecies.molecular_volume, 36.934);
346 EXPECT_EQ(mspecies.molecular_weight, 100.0892);
347 EXPECT_EQ(mspecies.basis_species, bs_gold);
348 EXPECT_EQ(mspecies.equilibrium_const, logk_gold);
349 EXPECT_EQ(mspecies.surface_area, 0.0);
351 mspecies = ms[
"Fe(OH)3(ppd)"];
352 logk_gold = {6.1946, 4.8890, 3.4608, 2.2392, 1.1150, .2446, -.5504, -1.5398};
353 bs_gold = {{
"H+", -3}, {
"Fe+++", 1}, {
"H2O", 3}};
355 EXPECT_EQ(mspecies.molecular_volume, 34.32);
356 EXPECT_EQ(mspecies.molecular_weight, 106.8689);
357 EXPECT_EQ(mspecies.basis_species, bs_gold);
358 EXPECT_EQ(mspecies.equilibrium_const, logk_gold);
359 EXPECT_EQ(mspecies.surface_area, 600.0);
360 bs_gold = {{
">(s)FeOH", 0.005}, {
">(w)FeOH", 0.2}};
361 EXPECT_EQ(mspecies.sorption_sites, bs_gold);
367 FAIL() <<
"Missing expected exception.";
369 catch (
const std::exception & e)
371 std::string msg(e.what());
372 ASSERT_TRUE(msg.find(
"does_not_exist does not exist in database database/moose_testdb.json") !=
374 <<
"Failed with unexpected error message: " << msg;
378 TEST(GeochemicalDatabaseReaderTest, getGasSpecies)
383 std::vector<std::string> gs_names{
"N2(g)",
"CH4(g)"};
389 std::vector<std::string> gs_names_returned;
391 gs_names_returned.push_back(s.first);
393 std::sort(gs_names_returned.begin(), gs_names_returned.end());
394 std::sort(gs_names.begin(), gs_names.end());
395 EXPECT_EQ(gs_names_returned, gs_names);
397 auto gspecies = gs[
"N2(g)"];
398 std::vector<Real> logk_gold = {
399 -2.9620, -3.1848, -3.3320, -3.2902, -3.1631, -2.9499, -2.7827, -2.3699};
400 std::map<std::string, Real> bs_gold = {{
"N2(aq)", 1}};
402 EXPECT_EQ(gspecies.molecular_weight, 28.0134);
403 EXPECT_EQ(gspecies.basis_species, bs_gold);
404 EXPECT_EQ(gspecies.equilibrium_const, logk_gold);
405 EXPECT_TRUE(gspecies.chi.empty());
406 EXPECT_EQ(gspecies.Pcrit, 33.9);
407 EXPECT_EQ(gspecies.Tcrit, 126.2);
408 EXPECT_EQ(gspecies.omega, .039);
410 gspecies = gs[
"CH4(g)"];
411 logk_gold = {-2.6487, -2.8202, -2.9329, -2.9446, -2.9163, -2.7253, -2.4643, -2.1569};
412 bs_gold = {{
"CH4(aq)", 1}};
413 std::vector<Real> chi_gold = {-537.779, 1.54946, -.000927827, 1.20861, -.00370814, 3.33804e-6};
415 EXPECT_EQ(gspecies.molecular_weight, 16.0426);
416 EXPECT_EQ(gspecies.basis_species, bs_gold);
417 EXPECT_EQ(gspecies.equilibrium_const, logk_gold);
418 EXPECT_EQ(gspecies.chi, chi_gold);
419 EXPECT_EQ(gspecies.Pcrit, 46.0);
420 EXPECT_EQ(gspecies.Tcrit, 190.4);
421 EXPECT_EQ(gspecies.omega, .011);
427 FAIL() <<
"Missing expected exception.";
429 catch (
const std::exception & e)
431 std::string msg(e.what());
432 ASSERT_TRUE(msg.find(
"does_not_exist does not exist in database database/moose_testdb.json") !=
434 <<
"Failed with unexpected error message: " << msg;
438 TEST(GeochemicalDatabaseReaderTest, getRedoxSpecies)
443 std::vector<std::string> rs_names{
"Am++++"};
449 std::vector<std::string> rs_names_returned;
451 rs_names_returned.push_back(s.first);
453 std::sort(rs_names_returned.begin(), rs_names_returned.end());
454 std::sort(rs_names.begin(), rs_names.end());
455 EXPECT_EQ(rs_names_returned, rs_names);
457 auto rspecies = rs[
"Am++++"];
458 std::vector<Real> logk_gold = {
459 18.7967, 18.0815, 17.2698, 16.5278, 15.8024, 15.2312, 14.7898, 14.4250};
460 std::map<std::string, Real> bs_gold = {{
"H2O", -0.5}, {
"H+", 1}, {
"Am+++", 1}, {
"O2(aq)", 0.250}};
462 EXPECT_EQ(rspecies.radius, 11);
463 EXPECT_EQ(rspecies.charge, 4);
464 EXPECT_EQ(rspecies.molecular_weight, 241.0600);
465 EXPECT_EQ(rspecies.basis_species, bs_gold);
466 EXPECT_EQ(rspecies.equilibrium_const, logk_gold);
472 FAIL() <<
"Missing expected exception.";
474 catch (
const std::exception & e)
476 std::string msg(e.what());
477 ASSERT_TRUE(msg.find(
"does_not_exist does not exist in database database/moose_testdb.json") !=
479 <<
"Failed with unexpected error message: " << msg;
483 TEST(GeochemicalDatabaseReaderTest, getOxideSpecies)
488 std::vector<std::string> os_names{
"Cu2O"};
494 std::vector<std::string> os_names_returned;
496 os_names_returned.push_back(s.first);
498 EXPECT_EQ(os_names_returned, os_names);
500 auto ospecies =
os[
"Cu2O"];
501 std::map<std::string, Real> bs_gold = {{
"H+", -2}, {
"Cu+", 2}, {
"H2O", 1}};
503 EXPECT_EQ(ospecies.molecular_weight, 143.0929);
504 EXPECT_EQ(ospecies.basis_species, bs_gold);
510 FAIL() <<
"Missing expected exception.";
512 catch (
const std::exception & e)
514 std::string msg(e.what());
515 ASSERT_TRUE(msg.find(
"does_not_exist does not exist in database database/moose_testdb.json") !=
517 <<
"Failed with unexpected error message: " << msg;
521 TEST(GeochemicalDatabaseReaderTest, getSurfaceSpecies)
525 std::vector<std::string> ss_names{
">(s)FeO-"};
530 std::vector<std::string> ss_names_returned;
532 ss_names_returned.push_back(s.first);
534 EXPECT_EQ(ss_names_returned, ss_names);
536 auto sspecies = ss[
">(s)FeO-"];
537 std::map<std::string, Real> ss_gold = {{
">(s)FeOH", 1}, {
"H+", -1}};
539 EXPECT_EQ(sspecies.basis_species, ss_gold);
545 FAIL() <<
"Missing expected exception.";
547 catch (
const std::exception & e)
549 std::string msg(e.what());
550 ASSERT_TRUE(msg.find(
"does_not_exist does not exist in database database/moose_testdb.json") !=
552 <<
"Failed with unexpected error message: " << msg;
556 TEST(GeochemicalDatabaseReaderTest, equilibriumReactions)
561 std::vector<std::string> names{
"CO2(aq)",
"CO3--",
"CaCO3",
"CaOH+",
"OH-"};
565 EXPECT_EQ(reactions[0],
"CO2(aq) = H+ - H2O + HCO3-");
566 EXPECT_EQ(reactions[1],
"CO3-- = - H+ + HCO3-");
567 EXPECT_EQ(reactions[2],
"CaCO3 = Ca++ - H+ + HCO3-");
568 EXPECT_EQ(reactions[3],
"CaOH+ = Ca++ - H+ + H2O");
569 EXPECT_EQ(reactions[4],
"OH- = - H+ + H2O");
575 FAIL() <<
"Missing expected exception.";
577 catch (
const std::exception & e)
579 std::string msg(e.what());
580 ASSERT_TRUE(msg.find(
"does_not_exist does not exist in database database/moose_testdb.json") !=
582 <<
"Failed with unexpected error message: " << msg;
586 TEST(GeochemicalDatabaseReaderTest, mineralReactions)
591 std::vector<std::string> names{
"Calcite"};
595 EXPECT_EQ(reactions[0],
"Calcite = Ca++ - H+ + HCO3-");
601 FAIL() <<
"Missing expected exception.";
603 catch (
const std::exception & e)
605 std::string msg(e.what());
606 ASSERT_TRUE(msg.find(
"does_not_exist does not exist in database database/moose_testdb.json") !=
608 <<
"Failed with unexpected error message: " << msg;
612 TEST(GeochemicalDatabaseReaderTest, gasReactions)
617 std::vector<std::string> names{
"CH4(g)",
"N2(g)"};
621 EXPECT_EQ(reactions[0],
"CH4(g) = CH4(aq)");
622 EXPECT_EQ(reactions[1],
"N2(g) = N2(aq)");
628 FAIL() <<
"Missing expected exception.";
630 catch (
const std::exception & e)
632 std::string msg(e.what());
633 ASSERT_TRUE(msg.find(
"does_not_exist does not exist in database database/moose_testdb.json") !=
635 <<
"Failed with unexpected error message: " << msg;
639 TEST(GeochemicalDatabaseReaderTest, redoxReactions)
644 std::vector<std::string> names{
"(O-phth)--",
"Am++++"};
648 EXPECT_EQ(reactions[0],
"(O-phth)-- = 6H+ -5H2O + 8HCO3- -7.5O2(aq)");
649 EXPECT_EQ(reactions[1],
"Am++++ = Am+++ + H+ -0.5H2O + 0.25O2(aq)");
655 FAIL() <<
"Missing expected exception.";
657 catch (
const std::exception & e)
659 std::string msg(e.what());
660 ASSERT_TRUE(msg.find(
"does_not_exist does not exist in database database/moose_testdb.json") !=
662 <<
"Failed with unexpected error message: " << msg;
666 TEST(GeochemicalDatabaseReaderTest, oxideReactions)
671 std::vector<std::string> names{
"Cu2O"};
675 EXPECT_EQ(reactions[0],
"Cu2O = 2Cu+ -2H+ + H2O");
681 FAIL() <<
"Missing expected exception.";
683 catch (
const std::exception & e)
685 std::string msg(e.what());
686 ASSERT_TRUE(msg.find(
"does_not_exist does not exist in database database/moose_testdb.json") !=
688 <<
"Failed with unexpected error message: " << msg;
692 TEST(GeochemicalDatabaseReaderTest, isBasisSpecies)
711 TEST(GeochemicalDatabaseReaderTest, isSecondarySpecies)
731 TEST(GeochemicalDatabaseReaderTest, isMineralSpecies)
750 TEST(GeochemicalDatabaseReaderTest, isRedoxSpecies)
769 TEST(GeochemicalDatabaseReaderTest, isGasSpecies)
788 TEST(GeochemicalDatabaseReaderTest, isSorbingMineral)
807 TEST(GeochemicalDatabaseReaderTest, isOxideSpecies)
826 TEST(GeochemicalDatabaseReaderTest, isSurfaceSpecies)
845 TEST(GeochemicalDatabaseReaderTest, mineralSpeciesNames)
850 for (
const auto & n : {
"Calcite",
856 "problematic_sorber"})
857 EXPECT_TRUE(std::find(names.begin(), names.end(), n) != names.end());
858 EXPECT_EQ(names.size(), (std::size_t)7);
861 TEST(GeochemicalDatabaseReaderTest, secondarySpeciesNames)
866 for (
const auto & n : {
"CO2(aq)",
"CO3--",
"CaCO3",
"CaOH+",
"OH-",
"e-",
"seq_radius_neg1"})
867 EXPECT_TRUE(std::find(names.begin(), names.end(), n) != names.end());
868 EXPECT_EQ(names.size(), (std::size_t)8);
871 TEST(GeochemicalDatabaseReaderTest, redoxCoupleNames)
876 for (
const auto & n : {
"(O-phth)--",
"Am++++",
"CH4(aq)",
"Fe+++",
"StoiCheckRedox"})
877 EXPECT_TRUE(std::find(names.begin(), names.end(), n) != names.end());
878 EXPECT_EQ(names.size(), (std::size_t)5);
881 TEST(GeochemicalDatabaseReaderTest, surfaceSpeciesNames)
886 for (
const auto & n : {
">(s)FeO-",
">(s)FeOCa+"})
887 EXPECT_TRUE(std::find(names.begin(), names.end(), n) != names.end());
888 EXPECT_EQ(names.size(), (std::size_t)2);
891 TEST(GeochemicalDatabaseReaderTest, getSpeciesData)
896 std::string gold =
"Ca++:\n{\n \"charge\": 2,\n \"elements\": {\n \"Ca\": 1.0\n " 897 "},\n \"molecular weight\": 40.08,\n \"radius\": 6.0\n}";
898 EXPECT_EQ(data, gold);
904 FAIL() <<
"Missing expected exception.";
906 catch (
const std::exception & e)
908 std::string msg(e.what());
909 ASSERT_TRUE(msg.find(
"does_not_exist is not a species in the database") != std::string::npos)
910 <<
"Failed with unexpected error message: " << msg;
915 TEST(GeochemicalDatabaseReaderTest, freeElectron)
921 std::vector<Real> logk_gold{
922 23.4266, 21.50045, 19.277525, 17.24705, 15.238975, 13.64975, 12.34665, 11.27355};
923 std::map<std::string, Real> bs_gold = {{
"H2O", 0.5}, {
"H+", -1}, {
"O2(aq)", -0.25}};
924 EXPECT_EQ(fe.charge, -1.0);
925 EXPECT_EQ(fe.radius, 0.0);
926 EXPECT_EQ(fe.molecular_weight, 0.0);
927 EXPECT_EQ(fe.basis_species, bs_gold);
928 EXPECT_EQ(fe.equilibrium_const, logk_gold);
932 TEST(GeochemicalDatabaseReaderTest, freeElectronNoReexpress)
938 std::vector<Real> logk_gold{
939 22.76135, 20.7757, 18.513025, 16.4658, 14.473225, 12.92125, 11.68165, 10.67105};
940 std::map<std::string, Real> bs_gold = {{
"H2O", 0.5}, {
"H+", -1}, {
"O2(g)", -0.25}};
941 EXPECT_EQ(fe.charge, -1.0);
942 EXPECT_EQ(fe.radius, 0.0);
943 EXPECT_EQ(fe.molecular_weight, 0.0);
944 EXPECT_EQ(fe.basis_species, bs_gold);
945 EXPECT_EQ(fe.equilibrium_const, logk_gold);
949 TEST(GeochemicalDatabaseReaderTest, isSecondarySpecies_noextrap)
std::map< std::string, GeochemistrySurfaceSpecies > getSurfaceSpecies(const std::vector< std::string > &names)
Get the surface sorbing species information.
std::map< std::string, GeochemistryEquilibriumSpecies > getEquilibriumSpecies(const std::vector< std::string > &names)
Get the secondary equilibrium species information.
std::vector< Real > getPressures()
Get the pressure points that the equilibrium constant is defined at.
std::string getActivityModel() const
Get the activity model type.
const GeochemistryDebyeHuckel & getDebyeHuckel() const
Get the Debye-Huckel activity coefficients.
std::vector< std::string > redoxCoupleNames() const
Returns a list of all the names of the "redox couples" in the database.
std::map< std::string, GeochemistryMineralSpecies > getMineralSpecies(const std::vector< std::string > &names)
Get the mineral species information.
std::map< std::string, GeochemistryGasSpecies > getGasSpecies(const std::vector< std::string > &names)
Get the gas species information.
std::vector< std::string > redoxReactions(const std::vector< std::string > &names) const
Generates a formatted vector of strings representing all redox reactions.
const FileName & filename() const
Filename of database.
std::string getLogKModel() const
Get the equilibrium constant model type.
std::string getFugacityModel() const
Get the fugacity model type.
std::basic_ostream< charT, traits > * os
std::string getSpeciesData(const std::string name) const
String representation of JSON species object contents.
const GeochemicalDatabaseReader database("database/moose_testdb.json", true, true, false)
bool isSorbingMineral(const std::string &name) const
returns True iff name is the name of a sorbing mineral
std::vector< std::string > mineralSpeciesNames() const
Returns a list of all the names of the "mineral species" in the database.
bool isOxideSpecies(const std::string &name) const
const std::vector< Real > & getTemperatures() const
Get the temperature points that the equilibrium constant is defined at.
std::vector< std::string > surfaceSpeciesNames() const
Returns a list of all the names of the "surface species" in the database.
TEST(GeochemicalDatabaseReaderTest, filename)
std::map< std::string, GeochemistryBasisSpecies > getBasisSpecies(const std::vector< std::string > &names)
Get the basis (primary) species information.
bool isGasSpecies(const std::string &name) const
std::map< std::string, GeochemistryElements > getElements()
Get all the elements.
std::vector< std::string > equilibriumReactions(const std::vector< std::string > &names) const
Generates a formatted vector of strings representing all aqueous equilibrium reactions.
bool isSecondarySpecies(const std::string &name) const
Returns true if name is a "secondary species" or "free electron" in the database. ...
std::vector< std::string > secondarySpeciesNames() const
Returns a list of all the names of the "secondary species" and "free electron" in the database...
bool isSurfaceSpecies(const std::string &name) const
std::vector< std::string > oxideReactions(const std::vector< std::string > &names) const
Generates a formatted vector of strings representing all oxide reactions.
std::map< std::string, GeochemistryOxideSpecies > getOxideSpecies(const std::vector< std::string > &names)
Get the oxide species information.
bool isMineralSpecies(const std::string &name) const
const std::map< std::string, GeochemistryNeutralSpeciesActivity > & getNeutralSpeciesActivity() const
Get the neutral species activity coefficients.
std::map< std::string, GeochemistryRedoxSpecies > getRedoxSpecies(const std::vector< std::string > &names)
Get the redox species (couples) information.
std::vector< std::string > gasReactions(const std::vector< std::string > &names) const
Generates a formatted vector of strings representing all gas reactions.
Class for reading geochemical reactions from a MOOSE geochemical database.
bool isRedoxSpecies(const std::string &name) const
std::vector< std::string > mineralReactions(const std::vector< std::string > &names) const
Generates a formatted vector of strings representing all mineral reactions.
bool isBasisSpecies(const std::string &name) const
Checks if species is of given type.