mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-11-29 20:43:49 -06:00
Merge pull request #3514 from totto82/fixEmptyRegion
Handle empty region in average calculator
This commit is contained in:
commit
ea392b58ce
@ -185,10 +185,11 @@ namespace Opm {
|
||||
// using the pore volume to do the averaging
|
||||
const auto& attri_pv = attributes_pv[reg];
|
||||
const double pv_sum = comm.sum(attri_pv.pv);
|
||||
assert(pv_sum > 0.);
|
||||
const double p_pv_sum = comm.sum(attri_pv.pressure);
|
||||
ra.pressure = p_pv_sum / pv_sum;
|
||||
|
||||
// pore volums can be zero if a fipnum region is empty
|
||||
if (pv_sum > 0) {
|
||||
const double p_pv_sum = comm.sum(attri_pv.pressure);
|
||||
ra.pressure = p_pv_sum / pv_sum;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user