Merge pull request #4715 from GitPaean/fixing_zero_scaling

avoid dividing by zero in updateWellStateRates()
This commit is contained in:
Bård Skaflestad 2023-06-21 09:46:23 +02:00 committed by GitHub
commit a4820d1e92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1181,6 +1181,7 @@ namespace Opm
// Set the currently-zero phase flows to be nonzero in proportion to well_q_s.
const double initial_nonzero_rate = ws.surface_rates[nonzero_rate_index];
const int comp_idx_nz = this->flowPhaseToEbosCompIdx(nonzero_rate_index);
if (std::abs(well_q_s[comp_idx_nz]) > floating_point_error_epsilon) {
for (int p = 0; p < this->number_of_phases_; ++p) {
if (p != nonzero_rate_index) {
const int comp_idx = this->flowPhaseToEbosCompIdx(p);
@ -1189,6 +1190,7 @@ namespace Opm
}
}
}
}
template<typename TypeTag>
typename WellInterface<TypeTag>::Eval
WellInterface<TypeTag>::getPerfCellPressure(const typename WellInterface<TypeTag>::FluidState& fs) const