mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
move NewtonTolerance to TypeTag-free parameter system
This commit is contained in:
@@ -75,21 +75,11 @@ struct Scalar<TypeTag, TTag::Co2InjectionFlashEcfvProblem>
|
||||
|
||||
} // namespace Opm::Properties
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
#if ! HAVE_QUAD
|
||||
template<class TypeTag>
|
||||
struct NewtonTolerance<TypeTag, Properties::TTag::Co2InjectionFlashEcfvProblem>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 1e-5;
|
||||
};
|
||||
#endif
|
||||
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
using EcfvProblemTypeTag = Opm::Properties::TTag::Co2InjectionFlashEcfvProblem;
|
||||
#if ! HAVE_QUAD
|
||||
Opm::Co2InjectionTolerance = 1e-5;
|
||||
#endif
|
||||
return Opm::start<EcfvProblemTypeTag>(argc, argv);
|
||||
}
|
||||
|
||||
@@ -77,21 +77,11 @@ struct Scalar<TypeTag, TTag::Co2InjectionFlashNiEcfvProblem>
|
||||
|
||||
} // namespace Opm::Properties
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
#if ! HAVE_QUAD
|
||||
template<class TypeTag>
|
||||
struct NewtonTolerance<TypeTag, Properties::TTag::Co2InjectionFlashNiEcfvProblem>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 1e-5;
|
||||
};
|
||||
#endif
|
||||
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
using EcfvProblemTypeTag = Opm::Properties::TTag::Co2InjectionFlashNiEcfvProblem;
|
||||
#if ! HAVE_QUAD
|
||||
Opm::Co2InjectionTolerance = 1e-5;
|
||||
#endif
|
||||
return Opm::start<EcfvProblemTypeTag>(argc, argv);
|
||||
}
|
||||
|
||||
@@ -73,21 +73,11 @@ struct Scalar<TypeTag, TTag::Co2InjectionFlashNiVcfvProblem>
|
||||
|
||||
} // namespace Opm::Properties
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
#if ! HAVE_QUAD
|
||||
template<class TypeTag>
|
||||
struct NewtonTolerance<TypeTag, Properties::TTag::Co2InjectionFlashNiVcfvProblem>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 1e-5;
|
||||
};
|
||||
#endif
|
||||
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
using VcfvProblemTypeTag = Opm::Properties::TTag::Co2InjectionFlashNiVcfvProblem;
|
||||
#if ! HAVE_QUAD
|
||||
Opm::Co2InjectionTolerance = 1e-5;
|
||||
#endif
|
||||
return Opm::start<VcfvProblemTypeTag>(argc, argv);
|
||||
}
|
||||
|
||||
@@ -69,21 +69,11 @@ struct Scalar<TypeTag, TTag::Co2InjectionFlashVcfvProblem>
|
||||
|
||||
} // namespace Opm::Properties
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
#if ! HAVE_QUAD
|
||||
template<class TypeTag>
|
||||
struct NewtonTolerance<TypeTag, Properties::TTag::Co2InjectionFlashVcfvProblem>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 1e-5;
|
||||
};
|
||||
#endif
|
||||
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
using VcfvProblemTypeTag = Opm::Properties::TTag::Co2InjectionFlashVcfvProblem;
|
||||
#if ! HAVE_QUAD
|
||||
Opm::Co2InjectionTolerance = 1e-5;
|
||||
#endif
|
||||
return Opm::start<VcfvProblemTypeTag>(argc, argv);
|
||||
}
|
||||
|
||||
@@ -231,6 +231,9 @@ struct Temperature<TypeTag, Properties::TTag::Co2InjectionBaseProblem>
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
namespace Opm {
|
||||
|
||||
double Co2InjectionTolerance = 1e-8;
|
||||
|
||||
/*!
|
||||
* \ingroup TestProblems
|
||||
*
|
||||
@@ -393,6 +396,8 @@ public:
|
||||
Parameters::SetDefault<Parameters::GridFile>("data/co2injection.dgf");
|
||||
Parameters::SetDefault<Parameters::EndTime<Scalar>>(1e4);
|
||||
Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(250);
|
||||
|
||||
Parameters::SetDefault<Parameters::NewtonTolerance<Scalar>>(Scalar{Co2InjectionTolerance});
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
@@ -190,13 +190,6 @@ struct LinearSolverTolerance<TypeTag, Properties::TTag::CO2PTBaseProblem>
|
||||
static constexpr type value = 1e-3;
|
||||
};
|
||||
|
||||
template <class TypeTag>
|
||||
struct NewtonTolerance<TypeTag, Properties::TTag::CO2PTBaseProblem>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 1e-3;
|
||||
};
|
||||
|
||||
template <class TypeTag>
|
||||
struct NewtonTargetIterations<TypeTag, Properties::TTag::CO2PTBaseProblem>
|
||||
{
|
||||
@@ -380,6 +373,7 @@ public:
|
||||
|
||||
Parameters::SetDefault<Parameters::EndTime<Scalar>>(60. * 60.);
|
||||
Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(0.1 * 60. * 60.);
|
||||
Parameters::SetDefault<Parameters::NewtonTolerance<Scalar>>(1e-3);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
@@ -148,14 +148,6 @@ struct MaxDepth<TypeTag, Properties::TTag::ReservoirBaseProblem>
|
||||
static constexpr type value = 2500;
|
||||
};
|
||||
|
||||
// increase the tolerance for this problem to get larger time steps
|
||||
template<class TypeTag>
|
||||
struct NewtonTolerance<TypeTag, Properties::TTag::ReservoirBaseProblem>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 1e-6;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct Temperature<TypeTag, Properties::TTag::ReservoirBaseProblem>
|
||||
{
|
||||
@@ -431,6 +423,8 @@ public:
|
||||
Parameters::SetDefault<Parameters::EnableStorageCache>(true);
|
||||
Parameters::SetDefault<Parameters::GridFile>("data/reservoir.dgf");
|
||||
Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(100e3);
|
||||
// increase the tolerance for this problem to get larger time steps
|
||||
Parameters::SetDefault<Parameters::NewtonTolerance<Scalar>>(1e-6);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
Reference in New Issue
Block a user