Flow123d  JS_before_hm-883-gc471082
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  */
44 public:
45 
46  class EqData : public FieldSet
47  {
48  public:
49  EqData();
50 
51  void initialize(Mesh &mesh);
52 
53  Field<3, FieldValue<3>::Scalar> alpha; ///< Biot coefficient.
54  Field<3, FieldValue<3>::Scalar> density; ///< Density of fluid.
55  Field<3, FieldValue<3>::Scalar> gravity; ///< Standard gravity.
57 
58  /// Potential -alpha*pressure whose gradient is passed to mechanics as additional load.
61 
62  /// FieldFE for pressure_potential field.
63  std::shared_ptr<FieldFE<3, FieldValue<3>::Scalar> > potential_ptr_;
64  std::shared_ptr<FieldFE<3, FieldValue<3>::Scalar> > beta_ptr_;
65  std::shared_ptr<FieldFE<3, FieldValue<3>::Scalar> > flow_source_ptr_;
66  std::shared_ptr<FieldFE<3, FieldValue<3>::Scalar> > old_pressure_ptr_;
67  std::shared_ptr<FieldFE<3, FieldValue<3>::Scalar> > old_iter_pressure_ptr_;
68  std::shared_ptr<FieldFE<3, FieldValue<3>::Scalar> > div_u_ptr_;
69  std::shared_ptr<FieldFE<3, FieldValue<3>::Scalar> > old_div_u_ptr_;
70  };
71 
72  /// Define input record.
73  static const Input::Type::Record & get_input_type();
74 
75  HM_Iterative(Mesh &mesh, Input::Record in_record);
76  void initialize() override;
77  void zero_time_step() override;
78  void update_solution() override;
79  double last_t() override;
80  ~HM_Iterative();
81 
82 private:
83 
84  void update_potential();
85 
86  void update_flow_fields();
87 
88  void compute_iteration_error(double &difference, double &norm);
89 
90  static const int registrar;
91 
92  /// steady or unsteady water flow simulator based on MH scheme
93  std::shared_ptr<RichardsLMH> flow_;
94 
95  /// solute transport with chemistry through operator splitting
96  std::shared_ptr<Elasticity> mechanics_;
97 
99 
100  /// Tuning parameter for iterative splitting.
101  double beta_;
102 
103  /// Minimal number of iterations to perform.
104  unsigned int min_it_;
105 
106  /// Maximal number of iterations.
107  unsigned int max_it_;
108 
109  /// Absolute tolerance for difference between two succeeding iterations.
110  double a_tol_;
111 
112  /// Relative tolerance for difference between two succeeding iterations.
113  double r_tol_;
114 
115 };
116 
117 #endif /* HC_EXPLICIT_SEQUENTIAL_HH_ */
Abstract base class for equation clasess.
Common abstract parent of all Field<...> classes.
Definition: field_common.hh:75
Container for various descendants of FieldCommonBase.
Definition: field_set.hh:74
unsigned int max_it_
Maximal number of iterations.
std::shared_ptr< FieldFE< 3, FieldValue< 3 >::Scalar > > old_div_u_ptr_
Definition: hm_iterative.hh:69
Class for solution of fully coupled flow and mechanics using fixed-stress iterative splitting...
Definition: hm_iterative.hh:43
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:90
void update_potential()
Class template representing a field with values dependent on: point, element, and region...
Definition: field.hh:92
void initialize(Mesh &mesh)
Definition: hm_iterative.cc:97
Definition: mesh.h:78
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:63
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:32
std::shared_ptr< FieldFE< 3, FieldValue< 3 >::Scalar > > old_pressure_ptr_
Definition: hm_iterative.hh:66
FEM for linear elasticity.
std::shared_ptr< FieldFE< 3, FieldValue< 3 >::Scalar > > div_u_ptr_
Definition: hm_iterative.hh:68
void update_solution() override
Mesh & mesh()
Definition: equation.hh:179
Field< 3, FieldValue< 3 >::Scalar > pressure_potential
Potential -alpha*pressure whose gradient is passed to mechanics as additional load.
Definition: hm_iterative.hh:59
std::shared_ptr< FieldFE< 3, FieldValue< 3 >::Scalar > > flow_source_ptr_
Definition: hm_iterative.hh:65
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:53
std::shared_ptr< Elasticity > mechanics_
solute transport with chemistry through operator splitting
Definition: hm_iterative.hh:96
Field< 3, FieldValue< 3 >::Scalar > gravity
Standard gravity.
Definition: hm_iterative.hh:55
Field< 3, FieldValue< 3 >::Scalar > flow_source
Definition: hm_iterative.hh:60
Field< 3, FieldValue< 3 >::Scalar > beta
Definition: hm_iterative.hh:56
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:93
void compute_iteration_error(double &difference, double &norm)
double last_t() override
Return last time of TimeGovernor.
std::shared_ptr< FieldFE< 3, FieldValue< 3 >::Scalar > > old_iter_pressure_ptr_
Definition: hm_iterative.hh:67
Field< 3, FieldValue< 3 >::Scalar > density
Density of fluid.
Definition: hm_iterative.hh:54
std::shared_ptr< FieldFE< 3, FieldValue< 3 >::Scalar > > beta_ptr_
Definition: hm_iterative.hh:64