Merge pull request #3810 from totto82/refactor_bhpFromThpLimit_1

Refactor bhp from thp limit
This commit is contained in:
Tor Harald Sandve
2022-03-22 13:57:52 +01:00
committed by GitHub
6 changed files with 384 additions and 464 deletions

View File

@@ -179,6 +179,16 @@ public:
bool changedToOpenThisStep() const {
return this->changed_to_open_this_step_;
}
std::optional<double> computeBhpAtThpLimitProdCommon(const std::function<std::vector<double>(const double)>& frates,
const SummaryState& summary_state,
const double maxPerfPress,
const double rho,
const double alq_value,
DeferredLogger& deferred_logger
) const;
protected:
bool getAllowCrossFlow() const;
double mostStrictBhpFromBhpLimits(const SummaryState& summaryState) const;
@@ -187,6 +197,30 @@ protected:
WellTestState& well_test_state,
DeferredLogger& deferred_logger) const;
std::optional<double> bhpMax(const std::function<double(const double)>& fflo,
const double bhp_limit,
const double maxPerfPress,
const double vfp_flo_front,
DeferredLogger& deferred_logger) const;
std::optional<double> computeBhpAtThpLimitCommon(
const std::function<std::vector<double>(const double)>& frates,
const std::function<double(const std::vector<double>)>& fbhp,
const std::array<double, 2>& range,
DeferredLogger& deferred_logger) const;
bool bruteForceBracket(const std::function<double(const double)>& eq,
const std::array<double, 2>& range,
double& low, double& high,
DeferredLogger& deferred_logger) const;
bool bisectBracket(const std::function<double(const double)>& eq,
const std::array<double, 2>& range,
double& low, double& high,
std::optional<double>& approximate_solution,
DeferredLogger& deferred_logger) const;
// definition of the struct OperabilityStatus
struct OperabilityStatus {