adding setWellSolutions to StandardWellsDense.

the function will calculate the well_solutions_ based on well_state.
It will be used when we recover the well_state from a failed iteration,
then we should also update well_solutions_ for consistence.
This commit is contained in:
Kai Bao 2017-08-08 10:44:10 +02:00
parent 5af15fa63f
commit 5cb0a5109e
2 changed files with 18 additions and 3 deletions

View File

@ -225,6 +225,9 @@ namespace Opm {
void updateGroupControls(WellState& well_state) const;
/// setting the well_solutions_ based on well_state.
void setWellSolutions(const WellState& well_state) const;
protected:
bool wells_active_;
const Wells* wells_;

View File

@ -505,6 +505,7 @@ namespace Opm {
if (!converged) {
well_state = well_state0;
setWellSolutions(well_state);
// also recover the old well controls
// TODO: well_solutions_ for each well not recovered here.
for (int w = 0; w < nw; ++w) {
@ -759,9 +760,7 @@ namespace Opm {
// calculate the well potentials
// TODO: for the purpose of group control, not tested yet
for (const auto& well : well_container_) {
well->setWellSolutions(well_state);
}
setWellSolutions(well_state);
setWellVariables();
computeWellConnectionPressures(ebos_simulator, well_state);
@ -1042,4 +1041,17 @@ namespace Opm {
}
template<typename TypeTag>
void
StandardWellsDense<TypeTag>::
setWellSolutions(const WellState& well_state) const
{
for (const auto& well : well_container_) {
well->setWellSolutions(well_state);
}
}
} // namespace Opm