mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Enable single-phase runs.
This commit is contained in:
committed by
Atgeirr Flø Rasmussen
parent
e4e8425bad
commit
d873ae165d
@@ -60,6 +60,7 @@ AdaptiveSimulatorTimer& AdaptiveSimulatorTimer::operator++ ()
|
||||
{
|
||||
++current_step_;
|
||||
current_time_ += dt_;
|
||||
assert(dt_ > 0);
|
||||
// store used time step sizes
|
||||
steps_.push_back( dt_ );
|
||||
return *this;
|
||||
@@ -71,7 +72,7 @@ AdaptiveSimulatorTimer& AdaptiveSimulatorTimer::operator++ ()
|
||||
double remaining = (total_time_ - current_time_);
|
||||
// apply max time step if it was set
|
||||
dt_ = std::min( dt_estimate, max_time_step_ );
|
||||
|
||||
assert(dt_ > 0);
|
||||
if( remaining > 0 ) {
|
||||
|
||||
// set new time step (depending on remaining time)
|
||||
@@ -81,6 +82,7 @@ AdaptiveSimulatorTimer& AdaptiveSimulatorTimer::operator++ ()
|
||||
if( dt_ > max_time_step_ ) {
|
||||
dt_ = 0.5 * remaining;
|
||||
}
|
||||
assert(dt_ > 0);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -89,6 +91,7 @@ AdaptiveSimulatorTimer& AdaptiveSimulatorTimer::operator++ ()
|
||||
|
||||
if( 1.5 * dt_ > remaining ) {
|
||||
dt_ = 0.5 * remaining;
|
||||
assert(dt_ > 0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -102,6 +105,7 @@ AdaptiveSimulatorTimer& AdaptiveSimulatorTimer::operator++ ()
|
||||
|
||||
double AdaptiveSimulatorTimer::currentStepLength () const
|
||||
{
|
||||
assert(dt_ > 0);
|
||||
return dt_;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user