Skip to content

Commit 39e1d67

Browse files
committed
restructure. separate geo and battery chemistry
1 parent 1037d19 commit 39e1d67

File tree

3 files changed

+326
-0
lines changed

3 files changed

+326
-0
lines changed
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
#pragma once
2+
3+
4+
namespace hpcReact
5+
{
6+
7+
8+
template< typename REAL_TYPE,
9+
typename INT_TYPE,
10+
int NUM_PRIMARY_SPECIES,
11+
int NUM_SECONDARY_SPECIES >
12+
struct EquilibriumGeochemicalReactionsParameters
13+
{
14+
using RealType = REAL_TYPE;
15+
using IntType = INT_TYPE;
16+
17+
static constexpr IntType numPrimarySpecies = NUM_PRIMARY_SPECIES;
18+
static constexpr IntType numSecondarySpecies = NUM_SECONDARY_SPECIES;
19+
20+
RealType m_ionSizePrimary[numPrimarySpecies];
21+
22+
RealType m_ionSizeSec[numSecondarySpecies];
23+
24+
IntType m_chargePrimary[numPrimarySpecies];
25+
IntType m_chargeSec[numSecondarySpecies];
26+
27+
RealType m_DebyeHuckelA;
28+
RealType m_DebyeHuckelB;
29+
RealType m_WATEQBDot;
30+
31+
CArrayWrapper< RealType, numSecondarySpecies, numPrimarySpecies> m_StoichMatrix[numSecondarySpecies][numPrimarySpecies];
32+
RealType m_Log10EqConst[numSecondarySpecies];
33+
};
34+
35+
36+
37+
template< typename REAL_TYPE,
38+
typename INT_TYPE,
39+
int NUM_PRIMARY_SPECIES,
40+
int NUM_SECONDARY_SPECIES,
41+
int NUM_KINETIC_REACTIONS >
42+
struct KineticGeochemicalReactionsParameters
43+
{
44+
using RealType = REAL_TYPE;
45+
using IntType = INT_TYPE;
46+
47+
static constexpr IntType numPrimarySpecies = NUM_PRIMARY_SPECIES;
48+
static constexpr IntType numSecondarySpecies = NUM_SECONDARY_SPECIES;
49+
static constexpr IntType numKineticReactions = NUM_KINETIC_REACTIONS;
50+
51+
RealType m_ionSizePrimary[numPrimarySpecies];
52+
53+
RealType m_ionSizeSec[numSecondarySpecies];
54+
55+
IntType m_chargePrimary[numPrimarySpecies];
56+
IntType m_chargeSec[numSecondarySpecies];
57+
58+
RealType m_DebyeHuckelA;
59+
RealType m_DebyeHuckelB;
60+
RealType m_WATEQBDot;
61+
62+
CArrayWrapper< RealType, numKineticReactions, numPrimarySpecies> m_StoichMatrix[numKineticReactions][numPrimarySpecies];
63+
RealType m_log10EqConst[numKineticReactions];
64+
65+
RealType m_reactionRateConstant[numKineticReactions];
66+
RealType m_specificSurfaceArea;
67+
};
68+
69+
70+
template< typename REAL_TYPE,
71+
typename INT_TYPE,
72+
int NUM_PRIMARY_SPECIES,
73+
int NUM_SECONDARY_SPECIES,
74+
int NUM_KINETIC_REACTIONS >
75+
struct GeochemicalReactionsParameters
76+
{
77+
using RealType = REAL_TYPE;
78+
using IntType = INT_TYPE;
79+
80+
static constexpr IntType numPrimarySpecies = NUM_PRIMARY_SPECIES;
81+
static constexpr IntType numSecondarySpecies = NUM_SECONDARY_SPECIES;
82+
static constexpr IntType numKineticReactions = NUM_KINETIC_REACTIONS;
83+
84+
RealType m_ionSizePrimary[numPrimarySpecies];
85+
RealType m_ionSizeSec[numSecondarySpecies];
86+
87+
IntType m_chargePrimary[numPrimarySpecies];
88+
IntType m_chargeSec[numSecondarySpecies];
89+
90+
RealType m_DebyeHuckelA;
91+
RealType m_DebyeHuckelB;
92+
RealType m_WATEQBDot;
93+
94+
CArrayWrapper< RealType, numSecondarySpecies, numPrimarySpecies> m_eqStoichMatrix;
95+
RealType m_eqLog10EqConst[numSecondarySpecies];
96+
97+
98+
CArrayWrapper< RealType, numKineticReactions, numPrimarySpecies > m_kineticStoichMatrix;
99+
RealType m_kineticlog10EqConst[numKineticReactions];
100+
101+
RealType m_kineticReactionRateConstant[numKineticReactions];
102+
RealType m_kineticSpecificSurfaceArea;
103+
104+
template< int ... PRIMARY_SPECIES,
105+
int ... SECONDARY_SPECIES,
106+
int ... SPECIES_PERMUTATIONS >
107+
constexpr EquilibriumGeochemicalReactionsParameters< REAL_TYPE, INT_TYPE, NUM_PRIMARY_SPECIES, NUM_SECONDARY_SPECIES >
108+
equilibriumReactionsParams_impl( std::integer_sequence< int, PRIMARY_SPECIES... >,
109+
std::integer_sequence< int, SECONDARY_SPECIES... >,
110+
std::integer_sequence< int, SPECIES_PERMUTATIONS... > )
111+
{
112+
return EquilibriumGeochemicalReactionsParameters< REAL_TYPE, INT_TYPE, NUM_PRIMARY_SPECIES, NUM_SECONDARY_SPECIES >{
113+
{m_ionSizePrimary[ PRIMARY_SPECIES ]...},
114+
{m_ionSizeSec[ SECONDARY_SPECIES ]...},
115+
{m_chargePrimary[ PRIMARY_SPECIES ]...},
116+
{m_chargeSec[ SECONDARY_SPECIES ]...},
117+
m_DebyeHuckelA,
118+
m_DebyeHuckelB,
119+
m_WATEQBDot,
120+
m_eqStoichMatrix,
121+
{m_eqLog10EqConst[ SECONDARY_SPECIES ]...}
122+
};
123+
}
124+
125+
constexpr EquilibriumGeochemicalReactionsParameters< REAL_TYPE, INT_TYPE, NUM_PRIMARY_SPECIES, NUM_SECONDARY_SPECIES >
126+
equilibriumReactions()
127+
{
128+
return equilibriumReactionsParams_impl( std::make_integer_sequence< int, NUM_PRIMARY_SPECIES >{},
129+
std::make_integer_sequence< int, NUM_SECONDARY_SPECIES >{},
130+
std::make_integer_sequence< int, NUM_PRIMARY_SPECIES*NUM_SECONDARY_SPECIES >{} );
131+
}
132+
};
133+
134+
135+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#pragma once
2+
3+
#include "GeochemicalReactionsParameters.hpp"
4+
5+
namespace hpcReact
6+
{
7+
8+
9+
constexpr
10+
GeochemicalReactionsParameters< double, int, 7, 11, 2 > chemicalReactionsParams =
11+
{
12+
// m_ionSizePrimary
13+
{ 9.00, 4.00, 6.00, 4.00, 3.00, 8.00, 4.00 },
14+
// m_ionSizeSec
15+
{ 3.50, 3.00, 4.50, 3.00, 4.00, 3.00, 3.00, 4.00, 3.00, 3.00, 4.00 },
16+
// m_chargePrimary
17+
{ 1, -1, 2, -2, -1, 2, 1 },
18+
// m_chargeSec
19+
{ -1, 0, -2, 0, 1, 0, 0, 1, 0, 0, -1 },
20+
// m_DebyeHuckelA
21+
0.5465,
22+
// m_DebyeHuckelB
23+
0.3346,
24+
// m_WATEQBDot
25+
0.0438,
26+
// m_eqStoichMatrix
27+
// First index: 0 = OH-, 1 = CO2, 2 = CO3-2, 3 = H2CO3, 4 = CaHCO3+, 5 = CaCO3, 6 = CaSO4, 7 = CaCl+, 8 = CaCl2, 9 = MgSO4, 10 = NaSO4-
28+
// Second index: 0 = H+, 1 = HCO3-, 2 = Ca+2, 3 = SO4-2, 4 = Cl-, 5 = Mg+2, 6 = Na+1
29+
{ { { -1, 0, 0, 0, 0, 0, 0 },
30+
{ 1, 1, 0, 0, 0, 0, 0 },
31+
{ -1, 1, 0, 0, 0, 0, 0 },
32+
{ 1, 1, 0, 0, 0, 0, 0 },
33+
{ 0, 1, 1, 0, 0, 0, 0 },
34+
{ -1, 1, 1, 0, 0, 0, 0 },
35+
{ 0, 0, 1, 1, 0, 0, 0 },
36+
{ 0, 0, 1, 1, 0, 0, 0 },
37+
{ 0, 0, 1, 0, 2, 0, 0 },
38+
{ 0, 0, 0, 1, 0, 1, 0 },
39+
{ 0, 0, 0, 1, 0, 0, 1 } }
40+
},
41+
// m_eqLog10EqConst
42+
{ 13.99, -6.36, 10.33, -3.77, -1.09, 7.07, -2.16, 0.67, 0.60, -2.43, -0.82 },
43+
// m_kineticStoichMatrix
44+
// First index: 0 = Ca(OH)2 dissolution, 1 = CaCO3 dissolution
45+
// Second index: 0 = H+, 1 = HCO3-, 2 = Ca+2, 3 = SO4-2, 4 = Cl-, 5 = Mg+2, 6 = Na+1
46+
{ { { -2, 0, 1, 0, 0, 0, 0 },
47+
{ -1, 1, 1, 0, 0, 0, 0 } }
48+
},
49+
// m_kineticLog10EqConst
50+
{ 20.19, 1.32 },
51+
// m_reactionRateConstant
52+
{ 9.95e-1, 9.95e-3 },
53+
// m_specificSurfaceArea
54+
1.0
55+
};
56+
57+
58+
} // namespace hpcReact
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
2+
#include "../ReactionsBase_impl.hpp"
3+
#include "MultiVector.hpp"
4+
#include "common/CArrayWrapper.hpp"
5+
#include "../GeochemicalReactionsParametersPredefined.hpp"
6+
7+
#include <gtest/gtest.h>
8+
9+
using namespace hpcReact;
10+
11+
template< typename T >
12+
constexpr bool nearEqual( T a, T b, T tol = 1e-7 )
13+
{
14+
return ( a - b ) * ( a - b ) < tol * tol;
15+
}
16+
17+
TEST( testReactionsBase, testParamsInitialization )
18+
{
19+
static_assert( chemicalReactionsParams.numPrimarySpecies == 7, "Number of primary species is not 7" );
20+
static_assert( chemicalReactionsParams.numSecondarySpecies == 11, "Number of secondary species is not 11" );
21+
static_assert( nearEqual( chemicalReactionsParams.m_ionSizePrimary[0], 9.00 ), "Ion size for primary species 0 is not 9.00" );
22+
static_assert( nearEqual( chemicalReactionsParams.m_ionSizePrimary[1], 4.00 ), "Ion size for primary species 1 is not 4.00" );
23+
static_assert( nearEqual( chemicalReactionsParams.m_ionSizePrimary[2], 6.00 ), "Ion size for primary species 2 is not 6.00" );
24+
static_assert( nearEqual( chemicalReactionsParams.m_ionSizePrimary[3], 4.00 ), "Ion size for primary species 3 is not 4.00" );
25+
static_assert( nearEqual( chemicalReactionsParams.m_ionSizePrimary[4], 3.00 ), "Ion size for primary species 4 is not 3.00" );
26+
static_assert( nearEqual( chemicalReactionsParams.m_ionSizePrimary[5], 8.00 ), "Ion size for primary species 5 is not 8.00" );
27+
static_assert( nearEqual( chemicalReactionsParams.m_ionSizePrimary[6], 4.00 ), "Ion size for primary species 6 is not 4.00" );
28+
static_assert( nearEqual( chemicalReactionsParams.m_ionSizeSec[0] , 3.50 ), "Ion size for secondary species 0 is not 3.50" );
29+
static_assert( nearEqual( chemicalReactionsParams.m_ionSizeSec[1] , 3.00 ), "Ion size for secondary species 1 is not 3.00" );
30+
static_assert( nearEqual( chemicalReactionsParams.m_ionSizeSec[2] , 4.50 ), "Ion size for secondary species 2 is not 4.50" );
31+
static_assert( nearEqual( chemicalReactionsParams.m_ionSizeSec[3] , 3.00 ), "Ion size for secondary species 3 is not 3.00" );
32+
static_assert( nearEqual( chemicalReactionsParams.m_ionSizeSec[4] , 4.00 ), "Ion size for secondary species 4 is not 4.00" );
33+
static_assert( nearEqual( chemicalReactionsParams.m_ionSizeSec[5] , 3.00 ), "Ion size for secondary species 5 is not 3.00" );
34+
static_assert( nearEqual( chemicalReactionsParams.m_ionSizeSec[6] , 3.00 ), "Ion size for secondary species 6 is not 3.00" );
35+
static_assert( nearEqual( chemicalReactionsParams.m_ionSizeSec[7] , 4.00 ), "Ion size for secondary species 7 is not 4.00" );
36+
static_assert( nearEqual( chemicalReactionsParams.m_ionSizeSec[8] , 3.00 ), "Ion size for secondary species 8 is not 3.00" );
37+
static_assert( nearEqual( chemicalReactionsParams.m_ionSizeSec[9] , 3.00 ), "Ion size for secondary species 9 is not 3.00" );
38+
static_assert( nearEqual( chemicalReactionsParams.m_ionSizeSec[10], 4.00 ), "Ion size for secondary species 10 is not 4.00" );
39+
static_assert( chemicalReactionsParams.m_chargePrimary[0] == 1, "Charge for primary species 0 is not 1" );
40+
static_assert( chemicalReactionsParams.m_chargePrimary[1] == -1, "Charge for primary species 1 is not -1" );
41+
static_assert( chemicalReactionsParams.m_chargePrimary[2] == 2, "Charge for primary species 2 is not 2" );
42+
static_assert( chemicalReactionsParams.m_chargePrimary[3] == -2, "Charge for primary species 3 is not -2" );
43+
static_assert( chemicalReactionsParams.m_chargePrimary[4] == -1, "Charge for primary species 4 is not -1" );
44+
static_assert( chemicalReactionsParams.m_chargePrimary[5] == 2, "Charge for primary species 5 is not 2" );
45+
static_assert( chemicalReactionsParams.m_chargePrimary[6] == 1, "Charge for primary species 6 is not 1" );
46+
static_assert( chemicalReactionsParams.m_chargeSec[0] == -1, "Charge for secondary species 0 is not -1" );
47+
static_assert( chemicalReactionsParams.m_chargeSec[1] == 0, "Charge for secondary species 1 is not 0" );
48+
static_assert( chemicalReactionsParams.m_chargeSec[2] == -2, "Charge for secondary species 2 is not -2" );
49+
static_assert( chemicalReactionsParams.m_chargeSec[3] == 0, "Charge for secondary species 3 is not 0" );
50+
static_assert( chemicalReactionsParams.m_chargeSec[4] == 1, "Charge for secondary species 4 is not 1" );
51+
static_assert( chemicalReactionsParams.m_chargeSec[5] == 0, "Charge for secondary species 5 is not 0" );
52+
static_assert( chemicalReactionsParams.m_chargeSec[6] == 0, "Charge for secondary species 6 is not 0" );
53+
static_assert( chemicalReactionsParams.m_chargeSec[7] == 1, "Charge for secondary species 7 is not 1" );
54+
static_assert( chemicalReactionsParams.m_chargeSec[8] == 0, "Charge for secondary species 8 is not 0" );
55+
static_assert( chemicalReactionsParams.m_chargeSec[9] == 0, "Charge for secondary species 9 is not 0" );
56+
static_assert( chemicalReactionsParams.m_chargeSec[10] == -1, "Charge for secondary species 10 is not -1" );
57+
static_assert( nearEqual( chemicalReactionsParams.m_DebyeHuckelA, 0.5465 ), "Debye Huckel A is not 0.5465" );
58+
static_assert( nearEqual( chemicalReactionsParams.m_DebyeHuckelB, 0.3346 ), "Debye Huckel B is not 0.3346" );
59+
static_assert( nearEqual( chemicalReactionsParams.m_WATEQBDot, 0.0438 ), "WATEQBDot is not 0.0438" );
60+
static_assert( nearEqual( chemicalReactionsParams.m_eqStoichMatrix[0][0], -1.0 ), "Stoichiometry matrix for species 0 and 0 is not -1" );
61+
static_assert( nearEqual( chemicalReactionsParams.m_eqStoichMatrix[0][1], 0.0 ), "Stoichiometry matrix for species 0 and 1 is not 0" );
62+
static_assert( nearEqual( chemicalReactionsParams.m_eqStoichMatrix[0][2], 0.0 ), "Stoichiometry matrix for species 0 and 2 is not 0" );
63+
static_assert( nearEqual( chemicalReactionsParams.m_eqStoichMatrix[0][3], 0.0 ), "Stoichiometry matrix for species 0 and 3 is not 0" );
64+
static_assert( nearEqual( chemicalReactionsParams.m_eqStoichMatrix[0][4], 0.0 ), "Stoichiometry matrix for species 0 and 4 is not 0" );
65+
static_assert( nearEqual( chemicalReactionsParams.m_eqStoichMatrix[0][5], 0.0 ), "Stoichiometry matrix for species 0 and 5 is not 0" );
66+
static_assert( nearEqual( chemicalReactionsParams.m_eqStoichMatrix[0][6], 0.0 ), "Stoichiometry matrix for species 0 and 6 is not 0" );
67+
static_assert( nearEqual( chemicalReactionsParams.m_eqStoichMatrix[1][0], 1.0 ), "Stoichiometry matrix for species 1 and 0 is not 1" );
68+
static_assert( nearEqual( chemicalReactionsParams.m_eqStoichMatrix[1][1], 1.0 ), "Stoichiometry matrix for species 1 and 1 is not 1" );
69+
static_assert( nearEqual( chemicalReactionsParams.m_eqStoichMatrix[1][2], 0.0 ), "Stoichiometry matrix for species 1 and 2 is not 0" );
70+
static_assert( nearEqual( chemicalReactionsParams.m_eqStoichMatrix[1][3], 0.0 ), "Stoichiometry matrix for species 1 and 3 is not 0" );
71+
static_assert( nearEqual( chemicalReactionsParams.m_eqStoichMatrix[1][4], 0.0 ), "Stoichiometry matrix for species 1 and 4 is not 0" );
72+
static_assert( nearEqual( chemicalReactionsParams.m_eqStoichMatrix[1][5], 0.0 ), "Stoichiometry matrix for species 1 and 5 is not 0" );
73+
static_assert( nearEqual( chemicalReactionsParams.m_eqStoichMatrix[1][6], 0.0 ), "Stoichiometry matrix for species 1 and 6 is not 0" );
74+
static_assert( nearEqual( chemicalReactionsParams.m_eqLog10EqConst[0], 13.99 ), "Log10 equilibrium constant for species 0 is not 13.99" );
75+
static_assert( nearEqual( chemicalReactionsParams.m_eqLog10EqConst[1], -6.36 ) , "Log10 equilibrium constant for species 1 is not -6.36" );
76+
static_assert( nearEqual( chemicalReactionsParams.m_eqLog10EqConst[2], 10.33 ), "Log10 equilibrium constant for species 2 is not 10.33" );
77+
static_assert( nearEqual( chemicalReactionsParams.m_eqLog10EqConst[3], -3.77 ) , "Log10 equilibrium constant for species 3 is not -3.77" );
78+
static_assert( nearEqual( chemicalReactionsParams.m_eqLog10EqConst[4], -1.09 ) , "Log10 equilibrium constant for species 4 is not -1.09" );
79+
static_assert( nearEqual( chemicalReactionsParams.m_eqLog10EqConst[5], 7.07 ) , "Log10 equilibrium constant for species 5 is not 7.07" );
80+
static_assert( nearEqual( chemicalReactionsParams.m_eqLog10EqConst[6], - 2.16 ) , "Log10 equilibrium constant for species 6 is not -2.16" );
81+
static_assert( nearEqual( chemicalReactionsParams.m_eqLog10EqConst[7], + 0.67 ) , "Log10 equilibrium constant for species 7 is not 0.67" );
82+
static_assert( nearEqual( chemicalReactionsParams.m_eqLog10EqConst[8], + 0.60 ) , "Log10 equilibrium constant for species 8 is not 0.60" );
83+
static_assert( nearEqual( chemicalReactionsParams.m_eqLog10EqConst[9], - 2.43 ) , "Log10 equilibrium constant for species 9 is not -2.43" );
84+
static_assert( nearEqual( chemicalReactionsParams.m_eqLog10EqConst[10], - 0.82 ), "Log10 equilibrium constant for species 10 is not -0.82" );
85+
static_assert( nearEqual( chemicalReactionsParams.m_kineticStoichMatrix[0][0],-2.0 ), "Stoichiometry matrix for kinetic reaction 0 and species 0 is not -2" );
86+
static_assert( nearEqual( chemicalReactionsParams.m_kineticStoichMatrix[0][1], 0.0 ), "Stoichiometry matrix for kinetic reaction 0 and species 1 is not 0" );
87+
static_assert( nearEqual( chemicalReactionsParams.m_kineticStoichMatrix[0][2], 1.0 ), "Stoichiometry matrix for kinetic reaction 0 and species 2 is not 1" );
88+
static_assert( nearEqual( chemicalReactionsParams.m_kineticStoichMatrix[0][3], 0.0 ), "Stoichiometry matrix for kinetic reaction 0 and species 3 is not 0" );
89+
static_assert( nearEqual( chemicalReactionsParams.m_kineticStoichMatrix[0][4], 0.0 ), "Stoichiometry matrix for kinetic reaction 0 and species 4 is not 0" );
90+
static_assert( nearEqual( chemicalReactionsParams.m_kineticStoichMatrix[0][5], 0.0 ), "Stoichiometry matrix for kinetic reaction 0 and species 5 is not 0" );
91+
static_assert( nearEqual( chemicalReactionsParams.m_kineticStoichMatrix[0][6], 0.0 ), "Stoichiometry matrix for kinetic reaction 0 and species 6 is not 0" );
92+
static_assert( nearEqual( chemicalReactionsParams.m_kineticStoichMatrix[1][0],-1.0 ), "Stoichiometry matrix for kinetic reaction 1 and species 0 is not -1" );
93+
static_assert( nearEqual( chemicalReactionsParams.m_kineticStoichMatrix[1][1], 1.0 ), "Stoichiometry matrix for kinetic reaction 1 and species 1 is not 1" );
94+
static_assert( nearEqual( chemicalReactionsParams.m_kineticStoichMatrix[1][2], 1.0 ), "Stoichiometry matrix for kinetic reaction 1 and species 2 is not 1" );
95+
static_assert( nearEqual( chemicalReactionsParams.m_kineticStoichMatrix[1][3], 0.0 ), "Stoichiometry matrix for kinetic reaction 1 and species 3 is not 0" );
96+
static_assert( nearEqual( chemicalReactionsParams.m_kineticStoichMatrix[1][4], 0.0 ), "Stoichiometry matrix for kinetic reaction 1 and species 4 is not 0" );
97+
static_assert( nearEqual( chemicalReactionsParams.m_kineticStoichMatrix[1][5], 0.0 ), "Stoichiometry matrix for kinetic reaction 1 and species 5 is not 0" );
98+
static_assert( nearEqual( chemicalReactionsParams.m_kineticStoichMatrix[1][6], 0.0 ), "Stoichiometry matrix for kinetic reaction 1 and species 6 is not 0" );
99+
static_assert( nearEqual( chemicalReactionsParams.m_kineticlog10EqConst[0], 20.19 ), "Log10 equilibrium constant for kinetic reaction 0 is not 20.19" );
100+
static_assert( nearEqual( chemicalReactionsParams.m_kineticlog10EqConst[1], 1.32 ), "Log10 equilibrium constant for kinetic reaction 1 is not 1.32" );
101+
static_assert( nearEqual( chemicalReactionsParams.m_kineticReactionRateConstant[0], 9.95e-1 ), "Reaction rate constant for kinetic reaction 0 is not 9.95e-1" );
102+
static_assert( nearEqual( chemicalReactionsParams.m_kineticReactionRateConstant[1], 9.95e-3 ), "Reaction rate constant for kinetic reaction 1 is not 9.95e-3" );
103+
static_assert( nearEqual( chemicalReactionsParams.m_kineticSpecificSurfaceArea, 1.0 ), "Specific surface area is not 1.0" );
104+
105+
106+
}
107+
108+
TEST( testReactionsBase, testEquilibriumParamsExtraction )
109+
{
110+
constexpr auto eqParams = chemicalReactionsParams.equilibriumReactions();
111+
static_assert( eqParams.numPrimarySpecies == 7, "Number of primary species is not 7" );
112+
static_assert( eqParams.numSecondarySpecies == 11, "Number of secondary species is not 11" );
113+
static_assert( nearEqual( eqParams.m_ionSizePrimary[0], 9.00 ), "Ion size for primary species 0 is not 9.00" );
114+
static_assert( nearEqual( eqParams.m_ionSizePrimary[1], 4.00 ), "Ion size for primary species 1 is not 4.00" );
115+
static_assert( nearEqual( eqParams.m_ionSizePrimary[2], 6.00 ), "Ion size for primary species 2 is not 6.00" );
116+
static_assert( nearEqual( eqParams.m_ionSizePrimary[3], 4.00 ), "Ion size for primary species 3 is not 4.00" );
117+
static_assert( nearEqual( eqParams.m_ionSizePrimary[4], 3.00 ), "Ion size for primary species 4 is not 3.00" );
118+
static_assert( nearEqual( eqParams.m_ionSizePrimary[5], 8.00 ), "Ion size for primary species 5 is not 8.00" );
119+
static_assert( nearEqual( eqParams.m_ionSizePrimary[6], 4.00 ), "Ion size for primary species 6 is not 4.00" );
120+
static_assert( nearEqual( eqParams.m_ionSizeSec[0] , 3.50 ), "Ion size for secondary species 0 is not 3.50" );
121+
static_assert( nearEqual( eqParams.m_ionSizeSec[1] , 3.00 ), "Ion size for secondary species 1 is not 3.00" );
122+
static_assert( nearEqual( eqParams.m_ionSizeSec[2] , 4.50 ), "Ion size for secondary species 2 is not 4.50" );
123+
static_assert( nearEqual( eqParams.m_ionSizeSec[3] , 3.00 ), "Ion size for secondary species 3 is not 3.00" );
124+
static_assert( nearEqual( eqParams.m_ionSizeSec[
125+
}
126+
127+
128+
int main( int argc, char * * argv )
129+
{
130+
::testing::InitGoogleTest( &argc, argv );
131+
int const result = RUN_ALL_TESTS();
132+
return result;
133+
}

0 commit comments

Comments
 (0)