#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)
{
depth = intersection.depth;
length = intersection.length;
depth = intersection.tvdChangeFromPreviousIntersection;
length = intersection.mdFromPreviousIntersection;
}
else
{
depth += intersection.depth;
length += intersection.length;
depth += intersection.tvdChangeFromPreviousIntersection;
length += intersection.mdFromPreviousIntersection;
}
double diameter = computeEffectiveDiameter(location.fishbonesSubs->tubingDiameter(unitSystem), location.fishbonesSubs->holeDiameter(unitSystem));
formatter.add(intersection.segmentNumber);
@ -370,10 +370,10 @@ void RicExportFishbonesWellSegmentsFeature::generateCompsegsTable(RifEclipseData
formatter.addZeroBasedCellIndex(i).addZeroBasedCellIndex(j).addZeroBasedCellIndex(k);
formatter.add(lateral.branchNumber);
formatter.add(aggregatedLength);
formatter.add(aggregatedLength + intersection.length);
formatter.add(aggregatedLength + intersection.mdFromPreviousIntersection);
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
const RigEclipseCaseData* caseData = settings.caseToApply()->eclipseCaseData();

View File

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

View File

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

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)
{
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())
{
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)
{

View File

@ -41,7 +41,11 @@ class QDateTime;
class RimCompletionCellIntersectionCalc
{
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:
static void calculateWellPathIntersections(const RimWellPath* wellPath, const RigMainGrid* grid, std::vector<double>& values, const QDateTime& fromDate);

View File

@ -2257,7 +2257,7 @@ void RigCaseCellResultsData::computeCompletionTypeForTimeStep(size_t 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)
{
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)
{
}

View File

@ -42,15 +42,16 @@ std::vector<WellPathCellIntersectionInfo> RigWellPathIntersectionTools::findCell
const RigMainGrid* grid = caseData->mainGrid();
if (pathCoords.size() < 2) return intersectionInfos;
cvf::ref<RigWellPath> dummyWellPath = new RigWellPath;
dummyWellPath->m_wellPathPoints = pathCoords;
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();
}
//--------------------------------------------------------------------------------------------------