25#ifndef OLB_APPS_FLORIAN_ADSORPTION3D_ADSORPTIONREACTION_H_
26#define OLB_APPS_FLORIAN_ADSORPTION3D_ADSORPTIONREACTION_H_
46template<
typename T,
typename DESCRIPTOR>
68 T conversionFactorLength =
_unitConverter.getConversionFactorLength();
70 this->D_s =
D_s / (conversionFactorLength*conversionFactorLength) *
_unitConverter.getConversionFactorTime();
72 this->r_p =
r_p / conversionFactorLength;
73 this->
k_s = 15 * this->D_s / (this->r_p * this->
r_p);
85 if (soluteConcentration < 0)
return 0;
86 T load = this->isotherm->
getLoading(soluteConcentration);
87 if (load < 0) load = 0;
102 if (soluteConcentration < 0)
return 0;
106 T surfaceConcentration = soluteConcentration;
107 T args[] = {particleLoading, soluteConcentration, particleConcentration};
108 for(
int i = 0; i<100; i++){
113 T dCs = surfaceConcentration/1E8;
116 T load =
isotherm->getLoading(surfaceConcentration);
117 if (load < 0) load = 0;
128 particleConcentration *=
_unitConverter.getConversionFactorParticleDensity();
129 soluteConcentration *=
_unitConverter.getConversionFactorDensity();
130 particleLoading *=
_unitConverter.getConversionFactorParticleDensity();
132 surfaceLoad = this->
getSurfaceLoading(soluteConcentration, particleLoading, particleConcentration);
137 T reactionRate = this->
k_s * (surfaceLoad * particleConcentration - particleLoading);
139 reactionRate /
_unitConverter.getConversionFactorParticleDensity());
140 return reactionRates;
155 clout <<
"----------------- Reaction information -----------------" << std::endl;
156 clout <<
"-- Parameters:" << std::endl;
162 clout <<
"lattice Equilibrium surface loading: q_0= " << this->
q_0 << std::endl;
164 clout <<
"-------------------------------------------------------------" << std::endl;
165 this->isotherm->
print(clout);
168 void write(std::string
const& fileName) {
172 std::ofstream fout(dataFile.c_str(), std::ios::app);
174 std::cout <<
"error write() function: can not open std::ofstream" << std::endl;
187 T particleConcentration = args[2];
190 T equation = this->
k_f * (c - c_s) - this->
k_s * (particleConcentration * q_s - q);
constexpr T getConversionFactorParticleDensity() const
conversion factor to convert particle density from lattice units to kg/m^3
Describes adsorption reactions in conjunction with a Isotherm class.
void print(std::ostream &clout)
const Isotherm< T > * isotherm
AdsorptionReaction(AdsorptionConverter< T, DESCRIPTOR > const &converter, Isotherm< T > const *isotherm, T k_f, T D_s, T c_0, T r_p)
void write(std::string const &fileName)
T getSurfaceLoading(T soluteConcentration)
Get surface loading without film diffusion.
T getSurfaceLoading(T soluteConcentration, T particleLoading, T particleConcentration)
Get surface loading with film diffusion.
bool externalMassTransferEnabled
T getPhysSurfaceTransferConstant()
Vector< T, 2 > getReactionRate(T soluteConcentration, T particleLoading, T particleConcentration)
Calculates reaction rate in lattice units.
T getPhysSurfaceDiffusionConstant()
const AdsorptionConverter< T, DESCRIPTOR > _unitConverter
T filmDiffBoundary(T c_s_, T args[])
equations for surface concentration
T getPhysFilmTransferConstant()
Base class for isotherms.
virtual T getLoading(T c) const =0
Equation for isotherm.
void print(std::ostream &clout) const
constexpr T getConversionFactorDensity() const
access (read-only) to private member variable
constexpr T getConversionFactorLength() const
access (read-only) to private member variable
constexpr T getConversionFactorTime() const
access (read-only) to private member variable
std::string getLogOutDir() const
Directories & directories()
Top level namespace for all of OpenLB.
Base of a field whose size is defined by [C,U_1,...,U_N]^T * [1,V_1,...V_N].