OGS 6.2.0-97-g4a610c866
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 
35 double
36 ReactionCaOH2::getEnthalpy(const double, const double, const double) const
37 {
39 }
40 
41 double
42 ReactionCaOH2::getReactionRate(const double, const double, const double, const double) const
43 {
44  OGS_FATAL("get_reaction_rate do not call directly");
45 }
46 
47 
48 double ReactionCaOH2::getReactionRate(double const solid_density)
49 {
50  _rho_s = solid_density;
51  calculateQR();
52  return _qR;
53 }
54 
56  double T_solid,
57  double p_gas,
58  double x_react,
59  double 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 = AdsorptionReaction::getMolarFraction(_x_react, _M_react, _M_carrier);
71 
72  _p_r_g = std::max(mol_frac_react * _p_gas, 1.0e-3); // avoid illdefined log
74  const double dXdt = CaHydration();
75  _qR = (rho_up - rho_low) * dXdt;
76 }
77 
78 // determine equilibrium temperature and pressure according to van't Hoff
80 {
82 
83  _X_D = (_rho_s - rho_up - _tol_rho)/(rho_low - rho_up - 2.0*_tol_rho) ;
84  _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]
85 
86  _X_H = 1.0 - _X_D;
87 
88  // calculate equilibrium
89  // using the p_eq to calculate the T_eq - Clausius-Clapeyron
90  _T_eq = (_reaction_enthalpy/R) / ((_reaction_entropy/R) + std::log(_p_r_g)); // unit of p in bar
91  // Alternative: Use T_s as T_eq and calculate p_eq - for Schaube kinetics
92  _p_eq = std::exp((_reaction_enthalpy/R)/_T_s - (_reaction_entropy/R));
93 }
94 
95 
97 {
99  double dXdt;
100  // step 3, calculate dX/dt
101 #ifdef SIMPLE_KINETICS
102  if ( T_s < T_eq ) // hydration - simple model
103 #else
104  if ( _p_r_g > _p_eq ) // hydration - Schaube model
105 #endif
106  {
107  //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.
108 #ifdef SIMPLE_KINETICS // this is from P. Schmidt
109  dXdt = -1.0*(1.0-X_H) * (T_s - T_eq) / T_eq * 0.2 * conversion_rate::x_react;
110 #else //this is from Schaube
111  if (_X_H == _tol_u || _rho_s == rho_up)
112  {
113  dXdt = 0.0;
114  }
115  else if ((_T_eq - _T_s) >= 50.0)
116  {
117  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);
118  }
119  else
120  {
121  dXdt = 1.0004e-34 * exp(5.3332e4 / _T_s) * std::pow(_p_r_g, 6.0) *
122  (_X_D);
123  }
124 #endif
125  }
126  else // dehydration
127  {
128  //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.
129 #ifdef SIMPLE_KINETICS // this is from P. Schmidt
130  dXdt = -1.0* (1.0-X_D) * (T_s - T_eq) / T_eq * 0.05;
131 #else
132  if (_X_D == _tol_u || _rho_s == rho_low)
133  {
134  dXdt = 0.0;
135  }
136  else if (_X_D < 0.2)
137  {
138  dXdt = -1.9425e12 * exp( -1.8788e5/R/_T_s ) * std::pow(1.0-_p_r_g/_p_eq,3.0)*(_X_H);
139  }
140  else
141  {
142  dXdt = -8.9588e9 * exp(-1.6262e5 / R / _T_s) *
143  std::pow(1.0 - _p_r_g / _p_eq, 3.0) * 2.0 *
144  std::pow(_X_H, 0.5);
145  }
146 #endif
147  }
148  return dXdt;
149 }
150 
151 } // 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