move FlowProblem parameters to TypeTag-free parameter system

This commit is contained in:
Arne Morten Kvarving
2024-07-06 10:22:47 +02:00
parent fdcc9a0fb2
commit 414f313d2a
6 changed files with 28 additions and 52 deletions

View File

@@ -1310,6 +1310,7 @@ namespace Opm {
public:
std::vector<bool> wasSwitched_;
};
} // namespace Opm
#endif // OPM_BLACKOILMODEL_HEADER_INCLUDED

View File

@@ -135,7 +135,7 @@ namespace Opm {
// the default eWoms checkpoint/restart mechanism does not work with flow
Parameters::Hide<Parameters::RestartTime<Scalar>>();
Parameters::hideParam<TypeTag, Parameters::RestartWritingInterval>();
Parameters::Hide<Parameters::RestartWritingInterval>();
// hide all vtk related it is not currently possible to do this dependet on if the vtk writing is used
//if(not(Parameters::get<TypeTag,Properties::EnableVtkOutput>())){
Parameters::Hide<Parameters::VtkWriteOilFormationVolumeFactor>();

View File

@@ -233,20 +233,20 @@ public:
#endif
Parameters::registerParam<TypeTag, Parameters::EclOutputDoublePrecision>
("Tell the output writer to use double precision. Useful for 'perfect' restarts");
Parameters::registerParam<TypeTag, Parameters::RestartWritingInterval>
Parameters::Register<Parameters::RestartWritingInterval>
("The frequencies of which time steps are serialized to disk");
Parameters::registerParam<TypeTag, Parameters::EnableDriftCompensation>
Parameters::Register<Parameters::EnableDriftCompensation>
("Enable partial compensation of systematic mass losses via "
"the source term of the next time step");
Parameters::registerParam<TypeTag, Parameters::OutputMode>
Parameters::Register<Parameters::OutputMode>
("Specify which messages are going to be printed. "
"Valid values are: none, log, all (default)");
Parameters::registerParam<TypeTag, Parameters::NumPressurePointsEquil>
Parameters::Register<Parameters::NumPressurePointsEquil>
("Number of pressure points (in each direction) in tables used for equilibration");
Parameters::hideParam<TypeTag, Parameters::NumPressurePointsEquil>(); // Users will typically not need to modify this parameter..
Parameters::registerParam<TypeTag, Parameters::ExplicitRockCompaction>
Parameters::Hide<Parameters::NumPressurePointsEquil>(); // Users will typically not need to modify this parameter..
Parameters::Register<Parameters::ExplicitRockCompaction>
("Use pressure from end of the last time step when evaluating rock compaction");
Parameters::hideParam<TypeTag, Parameters::ExplicitRockCompaction>(); // Users will typically not need to modify this parameter..
Parameters::Hide<Parameters::ExplicitRockCompaction>(); // Users will typically not need to modify this parameter..
// By default, stop it after the universe will probably have stopped
// to exist. (the ECL problem will finish the simulation explicitly
@@ -333,7 +333,7 @@ public:
damarisWriter_ = std::make_unique<DamarisWriterType>(simulator);
enableDamarisOutput_ = Parameters::Get<Parameters::EnableDamarisOutput>();
#endif
enableDriftCompensation_ = Parameters::get<TypeTag, Parameters::EnableDriftCompensation>();
enableDriftCompensation_ = Parameters::Get<Parameters::EnableDriftCompensation>();
enableEclOutput_ = Parameters::get<TypeTag, Parameters::EnableEclOutput>();
enableVtkOutput_ = Parameters::Get<Parameters::EnableVtkOutput>();
@@ -346,14 +346,14 @@ public:
// 1. Command line value (--num-pressure-points-equil=N)
// 2. EQLDIMS item 2
// Default value is defined in opm-common/src/opm/input/eclipse/share/keywords/000_Eclipse100/E/EQLDIMS
if (Parameters::isSet<TypeTag, Parameters::NumPressurePointsEquil>())
if (Parameters::IsSet<Parameters::NumPressurePointsEquil>())
{
this->numPressurePointsEquil_ = Parameters::get<TypeTag, Parameters::NumPressurePointsEquil>();
this->numPressurePointsEquil_ = Parameters::Get<Parameters::NumPressurePointsEquil>();
} else {
this->numPressurePointsEquil_ = simulator.vanguard().eclState().getTableManager().getEqldims().getNumDepthNodesP();
}
explicitRockCompaction_ = Parameters::get<TypeTag, Parameters::ExplicitRockCompaction>();
explicitRockCompaction_ = Parameters::Get<Parameters::ExplicitRockCompaction>();
RelpermDiagnostics relpermDiagnostics;

View File

@@ -28,29 +28,27 @@
#ifndef OPM_FLOW_PROBLEM_PARAMETERS_HPP
#define OPM_FLOW_PROBLEM_PARAMETERS_HPP
#include <opm/models/utils/propertysystem.hh>
#include <opm/input/eclipse/Parser/ParserKeywords/E.hpp>
namespace Opm::Parameters {
// Enable partial compensation of systematic mass losses via the source term of the next time
// step
template<class TypeTag, class MyTypeTag>
struct EnableDriftCompensation { using type = Properties::UndefinedProperty; };
// Enable partial compensation of systematic mass losses via
// the source term of the next time step
struct EnableDriftCompensation { static constexpr bool value = true; };
// implicit or explicit pressure in rock compaction
template<class TypeTag, class MyTypeTag>
struct ExplicitRockCompaction { using type = Properties::UndefinedProperty; };
struct ExplicitRockCompaction { static constexpr bool value = false; };
// Parameterize equilibration accuracy
template<class TypeTag, class MyTypeTag>
struct NumPressurePointsEquil { using type = Properties::UndefinedProperty; };
struct NumPressurePointsEquil
{ static constexpr int value = ParserKeywords::EQLDIMS::DEPTH_NODES_P::defaultValue; };
template<class TypeTag, class MyTypeTag>
struct OutputMode { using type = Properties::UndefinedProperty; };
struct OutputMode { static constexpr auto value = "all"; };
// The number of time steps skipped between writing two consequtive restart files
template<class TypeTag, class MyTypeTag>
struct RestartWritingInterval { using type = Properties::UndefinedProperty; };
// The frequency of writing restart (*.ers) files. This is the number of time steps
// between writing restart files
struct RestartWritingInterval { static constexpr int value = 0xffffff; }; // disable
} // namespace Opm::Parameters

View File

@@ -28,8 +28,6 @@
#ifndef OPM_FLOW_PROBLEM_PROPERTIES_HPP
#define OPM_FLOW_PROBLEM_PROPERTIES_HPP
#include <opm/input/eclipse/Parser/ParserKeywords/E.hpp>
#include <opm/material/fluidmatrixinteractions/EclMaterialLawManager.hpp>
#include <opm/material/thermal/EclThermalLawManager.hpp>
@@ -311,26 +309,6 @@ template<class TypeTag>
struct EnableWriteAllSolutions<TypeTag, Properties::TTag::FlowBaseProblem>
{ static constexpr bool value = false; };
// By default, use implicit pressure in rock compaction
template<class TypeTag>
struct ExplicitRockCompaction<TypeTag, Properties::TTag::FlowBaseProblem>
{ static constexpr bool value = false; };
// Parameterize equilibration accuracy
template<class TypeTag>
struct NumPressurePointsEquil<TypeTag, Properties::TTag::FlowBaseProblem>
{ static constexpr int value = ParserKeywords::EQLDIMS::DEPTH_NODES_P::defaultValue; };
template<class TypeTag>
struct OutputMode<TypeTag, Properties::TTag::FlowBaseProblem>
{ static constexpr auto value = "all"; };
// The frequency of writing restart (*.ers) files. This is the number of time steps
// between writing restart files
template<class TypeTag>
struct RestartWritingInterval<TypeTag, Properties::TTag::FlowBaseProblem>
{ static constexpr int value = 0xffffff; }; // disable
} // namespace Opm::Parameters
#endif // OPM_FLOW_PROBLEM_PROPERTIES_HPP

View File

@@ -406,7 +406,7 @@ private:
std::string cmdline_params;
if (outputCout_) {
printFlowBanner(FlowGenericVanguard::comm().size(),
getNumThreads<PreTypeTag>(),
getNumThreads(),
Opm::moduleVersionName());
std::ostringstream str;
Parameters::printValues(str);
@@ -417,12 +417,12 @@ private:
try {
this->readDeck(deckFilename,
outputDir,
Parameters::get<PreTypeTag, Parameters::OutputMode>(),
Parameters::Get<Parameters::OutputMode>(),
!Parameters::Get<Parameters::SchedRestart>(),
Parameters::Get<Parameters::EnableLoggingFalloutWarning>(),
Parameters::Get<Parameters::ParsingStrictness>(),
Parameters::Get<Parameters::InputSkipMode>(),
getNumThreads<PreTypeTag>(),
getNumThreads(),
Parameters::Get<Parameters::EclOutputInterval>(),
cmdline_params,
Opm::moduleVersion(),
@@ -705,7 +705,6 @@ private:
void setupVanguard();
template<class TypeTag>
static int getNumThreads()
{