1 #include <boost/foreach.hpp>
24 using namespace Input::Type;
29 "Linear isotherm runs the concentration exchange between liquid and solid.")
31 "Langmuir isotherm runs the concentration exchange between liquid and solid.")
33 "Freundlich isotherm runs the concentration exchange between liquid and solid.");
38 =
Record(
"Adsorption",
"AUXILIARY RECORD. Should not be directly part of the input tree.")
40 "Names of the substances that take part in the adsorption model.")
42 "Density of the solvent.")
44 "Number of equidistant substeps, molar mass and isotherm intersections")
46 "Specifies molar masses of all the adsorbing species.")
48 "Specifies solubility limits of all the adsorbing species.")
50 "Specifies highest aqueous concentration in interpolation table.")
51 .
declare_key(
"input_fields",
Array(EqData(
"").input_data_set_.make_field_descriptor_type(
"Sorption")), Default::obligatory(),
52 "Containes region specific data necessary to construct isotherms.")
58 ADD_FIELD(rock_density,
"Rock matrix density.",
"0.0");
60 ADD_FIELD(sorption_type,
"Considered adsorption is described by selected isotherm.");
61 sorption_type.input_selection(&sorption_type_selection);
63 ADD_FIELD(isotherm_mult,
"Multiplication parameters (k, omega) in either Langmuir c_s = omega * (alpha*c_a)/(1- alpha*c_a) or in linear c_s = k * c_a isothermal description.",
"1.0");
65 ADD_FIELD(isotherm_other,
"Second parameters (alpha, ...) defining isotherm c_s = omega * (alpha*c_a)/(1- alpha*c_a).",
"1.0");
66 ADD_FIELD(init_conc_solid,
"Initial solid concentration of substances."
67 " Vector, one value for every substance.",
"0");
69 rock_density.units(
"");
70 init_conc_solid.units(
"M/L^3");
72 input_data_set_ += *
this;
76 *
this += porosity.name(
"porosity").units(
"1").just_copy();
78 output_fields += *
this;
79 output_fields += conc_solid.name(output_field_name).units(
"M/L^3");
102 for (
unsigned int sbi = 0; sbi <
names_.size(); sbi++)
116 unsigned int k, global_idx, i_subst = 0;
123 for(k = 0; k < names.size(); k++)
125 if (*spec_iter == names[k])
134 xprintf(
UsrErr,
"Wrong name of %d-th substance - not found in global set of transported substances.\n", i_subst);
173 else xprintf(
UsrErr,
"Number of molar masses %d has to match number of adsorbing species %d.\n", molar_mass_array.size(),
molar_masses.size());
189 if( interp_table_limits )
205 ASSERT(
time_ !=
nullptr,
"Time governor has not been set yet.\n");
246 for (
unsigned int sbi = 0; sbi <
names_.size(); sbi++)
261 unsigned int index =
el_4_loc[loc_el];
278 for (
int sbi=0; sbi<
names_.size(); sbi++)
281 std::shared_ptr<FieldElementwise<3, FieldValue<3>::Scalar> > output_field_ptr(
322 xprintf(
UsrErr,
"Sorption model cannot have another descendant sorption model.\n");
325 xprintf(
UsrErr,
"Sorption model cannot have descendant dual porosity model.\n");
329 xprintf(
UsrErr,
"Semchem chemistry model is not supported at current time.\n");
332 xprintf(
UsrErr,
"Unknown reactions type in Sorption model.\n");
387 Region region = elem->region();
390 int i_subst, subst_id;
397 if (isotherms_vec[0].is_precomputed())
420 return concentrations;
431 DBGMSG(
"Not implemented.\n");
432 xprintf(
Msg,
"\nSorption parameters are defined as follows:\n");
446 int sbi, n_subst, ierr, rank, np;
452 for (sbi = 0; sbi < n_subst; sbi++) {
467 VecScatter vconc_out_scatter;
472 for (sbi = 0; sbi <
names_.size(); sbi++) {
478 VecScatterDestroy(&(vconc_out_scatter));