Flow123d  JS_before_hm-1804-gf2ad740aa
heat_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 heat_model.hh
15  * @brief Discontinuous Galerkin method for equation of transport with dispersion.
16  * @author Jan Stebel
17  */
18 
19 #ifndef HEAT_MODEL_HH_
20 #define HEAT_MODEL_HH_
21 
22 
23 #include <memory> // for shared_ptr
24 #include <string> // for string
25 #include <vector> // for vector
26 #include <armadillo>
29 #include "transport/substance.hh"
30 #include "fields/field_values.hh" // for FieldValue<>::Scalar
31 #include "fields/bc_field.hh"
32 #include "fields/bc_multi_field.hh"
33 #include "fields/field.hh"
34 #include "fields/multi_field.hh"
35 #include "fields/field_set.hh"
36 #include "input/type_base.hh" // for Array
37 #include "input/type_generic.hh" // for Instance
38 #include "input/type_record.hh" // for Record
39 #include "input/type_selection.hh" // for Selection
40 
41 class Mesh;
42 class OutputTime;
43 namespace Input { class Record; }
44 template <int spacedim> class ElementAccessor;
45 
46 
47 // class HeatProcessBase : public EquationBase
48 // {
49 // public:
50 // typedef HeatProcessBase FactoryBaseType;
51 
52 
53 // HeatProcessBase(Mesh &mesh, const Input::Record in_rec)
54 // : EquationBase(mesh, in_rec)
55 // {};
56 
57 // /**
58 // * This method takes sequential PETSc vector of side velocities and update
59 // * transport matrix. The ordering is same as ordering of sides in the mesh.
60 // * We just keep the pointer, but do not destroy the object.
61 // *
62 // * TODO: We should pass whole velocity field object (description of base functions and dof numbering) and vector.
63 // */
64 // virtual void set_velocity_changed() = 0;
65 
66 // /// Common specification of the input record for secondary equations.
67 // static Input::Type::Abstract & get_input_type() {
68 // return Input::Type::Abstract("Heat",
69 // "Equation for heat transfer.")
70 // .close();
71 // }
72 // };
73 
74 /*
75 class HeatNothing : public HeatProcessBase {
76 public:
77  inline HeatNothing(Mesh &mesh_in)
78  : HeatProcessBase(mesh_in, Input::Record() )
79 
80  {
81  // make module solved for ever
82  time_=new TimeGovernor();
83  time_->next_time();
84  };
85 
86  inline virtual ~HeatNothing()
87  {}
88 
89  inline void set_velocity_changed() override {};
90 
91  inline virtual void output_data() override {};
92 
93 };
94 */
95 
97 public:
98 
99  class ModelEqFields : public FieldSet {
100  public:
101 
102  /// Type of boundary condition (see also BC_Type)
104  /// Dirichlet boundary condition for temperature.
106  /// Flux value in total/diffusive flux b.c.
108  /// Transition coefficient in total/diffusive flux b.c.
110  /// Initial temperature.
112  /// Porosity of solid.
114  /// Water content passed from Darcy flow model
116  /// Flow flux, can be result of water flow model.
118  /// Density of fluid.
120  /// Heat capacity of fluid.
122  /// Heat conductivity of fluid.
124  /// Density of solid.
126  /// Heat capacity of solid.
128  /// Heat conductivity of solid.
130  /// Longitudal heat dispersivity.
132  /// Transversal heat dispersivity.
134  /// Thermal source in fluid.
136  /// Thermal source in solid.
138  /// Heat exchange rate in fluid.
140  /// Heat exchange rate in solid.
142  /// Reference temperature in fluid.
144  /// Reference temperature in solid.
146 
147  /// Pointer to DarcyFlow field cross_section
149 
150 
152 
153 
154  /// @name Instances of FieldModel used in assembly methods
155  // @{
156 
157  /// Velocity norm field.
159  /// Field represents coefficients of mass matrix.
161  /// Field represents retardation coefficients due to sorption.
163  /// Concentration sources - density output
165  /// Concentration sources - sigma output
167  /// Concentration sources - concentration output
169  /// Advection coefficients.
171  /// Diffusion coefficients.
173 
174  // @}
175 
181  };
182 
183  ModelEqFields();
184 
186 
187  /**
188  * Initialize FieldModel instances.
189  */
190  void initialize();
191 
192  };
193 
194 
195  class ModelEqData {
196  public:
197 
199  substances_.initialize({""});
200  }
201 
202  static constexpr const char * name() { return "Heat_AdvectionDiffusion"; }
203 
204  static string default_output_field() { return "\"temperature\""; }
205 
207 
208  /// Returns number of transported substances.
209  inline unsigned int n_substances()
210  { return 1; }
211 
212  /// Returns reference to the vector of substance indices.
214  { return subst_idx_; }
215 
216  /// Returns reference to the vector of substance names.
218  { return substances_; }
219 
220 
221  /// @name Data of substances
222  // @{
223 
224  /// Transported substances.
226 
227  /// List of indices used to call balance methods for a set of quantities.
229 
230  // @}
231  };
232 
234 
235 
236  HeatTransferModel(Mesh &mesh, const Input::Record in_rec);
237 
238  void init_from_input(const Input::Record &) override {};
239 
240  ~HeatTransferModel() override;
241 
242  /// Derived class should implement getter for ModelEqFields instance.
243  virtual ModelEqFields &eq_fields() = 0;
244 
245  /// Derived class should implement getter for ModelEqData instance.
246  virtual ModelEqData &eq_data() = 0;
247 
248 protected:
249 
250  /**
251  * Create input type that can be passed to the derived class.
252  * @param implementation String characterizing the numerical method, e.g. DG, FEM, FVM.
253  * @param description Comment used to describe the record key.
254  * @return
255  */
256  static IT::Record get_input_type(const string &implementation, const string &description);
257 
258  virtual void calculate_cumulative_balance() = 0;
259 
260  /**
261  * Temporary method, sets balance object after construction of EqData object.
262  */
263  void init_balance(const Input::Record &in_rec);
264 
265  std::shared_ptr<OutputTime> output_stream_;
266 };
267 
268 
269 
270 
271 
272 #endif /* HEAT_MODEL_HH_ */
bc_field.hh
HeatTransferModel::ModelEqData::ModelEqData
ModelEqData()
Definition: heat_model.hh:198
HeatTransferModel::init_balance
void init_balance(const Input::Record &in_rec)
Definition: heat_model.cc:441
HeatTransferModel::ModelEqFields::fluid_thermal_source
Field< 3, FieldValue< 3 >::Scalar > fluid_thermal_source
Thermal source in fluid.
Definition: heat_model.hh:135
HeatTransferModel::ModelEqFields::mass_matrix_coef
Field< 3, FieldValue< 3 >::Scalar > mass_matrix_coef
Field represents coefficients of mass matrix.
Definition: heat_model.hh:160
HeatTransferModel::ModelEqFields::cross_section
Field< 3, FieldValue< 3 >::Scalar > cross_section
Pointer to DarcyFlow field cross_section.
Definition: heat_model.hh:148
HeatTransferModel::ModelEqFields::solid_density
Field< 3, FieldValue< 3 >::Scalar > solid_density
Density of solid.
Definition: heat_model.hh:125
Input
Abstract linear system class.
Definition: balance.hh:40
SubstanceList
Definition: substance.hh:70
HeatTransferModel::ModelEqFields::v_norm
Field< 3, FieldValue< 3 >::Scalar > v_norm
Velocity norm field.
Definition: heat_model.hh:158
HeatTransferModel::calculate_cumulative_balance
virtual void calculate_cumulative_balance()=0
HeatTransferModel::ModelEqFields::bc_diffusive_flux
@ bc_diffusive_flux
Definition: heat_model.hh:180
advection_process_base.hh
HeatTransferModel::ModelEqFields::bc_total_flux
@ bc_total_flux
Definition: heat_model.hh:179
field_set.hh
substance.hh
Classes for storing substance data.
HeatTransferModel::ModelEqFields::disp_t
Field< 3, FieldValue< 3 >::Scalar > disp_t
Transversal heat dispersivity.
Definition: heat_model.hh:133
HeatTransferModel::eq_fields
virtual ModelEqFields & eq_fields()=0
Derived class should implement getter for ModelEqFields instance.
AdvectionDiffusionModel
Definition: advection_diffusion_model.hh:33
std::vector< unsigned int >
HeatTransferModel::ModelEqData::n_substances
unsigned int n_substances()
Returns number of transported substances.
Definition: heat_model.hh:209
ElementAccessor
Definition: dh_cell_accessor.hh:32
HeatTransferModel::ModelEqFields::flow_flux
Field< 3, FieldValue< 3 >::VectorFixed > flow_flux
Flow flux, can be result of water flow model.
Definition: heat_model.hh:117
HeatTransferModel
Definition: heat_model.hh:96
HeatTransferModel::init_from_input
void init_from_input(const Input::Record &) override
Read necessary data from input record.
Definition: heat_model.hh:238
advection_diffusion_model.hh
Discontinuous Galerkin method for equation of transport with dispersion.
HeatTransferModel::ModelEqFields
Definition: heat_model.hh:99
type_base.hh
type_selection.hh
HeatTransferModel::ModelEqFields::sources_density_out
MultiField< 3, FieldValue< 3 >::Scalar > sources_density_out
Concentration sources - density output.
Definition: heat_model.hh:164
SubstanceList::initialize
void initialize(const Input::Array &in_array)
Read from input array.
Definition: substance.cc:58
type_record.hh
HeatTransferModel::ModelEqFields::bc_robin_sigma
BCMultiField< 3, FieldValue< 3 >::Scalar > bc_robin_sigma
Transition coefficient in total/diffusive flux b.c.
Definition: heat_model.hh:109
EquationBase::mesh
Mesh & mesh()
Definition: equation.hh:177
HeatTransferModel::ModelEqFields::bc_inflow
@ bc_inflow
Definition: heat_model.hh:177
Input::Record
Accessor to the data with type Type::Record.
Definition: accessors.hh:291
AdvectionProcessBase
Definition: advection_process_base.hh:19
type_generic.hh
HeatTransferModel::ModelEqData::substances_
SubstanceList substances_
Transported substances.
Definition: heat_model.hh:225
HeatTransferModel::ModelEqFields::solid_heat_conductivity
Field< 3, FieldValue< 3 >::Scalar > solid_heat_conductivity
Heat conductivity of solid.
Definition: heat_model.hh:129
HeatTransferModel::ModelEqFields::bc_flux
BCMultiField< 3, FieldValue< 3 >::Scalar > bc_flux
Flux value in total/diffusive flux b.c.
Definition: heat_model.hh:107
HeatTransferModel::ModelEqFields::diffusion_coef
MultiField< 3, FieldValue< 3 >::TensorFixed > diffusion_coef
Diffusion coefficients.
Definition: heat_model.hh:172
HeatTransferModel::ModelEqFields::output_field
MultiField< 3, FieldValue< 3 >::Scalar > output_field
Definition: heat_model.hh:151
bc_multi_field.hh
HeatTransferModel::ModelEqFields::fluid_heat_exchange_rate
Field< 3, FieldValue< 3 >::Scalar > fluid_heat_exchange_rate
Heat exchange rate in fluid.
Definition: heat_model.hh:139
HeatTransferModel::ModelEqFields::disp_l
Field< 3, FieldValue< 3 >::Scalar > disp_l
Longitudal heat dispersivity.
Definition: heat_model.hh:131
field_values.hh
OutputTime
The class for outputting data during time.
Definition: output_time.hh:51
HeatTransferModel::ModelEqFields::water_content
Field< 3, FieldValue< 3 >::Scalar > water_content
Water content passed from Darcy flow model.
Definition: heat_model.hh:115
HeatTransferModel::ModelEqFields::advection_coef
MultiField< 3, FieldValue< 3 >::VectorFixed > advection_coef
Advection coefficients.
Definition: heat_model.hh:170
AdvectionProcessBase::get_input_type
static Input::Type::Abstract & get_input_type()
Common specification of the input record for secondary equations.
Definition: advection_process_base.hh:27
FieldSet
Container for various descendants of FieldCommonBase.
Definition: field_set.hh:159
Input::Type::Selection
Template for classes storing finite set of named values.
Definition: type_selection.hh:65
HeatTransferModel::ModelEqFields::solid_ref_temperature
Field< 3, FieldValue< 3 >::Scalar > solid_ref_temperature
Reference temperature in solid.
Definition: heat_model.hh:145
HeatTransferModel::ModelEqData
Definition: heat_model.hh:195
HeatTransferModel::ModelEqFields::initialize
void initialize()
Definition: heat_model.cc:340
Input::Type::Record
Record type proxy class.
Definition: type_record.hh:182
HeatTransferModel::ModelEqData::name
static constexpr const char * name()
Definition: heat_model.hh:202
HeatTransferModel::ModelEqFields::Heat_bc_types
Heat_bc_types
Definition: heat_model.hh:176
BCMultiField
Definition: bc_multi_field.hh:29
Mesh
Definition: mesh.h:98
HeatTransferModel::ModelEqFields::sources_conc_out
MultiField< 3, FieldValue< 3 >::Scalar > sources_conc_out
Concentration sources - concentration output.
Definition: heat_model.hh:168
HeatTransferModel::eq_data
virtual ModelEqData & eq_data()=0
Derived class should implement getter for ModelEqData instance.
multi_field.hh
HeatTransferModel::ModelEqFields::fluid_heat_capacity
Field< 3, FieldValue< 3 >::Scalar > fluid_heat_capacity
Heat capacity of fluid.
Definition: heat_model.hh:121
HeatTransferModel::ModelEqFields::fluid_ref_temperature
Field< 3, FieldValue< 3 >::Scalar > fluid_ref_temperature
Reference temperature in fluid.
Definition: heat_model.hh:143
HeatTransferModel::ModelEqFields::fluid_density
Field< 3, FieldValue< 3 >::Scalar > fluid_density
Density of fluid.
Definition: heat_model.hh:119
HeatTransferModel::ModelEqData::subst_idx_
vector< unsigned int > subst_idx_
List of indices used to call balance methods for a set of quantities.
Definition: heat_model.hh:228
HeatTransferModel::ModelEqFields::bc_dirichlet
@ bc_dirichlet
Definition: heat_model.hh:178
MultiField
Class for representation of a vector of fields of the same physical quantity.
Definition: multi_field.hh:87
HeatTransferModel::ModelEqData::get_output_selection
static IT::Selection get_output_selection()
Definition: heat_model.cc:405
HeatTransferModel::ModelEqFields::solid_heat_exchange_rate
Field< 3, FieldValue< 3 >::Scalar > solid_heat_exchange_rate
Heat exchange rate in solid.
Definition: heat_model.hh:141
HeatTransferModel::ModelEqFields::bc_dirichlet_value
BCMultiField< 3, FieldValue< 3 >::Scalar > bc_dirichlet_value
Dirichlet boundary condition for temperature.
Definition: heat_model.hh:105
HeatTransferModel::ModelEqData::default_output_field
static string default_output_field()
Definition: heat_model.hh:204
HeatTransferModel::ModelEqFields::fluid_heat_conductivity
Field< 3, FieldValue< 3 >::Scalar > fluid_heat_conductivity
Heat conductivity of fluid.
Definition: heat_model.hh:123
HeatTransferModel::ModelEqFields::retardation_coef
MultiField< 3, FieldValue< 3 >::Scalar > retardation_coef
Field represents retardation coefficients due to sorption.
Definition: heat_model.hh:162
HeatTransferModel::ModelEqData::subst_idx
const vector< unsigned int > & subst_idx()
Returns reference to the vector of substance indices.
Definition: heat_model.hh:213
HeatTransferModel::ModelEqData::substances
SubstanceList & substances()
Returns reference to the vector of substance names.
Definition: heat_model.hh:217
HeatTransferModel::FactoryBaseType
AdvectionProcessBase FactoryBaseType
Definition: heat_model.hh:233
Field
Class template representing a field with values dependent on: point, element, and region.
Definition: field.hh:95
HeatTransferModel::ModelEqFields::sources_sigma_out
MultiField< 3, FieldValue< 3 >::Scalar > sources_sigma_out
Concentration sources - sigma output.
Definition: heat_model.hh:166
HeatTransferModel::ModelEqFields::porosity
Field< 3, FieldValue< 3 >::Scalar > porosity
Porosity of solid.
Definition: heat_model.hh:113
HeatTransferModel::ModelEqFields::bc_type
BCMultiField< 3, FieldValue< 3 >::Enum > bc_type
Type of boundary condition (see also BC_Type)
Definition: heat_model.hh:103
HeatTransferModel::ModelEqFields::ModelEqFields
ModelEqFields()
Definition: heat_model.cc:134
HeatTransferModel::ModelEqFields::solid_thermal_source
Field< 3, FieldValue< 3 >::Scalar > solid_thermal_source
Thermal source in solid.
Definition: heat_model.hh:137
HeatTransferModel::~HeatTransferModel
~HeatTransferModel() override
Definition: heat_model.cc:451
HeatTransferModel::output_stream_
std::shared_ptr< OutputTime > output_stream_
Definition: heat_model.hh:265
HeatTransferModel::ModelEqFields::init_condition
MultiField< 3, FieldValue< 3 >::Scalar > init_condition
Initial temperature.
Definition: heat_model.hh:111
field.hh
HeatTransferModel::HeatTransferModel
HeatTransferModel(Mesh &mesh, const Input::Record in_rec)
Definition: heat_model.cc:430
HeatTransferModel::ModelEqFields::get_bc_type_selection
static const Input::Type::Selection & get_bc_type_selection()
Definition: heat_model.cc:379
HeatTransferModel::ModelEqFields::solid_heat_capacity
Field< 3, FieldValue< 3 >::Scalar > solid_heat_capacity
Heat capacity of solid.
Definition: heat_model.hh:127