Flow123d  release_3.0.0-962-g8853c67
sorption.hh
Go to the documentation of this file.
1 /*!
2  *
3  * Copyright (C) 2015 Technical University of Liberec. All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU General Public License version 3 as published by the
7  * Free Software Foundation. (http://www.gnu.org/licenses/gpl-3.0.en.html)
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12  *
13  *
14  * @file sorption.hh
15  * @brief This file contains classes representing sorption model.
16  * Sorption model can be computed both in case the dual porosity is considered or not.
17  *
18  * The difference is only in the isotherm_reinit method.
19  * Passing immobile porosity from dual porosity model is solved in abstract class SorptionDual.
20  *
21  * @todo
22  * It seems that the methods isotherm_reinit() are different only at computation of scale_aqua and scale_sorbed.
23  * So it could be moved to SorptionDual and the only method which would be virtual would be
24  * compute_sorbing_scale(). It is prepared in comment code.
25  */
26 
27 #ifndef SORPTION_H
28 #define SORPTION_H
29 
30 #include <boost/exception/info.hpp> // for operator<<, error_info::error_i...
31 #include <string> // for string
32 #include <vector> // for vector
33 #include "fields/field.hh" // for Field
34 #include "fields/field_values.hh" // for FieldValue<>::Scalar, FieldValue
35 #include "input/type_base.hh" // for Array
36 #include "input/type_generic.hh" // for Instance
37 #include "reaction/reaction_term.hh" // for ReactionTerm
39 
40 class Mesh;
41 class Isotherm;
42 namespace Input {
43  class Record;
44  namespace Type { class Record; }
45 }
46 template <int spacedim> class ElementAccessor;
47 
48 
49 /** @brief Simple sorption model without dual porosity.
50  *
51  */
53 {
54 public:
56 
57  static const Input::Type::Record & get_input_type();
58 
59  /// Constructor.
60  SorptionSimple(Mesh &init_mesh, Input::Record in_rec);
61 
62  /// Destructor.
63  ~SorptionSimple(void);
64 
65 protected:
66  /// Computes @p CommonElementData.
67  void compute_common_ele_data(const ElementAccessor<3> &elem) override;
68 
69 private:
70  /// Registrar of class to factory
71  static const int registrar;
72 };
73 
74 
75 /** @brief Abstract class of sorption model in case dual porosity is considered.
76  *
77  */
79 {
80 public:
81  /// Constructor.
82  SorptionDual(Mesh &init_mesh, Input::Record in_rec,
83  const string &output_conc_name,
84  const string &output_conc_desc);
85 
86  /// Destructor.
87  ~SorptionDual(void);
88 
89  /// Sets the immobile porosity field.
91  {
92  immob_porosity_.copy_from(por_imm);
93  }
94 
95 protected:
96  /// Computes @p CommonElementData. Pure virtual.
97  virtual void compute_common_ele_data(const ElementAccessor<3> &elem) = 0;
98 
99  Field<3, FieldValue<3>::Scalar > immob_porosity_; //< Immobile porosity field copied from transport
100 };
101 
102 
103 /** @brief Sorption model in mobile zone in case dual porosity is considered.
104  *
105  */
107 {
108 public:
110 
111  static const Input::Type::Record & get_input_type();
112 
113  /// Constructor.
114  SorptionMob(Mesh &init_mesh, Input::Record in_rec);
115 
116  /// Destructor.
117  ~SorptionMob(void);
118 
119 protected:
120  /// Computes @p CommonElementData.
121  void compute_common_ele_data(const ElementAccessor<3> &elem) override;
122 
123 private:
124  /// Registrar of class to factory
125  static const int registrar;
126 };
127 
128 
129 /** @brief Sorption model in immobile zone in case dual porosity is considered.
130  *
131  */
133 {
134 public:
136 
137  static const Input::Type::Record & get_input_type();
138 
139  /// Constructor.
140  SorptionImmob(Mesh &init_mesh, Input::Record in_rec);
141 
142  /// Destructor.
143  ~SorptionImmob(void);
144 
145 protected:
146  /// Computes @p CommonElementData.
147  void compute_common_ele_data(const ElementAccessor<3> &elem) override;
148 
149 private:
150  /// Registrar of class to factory
151  static const int registrar;
152 };
153 
154 
155 #endif // SORPTION_H
Sorption model in immobile zone in case dual porosity is considered.
Definition: sorption.hh:132
void set_porosity_immobile(Field< 3, FieldValue< 3 >::Scalar > &por_imm)
Sets the immobile porosity field.
Definition: sorption.hh:90
Abstract linear system class.
Definition: balance.hh:35
Class template representing a field with values dependent on: point, element, and region...
Definition: field.hh:83
ReactionTerm FactoryBaseType
Definition: sorption.hh:135
Abstract class of sorption model in case dual porosity is considered.
Definition: sorption.hh:78
Definition: mesh.h:76
Class ReactionTerm is an abstract class representing reaction term in transport.
ReactionTerm FactoryBaseType
Definition: sorption.hh:109
Field< 3, FieldValue< 3 >::Scalar > immob_porosity_
Definition: sorption.hh:99
Accessor to the data with type Type::Record.
Definition: accessors.hh:292
Sorption model in mobile zone in case dual porosity is considered.
Definition: sorption.hh:106
static const int registrar
Registrar of class to factory.
Definition: sorption.hh:71
Class SorptionBase is abstract class representing model of sorption in transport. ...
static const int registrar
Registrar of class to factory.
Definition: sorption.hh:151
static const int registrar
Registrar of class to factory.
Definition: sorption.hh:125
Simple sorption model without dual porosity.
Definition: sorption.hh:52
Record type proxy class.
Definition: type_record.hh:182
ReactionTerm FactoryBaseType
Definition: sorption.hh:55