mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fix crashes when exporting completions from input grid
This commit is contained in:
parent
c291f22d4d
commit
647bf0cf46
@ -1164,12 +1164,16 @@ std::vector<RigCompletionData> RicWellPathExportCompletionDataFeatureImpl::gener
|
|||||||
const RigActiveCellInfo* activeCellInfo =
|
const RigActiveCellInfo* activeCellInfo =
|
||||||
settings.caseToApply->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL );
|
settings.caseToApply->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL );
|
||||||
|
|
||||||
|
auto timeSteps = settings.caseToApply->timeStepDates();
|
||||||
|
|
||||||
if ( wellPath->perforationIntervalCollection()->isChecked() )
|
if ( wellPath->perforationIntervalCollection()->isChecked() )
|
||||||
{
|
{
|
||||||
for ( const RimPerforationInterval* interval : intervals )
|
for ( const RimPerforationInterval* interval : intervals )
|
||||||
{
|
{
|
||||||
if ( !interval->isChecked() ) continue;
|
if ( !interval->isChecked() ) continue;
|
||||||
if ( !interval->isActiveOnDate( settings.caseToApply->timeStepDates()[settings.timeStep] ) ) continue;
|
if ( (size_t)settings.timeStep < timeSteps.size() &&
|
||||||
|
!interval->isActiveOnDate( settings.caseToApply->timeStepDates()[settings.timeStep] ) )
|
||||||
|
continue;
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
pair<vector<cvf::Vec3d>, vector<double>> perforationPointsAndMD =
|
pair<vector<cvf::Vec3d>, vector<double>> perforationPointsAndMD =
|
||||||
|
@ -807,7 +807,8 @@ double RicWellPathExportMswCompletionsImpl::calculateLengthThroughActiveCells(
|
|||||||
double totalOverlap = 0.0;
|
double totalOverlap = 0.0;
|
||||||
for ( const WellPathCellIntersectionInfo& intersection : wellPathIntersections )
|
for ( const WellPathCellIntersectionInfo& intersection : wellPathIntersections )
|
||||||
{
|
{
|
||||||
if ( activeCellInfo->isActive( intersection.globCellIndex ) )
|
if ( intersection.globCellIndex < activeCellInfo->reservoirCellCount() &&
|
||||||
|
activeCellInfo->isActive( intersection.globCellIndex ) )
|
||||||
{
|
{
|
||||||
double overlapStart = std::max( startMD, intersection.startMD );
|
double overlapStart = std::max( startMD, intersection.startMD );
|
||||||
double overlapEnd = std::min( endMD, intersection.endMD );
|
double overlapEnd = std::min( endMD, intersection.endMD );
|
||||||
@ -1993,8 +1994,10 @@ std::vector<RigCompletionData>
|
|||||||
const RigActiveCellInfo* activeCellInfo =
|
const RigActiveCellInfo* activeCellInfo =
|
||||||
eclipseCase->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL );
|
eclipseCase->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL );
|
||||||
|
|
||||||
if ( wellPath->perforationIntervalCollection()->isChecked() && perforationInterval->isChecked() &&
|
bool hasDate = (size_t)timeStep < eclipseCase->timeStepDates().size();
|
||||||
perforationInterval->isActiveOnDate( eclipseCase->timeStepDates()[timeStep] ) )
|
bool isActive = !hasDate || perforationInterval->isActiveOnDate( eclipseCase->timeStepDates()[timeStep] );
|
||||||
|
|
||||||
|
if ( wellPath->perforationIntervalCollection()->isChecked() && perforationInterval->isChecked() && isActive )
|
||||||
{
|
{
|
||||||
std::pair<std::vector<cvf::Vec3d>, std::vector<double>> perforationPointsAndMD =
|
std::pair<std::vector<cvf::Vec3d>, std::vector<double>> perforationPointsAndMD =
|
||||||
wellPath->wellPathGeometry()->clippedPointSubset( perforationInterval->startMD(),
|
wellPath->wellPathGeometry()->clippedPointSubset( perforationInterval->startMD(),
|
||||||
|
Loading…
Reference in New Issue
Block a user