Merge pull request #3887 from totto82/init_alt_eps

use alternative init for wells with all rates less than eps
This commit is contained in:
Tor Harald Sandve 2022-04-26 10:46:19 +02:00 committed by GitHub
commit 4b5a53eaeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1056,8 +1056,9 @@ namespace Opm
// if more than one nonzero rate.
auto& ws = well_state.well(this->index_of_well_);
int nonzero_rate_index = -1;
const double floating_point_error_epsilon = 1e-14;
for (int p = 0; p < this->number_of_phases_; ++p) {
if (ws.surface_rates[p] != 0.0) {
if (std::abs(ws.surface_rates[p]) > floating_point_error_epsilon) {
if (nonzero_rate_index == -1) {
nonzero_rate_index = p;
} else {