Skip to content

Commit 3ec1ed8

Browse files
committed
refactor
1 parent fe0cdf9 commit 3ec1ed8

23 files changed

+99
-131
lines changed

src/CMakeLists.txt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22
set( hpcReact_headers
33
common/macros.hpp
44
common/CArrayWrapper.hpp
5-
reactions/bulkGeneric/EquilibriumReactions.hpp
6-
reactions/bulkGeneric/EquilibriumReactionsAggregatePrimaryConcentration_impl.hpp
7-
reactions/bulkGeneric/EquilibriumReactionsReactionExtents_impl.hpp
5+
reactions/exampleSystems/GenericSystems.hpp
86
reactions/geochemistry/GeochemicalSystems.hpp
97
reactions/geochemistry/Carbonate.hpp
108
reactions/geochemistry/Ultramafics.hpp
11-
reactions/bulkGeneric/KineticReactions.hpp
12-
reactions/bulkGeneric/KineticReactions_impl.hpp
13-
reactions/bulkGeneric/MixedEquilibriumKineticReactions.hpp
14-
reactions/bulkGeneric/MixedEquilibriumKineticReactions_impl.hpp
15-
reactions/bulkGeneric/Parameters.hpp
16-
reactions/bulkGeneric/GenericSystems.hpp
9+
reactions/massActions/MassActions.hpp
10+
reactions/reactionsSystems/EquilibriumReactions.hpp
11+
reactions/reactionsSystems/EquilibriumReactionsAggregatePrimaryConcentration_impl.hpp
12+
reactions/reactionsSystems/EquilibriumReactionsReactionExtents_impl.hpp
13+
reactions/reactionsSystems/KineticReactions.hpp
14+
reactions/reactionsSystems/KineticReactions_impl.hpp
15+
reactions/reactionsSystems/MixedEquilibriumKineticReactions.hpp
16+
reactions/reactionsSystems/MixedEquilibriumKineticReactions_impl.hpp
17+
reactions/reactionsSystems/Parameters.hpp
1718
reactions/unitTestUtilities/equilibriumReactionsTestUtilities.hpp
1819
reactions/unitTestUtilities/kineticReactionsTestUtilities.hpp
1920
reactions/unitTestUtilities/mixedReactionsTestUtilities.hpp
20-
reactions/massActions/MassActions.hpp
2121
)
2222

2323
set( hpcReact_sources)
@@ -65,7 +65,7 @@ message(STATUS "HPCReact/src CMAKE_CURRENT_SOURCE_DIR: ${CMAKE_CURRENT_SOURCE_DI
6565
# hpcReact_add_code_checks( PREFIX hpcReact
6666
# EXCLUDES "blt/*" )
6767

68-
add_subdirectory( reactions/bulkGeneric/unitTests )
68+
add_subdirectory( reactions/exampleSystems/unitTests )
6969
add_subdirectory( reactions/geochemistry/unitTests )
7070
add_subdirectory( reactions/massActions/unitTests )
7171
add_subdirectory( common/unitTests )

src/reactions/bulkGeneric/GenericSystems.hpp renamed to src/reactions/exampleSystems/GenericSystems.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#pragma once
22

3-
#include "Parameters.hpp"
3+
#include "../reactionsSystems/Parameters.hpp"
44

55
namespace hpcReact
66
{
7-
namespace bulkGeneric
7+
namespace reactionsSystems
88
{
99
// turn off uncrustify to allow for better readability of the parameters
1010
// *****UNCRUSTIFY-OFF******
@@ -72,5 +72,5 @@ simpleTestRateParams =
7272
{ 1.0, 0.5 }
7373
};
7474

75-
} // namespace bulkGeneric
75+
} // namespace reactionsSystems
7676
} // namespace hpcReact
File renamed without changes.

src/reactions/bulkGeneric/unitTests/testEquilibriumReactions.cpp renamed to src/reactions/exampleSystems/unitTests/testEquilibriumReactions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <gtest/gtest.h>
66

77
using namespace hpcReact;
8-
using namespace hpcReact::bulkGeneric;
8+
using namespace hpcReact::reactionsSystems;
99
using namespace hpcReact::unitTest_utilities;
1010

1111
//******************************************************************************

src/reactions/bulkGeneric/unitTests/testKineticReactions.cpp renamed to src/reactions/exampleSystems/unitTests/testKineticReactions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
using namespace hpcReact;
9-
using namespace hpcReact::bulkGeneric;
9+
using namespace hpcReact::reactionsSystems;
1010
using namespace hpcReact::unitTest_utilities;
1111

1212
//******************************************************************************

src/reactions/bulkGeneric/unitTests/testMixedReactions.cpp renamed to src/reactions/exampleSystems/unitTests/testMixedReactions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212

1313
using namespace hpcReact;
14-
using namespace hpcReact::bulkGeneric;
14+
using namespace hpcReact::reactionsSystems;
1515

1616
template< typename REAL_TYPE >
1717
REAL_TYPE tolerance( REAL_TYPE const a, REAL_TYPE const b, REAL_TYPE const ndigits )

src/reactions/bulkGeneric/unitTests/testUtilities.nb renamed to src/reactions/exampleSystems/unitTests/testUtilities.nb

File renamed without changes.

src/reactions/geochemistry/Carbonate.hpp

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
#include "reactions/bulkGeneric/Parameters.hpp"
3+
#include "../reactionsSystems/Parameters.hpp"
44

55
namespace hpcReact
66
{
@@ -28,7 +28,24 @@ constexpr CArrayWrapper<double, 11, 18> stoichMatrix =
2828
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 1, 1, 0, 0, 0, 0 } // CaCO3(s) + H+ = Ca+2 + HCO3- (kinetic)
2929
// { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0, 1, 0, 0, 0, 0 } // Ca(OH)2​(s) + 2H+ = Ca2+ + 2H2​O (kinetic)
3030
};
31-
// C^{n+1} - C^n - r( C^{n+1} ) * dt = 0
31+
32+
constexpr CArrayWrapper<double, 11, 17> stoichMatrixNosolid =
33+
{ // OH- CO2 CO3-2 H2CO3 CaHCO3+ CaSO4 CaCl+ CaCl2 MgSO4 NaSO4- H+ HCO3- Ca+2 SO4-2 Cl- Mg+2 Na+
34+
{ -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0 }, // OH- + H+ = H2O
35+
{ 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0 }, // CO2 + H2O = H+ + HCO3-
36+
{ 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0 }, // CO3-2 + H+ = HCO3-
37+
{ 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0 }, // H2CO3 = H+ + HCO3-
38+
{ 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 }, // CaHCO3+ = Ca+2 + HCO3-
39+
{ 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0 }, // CaSO4 = Ca+2 + SO4-2
40+
{ 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0 }, // CaCl+ = Ca+2 + Cl-
41+
{ 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 2, 0, 0 }, // CaCl2 = Ca+2 + 2Cl-
42+
{ 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0 }, // MgSO4 = Mg+2 + SO4-2
43+
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1 }, // NaSO4- = Na+ + SO4-2
44+
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 1, 1, 0, 0, 0, 0 } // CaCO3(s) + H+ = Ca+2 + HCO3- (kinetic)
45+
// { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0, 1, 0, 0, 0, 0 } // Ca(OH)2​(s) + 2H+ = Ca2+ + 2H2​O (kinetic)
46+
};
47+
48+
// C^{n+1} - C^n - r( C^{n+1} ) * dt = 0
3249
constexpr CArrayWrapper<double, 11> equilibriumConstants =
3350
{
3451
9.77E+13, // OH- + H+ = H2O
@@ -77,13 +94,13 @@ constexpr CArrayWrapper<double, 11> reverseRates =
7794
// 1 // Ca(OH)2​(s) + 2H+ = Ca2+ + 2H2​O (kinetic)
7895
};
7996
}
80-
using carbonateSystemAllKineticType = bulkGeneric::MixedReactionsParameters< double, int, int, 18, 11, 0 >;
81-
using carbonateSystemAllEquilibriumType = bulkGeneric::MixedReactionsParameters< double, int, int, 18, 11, 11 >;
82-
using carbonateSystemType = bulkGeneric::MixedReactionsParameters< double, int, int, 18, 11, 10 >;
97+
using carbonateSystemAllKineticType = reactionsSystems::MixedReactionsParameters< double, int, int, 18, 11, 0 >;
98+
using carbonateSystemAllEquilibriumType = reactionsSystems::MixedReactionsParameters< double, int, int, 18, 11, 11 >;
99+
using carbonateSystemType = reactionsSystems::MixedReactionsParameters< double, int, int, 17, 11, 10 >;
83100

84101
constexpr carbonateSystemAllKineticType carbonateSystemAllKinetic( carbonate::stoichMatrix, carbonate::equilibriumConstants, carbonate::forwardRates, carbonate::reverseRates );
85102
constexpr carbonateSystemAllEquilibriumType carbonateSystemAllEquilibrium( carbonate::stoichMatrix, carbonate::equilibriumConstants, carbonate::forwardRates, carbonate::reverseRates );
86-
constexpr carbonateSystemType carbonateSystem( carbonate::stoichMatrix, carbonate::equilibriumConstants, carbonate::forwardRates, carbonate::reverseRates );
103+
constexpr carbonateSystemType carbonateSystem( carbonate::stoichMatrixNosolid, carbonate::equilibriumConstants, carbonate::forwardRates, carbonate::reverseRates );
87104

88105
} // namespace geochemistry
89106
} // namespace hpcReact

src/reactions/geochemistry/Ultramafics.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
#include "reactions/bulkGeneric/Parameters.hpp"
3+
#include "../reactionsSystems/Parameters.hpp"
44

55
namespace hpcReact
66
{
@@ -117,9 +117,9 @@ constexpr CArrayWrapper<double, 21> reverseRates =
117117
};
118118
};
119119

120-
using ultramaficSystemAllKineticType = bulkGeneric::MixedReactionsParameters< double, int, int, 25, 21, 0 >;
121-
using ultramaficSystemAllEquilibriumType = bulkGeneric::MixedReactionsParameters< double, int, int, 25, 21, 21 >;
122-
using ultramaficSystemType = bulkGeneric::MixedReactionsParameters< double, int, int, 25, 21, 16 >;
120+
using ultramaficSystemAllKineticType = reactionsSystems::MixedReactionsParameters< double, int, int, 25, 21, 0 >;
121+
using ultramaficSystemAllEquilibriumType = reactionsSystems::MixedReactionsParameters< double, int, int, 25, 21, 21 >;
122+
using ultramaficSystemType = reactionsSystems::MixedReactionsParameters< double, int, int, 25, 21, 16 >;
123123

124124
constexpr ultramaficSystemAllKineticType ultramaficSystemAllKinetic( ultramafics::stoichMatrix, ultramafics::equilibriumConstants, ultramafics::forwardRates, ultramafics::reverseRates );
125125
constexpr ultramaficSystemAllEquilibriumType ultramaficSystemAllEquilibrium( ultramafics::stoichMatrix, ultramafics::equilibriumConstants, ultramafics::forwardRates, ultramafics::reverseRates );

src/reactions/geochemistry/unitTests/testGeochemicalEquilibriumReactions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ TEST( testEquilibriumReactions, testcarbonateSystemAllEquilibrium )
9191
TEST( testEquilibriumReactions, testcarbonateSystemAllEquilibrium2 )
9292
{
9393

94-
using EquilibriumReactionsType = bulkGeneric::EquilibriumReactions< double,
94+
using EquilibriumReactionsType = reactionsSystems::EquilibriumReactions< double,
9595
int,
9696
int >;
9797

0 commit comments

Comments
 (0)