mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-08 23:23:01 -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 Sv_diff = 0.0;
|
||||||
double deltaHorizontalStress = poissonsRatio / ( 1.0 - poissonsRatio ) * ( Sv_diff - biot * pressureDiff ) +
|
double deltaHorizontalStress = poissonsRatio / ( 1.0 - poissonsRatio ) * ( Sv_diff - biot * pressureDiff ) +
|
||||||
( 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;
|
double depletionStress = Sh_init + deltaHorizontalStress;
|
||||||
stress.push_back( RiaEclipseUnitTools::barToPsi( depletionStress ) );
|
stress.push_back( RiaEclipseUnitTools::barToPsi( depletionStress ) );
|
||||||
|
Loading…
Reference in New Issue
Block a user