OGS
ReactionCaOH2.cpp
Go to the documentation of this file.
1
10#include "ReactionCaOH2.h"
11
12#include <cassert>
13
14#include "Adsorption.h"
15#include "BaseLib/Error.h"
17
18namespace Adsorption
19{
20
22constexpr double reaction_enthalpy = -1.12e+05;
24constexpr double reaction_entropy = -143.5;
29
30constexpr double tol_l = 1e-4;
31constexpr double tol_u = 1.0 - 1e-4;
32constexpr double tol_rho = 0.1;
33
34double ReactionCaOH2::getEnthalpy(const double /*p_Ads*/,
35 const double /*T_Ads*/,
36 const double /*M_Ads*/) const
37{
38 return -reaction_enthalpy / M_react;
39}
40
41double ReactionCaOH2::getReactionRate(const double /*p_Ads*/,
42 const double /*T_Ads*/,
43 const double /*M_Ads*/,
44 const double /*loading*/) const
45{
46 OGS_FATAL("get_reaction_rate do not call directly");
47}
48
49double ReactionCaOH2::getReactionRate(double const solid_density)
50{
51 _rho_s = solid_density;
53 return _qR;
54}
55
56void ReactionCaOH2::updateParam(double const T_solid,
57 double const p_gas,
58 double const x_react,
59 double const rho_s_initial)
60{
61 _T_s = T_solid;
62 _p_gas = p_gas / 1e5; // convert Pa to bar
63 _x_react = x_react;
64 _rho_s = rho_s_initial;
65}
66
68{
69 // Convert mass fraction into mole fraction
70 const double mol_frac_react =
72
73 _p_r_g = std::max(mol_frac_react * _p_gas, 1.0e-3); // avoid illdefined log
75 const double dXdt = CaHydration();
76 _qR = (rho_up - rho_low) * dXdt;
77}
78
79// determine equilibrium temperature and pressure according to van't Hoff
81{
83
84 _X_D = (_rho_s - rho_up - tol_rho) / (rho_low - rho_up - 2.0 * tol_rho);
85 _X_D = (_X_D < 0.5)
86 ? std::max(tol_l, _X_D)
87 : std::min(_X_D, tol_u); // constrain to interval [tol_l;tol_u]
88
89 _X_H = 1.0 - _X_D;
90
91 // calculate equilibrium
92 // using the p_eq to calculate the T_eq - Clausius-Clapeyron
93 _T_eq = (reaction_enthalpy / R) /
94 ((reaction_entropy / R) + std::log(_p_r_g)); // unit of p in bar
95 // Alternative: Use T_s as T_eq and calculate p_eq - for Schaube kinetics
96 _p_eq = std::exp((reaction_enthalpy / R) / _T_s - (reaction_entropy / R));
97}
98
100{
102 double dXdt;
103 // step 3, calculate dX/dt
104#ifdef SIMPLE_KINETICS
105 if (T_s < T_eq) // hydration - simple model
106#else
107 if (_p_r_g > _p_eq) // hydration - Schaube model
108#endif
109 {
110 // X_H = max(tol_l,X_H); //lower tolerance to avoid oscillations at
111 // onset of hydration reaction. Set here so that no residual reaction
112 // rate occurs at end of hydration.
113#ifdef SIMPLE_KINETICS // this is from P. Schmidt
114 dXdt = -1.0 * (1.0 - X_H) * (T_s - T_eq) / T_eq * 0.2 *
115 conversion_rate::x_react;
116#else // this is from Schaube
117 if (_X_H == tol_u || _rho_s == rho_up)
118 {
119 dXdt = 0.0;
120 }
121 else if ((_T_eq - _T_s) >= 50.0)
122 {
123 dXdt = 13945.0 * exp(-89486.0 / R / _T_s) *
124 std::pow(_p_r_g / _p_eq - 1.0, 0.83) * 3.0 *
125 (_X_D)*std::pow(-1.0 * log(_X_D), 0.666);
126 }
127 else
128 {
129 dXdt = 1.0004e-34 * exp(5.3332e4 / _T_s) * std::pow(_p_r_g, 6.0) *
130 (_X_D);
131 }
132#endif
133 }
134 else // dehydration
135 {
136 // X_D = max(tol_l,X_D); //lower tolerance to avoid oscillations at
137 // onset of dehydration reaction. Set here so that no residual reaction
138 // rate occurs at end of dehydration.
139#ifdef SIMPLE_KINETICS // this is from P. Schmidt
140 dXdt = -1.0 * (1.0 - X_D) * (T_s - T_eq) / T_eq * 0.05;
141#else
142 if (_X_D == tol_u || _rho_s == rho_low)
143 {
144 dXdt = 0.0;
145 }
146 else if (_X_D < 0.2)
147 {
148 dXdt = -1.9425e12 * exp(-1.8788e5 / R / _T_s) *
149 std::pow(1.0 - _p_r_g / _p_eq, 3.0) * (_X_H);
150 }
151 else
152 {
153 dXdt = -8.9588e9 * exp(-1.6262e5 / R / _T_s) *
154 std::pow(1.0 - _p_r_g / _p_eq, 3.0) * 2.0 *
155 std::pow(_X_H, 0.5);
156 }
157#endif
158 }
159 return dXdt;
160}
161
162} // namespace Adsorption
#define OGS_FATAL(...)
Definition Error.h:26
static double getMolarFraction(double xm, double M_this, double M_other)
double _p_eq
equilibrium pressure in bar
double _T_s
solid phase temperature
double _rho_s
solid phase density
static MATERIALLIB_EXPORT constexpr double rho_low
lower density limit
double _T_eq
equilibrium temperature
double _x_react
mass fraction of water in gas phase
double getEnthalpy(const double, const double, const double) const override
double _p_gas
gas phase pressure in unit bar
double _X_H
mass fraction of hydration in the solid phase
double _qR
rate of solid density change
void updateParam(double T_solid, double p_gas, double x_react, double rho_s_initial)
double _X_D
mass fraction of dehydration (CaO) in the solid phase
static MATERIALLIB_EXPORT constexpr double rho_up
upper density limit
double getReactionRate(const double, const double, const double, const double) const override
double _p_r_g
pressure of H2O on gas phase
constexpr double reaction_enthalpy
reaction enthalpy in J/mol; negative for exothermic composition reaction
constexpr double tol_l
constexpr double tol_rho
constexpr double reaction_entropy
reaction entropy in J/mol/K
constexpr double M_react
reactive component molar mass
constexpr double M_carrier
inert component molar mass
constexpr double tol_u