mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #4621 from vkip/use_mb_from_tuning
Use mass balance limit (XXXMBE) from TUNING with --enable-tuning=true
This commit is contained in:
@@ -24,6 +24,8 @@
|
||||
#ifndef OPM_BLACKOILMODELEBOS_HEADER_INCLUDED
|
||||
#define OPM_BLACKOILMODELEBOS_HEADER_INCLUDED
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <ebos/eclproblem.hh>
|
||||
|
||||
#include <opm/common/ErrorMacros.hpp>
|
||||
@@ -1523,6 +1525,7 @@ namespace Opm {
|
||||
return grid_.comm().sum(errorPV);
|
||||
}
|
||||
|
||||
|
||||
ConvergenceReport getDomainReservoirConvergence(const double reportTime,
|
||||
const double dt,
|
||||
const int iteration,
|
||||
@@ -1632,6 +1635,14 @@ namespace Opm {
|
||||
|
||||
|
||||
|
||||
void updateTUNING(const Tuning& tuning) {
|
||||
param_.tolerance_mb_ = tuning.XXXMBE;
|
||||
if ( terminal_output_ ) {
|
||||
OpmLog::debug(fmt::format("Setting BlackoilModelEbos mass balance limit (XXXMBE) to {:.2e}", tuning.XXXMBE));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ConvergenceReport getReservoirConvergence(const double reportTime,
|
||||
const double dt,
|
||||
const int iteration,
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#define OPM_SIMULATORFULLYIMPLICITBLACKOILEBOS_HEADER_INCLUDED
|
||||
|
||||
#include <dune/common/hash.hh>
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <opm/simulators/flow/BlackoilModelEbos.hpp>
|
||||
#include <opm/simulators/flow/BlackoilModelParametersEbos.hpp>
|
||||
@@ -320,6 +321,13 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void updateTUNING(const Tuning& tuning) {
|
||||
modelParam_.tolerance_mb_ = tuning.XXXMBE;
|
||||
if (terminalOutput_) {
|
||||
OpmLog::debug(fmt::format("Setting SimulatorFullyImplicitBlackoilEbos mass balance limit (XXXMBE) to {:.2e}", tuning.XXXMBE));
|
||||
}
|
||||
}
|
||||
|
||||
bool runStep(SimulatorTimer& timer)
|
||||
{
|
||||
if (schedule().exitStatus().has_value()) {
|
||||
@@ -393,6 +401,10 @@ public:
|
||||
const auto& tuning = sched_state.tuning();
|
||||
const auto& max_next_tstep = sched_state.max_next_tstep();
|
||||
adaptiveTimeStepping_->updateTUNING(max_next_tstep, tuning);
|
||||
// \Note: Assumes TUNING is only used with adaptive time-stepping
|
||||
// \Note: Need to update both solver (model) and simulator since solver is re-created each report step.
|
||||
solver_->model().updateTUNING(tuning);
|
||||
this->updateTUNING(tuning);
|
||||
}
|
||||
}
|
||||
bool event = events.hasEvent(ScheduleEvents::NEW_WELL) ||
|
||||
|
||||
Reference in New Issue
Block a user