mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2425 Export Completions : Separated feature UI from app logic
This commit is contained in:
@@ -127,5 +127,5 @@ void RicfExportSimWellCompletions::execute()
|
|||||||
|
|
||||||
std::vector<RimWellPath*> wellPaths;
|
std::vector<RimWellPath*> wellPaths;
|
||||||
|
|
||||||
RicWellPathExportCompletionDataFeature::exportCompletions(wellPaths, simWells, *exportSettings);
|
RicWellPathExportCompletionDataFeatureImpl::exportCompletions(wellPaths, simWells, *exportSettings);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,5 +116,5 @@ void RicfExportWellPathCompletions::execute()
|
|||||||
|
|
||||||
std::vector<RimSimWellInView*> simWells;
|
std::vector<RimSimWellInView*> simWells;
|
||||||
|
|
||||||
RicWellPathExportCompletionDataFeature::exportCompletions(wellPaths, simWells, *exportSettings);
|
RicWellPathExportCompletionDataFeatureImpl::exportCompletions(wellPaths, simWells, *exportSettings);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ void RicExportFishbonesWellSegmentsFeature::exportWellSegments(const RimWellPath
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<WellSegmentLocation> locations = RicWellPathExportCompletionDataFeature::findWellSegmentLocations(settings.caseToApply, wellPath, fishbonesSubs);
|
std::vector<WellSegmentLocation> locations = RicWellPathExportCompletionDataFeatureImpl::findWellSegmentLocations(settings.caseToApply, wellPath, fishbonesSubs);
|
||||||
|
|
||||||
QTextStream stream(&exportFile);
|
QTextStream stream(&exportFile);
|
||||||
RifEclipseDataTableFormatter formatter(stream);
|
RifEclipseDataTableFormatter formatter(stream);
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ void RicFishbonesTransmissibilityCalculationFeatureImp::findFishboneLateralsWell
|
|||||||
{
|
{
|
||||||
// Generate data
|
// Generate data
|
||||||
const RigEclipseCaseData* caseData = settings.caseToApply()->eclipseCaseData();
|
const RigEclipseCaseData* caseData = settings.caseToApply()->eclipseCaseData();
|
||||||
std::vector<WellSegmentLocation> locations = RicWellPathExportCompletionDataFeature::findWellSegmentLocations(settings.caseToApply, wellPath);
|
std::vector<WellSegmentLocation> locations = RicWellPathExportCompletionDataFeatureImpl::findWellSegmentLocations(settings.caseToApply, wellPath);
|
||||||
|
|
||||||
RiaEclipseUnitTools::UnitSystem unitSystem = caseData->unitsType();
|
RiaEclipseUnitTools::UnitSystem unitSystem = caseData->unitsType();
|
||||||
bool isMainBore = false;
|
bool isMainBore = false;
|
||||||
@@ -126,7 +126,7 @@ std::vector<RigCompletionData> RicFishbonesTransmissibilityCalculationFeatureImp
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mainBoreDirection = RicWellPathExportCompletionDataFeature::calculateDirectionInCell(settings.caseToApply,
|
mainBoreDirection = RicWellPathExportCompletionDataFeatureImpl::calculateDirectionInCell(settings.caseToApply,
|
||||||
globalCellIndex,
|
globalCellIndex,
|
||||||
wellBorePart.lengthsInCell);
|
wellBorePart.lengthsInCell);
|
||||||
}
|
}
|
||||||
@@ -140,7 +140,7 @@ std::vector<RigCompletionData> RicFishbonesTransmissibilityCalculationFeatureImp
|
|||||||
if (wellBorePart.isMainBore)
|
if (wellBorePart.isMainBore)
|
||||||
{
|
{
|
||||||
//No change in transmissibility for main bore
|
//No change in transmissibility for main bore
|
||||||
transmissibility = RicWellPathExportCompletionDataFeature::calculateTransmissibility(settings.caseToApply,
|
transmissibility = RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibility(settings.caseToApply,
|
||||||
wellPath,
|
wellPath,
|
||||||
wellBorePart.lengthsInCell,
|
wellBorePart.lengthsInCell,
|
||||||
wellBorePart.skinFactor,
|
wellBorePart.skinFactor,
|
||||||
@@ -152,7 +152,7 @@ std::vector<RigCompletionData> RicFishbonesTransmissibilityCalculationFeatureImp
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
//Adjust transmissibility for fishbone laterals
|
//Adjust transmissibility for fishbone laterals
|
||||||
transmissibility = RicWellPathExportCompletionDataFeature::calculateTransmissibility(settings.caseToApply,
|
transmissibility = RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibility(settings.caseToApply,
|
||||||
wellPath,
|
wellPath,
|
||||||
wellBorePart.lengthsInCell,
|
wellBorePart.lengthsInCell,
|
||||||
wellBorePart.skinFactor,
|
wellBorePart.skinFactor,
|
||||||
@@ -164,7 +164,7 @@ std::vector<RigCompletionData> RicFishbonesTransmissibilityCalculationFeatureImp
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CellDirection direction = RicWellPathExportCompletionDataFeature::calculateDirectionInCell(settings.caseToApply,
|
CellDirection direction = RicWellPathExportCompletionDataFeatureImpl::calculateDirectionInCell(settings.caseToApply,
|
||||||
globalCellIndex,
|
globalCellIndex,
|
||||||
wellBorePart.lengthsInCell);
|
wellBorePart.lengthsInCell);
|
||||||
|
|
||||||
@@ -190,7 +190,7 @@ void RicFishbonesTransmissibilityCalculationFeatureImp::findFishboneImportedLate
|
|||||||
const RicExportCompletionDataSettingsUi& settings)
|
const RicExportCompletionDataSettingsUi& settings)
|
||||||
{
|
{
|
||||||
RiaEclipseUnitTools::UnitSystem unitSystem = settings.caseToApply->eclipseCaseData()->unitsType();
|
RiaEclipseUnitTools::UnitSystem unitSystem = settings.caseToApply->eclipseCaseData()->unitsType();
|
||||||
std::set<size_t> wellPathCells = RicWellPathExportCompletionDataFeature::findIntersectedCells(settings.caseToApply()->eclipseCaseData(),
|
std::set<size_t> wellPathCells = RicWellPathExportCompletionDataFeatureImpl::findIntersectedCells(settings.caseToApply()->eclipseCaseData(),
|
||||||
wellPath->wellPathGeometry()->m_wellPathPoints);
|
wellPath->wellPathGeometry()->m_wellPathPoints);
|
||||||
bool isMainBore = false;
|
bool isMainBore = false;
|
||||||
|
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ void RicWellPathExportCompletionDataFeature::onActionTriggered(bool isChecked)
|
|||||||
{
|
{
|
||||||
RiaApplication::instance()->setLastUsedDialogDirectory("COMPLETIONS", exportSettings->folder);
|
RiaApplication::instance()->setLastUsedDialogDirectory("COMPLETIONS", exportSettings->folder);
|
||||||
|
|
||||||
exportCompletions(wellPaths, simWells, *exportSettings);
|
RicWellPathExportCompletionDataFeatureImpl::exportCompletions(wellPaths, simWells, *exportSettings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -230,10 +230,33 @@ std::vector<RimSimWellInView*> RicWellPathExportCompletionDataFeature::selectedS
|
|||||||
return simWells;
|
return simWells;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicWellPathExportCompletionDataFeature::exportCompletions(const std::vector<RimWellPath*>& wellPaths,
|
void RicWellPathExportCompletionDataFeatureImpl::exportCompletions(const std::vector<RimWellPath*>& wellPaths,
|
||||||
const std::vector<RimSimWellInView*>& simWells,
|
const std::vector<RimSimWellInView*>& simWells,
|
||||||
const RicExportCompletionDataSettingsUi& exportSettings)
|
const RicExportCompletionDataSettingsUi& exportSettings)
|
||||||
{
|
{
|
||||||
@@ -476,7 +499,7 @@ void RicWellPathExportCompletionDataFeature::exportCompletions(const std::vector
|
|||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
RigCompletionData RicWellPathExportCompletionDataFeature::combineEclipseCellCompletions(const std::vector<RigCompletionData>& completions,
|
RigCompletionData RicWellPathExportCompletionDataFeatureImpl::combineEclipseCellCompletions(const std::vector<RigCompletionData>& completions,
|
||||||
const RicExportCompletionDataSettingsUi& settings)
|
const RicExportCompletionDataSettingsUi& settings)
|
||||||
{
|
{
|
||||||
CVF_ASSERT(!completions.empty());
|
CVF_ASSERT(!completions.empty());
|
||||||
@@ -551,7 +574,7 @@ RigCompletionData RicWellPathExportCompletionDataFeature::combineEclipseCellComp
|
|||||||
else if (settings.compdatExport == RicExportCompletionDataSettingsUi::WPIMULT_AND_DEFAULT_CONNECTION_FACTORS)
|
else if (settings.compdatExport == RicExportCompletionDataSettingsUi::WPIMULT_AND_DEFAULT_CONNECTION_FACTORS)
|
||||||
{
|
{
|
||||||
//calculate trans for main bore - but as Eclipse will do it!
|
//calculate trans for main bore - but as Eclipse will do it!
|
||||||
double transmissibilityEclipseCalculation = RicWellPathExportCompletionDataFeature::calculateTransmissibilityAsEclipseDoes(settings.caseToApply(),
|
double transmissibilityEclipseCalculation = RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibilityAsEclipseDoes(settings.caseToApply(),
|
||||||
skinfactor,
|
skinfactor,
|
||||||
wellBoreDiameter / 2,
|
wellBoreDiameter / 2,
|
||||||
cellIndexIJK.globalCellIndex(),
|
cellIndexIJK.globalCellIndex(),
|
||||||
@@ -571,7 +594,7 @@ RigCompletionData RicWellPathExportCompletionDataFeature::combineEclipseCellComp
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicWellPathExportCompletionDataFeature::printCompletionsToFiles(const QString& folderName,
|
void RicWellPathExportCompletionDataFeatureImpl::printCompletionsToFiles(const QString& folderName,
|
||||||
const QString& fileName,
|
const QString& fileName,
|
||||||
std::vector<RigCompletionData>& completions,
|
std::vector<RigCompletionData>& completions,
|
||||||
RicExportCompletionDataSettingsUi::CompdatExportType exportType)
|
RicExportCompletionDataSettingsUi::CompdatExportType exportType)
|
||||||
@@ -620,7 +643,7 @@ void RicWellPathExportCompletionDataFeature::printCompletionsToFiles(const QStri
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicWellPathExportCompletionDataFeature::printCompletionsToFile(const QString& folderName,
|
void RicWellPathExportCompletionDataFeatureImpl::printCompletionsToFile(const QString& folderName,
|
||||||
const QString& fileName,
|
const QString& fileName,
|
||||||
const std::map<QString, std::vector<RigCompletionData>>& completionsPerGrid,
|
const std::map<QString, std::vector<RigCompletionData>>& completionsPerGrid,
|
||||||
RicExportCompletionDataSettingsUi::CompdatExportType exportType)
|
RicExportCompletionDataSettingsUi::CompdatExportType exportType)
|
||||||
@@ -670,7 +693,7 @@ void RicWellPathExportCompletionDataFeature::printCompletionsToFile(const QStrin
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::vector<RigCompletionData> RicWellPathExportCompletionDataFeature::getCompletionsForWellAndCompletionType(const std::vector<RigCompletionData>& completions,
|
std::vector<RigCompletionData> RicWellPathExportCompletionDataFeatureImpl::getCompletionsForWellAndCompletionType(const std::vector<RigCompletionData>& completions,
|
||||||
const QString& wellName,
|
const QString& wellName,
|
||||||
RigCompletionData::CompletionType completionType)
|
RigCompletionData::CompletionType completionType)
|
||||||
{
|
{
|
||||||
@@ -688,7 +711,7 @@ std::vector<RigCompletionData> RicWellPathExportCompletionDataFeature::getComple
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::map<RigCompletionDataGridCell, std::vector<RigCompletionData> > RicWellPathExportCompletionDataFeature::getCompletionsForWell(const std::map<RigCompletionDataGridCell, std::vector<RigCompletionData>>& cellToCompletionMap, const QString& wellName)
|
std::map<RigCompletionDataGridCell, std::vector<RigCompletionData> > RicWellPathExportCompletionDataFeatureImpl::getCompletionsForWell(const std::map<RigCompletionDataGridCell, std::vector<RigCompletionData>>& cellToCompletionMap, const QString& wellName)
|
||||||
{
|
{
|
||||||
std::map<RigCompletionDataGridCell, std::vector<RigCompletionData> > wellCompletions;
|
std::map<RigCompletionDataGridCell, std::vector<RigCompletionData> > wellCompletions;
|
||||||
|
|
||||||
@@ -709,7 +732,7 @@ std::map<RigCompletionDataGridCell, std::vector<RigCompletionData> > RicWellPath
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicWellPathExportCompletionDataFeature::generateCompdatTable(RifEclipseDataTableFormatter& formatter, const QString& gridName, const std::vector<RigCompletionData>& completionData)
|
void RicWellPathExportCompletionDataFeatureImpl::generateCompdatTable(RifEclipseDataTableFormatter& formatter, const QString& gridName, const std::vector<RigCompletionData>& completionData)
|
||||||
{
|
{
|
||||||
std::vector<RifEclipseOutputTableColumn> header;
|
std::vector<RifEclipseOutputTableColumn> header;
|
||||||
|
|
||||||
@@ -829,7 +852,7 @@ void RicWellPathExportCompletionDataFeature::generateCompdatTable(RifEclipseData
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicWellPathExportCompletionDataFeature::generateWpimultTable(RifEclipseDataTableFormatter& formatter,
|
void RicWellPathExportCompletionDataFeatureImpl::generateWpimultTable(RifEclipseDataTableFormatter& formatter,
|
||||||
const QString& gridName,
|
const QString& gridName,
|
||||||
const std::vector<RigCompletionData>& completionData)
|
const std::vector<RigCompletionData>& completionData)
|
||||||
{
|
{
|
||||||
@@ -885,7 +908,7 @@ void RicWellPathExportCompletionDataFeature::generateWpimultTable(RifEclipseData
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::vector<RigCompletionData> RicWellPathExportCompletionDataFeature::generatePerforationsCompdatValues(const RimWellPath* wellPath, const RicExportCompletionDataSettingsUi& settings)
|
std::vector<RigCompletionData> RicWellPathExportCompletionDataFeatureImpl::generatePerforationsCompdatValues(const RimWellPath* wellPath, const RicExportCompletionDataSettingsUi& settings)
|
||||||
{
|
{
|
||||||
RiaEclipseUnitTools::UnitSystem unitSystem = settings.caseToApply->eclipseCaseData()->unitsType();
|
RiaEclipseUnitTools::UnitSystem unitSystem = settings.caseToApply->eclipseCaseData()->unitsType();
|
||||||
|
|
||||||
@@ -912,7 +935,7 @@ std::vector<RigCompletionData> RicWellPathExportCompletionDataFeature::generateP
|
|||||||
RigCompletionData completion(wellPath->completions()->wellNameForExport(), RigCompletionDataGridCell(cell.globCellIndex, settings.caseToApply->mainGrid()));
|
RigCompletionData completion(wellPath->completions()->wellNameForExport(), RigCompletionDataGridCell(cell.globCellIndex, settings.caseToApply->mainGrid()));
|
||||||
CellDirection direction = calculateDirectionInCell(settings.caseToApply, cell.globCellIndex, cell.intersectionLengthsInCellCS);
|
CellDirection direction = calculateDirectionInCell(settings.caseToApply, cell.globCellIndex, cell.intersectionLengthsInCellCS);
|
||||||
|
|
||||||
double transmissibility = RicWellPathExportCompletionDataFeature::calculateTransmissibility(settings.caseToApply,
|
double transmissibility = RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibility(settings.caseToApply,
|
||||||
wellPath,
|
wellPath,
|
||||||
cell.intersectionLengthsInCellCS,
|
cell.intersectionLengthsInCellCS,
|
||||||
interval->skinFactor(),
|
interval->skinFactor(),
|
||||||
@@ -938,7 +961,7 @@ std::vector<RigCompletionData> RicWellPathExportCompletionDataFeature::generateP
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::set<size_t> RicWellPathExportCompletionDataFeature::findIntersectedCells(const RigEclipseCaseData* caseData, const std::vector<cvf::Vec3d>& coords)
|
std::set<size_t> RicWellPathExportCompletionDataFeatureImpl::findIntersectedCells(const RigEclipseCaseData* caseData, const std::vector<cvf::Vec3d>& coords)
|
||||||
{
|
{
|
||||||
std::set<size_t> cells;
|
std::set<size_t> cells;
|
||||||
|
|
||||||
@@ -951,31 +974,10 @@ std::set<size_t> RicWellPathExportCompletionDataFeature::findIntersectedCells(co
|
|||||||
return cells;
|
return cells;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RicWellPathExportCompletionDataFeature::markWellPathCells(const std::vector<size_t>& wellPathCells, std::vector<WellSegmentLocation>* locations)
|
|
||||||
{
|
|
||||||
std::set<size_t> wellPathCellSet(wellPathCells.begin(), wellPathCells.end());
|
|
||||||
for (WellSegmentLocation& location : *locations)
|
|
||||||
{
|
|
||||||
for (WellSegmentLateral& lateral : location.laterals)
|
|
||||||
{
|
|
||||||
for (WellSegmentLateralIntersection& intersection : lateral.intersections)
|
|
||||||
{
|
|
||||||
if (wellPathCellSet.find(intersection.globalCellIndex) != wellPathCellSet.end())
|
|
||||||
{
|
|
||||||
intersection.mainBoreCell = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RicWellPathExportCompletionDataFeature::wellSegmentLocationOrdering(const WellSegmentLocation& first, const WellSegmentLocation& second)
|
bool RicWellPathExportCompletionDataFeatureImpl::wellSegmentLocationOrdering(const WellSegmentLocation& first, const WellSegmentLocation& second)
|
||||||
{
|
{
|
||||||
return first.measuredDepth < second.measuredDepth;
|
return first.measuredDepth < second.measuredDepth;
|
||||||
}
|
}
|
||||||
@@ -983,17 +985,7 @@ bool RicWellPathExportCompletionDataFeature::wellSegmentLocationOrdering(const W
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RicWellPathExportCompletionDataFeature::isPointBetween(const cvf::Vec3d& startPoint, const cvf::Vec3d& endPoint, const cvf::Vec3d& pointToCheck)
|
std::vector<WellSegmentLocation> RicWellPathExportCompletionDataFeatureImpl::findWellSegmentLocations(const RimEclipseCase* caseToApply, const RimWellPath* wellPath)
|
||||||
{
|
|
||||||
cvf::Plane plane;
|
|
||||||
plane.setFromPointAndNormal(pointToCheck, endPoint - startPoint);
|
|
||||||
return plane.side(startPoint) != plane.side(endPoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
std::vector<WellSegmentLocation> RicWellPathExportCompletionDataFeature::findWellSegmentLocations(const RimEclipseCase* caseToApply, const RimWellPath* wellPath)
|
|
||||||
{
|
{
|
||||||
std::vector<RimFishbonesMultipleSubs*> fishbonesSubs;
|
std::vector<RimFishbonesMultipleSubs*> fishbonesSubs;
|
||||||
|
|
||||||
@@ -1014,7 +1006,7 @@ std::vector<WellSegmentLocation> RicWellPathExportCompletionDataFeature::findWel
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::vector<WellSegmentLocation> RicWellPathExportCompletionDataFeature::findWellSegmentLocations(const RimEclipseCase* caseToApply, const RimWellPath* wellPath, const std::vector<RimFishbonesMultipleSubs*>& fishbonesSubs)
|
std::vector<WellSegmentLocation> RicWellPathExportCompletionDataFeatureImpl::findWellSegmentLocations(const RimEclipseCase* caseToApply, const RimWellPath* wellPath, const std::vector<RimFishbonesMultipleSubs*>& fishbonesSubs)
|
||||||
{
|
{
|
||||||
std::vector<WellSegmentLocation> wellSegmentLocations;
|
std::vector<WellSegmentLocation> wellSegmentLocations;
|
||||||
for (RimFishbonesMultipleSubs* subs : fishbonesSubs)
|
for (RimFishbonesMultipleSubs* subs : fishbonesSubs)
|
||||||
@@ -1041,7 +1033,7 @@ std::vector<WellSegmentLocation> RicWellPathExportCompletionDataFeature::findWel
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicWellPathExportCompletionDataFeature::assignLateralIntersections(const RimEclipseCase* caseToApply,
|
void RicWellPathExportCompletionDataFeatureImpl::assignLateralIntersections(const RimEclipseCase* caseToApply,
|
||||||
WellSegmentLocation* location,
|
WellSegmentLocation* location,
|
||||||
int* branchNum,
|
int* branchNum,
|
||||||
int* segmentNum)
|
int* segmentNum)
|
||||||
@@ -1099,7 +1091,7 @@ void RicWellPathExportCompletionDataFeature::assignLateralIntersections(const Ri
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicWellPathExportCompletionDataFeature::assignLateralIntersectionsAndBranchAndSegmentNumbers(const RimEclipseCase* caseToApply, std::vector<WellSegmentLocation>* locations)
|
void RicWellPathExportCompletionDataFeatureImpl::assignLateralIntersectionsAndBranchAndSegmentNumbers(const RimEclipseCase* caseToApply, std::vector<WellSegmentLocation>* locations)
|
||||||
{
|
{
|
||||||
int segmentNumber = 1;
|
int segmentNumber = 1;
|
||||||
int branchNumber = 1;
|
int branchNumber = 1;
|
||||||
@@ -1122,7 +1114,7 @@ void RicWellPathExportCompletionDataFeature::assignLateralIntersectionsAndBranch
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicWellPathExportCompletionDataFeature::appendCompletionData(std::map<RigCompletionDataGridCell, std::vector<RigCompletionData> >* completionData, const std::vector<RigCompletionData>& data)
|
void RicWellPathExportCompletionDataFeatureImpl::appendCompletionData(std::map<RigCompletionDataGridCell, std::vector<RigCompletionData> >* completionData, const std::vector<RigCompletionData>& data)
|
||||||
{
|
{
|
||||||
for (auto& completion : data)
|
for (auto& completion : data)
|
||||||
{
|
{
|
||||||
@@ -1141,7 +1133,7 @@ void RicWellPathExportCompletionDataFeature::appendCompletionData(std::map<RigCo
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
CellDirection RicWellPathExportCompletionDataFeature::calculateDirectionInCell(RimEclipseCase* eclipseCase, size_t globalCellIndex, const cvf::Vec3d& lengthsInCell)
|
CellDirection RicWellPathExportCompletionDataFeatureImpl::calculateDirectionInCell(RimEclipseCase* eclipseCase, size_t globalCellIndex, const cvf::Vec3d& lengthsInCell)
|
||||||
{
|
{
|
||||||
RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData();
|
RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData();
|
||||||
|
|
||||||
@@ -1173,7 +1165,7 @@ CellDirection RicWellPathExportCompletionDataFeature::calculateDirectionInCell(R
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
double RicWellPathExportCompletionDataFeature::calculateTransmissibility(RimEclipseCase* eclipseCase,
|
double RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibility(RimEclipseCase* eclipseCase,
|
||||||
const RimWellPath* wellPath,
|
const RimWellPath* wellPath,
|
||||||
const cvf::Vec3d& internalCellLengths,
|
const cvf::Vec3d& internalCellLengths,
|
||||||
double skinFactor,
|
double skinFactor,
|
||||||
@@ -1235,7 +1227,7 @@ double RicWellPathExportCompletionDataFeature::calculateTransmissibility(RimEcli
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
double RicWellPathExportCompletionDataFeature::calculateTransmissibilityAsEclipseDoes(RimEclipseCase* eclipseCase,
|
double RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibilityAsEclipseDoes(RimEclipseCase* eclipseCase,
|
||||||
double skinFactor,
|
double skinFactor,
|
||||||
double wellRadius,
|
double wellRadius,
|
||||||
size_t globalCellIndex,
|
size_t globalCellIndex,
|
||||||
|
|||||||
@@ -118,12 +118,30 @@ protected:
|
|||||||
virtual void onActionTriggered(bool isChecked) override;
|
virtual void onActionTriggered(bool isChecked) override;
|
||||||
virtual void setupActionLook(QAction* actionToSetup) override;
|
virtual void setupActionLook(QAction* actionToSetup) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::vector<RimWellPath*> selectedWellPaths();
|
||||||
|
std::vector<RimSimWellInView*> selectedSimWells();
|
||||||
|
|
||||||
|
bool noWellPathsSelectedDirectly();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
///
|
||||||
|
//==================================================================================================
|
||||||
|
class RicWellPathExportCompletionDataFeatureImpl
|
||||||
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static std::vector<WellSegmentLocation> findWellSegmentLocations(const RimEclipseCase* caseToApply, const RimWellPath* wellPath);
|
static std::vector<WellSegmentLocation> findWellSegmentLocations(const RimEclipseCase* caseToApply, const RimWellPath* wellPath);
|
||||||
static std::vector<WellSegmentLocation> findWellSegmentLocations(const RimEclipseCase* caseToApply, const RimWellPath* wellPath, const std::vector<RimFishbonesMultipleSubs*>& fishbonesSubs);
|
static std::vector<WellSegmentLocation> findWellSegmentLocations(const RimEclipseCase* caseToApply, const RimWellPath* wellPath, const std::vector<RimFishbonesMultipleSubs*>& fishbonesSubs);
|
||||||
|
|
||||||
//functions also used by RicFishbonesTransmissibilityCalculationFeatureImp
|
// TODO : Move
|
||||||
static std::set<size_t> findIntersectedCells(const RigEclipseCaseData* grid, const std::vector<cvf::Vec3d>& coords);
|
static std::set<size_t> findIntersectedCells(const RigEclipseCaseData* grid, const std::vector<cvf::Vec3d>& coords);
|
||||||
|
|
||||||
static CellDirection calculateDirectionInCell(RimEclipseCase* eclipseCase, size_t globalCellIndex, const cvf::Vec3d& lengthsInCell);
|
static CellDirection calculateDirectionInCell(RimEclipseCase* eclipseCase, size_t globalCellIndex, const cvf::Vec3d& lengthsInCell);
|
||||||
|
|
||||||
static double calculateTransmissibility(RimEclipseCase* eclipseCase,
|
static double calculateTransmissibility(RimEclipseCase* eclipseCase,
|
||||||
@@ -140,24 +158,21 @@ public:
|
|||||||
static void exportCompletions(const std::vector<RimWellPath*>& wellPaths, const std::vector<RimSimWellInView*>& simWells, const RicExportCompletionDataSettingsUi& exportSettings);
|
static void exportCompletions(const std::vector<RimWellPath*>& wellPaths, const std::vector<RimSimWellInView*>& simWells, const RicExportCompletionDataSettingsUi& exportSettings);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<RimWellPath*> selectedWellPaths();
|
|
||||||
std::vector<RimSimWellInView*> selectedSimWells();
|
|
||||||
|
|
||||||
bool noWellPathsSelectedDirectly();
|
|
||||||
static void markWellPathCells(const std::vector<size_t>& wellPathCells, std::vector<WellSegmentLocation>* locations);
|
|
||||||
|
|
||||||
static double calculateTransmissibilityAsEclipseDoes(RimEclipseCase* eclipseCase,
|
static double calculateTransmissibilityAsEclipseDoes(RimEclipseCase* eclipseCase,
|
||||||
double skinFactor,
|
double skinFactor,
|
||||||
double wellRadius,
|
double wellRadius,
|
||||||
size_t globalCellIndex,
|
size_t globalCellIndex,
|
||||||
CellDirection direction);
|
CellDirection direction);
|
||||||
|
|
||||||
static RigCompletionData combineEclipseCellCompletions(const std::vector<RigCompletionData>& completions,
|
static RigCompletionData combineEclipseCellCompletions(const std::vector<RigCompletionData>& completions,
|
||||||
const RicExportCompletionDataSettingsUi& settings);
|
const RicExportCompletionDataSettingsUi& settings);
|
||||||
|
|
||||||
static void printCompletionsToFiles(const QString& exportFolder, const QString& fileName, std::vector<RigCompletionData>& completions, RicExportCompletionDataSettingsUi::CompdatExportType exportType);
|
static void printCompletionsToFiles(const QString& exportFolder, const QString& fileName, std::vector<RigCompletionData>& completions, RicExportCompletionDataSettingsUi::CompdatExportType exportType);
|
||||||
|
|
||||||
static void printCompletionsToFile(const QString& folderName, const QString& fileName, const std::map<QString, std::vector<RigCompletionData>>& completionsPerGrid, RicExportCompletionDataSettingsUi::CompdatExportType exportType);
|
static void printCompletionsToFile(const QString& folderName, const QString& fileName, const std::map<QString, std::vector<RigCompletionData>>& completionsPerGrid, RicExportCompletionDataSettingsUi::CompdatExportType exportType);
|
||||||
|
|
||||||
static std::vector<RigCompletionData> getCompletionsForWellAndCompletionType(const std::vector<RigCompletionData>& completions, const QString& wellName, RigCompletionData::CompletionType completionType);
|
static std::vector<RigCompletionData> getCompletionsForWellAndCompletionType(const std::vector<RigCompletionData>& completions, const QString& wellName, RigCompletionData::CompletionType completionType);
|
||||||
|
|
||||||
static std::map<RigCompletionDataGridCell, std::vector<RigCompletionData> > getCompletionsForWell(const std::map<RigCompletionDataGridCell, std::vector<RigCompletionData>>& cellToCompletionMap, const QString& wellName);
|
static std::map<RigCompletionDataGridCell, std::vector<RigCompletionData> > getCompletionsForWell(const std::map<RigCompletionDataGridCell, std::vector<RigCompletionData>>& cellToCompletionMap, const QString& wellName);
|
||||||
|
|
||||||
static void generateCompdatTable(RifEclipseDataTableFormatter& formatter, const QString& gridName, const std::vector<RigCompletionData>& completionData);
|
static void generateCompdatTable(RifEclipseDataTableFormatter& formatter, const QString& gridName, const std::vector<RigCompletionData>& completionData);
|
||||||
@@ -166,7 +181,6 @@ private:
|
|||||||
static std::vector<RigCompletionData> generatePerforationsCompdatValues(const RimWellPath* wellPath, const RicExportCompletionDataSettingsUi& settings);
|
static std::vector<RigCompletionData> generatePerforationsCompdatValues(const RimWellPath* wellPath, const RicExportCompletionDataSettingsUi& settings);
|
||||||
|
|
||||||
static bool wellSegmentLocationOrdering(const WellSegmentLocation& first, const WellSegmentLocation& second);
|
static bool wellSegmentLocationOrdering(const WellSegmentLocation& first, const WellSegmentLocation& second);
|
||||||
static bool isPointBetween(const cvf::Vec3d& pointA, const cvf::Vec3d& pointB, const cvf::Vec3d& needle);
|
|
||||||
static void assignLateralIntersections(const RimEclipseCase* caseToApply, WellSegmentLocation* location, int* branchNum, int* segmentNum);
|
static void assignLateralIntersections(const RimEclipseCase* caseToApply, WellSegmentLocation* location, int* branchNum, int* segmentNum);
|
||||||
static void assignLateralIntersectionsAndBranchAndSegmentNumbers(const RimEclipseCase* caseToApply, std::vector<WellSegmentLocation>* locations);
|
static void assignLateralIntersectionsAndBranchAndSegmentNumbers(const RimEclipseCase* caseToApply, std::vector<WellSegmentLocation>* locations);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user