mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-26 19:46:24 -06:00
add checkFinite to StandardWellPrimaryVariables
This commit is contained in:
parent
999d4c6be9
commit
4bbcdf0646
@ -689,6 +689,16 @@ relaxationFactorFractionsProducer(const BVectorWell& dwells) const
|
||||
return relaxation_factor;
|
||||
}
|
||||
|
||||
template<class FluidSystem, class Indices, class Scalar>
|
||||
void StandardWellPrimaryVariables<FluidSystem,Indices,Scalar>::
|
||||
checkFinite(DeferredLogger& deferred_logger) const
|
||||
{
|
||||
for (const Scalar v : value_) {
|
||||
if (!isfinite(v))
|
||||
OPM_DEFLOG_THROW(NumericalIssue, "Infinite primary variable after update from wellState well: " << well_.name(), deferred_logger);
|
||||
}
|
||||
}
|
||||
|
||||
#define INSTANCE(...) \
|
||||
template class StandardWellPrimaryVariables<BlackOilFluidSystem<double,BlackOilDefaultIndexTraits>,__VA_ARGS__,double>;
|
||||
|
||||
|
@ -122,6 +122,9 @@ public:
|
||||
//! \brief Update polymer molecular weight values from newton update vector.
|
||||
void updateNewtonPolyMW(const BVectorWell& dwells);
|
||||
|
||||
//! \brief Check that all values are finite.
|
||||
void checkFinite(DeferredLogger& deferred_logger) const;
|
||||
|
||||
//! \brief Copy values to well state.
|
||||
void copyToWellState(WellState& well_state, DeferredLogger& deferred_logger) const;
|
||||
|
||||
|
@ -961,11 +961,7 @@ namespace Opm
|
||||
|
||||
updateExtraPrimaryVariables(dwells);
|
||||
|
||||
for (double v : this->primary_variables_.value_) {
|
||||
if(!isfinite(v))
|
||||
OPM_DEFLOG_THROW(NumericalIssue, "Infinite primary variable after newton update well: " << this->name(), deferred_logger);
|
||||
}
|
||||
|
||||
this->primary_variables_.checkFinite(deferred_logger);
|
||||
}
|
||||
|
||||
|
||||
@ -2038,10 +2034,8 @@ namespace Opm
|
||||
if constexpr (Base::has_polymermw) {
|
||||
this->primary_variables_.updatePolyMW(well_state);
|
||||
}
|
||||
for (double v : this->primary_variables_.value_) {
|
||||
if(!isfinite(v))
|
||||
OPM_DEFLOG_THROW(NumericalIssue, "Infinite primary variable after update from wellState well: " << this->name(), deferred_logger);
|
||||
}
|
||||
|
||||
this->primary_variables_.checkFinite(deferred_logger);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user