mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
changed: move the NewtonTolerance parameter to Opm::Parameters
This commit is contained in:
@@ -71,16 +71,22 @@ struct FlashSolver<TypeTag, TTag::Co2InjectionFlashEcfvProblem>
|
|||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct Scalar<TypeTag, TTag::Co2InjectionFlashEcfvProblem>
|
struct Scalar<TypeTag, TTag::Co2InjectionFlashEcfvProblem>
|
||||||
{ using type = quad; };
|
{ using type = quad; };
|
||||||
#else
|
#endif
|
||||||
|
|
||||||
|
} // namespace Opm::Properties
|
||||||
|
|
||||||
|
namespace Opm::Parameters {
|
||||||
|
|
||||||
|
#if ! HAVE_QUAD
|
||||||
template<class TypeTag>
|
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;
|
static constexpr type value = 1e-5;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} // namespace Opm::Properties
|
} // namespace Opm::Parameters
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -73,16 +73,22 @@ struct FlashSolver<TypeTag, TTag::Co2InjectionFlashNiEcfvProblem>
|
|||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct Scalar<TypeTag, TTag::Co2InjectionFlashNiEcfvProblem>
|
struct Scalar<TypeTag, TTag::Co2InjectionFlashNiEcfvProblem>
|
||||||
{ using type = quad; };
|
{ using type = quad; };
|
||||||
#else
|
#endif
|
||||||
|
|
||||||
|
} // namespace Opm::Properties
|
||||||
|
|
||||||
|
namespace Opm::Parameters {
|
||||||
|
|
||||||
|
#if ! HAVE_QUAD
|
||||||
template<class TypeTag>
|
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;
|
static constexpr type value = 1e-5;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} // namespace Opm::Properties
|
} // namespace Opm::Parameters
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -69,16 +69,22 @@ struct FlashSolver<TypeTag, TTag::Co2InjectionFlashNiVcfvProblem>
|
|||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct Scalar<TypeTag, TTag::Co2InjectionFlashNiVcfvProblem>
|
struct Scalar<TypeTag, TTag::Co2InjectionFlashNiVcfvProblem>
|
||||||
{ using type = quad; };
|
{ using type = quad; };
|
||||||
#else
|
#endif
|
||||||
|
|
||||||
|
} // namespace Opm::Properties
|
||||||
|
|
||||||
|
namespace Opm::Parameters {
|
||||||
|
|
||||||
|
#if ! HAVE_QUAD
|
||||||
template<class TypeTag>
|
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;
|
static constexpr type value = 1e-5;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} // namespace Opm::Properties
|
} // namespace Opm::Parameters
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -65,16 +65,22 @@ struct FlashSolver<TypeTag, TTag::Co2InjectionFlashVcfvProblem>
|
|||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct Scalar<TypeTag, TTag::Co2InjectionFlashVcfvProblem>
|
struct Scalar<TypeTag, TTag::Co2InjectionFlashVcfvProblem>
|
||||||
{ using type = quad; };
|
{ using type = quad; };
|
||||||
#else
|
#endif
|
||||||
|
|
||||||
|
} // namespace Opm::Properties
|
||||||
|
|
||||||
|
namespace Opm::Parameters {
|
||||||
|
|
||||||
|
#if ! HAVE_QUAD
|
||||||
template<class TypeTag>
|
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;
|
static constexpr type value = 1e-5;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} // namespace Opm::Properties
|
} // namespace Opm::Parameters
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -189,12 +189,6 @@ struct LinearSolverAbsTolerance<TypeTag, TTag::CO2PTBaseProblem> {
|
|||||||
static constexpr type value = 0.;
|
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>
|
template <class TypeTag>
|
||||||
struct NewtonMaxIterations<TypeTag, TTag::CO2PTBaseProblem> {
|
struct NewtonMaxIterations<TypeTag, TTag::CO2PTBaseProblem> {
|
||||||
static constexpr int value = 30;
|
static constexpr int value = 30;
|
||||||
@@ -299,6 +293,13 @@ template <class TypeTag>
|
|||||||
struct NewtonWriteConvergence<TypeTag, Properties::TTag::CO2PTBaseProblem>
|
struct NewtonWriteConvergence<TypeTag, Properties::TTag::CO2PTBaseProblem>
|
||||||
{ static constexpr bool value = false; };
|
{ 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::Parameters
|
||||||
|
|
||||||
namespace Opm {
|
namespace Opm {
|
||||||
|
|||||||
@@ -171,14 +171,6 @@ public:
|
|||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct GridFile<TypeTag, TTag::ReservoirBaseProblem> { static constexpr auto value = "data/reservoir.dgf"; };
|
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::Properties
|
||||||
|
|
||||||
namespace Opm::Parameters {
|
namespace Opm::Parameters {
|
||||||
@@ -188,6 +180,14 @@ template<class TypeTag>
|
|||||||
struct NewtonWriteConvergence<TypeTag, Properties::TTag::ReservoirBaseProblem>
|
struct NewtonWriteConvergence<TypeTag, Properties::TTag::ReservoirBaseProblem>
|
||||||
{ static constexpr bool value = false; };
|
{ 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::Parameters
|
||||||
|
|
||||||
namespace Opm {
|
namespace Opm {
|
||||||
|
|||||||
@@ -76,12 +76,6 @@ template<class TypeTag>
|
|||||||
struct NewtonMethod<TypeTag, TTag::NewtonMethod> { using type = ::Opm::NewtonMethod<TypeTag>; };
|
struct NewtonMethod<TypeTag, TTag::NewtonMethod> { using type = ::Opm::NewtonMethod<TypeTag>; };
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct NewtonConvergenceWriter<TypeTag, TTag::NewtonMethod> { using type = NullConvergenceWriter<TypeTag>; };
|
struct NewtonConvergenceWriter<TypeTag, TTag::NewtonMethod> { using type = NullConvergenceWriter<TypeTag>; };
|
||||||
template<class TypeTag>
|
|
||||||
struct NewtonTolerance<TypeTag, TTag::NewtonMethod>
|
|
||||||
{
|
|
||||||
using type = GetPropType<TypeTag, Scalar>;
|
|
||||||
static constexpr type value = 1e-8;
|
|
||||||
};
|
|
||||||
// set the abortion tolerace to some very large value. if not
|
// set the abortion tolerace to some very large value. if not
|
||||||
// overwritten at run-time this basically disables abortions
|
// overwritten at run-time this basically disables abortions
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
@@ -107,6 +101,13 @@ template<class TypeTag>
|
|||||||
struct NewtonWriteConvergence<TypeTag, Properties::TTag::NewtonMethod>
|
struct NewtonWriteConvergence<TypeTag, Properties::TTag::NewtonMethod>
|
||||||
{ static constexpr bool value = false; };
|
{ static constexpr bool value = false; };
|
||||||
|
|
||||||
|
template<class TypeTag>
|
||||||
|
struct NewtonTolerance<TypeTag, Properties::TTag::NewtonMethod>
|
||||||
|
{
|
||||||
|
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||||
|
static constexpr type value = 1e-8;
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace Opm::Parameters
|
} // namespace Opm::Parameters
|
||||||
|
|
||||||
namespace Opm {
|
namespace Opm {
|
||||||
@@ -148,7 +149,7 @@ public:
|
|||||||
{
|
{
|
||||||
lastError_ = 1e100;
|
lastError_ = 1e100;
|
||||||
error_ = 1e100;
|
error_ = 1e100;
|
||||||
tolerance_ = Parameters::get<TypeTag, Properties::NewtonTolerance>();
|
tolerance_ = Parameters::get<TypeTag, Parameters::NewtonTolerance>();
|
||||||
|
|
||||||
numIterations_ = 0;
|
numIterations_ = 0;
|
||||||
}
|
}
|
||||||
@@ -170,7 +171,7 @@ public:
|
|||||||
("The 'optimum' number of Newton iterations per time step");
|
("The 'optimum' number of Newton iterations per time step");
|
||||||
Parameters::registerParam<TypeTag, Properties::NewtonMaxIterations>
|
Parameters::registerParam<TypeTag, Properties::NewtonMaxIterations>
|
||||||
("The maximum number of Newton iterations per time step");
|
("The maximum number of Newton iterations per time step");
|
||||||
Parameters::registerParam<TypeTag, Properties::NewtonTolerance>
|
Parameters::registerParam<TypeTag, Parameters::NewtonTolerance>
|
||||||
("The maximum raw error tolerated by the Newton"
|
("The maximum raw error tolerated by the Newton"
|
||||||
"method for considering a solution to be converged");
|
"method for considering a solution to be converged");
|
||||||
Parameters::registerParam<TypeTag, Properties::NewtonMaxError>
|
Parameters::registerParam<TypeTag, Properties::NewtonMaxError>
|
||||||
|
|||||||
@@ -36,6 +36,15 @@ struct NewtonVerbose { using type = Properties::UndefinedProperty; };
|
|||||||
template<class TypeTag, class MyTypeTag>
|
template<class TypeTag, class MyTypeTag>
|
||||||
struct NewtonWriteConvergence { using type = Properties::UndefinedProperty; };
|
struct NewtonWriteConvergence { using type = Properties::UndefinedProperty; };
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief The value for the error below which convergence is declared
|
||||||
|
*
|
||||||
|
* This value can (and for the porous media models will) be changed to account for grid
|
||||||
|
* scaling and other effects.
|
||||||
|
*/
|
||||||
|
template<class TypeTag, class MyTypeTag>
|
||||||
|
struct NewtonTolerance { using type = Properties::UndefinedProperty; };
|
||||||
|
|
||||||
} // end namespace Opm::Parameters
|
} // end namespace Opm::Parameters
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -44,15 +44,6 @@ struct NewtonConvergenceWriter { using type = UndefinedProperty; };
|
|||||||
template<class TypeTag, class MyTypeTag>
|
template<class TypeTag, class MyTypeTag>
|
||||||
struct ConvergenceWriter { using type = UndefinedProperty; };
|
struct ConvergenceWriter { using type = UndefinedProperty; };
|
||||||
|
|
||||||
/*!
|
|
||||||
* \brief The value for the error below which convergence is declared
|
|
||||||
*
|
|
||||||
* This value can (and for the porous media models will) be changed to account for grid
|
|
||||||
* scaling and other effects.
|
|
||||||
*/
|
|
||||||
template<class TypeTag, class MyTypeTag>
|
|
||||||
struct NewtonTolerance { using type = UndefinedProperty; };
|
|
||||||
|
|
||||||
//! The maximum error which may occur in a simulation before the
|
//! The maximum error which may occur in a simulation before the
|
||||||
//! Newton method for the time step is aborted
|
//! Newton method for the time step is aborted
|
||||||
template<class TypeTag, class MyTypeTag>
|
template<class TypeTag, class MyTypeTag>
|
||||||
|
|||||||
Reference in New Issue
Block a user