StimPlan Model Calculator: guard against inf/nan in stress calculation.

This commit is contained in:
Kristian Bendiksen 2021-05-19 15:02:47 +02:00 committed by Magne Sjaastad
parent 3b383f1a57
commit f72890584f

View File

@ -436,6 +436,11 @@ bool RimStimPlanModelCalculator::calculateStressWithGradients( std::vector<doubl
double Sv_diff = 0.0;
double deltaHorizontalStress = poissonsRatio / ( 1.0 - poissonsRatio ) * ( Sv_diff - biot * pressureDiff ) +
( biot * pressureDiff );
if ( std::isnan( deltaHorizontalStress ) || std::isinf( deltaHorizontalStress ) )
{
RiaLogging::warning( "Invalid horizontal stress delta calculated. Setting to zero." );
deltaHorizontalStress = 0.0;
}
double depletionStress = Sh_init + deltaHorizontalStress;
stress.push_back( RiaEclipseUnitTools::barToPsi( depletionStress ) );