move BlackoilModel parameters to TypeTag-free parameter system

This commit is contained in:
Arne Morten Kvarving 2024-07-06 10:22:47 +02:00
parent febb359951
commit 3716ee664d
10 changed files with 230 additions and 575 deletions

View File

@ -54,9 +54,12 @@ class FlowExpProblem;
namespace Opm::Properties { namespace Opm::Properties {
namespace TTag { namespace TTag {
struct FlowExpTypeTag {
using InheritsFrom = std::tuple<FlowModelParameters, FlowBaseProblem, BlackOilModel, EclTimeSteppingParameters>; struct FlowExpTypeTag
{
using InheritsFrom = std::tuple<FlowBaseProblem, BlackOilModel, EclTimeSteppingParameters>;
}; };
} }
// Set the problem class // Set the problem class
@ -120,22 +123,6 @@ struct LinearSolverBackend<TypeTag, TTag::FlowExpTypeTag> {
} // namespace Opm::Properties } // namespace Opm::Properties
namespace Opm::Parameters {
// currently, flowexp uses the non-multisegment well model by default to avoid
// regressions. the --use-multisegment-well=true|false command line parameter is still
// available in flowexp, but hidden from view.
template<class TypeTag>
struct UseMultisegmentWell<TypeTag, Properties::TTag::FlowExpTypeTag>
{ static constexpr bool value = false; };
// set some properties that are only required by the well model
template<class TypeTag>
struct MatrixAddWellContributions<TypeTag, Properties::TTag::FlowExpTypeTag>
{ static constexpr bool value = false; };
} // namespace Opm::Parameters
namespace Opm { namespace Opm {
template <class TypeTag> template <class TypeTag>
class FlowExpProblem : public FlowProblem<TypeTag> //, public FvBaseProblem<TypeTag> class FlowExpProblem : public FlowProblem<TypeTag> //, public FvBaseProblem<TypeTag>
@ -165,33 +152,33 @@ public:
BlackoilModelParameters<TypeTag>::registerParameters(); BlackoilModelParameters<TypeTag>::registerParameters();
Parameters::Register<Parameters::EnableTerminalOutput>("Do *NOT* use!"); Parameters::Register<Parameters::EnableTerminalOutput>("Do *NOT* use!");
Parameters::hideParam<TypeTag, Parameters::DbhpMaxRel>(); Parameters::Hide<Parameters::DbhpMaxRel<Scalar>>();
Parameters::hideParam<TypeTag, Parameters::DwellFractionMax>(); Parameters::Hide<Parameters::DwellFractionMax<Scalar>>();
Parameters::hideParam<TypeTag, Parameters::MaxResidualAllowed>(); Parameters::Hide<Parameters::MaxResidualAllowed<Scalar>>();
Parameters::hideParam<TypeTag, Parameters::ToleranceMb>(); Parameters::Hide<Parameters::ToleranceMb<Scalar>>();
Parameters::hideParam<TypeTag, Parameters::ToleranceMbRelaxed>(); Parameters::Hide<Parameters::ToleranceMbRelaxed<Scalar>>();
Parameters::hideParam<TypeTag, Parameters::ToleranceCnv>(); Parameters::Hide<Parameters::ToleranceCnv<Scalar>>();
Parameters::hideParam<TypeTag, Parameters::ToleranceCnvRelaxed>(); Parameters::Hide<Parameters::ToleranceCnvRelaxed<Scalar>>();
Parameters::hideParam<TypeTag, Parameters::ToleranceWells>(); Parameters::Hide<Parameters::ToleranceWells<Scalar>>();
Parameters::hideParam<TypeTag, Parameters::ToleranceWellControl>(); Parameters::Hide<Parameters::ToleranceWellControl<Scalar>>();
Parameters::hideParam<TypeTag, Parameters::MaxWelleqIter>(); Parameters::Hide<Parameters::MaxWelleqIter>();
Parameters::hideParam<TypeTag, Parameters::UseMultisegmentWell>(); Parameters::Hide<Parameters::UseMultisegmentWell>();
Parameters::hideParam<TypeTag, Parameters::TolerancePressureMsWells>(); Parameters::Hide<Parameters::TolerancePressureMsWells<Scalar>>();
Parameters::hideParam<TypeTag, Parameters::MaxPressureChangeMsWells>(); Parameters::Hide<Parameters::MaxPressureChangeMsWells<Scalar>>();
Parameters::hideParam<TypeTag, Parameters::MaxInnerIterMsWells>(); Parameters::Hide<Parameters::MaxInnerIterMsWells>();
Parameters::hideParam<TypeTag, Parameters::MaxNewtonIterationsWithInnerWellIterations>(); Parameters::Hide<Parameters::MaxNewtonIterationsWithInnerWellIterations>();
Parameters::hideParam<TypeTag, Parameters::MaxInnerIterWells>(); Parameters::Hide<Parameters::MaxInnerIterWells>();
Parameters::hideParam<TypeTag, Parameters::MaxSinglePrecisionDays>(); Parameters::Hide<Parameters::MaxSinglePrecisionDays<Scalar>>();
Parameters::hideParam<TypeTag, Parameters::MinStrictCnvIter>(); Parameters::Hide<Parameters::MinStrictCnvIter>();
Parameters::hideParam<TypeTag, Parameters::MinStrictMbIter>(); Parameters::Hide<Parameters::MinStrictMbIter>();
Parameters::hideParam<TypeTag, Parameters::SolveWelleqInitially>(); Parameters::Hide<Parameters::SolveWelleqInitially>();
Parameters::hideParam<TypeTag, Parameters::UpdateEquationsScaling>(); Parameters::Hide<Parameters::UpdateEquationsScaling>();
Parameters::hideParam<TypeTag, Parameters::UseUpdateStabilization>(); Parameters::Hide<Parameters::UseUpdateStabilization>();
Parameters::hideParam<TypeTag, Parameters::MatrixAddWellContributions>(); Parameters::Hide<Parameters::MatrixAddWellContributions>();
Parameters::Hide<Parameters::EnableTerminalOutput>(); Parameters::Hide<Parameters::EnableTerminalOutput>();
// if openMP is available, set the default the number of threads per process for the main // if openMP is available, set the default the number of threads per process for the main
// simulation to 2 (instead of grabbing everything that is available). // simulation to 1 (instead of grabbing everything that is available).
#if _OPENMP #if _OPENMP
Parameters::SetDefault<Parameters::ThreadsPerProcess>(2); Parameters::SetDefault<Parameters::ThreadsPerProcess>(2);
#endif #endif
@ -206,6 +193,12 @@ public:
Parameters::SetDefault<Parameters::EclNewtonRelaxedVolumeFraction<Scalar>>(0.0); Parameters::SetDefault<Parameters::EclNewtonRelaxedVolumeFraction<Scalar>>(0.0);
Parameters::SetDefault<Parameters::EclNewtonSumTolerance<Scalar>>(1e-5); Parameters::SetDefault<Parameters::EclNewtonSumTolerance<Scalar>>(1e-5);
Parameters::SetDefault<Parameters::EnableTerminalOutput>(false); Parameters::SetDefault<Parameters::EnableTerminalOutput>(false);
// currently, flowexp uses the non-multisegment well model by default to avoid
// regressions. the --use-multisegment-well=true|false command line parameter is still
// available in flowexp, but hidden from view.
Parameters::SetDefault<Parameters::UseMultisegmentWell>(false);
Parameters::SetDefault<Parameters::MatrixAddWellContributions>(false);
} }
// inherit the constructors // inherit the constructors

View File

@ -75,7 +75,7 @@ namespace Opm::Properties {
namespace TTag { namespace TTag {
struct FlowProblem { struct FlowProblem {
using InheritsFrom = std::tuple<FlowTimeSteppingParameters, FlowModelParameters, using InheritsFrom = std::tuple<FlowTimeSteppingParameters,
FlowNonLinearSolver, FlowBaseProblem, BlackOilModel>; FlowNonLinearSolver, FlowBaseProblem, BlackOilModel>;
}; };
} }

View File

@ -25,7 +25,6 @@
#include <opm/models/utils/basicproperties.hh> #include <opm/models/utils/basicproperties.hh>
#include <opm/models/utils/parametersystem.hh> #include <opm/models/utils/parametersystem.hh>
#include <opm/models/utils/propertysystem.hh>
#include <opm/simulators/flow/SubDomain.hpp> #include <opm/simulators/flow/SubDomain.hpp>
@ -33,427 +32,106 @@
#include <stdexcept> #include <stdexcept>
#include <string> #include <string>
namespace Opm::Properties::TTag {
struct FlowModelParameters {};
}
namespace Opm::Parameters { namespace Opm::Parameters {
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct EclDeckFileName { using type = Properties::UndefinedProperty; }; struct DbhpMaxRel { static constexpr Scalar value = 1.0; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct DbhpMaxRel { using type = Properties::UndefinedProperty; }; struct DwellFractionMax { static constexpr Scalar value = 0.2; };
template<class TypeTag, class MyTypeTag> struct EclDeckFileName { static constexpr auto value = ""; };
struct DwellFractionMax { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct MaxResidualAllowed { using type = Properties::UndefinedProperty; }; struct MaxResidualAllowed { static constexpr Scalar value = 1e7; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct RelaxedMaxPvFraction { using type = Properties::UndefinedProperty; }; struct RelaxedMaxPvFraction { static constexpr Scalar value = 0.03; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct ToleranceMb { using type = Properties::UndefinedProperty; }; struct ToleranceMb { static constexpr Scalar value = 1e-7; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct ToleranceMbRelaxed { using type = Properties::UndefinedProperty; }; struct ToleranceMbRelaxed { static constexpr Scalar value = 1e-6; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct ToleranceCnv { using type = Properties::UndefinedProperty; }; struct ToleranceCnv { static constexpr Scalar value = 1e-2; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct ToleranceCnvRelaxed { using type = Properties::UndefinedProperty; }; struct ToleranceCnvRelaxed { static constexpr Scalar value = 1.0; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct ToleranceWells { using type = Properties::UndefinedProperty; }; struct ToleranceWells { static constexpr Scalar value = 1e-4; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct ToleranceWellControl { using type = Properties::UndefinedProperty; }; struct ToleranceWellControl { static constexpr Scalar value = 1e-7; };
template<class TypeTag, class MyTypeTag> struct MaxWelleqIter { static constexpr int value = 30; };
struct MaxWelleqIter { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct UseMultisegmentWell { using type = Properties::UndefinedProperty; }; struct MaxSinglePrecisionDays { static constexpr Scalar value = 20.0; };
template<class TypeTag, class MyTypeTag> struct MinStrictCnvIter { static constexpr int value = -1; };
struct MaxSinglePrecisionDays { using type = Properties::UndefinedProperty; }; struct MinStrictMbIter { static constexpr int value = -1; };
struct SolveWelleqInitially { static constexpr bool value = true; };
struct UpdateEquationsScaling { static constexpr bool value = false; };
struct UseUpdateStabilization { static constexpr bool value = true; };
struct MatrixAddWellContributions { static constexpr bool value = false; };
template<class TypeTag, class MyTypeTag> struct UseMultisegmentWell { static constexpr bool value = true; };
struct MinStrictCnvIter { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct MinStrictMbIter { using type = Properties::UndefinedProperty; }; struct TolerancePressureMsWells { static constexpr Scalar value = 0.01*1e5; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct SolveWelleqInitially { using type = Properties::UndefinedProperty; }; struct MaxPressureChangeMsWells { static constexpr Scalar value = 10*1e5; };
template<class TypeTag, class MyTypeTag> struct MaxNewtonIterationsWithInnerWellIterations { static constexpr int value = 8; };
struct UpdateEquationsScaling { using type = Properties::UndefinedProperty; }; struct MaxInnerIterMsWells { static constexpr int value = 100; };
struct MaxInnerIterWells { static constexpr int value = 50; };
struct ShutUnsolvableWells { static constexpr bool value = true; };
struct AlternativeWellRateInit { static constexpr bool value = true; };
struct StrictOuterIterWells { static constexpr int value = 6; };
struct StrictInnerIterWells { static constexpr int value = 40; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct UseUpdateStabilization { using type = Properties::UndefinedProperty; }; struct RegularizationFactorWells { static constexpr Scalar value = 100.0; };
template<class TypeTag, class MyTypeTag> struct EnableWellOperabilityCheck { static constexpr bool value = true; };
struct MatrixAddWellContributions { using type = Properties::UndefinedProperty; }; struct EnableWellOperabilityCheckIter { static constexpr bool value = false; };
struct DebugEmitCellPartition { static constexpr bool value = false; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct EnableWellOperabilityCheck { using type = Properties::UndefinedProperty; }; struct RelaxedWellFlowTol { static constexpr Scalar value = 1e-3; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct EnableWellOperabilityCheckIter { using type = Properties::UndefinedProperty; }; struct RelaxedPressureTolMsw { static constexpr Scalar value = 1e4; };
template<class TypeTag, class MyTypeTag> struct MaximumNumberOfWellSwitches { static constexpr int value = 3; };
struct DebugEmitCellPartition { using type = Properties::UndefinedProperty; }; struct UseAverageDensityMsWells { static constexpr bool value = false; };
struct LocalWellSolveControlSwitching { static constexpr bool value = true; };
// parameters for multisegment wells struct UseImplicitIpr { static constexpr bool value = true; };
template<class TypeTag, class MyTypeTag>
struct TolerancePressureMsWells { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct MaxPressureChangeMsWells { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct MaxInnerIterMsWells { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct StrictInnerIterWells { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct RelaxedWellFlowTol { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct StrictOuterIterWells { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct RelaxedPressureTolMsw { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct RegularizationFactorWells { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct MaxNewtonIterationsWithInnerWellIterations { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct ShutUnsolvableWells { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct MaxInnerIterWells { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct AlternativeWellRateInit { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct MaximumNumberOfWellSwitches { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct UseAverageDensityMsWells { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct LocalWellSolveControlSwitching { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct UseImplicitIpr { using type = Properties::UndefinedProperty; };
// Network solver parameters // Network solver parameters
template<class TypeTag, class MyTypeTag> struct NetworkMaxStrictIterations { static constexpr int value = 100; };
struct NetworkMaxStrictIterations { using type = Properties::UndefinedProperty; }; struct NetworkMaxIterations { static constexpr int value = 200; };
struct NonlinearSolver { static constexpr auto value = "newton"; };
struct LocalSolveApproach { static constexpr auto value = "gauss-seidel"; };
struct MaxLocalSolveIterations { static constexpr int value = 20; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct NetworkMaxIterations { using type = Properties::UndefinedProperty; }; struct LocalToleranceScalingMb { static constexpr Scalar value = 1.0; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct NonlinearSolver { using type = Properties::UndefinedProperty; }; struct LocalToleranceScalingCnv { static constexpr Scalar value = 0.1; };
struct NlddNumInitialNewtonIter { static constexpr int value = 1; };
struct NumLocalDomains { static constexpr int value = 0; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct LocalSolveApproach { using type = Properties::UndefinedProperty; }; struct LocalDomainsPartitioningImbalance { static constexpr Scalar value = 1.03; };
template<class TypeTag, class MyTypeTag> struct LocalDomainsPartitioningMethod { static constexpr auto value = "zoltan"; };
struct MaxLocalSolveIterations { using type = Properties::UndefinedProperty; }; struct LocalDomainsOrderingMeasure { static constexpr auto value = "maxpressure"; };
template<class TypeTag, class MyTypeTag>
struct LocalToleranceScalingMb { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct LocalToleranceScalingCnv { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct NlddNumInitialNewtonIter { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct NumLocalDomains { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct LocalDomainsPartitioningImbalance { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct LocalDomainsPartitioningMethod { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct LocalDomainsOrderingMeasure { using type = Properties::UndefinedProperty; };
template<class TypeTag>
struct DbhpMaxRel<TypeTag, Properties::TTag::FlowModelParameters>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1.0;
};
template<class TypeTag>
struct DwellFractionMax<TypeTag, Properties::TTag::FlowModelParameters>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 0.2;
};
template<class TypeTag>
struct MaxResidualAllowed<TypeTag, Properties::TTag::FlowModelParameters>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e7;
};
template<class TypeTag>
struct RelaxedMaxPvFraction<TypeTag, Properties::TTag::FlowModelParameters>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 0.03;
};
template<class TypeTag>
struct ToleranceMb<TypeTag, Properties::TTag::FlowModelParameters>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e-7;
};
template<class TypeTag>
struct ToleranceMbRelaxed<TypeTag, Properties::TTag::FlowModelParameters>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e-6;
};
template<class TypeTag>
struct ToleranceCnv<TypeTag, Properties::TTag::FlowModelParameters>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e-2;
};
template<class TypeTag>
struct ToleranceCnvRelaxed<TypeTag, Properties::TTag::FlowModelParameters>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1;
};
template<class TypeTag>
struct ToleranceWells<TypeTag, Properties::TTag::FlowModelParameters>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e-4;
};
template<class TypeTag>
struct ToleranceWellControl<TypeTag, Properties::TTag::FlowModelParameters>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e-7;
};
template<class TypeTag>
struct MaxWelleqIter<TypeTag, Properties::TTag::FlowModelParameters>
{ static constexpr int value = 30; };
template<class TypeTag>
struct UseMultisegmentWell<TypeTag, Properties::TTag::FlowModelParameters>
{ static constexpr bool value = true; };
template<class TypeTag>
struct MaxSinglePrecisionDays<TypeTag, Properties::TTag::FlowModelParameters>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 20.0;
};
template<class TypeTag>
struct MinStrictCnvIter<TypeTag, Properties::TTag::FlowModelParameters>
{ static constexpr int value = -1; };
template<class TypeTag>
struct MinStrictMbIter<TypeTag, Properties::TTag::FlowModelParameters>
{ static constexpr int value = -1; };
template<class TypeTag>
struct SolveWelleqInitially<TypeTag, Properties::TTag::FlowModelParameters>
{ static constexpr bool value = true; };
template<class TypeTag>
struct UpdateEquationsScaling<TypeTag, Properties::TTag::FlowModelParameters>
{ static constexpr bool value = false; };
template<class TypeTag>
struct UseUpdateStabilization<TypeTag, Properties::TTag::FlowModelParameters>
{ static constexpr bool value = true; };
template<class TypeTag>
struct MatrixAddWellContributions<TypeTag, Properties::TTag::FlowModelParameters>
{ static constexpr bool value = false; };
template<class TypeTag>
struct TolerancePressureMsWells<TypeTag, Properties::TTag::FlowModelParameters>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 0.01*1e5;
};
template<class TypeTag>
struct MaxPressureChangeMsWells<TypeTag, Properties::TTag::FlowModelParameters>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 10*1e5;
};
template<class TypeTag>
struct MaxNewtonIterationsWithInnerWellIterations<TypeTag, Properties::TTag::FlowModelParameters>
{ static constexpr int value = 8; };
template<class TypeTag>
struct MaxInnerIterMsWells<TypeTag, Properties::TTag::FlowModelParameters>
{ static constexpr int value = 100; };
template<class TypeTag>
struct MaxInnerIterWells<TypeTag, Properties::TTag::FlowModelParameters>
{ static constexpr int value = 50; };
template<class TypeTag>
struct ShutUnsolvableWells<TypeTag, Properties::TTag::FlowModelParameters>
{ static constexpr bool value = true; };
template<class TypeTag>
struct AlternativeWellRateInit<TypeTag, Properties::TTag::FlowModelParameters>
{ static constexpr bool value = true; };
template<class TypeTag>
struct StrictOuterIterWells<TypeTag, Properties::TTag::FlowModelParameters>
{ static constexpr int value = 6; };
template<class TypeTag>
struct StrictInnerIterWells<TypeTag, Properties::TTag::FlowModelParameters>
{ static constexpr int value = 40; };
template<class TypeTag>
struct RegularizationFactorWells<TypeTag, Properties::TTag::FlowModelParameters>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 100;
};
template<class TypeTag>
struct EnableWellOperabilityCheck<TypeTag, Properties::TTag::FlowModelParameters>
{ static constexpr bool value = true; };
template<class TypeTag>
struct EnableWellOperabilityCheckIter<TypeTag, Properties::TTag::FlowModelParameters>
{ static constexpr bool value = false; };
template<class TypeTag>
struct DebugEmitCellPartition<TypeTag, Properties::TTag::FlowModelParameters>
{ static constexpr bool value = false; };
template<class TypeTag>
struct RelaxedWellFlowTol<TypeTag, Properties::TTag::FlowModelParameters>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e-3;
};
template<class TypeTag>
struct RelaxedPressureTolMsw<TypeTag, Properties::TTag::FlowModelParameters>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1.0e4;
};
template<class TypeTag>
struct MaximumNumberOfWellSwitches<TypeTag, Properties::TTag::FlowModelParameters>
{ static constexpr int value = 3; };
template<class TypeTag>
struct UseAverageDensityMsWells<TypeTag, Properties::TTag::FlowModelParameters>
{ static constexpr bool value = false; };
template<class TypeTag>
struct LocalWellSolveControlSwitching<TypeTag, Properties::TTag::FlowModelParameters>
{ static constexpr bool value = true; };
template<class TypeTag>
struct UseImplicitIpr<TypeTag, Properties::TTag::FlowModelParameters>
{ static constexpr bool value = true; };
// Network solver parameters
template<class TypeTag>
struct NetworkMaxStrictIterations<TypeTag, Properties::TTag::FlowModelParameters>
{ static constexpr int value = 100; };
template<class TypeTag>
struct NetworkMaxIterations<TypeTag, Properties::TTag::FlowModelParameters>
{ static constexpr int value = 200; };
template<class TypeTag>
struct NonlinearSolver<TypeTag, Properties::TTag::FlowModelParameters>
{ static constexpr auto value = "newton"; };
template<class TypeTag>
struct LocalSolveApproach<TypeTag, Properties::TTag::FlowModelParameters>
{ static constexpr auto value = "gauss-seidel"; };
template<class TypeTag>
struct MaxLocalSolveIterations<TypeTag, Properties::TTag::FlowModelParameters>
{ static constexpr int value = 20; };
template<class TypeTag>
struct LocalToleranceScalingMb<TypeTag, Properties::TTag::FlowModelParameters>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1.0;
};
template<class TypeTag>
struct LocalToleranceScalingCnv<TypeTag, Properties::TTag::FlowModelParameters>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 0.1;
};
template<class TypeTag>
struct NlddNumInitialNewtonIter<TypeTag, Properties::TTag::FlowModelParameters>
{ static constexpr int value = 1;
};
template<class TypeTag>
struct NumLocalDomains<TypeTag, Properties::TTag::FlowModelParameters>
{ static constexpr int value = 0; };
template<class TypeTag>
struct LocalDomainsPartitioningImbalance<TypeTag, Properties::TTag::FlowModelParameters>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr auto value = type{1.03};
};
template<class TypeTag>
struct LocalDomainsPartitioningMethod<TypeTag, Properties::TTag::FlowModelParameters>
{ static constexpr auto value = "zoltan"; };
template<class TypeTag>
struct LocalDomainsOrderingMeasure<TypeTag, Properties::TTag::FlowModelParameters>
{ static constexpr auto value = "maxpressure"; };
} // namespace Opm::Parameters } // namespace Opm::Parameters
@ -600,44 +278,44 @@ public:
/// Construct from user parameters or defaults. /// Construct from user parameters or defaults.
BlackoilModelParameters() BlackoilModelParameters()
{ {
dbhp_max_rel_= Parameters::get<TypeTag, Parameters::DbhpMaxRel>(); dbhp_max_rel_ = Parameters::Get<Parameters::DbhpMaxRel<Scalar>>();
dwell_fraction_max_ = Parameters::get<TypeTag, Parameters::DwellFractionMax>(); dwell_fraction_max_ = Parameters::Get<Parameters::DwellFractionMax<Scalar>>();
max_residual_allowed_ = Parameters::get<TypeTag, Parameters::MaxResidualAllowed>(); max_residual_allowed_ = Parameters::Get<Parameters::MaxResidualAllowed<Scalar>>();
relaxed_max_pv_fraction_ = Parameters::get<TypeTag, Parameters::RelaxedMaxPvFraction>(); relaxed_max_pv_fraction_ = Parameters::Get<Parameters::RelaxedMaxPvFraction<Scalar>>();
tolerance_mb_ = Parameters::get<TypeTag, Parameters::ToleranceMb>(); tolerance_mb_ = Parameters::Get<Parameters::ToleranceMb<Scalar>>();
tolerance_mb_relaxed_ = std::max(tolerance_mb_, Parameters::get<TypeTag, Parameters::ToleranceMbRelaxed>()); tolerance_mb_relaxed_ = std::max(tolerance_mb_, Parameters::Get<Parameters::ToleranceMbRelaxed<Scalar>>());
tolerance_cnv_ = Parameters::get<TypeTag, Parameters::ToleranceCnv>(); tolerance_cnv_ = Parameters::Get<Parameters::ToleranceCnv<Scalar>>();
tolerance_cnv_relaxed_ = std::max(tolerance_cnv_, Parameters::get<TypeTag, Parameters::ToleranceCnvRelaxed>()); tolerance_cnv_relaxed_ = std::max(tolerance_cnv_, Parameters::Get<Parameters::ToleranceCnvRelaxed<Scalar>>());
tolerance_wells_ = Parameters::get<TypeTag, Parameters::ToleranceWells>(); tolerance_wells_ = Parameters::Get<Parameters::ToleranceWells<Scalar>>();
tolerance_well_control_ = Parameters::get<TypeTag, Parameters::ToleranceWellControl>(); tolerance_well_control_ = Parameters::Get<Parameters::ToleranceWellControl<Scalar>>();
max_welleq_iter_ = Parameters::get<TypeTag, Parameters::MaxWelleqIter>(); max_welleq_iter_ = Parameters::Get<Parameters::MaxWelleqIter>();
use_multisegment_well_ = Parameters::get<TypeTag, Parameters::UseMultisegmentWell>(); use_multisegment_well_ = Parameters::Get<Parameters::UseMultisegmentWell>();
tolerance_pressure_ms_wells_ = Parameters::get<TypeTag, Parameters::TolerancePressureMsWells>(); tolerance_pressure_ms_wells_ = Parameters::Get<Parameters::TolerancePressureMsWells<Scalar>>();
relaxed_tolerance_flow_well_ = Parameters::get<TypeTag, Parameters::RelaxedWellFlowTol>(); relaxed_tolerance_flow_well_ = Parameters::Get<Parameters::RelaxedWellFlowTol<Scalar>>();
relaxed_tolerance_pressure_ms_well_ = Parameters::get<TypeTag, Parameters::RelaxedPressureTolMsw>(); relaxed_tolerance_pressure_ms_well_ = Parameters::Get<Parameters::RelaxedPressureTolMsw<Scalar>>();
max_pressure_change_ms_wells_ = Parameters::get<TypeTag, Parameters::MaxPressureChangeMsWells>(); max_pressure_change_ms_wells_ = Parameters::Get<Parameters::MaxPressureChangeMsWells<Scalar>>();
max_inner_iter_ms_wells_ = Parameters::get<TypeTag, Parameters::MaxInnerIterMsWells>(); max_inner_iter_ms_wells_ = Parameters::Get<Parameters::MaxInnerIterMsWells>();
strict_inner_iter_wells_ = Parameters::get<TypeTag, Parameters::StrictInnerIterWells>(); strict_inner_iter_wells_ = Parameters::Get<Parameters::StrictInnerIterWells>();
strict_outer_iter_wells_ = Parameters::get<TypeTag, Parameters::StrictOuterIterWells>(); strict_outer_iter_wells_ = Parameters::Get<Parameters::StrictOuterIterWells>();
regularization_factor_wells_ = Parameters::get<TypeTag, Parameters::RegularizationFactorWells>(); regularization_factor_wells_ = Parameters::Get<Parameters::RegularizationFactorWells<Scalar>>();
max_niter_inner_well_iter_ = Parameters::get<TypeTag, Parameters::MaxNewtonIterationsWithInnerWellIterations>(); max_niter_inner_well_iter_ = Parameters::Get<Parameters::MaxNewtonIterationsWithInnerWellIterations>();
shut_unsolvable_wells_ = Parameters::get<TypeTag, Parameters::ShutUnsolvableWells>(); shut_unsolvable_wells_ = Parameters::Get<Parameters::ShutUnsolvableWells>();
max_inner_iter_wells_ = Parameters::get<TypeTag, Parameters::MaxInnerIterWells>(); max_inner_iter_wells_ = Parameters::Get<Parameters::MaxInnerIterWells>();
maxSinglePrecisionTimeStep_ = Parameters::get<TypeTag, Parameters::MaxSinglePrecisionDays>() * 24 * 60 * 60; maxSinglePrecisionTimeStep_ = Parameters::Get<Parameters::MaxSinglePrecisionDays<Scalar>>() * 24 * 60 * 60;
min_strict_cnv_iter_ = Parameters::get<TypeTag, Parameters::MinStrictCnvIter>(); min_strict_cnv_iter_ = Parameters::Get<Parameters::MinStrictCnvIter>();
min_strict_mb_iter_ = Parameters::get<TypeTag, Parameters::MinStrictMbIter>(); min_strict_mb_iter_ = Parameters::Get<Parameters::MinStrictMbIter>();
solve_welleq_initially_ = Parameters::get<TypeTag, Parameters::SolveWelleqInitially>(); solve_welleq_initially_ = Parameters::Get<Parameters::SolveWelleqInitially>();
update_equations_scaling_ = Parameters::get<TypeTag, Parameters::UpdateEquationsScaling>(); update_equations_scaling_ = Parameters::Get<Parameters::UpdateEquationsScaling>();
use_update_stabilization_ = Parameters::get<TypeTag, Parameters::UseUpdateStabilization>(); use_update_stabilization_ = Parameters::Get<Parameters::UseUpdateStabilization>();
matrix_add_well_contributions_ = Parameters::get<TypeTag, Parameters::MatrixAddWellContributions>(); matrix_add_well_contributions_ = Parameters::Get<Parameters::MatrixAddWellContributions>();
check_well_operability_ = Parameters::get<TypeTag, Parameters::EnableWellOperabilityCheck>(); check_well_operability_ = Parameters::Get<Parameters::EnableWellOperabilityCheck>();
check_well_operability_iter_ = Parameters::get<TypeTag, Parameters::EnableWellOperabilityCheckIter>(); check_well_operability_iter_ = Parameters::Get<Parameters::EnableWellOperabilityCheckIter>();
max_number_of_well_switches_ = Parameters::get<TypeTag, Parameters::MaximumNumberOfWellSwitches>(); max_number_of_well_switches_ = Parameters::Get<Parameters::MaximumNumberOfWellSwitches>();
use_average_density_ms_wells_ = Parameters::get<TypeTag, Parameters::UseAverageDensityMsWells>(); use_average_density_ms_wells_ = Parameters::Get<Parameters::UseAverageDensityMsWells>();
local_well_solver_control_switching_ = Parameters::get<TypeTag, Parameters::LocalWellSolveControlSwitching>(); local_well_solver_control_switching_ = Parameters::Get<Parameters::LocalWellSolveControlSwitching>();
use_implicit_ipr_ = Parameters::get<TypeTag, Parameters::UseImplicitIpr>(); use_implicit_ipr_ = Parameters::Get<Parameters::UseImplicitIpr>();
nonlinear_solver_ = Parameters::get<TypeTag, Parameters::NonlinearSolver>(); nonlinear_solver_ = Parameters::Get<Parameters::NonlinearSolver>();
const auto approach = Parameters::get<TypeTag, Parameters::LocalSolveApproach>(); const auto approach = Parameters::Get<Parameters::LocalSolveApproach>();
if (approach == "jacobi") { if (approach == "jacobi") {
local_solve_approach_ = DomainSolveApproach::Jacobi; local_solve_approach_ = DomainSolveApproach::Jacobi;
} else if (approach == "gauss-seidel") { } else if (approach == "gauss-seidel") {
@ -646,143 +324,143 @@ public:
throw std::runtime_error("Invalid domain solver approach '" + approach + "' specified."); throw std::runtime_error("Invalid domain solver approach '" + approach + "' specified.");
} }
max_local_solve_iterations_ = Parameters::get<TypeTag, Parameters::MaxLocalSolveIterations>(); max_local_solve_iterations_ = Parameters::Get<Parameters::MaxLocalSolveIterations>();
local_tolerance_scaling_mb_ = Parameters::get<TypeTag, Parameters::LocalToleranceScalingMb>(); local_tolerance_scaling_mb_ = Parameters::Get<Parameters::LocalToleranceScalingMb<Scalar>>();
local_tolerance_scaling_cnv_ = Parameters::get<TypeTag, Parameters::LocalToleranceScalingCnv>(); local_tolerance_scaling_cnv_ = Parameters::Get<Parameters::LocalToleranceScalingCnv<Scalar>>();
nldd_num_initial_newton_iter_ = Parameters::get<TypeTag, Parameters::NlddNumInitialNewtonIter>(); nldd_num_initial_newton_iter_ = Parameters::Get<Parameters::NlddNumInitialNewtonIter>();
num_local_domains_ = Parameters::get<TypeTag, Parameters::NumLocalDomains>(); num_local_domains_ = Parameters::Get<Parameters::NumLocalDomains>();
local_domain_partition_imbalance_ = std::max(Scalar{1.0}, Parameters::get<TypeTag, Parameters::LocalDomainsPartitioningImbalance>()); local_domain_partition_imbalance_ = std::max(Scalar{1.0}, Parameters::Get<Parameters::LocalDomainsPartitioningImbalance<Scalar>>());
local_domain_partition_method_ = Parameters::get<TypeTag, Parameters::LocalDomainsPartitioningMethod>(); local_domain_partition_method_ = Parameters::Get<Parameters::LocalDomainsPartitioningMethod>();
deck_file_name_ = Parameters::get<TypeTag, Parameters::EclDeckFileName>(); deck_file_name_ = Parameters::Get<Parameters::EclDeckFileName>();
network_max_strict_iterations_ = Parameters::get<TypeTag, Parameters::NetworkMaxStrictIterations>(); network_max_strict_iterations_ = Parameters::Get<Parameters::NetworkMaxStrictIterations>();
network_max_iterations_ = Parameters::get<TypeTag, Parameters::NetworkMaxIterations>(); network_max_iterations_ = Parameters::Get<Parameters::NetworkMaxIterations>();
local_domain_ordering_ = domainOrderingMeasureFromString(Parameters::get<TypeTag, Parameters::LocalDomainsOrderingMeasure>()); local_domain_ordering_ = domainOrderingMeasureFromString(Parameters::Get<Parameters::LocalDomainsOrderingMeasure>());
write_partitions_ = Parameters::get<TypeTag, Parameters::DebugEmitCellPartition>(); write_partitions_ = Parameters::Get<Parameters::DebugEmitCellPartition>();
} }
static void registerParameters() static void registerParameters()
{ {
Parameters::registerParam<TypeTag, Parameters::DbhpMaxRel> Parameters::Register<Parameters::DbhpMaxRel<Scalar>>
("Maximum relative change of the bottom-hole pressure in a single iteration"); ("Maximum relative change of the bottom-hole pressure in a single iteration");
Parameters::registerParam<TypeTag, Parameters::DwellFractionMax> Parameters::Register<Parameters::DwellFractionMax<Scalar>>
("Maximum absolute change of a well's volume fraction in a single iteration"); ("Maximum absolute change of a well's volume fraction in a single iteration");
Parameters::registerParam<TypeTag, Parameters::MaxResidualAllowed> Parameters::Register<Parameters::MaxResidualAllowed<Scalar>>
("Absolute maximum tolerated for residuals without cutting the time step size"); ("Absolute maximum tolerated for residuals without cutting the time step size");
Parameters::registerParam<TypeTag, Parameters::RelaxedMaxPvFraction> Parameters::Register<Parameters::RelaxedMaxPvFraction<Scalar>>
("The fraction of the pore volume of the reservoir " ("The fraction of the pore volume of the reservoir "
"where the volumetric error (CNV) may be voilated " "where the volumetric error (CNV) may be voilated "
"during strict Newton iterations."); "during strict Newton iterations.");
Parameters::registerParam<TypeTag, Parameters::ToleranceMb> Parameters::Register<Parameters::ToleranceMb<Scalar>>
("Tolerated mass balance error relative to total mass present"); ("Tolerated mass balance error relative to total mass present");
Parameters::registerParam<TypeTag, Parameters::ToleranceMbRelaxed> Parameters::Register<Parameters::ToleranceMbRelaxed<Scalar>>
("Relaxed tolerated mass balance error that applies for iterations " ("Relaxed tolerated mass balance error that applies for iterations "
"after the iterations with the strict tolerance"); "after the iterations with the strict tolerance");
Parameters::registerParam<TypeTag, Parameters::ToleranceCnv> Parameters::Register<Parameters::ToleranceCnv<Scalar>>
("Local convergence tolerance (Maximum of local saturation errors)"); ("Local convergence tolerance (Maximum of local saturation errors)");
Parameters::registerParam<TypeTag, Parameters::ToleranceCnvRelaxed> Parameters::Register<Parameters::ToleranceCnvRelaxed<Scalar>>
("Relaxed local convergence tolerance that applies for iterations " ("Relaxed local convergence tolerance that applies for iterations "
"after the iterations with the strict tolerance"); "after the iterations with the strict tolerance");
Parameters::registerParam<TypeTag, Parameters::ToleranceWells> Parameters::Register<Parameters::ToleranceWells<Scalar>>
("Well convergence tolerance"); ("Well convergence tolerance");
Parameters::registerParam<TypeTag, Parameters::ToleranceWellControl> Parameters::Register<Parameters::ToleranceWellControl<Scalar>>
("Tolerance for the well control equations"); ("Tolerance for the well control equations");
Parameters::registerParam<TypeTag, Parameters::MaxWelleqIter> Parameters::Register<Parameters::MaxWelleqIter>
("Maximum number of iterations to determine solution the well equations"); ("Maximum number of iterations to determine solution the well equations");
Parameters::registerParam<TypeTag, Parameters::UseMultisegmentWell> Parameters::Register<Parameters::UseMultisegmentWell>
("Use the well model for multi-segment wells instead of the " ("Use the well model for multi-segment wells instead of the "
"one for single-segment wells"); "one for single-segment wells");
Parameters::registerParam<TypeTag, Parameters::TolerancePressureMsWells> Parameters::Register<Parameters::TolerancePressureMsWells<Scalar>>
("Tolerance for the pressure equations for multi-segment wells"); ("Tolerance for the pressure equations for multi-segment wells");
Parameters::registerParam<TypeTag, Parameters::RelaxedWellFlowTol> Parameters::Register<Parameters::RelaxedWellFlowTol<Scalar>>
("Relaxed tolerance for the well flow residual"); ("Relaxed tolerance for the well flow residual");
Parameters::registerParam<TypeTag, Parameters::RelaxedPressureTolMsw> Parameters::Register<Parameters::RelaxedPressureTolMsw<Scalar>>
("Relaxed tolerance for the MSW pressure solution"); ("Relaxed tolerance for the MSW pressure solution");
Parameters::registerParam<TypeTag, Parameters::MaxPressureChangeMsWells> Parameters::Register<Parameters::MaxPressureChangeMsWells<Scalar>>
("Maximum relative pressure change for a single iteration " ("Maximum relative pressure change for a single iteration "
"of the multi-segment well model"); "of the multi-segment well model");
Parameters::registerParam<TypeTag, Parameters::MaxInnerIterMsWells> Parameters::Register<Parameters::MaxInnerIterMsWells>
("Maximum number of inner iterations for multi-segment wells"); ("Maximum number of inner iterations for multi-segment wells");
Parameters::registerParam<TypeTag, Parameters::StrictInnerIterWells> Parameters::Register<Parameters::StrictInnerIterWells>
("Number of inner well iterations with strict tolerance"); ("Number of inner well iterations with strict tolerance");
Parameters::registerParam<TypeTag, Parameters::StrictOuterIterWells> Parameters::Register<Parameters::StrictOuterIterWells>
("Number of newton iterations for which wells are checked with strict tolerance"); ("Number of newton iterations for which wells are checked with strict tolerance");
Parameters::registerParam<TypeTag, Parameters::MaxNewtonIterationsWithInnerWellIterations> Parameters::Register<Parameters::MaxNewtonIterationsWithInnerWellIterations>
("Maximum newton iterations with inner well iterations"); ("Maximum newton iterations with inner well iterations");
Parameters::registerParam<TypeTag, Parameters::ShutUnsolvableWells> Parameters::Register<Parameters::ShutUnsolvableWells>
("Shut unsolvable wells"); ("Shut unsolvable wells");
Parameters::registerParam<TypeTag, Parameters::MaxInnerIterWells> Parameters::Register<Parameters::MaxInnerIterWells>
("Maximum number of inner iterations for standard wells"); ("Maximum number of inner iterations for standard wells");
Parameters::registerParam<TypeTag, Parameters::AlternativeWellRateInit> Parameters::Register<Parameters::AlternativeWellRateInit>
("Use alternative well rate initialization procedure"); ("Use alternative well rate initialization procedure");
Parameters::registerParam<TypeTag, Parameters::RegularizationFactorWells> Parameters::Register<Parameters::RegularizationFactorWells<Scalar>>
("Regularization factor for wells"); ("Regularization factor for wells");
Parameters::registerParam<TypeTag, Parameters::MaxSinglePrecisionDays> Parameters::Register<Parameters::MaxSinglePrecisionDays<Scalar>>
("Maximum time step size where single precision floating point " ("Maximum time step size where single precision floating point "
"arithmetic can be used solving for the linear systems of equations"); "arithmetic can be used solving for the linear systems of equations");
Parameters::registerParam<TypeTag, Parameters::MinStrictCnvIter> Parameters::Register<Parameters::MinStrictCnvIter>
("Minimum number of Newton iterations before relaxed tolerances " ("Minimum number of Newton iterations before relaxed tolerances "
"can be used for the CNV convergence criterion"); "can be used for the CNV convergence criterion");
Parameters::registerParam<TypeTag, Parameters::MinStrictMbIter> Parameters::Register<Parameters::MinStrictMbIter>
("Minimum number of Newton iterations before relaxed tolerances " ("Minimum number of Newton iterations before relaxed tolerances "
"can be used for the MB convergence criterion. " "can be used for the MB convergence criterion. "
"Default -1 means that the relaxed tolerance is used when maximum " "Default -1 means that the relaxed tolerance is used when maximum "
"number of Newton iterations are reached."); "number of Newton iterations are reached.");
Parameters::registerParam<TypeTag, Parameters::SolveWelleqInitially> Parameters::Register<Parameters::SolveWelleqInitially>
("Fully solve the well equations before each iteration of the reservoir model"); ("Fully solve the well equations before each iteration of the reservoir model");
Parameters::registerParam<TypeTag, Parameters::UpdateEquationsScaling> Parameters::Register<Parameters::UpdateEquationsScaling>
("Update scaling factors for mass balance equations during the run"); ("Update scaling factors for mass balance equations during the run");
Parameters::registerParam<TypeTag, Parameters::UseUpdateStabilization> Parameters::Register<Parameters::UseUpdateStabilization>
("Try to detect and correct oscillations or stagnation during the Newton method"); ("Try to detect and correct oscillations or stagnation during the Newton method");
Parameters::registerParam<TypeTag, Parameters::MatrixAddWellContributions> Parameters::Register<Parameters::MatrixAddWellContributions>
("Explicitly specify the influences of wells between cells in " ("Explicitly specify the influences of wells between cells in "
"the Jacobian and preconditioner matrices"); "the Jacobian and preconditioner matrices");
Parameters::registerParam<TypeTag, Parameters::EnableWellOperabilityCheck> Parameters::Register<Parameters::EnableWellOperabilityCheck>
("Enable the well operability checking"); ("Enable the well operability checking");
Parameters::registerParam<TypeTag, Parameters::EnableWellOperabilityCheckIter> Parameters::Register<Parameters::EnableWellOperabilityCheckIter>
("Enable the well operability checking during iterations"); ("Enable the well operability checking during iterations");
Parameters::registerParam<TypeTag, Parameters::MaximumNumberOfWellSwitches> Parameters::Register<Parameters::MaximumNumberOfWellSwitches>
("Maximum number of times a well can switch to the same control"); ("Maximum number of times a well can switch to the same control");
Parameters::registerParam<TypeTag, Parameters::UseAverageDensityMsWells> Parameters::Register<Parameters::UseAverageDensityMsWells>
("Approximate segment densitities by averaging over segment and its outlet"); ("Approximate segment densitities by averaging over segment and its outlet");
Parameters::registerParam<TypeTag, Parameters::LocalWellSolveControlSwitching> Parameters::Register<Parameters::LocalWellSolveControlSwitching>
("Allow control switching during local well solutions"); ("Allow control switching during local well solutions");
Parameters::registerParam<TypeTag, Parameters::UseImplicitIpr> Parameters::Register<Parameters::UseImplicitIpr>
("Compute implict IPR for stability checks and stable solution search"); ("Compute implict IPR for stability checks and stable solution search");
Parameters::registerParam<TypeTag, Parameters::NetworkMaxStrictIterations> Parameters::Register<Parameters::NetworkMaxStrictIterations>
("Maximum iterations in network solver before relaxing tolerance"); ("Maximum iterations in network solver before relaxing tolerance");
Parameters::registerParam<TypeTag, Parameters::NetworkMaxIterations> Parameters::Register<Parameters::NetworkMaxIterations>
("Maximum number of iterations in the network solver before giving up"); ("Maximum number of iterations in the network solver before giving up");
Parameters::registerParam<TypeTag, Parameters::NonlinearSolver> Parameters::Register<Parameters::NonlinearSolver>
("Choose nonlinear solver. Valid choices are newton or nldd."); ("Choose nonlinear solver. Valid choices are newton or nldd.");
Parameters::registerParam<TypeTag, Parameters::LocalSolveApproach> Parameters::Register<Parameters::LocalSolveApproach>
("Choose local solve approach. Valid choices are jacobi and gauss-seidel"); ("Choose local solve approach. Valid choices are jacobi and gauss-seidel");
Parameters::registerParam<TypeTag, Parameters::MaxLocalSolveIterations> Parameters::Register<Parameters::MaxLocalSolveIterations>
("Max iterations for local solves with NLDD nonlinear solver."); ("Max iterations for local solves with NLDD nonlinear solver.");
Parameters::registerParam<TypeTag, Parameters::LocalToleranceScalingMb> Parameters::Register<Parameters::LocalToleranceScalingMb<Scalar>>
("Set lower than 1.0 to use stricter convergence tolerance for local solves."); ("Set lower than 1.0 to use stricter convergence tolerance for local solves.");
Parameters::registerParam<TypeTag, Parameters::LocalToleranceScalingCnv> Parameters::Register<Parameters::LocalToleranceScalingCnv<Scalar>>
("Set lower than 1.0 to use stricter convergence tolerance for local solves."); ("Set lower than 1.0 to use stricter convergence tolerance for local solves.");
Parameters::registerParam<TypeTag, Parameters::NlddNumInitialNewtonIter> Parameters::Register<Parameters::NlddNumInitialNewtonIter>
("Number of initial global Newton iterations when running the NLDD nonlinear solver."); ("Number of initial global Newton iterations when running the NLDD nonlinear solver.");
Parameters::registerParam<TypeTag, Parameters::NumLocalDomains> Parameters::Register<Parameters::NumLocalDomains>
("Number of local domains for NLDD nonlinear solver."); ("Number of local domains for NLDD nonlinear solver.");
Parameters::registerParam<TypeTag, Parameters::LocalDomainsPartitioningImbalance> Parameters::Register<Parameters::LocalDomainsPartitioningImbalance<Scalar>>
("Subdomain partitioning imbalance tolerance. 1.03 is 3 percent imbalance."); ("Subdomain partitioning imbalance tolerance. 1.03 is 3 percent imbalance.");
Parameters::registerParam<TypeTag, Parameters::LocalDomainsPartitioningMethod> Parameters::Register<Parameters::LocalDomainsPartitioningMethod>
("Subdomain partitioning method. Allowed values are " ("Subdomain partitioning method. Allowed values are "
"'zoltan', " "'zoltan', "
"'simple', " "'simple', "
"and the name of a partition file ending with '.partition'."); "and the name of a partition file ending with '.partition'.");
Parameters::registerParam<TypeTag, Parameters::LocalDomainsOrderingMeasure> Parameters::Register<Parameters::LocalDomainsOrderingMeasure>
("Subdomain ordering measure. Allowed values are " ("Subdomain ordering measure. Allowed values are "
"'maxpressure', " "'maxpressure', "
"'averagepressure' " "'averagepressure' "
"and 'residual'."); "and 'residual'.");
Parameters::registerParam<TypeTag, Parameters::DebugEmitCellPartition> Parameters::Register<Parameters::DebugEmitCellPartition>
("Whether or not to emit cell partitions as a debugging aid."); ("Whether or not to emit cell partitions as a debugging aid.");
Parameters::hideParam<TypeTag, Parameters::DebugEmitCellPartition>(); Parameters::Hide<Parameters::DebugEmitCellPartition>();
// if openMP is available, determine the number threads per process automatically. // if openMP is available, determine the number threads per process automatically.
#if _OPENMP #if _OPENMP

View File

@ -27,6 +27,8 @@
#ifndef OPM_FLOW_BASE_VANGUARD_HPP #ifndef OPM_FLOW_BASE_VANGUARD_HPP
#define OPM_FLOW_BASE_VANGUARD_HPP #define OPM_FLOW_BASE_VANGUARD_HPP
#include <dune/grid/common/partitionset.hh>
#include <opm/grid/common/GridEnums.hpp> #include <opm/grid/common/GridEnums.hpp>
#include <opm/grid/common/CartesianIndexMapper.hpp> #include <opm/grid/common/CartesianIndexMapper.hpp>
#include <opm/grid/LookUpCellCentroid.hh> #include <opm/grid/LookUpCellCentroid.hh>
@ -69,10 +71,6 @@ struct EquilGrid { using type = UndefinedProperty; };
namespace Opm::Parameters { namespace Opm::Parameters {
template<class TypeTag>
struct EclDeckFileName<TypeTag, Properties::TTag::FlowBaseVanguard>
{ static constexpr auto value = ""; };
// TODO: enumeration parameters. we use strings for now. // TODO: enumeration parameters. we use strings for now.
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct EnableDryRun { using type = Properties::UndefinedProperty; }; struct EnableDryRun { using type = Properties::UndefinedProperty; };
@ -115,11 +113,6 @@ struct PartitionMethod { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct SerialPartitioning { using type = Properties::UndefinedProperty; }; struct SerialPartitioning { using type = Properties::UndefinedProperty; };
// Same as in BlackoilModelParameters.hpp but for here.
template<class TypeTag>
struct UseMultisegmentWell<TypeTag, Properties::TTag::FlowBaseVanguard>
{ static constexpr bool value = true; };
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct ZoltanImbalanceTol { using type = Properties::UndefinedProperty; }; struct ZoltanImbalanceTol { using type = Properties::UndefinedProperty; };
@ -247,7 +240,7 @@ public:
*/ */
static void registerParameters() static void registerParameters()
{ {
Parameters::registerParam<TypeTag, Parameters::EclDeckFileName> Parameters::Register<Parameters::EclDeckFileName>
("The name of the file which contains the ECL deck to be simulated"); ("The name of the file which contains the ECL deck to be simulated");
Parameters::registerParam<TypeTag, Parameters::EclOutputInterval> Parameters::registerParam<TypeTag, Parameters::EclOutputInterval>
("The number of report steps that ought to be skipped between two writes of ECL results"); ("The number of report steps that ought to be skipped between two writes of ECL results");
@ -316,7 +309,7 @@ public:
Parameters::registerParam<TypeTag, Parameters::AllowDistributedWells> Parameters::registerParam<TypeTag, Parameters::AllowDistributedWells>
("Allow the perforations of a well to be distributed to interior of multiple processes"); ("Allow the perforations of a well to be distributed to interior of multiple processes");
// register here for the use in the tests without BlackoilModelParameters // register here for the use in the tests without BlackoilModelParameters
Parameters::registerParam<TypeTag, Parameters::UseMultisegmentWell> Parameters::Register<Parameters::UseMultisegmentWell>
("Use the well model for multi-segment wells instead of the one for single-segment wells"); ("Use the well model for multi-segment wells instead of the one for single-segment wells");
} }
@ -329,7 +322,7 @@ public:
FlowBaseVanguard(Simulator& simulator) FlowBaseVanguard(Simulator& simulator)
: ParentType(simulator) : ParentType(simulator)
{ {
fileName_ = Parameters::get<TypeTag, Parameters::EclDeckFileName>(); fileName_ = Parameters::Get<Parameters::EclDeckFileName>();
edgeWeightsMethod_ = Dune::EdgeWeightMethod(Parameters::get<TypeTag, Parameters::EdgeWeightsMethod>()); edgeWeightsMethod_ = Dune::EdgeWeightMethod(Parameters::get<TypeTag, Parameters::EdgeWeightsMethod>());
#if HAVE_OPENCL || HAVE_ROCSPARSE || HAVE_CUDA #if HAVE_OPENCL || HAVE_ROCSPARSE || HAVE_CUDA
@ -355,7 +348,7 @@ public:
int output_param = Parameters::get<TypeTag, Parameters::EclOutputInterval>(); int output_param = Parameters::get<TypeTag, Parameters::EclOutputInterval>();
if (output_param >= 0) if (output_param >= 0)
outputInterval_ = output_param; outputInterval_ = output_param;
useMultisegmentWell_ = Parameters::get<TypeTag, Parameters::UseMultisegmentWell>(); useMultisegmentWell_ = Parameters::Get<Parameters::UseMultisegmentWell>();
enableExperiments_ = enableExperiments; enableExperiments_ = enableExperiments;
init(); init();

View File

@ -190,7 +190,7 @@ namespace Opm {
Parameters::Hide<Parameters::VtkWriteEffectiveDiffusionCoefficients>(); Parameters::Hide<Parameters::VtkWriteEffectiveDiffusionCoefficients>();
// hide average density option // hide average density option
Parameters::hideParam<TypeTag, Parameters::UseAverageDensityMsWells>(); Parameters::Hide<Parameters::UseAverageDensityMsWells>();
Parameters::endRegistration(); Parameters::endRegistration();
@ -402,7 +402,7 @@ namespace Opm {
} }
detail::mergeParallelLogFiles(eclState().getIOConfig().getOutputDir(), detail::mergeParallelLogFiles(eclState().getIOConfig().getOutputDir(),
Parameters::get<TypeTag, Parameters::EclDeckFileName>(), Parameters::Get<Parameters::EclDeckFileName>(),
Parameters::get<TypeTag, Parameters::EnableLoggingFalloutWarning>()); Parameters::get<TypeTag, Parameters::EnableLoggingFalloutWarning>());
} }

View File

@ -337,7 +337,7 @@ private:
outputDir = eclipseState_->getIOConfig().getOutputDir(); outputDir = eclipseState_->getIOConfig().getOutputDir();
} }
else { else {
deckFilename = Parameters::get<PreTypeTag, Parameters::EclDeckFileName>(); deckFilename = Parameters::Get<Parameters::EclDeckFileName>();
outputDir = Parameters::Get<Parameters::OutputDir>(); outputDir = Parameters::Get<Parameters::OutputDir>();
} }

View File

@ -258,7 +258,7 @@ std::unique_ptr<Matrix> blockJacobiAdjacency(const Grid& grid,
// Set it up manually // Set it up manually
ElementMapper elemMapper(simulator_.vanguard().gridView(), Dune::mcmgElementLayout()); ElementMapper elemMapper(simulator_.vanguard().gridView(), Dune::mcmgElementLayout());
detail::findOverlapAndInterior(simulator_.vanguard().grid(), elemMapper, overlapRows_, interiorRows_); detail::findOverlapAndInterior(simulator_.vanguard().grid(), elemMapper, overlapRows_, interiorRows_);
useWellConn_ = Parameters::get<TypeTag, Parameters::MatrixAddWellContributions>(); useWellConn_ = Parameters::Get<Parameters::MatrixAddWellContributions>();
const bool ownersFirst = Parameters::get<TypeTag, Parameters::OwnerCellsFirst>(); const bool ownersFirst = Parameters::get<TypeTag, Parameters::OwnerCellsFirst>();
if (!ownersFirst) { if (!ownersFirst) {
const std::string msg = "The linear solver no longer supports --owner-cells-first=false."; const std::string msg = "The linear solver no longer supports --owner-cells-first=false.";
@ -324,7 +324,7 @@ std::unique_ptr<Matrix> blockJacobiAdjacency(const Grid& grid,
// Outch! We need to be able to scale the linear system! Hence const_cast // Outch! We need to be able to scale the linear system! Hence const_cast
matrix_ = const_cast<Matrix*>(&M); matrix_ = const_cast<Matrix*>(&M);
useWellConn_ = Parameters::get<TypeTag, Parameters::MatrixAddWellContributions>(); useWellConn_ = Parameters::Get<Parameters::MatrixAddWellContributions>();
// setup sparsity pattern for jacobi matrix for preconditioner (only used for openclSolver) // setup sparsity pattern for jacobi matrix for preconditioner (only used for openclSolver)
} else { } else {
// Pointers should not change // Pointers should not change

View File

@ -94,7 +94,7 @@ namespace Opm {
} }
this->alternative_well_rate_init_ = this->alternative_well_rate_init_ =
Parameters::get<TypeTag, Parameters::AlternativeWellRateInit>(); Parameters::Get<Parameters::AlternativeWellRateInit>();
using SourceDataSpan = using SourceDataSpan =
typename PAvgDynamicSourceData<Scalar>::template SourceDataSpan<Scalar>; typename PAvgDynamicSourceData<Scalar>::template SourceDataSpan<Scalar>;

View File

@ -39,8 +39,12 @@
namespace Opm::Properties { namespace Opm::Properties {
namespace TTag { namespace TTag {
struct TestTypeTag {
using InheritsFrom = std::tuple<FlowModelParameters, FlowBaseProblem, BlackOilModel, EclTimeSteppingParameters>; struct TestTypeTag
{
using InheritsFrom = std::tuple<FlowBaseProblem,
BlackOilModel,
EclTimeSteppingParameters>;
}; };
} }
@ -95,20 +99,4 @@ struct LinearSolverBackend<TTag::TestTypeTag, TTag::FlowIstlSolverParams> {
} // namespace Opm::Properties } // namespace Opm::Properties
namespace Opm::Parameters {
// set some parameters that are only required by the well model
template<class TypeTag>
struct MatrixAddWellContributions<TypeTag, Properties::TTag::TestTypeTag>
{ static constexpr bool value = true; };
// currently, ebos uses the non-multisegment well model by default to avoid
// regressions. the --use-multisegment-well=true|false command line parameter is still
// available in ebos, but hidden from view.
template<class TypeTag>
struct UseMultisegmentWell<TypeTag, Properties::TTag::TestTypeTag>
{ static constexpr bool value = false; };
} // namespace Opm::Parameters
#endif // OPM_TEST_TYPETAG_HPP #endif // OPM_TEST_TYPETAG_HPP

View File

@ -72,10 +72,13 @@ namespace TTag {
struct TestEquilTypeTag { struct TestEquilTypeTag {
using InheritsFrom = std::tuple<FlowTimeSteppingParameters, FlowModelParameters, FlowBaseProblem, BlackOilModel>; using InheritsFrom = std::tuple<FlowTimeSteppingParameters,
FlowBaseProblem,
BlackOilModel>;
}; };
struct TestEquilVapwatTypeTag { struct TestEquilVapwatTypeTag {
using InheritsFrom = std::tuple<FlowModelParameters, FlowBaseProblem, BlackOilModel>; using InheritsFrom = std::tuple<FlowBaseProblem,
BlackOilModel>;
}; };
} }