opm-simulators
BlackoilModelParameters.hpp
1 /*
2  Copyright 2015 SINTEF ICT, Applied Mathematics.
3 
4  This file is part of the Open Porous Media project (OPM).
5 
6  OPM is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  OPM is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with OPM. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef OPM_BLACKOILMODELPARAMETERS_HEADER_INCLUDED
21 #define OPM_BLACKOILMODELPARAMETERS_HEADER_INCLUDED
22 
23 #include <opm/simulators/flow/SubDomain.hpp>
24 
25 #include <string>
26 
27 namespace Opm::Parameters {
28 
29 template<class Scalar>
30 struct DbhpMaxRel { static constexpr Scalar value = 1.0; };
31 
32 template<class Scalar>
33 struct DwellFractionMax { static constexpr Scalar value = 0.2; };
34 
35 struct EclDeckFileName { static constexpr auto value = ""; };
36 
37 template<class Scalar>
38 struct InjMultOscThreshold { static constexpr Scalar value = 0.1; };
39 
40 template<class Scalar>
41 struct InjMultDampMult { static constexpr Scalar value = 0.9; };
42 
43 template<class Scalar>
44 struct InjMultMinDampFactor { static constexpr Scalar value = 0.05; };
45 
46 template<class Scalar>
47 struct MaxResidualAllowed { static constexpr Scalar value = 1e7; };
48 
49 template<class Scalar>
50 struct RelaxedMaxPvFraction { static constexpr Scalar value = 0.03; };
51 
52 template<class Scalar>
53 struct ToleranceMb { static constexpr Scalar value = 1e-7; };
54 
55 template<class Scalar>
56 struct ToleranceMbRelaxed { static constexpr Scalar value = 1e-6; };
57 
58 //TODO change to a simpler number with fewer digits
59 //converting J -> RM3 (entalpy / (cp * deltaK * rho) assuming change of 1e-5K of water
60 template<class Scalar>
61 struct ToleranceEnergyBalance { static constexpr Scalar value = 1e-7*41.82; };
62 
63 template<class Scalar>
64 struct ToleranceEnergyBalanceRelaxed { static constexpr Scalar value = 1e-6*41.82; };
65 
66 template<class Scalar>
67 struct ToleranceCnv { static constexpr Scalar value = 1e-2; };
68 
69 template<class Scalar>
70 struct ToleranceCnvRelaxed { static constexpr Scalar value = 1.0; };
71 
72 template<class Scalar>
73 struct ToleranceCnvEnergy { static constexpr Scalar value = 1e-2*41.82; };
74 
75 template<class Scalar>
76 struct ToleranceCnvEnergyRelaxed { static constexpr Scalar value = 1.0*41.82; };
77 
78 template<class Scalar>
79 struct ToleranceMaxDp { static constexpr Scalar value = 0.0; };
80 
81 template<class Scalar>
82 struct ToleranceMaxDs { static constexpr Scalar value = 0.0; };
83 
84 template<class Scalar>
85 struct ToleranceMaxDrs { static constexpr Scalar value = 0.0; };
86 
87 template<class Scalar>
88 struct ToleranceMaxDrv { static constexpr Scalar value = 0.0; };
89 
90 template<class Scalar>
91 struct ToleranceWells { static constexpr Scalar value = 1e-4; };
92 
93 template<class Scalar>
94 struct ToleranceWellControl { static constexpr Scalar value = 1e-7; };
95 
96 struct MaxWelleqIter { static constexpr int value = 30; };
97 
98 template<class Scalar>
99 struct MaxSinglePrecisionDays { static constexpr Scalar value = 20.0; };
100 
101 struct MinStrictCnvIter { static constexpr int value = -1; };
102 struct MinStrictMbIter { static constexpr int value = -1; };
103 struct SolveWelleqInitially { static constexpr bool value = true; };
104 struct PreSolveNetwork { static constexpr bool value = true; };
105 struct UpdateEquationsScaling { static constexpr bool value = false; };
106 struct UseUpdateStabilization { static constexpr bool value = true; };
107 struct MatrixAddWellContributions { static constexpr bool value = false; };
108 
109 struct UseMultisegmentWell { static constexpr bool value = true; };
110 
111 template<class Scalar>
112 struct TolerancePressureMsWells { static constexpr Scalar value = 0.01*1e5; };
113 
114 template<class Scalar>
115 struct MaxPressureChangeMsWells { static constexpr Scalar value = 10*1e5; };
116 
117 struct MaxNewtonIterationsWithInnerWellIterations { static constexpr int value = 99; };
118 struct MaxInnerIterMsWells { static constexpr int value = 100; };
119 struct MaxInnerIterWells { static constexpr int value = 50; };
120 struct MaxWellStatusSwitchInInnerIterWells { static constexpr int value = 99; };
121 struct MaxWellStatusSwitchForWells { static constexpr int value = 99; };
122 struct ShutUnsolvableWells { static constexpr bool value = true; };
123 struct AlternativeWellRateInit { static constexpr bool value = true; };
124 struct StrictOuterIterWells { static constexpr int value = 6; };
125 struct StrictInnerIterWells { static constexpr int value = 40; };
126 
127 template<class Scalar>
128 struct RegularizationFactorWells { static constexpr Scalar value = 100.0; };
129 
130 struct EnableWellOperabilityCheck { static constexpr bool value = true; };
131 struct EnableWellOperabilityCheckIter { static constexpr bool value = false; };
132 struct DebugEmitCellPartition { static constexpr bool value = false; };
133 
134 template<class Scalar>
135 struct RelaxedWellFlowTol { static constexpr Scalar value = 1e-3; };
136 
137 template<class Scalar>
138 struct RelaxedPressureTolMsw { static constexpr Scalar value = 1e4; };
139 
140 struct MaximumNumberOfWellSwitches { static constexpr int value = 3; };
141 struct MaximumNumberOfGroupSwitches { static constexpr int value = 3; };
142 struct UseAverageDensityMsWells { static constexpr bool value = false; };
143 struct LocalWellSolveControlSwitching { static constexpr bool value = true; };
144 struct UseImplicitIpr { static constexpr bool value = true; };
145 struct CheckGroupConstraintsInnerWellIterations { static constexpr bool value = true; };
146 
147 // Network solver parameters
148 struct NetworkMaxStrictOuterIterations { static constexpr int value = 10; };
149 struct NetworkMaxOuterIterations { static constexpr int value = 3; };
150 struct NetworkMaxSubIterations { static constexpr int value = 100; };
151 template<class Scalar>
152 struct NetworkPressureUpdateDampingFactor { static constexpr Scalar value = 0.1; };
153 template<class Scalar>
154 struct NetworkMaxPressureUpdateInBars { static constexpr Scalar value = 5.0; };
155 struct NonlinearSolver { static constexpr auto value = "newton"; };
156 struct LocalSolveApproach { static constexpr auto value = "gauss-seidel"; };
157 struct MaxLocalSolveIterations { static constexpr int value = 20; };
158 struct NewtonMinIterations { static constexpr int value = 2; };
159 
160 struct WellGroupConstraintsMaxIterations { static constexpr int value = 1; };
161 template<class Scalar>
162 struct LocalToleranceScalingMb { static constexpr Scalar value = 1.0; };
163 
164 template<class Scalar>
165 struct LocalToleranceScalingCnv { static constexpr Scalar value = 0.1; };
166 struct NlddNumInitialNewtonIter { static constexpr int value = 1; };
167 template<class Scalar>
168 struct NlddRelativeMobilityChangeTol { static constexpr Scalar value = 0.1; };
169 struct NumLocalDomains { static constexpr int value = 0; };
170 
171 template<class Scalar>
172 struct LocalDomainsPartitioningImbalance { static constexpr Scalar value = 1.03; };
173 
174 struct LocalDomainsPartitioningMethod { static constexpr auto value = "zoltan"; };
175 struct LocalDomainsPartitionWellNeighborLevels { static constexpr int value = 1; };
176 struct LocalDomainsOrderingMeasure { static constexpr auto value = "maxpressure"; };
177 
178 struct ConvergenceMonitoring { static constexpr bool value = false; };
179 struct ConvergenceMonitoringCutOff { static constexpr int value = 6; };
180 template<class Scalar>
181 struct ConvergenceMonitoringDecayFactor { static constexpr Scalar value = 0.75; };
182 
183 
184 template<class Scalar>
185 struct NupcolGroupRateTolerance { static constexpr Scalar value = 0.001; };
186 
187 } // namespace Opm::Parameters
188 
189 namespace Opm {
190 
192 template <class Scalar>
194 {
195 public:
210  Scalar relaxed_max_pv_fraction_;
238  // TODO: it might need to distinguish between rate control and pressure control later
244 
247 
250 
253 
256 
259 
262 
265 
268 
271 
274 
278 
281 
284 
287 
290 
293 
296 
303 
305  std::string deck_file_name_;
306 
309 
314 
317 
320 
323 
326 
329 
332 
335 
338 
341 
344 
347 
350 
353 
356 
358  std::string nonlinear_solver_;
359 
361  DomainSolveApproach local_solve_approach_{DomainSolveApproach::Jacobi};
362 
365 
368 
369  int max_local_solve_iterations_;
370 
371  Scalar local_tolerance_scaling_mb_;
372  Scalar local_tolerance_scaling_cnv_;
373 
374  int nldd_num_initial_newton_iter_{1};
377  int num_local_domains_{0};
378  Scalar local_domains_partition_imbalance_{1.03};
379  std::string local_domains_partition_method_;
380  int local_domains_partition_well_neighbor_levels_{1};
381  DomainOrderingMeasure local_domains_ordering_{DomainOrderingMeasure::MaxPressure};
382 
383  bool write_partitions_{false};
384 
387  {
389  bool enabled_;
391  int cutoff_;
394  };
395 
397 
398  // Relative tolerance of group rates (VREP, REIN)
399  // If violated the nupcol wellstate is updated
400  Scalar nupcol_group_rate_tolerance_;
401 
404 
405  static void registerParameters();
406 };
407 
408 } // namespace Opm
409 
410 #endif // OPM_BLACKOILMODELPARAMETERS_HEADER_INCLUDED
bool local_well_solver_control_switching_
Whether to allow control switching during local well solutions.
Definition: BlackoilModelParameters.hpp:325
Scalar regularization_factor_wells_
Regularization factor for wells.
Definition: BlackoilModelParameters.hpp:261
int min_strict_cnv_iter_
Minimum number of Newton iterations before we can use relaxed CNV convergence criterion.
Definition: BlackoilModelParameters.hpp:280
Scalar maxSinglePrecisionTimeStep_
Tolerance for time step in seconds where single precision can be used for solving for the Jacobian...
Definition: BlackoilModelParameters.hpp:277
Definition: BlackoilModelParameters.hpp:115
int well_group_constraints_max_iterations_
Maximum number of iterations in the well/group switch algorithm.
Definition: BlackoilModelParameters.hpp:349
int strict_inner_iter_wells_
Strict inner iteration number for wells.
Definition: BlackoilModelParameters.hpp:255
Definition: BlackoilModelParameters.hpp:172
Scalar inj_mult_min_damp_factor_
Minimum damping factor for injectivity multipliers.
Definition: BlackoilModelParameters.hpp:205
Definition: BlackoilModelParameters.hpp:157
bool matrix_add_well_contributions_
Whether to add influences of wells between cells to the matrix and preconditioner matrix...
Definition: BlackoilModelParameters.hpp:308
Definition: BlackoilModelParameters.hpp:99
Scalar tolerance_well_control_
Tolerance for the well control equations.
Definition: BlackoilModelParameters.hpp:239
int max_well_status_switch_
Maximum number of status switches (open<->stop> during a time step.
Definition: BlackoilModelParameters.hpp:355
Scalar network_max_pressure_update_in_bars_
Maximum pressure update in the inner network pressure update iterations.
Definition: BlackoilModelParameters.hpp:346
Definition: BlackoilModelParameters.hpp:47
bool enabled_
Whether to enable convergence monitoring.
Definition: BlackoilModelParameters.hpp:389
Definition: BlackoilModelParameters.hpp:156
int max_well_status_switch_inner_iter_
Maximum number of status switches (open<->stop> in local well iterations.
Definition: BlackoilModelParameters.hpp:352
int max_number_of_group_switches_
Maximum number of times group can switch to the same control.
Definition: BlackoilModelParameters.hpp:319
Definition: BlackoilModelParameters.hpp:125
bool pre_solve_network_
Pre solve and iterate network model.
Definition: BlackoilModelParameters.hpp:289
Definition: BlackoilModelParameters.hpp:30
Definition: BlackoilModelParameters.hpp:131
Definition: BlackoilModelParameters.hpp:103
DomainSolveApproach local_solve_approach_
&#39;jacobi&#39; and &#39;gauss-seidel&#39; supported
Definition: BlackoilModelParameters.hpp:361
Scalar tolerance_energy_balance_relaxed_
Relaxed energy balance tolerance (can be used when iter >= min_strict_mb_iter_).
Definition: BlackoilModelParameters.hpp:218
Definition: BlackoilModelParameters.hpp:112
Definition: BlackoilModelParameters.hpp:94
Definition: BlackoilModelParameters.hpp:118
Definition: BlackoilModelParameters.hpp:178
std::string deck_file_name_
The file name of the deck.
Definition: BlackoilModelParameters.hpp:305
Definition: BlackoilModelParameters.hpp:106
Definition: BlackoilModelParameters.hpp:73
ConvergenceMonitorParams monitor_params_
Convergence monitoring parameters.
Definition: BlackoilModelParameters.hpp:396
int strict_outer_iter_wells_
Newton iteration where wells are stricly convergent.
Definition: BlackoilModelParameters.hpp:258
Definition: BlackoilModelParameters.hpp:35
Definition: BlackoilModelParameters.hpp:79
Definition: BlackoilModelParameters.hpp:128
Definition: BlackoilModelParameters.hpp:44
Scalar network_pressure_update_damping_factor_
Damping factor in the inner network pressure update iterations.
Definition: BlackoilModelParameters.hpp:343
Definition: BlackoilModelParameters.hpp:67
bool check_well_operability_
Whether to check well operability.
Definition: BlackoilModelParameters.hpp:311
bool use_update_stabilization_
Try to detect oscillation or stagnation.
Definition: BlackoilModelParameters.hpp:295
DomainSolveApproach
Solver approach for NLDD.
Definition: SubDomain.hpp:33
Scalar tolerance_max_dp_
Max pressure change during a Newton iteration (TUNINGDP item = TRGDDP)
Definition: BlackoilModelParameters.hpp:228
Scalar tolerance_max_drs_
Max RS change during a Newton iteration (TUNINGDP item = TRGDDRS)
Definition: BlackoilModelParameters.hpp:232
Definition: BlackoilModelParameters.hpp:122
int network_max_strict_outer_iterations_
Maximum number of iterations in the network solver before relaxing tolerance.
Definition: BlackoilModelParameters.hpp:334
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: blackoilbioeffectsmodules.hh:45
Definition: BlackoilModelParameters.hpp:82
bool use_average_density_ms_wells_
Whether to approximate segment densities by averaging over segment and its outlet.
Definition: BlackoilModelParameters.hpp:322
Definition: BlackoilModelParameters.hpp:50
bool update_equations_scaling_
Update scaling factors for mass balance equations.
Definition: BlackoilModelParameters.hpp:292
Definition: BlackoilModelParameters.hpp:101
Definition: BlackoilModelParameters.hpp:105
Solver parameters for the BlackoilModel.
Definition: BlackoilModelParameters.hpp:193
Definition: blackoilnewtonmethodparams.hpp:31
bool check_well_operability_iter_
Whether to check well operability during iterations.
Definition: BlackoilModelParameters.hpp:313
Scalar nldd_relative_mobility_change_tol_
Threshold for single cell relative mobility change in NLDD.
Definition: BlackoilModelParameters.hpp:376
Definition: BlackoilModelParameters.hpp:158
Definition: BlackoilModelParameters.hpp:64
Definition: BlackoilModelParameters.hpp:109
BlackoilModelParameters()
Construct from user parameters or defaults.
Definition: BlackoilModelParameters.cpp:35
Definition: BlackoilModelParameters.hpp:176
int max_inner_iter_ms_wells_
Maximum inner iteration number for ms wells.
Definition: BlackoilModelParameters.hpp:252
Scalar inj_mult_damp_mult_
Injectivity multiplier dampening multiplier.
Definition: BlackoilModelParameters.hpp:203
DomainOrderingMeasure
Measure to use for domain ordering.
Definition: SubDomain.hpp:39
Scalar tolerance_energy_balance_
Relative energy balance tolerance (total energy balance error).
Definition: BlackoilModelParameters.hpp:216
Definition: BlackoilModelParameters.hpp:41
bool check_group_constraints_inner_well_iterations_
Whether to allow checking/changing to group controls during inner well iterations.
Definition: BlackoilModelParameters.hpp:331
bool use_implicit_ipr_
Whether to use implicit IPR for thp stability checks and solution search.
Definition: BlackoilModelParameters.hpp:328
Scalar tolerance_cnv_relaxed_
Relaxed local convergence tolerance (can be used when iter >= min_strict_cnv_iter_ && cnvViolatedPV <...
Definition: BlackoilModelParameters.hpp:222
Definition: BlackoilModelParameters.hpp:149
Definition: BlackoilModelParameters.hpp:56
Definition: BlackoilModelParameters.hpp:155
Definition: BlackoilModelParameters.hpp:154
Definition: BlackoilModelParameters.hpp:140
int cutoff_
Cut-off limit for convergence monitoring.
Definition: BlackoilModelParameters.hpp:391
Definition: BlackoilModelParameters.hpp:132
Definition: BlackoilModelParameters.hpp:138
Definition: BlackoilModelParameters.hpp:130
Scalar tolerance_max_ds_
Max saturation change during a Newton iteration (TUNINGDP item = TRGDDS)
Definition: BlackoilModelParameters.hpp:230
Definition: BlackoilModelParameters.hpp:168
Definition: BlackoilModelParameters.hpp:181
Definition: BlackoilModelParameters.hpp:162
Definition: BlackoilModelParameters.hpp:148
Definition: BlackoilModelParameters.hpp:135
Definition: BlackoilModelParameters.hpp:38
Scalar relaxed_tolerance_flow_well_
Relaxed tolerance for for the well flow residual.
Definition: BlackoilModelParameters.hpp:243
Scalar dbhp_max_rel_
Max relative change in bhp in single iteration.
Definition: BlackoilModelParameters.hpp:197
Definition: BlackoilModelParameters.hpp:119
bool shut_unsolvable_wells_
Whether to shut unsolvable well.
Definition: BlackoilModelParameters.hpp:267
Struct holding convergence monitor params.
Definition: BlackoilModelParameters.hpp:386
Definition: BlackoilModelParameters.hpp:144
Definition: BlackoilModelParameters.hpp:104
Definition: BlackoilModelParameters.hpp:102
Scalar tolerance_cnv_energy_
Local energy convergence tolerance (max of local energy errors).
Definition: BlackoilModelParameters.hpp:224
Definition: BlackoilModelParameters.hpp:160
int max_inner_iter_wells_
Maximum inner iteration number for standard wells.
Definition: BlackoilModelParameters.hpp:270
Definition: BlackoilModelParameters.hpp:152
Scalar tolerance_cnv_energy_relaxed_
Relaxed local energy convergence tolerance (can be used when iter >= min_strict_cnv_iter_ && cnvViola...
Definition: BlackoilModelParameters.hpp:226
Scalar tolerance_wells_
Well convergence tolerance.
Definition: BlackoilModelParameters.hpp:236
Definition: BlackoilModelParameters.hpp:185
Definition: BlackoilModelParameters.hpp:88
Scalar tolerance_cnv_
Local convergence tolerance (max of local saturation errors).
Definition: BlackoilModelParameters.hpp:220
Scalar tolerance_pressure_ms_wells_
Tolerance for the pressure equations for multisegment wells.
Definition: BlackoilModelParameters.hpp:241
int newton_min_iter_
Minimum number of Newton iterations per time step.
Definition: BlackoilModelParameters.hpp:367
Definition: BlackoilModelParameters.hpp:169
int max_niter_inner_well_iter_
Maximum newton iterations with inner well iterations.
Definition: BlackoilModelParameters.hpp:264
Definition: BlackoilModelParameters.hpp:179
Scalar relaxed_tolerance_pressure_ms_well_
Relaxed tolerance for the MSW pressure solution.
Definition: BlackoilModelParameters.hpp:246
int max_number_of_well_switches_
Maximum number of times a well can switch to the same control.
Definition: BlackoilModelParameters.hpp:316
Definition: BlackoilModelParameters.hpp:174
Scalar max_residual_allowed_
Absolute max limit for residuals.
Definition: BlackoilModelParameters.hpp:207
Definition: BlackoilModelParameters.hpp:121
int newton_max_iter_
Maximum number of Newton iterations per time step.
Definition: BlackoilModelParameters.hpp:364
Definition: BlackoilModelParameters.hpp:143
Definition: BlackoilModelParameters.hpp:166
Scalar decay_factor_
Decay factor used in convergence monitoring.
Definition: BlackoilModelParameters.hpp:393
Definition: BlackoilModelParameters.hpp:96
Scalar tolerance_mb_
Relative mass balance tolerance (total mass balance error).
Definition: BlackoilModelParameters.hpp:212
Definition: BlackoilModelParameters.hpp:61
int network_max_sub_iterations_
Maximum number of sub-iterations to update network pressures (within a single well/group control upda...
Definition: BlackoilModelParameters.hpp:340
Definition: BlackoilModelParameters.hpp:33
Definition: BlackoilModelParameters.hpp:123
int network_max_outer_iterations_
Maximum number of iterations in the network solver before giving up.
Definition: BlackoilModelParameters.hpp:337
Scalar max_pressure_change_ms_wells_
Maximum pressure change over an iteratio for ms wells.
Definition: BlackoilModelParameters.hpp:249
Definition: BlackoilModelParameters.hpp:70
Definition: BlackoilModelParameters.hpp:53
Definition: BlackoilModelParameters.hpp:175
Definition: BlackoilModelParameters.hpp:120
Definition: BlackoilModelParameters.hpp:76
int min_strict_mb_iter_
Minimum number of Newton iterations before we can use relaxed MB convergence criterion.
Definition: BlackoilModelParameters.hpp:283
Definition: BlackoilModelParameters.hpp:91
Definition: BlackoilModelParameters.hpp:145
Definition: BlackoilModelParameters.hpp:117
Definition: BlackoilModelParameters.hpp:124
Definition: BlackoilModelParameters.hpp:107
bool solve_welleq_initially_
Solve well equation initially.
Definition: BlackoilModelParameters.hpp:286
Scalar inj_mult_osc_threshold_
Injectivity multiplier oscillation threshold.
Definition: BlackoilModelParameters.hpp:201
Definition: BlackoilModelParameters.hpp:85
std::string nonlinear_solver_
Nonlinear solver type: newton or nldd.
Definition: BlackoilModelParameters.hpp:358
int max_welleq_iter_
Maximum iteration number of the well equation solution.
Definition: BlackoilModelParameters.hpp:273
Definition: BlackoilModelParameters.hpp:165
Scalar tolerance_max_drv_
Max RV change during a Newton iteration (TUNINGDP item = TRGDDRV)
Definition: BlackoilModelParameters.hpp:234
bool use_multisegment_well_
Whether to use MultisegmentWell to handle multisegment wells it is something temporary before the mul...
Definition: BlackoilModelParameters.hpp:302
Scalar dwell_fraction_max_
Max absolute change in well volume fraction in single iteration.
Definition: BlackoilModelParameters.hpp:199
Definition: BlackoilModelParameters.hpp:141
Definition: BlackoilModelParameters.hpp:142
Definition: BlackoilModelParameters.hpp:150
Scalar tolerance_mb_relaxed_
Relaxed mass balance tolerance (can be used when iter >= min_strict_mb_iter_).
Definition: BlackoilModelParameters.hpp:214