mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #5506 from akva2/move_params_to_parameters
Move parameters to Opm::Parameters namespace
This commit is contained in:
commit
ad595fed5e
@ -494,6 +494,7 @@ list (APPEND PUBLIC_HEADER_FILES
|
||||
opm/simulators/flow/FlowGenericVanguard.hpp
|
||||
opm/simulators/flow/FlowMain.hpp
|
||||
opm/simulators/flow/FlowProblem.hpp
|
||||
opm/simulators/flow/FlowProblemParameters.hpp
|
||||
opm/simulators/flow/FlowProblemProperties.hpp
|
||||
opm/simulators/flow/FlowUtils.hpp
|
||||
opm/simulators/flow/FlowsData.hpp
|
||||
@ -715,7 +716,7 @@ if (Damaris_FOUND AND MPI_FOUND AND USE_DAMARIS_LIB)
|
||||
list (APPEND PUBLIC_HEADER_FILES
|
||||
opm/simulators/utils/DamarisKeywords.hpp
|
||||
opm/simulators/utils/DamarisOutputModule.hpp
|
||||
opm/simulators/flow/DamarisProperties.hpp
|
||||
opm/simulators/flow/DamarisParameters.hpp
|
||||
opm/simulators/flow/DamarisWriter.hpp
|
||||
opm/simulators/utils/DamarisVar.hpp
|
||||
opm/simulators/utils/GridDataOutput.hpp
|
||||
|
@ -34,37 +34,22 @@
|
||||
#include <opm/models/blackoil/blackoilnewtonmethod.hh>
|
||||
#include <opm/models/utils/signum.hh>
|
||||
|
||||
namespace Opm::Properties {
|
||||
namespace Opm::Parameters {
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct EclNewtonSumTolerance
|
||||
{
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct EclNewtonSumTolerance { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct EclNewtonStrictIterations
|
||||
{
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct EclNewtonStrictIterations { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct EclNewtonRelaxedVolumeFraction
|
||||
{
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct EclNewtonRelaxedVolumeFraction { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct EclNewtonSumToleranceExponent
|
||||
{
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct EclNewtonSumToleranceExponent { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct EclNewtonRelaxedTolerance
|
||||
{
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct EclNewtonRelaxedTolerance { using type = Properties::UndefinedProperty; };
|
||||
|
||||
} // namespace Opm::Properties
|
||||
|
||||
@ -104,12 +89,12 @@ public:
|
||||
explicit FlowExpNewtonMethod(Simulator& simulator) : ParentType(simulator)
|
||||
{
|
||||
errorPvFraction_ = 1.0;
|
||||
relaxedMaxPvFraction_ = Parameters::get<TypeTag, Properties::EclNewtonRelaxedVolumeFraction>();
|
||||
relaxedMaxPvFraction_ = Parameters::get<TypeTag, Parameters::EclNewtonRelaxedVolumeFraction>();
|
||||
|
||||
sumTolerance_ = 0.0; // this gets determined in the error calculation proceedure
|
||||
relaxedTolerance_ = Parameters::get<TypeTag, Properties::EclNewtonRelaxedTolerance>();
|
||||
relaxedTolerance_ = Parameters::get<TypeTag, Parameters::EclNewtonRelaxedTolerance>();
|
||||
|
||||
numStrictIterations_ = Parameters::get<TypeTag, Properties::EclNewtonStrictIterations>();
|
||||
numStrictIterations_ = Parameters::get<TypeTag, Parameters::EclNewtonStrictIterations>();
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -119,19 +104,19 @@ public:
|
||||
{
|
||||
ParentType::registerParameters();
|
||||
|
||||
Parameters::registerParam<TypeTag, Properties::EclNewtonSumTolerance>
|
||||
Parameters::registerParam<TypeTag, Parameters::EclNewtonSumTolerance>
|
||||
("The maximum error tolerated by the Newton "
|
||||
"method for considering a solution to be converged");
|
||||
Parameters::registerParam<TypeTag, Properties::EclNewtonStrictIterations>
|
||||
Parameters::registerParam<TypeTag, Parameters::EclNewtonStrictIterations>
|
||||
("The number of Newton iterations where the "
|
||||
"volumetric error is considered.");
|
||||
Parameters::registerParam<TypeTag, Properties::EclNewtonRelaxedVolumeFraction>
|
||||
Parameters::registerParam<TypeTag, Parameters::EclNewtonRelaxedVolumeFraction>
|
||||
("The fraction of the pore volume of the reservoir "
|
||||
"where the volumetric error may be violated during strict Newton iterations.");
|
||||
Parameters::registerParam<TypeTag, Properties::EclNewtonSumToleranceExponent>
|
||||
Parameters::registerParam<TypeTag, Parameters::EclNewtonSumToleranceExponent>
|
||||
("The the exponent used to scale the sum tolerance by "
|
||||
"the total pore volume of the reservoir.");
|
||||
Parameters::registerParam<TypeTag, Properties::EclNewtonRelaxedTolerance>
|
||||
Parameters::registerParam<TypeTag, Parameters::EclNewtonRelaxedTolerance>
|
||||
("The maximum error which the volumetric residual "
|
||||
"may exhibit if it is in a 'relaxed' region during a strict iteration.");
|
||||
}
|
||||
@ -234,8 +219,8 @@ public:
|
||||
|
||||
// scale the tolerance for the total error with the pore volume. by default, the
|
||||
// exponent is 1/3, i.e., cubic root.
|
||||
Scalar x = Parameters::get<TypeTag, Properties::EclNewtonSumTolerance>();
|
||||
Scalar y = Parameters::get<TypeTag, Properties::EclNewtonSumToleranceExponent>();
|
||||
Scalar x = Parameters::get<TypeTag, Parameters::EclNewtonSumTolerance>();
|
||||
Scalar y = Parameters::get<TypeTag, Parameters::EclNewtonSumToleranceExponent>();
|
||||
sumTolerance_ = x*std::pow(sumPv, y);
|
||||
|
||||
this->endIterMsg() << " (max: " << this->tolerance_
|
||||
|
@ -28,6 +28,8 @@
|
||||
#ifndef FLOW_EXP_HPP
|
||||
#define FLOW_EXP_HPP
|
||||
|
||||
#include <flowexperimental/FlowExpNewtonMethod.hpp>
|
||||
|
||||
#include <opm/models/discretization/common/fvbaseproblem.hh>
|
||||
|
||||
#include <opm/models/utils/propertysystem.hh>
|
||||
@ -82,25 +84,6 @@ struct NewtonMethod<TypeTag, TTag::FlowExpTypeTag> {
|
||||
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;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct EnableTerminalOutput<TypeTag, TTag::FlowExpTypeTag> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
|
||||
// flow's well model only works with surface volumes
|
||||
template<class TypeTag>
|
||||
struct BlackoilConserveSurfaceVolume<TypeTag, TTag::FlowExpTypeTag> {
|
||||
@ -130,36 +113,6 @@ struct LinearSolverBackend<TTag::FlowExpTypeTag, TTag::FlowIstlSolverParams> {
|
||||
using type = ISTLSolver<TTag::FlowExpTypeTag>;
|
||||
};
|
||||
|
||||
// set fraction of the pore volume where the volumetric residual may be violated during
|
||||
// strict Newton iterations
|
||||
template<class TypeTag>
|
||||
struct EclNewtonRelaxedVolumeFraction<TypeTag, TTag::FlowExpTypeTag> {
|
||||
using type = GetPropType<TypeTag, Scalar>;
|
||||
static constexpr type value = 0.05;
|
||||
};
|
||||
|
||||
// the tolerated amount of "incorrect" amount of oil per time step for the complete
|
||||
// reservoir. this is scaled by the pore volume of the reservoir, i.e., larger reservoirs
|
||||
// will tolerate larger residuals.
|
||||
template<class TypeTag>
|
||||
struct EclNewtonSumTolerance<TypeTag, TTag::FlowExpTypeTag> {
|
||||
using type = GetPropType<TypeTag, Scalar>;
|
||||
static constexpr type value = 1e-5;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct EclNewtonSumToleranceExponent<TypeTag, TTag::FlowExpTypeTag> {
|
||||
using type = GetPropType<TypeTag, Scalar>;
|
||||
static constexpr type value = 1./3.;
|
||||
};
|
||||
// make all Newton iterations strict, i.e., the volumetric Newton tolerance must be
|
||||
// always be upheld in the majority of the spatial domain. In this context, "majority"
|
||||
// means 1 - EclNewtonRelaxedVolumeFraction.
|
||||
template<class TypeTag>
|
||||
struct EclNewtonStrictIterations<TypeTag, TTag::FlowExpTypeTag> {
|
||||
static constexpr int value = 100;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct LinearSolverBackend<TypeTag, TTag::FlowExpTypeTag> {
|
||||
using type = ISTLSolver<TypeTag>;
|
||||
@ -183,6 +136,10 @@ template<class TypeTag>
|
||||
struct ContinueOnConvergenceError<TypeTag, Properties::TTag::FlowExpTypeTag>
|
||||
{ static constexpr bool value = true; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct EnableTerminalOutput<TypeTag, Properties::TTag::FlowExpTypeTag>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
// the default for the allowed volumetric error for oil per second
|
||||
template<class TypeTag>
|
||||
struct NewtonTolerance<TypeTag, Properties::TTag::FlowExpTypeTag>
|
||||
@ -197,18 +154,30 @@ template<class TypeTag>
|
||||
struct NewtonMaxIterations<TypeTag, Properties::TTag::FlowExpTypeTag>
|
||||
{ static constexpr int value = 8; };
|
||||
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
namespace Opm::Properties {
|
||||
|
||||
// the maximum volumetric error of a cell in the relaxed region
|
||||
template<class TypeTag>
|
||||
struct EclNewtonRelaxedTolerance<TypeTag, TTag::FlowExpTypeTag> {
|
||||
using type = GetPropType<TypeTag, Scalar>;
|
||||
static constexpr type value = 1e6*Parameters::NewtonTolerance<TypeTag, TTag::FlowExpTypeTag>::value;
|
||||
struct EclNewtonRelaxedTolerance<TypeTag, Properties::TTag::FlowExpTypeTag>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr auto baseValue =
|
||||
Parameters::NewtonTolerance<TypeTag,
|
||||
Properties::TTag::FlowExpTypeTag>::value;
|
||||
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 {
|
||||
template <class TypeTag>
|
||||
@ -222,7 +191,9 @@ public:
|
||||
OPM_TIMEBLOCK(problemWriteOutput);
|
||||
// use the generic code to prepare the output fields and to
|
||||
// write the desired VTK files.
|
||||
if (Parameters::get<TypeTag, Properties::EnableWriteAllSolutions>() || this->simulator().episodeWillBeOver()) {
|
||||
if (Parameters::get<TypeTag, Parameters::EnableWriteAllSolutions>() ||
|
||||
this->simulator().episodeWillBeOver())
|
||||
{
|
||||
// \Note: the SimulatorTimer does not carry any useful information, so PRT file (if it gets output) will contain wrong
|
||||
// timing information.
|
||||
BaseType::writeOutput(SimulatorTimer{}, verbose);
|
||||
@ -234,31 +205,31 @@ public:
|
||||
ParentType::registerParameters();
|
||||
|
||||
BlackoilModelParameters<TypeTag>::registerParameters();
|
||||
Parameters::registerParam<TypeTag, Properties::EnableTerminalOutput>("Do *NOT* use!");
|
||||
Parameters::hideParam<TypeTag, Properties::DbhpMaxRel>();
|
||||
Parameters::hideParam<TypeTag, Properties::DwellFractionMax>();
|
||||
Parameters::hideParam<TypeTag, Properties::MaxResidualAllowed>();
|
||||
Parameters::hideParam<TypeTag, Properties::ToleranceMb>();
|
||||
Parameters::hideParam<TypeTag, Properties::ToleranceMbRelaxed>();
|
||||
Parameters::hideParam<TypeTag, Properties::ToleranceCnv>();
|
||||
Parameters::hideParam<TypeTag, Properties::ToleranceCnvRelaxed>();
|
||||
Parameters::hideParam<TypeTag, Properties::ToleranceWells>();
|
||||
Parameters::hideParam<TypeTag, Properties::ToleranceWellControl>();
|
||||
Parameters::hideParam<TypeTag, Properties::MaxWelleqIter>();
|
||||
Parameters::hideParam<TypeTag, Properties::UseMultisegmentWell>();
|
||||
Parameters::hideParam<TypeTag, Properties::TolerancePressureMsWells>();
|
||||
Parameters::hideParam<TypeTag, Properties::MaxPressureChangeMsWells>();
|
||||
Parameters::hideParam<TypeTag, Properties::MaxInnerIterMsWells>();
|
||||
Parameters::hideParam<TypeTag, Properties::MaxNewtonIterationsWithInnerWellIterations>();
|
||||
Parameters::hideParam<TypeTag, Properties::MaxInnerIterWells>();
|
||||
Parameters::hideParam<TypeTag, Properties::MaxSinglePrecisionDays>();
|
||||
Parameters::hideParam<TypeTag, Properties::MinStrictCnvIter>();
|
||||
Parameters::hideParam<TypeTag, Properties::MinStrictMbIter>();
|
||||
Parameters::hideParam<TypeTag, Properties::SolveWelleqInitially>();
|
||||
Parameters::hideParam<TypeTag, Properties::UpdateEquationsScaling>();
|
||||
Parameters::hideParam<TypeTag, Properties::UseUpdateStabilization>();
|
||||
Parameters::hideParam<TypeTag, Properties::MatrixAddWellContributions>();
|
||||
Parameters::hideParam<TypeTag, Properties::EnableTerminalOutput>();
|
||||
Parameters::registerParam<TypeTag, Parameters::EnableTerminalOutput>("Do *NOT* use!");
|
||||
Parameters::hideParam<TypeTag, Parameters::DbhpMaxRel>();
|
||||
Parameters::hideParam<TypeTag, Parameters::DwellFractionMax>();
|
||||
Parameters::hideParam<TypeTag, Parameters::MaxResidualAllowed>();
|
||||
Parameters::hideParam<TypeTag, Parameters::ToleranceMb>();
|
||||
Parameters::hideParam<TypeTag, Parameters::ToleranceMbRelaxed>();
|
||||
Parameters::hideParam<TypeTag, Parameters::ToleranceCnv>();
|
||||
Parameters::hideParam<TypeTag, Parameters::ToleranceCnvRelaxed>();
|
||||
Parameters::hideParam<TypeTag, Parameters::ToleranceWells>();
|
||||
Parameters::hideParam<TypeTag, Parameters::ToleranceWellControl>();
|
||||
Parameters::hideParam<TypeTag, Parameters::MaxWelleqIter>();
|
||||
Parameters::hideParam<TypeTag, Parameters::UseMultisegmentWell>();
|
||||
Parameters::hideParam<TypeTag, Parameters::TolerancePressureMsWells>();
|
||||
Parameters::hideParam<TypeTag, Parameters::MaxPressureChangeMsWells>();
|
||||
Parameters::hideParam<TypeTag, Parameters::MaxInnerIterMsWells>();
|
||||
Parameters::hideParam<TypeTag, Parameters::MaxNewtonIterationsWithInnerWellIterations>();
|
||||
Parameters::hideParam<TypeTag, Parameters::MaxInnerIterWells>();
|
||||
Parameters::hideParam<TypeTag, Parameters::MaxSinglePrecisionDays>();
|
||||
Parameters::hideParam<TypeTag, Parameters::MinStrictCnvIter>();
|
||||
Parameters::hideParam<TypeTag, Parameters::MinStrictMbIter>();
|
||||
Parameters::hideParam<TypeTag, Parameters::SolveWelleqInitially>();
|
||||
Parameters::hideParam<TypeTag, Parameters::UpdateEquationsScaling>();
|
||||
Parameters::hideParam<TypeTag, Parameters::UseUpdateStabilization>();
|
||||
Parameters::hideParam<TypeTag, Parameters::MatrixAddWellContributions>();
|
||||
Parameters::hideParam<TypeTag, Parameters::EnableTerminalOutput>();
|
||||
}
|
||||
|
||||
// inherit the constructors
|
||||
|
@ -55,22 +55,6 @@ struct Problem<TypeTag, TTag::FlowExpProblemBlackOil>
|
||||
using type = FlowExpProblem<TypeTag>;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct EclNewtonSumTolerance<TypeTag, TTag::FlowExpProblemBlackOil>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Scalar>;
|
||||
static constexpr type value = 1e-5;
|
||||
};
|
||||
|
||||
// set fraction of the pore volume where the volumetric residual may be violated during
|
||||
// strict Newton iterations
|
||||
template<class TypeTag>
|
||||
struct EclNewtonRelaxedVolumeFraction<TypeTag, TTag::FlowExpProblemBlackOil>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Scalar>;
|
||||
static constexpr type value = 0.0;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct EnableDiffusion<TypeTag, TTag::FlowExpProblemBlackOil>
|
||||
{
|
||||
@ -93,14 +77,42 @@ struct Simulator<TypeTag, TTag::FlowExpProblemBlackOil>
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
template<class TypeTag>
|
||||
struct ThreadsPerProcess<TypeTag, Properties::TTag::FlowExpProblemBlackOil>
|
||||
{ static constexpr int value = 1; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct ContinueOnConvergenceError<TypeTag, Properties::TTag::FlowExpProblemBlackOil>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct EclNewtonRelaxedTolerance<TypeTag, Properties::TTag::FlowExpProblemBlackOil>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr auto baseValue =
|
||||
Parameters::NewtonTolerance<TypeTag, Properties::TTag::FlowExpProblemBlackOil>::value;
|
||||
static constexpr type value = 10 * baseValue;
|
||||
};
|
||||
|
||||
// set fraction of the pore volume where the volumetric residual may be violated during
|
||||
// strict Newton iterations
|
||||
template<class TypeTag>
|
||||
struct EclNewtonRelaxedVolumeFraction<TypeTag, Properties::TTag::FlowExpProblemBlackOil>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 0.0;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct EclNewtonSumTolerance<TypeTag, Properties::TTag::FlowExpProblemBlackOil>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 1e-5;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct EclNewtonSumToleranceExponent<TypeTag, Properties::TTag::FlowExpProblemBlackOil>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 1.0 / 3.0;;
|
||||
};
|
||||
|
||||
// the default for the allowed volumetric error for oil per second
|
||||
template<class TypeTag>
|
||||
struct NewtonTolerance<TypeTag, Properties::TTag::FlowExpProblemBlackOil>
|
||||
@ -109,18 +121,15 @@ struct NewtonTolerance<TypeTag, Properties::TTag::FlowExpProblemBlackOil>
|
||||
static constexpr type value = 1e-2;
|
||||
};
|
||||
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
namespace Opm::Properties {
|
||||
template<class TypeTag>
|
||||
struct ThreadsPerProcess<TypeTag, Properties::TTag::FlowExpProblemBlackOil>
|
||||
{ static constexpr int value = 1; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct EclNewtonRelaxedTolerance<TypeTag, TTag::FlowExpProblemBlackOil>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Scalar>;
|
||||
static constexpr type value = 10 * Parameters::NewtonTolerance<TypeTag,TTag::FlowExpProblemBlackOil>::value;
|
||||
};
|
||||
struct EclNewtonStrictIterations<TypeTag, Properties::TTag::FlowExpProblemBlackOil>
|
||||
{ static constexpr int value = 100; };
|
||||
|
||||
} // namespace Opm::Properties
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
|
@ -79,77 +79,73 @@ struct FlowProblem {
|
||||
FlowNonLinearSolver, FlowBaseProblem, BlackOilModel>;
|
||||
};
|
||||
}
|
||||
template<class TypeTag>
|
||||
struct EnableDebuggingChecks<TypeTag, TTag::FlowProblem> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
// default in flow is to formulate the equations in surface volumes
|
||||
template<class TypeTag>
|
||||
struct BlackoilConserveSurfaceVolume<TypeTag, TTag::FlowProblem> {
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
template<class TypeTag>
|
||||
struct UseVolumetricResidual<TypeTag, TTag::FlowProblem> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
struct BlackoilConserveSurfaceVolume<TypeTag, TTag::FlowProblem>
|
||||
{ static constexpr bool value = true; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct AquiferModel<TypeTag, TTag::FlowProblem> {
|
||||
using type = BlackoilAquiferModel<TypeTag>;
|
||||
};
|
||||
struct UseVolumetricResidual<TypeTag, TTag::FlowProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct AquiferModel<TypeTag, TTag::FlowProblem>
|
||||
{ using type = BlackoilAquiferModel<TypeTag>; };
|
||||
|
||||
// disable all extensions supported by black oil model. this should not really be
|
||||
// necessary but it makes things a bit more explicit
|
||||
template<class TypeTag>
|
||||
struct EnablePolymer<TypeTag, TTag::FlowProblem> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
template<class TypeTag>
|
||||
struct EnableSolvent<TypeTag, TTag::FlowProblem> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
template<class TypeTag>
|
||||
struct EnableTemperature<TypeTag, TTag::FlowProblem> {
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
template<class TypeTag>
|
||||
struct EnableEnergy<TypeTag, TTag::FlowProblem> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
template<class TypeTag>
|
||||
struct EnableFoam<TypeTag, TTag::FlowProblem> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
template<class TypeTag>
|
||||
struct EnableBrine<TypeTag, TTag::FlowProblem> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
template<class TypeTag>
|
||||
struct EnableSaltPrecipitation<TypeTag, TTag::FlowProblem> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
template<class TypeTag>
|
||||
struct EnableMICP<TypeTag, TTag::FlowProblem> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
template<class TypeTag>
|
||||
struct EnableDispersion<TypeTag, TTag::FlowProblem> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
struct EnablePolymer<TypeTag, TTag::FlowProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct WellModel<TypeTag, TTag::FlowProblem> {
|
||||
using type = BlackoilWellModel<TypeTag>;
|
||||
};
|
||||
struct EnableSolvent<TypeTag, TTag::FlowProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct LinearSolverSplice<TypeTag, TTag::FlowProblem> {
|
||||
using type = TTag::FlowIstlSolver;
|
||||
};
|
||||
struct EnableTemperature<TypeTag, TTag::FlowProblem>
|
||||
{ static constexpr bool value = true; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct EnableEnergy<TypeTag, TTag::FlowProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct EnableFoam<TypeTag, TTag::FlowProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct EnableBrine<TypeTag, TTag::FlowProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct EnableSaltPrecipitation<TypeTag, TTag::FlowProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct EnableMICP<TypeTag, TTag::FlowProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct EnableDispersion<TypeTag, TTag::FlowProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct WellModel<TypeTag, TTag::FlowProblem>
|
||||
{ using type = BlackoilWellModel<TypeTag>; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct LinearSolverSplice<TypeTag, TTag::FlowProblem>
|
||||
{ using type = TTag::FlowIstlSolver; };
|
||||
|
||||
} // namespace Opm::Properties
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
template<class TypeTag>
|
||||
struct EnableDebuggingChecks<TypeTag, Properties::TTag::FlowProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct OutputDir<TypeTag, Properties::TTag::FlowProblem>
|
||||
{ static constexpr auto value = ""; };
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -28,69 +28,55 @@
|
||||
*
|
||||
* \copydoc Opm::DamarisWriter
|
||||
*/
|
||||
#ifndef OPM_DAMARIS_PROPERTIES_HPP
|
||||
#define OPM_DAMARIS_PROPERTIES_HPP
|
||||
#ifndef OPM_DAMARIS_PARAMETERS_HPP
|
||||
#define OPM_DAMARIS_PARAMETERS_HPP
|
||||
|
||||
#include <opm/models/utils/parametersystem.hh>
|
||||
#include <opm/models/utils/propertysystem.hh>
|
||||
|
||||
namespace Opm::Properties {
|
||||
namespace Opm::Parameters {
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct EnableDamarisOutput {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct DamarisOutputHdfCollective {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct DamarisSaveMeshToHdf {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct DamarisSaveToHdf {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct DamarisPythonScript {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct DamarisPythonParaviewScript {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct DamarisSimName {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct DamarisDedicatedCores {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct DamarisDedicatedNodes {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct DamarisSharedMemoryName {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct DamarisSharedMemorySizeBytes {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct DamarisLogLevel {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct DamarisDaskFile {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct DamarisLimitVariables {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
} // namespace Opm::Properties
|
||||
struct EnableDamarisOutput { using type = Properties::UndefinedProperty; };
|
||||
|
||||
#endif // OPM_DAMARIS_PROPERTIES_HPP
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct DamarisOutputHdfCollective { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct DamarisSaveMeshToHdf { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct DamarisSaveToHdf { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct DamarisPythonScript { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct DamarisPythonParaviewScript { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct DamarisSimName { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct DamarisDedicatedCores { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct DamarisDedicatedNodes { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct DamarisSharedMemoryName { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct DamarisSharedMemorySizeBytes { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct DamarisLogLevel { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct DamarisDaskFile { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct DamarisLimitVariables { using type = Properties::UndefinedProperty; };
|
||||
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
#endif // OPM_DAMARIS_PARAMETERS_HPP
|
@ -33,11 +33,10 @@
|
||||
|
||||
#include <dune/grid/common/partitionset.hh>
|
||||
|
||||
|
||||
#include <opm/common/OpmLog/OpmLog.hpp>
|
||||
|
||||
#include <opm/simulators/flow/countGlobalCells.hpp>
|
||||
#include <opm/simulators/flow/DamarisProperties.hpp>
|
||||
#include <opm/simulators/flow/DamarisParameters.hpp>
|
||||
#include <opm/simulators/flow/EclGenericWriter.hpp>
|
||||
#include <opm/simulators/flow/FlowBaseVanguard.hpp>
|
||||
#include <opm/simulators/flow/OutputBlackoilModule.hpp>
|
||||
@ -56,7 +55,6 @@
|
||||
#include <vector>
|
||||
#include <unordered_set>
|
||||
|
||||
|
||||
namespace Opm {
|
||||
|
||||
namespace DamarisOutput {
|
||||
@ -107,58 +105,58 @@ class DamarisWriter : public EclGenericWriter<GetPropType<TypeTag, Properties::G
|
||||
public:
|
||||
static void registerParameters()
|
||||
{
|
||||
Parameters::registerParam<TypeTag, Properties::DamarisOutputHdfCollective>
|
||||
Parameters::registerParam<TypeTag, Parameters::DamarisOutputHdfCollective>
|
||||
("Write output via Damaris using parallel HDF5 to "
|
||||
"get single file and dataset per timestep instead "
|
||||
"of one per Damaris core with multiple datasets.");
|
||||
Parameters::registerParam<TypeTag, Properties::DamarisSaveToHdf>
|
||||
Parameters::registerParam<TypeTag, Parameters::DamarisSaveToHdf>
|
||||
("Set to false to prevent output to HDF5. "
|
||||
"Uses collective output by default or "
|
||||
"set --enable-damaris-collective=false to"
|
||||
"use file per core (file per Damaris server).");
|
||||
Parameters::registerParam<TypeTag, Properties::DamarisSaveMeshToHdf>
|
||||
Parameters::registerParam<TypeTag, Parameters::DamarisSaveMeshToHdf>
|
||||
("Saves the mesh data to the HDF5 file (1st iteration only). "
|
||||
"Will set --damaris-output-hdf-collective to false "
|
||||
"so will use file per core (file per Damaris server) output "
|
||||
"(global sizes and offset values of mesh variables are not being provided as yet).");
|
||||
Parameters::registerParam<TypeTag, Properties::DamarisPythonScript>
|
||||
Parameters::registerParam<TypeTag, Parameters::DamarisPythonScript>
|
||||
("Set to the path and filename of a Python script to run on "
|
||||
"Damaris server resources with access to OPM flow data.");
|
||||
Parameters::registerParam<TypeTag, Properties::DamarisPythonParaviewScript>
|
||||
Parameters::registerParam<TypeTag, Parameters::DamarisPythonParaviewScript>
|
||||
("Set to the path and filename of a Paraview Python script "
|
||||
"to run on Paraview Catalyst (1 or 2) on Damaris server "
|
||||
"resources with access to OPM flow data.");
|
||||
Parameters::registerParam<TypeTag, Properties::DamarisSimName>
|
||||
Parameters::registerParam<TypeTag, Parameters::DamarisSimName>
|
||||
("The name of the simulation to be used by Damaris. "
|
||||
"If empty (the default) then Damaris uses \"opm-sim-<random-number>\". "
|
||||
"This name is used for the Damaris HDF5 file name prefix. "
|
||||
"Make unique if writing to the same output directory.");
|
||||
Parameters::registerParam<TypeTag, Properties::DamarisLogLevel>
|
||||
Parameters::registerParam<TypeTag, Parameters::DamarisLogLevel>
|
||||
("The log level for the Damaris logging system (boost log based). "
|
||||
"Levels are: [trace, debug, info, warning, error, fatal]. "
|
||||
"Currently debug and info are useful. ");
|
||||
Parameters::registerParam<TypeTag, Properties::DamarisDaskFile>
|
||||
Parameters::registerParam<TypeTag, Parameters::DamarisDaskFile>
|
||||
("The name of a Dask json configuration file (if using Dask for processing).");
|
||||
Parameters::registerParam<TypeTag, Properties::DamarisDedicatedCores>
|
||||
Parameters::registerParam<TypeTag, Parameters::DamarisDedicatedCores>
|
||||
("Set the number of dedicated cores (MPI processes) "
|
||||
"that should be used for Damaris processing (per node). "
|
||||
"Must divide evenly into the number of simulation ranks (client ranks).");
|
||||
Parameters::registerParam<TypeTag, Properties::DamarisDedicatedNodes>
|
||||
Parameters::registerParam<TypeTag, Parameters::DamarisDedicatedNodes>
|
||||
("Set the number of dedicated nodes (full nodes) "
|
||||
"that should be used for Damaris processing (per simulation). "
|
||||
"Must divide evenly into the number of simulation nodes.");
|
||||
Parameters::registerParam<TypeTag, Properties::DamarisSharedMemorySizeBytes>
|
||||
Parameters::registerParam<TypeTag, Parameters::DamarisSharedMemorySizeBytes>
|
||||
("Set the size of the shared memory buffer used for IPC "
|
||||
"between the simulation and the Damaris resources. "
|
||||
"Needs to hold all the variables published, possibly over "
|
||||
"multiple simulation iterations.");
|
||||
Parameters::registerParam<TypeTag, Properties::DamarisSharedMemoryName>
|
||||
Parameters::registerParam<TypeTag, Parameters::DamarisSharedMemoryName>
|
||||
("The name of the shared memory area to be used by Damaris for the current. "
|
||||
"If empty (the default) then Damaris uses \"opm-damaris-<random-string>\". "
|
||||
"This name should be unique if multiple simulations are running on "
|
||||
"the same node/server as it is used for the Damaris shmem name and by "
|
||||
"the Python Dask library to locate sections of variables.");
|
||||
Parameters::registerParam<TypeTag, Properties::DamarisLimitVariables>
|
||||
Parameters::registerParam<TypeTag, Parameters::DamarisLimitVariables>
|
||||
("A comma separated list of variable names that a user wants to pass "
|
||||
"through via DamarisOutput::DamarisWriter::writeOutput)() to the "
|
||||
"damaris_write() call. This can be used to limit the number of "
|
||||
@ -353,7 +351,7 @@ private:
|
||||
|
||||
static bool enableDamarisOutput_()
|
||||
{
|
||||
return Parameters::get<TypeTag, Properties::EnableDamarisOutput>();
|
||||
return Parameters::get<TypeTag, Parameters::EnableDamarisOutput>();
|
||||
}
|
||||
|
||||
void setGlobalIndexForDamaris ()
|
||||
|
@ -50,31 +50,26 @@
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
|
||||
namespace Opm::Properties {
|
||||
namespace Opm::Parameters {
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct EnableEclOutput {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct EnableEclOutput { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct EnableAsyncEclOutput {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct EnableAsyncEclOutput { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct EclOutputDoublePrecision {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct EclOutputDoublePrecision { using type = Properties::UndefinedProperty; };
|
||||
|
||||
// Write all solutions for visualization, not just the ones for the
|
||||
// report steps...
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct EnableWriteAllSolutions {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct EnableWriteAllSolutions { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct EnableEsmry {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
} // namespace Opm::Properties
|
||||
struct EnableEsmry { using type = Properties::UndefinedProperty; };
|
||||
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
namespace Opm {
|
||||
|
||||
@ -130,10 +125,10 @@ public:
|
||||
{
|
||||
OutputBlackOilModule<TypeTag>::registerParameters();
|
||||
|
||||
Parameters::registerParam<TypeTag, Properties::EnableAsyncEclOutput>
|
||||
Parameters::registerParam<TypeTag, Parameters::EnableAsyncEclOutput>
|
||||
("Write the ECL-formated results in a non-blocking way "
|
||||
"(i.e., using a separate thread).");
|
||||
Parameters::registerParam<TypeTag, Properties::EnableEsmry>
|
||||
Parameters::registerParam<TypeTag, Parameters::EnableEsmry>
|
||||
("Write ESMRY file for fast loading of summary data.");
|
||||
}
|
||||
|
||||
@ -153,8 +148,8 @@ public:
|
||||
((simulator.vanguard().grid().comm().rank() == 0)
|
||||
? &simulator.vanguard().equilCartesianIndexMapper()
|
||||
: nullptr),
|
||||
Parameters::get<TypeTag, Properties::EnableAsyncEclOutput>(),
|
||||
Parameters::get<TypeTag, Properties::EnableEsmry>())
|
||||
Parameters::get<TypeTag, Parameters::EnableAsyncEclOutput>(),
|
||||
Parameters::get<TypeTag, Parameters::EnableEsmry>())
|
||||
, simulator_(simulator)
|
||||
{
|
||||
#if HAVE_MPI
|
||||
@ -404,7 +399,7 @@ public:
|
||||
auto floresn = this->outputModule_->getFloresn();
|
||||
|
||||
// data::Solution localCellData = {};
|
||||
if (! isSubStep || Parameters::get<TypeTag, Properties::EnableWriteAllSolutions>()) {
|
||||
if (! isSubStep || Parameters::get<TypeTag, Parameters::EnableWriteAllSolutions>()) {
|
||||
|
||||
auto rstep = timer.reportStepNum();
|
||||
|
||||
@ -460,7 +455,7 @@ public:
|
||||
const Scalar curTime = simulator_.time() + simulator_.timeStepSize();
|
||||
const Scalar nextStepSize = simulator_.problem().nextTimeStepSize();
|
||||
std::optional<int> timeStepIdx;
|
||||
if (Parameters::get<TypeTag, Properties::EnableWriteAllSolutions>()) {
|
||||
if (Parameters::get<TypeTag, Parameters::EnableWriteAllSolutions>()) {
|
||||
timeStepIdx = simulator_.timeStepIndex();
|
||||
}
|
||||
this->doWriteOutput(reportStepNum, timeStepIdx, isSubStep,
|
||||
@ -474,7 +469,7 @@ public:
|
||||
this->summaryState(),
|
||||
this->simulator_.problem().thresholdPressure().getRestartVector(),
|
||||
curTime, nextStepSize,
|
||||
Parameters::get<TypeTag, Properties::EclOutputDoublePrecision>(),
|
||||
Parameters::get<TypeTag, Parameters::EclOutputDoublePrecision>(),
|
||||
isFlowsn, std::move(flowsn),
|
||||
isFloresn, std::move(floresn));
|
||||
}
|
||||
@ -489,7 +484,7 @@ public:
|
||||
bool gasActive = FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx);
|
||||
bool waterActive = FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx);
|
||||
bool enableSwatinit = simulator_.vanguard().eclState().fieldProps().has_double("SWATINIT");
|
||||
bool opm_rst_file = Parameters::get<TypeTag, Properties::EnableOpmRstFile>();
|
||||
bool opm_rst_file = Parameters::get<TypeTag, Parameters::EnableOpmRstFile>();
|
||||
bool read_temp = enableEnergy || (opm_rst_file && enableTemperature);
|
||||
std::vector<RestartKey> solutionKeys{
|
||||
{"PRESSURE", UnitSystem::measure::pressure},
|
||||
@ -609,7 +604,7 @@ public:
|
||||
|
||||
private:
|
||||
static bool enableEclOutput_()
|
||||
{ return Parameters::get<TypeTag, Properties::EnableEclOutput>(); }
|
||||
{ return Parameters::get<TypeTag, Parameters::EnableEclOutput>(); }
|
||||
|
||||
const EclipseState& eclState() const
|
||||
{ return simulator_.vanguard().eclState(); }
|
||||
@ -642,7 +637,7 @@ private:
|
||||
countLocalInteriorCellsGridView(gridView);
|
||||
this->outputModule_->
|
||||
allocBuffers(num_interior, reportStepNum,
|
||||
isSubStep && !Parameters::get<TypeTag, Properties::EnableWriteAllSolutions>(), log, /*isRestart*/ false);
|
||||
isSubStep && !Parameters::get<TypeTag, Parameters::EnableWriteAllSolutions>(), log, /*isRestart*/ false);
|
||||
|
||||
ElementContext elemCtx(simulator_);
|
||||
|
||||
|
@ -56,192 +56,152 @@ template<typename Grid, typename GridView> struct LookUpCellCentroid;
|
||||
namespace Opm::Properties {
|
||||
|
||||
namespace TTag {
|
||||
|
||||
struct FlowBaseVanguard {};
|
||||
|
||||
}
|
||||
|
||||
// declare the properties required by the for the ecl simulator vanguard
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct EquilGrid {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct EquilGrid { using type = UndefinedProperty; };
|
||||
|
||||
} // namespace Opm::Properties
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
template<class TypeTag>
|
||||
struct EclDeckFileName<TypeTag, Properties::TTag::FlowBaseVanguard>
|
||||
{ static constexpr auto value = ""; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct EnableOpmRstFile {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct EnableOpmRstFile { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct ParsingStrictness {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct ParsingStrictness { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct InputSkipMode {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct InputSkipMode { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct SchedRestart {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct SchedRestart { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct EclOutputInterval {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct EclOutputInterval { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct IgnoreKeywords {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct IgnoreKeywords { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct EdgeWeightsMethod {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct EdgeWeightsMethod { using type = Properties::UndefinedProperty; };
|
||||
|
||||
#if HAVE_OPENCL || HAVE_ROCSPARSE || HAVE_CUDA
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct NumJacobiBlocks {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct NumJacobiBlocks { using type = Properties::UndefinedProperty; };
|
||||
#endif
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct OwnerCellsFirst {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct OwnerCellsFirst { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct PartitionMethod {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct ImbalanceTol { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct SerialPartitioning {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct PartitionMethod { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct ImbalanceTol {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
|
||||
// Remove this for release 2025.04
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct ZoltanImbalanceTol {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct ZoltanParams {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct MetisParams {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
|
||||
template <class TypeTag, class MyTypeTag>
|
||||
struct ExternalPartition
|
||||
{
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct AllowDistributedWells {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct IgnoreKeywords<TypeTag, TTag::FlowBaseVanguard> {
|
||||
static constexpr auto value = "";
|
||||
};
|
||||
template<class TypeTag>
|
||||
struct EclDeckFileName<TypeTag, TTag::FlowBaseVanguard> {
|
||||
static constexpr auto value = "";
|
||||
};
|
||||
template<class TypeTag>
|
||||
struct EclOutputInterval<TypeTag, TTag::FlowBaseVanguard> {
|
||||
static constexpr int value = -1;
|
||||
};
|
||||
template<class TypeTag>
|
||||
struct EnableOpmRstFile<TypeTag, TTag::FlowBaseVanguard> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
template<class TypeTag>
|
||||
struct ParsingStrictness<TypeTag, TTag::FlowBaseVanguard> {
|
||||
static constexpr auto value = "normal";
|
||||
};
|
||||
template<class TypeTag>
|
||||
struct InputSkipMode<TypeTag, TTag::FlowBaseVanguard> {
|
||||
static constexpr auto value = "100";
|
||||
};
|
||||
template<class TypeTag>
|
||||
struct SchedRestart<TypeTag, TTag::FlowBaseVanguard> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
template<class TypeTag>
|
||||
struct EdgeWeightsMethod<TypeTag, TTag::FlowBaseVanguard> {
|
||||
static constexpr int value = 1;
|
||||
};
|
||||
|
||||
#if HAVE_OPENCL || HAVE_ROCSPARSE || HAVE_CUDA
|
||||
template<class TypeTag>
|
||||
struct NumJacobiBlocks<TypeTag, TTag::FlowBaseVanguard> {
|
||||
static constexpr int value = 0;
|
||||
};
|
||||
#endif
|
||||
|
||||
template<class TypeTag>
|
||||
struct OwnerCellsFirst<TypeTag, TTag::FlowBaseVanguard> {
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct PartitionMethod<TypeTag, TTag::FlowBaseVanguard> {
|
||||
static constexpr int value = 1; // 0: simple, 1: Zoltan, 2: METIS, see GridEnums.hpp
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct SerialPartitioning<TypeTag, TTag::FlowBaseVanguard> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct ZoltanImbalanceTol<TypeTag, TTag::FlowBaseVanguard> {
|
||||
static constexpr double value = 1.1;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct ZoltanParams<TypeTag,TTag::FlowBaseVanguard> {
|
||||
static constexpr auto value = "graph";
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct ImbalanceTol<TypeTag, TTag::FlowBaseVanguard> {
|
||||
static constexpr double value = 1.1;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct MetisParams<TypeTag,TTag::FlowBaseVanguard> {
|
||||
static constexpr auto value = "default";
|
||||
};
|
||||
|
||||
template <class TypeTag>
|
||||
struct ExternalPartition<TypeTag, TTag::FlowBaseVanguard>
|
||||
{
|
||||
static constexpr auto* value = "";
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct AllowDistributedWells<TypeTag, TTag::FlowBaseVanguard> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
|
||||
template<class T1, class T2>
|
||||
struct UseMultisegmentWell;
|
||||
struct SerialPartitioning { using type = Properties::UndefinedProperty; };
|
||||
|
||||
// Same as in BlackoilModelParameters.hpp but for here.
|
||||
template<class TypeTag>
|
||||
struct UseMultisegmentWell<TypeTag, TTag::FlowBaseVanguard> {
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
} // namespace Opm::Properties
|
||||
struct UseMultisegmentWell<TypeTag, Properties::TTag::FlowBaseVanguard>
|
||||
{ static constexpr bool value = true; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct ZoltanImbalanceTol { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct ZoltanParams { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct MetisParams { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template <class TypeTag, class MyTypeTag>
|
||||
struct ExternalPartition { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct AllowDistributedWells { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct IgnoreKeywords<TypeTag, Properties::TTag::FlowBaseVanguard>
|
||||
{ static constexpr auto value = ""; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct EclOutputInterval<TypeTag, Properties::TTag::FlowBaseVanguard>
|
||||
{ static constexpr int value = -1; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct EnableOpmRstFile<TypeTag, Properties::TTag::FlowBaseVanguard>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct ParsingStrictness<TypeTag, Properties::TTag::FlowBaseVanguard>
|
||||
{ static constexpr auto value = "normal"; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct InputSkipMode<TypeTag, Properties::TTag::FlowBaseVanguard>
|
||||
{ static constexpr auto value = "100"; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct SchedRestart<TypeTag, Properties::TTag::FlowBaseVanguard>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct EdgeWeightsMethod<TypeTag, Properties::TTag::FlowBaseVanguard>
|
||||
{ static constexpr int value = 1; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct ImbalanceTol<TypeTag, Properties::TTag::FlowBaseVanguard>
|
||||
{ static constexpr double value = 1.1; };
|
||||
|
||||
#if HAVE_OPENCL || HAVE_ROCSPARSE || HAVE_CUDA
|
||||
template<class TypeTag>
|
||||
struct NumJacobiBlocks<TypeTag, Properties::TTag::FlowBaseVanguard>
|
||||
{ static constexpr int value = 0; };
|
||||
#endif
|
||||
|
||||
template<class TypeTag>
|
||||
struct OwnerCellsFirst<TypeTag, Properties::TTag::FlowBaseVanguard>
|
||||
{ static constexpr bool value = true; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct PartitionMethod<TypeTag, Properties::TTag::FlowBaseVanguard>
|
||||
{ static constexpr int value = 1; }; // 0: simple, 1: Zoltan, 2: METIS, see GridEnums.hpp
|
||||
|
||||
template<class TypeTag>
|
||||
struct SerialPartitioning<TypeTag, Properties::TTag::FlowBaseVanguard>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct ZoltanImbalanceTol<TypeTag, Properties::TTag::FlowBaseVanguard>
|
||||
{ static constexpr double value = 1.1; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct ZoltanParams<TypeTag,Properties::TTag::FlowBaseVanguard>
|
||||
{ static constexpr auto value = "graph"; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct MetisParams<TypeTag,Properties::TTag::FlowBaseVanguard>
|
||||
{ static constexpr auto value = "default"; };
|
||||
|
||||
template <class TypeTag>
|
||||
struct ExternalPartition<TypeTag, Properties::TTag::FlowBaseVanguard>
|
||||
{ static constexpr auto* value = ""; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct AllowDistributedWells<TypeTag, Properties::TTag::FlowBaseVanguard>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
namespace Opm {
|
||||
|
||||
@ -278,75 +238,74 @@ public:
|
||||
*/
|
||||
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");
|
||||
Parameters::registerParam<TypeTag, Properties::EclOutputInterval>
|
||||
Parameters::registerParam<TypeTag, Parameters::EclOutputInterval>
|
||||
("The number of report steps that ought to be skipped between two writes of ECL results");
|
||||
Parameters::registerParam<TypeTag, Properties::EnableOpmRstFile>
|
||||
Parameters::registerParam<TypeTag, Parameters::EnableOpmRstFile>
|
||||
("Include OPM-specific keywords in the ECL restart file to "
|
||||
"enable restart of OPM simulators from these files");
|
||||
Parameters::registerParam<TypeTag, Properties::IgnoreKeywords>
|
||||
Parameters::registerParam<TypeTag, Parameters::IgnoreKeywords>
|
||||
("List of Eclipse keywords which should be ignored. As a ':' separated string.");
|
||||
Parameters::registerParam<TypeTag, Properties::ParsingStrictness>
|
||||
Parameters::registerParam<TypeTag, Parameters::ParsingStrictness>
|
||||
("Set strictness of parsing process. Available options are "
|
||||
"normal (stop for critical errors), "
|
||||
"high (stop for all errors) and "
|
||||
"low (as normal, except do not stop due to unsupported "
|
||||
"keywords even if marked critical");
|
||||
Parameters::registerParam<TypeTag, Properties::InputSkipMode>
|
||||
Parameters::registerParam<TypeTag, Parameters::InputSkipMode>
|
||||
("Set compatibility mode for the SKIP100/SKIP300 keywords. Options are "
|
||||
"100 (skip SKIP100..ENDSKIP, keep SKIP300..ENDSKIP) [default], "
|
||||
"300 (skip SKIP300..ENDSKIP, keep SKIP100..ENDSKIP) and "
|
||||
"all (skip both SKIP100..ENDSKIP and SKIP300..ENDSKIP) ");
|
||||
Parameters::registerParam<TypeTag, Properties::SchedRestart>
|
||||
Parameters::registerParam<TypeTag, Parameters::SchedRestart>
|
||||
("When restarting: should we try to initialize wells and "
|
||||
"groups from historical SCHEDULE section.");
|
||||
Parameters::registerParam<TypeTag, Properties::EdgeWeightsMethod>
|
||||
Parameters::registerParam<TypeTag, Parameters::EdgeWeightsMethod>
|
||||
("Choose edge-weighing strategy: 0=uniform, 1=trans, 2=log(trans).");
|
||||
|
||||
#if HAVE_OPENCL || HAVE_ROCSPARSE || HAVE_CUDA
|
||||
Parameters::registerParam<TypeTag, Properties::NumJacobiBlocks>
|
||||
Parameters::registerParam<TypeTag, Parameters::NumJacobiBlocks>
|
||||
("Number of blocks to be created for the Block-Jacobi preconditioner.");
|
||||
#endif
|
||||
|
||||
Parameters::registerParam<TypeTag, Properties::OwnerCellsFirst>
|
||||
Parameters::registerParam<TypeTag, Parameters::OwnerCellsFirst>
|
||||
("Order cells owned by rank before ghost/overlap cells.");
|
||||
#if HAVE_MPI
|
||||
Parameters::registerParam<TypeTag, Properties::PartitionMethod>
|
||||
Parameters::registerParam<TypeTag, Parameters::PartitionMethod>
|
||||
("Choose partitioning strategy: 0=simple, 1=Zoltan, 2=METIS.");
|
||||
Parameters::registerParam<TypeTag, Properties::SerialPartitioning>
|
||||
Parameters::registerParam<TypeTag, Parameters::SerialPartitioning>
|
||||
("Perform partitioning for parallel runs on a single process.");
|
||||
Parameters::registerParam<TypeTag, Properties::ZoltanImbalanceTol>
|
||||
Parameters::registerParam<TypeTag, Parameters::ZoltanImbalanceTol>
|
||||
("Tolerable imbalance of the loadbalancing provided by Zoltan. DEPRECATED: Use --imbalance-tol instead");
|
||||
Parameters::hideParam<TypeTag, Properties::ZoltanImbalanceTol>();
|
||||
Parameters::registerParam<TypeTag, Properties::ZoltanParams>
|
||||
Parameters::hideParam<TypeTag, Parameters::ZoltanImbalanceTol>();
|
||||
Parameters::registerParam<TypeTag, Parameters::ZoltanParams>
|
||||
("Configuration of Zoltan partitioner. "
|
||||
"Valid options are: graph, hypergraph or scotch. "
|
||||
"Alternatively, you can request a configuration to be read "
|
||||
"from a JSON file by giving the filename here, ending with '.json.' "
|
||||
"See https://sandialabs.github.io/Zoltan/ug_html/ug.html "
|
||||
"for available Zoltan options.");
|
||||
Parameters::hideParam<TypeTag, Properties::ZoltanParams>();
|
||||
Parameters::registerParam<TypeTag, Properties::ImbalanceTol>
|
||||
Parameters::hideParam<TypeTag, Parameters::ZoltanParams>();
|
||||
Parameters::registerParam<TypeTag, Parameters::ImbalanceTol>
|
||||
("Tolerable imbalance of the loadbalancing (default: 1.1).");
|
||||
|
||||
Parameters::registerParam<TypeTag, Properties::MetisParams>
|
||||
Parameters::registerParam<TypeTag, Parameters::MetisParams>
|
||||
("Configuration of Metis partitioner. "
|
||||
"You can request a configuration to be read "
|
||||
"from a JSON file by giving the filename here, ending with '.json.' "
|
||||
"See http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/manual.pdf"
|
||||
"for available METIS options.");
|
||||
Parameters::registerParam<TypeTag, Properties::ExternalPartition>
|
||||
Parameters::registerParam<TypeTag, Parameters::ExternalPartition>
|
||||
("Name of file from which to load an externally generated "
|
||||
"partitioning of the model's active cells for MPI "
|
||||
"distribution purposes. If empty, the built-in partitioning "
|
||||
"method will be employed.");
|
||||
Parameters::hideParam<TypeTag, Properties::ExternalPartition>();
|
||||
Parameters::hideParam<TypeTag, Parameters::ExternalPartition>();
|
||||
#endif
|
||||
Parameters::registerParam<TypeTag, Properties::AllowDistributedWells>
|
||||
Parameters::registerParam<TypeTag, Parameters::AllowDistributedWells>
|
||||
("Allow the perforations of a well to be distributed to interior of multiple processes");
|
||||
// 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");
|
||||
}
|
||||
|
||||
@ -359,33 +318,33 @@ public:
|
||||
FlowBaseVanguard(Simulator& simulator)
|
||||
: ParentType(simulator)
|
||||
{
|
||||
fileName_ = Parameters::get<TypeTag, Properties::EclDeckFileName>();
|
||||
edgeWeightsMethod_ = Dune::EdgeWeightMethod(Parameters::get<TypeTag, Properties::EdgeWeightsMethod>());
|
||||
fileName_ = Parameters::get<TypeTag, Parameters::EclDeckFileName>();
|
||||
edgeWeightsMethod_ = Dune::EdgeWeightMethod(Parameters::get<TypeTag, Parameters::EdgeWeightsMethod>());
|
||||
|
||||
#if HAVE_OPENCL || HAVE_ROCSPARSE || HAVE_CUDA
|
||||
numJacobiBlocks_ = Parameters::get<TypeTag, Properties::NumJacobiBlocks>();
|
||||
numJacobiBlocks_ = Parameters::get<TypeTag, Parameters::NumJacobiBlocks>();
|
||||
#endif
|
||||
|
||||
ownersFirst_ = Parameters::get<TypeTag, Properties::OwnerCellsFirst>();
|
||||
ownersFirst_ = Parameters::get<TypeTag, Parameters::OwnerCellsFirst>();
|
||||
#if HAVE_MPI
|
||||
partitionMethod_ = Dune::PartitionMethod(Parameters::get<TypeTag, Properties::PartitionMethod>());
|
||||
serialPartitioning_ = Parameters::get<TypeTag, Properties::SerialPartitioning>();
|
||||
imbalanceTol_ = Parameters::get<TypeTag, Properties::ImbalanceTol>();
|
||||
partitionMethod_ = Dune::PartitionMethod(Parameters::get<TypeTag, Parameters::PartitionMethod>());
|
||||
serialPartitioning_ = Parameters::get<TypeTag, Parameters::SerialPartitioning>();
|
||||
imbalanceTol_ = Parameters::get<TypeTag, Parameters::ImbalanceTol>();
|
||||
|
||||
zoltanImbalanceTolSet_ = Parameters::isSet<TypeTag, Properties::ZoltanImbalanceTol>();
|
||||
zoltanImbalanceTol_ = Parameters::get<TypeTag, Properties::ZoltanImbalanceTol>();
|
||||
zoltanParams_ = Parameters::get<TypeTag, Properties::ZoltanParams>();
|
||||
zoltanImbalanceTolSet_ = Parameters::isSet<TypeTag, Parameters::ZoltanImbalanceTol>();
|
||||
zoltanImbalanceTol_ = Parameters::get<TypeTag, Parameters::ZoltanImbalanceTol>();
|
||||
zoltanParams_ = Parameters::get<TypeTag, Parameters::ZoltanParams>();
|
||||
|
||||
metisParams_ = Parameters::get<TypeTag, Properties::MetisParams>();
|
||||
metisParams_ = Parameters::get<TypeTag, Parameters::MetisParams>();
|
||||
|
||||
externalPartitionFile_ = Parameters::get<TypeTag, Properties::ExternalPartition>();
|
||||
externalPartitionFile_ = Parameters::get<TypeTag, Parameters::ExternalPartition>();
|
||||
#endif
|
||||
enableDistributedWells_ = Parameters::get<TypeTag, Properties::AllowDistributedWells>();
|
||||
ignoredKeywords_ = Parameters::get<TypeTag, Properties::IgnoreKeywords>();
|
||||
int output_param = Parameters::get<TypeTag, Properties::EclOutputInterval>();
|
||||
enableDistributedWells_ = Parameters::get<TypeTag, Parameters::AllowDistributedWells>();
|
||||
ignoredKeywords_ = Parameters::get<TypeTag, Parameters::IgnoreKeywords>();
|
||||
int output_param = Parameters::get<TypeTag, Parameters::EclOutputInterval>();
|
||||
if (output_param >= 0)
|
||||
outputInterval_ = output_param;
|
||||
useMultisegmentWell_ = Parameters::get<TypeTag, Properties::UseMultisegmentWell>();
|
||||
useMultisegmentWell_ = Parameters::get<TypeTag, Parameters::UseMultisegmentWell>();
|
||||
enableExperiments_ = enableExperiments;
|
||||
|
||||
init();
|
||||
@ -582,7 +541,7 @@ protected:
|
||||
asImp_().createGrids_();
|
||||
asImp_().filterConnections_();
|
||||
std::string outputDir = Parameters::get<TypeTag, Parameters::OutputDir>();
|
||||
bool enableEclCompatFile = !Parameters::get<TypeTag, Properties::EnableOpmRstFile>();
|
||||
bool enableEclCompatFile = !Parameters::get<TypeTag, Parameters::EnableOpmRstFile>();
|
||||
asImp_().updateOutputDir_(outputDir, enableEclCompatFile);
|
||||
asImp_().finalizeInit_();
|
||||
}
|
||||
|
@ -42,37 +42,32 @@
|
||||
#include <cstddef>
|
||||
#include <memory>
|
||||
|
||||
namespace Opm::Properties {
|
||||
namespace Opm::Parameters {
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct EnableDryRun {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct EnableDryRun { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct OutputInterval {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct OutputInterval { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct EnableLoggingFalloutWarning {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct EnableLoggingFalloutWarning { using type = Properties::UndefinedProperty; };
|
||||
|
||||
// TODO: enumeration parameters. we use strings for now.
|
||||
template<class TypeTag>
|
||||
struct EnableDryRun<TypeTag, TTag::FlowProblem> {
|
||||
static constexpr auto value = "auto";
|
||||
};
|
||||
struct EnableDryRun<TypeTag, Properties::TTag::FlowProblem>
|
||||
{ static constexpr auto value = "auto"; };
|
||||
|
||||
// Do not merge parallel output files or warn about them
|
||||
template<class TypeTag>
|
||||
struct EnableLoggingFalloutWarning<TypeTag, TTag::FlowProblem> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
template<class TypeTag>
|
||||
struct OutputInterval<TypeTag, TTag::FlowProblem> {
|
||||
static constexpr int value = 1;
|
||||
};
|
||||
struct EnableLoggingFalloutWarning<TypeTag, Properties::TTag::FlowProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
} // namespace Opm::Properties
|
||||
template<class TypeTag>
|
||||
struct OutputInterval<TypeTag, Properties::TTag::FlowProblem>
|
||||
{ static constexpr int value = 1; };
|
||||
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
namespace Opm {
|
||||
|
||||
@ -115,11 +110,11 @@ namespace Opm {
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
// register the flow specific parameters
|
||||
Parameters::registerParam<TypeTag, Properties::EnableDryRun>
|
||||
Parameters::registerParam<TypeTag, Parameters::EnableDryRun>
|
||||
("Specify if the simulation ought to be actually run, or just pretended to be");
|
||||
Parameters::registerParam<TypeTag, Properties::OutputInterval>
|
||||
Parameters::registerParam<TypeTag, Parameters::OutputInterval>
|
||||
("Specify the number of report steps between two consecutive writes of restart data");
|
||||
Parameters::registerParam<TypeTag, Properties::EnableLoggingFalloutWarning>
|
||||
Parameters::registerParam<TypeTag, Parameters::EnableLoggingFalloutWarning>
|
||||
("Developer option to see whether logging was on non-root processors. "
|
||||
"In that case it will be appended to the *.DBG or *.PRT files");
|
||||
|
||||
@ -160,7 +155,7 @@ namespace Opm {
|
||||
|
||||
// the default eWoms checkpoint/restart mechanism does not work with flow
|
||||
Parameters::hideParam<TypeTag, Parameters::RestartTime>();
|
||||
Parameters::hideParam<TypeTag, Properties::RestartWritingInterval>();
|
||||
Parameters::hideParam<TypeTag, 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::hideParam<TypeTag, Parameters::VtkWriteOilFormationVolumeFactor>();
|
||||
@ -184,7 +179,7 @@ namespace Opm {
|
||||
Parameters::hideParam<TypeTag, Parameters::VtkWriteGasFormationVolumeFactor>();
|
||||
Parameters::hideParam<TypeTag, Parameters::VtkWriteGasSaturationPressure>();
|
||||
Parameters::hideParam<TypeTag, Parameters::VtkWriteIntrinsicPermeabilities>();
|
||||
Parameters::hideParam<TypeTag, Properties::VtkWriteTracerConcentration>();
|
||||
Parameters::hideParam<TypeTag, Parameters::VtkWriteTracerConcentration>();
|
||||
Parameters::hideParam<TypeTag, Parameters::VtkWriteExtrusionFactor>();
|
||||
Parameters::hideParam<TypeTag, Parameters::VtkWriteFilterVelocities>();
|
||||
Parameters::hideParam<TypeTag, Parameters::VtkWriteDensities>();
|
||||
@ -205,7 +200,7 @@ namespace Opm {
|
||||
Parameters::hideParam<TypeTag, Parameters::VtkWriteEffectiveDiffusionCoefficients>();
|
||||
|
||||
// hide average density option
|
||||
Parameters::hideParam<TypeTag, Properties::UseAverageDensityMsWells>();
|
||||
Parameters::hideParam<TypeTag, Parameters::UseAverageDensityMsWells>();
|
||||
|
||||
Parameters::endParamRegistration<TypeTag>();
|
||||
|
||||
@ -417,8 +412,8 @@ namespace Opm {
|
||||
}
|
||||
|
||||
detail::mergeParallelLogFiles(eclState().getIOConfig().getOutputDir(),
|
||||
Parameters::get<TypeTag, Properties::EclDeckFileName>(),
|
||||
Parameters::get<TypeTag, Properties::EnableLoggingFalloutWarning>());
|
||||
Parameters::get<TypeTag, Parameters::EclDeckFileName>(),
|
||||
Parameters::get<TypeTag, Parameters::EnableLoggingFalloutWarning>());
|
||||
}
|
||||
|
||||
void setupModelSimulator()
|
||||
@ -429,7 +424,7 @@ namespace Opm {
|
||||
|
||||
try {
|
||||
// Possible to force initialization only behavior (NOSIM).
|
||||
const std::string& dryRunString = Parameters::get<TypeTag, Properties::EnableDryRun>();
|
||||
const std::string& dryRunString = Parameters::get<TypeTag, Parameters::EnableDryRun>();
|
||||
if (dryRunString != "" && dryRunString != "auto") {
|
||||
bool yesno;
|
||||
if (dryRunString == "true"
|
||||
@ -507,7 +502,7 @@ namespace Opm {
|
||||
printFlowTrailer(mpi_size_, threads, total_setup_time_, deck_read_time_, report, simulator_->model().localAccumulatedReports());
|
||||
|
||||
detail::handleExtraConvergenceOutput(report,
|
||||
Parameters::get<TypeTag, Properties::OutputExtraConvergenceInfo>(),
|
||||
Parameters::get<TypeTag, Parameters::OutputExtraConvergenceInfo>(),
|
||||
R"(OutputExtraConvergenceInfo (--output-extra-convergence-info))",
|
||||
eclState().getIOConfig().getOutputDir(),
|
||||
eclState().getIOConfig().getBaseName());
|
||||
|
@ -216,32 +216,32 @@ public:
|
||||
|
||||
VtkTracerModule<TypeTag>::registerParameters();
|
||||
|
||||
Parameters::registerParam<TypeTag, Properties::EnableWriteAllSolutions>
|
||||
Parameters::registerParam<TypeTag, Parameters::EnableWriteAllSolutions>
|
||||
("Write all solutions to disk instead of only the ones for the "
|
||||
"report steps");
|
||||
Parameters::registerParam<TypeTag, Properties::EnableEclOutput>
|
||||
Parameters::registerParam<TypeTag, Parameters::EnableEclOutput>
|
||||
("Write binary output which is compatible with the commercial "
|
||||
"Eclipse simulator");
|
||||
#if HAVE_DAMARIS
|
||||
Parameters::registerParam<TypeTag, Properties::EnableDamarisOutput>
|
||||
Parameters::registerParam<TypeTag, Parameters::EnableDamarisOutput>
|
||||
("Write a specific variable using Damaris in a separate core");
|
||||
#endif
|
||||
Parameters::registerParam<TypeTag, Properties::EclOutputDoublePrecision>
|
||||
Parameters::registerParam<TypeTag, Parameters::EclOutputDoublePrecision>
|
||||
("Tell the output writer to use double precision. Useful for 'perfect' restarts");
|
||||
Parameters::registerParam<TypeTag, Properties::RestartWritingInterval>
|
||||
Parameters::registerParam<TypeTag, Parameters::RestartWritingInterval>
|
||||
("The frequencies of which time steps are serialized to disk");
|
||||
Parameters::registerParam<TypeTag, Properties::EnableDriftCompensation>
|
||||
Parameters::registerParam<TypeTag, Parameters::EnableDriftCompensation>
|
||||
("Enable partial compensation of systematic mass losses via "
|
||||
"the source term of the next time step");
|
||||
Parameters::registerParam<TypeTag, Properties::OutputMode>
|
||||
Parameters::registerParam<TypeTag, Parameters::OutputMode>
|
||||
("Specify which messages are going to be printed. "
|
||||
"Valid values are: none, log, all (default)");
|
||||
Parameters::registerParam<TypeTag, Properties::NumPressurePointsEquil>
|
||||
Parameters::registerParam<TypeTag, Parameters::NumPressurePointsEquil>
|
||||
("Number of pressure points (in each direction) in tables used for equilibration");
|
||||
Parameters::hideParam<TypeTag, Properties::NumPressurePointsEquil>(); // Users will typically not need to modify this parameter..
|
||||
Parameters::registerParam<TypeTag, Properties::ExplicitRockCompaction>
|
||||
Parameters::hideParam<TypeTag, Parameters::NumPressurePointsEquil>(); // Users will typically not need to modify this parameter..
|
||||
Parameters::registerParam<TypeTag, Parameters::ExplicitRockCompaction>
|
||||
("Use pressure from end of the last time step when evaluating rock compaction");
|
||||
Parameters::hideParam<TypeTag, Properties::ExplicitRockCompaction>(); // Users will typically not need to modify this parameter..
|
||||
Parameters::hideParam<TypeTag, Parameters::ExplicitRockCompaction>(); // Users will typically not need to modify this parameter..
|
||||
}
|
||||
|
||||
|
||||
@ -309,28 +309,28 @@ public:
|
||||
#if HAVE_DAMARIS
|
||||
// create Damaris writer
|
||||
damarisWriter_ = std::make_unique<DamarisWriterType>(simulator);
|
||||
enableDamarisOutput_ = Parameters::get<TypeTag, Properties::EnableDamarisOutput>();
|
||||
enableDamarisOutput_ = Parameters::get<TypeTag, Parameters::EnableDamarisOutput>();
|
||||
#endif
|
||||
enableDriftCompensation_ = Parameters::get<TypeTag, Properties::EnableDriftCompensation>();
|
||||
enableDriftCompensation_ = Parameters::get<TypeTag, Parameters::EnableDriftCompensation>();
|
||||
|
||||
enableEclOutput_ = Parameters::get<TypeTag, Properties::EnableEclOutput>();
|
||||
enableEclOutput_ = Parameters::get<TypeTag, Parameters::EnableEclOutput>();
|
||||
|
||||
this->enableTuning_ = Parameters::get<TypeTag, Properties::EnableTuning>();
|
||||
this->enableTuning_ = Parameters::get<TypeTag, Parameters::EnableTuning>();
|
||||
this->initialTimeStepSize_ = Parameters::get<TypeTag, Parameters::InitialTimeStepSize>();
|
||||
this->maxTimeStepAfterWellEvent_ = Parameters::get<TypeTag, Properties::TimeStepAfterEventInDays>() * 24 * 60 * 60;
|
||||
this->maxTimeStepAfterWellEvent_ = Parameters::get<TypeTag, Parameters::TimeStepAfterEventInDays>() * 24 * 60 * 60;
|
||||
|
||||
// The value N for this parameter is defined in the following order of presedence:
|
||||
// 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, Properties::NumPressurePointsEquil>())
|
||||
if (Parameters::isSet<TypeTag, Parameters::NumPressurePointsEquil>())
|
||||
{
|
||||
this->numPressurePointsEquil_ = Parameters::get<TypeTag, Properties::NumPressurePointsEquil>();
|
||||
this->numPressurePointsEquil_ = Parameters::get<TypeTag, Parameters::NumPressurePointsEquil>();
|
||||
} else {
|
||||
this->numPressurePointsEquil_ = simulator.vanguard().eclState().getTableManager().getEqldims().getNumDepthNodesP();
|
||||
}
|
||||
|
||||
explicitRockCompaction_ = Parameters::get<TypeTag, Properties::ExplicitRockCompaction>();
|
||||
explicitRockCompaction_ = Parameters::get<TypeTag, Parameters::ExplicitRockCompaction>();
|
||||
|
||||
|
||||
RelpermDiagnostics relpermDiagnostics;
|
||||
@ -649,7 +649,7 @@ public:
|
||||
OPM_TIMEBLOCK(endTimeStep);
|
||||
|
||||
#ifndef NDEBUG
|
||||
if constexpr (getPropValue<TypeTag, Properties::EnableDebuggingChecks>()) {
|
||||
if constexpr (getPropValue<TypeTag, Parameters::EnableDebuggingChecks>()) {
|
||||
// in debug mode, we don't care about performance, so we check
|
||||
// if the model does the right thing (i.e., the mass change
|
||||
// inside the whole reservoir must be equivalent to the fluxes
|
||||
@ -780,7 +780,7 @@ public:
|
||||
OPM_TIMEBLOCK(problemWriteOutput);
|
||||
// use the generic code to prepare the output fields and to
|
||||
// write the desired VTK files.
|
||||
if (Parameters::get<TypeTag, Properties::EnableWriteAllSolutions>() ||
|
||||
if (Parameters::get<TypeTag, Parameters::EnableWriteAllSolutions>() ||
|
||||
this->simulator().episodeWillBeOver()) {
|
||||
ParentType::writeOutput(verbose);
|
||||
}
|
||||
@ -2689,7 +2689,7 @@ private:
|
||||
int episodeIdx = simulator.episodeIndex();
|
||||
|
||||
// first thing in the morning, limit the time step size to the maximum size
|
||||
Scalar maxTimeStepSize = Parameters::get<TypeTag, Properties::SolverMaxTimeStepInDays>() * 24 * 60 * 60;
|
||||
Scalar maxTimeStepSize = Parameters::get<TypeTag, Parameters::SolverMaxTimeStepInDays>() * 24 * 60 * 60;
|
||||
int reportStepIdx = std::max(episodeIdx, 0);
|
||||
if (this->enableTuning_) {
|
||||
const auto& tuning = schedule[reportStepIdx].tuning();
|
||||
|
63
opm/simulators/flow/FlowProblemParameters.hpp
Normal file
63
opm/simulators/flow/FlowProblemParameters.hpp
Normal file
@ -0,0 +1,63 @@
|
||||
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
// vi: set et ts=4 sw=4 sts=4:
|
||||
/*
|
||||
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 2 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/>.
|
||||
|
||||
Consult the COPYING file in the top-level source directory of this
|
||||
module for the precise wording of the license and the list of
|
||||
copyright holders.
|
||||
*/
|
||||
/*!
|
||||
* \file
|
||||
*
|
||||
* \copydoc Opm::FlowProblem
|
||||
*/
|
||||
#ifndef OPM_FLOW_PROBLEM_PARAMETERS_HPP
|
||||
#define OPM_FLOW_PROBLEM_PARAMETERS_HPP
|
||||
|
||||
#include <opm/models/utils/propertysystem.hh>
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
// Enable the additional checks even if compiled in debug mode (i.e., with the NDEBUG
|
||||
// macro undefined). Next to a slightly better performance, this also eliminates some
|
||||
// print statements in debug mode.
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct EnableDebuggingChecks { using type = Properties::UndefinedProperty; };
|
||||
|
||||
// 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; };
|
||||
|
||||
// implicit or explicit pressure in rock compaction
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct ExplicitRockCompaction { using type = Properties::UndefinedProperty; };
|
||||
|
||||
// Parameterize equilibration accuracy
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct NumPressurePointsEquil { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct OutputMode { using type = Properties::UndefinedProperty; };
|
||||
|
||||
// The number of time steps skipped between writing two consequtive restart files
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct RestartWritingInterval { using type = Properties::UndefinedProperty; };
|
||||
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
#endif // OPM_FLOW_PROBLEM_PARAMETERS_HPP
|
@ -40,6 +40,7 @@
|
||||
#include <opm/simulators/flow/CpGridVanguard.hpp>
|
||||
#include <opm/simulators/flow/DummyGradientCalculator.hpp>
|
||||
#include <opm/simulators/flow/EclWriter.hpp>
|
||||
#include <opm/simulators/flow/FlowProblemParameters.hpp>
|
||||
#include <opm/simulators/flow/FIBlackoilModel.hpp>
|
||||
#include <opm/simulators/flow/NewTranFluxModule.hpp>
|
||||
#include <opm/simulators/flow/OutputBlackoilModule.hpp>
|
||||
@ -61,113 +62,62 @@ namespace Opm::Properties {
|
||||
namespace TTag {
|
||||
|
||||
struct FlowBaseProblem {
|
||||
using InheritsFrom = std::tuple<VtkTracer, OutputBlackOil, CpGridVanguard>;
|
||||
using InheritsFrom = std::tuple<VtkTracer, OutputBlackOil, CpGridVanguard>;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
// The class which deals with wells
|
||||
// The class which deals with ECL aquifers
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct WellModel {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
|
||||
// The number of time steps skipped between writing two consequtive restart files
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct RestartWritingInterval {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
|
||||
// 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 = UndefinedProperty;
|
||||
};
|
||||
|
||||
// Enable the additional checks even if compiled in debug mode (i.e., with the NDEBUG
|
||||
// macro undefined). Next to a slightly better performance, this also eliminates some
|
||||
// print statements in debug mode.
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct EnableDebuggingChecks {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
|
||||
// if thermal flux boundaries are enabled an effort is made to preserve the initial
|
||||
// thermal gradient specified via the TEMPVD keyword
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct EnableThermalFluxBoundaries {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct AquiferModel { using type = UndefinedProperty; };
|
||||
|
||||
// Specify whether API tracking should be enabled (replaces PVT regions).
|
||||
// TODO: This is not yet implemented
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct EnableApiTracking {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct EnableApiTracking { using type = UndefinedProperty; };
|
||||
|
||||
// The class which deals with ECL aquifers
|
||||
// if thermal flux boundaries are enabled an effort is made to preserve the initial
|
||||
// thermal gradient specified via the TEMPVD keyword
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct AquiferModel {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct EnableThermalFluxBoundaries { using type = UndefinedProperty; };
|
||||
|
||||
// The class which deals with wells
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct OutputMode {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
// Parameterize equilibration accuracy
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct NumPressurePointsEquil {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
// implicit or explicit pressure in rock compaction
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct ExplicitRockCompaction {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
|
||||
|
||||
struct WellModel { using type = UndefinedProperty; };
|
||||
|
||||
// Set the problem property
|
||||
template<class TypeTag>
|
||||
struct Problem<TypeTag, TTag::FlowBaseProblem> {
|
||||
using type = FlowProblem<TypeTag>;
|
||||
};
|
||||
struct Problem<TypeTag, TTag::FlowBaseProblem>
|
||||
{ using type = FlowProblem<TypeTag>; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct Model<TypeTag, TTag::FlowBaseProblem> {
|
||||
using type = FIBlackOilModel<TypeTag>;
|
||||
};
|
||||
struct Model<TypeTag, TTag::FlowBaseProblem>
|
||||
{ using type = FIBlackOilModel<TypeTag>; };
|
||||
|
||||
// Select the element centered finite volume method as spatial discretization
|
||||
template<class TypeTag>
|
||||
struct SpatialDiscretizationSplice<TypeTag, TTag::FlowBaseProblem> {
|
||||
using type = TTag::EcfvDiscretization;
|
||||
};
|
||||
struct SpatialDiscretizationSplice<TypeTag, TTag::FlowBaseProblem>
|
||||
{ using type = TTag::EcfvDiscretization; };
|
||||
|
||||
// use automatic differentiation to linearize the system of PDEs
|
||||
template<class TypeTag>
|
||||
struct LocalLinearizerSplice<TypeTag, TTag::FlowBaseProblem> {
|
||||
using type = TTag::AutoDiffLocalLinearizer;
|
||||
};
|
||||
struct LocalLinearizerSplice<TypeTag, TTag::FlowBaseProblem>
|
||||
{ using type = TTag::AutoDiffLocalLinearizer; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct BaseDiscretizationType<TypeTag, TTag::FlowBaseProblem> {
|
||||
using type = FvBaseDiscretizationNoAdapt<TypeTag>;
|
||||
};
|
||||
struct BaseDiscretizationType<TypeTag, TTag::FlowBaseProblem>
|
||||
{ using type = FvBaseDiscretizationNoAdapt<TypeTag>; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct DiscreteFunction<TypeTag, TTag::FlowBaseProblem> {
|
||||
struct DiscreteFunction<TypeTag, TTag::FlowBaseProblem>
|
||||
{
|
||||
using BaseDiscretization = FvBaseDiscretization<TypeTag>;
|
||||
using type = typename BaseDiscretization::BlockVectorWrapper;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct GridView<TypeTag, TTag::FlowBaseProblem>
|
||||
{
|
||||
using type = typename GetPropType<TypeTag, Properties::Grid>::LeafGridView;
|
||||
};
|
||||
{ using type = typename GetPropType<TypeTag, Properties::Grid>::LeafGridView; };
|
||||
|
||||
// Set the material law for fluid fluxes
|
||||
template<class TypeTag>
|
||||
@ -240,230 +190,193 @@ struct AquiferModel<TypeTag, TTag::FlowBaseProblem> {
|
||||
|
||||
// Enable diffusion
|
||||
template<class TypeTag>
|
||||
struct EnableDiffusion<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
struct EnableDiffusion<TypeTag, TTag::FlowBaseProblem>
|
||||
{ static constexpr bool value = true; };
|
||||
|
||||
// Disable dispersion
|
||||
template<class TypeTag>
|
||||
struct EnableDispersion<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
|
||||
// only write the solutions for the report steps to disk
|
||||
template<class TypeTag>
|
||||
struct EnableWriteAllSolutions<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
struct EnableDispersion<TypeTag, TTag::FlowBaseProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
// disable API tracking
|
||||
template<class TypeTag>
|
||||
struct EnableApiTracking<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
|
||||
// ... but enable the ECL output by default
|
||||
template<class TypeTag>
|
||||
struct EnableEclOutput<TypeTag,TTag::FlowBaseProblem> {
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
#ifdef HAVE_DAMARIS
|
||||
//! Disable the Damaris HDF5 output by default
|
||||
template<class TypeTag>
|
||||
struct EnableDamarisOutput<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
// If Damaris is available, write specific variable output in parallel
|
||||
template<class TypeTag>
|
||||
struct DamarisOutputHdfCollective<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
// Save the reservoir model mesh data to the HDF5 file (even if field data HDF5 output is disabled)
|
||||
template<class TypeTag>
|
||||
struct DamarisSaveMeshToHdf<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
// Save the simulation fields (currently only PRESSURE) variables to HDF5 file
|
||||
template<class TypeTag>
|
||||
struct DamarisSaveToHdf<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
// Specify path and filename of a Python script to run on each end of iteration output
|
||||
template<class TypeTag>
|
||||
struct DamarisPythonScript<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr auto value = "";
|
||||
};
|
||||
// Specifiy a Paraview Catalyst in situ visualisation script (if Paraview is enabled in Damaris)
|
||||
template<class TypeTag>
|
||||
struct DamarisPythonParaviewScript<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr auto value = "";
|
||||
};
|
||||
// Specify a unique name for the Damaris simulation (used as prefix to HDF5 filenames)
|
||||
template<class TypeTag>
|
||||
struct DamarisSimName<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr auto value = "";
|
||||
};
|
||||
// Specify the number of Damaris cores (dc) to create (per-node). Must divide into the remaining ranks
|
||||
// equally, e.g. mpirun -np 16 ... -> (if running on one node)
|
||||
// The following are allowed:
|
||||
// 1 dc + 15 sim ranks
|
||||
// or 2 dc + 14 sim
|
||||
// or 4 dc + 12 sim
|
||||
// *not* 3 dc + 13 sim ranks
|
||||
template<class TypeTag>
|
||||
struct DamarisDedicatedCores<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr int value = 1;
|
||||
};
|
||||
// Specify the number of Damaris nodes to create
|
||||
template<class TypeTag>
|
||||
struct DamarisDedicatedNodes<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr int value = 0;
|
||||
};
|
||||
// Specify a name for the Damaris shared memory file (a unique name will be created by default)
|
||||
template<class TypeTag>
|
||||
struct DamarisSharedMemoryName<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr auto value = "" ; // default name is empty, will make unique if needed in DamarisKeywords()
|
||||
};
|
||||
// Specify the shared memory file size
|
||||
template<class TypeTag>
|
||||
struct DamarisSharedMemorySizeBytes<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr long value = 536870912; // 512 MB
|
||||
};
|
||||
// Specify the Damaris log level - if set to debug then log is flushed regularly
|
||||
template<class TypeTag>
|
||||
struct DamarisLogLevel<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr auto value = "info";
|
||||
};
|
||||
// Specify the dask file jason file that specifies the Dask scheduler etc.
|
||||
template<class TypeTag>
|
||||
struct DamarisDaskFile<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr auto value = "";
|
||||
};
|
||||
// Specify the the exact variables to be passed through to Damaris (must exist in the XML file / intiDamarisXmlFile.cpp)
|
||||
template<class TypeTag>
|
||||
struct DamarisLimitVariables<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr auto value = "";
|
||||
};
|
||||
#endif
|
||||
// If available, write the ECL output in a non-blocking manner
|
||||
template<class TypeTag>
|
||||
struct EnableAsyncEclOutput<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
|
||||
// Write ESMRY file for fast loading of summary data
|
||||
template<class TypeTag>
|
||||
struct EnableEsmry<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
|
||||
// By default, use single precision for the ECL formated results
|
||||
template<class TypeTag>
|
||||
struct EclOutputDoublePrecision<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
struct EnableApiTracking<TypeTag, TTag::FlowBaseProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
// Use the "velocity module" which uses the Eclipse "NEWTRAN" transmissibilities
|
||||
template<class TypeTag>
|
||||
struct FluxModule<TypeTag, TTag::FlowBaseProblem> {
|
||||
using type = NewTranFluxModule<TypeTag>;
|
||||
};
|
||||
struct FluxModule<TypeTag, TTag::FlowBaseProblem>
|
||||
{ using type = NewTranFluxModule<TypeTag>; };
|
||||
|
||||
// Use the dummy gradient calculator in order not to do unnecessary work.
|
||||
template<class TypeTag>
|
||||
struct GradientCalculator<TypeTag, TTag::FlowBaseProblem> {
|
||||
using type = DummyGradientCalculator<TypeTag>;
|
||||
};
|
||||
struct GradientCalculator<TypeTag, TTag::FlowBaseProblem>
|
||||
{ using type = DummyGradientCalculator<TypeTag>; };
|
||||
|
||||
// The frequency of writing restart (*.ers) files. This is the number of time steps
|
||||
// between writing restart files
|
||||
// store temperature (but do not conserve energy, as long as EnableEnergy is false)
|
||||
template<class TypeTag>
|
||||
struct RestartWritingInterval<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr int value = 0xffffff; // disable
|
||||
};
|
||||
struct EnableTemperature<TypeTag, TTag::FlowBaseProblem>
|
||||
{ static constexpr bool value = true; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct EnableMech<TypeTag, TTag::FlowBaseProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
// disable all extensions supported by black oil model. this should not really be
|
||||
// necessary but it makes things a bit more explicit
|
||||
template<class TypeTag>
|
||||
struct EnablePolymer<TypeTag, TTag::FlowBaseProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct EnableSolvent<TypeTag, TTag::FlowBaseProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct EnableEnergy<TypeTag, TTag::FlowBaseProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct EnableFoam<TypeTag, TTag::FlowBaseProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct EnableExtbo<TypeTag, TTag::FlowBaseProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct EnableMICP<TypeTag, TTag::FlowBaseProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
// disable thermal flux boundaries by default
|
||||
template<class TypeTag>
|
||||
struct EnableThermalFluxBoundaries<TypeTag, TTag::FlowBaseProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
// By default, simulators derived from the FlowBaseProblem are production simulators,
|
||||
// i.e., experimental features must be explicitly enabled at compile time
|
||||
template<class TypeTag>
|
||||
struct EnableExperiments<TypeTag, TTag::FlowBaseProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
} // namespace Opm::Properties
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
#ifdef HAVE_DAMARIS
|
||||
//! Disable the Damaris HDF5 output by default
|
||||
template<class TypeTag>
|
||||
struct EnableDamarisOutput<TypeTag, Properties::TTag::FlowBaseProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
// If Damaris is available, write specific variable output in parallel
|
||||
template<class TypeTag>
|
||||
struct DamarisOutputHdfCollective<TypeTag, Properties::TTag::FlowBaseProblem>
|
||||
{ static constexpr bool value = true; };
|
||||
|
||||
// Save the reservoir model mesh data to the HDF5 file
|
||||
// (even if field data HDF5 output is disabled)
|
||||
template<class TypeTag>
|
||||
struct DamarisSaveMeshToHdf<TypeTag, Properties::TTag::FlowBaseProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
// Save the simulation fields (currently only PRESSURE) variables to HDF5 file
|
||||
template<class TypeTag>
|
||||
struct DamarisSaveToHdf<TypeTag, Properties::TTag::FlowBaseProblem>
|
||||
{ static constexpr bool value = true; };
|
||||
|
||||
// Specify path and filename of a Python script to run on each end of iteration output
|
||||
template<class TypeTag>
|
||||
struct DamarisPythonScript<TypeTag, Properties::TTag::FlowBaseProblem>
|
||||
{ static constexpr auto value = ""; };
|
||||
|
||||
// Specifiy a Paraview Catalyst in situ visualisation script
|
||||
// (if Paraview is enabled in Damaris)
|
||||
template<class TypeTag>
|
||||
struct DamarisPythonParaviewScript<TypeTag, Properties::TTag::FlowBaseProblem>
|
||||
{ static constexpr auto value = ""; };
|
||||
|
||||
// Specify a unique name for the Damaris simulation (used as prefix to HDF5 filenames)
|
||||
template<class TypeTag>
|
||||
struct DamarisSimName<TypeTag, Properties::TTag::FlowBaseProblem>
|
||||
{ static constexpr auto value = ""; };
|
||||
|
||||
// Specify the number of Damaris cores (dc) to create (per-node).
|
||||
// Must divide into the remaining ranks
|
||||
// equally, e.g. mpirun -np 16 ... -> (if running on one node)
|
||||
// The following are allowed:
|
||||
// 1 dc + 15 sim ranks
|
||||
// or 2 dc + 14 sim
|
||||
// or 4 dc + 12 sim
|
||||
// *not* 3 dc + 13 sim ranks
|
||||
template<class TypeTag>
|
||||
struct DamarisDedicatedCores<TypeTag, Properties::TTag::FlowBaseProblem>
|
||||
{ static constexpr int value = 1; };
|
||||
|
||||
// Specify the number of Damaris nodes to create
|
||||
template<class TypeTag>
|
||||
struct DamarisDedicatedNodes<TypeTag, Properties::TTag::FlowBaseProblem>
|
||||
{ static constexpr int value = 0; };
|
||||
|
||||
// Specify a name for the Damaris shared memory file
|
||||
// (a unique name will be created by default)
|
||||
template<class TypeTag>
|
||||
struct DamarisSharedMemoryName<TypeTag, Properties::TTag::FlowBaseProblem>
|
||||
{ static constexpr auto value = "" ; };
|
||||
|
||||
// Specify the shared memory file size
|
||||
template<class TypeTag>
|
||||
struct DamarisSharedMemorySizeBytes<TypeTag, Properties::TTag::FlowBaseProblem>
|
||||
{ static constexpr long value = 536870912; }; // 512 MB
|
||||
|
||||
// Specify the Damaris log level - if set to debug then log is flushed regularly
|
||||
template<class TypeTag>
|
||||
struct DamarisLogLevel<TypeTag, Properties::TTag::FlowBaseProblem>
|
||||
{ static constexpr auto value = "info"; };
|
||||
|
||||
// Specify the dask file jason file that specifies the Dask scheduler etc.
|
||||
template<class TypeTag>
|
||||
struct DamarisDaskFile<TypeTag, Properties::TTag::FlowBaseProblem>
|
||||
{ static constexpr auto value = ""; };
|
||||
|
||||
// Specify the the exact variables to be passed through
|
||||
// to Damaris (must exist in the XML file / intiDamarisXmlFile.cpp)
|
||||
template<class TypeTag>
|
||||
struct DamarisLimitVariables<TypeTag, Properties::TTag::FlowBaseProblem>
|
||||
{ static constexpr auto value = ""; };
|
||||
#endif
|
||||
|
||||
// By default, use single precision for the ECL formated results
|
||||
template<class TypeTag>
|
||||
struct EclOutputDoublePrecision<TypeTag, Properties::TTag::FlowBaseProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
// If available, write the ECL output in a non-blocking manner
|
||||
template<class TypeTag>
|
||||
struct EnableAsyncEclOutput<TypeTag, Properties::TTag::FlowBaseProblem>
|
||||
{ static constexpr bool value = true; };
|
||||
|
||||
// By default, we enable the debugging checks if we're compiled in debug mode
|
||||
template<class TypeTag>
|
||||
struct EnableDebuggingChecks<TypeTag, Properties::TTag::FlowBaseProblem>
|
||||
{ static constexpr bool value = true; };
|
||||
|
||||
// Drift compensation is an experimental feature, i.e., systematic errors in the
|
||||
// conservation quantities are only compensated for
|
||||
// as default if experimental mode is enabled.
|
||||
template<class TypeTag>
|
||||
struct EnableDriftCompensation<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
struct EnableDriftCompensation<TypeTag, Properties::TTag::FlowBaseProblem>
|
||||
{ static constexpr bool value = true; };
|
||||
|
||||
// By default, we enable the debugging checks if we're compiled in debug mode
|
||||
// enable the ECL output by default
|
||||
template<class TypeTag>
|
||||
struct EnableDebuggingChecks<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
struct EnableEclOutput<TypeTag,Properties::TTag::FlowBaseProblem>
|
||||
{ static constexpr bool value = true; };
|
||||
|
||||
// store temperature (but do not conserve energy, as long as EnableEnergy is false)
|
||||
// Write ESMRY file for fast loading of summary data
|
||||
template<class TypeTag>
|
||||
struct EnableTemperature<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct EnableMech<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
// disable all extensions supported by black oil model. this should not really be
|
||||
// necessary but it makes things a bit more explicit
|
||||
template<class TypeTag>
|
||||
struct EnablePolymer<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
template<class TypeTag>
|
||||
struct EnableSolvent<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
template<class TypeTag>
|
||||
struct EnableEnergy<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
template<class TypeTag>
|
||||
struct EnableFoam<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
template<class TypeTag>
|
||||
struct EnableExtbo<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
template<class TypeTag>
|
||||
struct EnableMICP<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
|
||||
// disable thermal flux boundaries by default
|
||||
template<class TypeTag>
|
||||
struct EnableThermalFluxBoundaries<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
|
||||
// By default, simulators derived from the FlowBaseProblem are production simulators,
|
||||
// i.e., experimental features must be explicitly enabled at compile time
|
||||
template<class TypeTag>
|
||||
struct EnableExperiments<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct OutputMode<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr auto value = "all";
|
||||
};
|
||||
// Parameterize equilibration accuracy
|
||||
template<class TypeTag>
|
||||
struct NumPressurePointsEquil<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr int value = ParserKeywords::EQLDIMS::DEPTH_NODES_P::defaultValue;
|
||||
};
|
||||
// By default, use implicit pressure in rock compaction
|
||||
template<class TypeTag>
|
||||
struct ExplicitRockCompaction<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
|
||||
} // namespace Opm::Properties
|
||||
|
||||
namespace Opm::Parameters {
|
||||
struct EnableEsmry<TypeTag, Properties::TTag::FlowBaseProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
// Enable gravity
|
||||
template<class TypeTag>
|
||||
@ -486,6 +399,11 @@ template<class TypeTag>
|
||||
struct EnableVtkOutput<TypeTag, Properties::TTag::FlowBaseProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
// only write the solutions for the report steps to disk
|
||||
template<class TypeTag>
|
||||
struct EnableWriteAllSolutions<TypeTag, Properties::TTag::FlowBaseProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
// The default for the end time of the simulation [s]
|
||||
//
|
||||
// By default, stop it after the universe will probably have stopped
|
||||
@ -498,6 +416,11 @@ struct EndTime<TypeTag, Properties::TTag::FlowBaseProblem>
|
||||
static constexpr type value = 1e100;
|
||||
};
|
||||
|
||||
// By default, use implicit pressure in rock compaction
|
||||
template<class TypeTag>
|
||||
struct ExplicitRockCompaction<TypeTag, Properties::TTag::FlowBaseProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
// The default for the initial time step size of the simulation [s].
|
||||
//
|
||||
// The chosen value means that the size of the first time step is the
|
||||
@ -518,11 +441,26 @@ struct NewtonTolerance<TypeTag, Properties::TTag::FlowBaseProblem>
|
||||
static constexpr type value = 1e-2;
|
||||
};
|
||||
|
||||
// Parameterize equilibration accuracy
|
||||
template<class TypeTag>
|
||||
struct NumPressurePointsEquil<TypeTag, Properties::TTag::FlowBaseProblem>
|
||||
{ static constexpr int value = ParserKeywords::EQLDIMS::DEPTH_NODES_P::defaultValue; };
|
||||
|
||||
// The default location for the ECL output files
|
||||
template<class TypeTag>
|
||||
struct OutputDir<TypeTag, Properties::TTag::FlowBaseProblem>
|
||||
{ static constexpr auto value = "."; };
|
||||
|
||||
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
|
||||
|
@ -336,12 +336,12 @@ private:
|
||||
outputDir = eclipseState_->getIOConfig().getOutputDir();
|
||||
}
|
||||
else {
|
||||
deckFilename = Parameters::get<PreTypeTag, Properties::EclDeckFileName>();
|
||||
deckFilename = Parameters::get<PreTypeTag, Parameters::EclDeckFileName>();
|
||||
outputDir = Parameters::get<PreTypeTag, Parameters::OutputDir>();
|
||||
}
|
||||
|
||||
#if HAVE_DAMARIS
|
||||
enableDamarisOutput_ = Parameters::get<PreTypeTag, Properties::EnableDamarisOutput>();
|
||||
enableDamarisOutput_ = Parameters::get<PreTypeTag, Parameters::EnableDamarisOutput>();
|
||||
|
||||
// Reset to false as we cannot use Damaris if there is only one rank.
|
||||
if ((enableDamarisOutput_ == true) && (FlowGenericVanguard::comm().size() == 1)) {
|
||||
@ -377,7 +377,7 @@ private:
|
||||
int mpiRank = FlowGenericVanguard::comm().rank();
|
||||
outputCout_ = false;
|
||||
if (mpiRank == 0)
|
||||
outputCout_ = Parameters::get<PreTypeTag, Properties::EnableTerminalOutput>();
|
||||
outputCout_ = Parameters::get<PreTypeTag, Parameters::EnableTerminalOutput>();
|
||||
|
||||
if (deckFilename.empty()) {
|
||||
if (mpiRank == 0) {
|
||||
@ -416,13 +416,13 @@ private:
|
||||
try {
|
||||
this->readDeck(deckFilename,
|
||||
outputDir,
|
||||
Parameters::get<PreTypeTag, Properties::OutputMode>(),
|
||||
!Parameters::get<PreTypeTag, Properties::SchedRestart>(),
|
||||
Parameters::get<PreTypeTag, Properties::EnableLoggingFalloutWarning>(),
|
||||
Parameters::get<PreTypeTag, Properties::ParsingStrictness>(),
|
||||
Parameters::get<PreTypeTag, Properties::InputSkipMode>(),
|
||||
Parameters::get<PreTypeTag, Parameters::OutputMode>(),
|
||||
!Parameters::get<PreTypeTag, Parameters::SchedRestart>(),
|
||||
Parameters::get<PreTypeTag, Parameters::EnableLoggingFalloutWarning>(),
|
||||
Parameters::get<PreTypeTag, Parameters::ParsingStrictness>(),
|
||||
Parameters::get<PreTypeTag, Parameters::InputSkipMode>(),
|
||||
getNumThreads<PreTypeTag>(),
|
||||
Parameters::get<PreTypeTag, Properties::EclOutputInterval>(),
|
||||
Parameters::get<PreTypeTag, Parameters::EclOutputInterval>(),
|
||||
cmdline_params,
|
||||
Opm::moduleVersion(),
|
||||
Opm::compileTimestamp());
|
||||
|
@ -39,44 +39,42 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace Opm::Properties {
|
||||
namespace Opm::Properties::TTag {
|
||||
|
||||
namespace TTag {
|
||||
struct FlowNonLinearSolver {};
|
||||
|
||||
}
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct NewtonMaxRelax {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct NewtonMaxRelax { using type = Properties::UndefinedProperty; };
|
||||
|
||||
// we are reusing NewtonMaxIterations from opm-models
|
||||
// See opm/models/nonlinear/newtonmethodproperties.hh
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct NewtonMinIterations{
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct NewtonMinIterations { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct NewtonRelaxationType{
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct NewtonRelaxationType { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct NewtonMaxRelax<TypeTag, TTag::FlowNonLinearSolver> {
|
||||
using type = GetPropType<TypeTag, Scalar>;
|
||||
struct NewtonMaxRelax<TypeTag, Properties::TTag::FlowNonLinearSolver>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 0.5;
|
||||
};
|
||||
template<class TypeTag>
|
||||
struct NewtonMinIterations<TypeTag, TTag::FlowNonLinearSolver> {
|
||||
static constexpr int value = 2;
|
||||
};
|
||||
template<class TypeTag>
|
||||
struct NewtonRelaxationType<TypeTag, TTag::FlowNonLinearSolver> {
|
||||
static constexpr auto value = "dampen";
|
||||
};
|
||||
|
||||
} // namespace Opm::Properties
|
||||
template<class TypeTag>
|
||||
struct NewtonMinIterations<TypeTag, Properties::TTag::FlowNonLinearSolver>
|
||||
{ static constexpr int value = 2; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct NewtonRelaxationType<TypeTag, Properties::TTag::FlowNonLinearSolver>
|
||||
{ static constexpr auto value = "dampen"; };
|
||||
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
@ -135,11 +133,11 @@ void stabilizeNonlinearUpdate(BVector& dx, BVector& dxOld,
|
||||
reset();
|
||||
|
||||
// overload with given parameters
|
||||
relaxMax_ = Parameters::get<TypeTag, Properties::NewtonMaxRelax>();
|
||||
relaxMax_ = Parameters::get<TypeTag, Parameters::NewtonMaxRelax>();
|
||||
maxIter_ = Parameters::get<TypeTag, Parameters::NewtonMaxIterations>();
|
||||
minIter_ = Parameters::get<TypeTag, Properties::NewtonMinIterations>();
|
||||
minIter_ = Parameters::get<TypeTag, Parameters::NewtonMinIterations>();
|
||||
|
||||
const auto& relaxationTypeString = Parameters::get<TypeTag, Properties::NewtonRelaxationType>();
|
||||
const auto& relaxationTypeString = Parameters::get<TypeTag, Parameters::NewtonRelaxationType>();
|
||||
if (relaxationTypeString == "dampen") {
|
||||
relaxType_ = NonlinearRelaxType::Dampen;
|
||||
} else if (relaxationTypeString == "sor") {
|
||||
@ -152,13 +150,13 @@ void stabilizeNonlinearUpdate(BVector& dx, BVector& dxOld,
|
||||
|
||||
static void registerParameters()
|
||||
{
|
||||
Parameters::registerParam<TypeTag, Properties::NewtonMaxRelax>
|
||||
Parameters::registerParam<TypeTag, Parameters::NewtonMaxRelax>
|
||||
("The maximum relaxation factor of a Newton iteration");
|
||||
Parameters::registerParam<TypeTag, Parameters::NewtonMaxIterations>
|
||||
("The maximum number of Newton iterations per time step");
|
||||
Parameters::registerParam<TypeTag, Properties::NewtonMinIterations>
|
||||
Parameters::registerParam<TypeTag, Parameters::NewtonMinIterations>
|
||||
("The minimum number of Newton iterations per time step");
|
||||
Parameters::registerParam<TypeTag, Properties::NewtonRelaxationType>
|
||||
Parameters::registerParam<TypeTag, Parameters::NewtonRelaxationType>
|
||||
("The type of relaxation used by Newton method");
|
||||
}
|
||||
|
||||
|
@ -65,38 +65,30 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace Opm::Properties
|
||||
{
|
||||
namespace Opm::Properties::TTag {
|
||||
|
||||
// create new type tag for the Ecl-output
|
||||
namespace TTag
|
||||
{
|
||||
struct OutputBlackOil {
|
||||
};
|
||||
} // namespace TTag
|
||||
struct OutputBlackOil {};
|
||||
|
||||
} // namespace Opm::Properties::TTag
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
template <class TypeTag, class MyTypeTag>
|
||||
struct ForceDisableFluidInPlaceOutput {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
|
||||
template <class TypeTag>
|
||||
struct ForceDisableFluidInPlaceOutput<TypeTag, TTag::OutputBlackOil> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
|
||||
struct ForceDisableFluidInPlaceOutput { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template <class TypeTag, class MyTypeTag>
|
||||
struct ForceDisableResvFluidInPlaceOutput {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct ForceDisableResvFluidInPlaceOutput { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template <class TypeTag>
|
||||
struct ForceDisableResvFluidInPlaceOutput<TypeTag, TTag::OutputBlackOil> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
struct ForceDisableFluidInPlaceOutput<TypeTag, Properties::TTag::OutputBlackOil>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
} // namespace Opm::Properties
|
||||
template <class TypeTag>
|
||||
struct ForceDisableResvFluidInPlaceOutput<TypeTag, Properties::TTag::OutputBlackOil>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
@ -173,12 +165,12 @@ public:
|
||||
this->setupBlockData(isCartIdxOnThisRank);
|
||||
|
||||
this->forceDisableFipOutput_ =
|
||||
Parameters::get<TypeTag, Properties::ForceDisableFluidInPlaceOutput>();
|
||||
Parameters::get<TypeTag, Parameters::ForceDisableFluidInPlaceOutput>();
|
||||
|
||||
this->forceDisableFipresvOutput_ =
|
||||
Parameters::get<TypeTag, Properties::ForceDisableResvFluidInPlaceOutput>();
|
||||
Parameters::get<TypeTag, Parameters::ForceDisableResvFluidInPlaceOutput>();
|
||||
|
||||
if (! Parameters::get<TypeTag, Properties::OwnerCellsFirst>()) {
|
||||
if (! Parameters::get<TypeTag, Parameters::OwnerCellsFirst>()) {
|
||||
const std::string msg = "The output code does not support --owner-cells-first=false.";
|
||||
if (collectToIORank.isIORank()) {
|
||||
OpmLog::error(msg);
|
||||
@ -207,10 +199,10 @@ public:
|
||||
*/
|
||||
static void registerParameters()
|
||||
{
|
||||
Parameters::registerParam<TypeTag, Properties::ForceDisableFluidInPlaceOutput>
|
||||
Parameters::registerParam<TypeTag, Parameters::ForceDisableFluidInPlaceOutput>
|
||||
("Do not print fluid-in-place values after each report step "
|
||||
"even if requested by the deck.");
|
||||
Parameters::registerParam<TypeTag, Properties::ForceDisableResvFluidInPlaceOutput>
|
||||
Parameters::registerParam<TypeTag, Parameters::ForceDisableResvFluidInPlaceOutput>
|
||||
("Do not print reservoir volumes values after each report step "
|
||||
"even if requested by the deck.");
|
||||
}
|
||||
|
@ -57,83 +57,55 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace Opm::Properties {
|
||||
namespace Opm::Parameters {
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct EnableAdaptiveTimeStepping {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct EnableAdaptiveTimeStepping { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template <class TypeTag, class MyTypeTag>
|
||||
struct OutputExtraConvergenceInfo
|
||||
{
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct OutputExtraConvergenceInfo { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template <class TypeTag, class MyTypeTag>
|
||||
struct SaveStep
|
||||
{
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct SaveStep { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template <class TypeTag, class MyTypeTag>
|
||||
struct LoadStep
|
||||
{
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct LoadStep { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template <class TypeTag, class MyTypeTag>
|
||||
struct SaveFile
|
||||
{
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct SaveFile { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template <class TypeTag, class MyTypeTag>
|
||||
struct LoadFile
|
||||
{
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct LoadFile { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct EnableTerminalOutput<TypeTag, TTag::FlowProblem> {
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
struct EnableAdaptiveTimeStepping<TypeTag, Properties::TTag::FlowProblem>
|
||||
{ static constexpr bool value = true; };
|
||||
|
||||
template <class TypeTag>
|
||||
struct OutputExtraConvergenceInfo<TypeTag, Properties::TTag::FlowProblem>
|
||||
{ static constexpr auto* value = "none"; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct EnableAdaptiveTimeStepping<TypeTag, TTag::FlowProblem> {
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
struct EnableTerminalOutput<TypeTag, Properties::TTag::FlowProblem>
|
||||
{ static constexpr bool value = true; };
|
||||
|
||||
template <class TypeTag>
|
||||
struct OutputExtraConvergenceInfo<TypeTag, TTag::FlowProblem>
|
||||
{
|
||||
static constexpr auto* value = "none";
|
||||
};
|
||||
struct SaveStep<TypeTag, Properties::TTag::FlowProblem>
|
||||
{ static constexpr auto* value = ""; };
|
||||
|
||||
template <class TypeTag>
|
||||
struct SaveStep<TypeTag, TTag::FlowProblem>
|
||||
{
|
||||
static constexpr auto* value = "";
|
||||
};
|
||||
struct SaveFile<TypeTag, Properties::TTag::FlowProblem>
|
||||
{ static constexpr auto* value = ""; };
|
||||
|
||||
template <class TypeTag>
|
||||
struct SaveFile<TypeTag, TTag::FlowProblem>
|
||||
{
|
||||
static constexpr auto* value = "";
|
||||
};
|
||||
struct LoadFile<TypeTag, Properties::TTag::FlowProblem>
|
||||
{ static constexpr auto* value = ""; };
|
||||
|
||||
template <class TypeTag>
|
||||
struct LoadFile<TypeTag, TTag::FlowProblem>
|
||||
{
|
||||
static constexpr auto* value = "";
|
||||
};
|
||||
struct LoadStep<TypeTag, Properties::TTag::FlowProblem>
|
||||
{ static constexpr int value = -1; };
|
||||
|
||||
template <class TypeTag>
|
||||
struct LoadStep<TypeTag, TTag::FlowProblem>
|
||||
{
|
||||
static constexpr int value = -1;
|
||||
};
|
||||
|
||||
} // namespace Opm::Properties
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
namespace Opm {
|
||||
|
||||
@ -189,19 +161,19 @@ public:
|
||||
, serializer_(*this,
|
||||
FlowGenericVanguard::comm(),
|
||||
simulator_.vanguard().eclState().getIOConfig(),
|
||||
Parameters::get<TypeTag, Properties::SaveStep>(),
|
||||
Parameters::get<TypeTag, Properties::LoadStep>(),
|
||||
Parameters::get<TypeTag, Properties::SaveFile>(),
|
||||
Parameters::get<TypeTag, Properties::LoadFile>())
|
||||
Parameters::get<TypeTag, Parameters::SaveStep>(),
|
||||
Parameters::get<TypeTag, Parameters::LoadStep>(),
|
||||
Parameters::get<TypeTag, Parameters::SaveFile>(),
|
||||
Parameters::get<TypeTag, Parameters::LoadFile>())
|
||||
{
|
||||
phaseUsage_ = phaseUsageFromDeck(eclState());
|
||||
|
||||
// Only rank 0 does print to std::cout, and only if specifically requested.
|
||||
this->terminalOutput_ = false;
|
||||
if (this->grid().comm().rank() == 0) {
|
||||
this->terminalOutput_ = Parameters::get<TypeTag, Properties::EnableTerminalOutput>();
|
||||
this->terminalOutput_ = Parameters::get<TypeTag, Parameters::EnableTerminalOutput>();
|
||||
|
||||
this->startConvergenceOutputThread(Parameters::get<TypeTag, Properties::OutputExtraConvergenceInfo>(),
|
||||
this->startConvergenceOutputThread(Parameters::get<TypeTag, Parameters::OutputExtraConvergenceInfo>(),
|
||||
R"(OutputExtraConvergenceInfo (--output-extra-convergence-info))");
|
||||
}
|
||||
}
|
||||
@ -218,11 +190,11 @@ public:
|
||||
SolverParameters::registerParameters();
|
||||
TimeStepper::registerParameters();
|
||||
|
||||
Parameters::registerParam<TypeTag, Properties::EnableTerminalOutput>
|
||||
Parameters::registerParam<TypeTag, Parameters::EnableTerminalOutput>
|
||||
("Print high-level information about the simulation's progress to the terminal");
|
||||
Parameters::registerParam<TypeTag, Properties::EnableAdaptiveTimeStepping>
|
||||
Parameters::registerParam<TypeTag, Parameters::EnableAdaptiveTimeStepping>
|
||||
("Use adaptive time stepping between report steps");
|
||||
Parameters::registerParam<TypeTag, Properties::OutputExtraConvergenceInfo>
|
||||
Parameters::registerParam<TypeTag, Parameters::OutputExtraConvergenceInfo>
|
||||
("Provide additional convergence output "
|
||||
"files for diagnostic purposes. "
|
||||
"\"none\" gives no extra output and "
|
||||
@ -231,25 +203,25 @@ public:
|
||||
"\"iterations\" generates an INFOITER file. "
|
||||
"Combine options with commas, e.g., "
|
||||
"\"steps,iterations\" for multiple outputs.");
|
||||
Parameters::registerParam<TypeTag, Properties::SaveStep>
|
||||
Parameters::registerParam<TypeTag, Parameters::SaveStep>
|
||||
("Save serialized state to .OPMRST file. "
|
||||
"Either a specific report step, \"all\" to save "
|
||||
"all report steps or \":x\" to save every x'th step."
|
||||
"Use negative values of \"x\" to keep only the last "
|
||||
"written step, or \"last\" to save every step, keeping "
|
||||
"only the last.");
|
||||
Parameters::registerParam<TypeTag, Properties::LoadStep>
|
||||
Parameters::registerParam<TypeTag, Parameters::LoadStep>
|
||||
("Load serialized state from .OPMRST file. "
|
||||
"Either a specific report step, or 0 to load last "
|
||||
"stored report step.");
|
||||
Parameters::registerParam<TypeTag, Properties::SaveFile>
|
||||
Parameters::registerParam<TypeTag, Parameters::SaveFile>
|
||||
("FileName for .OPMRST file used for saving serialized state. "
|
||||
"If empty, CASENAME.OPMRST is used.");
|
||||
Parameters::hideParam<TypeTag, Properties::SaveFile>();
|
||||
Parameters::registerParam<TypeTag, Properties::LoadFile>
|
||||
Parameters::hideParam<TypeTag, Parameters::SaveFile>();
|
||||
Parameters::registerParam<TypeTag, Parameters::LoadFile>
|
||||
("FileName for .OPMRST file used to load serialized state. "
|
||||
"If empty, CASENAME.OPMRST is used.");
|
||||
Parameters::hideParam<TypeTag, Properties::LoadFile>();
|
||||
Parameters::hideParam<TypeTag, Parameters::LoadFile>();
|
||||
}
|
||||
|
||||
/// Run the simulation.
|
||||
@ -281,8 +253,8 @@ public:
|
||||
totalTimer_->start();
|
||||
|
||||
// adaptive time stepping
|
||||
bool enableAdaptive = Parameters::get<TypeTag, Properties::EnableAdaptiveTimeStepping>();
|
||||
bool enableTUNING = Parameters::get<TypeTag, Properties::EnableTuning>();
|
||||
bool enableAdaptive = Parameters::get<TypeTag, Parameters::EnableAdaptiveTimeStepping>();
|
||||
bool enableTUNING = Parameters::get<TypeTag, Parameters::EnableTuning>();
|
||||
if (enableAdaptive) {
|
||||
const UnitSystem& unitSystem = this->simulator_.vanguard().eclState().getUnits();
|
||||
const auto& sched_state = schedule()[timer.currentStepNum()];
|
||||
@ -372,7 +344,7 @@ public:
|
||||
|
||||
this->solver_->model().beginReportStep();
|
||||
|
||||
const bool enableTUNING = Parameters::get<TypeTag, Properties::EnableTuning>();
|
||||
const bool enableTUNING = Parameters::get<TypeTag, Parameters::EnableTuning>();
|
||||
|
||||
// If sub stepping is enabled allow the solver to sub cycle
|
||||
// in case the report steps are too large for the solver to converge
|
||||
|
@ -39,26 +39,25 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace Opm::Properties {
|
||||
namespace Opm::Properties::TTag {
|
||||
|
||||
// create new type tag for the VTK tracer output
|
||||
namespace TTag {
|
||||
struct VtkTracer {};
|
||||
|
||||
}
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
// create the property tags needed for the tracer model
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct VtkWriteTracerConcentration {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct VtkWriteTracerConcentration { using type = Properties::UndefinedProperty; };
|
||||
|
||||
// set default values for what quantities to output
|
||||
template<class TypeTag>
|
||||
struct VtkWriteTracerConcentration<TypeTag, TTag::VtkTracer> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
struct VtkWriteTracerConcentration<TypeTag, Properties::TTag::VtkTracer>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
} // namespace Opm::Properties
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
namespace Opm {
|
||||
/*!
|
||||
@ -96,7 +95,7 @@ namespace Opm {
|
||||
*/
|
||||
static void registerParameters()
|
||||
{
|
||||
Parameters::registerParam<TypeTag, Properties::VtkWriteTracerConcentration>
|
||||
Parameters::registerParam<TypeTag, Parameters::VtkWriteTracerConcentration>
|
||||
("Include the tracer concentration in the VTK output files");
|
||||
}
|
||||
|
||||
@ -178,7 +177,7 @@ namespace Opm {
|
||||
private:
|
||||
static bool eclTracerConcentrationOutput_()
|
||||
{
|
||||
static bool val = Parameters::get<TypeTag, Properties::VtkWriteTracerConcentration>();
|
||||
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteTracerConcentration>();
|
||||
return val;
|
||||
}
|
||||
|
||||
|
@ -48,155 +48,6 @@ struct FlowIstlSolverParams {};
|
||||
|
||||
}
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct LinearSolverReduction { using type = UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct RelaxedLinearSolverReduction { using type = UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct LinearSolverMaxIter { using type = UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct LinearSolverRestart { using type = UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct IluRelaxation { using type = UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct IluFillinLevel { using type = UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct MiluVariant { using type = UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct IluRedblack { using type = UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct IluReorderSpheres { using type = UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct UseGmres { using type = UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct LinearSolverIgnoreConvergenceFailure { using type = UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct ScaleLinearSystem { using type = UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct LinearSolver { using type = UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct LinearSolverPrintJsonDefinition { using type = UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct CprReuseSetup { using type = UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct CprReuseInterval { using type = UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct AcceleratorMode { using type = UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct BdaDeviceId { using type = UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct OpenclPlatformId { using type = UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct OpenclIluParallel { using type = UndefinedProperty; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct LinearSolverReduction<TypeTag, TTag::FlowIstlSolverParams>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Scalar>;
|
||||
static constexpr type value = 1e-2;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct RelaxedLinearSolverReduction<TypeTag, TTag::FlowIstlSolverParams>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Scalar>;
|
||||
static constexpr type value = 1e-2;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct LinearSolverMaxIter<TypeTag, TTag::FlowIstlSolverParams>
|
||||
{ static constexpr int value = 200; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct LinearSolverRestart<TypeTag, TTag::FlowIstlSolverParams>
|
||||
{ static constexpr int value = 40; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct IluRelaxation<TypeTag, TTag::FlowIstlSolverParams>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Scalar>;
|
||||
static constexpr type value = 0.9;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct IluFillinLevel<TypeTag, TTag::FlowIstlSolverParams>
|
||||
{ static constexpr int value = 0; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct MiluVariant<TypeTag, TTag::FlowIstlSolverParams>
|
||||
{ static constexpr auto value = "ILU"; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct IluRedblack<TypeTag, TTag::FlowIstlSolverParams>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct IluReorderSpheres<TypeTag, TTag::FlowIstlSolverParams>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct UseGmres<TypeTag, TTag::FlowIstlSolverParams>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct LinearSolverIgnoreConvergenceFailure<TypeTag, TTag::FlowIstlSolverParams>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct ScaleLinearSystem<TypeTag, TTag::FlowIstlSolverParams>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct LinearSolver<TypeTag, TTag::FlowIstlSolverParams>
|
||||
{ static constexpr auto value = "ilu0"; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct LinearSolverPrintJsonDefinition<TypeTag, TTag::FlowIstlSolverParams>
|
||||
{ static constexpr auto value = true; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct CprReuseSetup<TypeTag, TTag::FlowIstlSolverParams>
|
||||
{ static constexpr int value = 4; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct CprReuseInterval<TypeTag, TTag::FlowIstlSolverParams>
|
||||
{ static constexpr int value = 30; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct AcceleratorMode<TypeTag, TTag::FlowIstlSolverParams>
|
||||
{ static constexpr auto value = "none"; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct BdaDeviceId<TypeTag, TTag::FlowIstlSolverParams>
|
||||
{ static constexpr int value = 0; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct OpenclPlatformId<TypeTag, TTag::FlowIstlSolverParams>
|
||||
{ static constexpr int value = 0; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct OpenclIluParallel<TypeTag, TTag::FlowIstlSolverParams>
|
||||
{ static constexpr bool value = true; }; // note: false should only be used in debug
|
||||
|
||||
// Set the backend to be used.
|
||||
template<class TypeTag>
|
||||
struct LinearSolverBackend<TypeTag, TTag::FlowIstlSolverParams>
|
||||
@ -208,15 +59,164 @@ struct LinearSolverBackend<TypeTag, TTag::FlowIstlSolverParams>
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace Opm::Properties
|
||||
}
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct LinearSolverReduction { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct RelaxedLinearSolverReduction { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct LinearSolverMaxIter { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct LinearSolverRestart { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct IluRelaxation { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct IluFillinLevel { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct MiluVariant { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct IluRedblack { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct IluReorderSpheres { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct UseGmres { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct LinearSolverIgnoreConvergenceFailure { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct ScaleLinearSystem { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct LinearSolver { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct LinearSolverPrintJsonDefinition { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct CprReuseSetup { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct CprReuseInterval { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct AcceleratorMode { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct BdaDeviceId { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct OpenclPlatformId { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct OpenclIluParallel { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct LinearSolverReduction<TypeTag, Properties::TTag::FlowIstlSolverParams>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 1e-2;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct RelaxedLinearSolverReduction<TypeTag, Properties::TTag::FlowIstlSolverParams>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 1e-2;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct LinearSolverMaxIter<TypeTag, Properties::TTag::FlowIstlSolverParams>
|
||||
{ static constexpr int value = 200; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct LinearSolverRestart<TypeTag, Properties::TTag::FlowIstlSolverParams>
|
||||
{ static constexpr int value = 40; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct IluRelaxation<TypeTag, Properties::TTag::FlowIstlSolverParams>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 0.9;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct IluFillinLevel<TypeTag, Properties::TTag::FlowIstlSolverParams>
|
||||
{ static constexpr int value = 0; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct MiluVariant<TypeTag, Properties::TTag::FlowIstlSolverParams>
|
||||
{ static constexpr auto value = "ILU"; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct IluRedblack<TypeTag, Properties::TTag::FlowIstlSolverParams>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct IluReorderSpheres<TypeTag, Properties::TTag::FlowIstlSolverParams>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct UseGmres<TypeTag, Properties::TTag::FlowIstlSolverParams>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct LinearSolverIgnoreConvergenceFailure<TypeTag, Properties::TTag::FlowIstlSolverParams>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct ScaleLinearSystem<TypeTag, Properties::TTag::FlowIstlSolverParams>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct LinearSolver<TypeTag, Properties::TTag::FlowIstlSolverParams>
|
||||
{ static constexpr auto value = "ilu0"; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct LinearSolverPrintJsonDefinition<TypeTag, Properties::TTag::FlowIstlSolverParams>
|
||||
{ static constexpr auto value = true; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct CprReuseSetup<TypeTag, Properties::TTag::FlowIstlSolverParams>
|
||||
{ static constexpr int value = 4; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct CprReuseInterval<TypeTag, Properties::TTag::FlowIstlSolverParams>
|
||||
{ static constexpr int value = 30; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct AcceleratorMode<TypeTag, Properties::TTag::FlowIstlSolverParams>
|
||||
{ static constexpr auto value = "none"; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct BdaDeviceId<TypeTag, Properties::TTag::FlowIstlSolverParams>
|
||||
{ static constexpr int value = 0; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct OpenclPlatformId<TypeTag, Properties::TTag::FlowIstlSolverParams>
|
||||
{ static constexpr int value = 0; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct OpenclIluParallel<TypeTag, Properties::TTag::FlowIstlSolverParams>
|
||||
{ static constexpr bool value = true; }; // note: false should only be used in debug
|
||||
|
||||
template<class TypeTag>
|
||||
struct LinearSolverVerbosity<TypeTag, Properties::TTag::FlowIstlSolverParams>
|
||||
{ static constexpr int value = 0; };
|
||||
|
||||
} // namespace Opm::Properties
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
namespace Opm {
|
||||
|
||||
@ -249,105 +249,105 @@ struct FlowLinearSolverParameters
|
||||
void init(bool cprRequestedInDataFile)
|
||||
{
|
||||
// TODO: these parameters have undocumented non-trivial dependencies
|
||||
linear_solver_reduction_ = Parameters::get<TypeTag, Properties::LinearSolverReduction>();
|
||||
relaxed_linear_solver_reduction_ = Parameters::get<TypeTag, Properties::RelaxedLinearSolverReduction>();
|
||||
linear_solver_maxiter_ = Parameters::get<TypeTag, Properties::LinearSolverMaxIter>();
|
||||
linear_solver_restart_ = Parameters::get<TypeTag, Properties::LinearSolverRestart>();
|
||||
linear_solver_reduction_ = Parameters::get<TypeTag, Parameters::LinearSolverReduction>();
|
||||
relaxed_linear_solver_reduction_ = Parameters::get<TypeTag, Parameters::RelaxedLinearSolverReduction>();
|
||||
linear_solver_maxiter_ = Parameters::get<TypeTag, Parameters::LinearSolverMaxIter>();
|
||||
linear_solver_restart_ = Parameters::get<TypeTag, Parameters::LinearSolverRestart>();
|
||||
linear_solver_verbosity_ = Parameters::get<TypeTag, Parameters::LinearSolverVerbosity>();
|
||||
ilu_relaxation_ = Parameters::get<TypeTag, Properties::IluRelaxation>();
|
||||
ilu_fillin_level_ = Parameters::get<TypeTag, Properties::IluFillinLevel>();
|
||||
ilu_milu_ = convertString2Milu(Parameters::get<TypeTag, Properties::MiluVariant>());
|
||||
ilu_redblack_ = Parameters::get<TypeTag, Properties::IluRedblack>();
|
||||
ilu_reorder_sphere_ = Parameters::get<TypeTag, Properties::IluReorderSpheres>();
|
||||
newton_use_gmres_ = Parameters::get<TypeTag, Properties::UseGmres>();
|
||||
ignoreConvergenceFailure_ = Parameters::get<TypeTag, Properties::LinearSolverIgnoreConvergenceFailure>();
|
||||
scale_linear_system_ = Parameters::get<TypeTag, Properties::ScaleLinearSystem>();
|
||||
linsolver_ = Parameters::get<TypeTag, Properties::LinearSolver>();
|
||||
linear_solver_print_json_definition_ = Parameters::get<TypeTag, Properties::LinearSolverPrintJsonDefinition>();
|
||||
cpr_reuse_setup_ = Parameters::get<TypeTag, Properties::CprReuseSetup>();
|
||||
cpr_reuse_interval_ = Parameters::get<TypeTag, Properties::CprReuseInterval>();
|
||||
ilu_relaxation_ = Parameters::get<TypeTag, Parameters::IluRelaxation>();
|
||||
ilu_fillin_level_ = Parameters::get<TypeTag, Parameters::IluFillinLevel>();
|
||||
ilu_milu_ = convertString2Milu(Parameters::get<TypeTag, Parameters::MiluVariant>());
|
||||
ilu_redblack_ = Parameters::get<TypeTag, Parameters::IluRedblack>();
|
||||
ilu_reorder_sphere_ = Parameters::get<TypeTag, Parameters::IluReorderSpheres>();
|
||||
newton_use_gmres_ = Parameters::get<TypeTag, Parameters::UseGmres>();
|
||||
ignoreConvergenceFailure_ = Parameters::get<TypeTag, Parameters::LinearSolverIgnoreConvergenceFailure>();
|
||||
scale_linear_system_ = Parameters::get<TypeTag, Parameters::ScaleLinearSystem>();
|
||||
linsolver_ = Parameters::get<TypeTag, Parameters::LinearSolver>();
|
||||
linear_solver_print_json_definition_ = Parameters::get<TypeTag, Parameters::LinearSolverPrintJsonDefinition>();
|
||||
cpr_reuse_setup_ = Parameters::get<TypeTag, Parameters::CprReuseSetup>();
|
||||
cpr_reuse_interval_ = Parameters::get<TypeTag, Parameters::CprReuseInterval>();
|
||||
|
||||
if (!Parameters::isSet<TypeTag, Properties::LinearSolver>() && cprRequestedInDataFile) {
|
||||
if (!Parameters::isSet<TypeTag, Parameters::LinearSolver>() && cprRequestedInDataFile) {
|
||||
linsolver_ = "cpr";
|
||||
} else {
|
||||
linsolver_ = Parameters::get<TypeTag, Properties::LinearSolver>();
|
||||
linsolver_ = Parameters::get<TypeTag, Parameters::LinearSolver>();
|
||||
}
|
||||
|
||||
accelerator_mode_ = Parameters::get<TypeTag, Properties::AcceleratorMode>();
|
||||
bda_device_id_ = Parameters::get<TypeTag, Properties::BdaDeviceId>();
|
||||
opencl_platform_id_ = Parameters::get<TypeTag, Properties::OpenclPlatformId>();
|
||||
opencl_ilu_parallel_ = Parameters::get<TypeTag, Properties::OpenclIluParallel>();
|
||||
accelerator_mode_ = Parameters::get<TypeTag, Parameters::AcceleratorMode>();
|
||||
bda_device_id_ = Parameters::get<TypeTag, Parameters::BdaDeviceId>();
|
||||
opencl_platform_id_ = Parameters::get<TypeTag, Parameters::OpenclPlatformId>();
|
||||
opencl_ilu_parallel_ = Parameters::get<TypeTag, Parameters::OpenclIluParallel>();
|
||||
}
|
||||
|
||||
template <class TypeTag>
|
||||
static void registerParameters()
|
||||
{
|
||||
Parameters::registerParam<TypeTag, Properties::LinearSolverReduction>
|
||||
Parameters::registerParam<TypeTag, Parameters::LinearSolverReduction>
|
||||
("The minimum reduction of the residual which the linear solver must achieve");
|
||||
Parameters::registerParam<TypeTag, Properties::RelaxedLinearSolverReduction>
|
||||
Parameters::registerParam<TypeTag, Parameters::RelaxedLinearSolverReduction>
|
||||
("The minimum reduction of the residual which the linear solver need to "
|
||||
"achieve for the solution to be accepted");
|
||||
Parameters::registerParam<TypeTag, Properties::LinearSolverMaxIter>
|
||||
Parameters::registerParam<TypeTag, Parameters::LinearSolverMaxIter>
|
||||
("The maximum number of iterations of the linear solver");
|
||||
Parameters::registerParam<TypeTag, Properties::LinearSolverRestart>
|
||||
Parameters::registerParam<TypeTag, Parameters::LinearSolverRestart>
|
||||
("The number of iterations after which GMRES is restarted");
|
||||
Parameters::registerParam<TypeTag, Parameters::LinearSolverVerbosity>
|
||||
("The verbosity level of the linear solver (0: off, 2: all)");
|
||||
Parameters::registerParam<TypeTag, Properties::IluRelaxation>
|
||||
Parameters::registerParam<TypeTag, Parameters::IluRelaxation>
|
||||
("The relaxation factor of the linear solver's ILU preconditioner");
|
||||
Parameters::registerParam<TypeTag, Properties::IluFillinLevel>
|
||||
Parameters::registerParam<TypeTag, Parameters::IluFillinLevel>
|
||||
("The fill-in level of the linear solver's ILU preconditioner");
|
||||
Parameters::registerParam<TypeTag, Properties::MiluVariant>
|
||||
Parameters::registerParam<TypeTag, Parameters::MiluVariant>
|
||||
("Specify which variant of the modified-ILU preconditioner ought to be used. "
|
||||
"Possible variants are: ILU (default, plain ILU), "
|
||||
"MILU_1 (lump diagonal with dropped row entries), "
|
||||
"MILU_2 (lump diagonal with the sum of the absolute values of the dropped row entries), "
|
||||
"MILU_3 (if diagonal is positive add sum of dropped row entries, otherwise subtract them), "
|
||||
"MILU_4 (if diagonal is positive add sum of dropped row entries, otherwise do nothing");
|
||||
Parameters::registerParam<TypeTag, Properties::IluRedblack>
|
||||
Parameters::registerParam<TypeTag, Parameters::IluRedblack>
|
||||
("Use red-black partitioning for the ILU preconditioner");
|
||||
Parameters::registerParam<TypeTag, Properties::IluReorderSpheres>
|
||||
Parameters::registerParam<TypeTag, Parameters::IluReorderSpheres>
|
||||
("Whether to reorder the entries of the matrix in the red-black "
|
||||
"ILU preconditioner in spheres starting at an edge. "
|
||||
"If false the original ordering is preserved in each color. "
|
||||
"Otherwise why try to ensure D4 ordering (in a 2D structured grid, "
|
||||
"the diagonal elements are consecutive).");
|
||||
Parameters::registerParam<TypeTag, Properties::UseGmres>
|
||||
Parameters::registerParam<TypeTag, Parameters::UseGmres>
|
||||
("Use GMRES as the linear solver");
|
||||
Parameters::registerParam<TypeTag, Properties::LinearSolverIgnoreConvergenceFailure>
|
||||
Parameters::registerParam<TypeTag, Parameters::LinearSolverIgnoreConvergenceFailure>
|
||||
("Continue with the simulation like nothing happened "
|
||||
"after the linear solver did not converge");
|
||||
Parameters::registerParam<TypeTag, Properties::ScaleLinearSystem>
|
||||
Parameters::registerParam<TypeTag, Parameters::ScaleLinearSystem>
|
||||
("Scale linear system according to equation scale and primary variable types");
|
||||
Parameters::registerParam<TypeTag, Properties::LinearSolver>
|
||||
Parameters::registerParam<TypeTag, Parameters::LinearSolver>
|
||||
("Configuration of solver. Valid options are: ilu0 (default), "
|
||||
"dilu, cprw, cpr (an alias for cprw), cpr_quasiimpes, "
|
||||
"cpr_trueimpes, cpr_trueimpesanalytic, amg or hybrid (experimental). "
|
||||
"Alternatively, you can request a configuration to be read from a "
|
||||
"JSON file by giving the filename here, ending with '.json.'");
|
||||
Parameters::registerParam<TypeTag, Properties::LinearSolverPrintJsonDefinition>
|
||||
Parameters::registerParam<TypeTag, Parameters::LinearSolverPrintJsonDefinition>
|
||||
("Write the JSON definition of the linear solver setup to the DBG file.");
|
||||
Parameters::registerParam<TypeTag, Properties::CprReuseSetup>
|
||||
Parameters::registerParam<TypeTag, Parameters::CprReuseSetup>
|
||||
("Reuse preconditioner setup. Valid options are "
|
||||
"0: recreate the preconditioner for every linear solve, "
|
||||
"1: recreate once every timestep, "
|
||||
"2: recreate if last linear solve took more than 10 iterations, "
|
||||
"3: never recreate, "
|
||||
"4: recreated every CprReuseInterval");
|
||||
Parameters::registerParam<TypeTag, Properties::CprReuseInterval>
|
||||
Parameters::registerParam<TypeTag, Parameters::CprReuseInterval>
|
||||
("Reuse preconditioner interval. Used when CprReuseSetup is set to 4, "
|
||||
"then the preconditioner will be fully recreated instead of reused "
|
||||
"every N linear solve, where N is this parameter.");
|
||||
Parameters::registerParam<TypeTag, Properties::AcceleratorMode>
|
||||
Parameters::registerParam<TypeTag, Parameters::AcceleratorMode>
|
||||
("Choose a linear solver, usage: "
|
||||
"'--accelerator-mode=[none|cusparse|opencl|amgcl|rocalution|rocsparse]'");
|
||||
Parameters::registerParam<TypeTag, Properties::BdaDeviceId>
|
||||
Parameters::registerParam<TypeTag, Parameters::BdaDeviceId>
|
||||
("Choose device ID for cusparseSolver or openclSolver, "
|
||||
"use 'nvidia-smi' or 'clinfo' to determine valid IDs");
|
||||
Parameters::registerParam<TypeTag, Properties::OpenclPlatformId>
|
||||
Parameters::registerParam<TypeTag, Parameters::OpenclPlatformId>
|
||||
("Choose platform ID for openclSolver, use 'clinfo' "
|
||||
"to determine valid platform IDs");
|
||||
Parameters::registerParam<TypeTag, Properties::OpenclIluParallel>
|
||||
Parameters::registerParam<TypeTag, Parameters::OpenclIluParallel>
|
||||
("Parallelize ILU decomposition and application on GPU");
|
||||
}
|
||||
|
||||
|
@ -224,8 +224,8 @@ std::unique_ptr<Matrix> blockJacobiAdjacency(const Grid& grid,
|
||||
para.linsolver_ = "cprw";
|
||||
parameters_.push_back(para);
|
||||
prm_.push_back(setupPropertyTree(parameters_[0],
|
||||
Parameters::isSet<TypeTag,Properties::LinearSolverMaxIter>(),
|
||||
Parameters::isSet<TypeTag,Properties::LinearSolverReduction>()));
|
||||
Parameters::isSet<TypeTag, Parameters::LinearSolverMaxIter>(),
|
||||
Parameters::isSet<TypeTag, Parameters::LinearSolverReduction>()));
|
||||
}
|
||||
{
|
||||
FlowLinearSolverParameters para;
|
||||
@ -233,8 +233,8 @@ std::unique_ptr<Matrix> blockJacobiAdjacency(const Grid& grid,
|
||||
para.linsolver_ = "ilu0";
|
||||
parameters_.push_back(para);
|
||||
prm_.push_back(setupPropertyTree(parameters_[1],
|
||||
Parameters::isSet<TypeTag,Properties::LinearSolverMaxIter>(),
|
||||
Parameters::isSet<TypeTag,Properties::LinearSolverReduction>()));
|
||||
Parameters::isSet<TypeTag, Parameters::LinearSolverMaxIter>(),
|
||||
Parameters::isSet<TypeTag, Parameters::LinearSolverReduction>()));
|
||||
}
|
||||
// ------------
|
||||
} else {
|
||||
@ -242,8 +242,8 @@ std::unique_ptr<Matrix> blockJacobiAdjacency(const Grid& grid,
|
||||
assert(parameters_.size() == 1);
|
||||
assert(prm_.empty());
|
||||
prm_.push_back(setupPropertyTree(parameters_[0],
|
||||
Parameters::isSet<TypeTag,Properties::LinearSolverMaxIter>(),
|
||||
Parameters::isSet<TypeTag,Properties::LinearSolverReduction>()));
|
||||
Parameters::isSet<TypeTag, Parameters::LinearSolverMaxIter>(),
|
||||
Parameters::isSet<TypeTag, Parameters::LinearSolverReduction>()));
|
||||
}
|
||||
flexibleSolver_.resize(prm_.size());
|
||||
|
||||
@ -258,8 +258,8 @@ std::unique_ptr<Matrix> blockJacobiAdjacency(const Grid& grid,
|
||||
// Set it up manually
|
||||
ElementMapper elemMapper(simulator_.vanguard().gridView(), Dune::mcmgElementLayout());
|
||||
detail::findOverlapAndInterior(simulator_.vanguard().grid(), elemMapper, overlapRows_, interiorRows_);
|
||||
useWellConn_ = Parameters::get<TypeTag, Properties::MatrixAddWellContributions>();
|
||||
const bool ownersFirst = Parameters::get<TypeTag, Properties::OwnerCellsFirst>();
|
||||
useWellConn_ = Parameters::get<TypeTag, Parameters::MatrixAddWellContributions>();
|
||||
const bool ownersFirst = Parameters::get<TypeTag, Parameters::OwnerCellsFirst>();
|
||||
if (!ownersFirst) {
|
||||
const std::string msg = "The linear solver no longer supports --owner-cells-first=false.";
|
||||
if (on_io_rank) {
|
||||
@ -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
|
||||
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)
|
||||
} else {
|
||||
// Pointers should not change
|
||||
|
@ -152,7 +152,7 @@ public:
|
||||
{
|
||||
OPM_TIMEBLOCK(initializeBda);
|
||||
|
||||
std::string accelerator_mode = Parameters::get<TypeTag, Properties::AcceleratorMode>();
|
||||
std::string accelerator_mode = Parameters::get<TypeTag, Parameters::AcceleratorMode>();
|
||||
// Force accelerator mode to none if using MPI.
|
||||
if ((this->simulator_.vanguard().grid().comm().size() > 1) && (accelerator_mode != "none")) {
|
||||
const bool on_io_rank = (this->simulator_.gridView().comm().rank() == 0);
|
||||
@ -167,13 +167,13 @@ public:
|
||||
}
|
||||
|
||||
// Initialize the BdaBridge
|
||||
const int platformID = Parameters::get<TypeTag, Properties::OpenclPlatformId>();
|
||||
const int deviceID = Parameters::get<TypeTag, Properties::BdaDeviceId>();
|
||||
const int maxit = Parameters::get<TypeTag, Properties::LinearSolverMaxIter>();
|
||||
const double tolerance = Parameters::get<TypeTag, Properties::LinearSolverReduction>();
|
||||
const bool opencl_ilu_parallel = Parameters::get<TypeTag, Properties::OpenclIluParallel>();
|
||||
const int platformID = Parameters::get<TypeTag, Parameters::OpenclPlatformId>();
|
||||
const int deviceID = Parameters::get<TypeTag, Parameters::BdaDeviceId>();
|
||||
const int maxit = Parameters::get<TypeTag, Parameters::LinearSolverMaxIter>();
|
||||
const double tolerance = Parameters::get<TypeTag, Parameters::LinearSolverReduction>();
|
||||
const bool opencl_ilu_parallel = Parameters::get<TypeTag, Parameters::OpenclIluParallel>();
|
||||
const int linear_solver_verbosity = this->parameters_[0].linear_solver_verbosity_;
|
||||
std::string linsolver = Parameters::get<TypeTag, Properties::LinearSolver>();
|
||||
std::string linsolver = Parameters::get<TypeTag, Parameters::LinearSolver>();
|
||||
bdaBridge_ = std::make_unique<detail::BdaSolverInfo<Matrix,Vector>>(accelerator_mode,
|
||||
linear_solver_verbosity,
|
||||
maxit,
|
||||
@ -204,7 +204,7 @@ public:
|
||||
// to the original one with a deleter that does nothing.
|
||||
// Outch! We need to be able to scale the linear system! Hence const_cast
|
||||
// setup sparsity pattern for jacobi matrix for preconditioner (only used for openclSolver)
|
||||
bdaBridge_->numJacobiBlocks_ = Parameters::get<TypeTag, Properties::NumJacobiBlocks>();
|
||||
bdaBridge_->numJacobiBlocks_ = Parameters::get<TypeTag, Parameters::NumJacobiBlocks>();
|
||||
bdaBridge_->prepare(this->simulator_.vanguard().grid(),
|
||||
this->simulator_.vanguard().cartesianIndexMapper(),
|
||||
this->simulator_.vanguard().schedule().getWellsatEnd(),
|
||||
|
@ -47,162 +47,160 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace Opm::Properties {
|
||||
namespace Opm::Properties::TTag {
|
||||
|
||||
namespace TTag {
|
||||
struct FlowTimeSteppingParameters {
|
||||
using InheritsFrom = std::tuple<EclTimeSteppingParameters>;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct SolverContinueOnConvergenceFailure {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct SolverContinueOnConvergenceFailure { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct SolverMaxRestarts {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct SolverMaxRestarts { using type = Properties::UndefinedProperty; };
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct SolverVerbosity {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
|
||||
struct SolverVerbosity { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct TimeStepVerbosity {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct TimeStepVerbosity { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct InitialTimeStepInDays {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct InitialTimeStepInDays { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct FullTimeStepInitially {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct FullTimeStepInitially { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct TimeStepControl {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct TimeStepControl { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct TimeStepControlTolerance {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct TimeStepControlTolerance { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct TimeStepControlTargetIterations {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct TimeStepControlTargetIterations { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct TimeStepControlTargetNewtonIterations {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct TimeStepControlTargetNewtonIterations { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct TimeStepControlDecayRate {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct TimeStepControlDecayRate { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct TimeStepControlGrowthRate {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct TimeStepControlGrowthRate { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct TimeStepControlDecayDampingFactor {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct TimeStepControlDecayDampingFactor { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct TimeStepControlGrowthDampingFactor {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct TimeStepControlGrowthDampingFactor { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct TimeStepControlFileName {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct TimeStepControlFileName { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct MinTimeStepBeforeShuttingProblematicWellsInDays {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct MinTimeStepBeforeShuttingProblematicWellsInDays { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct MinTimeStepBasedOnNewtonIterations {
|
||||
using type = UndefinedProperty;
|
||||
struct MinTimeStepBasedOnNewtonIterations { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct SolverContinueOnConvergenceFailure<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct SolverMaxRestarts<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
|
||||
{ static constexpr int value = 10; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct SolverVerbosity<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
|
||||
{ static constexpr int value = 1; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct TimeStepVerbosity<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
|
||||
{ static constexpr int value = 1; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct InitialTimeStepInDays<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 1.0;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct SolverContinueOnConvergenceFailure<TypeTag, TTag::FlowTimeSteppingParameters> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
struct FullTimeStepInitially<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct SolverMaxRestarts<TypeTag, TTag::FlowTimeSteppingParameters> {
|
||||
static constexpr int value = 10;
|
||||
};
|
||||
struct TimeStepControl<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
|
||||
{ static constexpr auto value = "pid+newtoniteration"; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct SolverVerbosity<TypeTag, TTag::FlowTimeSteppingParameters> {
|
||||
static constexpr int value = 1;
|
||||
};
|
||||
template<class TypeTag>
|
||||
struct TimeStepVerbosity<TypeTag, TTag::FlowTimeSteppingParameters> {
|
||||
static constexpr int value = 1;
|
||||
};
|
||||
template<class TypeTag>
|
||||
struct InitialTimeStepInDays<TypeTag, TTag::FlowTimeSteppingParameters> {
|
||||
using type = GetPropType<TypeTag, Scalar>;
|
||||
static constexpr type value = 1.0;
|
||||
};
|
||||
template<class TypeTag>
|
||||
struct FullTimeStepInitially<TypeTag, TTag::FlowTimeSteppingParameters> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
template<class TypeTag>
|
||||
struct TimeStepControl<TypeTag, TTag::FlowTimeSteppingParameters> {
|
||||
static constexpr auto value = "pid+newtoniteration";
|
||||
};
|
||||
template<class TypeTag>
|
||||
struct TimeStepControlTolerance<TypeTag, TTag::FlowTimeSteppingParameters> {
|
||||
using type = GetPropType<TypeTag, Scalar>;
|
||||
struct TimeStepControlTolerance<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 1e-1;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct TimeStepControlTargetIterations<TypeTag, TTag::FlowTimeSteppingParameters> {
|
||||
static constexpr int value = 30;
|
||||
};
|
||||
struct TimeStepControlTargetIterations<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
|
||||
{ static constexpr int value = 30; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct TimeStepControlTargetNewtonIterations<TypeTag, TTag::FlowTimeSteppingParameters> {
|
||||
static constexpr int value = 8;
|
||||
};
|
||||
struct TimeStepControlTargetNewtonIterations<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
|
||||
{ static constexpr int value = 8; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct TimeStepControlDecayRate<TypeTag, TTag::FlowTimeSteppingParameters> {
|
||||
using type = GetPropType<TypeTag, Scalar>;
|
||||
struct TimeStepControlDecayRate<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 0.75;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct TimeStepControlGrowthRate<TypeTag, TTag::FlowTimeSteppingParameters> {
|
||||
using type = GetPropType<TypeTag, Scalar>;
|
||||
struct TimeStepControlGrowthRate<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 1.25;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct TimeStepControlDecayDampingFactor<TypeTag, TTag::FlowTimeSteppingParameters> {
|
||||
using type = GetPropType<TypeTag, Scalar>;
|
||||
struct TimeStepControlDecayDampingFactor<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 1.0;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct TimeStepControlGrowthDampingFactor<TypeTag, TTag::FlowTimeSteppingParameters> {
|
||||
using type = GetPropType<TypeTag, Scalar>;
|
||||
struct TimeStepControlGrowthDampingFactor<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 3.2;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct TimeStepControlFileName<TypeTag, TTag::FlowTimeSteppingParameters> {
|
||||
static constexpr auto value = "timesteps";
|
||||
};
|
||||
struct TimeStepControlFileName<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
|
||||
{ static constexpr auto value = "timesteps"; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct MinTimeStepBeforeShuttingProblematicWellsInDays<TypeTag, TTag::FlowTimeSteppingParameters> {
|
||||
using type = GetPropType<TypeTag, Scalar>;
|
||||
struct MinTimeStepBeforeShuttingProblematicWellsInDays<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 0.01;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct MinTimeStepBasedOnNewtonIterations<TypeTag, TTag::FlowTimeSteppingParameters> {
|
||||
using type = GetPropType<TypeTag, Scalar>;
|
||||
struct MinTimeStepBasedOnNewtonIterations<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 0.0;
|
||||
};
|
||||
|
||||
} // namespace Opm::Properties
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
namespace Opm {
|
||||
|
||||
@ -254,20 +252,20 @@ std::set<std::string> consistentlyFailingWells(const std::vector<StepReport>& sr
|
||||
const double max_next_tstep = -1.0,
|
||||
const bool terminalOutput = true)
|
||||
: timeStepControl_()
|
||||
, restartFactor_(Parameters::get<TypeTag, Properties::SolverRestartFactor>()) // 0.33
|
||||
, growthFactor_(Parameters::get<TypeTag, Properties::SolverGrowthFactor>()) // 2.0
|
||||
, maxGrowth_(Parameters::get<TypeTag, Properties::SolverMaxGrowth>()) // 3.0
|
||||
, maxTimeStep_(Parameters::get<TypeTag, Properties::SolverMaxTimeStepInDays>() * 24 * 60 * 60) // 365.25
|
||||
, minTimeStep_(unitSystem.to_si(UnitSystem::measure::time, Parameters::get<TypeTag, Properties::SolverMinTimeStep>())) // 1e-12;
|
||||
, ignoreConvergenceFailure_(Parameters::get<TypeTag, Properties::SolverContinueOnConvergenceFailure>()) // false;
|
||||
, solverRestartMax_(Parameters::get<TypeTag, Properties::SolverMaxRestarts>()) // 10
|
||||
, solverVerbose_(Parameters::get<TypeTag, Properties::SolverVerbosity>() > 0 && terminalOutput) // 2
|
||||
, timestepVerbose_(Parameters::get<TypeTag, Properties::TimeStepVerbosity>() > 0 && terminalOutput) // 2
|
||||
, suggestedNextTimestep_((max_next_tstep <= 0 ? Parameters::get<TypeTag, Properties::InitialTimeStepInDays>() : max_next_tstep) * 24 * 60 * 60) // 1.0
|
||||
, fullTimestepInitially_(Parameters::get<TypeTag, Properties::FullTimeStepInitially>()) // false
|
||||
, timestepAfterEvent_(Parameters::get<TypeTag, Properties::TimeStepAfterEventInDays>() * 24 * 60 * 60) // 1e30
|
||||
, restartFactor_(Parameters::get<TypeTag, Parameters::SolverRestartFactor>()) // 0.33
|
||||
, growthFactor_(Parameters::get<TypeTag, Parameters::SolverGrowthFactor>()) // 2.0
|
||||
, maxGrowth_(Parameters::get<TypeTag, Parameters::SolverMaxGrowth>()) // 3.0
|
||||
, maxTimeStep_(Parameters::get<TypeTag, Parameters::SolverMaxTimeStepInDays>() * 24 * 60 * 60) // 365.25
|
||||
, minTimeStep_(unitSystem.to_si(UnitSystem::measure::time, Parameters::get<TypeTag, Parameters::SolverMinTimeStep>())) // 1e-12;
|
||||
, ignoreConvergenceFailure_(Parameters::get<TypeTag, Parameters::SolverContinueOnConvergenceFailure>()) // false;
|
||||
, solverRestartMax_(Parameters::get<TypeTag, Parameters::SolverMaxRestarts>()) // 10
|
||||
, solverVerbose_(Parameters::get<TypeTag, Parameters::SolverVerbosity>() > 0 && terminalOutput) // 2
|
||||
, timestepVerbose_(Parameters::get<TypeTag, Parameters::TimeStepVerbosity>() > 0 && terminalOutput) // 2
|
||||
, suggestedNextTimestep_((max_next_tstep <= 0 ? Parameters::get<TypeTag, Parameters::InitialTimeStepInDays>() : max_next_tstep) * 24 * 60 * 60) // 1.0
|
||||
, fullTimestepInitially_(Parameters::get<TypeTag, Parameters::FullTimeStepInitially>()) // false
|
||||
, timestepAfterEvent_(Parameters::get<TypeTag, Parameters::TimeStepAfterEventInDays>() * 24 * 60 * 60) // 1e30
|
||||
, useNewtonIteration_(false)
|
||||
, minTimeStepBeforeShuttingProblematicWells_(Parameters::get<TypeTag, Properties::MinTimeStepBeforeShuttingProblematicWellsInDays>() * unit::day)
|
||||
, minTimeStepBeforeShuttingProblematicWells_(Parameters::get<TypeTag, Parameters::MinTimeStepBeforeShuttingProblematicWellsInDays>() * unit::day)
|
||||
|
||||
{
|
||||
init_(unitSystem);
|
||||
@ -289,14 +287,14 @@ std::set<std::string> consistentlyFailingWells(const std::vector<StepReport>& sr
|
||||
, maxTimeStep_(tuning.TSMAXZ) // 365.25
|
||||
, minTimeStep_(tuning.TSFMIN) // 0.1;
|
||||
, ignoreConvergenceFailure_(true)
|
||||
, solverRestartMax_(Parameters::get<TypeTag, Properties::SolverMaxRestarts>()) // 10
|
||||
, solverVerbose_(Parameters::get<TypeTag, Properties::SolverVerbosity>() > 0 && terminalOutput) // 2
|
||||
, timestepVerbose_(Parameters::get<TypeTag, Properties::TimeStepVerbosity>() > 0 && terminalOutput) // 2
|
||||
, suggestedNextTimestep_(max_next_tstep <= 0 ? Parameters::get<TypeTag, Properties::InitialTimeStepInDays>() * 24 * 60 * 60 : max_next_tstep) // 1.0
|
||||
, fullTimestepInitially_(Parameters::get<TypeTag, Properties::FullTimeStepInitially>()) // false
|
||||
, solverRestartMax_(Parameters::get<TypeTag, Parameters::SolverMaxRestarts>()) // 10
|
||||
, solverVerbose_(Parameters::get<TypeTag, Parameters::SolverVerbosity>() > 0 && terminalOutput) // 2
|
||||
, timestepVerbose_(Parameters::get<TypeTag, Parameters::TimeStepVerbosity>() > 0 && terminalOutput) // 2
|
||||
, suggestedNextTimestep_(max_next_tstep <= 0 ? Parameters::get<TypeTag, Parameters::InitialTimeStepInDays>() * 24 * 60 * 60 : max_next_tstep) // 1.0
|
||||
, fullTimestepInitially_(Parameters::get<TypeTag, Parameters::FullTimeStepInitially>()) // false
|
||||
, timestepAfterEvent_(tuning.TMAXWC) // 1e30
|
||||
, useNewtonIteration_(false)
|
||||
, minTimeStepBeforeShuttingProblematicWells_(Parameters::get<TypeTag, Properties::MinTimeStepBeforeShuttingProblematicWellsInDays>() * unit::day)
|
||||
, minTimeStepBeforeShuttingProblematicWells_(Parameters::get<TypeTag, Parameters::MinTimeStepBeforeShuttingProblematicWellsInDays>() * unit::day)
|
||||
{
|
||||
init_(unitSystem);
|
||||
}
|
||||
@ -305,20 +303,20 @@ std::set<std::string> consistentlyFailingWells(const std::vector<StepReport>& sr
|
||||
{
|
||||
registerEclTimeSteppingParameters<TypeTag>();
|
||||
// TODO: make sure the help messages are correct (and useful)
|
||||
Parameters::registerParam<TypeTag, Properties::SolverContinueOnConvergenceFailure>
|
||||
Parameters::registerParam<TypeTag, Parameters::SolverContinueOnConvergenceFailure>
|
||||
("Continue instead of stop when minimum solver time step is reached");
|
||||
Parameters::registerParam<TypeTag, Properties::SolverMaxRestarts>
|
||||
Parameters::registerParam<TypeTag, Parameters::SolverMaxRestarts>
|
||||
("The maximum number of breakdowns before a substep is given up and "
|
||||
"the simulator is terminated");
|
||||
Parameters::registerParam<TypeTag, Properties::SolverVerbosity>
|
||||
Parameters::registerParam<TypeTag, Parameters::SolverVerbosity>
|
||||
("Specify the \"chattiness\" of the non-linear solver itself");
|
||||
Parameters::registerParam<TypeTag, Properties::TimeStepVerbosity>
|
||||
Parameters::registerParam<TypeTag, Parameters::TimeStepVerbosity>
|
||||
("Specify the \"chattiness\" during the time integration");
|
||||
Parameters::registerParam<TypeTag, Properties::InitialTimeStepInDays>
|
||||
Parameters::registerParam<TypeTag, Parameters::InitialTimeStepInDays>
|
||||
("The size of the initial time step in days");
|
||||
Parameters::registerParam<TypeTag, Properties::FullTimeStepInitially>
|
||||
Parameters::registerParam<TypeTag, Parameters::FullTimeStepInitially>
|
||||
("Always attempt to finish a report step using a single substep");
|
||||
Parameters::registerParam<TypeTag, Properties::TimeStepControl>
|
||||
Parameters::registerParam<TypeTag, Parameters::TimeStepControl>
|
||||
("The algorithm used to determine time-step sizes. "
|
||||
"Valid options are: "
|
||||
"'pid' (default), "
|
||||
@ -327,31 +325,31 @@ std::set<std::string> consistentlyFailingWells(const std::vector<StepReport>& sr
|
||||
"'iterationcount', "
|
||||
"'newtoniterationcount' "
|
||||
"and 'hardcoded'");
|
||||
Parameters::registerParam<TypeTag, Properties::TimeStepControlTolerance>
|
||||
Parameters::registerParam<TypeTag, Parameters::TimeStepControlTolerance>
|
||||
("The tolerance used by the time step size control algorithm");
|
||||
Parameters::registerParam<TypeTag, Properties::TimeStepControlTargetIterations>
|
||||
Parameters::registerParam<TypeTag, Parameters::TimeStepControlTargetIterations>
|
||||
("The number of linear iterations which the time step control scheme "
|
||||
"should aim for (if applicable)");
|
||||
Parameters::registerParam<TypeTag, Properties::TimeStepControlTargetNewtonIterations>
|
||||
Parameters::registerParam<TypeTag, Parameters::TimeStepControlTargetNewtonIterations>
|
||||
("The number of Newton iterations which the time step control scheme "
|
||||
"should aim for (if applicable)");
|
||||
Parameters::registerParam<TypeTag, Properties::TimeStepControlDecayRate>
|
||||
Parameters::registerParam<TypeTag, Parameters::TimeStepControlDecayRate>
|
||||
("The decay rate of the time step size of the number of "
|
||||
"target iterations is exceeded");
|
||||
Parameters::registerParam<TypeTag, Properties::TimeStepControlGrowthRate>
|
||||
Parameters::registerParam<TypeTag, Parameters::TimeStepControlGrowthRate>
|
||||
("The growth rate of the time step size of the number of "
|
||||
"target iterations is undercut");
|
||||
Parameters::registerParam<TypeTag, Properties::TimeStepControlDecayDampingFactor>
|
||||
Parameters::registerParam<TypeTag, Parameters::TimeStepControlDecayDampingFactor>
|
||||
("The decay rate of the time step decrease when the "
|
||||
"target iterations is exceeded");
|
||||
Parameters::registerParam<TypeTag, Properties::TimeStepControlGrowthDampingFactor>
|
||||
Parameters::registerParam<TypeTag, Parameters::TimeStepControlGrowthDampingFactor>
|
||||
("The growth rate of the time step increase when the "
|
||||
"target iterations is undercut");
|
||||
Parameters::registerParam<TypeTag, Properties::TimeStepControlFileName>
|
||||
Parameters::registerParam<TypeTag, Parameters::TimeStepControlFileName>
|
||||
("The name of the file which contains the hardcoded time steps sizes");
|
||||
Parameters::registerParam<TypeTag, Properties::MinTimeStepBeforeShuttingProblematicWellsInDays>
|
||||
Parameters::registerParam<TypeTag, Parameters::MinTimeStepBeforeShuttingProblematicWellsInDays>
|
||||
("The minimum time step size in days for which problematic wells are not shut");
|
||||
Parameters::registerParam<TypeTag, Properties::MinTimeStepBasedOnNewtonIterations>
|
||||
Parameters::registerParam<TypeTag, Parameters::MinTimeStepBasedOnNewtonIterations>
|
||||
("The minimum time step size (in days for field and metric unit and hours for lab unit) "
|
||||
"can be reduced to based on newton iteration counts");
|
||||
}
|
||||
@ -815,25 +813,25 @@ std::set<std::string> consistentlyFailingWells(const std::vector<StepReport>& sr
|
||||
void init_(const UnitSystem& unitSystem)
|
||||
{
|
||||
// valid are "pid" and "pid+iteration"
|
||||
std::string control = Parameters::get<TypeTag, Properties::TimeStepControl>(); // "pid"
|
||||
std::string control = Parameters::get<TypeTag, Parameters::TimeStepControl>(); // "pid"
|
||||
|
||||
const double tol = Parameters::get<TypeTag, Properties::TimeStepControlTolerance>(); // 1e-1
|
||||
const double tol = Parameters::get<TypeTag, Parameters::TimeStepControlTolerance>(); // 1e-1
|
||||
if (control == "pid") {
|
||||
timeStepControl_ = std::make_unique<PIDTimeStepControl>(tol);
|
||||
timeStepControlType_ = TimeStepControlType::PID;
|
||||
}
|
||||
else if (control == "pid+iteration") {
|
||||
const int iterations = Parameters::get<TypeTag, Properties::TimeStepControlTargetIterations>(); // 30
|
||||
const double decayDampingFactor = Parameters::get<TypeTag, Properties::TimeStepControlDecayDampingFactor>(); // 1.0
|
||||
const double growthDampingFactor = Parameters::get<TypeTag, Properties::TimeStepControlGrowthDampingFactor>(); // 3.2
|
||||
const int iterations = Parameters::get<TypeTag, Parameters::TimeStepControlTargetIterations>(); // 30
|
||||
const double decayDampingFactor = Parameters::get<TypeTag, Parameters::TimeStepControlDecayDampingFactor>(); // 1.0
|
||||
const double growthDampingFactor = Parameters::get<TypeTag, Parameters::TimeStepControlGrowthDampingFactor>(); // 3.2
|
||||
timeStepControl_ = std::make_unique<PIDAndIterationCountTimeStepControl>(iterations, decayDampingFactor, growthDampingFactor, tol);
|
||||
timeStepControlType_ = TimeStepControlType::PIDAndIterationCount;
|
||||
}
|
||||
else if (control == "pid+newtoniteration") {
|
||||
const int iterations = Parameters::get<TypeTag, Properties::TimeStepControlTargetNewtonIterations>(); // 8
|
||||
const double decayDampingFactor = Parameters::get<TypeTag, Properties::TimeStepControlDecayDampingFactor>(); // 1.0
|
||||
const double growthDampingFactor = Parameters::get<TypeTag, Properties::TimeStepControlGrowthDampingFactor>(); // 3.2
|
||||
const double nonDimensionalMinTimeStepIterations = Parameters::get<TypeTag, Properties::MinTimeStepBasedOnNewtonIterations>(); // 0.0 by default
|
||||
const int iterations = Parameters::get<TypeTag, Parameters::TimeStepControlTargetNewtonIterations>(); // 8
|
||||
const double decayDampingFactor = Parameters::get<TypeTag, Parameters::TimeStepControlDecayDampingFactor>(); // 1.0
|
||||
const double growthDampingFactor = Parameters::get<TypeTag, Parameters::TimeStepControlGrowthDampingFactor>(); // 3.2
|
||||
const double nonDimensionalMinTimeStepIterations = Parameters::get<TypeTag, Parameters::MinTimeStepBasedOnNewtonIterations>(); // 0.0 by default
|
||||
// the min time step can be reduced by the newton iteration numbers
|
||||
double minTimeStepReducedByIterations = unitSystem.to_si(UnitSystem::measure::time, nonDimensionalMinTimeStepIterations);
|
||||
timeStepControl_ = std::make_unique<PIDAndIterationCountTimeStepControl>(iterations, decayDampingFactor,
|
||||
@ -842,22 +840,22 @@ std::set<std::string> consistentlyFailingWells(const std::vector<StepReport>& sr
|
||||
useNewtonIteration_ = true;
|
||||
}
|
||||
else if (control == "iterationcount") {
|
||||
const int iterations = Parameters::get<TypeTag, Properties::TimeStepControlTargetIterations>(); // 30
|
||||
const double decayrate = Parameters::get<TypeTag, Properties::TimeStepControlDecayRate>(); // 0.75
|
||||
const double growthrate = Parameters::get<TypeTag, Properties::TimeStepControlGrowthRate>(); // 1.25
|
||||
const int iterations = Parameters::get<TypeTag, Parameters::TimeStepControlTargetIterations>(); // 30
|
||||
const double decayrate = Parameters::get<TypeTag, Parameters::TimeStepControlDecayRate>(); // 0.75
|
||||
const double growthrate = Parameters::get<TypeTag, Parameters::TimeStepControlGrowthRate>(); // 1.25
|
||||
timeStepControl_ = std::make_unique<SimpleIterationCountTimeStepControl>(iterations, decayrate, growthrate);
|
||||
timeStepControlType_ = TimeStepControlType::SimpleIterationCount;
|
||||
}
|
||||
else if (control == "newtoniterationcount") {
|
||||
const int iterations = Parameters::get<TypeTag, Properties::TimeStepControlTargetNewtonIterations>(); // 8
|
||||
const double decayrate = Parameters::get<TypeTag, Properties::TimeStepControlDecayRate>(); // 0.75
|
||||
const double growthrate = Parameters::get<TypeTag, Properties::TimeStepControlGrowthRate>(); // 1.25
|
||||
const int iterations = Parameters::get<TypeTag, Parameters::TimeStepControlTargetNewtonIterations>(); // 8
|
||||
const double decayrate = Parameters::get<TypeTag, Parameters::TimeStepControlDecayRate>(); // 0.75
|
||||
const double growthrate = Parameters::get<TypeTag, Parameters::TimeStepControlGrowthRate>(); // 1.25
|
||||
timeStepControl_ = std::make_unique<SimpleIterationCountTimeStepControl>(iterations, decayrate, growthrate);
|
||||
useNewtonIteration_ = true;
|
||||
timeStepControlType_ = TimeStepControlType::SimpleIterationCount;
|
||||
}
|
||||
else if (control == "hardcoded") {
|
||||
const std::string filename = Parameters::get<TypeTag, Properties::TimeStepControlFileName>(); // "timesteps"
|
||||
const std::string filename = Parameters::get<TypeTag, Parameters::TimeStepControlFileName>(); // "timesteps"
|
||||
timeStepControl_ = std::make_unique<HardcodedTimeStepControl>(filename);
|
||||
timeStepControlType_ = TimeStepControlType::HardCodedTimeStep;
|
||||
}
|
||||
|
@ -26,85 +26,79 @@
|
||||
#include <opm/models/utils/basicproperties.hh>
|
||||
#include <opm/models/utils/propertysystem.hh>
|
||||
|
||||
namespace Opm::Properties {
|
||||
|
||||
namespace TTag {
|
||||
namespace Opm::Properties::TTag {
|
||||
|
||||
struct EclTimeSteppingParameters {};
|
||||
|
||||
}
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct EnableTuning {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
namespace Opm::Parameters {
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct SolverGrowthFactor {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct EnableTuning { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct SolverMaxGrowth {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct SolverGrowthFactor { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct SolverMaxTimeStepInDays {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct SolverMaxGrowth { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct SolverMinTimeStep {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct SolverMaxTimeStepInDays { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct SolverRestartFactor {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct SolverMinTimeStep { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct TimeStepAfterEventInDays {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct SolverRestartFactor { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct TimeStepAfterEventInDays { using type = Properties::UndefinedProperty; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct EnableTuning<TypeTag, TTag::EclTimeSteppingParameters> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
struct EnableTuning<TypeTag, Properties::TTag::EclTimeSteppingParameters>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct SolverGrowthFactor<TypeTag, TTag::EclTimeSteppingParameters> {
|
||||
using type = GetPropType<TypeTag, Scalar>;
|
||||
struct SolverGrowthFactor<TypeTag, Properties::TTag::EclTimeSteppingParameters>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 2.0;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct SolverMaxGrowth<TypeTag, TTag::EclTimeSteppingParameters> {
|
||||
using type = GetPropType<TypeTag, Scalar>;
|
||||
struct SolverMaxGrowth<TypeTag, Properties::TTag::EclTimeSteppingParameters>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 3.0;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct SolverMinTimeStep<TypeTag, TTag::EclTimeSteppingParameters> {
|
||||
using type = GetPropType<TypeTag, Scalar>;
|
||||
struct SolverMinTimeStep<TypeTag, Properties::TTag::EclTimeSteppingParameters>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 1.0e-12;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct SolverMaxTimeStepInDays<TypeTag, TTag::EclTimeSteppingParameters> {
|
||||
using type = GetPropType<TypeTag, Scalar>;
|
||||
struct SolverMaxTimeStepInDays<TypeTag, Properties::TTag::EclTimeSteppingParameters>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 365.0;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct SolverRestartFactor<TypeTag, TTag::EclTimeSteppingParameters> {
|
||||
using type = GetPropType<TypeTag, Scalar>;
|
||||
struct SolverRestartFactor<TypeTag, Properties::TTag::EclTimeSteppingParameters>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 0.33;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct TimeStepAfterEventInDays<TypeTag, TTag::EclTimeSteppingParameters> {
|
||||
using type = GetPropType<TypeTag, Scalar>;
|
||||
struct TimeStepAfterEventInDays<TypeTag, Properties::TTag::EclTimeSteppingParameters>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = -1.0;
|
||||
};
|
||||
|
||||
@ -115,21 +109,21 @@ namespace Opm {
|
||||
template<class TypeTag>
|
||||
void registerEclTimeSteppingParameters()
|
||||
{
|
||||
Parameters::registerParam<TypeTag, Properties::EnableTuning>
|
||||
Parameters::registerParam<TypeTag, Parameters::EnableTuning>
|
||||
("Honor some aspects of the TUNING keyword.");
|
||||
Parameters::registerParam<TypeTag, Properties::SolverGrowthFactor>
|
||||
Parameters::registerParam<TypeTag, Parameters::SolverGrowthFactor>
|
||||
("The factor time steps are elongated after a successful substep");
|
||||
Parameters::registerParam<TypeTag, Properties::SolverMaxGrowth>
|
||||
Parameters::registerParam<TypeTag, Parameters::SolverMaxGrowth>
|
||||
("The maximum factor time steps are elongated after a report step");
|
||||
Parameters::registerParam<TypeTag, Properties::SolverMaxTimeStepInDays>
|
||||
Parameters::registerParam<TypeTag, Parameters::SolverMaxTimeStepInDays>
|
||||
("The maximum size of a time step in days");
|
||||
Parameters::registerParam<TypeTag, Properties::SolverMinTimeStep>
|
||||
Parameters::registerParam<TypeTag, Parameters::SolverMinTimeStep>
|
||||
("The minimum size of a time step in days for field and "
|
||||
"metric and hours for lab. If a step cannot converge without "
|
||||
"getting cut below this step size the simulator will stop");
|
||||
Parameters::registerParam<TypeTag, Properties::SolverRestartFactor>
|
||||
Parameters::registerParam<TypeTag, Parameters::SolverRestartFactor>
|
||||
("The factor time steps are elongated after restarts");
|
||||
Parameters::registerParam<TypeTag, Properties::TimeStepAfterEventInDays>
|
||||
Parameters::registerParam<TypeTag, Parameters::TimeStepAfterEventInDays>
|
||||
("Time step size of the first time step after an event "
|
||||
"occurs during the simulation in days");
|
||||
}
|
||||
|
@ -20,7 +20,9 @@
|
||||
#ifndef OPM_DAMARISKEYWORDS_HEADER_INCLUDED
|
||||
#define OPM_DAMARISKEYWORDS_HEADER_INCLUDED
|
||||
|
||||
#include <opm/simulators/flow/DamarisProperties.hpp>
|
||||
#include <opm/models/utils/parametersystem.hh>
|
||||
|
||||
#include <opm/simulators/flow/DamarisParameters.hpp>
|
||||
#include <opm/simulators/utils/ParallelCommunication.hpp>
|
||||
|
||||
#include <map>
|
||||
@ -36,8 +38,7 @@
|
||||
be changed. We only allow changing FileMode together with output directory
|
||||
*/
|
||||
|
||||
namespace Opm::DamarisOutput
|
||||
{
|
||||
namespace Opm::DamarisOutput {
|
||||
|
||||
/**
|
||||
* Returns true if the file exists.
|
||||
@ -49,7 +50,8 @@ namespace Opm::DamarisOutput
|
||||
bool FileExists(const std::string& filename_in,
|
||||
const Parallel::Communication& comm);
|
||||
|
||||
struct DamarisSettings {
|
||||
struct DamarisSettings
|
||||
{
|
||||
bool enableDamarisOutputCollective_ = true;
|
||||
bool saveToDamarisHDF5_ = true;
|
||||
// if saveMeshToDamarisHDF5 is true, requires enableDamarisOutputCollective to be false
|
||||
@ -72,8 +74,6 @@ struct DamarisSettings {
|
||||
std::map<std::string, std::string>
|
||||
getKeywords(const Parallel::Communication& comm,
|
||||
const std::string& OutputDir);
|
||||
|
||||
|
||||
|
||||
void SetRandString(void); // sets the value of rand_value_str_
|
||||
};
|
||||
@ -97,18 +97,19 @@ getDamarisKeywords(const Parallel::Communication& comm, const std::string& Outpu
|
||||
// which is used in simulators/flow/Main.hpp)
|
||||
// These command line arguments are defined in opm/simulators/flow/DamarisWriter.hpp and
|
||||
// defaults are set in opm/simulators/flow/FlowProblemProperties.hpp
|
||||
settings.enableDamarisOutputCollective_ = Parameters::get<TypeTag, Properties::DamarisOutputHdfCollective>();
|
||||
settings.saveMeshToHDF5_ = Parameters::get<TypeTag, Properties::DamarisSaveMeshToHdf>();
|
||||
settings.saveToDamarisHDF5_ = Parameters::get<TypeTag, Properties::DamarisSaveToHdf>();
|
||||
settings.pythonFilename_ = Parameters::get<TypeTag, Properties::DamarisPythonScript>();
|
||||
settings.paraviewPythonFilename_ = Parameters::get<TypeTag, Properties::DamarisPythonParaviewScript>();
|
||||
settings.damarisSimName_ = Parameters::get<TypeTag, Properties::DamarisSimName>();
|
||||
settings.nDamarisCores_ = Parameters::get<TypeTag, Properties::DamarisDedicatedCores>();
|
||||
settings.nDamarisNodes_ = Parameters::get<TypeTag, Properties::DamarisDedicatedNodes>();
|
||||
settings.shmemSizeBytes_ = Parameters::get<TypeTag, Properties::DamarisSharedMemorySizeBytes>();
|
||||
settings.shmemName_ = Parameters::get<TypeTag, Properties::DamarisSharedMemoryName>();
|
||||
settings.damarisLogLevel_ = Parameters::get<TypeTag, Properties::DamarisLogLevel>();
|
||||
settings.damarisDaskFile_ = Parameters::get<TypeTag, Properties::DamarisDaskFile>();
|
||||
settings.enableDamarisOutputCollective_ = Parameters::get<TypeTag, Parameters::DamarisOutputHdfCollective>();
|
||||
settings.saveMeshToHDF5_ = Parameters::get<TypeTag, Parameters::DamarisSaveMeshToHdf>();
|
||||
settings.saveToDamarisHDF5_ = Parameters::get<TypeTag, Parameters::DamarisSaveToHdf>();
|
||||
settings.pythonFilename_ = Parameters::get<TypeTag, Parameters::DamarisPythonScript>();
|
||||
settings.paraviewPythonFilename_ = Parameters::get<TypeTag, Parameters::DamarisPythonParaviewScript>();
|
||||
settings.damarisSimName_ = Parameters::get<TypeTag, Parameters::DamarisSimName>();
|
||||
settings.nDamarisCores_ = Parameters::get<TypeTag, Parameters::DamarisDedicatedCores>();
|
||||
settings.nDamarisNodes_ = Parameters::get<TypeTag, Parameters::DamarisDedicatedNodes>();
|
||||
settings.shmemSizeBytes_ = Parameters::get<TypeTag, Parameters::DamarisSharedMemorySizeBytes>();
|
||||
settings.shmemName_ = Parameters::get<TypeTag, Parameters::DamarisSharedMemoryName>();
|
||||
settings.damarisLogLevel_ = Parameters::get<TypeTag, Parameters::DamarisLogLevel>();
|
||||
settings.damarisDaskFile_ = Parameters::get<TypeTag, Parameters::DamarisDaskFile>();
|
||||
|
||||
return settings.getKeywords(comm, OutputDir);
|
||||
}
|
||||
|
||||
@ -119,7 +120,7 @@ getSetOfIncludedVariables(void)
|
||||
std::unordered_set<std::string> resuset ;
|
||||
std::string tstr;
|
||||
// The --damaris-limit-variables command line option (defaults to empty string)
|
||||
std::string damarisLimitVars = Parameters::get<TypeTag, Properties::DamarisLimitVariables>();
|
||||
std::string damarisLimitVars = Parameters::get<TypeTag, Parameters::DamarisLimitVariables>();
|
||||
std::stringstream ss(damarisLimitVars);
|
||||
|
||||
// Use while loop to check the getline() function condition.
|
||||
@ -132,7 +133,7 @@ getSetOfIncludedVariables(void)
|
||||
resuset.insert(tstr) ;
|
||||
}
|
||||
}
|
||||
return (resuset) ;
|
||||
return resuset;
|
||||
}
|
||||
|
||||
} // namespace Opm::DamarisOutput
|
||||
|
@ -78,14 +78,12 @@
|
||||
|
||||
#include <opm/simulators/utils/DeferredLogger.hpp>
|
||||
|
||||
namespace Opm::Properties {
|
||||
namespace Opm::Parameters {
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct EnableTerminalOutput {
|
||||
using type = UndefinedProperty;
|
||||
};
|
||||
struct EnableTerminalOutput { using type = Properties::UndefinedProperty; };
|
||||
|
||||
} // namespace Opm::Properties
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
namespace Opm {
|
||||
|
||||
|
@ -77,7 +77,7 @@ namespace Opm {
|
||||
, simulator_(simulator)
|
||||
{
|
||||
this->terminal_output_ = ((simulator.gridView().comm().rank() == 0) &&
|
||||
Parameters::get<TypeTag, Properties::EnableTerminalOutput>());
|
||||
Parameters::get<TypeTag, Parameters::EnableTerminalOutput>());
|
||||
|
||||
local_num_cells_ = simulator_.gridView().size(0);
|
||||
|
||||
@ -94,7 +94,7 @@ namespace Opm {
|
||||
}
|
||||
|
||||
this->alternative_well_rate_init_ =
|
||||
Parameters::get<TypeTag, Properties::AlternativeWellRateInit>();
|
||||
Parameters::get<TypeTag, Parameters::AlternativeWellRateInit>();
|
||||
|
||||
using SourceDataSpan =
|
||||
typename PAvgDynamicSourceData<Scalar>::template SourceDataSpan<Scalar>;
|
||||
|
@ -64,25 +64,6 @@ struct WellModel<TypeTag, TTag::TestTypeTag> {
|
||||
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;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct EnableTerminalOutput<TypeTag, TTag::TestTypeTag> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
|
||||
// flow's well model only works with surface volumes
|
||||
template<class TypeTag>
|
||||
struct BlackoilConserveSurfaceVolume<TypeTag, TTag::TestTypeTag> {
|
||||
@ -116,6 +97,36 @@ struct LinearSolverBackend<TTag::TestTypeTag, TTag::FlowIstlSolverParams> {
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
template<class TypeTag>
|
||||
struct EnableTerminalOutput<TypeTag, Properties::TTag::TestTypeTag>
|
||||
{ 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
|
||||
// simulation to 2 (instead of grabbing everything that is available).
|
||||
#if _OPENMP
|
||||
@ -130,20 +141,6 @@ template<class TypeTag>
|
||||
struct ContinueOnConvergenceError<TypeTag, Properties::TTag::TestTypeTag>
|
||||
{ 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
|
||||
|
||||
#endif // OPM_TEST_TYPETAG_HPP
|
||||
|
@ -513,7 +513,7 @@ struct AquiferFixture {
|
||||
};
|
||||
AdaptiveTimeStepping<TT>::registerParameters();
|
||||
BlackoilModelParameters<TT>::registerParameters();
|
||||
Parameters::registerParam<TT, Properties::EnableTerminalOutput>("Do *NOT* use!");
|
||||
Parameters::registerParam<TT, Parameters::EnableTerminalOutput>("Do *NOT* use!");
|
||||
setupParameters_<TT>(2, argv, /*registerParams=*/true);
|
||||
Opm::FlowGenericVanguard::setCommunication(std::make_unique<Opm::Parallel::Communication>());
|
||||
}
|
||||
|
@ -68,11 +68,6 @@
|
||||
|
||||
namespace Opm::Properties {
|
||||
|
||||
template<class TypeTag>
|
||||
struct EnableTerminalOutput<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
|
||||
namespace TTag {
|
||||
|
||||
|
||||
@ -100,8 +95,18 @@ template<class TypeTag>
|
||||
struct EnableVapwat<TypeTag, TTag::TestEquilVapwatTypeTag> {
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
|
||||
} // namespace Opm::Properties
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
template<class TypeTag>
|
||||
struct EnableTerminalOutput<TypeTag, Properties::TTag::FlowBaseProblem> {
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
template <class TypeTag>
|
||||
std::unique_ptr<Opm::GetPropType<TypeTag, Opm::Properties::Simulator>>
|
||||
initSimulator(const char *filename)
|
||||
@ -237,7 +242,7 @@ struct EquilFixture {
|
||||
BlackoilModelParameters<TypeTag>::registerParameters();
|
||||
AdaptiveTimeStepping<TypeTag>::registerParameters();
|
||||
Parameters::registerParam<TypeTag,
|
||||
Properties::EnableTerminalOutput>("Dummy added for the well model to compile.");
|
||||
Parameters::EnableTerminalOutput>("Dummy added for the well model to compile.");
|
||||
registerAllParameters_<TypeTag>();
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,7 @@ initSimulator(const char *filename)
|
||||
|
||||
registerEclTimeSteppingParameters<TypeTag>();
|
||||
BlackoilModelParameters<TypeTag>::registerParameters();
|
||||
Parameters::registerParam<TypeTag, Properties::EnableTerminalOutput>("Do *NOT* use!");
|
||||
Parameters::registerParam<TypeTag, Parameters::EnableTerminalOutput>("Do *NOT* use!");
|
||||
setupParameters_<TypeTag>(/*argc=*/sizeof(argv)/sizeof(argv[0]), argv, /*registerParams=*/true);
|
||||
|
||||
FlowGenericVanguard::readDeck(filename);
|
||||
|
Loading…
Reference in New Issue
Block a user