Flow123d  JS_before_hm-1828-g90ad75301
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 
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
SorptionDual::SorptionDual
SorptionDual(Mesh &init_mesh, Input::Record in_rec, const string &output_conc_name, const string &output_conc_desc)
Constructor.
Definition: sorption.cc:76
SorptionImmob::SorptionImmob
SorptionImmob(Mesh &init_mesh, Input::Record in_rec)
Constructor.
Definition: sorption.cc:153
SorptionSimple::compute_common_ele_data
void compute_common_ele_data(const ElementAccessor< 3 > &elem) override
Computes CommonElementData.
Definition: sorption.cc:61
SorptionDual::immob_porosity_
Field< 3, FieldValue< 3 >::Scalar > immob_porosity_
Definition: sorption.hh:99
SorptionMob::SorptionMob
SorptionMob(Mesh &init_mesh, Input::Record in_rec)
Constructor.
Definition: sorption.cc:113
SorptionSimple::registrar
static const int registrar
Registrar of class to factory.
Definition: sorption.hh:71
SorptionMob::~SorptionMob
~SorptionMob(void)
Destructor.
Definition: sorption.cc:118
SorptionImmob::~SorptionImmob
~SorptionImmob(void)
Destructor.
Definition: sorption.cc:157
Input
Abstract linear system class.
Definition: balance.hh:40
SorptionSimple::~SorptionSimple
~SorptionSimple(void)
Destructor.
Definition: sorption.cc:58
ElementAccessor
Definition: dh_cell_accessor.hh:32
SorptionImmob::compute_common_ele_data
void compute_common_ele_data(const ElementAccessor< 3 > &elem) override
Computes CommonElementData.
Definition: sorption.cc:160
sorption_base.hh
Class SorptionBase is abstract class representing model of sorption in transport.
type_base.hh
SorptionMob::FactoryBaseType
ReactionTerm FactoryBaseType
Definition: sorption.hh:109
SorptionBase
Definition: sorption_base.hh:59
SorptionImmob
Sorption model in immobile zone in case dual porosity is considered.
Definition: sorption.hh:132
SorptionDual::set_porosity_immobile
void set_porosity_immobile(Field< 3, FieldValue< 3 >::Scalar > &por_imm)
Sets the immobile porosity field.
Definition: sorption.hh:90
SorptionMob
Sorption model in mobile zone in case dual porosity is considered.
Definition: sorption.hh:106
SorptionImmob::get_input_type
static const Input::Type::Record & get_input_type()
Definition: sorption.cc:138
Input::Record
Accessor to the data with type Type::Record.
Definition: accessors.hh:291
type_generic.hh
field_values.hh
SorptionMob::compute_common_ele_data
void compute_common_ele_data(const ElementAccessor< 3 > &elem) override
Computes CommonElementData.
Definition: sorption.cc:121
SorptionDual::~SorptionDual
~SorptionDual(void)
Destructor.
Definition: sorption.cc:89
SorptionSimple
Simple sorption model without dual porosity.
Definition: sorption.hh:52
SorptionImmob::FactoryBaseType
ReactionTerm FactoryBaseType
Definition: sorption.hh:135
SorptionMob::get_input_type
static const Input::Type::Record & get_input_type()
Definition: sorption.cc:96
Input::Type::Record
Record type proxy class.
Definition: type_record.hh:182
Mesh
Definition: mesh.h:98
SorptionMob::registrar
static const int registrar
Registrar of class to factory.
Definition: sorption.hh:125
SorptionDual::compute_common_ele_data
virtual void compute_common_ele_data(const ElementAccessor< 3 > &elem)=0
Computes CommonElementData. Pure virtual.
Isotherm
Definition: isotherm.hh:158
SorptionSimple::get_input_type
static const Input::Type::Record & get_input_type()
Definition: sorption.cc:36
Field
Class template representing a field with values dependent on: point, element, and region.
Definition: field.hh:95
reaction_term.hh
Class ReactionTerm is an abstract class representing reaction term in transport.
SorptionSimple::FactoryBaseType
ReactionTerm FactoryBaseType
Definition: sorption.hh:55
ReactionTerm
Definition: reaction_term.hh:45
SorptionDual
Abstract class of sorption model in case dual porosity is considered.
Definition: sorption.hh:78
SorptionSimple::SorptionSimple
SorptionSimple(Mesh &init_mesh, Input::Record in_rec)
Constructor.
Definition: sorption.cc:47
Field::copy_from
void copy_from(const FieldCommon &other) override
Definition: field.impl.hh:378
field.hh
FieldValue
Definition: field_values.hh:645
SorptionImmob::registrar
static const int registrar
Registrar of class to factory.
Definition: sorption.hh:151