mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
making the VREP enforcement into a small method.
in BlackoilModelBase.
This commit is contained in:
@@ -319,6 +319,10 @@ namespace Opm {
|
|||||||
std::vector<double>& well_voidage_rates,
|
std::vector<double>& well_voidage_rates,
|
||||||
std::vector<double>& voidage_conversion_coeffs);
|
std::vector<double>& voidage_conversion_coeffs);
|
||||||
|
|
||||||
|
|
||||||
|
void applyVREPGroupControl(const ReservoirState& reservoir_state,
|
||||||
|
const WellState& well_state);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// --------- Types and enums ---------
|
// --------- Types and enums ---------
|
||||||
|
|||||||
@@ -1063,11 +1063,8 @@ namespace detail {
|
|||||||
converged = getWellConvergence(it);
|
converged = getWellConvergence(it);
|
||||||
|
|
||||||
// Enforce the VREP control
|
// Enforce the VREP control
|
||||||
if (it == 0 && asImpl().wellModel().wellCollection()->havingVREPGroups()) {
|
if (it == 0) {
|
||||||
std::vector<double> well_voidage_rates;
|
applyVREPGroupControl(reservoir_state, well_state);
|
||||||
std::vector<double> voidage_conversion_coeffs;
|
|
||||||
computeWellVoidageRates(reservoir_state, well_state, well_voidage_rates, voidage_conversion_coeffs);
|
|
||||||
asImpl().wellModel().wellCollection()->applyVREPGroupControls(well_voidage_rates, voidage_conversion_coeffs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// When the well targets are just updated or need to be updated, we need at least one more iteration.
|
// When the well targets are just updated or need to be updated, we need at least one more iteration.
|
||||||
@@ -1103,12 +1100,7 @@ namespace detail {
|
|||||||
asImpl().wellModel().updateWellState(dx.array(), dpMaxRel(), well_state);
|
asImpl().wellModel().updateWellState(dx.array(), dpMaxRel(), well_state);
|
||||||
|
|
||||||
// Enforce the VREP control
|
// Enforce the VREP control
|
||||||
if (asImpl().wellModel().wellCollection()->havingVREPGroups()) {
|
applyVREPGroupControl(reservoir_state, well_state);
|
||||||
std::vector<double> well_voidage_rates;
|
|
||||||
std::vector<double> voidage_conversion_coeffs;
|
|
||||||
computeWellVoidageRates(reservoir_state, well_state, well_voidage_rates, voidage_conversion_coeffs);
|
|
||||||
asImpl().wellModel().wellCollection()->applyVREPGroupControls(well_voidage_rates, voidage_conversion_coeffs);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// We have to update the well controls regardless whether there are local
|
// We have to update the well controls regardless whether there are local
|
||||||
// wells active or not as parallel logging will take place that needs to
|
// wells active or not as parallel logging will take place that needs to
|
||||||
@@ -1529,12 +1521,8 @@ namespace detail {
|
|||||||
|
|
||||||
asImpl().wellModel().updateWellState(dwells, dpMaxRel(), well_state);
|
asImpl().wellModel().updateWellState(dwells, dpMaxRel(), well_state);
|
||||||
|
|
||||||
if (asImpl().wellModel().wellCollection()->havingVREPGroups()) {
|
// enforce VREP control when necessary.
|
||||||
std::vector<double> well_voidage_rates;
|
applyVREPGroupControl(reservoir_state, well_state);
|
||||||
std::vector<double> voidage_conversion_coeffs;
|
|
||||||
computeWellVoidageRates(reservoir_state, well_state, well_voidage_rates, voidage_conversion_coeffs);
|
|
||||||
asImpl().wellModel().wellCollection()->applyVREPGroupControls(well_voidage_rates, voidage_conversion_coeffs);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update phase conditions used for property calculations.
|
// Update phase conditions used for property calculations.
|
||||||
updatePhaseCondFromPrimalVariable(reservoir_state);
|
updatePhaseCondFromPrimalVariable(reservoir_state);
|
||||||
@@ -2677,6 +2665,24 @@ namespace detail {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
template <class Grid, class WellModel, class Implementation>
|
||||||
|
void
|
||||||
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
|
applyVREPGroupControl(const ReservoirState& reservoir_state,
|
||||||
|
const WellState& well_state)
|
||||||
|
{
|
||||||
|
if (asImpl().wellModel().wellCollection()->havingVREPGroups()) {
|
||||||
|
std::vector<double> well_voidage_rates;
|
||||||
|
std::vector<double> voidage_conversion_coeffs;
|
||||||
|
computeWellVoidageRates(reservoir_state, well_state, well_voidage_rates, voidage_conversion_coeffs);
|
||||||
|
asImpl().wellModel().wellCollection()->applyVREPGroupControls(well_voidage_rates, voidage_conversion_coeffs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Opm
|
} // namespace Opm
|
||||||
|
|
||||||
#endif // OPM_BLACKOILMODELBASE_IMPL_HEADER_INCLUDED
|
#endif // OPM_BLACKOILMODELBASE_IMPL_HEADER_INCLUDED
|
||||||
|
|||||||
Reference in New Issue
Block a user