Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions opm/simulators/wells/StandardWellPrimaryVariables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -750,13 +750,16 @@ relaxationFactorFractionsProducer(const BVectorWell& dwells,

template<class FluidSystem, class Indices>
void StandardWellPrimaryVariables<FluidSystem,Indices>::
checkFinite(DeferredLogger& deferred_logger) const
checkFinite(DeferredLogger& deferred_logger, std::string_view context) const
{
for (const Scalar v : value_) {
if (!isfinite(v))
if (!isfinite(v)) {
const std::string msg =
fmt::format("Non-finite primary variable for well {} after {}", well_.name(), context);
OPM_DEFLOG_PROBLEM(NumericalProblem,
"Infinite primary variable after update from wellState, well: " + well_.name(),
msg,
deferred_logger);
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion opm/simulators/wells/StandardWellPrimaryVariables.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#include <opm/simulators/wells/StandardWellEquations.hpp>

#include <string_view>
#include <vector>

namespace Opm
Expand Down Expand Up @@ -118,7 +119,7 @@ class StandardWellPrimaryVariables {
void updateNewtonPolyMW(const BVectorWell& dwells);

//! \brief Check that all values are finite.
void checkFinite(DeferredLogger& deferred_logger) const;
void checkFinite(DeferredLogger& deferred_logger, std::string_view context) const;

//! \brief Copy values to well state.
void copyToWellState(WellState<Scalar, IndexTraits>& well_state,
Expand Down
4 changes: 2 additions & 2 deletions opm/simulators/wells/StandardWell_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ namespace Opm
this->primary_variables_.updateNewtonPolyMW(dwells);
}

this->primary_variables_.checkFinite(deferred_logger);
this->primary_variables_.checkFinite(deferred_logger, "Newton update");
}


Expand Down Expand Up @@ -1871,7 +1871,7 @@ namespace Opm
this->primary_variables_.updatePolyMW(well_state);
}

this->primary_variables_.checkFinite(deferred_logger);
this->primary_variables_.checkFinite(deferred_logger, "updating from well state");
}


Expand Down