mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Add parameter --nupcol_group_rate_tolerance to be able to set the relative tolerance. Default is 0.001
This commit is contained in:
@@ -102,6 +102,8 @@ BlackoilModelParameters<Scalar>::BlackoilModelParameters()
|
||||
convergence_monitoring_ = Parameters::Get<Parameters::ConvergenceMonitoring>();
|
||||
convergence_monitoring_cutoff_ = Parameters::Get<Parameters::ConvergenceMonitoringCutOff>();
|
||||
convergence_monitoring_decay_factor_ = Parameters::Get<Parameters::ConvergenceMonitoringDecayFactor<Scalar>>();
|
||||
|
||||
nupcol_group_rate_tolerance_ = Parameters::Get<Parameters::NupcolGroupRateTolerance<Scalar>>();
|
||||
}
|
||||
|
||||
template<class Scalar>
|
||||
@@ -251,6 +253,9 @@ void BlackoilModelParameters<Scalar>::registerParameters()
|
||||
Parameters::Register<Parameters::ConvergenceMonitoringDecayFactor<Scalar>>
|
||||
("Decay factor for convergence monitoring");
|
||||
|
||||
Parameters::Register<Parameters::NupcolGroupRateTolerance<Scalar>>
|
||||
("Tolerance for acceptable changes in VREP/RAIN group rates");
|
||||
|
||||
Parameters::Hide<Parameters::DebugEmitCellPartition>();
|
||||
|
||||
// if openMP is available, determine the number threads per process automatically.
|
||||
|
||||
@@ -152,6 +152,9 @@ struct ConvergenceMonitoringCutOff { static constexpr int value = 6; };
|
||||
template<class Scalar>
|
||||
struct ConvergenceMonitoringDecayFactor { static constexpr Scalar value = 0.75; };
|
||||
|
||||
template<class Scalar>
|
||||
struct NupcolGroupRateTolerance { static constexpr Scalar value = 0.001; };
|
||||
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
namespace Opm {
|
||||
@@ -315,6 +318,10 @@ public:
|
||||
/// Decay factor used in convergence monitoring
|
||||
Scalar convergence_monitoring_decay_factor_;
|
||||
|
||||
// Relative tolerance of group rates (VREP, REIN)
|
||||
// If violated the nupcol wellstate is updated
|
||||
Scalar nupcol_group_rate_tolerance_;
|
||||
|
||||
/// Construct from user parameters or defaults.
|
||||
BlackoilModelParameters();
|
||||
|
||||
|
||||
@@ -1180,6 +1180,7 @@ template<class Scalar>
|
||||
void BlackoilWellModelGeneric<Scalar>::
|
||||
updateAndCommunicateGroupData(const int reportStepIdx,
|
||||
const int iterationIdx,
|
||||
const Scalar tol_nupcol,
|
||||
DeferredLogger& deferred_logger)
|
||||
{
|
||||
const Group& fieldGroup = schedule().getGroup("FIELD", reportStepIdx);
|
||||
@@ -1192,7 +1193,6 @@ updateAndCommunicateGroupData(const int reportStepIdx,
|
||||
if (iterationIdx <= nupcol) {
|
||||
this->updateNupcolWGState();
|
||||
} else {
|
||||
Scalar tol_nupcol = 0.01;
|
||||
for (const auto& gr_name : schedule().groupNames(reportStepIdx)) {
|
||||
const Phase all[] = { Phase::WATER, Phase::OIL, Phase::GAS };
|
||||
for (Phase phase : all) {
|
||||
|
||||
@@ -377,6 +377,7 @@ protected:
|
||||
|
||||
void updateAndCommunicateGroupData(const int reportStepIdx,
|
||||
const int iterationIdx,
|
||||
const Scalar tol_nupcol,
|
||||
DeferredLogger& deferred_logger);
|
||||
|
||||
void inferLocalShutWells();
|
||||
|
||||
@@ -472,7 +472,9 @@ namespace Opm {
|
||||
|
||||
const int reportStepIdx = simulator_.episodeIndex();
|
||||
this->updateAndCommunicateGroupData(reportStepIdx,
|
||||
simulator_.model().newtonMethod().numIterations(), local_deferredLogger);
|
||||
simulator_.model().newtonMethod().numIterations(),
|
||||
param_.nupcol_group_rate_tolerance_,
|
||||
local_deferredLogger);
|
||||
|
||||
this->wellState().updateWellsDefaultALQ(this->schedule(), reportStepIdx, this->summaryState());
|
||||
this->wellState().gliftTimeStepInit();
|
||||
@@ -2176,7 +2178,7 @@ namespace Opm {
|
||||
|
||||
const int iterationIdx = simulator_.model().newtonMethod().numIterations();
|
||||
const auto& comm = simulator_.vanguard().grid().comm();
|
||||
this->updateAndCommunicateGroupData(episodeIdx, iterationIdx, deferred_logger);
|
||||
this->updateAndCommunicateGroupData(episodeIdx, iterationIdx, param_.nupcol_group_rate_tolerance_, deferred_logger);
|
||||
|
||||
// network related
|
||||
bool more_network_update = false;
|
||||
@@ -2430,7 +2432,7 @@ namespace Opm {
|
||||
const int iterationIdx,
|
||||
DeferredLogger& deferred_logger)
|
||||
{
|
||||
this->updateAndCommunicateGroupData(reportStepIdx, iterationIdx, deferred_logger);
|
||||
this->updateAndCommunicateGroupData(reportStepIdx, iterationIdx, param_.nupcol_group_rate_tolerance_, deferred_logger);
|
||||
|
||||
// updateWellStateWithTarget might throw for multisegment wells hence we
|
||||
// have a parallel try catch here to thrown on all processes.
|
||||
@@ -2442,7 +2444,7 @@ namespace Opm {
|
||||
}
|
||||
OPM_END_PARALLEL_TRY_CATCH("BlackoilWellModel::updateAndCommunicate failed: ",
|
||||
simulator_.gridView().comm())
|
||||
this->updateAndCommunicateGroupData(reportStepIdx, iterationIdx, deferred_logger);
|
||||
this->updateAndCommunicateGroupData(reportStepIdx, iterationIdx, param_.nupcol_group_rate_tolerance_, deferred_logger);
|
||||
}
|
||||
|
||||
template<typename TypeTag>
|
||||
|
||||
Reference in New Issue
Block a user