Skip to content

Commit

Permalink
Refactor: better isnan in assert, and reduce variable lifetime.
Browse files Browse the repository at this point in the history
  • Loading branch information
kriben authored and magnesj committed Mar 15, 2024
1 parent e014bfd commit 5152136
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ void RigEclipseToStimPlanCellTransmissibilityCalculator::calculateStimPlanCellsM
}

std::vector<std::vector<cvf::Vec3d>> polygonsForStimPlanCellInEclipseCell;
cvf::Vec3d areaVector;
std::vector<cvf::Vec3d> stimPlanPolygon = m_stimPlanCell.getPolygon();

for ( const std::vector<cvf::Vec3d>& planeCellPolygon : planeCellPolygons )
Expand All @@ -233,19 +232,18 @@ void RigEclipseToStimPlanCellTransmissibilityCalculator::calculateStimPlanCellsM
if ( polygonsForStimPlanCellInEclipseCell.empty() ) continue;

std::vector<double> areaOfFractureParts;
double length;
std::vector<double> lengthXareaOfFractureParts;
double Ax = 0.0;
double Ay = 0.0;
double Az = 0.0;

for ( const std::vector<cvf::Vec3d>& fracturePartPolygon : polygonsForStimPlanCellInEclipseCell )
{
areaVector = cvf::GeometryTools::polygonAreaNormal3D( fracturePartPolygon );
double area = areaVector.length();
cvf::Vec3d areaVector = cvf::GeometryTools::polygonAreaNormal3D( fracturePartPolygon );
double area = areaVector.length();
areaOfFractureParts.push_back( area );

length = RigCellGeometryTools::polygonLengthInLocalXdirWeightedByArea( fracturePartPolygon );
double length = RigCellGeometryTools::polygonLengthInLocalXdirWeightedByArea( fracturePartPolygon );
lengthXareaOfFractureParts.push_back( length * area );

cvf::Plane fracturePlane;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,15 @@ double RigFractureTransmissibilityEquations::matrixToFractureTrans( double perm,
double fractureAreaWeightedlength,
double cDarcy )
{
double transmissibility;

double slDivPi = 0.0;
if ( cvf::Math::abs( skinfactor ) > EPSILON )
{
slDivPi = ( skinfactor * fractureAreaWeightedlength ) / cvf::PI_D;
}

transmissibility = 8 * cDarcy * ( perm * NTG ) * A / ( cellSizeLength + slDivPi );
double transmissibility = 8 * cDarcy * ( perm * NTG ) * A / ( cellSizeLength + slDivPi );

CVF_ASSERT( transmissibility == transmissibility );
CVF_ASSERT( !std::isnan( transmissibility ) );
return transmissibility;
}

Expand Down

0 comments on commit 5152136

Please sign in to comment.