mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-11-22 09:16:27 -06:00
move FlashTolerance to TypeTag-free parameter system
This commit is contained in:
parent
00c0304fce
commit
65db009152
@ -107,7 +107,7 @@ public:
|
||||
|
||||
const auto& priVars = elemCtx.primaryVars(dofIdx, timeIdx);
|
||||
const auto& problem = elemCtx.problem();
|
||||
Scalar flashTolerance = Parameters::get<TypeTag, Parameters::FlashTolerance>();
|
||||
Scalar flashTolerance = Parameters::Get<Parameters::FlashTolerance<Scalar>>();
|
||||
|
||||
// extract the total molar densities of the components
|
||||
ComponentVector cTotal;
|
||||
|
@ -133,14 +133,6 @@ template<class TypeTag>
|
||||
struct EnableThermodynamicHints<TypeTag, Properties::TTag::FlashModel>
|
||||
{ static constexpr bool value = true; };
|
||||
|
||||
//! Let the flash solver choose its tolerance by default
|
||||
template<class TypeTag>
|
||||
struct FlashTolerance<TypeTag, Properties::TTag::FlashModel>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = -1.0;
|
||||
};
|
||||
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
namespace Opm {
|
||||
@ -244,7 +236,7 @@ public:
|
||||
if (enableEnergy)
|
||||
Opm::VtkEnergyModule<TypeTag>::registerParameters();
|
||||
|
||||
Parameters::registerParam<TypeTag, Parameters::FlashTolerance>
|
||||
Parameters::Register<Parameters::FlashTolerance<Scalar>>
|
||||
("The maximum tolerance for the flash solver to "
|
||||
"consider the solution converged");
|
||||
}
|
||||
|
@ -30,13 +30,12 @@
|
||||
#ifndef EWOMS_FLASH_PARAMETERS_HH
|
||||
#define EWOMS_FLASH_PARAMETERS_HH
|
||||
|
||||
#include <opm/models/utils/propertysystem.hh>
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
//! The maximum accepted error of the flash solver
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct FlashTolerance { using type = Properties::UndefinedProperty; };
|
||||
//! Let the flash solver choose its tolerance by default
|
||||
template<class Scalar>
|
||||
struct FlashTolerance { static constexpr Scalar value = -1.0; };
|
||||
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
|
@ -110,7 +110,7 @@ public:
|
||||
const auto& priVars = elemCtx.primaryVars(dofIdx, timeIdx);
|
||||
const auto& problem = elemCtx.problem();
|
||||
|
||||
const Scalar flashTolerance = Parameters::get<TypeTag, Parameters::FlashTolerance>();
|
||||
const Scalar flashTolerance = Parameters::Get<Parameters::FlashTolerance<Scalar>>();
|
||||
const int flashVerbosity = Parameters::get<TypeTag, Parameters::FlashVerbosity>();
|
||||
const std::string flashTwoPhaseMethod = Parameters::get<TypeTag, Parameters::FlashTwoPhaseMethod>();
|
||||
|
||||
|
@ -156,14 +156,6 @@ template<class TypeTag>
|
||||
struct EnableThermodynamicHints<TypeTag, Properties::TTag::FlashModel>
|
||||
{ static constexpr bool value = true; };
|
||||
|
||||
//! Let the flash solver choose its tolerance by default
|
||||
template<class TypeTag>
|
||||
struct FlashTolerance<TypeTag, Properties::TTag::FlashModel>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 1.e-12;
|
||||
};
|
||||
|
||||
// Flash two-phase method
|
||||
template<class TypeTag>
|
||||
struct FlashTwoPhaseMethod<TypeTag, Properties::TTag::FlashModel>
|
||||
@ -261,7 +253,7 @@ public:
|
||||
if (enableEnergy)
|
||||
Opm::VtkEnergyModule<TypeTag>::registerParameters();
|
||||
|
||||
Parameters::registerParam<TypeTag, Parameters::FlashTolerance>
|
||||
Parameters::Register<Parameters::FlashTolerance<Scalar>>
|
||||
("The maximum tolerance for the flash solver to "
|
||||
"consider the solution converged");
|
||||
Parameters::registerParam<TypeTag, Parameters::FlashVerbosity>
|
||||
@ -269,6 +261,8 @@ public:
|
||||
Parameters::registerParam<TypeTag, Parameters::FlashTwoPhaseMethod>
|
||||
("Method for solving vapor-liquid composition. Available options include: "
|
||||
"ssi, newton, ssi+newton");
|
||||
|
||||
Parameters::SetDefault<Parameters::FlashTolerance<Scalar>>(1e-12);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
Loading…
Reference in New Issue
Block a user