Flow123d
JS_before_hm-2115-gf629a871a
|
Go to the documentation of this file.
48 return Record(
"DualPorosity",
49 "Dual porosity model in transport problems.\n"
50 "Provides computing the concentration of substances in mobile and immobile zone.\n"
54 "Containes region specific data necessary to construct dual porosity model.")
56 "Tolerance according to which the explicit Euler scheme is used or not."
57 "Set 0.0 to use analytic formula only (can be slower).")
62 EqFields().output_fields.make_output_type(
"DualPorosity",
""),
63 IT::Default(
"{ \"fields\": [ \"conc_immobile\" ] }"),
64 "Setting of the fields output.")
69 Input::register_class< DualPorosity, Mesh &, Input::Record >(
"DualPorosity") +
76 .
name(
"diffusion_rate_immobile")
77 .
description(
"Diffusion coefficient of non-equilibrium linear exchange between mobile and immobile zone.")
82 .
name(
"porosity_immobile")
89 .
name(
"init_conc_immobile")
90 .
description(
"Initial concentration of substances in the immobile zone.")
96 .
description(
"Concentration solution in the mobile phase.")
102 .
name(
"conc_immobile")
160 ASSERT(
time_ !=
nullptr).error(
"Time governor has not been set yet.\n");
161 ASSERT_LT(0,
eq_data_->substances_.size()).error(
"No substances for rection term.\n");
170 .concentration_fields(
eq_fields_->conc_mobile_fe)
171 .set_time_governor(*
time_);
179 .concentration_fields(
eq_fields_->conc_immobile_fe)
180 .set_time_governor(*
time_);
205 for (
unsigned int sbi = 0; sbi <
eq_data_->substances_.size(); sbi++)
208 eq_fields_->conc_immobile_fe[sbi] = create_field_fe< 3, FieldValue<3>::Scalar >(
eq_data_->dof_handler_);
218 ASSERT(
time_ !=
nullptr).error(
"Time governor has not been set yet.\n");
219 ASSERT_LT(0,
eq_data_->substances_.size()).error(
"No substances for rection term.\n");
237 std::stringstream ss;
256 IntIdx dof_p0 = dh_cell.get_loc_dof_indices()[0];
260 for (
unsigned int sbi = 0; sbi <
eq_data_->substances_.size(); sbi++)
287 conc_mob, conc_immob,
288 previous_conc_mob, previous_conc_immob,
297 arma::Col<double> diff_vec(
eq_data_->substances_.size());
298 for (sbi=0; sbi<
eq_data_->substances_.size(); sbi++)
299 diff_vec[sbi] =
eq_fields_->diffusion_rate_immobile[sbi].value(ele.
centre(), ele);
303 if (por_immob == 0.0)
return;
306 temp_exponent = (por_mob + por_immob) / (por_mob * por_immob) *
time_->
dt();
308 for (sbi = 0; sbi <
eq_data_->substances_.size(); sbi++)
310 exponent = diff_vec[sbi] * temp_exponent;
312 previous_conc_mob =
eq_fields_->conc_mobile_fe[sbi]->vec().get(dof_p0);
313 previous_conc_immob =
eq_fields_->conc_immobile_fe[sbi]->vec().get(dof_p0);
316 conc_average = ((por_mob * previous_conc_mob) + (por_immob * previous_conc_immob))
317 / (por_mob + por_immob);
319 conc_max = std::max(previous_conc_mob-conc_average, previous_conc_immob-conc_average);
324 if(
time_->
dt() <= por_mob*por_immob/(max(diff_vec)*(por_mob+por_immob)) &&
327 double temp = diff_vec[sbi]*(previous_conc_immob - previous_conc_mob) *
time_->
dt();
329 conc_mob = temp / por_mob + previous_conc_mob;
332 conc_immob = -temp / por_immob + previous_conc_immob;
336 double temp = exp(-exponent);
338 conc_mob = (previous_conc_mob - conc_average) * temp + conc_average;
341 conc_immob = (previous_conc_immob - conc_average) * temp + conc_average;
344 eq_fields_->conc_mobile_fe[sbi]->vec().set(dof_p0, conc_mob);
345 eq_fields_->conc_immobile_fe[sbi]->vec().set(dof_p0, conc_immob);
EqFields()
Collect all fields.
FieldCommon & units(const UnitSI &units)
Set basic units of the field.
std::shared_ptr< OutputTime > output_stream_
Pointer to a transport output stream.
static const int registrar
Registrar of class to factory.
MultiField< 3, FieldValue< 3 >::Scalar > diffusion_rate_immobile
Mass transfer coefficients between mobile and immobile pores.
void initialize() override
Prepares the object to usage.
static UnitSI & dimensionless()
Returns dimensionless unit.
static Input::Type::Abstract & it_abstract_immobile_term()
ReactionTerm(Mesh &init_mesh, Input::Record in_rec)
double scheme_tolerance_
Dual porosity computational scheme tolerance.
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library.
std::shared_ptr< EqFields > eq_fields_
Equation fields - all fields are in this set.
Support classes for parallel programing.
void set_input_list(Input::Array input_list, const TimeGovernor &tg)
void compute_reaction(const DHCellAccessor &dh_cell) override
Compute reaction on a single element.
void update_solution(void) override
#define FLOW123D_FORCE_LINK_IN_CHILD(x)
MultiField< 3, FieldValue< 3 >::Scalar > init_conc_immobile
Initial concentrations in the immobile zone.
FieldCommon & set_limits(double min, double max=std::numeric_limits< double >::max())
FieldCommon & flags(FieldFlag::Flags::Mask mask)
void make_reactions()
Resolves construction of following reactions.
#define ASSERT_LT(a, b)
Definition of comparative assert macro (Less Than)
Sorption model in immobile zone in case dual porosity is considered.
Sorption model in mobile zone in case dual porosity is considered.
FieldSet input_field_set_
static constexpr Mask equation_result
Match result fields. These are never given by input or copy of input.
const TimeStep & step(int index=-1) const
std::shared_ptr< ReactionTerm > reaction_mobile
Reaction running in mobile zone.
This file contains classes representing sorption model. Sorption model can be computed both in case t...
const ElementAccessor< 3 > elm() const
Return ElementAccessor to element of loc_ele_idx_.
Field< 3, FieldValue< 3 >::Scalar > porosity_immobile
Immobile porosity field.
static bool print_message_table(ostream &stream, std::string equation_name)
Class for representation SI units of Fields.
Input::Record input_record_
~DualPorosity(void)
Destructor.
Field< 3, FieldValue< 3 >::Scalar > porosity
Porosity field.
void set_initial_condition()
Sets initial condition from input.
static constexpr Mask input_copy
std::shared_ptr< ReactionTerm > reaction_immobile
Reaction running in immobile zone.
FieldCommon & input_default(const string &input_default)
void output_data(void) override
Main output routine.
Class Dual_por_exchange implements the model of dual porosity.
void zero_time_step() override
Cell accessor allow iterate over DOF handler cells.
static const Input::Type::Record & get_input_type()
#define WarningOut()
Macro defining 'warning' record of log.
static Input::Type::Abstract & it_abstract_term()
std::shared_ptr< EqFields > eq_fields_base_
Equation data - all fields needs in assembly class.
LocDofVec get_loc_dof_indices() const
Returns the local indices of dofs associated to the cell on the local process.
EquationOutput output_fields
Fields indended for output, i.e. all input fields plus those representing solution.
void initialize_fields()
Initializes field sets.
FieldCommon & description(const string &description)
Class ReactionTerm is an abstract class representing reaction term in transport.
static Input::Type::Abstract & it_abstract_mobile_term()
#define START_TIMER(tag)
Starts a timer with specified tag.
std::shared_ptr< EqData > eq_data_
Equation data - all data needs in assembly class.
#define END_TIMER(tag)
Ends a timer with specified tag.
MultiField< 3, FieldValue< 3 >::Scalar > conc_immobile
Calculated concentrations in the immobile zone.
FieldCommon & name(const string &name)
arma::vec::fixed< spacedim > centre() const
Computes the barycenter.