OGS
Adsorption::ReactionCaOH2 Class Referencefinal

Detailed Description

Definition at line 27 of file ReactionCaOH2.h.

#include <ReactionCaOH2.h>

Inheritance diagram for Adsorption::ReactionCaOH2:
[legend]
Collaboration diagram for Adsorption::ReactionCaOH2:
[legend]

Public Member Functions

 ReactionCaOH2 (BaseLib::ConfigTree const &conf)
 
double getEnthalpy (const double, const double, const double) const override
 
double getReactionRate (const double, const double, const double, const double) const override
 
const BaseLib::ConfigTreegetOdeSolverConfig () const
 
double getReactionRate (double const solid_density)
 
void updateParam (double T_solid, double p_gas, double x_react, double rho_s_initial)
 
- Public Member Functions inherited from Adsorption::Reaction
virtual double getEquilibriumLoading (const double, const double, const double) const
 
virtual ~Reaction ()=default
 

Static Public Attributes

static MATERIALLIB_EXPORT constexpr double rho_low
 lower density limit
 
static MATERIALLIB_EXPORT constexpr double rho_up
 upper density limit
 

Private Member Functions

void calculateQR ()
 
void setChemicalEquilibrium ()
 
double CaHydration ()
 

Private Attributes

double _rho_s = nan
 solid phase density
 
double _p_gas = nan
 gas phase pressure in unit bar
 
double _p_r_g = nan
 pressure of H2O on gas phase
 
double _p_eq = 1.0
 equilibrium pressure in bar
 
double _T_eq = nan
 equilibrium temperature
 
double _T_s = nan
 solid phase temperature
 
double _qR = nan
 rate of solid density change
 
double _x_react = nan
 mass fraction of water in gas phase
 
double _X_D
 mass fraction of dehydration (CaO) in the solid phase
 
double _X_H = nan
 mass fraction of hydration in the solid phase
 
const BaseLib::ConfigTree _ode_solver_config
 

Static Private Attributes

static constexpr double nan = std::numeric_limits<double>::quiet_NaN()
 

Friends

template<typename >
class ProcessLib::TESFEMReactionAdaptorCaOH2
 

Additional Inherited Members

- Static Public Member Functions inherited from Adsorption::Reaction
static std::unique_ptr< ReactionnewInstance (BaseLib::ConfigTree const &conf)
 

Constructor & Destructor Documentation

◆ ReactionCaOH2()

Adsorption::ReactionCaOH2::ReactionCaOH2 ( BaseLib::ConfigTree const & conf)
inlineexplicit

Definition at line 30 of file ReactionCaOH2.h.

30 :
32 _ode_solver_config{conf.getConfigSubtree("ode_solver_config")}
33 {}
const BaseLib::ConfigTree _ode_solver_config
ConfigTree getConfigSubtree(std::string const &root) const

Member Function Documentation

◆ CaHydration()

double Adsorption::ReactionCaOH2::CaHydration ( )
private

Definition at line 99 of file ReactionCaOH2.cpp.

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}
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_H
mass fraction of hydration in the solid phase
double _X_D
mass fraction of dehydration (CaO) in the solid phase
static MATERIALLIB_EXPORT constexpr double rho_up
upper density limit
double _p_r_g
pressure of H2O on gas phase
constexpr double tol_u

References _p_eq, _p_r_g, _rho_s, _T_eq, _T_s, _X_D, _X_H, MaterialLib::PhysicalConstant::IdealGasConstant, rho_low, rho_up, and Adsorption::tol_u.

Referenced by calculateQR().

◆ calculateQR()

void Adsorption::ReactionCaOH2::calculateQR ( )
private

Definition at line 67 of file ReactionCaOH2.cpp.

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}
static double getMolarFraction(double xm, double M_this, double M_other)
double _x_react
mass fraction of water in gas phase
double _p_gas
gas phase pressure in unit bar
double _qR
rate of solid density change
constexpr double M_react
reactive component molar mass
constexpr double M_carrier
inert component molar mass

References _p_gas, _p_r_g, _qR, _x_react, CaHydration(), Adsorption::AdsorptionReaction::getMolarFraction(), Adsorption::M_carrier, Adsorption::M_react, rho_low, rho_up, and setChemicalEquilibrium().

Referenced by getReactionRate().

◆ getEnthalpy()

double Adsorption::ReactionCaOH2::getEnthalpy ( const double ,
const double ,
const double  ) const
overridevirtual

Implements Adsorption::Reaction.

Definition at line 34 of file ReactionCaOH2.cpp.

37{
38 return -reaction_enthalpy / M_react;
39}
constexpr double reaction_enthalpy
reaction enthalpy in J/mol; negative for exothermic composition reaction

References Adsorption::M_react, and Adsorption::reaction_enthalpy.

◆ getOdeSolverConfig()

const BaseLib::ConfigTree & Adsorption::ReactionCaOH2::getOdeSolverConfig ( ) const
inline

◆ getReactionRate() [1/2]

double Adsorption::ReactionCaOH2::getReactionRate ( const double ,
const double ,
const double ,
const double  ) const
overridevirtual

Implements Adsorption::Reaction.

Definition at line 41 of file ReactionCaOH2.cpp.

45{
46 OGS_FATAL("get_reaction_rate do not call directly");
47}
#define OGS_FATAL(...)
Definition Error.h:26

References OGS_FATAL.

Referenced by ProcessLib::TES::TESFEMReactionAdaptorCaOH2::TESFEMReactionAdaptorCaOH2().

◆ getReactionRate() [2/2]

double Adsorption::ReactionCaOH2::getReactionRate ( double const solid_density)

Definition at line 49 of file ReactionCaOH2.cpp.

50{
51 _rho_s = solid_density;
53 return _qR;
54}

References _qR, _rho_s, and calculateQR().

◆ setChemicalEquilibrium()

void Adsorption::ReactionCaOH2::setChemicalEquilibrium ( )
private

Definition at line 80 of file ReactionCaOH2.cpp.

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}
constexpr double tol_l
constexpr double tol_rho
constexpr double reaction_entropy
reaction entropy in J/mol/K

References _p_eq, _p_r_g, _rho_s, _T_eq, _T_s, _X_D, _X_H, MaterialLib::PhysicalConstant::IdealGasConstant, Adsorption::reaction_enthalpy, Adsorption::reaction_entropy, rho_low, rho_up, Adsorption::tol_l, Adsorption::tol_rho, and Adsorption::tol_u.

Referenced by calculateQR().

◆ updateParam()

void Adsorption::ReactionCaOH2::updateParam ( double T_solid,
double p_gas,
double x_react,
double rho_s_initial )

Definition at line 56 of file ReactionCaOH2.cpp.

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}

References _p_gas, _rho_s, _T_s, and _x_react.

Referenced by ProcessLib::TES::TESFEMReactionAdaptorCaOH2::initReaction().

Friends And Related Symbol Documentation

◆ ProcessLib::TESFEMReactionAdaptorCaOH2

template<typename >
friend class ProcessLib::TESFEMReactionAdaptorCaOH2
friend

Definition at line 71 of file ReactionCaOH2.h.

Member Data Documentation

◆ _ode_solver_config

const BaseLib::ConfigTree Adsorption::ReactionCaOH2::_ode_solver_config
private

Definition at line 68 of file ReactionCaOH2.h.

Referenced by getOdeSolverConfig().

◆ _p_eq

double Adsorption::ReactionCaOH2::_p_eq = 1.0
private

equilibrium pressure in bar

Definition at line 59 of file ReactionCaOH2.h.

Referenced by CaHydration(), and setChemicalEquilibrium().

◆ _p_gas

double Adsorption::ReactionCaOH2::_p_gas = nan
private

gas phase pressure in unit bar

Definition at line 57 of file ReactionCaOH2.h.

Referenced by calculateQR(), and updateParam().

◆ _p_r_g

double Adsorption::ReactionCaOH2::_p_r_g = nan
private

pressure of H2O on gas phase

Definition at line 58 of file ReactionCaOH2.h.

Referenced by CaHydration(), calculateQR(), and setChemicalEquilibrium().

◆ _qR

double Adsorption::ReactionCaOH2::_qR = nan
private

rate of solid density change

Definition at line 62 of file ReactionCaOH2.h.

Referenced by calculateQR(), and getReactionRate().

◆ _rho_s

double Adsorption::ReactionCaOH2::_rho_s = nan
private

solid phase density

Definition at line 56 of file ReactionCaOH2.h.

Referenced by CaHydration(), getReactionRate(), setChemicalEquilibrium(), and updateParam().

◆ _T_eq

double Adsorption::ReactionCaOH2::_T_eq = nan
private

equilibrium temperature

Definition at line 60 of file ReactionCaOH2.h.

Referenced by CaHydration(), and setChemicalEquilibrium().

◆ _T_s

double Adsorption::ReactionCaOH2::_T_s = nan
private

solid phase temperature

Definition at line 61 of file ReactionCaOH2.h.

Referenced by CaHydration(), setChemicalEquilibrium(), and updateParam().

◆ _X_D

double Adsorption::ReactionCaOH2::_X_D
private
Initial value:
=
static constexpr double nan

mass fraction of dehydration (CaO) in the solid phase

Definition at line 64 of file ReactionCaOH2.h.

Referenced by CaHydration(), and setChemicalEquilibrium().

◆ _X_H

double Adsorption::ReactionCaOH2::_X_H = nan
private

mass fraction of hydration in the solid phase

Definition at line 66 of file ReactionCaOH2.h.

Referenced by CaHydration(), and setChemicalEquilibrium().

◆ _x_react

double Adsorption::ReactionCaOH2::_x_react = nan
private

mass fraction of water in gas phase

Definition at line 63 of file ReactionCaOH2.h.

Referenced by calculateQR(), and updateParam().

◆ nan

constexpr double Adsorption::ReactionCaOH2::nan = std::numeric_limits<double>::quiet_NaN()
staticconstexprprivate

Definition at line 54 of file ReactionCaOH2.h.

◆ rho_low

MATERIALLIB_EXPORT constexpr double Adsorption::ReactionCaOH2::rho_low
staticconstexpr
Initial value:
=
1656.0

lower density limit

Definition at line 74 of file ReactionCaOH2.h.

Referenced by CaHydration(), calculateQR(), ProcessLib::TES::TESFEMReactionAdaptorCaOH2::initReaction(), and setChemicalEquilibrium().

◆ rho_up

MATERIALLIB_EXPORT constexpr double Adsorption::ReactionCaOH2::rho_up
staticconstexpr
Initial value:
=
2200.0

upper density limit

Definition at line 76 of file ReactionCaOH2.h.

Referenced by CaHydration(), calculateQR(), ProcessLib::TES::TESFEMReactionAdaptorCaOH2::initReaction(), and setChemicalEquilibrium().


The documentation for this class was generated from the following files: