opm-simulators
Loading...
Searching...
No Matches
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
27namespace Opm::Parameters {
28
29template<class Scalar>
30struct DbhpMaxRel { static constexpr Scalar value = 1.0; };
31
32template<class Scalar>
33struct DwellFractionMax { static constexpr Scalar value = 0.2; };
34
35struct EclDeckFileName { static constexpr auto value = ""; };
36
37template<class Scalar>
38struct InjMultOscThreshold { static constexpr Scalar value = 0.1; };
39
40template<class Scalar>
41struct InjMultDampMult { static constexpr Scalar value = 0.9; };
42
43template<class Scalar>
44struct InjMultMinDampFactor { static constexpr Scalar value = 0.05; };
45
46template<class Scalar>
47struct MaxResidualAllowed { static constexpr Scalar value = 1e7; };
48
49template<class Scalar>
50struct RelaxedMaxPvFraction { static constexpr Scalar value = 0.03; };
51
52template<class Scalar>
53struct ToleranceMb { static constexpr Scalar value = 1e-7; };
54
55template<class Scalar>
56struct 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
60template<class Scalar>
61struct ToleranceEnergyBalance { static constexpr Scalar value = 1e-7*41.82; };
62
63template<class Scalar>
64struct ToleranceEnergyBalanceRelaxed { static constexpr Scalar value = 1e-6*41.82; };
65
66template<class Scalar>
67struct ToleranceCnv { static constexpr Scalar value = 1e-2; };
68
69template<class Scalar>
70struct ToleranceCnvRelaxed { static constexpr Scalar value = 1.0; };
71
72template<class Scalar>
73struct ToleranceCnvEnergy { static constexpr Scalar value = 1e-2*41.82; };
74
75template<class Scalar>
76struct ToleranceCnvEnergyRelaxed { static constexpr Scalar value = 1.0*41.82; };
77
78template<class Scalar>
79struct ToleranceMaxDp { static constexpr Scalar value = 0.0; };
80
81template<class Scalar>
82struct ToleranceMaxDs { static constexpr Scalar value = 0.0; };
83
84template<class Scalar>
85struct ToleranceMaxDrs { static constexpr Scalar value = 0.0; };
86
87template<class Scalar>
88struct ToleranceMaxDrv { static constexpr Scalar value = 0.0; };
89
90template<class Scalar>
91struct ToleranceWells { static constexpr Scalar value = 1e-4; };
92
93template<class Scalar>
94struct ToleranceWellControl { static constexpr Scalar value = 1e-7; };
95
96struct MaxWelleqIter { static constexpr int value = 30; };
97
98template<class Scalar>
99struct MaxSinglePrecisionDays { static constexpr Scalar value = 20.0; };
100
101struct MinStrictCnvIter { static constexpr int value = -1; };
102struct MinStrictMbIter { static constexpr int value = -1; };
103struct SolveWelleqInitially { static constexpr bool value = true; };
104struct PreSolveNetwork { static constexpr bool value = true; };
105struct UpdateEquationsScaling { static constexpr bool value = false; };
106struct UseUpdateStabilization { static constexpr bool value = true; };
107struct MatrixAddWellContributions { static constexpr bool value = false; };
108
109struct UseMultisegmentWell { static constexpr bool value = true; };
110
111template<class Scalar>
112struct TolerancePressureMsWells { static constexpr Scalar value = 0.01*1e5; };
113
114template<class Scalar>
115struct MaxPressureChangeMsWells { static constexpr Scalar value = 10*1e5; };
116
117struct MaxNewtonIterationsWithInnerWellIterations { static constexpr int value = 99; };
118struct MaxInnerIterMsWells { static constexpr int value = 100; };
119struct MaxInnerIterWells { static constexpr int value = 50; };
120struct MaxWellStatusSwitchInInnerIterWells { static constexpr int value = 99; };
121struct MaxWellStatusSwitchForWells { static constexpr int value = 99; };
122struct ShutUnsolvableWells { static constexpr bool value = true; };
123struct AlternativeWellRateInit { static constexpr bool value = true; };
124struct StrictOuterIterWells { static constexpr int value = 6; };
125struct StrictInnerIterWells { static constexpr int value = 40; };
126
127template<class Scalar>
128struct RegularizationFactorWells { static constexpr Scalar value = 100.0; };
129
130struct EnableWellOperabilityCheck { static constexpr bool value = true; };
131struct EnableWellOperabilityCheckIter { static constexpr bool value = false; };
132struct DebugEmitCellPartition { static constexpr bool value = false; };
133
134template<class Scalar>
135struct RelaxedWellFlowTol { static constexpr Scalar value = 1e-3; };
136
137template<class Scalar>
138struct RelaxedPressureTolMsw { static constexpr Scalar value = 1e4; };
139
140struct MaximumNumberOfWellSwitches { static constexpr int value = 3; };
141struct MaximumNumberOfGroupSwitches { static constexpr int value = 3; };
142struct UseAverageDensityMsWells { static constexpr bool value = false; };
143struct LocalWellSolveControlSwitching { static constexpr bool value = true; };
144struct UseImplicitIpr { static constexpr bool value = true; };
145struct CheckGroupConstraintsInnerWellIterations { static constexpr bool value = true; };
146
147// Network solver parameters
148struct NetworkMaxStrictOuterIterations { static constexpr int value = 10; };
149struct NetworkMaxOuterIterations { static constexpr int value = 3; };
150struct NetworkMaxSubIterations { static constexpr int value = 100; };
151template<class Scalar>
152struct NetworkPressureUpdateDampingFactor { static constexpr Scalar value = 0.1; };
153template<class Scalar>
154struct NetworkMaxPressureUpdateInBars { static constexpr Scalar value = 5.0; };
155struct NonlinearSolver { static constexpr auto value = "newton"; };
156struct LocalSolveApproach { static constexpr auto value = "gauss-seidel"; };
157struct MaxLocalSolveIterations { static constexpr int value = 20; };
158struct NewtonMinIterations { static constexpr int value = 2; };
159
160struct WellGroupConstraintsMaxIterations { static constexpr int value = 1; };
161template<class Scalar>
162struct LocalToleranceScalingMb { static constexpr Scalar value = 1.0; };
163
164template<class Scalar>
165struct LocalToleranceScalingCnv { static constexpr Scalar value = 0.1; };
166struct NlddNumInitialNewtonIter { static constexpr int value = 1; };
167template<class Scalar>
168struct NlddRelativeMobilityChangeTol { static constexpr Scalar value = 0.1; };
169struct NumLocalDomains { static constexpr int value = 0; };
170
171template<class Scalar>
172struct LocalDomainsPartitioningImbalance { static constexpr Scalar value = 1.03; };
173
174struct LocalDomainsPartitioningMethod { static constexpr auto value = "zoltan"; };
175struct LocalDomainsPartitionWellNeighborLevels { static constexpr int value = 1; };
176struct LocalDomainsOrderingMeasure { static constexpr auto value = "maxpressure"; };
177
178struct ConvergenceMonitoring { static constexpr bool value = false; };
179struct ConvergenceMonitoringCutOff { static constexpr int value = 6; };
180template<class Scalar>
181struct ConvergenceMonitoringDecayFactor { static constexpr Scalar value = 0.75; };
182
183
184template<class Scalar>
185struct NupcolGroupRateTolerance { static constexpr Scalar value = 0.001; };
186
187} // namespace Opm::Parameters
188
189namespace Opm {
190
192template <class Scalar>
194{
195public:
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
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
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:45
DomainOrderingMeasure
Measure to use for domain ordering.
Definition SubDomain.hpp:39
DomainSolveApproach
Solver approach for NLDD.
Definition SubDomain.hpp:33
Struct holding convergence monitor params.
Definition BlackoilModelParameters.hpp:387
int cutoff_
Cut-off limit for convergence monitoring.
Definition BlackoilModelParameters.hpp:391
Scalar decay_factor_
Decay factor used in convergence monitoring.
Definition BlackoilModelParameters.hpp:393
bool enabled_
Whether to enable convergence monitoring.
Definition BlackoilModelParameters.hpp:389
Scalar tolerance_max_drv_
Max RV change during a Newton iteration (TUNINGDP item = TRGDDRV).
Definition BlackoilModelParameters.hpp:234
Scalar tolerance_mb_relaxed_
Relaxed mass balance tolerance (can be used when iter >= min_strict_mb_iter_).
Definition BlackoilModelParameters.hpp:214
Scalar tolerance_energy_balance_
Relative energy balance tolerance (total energy balance error).
Definition BlackoilModelParameters.hpp:216
int max_niter_inner_well_iter_
Maximum newton iterations with inner well iterations.
Definition BlackoilModelParameters.hpp:264
Scalar tolerance_max_dp_
Max pressure change during a Newton iteration (TUNINGDP item = TRGDDP).
Definition BlackoilModelParameters.hpp:228
int max_number_of_well_switches_
Maximum number of times a well can switch to the same control.
Definition BlackoilModelParameters.hpp:316
bool use_average_density_ms_wells_
Whether to approximate segment densities by averaging over segment and its outlet.
Definition BlackoilModelParameters.hpp:322
bool matrix_add_well_contributions_
Whether to add influences of wells between cells to the matrix and preconditioner matrix.
Definition BlackoilModelParameters.hpp:308
bool solve_welleq_initially_
Solve well equation initially.
Definition BlackoilModelParameters.hpp:286
bool update_equations_scaling_
Update scaling factors for mass balance equations.
Definition BlackoilModelParameters.hpp:292
Scalar tolerance_well_control_
Tolerance for the well control equations.
Definition BlackoilModelParameters.hpp:239
int max_inner_iter_wells_
Maximum inner iteration number for standard wells.
Definition BlackoilModelParameters.hpp:270
Scalar tolerance_energy_balance_relaxed_
Relaxed energy balance tolerance (can be used when iter >= min_strict_mb_iter_).
Definition BlackoilModelParameters.hpp:218
int network_max_outer_iterations_
Maximum number of iterations in the network solver before giving up.
Definition BlackoilModelParameters.hpp:337
int max_well_status_switch_
Maximum number of status switches (open<->stop> during a time step.
Definition BlackoilModelParameters.hpp:355
bool shut_unsolvable_wells_
Whether to shut unsolvable well.
Definition BlackoilModelParameters.hpp:267
Scalar inj_mult_osc_threshold_
Injectivity multiplier oscillation threshold.
Definition BlackoilModelParameters.hpp:201
bool use_implicit_ipr_
Whether to use implicit IPR for thp stability checks and solution search.
Definition BlackoilModelParameters.hpp:328
int newton_min_iter_
Minimum number of Newton iterations per time step.
Definition BlackoilModelParameters.hpp:367
int min_strict_mb_iter_
Minimum number of Newton iterations before we can use relaxed MB convergence criterion.
Definition BlackoilModelParameters.hpp:283
Scalar max_pressure_change_ms_wells_
Maximum pressure change over an iteratio for ms wells.
Definition BlackoilModelParameters.hpp:249
int min_strict_cnv_iter_
Minimum number of Newton iterations before we can use relaxed CNV convergence criterion.
Definition BlackoilModelParameters.hpp:280
bool check_well_operability_
Whether to check well operability.
Definition BlackoilModelParameters.hpp:311
bool check_well_operability_iter_
Whether to check well operability during iterations.
Definition BlackoilModelParameters.hpp:313
Scalar dwell_fraction_max_
Max absolute change in well volume fraction in single iteration.
Definition BlackoilModelParameters.hpp:199
int max_welleq_iter_
Maximum iteration number of the well equation solution.
Definition BlackoilModelParameters.hpp:273
Scalar network_max_pressure_update_in_bars_
Maximum pressure update in the inner network pressure update iterations.
Definition BlackoilModelParameters.hpp:346
bool use_update_stabilization_
Try to detect oscillation or stagnation.
Definition BlackoilModelParameters.hpp:295
int max_number_of_group_switches_
Maximum number of times group can switch to the same control.
Definition BlackoilModelParameters.hpp:319
Scalar inj_mult_min_damp_factor_
Minimum damping factor for injectivity multipliers.
Definition BlackoilModelParameters.hpp:205
bool check_group_constraints_inner_well_iterations_
Whether to allow checking/changing to group controls during inner well iterations.
Definition BlackoilModelParameters.hpp:331
Scalar tolerance_max_ds_
Max saturation change during a Newton iteration (TUNINGDP item = TRGDDS).
Definition BlackoilModelParameters.hpp:230
Scalar regularization_factor_wells_
Regularization factor for wells.
Definition BlackoilModelParameters.hpp:261
Scalar tolerance_max_drs_
Max RS change during a Newton iteration (TUNINGDP item = TRGDDRS).
Definition BlackoilModelParameters.hpp:232
DomainSolveApproach local_solve_approach_
'jacobi' and 'gauss-seidel' supported
Definition BlackoilModelParameters.hpp:361
BlackoilModelParameters()
Construct from user parameters or defaults.
Definition BlackoilModelParameters.cpp:35
Scalar tolerance_pressure_ms_wells_
Tolerance for the pressure equations for multisegment wells.
Definition BlackoilModelParameters.hpp:241
Scalar tolerance_cnv_energy_
Local energy convergence tolerance (max of local energy errors).
Definition BlackoilModelParameters.hpp:224
int newton_max_iter_
Maximum number of Newton iterations per time step.
Definition BlackoilModelParameters.hpp:364
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
int max_well_status_switch_inner_iter_
Maximum number of status switches (open<->stop> in local well iterations.
Definition BlackoilModelParameters.hpp:352
bool local_well_solver_control_switching_
Whether to allow control switching during local well solutions.
Definition BlackoilModelParameters.hpp:325
Scalar tolerance_wells_
Well convergence tolerance.
Definition BlackoilModelParameters.hpp:236
Scalar max_residual_allowed_
Absolute max limit for residuals.
Definition BlackoilModelParameters.hpp:207
bool use_multisegment_well_
Whether to use MultisegmentWell to handle multisegment wells it is something temporary before the mul...
Definition BlackoilModelParameters.hpp:302
Scalar nldd_relative_mobility_change_tol_
Threshold for single cell relative mobility change in NLDD.
Definition BlackoilModelParameters.hpp:376
int max_inner_iter_ms_wells_
Maximum inner iteration number for ms wells.
Definition BlackoilModelParameters.hpp:252
int strict_outer_iter_wells_
Newton iteration where wells are stricly convergent.
Definition BlackoilModelParameters.hpp:258
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 inj_mult_damp_mult_
Injectivity multiplier dampening multiplier.
Definition BlackoilModelParameters.hpp:203
Scalar tolerance_mb_
Relative mass balance tolerance (total mass balance error).
Definition BlackoilModelParameters.hpp:212
Scalar tolerance_cnv_
Local convergence tolerance (max of local saturation errors).
Definition BlackoilModelParameters.hpp:220
Scalar dbhp_max_rel_
Max relative change in bhp in single iteration.
Definition BlackoilModelParameters.hpp:197
Scalar tolerance_cnv_relaxed_
Relaxed local convergence tolerance (can be used when iter >= min_strict_cnv_iter_ && cnvViolatedPV <...
Definition BlackoilModelParameters.hpp:222
bool pre_solve_network_
Pre solve and iterate network model.
Definition BlackoilModelParameters.hpp:289
Scalar relaxed_tolerance_pressure_ms_well_
Relaxed tolerance for the MSW pressure solution.
Definition BlackoilModelParameters.hpp:246
Scalar network_pressure_update_damping_factor_
Damping factor in the inner network pressure update iterations.
Definition BlackoilModelParameters.hpp:343
std::string deck_file_name_
The file name of the deck.
Definition BlackoilModelParameters.hpp:305
ConvergenceMonitorParams monitor_params_
Convergence monitoring parameters.
Definition BlackoilModelParameters.hpp:396
int network_max_strict_outer_iterations_
Maximum number of iterations in the network solver before relaxing tolerance.
Definition BlackoilModelParameters.hpp:334
int well_group_constraints_max_iterations_
Maximum number of iterations in the well/group switch algorithm.
Definition BlackoilModelParameters.hpp:349
std::string nonlinear_solver_
Nonlinear solver type: newton or nldd.
Definition BlackoilModelParameters.hpp:358
int strict_inner_iter_wells_
Strict inner iteration number for wells.
Definition BlackoilModelParameters.hpp:255
Scalar relaxed_tolerance_flow_well_
Relaxed tolerance for for the well flow residual.
Definition BlackoilModelParameters.hpp:243
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:123
Definition BlackoilModelParameters.hpp:145
Definition BlackoilModelParameters.hpp:179
Definition BlackoilModelParameters.hpp:181
Definition BlackoilModelParameters.hpp:178
Definition BlackoilModelParameters.hpp:30
Definition BlackoilModelParameters.hpp:132
Definition BlackoilModelParameters.hpp:33
Definition BlackoilModelParameters.hpp:35
Definition BlackoilModelParameters.hpp:131
Definition BlackoilModelParameters.hpp:130
Definition BlackoilModelParameters.hpp:41
Definition BlackoilModelParameters.hpp:44
Definition BlackoilModelParameters.hpp:38
Definition BlackoilModelParameters.hpp:176
Definition BlackoilModelParameters.hpp:175
Definition BlackoilModelParameters.hpp:172
Definition BlackoilModelParameters.hpp:174
Definition BlackoilModelParameters.hpp:156
Definition BlackoilModelParameters.hpp:165
Definition BlackoilModelParameters.hpp:162
Definition BlackoilModelParameters.hpp:143
Definition BlackoilModelParameters.hpp:107
Definition BlackoilModelParameters.hpp:118
Definition BlackoilModelParameters.hpp:119
Definition BlackoilModelParameters.hpp:157
Definition BlackoilModelParameters.hpp:117
Definition BlackoilModelParameters.hpp:115
Definition BlackoilModelParameters.hpp:47
Definition BlackoilModelParameters.hpp:99
Definition BlackoilModelParameters.hpp:121
Definition BlackoilModelParameters.hpp:120
Definition BlackoilModelParameters.hpp:96
Definition BlackoilModelParameters.hpp:141
Definition BlackoilModelParameters.hpp:140
Definition BlackoilModelParameters.hpp:101
Definition BlackoilModelParameters.hpp:102
Definition BlackoilModelParameters.hpp:149
Definition BlackoilModelParameters.hpp:154
Definition BlackoilModelParameters.hpp:148
Definition BlackoilModelParameters.hpp:150
Definition BlackoilModelParameters.hpp:152
Definition BlackoilModelParameters.hpp:158
Definition BlackoilModelParameters.hpp:166
Definition BlackoilModelParameters.hpp:168
Definition BlackoilModelParameters.hpp:155
Definition BlackoilModelParameters.hpp:169
Definition BlackoilModelParameters.hpp:185
Definition BlackoilModelParameters.hpp:104
Definition BlackoilModelParameters.hpp:128
Definition BlackoilModelParameters.hpp:50
Definition BlackoilModelParameters.hpp:138
Definition BlackoilModelParameters.hpp:135
Definition BlackoilModelParameters.hpp:122
Definition BlackoilModelParameters.hpp:103
Definition BlackoilModelParameters.hpp:125
Definition BlackoilModelParameters.hpp:124
Definition BlackoilModelParameters.hpp:76
Definition BlackoilModelParameters.hpp:73
Definition BlackoilModelParameters.hpp:70
Definition BlackoilModelParameters.hpp:67
Definition BlackoilModelParameters.hpp:64
Definition BlackoilModelParameters.hpp:61
Definition BlackoilModelParameters.hpp:79
Definition BlackoilModelParameters.hpp:85
Definition BlackoilModelParameters.hpp:88
Definition BlackoilModelParameters.hpp:82
Definition BlackoilModelParameters.hpp:56
Definition BlackoilModelParameters.hpp:53
Definition BlackoilModelParameters.hpp:112
Definition BlackoilModelParameters.hpp:94
Definition BlackoilModelParameters.hpp:91
Definition BlackoilModelParameters.hpp:105
Definition BlackoilModelParameters.hpp:142
Definition BlackoilModelParameters.hpp:144
Definition BlackoilModelParameters.hpp:109
Definition BlackoilModelParameters.hpp:106
Definition BlackoilModelParameters.hpp:160