Well Path Completion Type : Make sure all completions are visible

For MLT wells, make sure the previous defined completion types are not overwritten by laterals
This commit is contained in:
Magne Sjaastad 2021-05-27 10:56:47 +02:00
parent 73551b0ec8
commit 59c14b2a53

View File

@ -18,6 +18,7 @@
#include "RimCompletionCellIntersectionCalc.h" #include "RimCompletionCellIntersectionCalc.h"
#include "RiaApplication.h"
#include "RiaDefines.h" #include "RiaDefines.h"
#include "RigCompletionData.h" #include "RigCompletionData.h"
@ -68,60 +69,71 @@ void RimCompletionCellIntersectionCalc::calculateCompletionTypeResult( RimEclips
{ {
CVF_ASSERT( eclipseCase && eclipseCase->eclipseCaseData() ); CVF_ASSERT( eclipseCase && eclipseCase->eclipseCaseData() );
RimProject* project = nullptr; const RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData();
eclipseCase->firstAncestorOrThisOfTypeAsserted( project );
if ( project->activeOilField()->wellPathCollection->isActive ) std::vector<const RimWellPath*> visibleWells;
{ {
const RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData(); RimProject* project = RiaApplication::instance()->project();
if ( project->activeOilField()->wellPathCollection->isActive )
for ( const RimWellPath* wellPath : project->activeOilField()->wellPathCollection->allWellPaths() )
{ {
if ( wellPath->showWellPath() && wellPath->wellPathGeometry() ) for ( const RimWellPath* wellPath : project->activeOilField()->wellPathCollection->allWellPaths() )
{ {
auto intersectedCells = if ( wellPath->showWellPath() && wellPath->wellPathGeometry() )
RigWellPathIntersectionTools::findIntersectedGlobalCellIndices( eclipseCaseData,
wellPath->wellPathGeometry()
->wellPathPoints() );
for ( auto& intersection : intersectedCells )
{ {
completionTypeCellResult[intersection] = visibleWells.push_back( wellPath );
static_cast<int>( RiaDefines::WellPathComponentType::WELL_PATH ); }
}
}
}
// Set all intersected cells by well path cells to well path completion type. Override later with other completions
// types
for ( const RimWellPath* wellPath : visibleWells )
{
auto intersectedCells =
RigWellPathIntersectionTools::findIntersectedGlobalCellIndices( eclipseCaseData,
wellPath->wellPathGeometry()->wellPathPoints() );
for ( auto& intersection : intersectedCells )
{
completionTypeCellResult[intersection] = static_cast<int>( RiaDefines::WellPathComponentType::WELL_PATH );
}
}
auto completions = eclipseCase->computeAndGetVirtualPerforationTransmissibilities();
if ( completions )
{
for ( const RimWellPath* wellPath : visibleWells )
{
for ( const auto& [globalCellIndex, completionsForCell] :
completions->multipleCompletionsPerEclipseCell( wellPath, timeStep ) )
{
RiaDefines::WellPathComponentType appCompletionType = RiaDefines::WellPathComponentType::WELL_PATH;
auto appCompletionTypes = fromCompletionData( completionsForCell );
if ( std::find( appCompletionTypes.begin(),
appCompletionTypes.end(),
RiaDefines::WellPathComponentType::FRACTURE ) != appCompletionTypes.end() )
{
appCompletionType = RiaDefines::WellPathComponentType::FRACTURE;
}
else if ( std::find( appCompletionTypes.begin(),
appCompletionTypes.end(),
RiaDefines::WellPathComponentType::FISHBONES ) != appCompletionTypes.end() )
{
appCompletionType = RiaDefines::WellPathComponentType::FISHBONES;
}
else if ( std::find( appCompletionTypes.begin(),
appCompletionTypes.end(),
RiaDefines::WellPathComponentType::PERFORATION_INTERVAL ) != appCompletionTypes.end() )
{
appCompletionType = RiaDefines::WellPathComponentType::PERFORATION_INTERVAL;
} }
auto completions = eclipseCase->computeAndGetVirtualPerforationTransmissibilities(); if ( appCompletionType != RiaDefines::WellPathComponentType::WELL_PATH )
if ( completions )
{ {
for ( const auto& completionsForWell : completionTypeCellResult[globalCellIndex] = static_cast<int>( appCompletionType );
completions->multipleCompletionsPerEclipseCell( wellPath, timeStep ) )
{
RiaDefines::WellPathComponentType appCompletionType = RiaDefines::WellPathComponentType::WELL_PATH;
auto appCompletionTypes = fromCompletionData( completionsForWell.second );
if ( std::find( appCompletionTypes.begin(),
appCompletionTypes.end(),
RiaDefines::WellPathComponentType::FRACTURE ) != appCompletionTypes.end() )
{
appCompletionType = RiaDefines::WellPathComponentType::FRACTURE;
}
else if ( std::find( appCompletionTypes.begin(),
appCompletionTypes.end(),
RiaDefines::WellPathComponentType::FISHBONES ) != appCompletionTypes.end() )
{
appCompletionType = RiaDefines::WellPathComponentType::FISHBONES;
}
else if ( std::find( appCompletionTypes.begin(),
appCompletionTypes.end(),
RiaDefines::WellPathComponentType::PERFORATION_INTERVAL ) !=
appCompletionTypes.end() )
{
appCompletionType = RiaDefines::WellPathComponentType::PERFORATION_INTERVAL;
}
completionTypeCellResult[completionsForWell.first] = static_cast<int>( appCompletionType );
}
} }
} }
} }