mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
move checkGroupConstraintsProd into WellGroupConstraints
This commit is contained in:
parent
698b748270
commit
75dad9f4c4
@ -91,4 +91,36 @@ checkGroupConstraintsInj(const Group& group,
|
||||
deferred_logger);
|
||||
}
|
||||
|
||||
std::pair<bool, double>
|
||||
WellGroupConstraints::
|
||||
checkGroupConstraintsProd(const Group& group,
|
||||
const WellState& well_state,
|
||||
const GroupState& group_state,
|
||||
const double efficiencyFactor,
|
||||
const Schedule& schedule,
|
||||
const SummaryState& summaryState,
|
||||
const RateConvFunc& rateConverter,
|
||||
DeferredLogger& deferred_logger) const
|
||||
{
|
||||
// Make conversion factors for RESV <-> surface rates.
|
||||
std::vector<double> resv_coeff(well_.phaseUsage().num_phases, 1.0);
|
||||
rateConverter(0, well_.pvtRegionIdx(), resv_coeff); // FIPNUM region 0 here, should use FIPNUM from WELSPECS.
|
||||
|
||||
const auto& ws = well_state.well(well_.indexOfWell());
|
||||
return WellGroupHelpers::checkGroupConstraintsProd(well_.name(),
|
||||
well_.wellEcl().groupName(),
|
||||
group,
|
||||
well_state,
|
||||
group_state,
|
||||
well_.currentStep(),
|
||||
well_.guideRate(),
|
||||
ws.surface_rates.data(),
|
||||
well_.phaseUsage(),
|
||||
efficiencyFactor,
|
||||
schedule,
|
||||
summaryState,
|
||||
resv_coeff,
|
||||
deferred_logger);
|
||||
}
|
||||
|
||||
} // namespace Opm
|
||||
|
@ -59,6 +59,16 @@ public:
|
||||
const RateConvFunc& rateConverter,
|
||||
DeferredLogger& deferred_logger) const;
|
||||
|
||||
std::pair<bool, double>
|
||||
checkGroupConstraintsProd(const Group& group,
|
||||
const WellState& well_state,
|
||||
const GroupState& group_state,
|
||||
const double efficiencyFactor,
|
||||
const Schedule& schedule,
|
||||
const SummaryState& summaryState,
|
||||
const RateConvFunc& rateConverter,
|
||||
DeferredLogger& deferred_logger) const;
|
||||
|
||||
private:
|
||||
const WellInterfaceGeneric& well_; //!< Reference to well interface
|
||||
};
|
||||
|
@ -327,38 +327,6 @@ checkIndividualConstraints(SingleWellState& ws,
|
||||
return false;
|
||||
}
|
||||
|
||||
template <typename FluidSystem>
|
||||
std::pair<bool, double>
|
||||
WellInterfaceFluidSystem<FluidSystem>::
|
||||
checkGroupConstraintsProd(const Group& group,
|
||||
const WellState& well_state,
|
||||
const GroupState& group_state,
|
||||
const double efficiencyFactor,
|
||||
const Schedule& schedule,
|
||||
const SummaryState& summaryState,
|
||||
DeferredLogger& deferred_logger) const
|
||||
{
|
||||
// Make conversion factors for RESV <-> surface rates.
|
||||
std::vector<double> resv_coeff(this->phaseUsage().num_phases, 1.0);
|
||||
rateConverter_.calcCoeff(0, pvtRegionIdx_, resv_coeff); // FIPNUM region 0 here, should use FIPNUM from WELSPECS.
|
||||
|
||||
const auto& ws = well_state.well(this->index_of_well_);
|
||||
return WellGroupHelpers::checkGroupConstraintsProd(name(),
|
||||
well_ecl_.groupName(),
|
||||
group,
|
||||
well_state,
|
||||
group_state,
|
||||
current_step_,
|
||||
guide_rate_,
|
||||
ws.surface_rates.data(),
|
||||
phaseUsage(),
|
||||
efficiencyFactor,
|
||||
schedule,
|
||||
summaryState,
|
||||
resv_coeff,
|
||||
deferred_logger);
|
||||
}
|
||||
|
||||
template <typename FluidSystem>
|
||||
bool
|
||||
WellInterfaceFluidSystem<FluidSystem>::
|
||||
@ -425,8 +393,15 @@ checkGroupConstraints(WellState& well_state,
|
||||
const auto& group = schedule.getGroup( well.groupName(), current_step_ );
|
||||
const double efficiencyFactor = well.getEfficiencyFactor();
|
||||
const std::pair<bool, double> group_constraint =
|
||||
checkGroupConstraintsProd(group, well_state, group_state, efficiencyFactor,
|
||||
schedule, summaryState, deferred_logger);
|
||||
WellGroupConstraints(*this).
|
||||
checkGroupConstraintsProd(group,
|
||||
well_state,
|
||||
group_state,
|
||||
efficiencyFactor,
|
||||
schedule,
|
||||
summaryState,
|
||||
rCoeff,
|
||||
deferred_logger);
|
||||
// If a group constraint was broken, we set the current well control to
|
||||
// be GRUP.
|
||||
if (group_constraint.first) {
|
||||
|
@ -89,14 +89,6 @@ protected:
|
||||
const SummaryState& summaryState,
|
||||
DeferredLogger& deferred_logger) const;
|
||||
|
||||
std::pair<bool, double> checkGroupConstraintsProd(const Group& group,
|
||||
const WellState& well_state,
|
||||
const GroupState& group_state,
|
||||
const double efficiencyFactor,
|
||||
const Schedule& schedule,
|
||||
const SummaryState& summaryState,
|
||||
DeferredLogger& deferred_logger) const;
|
||||
|
||||
bool checkGroupConstraints(WellState& well_state,
|
||||
const GroupState& group_state,
|
||||
const Schedule& schedule,
|
||||
|
Loading…
Reference in New Issue
Block a user