changed: BlackoilModel parameters moved to Opm::Parameters namespace

This commit is contained in:
Arne Morten Kvarving 2024-06-28 12:17:13 +02:00
parent b69439aa1f
commit a65ddff8f6
8 changed files with 678 additions and 697 deletions

View File

@ -28,6 +28,8 @@
#ifndef FLOW_EXP_HPP #ifndef FLOW_EXP_HPP
#define FLOW_EXP_HPP #define FLOW_EXP_HPP
#include <flowexperimental/FlowExpNewtonMethod.hpp>
#include <opm/models/discretization/common/fvbaseproblem.hh> #include <opm/models/discretization/common/fvbaseproblem.hh>
#include <opm/models/utils/propertysystem.hh> #include <opm/models/utils/propertysystem.hh>
@ -82,20 +84,6 @@ struct NewtonMethod<TypeTag, TTag::FlowExpTypeTag> {
using type = FlowExpNewtonMethod<TypeTag>; using type = FlowExpNewtonMethod<TypeTag>;
}; };
// 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, TTag::FlowExpTypeTag> {
static constexpr bool value = false;
};
// set some properties that are only required by the well model
template<class TypeTag>
struct MatrixAddWellContributions<TypeTag, TTag::FlowExpTypeTag> {
static constexpr bool value = true;
};
// flow's well model only works with surface volumes // flow's well model only works with surface volumes
template<class TypeTag> template<class TypeTag>
struct BlackoilConserveSurfaceVolume<TypeTag, TTag::FlowExpTypeTag> { struct BlackoilConserveSurfaceVolume<TypeTag, TTag::FlowExpTypeTag> {
@ -177,6 +165,18 @@ struct EclNewtonRelaxedTolerance<TypeTag, Properties::TTag::FlowExpTypeTag>
static constexpr type value = 1e6 * baseValue; static constexpr type value = 1e6 * baseValue;
}; };
// 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 = true; };
} // namespace Opm::Parameters } // namespace Opm::Parameters
namespace Opm { namespace Opm {
@ -206,29 +206,29 @@ public:
BlackoilModelParameters<TypeTag>::registerParameters(); BlackoilModelParameters<TypeTag>::registerParameters();
Parameters::registerParam<TypeTag, Parameters::EnableTerminalOutput>("Do *NOT* use!"); Parameters::registerParam<TypeTag, Parameters::EnableTerminalOutput>("Do *NOT* use!");
Parameters::hideParam<TypeTag, Properties::DbhpMaxRel>(); Parameters::hideParam<TypeTag, Parameters::DbhpMaxRel>();
Parameters::hideParam<TypeTag, Properties::DwellFractionMax>(); Parameters::hideParam<TypeTag, Parameters::DwellFractionMax>();
Parameters::hideParam<TypeTag, Properties::MaxResidualAllowed>(); Parameters::hideParam<TypeTag, Parameters::MaxResidualAllowed>();
Parameters::hideParam<TypeTag, Properties::ToleranceMb>(); Parameters::hideParam<TypeTag, Parameters::ToleranceMb>();
Parameters::hideParam<TypeTag, Properties::ToleranceMbRelaxed>(); Parameters::hideParam<TypeTag, Parameters::ToleranceMbRelaxed>();
Parameters::hideParam<TypeTag, Properties::ToleranceCnv>(); Parameters::hideParam<TypeTag, Parameters::ToleranceCnv>();
Parameters::hideParam<TypeTag, Properties::ToleranceCnvRelaxed>(); Parameters::hideParam<TypeTag, Parameters::ToleranceCnvRelaxed>();
Parameters::hideParam<TypeTag, Properties::ToleranceWells>(); Parameters::hideParam<TypeTag, Parameters::ToleranceWells>();
Parameters::hideParam<TypeTag, Properties::ToleranceWellControl>(); Parameters::hideParam<TypeTag, Parameters::ToleranceWellControl>();
Parameters::hideParam<TypeTag, Properties::MaxWelleqIter>(); Parameters::hideParam<TypeTag, Parameters::MaxWelleqIter>();
Parameters::hideParam<TypeTag, Properties::UseMultisegmentWell>(); Parameters::hideParam<TypeTag, Parameters::UseMultisegmentWell>();
Parameters::hideParam<TypeTag, Properties::TolerancePressureMsWells>(); Parameters::hideParam<TypeTag, Parameters::TolerancePressureMsWells>();
Parameters::hideParam<TypeTag, Properties::MaxPressureChangeMsWells>(); Parameters::hideParam<TypeTag, Parameters::MaxPressureChangeMsWells>();
Parameters::hideParam<TypeTag, Properties::MaxInnerIterMsWells>(); Parameters::hideParam<TypeTag, Parameters::MaxInnerIterMsWells>();
Parameters::hideParam<TypeTag, Properties::MaxNewtonIterationsWithInnerWellIterations>(); Parameters::hideParam<TypeTag, Parameters::MaxNewtonIterationsWithInnerWellIterations>();
Parameters::hideParam<TypeTag, Properties::MaxInnerIterWells>(); Parameters::hideParam<TypeTag, Parameters::MaxInnerIterWells>();
Parameters::hideParam<TypeTag, Properties::MaxSinglePrecisionDays>(); Parameters::hideParam<TypeTag, Parameters::MaxSinglePrecisionDays>();
Parameters::hideParam<TypeTag, Properties::MinStrictCnvIter>(); Parameters::hideParam<TypeTag, Parameters::MinStrictCnvIter>();
Parameters::hideParam<TypeTag, Properties::MinStrictMbIter>(); Parameters::hideParam<TypeTag, Parameters::MinStrictMbIter>();
Parameters::hideParam<TypeTag, Properties::SolveWelleqInitially>(); Parameters::hideParam<TypeTag, Parameters::SolveWelleqInitially>();
Parameters::hideParam<TypeTag, Properties::UpdateEquationsScaling>(); Parameters::hideParam<TypeTag, Parameters::UpdateEquationsScaling>();
Parameters::hideParam<TypeTag, Properties::UseUpdateStabilization>(); Parameters::hideParam<TypeTag, Parameters::UseUpdateStabilization>();
Parameters::hideParam<TypeTag, Properties::MatrixAddWellContributions>(); Parameters::hideParam<TypeTag, Parameters::MatrixAddWellContributions>();
Parameters::hideParam<TypeTag, Parameters::EnableTerminalOutput>(); Parameters::hideParam<TypeTag, Parameters::EnableTerminalOutput>();
} }

File diff suppressed because it is too large Load Diff

View File

@ -65,19 +65,14 @@ struct FlowBaseVanguard {};
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct EquilGrid { using type = UndefinedProperty; }; struct EquilGrid { using type = UndefinedProperty; };
template<class TypeTag>
struct EclDeckFileName<TypeTag, Properties::TTag::FlowBaseVanguard>
{ static constexpr auto value = ""; };
// Same as in BlackoilModelParameters.hpp but for here.
template<class TypeTag>
struct UseMultisegmentWell<TypeTag, TTag::FlowBaseVanguard>
{ static constexpr bool value = true; };
} // namespace Opm::Properties } // namespace Opm::Properties
namespace Opm::Parameters { namespace Opm::Parameters {
template<class TypeTag>
struct EclDeckFileName<TypeTag, Properties::TTag::FlowBaseVanguard>
{ static constexpr auto value = ""; };
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct EnableOpmRstFile { using type = Properties::UndefinedProperty; }; struct EnableOpmRstFile { using type = Properties::UndefinedProperty; };
@ -116,6 +111,11 @@ 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; };
@ -238,7 +238,7 @@ public:
*/ */
static void registerParameters() static void registerParameters()
{ {
Parameters::registerParam<TypeTag, Properties::EclDeckFileName> Parameters::registerParam<TypeTag, 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");
@ -305,7 +305,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, Properties::UseMultisegmentWell> Parameters::registerParam<TypeTag, 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");
} }
@ -318,7 +318,7 @@ public:
FlowBaseVanguard(Simulator& simulator) FlowBaseVanguard(Simulator& simulator)
: ParentType(simulator) : ParentType(simulator)
{ {
fileName_ = Parameters::get<TypeTag, Properties::EclDeckFileName>(); fileName_ = Parameters::get<TypeTag, 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
@ -344,7 +344,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, Properties::UseMultisegmentWell>(); useMultisegmentWell_ = Parameters::get<TypeTag, Parameters::UseMultisegmentWell>();
enableExperiments_ = enableExperiments; enableExperiments_ = enableExperiments;
init(); init();

View File

@ -199,7 +199,7 @@ namespace Opm {
Parameters::hideParam<TypeTag, Parameters::VtkWriteEffectiveDiffusionCoefficients>(); Parameters::hideParam<TypeTag, Parameters::VtkWriteEffectiveDiffusionCoefficients>();
// hide average density option // hide average density option
Parameters::hideParam<TypeTag, Properties::UseAverageDensityMsWells>(); Parameters::hideParam<TypeTag, Parameters::UseAverageDensityMsWells>();
Parameters::endParamRegistration<TypeTag>(); Parameters::endParamRegistration<TypeTag>();
@ -415,7 +415,7 @@ namespace Opm {
} }
detail::mergeParallelLogFiles(eclState().getIOConfig().getOutputDir(), detail::mergeParallelLogFiles(eclState().getIOConfig().getOutputDir(),
Parameters::get<TypeTag, Properties::EclDeckFileName>(), Parameters::get<TypeTag, Parameters::EclDeckFileName>(),
Parameters::get<TypeTag, Parameters::EnableLoggingFalloutWarning>()); Parameters::get<TypeTag, Parameters::EnableLoggingFalloutWarning>());
} }

View File

@ -335,7 +335,7 @@ private:
outputDir = eclipseState_->getIOConfig().getOutputDir(); outputDir = eclipseState_->getIOConfig().getOutputDir();
} }
else { else {
deckFilename = Parameters::get<PreTypeTag, Properties::EclDeckFileName>(); deckFilename = Parameters::get<PreTypeTag, Parameters::EclDeckFileName>();
outputDir = Parameters::get<PreTypeTag, Parameters::OutputDir>(); outputDir = Parameters::get<PreTypeTag, 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, Properties::MatrixAddWellContributions>(); useWellConn_ = Parameters::get<TypeTag, 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, Properties::MatrixAddWellContributions>(); useWellConn_ = Parameters::get<TypeTag, 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, Properties::AlternativeWellRateInit>(); Parameters::get<TypeTag, Parameters::AlternativeWellRateInit>();
using SourceDataSpan = using SourceDataSpan =
typename PAvgDynamicSourceData<Scalar>::template SourceDataSpan<Scalar>; typename PAvgDynamicSourceData<Scalar>::template SourceDataSpan<Scalar>;

View File

@ -64,20 +64,6 @@ struct WellModel<TypeTag, TTag::TestTypeTag> {
using type = BlackoilWellModel<TypeTag>; using type = BlackoilWellModel<TypeTag>;
}; };
// 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, TTag::TestTypeTag> {
static constexpr bool value = false;
};
// set some properties that are only required by the well model
template<class TypeTag>
struct MatrixAddWellContributions<TypeTag, TTag::TestTypeTag> {
static constexpr bool value = true;
};
// flow's well model only works with surface volumes // flow's well model only works with surface volumes
template<class TypeTag> template<class TypeTag>
struct BlackoilConserveSurfaceVolume<TypeTag, TTag::TestTypeTag> { struct BlackoilConserveSurfaceVolume<TypeTag, TTag::TestTypeTag> {
@ -115,6 +101,32 @@ template<class TypeTag>
struct EnableTerminalOutput<TypeTag, Properties::TTag::TestTypeTag> struct EnableTerminalOutput<TypeTag, Properties::TTag::TestTypeTag>
{ static constexpr bool value = false; }; { static constexpr bool value = false; };
// 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; };
// set the maximum number of Newton iterations to 8 so that we fail quickly (albeit
// relatively often)
template<class TypeTag>
struct NewtonMaxIterations<TypeTag, Properties::TTag::TestTypeTag>
{ static constexpr int value = 8; };
// the default for the allowed volumetric error for oil per second
template<class TypeTag>
struct NewtonTolerance<TypeTag, Properties::TTag::TestTypeTag>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e-1;
};
// 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; };
// 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 2 (instead of grabbing everything that is available).
#if _OPENMP #if _OPENMP
@ -129,20 +141,6 @@ template<class TypeTag>
struct ContinueOnConvergenceError<TypeTag, Properties::TTag::TestTypeTag> struct ContinueOnConvergenceError<TypeTag, Properties::TTag::TestTypeTag>
{ static constexpr bool value = true; }; { static constexpr bool value = true; };
// the default for the allowed volumetric error for oil per second
template<class TypeTag>
struct NewtonTolerance<TypeTag, Properties::TTag::TestTypeTag>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e-1;
};
// set the maximum number of Newton iterations to 8 so that we fail quickly (albeit
// relatively often)
template<class TypeTag>
struct NewtonMaxIterations<TypeTag, Properties::TTag::TestTypeTag>
{ static constexpr int value = 8; };
} // namespace Opm::Parameters } // namespace Opm::Parameters
#endif // OPM_TEST_TYPETAG_HPP #endif // OPM_TEST_TYPETAG_HPP