diff --git a/opm/simulators/wells/StandardWell.hpp b/opm/simulators/wells/StandardWell.hpp index 68a7dbccd..fbf414c91 100644 --- a/opm/simulators/wells/StandardWell.hpp +++ b/opm/simulators/wells/StandardWell.hpp @@ -359,7 +359,8 @@ namespace Opm DeferredLogger& deferred_logger) const; void updatePrimaryVariablesNewton(const BVectorWell& dwells, - const WellState& well_state) const; + const WellState& well_state, + DeferredLogger& deferred_logger) const; // update extra primary vriables if there are any void updateExtraPrimaryVariables(const BVectorWell& dwells) const; diff --git a/opm/simulators/wells/StandardWell_impl.hpp b/opm/simulators/wells/StandardWell_impl.hpp index da775db7b..02a85d8c9 100644 --- a/opm/simulators/wells/StandardWell_impl.hpp +++ b/opm/simulators/wells/StandardWell_impl.hpp @@ -854,7 +854,7 @@ namespace Opm { if (!this->isOperableAndSolvable() && !this->wellIsStopped()) return; - updatePrimaryVariablesNewton(dwells, well_state); + updatePrimaryVariablesNewton(dwells, well_state, deferred_logger); updateWellStateFromPrimaryVariables(well_state, deferred_logger); Base::calculateReservoirRates(well_state.well(this->index_of_well_)); @@ -868,7 +868,8 @@ namespace Opm void StandardWell:: updatePrimaryVariablesNewton(const BVectorWell& dwells, - const WellState& /* well_state */) const + const WellState& /* well_state */, + DeferredLogger& deferred_logger) const { const double dFLimit = this->param_.dwell_fraction_max_; const double dBHPLimit = this->param_.dbhp_max_rel_; @@ -876,11 +877,10 @@ namespace Opm updateExtraPrimaryVariables(dwells); -#ifndef NDEBUG for (double v : this->primary_variables_) { - assert(isfinite(v)); + if(!isfinite(v)) + OPM_DEFLOG_THROW(NumericalIssue, "Infinite primary variable after newton update well: " << this->name(), deferred_logger); } -#endif } @@ -1918,11 +1918,10 @@ namespace Opm } } } -#ifndef NDEBUG for (double v : this->primary_variables_) { - assert(isfinite(v)); + if(!isfinite(v)) + OPM_DEFLOG_THROW(NumericalIssue, "Infinite primary variable after update from wellState well: " << this->name(), deferred_logger); } -#endif }