Make StandardWellsDense support cases with no wells.

In that case `wells_manager.c_wells()` returns a null pointer
which made `updateListEconLimited` segfault. With this commit
we treat a null wells_struct as having zero wells.

With this this and #1001 opm-data/equilibrium at least runs
through in parallel. Results will be checked next.
This commit is contained in:
Markus Blatt
2017-01-09 11:34:08 +01:00
parent 86b71e7d48
commit 5bcdb01f5a

View File

@@ -1360,7 +1360,8 @@ enum WellVariablePositions {
const WellState& well_state, const WellState& well_state,
DynamicListEconLimited& list_econ_limited) const DynamicListEconLimited& list_econ_limited) const
{ {
const int nw = wells_struct->number_of_wells; // With no wells (on process) wells_struct is a null pointer
const int nw = (wells_struct)? wells_struct->number_of_wells : 0;
for (int w = 0; w < nw; ++w) { for (int w = 0; w < nw; ++w) {
// flag to check if the mim oil/gas rate limit is violated // flag to check if the mim oil/gas rate limit is violated