mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2868 Completion Type : Compute completion type based on virtual connection factors
This commit is contained in:
parent
9e6e2e8735
commit
9bb8f36052
@ -20,6 +20,8 @@
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RigEclipseCaseData.h"
|
||||
|
||||
#include "Rim3dView.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseCaseCollection.h"
|
||||
@ -51,12 +53,10 @@ RiaCompletionTypeCalculationScheduler* RiaCompletionTypeCalculationScheduler::in
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaCompletionTypeCalculationScheduler::scheduleRecalculateCompletionTypeAndRedrawAllViews()
|
||||
{
|
||||
for (RimEclipseCase* eclipseCase : RiaApplication::instance()->project()->activeOilField()->analysisModels->cases())
|
||||
{
|
||||
m_eclipseCasesToRecalculate.push_back(eclipseCase);
|
||||
}
|
||||
std::vector<RimEclipseCase*> eclipseCases =
|
||||
RiaApplication::instance()->project()->activeOilField()->analysisModels->cases().childObjects();
|
||||
|
||||
startTimer();
|
||||
scheduleRecalculateCompletionTypeAndRedrawEclipseCases(eclipseCases);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -64,7 +64,29 @@ void RiaCompletionTypeCalculationScheduler::scheduleRecalculateCompletionTypeAnd
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaCompletionTypeCalculationScheduler::scheduleRecalculateCompletionTypeAndRedrawEclipseCase(RimEclipseCase* eclipseCase)
|
||||
{
|
||||
m_eclipseCasesToRecalculate.push_back(eclipseCase);
|
||||
std::vector<RimEclipseCase*> eclipseCases;
|
||||
eclipseCases.push_back(eclipseCase);
|
||||
|
||||
scheduleRecalculateCompletionTypeAndRedrawEclipseCases(eclipseCases);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaCompletionTypeCalculationScheduler::scheduleRecalculateCompletionTypeAndRedrawEclipseCases(
|
||||
const std::vector<RimEclipseCase*>& eclipseCases)
|
||||
{
|
||||
for (RimEclipseCase* eclipseCase : eclipseCases)
|
||||
{
|
||||
CVF_ASSERT(eclipseCase);
|
||||
|
||||
if (eclipseCase->eclipseCaseData())
|
||||
{
|
||||
eclipseCase->eclipseCaseData()->setVirtualPerforationTransmissibilities(nullptr);
|
||||
}
|
||||
|
||||
m_eclipseCasesToRecalculate.push_back(eclipseCase);
|
||||
}
|
||||
|
||||
startTimer();
|
||||
}
|
||||
@ -111,7 +133,7 @@ RiaCompletionTypeCalculationScheduler::~RiaCompletionTypeCalculationScheduler()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaCompletionTypeCalculationScheduler::startTimer()
|
||||
{
|
||||
|
@ -45,6 +45,8 @@ private:
|
||||
RiaCompletionTypeCalculationScheduler(const RiaCompletionTypeCalculationScheduler& o) = delete;
|
||||
void operator=(const RiaCompletionTypeCalculationScheduler& o) = delete;
|
||||
|
||||
void scheduleRecalculateCompletionTypeAndRedrawEclipseCases(const std::vector<RimEclipseCase*>& eclipseCases);
|
||||
|
||||
void startTimer();
|
||||
|
||||
private:
|
||||
|
@ -21,11 +21,13 @@
|
||||
#include "RiaDefines.h"
|
||||
|
||||
#include "RigCellGeometryTools.h"
|
||||
#include "RigCompletionData.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigFractureCell.h"
|
||||
#include "RigFractureGrid.h"
|
||||
#include "RigHexIntersectionTools.h"
|
||||
#include "RigMainGrid.h"
|
||||
#include "RigVirtualPerforationTransmissibilities.h"
|
||||
#include "RigWellPath.h"
|
||||
#include "RigWellPathIntersectionTools.h"
|
||||
|
||||
@ -49,6 +51,7 @@
|
||||
#include "RimWellPathFracture.h"
|
||||
#include "RimWellPathFractureCollection.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include <QDateTime>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -77,6 +80,93 @@ void RimCompletionCellIntersectionCalc::calculateCompletionTypeResult(const RimP
|
||||
// NOTE : Never compute completion type result for simulation well fractures, as these are defined per view
|
||||
}
|
||||
|
||||
std::vector<RiaDefines::CompletionType> fromCompletionData(const std::vector<RigCompletionData>& data)
|
||||
{
|
||||
std::vector<RiaDefines::CompletionType> appCompletionTypes;
|
||||
|
||||
for (const auto& d : data)
|
||||
{
|
||||
switch (d.completionType())
|
||||
{
|
||||
case RigCompletionData::FRACTURE:
|
||||
appCompletionTypes.push_back(RiaDefines::FRACTURE);
|
||||
break;
|
||||
case RigCompletionData::PERFORATION:
|
||||
appCompletionTypes.push_back(RiaDefines::PERFORATION_INTERVAL);
|
||||
break;
|
||||
case RigCompletionData::FISHBONES:
|
||||
appCompletionTypes.push_back(RiaDefines::FISHBONES);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return appCompletionTypes;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimCompletionCellIntersectionCalc::calculateCompletionTypeResult(RimEclipseCase* eclipseCase,
|
||||
std::vector<double>& completionTypeCellResult,
|
||||
size_t timeStep)
|
||||
{
|
||||
CVF_ASSERT(eclipseCase && eclipseCase->eclipseCaseData());
|
||||
|
||||
RimProject* project = nullptr;
|
||||
eclipseCase->firstAncestorOrThisOfTypeAsserted(project);
|
||||
|
||||
if (project->activeOilField()->wellPathCollection->isActive)
|
||||
{
|
||||
const RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData();
|
||||
|
||||
for (const RimWellPath* wellPath : project->activeOilField()->wellPathCollection->wellPaths)
|
||||
{
|
||||
if (wellPath->showWellPath() && wellPath->wellPathGeometry())
|
||||
{
|
||||
auto intersectedCells = RigWellPathIntersectionTools::findIntersectedGlobalCellIndices(
|
||||
eclipseCaseData, wellPath->wellPathGeometry()->m_wellPathPoints);
|
||||
|
||||
for (auto& intersection : intersectedCells)
|
||||
{
|
||||
completionTypeCellResult[intersection] = RiaDefines::WELL_PATH;
|
||||
}
|
||||
|
||||
auto conn = eclipseCase->computeAndGetVirtualPerforationTransmissibilities();
|
||||
if (conn)
|
||||
{
|
||||
for (const auto& connForWell : conn->multipleCompletionsPerEclipseCell(wellPath, timeStep))
|
||||
{
|
||||
RiaDefines::CompletionType appCompletionType = RiaDefines::WELL_PATH;
|
||||
|
||||
auto appCompletionTypes = fromCompletionData(connForWell.second);
|
||||
|
||||
if (std::find(appCompletionTypes.begin(), appCompletionTypes.end(), RiaDefines::FISHBONES) !=
|
||||
appCompletionTypes.end())
|
||||
{
|
||||
appCompletionType = RiaDefines::FISHBONES;
|
||||
}
|
||||
else if (std::find(appCompletionTypes.begin(), appCompletionTypes.end(), RiaDefines::FRACTURE) !=
|
||||
appCompletionTypes.end())
|
||||
{
|
||||
appCompletionType = RiaDefines::FRACTURE;
|
||||
}
|
||||
else if (std::find(appCompletionTypes.begin(),
|
||||
appCompletionTypes.end(),
|
||||
RiaDefines::PERFORATION_INTERVAL) != appCompletionTypes.end())
|
||||
{
|
||||
appCompletionType = RiaDefines::PERFORATION_INTERVAL;
|
||||
}
|
||||
|
||||
completionTypeCellResult[connForWell.first.globalCellIndex()] = appCompletionType;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -175,9 +265,9 @@ void RimCompletionCellIntersectionCalc::calculatePerforationIntersections(const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimCompletionCellIntersectionCalc::calculateFractureIntersections(const RigMainGrid* mainGrid,
|
||||
const RimWellPathFracture* fracture,
|
||||
std::vector<double>& values)
|
||||
void RimCompletionCellIntersectionCalc::calculateFractureIntersections(const RigMainGrid* mainGrid,
|
||||
const RimWellPathFracture* fracture,
|
||||
std::vector<double>& values)
|
||||
{
|
||||
if (!fracture->fractureTemplate()) return;
|
||||
if (!fracture->fractureTemplate()->fractureGrid()) return;
|
||||
|
@ -43,6 +43,10 @@ public:
|
||||
std::vector<double>& completionTypeCellResult,
|
||||
const QDateTime& fromDate);
|
||||
|
||||
static void calculateCompletionTypeResult(RimEclipseCase* eclipseCase,
|
||||
std::vector<double>& completionTypeCellResult,
|
||||
size_t timeStep);
|
||||
|
||||
private:
|
||||
static void calculateWellPathIntersections(const RimWellPath* wellPath,
|
||||
const RigEclipseCaseData* eclipseCaseData,
|
||||
|
@ -2254,12 +2254,7 @@ void RigCaseCellResultsData::computeCompletionTypeForTimeStep(size_t timeStep)
|
||||
|
||||
if (!eclipseCase) return;
|
||||
|
||||
RimProject* project;
|
||||
eclipseCase->firstAncestorOrThisOfTypeAsserted(project);
|
||||
|
||||
QDateTime timeStepDate = this->timeStepDates()[timeStep];
|
||||
|
||||
RimCompletionCellIntersectionCalc::calculateCompletionTypeResult(project, eclipseCase, completionTypeResult, timeStepDate);
|
||||
RimCompletionCellIntersectionCalc::calculateCompletionTypeResult(eclipseCase, completionTypeResult, timeStep);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user