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:
@@ -91,4 +91,36 @@ checkGroupConstraintsInj(const Group& group,
|
|||||||
deferred_logger);
|
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
|
} // namespace Opm
|
||||||
|
|||||||
@@ -59,6 +59,16 @@ public:
|
|||||||
const RateConvFunc& rateConverter,
|
const RateConvFunc& rateConverter,
|
||||||
DeferredLogger& deferred_logger) const;
|
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:
|
private:
|
||||||
const WellInterfaceGeneric& well_; //!< Reference to well interface
|
const WellInterfaceGeneric& well_; //!< Reference to well interface
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -327,38 +327,6 @@ checkIndividualConstraints(SingleWellState& ws,
|
|||||||
return false;
|
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>
|
template <typename FluidSystem>
|
||||||
bool
|
bool
|
||||||
WellInterfaceFluidSystem<FluidSystem>::
|
WellInterfaceFluidSystem<FluidSystem>::
|
||||||
@@ -425,8 +393,15 @@ checkGroupConstraints(WellState& well_state,
|
|||||||
const auto& group = schedule.getGroup( well.groupName(), current_step_ );
|
const auto& group = schedule.getGroup( well.groupName(), current_step_ );
|
||||||
const double efficiencyFactor = well.getEfficiencyFactor();
|
const double efficiencyFactor = well.getEfficiencyFactor();
|
||||||
const std::pair<bool, double> group_constraint =
|
const std::pair<bool, double> group_constraint =
|
||||||
checkGroupConstraintsProd(group, well_state, group_state, efficiencyFactor,
|
WellGroupConstraints(*this).
|
||||||
schedule, summaryState, deferred_logger);
|
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
|
// If a group constraint was broken, we set the current well control to
|
||||||
// be GRUP.
|
// be GRUP.
|
||||||
if (group_constraint.first) {
|
if (group_constraint.first) {
|
||||||
|
|||||||
@@ -89,14 +89,6 @@ protected:
|
|||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
DeferredLogger& deferred_logger) const;
|
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,
|
bool checkGroupConstraints(WellState& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState& group_state,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
|
|||||||
Reference in New Issue
Block a user