18 #ifndef ASSEMBLY_REACTION_HH_
19 #define ASSEMBLY_REACTION_HH_
32 template <
unsigned int dim,
class TEqData>
39 static constexpr
const char *
name() {
return "Dp_InitCondition_Assembly"; }
58 ASSERT_EQ(cell.
dim(), dim).error(
"Dimension of element mismatch!");
64 for (
unsigned int sbi = 0; sbi <
eq_data_->substances_.size(); sbi++)
83 template <
template<
IntDim...>
class DimAssembly>
87 template <
unsigned int dim,
class TEqData>
94 static constexpr
const char *
name() {
return "Dp_InitCondition_Assembly"; }
115 ASSERT_EQ(cell.
dim(), dim).error(
"Dimension of element mismatch!");
127 arma::Col<double> diff_vec(
eq_data_->substances_.size());
193 template <
template<
IntDim...>
class DimAssembly>
197 template <
unsigned int dim,
class TEqData>
204 static constexpr
const char *
name() {
return "Sorp_InitCondition_Assembly"; }
223 ASSERT_EQ(cell.
dim(), dim).error(
"Dimension of element mismatch!");
229 for (
unsigned int sbi = 0; sbi <
eq_data_->n_substances_; sbi++)
247 template <
template<
IntDim...>
class DimAssembly>
251 template <
unsigned int dim,
class TEqData>
258 static constexpr
const char *
name() {
return "Sorp_Reaction_Assembly"; }
282 ASSERT_EQ(cell.
dim(), dim).error(
"Dimension of element mismatch!");
284 unsigned int i_subst, subst_id;
290 double scale_aqua =
eq_fields_->scale_aqua(p);
291 double scale_sorbed =
eq_fields_->scale_sorbed(p);
292 double no_sorbing_surface_cond =
eq_fields_->no_sorbing_surface_cond(p);
294 for(i_subst = 0; i_subst <
eq_data_->n_substances_; i_subst++)
296 subst_id =
eq_data_->substance_global_idx_[i_subst];
300 bool limited_solubility_on =
eq_data_->solubility_vec_[i_subst] > 0.0;
303 if( no_sorbing_surface_cond <= std::numeric_limits<double>::epsilon())
306 scale_aqua, scale_sorbed,
309 if ( scale_sorbed <= 0.0)
310 THROW( SorptionBase::ExcNotPositiveScaling() << SorptionBase::EI_Subst(i_subst) );
313 limited_solubility_on,
eq_data_->solvent_density_,
314 scale_aqua, scale_sorbed,
316 eq_fields_->distribution_coefficient[i_subst](p),
322 isotherm.
compute(c_aqua, c_sorbed);
327 if(
eq_data_->table_limit_[i_subst] < 0)
348 template <
template<
IntDim...>
class DimAssembly>
#define ASSERT_EQ(a, b)
Definition of comparative assert macro (EQual) only for debug mode.
std::shared_ptr< BulkIntegralAcc< dim > > create_bulk_integral(Quadrature *quad)
Quadrature * quad_
Quadrature used in assembling methods.
Cell accessor allow iterate over DOF handler cells.
LocDofVec get_loc_dof_indices() const
Returns the local indices of dofs associated to the cell on the local process.
unsigned int dim() const
Return dimension of element appropriate to cell.
ElementAccessor< 3 > elm() const
Return ElementAccessor to element of loc_ele_idx_.
Container for various descendants of FieldCommonBase.
Generic class of assemblation.
EqFields * eq_fields_
Data objects shared with Elasticity.
~InitConditionAssemblyDp()
Destructor.
void initialize()
Initialize auxiliary vectors and other data members.
InitConditionAssemblyDp(EqData *eq_data, AssemblyInternals *asm_internals)
Constructor.
static constexpr const char * name()
void cell_integral(DHCellAccessor cell, unsigned int element_patch_idx)
Assemble integral over element.
IntIdx dof_p0_
Index of local DOF.
TEqData::EqFields EqFields
FieldSet used_fields_
Sub field set contains fields used in calculation.
std::shared_ptr< BulkIntegralAcc< dim > > mass_integral_
Bulk integral of assembly class.
TEqData::EqFields EqFields
void cell_integral(DHCellAccessor cell, unsigned int element_patch_idx)
Assemble integral over element.
InitConditionAssemblySorp(EqData *eq_data, AssemblyInternals *asm_internals)
Constructor.
void initialize()
Initialize auxiliary vectors and other data members.
static constexpr const char * name()
FieldSet used_fields_
Sub field set contains fields used in calculation.
EqFields * eq_fields_
Data objects shared with Elasticity.
~InitConditionAssemblySorp()
Destructor.
std::shared_ptr< BulkIntegralAcc< dim > > mass_integral_
Bulk integral of assembly class.
IntIdx dof_p0_
Index of local DOF.
void compute(double &c_aqua, double &c_sorbed)
SorptionType
Type of adsorption isotherm.
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)
double conc_max_
difference between concentration and average concentration
EqFields * eq_fields_
Data objects shared with Elasticity.
double temp_
Precomputed values.
double conc_immob_
new mobile and immobile concentration
double conc_average_
weighted (by porosity) average of concentration
~ReactionAssemblyDp()
Destructor.
IntIdx dof_p0_
Index of local DOF.
double previous_conc_immob_
mobile and immobile concentration in previous time step
void cell_integral(DHCellAccessor cell, unsigned int element_patch_idx)
Assemble integral over element.
double previous_conc_mob_
static constexpr const char * name()
FieldSet used_fields_
Sub field set contains fields used in calculation.
TEqData::EqFields EqFields
void initialize()
Initialize auxiliary vectors and other data members.
ReactionAssemblyDp(EqData *eq_data, AssemblyInternals *asm_internals)
Constructor.
std::shared_ptr< BulkIntegralAcc< dim > > mass_integral_
Bulk integral of assembly class.
double por_immob_
mobile and immobile porosity
unsigned int sbi_
Index of substance.
std::shared_ptr< BulkIntegralAcc< dim > > mass_integral_
Bulk integral of assembly class.
TEqData::EqFields EqFields
static constexpr const char * name()
~ReactionAssemblySorp()
Destructor.
void cell_integral(DHCellAccessor cell, unsigned int element_patch_idx)
Assemble integral over element.
ReactionAssemblySorp(EqData *eq_data, AssemblyInternals *asm_internals)
Constructor.
int reg_idx_
Bulk region idx.
void initialize()
Initialize auxiliary vectors and other data members.
EqFields * eq_fields_
Data objects shared with Elasticity.
FieldSet used_fields_
Sub field set contains fields used in calculation.
IntIdx dof_p0_
Index of local DOF.
unsigned int bulk_idx() const
Returns index of the region in the bulk set.
Class Dual_por_exchange implements the model of dual porosity.
Definitions of basic Lagrangean finite elements with polynomial shape functions.
#define THROW(whole_exception_expr)
Wrapper for throw. Saves the throwing point.
unsigned int IntDim
A dimension index type.
Definitions of particular quadrature rules on simplices.
Holds common data shared between GenericAssemblz and Assembly<dim> classes.