Flow123d
master-9c1c1b8e5
|
Go to the documentation of this file.
47 #ifndef ISOTHERM_IMPL_HH_
48 #define ISOTHERM_IMPL_HH_
59 #include <boost/math/special_functions/detail/round_fwd.hpp>
73 eps = T(ldexp(1.0F, 1-bits));
78 return fabs(a - b) <= (
eps * (std::max)(fabs(a), fabs(b)));
162 "The Boost solver of nonlinear equation did not converge in sorption model.\n"
163 <<
"Check input at the following address for possible user error: \t" << Input::EI_Address::val <<
"\n"
164 "Solver message: \n" << EI_BoostMessage::val);
168 "The total mass in sorption model became negative during the computation (value: "
169 << EI_TotalMass::val <<
").\n"
170 <<
"Check input at the following address for possible user error: \t" << Input::EI_Address::val <<
"\n");
205 double aqua_density,
double scale_aqua,
double scale_sorbed,
206 double c_aqua_limit,
double mult_coef,
double second_coef);
227 void compute(
double &c_aqua,
double &c_sorbed);
234 void interpolate(
double &c_aqua,
double &c_sorbed);
253 void make_table(
const Func &isotherm,
int n_points);
260 ConcPair
solve_conc(ConcPair c_pair,
const Func &isotherm);
326 template <
class Func>
330 CrossFunction(
const Func &func_,
double total_mass,
double scale_aqua,
double scale_sorbed,
double rho_aqua)
ConcPair compute_projection(ConcPair conc)
bool operator()(const T &a, const T &b)
Langmuir(double mult_coef, double alpha)
Constructor to set parameters.
double table_limit_
Concentration in liquid phase for limit of the interpolation table.
double solubility_limit_
Concentration limit in liquid phase (solubility limit).
ConcPair(double x, double y)
Linear(double mult_coef)
Constructor to set parameters.
double scale_aqua_
coefficient that convert soluted concentration to mass; porosity = k_W, originally rho_aqua*porosity ...
double get_total_mass(ConcPair conc)
bool limited_solubility_on_
Solubility limit flag.
double scale_sorbed_
coefficient that convert adsorbed molar concentration to mass; molar_weight * rho_rock * (1 - porosit...
double operator()(double)
Isotherm definition.
double mult_coef_
Parameters of the isotherm.
void make_table(unsigned int n_points, double table_limit)
double operator()(double conc_aqua)
ConcPair precipitate(ConcPair conc)
void interpolate(double &c_aqua, double &c_sorbed)
void compute(double &c_aqua, double &c_sorbed)
SorptionType
Type of adsorption isotherm.
double operator()(double x)
Isotherm definition.
DECLARE_EXCEPTION(ExcBoostSolver,<< "The Boost solver of nonlinear equation did not converge in sorption model.\n"<< "Check input at the following address for possible user error: \t"<< Input::EI_Address::val<< "\n" "Solver message: \n"<< EI_BoostMessage::val)
double mult_coef_
Parameters of the isotherm.
TYPEDEF_ERR_INFO(EI_BoostMessage, std::string)
double second_coef_
Optional secod parameter of the isotherm.
enum SorptionType adsorption_type_
Type of isotherm.
Freundlich(double mult_coef, double exponent)
Constructor to set parameters.
double table_limit(void) const
Getter for table limit (limit aqueous concentration).
bool is_precomputed(void)
double inv_scale_aqua_
reciprocal values
Pair of soluted and adsorbed concentration.
double operator()(double x)
Isotherm definition.
CrossFunction(const Func &func_, double total_mass, double scale_aqua, double scale_sorbed, double rho_aqua)
double mult_coef_
Multiplication parameter of the isotherm.
double mult_coef_
Parameters of the isotherm.
ConcPair solve_conc(ConcPair c_pair, const Func &isotherm)
Isotherm()
Default constructor.
double operator()(double x)
Isotherm definition.
double rho_aqua_
density of the solvent
std::vector< double > interpolation_table
void reinit(enum SorptionType sorption_type, bool limited_solubility_on, double aqua_density, double scale_aqua, double scale_sorbed, double c_aqua_limit, double mult_coef, double second_coef)
None()
Constructor to set parameters.