mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2371 Fracture : Guard for null pointer access
This commit is contained in:
@@ -145,8 +145,10 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
|
||||
|
||||
if (!fracTemplate) continue;
|
||||
|
||||
bool useFiniteConductivityInFracture = (fracTemplate->conductivityType() == RimFractureTemplate::FINITE_CONDUCTIVITY);
|
||||
const RigFractureGrid* fractureGrid = fracTemplate->fractureGrid();
|
||||
if (!fractureGrid) continue;
|
||||
|
||||
bool useFiniteConductivityInFracture = (fracTemplate->conductivityType() == RimFractureTemplate::FINITE_CONDUCTIVITY);
|
||||
|
||||
//If finite cond chosen and conductivity not present in stimplan file, do not calculate trans for this fracture
|
||||
if (useFiniteConductivityInFracture)
|
||||
@@ -278,21 +280,24 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
|
||||
|| fracture->fractureTemplate()->orientationType() == RimFractureTemplate::TRANSVERSE_WELL_PATH)
|
||||
{
|
||||
const RigFractureGrid* fracGrid = fracture->fractureTemplate()->fractureGrid();
|
||||
std::pair<size_t, size_t> wellCellIJ = fracGrid->fractureCellAtWellCenter();
|
||||
size_t wellCellIndex = fracGrid->getGlobalIndexFromIJ(wellCellIJ.first, wellCellIJ.second);
|
||||
if (fracGrid)
|
||||
{
|
||||
std::pair<size_t, size_t> wellCellIJ = fracGrid->fractureCellAtWellCenter();
|
||||
size_t wellCellIndex = fracGrid->getGlobalIndexFromIJ(wellCellIJ.first, wellCellIJ.second);
|
||||
|
||||
const RigFractureCell& wellCell = fractureGrid->cellFromIndex(wellCellIndex);
|
||||
const RigFractureCell& wellCell = fractureGrid->cellFromIndex(wellCellIndex);
|
||||
|
||||
double radialTrans = RigFractureTransmissibilityEquations::fractureCellToWellRadialTrans(wellCell.getConductivtyValue(),
|
||||
wellCell.cellSizeX(),
|
||||
wellCell.cellSizeZ(),
|
||||
fracture->wellRadius(caseToApply->eclipseCaseData()->unitsType()),
|
||||
fracTemplate->skinFactor(),
|
||||
cDarcyInCorrectUnit);
|
||||
double radialTrans = RigFractureTransmissibilityEquations::fractureCellToWellRadialTrans(wellCell.getConductivtyValue(),
|
||||
wellCell.cellSizeX(),
|
||||
wellCell.cellSizeZ(),
|
||||
fracture->wellRadius(caseToApply->eclipseCaseData()->unitsType()),
|
||||
fracTemplate->skinFactor(),
|
||||
cDarcyInCorrectUnit);
|
||||
|
||||
transCondenser.addNeighborTransmissibility({ true, RigTransmissibilityCondenser::CellAddress::WELL, 1 },
|
||||
{ false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, wellCellIndex },
|
||||
radialTrans);
|
||||
transCondenser.addNeighborTransmissibility({ true, RigTransmissibilityCondenser::CellAddress::WELL, 1 },
|
||||
{ false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, wellCellIndex },
|
||||
radialTrans);
|
||||
}
|
||||
}
|
||||
else if (fracture->fractureTemplate()->orientationType() == RimFractureTemplate::ALONG_WELL_PATH)
|
||||
{
|
||||
|
||||
@@ -270,6 +270,8 @@ cvf::ref<cvf::Part> RivWellFracturePartMgr::createStimPlanElementColorSurfacePar
|
||||
RimStimPlanFractureTemplate* stimPlanFracTemplate = dynamic_cast<RimStimPlanFractureTemplate*>(m_rimFracture->fractureTemplate());
|
||||
CVF_ASSERT(stimPlanFracTemplate);
|
||||
|
||||
if (!stimPlanFracTemplate->fractureGrid()) return nullptr;
|
||||
|
||||
auto displayCoordTransform = activeView.displayCoordTransform();
|
||||
if (displayCoordTransform.isNull()) return nullptr;
|
||||
|
||||
@@ -543,6 +545,7 @@ cvf::ref<cvf::DrawableGeo> RivWellFracturePartMgr::createStimPlanMeshDrawable(Ri
|
||||
//Should probably be moved, since it now is called twice in some cases...
|
||||
stimPlanFracTemplate->updateFractureGrid();
|
||||
|
||||
if (!stimPlanFracTemplate->fractureGrid()) return nullptr;
|
||||
|
||||
auto displayCoordTransform = activeView.displayCoordTransform();
|
||||
if (displayCoordTransform.isNull()) return nullptr;
|
||||
|
||||
@@ -182,6 +182,7 @@ void RimCompletionCellIntersectionCalc::calculatePerforationIntersections(const
|
||||
void RimCompletionCellIntersectionCalc::calculateFractureIntersections(const RigMainGrid* mainGrid, const RimFracture* fracture, std::vector<double>& values)
|
||||
{
|
||||
if (!fracture->fractureTemplate()) return;
|
||||
if (!fracture->fractureTemplate()->fractureGrid()) return;
|
||||
|
||||
for (const RigFractureCell& fractureCell : fracture->fractureTemplate()->fractureGrid()->fractureCells())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user