18 #ifndef ASSEMBLY_REACTION_HH_
19 #define ASSEMBLY_REACTION_HH_
33 template <
unsigned int dim,
class TEqData>
40 static constexpr
const char *
name() {
return "Dp_InitCondition_Assembly"; }
59 ASSERT_EQ(cell.
dim(), dim).error(
"Dimension of element mismatch!");
65 for (
unsigned int sbi = 0; sbi <
eq_data_->substances_.size(); sbi++)
84 template <
template<
IntDim...>
class DimAssembly>
88 template <
unsigned int dim,
class TEqData>
95 static constexpr
const char *
name() {
return "Dp_InitCondition_Assembly"; }
116 ASSERT_EQ(cell.
dim(), dim).error(
"Dimension of element mismatch!");
128 arma::Col<double> diff_vec(
eq_data_->substances_.size());
194 template <
template<
IntDim...>
class DimAssembly>
198 template <
unsigned int dim,
class TEqData>
205 static constexpr
const char *
name() {
return "Sorp_InitCondition_Assembly"; }
224 ASSERT_EQ(cell.
dim(), dim).error(
"Dimension of element mismatch!");
230 for (
unsigned int sbi = 0; sbi <
eq_data_->n_substances_; sbi++)
248 template <
template<
IntDim...>
class DimAssembly>
252 template <
unsigned int dim,
class TEqData>
259 static constexpr
const char *
name() {
return "Sorp_Reaction_Assembly"; }
283 ASSERT_EQ(cell.
dim(), dim).error(
"Dimension of element mismatch!");
285 unsigned int i_subst, subst_id;
291 double scale_aqua =
eq_fields_->scale_aqua(p);
292 double scale_sorbed =
eq_fields_->scale_sorbed(p);
293 double no_sorbing_surface_cond =
eq_fields_->no_sorbing_surface_cond(p);
295 for(i_subst = 0; i_subst <
eq_data_->n_substances_; i_subst++)
297 subst_id =
eq_data_->substance_global_idx_[i_subst];
301 bool limited_solubility_on =
eq_data_->solubility_vec_[i_subst] > 0.0;
304 if( no_sorbing_surface_cond <= std::numeric_limits<double>::epsilon())
307 scale_aqua, scale_sorbed,
310 if ( scale_sorbed <= 0.0)
311 THROW( SorptionBase::ExcNotPositiveScaling() << SorptionBase::EI_Subst(i_subst) );
314 limited_solubility_on,
eq_data_->solvent_density_,
315 scale_aqua, scale_sorbed,
317 eq_fields_->distribution_coefficient[i_subst](p),
323 isotherm.
compute(c_aqua, c_sorbed);
328 if(
eq_data_->table_limit_[i_subst] < 0)
349 template <
template<
IntDim...>
class DimAssembly>
#define ASSERT_EQ(a, b)
Definition of comparative assert macro (EQual) only for debug mode.
Quadrature * quad_
Quadrature used in assembling methods.
std::shared_ptr< BulkIntegralAcc< dim > > create_bulk_integral(Quadrature *quad)
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.
Class FEValues calculates finite element data on the actual cells such as shape function values,...
#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.