mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
adding parameter to control the min time step
can be reduced to based on the newton iteration counts. By default it is zero, so it should not change any running results.
This commit is contained in:
@@ -175,11 +175,13 @@ namespace Opm
|
||||
const double decayDampingFactor,
|
||||
const double growthDampingFactor,
|
||||
const double tol,
|
||||
const double minTimeStepBasedOnIterations,
|
||||
const bool verbose)
|
||||
: PIDTimeStepControl( tol, verbose )
|
||||
, target_iterations_( target_iterations )
|
||||
, decayDampingFactor_( decayDampingFactor )
|
||||
, growthDampingFactor_( growthDampingFactor )
|
||||
, minTimeStepBasedOnIterations_(minTimeStepBasedOnIterations)
|
||||
{}
|
||||
|
||||
double PIDAndIterationCountTimeStepControl::
|
||||
@@ -192,6 +194,9 @@ namespace Opm
|
||||
if (iterations > target_iterations_) {
|
||||
double off_target_fraction = double(iterations - target_iterations_) / target_iterations_;
|
||||
dtEstimateIter = dt / (1.0 + off_target_fraction * decayDampingFactor_);
|
||||
if (dtEstimateIter < minTimeStepBasedOnIterations_) {
|
||||
dtEstimateIter = minTimeStepBasedOnIterations_;
|
||||
}
|
||||
} else {
|
||||
double off_target_fraction = double(target_iterations_ - iterations) / target_iterations_;
|
||||
// Be a bit more careful when increasing.
|
||||
|
||||
Reference in New Issue
Block a user