Reset the total penalty card after each nonlinear iteration

This commit is contained in:
jakobtorben
2024-09-09 17:38:58 +02:00
parent e1e577fab1
commit 3e6f9c52bb
2 changed files with 8 additions and 0 deletions

View File

@@ -392,6 +392,7 @@ namespace Opm {
// For each iteration we store in a vector the norms of the residual of
// the mass balance for each active phase, the well flux and the well equations.
residual_norms_history_.clear();
total_penaltyCard_.reset();
current_relaxation_ = 1.0;
dx_old_ = 0.0;
convergence_reports_.push_back({timer.reportStepNum(), timer.currentStepNum(), {}});

View File

@@ -62,6 +62,13 @@ namespace Opm
return nonConverged + distanceDecay + largeWellResiduals;
}
void reset()
{
nonConverged = 0;
distanceDecay = 0;
largeWellResiduals = 0;
}
PenaltyCard& operator+=(const PenaltyCard& other) {
nonConverged += other.nonConverged;
distanceDecay += other.distanceDecay;