changed: move the NewtonTolerance parameter to Opm::Parameters

This commit is contained in:
Arne Morten Kvarving
2024-07-01 10:20:05 +02:00
parent c54fb7816f
commit 2a133b615e
9 changed files with 73 additions and 47 deletions

View File

@@ -71,16 +71,22 @@ struct FlashSolver<TypeTag, TTag::Co2InjectionFlashEcfvProblem>
template<class TypeTag>
struct Scalar<TypeTag, TTag::Co2InjectionFlashEcfvProblem>
{ using type = quad; };
#else
#endif
} // namespace Opm::Properties
namespace Opm::Parameters {
#if ! HAVE_QUAD
template<class TypeTag>
struct NewtonTolerance<TypeTag, TTag::Co2InjectionFlashEcfvProblem>
struct NewtonTolerance<TypeTag, Properties::TTag::Co2InjectionFlashEcfvProblem>
{
using type = GetPropType<TypeTag, Scalar>;
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e-5;
};
#endif
} // namespace Opm::Properties
} // namespace Opm::Parameters
int main(int argc, char **argv)
{

View File

@@ -73,16 +73,22 @@ struct FlashSolver<TypeTag, TTag::Co2InjectionFlashNiEcfvProblem>
template<class TypeTag>
struct Scalar<TypeTag, TTag::Co2InjectionFlashNiEcfvProblem>
{ using type = quad; };
#else
#endif
} // namespace Opm::Properties
namespace Opm::Parameters {
#if ! HAVE_QUAD
template<class TypeTag>
struct NewtonTolerance<TypeTag, TTag::Co2InjectionFlashNiEcfvProblem>
struct NewtonTolerance<TypeTag, Properties::TTag::Co2InjectionFlashNiEcfvProblem>
{
using type = GetPropType<TypeTag, Scalar>;
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e-5;
};
#endif
} // namespace Opm::Properties
} // namespace Opm::Parameters
int main(int argc, char **argv)
{

View File

@@ -69,16 +69,22 @@ struct FlashSolver<TypeTag, TTag::Co2InjectionFlashNiVcfvProblem>
template<class TypeTag>
struct Scalar<TypeTag, TTag::Co2InjectionFlashNiVcfvProblem>
{ using type = quad; };
#else
#endif
} // namespace Opm::Properties
namespace Opm::Parameters {
#if ! HAVE_QUAD
template<class TypeTag>
struct NewtonTolerance<TypeTag, TTag::Co2InjectionFlashNiVcfvProblem>
struct NewtonTolerance<TypeTag, Properties::TTag::Co2InjectionFlashNiVcfvProblem>
{
using type = GetPropType<TypeTag, Scalar>;
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e-5;
};
#endif
} // namespace Opm::Properties
} // namespace Opm::Parameters
int main(int argc, char **argv)
{

View File

@@ -65,16 +65,22 @@ struct FlashSolver<TypeTag, TTag::Co2InjectionFlashVcfvProblem>
template<class TypeTag>
struct Scalar<TypeTag, TTag::Co2InjectionFlashVcfvProblem>
{ using type = quad; };
#else
#endif
} // namespace Opm::Properties
namespace Opm::Parameters {
#if ! HAVE_QUAD
template<class TypeTag>
struct NewtonTolerance<TypeTag, TTag::Co2InjectionFlashVcfvProblem>
struct NewtonTolerance<TypeTag, Properties::TTag::Co2InjectionFlashVcfvProblem>
{
using type = GetPropType<TypeTag, Scalar>;
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e-5;
};
#endif
} // namespace Opm::Properties
} // namespace Opm::Parameters
int main(int argc, char **argv)
{

View File

@@ -189,12 +189,6 @@ struct LinearSolverAbsTolerance<TypeTag, TTag::CO2PTBaseProblem> {
static constexpr type value = 0.;
};
template <class TypeTag>
struct NewtonTolerance<TypeTag, TTag::CO2PTBaseProblem> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 1e-3;
};
template <class TypeTag>
struct NewtonMaxIterations<TypeTag, TTag::CO2PTBaseProblem> {
static constexpr int value = 30;
@@ -299,6 +293,13 @@ template <class TypeTag>
struct NewtonWriteConvergence<TypeTag, Properties::TTag::CO2PTBaseProblem>
{ static constexpr bool value = false; };
template <class TypeTag>
struct NewtonTolerance<TypeTag, Properties::TTag::CO2PTBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e-3;
};
} // namespace Opm::Parameters
namespace Opm {

View File

@@ -171,14 +171,6 @@ public:
template<class TypeTag>
struct GridFile<TypeTag, TTag::ReservoirBaseProblem> { static constexpr auto value = "data/reservoir.dgf"; };
// increase the tolerance for this problem to get larger time steps
template<class TypeTag>
struct NewtonTolerance<TypeTag, TTag::ReservoirBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 1e-6;
};
} // namespace Opm::Properties
namespace Opm::Parameters {
@@ -188,6 +180,14 @@ template<class TypeTag>
struct NewtonWriteConvergence<TypeTag, Properties::TTag::ReservoirBaseProblem>
{ static constexpr bool value = false; };
// 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;
};
} // namespace Opm::Parameters
namespace Opm {