Flow123d  JB_transport-112d700
conc_dispersion_model.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 concentration_model.hh
15  * @brief Discontinuous Galerkin method for equation of transport with dispersion.
16  * @author Jan Stebel
17  */
18 
19 #ifndef CONC_DISP_MODEL_HH_
20 #define CONC_DISP_MODEL_HH_
21 
22 
23 #include <memory> // for shared_ptr
24 #include <string> // for string
25 #include <vector> // for vector
26 #include <armadillo>
28 #include "fields/field_values.hh" // for FieldValue<>::S...
29 #include "fields/bc_multi_field.hh"
30 #include "fields/field.hh"
31 #include "fields/multi_field.hh"
32 
33 #include "input/accessors.hh" // for ExcAccessorForNullStorage
34 #include "input/accessors_impl.hh" // for Record::val
35 #include "input/type_base.hh" // for Array
36 #include "input/type_generic.hh" // for Instance
37 #include "input/type_record.hh" // for Record
38 #include "input/type_selection.hh" // for Selection
39 #include "transport/substance.hh" // for SubstanceList
40 #include "transport/transport_operator_splitting.hh" // for ConcentrationTr...
41 
42 class Balance;
43 class Mesh;
44 class OutputTime;
45 namespace Input { class Record; }
46 template <int spacedim> class ElementAccessor;
47 
48 
49 
50 
52 public:
53 
55  public:
56 
57  /// Type of boundary condition (see also BC_Type)
59  /// Prescribed concentration for Dirichlet/reference concentration for flux b.c.
61  /// Flux value in total/diffusive flux b.c.
63  /// Transition coefficient in total/diffusive flux b.c.
65  /// Initial concentrations.
67 
68  /// Components of the full dispersion tensor
75  /// Longitudal dispersivity (for each substance).
76 
77  //MultiField<3, FieldValue<3>::Scalar> disp_l;
78  /// Transversal dispersivity (for each substance).
79  //MultiField<3, FieldValue<3>::Scalar> disp_t;
80  /// Molecular diffusivity (for each substance).
81  //MultiField<3, FieldValue<3>::Tensor> diff_m;
82 
83  Field<3, FieldValue<3>::Scalar > rock_density; ///< Rock matrix density.
84  MultiField<3, FieldValue<3>::Scalar > sorption_coefficient; ///< Coefficient of linear sorption.
85 
86 
88 
89 
90  /// @name Instances of FieldModel used in assembly methods
91  // @{
92 
93  /// Field represents coefficients of mass matrix.
95  /// Field represents retardation coefficients due to sorption.
97  /// Concentration sources - density output
99  /// Concentration sources - sigma output
101  /// Concentration sources - concentration output
103  /// Advection coefficients.
105  /// Diffusion coefficients.
107  /// Velocity norm field.
109 
110  // @}
111 
117  };
118 
119  ModelEqFields();
120 
122 
123  /**
124  * Initialize FieldModel instances.
125  */
126  void initialize(Input::Record transport_rec);
127 
128  };
129 
130  class ModelEqData {
131  public:
132 
134 
135  static constexpr const char * name() { return "Solute_ConcDispersion"; }
136 
137  static string default_output_field() { return "\"conc\""; }
138 
140 
141  /// Returns number of transported substances.
142  inline unsigned int n_substances()
143  { return substances_.size(); }
144 
145  /// Returns reference to the vector of substance indices.
147  { return subst_idx_; }
148 
149  /// Returns reference to the vector of substance names.
151  { return substances_; }
152 
153 
154  /// @name Data of substances
155  // @{
156 
157  /// Transported substances.
159 
160  /// List of indices used to call balance methods for a set of quantities.
162 
163 
164  // @}
165  };
166 
167 
169 
170 
171  ConcDispersionModel(Mesh &mesh, const Input::Record &in_rec);
172 
173  void init_from_input(const Input::Record &in_rec) override;
174 
175 
176  ~ConcDispersionModel() override;
177 
178  /// Returns number of transported substances.
179  inline unsigned int n_substances() override
180  { return eq_data().n_substances(); }
181 
182  /// Returns reference to the vector of substance names.
183  inline SubstanceList &substances() override
184  { return eq_data().substances(); }
185 
186 
187  // Methods inherited from ConcentrationTransportBase:
188 
189  // Must be implemented in descendants.
190  void set_target_time(double) override {};
191 
192  void set_balance_object(std::shared_ptr<Balance> balance) override;
193 
195  { return eq_data().subst_idx(); }
196 
197  void set_output_stream(std::shared_ptr<OutputTime> stream)
198  { output_stream_ = stream; }
199 
200 
201  /// Derived class should implement getter for ModelEqFields instance.
202  virtual ModelEqFields &eq_fields() = 0;
203 
204  /// Derived class should implement getter for ModelEqData instance.
205  virtual ModelEqData &eq_data() = 0;
206 
207 protected:
208 
209  /**
210  * Create input type that can be passed to the derived class.
211  * @param implementation String characterizing the numerical method, e.g. DG, FEM, FVM.
212  * @param description Comment used to describe the record key.
213  * @return
214  */
215  static IT::Record get_input_type(const string &implementation, const string &description);
216 
217  /**
218  * Empty temporary method (must be implemented for continuity with HeatTransferModel)
219  */
220  void init_balance(const Input::Record &in_rec);
221 
222  /// Density of liquid (a global constant).
224 
225  std::shared_ptr<OutputTime> output_stream_;
226 };
227 
228 
229 
230 
231 
232 
233 
234 
235 #endif /* CONC_DISP_MODEL_HH_ */
ConcDispersionModel::ModelEqData::n_substances
unsigned int n_substances()
Returns number of transported substances.
Definition: conc_dispersion_model.hh:142
ConcDispersionModel::ModelEqData::substances
SubstanceList & substances()
Returns reference to the vector of substance names.
Definition: conc_dispersion_model.hh:150
ConcDispersionModel::get_subst_idx
const vector< unsigned int > & get_subst_idx() override
Return substance indices used in balance.
Definition: conc_dispersion_model.hh:194
ConcDispersionModel::solvent_density_
double solvent_density_
Density of liquid (a global constant).
Definition: conc_dispersion_model.hh:223
ConcDispersionModel::ModelEqFields
Definition: conc_dispersion_model.hh:54
ConcDispersionModel::ModelEqFields::ModelEqFields
ModelEqFields()
Definition: conc_dispersion_model.cc:135
ConcDispersionModel::ModelEqFields::retardation_coef
MultiField< 3, FieldValue< 3 >::Scalar > retardation_coef
Field represents retardation coefficients due to sorption.
Definition: conc_dispersion_model.hh:96
ConcDispersionModel::ModelEqData::subst_idx_
vector< unsigned int > subst_idx_
List of indices used to call balance methods for a set of quantities.
Definition: conc_dispersion_model.hh:161
ConcDispersionModel::ModelEqFields::output_field
MultiField< 3, FieldValue< 3 >::Scalar > output_field
Definition: conc_dispersion_model.hh:87
ConcDispersionModel::ModelEqFields::sources_conc_out
MultiField< 3, FieldValue< 3 >::Scalar > sources_conc_out
Concentration sources - concentration output.
Definition: conc_dispersion_model.hh:102
ConcDispersionModel::eq_data
virtual ModelEqData & eq_data()=0
Derived class should implement getter for ModelEqData instance.
Input
Abstract linear system class.
Definition: balance.hh:40
SubstanceList::size
unsigned int size() const
Definition: substance.hh:87
SubstanceList
Definition: substance.hh:70
Balance
Definition: balance.hh:119
ConcDispersionModel::ModelEqData::name
static constexpr const char * name()
Definition: conc_dispersion_model.hh:135
ConcDispersionModel::set_target_time
void set_target_time(double) override
Definition: conc_dispersion_model.hh:190
ConcDispersionModel::output_stream_
std::shared_ptr< OutputTime > output_stream_
Definition: conc_dispersion_model.hh:225
ConcDispersionModel::ModelEqData::default_output_field
static string default_output_field()
Definition: conc_dispersion_model.hh:137
ConcDispersionModel::init_balance
void init_balance(const Input::Record &in_rec)
Definition: conc_dispersion_model.cc:387
substance.hh
Classes for storing substance data.
AdvectionDiffusionModel
Definition: advection_diffusion_model.hh:33
ConcDispersionModel::ModelEqFields::rock_density
Field< 3, FieldValue< 3 >::Scalar > rock_density
Longitudal dispersivity (for each substance).
Definition: conc_dispersion_model.hh:83
std::vector< unsigned int >
ElementAccessor
Definition: dh_cell_accessor.hh:32
ConcDispersionModel::ModelEqFields::sorption_coefficient
MultiField< 3, FieldValue< 3 >::Scalar > sorption_coefficient
Coefficient of linear sorption.
Definition: conc_dispersion_model.hh:84
ConcDispersionModel::init_from_input
void init_from_input(const Input::Record &in_rec) override
Read necessary data from input record.
Definition: conc_dispersion_model.cc:370
advection_diffusion_model.hh
Discontinuous Galerkin method for equation of transport with dispersion.
ConcDispersionModel::ModelEqFields::disp_uxy
Field< 3, FieldValue< 3 >::Tensor > disp_uxy
Definition: conc_dispersion_model.hh:74
type_base.hh
type_selection.hh
ConcDispersionModel::ConcDispersionModel
ConcDispersionModel(Mesh &mesh, const Input::Record &in_rec)
Definition: conc_dispersion_model.cc:365
ConcDispersionModel::ModelEqFields::bc_diffusive_flux
@ bc_diffusive_flux
Definition: conc_dispersion_model.hh:116
ConcDispersionModel::ModelEqData::get_output_selection
static IT::Selection get_output_selection()
Definition: conc_dispersion_model.cc:342
type_record.hh
ConcDispersionModel::n_substances
unsigned int n_substances() override
Returns number of transported substances.
Definition: conc_dispersion_model.hh:179
ConcDispersionModel::set_output_stream
void set_output_stream(std::shared_ptr< OutputTime > stream)
Setter for output stream.
Definition: conc_dispersion_model.hh:197
EquationBase::mesh
Mesh & mesh()
Definition: equation.hh:181
EquationBase::balance
std::shared_ptr< Balance > balance() const
Definition: equation.hh:189
ConcDispersionModel::FactoryBaseType
ConcentrationTransportBase FactoryBaseType
Definition: conc_dispersion_model.hh:168
ConcDispersionModel::ModelEqFields::get_bc_type_selection
static const Input::Type::Selection & get_bc_type_selection()
Definition: conc_dispersion_model.cc:314
ConcDispersionModel::ModelEqFields::initialize
void initialize(Input::Record transport_rec)
Definition: conc_dispersion_model.cc:271
Input::Record
Accessor to the data with type Type::Record.
Definition: accessors.hh:291
ConcDispersionModel::ModelEqFields::disp_uyz
Field< 3, FieldValue< 3 >::Tensor > disp_uyz
Definition: conc_dispersion_model.hh:72
type_generic.hh
ConcDispersionModel::ModelEqData
Definition: conc_dispersion_model.hh:130
accessors.hh
ConcDispersionModel::ModelEqFields::bc_dirichlet
@ bc_dirichlet
Definition: conc_dispersion_model.hh:114
ConcDispersionModel::ModelEqFields::bc_total_flux
@ bc_total_flux
Definition: conc_dispersion_model.hh:115
bc_multi_field.hh
ConcDispersionModel::~ConcDispersionModel
~ConcDispersionModel() override
Definition: conc_dispersion_model.cc:376
field_values.hh
OutputTime
The class for outputting data during time.
Definition: output_time.hh:51
ConcDispersionModel::set_balance_object
void set_balance_object(std::shared_ptr< Balance > balance) override
Definition: conc_dispersion_model.cc:380
ConcDispersionModel::ModelEqFields::disp_uyy
Field< 3, FieldValue< 3 >::Tensor > disp_uyy
Definition: conc_dispersion_model.hh:70
Input::Type::Selection
Template for classes storing finite set of named values.
Definition: type_selection.hh:65
ConcDispersionModel::ModelEqData::ModelEqData
ModelEqData()
Definition: conc_dispersion_model.hh:133
ConcDispersionModel
Definition: conc_dispersion_model.hh:51
Input::Type::Record
Record type proxy class.
Definition: type_record.hh:182
ConcDispersionModel::ModelEqFields::sources_sigma_out
MultiField< 3, FieldValue< 3 >::Scalar > sources_sigma_out
Concentration sources - sigma output.
Definition: conc_dispersion_model.hh:100
ConcDispersionModel::ModelEqFields::sources_density_out
MultiField< 3, FieldValue< 3 >::Scalar > sources_density_out
Concentration sources - density output.
Definition: conc_dispersion_model.hh:98
ConcDispersionModel::ModelEqFields::mass_matrix_coef
Field< 3, FieldValue< 3 >::Scalar > mass_matrix_coef
Field represents coefficients of mass matrix.
Definition: conc_dispersion_model.hh:94
ConcDispersionModel::ModelEqFields::Concentration_bc_types
Concentration_bc_types
Definition: conc_dispersion_model.hh:112
BCMultiField
Definition: bc_multi_field.hh:29
ConcentrationTransportBase
Definition: transport_operator_splitting.hh:61
Mesh
Definition: mesh.h:362
ConcDispersionModel::ModelEqData::substances_
SubstanceList substances_
Transported substances.
Definition: conc_dispersion_model.hh:158
ConcDispersionModel::ModelEqFields::disp_uxx
Field< 3, FieldValue< 3 >::Tensor > disp_uxx
Components of the full dispersion tensor.
Definition: conc_dispersion_model.hh:69
ConcDispersionModel::eq_fields
virtual ModelEqFields & eq_fields()=0
Derived class should implement getter for ModelEqFields instance.
multi_field.hh
accessors_impl.hh
ConcDispersionModel::ModelEqFields::disp_uxz
Field< 3, FieldValue< 3 >::Tensor > disp_uxz
Definition: conc_dispersion_model.hh:73
MultiField
Class for representation of a vector of fields of the same physical quantity.
Definition: multi_field.hh:87
ConcDispersionModel::ModelEqFields::diffusion_coef
MultiField< 3, FieldValue< 3 >::Tensor > diffusion_coef
Diffusion coefficients.
Definition: conc_dispersion_model.hh:106
ConcDispersionModel::ModelEqFields::advection_coef
MultiField< 3, FieldValue< 3 >::Vector > advection_coef
Advection coefficients.
Definition: conc_dispersion_model.hh:104
ConcentrationTransportBase::get_input_type
static Input::Type::Abstract & get_input_type()
Common specification of the input record for secondary equations.
Definition: transport_operator_splitting.cc:62
ConcDispersionModel::ModelEqFields::disp_uzz
Field< 3, FieldValue< 3 >::Tensor > disp_uzz
Definition: conc_dispersion_model.hh:71
ConcDispersionModel::ModelEqFields::v_norm
Field< 3, FieldValue< 3 >::Scalar > v_norm
Velocity norm field.
Definition: conc_dispersion_model.hh:108
ConcDispersionModel::ModelEqData::subst_idx
const vector< unsigned int > & subst_idx()
Returns reference to the vector of substance indices.
Definition: conc_dispersion_model.hh:146
ConcDispersionModel::ModelEqFields::bc_flux
BCMultiField< 3, FieldValue< 3 >::Scalar > bc_flux
Flux value in total/diffusive flux b.c.
Definition: conc_dispersion_model.hh:62
Field
Class template representing a field with values dependent on: point, element, and region.
Definition: field.hh:92
TransportEqFields
Definition: transport_operator_splitting.hh:137
ConcDispersionModel::ModelEqFields::bc_type
BCMultiField< 3, FieldValue< 3 >::Enum > bc_type
Type of boundary condition (see also BC_Type)
Definition: conc_dispersion_model.hh:58
transport_operator_splitting.hh
ConcDispersionModel::ModelEqFields::init_condition
MultiField< 3, FieldValue< 3 >::Scalar > init_condition
Initial concentrations.
Definition: conc_dispersion_model.hh:66
ConcDispersionModel::ModelEqFields::bc_dirichlet_value
BCMultiField< 3, FieldValue< 3 >::Scalar > bc_dirichlet_value
Prescribed concentration for Dirichlet/reference concentration for flux b.c.
Definition: conc_dispersion_model.hh:60
ConcDispersionModel::substances
SubstanceList & substances() override
Returns reference to the vector of substance names.
Definition: conc_dispersion_model.hh:183
field.hh
ConcDispersionModel::ModelEqFields::bc_inflow
@ bc_inflow
Definition: conc_dispersion_model.hh:113
ConcDispersionModel::ModelEqFields::bc_robin_sigma
BCMultiField< 3, FieldValue< 3 >::Scalar > bc_robin_sigma
Transition coefficient in total/diffusive flux b.c.
Definition: conc_dispersion_model.hh:64