mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-07 06:33:05 -06:00
StimPlan Model Calculator: guard against inf/nan in stress calculation.
This commit is contained in:
parent
3b383f1a57
commit
f72890584f
@ -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 ) );
|
||||
|
Loading…
Reference in New Issue
Block a user