mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
phaseIdx in this for statement is actual active phase index, should not
active once again.
This commit is contained in:
parent
7fffc2c99a
commit
66bb1fae8f
@ -1740,18 +1740,16 @@ namespace {
|
||||
int oscillatePhase = 0;
|
||||
|
||||
for (int phaseIdx= 0; phaseIdx < fluid_.numPhases(); ++ phaseIdx){
|
||||
if (active_[phaseIdx]) {
|
||||
double relChange1 = std::fabs((residual_history[it][phaseIdx] - residual_history[it - 2][phaseIdx]) /
|
||||
residual_history[it][phaseIdx]);
|
||||
double relChange2 = std::fabs((residual_history[it][phaseIdx] - residual_history[it - 1][phaseIdx]) /
|
||||
residual_history[it][phaseIdx]);
|
||||
oscillatePhase += (relChange1 < relaxRelTol) && (relChange2 > relaxRelTol);
|
||||
double relChange1 = std::fabs((residual_history[it][phaseIdx] - residual_history[it - 2][phaseIdx]) /
|
||||
residual_history[it][phaseIdx]);
|
||||
double relChange2 = std::fabs((residual_history[it][phaseIdx] - residual_history[it - 1][phaseIdx]) /
|
||||
residual_history[it][phaseIdx]);
|
||||
oscillatePhase += (relChange1 < relaxRelTol) && (relChange2 > relaxRelTol);
|
||||
|
||||
double relChange3 = std::fabs((residual_history[it - 1][phaseIdx] - residual_history[it - 2][phaseIdx]) /
|
||||
residual_history[it - 2][phaseIdx]);
|
||||
if (relChange3 > 1.e-3) {
|
||||
stagnate = false;
|
||||
}
|
||||
double relChange3 = std::fabs((residual_history[it - 1][phaseIdx] - residual_history[it - 2][phaseIdx]) /
|
||||
residual_history[it - 2][phaseIdx]);
|
||||
if (relChange3 > 1.e-3) {
|
||||
stagnate = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user