mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
WIP in testing new group update strtegy.
results with min_iter=2 works okay, while not min_iter=1. It means the iteration stop at the wrong situation.
This commit is contained in:
parent
753da2dd36
commit
002439c5b1
@ -321,7 +321,7 @@ namespace Opm {
|
|||||||
|
|
||||||
|
|
||||||
void applyVREPGroupControl(const ReservoirState& reservoir_state,
|
void applyVREPGroupControl(const ReservoirState& reservoir_state,
|
||||||
const WellState& well_state);
|
WellState& well_state);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -793,6 +793,8 @@ namespace detail {
|
|||||||
// enforce VREP control when necessary.
|
// enforce VREP control when necessary.
|
||||||
applyVREPGroupControl(reservoir_state, well_state);
|
applyVREPGroupControl(reservoir_state, well_state);
|
||||||
|
|
||||||
|
asImpl().wellModel().wellCollection()->updateWellTargets(well_state.wellRates());
|
||||||
|
|
||||||
// Create the primary variables.
|
// Create the primary variables.
|
||||||
SolutionState state = asImpl().variableState(reservoir_state, well_state);
|
SolutionState state = asImpl().variableState(reservoir_state, well_state);
|
||||||
|
|
||||||
@ -1069,20 +1071,7 @@ namespace detail {
|
|||||||
asImpl().wellModel().addWellControlEq(wellSolutionState, well_state, aliveWells, residual_);
|
asImpl().wellModel().addWellControlEq(wellSolutionState, well_state, aliveWells, residual_);
|
||||||
converged = getWellConvergence(it);
|
converged = getWellConvergence(it);
|
||||||
|
|
||||||
// Enforce the VREP control
|
|
||||||
if (it == 0) {
|
|
||||||
applyVREPGroupControl(reservoir_state, well_state);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 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.
|
||||||
if (asImpl().wellModel().wellCollection()->justUpdateWellTargets()) {
|
|
||||||
converged = false;
|
|
||||||
asImpl().wellModel().wellCollection()->setJustUpdateWellTargets(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (converged && asImpl().wellModel().wellCollection()->needUpdateWellTargets()) {
|
|
||||||
converged = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (converged) {
|
if (converged) {
|
||||||
break;
|
break;
|
||||||
@ -1112,6 +1101,7 @@ namespace detail {
|
|||||||
asImpl().wellModel().updateWellControls(well_state);
|
asImpl().wellModel().updateWellControls(well_state);
|
||||||
// Enforce the VREP control
|
// Enforce the VREP control
|
||||||
applyVREPGroupControl(reservoir_state, well_state);
|
applyVREPGroupControl(reservoir_state, well_state);
|
||||||
|
asImpl().wellModel().wellCollection()->updateWellTargets(well_state.wellRates());
|
||||||
} while (it < 15);
|
} while (it < 15);
|
||||||
|
|
||||||
if (converged) {
|
if (converged) {
|
||||||
@ -2678,13 +2668,23 @@ namespace detail {
|
|||||||
void
|
void
|
||||||
BlackoilModelBase<Grid, WellModel, Implementation>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
applyVREPGroupControl(const ReservoirState& reservoir_state,
|
applyVREPGroupControl(const ReservoirState& reservoir_state,
|
||||||
const WellState& well_state)
|
WellState& well_state)
|
||||||
{
|
{
|
||||||
if (asImpl().wellModel().wellCollection()->havingVREPGroups()) {
|
if (asImpl().wellModel().wellCollection()->havingVREPGroups()) {
|
||||||
std::vector<double> well_voidage_rates;
|
std::vector<double> well_voidage_rates;
|
||||||
std::vector<double> voidage_conversion_coeffs;
|
std::vector<double> voidage_conversion_coeffs;
|
||||||
computeWellVoidageRates(reservoir_state, well_state, well_voidage_rates, voidage_conversion_coeffs);
|
computeWellVoidageRates(reservoir_state, well_state, well_voidage_rates, voidage_conversion_coeffs);
|
||||||
asImpl().wellModel().wellCollection()->applyVREPGroupControls(well_voidage_rates, voidage_conversion_coeffs);
|
asImpl().wellModel().wellCollection()->applyVREPGroupControls(well_voidage_rates, voidage_conversion_coeffs);
|
||||||
|
|
||||||
|
// for the wells under group control, update the currentControls for the well_state
|
||||||
|
const size_t number_node = asImpl().wellModel().wellCollection()->numNode();
|
||||||
|
for (size_t w = 0; w < number_node; ++w) {
|
||||||
|
const WellNode* well_node = asImpl().wellModel().wellCollection()->getNode(w);
|
||||||
|
if (well_node->isInjector() && !well_node->individualControl()) {
|
||||||
|
const int well_index = well_node->selfIndex();
|
||||||
|
well_state.currentControls()[well_index] = well_node->groupControlIndex();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -716,13 +716,13 @@ namespace Opm
|
|||||||
|
|
||||||
// if we need to update the well targets related to group control,
|
// if we need to update the well targets related to group control,
|
||||||
// we update them then re-run the simulation before updating the well control
|
// we update them then re-run the simulation before updating the well control
|
||||||
if (well_collection_->needUpdateWellTargets() ) {
|
/* if (well_collection_->needUpdateWellTargets() ) {
|
||||||
well_collection_->updateWellTargets(xw.wellRates());
|
well_collection_->updateWellTargets(xw.wellRates());
|
||||||
for (size_t i = 0; i < well_collection_->numNode(); ++i) {
|
for (size_t i = 0; i < well_collection_->numNode(); ++i) {
|
||||||
well_collection_->getNode(i)->setShouldUpdateWellTargets(false);
|
well_collection_->getNode(i)->setShouldUpdateWellTargets(false);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
} */
|
||||||
|
|
||||||
// Find, for each well, if any constraints are broken. If so,
|
// Find, for each well, if any constraints are broken. If so,
|
||||||
// switch control to first broken constraint.
|
// switch control to first broken constraint.
|
||||||
|
Loading…
Reference in New Issue
Block a user