remove some unused bools

these loops are inf-loops-with-break and the bools are never used
This commit is contained in:
Arne Morten Kvarving 2025-01-23 10:50:48 +01:00
parent 4ff851af9c
commit de986943f0
2 changed files with 5 additions and 10 deletions

View File

@ -1048,11 +1048,10 @@ GasLiftSingleWellGeneric<Scalar>::
increaseALQtoPositiveOilRate_(Scalar alq,
const LimitedRates& orig_rates) const
{
bool stop_iteration = false;
Scalar temp_alq = alq;
// use the copy constructor to only copy the rates
BasicRates rates = orig_rates;
while (!stop_iteration) {
while (true) {
temp_alq += this->increment_;
if (temp_alq > this->max_alq_)
break;
@ -1078,10 +1077,9 @@ increaseALQtoMinALQ_(const Scalar orig_alq,
assert(min_alq >= 0);
assert(orig_alq < min_alq);
assert(min_alq < this->max_alq_);
bool stop_iteration = false;
Scalar alq = orig_alq;
LimitedRates rates = orig_rates;
while (!stop_iteration) {
while (true) {
Scalar temp_alq = alq + this->increment_;
alq = temp_alq;
@ -1175,11 +1173,10 @@ GasLiftSingleWellGeneric<Scalar>::
reduceALQtoGroupAlqLimits_(const Scalar orig_alq,
const LimitedRates& orig_rates) const
{
bool stop_this_iteration = false;
Scalar alq = orig_alq;
BasicRates rates {orig_rates};
Scalar temp_alq = orig_alq;
while (!stop_this_iteration) {
while (true) {
if (temp_alq == 0)
break;
temp_alq -= this->increment_;
@ -1268,8 +1265,7 @@ reduceALQtoWellTarget_(const Scalar orig_alq,
Scalar alq = orig_alq;
Scalar temp_alq = alq;
std::optional<LimitedRates> new_rates;
bool stop_iteration = false;
while (!stop_iteration) {
while (true) {
if (temp_alq == 0)
break;
temp_alq -= this->increment_;

View File

@ -171,10 +171,9 @@ findThpFromBhpIteratively(const std::function<Scalar(const Scalar, const Scalar)
auto pressure_loss = getVfpBhpAdjustment(bhp + dp, thp_limit);
auto thp = thp_func(bhp, pressure_loss);
const Scalar tolerance = 1e-5 * unit::barsa;
bool do_iterate = true;
int it = 1;
int max_iterations = 50;
while (do_iterate) {
while (true) {
if (it > max_iterations) {
break;
}