changed: NewtonTolerance parameter moved to Opm::Parameters namespace

This commit is contained in:
Arne Morten Kvarving
2024-06-28 12:17:13 +02:00
parent 389ea1ef8b
commit 514eddc950
5 changed files with 66 additions and 49 deletions

View File

@@ -21,6 +21,7 @@
#include "flowexp.hpp"
#include <opm/models/discretization/common/tpfalinearizer.hh>
#include <opm/models/utils/parametersystem.hh>
#include <opm/simulators/flow/Main.hpp>
#include <opm/simulators/flow/FlowProblem.hpp>
@@ -61,14 +62,6 @@ struct EclNewtonSumTolerance<TypeTag, TTag::FlowExpProblemBlackOil>
static constexpr type value = 1e-5;
};
// the default for the allowed volumetric error for oil per second
template<class TypeTag>
struct NewtonTolerance<TypeTag, TTag::FlowExpProblemBlackOil>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 1e-2;
};
// set fraction of the pore volume where the volumetric residual may be violated during
// strict Newton iterations
template<class TypeTag>
@@ -78,13 +71,6 @@ struct EclNewtonRelaxedVolumeFraction<TypeTag, TTag::FlowExpProblemBlackOil>
static constexpr type value = 0.0;
};
template<class TypeTag>
struct EclNewtonRelaxedTolerance<TypeTag, TTag::FlowExpProblemBlackOil>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 10*getPropValue<TypeTag, Properties::NewtonTolerance>();
};
template<class TypeTag>
struct EnableDiffusion<TypeTag, TTag::FlowExpProblemBlackOil>
{
@@ -103,7 +89,7 @@ struct Simulator<TypeTag, TTag::FlowExpProblemBlackOil>
using type = Opm::Simulator<TypeTag>;
};
}
} // namespace Opm::Properties
namespace Opm::Parameters {
@@ -115,8 +101,27 @@ template<class TypeTag>
struct ContinueOnConvergenceError<TypeTag, Properties::TTag::FlowExpProblemBlackOil>
{ static constexpr bool value = false; };
// the default for the allowed volumetric error for oil per second
template<class TypeTag>
struct NewtonTolerance<TypeTag, Properties::TTag::FlowExpProblemBlackOil>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e-2;
};
} // namespace Opm::Parameters
namespace Opm::Properties {
template<class TypeTag>
struct EclNewtonRelaxedTolerance<TypeTag, TTag::FlowExpProblemBlackOil>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 10 * Parameters::NewtonTolerance<TypeTag,TTag::FlowExpProblemBlackOil>::value;
};
} // namespace Opm::Properties
int main(int argc, char** argv)
{
using TypeTag = Opm::Properties::TTag::FlowExpProblemBlackOil;