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];
#define ASSERT_PERMANENT_LT(a, b)
Definition of comparative assert macro (Less Than)
#define ASSERT_PERMANENT_PTR(ptr)
Definition of assert macro checking non-null pointer (PTR)
#define ASSERT_PERMANENT(expr)
Allow use shorter versions of macro names if these names is not used with external library.
#define ASSERT_LT(a, b)
Definition of comparative assert macro (Less Than) only for debug mode.
#define ASSERT_GT(a, b)
Definition of comparative assert macro (Greater Than) only for debug mode.
#define ASSERT_PTR(ptr)
Definition of assert macro checking non-null pointer (PTR) only for debug mode.
Cell accessor allow iterate over DOF handler cells.
Input::Record input_record_
Base of exceptions used in Flow123d.
static bool print_message_table(ostream &stream, std::string equation_name)
FieldCommon & input_selection(Input::Type::Selection element_selection)
FieldCommon & description(const string &description)
FieldCommon & flags(FieldFlag::Flags::Mask mask)
FieldCommon & name(const string &name)
FieldCommon & set_limits(double min, double max=std::numeric_limits< double >::max())
FieldCommon & units(const UnitSI &units)
Set basic units of the field.
FieldCommon & input_default(const string &input_default)
static constexpr Mask input_copy
static constexpr Mask equation_result
Match result fields. These are never given by input or copy of input.
Input::Type::Record make_field_descriptor_type(const std::string &equation_name) const
void assemble(std::shared_ptr< DOFHandlerMultiDim > dh) override
General assemble methods.
const RegionDB & region_db() const
std::shared_ptr< OutputTime > output_stream_
Pointer to a transport output stream.
std::shared_ptr< EqData > eq_data_base_
Equation data - all data needs in assembly class.
static Input::Type::Abstract & it_abstract_reaction()
ReactionTerm(Mesh &init_mesh, Input::Record in_rec)
RegionSet get_region_set(const std::string &set_name) const
unsigned int bulk_size() const
EqData()
Collect all fields.
MultiField< 3, FieldValue< 3 >::Scalar > init_conc_solid
Initial sorbed concentrations.
MultiField< 3, FieldValue< 3 >::Scalar > isotherm_other
Langmuir sorption coeficients alpha (in fraction c_s = omega * (alpha*c_a)/(1- alpha*c_a)).
FieldSet input_field_set_
Input data set - fields in this set are read from the input file.
Field< 3, FieldValue< 3 >::Scalar > scale_sorbed
Field< 3, FieldValue< 3 >::Scalar > rock_density
Rock matrix density.
MultiField< 3, FieldValue< 3 >::Scalar > conc_solid
Calculated sorbed concentrations, for output only.
MultiField< 3, FieldValue< 3 >::Enum > sorption_type
Discrete need Selection for initialization.
Field< 3, FieldValue< 3 >::Scalar > scale_aqua
Instances of FieldModel used in assembly methods.
static const Input::Type::Selection & get_sorption_type_selection()
Field< 3, FieldValue< 3 >::Scalar > porosity
Porosity field copied from transport.
Field< 3, FieldValue< 3 >::Scalar > no_sorbing_surface_cond
MultiField< 3, FieldValue< 3 >::Scalar > distribution_coefficient
Multiplication coefficients (k, omega) for all types of isotherms.
EquationOutput output_fields
Fields indended for output, i.e. all input fields plus those representing solution.
void compute_reaction(const DHCellAccessor &dh_cell) override
Compute reaction on a single element.
void zero_time_step() override
void output_data(void) override
Output method.
static const Input::Type::Record & get_input_type()
std::shared_ptr< ReactionTerm > reaction_liquid
GenericAssembly< ReactionAssemblySorp > * reaction_assembly_
void initialize() override
Prepares the object to usage.
virtual ~SorptionBase(void)
std::shared_ptr< ReactionTerm > reaction_solid
std::shared_ptr< EqData > eq_data_
Equation data.
void initialize_from_input()
Initializes private members of sorption from the input record.
unsigned int n_interpolation_steps_
void clear_max_conc()
Sets max conc to zeros on all regins.
void initialize_substance_ids()
Reads names of substances from input and creates indexing to global vector of substance.
GenericAssembly< InitConditionAssemblySorp > * init_condition_assembly_
general assembly objects, hold assembly objects of appropriate dimension
void update_max_conc()
Computes maximal aqueous concentration at the current step.
void initialize_fields()
Initializes field sets.
std::shared_ptr< EqFields > eq_fields_
Pointer to equation fields. The object is constructed in descendants.
virtual void init_field_models()=0
Initialize FieldModels, method is implemented in descendants.
void update_solution(void) override
Updates the solution.
const TimeStep & step(int index=-1) const
Class for representation SI units of Fields.
static UnitSI & dimensionless()
Returns dimensionless unit.
Support classes for parallel programing.
Class Dual_por_exchange implements the model of dual porosity.
#define THROW(whole_exception_expr)
Wrapper for throw. Saves the throwing point.
#define WarningOut()
Macro defining 'warning' record of log.
Class ReactionTerm is an abstract class representing reaction term in transport.
Class SorptionBase is abstract class representing model of sorption in transport.
#define END_TIMER(tag)
Ends a timer with specified tag.
#define START_TIMER(tag)
Starts a timer with specified tag.