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