Go to the documentation of this file.
44 "Linear isotherm runs the concentration exchange between liquid and solid.")
46 "Langmuir isotherm runs the concentration exchange between liquid and solid.")
48 "Freundlich isotherm runs the concentration exchange between liquid and solid.")
55 return Record(
"SorptionAux",
"AUXILIARY RECORD. Should not be directly part of the input tree.")
57 "Names of the substances that take part in the sorption model.")
59 "Density of the solvent.")
61 "Number of equidistant substeps, molar mass and isotherm intersections")
63 "Specifies solubility limits of all the sorbing species.")
65 "Specifies the highest aqueous concentration in the isotherm function interpolation table. "
66 "Use any negative value for an automatic choice according to current maximal concentration (default and recommended). "
67 "Use '0' to always evaluate isotherm function directly (can be very slow). "
68 "Use a positive value to set the interpolation table limit manually "
69 "(if aqueous concentration is higher, then the isotherm function is evaluated directly).")
71 "Containes region specific data necessary to construct isotherms.")
87 .
description(
"Considered sorption is described by selected isotherm.\n"
88 "If porosity on an element is equal to 1.0 (or even higher), meaning no sorbing surface, then type 'none' will be selected automatically.")
94 .
description(
"Distribution coefficient (( $k_l, k_F, k_L $)) of linear, Freundlich or Langmuir isotherm respectively.")
99 .
description(
"Additional parameter (($ \\alpha $)) of nonlinear isotherms.")
104 .
description(
"Initial solid concentration of substances. It is a vector: one value for every substance.")
135 .
description(
"No sorbing surface condition computed by model.")
151 eq_data_ = std::make_shared<EqData>();
203 eq_data_->isotherms.resize(nr_of_regions);
204 eq_data_->max_conc.resize(nr_of_regions);
205 for(
unsigned int i_reg = 0; i_reg < nr_of_regions; i_reg++)
209 for(
unsigned int i_subst = 0; i_subst <
eq_data_->n_substances_; i_subst++)
221 .concentration_fields(
eq_fields_->conc_mobile_fe)
222 .set_time_governor(*
time_);
228 .concentration_fields(
eq_fields_->conc_solid_fe)
229 .set_time_governor(*
time_);
241 unsigned int k, global_idx, i_subst = 0;
245 for(; spec_iter != substances_array.
end(); ++spec_iter, i_subst++)
249 for(k = 0; k <
eq_data_->substances_.size(); k++)
251 if (*spec_iter ==
eq_data_->substances_[k].name())
260 THROW(ReactionTerm::ExcUnknownSubstance()
261 << ReactionTerm::EI_Substance(*spec_iter)
266 for(k = 0; k <
eq_data_->substance_global_idx_.size(); k++)
268 if(
eq_data_->substance_global_idx_[k] == global_idx)
277 eq_data_->substance_global_idx_.push_back(global_idx);
296 if (solub_iter->Array::size() !=
eq_data_->n_substances_)
298 THROW(SorptionBase::ExcSubstanceCountMatch()
299 << SorptionBase::EI_ArrayName(
"solubility")
304 else solub_iter->copy_to(
eq_data_->solubility_vec_);
314 if( interp_table_limits )
316 if (interp_table_limits->Array::size() !=
eq_data_->n_substances_)
318 THROW(SorptionBase::ExcSubstanceCountMatch()
319 << SorptionBase::EI_ArrayName(
"table_limits")
324 else interp_table_limits->copy_to(
eq_data_->table_limit_);
335 ASSERT_GT(
eq_data_->n_substances_, 0).error(
"Number of substances is wrong, they might have not been set yet.\n");
340 for (
unsigned int i :
eq_data_->substance_global_idx_)
341 substances_sorption.push_back(
eq_data_->substances_[i].name());
342 eq_fields_->set_components(substances_sorption);
358 for (
unsigned int sbi = 0; sbi <
eq_data_->substances_.size(); sbi++)
361 eq_fields_->conc_solid_fe[sbi] = create_field_fe< 3, FieldValue<3>::Scalar >(
eq_data_->dof_handler_);
376 std::stringstream ss;
468 unsigned int reg_idx, i_subst;
472 for(reg_idx = 0; reg_idx < nr_of_regions; reg_idx++)
473 for(i_subst = 0; i_subst <
eq_data_->n_substances_; i_subst++)
474 eq_data_->max_conc[reg_idx][i_subst] = 0.0;
479 unsigned int reg_idx, i_subst, subst_id;
484 IntIdx dof_p0 = dh_cell.get_loc_dof_indices()[0];
485 reg_idx = dh_cell.elm().region().bulk_idx();
486 for(i_subst = 0; i_subst <
eq_data_->n_substances_; i_subst++){
487 subst_id =
eq_data_->substance_global_idx_[i_subst];
488 eq_data_->max_conc[reg_idx][i_subst] = std::max(
eq_data_->max_conc[reg_idx][i_subst],
eq_fields_->conc_mobile_fe[subst_id]->vec().get(dof_p0));
501 int reg_idx = reg_iter.bulk_idx();
513 for(
unsigned int i_subst = 0; i_subst <
eq_data_->n_substances_; i_subst++){
517 eq_data_->isotherms[reg_idx][i_subst].clear_table();
523 bool call_make_table = call_reinit;
525 double subst_table_limit =
eq_data_->isotherms[reg_idx][i_subst].table_limit();
528 if(
eq_data_->table_limit_[i_subst] < 0.0)
530 if(subst_table_limit < eq_data_->max_conc[reg_idx][i_subst])
532 call_make_table =
true;
533 subst_table_limit = 2*
eq_data_->max_conc[reg_idx][i_subst];
540 subst_table_limit =
eq_data_->table_limit_[i_subst];
FieldCommon & units(const UnitSI &units)
Set basic units of the field.
std::shared_ptr< OutputTime > output_stream_
Pointer to a transport output stream.
MultiField< 3, FieldValue< 3 >::Enum > sorption_type
Discrete need Selection for initialization.
#define ASSERT_PERMANENT_PTR(ptr)
Definition of assert macro checking non-null pointer (PTR)
static const Input::Type::Record & get_input_type()
#define ASSERT_GT(a, b)
Definition of comparative assert macro (Greater Than) only for debug mode.
static UnitSI & dimensionless()
Returns dimensionless unit.
Field< 3, FieldValue< 3 >::Scalar > no_sorbing_surface_cond
std::shared_ptr< ReactionTerm > reaction_liquid
void initialize_substance_ids()
Reads names of substances from input and creates indexing to global vector of substance.
std::shared_ptr< ReactionTerm > reaction_solid
ReactionTerm(Mesh &init_mesh, Input::Record in_rec)
MultiField< 3, FieldValue< 3 >::Scalar > distribution_coefficient
Multiplication coefficients (k, omega) for all types of isotherms.
Base of exceptions used in Flow123d.
const RegionDB & region_db() const
void clear_max_conc()
Sets max conc to zeros on all regins.
virtual void init_field_models()=0
Initialize FieldModels, method is implemented in descendants.
void initialize_from_input()
Initializes private members of sorption from the input record.
Support classes for parallel programing.
#define ASSERT_PERMANENT_LT(a, b)
Definition of comparative assert macro (Less Than)
std::shared_ptr< EqFields > eq_fields_
Pointer to equation fields. The object is constructed in descendants.
void initialize_fields()
Initializes field sets.
unsigned int n_interpolation_steps_
void update_max_conc()
Computes maximal aqueous concentration at the current step.
#define THROW(whole_exception_expr)
Wrapper for throw. Saves the throwing point.
FieldCommon & set_limits(double min, double max=std::numeric_limits< double >::max())
FieldCommon & flags(FieldFlag::Flags::Mask mask)
Class SorptionBase is abstract class representing model of sorption in transport.
GenericAssembly< ReactionAssemblySorp > * reaction_assembly_
void assemble(std::shared_ptr< DOFHandlerMultiDim > dh) override
General assemble methods.
void compute_reaction(const DHCellAccessor &dh_cell) override
Compute reaction on a single element.
void output_data(void) override
Output method.
#define ASSERT_LT(a, b)
Definition of comparative assert macro (Less Than) only for debug mode.
static const Input::Type::Selection & get_sorption_type_selection()
MultiField< 3, FieldValue< 3 >::Scalar > isotherm_other
Langmuir sorption coeficients alpha (in fraction c_s = omega * (alpha*c_a)/(1- alpha*c_a)).
MultiField< 3, FieldValue< 3 >::Scalar > init_conc_solid
Initial sorbed concentrations.
static constexpr Mask equation_result
Match result fields. These are never given by input or copy of input.
static Input::Type::Abstract & it_abstract_reaction()
#define ASSERT_PERMANENT(expr)
Allow use shorter versions of macro names if these names is not used with external library.
unsigned int bulk_size() const
void zero_time_step() override
const TimeStep & step(int index=-1) const
static bool print_message_table(ostream &stream, std::string equation_name)
Class for representation SI units of Fields.
Input::Record input_record_
RegionSet get_region_set(const std::string &set_name) const
virtual ~SorptionBase(void)
MultiField< 3, FieldValue< 3 >::Scalar > conc_solid
Calculated sorbed concentrations, for output only.
std::shared_ptr< EqData > eq_data_
Equation data.
static constexpr Mask input_copy
void update_solution(void) override
Updates the solution.
Field< 3, FieldValue< 3 >::Scalar > rock_density
Rock matrix density.
EquationOutput output_fields
Fields indended for output, i.e. all input fields plus those representing solution.
FieldCommon & input_default(const string &input_default)
Class Dual_por_exchange implements the model of dual porosity.
Cell accessor allow iterate over DOF handler cells.
#define WarningOut()
Macro defining 'warning' record of log.
EqData()
Collect all fields.
Field< 3, FieldValue< 3 >::Scalar > scale_aqua
Instances of FieldModel used in assembly methods.
std::shared_ptr< EqData > eq_data_base_
Equation data - all data needs in assembly class.
GenericAssembly< InitConditionAssemblySorp > * init_condition_assembly_
general assembly objects, hold assembly objects of appropriate dimension
void initialize() override
Prepares the object to usage.
FieldCommon & input_selection(Input::Type::Selection element_selection)
FieldCommon & description(const string &description)
Class ReactionTerm is an abstract class representing reaction term in transport.
#define ASSERT_PTR(ptr)
Definition of assert macro checking non-null pointer (PTR) only for debug mode.
Field< 3, FieldValue< 3 >::Scalar > porosity
Porosity field copied from transport.
FieldSet input_field_set_
Input data set - fields in this set are read from the input file.
#define START_TIMER(tag)
Starts a timer with specified tag.
Field< 3, FieldValue< 3 >::Scalar > scale_sorbed
Input::Type::Record make_field_descriptor_type(const std::string &equation_name) const
#define END_TIMER(tag)
Ends a timer with specified tag.
FieldCommon & name(const string &name)