#13295 Always use grid local IJ for WELSPECS/WELSPECL

This commit is contained in:
Magne Sjaastad committed 2025-12-08 15:22:00 +01:00
1 parent 2429778f25
commit 4f53c2692e
2 files changed
+20 -44

No files matched your search

@@ -774,33 +774,18 @@ void RicWellPathExportCompletionDataFeatureImpl::exportWelspeclToFile( RimEclips
for ( const auto& completion : completionsForLgr.second )
{
const auto wellPath = RicWellPathExportCompletionsFileTools::findWellPathFromExportName( completion.wellName() );
if ( !wellPath ) continue;
wellPathToLgrNameMap[wellPath].insert( completionsForLgr.first );
}
}
for ( const auto& wellPathsForLgr : wellPathToLgrNameMap )
// See similar logic in RiaGrpcWellPathService::GetCompletionData()
for ( const auto& [wellPath, gridNames] : wellPathToLgrNameMap )
{
const RimWellPath* wellPath = wellPathsForLgr.first;
std::tuple<double, cvf::Vec2i, QString> itemWithLowestMD = std::make_tuple( std::numeric_limits<double>::max(), cvf::Vec2i(), "" );
// Find first LGR-intersection along the well path
for ( const auto& lgrName : wellPathsForLgr.second )
for ( const auto& lgrName : gridNames )
{
auto ijIntersection = wellPathUpperGridIntersectionIJ( gridCase, wellPath, lgrName );
if ( ijIntersection.first < std::get<0>( itemWithLowestMD ) )
{
itemWithLowestMD = std::make_tuple( ijIntersection.first, ijIntersection.second, lgrName );
}
}
{
double measuredDepth = 0.0;
cvf::Vec2i ijIntersection;
QString lgrName;
std::tie( measuredDepth, ijIntersection, lgrName ) = itemWithLowestMD;
const auto& [measuredDepth, ijIntersection] = wellPathUpperGridIntersectionIJ( gridCase, wellPath, lgrName );
auto completionSettings = wellPath->completionSettings();
+14 -23
View File
@@ -45,7 +45,7 @@ namespace internal
//--------------------------------------------------------------------------------------------------
void populateReply( RimEclipseCase* eclipseCase, RimWellPath* wellPath, ::rips::SimulatorTableData* reply )
{
std::set<QString> gridNames;
std::set<QString> gridNamesWithCompletions;
auto compdata = RicWellPathExportCompletionDataFeatureImpl::completionDataForWellPath( wellPath, eclipseCase );
for ( const auto& cd : compdata )
{
@@ -53,7 +53,7 @@ void populateReply( RimEclipseCase* eclipseCase, RimWellPath* wellPath, ::rips::
RiaWellPathDataToGrpcConverter::copyCompdatToGrpc( cd, grpcData );
auto completionCell = cd.completionDataGridCell();
gridNames.insert( completionCell.lgrName() );
gridNamesWithCompletions.insert( completionCell.lgrName() );
const auto wpimult = cd.wpimult();
if ( wpimult != 0.0 && !RigCompletionData::isDefaultValue( wpimult ) )
@@ -71,31 +71,22 @@ void populateReply( RimEclipseCase* eclipseCase, RimWellPath* wellPath, ::rips::
}
// See RicWellPathExportCompletionDataFeatureImpl::exportWelspeclToFile
// Find the grid with the uppermost intersection along the well path
std::tuple<double, cvf::Vec2i, QString> itemWithLowestMD =
std::make_tuple( std::numeric_limits<double>::max(), cvf::Vec2i(), "" );
for ( const auto& gridName : gridNames )
for ( const auto& gridName : gridNamesWithCompletions )
{
auto candidate =
auto upperGridIntersection =
RicWellPathExportCompletionDataFeatureImpl::wellPathUpperGridIntersectionIJ( eclipseCase, wellPath, gridName );
if ( candidate.first < std::get<0>( itemWithLowestMD ) )
{
itemWithLowestMD = std::make_tuple( candidate.first, candidate.second, gridName );
}
auto compSettings = wellPath->completionSettings();
cvf::Vec2i ijIntersection = std::get<1>( upperGridIntersection );
SimulatorWelspecsEntry* grpcData = reply->add_welspecs();
RiaWellPathDataToGrpcConverter::copyWelspecsToGrpc( compSettings,
grpcData,
ijIntersection.x(),
ijIntersection.y(),
gridName.toStdString() );
}
auto compSettings = wellPath->completionSettings();
cvf::Vec2i ijIntersection = std::get<1>( itemWithLowestMD );
QString lgrName = std::get<2>( itemWithLowestMD );
SimulatorWelspecsEntry* grpcData = reply->add_welspecs();
RiaWellPathDataToGrpcConverter::copyWelspecsToGrpc( compSettings,
grpcData,
ijIntersection.x(),
ijIntersection.y(),
lgrName.toStdString() );
// Multisegment wells
int timeStep = 0;