Skip to content

Commit 1043a67

Browse files
committed
move the momas example to exampleSystems
1 parent 6d0282a commit 1043a67

File tree

5 files changed

+39
-146
lines changed

5 files changed

+39
-146
lines changed

src/reactions/exampleSystems/MoMasBenchmark.hpp

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,33 +49,35 @@ namespace MomMasBenchmark
4949
},
5050

5151
// Forward rate constants
52-
{ 0.0,
53-
0.0,
54-
0.0,
55-
0.0,
56-
0.0,
57-
0.0,
58-
0.0
52+
{
53+
0.0, // C1 = -X2
54+
0.0, // C2 = X2 + X3
55+
0.0, // C3 = X2 + X4
56+
0.0, // C4 = -4X2 + X3 + 3X4
57+
0.0, // C5 = 4X2 + 3X3 + X4
58+
0.0, // CS1 = 3X2 + X3 + S
59+
0.0 // CS2 = -3X2 + X4 + 2S
5960
},
6061

6162
// Reverse rate constants
62-
{ 0.0,
63-
0.0,
64-
0.0,
65-
0.0,
66-
0.0,
67-
0.0,
68-
0.0
63+
{
64+
0.0, // C1 = -X2
65+
0.0, // C2 = X2 + X3
66+
0.0, // C3 = X2 + X4
67+
0.0, // C4 = -4X2 + X3 + 3X4
68+
0.0, // C5 = 4X2 + 3X3 + X4
69+
0.0, // CS1 = 3X2 + X3 + S
70+
0.0 // CS2 = -3X2 + X4 + 2S
6971
},
7072

7173
// Flag of mobile secondary species
72-
{ 1, // C1 = - X2
74+
{ 1, // C1 = -X2
7375
1, // C2 = X2 + X3
7476
1, // C3 = -X2 + X4
7577
1, // C4 = -4X2 + X3 + 3X4
7678
1, // C5 = 4X2 + 3X3 + X4
7779
0, // CS1 = 3X2 + X3 + S
78-
0 // CS2 = -3X2 + X4 + 2S
80+
0 // CS2 = -3X2 + X4 + 2S
7981
}
8082
};
8183

src/reactions/exampleSystems/unitTests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
set( testSourceFiles
33
testEquilibriumReactions.cpp
44
testKineticReactions.cpp
5+
testMomasEasyCase.cpp
56
)
67

78
set( dependencyList hpcReact gtest )

src/reactions/geochemistry/unitTests/testMomasEasyCase.cpp renamed to src/reactions/exampleSystems/unitTests/testMomasEasyCase.cpp

Lines changed: 20 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,12 @@
1111

1212

1313
#include "reactions/unitTestUtilities/equilibriumReactionsTestUtilities.hpp"
14-
#include "../Momas.hpp"
14+
#include "../MoMasBenchmark.hpp"
1515

1616
using namespace hpcReact;
17-
using namespace hpcReact::geochemistry;
17+
using namespace hpcReact::MomMasBenchmark;
1818
using namespace hpcReact::unitTest_utilities;
1919

20-
21-
// //******************************************************************************
22-
// TEST( testEquilibriumReactions, testEnforceEquilibrium )
23-
// {
24-
// double const initialSpeciesConcentration[] = { 1.0, 1.0e-16, 0.5, 1.0, 1.0e-16 };
25-
// double const expectedSpeciesConcentrations[5] = { 3.92138294e-01, 3.03930853e-01, 5.05945481e-01, 7.02014628e-01, 5.95970745e-01 };
26-
27-
28-
// std::cout<<" RESIDUAL_FORM 2:"<<std::endl;
29-
// testEnforceEquilibrium< double, 2 >( simpleTestRateParams.equilibriumReactionsParameters(),
30-
// initialSpeciesConcentration,
31-
// expectedSpeciesConcentrations );
32-
33-
// }
34-
35-
3620
//******************************************************************************
3721

3822
TEST( testEquilibriumReactions, testMoMasAllEquilibrium )
@@ -42,24 +26,24 @@ TEST( testEquilibriumReactions, testMoMasAllEquilibrium )
4226
int,
4327
int >;
4428

45-
constexpr int numPrimarySpecies = hpcReact::geochemistry::momasSystemAllEquilibrium.numPrimarySpecies();
29+
constexpr int numPrimarySpecies = hpcReact::MomMasBenchmark::simpleSystemParams.numPrimarySpecies();
4630

4731
double const targetAggregatePrimarySpeciesConcentration[numPrimarySpecies] =
4832
{
49-
1.0e-20, // X1
50-
-2.0, // X2
51-
1.0e-20, // X3
52-
2.0, // X4
53-
1.0 // S
33+
1.0e-20, // X1
34+
-2.0, // X2
35+
1.0e-20, // X3
36+
2.0, // X4
37+
1.0 // S
5438
};
5539

5640
double const initialPrimarySpeciesConcentration[numPrimarySpecies] =
5741
{
58-
1.0e-20, // X1
59-
0.02, // X2
60-
1.0e-20, // X3
61-
1.0, // X4
62-
1.00 // S
42+
1.0e-20, // X1
43+
0.02, // X2
44+
1.0e-20, // X3
45+
1.0, // X4
46+
1.00 // S
6347
};
6448

6549
double const logInitialPrimarySpeciesConcentration[numPrimarySpecies] =
@@ -73,18 +57,18 @@ TEST( testEquilibriumReactions, testMoMasAllEquilibrium )
7357

7458
double logPrimarySpeciesConcentration[numPrimarySpecies];
7559
EquilibriumReactionsType::enforceEquilibrium_Aggregate( 0,
76-
hpcReact::geochemistry::momasSystemAllEquilibrium.equilibriumReactionsParameters(),
60+
hpcReact::MomMasBenchmark::simpleSystemParams.equilibriumReactionsParameters(),
7761
targetAggregatePrimarySpeciesConcentration,
7862
logInitialPrimarySpeciesConcentration,
7963
logPrimarySpeciesConcentration );
8064

8165
double const expectedPrimarySpeciesConcentrations[numPrimarySpecies] =
8266
{
83-
9.7051090442170804E-21, // X1
84-
5.0023298955833342E-12, // X2
85-
1.9327372426296357E-33, // X3
86-
7.3929274619958745E-12, // X4
87-
9.8708294125907346E-13 // S
67+
9.9999999999999919e-21, // X1
68+
0.25971841330881928, // X2
69+
1.4603613417111526e-24, // X3
70+
0.3495378685828045, // X4
71+
0.39074371811222675 // S
8872
};
8973

9074
for( int r=0; r<numPrimarySpecies; ++r )
@@ -100,4 +84,4 @@ int main( int argc, char * * argv )
10084
::testing::InitGoogleTest( &argc, argv );
10185
int const result = RUN_ALL_TESTS();
10286
return result;
103-
}
87+
}

src/reactions/geochemistry/Momas.hpp

Lines changed: 0 additions & 93 deletions
This file was deleted.

src/reactions/geochemistry/unitTests/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ set( testSourceFiles
33
testGeochemicalEquilibriumReactions.cpp
44
testGeochemicalKineticReactions.cpp
55
testGeochemicalMixedReactions.cpp
6-
testMomasEasyCase.cpp
76
)
87

98
set( dependencyList hpcReact gtest )

0 commit comments

Comments
 (0)