Resetting WINJMULT dampening factors before fixed BHP calculations

This commit is contained in:
Vegard Kippe
2024-10-10 09:25:28 +02:00
parent 5d1b29ac72
commit a2882dc0c8
4 changed files with 8 additions and 4 deletions

View File

@@ -394,6 +394,8 @@ namespace Opm
// creating a copy of the well itself, to avoid messing up the explicit information
// during this copy, the only information not copied properly is the well controls
MultisegmentWell<TypeTag> well_copy(*this);
well_copy.resetDampening();
well_copy.debug_cost_counter_ = 0;
// store a copy of the well state, we don't want to update the real well state

View File

@@ -1522,6 +1522,7 @@ namespace Opm
// creating a copy of the well itself, to avoid messing up the explicit information
// during this copy, the only information not copied properly is the well controls
StandardWell<TypeTag> well_copy(*this);
well_copy.resetDampening();
// iterate to get a more accurate well density
// create a copy of the well_state to use. If the operability checking is sucessful, we use this one

View File

@@ -256,8 +256,6 @@ getInjMult(const int perf,
Scalar multiplier = 1.;
const auto perf_ecl_index = this->perforationData()[perf].ecl_index;
const bool is_wrev = this->well_ecl_.getInjMultMode() == Well::InjMultMode::WREV;
const bool active_injmult = (is_wrev && this->well_ecl_.aciveWellInjMult()) ||
@@ -277,8 +275,7 @@ getInjMult(const int perf,
const Scalar prev_multiplier = this->inj_multiplier_[perf_ecl_index] > 0 ? this->inj_multiplier_[perf_ecl_index] : 1.0;
if (std::abs(multiplier - prev_multiplier) > osc_threshold) {
const Scalar prev2_multiplier = this->inj_multiplier_previter_[perf_ecl_index] > 0 ? this->inj_multiplier_previter_[perf_ecl_index] : 1.0;
const bool oscillating = (multiplier > prev_multiplier && prev_multiplier < prev2_multiplier) ||
(multiplier < prev_multiplier && prev_multiplier > prev2_multiplier);
const bool oscillating = (multiplier - prev_multiplier) * (prev_multiplier - prev2_multiplier) < 0;
const Scalar min_damp_factor = this->param_.inj_mult_min_damp_factor_;
Scalar damp_factor = this->inj_multiplier_damp_factor_[perf_ecl_index];

View File

@@ -221,6 +221,10 @@ protected:
Well::InjectionControls& inj_controls,
Well::ProductionControls& prod_controls) const;
void resetDampening() {
std::fill(this->inj_multiplier_damp_factor_.begin(), this->inj_multiplier_damp_factor_.end(), 1.0);
}
// definition of the struct OperabilityStatus
struct OperabilityStatus
{