move NewtonTolerance to TypeTag-free parameter system

This commit is contained in:
Arne Morten Kvarving
2024-07-05 17:49:51 +02:00
parent 6d649be5db
commit 73344cfb60
9 changed files with 31 additions and 85 deletions

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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});
}
/*!

View File

@@ -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);
}
/*!

View File

@@ -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);
}
/*!