Flow123d  JS_before_hm-2115-gf629a871a
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:
82  public:
83  EqFields(const string &output_field_name, const string &output_field_desc);
84 
85  Field<3, FieldValue<3>::Scalar > immob_porosity_; //< Immobile porosity field copied from transport
86  };
87 
88  /// Constructor.
89  SorptionDual(Mesh &init_mesh, Input::Record in_rec,
90  const string &output_conc_name,
91  const string &output_conc_desc);
92 
93  /// Destructor.
94  ~SorptionDual(void);
95 
96  /// Sets the immobile porosity field.
98  {
99  eq_fields_dual_->immob_porosity_.copy_from(por_imm);
100  }
101 
102 protected:
103  /// Computes @p CommonElementData. Pure virtual.
104  virtual void compute_common_ele_data(const ElementAccessor<3> &elem) = 0;
105 
106  std::shared_ptr<EqFields> eq_fields_dual_; ///< Overwrites SorptionBase::eq_fields_.
107 };
108 
109 
110 /** @brief Sorption model in mobile zone in case dual porosity is considered.
111  *
112  */
114 {
115 public:
117 
118  static const Input::Type::Record & get_input_type();
119 
120  /// Constructor.
121  SorptionMob(Mesh &init_mesh, Input::Record in_rec);
122 
123  /// Destructor.
124  ~SorptionMob(void);
125 
126 protected:
127  /// Computes @p CommonElementData.
128  void compute_common_ele_data(const ElementAccessor<3> &elem) override;
129 
130 private:
131  /// Registrar of class to factory
132  static const int registrar;
133 };
134 
135 
136 /** @brief Sorption model in immobile zone in case dual porosity is considered.
137  *
138  */
140 {
141 public:
143 
144  static const Input::Type::Record & get_input_type();
145 
146  /// Constructor.
147  SorptionImmob(Mesh &init_mesh, Input::Record in_rec);
148 
149  /// Destructor.
150  ~SorptionImmob(void);
151 
152 protected:
153  /// Computes @p CommonElementData.
154  void compute_common_ele_data(const ElementAccessor<3> &elem) override;
155 
156 private:
157  /// Registrar of class to factory
158  static const int registrar;
159 };
160 
161 
162 #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:86
SorptionImmob::SorptionImmob
SorptionImmob(Mesh &init_mesh, Input::Record in_rec)
Constructor.
Definition: sorption.cc:161
SorptionSimple::compute_common_ele_data
void compute_common_ele_data(const ElementAccessor< 3 > &elem) override
Computes CommonElementData.
Definition: sorption.cc:62
SorptionMob::SorptionMob
SorptionMob(Mesh &init_mesh, Input::Record in_rec)
Constructor.
Definition: sorption.cc:121
SorptionSimple::registrar
static const int registrar
Registrar of class to factory.
Definition: sorption.hh:71
SorptionMob::~SorptionMob
~SorptionMob(void)
Destructor.
Definition: sorption.cc:126
SorptionImmob::~SorptionImmob
~SorptionImmob(void)
Destructor.
Definition: sorption.cc:165
ReactionTerm::EqFields::EqFields
EqFields()
Constructor.
Definition: reaction_term.hh:69
Input
Abstract linear system class.
Definition: balance.hh:40
SorptionSimple::~SorptionSimple
~SorptionSimple(void)
Destructor.
Definition: sorption.cc:59
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:168
sorption_base.hh
Class SorptionBase is abstract class representing model of sorption in transport.
type_base.hh
SorptionMob::FactoryBaseType
ReactionTerm FactoryBaseType
Definition: sorption.hh:116
SorptionBase::EqFields
Definition: sorption_base.hh:79
SorptionBase
Definition: sorption_base.hh:59
SorptionImmob
Sorption model in immobile zone in case dual porosity is considered.
Definition: sorption.hh:139
SorptionDual::set_porosity_immobile
void set_porosity_immobile(Field< 3, FieldValue< 3 >::Scalar > &por_imm)
Sets the immobile porosity field.
Definition: sorption.hh:97
SorptionMob
Sorption model in mobile zone in case dual porosity is considered.
Definition: sorption.hh:113
SorptionImmob::get_input_type
static const Input::Type::Record & get_input_type()
Definition: sorption.cc:146
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:129
SorptionDual::~SorptionDual
~SorptionDual(void)
Destructor.
Definition: sorption.cc:97
SorptionSimple
Simple sorption model without dual porosity.
Definition: sorption.hh:52
SorptionImmob::FactoryBaseType
ReactionTerm FactoryBaseType
Definition: sorption.hh:142
SorptionMob::get_input_type
static const Input::Type::Record & get_input_type()
Definition: sorption.cc:104
Input::Type::Record
Record type proxy class.
Definition: type_record.hh:182
Mesh
Definition: mesh.h:355
SorptionMob::registrar
static const int registrar
Registrar of class to factory.
Definition: sorption.hh:132
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
SorptionDual::EqFields
Definition: sorption.hh:81
SorptionDual::eq_fields_dual_
std::shared_ptr< EqFields > eq_fields_dual_
Overwrites SorptionBase::eq_fields_.
Definition: sorption.hh:106
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:93
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:46
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.hh
SorptionDual::EqFields::immob_porosity_
Field< 3, FieldValue< 3 >::Scalar > immob_porosity_
Definition: sorption.hh:85
FieldValue
Definition: field_values.hh:645
SorptionImmob::registrar
static const int registrar
Registrar of class to factory.
Definition: sorption.hh:158