Flow123d  JS_before_hm-2154-g185f171e0
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SorptionBase Class Referenceabstract

#include <sorption_base.hh>

Inheritance diagram for SorptionBase:
Inheritance graph
[legend]
Collaboration diagram for SorptionBase:
Collaboration graph
[legend]

Classes

class  EqData
 DualPorosity data. More...
 
class  EqFields
 

Public Member Functions

 TYPEDEF_ERR_INFO (EI_ArrayName, std::string)
 
 TYPEDEF_ERR_INFO (EI_Subst, unsigned int)
 
 DECLARE_INPUT_EXCEPTION (ExcSubstanceCountMatch,<< "The size of the input array "<< EI_ArrayName::qval<< " does not match the number of substances.")
 
 DECLARE_EXCEPTION (ExcNotPositiveScaling,<< "Scaling parameter in sorption is not positive. Check the input for rock density and molar mass of "<< EI_Subst::val<< ". substance.\n")
 
 SorptionBase (Mesh &init_mesh, Input::Record in_rec)
 
virtual ~SorptionBase (void)
 
void initialize () override
 Prepares the object to usage. More...
 
void zero_time_step () override
 
void update_solution (void) override
 Updates the solution. More...
 
void output_data (void) override
 Output method. More...
 
- Public Member Functions inherited from ReactionTerm
 TYPEDEF_ERR_INFO (EI_Substance, std::string)
 
 TYPEDEF_ERR_INFO (EI_Model, std::string)
 
 DECLARE_INPUT_EXCEPTION (ExcUnknownSubstance,<< "Unknown substance name: "<< EI_Substance::qval)
 
 DECLARE_INPUT_EXCEPTION (ExcWrongDescendantModel,<< "Impossible descendant model: "<< EI_Model::qval)
 
 ReactionTerm (Mesh &init_mesh, Input::Record in_rec)
 
 ~ReactionTerm (void)
 Destructor. More...
 
ReactionTermsubstances (SubstanceList &substances)
 Sets the names of substances considered in transport. More...
 
ReactionTermoutput_stream (std::shared_ptr< OutputTime > ostream)
 Sets the output stream which is given from transport class. More...
 
ReactionTermconcentration_fields (FieldFEScalarVec &conc_mobile)
 
void choose_next_time (void) override
 Disable changes in TimeGovernor by empty method. More...
 
- Public Member Functions inherited from EquationBase
 EquationBase ()
 
 EquationBase (Mesh &mesh, const Input::Record in_rec)
 
virtual ~EquationBase ()
 
virtual void set_time_upper_constraint (double dt, std::string message)
 
virtual void set_time_lower_constraint (double dt, std::string message)
 
TimeGovernortime ()
 
virtual void set_time_governor (TimeGovernor &time)
 
double planned_time ()
 
virtual double solved_time ()
 
Meshmesh ()
 
std::shared_ptr< Balancebalance () const
 
TimeMark::Type mark_type ()
 
FieldSeteq_fieldset ()
 

Static Public Member Functions

static const Input::Type::Recordget_input_type ()
 
static Input::Type::Instance make_output_type (const string &equation_name, const string &output_field_name, const string &output_field_desc)
 
- Static Public Member Functions inherited from ReactionTerm
static Input::Type::Abstractit_abstract_term ()
 
static Input::Type::Abstractit_abstract_mobile_term ()
 
static Input::Type::Abstractit_abstract_immobile_term ()
 
static Input::Type::Abstractit_abstract_reaction ()
 
- Static Public Member Functions inherited from EquationBase
static Input::Type::Recordrecord_template ()
 Template Record with common keys for derived equations. More...
 

Protected Member Functions

 SorptionBase ()
 
void make_reactions ()
 
void initialize_substance_ids ()
 Reads names of substances from input and creates indexing to global vector of substance. More...
 
void initialize_from_input ()
 Initializes private members of sorption from the input record. More...
 
void initialize_fields ()
 Initializes field sets. More...
 
void compute_reaction (const DHCellAccessor &dh_cell) override
 Compute reaction on a single element. More...
 
void isotherm_reinit (unsigned int i_subst, const ElementAccessor< 3 > &elm)
 Reinitializes the isotherm. More...
 
void isotherm_reinit_all (const ElementAccessor< 3 > &elm)
 Calls isotherm_reinit for all isotherms. More...
 
void make_tables (void)
 
void update_max_conc ()
 Computes maximal aqueous concentration at the current step. More...
 
void clear_max_conc ()
 Sets max conc to zeros on all regins. More...
 
virtual void init_field_models ()=0
 Initialize FieldModels, method is implemented in descendants. More...
 
- Protected Member Functions inherited from ReactionTerm

Protected Attributes

std::shared_ptr< EqFieldseq_fields_
 Pointer to equation fields. The object is constructed in descendants. More...
 
std::shared_ptr< EqDataeq_data_
 Equation data. More...
 
unsigned int n_interpolation_steps_
 
double solvent_density_
 
std::vector< double > solubility_vec_
 
std::vector< double > table_limit_
 
std::vector< std::vector< double > > max_conc
 
std::vector< std::vector< Isotherm > > isotherms
 
std::shared_ptr< ReactionTermreaction_liquid
 
std::shared_ptr< ReactionTermreaction_solid
 
GenericAssembly< InitConditionAssemblySorp > * init_condition_assembly_
 general assembly objects, hold assembly objects of appropriate dimension More...
 
- Protected Attributes inherited from ReactionTerm
std::shared_ptr< OutputTimeoutput_stream_
 Pointer to a transport output stream. More...
 
std::shared_ptr< EqFieldseq_fields_base_
 Equation data - all fields needs in assembly class. More...
 
std::shared_ptr< EqDataeq_data_base_
 Equation data - all data needs in assembly class. More...
 
- Protected Attributes inherited from EquationBase
bool equation_empty_
 flag is true if only default constructor was called More...
 
Meshmesh_
 
TimeGovernortime_
 
Input::Record input_record_
 
FieldSeteq_fieldset_
 
std::shared_ptr< Balancebalance_
 object for calculation and writing the mass balance to file. More...
 

Additional Inherited Members

- Public Types inherited from ReactionTerm
typedef std::vector< std::shared_ptr< FieldFE< 3, FieldValue< 3 >::Scalar > > > FieldFEScalarVec
 

Detailed Description

Definition at line 62 of file sorption_base.hh.

Constructor & Destructor Documentation

◆ SorptionBase() [1/2]

SorptionBase::SorptionBase ( Mesh init_mesh,
Input::Record  in_rec 
)

Constructor with parameter for initialization of a new declared class member

Definition at line 146 of file sorption_base.cc.

◆ ~SorptionBase()

SorptionBase::~SorptionBase ( void  )
virtual

Destructor.

Definition at line 158 of file sorption_base.cc.

◆ SorptionBase() [2/2]

SorptionBase::SorptionBase ( )
protected

This method disables to use constructor without parameters.

Member Function Documentation

◆ clear_max_conc()

void SorptionBase::clear_max_conc ( )
protected

Sets max conc to zeros on all regins.

Definition at line 457 of file sorption_base.cc.

Here is the caller graph for this function:

◆ compute_reaction()

void SorptionBase::compute_reaction ( const DHCellAccessor dh_cell)
overrideprotectedvirtual

Compute reaction on a single element.

Implements ReactionTerm.

Definition at line 548 of file sorption_base.cc.

Here is the caller graph for this function:

◆ DECLARE_EXCEPTION()

SorptionBase::DECLARE_EXCEPTION ( ExcNotPositiveScaling  ,
<< "Scaling parameter in sorption is not positive. Check the input for rock density and molar mass of "<< EI_Subst::val<< ". substance.\n"   
)

◆ DECLARE_INPUT_EXCEPTION()

SorptionBase::DECLARE_INPUT_EXCEPTION ( ExcSubstanceCountMatch  ,
<< "The size of the input array "<< EI_ArrayName::qval<< " does not match the number of substances."   
)

◆ get_input_type()

const Record & SorptionBase::get_input_type ( )
static

Static variable for new input data types input

Definition at line 55 of file sorption_base.cc.

Here is the caller graph for this function:

◆ init_field_models()

virtual void SorptionBase::init_field_models ( )
protectedpure virtual

Initialize FieldModels, method is implemented in descendants.

Implemented in SorptionImmob, SorptionMob, and SorptionSimple.

Here is the caller graph for this function:

◆ initialize()

void SorptionBase::initialize ( )
overridevirtual

Prepares the object to usage.

Allocating memory, reading input, initialization of fields.

Reimplemented from EquationBase.

Definition at line 190 of file sorption_base.cc.

◆ initialize_fields()

void SorptionBase::initialize_fields ( )
protected

Initializes field sets.

Definition at line 330 of file sorption_base.cc.

Here is the caller graph for this function:

◆ initialize_from_input()

void SorptionBase::initialize_from_input ( )
protected

Initializes private members of sorption from the input record.

Definition at line 281 of file sorption_base.cc.

Here is the caller graph for this function:

◆ initialize_substance_ids()

void SorptionBase::initialize_substance_ids ( )
protected

Reads names of substances from input and creates indexing to global vector of substance.

Also creates the local vector of molar masses.

Definition at line 235 of file sorption_base.cc.

Here is the caller graph for this function:

◆ isotherm_reinit()

void SorptionBase::isotherm_reinit ( unsigned int  i_subst,
const ElementAccessor< 3 > &  elm 
)
protected

Reinitializes the isotherm.

On data change the isotherm is recomputed, possibly new interpolation table is made.

Definition at line 415 of file sorption_base.cc.

Here is the caller graph for this function:

◆ isotherm_reinit_all()

void SorptionBase::isotherm_reinit_all ( const ElementAccessor< 3 > &  elm)
protected

Calls isotherm_reinit for all isotherms.

Definition at line 449 of file sorption_base.cc.

Here is the caller graph for this function:

◆ make_output_type()

static Input::Type::Instance SorptionBase::make_output_type ( const string &  equation_name,
const string &  output_field_name,
const string &  output_field_desc 
)
inlinestatic

Definition at line 77 of file sorption_base.hh.

Here is the caller graph for this function:

◆ make_reactions()

void SorptionBase::make_reactions ( )
protected

Initializes possible following reactions from input record. It should be called after setting mesh, time_governor, distribution and concentration_matrix if there are some setting methods for reactions called (they are not at the moment, so it could be part of init_from_input).

Definition at line 163 of file sorption_base.cc.

Here is the caller graph for this function:

◆ make_tables()

void SorptionBase::make_tables ( void  )
protected

Creates interpolation table for isotherms.

Definition at line 484 of file sorption_base.cc.

Here is the caller graph for this function:

◆ output_data()

void SorptionBase::output_data ( void  )
overridevirtual

Output method.

Some reaction models have their own data to output (sorption, dual porosity)

  • this is where it must be reimplemented. On the other hand, some do not have (linear reaction, pade approximant)
  • that is why it is not pure virtual.

Reimplemented from ReactionTerm.

Definition at line 596 of file sorption_base.cc.

Here is the caller graph for this function:

◆ TYPEDEF_ERR_INFO() [1/2]

SorptionBase::TYPEDEF_ERR_INFO ( EI_ArrayName  ,
std::string   
)

◆ TYPEDEF_ERR_INFO() [2/2]

SorptionBase::TYPEDEF_ERR_INFO ( EI_Subst  ,
unsigned int   
)

◆ update_max_conc()

void SorptionBase::update_max_conc ( )
protected

Computes maximal aqueous concentration at the current step.

Definition at line 468 of file sorption_base.cc.

Here is the caller graph for this function:

◆ update_solution()

void SorptionBase::update_solution ( void  )
overridevirtual

Updates the solution.

Goes through local distribution of elements and calls compute_reaction.

Reimplemented from EquationBase.

Definition at line 394 of file sorption_base.cc.

◆ zero_time_step()

void SorptionBase::zero_time_step ( )
overridevirtual

Does first computation after initialization process. The time is set and initial condition is set and output.

Reimplemented from EquationBase.

Definition at line 366 of file sorption_base.cc.

Member Data Documentation

◆ eq_data_

std::shared_ptr<EqData> SorptionBase::eq_data_
protected

Equation data.

Definition at line 216 of file sorption_base.hh.

◆ eq_fields_

std::shared_ptr<EqFields> SorptionBase::eq_fields_
protected

Pointer to equation fields. The object is constructed in descendants.

Definition at line 215 of file sorption_base.hh.

◆ init_condition_assembly_

GenericAssembly< InitConditionAssemblySorp >* SorptionBase::init_condition_assembly_
protected

general assembly objects, hold assembly objects of appropriate dimension

Definition at line 255 of file sorption_base.hh.

◆ isotherms

std::vector<std::vector<Isotherm> > SorptionBase::isotherms
protected

Three dimensional array contains intersections between isotherms and mass balance lines. It describes behaviour of sorbents in mobile pores of various rock matrix enviroments. Up to |nr_of_region x nr_of_substances x n_points| doubles. Because of equidistant step lenght in cocidered system of coordinates, just function values are stored.

Definition at line 246 of file sorption_base.hh.

◆ max_conc

std::vector<std::vector<double> > SorptionBase::max_conc
protected

Maximum concentration per region. It is used for optimization of interpolation table.

Definition at line 239 of file sorption_base.hh.

◆ n_interpolation_steps_

unsigned int SorptionBase::n_interpolation_steps_
protected

Temporary nr_of_points can be computed using step_length. Should be |nr_of_region x nr_of_substances| matrix later.

Definition at line 221 of file sorption_base.hh.

◆ reaction_liquid

std::shared_ptr<ReactionTerm> SorptionBase::reaction_liquid
protected

Reaction model that follows the sorption.

Definition at line 251 of file sorption_base.hh.

◆ reaction_solid

std::shared_ptr<ReactionTerm> SorptionBase::reaction_solid
protected

Definition at line 252 of file sorption_base.hh.

◆ solubility_vec_

std::vector<double> SorptionBase::solubility_vec_
protected

Critical concentrations of species dissolved in water.

Definition at line 230 of file sorption_base.hh.

◆ solvent_density_

double SorptionBase::solvent_density_
protected

Density of the solvent. TODO: Could be done region dependent, easily.

Definition at line 226 of file sorption_base.hh.

◆ table_limit_

std::vector<double> SorptionBase::table_limit_
protected

Concentration table limits of species dissolved in water.

Definition at line 234 of file sorption_base.hh.


The documentation for this class was generated from the following files: