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, idx, i_spec = 0;
121 for(k = 0; k < names.size(); k++)
123 if (*spec_iter == names[k])
130 if ((idx < names.size()) && (idx >= 0))
134 else xprintf(
UsrErr,
"Wrong name of %d-th reaction specie - not found in global set of transported substances.\n", i_spec);
158 else xprintf(
UsrErr,
"Number of molar masses %d has to match number of adsorbing species %d.\n", molar_mass_array.size(),
molar_masses.size());
174 if( interp_table_limits )
190 ASSERT(
time_ !=
nullptr,
"Time governor has not been set yet.\n");
231 for (
unsigned int sbi = 0; sbi <
names_.size(); sbi++)
246 unsigned int index =
el_4_loc[loc_el];
263 for (
int sbi=0; sbi<
names_.size(); sbi++)
266 std::shared_ptr<FieldElementwise<3, FieldValue<3>::Scalar> > output_field_ptr(
307 xprintf(
UsrErr,
"Sorption model cannot have another descendant sorption model.\n");
310 xprintf(
UsrErr,
"Sorption model cannot have descendant dual porosity model.\n");
314 xprintf(
UsrErr,
"Semchem chemistry model is not supported at current time.\n");
317 xprintf(
UsrErr,
"Unknown reactions type in Sorption model.\n");
372 Region region = elem->region();
375 int i_subst, subst_id;
382 if (isotherms_vec[0].is_precomputed())
405 return concentrations;
416 DBGMSG(
"Not implemented.\n");
417 xprintf(
Msg,
"\nSorption parameters are defined as follows:\n");
431 int sbi, n_subst, ierr, rank, np;
437 for (sbi = 0; sbi < n_subst; sbi++) {
452 VecScatter vconc_out_scatter;
457 for (sbi = 0; sbi <
names_.size(); sbi++) {
463 VecScatterDestroy(&(vconc_out_scatter));