Flow123d
JS_before_hm-1821-g587b1939c
|
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 EqData().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") +
74 *
this += diffusion_rate_immobile
75 .name(
"diffusion_rate_immobile")
76 .description(
"Diffusion coefficient of non-equilibrium linear exchange between mobile and immobile zone.")
80 *
this += porosity_immobile
81 .name(
"porosity_immobile")
82 .description(
"Porosity of the immobile zone.")
87 *
this += init_conc_immobile
88 .name(
"init_conc_immobile")
89 .description(
"Initial concentration of substances in the immobile zone.")
90 .units(
UnitSI().kg().m(-3) );
95 .description(
"Concentration solution in the mobile phase.")
100 *
this += conc_immobile
101 .name(
"conc_immobile")
102 .units(
UnitSI().kg().m(-3) )
105 output_fields += *
this;
153 ASSERT(
time_ !=
nullptr).error(
"Time governor has not been set yet.\n");
164 .set_time_governor(*
time_);
173 .set_time_governor(*
time_);
211 ASSERT(
time_ !=
nullptr).error(
"Time governor has not been set yet.\n");
230 std::stringstream ss;
249 IntIdx dof_p0 = dh_cell.get_loc_dof_indices()[0];
280 conc_mob, conc_immob,
281 previous_conc_mob, previous_conc_immob,
296 if (por_immob == 0.0)
return;
299 temp_exponent = (por_mob + por_immob) / (por_mob * por_immob) *
time_->
dt();
303 exponent = diff_vec[sbi] * temp_exponent;
309 conc_average = ((por_mob * previous_conc_mob) + (por_immob * previous_conc_immob))
310 / (por_mob + por_immob);
312 conc_max = std::max(previous_conc_mob-conc_average, previous_conc_immob-conc_average);
317 if(
time_->
dt() <= por_mob*por_immob/(max(diff_vec)*(por_mob+por_immob)) &&
320 double temp = diff_vec[sbi]*(previous_conc_immob - previous_conc_mob) *
time_->
dt();
322 conc_mob = temp / por_mob + previous_conc_mob;
325 conc_immob = -temp / por_immob + previous_conc_immob;
329 double temp = exp(-exponent);
331 conc_mob = (previous_conc_mob - conc_average) * temp + conc_average;
334 conc_immob = (previous_conc_immob - conc_average) * temp + conc_average;
std::shared_ptr< OutputTime > output_stream_
Pointer to a transport output stream.
static const int registrar
Registrar of class to factory.
void initialize() override
Prepares the object to usage.
static UnitSI & dimensionless()
Returns dimensionless unit.
static Input::Type::Abstract & it_abstract_immobile_term()
FieldFEScalarVec conc_immobile_fe
Underlaying FieldFE for each substance of conc_immobile.
bool set_time(const TimeStep &time, LimitSide limit_side)
ReactionTerm(Mesh &init_mesh, Input::Record in_rec)
Constructor.
double scheme_tolerance_
Dual porosity computational scheme tolerance.
void initialize(std::shared_ptr< OutputTime > stream, Mesh *mesh, Input::Record in_rec, const TimeGovernor &tg)
unsigned int size() const
#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"})
Support classes for parallel programing.
void set_input_list(Input::Array input_list, const TimeGovernor &tg)
void output_type(OutputTime::DiscreteSpace rt)
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)
std::shared_ptr< DOFHandlerMultiDim > dof_handler_
Pointer to DOF handler used through the reaction tree.
void make_reactions()
Resolves construction of following reactions.
#define ASSERT_LT(a, b)
Definition of comparative assert macro (Less Than)
FieldFEScalarVec conc_mobile_fe
FieldFEs representing P0 interpolation of mobile concentration (passed from transport).
const std::vector< std::string > & names()
Sorption model in immobile zone in case dual porosity is considered.
Sorption model in mobile zone in case dual porosity is considered.
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.
const TimeStep & step(int index=-1) const
std::shared_ptr< ReactionTerm > reaction_mobile
Reaction running in mobile zone.
MultiField< 3, FieldValue< 3 >::Scalar > diffusion_rate_immobile
Mass transfer coefficients between mobile and immobile pores.
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_.
static bool print_message_table(ostream &stream, std::string equation_name)
Class for representation SI units of Fields.
Input::Record input_record_
Field< 3, FieldValue< 3 >::Scalar > porosity_immobile
Immobile porosity field.
~DualPorosity(void)
Destructor.
SubstanceList substances_
Names belonging to substances.
void set_initial_condition()
Sets initial condition from input.
static constexpr Mask input_copy
virtual const Value::return_type & value(const Point &p, const ElementAccessor< spacedim > &elm) const
std::shared_ptr< ReactionTerm > reaction_immobile
Reaction running in immobile zone.
void output(TimeStep step)
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()
void set_mesh(const Mesh &mesh)
#define WarningOut()
Macro defining 'warning' record of log.
EqData()
Collect all fields.
static Input::Type::Abstract & it_abstract_term()
MultiField< 3, FieldValue< 3 >::Scalar > conc_immobile
Calculated concentrations in the immobile zone.
MultiField< 3, FieldValue< 3 >::Scalar > init_conc_immobile
Initial concentrations in the immobile zone.
LocDofVec get_loc_dof_indices() const
Returns the local indices of dofs associated to the cell on the local process.
void initialize_fields()
Initializes field sets.
EquationOutput output_fields
Fields indended for output, i.e. all input fields plus those representing solution.
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.
Field< 3, FieldValue< 3 >::Scalar > porosity
Porosity field.
#define END_TIMER(tag)
Ends a timer with specified tag.
arma::vec::fixed< spacedim > centre() const
Computes the barycenter.