34 controls(controls_arg)
38 bool hasControl(WellProducerCMode cmode_arg)
const
40 return (this->controls &
static_cast<int>(cmode_arg)) != 0;
43 void skipControl(WellProducerCMode cmode_arg) {
44 auto int_arg =
static_cast<int>(cmode_arg);
45 if ((this->controls & int_arg) != 0)
46 this->controls -= int_arg;
49 void addControl(WellProducerCMode cmode_arg) {
50 auto int_arg =
static_cast<int>(cmode_arg);
51 if ((this->controls & int_arg) == 0)
52 this->controls += int_arg;
59 bool anyZeroRateConstraint()
const {
60 auto is_zero = [](
const double x)
62 return std::isfinite(x) && !std::isnormal(x);
65 if (this->hasControl(WellProducerCMode::ORAT) && is_zero(this->oil_rate)) {
69 if (this->hasControl(WellProducerCMode::WRAT) && is_zero(this->water_rate)) {
73 if (this->hasControl(WellProducerCMode::GRAT) && is_zero(this->gas_rate)) {
77 if (this->hasControl(WellProducerCMode::LRAT) && is_zero(this->liquid_rate)) {
81 if (this->hasControl(WellProducerCMode::RESV)) {
86 const auto zero_rate = this->prediction_mode
87 ? is_zero(this->resv_rate)
88 : is_zero(this->oil_rate) && is_zero(this->water_rate) && is_zero(this->gas_rate);
100 return this->cmode == other.cmode &&
101 this->oil_rate == other.oil_rate &&
102 this->water_rate == other.water_rate &&
103 this->gas_rate == other.gas_rate &&
104 this->liquid_rate == other.liquid_rate &&
105 this->resv_rate == other.resv_rate &&
106 this->bhp_history == other.bhp_history &&
107 this->thp_history == other.thp_history &&
108 this->bhp_limit == other.bhp_limit &&
109 this->thp_limit == other.thp_limit &&
110 this->alq_value == other.alq_value &&
111 this->vfp_table_number == other.vfp_table_number &&
112 this->prediction_mode == other.prediction_mode;
115 WellProducerCMode cmode = WellProducerCMode::NONE;
117 double water_rate{0};
119 double liquid_rate{0};
121 double bhp_history{0};
122 double thp_history{0};
126 int vfp_table_number{0};
127 bool prediction_mode{0};
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30