Refactor: better isnan in assert, and reduce variable lifetime.

This commit is contained in:
Kristian Bendiksen 2024-03-15 12:56:43 +01:00 committed by Magne Sjaastad
parent e014bfd283
commit 515213694c
2 changed files with 5 additions and 9 deletions

View File

@ -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 )
@ -233,7 +232,6 @@ 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;
@ -241,11 +239,11 @@ void RigEclipseToStimPlanCellTransmissibilityCalculator::calculateStimPlanCellsM
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;

View File

@ -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;
}