Flow123d  JS_before_hm-2198-g122e1f2e2
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  /// Implements @p SorptionBase::init_field_models
67  void init_field_models() 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  std::shared_ptr<EqFields> eq_fields_dual_; ///< Overwrites SorptionBase::eq_fields_.
104 };
105 
106 
107 /** @brief Sorption model in mobile zone in case dual porosity is considered.
108  *
109  */
111 {
112 public:
114 
115  static const Input::Type::Record & get_input_type();
116 
117  /// Constructor.
118  SorptionMob(Mesh &init_mesh, Input::Record in_rec);
119 
120  /// Destructor.
121  ~SorptionMob(void);
122 
123 protected:
124  /// Implements @p SorptionBase::init_field_models
125  void init_field_models() override;
126 
127 private:
128  /// Registrar of class to factory
129  static const int registrar;
130 };
131 
132 
133 /** @brief Sorption model in immobile zone in case dual porosity is considered.
134  *
135  */
137 {
138 public:
140 
141  static const Input::Type::Record & get_input_type();
142 
143  /// Constructor.
144  SorptionImmob(Mesh &init_mesh, Input::Record in_rec);
145 
146  /// Destructor.
147  ~SorptionImmob(void);
148 
149 protected:
150  /// Implements @p SorptionBase::init_field_models
151  void init_field_models() override;
152 
153 private:
154  /// Registrar of class to factory
155  static const int registrar;
156 };
157 
158 
159 #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:105
SorptionImmob::SorptionImmob
SorptionImmob(Mesh &init_mesh, Input::Record in_rec)
Constructor.
Definition: sorption.cc:220
SorptionMob::SorptionMob
SorptionMob(Mesh &init_mesh, Input::Record in_rec)
Constructor.
Definition: sorption.cc:161
SorptionSimple::registrar
static const int registrar
Registrar of class to factory.
Definition: sorption.hh:71
SorptionSimple::init_field_models
void init_field_models() override
Implements SorptionBase::init_field_models.
Definition: sorption.cc:83
SorptionMob::~SorptionMob
~SorptionMob(void)
Destructor.
Definition: sorption.cc:166
SorptionImmob::~SorptionImmob
~SorptionImmob(void)
Destructor.
Definition: sorption.cc:224
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:80
SorptionImmob::init_field_models
void init_field_models() override
Implements SorptionBase::init_field_models.
Definition: sorption.cc:227
ElementAccessor
Definition: dh_cell_accessor.hh:32
sorption_base.hh
Class SorptionBase is abstract class representing model of sorption in transport.
type_base.hh
SorptionMob::FactoryBaseType
ReactionTerm FactoryBaseType
Definition: sorption.hh:113
SorptionBase::EqFields
Definition: sorption_base.hh:82
SorptionBase
Definition: sorption_base.hh:62
SorptionImmob
Sorption model in immobile zone in case dual porosity is considered.
Definition: sorption.hh:136
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:110
SorptionImmob::get_input_type
static const Input::Type::Record & get_input_type()
Definition: sorption.cc:205
Input::Record
Accessor to the data with type Type::Record.
Definition: accessors.hh:291
SorptionMob::init_field_models
void init_field_models() override
Implements SorptionBase::init_field_models.
Definition: sorption.cc:169
type_generic.hh
field_values.hh
SorptionDual::~SorptionDual
~SorptionDual(void)
Destructor.
Definition: sorption.cc:116
SorptionSimple
Simple sorption model without dual porosity.
Definition: sorption.hh:52
SorptionImmob::FactoryBaseType
ReactionTerm FactoryBaseType
Definition: sorption.hh:139
SorptionMob::get_input_type
static const Input::Type::Record & get_input_type()
Definition: sorption.cc:144
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:129
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:103
SorptionSimple::get_input_type
static const Input::Type::Record & get_input_type()
Definition: sorption.cc:57
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:68
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:155