20#ifndef OPM_BLACKOILMODELPARAMETERS_EBOS_HEADER_INCLUDED
21#define OPM_BLACKOILMODELPARAMETERS_EBOS_HEADER_INCLUDED
23#include <opm/models/discretization/common/fvbaseproperties.hh>
25#include <opm/models/utils/basicproperties.hh>
26#include <opm/models/utils/parametersystem.hh>
27#include <opm/models/utils/propertysystem.hh>
29#include <opm/simulators/flow/SubDomain.hpp>
34namespace Opm::Properties {
40template<
class TypeTag,
class MyTypeTag>
44template<
class TypeTag,
class MyTypeTag>
48template<
class TypeTag,
class MyTypeTag>
52template<
class TypeTag,
class MyTypeTag>
56template<
class TypeTag,
class MyTypeTag>
60template<
class TypeTag,
class MyTypeTag>
64template<
class TypeTag,
class MyTypeTag>
68template<
class TypeTag,
class MyTypeTag>
72template<
class TypeTag,
class MyTypeTag>
76template<
class TypeTag,
class MyTypeTag>
80template<
class TypeTag,
class MyTypeTag>
84template<
class TypeTag,
class MyTypeTag>
88template<
class TypeTag,
class MyTypeTag>
92template<
class TypeTag,
class MyTypeTag>
96template<
class TypeTag,
class MyTypeTag>
100template<
class TypeTag,
class MyTypeTag>
104template<
class TypeTag,
class MyTypeTag>
108template<
class TypeTag,
class MyTypeTag>
112template<
class TypeTag,
class MyTypeTag>
116template<
class TypeTag,
class MyTypeTag>
121template<
class TypeTag,
class MyTypeTag>
125template<
class TypeTag,
class MyTypeTag>
129template<
class TypeTag,
class MyTypeTag>
133template<
class TypeTag,
class MyTypeTag>
137template<
class TypeTag,
class MyTypeTag>
141template<
class TypeTag,
class MyTypeTag>
145template<
class TypeTag,
class MyTypeTag>
149template<
class TypeTag,
class MyTypeTag>
153template<
class TypeTag,
class MyTypeTag>
157template<
class TypeTag,
class MyTypeTag>
161template<
class TypeTag,
class MyTypeTag>
165template<
class TypeTag,
class MyTypeTag>
169template<
class TypeTag,
class MyTypeTag>
173template<
class TypeTag,
class MyTypeTag>
177template<
class TypeTag,
class MyTypeTag>
182template<
class TypeTag,
class MyTypeTag>
186template<
class TypeTag,
class MyTypeTag>
190template<
class TypeTag,
class MyTypeTag>
194template<
class TypeTag,
class MyTypeTag>
198template<
class TypeTag,
class MyTypeTag>
202template<
class TypeTag,
class MyTypeTag>
206template<
class TypeTag,
class MyTypeTag>
210template<
class TypeTag,
class MyTypeTag>
214template<
class TypeTag,
class MyTypeTag>
218template<
class TypeTag,
class MyTypeTag>
222template<
class TypeTag,
class MyTypeTag>
226template<
class TypeTag,
class MyTypeTag>
230template<
class TypeTag>
233 static constexpr type value = 1.0;
235template<
class TypeTag>
238 static constexpr type value = 0.2;
240template<
class TypeTag>
243 static constexpr type value = 1
e7;
245template<
class TypeTag>
248 static constexpr type value = 0.03;
250template<
class TypeTag>
253 static constexpr type value = 1
e-6;
255template<
class TypeTag>
258 static constexpr type value = 1
e-2;
260template<
class TypeTag>
263 static constexpr type value = 1;
265template<
class TypeTag>
268 static constexpr type value = 1
e-4;
270template<
class TypeTag>
273 static constexpr type value = 1
e-7;
275template<
class TypeTag>
277 static constexpr int value = 30;
279template<
class TypeTag>
281 static constexpr bool value =
true;
283template<
class TypeTag>
286 static constexpr type value = 20.0;
288template<
class TypeTag>
290 static constexpr int value = 0;
292template<
class TypeTag>
294 static constexpr bool value =
true;
296template<
class TypeTag>
298 static constexpr bool value =
false;
300template<
class TypeTag>
302 static constexpr bool value =
true;
304template<
class TypeTag>
306 static constexpr bool value =
false;
308template<
class TypeTag>
311 static constexpr type value = 0.01*1
e5;
313template<
class TypeTag>
316 static constexpr type value = 10*1
e5;
318template<
class TypeTag>
320 static constexpr int value = 8;
322template<
class TypeTag>
324 static constexpr int value = 100;
326template<
class TypeTag>
328 static constexpr int value = 50;
330template<
class TypeTag>
332 static constexpr bool value =
true;
334template<
class TypeTag>
336 static constexpr bool value =
true;
338template<
class TypeTag>
340 static constexpr int value = 6;
342template<
class TypeTag>
344 static constexpr int value = 40;
346template<
class TypeTag>
349 static constexpr type value = 100;
351template<
class TypeTag>
353 static constexpr bool value =
true;
355template<
class TypeTag>
357 static constexpr bool value =
false;
359template<
class TypeTag>
362 static constexpr type value = 1
e-3;
364template<
class TypeTag>
367 static constexpr type value = 1.0e4;
369template<
class TypeTag>
371 static constexpr int value = 3;
373template<
class TypeTag>
375 static constexpr bool value =
false;
377template<
class TypeTag>
379 static constexpr bool value =
false;
383template<
class TypeTag>
385 static constexpr int value = 100;
387template<
class TypeTag>
389 static constexpr int value = 200;
391template<
class TypeTag>
393 static constexpr auto value =
"newton";
395template<
class TypeTag>
397 static constexpr auto value =
"jacobi";
399template<
class TypeTag>
401 static constexpr int value = 20;
403template<
class TypeTag>
406 static constexpr type value = 1.0;
408template<
class TypeTag>
411 static constexpr type value = 0.01;
413template<
class TypeTag>
416 static constexpr auto value =
type{1};
418template<
class TypeTag>
421 static constexpr auto value = 0;
423template<
class TypeTag>
426 static constexpr auto value =
type{1.03};
428template<
class TypeTag>
430 static constexpr auto value =
"zoltan";
432template<
class TypeTag>
434 static constexpr auto value =
"pressure";
438template<
class TypeTag>
440 static constexpr int value = -1;
449 template <
class TypeTag>
464 double relaxed_max_pv_fraction_;
565 int max_local_solve_iterations_;
567 double local_tolerance_scaling_mb_;
568 double local_tolerance_scaling_cnv_;
570 int nldd_num_initial_newton_iter_{1};
571 int num_local_domains_{0};
572 double local_domain_partition_imbalance_{1.03};
573 std::string local_domain_partition_method_;
616 }
else if (
approach ==
"gauss-seidel") {
619 throw std::runtime_error(
"Invalid domain solver approach '" +
approach +
"' specified.");
622 max_local_solve_iterations_ =
EWOMS_GET_PARAM(TypeTag,
int, MaxLocalSolveIterations);
623 local_tolerance_scaling_mb_ =
EWOMS_GET_PARAM(TypeTag,
double, LocalToleranceScalingMb);
624 local_tolerance_scaling_cnv_ =
EWOMS_GET_PARAM(TypeTag,
double, LocalToleranceScalingCnv);
625 nldd_num_initial_newton_iter_ =
EWOMS_GET_PARAM(TypeTag,
int, NlddNumInitialNewtonIter);
627 local_domain_partition_imbalance_ = std::max(1.0,
EWOMS_GET_PARAM(TypeTag,
double, LocalDomainsPartitioningImbalance));
628 local_domain_partition_method_ =
EWOMS_GET_PARAM(TypeTag, std::string, LocalDomainsPartitioningMethod);
634 local_domain_ordering_ = DomainOrderingMeasure::Residual;
635 }
else if (
measure ==
"pressure") {
636 local_domain_ordering_ = DomainOrderingMeasure::AveragePressure;
638 throw std::runtime_error(
"Invalid domain ordering '" +
measure +
"' specified.");
642 static void registerParameters()
644 EWOMS_REGISTER_PARAM(TypeTag, Scalar, DbhpMaxRel,
"Maximum relative change of the bottom-hole pressure in a single iteration");
645 EWOMS_REGISTER_PARAM(TypeTag, Scalar, DwellFractionMax,
"Maximum absolute change of a well's volume fraction in a single iteration");
646 EWOMS_REGISTER_PARAM(TypeTag, Scalar, MaxResidualAllowed,
"Absolute maximum tolerated for residuals without cutting the time step size");
647 EWOMS_REGISTER_PARAM(TypeTag, Scalar, RelaxedMaxPvFraction,
"The fraction of the pore volume of the reservoir "
648 "where the volumetric error (CNV) may be voilated during strict Newton iterations.");
649 EWOMS_REGISTER_PARAM(TypeTag, Scalar, ToleranceMb,
"Tolerated mass balance error relative to total mass present");
650 EWOMS_REGISTER_PARAM(TypeTag, Scalar, ToleranceCnv,
"Local convergence tolerance (Maximum of local saturation errors)");
651 EWOMS_REGISTER_PARAM(TypeTag, Scalar, ToleranceCnvRelaxed,
"Relaxed local convergence tolerance that applies for iterations after the iterations with the strict tolerance");
653 EWOMS_REGISTER_PARAM(TypeTag, Scalar, ToleranceWellControl,
"Tolerance for the well control equations");
654 EWOMS_REGISTER_PARAM(TypeTag,
int, MaxWelleqIter,
"Maximum number of iterations to determine solution the well equations");
655 EWOMS_REGISTER_PARAM(TypeTag,
bool, UseMultisegmentWell,
"Use the well model for multi-segment wells instead of the one for single-segment wells");
656 EWOMS_REGISTER_PARAM(TypeTag, Scalar, TolerancePressureMsWells,
"Tolerance for the pressure equations for multi-segment wells");
657 EWOMS_REGISTER_PARAM(TypeTag, Scalar, RelaxedWellFlowTol,
"Relaxed tolerance for the well flow residual");
658 EWOMS_REGISTER_PARAM(TypeTag, Scalar, RelaxedPressureTolMsw,
"Relaxed tolerance for the MSW pressure solution");
659 EWOMS_REGISTER_PARAM(TypeTag, Scalar, MaxPressureChangeMsWells,
"Maximum relative pressure change for a single iteration of the multi-segment well model");
660 EWOMS_REGISTER_PARAM(TypeTag,
int, MaxInnerIterMsWells,
"Maximum number of inner iterations for multi-segment wells");
661 EWOMS_REGISTER_PARAM(TypeTag,
int, StrictInnerIterWells,
"Number of inner well iterations with strict tolerance");
662 EWOMS_REGISTER_PARAM(TypeTag,
int, StrictOuterIterWells,
"Number of newton iterations for which wells are checked with strict tolerance");
663 EWOMS_REGISTER_PARAM(TypeTag,
int, MaxNewtonIterationsWithInnerWellIterations,
"Maximum newton iterations with inner well iterations");
665 EWOMS_REGISTER_PARAM(TypeTag,
int, MaxInnerIterWells,
"Maximum number of inner iterations for standard wells");
666 EWOMS_REGISTER_PARAM(TypeTag,
bool, AlternativeWellRateInit,
"Use alternative well rate initialization procedure");
667 EWOMS_REGISTER_PARAM(TypeTag, Scalar, RegularizationFactorWells,
"Regularization factor for wells");
668 EWOMS_REGISTER_PARAM(TypeTag, Scalar, MaxSinglePrecisionDays,
"Maximum time step size where single precision floating point arithmetic can be used solving for the linear systems of equations");
669 EWOMS_REGISTER_PARAM(TypeTag,
int, MinStrictCnvIter,
"Minimum number of Newton iterations before relaxed tolerances can be used for the CNV convergence criterion");
670 EWOMS_REGISTER_PARAM(TypeTag,
bool, SolveWelleqInitially,
"Fully solve the well equations before each iteration of the reservoir model");
671 EWOMS_REGISTER_PARAM(TypeTag,
bool, UpdateEquationsScaling,
"Update scaling factors for mass balance equations during the run");
672 EWOMS_REGISTER_PARAM(TypeTag,
bool, UseUpdateStabilization,
"Try to detect and correct oscillations or stagnation during the Newton method");
673 EWOMS_REGISTER_PARAM(TypeTag,
bool, MatrixAddWellContributions,
"Explicitly specify the influences of wells between cells in the Jacobian and preconditioner matrices");
674 EWOMS_REGISTER_PARAM(TypeTag,
bool, EnableWellOperabilityCheck,
"Enable the well operability checking");
675 EWOMS_REGISTER_PARAM(TypeTag,
bool, EnableWellOperabilityCheckIter,
"Enable the well operability checking during iterations");
676 EWOMS_REGISTER_PARAM(TypeTag,
int, MaximumNumberOfWellSwitches,
"Maximum number of times a well can switch to the same control");
677 EWOMS_REGISTER_PARAM(TypeTag,
bool, UseAverageDensityMsWells,
"Approximate segment densitities by averaging over segment and its outlet");
678 EWOMS_REGISTER_PARAM(TypeTag,
bool, LocalWellSolveControlSwitching,
"Allow control switching during local well solutions");
679 EWOMS_REGISTER_PARAM(TypeTag,
int, NetworkMaxStrictIterations,
"Maximum iterations in network solver before relaxing tolerance");
680 EWOMS_REGISTER_PARAM(TypeTag,
int, NetworkMaxIterations,
"Maximum number of iterations in the network solver before giving up");
681 EWOMS_REGISTER_PARAM(TypeTag, std::string, NonlinearSolver,
"Choose nonlinear solver. Valid choices are newton or nldd.");
682 EWOMS_REGISTER_PARAM(TypeTag, std::string, LocalSolveApproach,
"Choose local solve approach. Valid choices are jacobi and gauss-seidel");
683 EWOMS_REGISTER_PARAM(TypeTag,
int, MaxLocalSolveIterations,
"Max iterations for local solves with NLDD nonlinear solver.");
684 EWOMS_REGISTER_PARAM(TypeTag, Scalar, LocalToleranceScalingMb,
"Set lower than 1.0 to use stricter convergence tolerance for local solves.");
685 EWOMS_REGISTER_PARAM(TypeTag, Scalar, LocalToleranceScalingCnv,
"Set lower than 1.0 to use stricter convergence tolerance for local solves.");
686 EWOMS_REGISTER_PARAM(TypeTag,
int, NlddNumInitialNewtonIter,
"Number of initial global Newton iterations when running the NLDD nonlinear solver.");
687 EWOMS_REGISTER_PARAM(TypeTag,
int, NumLocalDomains,
"Number of local domains for NLDD nonlinear solver.");
688 EWOMS_REGISTER_PARAM(TypeTag, Scalar, LocalDomainsPartitioningImbalance,
"Subdomain partitioning imbalance tolerance. 1.03 is 3 percent imbalance.");
689 EWOMS_REGISTER_PARAM(TypeTag, std::string, LocalDomainsPartitioningMethod,
"Subdomain partitioning method. "
690 "Allowed values are 'zoltan', 'simple', and the name of a partition file ending with '.partition'.");
691 EWOMS_REGISTER_PARAM(TypeTag, std::string, LocalDomainsOrderingMeasure,
"Subdomain ordering measure. "
692 "Allowed values are 'pressure' and 'residual'.");
Definition AquiferInterface.hpp:35
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition BlackoilPhases.hpp:27
DomainOrderingMeasure
Measure to use for domain ordering.
Definition SubDomain.hpp:37
DomainSolveApproach
Solver approach for NLDD.
Definition SubDomain.hpp:31
Solver parameters for the BlackoilModel.
Definition BlackoilModelParametersEbos.hpp:451
double tolerance_cnv_relaxed_
Relaxed local convergence tolerance (can be used when iter >= min_strict_cnv_iter_ && cnvViolatedPV <...
Definition BlackoilModelParametersEbos.hpp:470
int max_niter_inner_well_iter_
Maximum newton iterations with inner well iterations.
Definition BlackoilModelParametersEbos.hpp:500
double dbhp_max_rel_
Max relative change in bhp in single iteration.
Definition BlackoilModelParametersEbos.hpp:457
double tolerance_wells_
Well convergence tolerance.
Definition BlackoilModelParametersEbos.hpp:472
bool shut_unsolvable_wells_
Whether to shut unsolvable well.
Definition BlackoilModelParametersEbos.hpp:503
int max_inner_iter_ms_wells_
Maximum inner iteration number for ms wells.
Definition BlackoilModelParametersEbos.hpp:488
bool matrix_add_well_contributions_
Whether to add influences of wells between cells to the matrix and preconditioner matrix.
Definition BlackoilModelParametersEbos.hpp:538
std::string nonlinear_solver_
Nonlinear solver type: newton or nldd.
Definition BlackoilModelParametersEbos.hpp:561
int network_max_iterations_
Maximum number of iterations in the network solver before giving up.
Definition BlackoilModelParametersEbos.hpp:558
bool solve_welleq_initially_
Solve well equation initially.
Definition BlackoilModelParametersEbos.hpp:519
bool use_update_stabilization_
Try to detect oscillation or stagnation.
Definition BlackoilModelParametersEbos.hpp:525
double tolerance_pressure_ms_wells_
Tolerance for the pressure equations for multisegment wells.
Definition BlackoilModelParametersEbos.hpp:477
int network_max_strict_iterations_
Maximum number of iterations in the network solver before relaxing tolerance.
Definition BlackoilModelParametersEbos.hpp:555
std::string deck_file_name_
The file name of the deck.
Definition BlackoilModelParametersEbos.hpp:535
DomainSolveApproach local_solve_approach_
'jacobi' and 'gauss-seidel' supported.
Definition BlackoilModelParametersEbos.hpp:563
double tolerance_cnv_
Local convergence tolerance (max of local saturation errors).
Definition BlackoilModelParametersEbos.hpp:468
bool update_equations_scaling_
Update scaling factors for mass balance equations.
Definition BlackoilModelParametersEbos.hpp:522
bool use_average_density_ms_wells_
Whether to approximate segment densities by averaging over segment and its outlet.
Definition BlackoilModelParametersEbos.hpp:549
double relaxed_tolerance_flow_well_
Relaxed tolerance for for the well flow residual.
Definition BlackoilModelParametersEbos.hpp:479
double tolerance_mb_
Relative mass balance tolerance (total mass balance error).
Definition BlackoilModelParametersEbos.hpp:466
double relaxed_tolerance_pressure_ms_well_
Relaxed tolerance for the MSW pressure solution.
Definition BlackoilModelParametersEbos.hpp:482
double max_pressure_change_ms_wells_
Maximum pressure change over an iteratio for ms wells.
Definition BlackoilModelParametersEbos.hpp:485
bool check_well_operability_
Whether to check well operability.
Definition BlackoilModelParametersEbos.hpp:541
int min_strict_cnv_iter_
Minimum number of Newton iterations before we can use relaxed CNV convergence criterion.
Definition BlackoilModelParametersEbos.hpp:516
BlackoilModelParametersEbos()
Construct from user parameters or defaults.
Definition BlackoilModelParametersEbos.hpp:577
bool use_multisegment_well_
Whether to use MultisegmentWell to handle multisegment wells it is something temporary before the mul...
Definition BlackoilModelParametersEbos.hpp:532
double max_residual_allowed_
Absolute max limit for residuals.
Definition BlackoilModelParametersEbos.hpp:461
int strict_outer_iter_wells_
Newton iteration where wells are stricly convergent.
Definition BlackoilModelParametersEbos.hpp:494
double tolerance_well_control_
Tolerance for the well control equations.
Definition BlackoilModelParametersEbos.hpp:475
double maxSinglePrecisionTimeStep_
Tolerance for time step in seconds where single precision can be used for solving for the Jacobian.
Definition BlackoilModelParametersEbos.hpp:513
int strict_inner_iter_wells_
Strict inner iteration number for wells.
Definition BlackoilModelParametersEbos.hpp:491
int max_number_of_well_switches_
Maximum number of times a well can switch to the same controt.
Definition BlackoilModelParametersEbos.hpp:546
double regularization_factor_wells_
Regularization factor for wells.
Definition BlackoilModelParametersEbos.hpp:497
bool local_well_solver_control_switching_
Whether to allow control switching during local well solutions.
Definition BlackoilModelParametersEbos.hpp:552
double dwell_fraction_max_
Max absolute change in well volume fraction in single iteration.
Definition BlackoilModelParametersEbos.hpp:459
bool check_well_operability_iter_
Whether to check well operability during iterations.
Definition BlackoilModelParametersEbos.hpp:543
int max_inner_iter_wells_
Maximum inner iteration number for standard wells.
Definition BlackoilModelParametersEbos.hpp:506
int max_welleq_iter_
Maximum iteration number of the well equation solution.
Definition BlackoilModelParametersEbos.hpp:509
Definition BlackoilModelParametersEbos.hpp:166
Definition BlackoilModelParametersEbos.hpp:45
Definition BlackoilModelParametersEbos.hpp:49
Definition BlackoilModelParametersEbos.hpp:41
Definition BlackoilModelParametersEbos.hpp:117
Definition BlackoilModelParametersEbos.hpp:113
Definition BlackoilModelParametersEbos.hpp:227
Definition BlackoilModelParametersEbos.hpp:219
Definition BlackoilModelParametersEbos.hpp:223
Definition BlackoilModelParametersEbos.hpp:195
Definition BlackoilModelParametersEbos.hpp:207
Definition BlackoilModelParametersEbos.hpp:203
Definition BlackoilModelParametersEbos.hpp:178
Definition BlackoilModelParametersEbos.hpp:109
Definition BlackoilModelParametersEbos.hpp:130
Definition BlackoilModelParametersEbos.hpp:162
Definition BlackoilModelParametersEbos.hpp:199
Definition BlackoilModelParametersEbos.hpp:154
Definition BlackoilModelParametersEbos.hpp:126
Definition BlackoilModelParametersEbos.hpp:53
Definition BlackoilModelParametersEbos.hpp:89
Definition BlackoilModelParametersEbos.hpp:81
Definition BlackoilModelParametersEbos.hpp:170
Definition BlackoilModelParametersEbos.hpp:93
Definition BlackoilModelParametersEbos.hpp:187
Definition BlackoilModelParametersEbos.hpp:183
Definition BlackoilModelParametersEbos.hpp:211
Definition BlackoilModelParametersEbos.hpp:191
Definition BlackoilModelParametersEbos.hpp:215
Definition BlackoilModelParametersEbos.hpp:150
Definition BlackoilModelParametersEbos.hpp:57
Definition BlackoilModelParametersEbos.hpp:146
Definition BlackoilModelParametersEbos.hpp:138
Definition BlackoilModelParametersEbos.hpp:158
Definition BlackoilModelParametersEbos.hpp:97
Definition BlackoilModelParametersEbos.hpp:134
Definition BlackoilModelParametersEbos.hpp:142
Definition BlackoilModelParametersEbos.hpp:37
Definition BlackoilModelParametersEbos.hpp:69
Definition BlackoilModelParametersEbos.hpp:65
Definition BlackoilModelParametersEbos.hpp:61
Definition BlackoilModelParametersEbos.hpp:122
Definition BlackoilModelParametersEbos.hpp:77
Definition BlackoilModelParametersEbos.hpp:73
Definition BlackoilModelParametersEbos.hpp:101
Definition BlackoilModelParametersEbos.hpp:174
Definition BlackoilModelParametersEbos.hpp:85
Definition BlackoilModelParametersEbos.hpp:105