Represent Assigned PI as an optional<>
Suggested by: [at]joakim-hove
This commit is contained in:
@@ -23,9 +23,9 @@
|
||||
|
||||
#include <cstddef>
|
||||
#include <iosfwd>
|
||||
#include <limits>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
@@ -633,7 +633,7 @@ private:
|
||||
double solvent_fraction;
|
||||
bool has_produced = false;
|
||||
bool prediction_mode = true;
|
||||
double productivity_index{ std::numeric_limits<double>::lowest() };
|
||||
std::optional<double> productivity_index{ std::nullopt };
|
||||
|
||||
std::shared_ptr<WellEconProductionLimits> econ_limits;
|
||||
std::shared_ptr<WellFoamProperties> foam_properties;
|
||||
|
||||
@@ -816,7 +816,7 @@ void Well::applyWellProdIndexScaling(const double currentEffectivePI) {
|
||||
// No connections for this well. Unexpected.
|
||||
return;
|
||||
|
||||
if (this->productivity_index < 0.0)
|
||||
if (!this->productivity_index)
|
||||
// WELPI not activated. Nothing to do.
|
||||
return;
|
||||
|
||||
@@ -824,7 +824,7 @@ void Well::applyWellProdIndexScaling(const double currentEffectivePI) {
|
||||
// No change in scaling.
|
||||
return;
|
||||
|
||||
this->connections->applyWellPIScaling(this->productivity_index / currentEffectivePI);
|
||||
this->connections->applyWellPIScaling(*this->productivity_index / currentEffectivePI);
|
||||
}
|
||||
|
||||
const WellConnections& Well::getConnections() const {
|
||||
|
||||
Reference in New Issue
Block a user