Flow123d  JS_before_hm-62-ge56f9d5
hm_iterative.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 hm_iterative.hh
15  * @brief
16  * @author Jan Stebel
17  */
18 
19 #ifndef HM_ITERATIVE_HH_
20 #define HM_ITERATIVE_HH_
21 
22 #include <memory>
23 #include <string>
24 #include <vector>
27 #include "coupling/equation.hh"
29 #include "mechanics/elasticity.hh"
30 
31 class Mesh;
32 class FieldCommon;
33 class RichardsLMH;
34 
35 
36 /**
37  * @brief Class for solution of fully coupled flow and mechanics using fixed-stress iterative splitting.
38  *
39  * Flow and mechanics are solved separately and within each iteration the coupling terms are updated.
40  * Here we use the fixed-stress splitting [see Mikelic&Wheeler, Comput. Geosci. 17(3), 2013] which uses
41  * a tuning parameter "beta" to speed up the convergence.
42  *
43  * TODO: The class is currently inherited from DarcyFlowInterface in order to provide MH_DofHandler for
44  * transport processes. This should be changed as soon as we replace MH_DofHandler by fields for velocity
45  * and pressure.
46  */
48 public:
49 
50  class EqData : public FieldSet
51  {
52  public:
53  EqData();
54 
55  void initialize(Mesh &mesh);
56 
57  Field<3, FieldValue<3>::Scalar> alpha; ///< Biot coefficient.
58  Field<3, FieldValue<3>::Scalar> density; ///< Density of fluid.
59  Field<3, FieldValue<3>::Scalar> gravity; ///< Standard gravity.
61 
62  /// Potential -alpha*pressure whose gradient is passed to mechanics as additional load.
65 
66  /// FieldFE for pressure_potential field.
67  std::shared_ptr<FieldFE<3, FieldValue<3>::Scalar> > potential_ptr_;
68  std::shared_ptr<FieldFE<3, FieldValue<3>::Scalar> > beta_ptr_;
69  std::shared_ptr<FieldFE<3, FieldValue<3>::Scalar> > flow_source_ptr_;
70  std::shared_ptr<FieldFE<3, FieldValue<3>::Scalar> > old_pressure_ptr_;
71  std::shared_ptr<FieldFE<3, FieldValue<3>::Scalar> > old_iter_pressure_ptr_;
72  std::shared_ptr<FieldFE<3, FieldValue<3>::Scalar> > div_u_ptr_;
73  std::shared_ptr<FieldFE<3, FieldValue<3>::Scalar> > old_div_u_ptr_;
74  };
75 
76  /// Define input record.
77  static const Input::Type::Record & get_input_type();
78 
79  HM_Iterative(Mesh &mesh, Input::Record in_record);
80  void initialize() override;
81  void zero_time_step() override;
82  void update_solution() override;
83  const MH_DofHandler & get_mh_dofhandler() override;
84  ~HM_Iterative();
85 
86 private:
87 
88  void update_potential();
89 
90  void update_flow_fields();
91 
92  void compute_iteration_error(double &difference, double &norm);
93 
94  static const int registrar;
95 
96  /// steady or unsteady water flow simulator based on MH scheme
97  std::shared_ptr<RichardsLMH> flow_;
98 
99  /// solute transport with chemistry through operator splitting
100  std::shared_ptr<Elasticity> mechanics_;
101 
103 
104  /// Tuning parameter for iterative splitting.
105  double beta_;
106 
107  /// Minimal number of iterations to perform.
108  unsigned int min_it_;
109 
110  /// Maximal number of iterations.
111  unsigned int max_it_;
112 
113  /// Absolute tolerance for difference between two succeeding iterations.
114  double a_tol_;
115 
116  /// Relative tolerance for difference between two succeeding iterations.
117  double r_tol_;
118 
119 };
120 
121 #endif /* HC_EXPLICIT_SEQUENTIAL_HH_ */
Abstract base class for equation clasess.
Common abstract parent of all Field<...> classes.
Definition: field_common.hh:73
Container for various descendants of FieldCommonBase.
Definition: field_set.hh:71
unsigned int max_it_
Maximal number of iterations.
std::shared_ptr< FieldFE< 3, FieldValue< 3 >::Scalar > > old_div_u_ptr_
Definition: hm_iterative.hh:73
Class for solution of fully coupled flow and mechanics using fixed-stress iterative splitting...
Definition: hm_iterative.hh:47
double beta_
Tuning parameter for iterative splitting.
double r_tol_
Relative tolerance for difference between two succeeding iterations.
static const int registrar
Definition: hm_iterative.hh:94
void update_potential()
Class template representing a field with values dependent on: point, element, and region...
Definition: field.hh:83
void initialize(Mesh &mesh)
const MH_DofHandler & get_mh_dofhandler() override
Definition: mesh.h:76
void update_flow_fields()
void zero_time_step() override
std::shared_ptr< FieldFE< 3, FieldValue< 3 >::Scalar > > potential_ptr_
FieldFE for pressure_potential field.
Definition: hm_iterative.hh:67
double a_tol_
Absolute tolerance for difference between two succeeding iterations.
static const Input::Type::Record & get_input_type()
Define input record.
Definition: hm_iterative.cc:96
std::shared_ptr< FieldFE< 3, FieldValue< 3 >::Scalar > > old_pressure_ptr_
Definition: hm_iterative.hh:70
FEM for linear elasticity.
std::shared_ptr< FieldFE< 3, FieldValue< 3 >::Scalar > > div_u_ptr_
Definition: hm_iterative.hh:72
void update_solution() override
Mesh & mesh()
Definition: equation.hh:176
Field< 3, FieldValue< 3 >::Scalar > pressure_potential
Potential -alpha*pressure whose gradient is passed to mechanics as additional load.
Definition: hm_iterative.hh:63
std::shared_ptr< FieldFE< 3, FieldValue< 3 >::Scalar > > flow_source_ptr_
Definition: hm_iterative.hh:69
Edge lumped mixed-hybrid solution of unsteady Darcy flow.
Definition: richards_lmh.hh:62
Accessor to the data with type Type::Record.
Definition: accessors.hh:292
Field< 3, FieldValue< 3 >::Scalar > alpha
Biot coefficient.
Definition: hm_iterative.hh:57
std::shared_ptr< Elasticity > mechanics_
solute transport with chemistry through operator splitting
Field< 3, FieldValue< 3 >::Scalar > gravity
Standard gravity.
Definition: hm_iterative.hh:59
Field< 3, FieldValue< 3 >::Scalar > flow_source
Definition: hm_iterative.hh:64
Field< 3, FieldValue< 3 >::Scalar > beta
Definition: hm_iterative.hh:60
unsigned int min_it_
Minimal number of iterations to perform.
HM_Iterative(Mesh &mesh, Input::Record in_record)
Record type proxy class.
Definition: type_record.hh:182
std::shared_ptr< RichardsLMH > flow_
steady or unsteady water flow simulator based on MH scheme
Definition: hm_iterative.hh:97
void compute_iteration_error(double &difference, double &norm)
std::shared_ptr< FieldFE< 3, FieldValue< 3 >::Scalar > > old_iter_pressure_ptr_
Definition: hm_iterative.hh:71
Field< 3, FieldValue< 3 >::Scalar > density
Density of fluid.
Definition: hm_iterative.hh:58
std::shared_ptr< FieldFE< 3, FieldValue< 3 >::Scalar > > beta_ptr_
Definition: hm_iterative.hh:68