#1858 Renaming and whitespace as preparations

This commit is contained in:
Jacob Støren 2017-12-12 12:47:05 +01:00
parent 574c5ec466
commit 3a1939d460
10 changed files with 84 additions and 49 deletions

View File

@ -297,13 +297,13 @@ void RicExportFishbonesWellSegmentsFeature::generateWelsegsTable(RifEclipseDataT
{ {
if (wellPath->fishbonesCollection()->lengthAndDepth() == RimFishbonesCollection::INC) if (wellPath->fishbonesCollection()->lengthAndDepth() == RimFishbonesCollection::INC)
{ {
depth = intersection.depth; depth = intersection.tvdChangeFromPreviousIntersection;
length = intersection.length; length = intersection.mdFromPreviousIntersection;
} }
else else
{ {
depth += intersection.depth; depth += intersection.tvdChangeFromPreviousIntersection;
length += intersection.length; length += intersection.mdFromPreviousIntersection;
} }
double diameter = computeEffectiveDiameter(location.fishbonesSubs->tubingDiameter(unitSystem), location.fishbonesSubs->holeDiameter(unitSystem)); double diameter = computeEffectiveDiameter(location.fishbonesSubs->tubingDiameter(unitSystem), location.fishbonesSubs->holeDiameter(unitSystem));
formatter.add(intersection.segmentNumber); formatter.add(intersection.segmentNumber);
@ -370,10 +370,10 @@ void RicExportFishbonesWellSegmentsFeature::generateCompsegsTable(RifEclipseData
formatter.addZeroBasedCellIndex(i).addZeroBasedCellIndex(j).addZeroBasedCellIndex(k); formatter.addZeroBasedCellIndex(i).addZeroBasedCellIndex(j).addZeroBasedCellIndex(k);
formatter.add(lateral.branchNumber); formatter.add(lateral.branchNumber);
formatter.add(aggregatedLength); formatter.add(aggregatedLength);
formatter.add(aggregatedLength + intersection.length); formatter.add(aggregatedLength + intersection.mdFromPreviousIntersection);
formatter.rowCompleted(); formatter.rowCompleted();
aggregatedLength += intersection.length; aggregatedLength += intersection.mdFromPreviousIntersection;
} }
} }
} }

View File

@ -37,7 +37,9 @@
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RicFishbonesTransmissibilityCalculationFeatureImp::findFishboneLateralsWellBoreParts(std::map<size_t, std::vector<WellBorePartForTransCalc> >& wellBorePartsInCells, const RimWellPath* wellPath, const RicExportCompletionDataSettingsUi& settings) void RicFishbonesTransmissibilityCalculationFeatureImp::findFishboneLateralsWellBoreParts(std::map<size_t, std::vector<WellBorePartForTransCalc> >& wellBorePartsInCells,
const RimWellPath* wellPath,
const RicExportCompletionDataSettingsUi& settings)
{ {
// Generate data // Generate data
const RigEclipseCaseData* caseData = settings.caseToApply()->eclipseCaseData(); const RigEclipseCaseData* caseData = settings.caseToApply()->eclipseCaseData();

View File

@ -848,7 +848,7 @@ std::vector<WellSegmentLocation> RicWellPathExportCompletionDataFeature::findWel
} }
std::sort(wellSegmentLocations.begin(), wellSegmentLocations.end(), wellSegmentLocationOrdering); std::sort(wellSegmentLocations.begin(), wellSegmentLocations.end(), wellSegmentLocationOrdering);
assignBranchAndSegmentNumbers(caseToApply, &wellSegmentLocations); assignLateralIntersectionsAndBranchAndSegmentNumbers(caseToApply, &wellSegmentLocations);
return wellSegmentLocations; return wellSegmentLocations;
} }
@ -856,14 +856,15 @@ std::vector<WellSegmentLocation> RicWellPathExportCompletionDataFeature::findWel
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RicWellPathExportCompletionDataFeature::calculateLateralIntersections(const RimEclipseCase* caseToApply, void RicWellPathExportCompletionDataFeature::assignLateralIntersections(const RimEclipseCase* caseToApply,
WellSegmentLocation* location, WellSegmentLocation* location,
int* branchNum, int* branchNum,
int* segmentNum) int* segmentNum)
{ {
for (WellSegmentLateral& lateral : location->laterals) for (WellSegmentLateral& lateral : location->laterals)
{ {
lateral.branchNumber = ++(*branchNum); ++(*branchNum);
lateral.branchNumber = (*branchNum);
std::vector<std::pair<cvf::Vec3d, double> > lateralCoordMDPairs = location->fishbonesSubs->coordsAndMDForLateral(location->subIndex, lateral.lateralIndex); std::vector<std::pair<cvf::Vec3d, double> > lateralCoordMDPairs = location->fishbonesSubs->coordsAndMDForLateral(location->subIndex, lateral.lateralIndex);
@ -884,8 +885,8 @@ void RicWellPathExportCompletionDataFeature::calculateLateralIntersections(const
lateralMDs); lateralMDs);
auto intersection = intersections.cbegin(); auto intersection = intersections.cbegin();
double length = 0; double mdFromPreviousIntersection = 0;
double depth = 0; double tvdChangeFromPreviousIntersection = 0;
cvf::Vec3d startPoint = lateralCoords[0]; cvf::Vec3d startPoint = lateralCoords[0];
int attachedSegmentNumber = location->icdSegmentNumber; int attachedSegmentNumber = location->icdSegmentNumber;
@ -893,28 +894,31 @@ void RicWellPathExportCompletionDataFeature::calculateLateralIntersections(const
{ {
if (isPointBetween(startPoint, lateralCoords[i], intersection->endPoint)) if (isPointBetween(startPoint, lateralCoords[i], intersection->endPoint))
{ {
length += (intersection->endPoint - startPoint).length(); mdFromPreviousIntersection += (intersection->endPoint - startPoint).length();
depth += intersection->endPoint.z() - startPoint.z(); tvdChangeFromPreviousIntersection += intersection->endPoint.z() - startPoint.z();
++(*segmentNum);
WellSegmentLateralIntersection lateralIntersection( ++(*segmentNum), WellSegmentLateralIntersection lateralIntersection((*segmentNum),
attachedSegmentNumber, attachedSegmentNumber,
intersection->globCellIndex, intersection->globCellIndex,
length, mdFromPreviousIntersection,
depth); tvdChangeFromPreviousIntersection,
intersection->internalCellLengths);
lateralIntersection.lengthsInCell = intersection->internalCellLengths;
lateral.intersections.push_back(lateralIntersection); lateral.intersections.push_back(lateralIntersection);
length = 0; mdFromPreviousIntersection = 0;
depth = 0; tvdChangeFromPreviousIntersection = 0;
startPoint = intersection->endPoint; startPoint = intersection->endPoint;
attachedSegmentNumber = *segmentNum;
attachedSegmentNumber = (*segmentNum);
++intersection; ++intersection;
} }
else else
{ {
length += (lateralCoords[i] - startPoint).length(); mdFromPreviousIntersection += (lateralCoords[i] - startPoint).length();
depth += lateralCoords[i].z() - startPoint.z(); tvdChangeFromPreviousIntersection += lateralCoords[i].z() - startPoint.z();
startPoint = lateralCoords[i]; startPoint = lateralCoords[i];
} }
} }
@ -924,10 +928,11 @@ void RicWellPathExportCompletionDataFeature::calculateLateralIntersections(const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RicWellPathExportCompletionDataFeature::assignBranchAndSegmentNumbers(const RimEclipseCase* caseToApply, std::vector<WellSegmentLocation>* locations) void RicWellPathExportCompletionDataFeature::assignLateralIntersectionsAndBranchAndSegmentNumbers(const RimEclipseCase* caseToApply, std::vector<WellSegmentLocation>* locations)
{ {
int segmentNumber = 1; int segmentNumber = 1;
int branchNumber = 1; int branchNumber = 1;
// First loop over the locations so that each segment on the main stem is an incremental number // First loop over the locations so that each segment on the main stem is an incremental number
for (WellSegmentLocation& location : *locations) for (WellSegmentLocation& location : *locations)
{ {
@ -935,10 +940,11 @@ void RicWellPathExportCompletionDataFeature::assignBranchAndSegmentNumbers(const
location.icdBranchNumber = ++branchNumber; location.icdBranchNumber = ++branchNumber;
location.icdSegmentNumber = ++segmentNumber; location.icdSegmentNumber = ++segmentNumber;
} }
// Then assign branch and segment numbers to each lateral parts // Then assign branch and segment numbers to each lateral parts
for (WellSegmentLocation& location : *locations) for (WellSegmentLocation& location : *locations)
{ {
calculateLateralIntersections(caseToApply, &location, &branchNumber, &segmentNumber); assignLateralIntersections(caseToApply, &location, &branchNumber, &segmentNumber);
} }
} }

View File

@ -43,12 +43,18 @@ class RimWellPath;
/// ///
//================================================================================================== //==================================================================================================
struct WellSegmentLateralIntersection { struct WellSegmentLateralIntersection {
WellSegmentLateralIntersection(int segmentNumber, int attachedSegmentNumber, size_t cellIndex, double length, double depth) WellSegmentLateralIntersection(int segmentNumber,
int attachedSegmentNumber,
size_t cellIndex,
double length,
double depth,
const cvf::Vec3d& lengthsInCell)
: segmentNumber(segmentNumber), : segmentNumber(segmentNumber),
attachedSegmentNumber(attachedSegmentNumber), attachedSegmentNumber(attachedSegmentNumber),
cellIndex(cellIndex), cellIndex(cellIndex),
length(length), mdFromPreviousIntersection(length),
depth(depth), tvdChangeFromPreviousIntersection(depth),
lengthsInCell(lengthsInCell),
mainBoreCell(false) mainBoreCell(false)
{} {}
@ -56,8 +62,8 @@ struct WellSegmentLateralIntersection {
int attachedSegmentNumber; int attachedSegmentNumber;
size_t cellIndex; size_t cellIndex;
bool mainBoreCell; bool mainBoreCell;
double length; double mdFromPreviousIntersection;
double depth; double tvdChangeFromPreviousIntersection;
cvf::Vec3d lengthsInCell; cvf::Vec3d lengthsInCell;
}; };
@ -172,8 +178,8 @@ private:
static bool wellSegmentLocationOrdering(const WellSegmentLocation& first, const WellSegmentLocation& second); static bool wellSegmentLocationOrdering(const WellSegmentLocation& first, const WellSegmentLocation& second);
static bool isPointBetween(const cvf::Vec3d& pointA, const cvf::Vec3d& pointB, const cvf::Vec3d& needle); static bool isPointBetween(const cvf::Vec3d& pointA, const cvf::Vec3d& pointB, const cvf::Vec3d& needle);
static void calculateLateralIntersections(const RimEclipseCase* caseToApply, WellSegmentLocation* location, int* branchNum, int* segmentNum); static void assignLateralIntersections(const RimEclipseCase* caseToApply, WellSegmentLocation* location, int* branchNum, int* segmentNum);
static void assignBranchAndSegmentNumbers(const RimEclipseCase* caseToApply, std::vector<WellSegmentLocation>* locations); 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<IJKCellIndex, std::vector<RigCompletionData> >* completionData, const std::vector<RigCompletionData>& data);

View File

@ -55,13 +55,17 @@
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimCompletionCellIntersectionCalc::calculateIntersections(const RimProject* project, const RimEclipseCase* eclipseCase, const RigMainGrid* grid, std::vector<double>& values, const QDateTime& fromDate) void RimCompletionCellIntersectionCalc::calculateCompletionTypeResult(const RimProject* project,
const RimEclipseCase* eclipseCase,
const RigMainGrid* grid,
std::vector<double>& completionTypeCellResults,
const QDateTime& fromDate)
{ {
for (const RimWellPath* wellPath : project->activeOilField()->wellPathCollection->wellPaths) for (const RimWellPath* wellPath : project->activeOilField()->wellPathCollection->wellPaths)
{ {
if (wellPath->showWellPath()) if (wellPath->showWellPath())
{ {
calculateWellPathIntersections(wellPath, grid, values, fromDate); calculateWellPathIntersections(wellPath, grid, completionTypeCellResults, fromDate);
} }
} }
@ -72,7 +76,7 @@ void RimCompletionCellIntersectionCalc::calculateIntersections(const RimProject*
{ {
for (RimSimWellFracture* fracture : simWell->simwellFractureCollection()->simwellFractures()) for (RimSimWellFracture* fracture : simWell->simwellFractureCollection()->simwellFractures())
{ {
calculateFractureIntersections(grid, fracture, values); calculateFractureIntersections(grid, fracture, completionTypeCellResults);
} }
} }
} }
@ -82,9 +86,13 @@ void RimCompletionCellIntersectionCalc::calculateIntersections(const RimProject*
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimCompletionCellIntersectionCalc::calculateWellPathIntersections(const RimWellPath* wellPath, const RigMainGrid* grid, std::vector<double>& values, const QDateTime& fromDate) void RimCompletionCellIntersectionCalc::calculateWellPathIntersections(const RimWellPath* wellPath,
const RigMainGrid* grid,
std::vector<double>& values,
const QDateTime& fromDate)
{ {
std::vector<HexIntersectionInfo> intersections = RigWellPathIntersectionTools::getIntersectedCells(grid, wellPath->wellPathGeometry()->m_wellPathPoints); std::vector<HexIntersectionInfo> intersections = RigWellPathIntersectionTools::getIntersectedCells(grid,
wellPath->wellPathGeometry()->m_wellPathPoints);
for (auto& intersection : intersections) for (auto& intersection : intersections)
{ {

View File

@ -41,8 +41,12 @@ class QDateTime;
class RimCompletionCellIntersectionCalc class RimCompletionCellIntersectionCalc
{ {
public: public:
static void calculateIntersections(const RimProject* project, const RimEclipseCase* eclipseCase, const RigMainGrid* grid, std::vector<double>& values, const QDateTime& fromDate); static void calculateCompletionTypeResult(const RimProject* project,
const RimEclipseCase* eclipseCase,
const RigMainGrid* grid,
std::vector<double>& completionTypeCellResult,
const QDateTime& fromDate);
private: private:
static void calculateWellPathIntersections(const RimWellPath* wellPath, const RigMainGrid* grid, std::vector<double>& values, const QDateTime& fromDate); static void calculateWellPathIntersections(const RimWellPath* wellPath, const RigMainGrid* grid, std::vector<double>& values, const QDateTime& fromDate);
static void calculateFishbonesIntersections(const RimFishbonesMultipleSubs* fishbonesSubs, const RigMainGrid* grid, std::vector<double>& values); static void calculateFishbonesIntersections(const RimFishbonesMultipleSubs* fishbonesSubs, const RigMainGrid* grid, std::vector<double>& values);

View File

@ -2257,7 +2257,7 @@ void RigCaseCellResultsData::computeCompletionTypeForTimeStep(size_t timeStep)
QDateTime timeStepDate = this->timeStepDates()[timeStep]; QDateTime timeStepDate = this->timeStepDates()[timeStep];
RimCompletionCellIntersectionCalc::calculateIntersections(project, eclipseCase, m_ownerMainGrid, completionTypeResult, timeStepDate); RimCompletionCellIntersectionCalc::calculateCompletionTypeResult(project, eclipseCase, m_ownerMainGrid, completionTypeResult, timeStepDate);
} }

View File

@ -153,9 +153,15 @@ std::vector<WellPathCellIntersectionInfo> RigEclipseWellLogExtractor::cellInters
if (cellIdx1 == cellIdx2) if (cellIdx1 == cellIdx2)
{ {
cvf::Vec3d internalCellLengths; cvf::Vec3d internalCellLengths;
internalCellLengths = RigWellPathIntersectionTools::calculateLengthInCell( m_caseData->mainGrid(), cellIdx1, m_intersections[cpIdx], m_intersections[cpIdx+1] ); internalCellLengths = RigWellPathIntersectionTools::calculateLengthInCell(m_caseData->mainGrid(),
cellIdx1,
m_intersections[cpIdx],
m_intersections[cpIdx+1]);
cellIntersectionInfos.push_back(WellPathCellIntersectionInfo(cellIdx1, m_intersections[cpIdx], m_intersections[cpIdx+1], internalCellLengths)); cellIntersectionInfos.push_back(WellPathCellIntersectionInfo(cellIdx1,
m_intersections[cpIdx],
m_intersections[cpIdx+1],
internalCellLengths));
} }
} }
} }

View File

@ -25,7 +25,9 @@
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RigWellLogExtractor::RigWellLogExtractor(const RigWellPath* wellpath, const std::string& wellCaseErrorMsgName) : m_wellPath(wellpath), m_wellCaseErrorMsgName(wellCaseErrorMsgName) RigWellLogExtractor::RigWellLogExtractor(const RigWellPath* wellpath, const std::string& wellCaseErrorMsgName)
: m_wellPath(wellpath),
m_wellCaseErrorMsgName(wellCaseErrorMsgName)
{ {
} }
@ -95,9 +97,9 @@ void RigWellLogExtractor::insertIntersectionsInMap(const std::vector<HexIntersec
} }
uniqueIntersections->insert(std::make_pair(RigMDCellIdxEnterLeaveKey(measuredDepthOfPoint, uniqueIntersections->insert(std::make_pair(RigMDCellIdxEnterLeaveKey(measuredDepthOfPoint,
intersections[intIdx].m_hexIndex, intersections[intIdx].m_hexIndex,
intersections[intIdx].m_isIntersectionEntering), intersections[intIdx].m_isIntersectionEntering),
intersections[intIdx])); intersections[intIdx]));
} }
} }

View File

@ -42,15 +42,16 @@ std::vector<WellPathCellIntersectionInfo> RigWellPathIntersectionTools::findCell
const RigMainGrid* grid = caseData->mainGrid(); const RigMainGrid* grid = caseData->mainGrid();
if (pathCoords.size() < 2) return intersectionInfos; if (pathCoords.size() < 2) return intersectionInfos;
cvf::ref<RigWellPath> dummyWellPath = new RigWellPath; cvf::ref<RigWellPath> dummyWellPath = new RigWellPath;
dummyWellPath->m_wellPathPoints = pathCoords; dummyWellPath->m_wellPathPoints = pathCoords;
dummyWellPath->m_measuredDepths = pathMds; dummyWellPath->m_measuredDepths = pathMds;
cvf::ref<RigEclipseWellLogExtractor> extractor = new RigEclipseWellLogExtractor(caseData, dummyWellPath.p(), caseData->ownerCase()->caseUserDescription().toStdString()); cvf::ref<RigEclipseWellLogExtractor> extractor = new RigEclipseWellLogExtractor(caseData,
dummyWellPath.p(),
caseData->ownerCase()->caseUserDescription().toStdString());
return extractor->cellIntersectionInfo(); return extractor->cellIntersectionInfo();
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------