Flow123d
JS_before_hm-1884-g94bc49f8c
|
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.")
80 *
this += rock_density.name(
"rock_density")
81 .description(
"Rock matrix density.")
83 .units(
UnitSI().kg().m(-3) );
85 *
this += sorption_type.name(
"sorption_type")
86 .description(
"Considered sorption is described by selected isotherm.\n"
87 "If porosity on an element is equal to 1.0 (or even higher), meaning no sorbing surface, then type 'none' will be selected automatically.")
88 .input_selection(get_sorption_type_selection())
91 *
this += distribution_coefficient.name(
"distribution_coefficient")
92 .description(
"Distribution coefficient (( $k_l, k_F, k_L $)) of linear, Freundlich or Langmuir isotherm respectively.")
94 .units(
UnitSI().m(3).kg(-1) );
96 *
this += isotherm_other.name(
"isotherm_other")
97 .description(
"Additional parameter (($ \\alpha $)) of nonlinear isotherms.")
101 *
this += init_conc_solid.name(
"init_conc_solid")
102 .description(
"Initial solid concentration of substances. It is a vector: one value for every substance.")
104 .units(
UnitSI().dimensionless() );
106 input_data_set_ += *
this;
116 output_fields += *
this;
117 output_fields += conc_solid.name(output_field_name)
118 .description(output_field_desc)
119 .units(
UnitSI().dimensionless() )
178 for(
unsigned int i_reg = 0; i_reg < nr_of_regions; i_reg++)
182 for(
unsigned int i_subst = 0; i_subst <
n_substances_; i_subst++)
194 .set_time_governor(*
time_);
201 .set_time_governor(*
time_);
210 unsigned int k, global_idx, i_subst = 0;
214 for(; spec_iter != substances_array.
end(); ++spec_iter, i_subst++)
229 THROW(ReactionTerm::ExcUnknownSubstance()
230 << ReactionTerm::EI_Substance(*spec_iter)
267 THROW(SorptionBase::ExcSubstanceCountMatch()
268 << SorptionBase::EI_ArrayName(
"solubility")
283 if( interp_table_limits )
287 THROW(SorptionBase::ExcSubstanceCountMatch()
288 << SorptionBase::EI_ArrayName(
"table_limits")
310 substances_sorption.push_back(
substances_[i].name());
345 std::stringstream ss;
367 IntIdx dof_p0 = dh_cell.get_loc_dof_indices()[0];
422 THROW( ExcNotPositiveScaling() << EI_Subst(i_subst) );
432 for(
unsigned int i_subst = 0; i_subst <
n_substances_; i_subst++)
440 unsigned int reg_idx, i_subst;
444 for(reg_idx = 0; reg_idx < nr_of_regions; reg_idx++)
451 unsigned int reg_idx, i_subst, subst_id;
456 IntIdx dof_p0 = dh_cell.get_loc_dof_indices()[0];
457 reg_idx = dh_cell.elm().region().bulk_idx();
473 int reg_idx = reg_iter.bulk_idx();
486 for(
unsigned int i_subst = 0; i_subst <
n_substances_; i_subst++){
490 isotherms[reg_idx][i_subst].clear_table();
496 bool call_make_table = call_reinit;
498 double subst_table_limit =
isotherms[reg_idx][i_subst].table_limit();
503 if(subst_table_limit <
max_conc[reg_idx][i_subst])
505 call_make_table =
true;
506 subst_table_limit = 2*
max_conc[reg_idx][i_subst];
535 unsigned int i_subst, subst_id;
537 bool is_common_ele_data_valid =
false;
554 if(! is_common_ele_data_valid){
556 is_common_ele_data_valid =
true;
562 isotherm.
compute(c_aqua, c_sorbed);
std::vector< double > table_limit_
std::shared_ptr< OutputTime > output_stream_
Pointer to a transport output stream.
static const Input::Type::Record & get_input_type()
EqData * data_
Pointer to equation data. The object is constructed in descendants.
#define ASSERT_GT(a, b)
Definition of comparative assert macro (Greater Than)
static UnitSI & dimensionless()
Returns dimensionless unit.
std::shared_ptr< ReactionTerm > reaction_liquid
void initialize_substance_ids()
Reads names of substances from input and creates indexing to global vector of substance.
bool set_time(const TimeStep &time, LimitSide limit_side)
std::shared_ptr< ReactionTerm > reaction_solid
bool is_constant(Region reg) const
ReactionTerm(Mesh &init_mesh, Input::Record in_rec)
Constructor.
void initialize(std::shared_ptr< OutputTime > stream, Mesh *mesh, Input::Record in_rec, const TimeGovernor &tg)
Base of exceptions used in Flow123d.
unsigned int size() const
void clear_max_conc()
Sets max conc to zeros on all regins.
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library.
void set(std::vector< typename Field< spacedim, Value >::FieldBasePtr > field_vec, double time, std::vector< std::string > region_set_names={"ALL"})
void initialize_from_input()
Initializes private members of sorption from the input record.
Support classes for parallel programing.
EquationOutput output_fields
Fields indended for output, i.e. all input fields plus those representing solution.
void set_input_list(Input::Array input_list, const TimeGovernor &tg)
void output_type(OutputTime::DiscreteSpace rt)
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.
std::vector< double > solubility_vec_
MultiField< 3, FieldValue< 3 >::Enum > sorption_type
Discrete need Selection for initialization.
Class SorptionBase is abstract class representing model of sorption in transport.
double no_sorbing_surface_cond
std::shared_ptr< DOFHandlerMultiDim > dof_handler_
Pointer to DOF handler used through the reaction tree.
void isotherm_reinit(unsigned int i_subst, const ElementAccessor< 3 > &elm)
Reinitializes the isotherm.
void interpolate(double &c_aqua, double &c_sorbed)
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)
virtual void compute_common_ele_data(const ElementAccessor< 3 > &elem)=0
void compute(double &c_aqua, double &c_sorbed)
FieldFEScalarVec conc_mobile_fe
FieldFEs representing P0 interpolation of mobile concentration (passed from transport).
const std::vector< std::string > & names()
SorptionType
Type of adsorption isotherm.
MultiField< 3, FieldValue< 3 >::Scalar > init_conc_solid
Initial sorbed concentrations.
EqData(const string &output_field_name, const string &output_field_desc)
Collect all fields.
void set_components(const std::vector< string > &names)
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()
void set_initial_condition()
Reads and sets initial condition for concentration in solid.
unsigned int bulk_size() const
void zero_time_step() override
static const Input::Type::Selection & get_sorption_type_selection()
const TimeStep & step(int index=-1) const
const ElementAccessor< 3 > elm() const
Return ElementAccessor to element of loc_ele_idx_.
static bool print_message_table(ostream &stream, std::string equation_name)
Class for representation SI units of Fields.
const RegionDB & region_db() const
Input::Record input_record_
RegionSet get_region_set(const std::string &set_name) const
virtual ~SorptionBase(void)
SubstanceList substances_
Names belonging to substances.
FieldFEScalarVec conc_solid_fe
Underlaying FieldFE for each substance of conc_solid.
bool is_precomputed(void)
static constexpr Mask input_copy
std::vector< std::vector< Isotherm > > isotherms
void update_solution(void) override
Updates the solution.
std::vector< unsigned int > substance_global_idx_
Mapping from local indexing of substances to global.
void set_components(const std::vector< string > &names)
void output(TimeStep step)
Class Dual_por_exchange implements the model of dual porosity.
Cell accessor allow iterate over DOF handler cells.
FieldSet input_data_set_
Input data set - fields in this set are read from the input file.
void set_mesh(const Mesh &mesh)
#define WarningOut()
Macro defining 'warning' record of log.
unsigned int n_substances_
void isotherm_reinit_all(const ElementAccessor< 3 > &elm)
Calls isotherm_reinit for all isotherms.
LocDofVec get_loc_dof_indices() const
Returns the local indices of dofs associated to the cell on the local process.
std::vector< std::vector< double > > max_conc
MultiField< 3, FieldValue< 3 >::Scalar > conc_solid
Calculated sorbed concentrations, for output only.
void initialize() override
Prepares the object to usage.
MultiField< 3, FieldValue< 3 >::Scalar > isotherm_other
Langmuir sorption coeficients alpha (in fraction c_s = omega * (alpha*c_a)/(1- alpha*c_a)).
Class ReactionTerm is an abstract class representing reaction term in transport.
#define ASSERT_PTR(ptr)
Definition of assert macro checking non-null pointer (PTR)
MultiField< 3, FieldValue< 3 >::Scalar > distribution_coefficient
Multiplication coefficients (k, omega) for all types of isotherms.
unsigned int bulk_idx() const
Returns index of the region in the bulk set.
#define START_TIMER(tag)
Starts a timer with specified tag.
Input::Type::Record make_field_descriptor_type(const std::string &equation_name) const
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)
#define END_TIMER(tag)
Ends a timer with specified tag.
arma::vec::fixed< spacedim > centre() const
Computes the barycenter.
struct SorptionBase::CommonElementData common_ele_data