2018-06-21 05:14:17 -05:00
/*
Copyright 2015 SINTEF ICT , Applied Mathematics .
This file is part of the Open Porous Media project ( OPM ) .
OPM is free software : you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
( at your option ) any later version .
OPM is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
You should have received a copy of the GNU General Public License
along with OPM . If not , see < http : //www.gnu.org/licenses/>.
*/
# ifndef OPM_BLACKOILMODELPARAMETERS_EBOS_HEADER_INCLUDED
# define OPM_BLACKOILMODELPARAMETERS_EBOS_HEADER_INCLUDED
2023-07-03 05:16:30 -05:00
# include <opm/models/discretization/common/fvbaseproperties.hh>
# include <opm/models/utils/basicproperties.hh>
2019-09-16 03:58:20 -05:00
# include <opm/models/utils/parametersystem.hh>
2023-07-03 05:16:30 -05:00
# include <opm/models/utils/propertysystem.hh>
2018-06-21 05:14:17 -05:00
2023-07-03 05:16:30 -05:00
# include <opm/simulators/flow/SubDomain.hpp>
# include <stdexcept>
2018-06-21 05:14:17 -05:00
# include <string>
2020-08-21 06:42:08 -05:00
namespace Opm : : Properties {
2018-06-21 05:14:17 -05:00
2020-08-27 03:30:29 -05:00
namespace TTag {
struct FlowModelParameters { } ;
}
2018-06-21 05:14:17 -05:00
2021-05-15 07:41:05 -05:00
template < class TypeTag , class MyTypeTag >
struct EclDeckFileName {
using type = UndefinedProperty ;
} ;
2020-08-27 04:38:38 -05:00
template < class TypeTag , class MyTypeTag >
struct DbhpMaxRel {
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
struct DwellFractionMax {
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
struct MaxResidualAllowed {
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
struct RelaxedMaxPvFraction {
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
struct ToleranceMb {
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
struct ToleranceCnv {
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
struct ToleranceCnvRelaxed {
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
struct ToleranceWells {
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
struct ToleranceWellControl {
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
struct MaxWelleqIter {
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
struct UseMultisegmentWell {
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
struct MaxSinglePrecisionDays {
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
2022-09-07 07:12:03 -05:00
struct MinStrictCnvIter {
2020-08-27 04:38:38 -05:00
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
struct SolveWelleqInitially {
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
struct UpdateEquationsScaling {
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
struct UseUpdateStabilization {
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
struct MatrixAddWellContributions {
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
struct EnableWellOperabilityCheck {
using type = UndefinedProperty ;
} ;
2021-09-21 04:34:19 -05:00
template < class TypeTag , class MyTypeTag >
struct EnableWellOperabilityCheckIter {
using type = UndefinedProperty ;
} ;
2023-10-23 08:55:51 -05:00
template < class TypeTag , class MyTypeTag >
struct DebugEmitCellPartition {
using type = UndefinedProperty ;
} ;
2018-06-21 05:14:17 -05:00
// parameters for multisegment wells
2020-08-27 04:38:38 -05:00
template < class TypeTag , class MyTypeTag >
struct TolerancePressureMsWells {
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
struct MaxPressureChangeMsWells {
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
struct MaxInnerIterMsWells {
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
2021-09-06 03:08:28 -05:00
struct StrictInnerIterWells {
2020-08-27 04:38:38 -05:00
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
2021-09-06 03:08:28 -05:00
struct RelaxedWellFlowTol {
2021-09-02 06:47:38 -05:00
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
2021-09-06 03:08:28 -05:00
struct StrictOuterIterWells {
2020-08-27 04:38:38 -05:00
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
2021-09-06 03:08:28 -05:00
struct RelaxedPressureTolMsw {
2020-08-27 04:38:38 -05:00
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
2022-06-29 05:54:42 -05:00
struct RegularizationFactorWells {
2020-08-27 04:38:38 -05:00
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
2021-06-04 03:51:15 -05:00
struct MaxNewtonIterationsWithInnerWellIterations {
2020-08-27 04:38:38 -05:00
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
2021-04-16 07:44:14 -05:00
struct ShutUnsolvableWells {
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
2020-08-27 04:38:38 -05:00
struct MaxInnerIterWells {
using type = UndefinedProperty ;
} ;
2020-10-15 10:56:11 -05:00
template < class TypeTag , class MyTypeTag >
struct AlternativeWellRateInit {
using type = UndefinedProperty ;
} ;
2021-04-15 01:14:52 -05:00
template < class TypeTag , class MyTypeTag >
struct MaximumNumberOfWellSwitches {
using type = UndefinedProperty ;
} ;
2023-05-23 05:44:06 -05:00
template < class TypeTag , class MyTypeTag >
struct UseAverageDensityMsWells {
using type = UndefinedProperty ;
} ;
2023-08-16 05:50:06 -05:00
template < class TypeTag , class MyTypeTag >
struct LocalWellSolveControlSwitching {
using type = UndefinedProperty ;
} ;
2023-06-16 05:15:06 -05:00
// Network solver parameters
template < class TypeTag , class MyTypeTag >
struct NetworkMaxStrictIterations {
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
struct NetworkMaxIterations {
using type = UndefinedProperty ;
} ;
2023-06-14 02:18:53 -05:00
template < class TypeTag , class MyTypeTag >
struct NonlinearSolver {
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
struct LocalSolveApproach {
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
struct MaxLocalSolveIterations {
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
struct LocalToleranceScalingMb {
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
struct LocalToleranceScalingCnv {
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
2023-10-10 11:25:24 -05:00
struct NlddNumInitialNewtonIter {
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
2023-06-14 02:18:53 -05:00
struct NumLocalDomains {
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
struct LocalDomainsPartitioningImbalance {
using type = UndefinedProperty ;
} ;
template < class TypeTag , class MyTypeTag >
struct LocalDomainsPartitioningMethod {
using type = UndefinedProperty ;
} ;
2023-07-03 05:16:30 -05:00
template < class TypeTag , class MyTypeTag >
struct LocalDomainsOrderingMeasure {
using type = UndefinedProperty ;
} ;
2020-08-27 04:38:38 -05:00
template < class TypeTag >
struct DbhpMaxRel < TypeTag , TTag : : FlowModelParameters > {
using type = GetPropType < TypeTag , Scalar > ;
static constexpr type value = 1.0 ;
} ;
template < class TypeTag >
struct DwellFractionMax < TypeTag , TTag : : FlowModelParameters > {
using type = GetPropType < TypeTag , Scalar > ;
static constexpr type value = 0.2 ;
} ;
template < class TypeTag >
struct MaxResidualAllowed < TypeTag , TTag : : FlowModelParameters > {
using type = GetPropType < TypeTag , Scalar > ;
static constexpr type value = 1e7 ;
} ;
template < class TypeTag >
struct RelaxedMaxPvFraction < TypeTag , TTag : : FlowModelParameters > {
using type = GetPropType < TypeTag , Scalar > ;
2020-09-16 08:58:14 -05:00
static constexpr type value = 0.03 ;
2020-08-27 04:38:38 -05:00
} ;
template < class TypeTag >
struct ToleranceMb < TypeTag , TTag : : FlowModelParameters > {
using type = GetPropType < TypeTag , Scalar > ;
static constexpr type value = 1e-6 ;
} ;
template < class TypeTag >
struct ToleranceCnv < TypeTag , TTag : : FlowModelParameters > {
using type = GetPropType < TypeTag , Scalar > ;
static constexpr type value = 1e-2 ;
} ;
template < class TypeTag >
struct ToleranceCnvRelaxed < TypeTag , TTag : : FlowModelParameters > {
using type = GetPropType < TypeTag , Scalar > ;
2020-09-16 08:58:14 -05:00
static constexpr type value = 1 ;
2020-08-27 04:38:38 -05:00
} ;
template < class TypeTag >
struct ToleranceWells < TypeTag , TTag : : FlowModelParameters > {
using type = GetPropType < TypeTag , Scalar > ;
static constexpr type value = 1e-4 ;
} ;
template < class TypeTag >
struct ToleranceWellControl < TypeTag , TTag : : FlowModelParameters > {
using type = GetPropType < TypeTag , Scalar > ;
static constexpr type value = 1e-7 ;
} ;
2020-08-27 04:38:38 -05:00
template < class TypeTag >
struct MaxWelleqIter < TypeTag , TTag : : FlowModelParameters > {
static constexpr int value = 30 ;
} ;
2020-08-27 04:38:38 -05:00
template < class TypeTag >
struct UseMultisegmentWell < TypeTag , TTag : : FlowModelParameters > {
static constexpr bool value = true ;
} ;
2020-08-27 04:38:38 -05:00
template < class TypeTag >
struct MaxSinglePrecisionDays < TypeTag , TTag : : FlowModelParameters > {
using type = GetPropType < TypeTag , Scalar > ;
static constexpr type value = 20.0 ;
} ;
2020-08-27 04:38:38 -05:00
template < class TypeTag >
2022-09-07 07:12:03 -05:00
struct MinStrictCnvIter < TypeTag , TTag : : FlowModelParameters > {
2020-09-16 08:58:14 -05:00
static constexpr int value = 0 ;
2020-08-27 04:38:38 -05:00
} ;
2020-08-27 04:38:38 -05:00
template < class TypeTag >
struct SolveWelleqInitially < TypeTag , TTag : : FlowModelParameters > {
static constexpr bool value = true ;
} ;
template < class TypeTag >
struct UpdateEquationsScaling < TypeTag , TTag : : FlowModelParameters > {
static constexpr bool value = false ;
} ;
template < class TypeTag >
struct UseUpdateStabilization < TypeTag , TTag : : FlowModelParameters > {
static constexpr bool value = true ;
} ;
template < class TypeTag >
struct MatrixAddWellContributions < TypeTag , TTag : : FlowModelParameters > {
static constexpr bool value = false ;
} ;
2020-08-27 04:38:38 -05:00
template < class TypeTag >
struct TolerancePressureMsWells < TypeTag , TTag : : FlowModelParameters > {
using type = GetPropType < TypeTag , Scalar > ;
static constexpr type value = 0.01 * 1e5 ;
} ;
template < class TypeTag >
struct MaxPressureChangeMsWells < TypeTag , TTag : : FlowModelParameters > {
using type = GetPropType < TypeTag , Scalar > ;
static constexpr type value = 10 * 1e5 ;
} ;
2020-08-27 04:38:38 -05:00
template < class TypeTag >
2021-06-04 03:51:15 -05:00
struct MaxNewtonIterationsWithInnerWellIterations < TypeTag , TTag : : FlowModelParameters > {
2021-08-18 01:41:37 -05:00
static constexpr int value = 8 ;
2020-08-27 04:38:38 -05:00
} ;
2020-08-27 04:38:38 -05:00
template < class TypeTag >
struct MaxInnerIterMsWells < TypeTag , TTag : : FlowModelParameters > {
static constexpr int value = 100 ;
} ;
2020-08-27 04:38:38 -05:00
template < class TypeTag >
2020-08-27 04:38:38 -05:00
struct MaxInnerIterWells < TypeTag , TTag : : FlowModelParameters > {
static constexpr int value = 50 ;
} ;
template < class TypeTag >
2021-04-16 07:44:14 -05:00
struct ShutUnsolvableWells < TypeTag , TTag : : FlowModelParameters > {
2022-04-04 02:53:09 -05:00
static constexpr bool value = true ;
2021-04-16 07:44:14 -05:00
} ;
template < class TypeTag >
2020-10-15 10:56:11 -05:00
struct AlternativeWellRateInit < TypeTag , TTag : : FlowModelParameters > {
2020-11-17 04:56:02 -06:00
static constexpr bool value = true ;
2020-10-15 10:56:11 -05:00
} ;
template < class TypeTag >
2021-09-06 03:08:28 -05:00
struct StrictOuterIterWells < TypeTag , TTag : : FlowModelParameters > {
2022-04-04 02:53:09 -05:00
static constexpr int value = 6 ;
2021-09-02 06:47:38 -05:00
} ;
template < class TypeTag >
2021-09-06 03:08:28 -05:00
struct StrictInnerIterWells < TypeTag , TTag : : FlowModelParameters > {
2020-08-27 04:38:38 -05:00
static constexpr int value = 40 ;
} ;
2020-08-27 04:38:38 -05:00
template < class TypeTag >
2022-06-29 05:54:42 -05:00
struct RegularizationFactorWells < TypeTag , TTag : : FlowModelParameters > {
2020-08-27 04:38:38 -05:00
using type = GetPropType < TypeTag , Scalar > ;
2022-05-02 02:41:43 -05:00
static constexpr type value = 100 ;
2020-08-27 04:38:38 -05:00
} ;
2020-08-27 04:38:38 -05:00
template < class TypeTag >
struct EnableWellOperabilityCheck < TypeTag , TTag : : FlowModelParameters > {
static constexpr bool value = true ;
} ;
2020-08-27 04:38:38 -05:00
template < class TypeTag >
2021-09-21 04:34:19 -05:00
struct EnableWellOperabilityCheckIter < TypeTag , TTag : : FlowModelParameters > {
static constexpr bool value = false ;
} ;
template < class TypeTag >
2023-10-23 08:55:51 -05:00
struct DebugEmitCellPartition < TypeTag , TTag : : FlowModelParameters > {
static constexpr bool value = false ;
} ;
template < class TypeTag >
2021-09-06 03:08:28 -05:00
struct RelaxedWellFlowTol < TypeTag , TTag : : FlowModelParameters > {
2020-08-27 04:38:38 -05:00
using type = GetPropType < TypeTag , Scalar > ;
2022-04-04 02:53:09 -05:00
static constexpr type value = 1e-3 ;
2020-08-27 04:38:38 -05:00
} ;
template < class TypeTag >
2021-09-06 03:08:28 -05:00
struct RelaxedPressureTolMsw < TypeTag , TTag : : FlowModelParameters > {
2020-08-27 04:38:38 -05:00
using type = GetPropType < TypeTag , Scalar > ;
2022-04-04 02:53:09 -05:00
static constexpr type value = 1.0e4 ;
2020-08-27 04:38:38 -05:00
} ;
2021-04-15 01:14:52 -05:00
template < class TypeTag >
struct MaximumNumberOfWellSwitches < TypeTag , TTag : : FlowModelParameters > {
static constexpr int value = 3 ;
} ;
2023-05-23 05:44:06 -05:00
template < class TypeTag >
struct UseAverageDensityMsWells < TypeTag , TTag : : FlowModelParameters > {
static constexpr bool value = false ;
} ;
2023-08-16 05:50:06 -05:00
template < class TypeTag >
struct LocalWellSolveControlSwitching < TypeTag , TTag : : FlowModelParameters > {
2023-09-25 08:10:34 -05:00
static constexpr bool value = false ;
2023-08-16 05:50:06 -05:00
} ;
2023-06-16 05:15:06 -05:00
// Network solver parameters
template < class TypeTag >
struct NetworkMaxStrictIterations < TypeTag , TTag : : FlowModelParameters > {
static constexpr int value = 100 ;
} ;
template < class TypeTag >
struct NetworkMaxIterations < TypeTag , TTag : : FlowModelParameters > {
static constexpr int value = 200 ;
} ;
2023-06-14 02:18:53 -05:00
template < class TypeTag >
struct NonlinearSolver < TypeTag , TTag : : FlowModelParameters > {
static constexpr auto value = " newton " ;
} ;
template < class TypeTag >
struct LocalSolveApproach < TypeTag , TTag : : FlowModelParameters > {
static constexpr auto value = " jacobi " ;
} ;
template < class TypeTag >
struct MaxLocalSolveIterations < TypeTag , TTag : : FlowModelParameters > {
static constexpr int value = 20 ;
} ;
template < class TypeTag >
struct LocalToleranceScalingMb < TypeTag , TTag : : FlowModelParameters > {
using type = GetPropType < TypeTag , Scalar > ;
static constexpr type value = 1.0 ;
} ;
template < class TypeTag >
struct LocalToleranceScalingCnv < TypeTag , TTag : : FlowModelParameters > {
using type = GetPropType < TypeTag , Scalar > ;
static constexpr type value = 0.01 ;
} ;
template < class TypeTag >
2023-10-10 11:25:24 -05:00
struct NlddNumInitialNewtonIter < TypeTag , TTag : : FlowModelParameters > {
using type = int ;
static constexpr auto value = type { 1 } ;
} ;
template < class TypeTag >
2023-06-14 02:18:53 -05:00
struct NumLocalDomains < TypeTag , TTag : : FlowModelParameters > {
using type = int ;
static constexpr auto value = 0 ;
} ;
template < class TypeTag >
struct LocalDomainsPartitioningImbalance < TypeTag , TTag : : FlowModelParameters > {
using type = GetPropType < TypeTag , Scalar > ;
static constexpr auto value = type { 1.03 } ;
} ;
template < class TypeTag >
struct LocalDomainsPartitioningMethod < TypeTag , TTag : : FlowModelParameters > {
static constexpr auto value = " zoltan " ;
} ;
2023-07-03 05:16:30 -05:00
template < class TypeTag >
struct LocalDomainsOrderingMeasure < TypeTag , TTag : : FlowModelParameters > {
2023-11-15 02:36:01 -06:00
static constexpr auto value = " maxpressure " ;
2023-07-03 05:16:30 -05:00
} ;
2018-08-31 05:32:41 -05:00
// if openMP is available, determine the number threads per process automatically.
# if _OPENMP
2020-08-27 04:38:38 -05:00
template < class TypeTag >
struct ThreadsPerProcess < TypeTag , TTag : : FlowModelParameters > {
static constexpr int value = - 1 ;
} ;
2018-08-31 05:32:41 -05:00
# endif
2020-08-21 06:42:08 -05:00
} // namespace Opm::Properties
2018-06-21 05:14:17 -05:00
namespace Opm
{
/// Solver parameters for the BlackoilModel.
template < class TypeTag >
struct BlackoilModelParametersEbos
{
private :
2020-08-26 03:49:52 -05:00
using Scalar = GetPropType < TypeTag , Properties : : Scalar > ;
2018-06-21 05:14:17 -05:00
public :
/// Max relative change in bhp in single iteration.
double dbhp_max_rel_ ;
/// Max absolute change in well volume fraction in single iteration.
double dwell_fraction_max_ ;
/// Absolute max limit for residuals.
double max_residual_allowed_ ;
2020-07-02 04:52:44 -05:00
//// Max allowed pore volume faction where CNV is violated. Below the
//// relaxed tolerance tolerance_cnv_relaxed_ is used.
double relaxed_max_pv_fraction_ ;
2018-06-21 05:14:17 -05:00
/// Relative mass balance tolerance (total mass balance error).
double tolerance_mb_ ;
/// Local convergence tolerance (max of local saturation errors).
double tolerance_cnv_ ;
2022-09-07 07:12:03 -05:00
/// Relaxed local convergence tolerance (can be used when iter >= min_strict_cnv_iter_ && cnvViolatedPV < relaxed_max_pv_fraction_).
2018-06-21 05:14:17 -05:00
double tolerance_cnv_relaxed_ ;
/// Well convergence tolerance.
double tolerance_wells_ ;
/// Tolerance for the well control equations
// TODO: it might need to distinguish between rate control and pressure control later
double tolerance_well_control_ ;
/// Tolerance for the pressure equations for multisegment wells
double tolerance_pressure_ms_wells_ ;
2021-09-06 03:08:28 -05:00
/// Relaxed tolerance for for the well flow residual
double relaxed_tolerance_flow_well_ ;
2020-06-02 07:54:45 -05:00
2021-09-06 03:08:28 -05:00
/// Relaxed tolerance for the MSW pressure solution
double relaxed_tolerance_pressure_ms_well_ ;
2020-06-02 07:54:45 -05:00
2018-06-21 05:14:17 -05:00
/// Maximum pressure change over an iteratio for ms wells
double max_pressure_change_ms_wells_ ;
/// Maximum inner iteration number for ms wells
int max_inner_iter_ms_wells_ ;
2021-09-06 03:08:28 -05:00
/// Strict inner iteration number for wells
int strict_inner_iter_wells_ ;
2020-06-02 07:54:45 -05:00
2021-09-06 03:08:28 -05:00
/// Newton iteration where wells are stricly convergent
int strict_outer_iter_wells_ ;
2021-09-02 06:47:38 -05:00
2022-06-29 05:54:42 -05:00
/// Regularization factor for wells
2023-03-23 10:47:03 -05:00
double regularization_factor_wells_ ;
2020-06-02 07:54:45 -05:00
2021-06-04 03:51:15 -05:00
/// Maximum newton iterations with inner well iterations
int max_niter_inner_well_iter_ ;
2020-06-02 07:54:45 -05:00
2021-04-16 07:44:14 -05:00
/// Whether to shut unsolvable well
bool shut_unsolvable_wells_ ;
2020-06-02 07:54:45 -05:00
/// Maximum inner iteration number for standard wells
int max_inner_iter_wells_ ;
2018-06-21 05:14:17 -05:00
/// Maximum iteration number of the well equation solution
int max_welleq_iter_ ;
/// Tolerance for time step in seconds where single precision can be used
/// for solving for the Jacobian
double maxSinglePrecisionTimeStep_ ;
2022-09-07 07:12:03 -05:00
/// Minimum number of Newton iterations before we can use relaxed CNV convergence criterion
int min_strict_cnv_iter_ ;
2018-06-21 05:14:17 -05:00
/// Solve well equation initially
bool solve_welleq_initially_ ;
/// Update scaling factors for mass balance equations
bool update_equations_scaling_ ;
/// Try to detect oscillation or stagnation.
bool use_update_stabilization_ ;
/// Whether to use MultisegmentWell to handle multisegment wells
/// it is something temporary before the multisegment well model is considered to be
/// well developed and tested.
/// if it is false, we will handle multisegment wells as standard wells, which will be
/// the default behavoir for the moment. Later, we might set it to be true by default if necessary
bool use_multisegment_well_ ;
/// The file name of the deck
std : : string deck_file_name_ ;
2021-04-15 01:14:52 -05:00
/// Whether to add influences of wells between cells to the matrix and preconditioner matrix
2018-06-21 05:14:17 -05:00
bool matrix_add_well_contributions_ ;
2021-04-15 01:14:52 -05:00
/// Whether to check well operability
2021-09-29 09:01:16 -05:00
bool check_well_operability_ ;
2021-04-15 01:14:52 -05:00
/// Whether to check well operability during iterations
2021-09-29 09:01:16 -05:00
bool check_well_operability_iter_ ;
2021-09-21 04:34:19 -05:00
2021-04-15 01:14:52 -05:00
/// Maximum number of times a well can switch to the same controt
int max_number_of_well_switches_ ;
2023-05-23 05:44:06 -05:00
/// Whether to approximate segment densities by averaging over segment and its outlet
bool use_average_density_ms_wells_ ;
2023-08-16 05:50:06 -05:00
/// Whether to allow control switching during local well solutions
bool local_well_solver_control_switching_ ;
2023-06-16 05:15:06 -05:00
/// Maximum number of iterations in the network solver before relaxing tolerance
int network_max_strict_iterations_ ;
/// Maximum number of iterations in the network solver before giving up
int network_max_iterations_ ;
2021-04-15 01:14:52 -05:00
2023-06-14 02:18:53 -05:00
/// Nonlinear solver type: newton or nldd.
std : : string nonlinear_solver_ ;
/// 'jacobi' and 'gauss-seidel' supported.
2023-07-03 06:05:21 -05:00
DomainSolveApproach local_solve_approach_ { DomainSolveApproach : : Jacobi } ;
2023-06-14 02:18:53 -05:00
int max_local_solve_iterations_ ;
double local_tolerance_scaling_mb_ ;
double local_tolerance_scaling_cnv_ ;
2023-10-10 11:25:24 -05:00
int nldd_num_initial_newton_iter_ { 1 } ;
2023-06-14 02:18:53 -05:00
int num_local_domains_ { 0 } ;
double local_domain_partition_imbalance_ { 1.03 } ;
std : : string local_domain_partition_method_ ;
2023-11-15 02:36:01 -06:00
DomainOrderingMeasure local_domain_ordering_ { DomainOrderingMeasure : : MaxPressure } ;
2021-09-21 04:34:19 -05:00
2023-10-23 08:55:51 -05:00
bool write_partitions_ { false } ;
2018-06-21 05:14:17 -05:00
/// Construct from user parameters or defaults.
BlackoilModelParametersEbos ( )
{
2018-08-08 08:45:57 -05:00
dbhp_max_rel_ = EWOMS_GET_PARAM ( TypeTag , Scalar , DbhpMaxRel ) ;
dwell_fraction_max_ = EWOMS_GET_PARAM ( TypeTag , Scalar , DwellFractionMax ) ;
2018-08-06 08:59:35 -05:00
max_residual_allowed_ = EWOMS_GET_PARAM ( TypeTag , Scalar , MaxResidualAllowed ) ;
2020-07-02 04:52:44 -05:00
relaxed_max_pv_fraction_ = EWOMS_GET_PARAM ( TypeTag , Scalar , RelaxedMaxPvFraction ) ;
2018-08-06 08:59:35 -05:00
tolerance_mb_ = EWOMS_GET_PARAM ( TypeTag , Scalar , ToleranceMb ) ;
tolerance_cnv_ = EWOMS_GET_PARAM ( TypeTag , Scalar , ToleranceCnv ) ;
tolerance_cnv_relaxed_ = EWOMS_GET_PARAM ( TypeTag , Scalar , ToleranceCnvRelaxed ) ;
tolerance_wells_ = EWOMS_GET_PARAM ( TypeTag , Scalar , ToleranceWells ) ;
tolerance_well_control_ = EWOMS_GET_PARAM ( TypeTag , Scalar , ToleranceWellControl ) ;
max_welleq_iter_ = EWOMS_GET_PARAM ( TypeTag , int , MaxWelleqIter ) ;
use_multisegment_well_ = EWOMS_GET_PARAM ( TypeTag , bool , UseMultisegmentWell ) ;
tolerance_pressure_ms_wells_ = EWOMS_GET_PARAM ( TypeTag , Scalar , TolerancePressureMsWells ) ;
2021-09-06 03:08:28 -05:00
relaxed_tolerance_flow_well_ = EWOMS_GET_PARAM ( TypeTag , Scalar , RelaxedWellFlowTol ) ;
relaxed_tolerance_pressure_ms_well_ = EWOMS_GET_PARAM ( TypeTag , Scalar , RelaxedPressureTolMsw ) ;
2018-08-06 08:59:35 -05:00
max_pressure_change_ms_wells_ = EWOMS_GET_PARAM ( TypeTag , Scalar , MaxPressureChangeMsWells ) ;
max_inner_iter_ms_wells_ = EWOMS_GET_PARAM ( TypeTag , int , MaxInnerIterMsWells ) ;
2021-09-06 03:08:28 -05:00
strict_inner_iter_wells_ = EWOMS_GET_PARAM ( TypeTag , int , StrictInnerIterWells ) ;
strict_outer_iter_wells_ = EWOMS_GET_PARAM ( TypeTag , int , StrictOuterIterWells ) ;
2022-06-29 05:54:42 -05:00
regularization_factor_wells_ = EWOMS_GET_PARAM ( TypeTag , Scalar , RegularizationFactorWells ) ;
2021-06-11 01:09:35 -05:00
max_niter_inner_well_iter_ = EWOMS_GET_PARAM ( TypeTag , int , MaxNewtonIterationsWithInnerWellIterations ) ;
2021-04-16 07:44:14 -05:00
shut_unsolvable_wells_ = EWOMS_GET_PARAM ( TypeTag , bool , ShutUnsolvableWells ) ;
2020-06-02 07:54:45 -05:00
max_inner_iter_wells_ = EWOMS_GET_PARAM ( TypeTag , int , MaxInnerIterWells ) ;
2018-08-06 08:59:35 -05:00
maxSinglePrecisionTimeStep_ = EWOMS_GET_PARAM ( TypeTag , Scalar , MaxSinglePrecisionDays ) * 24 * 60 * 60 ;
2022-09-07 07:12:03 -05:00
min_strict_cnv_iter_ = EWOMS_GET_PARAM ( TypeTag , int , MinStrictCnvIter ) ;
2018-08-06 08:59:35 -05:00
solve_welleq_initially_ = EWOMS_GET_PARAM ( TypeTag , bool , SolveWelleqInitially ) ;
update_equations_scaling_ = EWOMS_GET_PARAM ( TypeTag , bool , UpdateEquationsScaling ) ;
use_update_stabilization_ = EWOMS_GET_PARAM ( TypeTag , bool , UseUpdateStabilization ) ;
matrix_add_well_contributions_ = EWOMS_GET_PARAM ( TypeTag , bool , MatrixAddWellContributions ) ;
2021-09-29 09:01:16 -05:00
check_well_operability_ = EWOMS_GET_PARAM ( TypeTag , bool , EnableWellOperabilityCheck ) ;
check_well_operability_iter_ = EWOMS_GET_PARAM ( TypeTag , bool , EnableWellOperabilityCheckIter ) ;
2021-04-15 01:14:52 -05:00
max_number_of_well_switches_ = EWOMS_GET_PARAM ( TypeTag , int , MaximumNumberOfWellSwitches ) ;
2023-05-23 05:44:06 -05:00
use_average_density_ms_wells_ = EWOMS_GET_PARAM ( TypeTag , bool , UseAverageDensityMsWells ) ;
2023-08-16 05:50:06 -05:00
local_well_solver_control_switching_ = EWOMS_GET_PARAM ( TypeTag , bool , LocalWellSolveControlSwitching ) ;
2023-06-14 02:18:53 -05:00
nonlinear_solver_ = EWOMS_GET_PARAM ( TypeTag , std : : string , NonlinearSolver ) ;
2023-07-03 06:05:21 -05:00
std : : string approach = EWOMS_GET_PARAM ( TypeTag , std : : string , LocalSolveApproach ) ;
if ( approach = = " jacobi " ) {
local_solve_approach_ = DomainSolveApproach : : Jacobi ;
} else if ( approach = = " gauss-seidel " ) {
local_solve_approach_ = DomainSolveApproach : : GaussSeidel ;
} else {
throw std : : runtime_error ( " Invalid domain solver approach ' " + approach + " ' specified. " ) ;
}
2023-06-14 02:18:53 -05:00
max_local_solve_iterations_ = EWOMS_GET_PARAM ( TypeTag , int , MaxLocalSolveIterations ) ;
local_tolerance_scaling_mb_ = EWOMS_GET_PARAM ( TypeTag , double , LocalToleranceScalingMb ) ;
local_tolerance_scaling_cnv_ = EWOMS_GET_PARAM ( TypeTag , double , LocalToleranceScalingCnv ) ;
2023-10-10 11:25:24 -05:00
nldd_num_initial_newton_iter_ = EWOMS_GET_PARAM ( TypeTag , int , NlddNumInitialNewtonIter ) ;
2023-06-14 02:18:53 -05:00
num_local_domains_ = EWOMS_GET_PARAM ( TypeTag , int , NumLocalDomains ) ;
local_domain_partition_imbalance_ = std : : max ( 1.0 , EWOMS_GET_PARAM ( TypeTag , double , LocalDomainsPartitioningImbalance ) ) ;
local_domain_partition_method_ = EWOMS_GET_PARAM ( TypeTag , std : : string , LocalDomainsPartitioningMethod ) ;
2018-06-21 05:14:17 -05:00
deck_file_name_ = EWOMS_GET_PARAM ( TypeTag , std : : string , EclDeckFileName ) ;
2023-06-16 05:15:06 -05:00
network_max_strict_iterations_ = EWOMS_GET_PARAM ( TypeTag , int , NetworkMaxStrictIterations ) ;
2023-07-03 05:16:30 -05:00
network_max_iterations_ = EWOMS_GET_PARAM ( TypeTag , int , NetworkMaxIterations ) ;
std : : string measure = EWOMS_GET_PARAM ( TypeTag , std : : string , LocalDomainsOrderingMeasure ) ;
if ( measure = = " residual " ) {
local_domain_ordering_ = DomainOrderingMeasure : : Residual ;
2023-11-15 02:36:01 -06:00
} else if ( measure = = " maxpressure " ) {
local_domain_ordering_ = DomainOrderingMeasure : : MaxPressure ;
} else if ( measure = = " averagepressure " ) {
2023-07-03 05:16:30 -05:00
local_domain_ordering_ = DomainOrderingMeasure : : AveragePressure ;
} else {
throw std : : runtime_error ( " Invalid domain ordering ' " + measure + " ' specified. " ) ;
}
2023-10-23 08:55:51 -05:00
write_partitions_ = EWOMS_GET_PARAM ( TypeTag , bool , DebugEmitCellPartition ) ;
2018-06-21 05:14:17 -05:00
}
static void registerParameters ( )
{
2018-08-08 08:45:57 -05:00
EWOMS_REGISTER_PARAM ( TypeTag , Scalar , DbhpMaxRel , " Maximum relative change of the bottom-hole pressure in a single iteration " ) ;
EWOMS_REGISTER_PARAM ( TypeTag , Scalar , DwellFractionMax , " Maximum absolute change of a well's volume fraction in a single iteration " ) ;
2018-08-06 08:59:35 -05:00
EWOMS_REGISTER_PARAM ( TypeTag , Scalar , MaxResidualAllowed , " Absolute maximum tolerated for residuals without cutting the time step size " ) ;
2020-07-02 04:52:44 -05:00
EWOMS_REGISTER_PARAM ( TypeTag , Scalar , RelaxedMaxPvFraction , " The fraction of the pore volume of the reservoir "
" where the volumetric error (CNV) may be voilated during strict Newton iterations. " ) ;
2018-08-06 08:59:35 -05:00
EWOMS_REGISTER_PARAM ( TypeTag , Scalar , ToleranceMb , " Tolerated mass balance error relative to total mass present " ) ;
EWOMS_REGISTER_PARAM ( TypeTag , Scalar , ToleranceCnv , " Local convergence tolerance (Maximum of local saturation errors) " ) ;
EWOMS_REGISTER_PARAM ( TypeTag , Scalar , ToleranceCnvRelaxed , " Relaxed local convergence tolerance that applies for iterations after the iterations with the strict tolerance " ) ;
EWOMS_REGISTER_PARAM ( TypeTag , Scalar , ToleranceWells , " Well convergence tolerance " ) ;
EWOMS_REGISTER_PARAM ( TypeTag , Scalar , ToleranceWellControl , " Tolerance for the well control equations " ) ;
EWOMS_REGISTER_PARAM ( TypeTag , int , MaxWelleqIter , " Maximum number of iterations to determine solution the well equations " ) ;
EWOMS_REGISTER_PARAM ( TypeTag , bool , UseMultisegmentWell , " Use the well model for multi-segment wells instead of the one for single-segment wells " ) ;
EWOMS_REGISTER_PARAM ( TypeTag , Scalar , TolerancePressureMsWells , " Tolerance for the pressure equations for multi-segment wells " ) ;
2021-09-06 03:08:28 -05:00
EWOMS_REGISTER_PARAM ( TypeTag , Scalar , RelaxedWellFlowTol , " Relaxed tolerance for the well flow residual " ) ;
EWOMS_REGISTER_PARAM ( TypeTag , Scalar , RelaxedPressureTolMsw , " Relaxed tolerance for the MSW pressure solution " ) ;
2018-08-06 08:59:35 -05:00
EWOMS_REGISTER_PARAM ( TypeTag , Scalar , MaxPressureChangeMsWells , " Maximum relative pressure change for a single iteration of the multi-segment well model " ) ;
EWOMS_REGISTER_PARAM ( TypeTag , int , MaxInnerIterMsWells , " Maximum number of inner iterations for multi-segment wells " ) ;
2021-09-06 03:08:28 -05:00
EWOMS_REGISTER_PARAM ( TypeTag , int , StrictInnerIterWells , " Number of inner well iterations with strict tolerance " ) ;
EWOMS_REGISTER_PARAM ( TypeTag , int , StrictOuterIterWells , " Number of newton iterations for which wells are checked with strict tolerance " ) ;
2021-06-04 03:51:15 -05:00
EWOMS_REGISTER_PARAM ( TypeTag , int , MaxNewtonIterationsWithInnerWellIterations , " Maximum newton iterations with inner well iterations " ) ;
2021-04-16 07:44:14 -05:00
EWOMS_REGISTER_PARAM ( TypeTag , bool , ShutUnsolvableWells , " Shut unsolvable wells " ) ;
2020-06-02 07:54:45 -05:00
EWOMS_REGISTER_PARAM ( TypeTag , int , MaxInnerIterWells , " Maximum number of inner iterations for standard wells " ) ;
2020-10-15 10:56:11 -05:00
EWOMS_REGISTER_PARAM ( TypeTag , bool , AlternativeWellRateInit , " Use alternative well rate initialization procedure " ) ;
2022-06-29 05:54:42 -05:00
EWOMS_REGISTER_PARAM ( TypeTag , Scalar , RegularizationFactorWells , " Regularization factor for wells " ) ;
2018-08-06 08:59:35 -05:00
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 " ) ;
2022-09-07 07:12:03 -05:00
EWOMS_REGISTER_PARAM ( TypeTag , int , MinStrictCnvIter , " Minimum number of Newton iterations before relaxed tolerances can be used for the CNV convergence criterion " ) ;
2018-08-06 08:59:35 -05:00
EWOMS_REGISTER_PARAM ( TypeTag , bool , SolveWelleqInitially , " Fully solve the well equations before each iteration of the reservoir model " ) ;
EWOMS_REGISTER_PARAM ( TypeTag , bool , UpdateEquationsScaling , " Update scaling factors for mass balance equations during the run " ) ;
EWOMS_REGISTER_PARAM ( TypeTag , bool , UseUpdateStabilization , " Try to detect and correct oscillations or stagnation during the Newton method " ) ;
EWOMS_REGISTER_PARAM ( TypeTag , bool , MatrixAddWellContributions , " Explicitly specify the influences of wells between cells in the Jacobian and preconditioner matrices " ) ;
2019-10-22 04:29:27 -05:00
EWOMS_REGISTER_PARAM ( TypeTag , bool , EnableWellOperabilityCheck , " Enable the well operability checking " ) ;
2021-09-21 04:34:19 -05:00
EWOMS_REGISTER_PARAM ( TypeTag , bool , EnableWellOperabilityCheckIter , " Enable the well operability checking during iterations " ) ;
2021-04-15 01:14:52 -05:00
EWOMS_REGISTER_PARAM ( TypeTag , int , MaximumNumberOfWellSwitches , " Maximum number of times a well can switch to the same control " ) ;
2023-05-23 05:44:06 -05:00
EWOMS_REGISTER_PARAM ( TypeTag , bool , UseAverageDensityMsWells , " Approximate segment densitities by averaging over segment and its outlet " ) ;
2023-08-16 05:50:06 -05:00
EWOMS_REGISTER_PARAM ( TypeTag , bool , LocalWellSolveControlSwitching , " Allow control switching during local well solutions " ) ;
2023-06-16 05:15:06 -05:00
EWOMS_REGISTER_PARAM ( TypeTag , int , NetworkMaxStrictIterations , " Maximum iterations in network solver before relaxing tolerance " ) ;
EWOMS_REGISTER_PARAM ( TypeTag , int , NetworkMaxIterations , " Maximum number of iterations in the network solver before giving up " ) ;
2023-06-14 02:18:53 -05:00
EWOMS_REGISTER_PARAM ( TypeTag , std : : string , NonlinearSolver , " Choose nonlinear solver. Valid choices are newton or nldd. " ) ;
EWOMS_REGISTER_PARAM ( TypeTag , std : : string , LocalSolveApproach , " Choose local solve approach. Valid choices are jacobi and gauss-seidel " ) ;
EWOMS_REGISTER_PARAM ( TypeTag , int , MaxLocalSolveIterations , " Max iterations for local solves with NLDD nonlinear solver. " ) ;
EWOMS_REGISTER_PARAM ( TypeTag , Scalar , LocalToleranceScalingMb , " Set lower than 1.0 to use stricter convergence tolerance for local solves. " ) ;
EWOMS_REGISTER_PARAM ( TypeTag , Scalar , LocalToleranceScalingCnv , " Set lower than 1.0 to use stricter convergence tolerance for local solves. " ) ;
2023-10-10 11:25:24 -05:00
EWOMS_REGISTER_PARAM ( TypeTag , int , NlddNumInitialNewtonIter , " Number of initial global Newton iterations when running the NLDD nonlinear solver. " ) ;
2023-06-14 02:18:53 -05:00
EWOMS_REGISTER_PARAM ( TypeTag , int , NumLocalDomains , " Number of local domains for NLDD nonlinear solver. " ) ;
EWOMS_REGISTER_PARAM ( TypeTag , Scalar , LocalDomainsPartitioningImbalance , " Subdomain partitioning imbalance tolerance. 1.03 is 3 percent imbalance. " ) ;
EWOMS_REGISTER_PARAM ( TypeTag , std : : string , LocalDomainsPartitioningMethod , " Subdomain partitioning method. "
" Allowed values are 'zoltan', 'simple', and the name of a partition file ending with '.partition'. " ) ;
2023-07-03 05:16:30 -05:00
EWOMS_REGISTER_PARAM ( TypeTag , std : : string , LocalDomainsOrderingMeasure , " Subdomain ordering measure. "
2023-11-15 02:36:01 -06:00
" Allowed values are 'maxpressure', 'averagepressure' and 'residual'. " ) ;
2023-10-23 08:55:51 -05:00
EWOMS_REGISTER_PARAM ( TypeTag , bool , DebugEmitCellPartition , " Whether or not to emit cell partitions as a debugging aid. " ) ;
EWOMS_HIDE_PARAM ( TypeTag , DebugEmitCellPartition ) ;
2018-06-21 05:14:17 -05:00
}
} ;
} // namespace Opm
# endif // OPM_BLACKOILMODELPARAMETERS_EBOS_HEADER_INCLUDED