mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
commit
33ef2948f4
@ -117,6 +117,7 @@ list( APPEND REFERENCED_CMAKE_FILES
|
||||
Commands/CMakeLists_files.cmake
|
||||
Commands/ApplicationCommands/CMakeLists_files.cmake
|
||||
Commands/CompletionCommands/CMakeLists_files.cmake
|
||||
Commands/CompletionExportCommands/CMakeLists_files.cmake
|
||||
Commands/CrossSectionCommands/CMakeLists_files.cmake
|
||||
Commands/EclipseCommands/CMakeLists_files.cmake
|
||||
Commands/EclipseCommands/EclipseWell/CMakeLists_files.cmake
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include "RimFishbonesCollection.h"
|
||||
#include "RimFishbonesMultipleSubs.h"
|
||||
|
||||
#include "CompletionCommands/RicExportFishbonesWellSegmentsFeature.h"
|
||||
#include "CompletionExportCommands/RicExportFishbonesWellSegmentsFeature.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RicfExportMsw, "exportMsw");
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
|
||||
#include "CompletionCommands/RicWellPathExportCompletionDataFeature.h"
|
||||
#include "CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RicfExportSimWellCompletions, "exportSimWellCompletions");
|
||||
|
||||
@ -127,5 +127,5 @@ void RicfExportSimWellCompletions::execute()
|
||||
|
||||
std::vector<RimWellPath*> wellPaths;
|
||||
|
||||
RicWellPathExportCompletionDataFeature::exportCompletions(wellPaths, simWells, *exportSettings);
|
||||
RicWellPathExportCompletionDataFeatureImpl::exportCompletions(wellPaths, simWells, *exportSettings);
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
#include "RicfCommandObject.h"
|
||||
|
||||
#include "CompletionCommands/RicExportCompletionDataSettingsUi.h"
|
||||
#include "CompletionExportCommands/RicExportCompletionDataSettingsUi.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmField.h"
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include "RimWellPathCollection.h"
|
||||
#include "RimWellPath.h"
|
||||
|
||||
#include "CompletionCommands/RicWellPathExportCompletionDataFeature.h"
|
||||
#include "CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RicfExportWellPathCompletions, "exportWellPathCompletions");
|
||||
|
||||
@ -116,5 +116,5 @@ void RicfExportWellPathCompletions::execute()
|
||||
|
||||
std::vector<RimSimWellInView*> simWells;
|
||||
|
||||
RicWellPathExportCompletionDataFeature::exportCompletions(wellPaths, simWells, *exportSettings);
|
||||
RicWellPathExportCompletionDataFeatureImpl::exportCompletions(wellPaths, simWells, *exportSettings);
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
#include "RicfCommandObject.h"
|
||||
|
||||
#include "CompletionCommands/RicExportCompletionDataSettingsUi.h"
|
||||
#include "CompletionExportCommands/RicExportCompletionDataSettingsUi.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmField.h"
|
||||
|
@ -5,50 +5,27 @@ if (${CMAKE_VERSION} VERSION_GREATER "2.8.2")
|
||||
endif()
|
||||
|
||||
set (SOURCE_GROUP_HEADER_FILES
|
||||
${CEE_CURRENT_LIST_DIR}RicCaseAndFileExportSettingsUi.h
|
||||
${CEE_CURRENT_LIST_DIR}RicEditPerforationCollectionFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicExportCompletionDataSettingsUi.h
|
||||
${CEE_CURRENT_LIST_DIR}RicExportFishbonesLateralsFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicExportFishbonesWellSegmentsFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicNewFishbonesSubsAtMeasuredDepthFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicNewFishbonesSubsFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicNewPerforationIntervalFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicNewPerforationIntervalAtMeasuredDepthFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicWellPathExportCompletionDataFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicWellPathImportCompletionsFileFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicWellPathImportPerforationIntervalsFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicFishbonesTransmissibilityCalculationFeatureImp.h
|
||||
)
|
||||
|
||||
if (RESINSIGHT_ENABLE_PROTOTYPE_FEATURE_FRACTURES)
|
||||
list (APPEND SOURCE_GROUP_HEADER_FILES
|
||||
${CEE_CURRENT_LIST_DIR}RicExportFractureCompletionsImpl.h
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
${CEE_CURRENT_LIST_DIR}RicCaseAndFileExportSettingsUi.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicEditPerforationCollectionFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicExportCompletionDataSettingsUi.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicExportFishbonesLateralsFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicExportFishbonesWellSegmentsFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicNewFishbonesSubsAtMeasuredDepthFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicNewFishbonesSubsFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicNewPerforationIntervalFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicNewPerforationIntervalAtMeasuredDepthFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicWellPathExportCompletionDataFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicWellPathImportCompletionsFileFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicWellPathImportPerforationIntervalsFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicFishbonesTransmissibilityCalculationFeatureImp.cpp
|
||||
)
|
||||
|
||||
if (RESINSIGHT_ENABLE_PROTOTYPE_FEATURE_FRACTURES)
|
||||
list (APPEND SOURCE_GROUP_SOURCE_FILES
|
||||
${CEE_CURRENT_LIST_DIR}RicExportFractureCompletionsImpl.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
${SOURCE_GROUP_HEADER_FILES}
|
||||
|
@ -1,78 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 Statoil ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cvfBase.h"
|
||||
#include "cvfVector3.h"
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <QString>
|
||||
|
||||
class RigCompletionData;
|
||||
class RimWellPath;
|
||||
class RicExportCompletionDataSettingsUi;
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
struct WellBorePartForTransCalc {
|
||||
WellBorePartForTransCalc(cvf::Vec3d lengthsInCell,
|
||||
double wellRadius,
|
||||
double skinFactor,
|
||||
bool isMainBore,
|
||||
QString metaData)
|
||||
: lengthsInCell(lengthsInCell),
|
||||
wellRadius(wellRadius),
|
||||
skinFactor(skinFactor),
|
||||
isMainBore(isMainBore),
|
||||
metaData(metaData)
|
||||
{}
|
||||
|
||||
cvf::Vec3d lengthsInCell;
|
||||
double wellRadius;
|
||||
double skinFactor;
|
||||
QString metaData;
|
||||
bool isMainBore;
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicFishbonesTransmissibilityCalculationFeatureImp
|
||||
{
|
||||
public:
|
||||
static std::vector<RigCompletionData> generateFishboneCompdatValuesUsingAdjustedCellVolume(const RimWellPath* wellPath,
|
||||
const RicExportCompletionDataSettingsUi& settings);
|
||||
|
||||
|
||||
|
||||
private:
|
||||
static void findFishboneLateralsWellBoreParts(std::map<size_t, std::vector<WellBorePartForTransCalc> >& wellBorePartsInCells,
|
||||
const RimWellPath* wellPath,
|
||||
const RicExportCompletionDataSettingsUi& settings);
|
||||
static void findFishboneImportedLateralsWellBoreParts(std::map<size_t, std::vector<WellBorePartForTransCalc> >& wellBorePartsInCells,
|
||||
const RimWellPath* wellPath,
|
||||
const RicExportCompletionDataSettingsUi& settings);
|
||||
static void findMainWellBoreParts(std::map<size_t, std::vector<WellBorePartForTransCalc>>& wellBorePartsInCells,
|
||||
const RimWellPath* wellPath,
|
||||
const RicExportCompletionDataSettingsUi& settings);
|
||||
};
|
||||
|
@ -0,0 +1,59 @@
|
||||
|
||||
# Use this workaround until we're on 2.8.3 on all platforms and can use CMAKE_CURRENT_LIST_DIR directly
|
||||
if (${CMAKE_VERSION} VERSION_GREATER "2.8.2")
|
||||
set(CEE_CURRENT_LIST_DIR ${CMAKE_CURRENT_LIST_DIR}/)
|
||||
endif()
|
||||
|
||||
set (SOURCE_GROUP_HEADER_FILES
|
||||
${CEE_CURRENT_LIST_DIR}RicExportCompletionDataSettingsUi.h
|
||||
${CEE_CURRENT_LIST_DIR}RicWellPathExportCompletionDataFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicWellPathExportCompletionDataFeatureImpl.h
|
||||
${CEE_CURRENT_LIST_DIR}RicFishbonesTransmissibilityCalculationFeatureImp.h
|
||||
${CEE_CURRENT_LIST_DIR}RigCompletionData.h
|
||||
${CEE_CURRENT_LIST_DIR}RigCompletionDataGridCell.h
|
||||
${CEE_CURRENT_LIST_DIR}RicExportFishbonesWellSegmentsFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicCaseAndFileExportSettingsUi.h
|
||||
)
|
||||
|
||||
if (RESINSIGHT_ENABLE_PROTOTYPE_FEATURE_FRACTURES)
|
||||
list (APPEND SOURCE_GROUP_HEADER_FILES
|
||||
${CEE_CURRENT_LIST_DIR}RicExportFractureCompletionsImpl.h
|
||||
${CEE_CURRENT_LIST_DIR}RigEclipseToStimPlanCellTransmissibilityCalculator.h
|
||||
${CEE_CURRENT_LIST_DIR}RigTransmissibilityCondenser.h
|
||||
${CEE_CURRENT_LIST_DIR}RigFractureTransmissibilityEquations.h
|
||||
${CEE_CURRENT_LIST_DIR}RigWellPathStimplanIntersector.h
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
${CEE_CURRENT_LIST_DIR}RicExportCompletionDataSettingsUi.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicWellPathExportCompletionDataFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicWellPathExportCompletionDataFeatureImpl.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicFishbonesTransmissibilityCalculationFeatureImp.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigCompletionData.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigCompletionDataGridCell.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicExportFishbonesWellSegmentsFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicCaseAndFileExportSettingsUi.cpp
|
||||
)
|
||||
|
||||
if (RESINSIGHT_ENABLE_PROTOTYPE_FEATURE_FRACTURES)
|
||||
list (APPEND SOURCE_GROUP_SOURCE_FILES
|
||||
${CEE_CURRENT_LIST_DIR}RicExportFractureCompletionsImpl.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigEclipseToStimPlanCellTransmissibilityCalculator.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigTransmissibilityCondenser.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigFractureTransmissibilityEquations.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigWellPathStimplanIntersector.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
${SOURCE_GROUP_HEADER_FILES}
|
||||
)
|
||||
|
||||
list(APPEND CODE_SOURCE_FILES
|
||||
${SOURCE_GROUP_SOURCE_FILES}
|
||||
)
|
||||
|
||||
source_group( "CommandFeature\\CompletionExport" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CEE_CURRENT_LIST_DIR}CMakeLists_files.cmake )
|
@ -175,7 +175,7 @@ void RicExportFishbonesWellSegmentsFeature::exportWellSegments(const RimWellPath
|
||||
return;
|
||||
}
|
||||
|
||||
std::vector<WellSegmentLocation> locations = RicWellPathExportCompletionDataFeature::findWellSegmentLocations(settings.caseToApply, wellPath, fishbonesSubs);
|
||||
std::vector<WellSegmentLocation> locations = RicWellPathExportCompletionDataFeatureImpl::findWellSegmentLocations(settings.caseToApply, wellPath, fishbonesSubs);
|
||||
|
||||
QTextStream stream(&exportFile);
|
||||
RifEclipseDataTableFormatter formatter(stream);
|
||||
@ -365,7 +365,7 @@ void RicExportFishbonesWellSegmentsFeature::generateCompsegsTable(RifEclipseData
|
||||
for (const WellSegmentLateralIntersection& intersection : lateral.intersections)
|
||||
{
|
||||
size_t i, j, k;
|
||||
grid->ijkFromCellIndex(intersection.cellIndex, &i, &j, &k);
|
||||
grid->ijkFromCellIndex(intersection.globalCellIndex, &i, &j, &k);
|
||||
|
||||
formatter.addZeroBasedCellIndex(i).addZeroBasedCellIndex(j).addZeroBasedCellIndex(k);
|
||||
formatter.add(lateral.branchNumber);
|
@ -21,8 +21,8 @@
|
||||
#include "RifEclipseDataTableFormatter.h"
|
||||
|
||||
#include "RicCaseAndFileExportSettingsUi.h"
|
||||
#include "RicWellPathExportCompletionDataFeatureImpl.h"
|
||||
|
||||
#include "RicWellPathExportCompletionDataFeature.h"
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
|
@ -344,23 +344,14 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
|
||||
{
|
||||
if (externalCell.m_cellIndexSpace == RigTransmissibilityCondenser::CellAddress::ECLIPSE)
|
||||
{
|
||||
if (externalCell.m_globalCellIdx > mainGrid->cellCount())
|
||||
{
|
||||
RiaLogging::error(QString("LGR cells (not supported) found in export of COMPDAT values for fracture %1").arg(fracture->name()));
|
||||
}
|
||||
else
|
||||
{
|
||||
double trans = transCondenser.condensedTransmissibility(externalCell, { true, RigTransmissibilityCondenser::CellAddress::WELL, 1 });
|
||||
double trans = transCondenser.condensedTransmissibility(externalCell, { true, RigTransmissibilityCondenser::CellAddress::WELL, 1 });
|
||||
|
||||
eclCellIdxToTransPrFractureMap[externalCell.m_globalCellIdx][fracture] = trans;
|
||||
size_t i, j, k;
|
||||
mainGrid->ijkFromCellIndex(externalCell.m_globalCellIdx, &i, &j, &k);
|
||||
eclCellIdxToTransPrFractureMap[externalCell.m_globalCellIdx][fracture] = trans;
|
||||
|
||||
RigCompletionData compDat(wellPathName, {i,j,k});
|
||||
compDat.setFromFracture(trans, fracture->fractureTemplate()->skinFactor());
|
||||
compDat.addMetadata(fracture->name(), QString::number(trans));
|
||||
fractureCompletions.push_back(compDat);
|
||||
}
|
||||
RigCompletionData compDat(wellPathName, RigCompletionDataGridCell(externalCell.m_globalCellIdx, caseToApply->mainGrid()));
|
||||
compDat.setFromFracture(trans, fracture->fractureTemplate()->skinFactor());
|
||||
compDat.addMetadata(fracture->name(), QString::number(trans));
|
||||
fractureCompletions.push_back(compDat);
|
||||
}
|
||||
}
|
||||
|
||||
@ -377,4 +368,3 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
|
||||
return fractureCompletions;
|
||||
}
|
||||
|
||||
|
@ -19,13 +19,14 @@
|
||||
#include "RicFishbonesTransmissibilityCalculationFeatureImp.h"
|
||||
|
||||
#include "RicExportCompletionDataSettingsUi.h"
|
||||
#include "RicWellPathExportCompletionDataFeature.h"
|
||||
#include "RicWellPathExportCompletionDataFeatureImpl.h"
|
||||
|
||||
#include "RigActiveCellInfo.h"
|
||||
#include "RigCompletionData.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigMainGrid.h"
|
||||
#include "RigWellPath.h"
|
||||
#include "RigWellPathIntersectionTools.h"
|
||||
|
||||
#include "RimFishboneWellPath.h"
|
||||
#include "RimFishboneWellPathCollection.h"
|
||||
@ -35,6 +36,23 @@
|
||||
#include "RimWellPathCompletions.h"
|
||||
#include "RigWellLogExtractor.h"
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
struct WellBorePartForTransCalc
|
||||
{
|
||||
WellBorePartForTransCalc(cvf::Vec3d lengthsInCell, double wellRadius, double skinFactor, bool isMainBore, QString metaData)
|
||||
: lengthsInCell(lengthsInCell), wellRadius(wellRadius), skinFactor(skinFactor), isMainBore(isMainBore), metaData(metaData)
|
||||
{
|
||||
}
|
||||
|
||||
cvf::Vec3d lengthsInCell;
|
||||
double wellRadius;
|
||||
double skinFactor;
|
||||
QString metaData;
|
||||
bool isMainBore;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -44,7 +62,7 @@ void RicFishbonesTransmissibilityCalculationFeatureImp::findFishboneLateralsWell
|
||||
{
|
||||
// Generate data
|
||||
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();
|
||||
bool isMainBore = false;
|
||||
@ -63,7 +81,7 @@ void RicFishbonesTransmissibilityCalculationFeatureImp::findFishboneLateralsWell
|
||||
isMainBore,
|
||||
completionMetaData);
|
||||
|
||||
wellBorePartsInCells[intersection.cellIndex].push_back(wellBorePart);
|
||||
wellBorePartsInCells[intersection.globalCellIndex].push_back(wellBorePart);
|
||||
|
||||
}
|
||||
}
|
||||
@ -87,17 +105,14 @@ std::vector<RigCompletionData> RicFishbonesTransmissibilityCalculationFeatureImp
|
||||
|
||||
std::vector<RigCompletionData> completionData;
|
||||
|
||||
RigMainGrid* grid = settings.caseToApply->eclipseCaseData()->mainGrid();
|
||||
const RigActiveCellInfo* activeCellInfo = settings.caseToApply->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL);
|
||||
|
||||
for (const auto& cellAndWellBoreParts : wellBorePartsInCells)
|
||||
{
|
||||
size_t cellIndex = cellAndWellBoreParts.first;
|
||||
size_t globalCellIndex = cellAndWellBoreParts.first;
|
||||
const std::vector<WellBorePartForTransCalc>& wellBoreParts = cellAndWellBoreParts.second;
|
||||
size_t i, j, k;
|
||||
grid->ijkFromCellIndex(cellIndex, &i, &j, &k);
|
||||
|
||||
bool cellIsActive = activeCellInfo->isActive(cellIndex);
|
||||
bool cellIsActive = activeCellInfo->isActive(globalCellIndex);
|
||||
if (!cellIsActive) continue;
|
||||
|
||||
// Find main bore and number of laterals
|
||||
@ -112,46 +127,46 @@ std::vector<RigCompletionData> RicFishbonesTransmissibilityCalculationFeatureImp
|
||||
}
|
||||
else
|
||||
{
|
||||
mainBoreDirection = RicWellPathExportCompletionDataFeature::calculateDirectionInCell(settings.caseToApply,
|
||||
cellIndex,
|
||||
mainBoreDirection = RicWellPathExportCompletionDataFeatureImpl::calculateDirectionInCell(settings.caseToApply,
|
||||
globalCellIndex,
|
||||
wellBorePart.lengthsInCell);
|
||||
}
|
||||
}
|
||||
|
||||
for (WellBorePartForTransCalc wellBorePart : wellBoreParts)
|
||||
{
|
||||
RigCompletionData completion(wellPath->completions()->wellNameForExport(), IJKCellIndex(i, j, k));
|
||||
RigCompletionData completion(wellPath->completions()->wellNameForExport(), RigCompletionDataGridCell(globalCellIndex, settings.caseToApply->mainGrid()));
|
||||
|
||||
double transmissibility = 0.0;
|
||||
if (wellBorePart.isMainBore)
|
||||
{
|
||||
//No change in transmissibility for main bore
|
||||
transmissibility = RicWellPathExportCompletionDataFeature::calculateTransmissibility(settings.caseToApply,
|
||||
transmissibility = RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibility(settings.caseToApply,
|
||||
wellPath,
|
||||
wellBorePart.lengthsInCell,
|
||||
wellBorePart.skinFactor,
|
||||
wellBorePart.wellRadius,
|
||||
cellIndex,
|
||||
globalCellIndex,
|
||||
settings.useLateralNTG);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//Adjust transmissibility for fishbone laterals
|
||||
transmissibility = RicWellPathExportCompletionDataFeature::calculateTransmissibility(settings.caseToApply,
|
||||
transmissibility = RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibility(settings.caseToApply,
|
||||
wellPath,
|
||||
wellBorePart.lengthsInCell,
|
||||
wellBorePart.skinFactor,
|
||||
wellBorePart.wellRadius,
|
||||
cellIndex,
|
||||
globalCellIndex,
|
||||
settings.useLateralNTG,
|
||||
numberOfLaterals,
|
||||
mainBoreDirection);
|
||||
|
||||
}
|
||||
|
||||
CellDirection direction = RicWellPathExportCompletionDataFeature::calculateDirectionInCell(settings.caseToApply,
|
||||
cellIndex,
|
||||
CellDirection direction = RicWellPathExportCompletionDataFeatureImpl::calculateDirectionInCell(settings.caseToApply,
|
||||
globalCellIndex,
|
||||
wellBorePart.lengthsInCell);
|
||||
|
||||
completion.setTransAndWPImultBackgroundDataFromFishbone(transmissibility,
|
||||
@ -176,7 +191,7 @@ void RicFishbonesTransmissibilityCalculationFeatureImp::findFishboneImportedLate
|
||||
const RicExportCompletionDataSettingsUi& settings)
|
||||
{
|
||||
RiaEclipseUnitTools::UnitSystem unitSystem = settings.caseToApply->eclipseCaseData()->unitsType();
|
||||
std::set<size_t> wellPathCells = RicWellPathExportCompletionDataFeature::findIntersectedCells(settings.caseToApply()->eclipseCaseData(),
|
||||
std::set<size_t> wellPathCells = RicFishbonesTransmissibilityCalculationFeatureImp::findIntersectedCells(settings.caseToApply()->eclipseCaseData(),
|
||||
wellPath->wellPathGeometry()->m_wellPathPoints);
|
||||
bool isMainBore = false;
|
||||
|
||||
@ -237,3 +252,19 @@ void RicFishbonesTransmissibilityCalculationFeatureImp::findMainWellBoreParts(st
|
||||
wellBorePartsInCells[cell.globCellIndex].push_back(wellBorePart);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<size_t> RicFishbonesTransmissibilityCalculationFeatureImp::findIntersectedCells(const RigEclipseCaseData* caseData, const std::vector<cvf::Vec3d>& coords)
|
||||
{
|
||||
std::set<size_t> cells;
|
||||
|
||||
std::vector<HexIntersectionInfo> intersections = RigWellPathIntersectionTools::findRawHexCellIntersections(caseData->mainGrid(), coords);
|
||||
for (auto intersection : intersections)
|
||||
{
|
||||
cells.insert(intersection.m_hexIndex);
|
||||
}
|
||||
|
||||
return cells;
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 Statoil ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cvfBase.h"
|
||||
#include "cvfVector3.h"
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <set>
|
||||
|
||||
class RigCompletionData;
|
||||
class RimWellPath;
|
||||
class RicExportCompletionDataSettingsUi;
|
||||
class RigEclipseCaseData;
|
||||
|
||||
struct WellBorePartForTransCalc;
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicFishbonesTransmissibilityCalculationFeatureImp
|
||||
{
|
||||
public:
|
||||
static std::vector<RigCompletionData> generateFishboneCompdatValuesUsingAdjustedCellVolume(const RimWellPath* wellPath,
|
||||
const RicExportCompletionDataSettingsUi& settings);
|
||||
|
||||
|
||||
private:
|
||||
static void findFishboneLateralsWellBoreParts(std::map<size_t,
|
||||
std::vector<WellBorePartForTransCalc>>& wellBorePartsInCells,
|
||||
const RimWellPath* wellPath,
|
||||
const RicExportCompletionDataSettingsUi& settings);
|
||||
|
||||
static void findFishboneImportedLateralsWellBoreParts(std::map<size_t, std::vector<WellBorePartForTransCalc>>& wellBorePartsInCells,
|
||||
const RimWellPath* wellPath,
|
||||
const RicExportCompletionDataSettingsUi& settings);
|
||||
|
||||
static void findMainWellBoreParts(std::map<size_t, std::vector<WellBorePartForTransCalc>>& wellBorePartsInCells,
|
||||
const RimWellPath* wellPath,
|
||||
const RicExportCompletionDataSettingsUi& settings);
|
||||
|
||||
static std::set<size_t> findIntersectedCells(const RigEclipseCaseData* caseData, const std::vector<cvf::Vec3d>& coords);
|
||||
};
|
@ -0,0 +1,204 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 Statoil ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicWellPathExportCompletionDataFeature.h"
|
||||
#include "RicWellPathExportCompletionDataFeatureImpl.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RicExportFeatureImpl.h"
|
||||
|
||||
#include "RimDialogData.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSimWellInView.h"
|
||||
#include "RimSimWellInViewCollection.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
#include "cafPdmUiPropertyViewDialog.h"
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicWellPathExportCompletionDataFeature, "RicWellPathExportCompletionDataFeature");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicWellPathExportCompletionDataFeature::isCommandEnabled()
|
||||
{
|
||||
std::vector<RimWellPath*> wellPaths = selectedWellPaths();
|
||||
std::vector<RimSimWellInView*> simWells = selectedSimWells();
|
||||
|
||||
if (wellPaths.empty() && simWells.empty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!wellPaths.empty() && !simWells.empty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
std::set<RimEclipseCase*> eclipseCases;
|
||||
for (auto simWell : simWells)
|
||||
{
|
||||
RimEclipseCase* eclipseCase;
|
||||
simWell->firstAncestorOrThisOfType(eclipseCase);
|
||||
eclipseCases.insert(eclipseCase);
|
||||
}
|
||||
if (eclipseCases.size() > 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicWellPathExportCompletionDataFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
std::vector<RimWellPath*> wellPaths = selectedWellPaths();
|
||||
std::vector<RimSimWellInView*> simWells = selectedSimWells();
|
||||
|
||||
CVF_ASSERT(wellPaths.size() > 0 || simWells.size() > 0);
|
||||
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
RimProject* project = app->project();
|
||||
|
||||
QString projectFolder = app->currentProjectPath();
|
||||
QString defaultDir = RiaApplication::instance()->lastUsedDialogDirectoryWithFallback("COMPLETIONS", projectFolder);
|
||||
|
||||
bool onlyWellPathCollectionSelected = noWellPathsSelectedDirectly();
|
||||
RicExportCompletionDataSettingsUi* exportSettings =
|
||||
project->dialogData()->exportCompletionData(onlyWellPathCollectionSelected);
|
||||
|
||||
if (wellPaths.empty())
|
||||
{
|
||||
exportSettings->showForSimWells();
|
||||
}
|
||||
else
|
||||
{
|
||||
exportSettings->showForWellPath();
|
||||
}
|
||||
|
||||
if (!exportSettings->caseToApply())
|
||||
{
|
||||
std::vector<RimCase*> cases;
|
||||
app->project()->allCases(cases);
|
||||
for (auto c : cases)
|
||||
{
|
||||
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>(c);
|
||||
if (eclipseCase != nullptr)
|
||||
{
|
||||
exportSettings->caseToApply = eclipseCase;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (exportSettings->folder().isEmpty()) exportSettings->folder = defaultDir;
|
||||
|
||||
caf::PdmUiPropertyViewDialog propertyDialog(RiuMainWindow::instance(), exportSettings, "Export Completion Data", "");
|
||||
RicExportFeatureImpl::configureForExport(&propertyDialog);
|
||||
|
||||
if (propertyDialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
RiaApplication::instance()->setLastUsedDialogDirectory("COMPLETIONS", exportSettings->folder);
|
||||
|
||||
RicWellPathExportCompletionDataFeatureImpl::exportCompletions(wellPaths, simWells, *exportSettings);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicWellPathExportCompletionDataFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
actionToSetup->setText("Export Completion Data");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimWellPath*> RicWellPathExportCompletionDataFeature::selectedWellPaths()
|
||||
{
|
||||
std::vector<RimWellPath*> wellPaths;
|
||||
caf::SelectionManager::instance()->objectsByType(&wellPaths);
|
||||
|
||||
if (wellPaths.empty())
|
||||
{
|
||||
std::vector<RimWellPathCollection*> wellPathCollections;
|
||||
caf::SelectionManager::instance()->objectsByType(&wellPathCollections);
|
||||
|
||||
for (auto wellPathCollection : wellPathCollections)
|
||||
{
|
||||
for (auto wellPath : wellPathCollection->wellPaths())
|
||||
{
|
||||
wellPaths.push_back(wellPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::set<RimWellPath*> uniqueWellPaths(wellPaths.begin(), wellPaths.end());
|
||||
wellPaths.assign(uniqueWellPaths.begin(), uniqueWellPaths.end());
|
||||
return wellPaths;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicWellPathExportCompletionDataFeature::noWellPathsSelectedDirectly()
|
||||
{
|
||||
std::vector<RimWellPath*> wellPaths;
|
||||
caf::SelectionManager::instance()->objectsByType(&wellPaths);
|
||||
|
||||
if (wellPaths.empty())
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSimWellInView*> RicWellPathExportCompletionDataFeature::selectedSimWells()
|
||||
{
|
||||
std::vector<RimSimWellInView*> simWells;
|
||||
caf::SelectionManager::instance()->objectsByType(&simWells);
|
||||
|
||||
std::vector<RimSimWellInViewCollection*> simWellCollections;
|
||||
caf::SelectionManager::instance()->objectsByType(&simWellCollections);
|
||||
|
||||
for (auto simWellCollection : simWellCollections)
|
||||
{
|
||||
for (auto simWell : simWellCollection->wells())
|
||||
{
|
||||
simWells.push_back(simWell);
|
||||
}
|
||||
}
|
||||
|
||||
std::set<RimSimWellInView*> uniqueSimWells(simWells.begin(), simWells.end());
|
||||
simWells.assign(uniqueSimWells.begin(), uniqueSimWells.end());
|
||||
|
||||
return simWells;
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 Statoil ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
class RimSimWellInView;
|
||||
class RimWellPath;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicWellPathExportCompletionDataFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
virtual bool isCommandEnabled() override;
|
||||
virtual void onActionTriggered(bool isChecked) override;
|
||||
virtual void setupActionLook(QAction* actionToSetup) override;
|
||||
|
||||
private:
|
||||
std::vector<RimWellPath*> selectedWellPaths();
|
||||
std::vector<RimSimWellInView*> selectedSimWells();
|
||||
|
||||
bool noWellPathsSelectedDirectly();
|
||||
};
|
@ -16,7 +16,7 @@
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicWellPathExportCompletionDataFeature.h"
|
||||
#include "RicWellPathExportCompletionDataFeatureImpl.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaLogging.h"
|
||||
@ -24,30 +24,26 @@
|
||||
|
||||
#include "RicExportCompletionDataSettingsUi.h"
|
||||
#include "RicExportFeatureImpl.h"
|
||||
#include "RicFishbonesTransmissibilityCalculationFeatureImp.h"
|
||||
#include "RicExportFractureCompletionsImpl.h"
|
||||
#include "RicFishbonesTransmissibilityCalculationFeatureImp.h"
|
||||
|
||||
#include "RifEclipseDataTableFormatter.h"
|
||||
|
||||
#include "RigActiveCellInfo.h"
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigMainGrid.h"
|
||||
#include "RigResultAccessorFactory.h"
|
||||
|
||||
#include "RigTransmissibilityEquations.h"
|
||||
|
||||
#include "RigWellLogExtractionTools.h"
|
||||
#include "RigWellLogExtractor.h"
|
||||
#include "RigWellPath.h"
|
||||
#include "RigWellPathIntersectionTools.h"
|
||||
|
||||
#include "RimDialogData.h"
|
||||
#include "RimSimWellInViewCollection.h"
|
||||
#include "RimFishboneWellPath.h"
|
||||
#include "RimFishboneWellPathCollection.h"
|
||||
#include "RimFishbonesCollection.h"
|
||||
#include "RimFishbonesMultipleSubs.h"
|
||||
#include "RimPerforationCollection.h"
|
||||
#include "RimPerforationInterval.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSimWellInView.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
@ -61,179 +57,14 @@
|
||||
|
||||
#include "cvfPlane.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QDir>
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
#include "RigWellLogExtractor.h"
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicWellPathExportCompletionDataFeature, "RicWellPathExportCompletionDataFeature");
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicWellPathExportCompletionDataFeature::isCommandEnabled()
|
||||
{
|
||||
std::vector<RimWellPath*> wellPaths = selectedWellPaths();
|
||||
std::vector<RimSimWellInView*> simWells = selectedSimWells();
|
||||
|
||||
if (wellPaths.empty() && simWells.empty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!wellPaths.empty() && !simWells.empty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
std::set<RimEclipseCase*> eclipseCases;
|
||||
for (auto simWell : simWells)
|
||||
{
|
||||
RimEclipseCase* eclipseCase;
|
||||
simWell->firstAncestorOrThisOfType(eclipseCase);
|
||||
eclipseCases.insert(eclipseCase);
|
||||
}
|
||||
if (eclipseCases.size() > 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicWellPathExportCompletionDataFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
std::vector<RimWellPath*> wellPaths = selectedWellPaths();
|
||||
std::vector<RimSimWellInView*> simWells = selectedSimWells();
|
||||
|
||||
CVF_ASSERT(wellPaths.size() > 0 || simWells.size() > 0);
|
||||
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
RimProject* project = app->project();
|
||||
|
||||
QString projectFolder = app->currentProjectPath();
|
||||
QString defaultDir = RiaApplication::instance()->lastUsedDialogDirectoryWithFallback("COMPLETIONS", projectFolder);
|
||||
|
||||
bool onlyWellPathCollectionSelected = noWellPathsSelectedDirectly();
|
||||
RicExportCompletionDataSettingsUi* exportSettings = project->dialogData()->exportCompletionData(onlyWellPathCollectionSelected);
|
||||
|
||||
if (wellPaths.empty())
|
||||
{
|
||||
exportSettings->showForSimWells();
|
||||
}
|
||||
else
|
||||
{
|
||||
exportSettings->showForWellPath();
|
||||
}
|
||||
|
||||
if (!exportSettings->caseToApply())
|
||||
{
|
||||
std::vector<RimCase*> cases;
|
||||
app->project()->allCases(cases);
|
||||
for (auto c : cases)
|
||||
{
|
||||
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>(c);
|
||||
if (eclipseCase != nullptr)
|
||||
{
|
||||
exportSettings->caseToApply = eclipseCase;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(exportSettings->folder().isEmpty()) exportSettings->folder = defaultDir;
|
||||
|
||||
caf::PdmUiPropertyViewDialog propertyDialog(RiuMainWindow::instance(), exportSettings, "Export Completion Data", "");
|
||||
RicExportFeatureImpl::configureForExport(&propertyDialog);
|
||||
|
||||
if (propertyDialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
RiaApplication::instance()->setLastUsedDialogDirectory("COMPLETIONS", exportSettings->folder);
|
||||
|
||||
exportCompletions(wellPaths, simWells, *exportSettings);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicWellPathExportCompletionDataFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
actionToSetup->setText("Export Completion Data");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimWellPath*> RicWellPathExportCompletionDataFeature::selectedWellPaths()
|
||||
{
|
||||
std::vector<RimWellPath*> wellPaths;
|
||||
caf::SelectionManager::instance()->objectsByType(&wellPaths);
|
||||
|
||||
if (wellPaths.empty())
|
||||
{
|
||||
std::vector<RimWellPathCollection*> wellPathCollections;
|
||||
caf::SelectionManager::instance()->objectsByType(&wellPathCollections);
|
||||
|
||||
for (auto wellPathCollection : wellPathCollections)
|
||||
{
|
||||
for (auto wellPath : wellPathCollection->wellPaths())
|
||||
{
|
||||
wellPaths.push_back(wellPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::set<RimWellPath*> uniqueWellPaths(wellPaths.begin(), wellPaths.end());
|
||||
wellPaths.assign(uniqueWellPaths.begin(), uniqueWellPaths.end());
|
||||
return wellPaths;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicWellPathExportCompletionDataFeature::noWellPathsSelectedDirectly()
|
||||
{
|
||||
std::vector<RimWellPath*> wellPaths;
|
||||
caf::SelectionManager::instance()->objectsByType(&wellPaths);
|
||||
|
||||
if (wellPaths.empty()) return true;
|
||||
else return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSimWellInView*> RicWellPathExportCompletionDataFeature::selectedSimWells()
|
||||
{
|
||||
std::vector<RimSimWellInView*> simWells;
|
||||
caf::SelectionManager::instance()->objectsByType(&simWells);
|
||||
|
||||
std::vector<RimSimWellInViewCollection*> simWellCollections;
|
||||
caf::SelectionManager::instance()->objectsByType(&simWellCollections);
|
||||
|
||||
for (auto simWellCollection : simWellCollections)
|
||||
{
|
||||
for (auto simWell : simWellCollection->wells())
|
||||
{
|
||||
simWells.push_back(simWell);
|
||||
}
|
||||
}
|
||||
|
||||
std::set<RimSimWellInView*> uniqueSimWells(simWells.begin(), simWells.end());
|
||||
simWells.assign(uniqueSimWells.begin(), uniqueSimWells.end());
|
||||
|
||||
return simWells;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicWellPathExportCompletionDataFeature::exportCompletions(const std::vector<RimWellPath*>& wellPaths,
|
||||
void RicWellPathExportCompletionDataFeatureImpl::exportCompletions(const std::vector<RimWellPath*>& wellPaths,
|
||||
const std::vector<RimSimWellInView*>& simWells,
|
||||
const RicExportCompletionDataSettingsUi& exportSettings)
|
||||
{
|
||||
@ -288,7 +119,7 @@ void RicWellPathExportCompletionDataFeature::exportCompletions(const std::vector
|
||||
}
|
||||
}
|
||||
|
||||
std::map<IJKCellIndex, std::vector<RigCompletionData> > completionsPerEclipseCell;
|
||||
std::map<RigCompletionDataGridCell, std::vector<RigCompletionData> > completionsPerEclipseCell;
|
||||
|
||||
// FractureTransmissibilityExportInformation
|
||||
std::unique_ptr<QTextStream> fractureTransmissibilityExportInformationStream = nullptr;
|
||||
@ -371,21 +202,21 @@ void RicWellPathExportCompletionDataFeature::exportCompletions(const std::vector
|
||||
}
|
||||
|
||||
const QString fileName = QString("UnifiedCompletions_%1").arg(eclipseCaseName);
|
||||
printCompletionsToFile(exportSettings.folder, fileName, completions, exportSettings.compdatExport);
|
||||
printCompletionsToFiles(exportSettings.folder, fileName, completions, exportSettings.compdatExport);
|
||||
progress.incrementProgress();
|
||||
}
|
||||
else if (exportSettings.fileSplit == RicExportCompletionDataSettingsUi::SPLIT_ON_WELL)
|
||||
{
|
||||
for (auto wellPath : usedWellPaths)
|
||||
{
|
||||
std::map<IJKCellIndex, std::vector<RigCompletionData> > filteredWellCompletions = getCompletionsForWell(completionsPerEclipseCell, wellPath->completions()->wellNameForExport());
|
||||
std::map<RigCompletionDataGridCell, std::vector<RigCompletionData> > filteredWellCompletions = getCompletionsForWell(completionsPerEclipseCell, wellPath->completions()->wellNameForExport());
|
||||
std::vector<RigCompletionData> completions;
|
||||
for (auto& data : filteredWellCompletions)
|
||||
{
|
||||
completions.push_back(combineEclipseCellCompletions(data.second, exportSettings));
|
||||
}
|
||||
std::vector<RigCompletionData> wellCompletions;
|
||||
for (auto completion : completions)
|
||||
for (const auto& completion : completions)
|
||||
{
|
||||
if (completion.wellName() == wellPath->completions()->wellNameForExport())
|
||||
{
|
||||
@ -396,7 +227,7 @@ void RicWellPathExportCompletionDataFeature::exportCompletions(const std::vector
|
||||
if (wellCompletions.empty()) continue;
|
||||
|
||||
QString fileName = QString("%1_unifiedCompletions_%2").arg(wellPath->name()).arg(eclipseCaseName);
|
||||
printCompletionsToFile(exportSettings.folder, fileName, wellCompletions, exportSettings.compdatExport);
|
||||
printCompletionsToFiles(exportSettings.folder, fileName, wellCompletions, exportSettings.compdatExport);
|
||||
progress.incrementProgress();
|
||||
}
|
||||
}
|
||||
@ -404,7 +235,7 @@ void RicWellPathExportCompletionDataFeature::exportCompletions(const std::vector
|
||||
{
|
||||
for (auto wellPath : usedWellPaths)
|
||||
{
|
||||
std::map<IJKCellIndex, std::vector<RigCompletionData> > filteredWellCompletions = getCompletionsForWell(completionsPerEclipseCell, wellPath->completions()->wellNameForExport());
|
||||
std::map<RigCompletionDataGridCell, std::vector<RigCompletionData> > filteredWellCompletions = getCompletionsForWell(completionsPerEclipseCell, wellPath->completions()->wellNameForExport());
|
||||
std::vector<RigCompletionData> completions;
|
||||
for (auto& data : filteredWellCompletions)
|
||||
{
|
||||
@ -415,7 +246,7 @@ void RicWellPathExportCompletionDataFeature::exportCompletions(const std::vector
|
||||
if (!fishbonesCompletions.empty())
|
||||
{
|
||||
QString fileName = QString("%1_Fishbones_%2").arg(wellPath->name()).arg(eclipseCaseName);
|
||||
printCompletionsToFile(exportSettings.folder, fileName, fishbonesCompletions, exportSettings.compdatExport);
|
||||
printCompletionsToFiles(exportSettings.folder, fileName, fishbonesCompletions, exportSettings.compdatExport);
|
||||
}
|
||||
progress.incrementProgress();
|
||||
}
|
||||
@ -424,7 +255,7 @@ void RicWellPathExportCompletionDataFeature::exportCompletions(const std::vector
|
||||
if (!perforationCompletions.empty())
|
||||
{
|
||||
QString fileName = QString("%1_Perforations_%2").arg(wellPath->name()).arg(eclipseCaseName);
|
||||
printCompletionsToFile(exportSettings.folder, fileName, perforationCompletions, exportSettings.compdatExport);
|
||||
printCompletionsToFiles(exportSettings.folder, fileName, perforationCompletions, exportSettings.compdatExport);
|
||||
}
|
||||
progress.incrementProgress();
|
||||
}
|
||||
@ -433,7 +264,7 @@ void RicWellPathExportCompletionDataFeature::exportCompletions(const std::vector
|
||||
if (!fractureCompletions.empty())
|
||||
{
|
||||
QString fileName = QString("%1_Fractures_%2").arg(wellPath->name()).arg(eclipseCaseName);
|
||||
printCompletionsToFile(exportSettings.folder, fileName, fractureCompletions, exportSettings.compdatExport);
|
||||
printCompletionsToFiles(exportSettings.folder, fileName, fractureCompletions, exportSettings.compdatExport);
|
||||
}
|
||||
progress.incrementProgress();
|
||||
}
|
||||
@ -446,14 +277,14 @@ void RicWellPathExportCompletionDataFeature::exportCompletions(const std::vector
|
||||
{
|
||||
for (auto simWell : simWells)
|
||||
{
|
||||
std::map<IJKCellIndex, std::vector<RigCompletionData> > filteredWellCompletions = getCompletionsForWell(completionsPerEclipseCell, simWell->name());
|
||||
std::map<RigCompletionDataGridCell, std::vector<RigCompletionData> > filteredWellCompletions = getCompletionsForWell(completionsPerEclipseCell, simWell->name());
|
||||
std::vector<RigCompletionData> completions;
|
||||
for (auto& data : filteredWellCompletions)
|
||||
{
|
||||
completions.push_back(combineEclipseCellCompletions(data.second, exportSettings));
|
||||
}
|
||||
std::vector<RigCompletionData> wellCompletions;
|
||||
for (auto completion : completions)
|
||||
for (const auto& completion : completions)
|
||||
{
|
||||
if (completion.wellName() == simWell->name())
|
||||
{
|
||||
@ -466,7 +297,7 @@ void RicWellPathExportCompletionDataFeature::exportCompletions(const std::vector
|
||||
QString fileName = exportSettings.fileSplit == RicExportCompletionDataSettingsUi::SPLIT_ON_WELL ?
|
||||
QString("%1_unifiedCompletions_%2").arg(simWell->name()).arg(eclipseCaseName) :
|
||||
QString("%1_Fractures_%2").arg(simWell->name()).arg(eclipseCaseName);
|
||||
printCompletionsToFile(exportSettings.folder, fileName, wellCompletions, exportSettings.compdatExport);
|
||||
printCompletionsToFiles(exportSettings.folder, fileName, wellCompletions, exportSettings.compdatExport);
|
||||
progress.incrementProgress();
|
||||
}
|
||||
}
|
||||
@ -476,14 +307,12 @@ 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)
|
||||
{
|
||||
CVF_ASSERT(!completions.empty());
|
||||
QString wellName = completions[0].wellName();
|
||||
IJKCellIndex cellIndexIJK = completions[0].cellIndex();
|
||||
RigMainGrid* grid = settings.caseToApply->eclipseCaseData()->mainGrid();
|
||||
size_t cellIndex = grid->cellIndexFromIJK(cellIndexIJK.i, cellIndexIJK.j, cellIndexIJK.k);
|
||||
RigCompletionDataGridCell cellIndexIJK = completions[0].completionDataGridCell();
|
||||
RigCompletionData::CompletionType completionType = completions[0].completionType();
|
||||
|
||||
//completion type, skin factor, well bore diameter and cell direction are taken from (first) main bore,
|
||||
@ -515,7 +344,7 @@ RigCompletionData RicWellPathExportCompletionDataFeature::combineEclipseCellComp
|
||||
|
||||
if (completion.completionType() != completions[0].completionType())
|
||||
{
|
||||
QString errorMessage = QString("Cannot combine completions of different types in same cell [%1, %2, %3]").arg(cellIndexIJK.i + 1).arg(cellIndexIJK.j + 1).arg(cellIndexIJK.k + 1);
|
||||
QString errorMessage = QString("Cannot combine completions of different types in same cell %1").arg(cellIndexIJK.oneBasedLocalCellIndexString());
|
||||
RiaLogging::error(errorMessage);
|
||||
resultCompletion.addMetadata("ERROR", errorMessage);
|
||||
return resultCompletion; //Returning empty completion, should not be exported
|
||||
@ -523,7 +352,7 @@ RigCompletionData RicWellPathExportCompletionDataFeature::combineEclipseCellComp
|
||||
|
||||
if (completion.wellName() != completions[0].wellName())
|
||||
{
|
||||
QString errorMessage = QString("Cannot combine completions from different wells in same cell [%1, %2, %3]").arg(cellIndexIJK.i + 1).arg(cellIndexIJK.j + 1).arg(cellIndexIJK.k + 1);
|
||||
QString errorMessage = QString("Cannot combine completions of different types in same cell %1").arg(cellIndexIJK.oneBasedLocalCellIndexString());
|
||||
RiaLogging::error(errorMessage);
|
||||
resultCompletion.addMetadata("ERROR", errorMessage);
|
||||
return resultCompletion; //Returning empty completion, should not be exported
|
||||
@ -531,7 +360,7 @@ RigCompletionData RicWellPathExportCompletionDataFeature::combineEclipseCellComp
|
||||
|
||||
if (completion.transmissibility() == HUGE_VAL)
|
||||
{
|
||||
QString errorMessage = QString("Transmissibility calculation has failed for cell [%1, %2, %3]").arg(cellIndexIJK.i + 1).arg(cellIndexIJK.j + 1).arg(cellIndexIJK.k + 1);
|
||||
QString errorMessage = QString("Transmissibility calculation has failed for cell %1").arg(cellIndexIJK.oneBasedLocalCellIndexString());
|
||||
RiaLogging::error(errorMessage);
|
||||
resultCompletion.addMetadata("ERROR", errorMessage);
|
||||
return resultCompletion; //Returning empty completion, should not be exported
|
||||
@ -553,10 +382,10 @@ RigCompletionData RicWellPathExportCompletionDataFeature::combineEclipseCellComp
|
||||
else if (settings.compdatExport == RicExportCompletionDataSettingsUi::WPIMULT_AND_DEFAULT_CONNECTION_FACTORS)
|
||||
{
|
||||
//calculate trans for main bore - but as Eclipse will do it!
|
||||
double transmissibilityEclipseCalculation = RicWellPathExportCompletionDataFeature::calculateTransmissibilityAsEclipseDoes(settings.caseToApply(),
|
||||
double transmissibilityEclipseCalculation = RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibilityAsEclipseDoes(settings.caseToApply(),
|
||||
skinfactor,
|
||||
wellBoreDiameter / 2,
|
||||
cellIndex,
|
||||
cellIndexIJK.globalCellIndex(),
|
||||
cellDirection);
|
||||
|
||||
double wpimult = totalTrans / transmissibilityEclipseCalculation;
|
||||
@ -573,14 +402,63 @@ RigCompletionData RicWellPathExportCompletionDataFeature::combineEclipseCellComp
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicWellPathExportCompletionDataFeature::printCompletionsToFile(const QString& folderName,
|
||||
void RicWellPathExportCompletionDataFeatureImpl::printCompletionsToFiles(const QString& folderName,
|
||||
const QString& fileName,
|
||||
std::vector<RigCompletionData>& completions,
|
||||
RicExportCompletionDataSettingsUi::CompdatExportType exportType)
|
||||
{
|
||||
//TODO: Check that completion is ready for export
|
||||
// Sort completions based on grid they belong to
|
||||
std::vector<RigCompletionData> completionsForMainGrid;
|
||||
|
||||
QDir exportFolder = QDir(folderName);
|
||||
std::map<QString, std::vector<RigCompletionData>> completionsForSubGrids;
|
||||
|
||||
for (const auto& completion : completions)
|
||||
{
|
||||
QString gridName = completion.completionDataGridCell().lgrName();
|
||||
if (gridName.isEmpty())
|
||||
{
|
||||
completionsForMainGrid.push_back(completion);
|
||||
}
|
||||
else
|
||||
{
|
||||
auto it = completionsForSubGrids.find(gridName);
|
||||
if (it == completionsForSubGrids.end())
|
||||
{
|
||||
completionsForSubGrids.insert(std::pair<QString, std::vector<RigCompletionData>>(gridName, std::vector<RigCompletionData>{completion}));
|
||||
}
|
||||
else
|
||||
{
|
||||
it->second.push_back(completion);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!completionsForMainGrid.empty())
|
||||
{
|
||||
std::map<QString, std::vector<RigCompletionData>> completionsForGrid;
|
||||
completionsForGrid.insert(std::pair<QString, std::vector<RigCompletionData>>("", completionsForMainGrid));
|
||||
|
||||
printCompletionsToFile(folderName, fileName, completionsForGrid, exportType);
|
||||
}
|
||||
|
||||
if (!completionsForSubGrids.empty())
|
||||
{
|
||||
QString lgrFileName = fileName + "_LGR";
|
||||
printCompletionsToFile(folderName, lgrFileName, completionsForSubGrids, exportType);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicWellPathExportCompletionDataFeatureImpl::printCompletionsToFile(const QString& folderName,
|
||||
const QString& fileName,
|
||||
const std::map<QString, std::vector<RigCompletionData>>& completionsPerGrid,
|
||||
RicExportCompletionDataSettingsUi::CompdatExportType exportType)
|
||||
{
|
||||
if (completionsPerGrid.empty()) return;
|
||||
|
||||
QDir exportFolder(folderName);
|
||||
|
||||
if (!exportFolder.exists())
|
||||
{
|
||||
@ -591,7 +469,7 @@ void RicWellPathExportCompletionDataFeature::printCompletionsToFile(const QStrin
|
||||
|
||||
QString filePath = exportFolder.filePath(fileName);
|
||||
QFile exportFile(filePath);
|
||||
if (!exportFile.open(QIODevice::WriteOnly))
|
||||
if (!exportFile.open(QIODevice::WriteOnly))
|
||||
{
|
||||
RiaLogging::error(QString("Export Completions Data: Could not open the file: %1").arg(filePath));
|
||||
return;
|
||||
@ -600,16 +478,21 @@ void RicWellPathExportCompletionDataFeature::printCompletionsToFile(const QStrin
|
||||
QTextStream stream(&exportFile);
|
||||
RifEclipseDataTableFormatter formatter(stream);
|
||||
|
||||
// Sort by well name / cell index
|
||||
std::sort(completions.begin(), completions.end());
|
||||
|
||||
// Print completion data
|
||||
generateCompdatTable(formatter, completions);
|
||||
|
||||
|
||||
if (exportType == RicExportCompletionDataSettingsUi::WPIMULT_AND_DEFAULT_CONNECTION_FACTORS)
|
||||
for (const auto& gridCompletions : completionsPerGrid)
|
||||
{
|
||||
generateWpimultTable(formatter, completions);
|
||||
std::vector<RigCompletionData> completions = gridCompletions.second;
|
||||
|
||||
// Sort by well name / cell index
|
||||
std::sort(completions.begin(), completions.end());
|
||||
|
||||
// Print completion data
|
||||
QString gridName = gridCompletions.first;
|
||||
generateCompdatTable(formatter, gridName, completions);
|
||||
|
||||
if (exportType == RicExportCompletionDataSettingsUi::WPIMULT_AND_DEFAULT_CONNECTION_FACTORS)
|
||||
{
|
||||
generateWpimultTable(formatter, gridName, completions);
|
||||
}
|
||||
}
|
||||
|
||||
RiaLogging::info(QString("Successfully exported completion data to %1").arg(filePath));
|
||||
@ -618,12 +501,12 @@ 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,
|
||||
RigCompletionData::CompletionType completionType)
|
||||
{
|
||||
std::vector<RigCompletionData> filteredCompletions;
|
||||
for (auto completion : completions)
|
||||
for (const auto& completion : completions)
|
||||
{
|
||||
if (completion.wellName() == wellName && completion.completionType() == completionType)
|
||||
{
|
||||
@ -636,9 +519,9 @@ std::vector<RigCompletionData> RicWellPathExportCompletionDataFeature::getComple
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::map<IJKCellIndex, std::vector<RigCompletionData> > RicWellPathExportCompletionDataFeature::getCompletionsForWell(const std::map<IJKCellIndex, 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<IJKCellIndex, std::vector<RigCompletionData> > wellCompletions;
|
||||
std::map<RigCompletionDataGridCell, std::vector<RigCompletionData> > wellCompletions;
|
||||
|
||||
for (const auto& it : cellToCompletionMap)
|
||||
{
|
||||
@ -657,26 +540,53 @@ std::map<IJKCellIndex, std::vector<RigCompletionData> > RicWellPathExportComplet
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicWellPathExportCompletionDataFeature::generateCompdatTable(RifEclipseDataTableFormatter& formatter, const std::vector<RigCompletionData>& completionData)
|
||||
void RicWellPathExportCompletionDataFeatureImpl::generateCompdatTable(RifEclipseDataTableFormatter& formatter, const QString& gridName, const std::vector<RigCompletionData>& completionData)
|
||||
{
|
||||
std::vector<RifEclipseOutputTableColumn> header = {
|
||||
RifEclipseOutputTableColumn("Well"),
|
||||
RifEclipseOutputTableColumn("I"),
|
||||
RifEclipseOutputTableColumn("J"),
|
||||
RifEclipseOutputTableColumn("K1"),
|
||||
RifEclipseOutputTableColumn("K2"),
|
||||
RifEclipseOutputTableColumn("Status"),
|
||||
RifEclipseOutputTableColumn("SAT"),
|
||||
RifEclipseOutputTableColumn("TR", RifEclipseOutputTableDoubleFormatting(RifEclipseOutputTableDoubleFormat::RIF_SCIENTIFIC)),
|
||||
RifEclipseOutputTableColumn("DIAM"),
|
||||
RifEclipseOutputTableColumn("KH"),
|
||||
RifEclipseOutputTableColumn("S"),
|
||||
RifEclipseOutputTableColumn("Df"),
|
||||
RifEclipseOutputTableColumn("DIR"),
|
||||
RifEclipseOutputTableColumn("r0")
|
||||
};
|
||||
std::vector<RifEclipseOutputTableColumn> header;
|
||||
|
||||
formatter.keyword("COMPDAT");
|
||||
if (gridName.isEmpty())
|
||||
{
|
||||
header = {
|
||||
RifEclipseOutputTableColumn("Well"),
|
||||
RifEclipseOutputTableColumn("I"),
|
||||
RifEclipseOutputTableColumn("J"),
|
||||
RifEclipseOutputTableColumn("K1"),
|
||||
RifEclipseOutputTableColumn("K2"),
|
||||
RifEclipseOutputTableColumn("Status"),
|
||||
RifEclipseOutputTableColumn("SAT"),
|
||||
RifEclipseOutputTableColumn("TR", RifEclipseOutputTableDoubleFormatting(RifEclipseOutputTableDoubleFormat::RIF_SCIENTIFIC)),
|
||||
RifEclipseOutputTableColumn("DIAM"),
|
||||
RifEclipseOutputTableColumn("KH"),
|
||||
RifEclipseOutputTableColumn("S"),
|
||||
RifEclipseOutputTableColumn("Df"),
|
||||
RifEclipseOutputTableColumn("DIR"),
|
||||
RifEclipseOutputTableColumn("r0")
|
||||
};
|
||||
|
||||
formatter.keyword("COMPDAT");
|
||||
}
|
||||
else
|
||||
{
|
||||
header = {
|
||||
RifEclipseOutputTableColumn("Well"),
|
||||
RifEclipseOutputTableColumn("LgrName"),
|
||||
RifEclipseOutputTableColumn("I"),
|
||||
RifEclipseOutputTableColumn("J"),
|
||||
RifEclipseOutputTableColumn("K1"),
|
||||
RifEclipseOutputTableColumn("K2"),
|
||||
RifEclipseOutputTableColumn("Status"),
|
||||
RifEclipseOutputTableColumn("SAT"),
|
||||
RifEclipseOutputTableColumn("TR", RifEclipseOutputTableDoubleFormatting(RifEclipseOutputTableDoubleFormat::RIF_SCIENTIFIC)),
|
||||
RifEclipseOutputTableColumn("DIAM"),
|
||||
RifEclipseOutputTableColumn("KH"),
|
||||
RifEclipseOutputTableColumn("S"),
|
||||
RifEclipseOutputTableColumn("Df"),
|
||||
RifEclipseOutputTableColumn("DIR"),
|
||||
RifEclipseOutputTableColumn("r0")
|
||||
};
|
||||
|
||||
formatter.keyword("COMPDATL");
|
||||
}
|
||||
formatter.header(header);
|
||||
|
||||
for (const RigCompletionData& data : completionData)
|
||||
@ -692,7 +602,13 @@ void RicWellPathExportCompletionDataFeature::generateCompdatTable(RifEclipseData
|
||||
formatter.comment(QString("%1 : %2").arg(metadata.name).arg(metadata.comment));
|
||||
}
|
||||
formatter.add(data.wellName());
|
||||
formatter.addZeroBasedCellIndex(data.cellIndex().i).addZeroBasedCellIndex(data.cellIndex().j).addZeroBasedCellIndex(data.cellIndex().k).addZeroBasedCellIndex(data.cellIndex().k);
|
||||
|
||||
if (!gridName.isEmpty())
|
||||
{
|
||||
formatter.add(gridName);
|
||||
}
|
||||
|
||||
formatter.addZeroBasedCellIndex(data.completionDataGridCell().localCellIndexI()).addZeroBasedCellIndex(data.completionDataGridCell().localCellIndexJ()).addZeroBasedCellIndex(data.completionDataGridCell().localCellIndexK()).addZeroBasedCellIndex(data.completionDataGridCell().localCellIndexK());
|
||||
switch (data.connectionState())
|
||||
{
|
||||
case OPEN:
|
||||
@ -744,16 +660,35 @@ void RicWellPathExportCompletionDataFeature::generateCompdatTable(RifEclipseData
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicWellPathExportCompletionDataFeature::generateWpimultTable(RifEclipseDataTableFormatter& formatter, const std::vector<RigCompletionData>& completionData)
|
||||
void RicWellPathExportCompletionDataFeatureImpl::generateWpimultTable(RifEclipseDataTableFormatter& formatter,
|
||||
const QString& gridName,
|
||||
const std::vector<RigCompletionData>& completionData)
|
||||
{
|
||||
std::vector<RifEclipseOutputTableColumn> header = {
|
||||
RifEclipseOutputTableColumn("Well"),
|
||||
RifEclipseOutputTableColumn("Mult"),
|
||||
RifEclipseOutputTableColumn("I"),
|
||||
RifEclipseOutputTableColumn("J"),
|
||||
RifEclipseOutputTableColumn("K"),
|
||||
};
|
||||
formatter.keyword("WPIMULT");
|
||||
std::vector<RifEclipseOutputTableColumn> header;
|
||||
|
||||
if (gridName.isEmpty())
|
||||
{
|
||||
header = {
|
||||
RifEclipseOutputTableColumn("Well"),
|
||||
RifEclipseOutputTableColumn("Mult"),
|
||||
RifEclipseOutputTableColumn("I"),
|
||||
RifEclipseOutputTableColumn("J"),
|
||||
RifEclipseOutputTableColumn("K"),
|
||||
};
|
||||
formatter.keyword("WPIMULT");
|
||||
}
|
||||
else
|
||||
{
|
||||
header = {
|
||||
RifEclipseOutputTableColumn("Well"),
|
||||
RifEclipseOutputTableColumn("LgrName"),
|
||||
RifEclipseOutputTableColumn("Mult"),
|
||||
RifEclipseOutputTableColumn("I"),
|
||||
RifEclipseOutputTableColumn("J"),
|
||||
RifEclipseOutputTableColumn("K"),
|
||||
};
|
||||
formatter.keyword("WPIMULTL");
|
||||
}
|
||||
formatter.header(header);
|
||||
|
||||
for (auto& completion : completionData)
|
||||
@ -765,7 +700,13 @@ void RicWellPathExportCompletionDataFeature::generateWpimultTable(RifEclipseData
|
||||
|
||||
formatter.add(completion.wellName());
|
||||
formatter.add(completion.wpimult());
|
||||
formatter.addZeroBasedCellIndex(completion.cellIndex().i).addZeroBasedCellIndex(completion.cellIndex().j).addZeroBasedCellIndex(completion.cellIndex().k);
|
||||
|
||||
if (!gridName.isEmpty())
|
||||
{
|
||||
formatter.add(gridName);
|
||||
}
|
||||
|
||||
formatter.addZeroBasedCellIndex(completion.completionDataGridCell().localCellIndexI()).addZeroBasedCellIndex(completion.completionDataGridCell().localCellIndexJ()).addZeroBasedCellIndex(completion.completionDataGridCell().localCellIndexK());
|
||||
formatter.rowCompleted();
|
||||
}
|
||||
|
||||
@ -775,14 +716,13 @@ 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();
|
||||
|
||||
std::vector<RigCompletionData> completionData;
|
||||
const RigActiveCellInfo* activeCellInfo = settings.caseToApply->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL);
|
||||
|
||||
|
||||
if (wellPath->perforationIntervalCollection()->isChecked())
|
||||
{
|
||||
for (const RimPerforationInterval* interval : wellPath->perforationIntervalCollection()->perforations())
|
||||
@ -800,12 +740,10 @@ std::vector<RigCompletionData> RicWellPathExportCompletionDataFeature::generateP
|
||||
bool cellIsActive = activeCellInfo->isActive(cell.globCellIndex);
|
||||
if (!cellIsActive) continue;
|
||||
|
||||
size_t i, j, k;
|
||||
settings.caseToApply->eclipseCaseData()->mainGrid()->ijkFromCellIndex(cell.globCellIndex, &i, &j, &k);
|
||||
RigCompletionData completion(wellPath->completions()->wellNameForExport(), IJKCellIndex(i, j, k));
|
||||
RigCompletionData completion(wellPath->completions()->wellNameForExport(), RigCompletionDataGridCell(cell.globCellIndex, settings.caseToApply->mainGrid()));
|
||||
CellDirection direction = calculateDirectionInCell(settings.caseToApply, cell.globCellIndex, cell.intersectionLengthsInCellCS);
|
||||
|
||||
double transmissibility = RicWellPathExportCompletionDataFeature::calculateTransmissibility(settings.caseToApply,
|
||||
double transmissibility = RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibility(settings.caseToApply,
|
||||
wellPath,
|
||||
cell.intersectionLengthsInCellCS,
|
||||
interval->skinFactor(),
|
||||
@ -831,44 +769,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> cells;
|
||||
|
||||
std::vector<HexIntersectionInfo> intersections = RigWellPathIntersectionTools::findRawHexCellIntersections(caseData->mainGrid(), coords);
|
||||
for (auto intersection : intersections)
|
||||
{
|
||||
cells.insert(intersection.m_hexIndex);
|
||||
}
|
||||
|
||||
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.cellIndex) != 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;
|
||||
}
|
||||
@ -876,17 +777,7 @@ bool RicWellPathExportCompletionDataFeature::wellSegmentLocationOrdering(const W
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicWellPathExportCompletionDataFeature::isPointBetween(const cvf::Vec3d& startPoint, const cvf::Vec3d& endPoint, const cvf::Vec3d& pointToCheck)
|
||||
{
|
||||
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<WellSegmentLocation> RicWellPathExportCompletionDataFeatureImpl::findWellSegmentLocations(const RimEclipseCase* caseToApply, const RimWellPath* wellPath)
|
||||
{
|
||||
std::vector<RimFishbonesMultipleSubs*> fishbonesSubs;
|
||||
|
||||
@ -907,7 +798,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;
|
||||
for (RimFishbonesMultipleSubs* subs : fishbonesSubs)
|
||||
@ -934,7 +825,7 @@ std::vector<WellSegmentLocation> RicWellPathExportCompletionDataFeature::findWel
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicWellPathExportCompletionDataFeature::assignLateralIntersections(const RimEclipseCase* caseToApply,
|
||||
void RicWellPathExportCompletionDataFeatureImpl::assignLateralIntersections(const RimEclipseCase* caseToApply,
|
||||
WellSegmentLocation* location,
|
||||
int* branchNum,
|
||||
int* segmentNum)
|
||||
@ -946,7 +837,7 @@ void RicWellPathExportCompletionDataFeature::assignLateralIntersections(const Ri
|
||||
|
||||
std::vector<std::pair<cvf::Vec3d, double> > lateralCoordMDPairs = location->fishbonesSubs->coordsAndMDForLateral(location->subIndex, lateral.lateralIndex);
|
||||
|
||||
if ( !lateralCoordMDPairs.size() )
|
||||
if ( lateralCoordMDPairs.empty() )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@ -992,7 +883,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 branchNumber = 1;
|
||||
@ -1015,18 +906,18 @@ void RicWellPathExportCompletionDataFeature::assignLateralIntersectionsAndBranch
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicWellPathExportCompletionDataFeature::appendCompletionData(std::map<IJKCellIndex, 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)
|
||||
{
|
||||
auto it = completionData->find(completion.cellIndex());
|
||||
auto it = completionData->find(completion.completionDataGridCell());
|
||||
if (it != completionData->end())
|
||||
{
|
||||
it->second.push_back(completion);
|
||||
}
|
||||
else
|
||||
{
|
||||
completionData->insert(std::pair<IJKCellIndex, std::vector<RigCompletionData> >(completion.cellIndex(), std::vector<RigCompletionData> {completion}));
|
||||
completionData->insert(std::pair<RigCompletionDataGridCell, std::vector<RigCompletionData> >(completion.completionDataGridCell(), std::vector<RigCompletionData> {completion}));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1034,7 +925,7 @@ void RicWellPathExportCompletionDataFeature::appendCompletionData(std::map<IJKCe
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
CellDirection RicWellPathExportCompletionDataFeature::calculateDirectionInCell(RimEclipseCase* eclipseCase, size_t cellIndex, const cvf::Vec3d& lengthsInCell)
|
||||
CellDirection RicWellPathExportCompletionDataFeatureImpl::calculateDirectionInCell(RimEclipseCase* eclipseCase, size_t globalCellIndex, const cvf::Vec3d& lengthsInCell)
|
||||
{
|
||||
RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData();
|
||||
|
||||
@ -1045,9 +936,9 @@ CellDirection RicWellPathExportCompletionDataFeature::calculateDirectionInCell(R
|
||||
eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ");
|
||||
cvf::ref<RigResultAccessor> dzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DZ");
|
||||
|
||||
double xLengthFraction = fabs(lengthsInCell.x() / dxAccessObject->cellScalarGlobIdx(cellIndex));
|
||||
double yLengthFraction = fabs(lengthsInCell.y() / dyAccessObject->cellScalarGlobIdx(cellIndex));
|
||||
double zLengthFraction = fabs(lengthsInCell.z() / dzAccessObject->cellScalarGlobIdx(cellIndex));
|
||||
double xLengthFraction = fabs(lengthsInCell.x() / dxAccessObject->cellScalarGlobIdx(globalCellIndex));
|
||||
double yLengthFraction = fabs(lengthsInCell.y() / dyAccessObject->cellScalarGlobIdx(globalCellIndex));
|
||||
double zLengthFraction = fabs(lengthsInCell.z() / dzAccessObject->cellScalarGlobIdx(globalCellIndex));
|
||||
|
||||
if (xLengthFraction > yLengthFraction && xLengthFraction > zLengthFraction)
|
||||
{
|
||||
@ -1066,12 +957,12 @@ CellDirection RicWellPathExportCompletionDataFeature::calculateDirectionInCell(R
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RicWellPathExportCompletionDataFeature::calculateTransmissibility(RimEclipseCase* eclipseCase,
|
||||
double RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibility(RimEclipseCase* eclipseCase,
|
||||
const RimWellPath* wellPath,
|
||||
const cvf::Vec3d& internalCellLengths,
|
||||
double skinFactor,
|
||||
double wellRadius,
|
||||
size_t cellIndex,
|
||||
size_t globalCellIndex,
|
||||
bool useLateralNTG,
|
||||
size_t volumeScaleConstant,
|
||||
CellDirection directionForVolumeScaling)
|
||||
@ -1097,16 +988,16 @@ double RicWellPathExportCompletionDataFeature::calculateTransmissibility(RimEcli
|
||||
if (ntgResIdx != cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
cvf::ref<RigResultAccessor> ntgAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "NTG");
|
||||
ntg = ntgAccessObject->cellScalarGlobIdx(cellIndex);
|
||||
ntg = ntgAccessObject->cellScalarGlobIdx(globalCellIndex);
|
||||
}
|
||||
double latNtg = useLateralNTG ? ntg : 1.0;
|
||||
|
||||
double dx = dxAccessObject->cellScalarGlobIdx(cellIndex);
|
||||
double dy = dyAccessObject->cellScalarGlobIdx(cellIndex);
|
||||
double dz = dzAccessObject->cellScalarGlobIdx(cellIndex);
|
||||
double permx = permxAccessObject->cellScalarGlobIdx(cellIndex);
|
||||
double permy = permyAccessObject->cellScalarGlobIdx(cellIndex);
|
||||
double permz = permzAccessObject->cellScalarGlobIdx(cellIndex);
|
||||
double dx = dxAccessObject->cellScalarGlobIdx(globalCellIndex);
|
||||
double dy = dyAccessObject->cellScalarGlobIdx(globalCellIndex);
|
||||
double dz = dzAccessObject->cellScalarGlobIdx(globalCellIndex);
|
||||
double permx = permxAccessObject->cellScalarGlobIdx(globalCellIndex);
|
||||
double permy = permyAccessObject->cellScalarGlobIdx(globalCellIndex);
|
||||
double permz = permzAccessObject->cellScalarGlobIdx(globalCellIndex);
|
||||
|
||||
double darcy = RiaEclipseUnitTools::darcysConstant(wellPath->unitSystem());
|
||||
|
||||
@ -1128,10 +1019,10 @@ double RicWellPathExportCompletionDataFeature::calculateTransmissibility(RimEcli
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RicWellPathExportCompletionDataFeature::calculateTransmissibilityAsEclipseDoes(RimEclipseCase* eclipseCase,
|
||||
double RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibilityAsEclipseDoes(RimEclipseCase* eclipseCase,
|
||||
double skinFactor,
|
||||
double wellRadius,
|
||||
size_t cellIndex,
|
||||
size_t globalCellIndex,
|
||||
CellDirection direction)
|
||||
{
|
||||
RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData();
|
||||
@ -1155,15 +1046,15 @@ double RicWellPathExportCompletionDataFeature::calculateTransmissibilityAsEclips
|
||||
if (ntgResIdx != cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
cvf::ref<RigResultAccessor> ntgAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "NTG");
|
||||
ntg = ntgAccessObject->cellScalarGlobIdx(cellIndex);
|
||||
ntg = ntgAccessObject->cellScalarGlobIdx(globalCellIndex);
|
||||
}
|
||||
|
||||
double dx = dxAccessObject->cellScalarGlobIdx(cellIndex);
|
||||
double dy = dyAccessObject->cellScalarGlobIdx(cellIndex);
|
||||
double dz = dzAccessObject->cellScalarGlobIdx(cellIndex);
|
||||
double permx = permxAccessObject->cellScalarGlobIdx(cellIndex);
|
||||
double permy = permyAccessObject->cellScalarGlobIdx(cellIndex);
|
||||
double permz = permzAccessObject->cellScalarGlobIdx(cellIndex);
|
||||
double dx = dxAccessObject->cellScalarGlobIdx(globalCellIndex);
|
||||
double dy = dyAccessObject->cellScalarGlobIdx(globalCellIndex);
|
||||
double dz = dzAccessObject->cellScalarGlobIdx(globalCellIndex);
|
||||
double permx = permxAccessObject->cellScalarGlobIdx(globalCellIndex);
|
||||
double permy = permyAccessObject->cellScalarGlobIdx(globalCellIndex);
|
||||
double permz = permzAccessObject->cellScalarGlobIdx(globalCellIndex);
|
||||
|
||||
RiaEclipseUnitTools::UnitSystem units = eclipseCaseData->unitsType();
|
||||
double darcy = RiaEclipseUnitTools::darcysConstant(units);
|
@ -18,18 +18,14 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RifEclipseDataTableFormatter.h"
|
||||
|
||||
#include "RigWellLogExtractionTools.h"
|
||||
#include "RigWellPathIntersectionTools.h"
|
||||
#include "RigCompletionData.h"
|
||||
|
||||
#include "RicExportCompletionDataSettingsUi.h"
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
#include "cvfBoundingBox.h"
|
||||
#include "cvfBase.h"
|
||||
#include "cvfVector3.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
class RigCell;
|
||||
class RigEclipseCaseData;
|
||||
@ -38,6 +34,7 @@ class RimEclipseCase;
|
||||
class RimFishbonesMultipleSubs;
|
||||
class RimSimWellInView;
|
||||
class RimWellPath;
|
||||
class RifEclipseDataTableFormatter;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@ -45,13 +42,13 @@ class RimWellPath;
|
||||
struct WellSegmentLateralIntersection {
|
||||
WellSegmentLateralIntersection(int segmentNumber,
|
||||
int attachedSegmentNumber,
|
||||
size_t cellIndex,
|
||||
size_t globalCellIndex,
|
||||
double length,
|
||||
double depth,
|
||||
const cvf::Vec3d& lengthsInCell)
|
||||
: segmentNumber(segmentNumber),
|
||||
attachedSegmentNumber(attachedSegmentNumber),
|
||||
cellIndex(cellIndex),
|
||||
globalCellIndex(globalCellIndex),
|
||||
mdFromPreviousIntersection(length),
|
||||
tvdChangeFromPreviousIntersection(depth),
|
||||
lengthsInCell(lengthsInCell),
|
||||
@ -60,7 +57,7 @@ struct WellSegmentLateralIntersection {
|
||||
|
||||
int segmentNumber;
|
||||
int attachedSegmentNumber;
|
||||
size_t cellIndex;
|
||||
size_t globalCellIndex;
|
||||
bool mainBoreCell;
|
||||
double mdFromPreviousIntersection;
|
||||
double tvdChangeFromPreviousIntersection;
|
||||
@ -106,82 +103,59 @@ struct WellSegmentLocation {
|
||||
std::vector<WellSegmentLateral> laterals;
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
struct EclipseCellIndexRange {
|
||||
size_t i;
|
||||
size_t j;
|
||||
size_t k1;
|
||||
size_t k2;
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
typedef std::tuple<size_t, size_t, size_t> EclipseCellIndex;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicWellPathExportCompletionDataFeature : public caf::CmdFeature
|
||||
class RicWellPathExportCompletionDataFeatureImpl
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
protected:
|
||||
|
||||
// Overrides
|
||||
virtual bool isCommandEnabled() override;
|
||||
virtual void onActionTriggered(bool isChecked) override;
|
||||
virtual void setupActionLook(QAction* actionToSetup) override;
|
||||
|
||||
std::vector<RimWellPath*> selectedWellPaths();
|
||||
std::vector<RimSimWellInView*> selectedSimWells();
|
||||
|
||||
bool noWellPathsSelectedDirectly();
|
||||
|
||||
public:
|
||||
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);
|
||||
|
||||
//functions also used by RicFishbonesTransmissibilityCalculationFeatureImp
|
||||
static std::set<size_t> findIntersectedCells(const RigEclipseCaseData* grid, const std::vector<cvf::Vec3d>& coords);
|
||||
static void markWellPathCells(const std::vector<size_t>& wellPathCells, std::vector<WellSegmentLocation>* locations);
|
||||
static CellDirection calculateDirectionInCell(RimEclipseCase* eclipseCase, size_t cellIndex, const cvf::Vec3d& lengthsInCell);
|
||||
static CellDirection calculateDirectionInCell(RimEclipseCase* eclipseCase, size_t globalCellIndex, const cvf::Vec3d& lengthsInCell);
|
||||
|
||||
static double calculateTransmissibility(RimEclipseCase* eclipseCase,
|
||||
const RimWellPath* wellPath,
|
||||
const cvf::Vec3d& internalCellLengths,
|
||||
double skinFactor,
|
||||
double wellRadius,
|
||||
size_t cellIndex,
|
||||
size_t globalCellIndex,
|
||||
bool useLateralNTG,
|
||||
size_t volumeScaleConstant = 1,
|
||||
CellDirection directionForVolumeScaling = CellDirection::DIR_I);
|
||||
static double calculateTransmissibilityAsEclipseDoes(RimEclipseCase* eclipseCase,
|
||||
double skinFactor,
|
||||
double wellRadius,
|
||||
size_t cellIndex,
|
||||
CellDirection direction);
|
||||
|
||||
|
||||
static void exportCompletions(const std::vector<RimWellPath*>& wellPaths, const std::vector<RimSimWellInView*>& simWells, const RicExportCompletionDataSettingsUi& exportSettings);
|
||||
|
||||
private:
|
||||
static double calculateTransmissibilityAsEclipseDoes(RimEclipseCase* eclipseCase,
|
||||
double skinFactor,
|
||||
double wellRadius,
|
||||
size_t globalCellIndex,
|
||||
CellDirection direction);
|
||||
|
||||
static RigCompletionData combineEclipseCellCompletions(const std::vector<RigCompletionData>& completions,
|
||||
const RicExportCompletionDataSettingsUi& settings);
|
||||
static void printCompletionsToFile(const QString& exportFolder, const QString& fileName, std::vector<RigCompletionData>& completions, RicExportCompletionDataSettingsUi::CompdatExportType exportType);
|
||||
static std::vector<RigCompletionData> getCompletionsForWellAndCompletionType(const std::vector<RigCompletionData>& completions, const QString& wellName, RigCompletionData::CompletionType completionType);
|
||||
static std::map<IJKCellIndex, std::vector<RigCompletionData> > getCompletionsForWell(const std::map<IJKCellIndex, std::vector<RigCompletionData>>& cellToCompletionMap, const QString& wellName);
|
||||
|
||||
static void generateCompdatTable(RifEclipseDataTableFormatter& formatter, const std::vector<RigCompletionData>& completionData);
|
||||
static void generateWpimultTable(RifEclipseDataTableFormatter& formatter, const std::vector<RigCompletionData>& completionData);
|
||||
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 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 void generateCompdatTable(RifEclipseDataTableFormatter& formatter, const QString& gridName, const std::vector<RigCompletionData>& completionData);
|
||||
static void generateWpimultTable(RifEclipseDataTableFormatter& formatter, const QString& gridName, const std::vector<RigCompletionData>& completionData);
|
||||
|
||||
static std::vector<RigCompletionData> generatePerforationsCompdatValues(const RimWellPath* wellPath, const RicExportCompletionDataSettingsUi& settings);
|
||||
|
||||
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 assignLateralIntersectionsAndBranchAndSegmentNumbers(const RimEclipseCase* caseToApply, std::vector<WellSegmentLocation>* locations);
|
||||
|
||||
static void appendCompletionData(std::map<IJKCellIndex, std::vector<RigCompletionData> >* completionData, const std::vector<RigCompletionData>& data);
|
||||
|
||||
static void appendCompletionData(std::map<RigCompletionDataGridCell, std::vector<RigCompletionData> >* completionData, const std::vector<RigCompletionData>& data);
|
||||
};
|
||||
|
@ -30,7 +30,7 @@
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
RigCompletionData::RigCompletionData(const QString wellName, const IJKCellIndex& cellIndex)
|
||||
RigCompletionData::RigCompletionData(const QString wellName, const RigCompletionDataGridCell& cellIndex)
|
||||
: m_wellName(wellName),
|
||||
m_cellIndex(cellIndex),
|
||||
m_saturation(HUGE_VAL),
|
||||
@ -79,7 +79,7 @@ RigCompletionData RigCompletionData::combine(const std::vector<RigCompletionData
|
||||
{
|
||||
if (it->completionType() != result.completionType())
|
||||
{
|
||||
RiaLogging::error(QString("Cannot combine completions of different types in same cell [%1, %2, %3]").arg(result.m_cellIndex.i).arg(result.m_cellIndex.j).arg(result.m_cellIndex.k));
|
||||
RiaLogging::error(QString("Cannot combine completions of different types in same cell [%1, %2, %3]").arg(result.m_cellIndex.localCellIndexI()).arg(result.m_cellIndex.localCellIndexJ()).arg(result.m_cellIndex.localCellIndexK()));
|
||||
continue;
|
||||
}
|
||||
if (onlyOneIsDefaulted(result.m_transmissibility, it->m_transmissibility))
|
||||
@ -212,6 +212,134 @@ bool RigCompletionData::isDefaultValue(double val)
|
||||
return val == HUGE_VAL;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<RigCompletionMetaData>& RigCompletionData::metadata() const
|
||||
{
|
||||
return m_metadata;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const QString& RigCompletionData::wellName() const
|
||||
{
|
||||
return m_wellName;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RigCompletionDataGridCell& RigCompletionData::completionDataGridCell() const
|
||||
{
|
||||
return m_cellIndex;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
WellConnectionState RigCompletionData::connectionState() const
|
||||
{
|
||||
return m_connectionState;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigCompletionData::saturation() const
|
||||
{
|
||||
return m_saturation;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigCompletionData::transmissibility() const
|
||||
{
|
||||
return m_transmissibility;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigCompletionData::diameter() const
|
||||
{
|
||||
return m_diameter;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigCompletionData::kh() const
|
||||
{
|
||||
return m_kh;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigCompletionData::skinFactor() const
|
||||
{
|
||||
return m_skinFactor;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigCompletionData::dFactor() const
|
||||
{
|
||||
return m_dFactor;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
CellDirection RigCompletionData::direction() const
|
||||
{
|
||||
return m_direction;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RigCompletionData::count() const
|
||||
{
|
||||
return m_count;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigCompletionData::wpimult() const
|
||||
{
|
||||
return m_wpimult;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigCompletionData::CompletionType RigCompletionData::completionType() const
|
||||
{
|
||||
return m_completionType;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigCompletionData::isMainBore() const
|
||||
{
|
||||
return m_isMainBore;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigCompletionData::readyForExport() const
|
||||
{
|
||||
return m_readyForExport;
|
||||
}
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
@ -262,3 +390,4 @@ void RigCompletionData::copy(RigCompletionData& target, const RigCompletionData&
|
||||
target.m_wpimult = from.m_wpimult;
|
||||
target.m_completionType = from.m_completionType;
|
||||
}
|
||||
|
@ -18,10 +18,14 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RigCompletionDataGridCell.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include <vector>
|
||||
|
||||
class RimEclipseCase;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
@ -41,38 +45,6 @@ enum CellDirection {
|
||||
DIR_UNDEF,
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class IJKCellIndex {
|
||||
public:
|
||||
IJKCellIndex() {};
|
||||
IJKCellIndex(size_t i, size_t j, size_t k) : i(i), j(j), k(k) {};
|
||||
IJKCellIndex(const IJKCellIndex& other)
|
||||
{
|
||||
i = other.i;
|
||||
j = other.j;
|
||||
k = other.k;
|
||||
}
|
||||
|
||||
bool operator==(const IJKCellIndex& other) const
|
||||
{
|
||||
return i == other.i && j == other.j && k == other.k;
|
||||
}
|
||||
|
||||
bool operator<(const IJKCellIndex& other) const
|
||||
{
|
||||
if (i != other.i) return i < other.i;
|
||||
if (j != other.j) return j < other.j;
|
||||
if (k != other.k) return k < other.k;
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t i;
|
||||
size_t j;
|
||||
size_t k;
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
@ -96,7 +68,7 @@ public:
|
||||
CT_UNDEFINED
|
||||
};
|
||||
|
||||
RigCompletionData(const QString wellName, const IJKCellIndex& cellIndex);
|
||||
RigCompletionData(const QString wellName, const RigCompletionDataGridCell& cellIndex);
|
||||
~RigCompletionData();
|
||||
RigCompletionData(const RigCompletionData& other);
|
||||
|
||||
@ -105,52 +77,52 @@ public:
|
||||
bool operator<(const RigCompletionData& other) const;
|
||||
RigCompletionData& operator=(const RigCompletionData& other);
|
||||
|
||||
void setFromFracture(double transmissibility, double skinFactor);
|
||||
|
||||
void setTransAndWPImultBackgroundDataFromFishbone(double transmissibility,
|
||||
double skinFactor,
|
||||
double diameter,
|
||||
CellDirection direction,
|
||||
bool isMainBore);
|
||||
void setFromFracture(double transmissibility, double skinFactor);
|
||||
|
||||
void setTransAndWPImultBackgroundDataFromFishbone(double transmissibility,
|
||||
double skinFactor,
|
||||
double diameter,
|
||||
CellDirection direction,
|
||||
bool isMainBore);
|
||||
|
||||
void setTransAndWPImultBackgroundDataFromPerforation(double transmissibility,
|
||||
double skinFactor,
|
||||
double diameter,
|
||||
CellDirection direction);
|
||||
void setTransAndWPImultBackgroundDataFromPerforation(double transmissibility,
|
||||
double skinFactor,
|
||||
double diameter,
|
||||
CellDirection direction);
|
||||
|
||||
void setCombinedValuesExplicitTrans(double transmissibility,
|
||||
CompletionType completionType);
|
||||
void setCombinedValuesImplicitTransWPImult(double wpimult,
|
||||
CellDirection celldirection,
|
||||
double skinFactor,
|
||||
double wellDiameter,
|
||||
CompletionType completionType);
|
||||
void setCombinedValuesExplicitTrans(double transmissibility, CompletionType completionType);
|
||||
|
||||
void setCombinedValuesImplicitTransWPImult(double wpimult,
|
||||
CellDirection celldirection,
|
||||
double skinFactor,
|
||||
double wellDiameter,
|
||||
CompletionType completionType);
|
||||
|
||||
void addMetadata(const QString& name, const QString& comment);
|
||||
static bool isDefaultValue(double val);
|
||||
void addMetadata(const QString& name, const QString& comment);
|
||||
static bool isDefaultValue(double val);
|
||||
|
||||
const std::vector<RigCompletionMetaData>& metadata() const { return m_metadata; }
|
||||
const QString& wellName() const { return m_wellName; }
|
||||
const IJKCellIndex& cellIndex() const { return m_cellIndex; }
|
||||
WellConnectionState connectionState() const { return m_connectionState; }
|
||||
double saturation() const { return m_saturation; }
|
||||
double transmissibility() const { return m_transmissibility; }
|
||||
double diameter() const { return m_diameter; } //TODO: should be ft or m
|
||||
double kh() const { return m_kh; }
|
||||
double skinFactor() const { return m_skinFactor; }
|
||||
double dFactor() const { return m_dFactor; }
|
||||
CellDirection direction() const { return m_direction; }
|
||||
size_t count() const { return m_count; }
|
||||
double wpimult() const { return m_wpimult; }
|
||||
CompletionType completionType() const { return m_completionType; }
|
||||
bool isMainBore() const { return m_isMainBore; }
|
||||
bool readyForExport() const { return m_readyForExport; }
|
||||
const std::vector<RigCompletionMetaData>& metadata() const;
|
||||
const QString& wellName() const;
|
||||
const RigCompletionDataGridCell& completionDataGridCell() const;
|
||||
WellConnectionState connectionState() const;
|
||||
double saturation() const;
|
||||
double transmissibility() const;
|
||||
double diameter() const; //TODO: should be ft or m
|
||||
double kh() const;
|
||||
double skinFactor() const;
|
||||
double dFactor() const;
|
||||
CellDirection direction() const;
|
||||
size_t count() const;
|
||||
double wpimult() const;
|
||||
CompletionType completionType() const;
|
||||
bool isMainBore() const;
|
||||
bool readyForExport() const;
|
||||
|
||||
std::vector<RigCompletionMetaData> m_metadata;
|
||||
|
||||
private:
|
||||
QString m_wellName;
|
||||
IJKCellIndex m_cellIndex;
|
||||
RigCompletionDataGridCell m_cellIndex;
|
||||
WellConnectionState m_connectionState;
|
||||
double m_saturation; //TODO: remove, always use default in Eclipse?
|
||||
double m_transmissibility;
|
@ -0,0 +1,127 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018 Statoil ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RigCompletionDataGridCell.h"
|
||||
|
||||
#include "RigMainGrid.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigCompletionDataGridCell::RigCompletionDataGridCell() {}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigCompletionDataGridCell::RigCompletionDataGridCell(size_t globalCellIndex, const RigMainGrid* mainGrid)
|
||||
: m_globalCellIndex(globalCellIndex)
|
||||
{
|
||||
if (mainGrid)
|
||||
{
|
||||
const RigCell& cell = mainGrid->globalCellArray()[globalCellIndex];
|
||||
RigGridBase* grid = cell.hostGrid();
|
||||
if (grid)
|
||||
{
|
||||
size_t gridLocalCellIndex = cell.gridLocalCellIndex();
|
||||
|
||||
size_t i = 0;
|
||||
size_t j = 0;
|
||||
size_t k = 0;
|
||||
grid->ijkFromCellIndex(gridLocalCellIndex, &i, &j, &k);
|
||||
|
||||
m_localCellIndexI = i;
|
||||
m_localCellIndexJ = j;
|
||||
m_localCellIndexK = k;
|
||||
|
||||
if (grid != mainGrid)
|
||||
{
|
||||
m_lgrName = QString::fromStdString(grid->gridName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigCompletionDataGridCell::operator==(const RigCompletionDataGridCell& other) const
|
||||
{
|
||||
return m_globalCellIndex == other.m_globalCellIndex;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigCompletionDataGridCell::operator<(const RigCompletionDataGridCell& other) const
|
||||
{
|
||||
if (m_localCellIndexI != other.m_localCellIndexI) return m_localCellIndexI < other.m_localCellIndexI;
|
||||
if (m_localCellIndexJ != other.m_localCellIndexJ) return m_localCellIndexJ < other.m_localCellIndexJ;
|
||||
if (m_localCellIndexK != other.m_localCellIndexK) return m_localCellIndexK < other.m_localCellIndexK;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RigCompletionDataGridCell::globalCellIndex() const
|
||||
{
|
||||
return m_globalCellIndex;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RigCompletionDataGridCell::localCellIndexI() const
|
||||
{
|
||||
return m_localCellIndexI;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RigCompletionDataGridCell::localCellIndexJ() const
|
||||
{
|
||||
return m_localCellIndexJ;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RigCompletionDataGridCell::localCellIndexK() const
|
||||
{
|
||||
return m_localCellIndexK;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RigCompletionDataGridCell::oneBasedLocalCellIndexString() const
|
||||
{
|
||||
QString text = QString("[%1, %2, %3]").arg(m_localCellIndexI + 1).arg(m_localCellIndexJ + 1).arg(m_localCellIndexK + 1);
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RigCompletionDataGridCell::lgrName() const
|
||||
{
|
||||
return m_lgrName;
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018 Statoil ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QString>
|
||||
|
||||
class RigMainGrid;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RigCompletionDataGridCell
|
||||
{
|
||||
public:
|
||||
RigCompletionDataGridCell();
|
||||
|
||||
RigCompletionDataGridCell(size_t globalCellIndex, const RigMainGrid* mainGrid);
|
||||
|
||||
bool operator==(const RigCompletionDataGridCell& other) const;
|
||||
|
||||
bool operator<(const RigCompletionDataGridCell& other) const;
|
||||
|
||||
size_t globalCellIndex() const;
|
||||
|
||||
size_t localCellIndexI() const;
|
||||
size_t localCellIndexJ() const;
|
||||
size_t localCellIndexK() const;
|
||||
|
||||
QString oneBasedLocalCellIndexString() const;
|
||||
|
||||
QString lgrName() const;
|
||||
|
||||
private:
|
||||
size_t m_globalCellIndex;
|
||||
QString m_lgrName;
|
||||
|
||||
size_t m_localCellIndexI;
|
||||
size_t m_localCellIndexJ;
|
||||
size_t m_localCellIndexK;
|
||||
};
|
@ -59,13 +59,11 @@ private:
|
||||
const QString& uiResultName);
|
||||
|
||||
private:
|
||||
RimEclipseCase* m_case;
|
||||
double m_cDarcy;
|
||||
double m_fractureSkinFactor;
|
||||
cvf::Mat4d m_fractureTransform;
|
||||
const RigFractureCell& m_stimPlanCell;
|
||||
|
||||
std::vector<size_t> m_globalIndeciesToContributingEclipseCells;
|
||||
std::vector<double> m_contributingEclipseCellTransmissibilities;
|
||||
RimEclipseCase* m_case;
|
||||
double m_cDarcy;
|
||||
double m_fractureSkinFactor;
|
||||
cvf::Mat4d m_fractureTransform;
|
||||
const RigFractureCell& m_stimPlanCell;
|
||||
std::vector<size_t> m_globalIndeciesToContributingEclipseCells;
|
||||
std::vector<double> m_contributingEclipseCellTransmissibilities;
|
||||
};
|
||||
|
@ -17,23 +17,13 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RigFractureTransmissibilityEquations.h"
|
||||
|
||||
#include "cvfBase.h"
|
||||
#include "cvfMath.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigFractureTransmissibilityEquations::centerToEdgeFractureCellTrans(double conductivity,
|
||||
double sideLengthParallellTrans,
|
||||
double sideLengthNormalTrans,
|
||||
double cDarcyForRelevantUnit)
|
||||
{
|
||||
double transmissibility = cDarcyForRelevantUnit * conductivity * sideLengthNormalTrans / (sideLengthParallellTrans / 2);
|
||||
return transmissibility;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -130,3 +120,16 @@ double RigFractureTransmissibilityEquations::matrixToFractureTrans(double perm,
|
||||
CVF_ASSERT(transmissibility == transmissibility);
|
||||
return transmissibility;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigFractureTransmissibilityEquations::centerToEdgeFractureCellTrans(double conductivity,
|
||||
double sideLengthParallellTrans,
|
||||
double sideLengthNormalTrans,
|
||||
double cDarcyForRelevantUnit)
|
||||
{
|
||||
double transmissibility = cDarcyForRelevantUnit * conductivity * sideLengthNormalTrans / (sideLengthParallellTrans / 2);
|
||||
return transmissibility;
|
||||
}
|
||||
|
@ -0,0 +1,67 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017- Statoil ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
class RigFractureTransmissibilityEquations
|
||||
{
|
||||
public:
|
||||
static double centerToCenterFractureCellTrans(double conductivityCell1,
|
||||
double sideLengthParallellTransCell1,
|
||||
double sideLengthNormalTransCell1,
|
||||
double conductivityCell2,
|
||||
double sideLengthParallellTransCell2,
|
||||
double sideLengthNormalTransCell2,
|
||||
double cDarcyForRelevantUnit);
|
||||
|
||||
static double fractureCellToWellRadialTrans(double fractureCellConductivity,
|
||||
double fractureCellSizeX,
|
||||
double fractureCellSizeZ,
|
||||
double wellRadius,
|
||||
double skinFactor,
|
||||
double cDarcyForRelevantUnit);
|
||||
|
||||
static double fractureCellToWellLinearTrans(double fractureConductivity,
|
||||
double fractureCellSizeX,
|
||||
double fractureCellSizeZ,
|
||||
double perforationLengthVertical,
|
||||
double perforationLengthHorizontal,
|
||||
double perforationEfficiency,
|
||||
double skinfactor,
|
||||
double cDarcyForRelevantUnit);
|
||||
|
||||
static double matrixToFractureTrans(double permX,
|
||||
double NTG,
|
||||
double Ay,
|
||||
double dx,
|
||||
double skinfactor,
|
||||
double fractureAreaWeightedlength,
|
||||
double cDarcy);
|
||||
|
||||
private:
|
||||
static double centerToEdgeFractureCellTrans(double conductivity,
|
||||
double sideLengthParallellTrans,
|
||||
double sideLengthNormalTrans,
|
||||
double cDarcyForRelevantUnit);
|
||||
|
||||
|
||||
};
|
@ -28,6 +28,9 @@ class RigMainGrid;
|
||||
class RimStimPlanFractureTemplate;
|
||||
class RigFractureGrid;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
class RigTransmissibilityCondenser
|
||||
{
|
||||
public:
|
@ -198,6 +198,19 @@ cvf::Color3f RimEclipseCase::defaultWellColor(const QString& wellName)
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RigMainGrid* RimEclipseCase::mainGrid() const
|
||||
{
|
||||
if (eclipseCaseData())
|
||||
{
|
||||
return eclipseCaseData()->mainGrid();
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -39,6 +39,7 @@ class QString;
|
||||
class RigEclipseCaseData;
|
||||
class RigCaseCellResultsData;
|
||||
class RigGridBase;
|
||||
class RigMainGrid;
|
||||
class RimCaseCollection;
|
||||
class RimIdenticalGridCaseGroup;
|
||||
class RimReservoirCellResultsStorage;
|
||||
@ -74,6 +75,8 @@ public:
|
||||
const RigEclipseCaseData* eclipseCaseData() const;
|
||||
cvf::Color3f defaultWellColor(const QString& wellName);
|
||||
|
||||
const RigMainGrid* mainGrid() const;
|
||||
|
||||
RigCaseCellResultsData* results(RiaDefines::PorosityModelType porosityModel);
|
||||
const RigCaseCellResultsData* results(RiaDefines::PorosityModelType porosityModel) const;
|
||||
|
||||
|
@ -18,7 +18,6 @@ ${CEE_CURRENT_LIST_DIR}RigCellEdgeResultAccessor.h
|
||||
${CEE_CURRENT_LIST_DIR}RigCellGeometryTools.h
|
||||
${CEE_CURRENT_LIST_DIR}RigCombTransResultAccessor.h
|
||||
${CEE_CURRENT_LIST_DIR}RigCombMultResultAccessor.h
|
||||
${CEE_CURRENT_LIST_DIR}RigCompletionData.h
|
||||
${CEE_CURRENT_LIST_DIR}RigResultModifier.h
|
||||
${CEE_CURRENT_LIST_DIR}RigResultModifierFactory.h
|
||||
${CEE_CURRENT_LIST_DIR}RigFormationNames.h
|
||||
@ -70,13 +69,9 @@ ${CEE_CURRENT_LIST_DIR}RigWellPathFormations.h
|
||||
|
||||
if (RESINSIGHT_ENABLE_PROTOTYPE_FEATURE_FRACTURES)
|
||||
list (APPEND SOURCE_GROUP_HEADER_FILES
|
||||
${CEE_CURRENT_LIST_DIR}RigEclipseToStimPlanCellTransmissibilityCalculator.h
|
||||
${CEE_CURRENT_LIST_DIR}RigTransmissibilityCondenser.h
|
||||
${CEE_CURRENT_LIST_DIR}RigFractureTransmissibilityEquations.h
|
||||
${CEE_CURRENT_LIST_DIR}RigStimPlanFractureDefinition.h
|
||||
${CEE_CURRENT_LIST_DIR}RigFractureGrid.h
|
||||
${CEE_CURRENT_LIST_DIR}RigFractureCell.h
|
||||
${CEE_CURRENT_LIST_DIR}RigWellPathStimplanIntersector.h
|
||||
)
|
||||
endif()
|
||||
|
||||
@ -95,7 +90,6 @@ ${CEE_CURRENT_LIST_DIR}RigCellEdgeResultAccessor.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigCellGeometryTools.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigCombTransResultAccessor.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigCombMultResultAccessor.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigCompletionData.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigResultModifierFactory.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigFormationNames.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigFlowDiagResultAddress.cpp
|
||||
@ -142,13 +136,9 @@ ${CEE_CURRENT_LIST_DIR}RigWellPathFormations.cpp
|
||||
|
||||
if (RESINSIGHT_ENABLE_PROTOTYPE_FEATURE_FRACTURES)
|
||||
list (APPEND SOURCE_GROUP_SOURCE_FILES
|
||||
${CEE_CURRENT_LIST_DIR}RigEclipseToStimPlanCellTransmissibilityCalculator.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigTransmissibilityCondenser.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigFractureTransmissibilityEquations.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigStimPlanFractureDefinition.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigFractureGrid.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigFractureCell.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigWellPathStimplanIntersector.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
|
@ -1,63 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017- Statoil ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
class RigFractureTransmissibilityEquations
|
||||
{
|
||||
public:
|
||||
static double centerToEdgeFractureCellTrans(double conductivity,
|
||||
double sideLengthParallellTrans,
|
||||
double sideLengthNormalTrans,
|
||||
double cDarcyForRelevantUnit);
|
||||
|
||||
static double centerToCenterFractureCellTrans(double conductivityCell1,
|
||||
double sideLengthParallellTransCell1,
|
||||
double sideLengthNormalTransCell1,
|
||||
double conductivityCell2,
|
||||
double sideLengthParallellTransCell2,
|
||||
double sideLengthNormalTransCell2,
|
||||
double cDarcyForRelevantUnit);
|
||||
|
||||
static double fractureCellToWellRadialTrans(double fractureCellConductivity,
|
||||
double fractureCellSizeX,
|
||||
double fractureCellSizeZ,
|
||||
double wellRadius,
|
||||
double skinFactor,
|
||||
double cDarcyForRelevantUnit);
|
||||
|
||||
static double fractureCellToWellLinearTrans(double fractureConductivity,
|
||||
double fractureCellSizeX,
|
||||
double fractureCellSizeZ,
|
||||
double perforationLengthVertical,
|
||||
double perforationLengthHorizontal,
|
||||
double perforationEfficiency,
|
||||
double skinfactor,
|
||||
double cDarcyForRelevantUnit);
|
||||
|
||||
static double matrixToFractureTrans(double permX,
|
||||
double NTG,
|
||||
double Ay,
|
||||
double dx,
|
||||
double skinfactor,
|
||||
double fractureAreaWeightedlength,
|
||||
double cDarcy);
|
||||
|
||||
};
|
||||
|
@ -296,7 +296,7 @@ TEST(RigCellGeometryTools, polylinePolygonIntersectionTest2)
|
||||
}
|
||||
|
||||
|
||||
#include "RigWellPathStimplanIntersector.h"
|
||||
#include "CompletionExportCommands/RigWellPathStimplanIntersector.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "RigTransmissibilityCondenser.h"
|
||||
#include "CompletionExportCommands/RigTransmissibilityCondenser.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user