Whitespace

This commit is contained in:
Magne Sjaastad 2018-10-11 10:25:54 +02:00
parent 256e5de30c
commit bebd21aa47

View File

@ -77,8 +77,20 @@
class SubSegmentIntersectionInfo class SubSegmentIntersectionInfo
{ {
public: public:
SubSegmentIntersectionInfo(size_t globCellIndex, double startTVD, double endTVD, double startMD, double endMD, cvf::Vec3d lengthsInCell) SubSegmentIntersectionInfo(size_t globCellIndex,
: globCellIndex(globCellIndex), startTVD(startTVD), endTVD(endTVD), startMD(startMD), endMD(endMD), intersectionLengthsInCellCS(lengthsInCell) {} double startTVD,
double endTVD,
double startMD,
double endMD,
cvf::Vec3d lengthsInCell)
: globCellIndex(globCellIndex)
, startTVD(startTVD)
, endTVD(endTVD)
, startMD(startMD)
, endMD(endMD)
, intersectionLengthsInCellCS(lengthsInCell)
{
}
size_t globCellIndex; size_t globCellIndex;
double startTVD; double startTVD;
@ -200,8 +212,8 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions(const std::ve
if (exportSettings.includePerforations) if (exportSettings.includePerforations)
{ {
std::vector<RigCompletionData> perforationCompletionData = std::vector<RigCompletionData> perforationCompletionData = generatePerforationsCompdatValues(
generatePerforationsCompdatValues(wellPath, wellPath->perforationIntervalCollection()->perforations(), exportSettings); wellPath, wellPath->perforationIntervalCollection()->perforations(), exportSettings);
appendCompletionData(&completionsPerEclipseCellAllCompletionTypes, perforationCompletionData); appendCompletionData(&completionsPerEclipseCellAllCompletionTypes, perforationCompletionData);
appendCompletionData(&completionsPerEclipseCellPerforations, perforationCompletionData); appendCompletionData(&completionsPerEclipseCellPerforations, perforationCompletionData);
@ -230,8 +242,7 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions(const std::ve
exportSettings.caseToApply(), exportSettings.caseToApply(),
reportItems, reportItems,
fractureTransmissibilityExportInformationStream.get(), fractureTransmissibilityExportInformationStream.get(),
RicExportFractureCompletionsImpl::PressureDepletionParameters( RicExportFractureCompletionsImpl::PressureDepletionParameters(exportSettings.transScalingType(),
exportSettings.transScalingType(),
exportSettings.transScalingCorrection(), exportSettings.transScalingCorrection(),
exportSettings.transScalingTimeStep(), exportSettings.transScalingTimeStep(),
exportSettings.transScalingSummaryWBHP(), exportSettings.transScalingSummaryWBHP(),
@ -278,8 +289,7 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions(const std::ve
exportSettings.caseToApply(), exportSettings.caseToApply(),
simWell, simWell,
fractureTransmissibilityExportInformationStream.get(), fractureTransmissibilityExportInformationStream.get(),
RicExportFractureCompletionsImpl::PressureDepletionParameters( RicExportFractureCompletionsImpl::PressureDepletionParameters(exportSettings.transScalingType(),
exportSettings.transScalingType(),
exportSettings.transScalingCorrection(), exportSettings.transScalingCorrection(),
exportSettings.transScalingTimeStep(), exportSettings.transScalingTimeStep(),
exportSettings.transScalingSummaryWBHP(), exportSettings.transScalingSummaryWBHP(),
@ -556,7 +566,8 @@ std::vector<RigCompletionData>
exportSettings.includePerforations = true; exportSettings.includePerforations = true;
exportSettings.includeFractures = true; exportSettings.includeFractures = true;
completionsPerEclipseCell = generatePerforationsCompdatValues(wellPath, wellPath->perforationIntervalCollection()->perforations(), exportSettings); completionsPerEclipseCell = generatePerforationsCompdatValues(
wellPath, wellPath->perforationIntervalCollection()->perforations(), exportSettings);
} }
return completionsPerEclipseCell; return completionsPerEclipseCell;
@ -790,7 +801,7 @@ void RicWellPathExportCompletionDataFeatureImpl::generateCompsegTables(RifEclips
} }
{ {
std::set<RigCompletionData::CompletionType> completionTypes = { RigCompletionData::PERFORATION }; std::set<RigCompletionData::CompletionType> completionTypes = {RigCompletionData::PERFORATION};
generateCompsegTable(formatter, exportInfo, false, completionTypes); generateCompsegTable(formatter, exportInfo, false, completionTypes);
if (exportInfo.hasSubGridIntersections()) if (exportInfo.hasSubGridIntersections())
{ {
@ -1661,9 +1672,7 @@ std::vector<RigCompletionData> RicWellPathExportCompletionDataFeatureImpl::gener
cell.globCellIndex, cell.globCellIndex,
wellPath->perforationIntervalCollection()->nonDarcyParameters()); wellPath->perforationIntervalCollection()->nonDarcyParameters());
double kh = calculateKh(settings.caseToApply, double kh = calculateKh(settings.caseToApply, cell.intersectionLengthsInCellCS, cell.globCellIndex);
cell.intersectionLengthsInCellCS,
cell.globCellIndex);
completion.setTransAndWPImultBackgroundDataFromPerforation( completion.setTransAndWPImultBackgroundDataFromPerforation(
transmissibility, interval->skinFactor(), interval->diameter(unitSystem), dFactor, kh, direction); transmissibility, interval->skinFactor(), interval->diameter(unitSystem), dFactor, kh, direction);
@ -1709,8 +1718,7 @@ RicMswExportInfo RicWellPathExportCompletionDataFeatureImpl::generateFishbonesMs
exportInfo.setLinerDiameter(wellPath->fishbonesCollection()->mswParameters()->linerDiameter(unitSystem)); exportInfo.setLinerDiameter(wellPath->fishbonesCollection()->mswParameters()->linerDiameter(unitSystem));
exportInfo.setRoughnessFactor(wellPath->fishbonesCollection()->mswParameters()->roughnessFactor(unitSystem)); exportInfo.setRoughnessFactor(wellPath->fishbonesCollection()->mswParameters()->roughnessFactor(unitSystem));
double maxSegmentLength = enableSegmentSplitting double maxSegmentLength = enableSegmentSplitting ? wellPath->fishbonesCollection()->mswParameters()->maxSegmentLength()
? wellPath->fishbonesCollection()->mswParameters()->maxSegmentLength()
: std::numeric_limits<double>::infinity(); : std::numeric_limits<double>::infinity();
bool foundSubGridIntersections = false; bool foundSubGridIntersections = false;
double subStartMD = wellPath->fishbonesCollection()->startMD(); double subStartMD = wellPath->fishbonesCollection()->startMD();
@ -1752,7 +1760,8 @@ RicMswExportInfo RicWellPathExportCompletionDataFeatureImpl::generateFishbonesMs
QString label = QString("Lateral %1").arg(lateralIndex); QString label = QString("Lateral %1").arg(lateralIndex);
location.addCompletion(RicMswCompletion(RigCompletionData::FISHBONES, label, lateralIndex)); location.addCompletion(RicMswCompletion(RigCompletionData::FISHBONES, label, lateralIndex));
} }
assignFishbonesLateralIntersections(caseToApply, subs, &location, &foundSubGridIntersections, maxSegmentLength); assignFishbonesLateralIntersections(
caseToApply, subs, &location, &foundSubGridIntersections, maxSegmentLength);
} }
exportInfo.addWellSegmentLocation(location); exportInfo.addWellSegmentLocation(location);
@ -1804,7 +1813,8 @@ RicMswExportInfo
RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath(caseToApply->eclipseCaseData(), coords, mds); RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath(caseToApply->eclipseCaseData(), coords, mds);
double maxSegmentLength = wellPath->fractureCollection()->mswParameters()->maxSegmentLength(); double maxSegmentLength = wellPath->fractureCollection()->mswParameters()->maxSegmentLength();
std::vector<SubSegmentIntersectionInfo> subSegIntersections = spiltIntersectionSegmentsToMaxLength(wellPathGeometry, intersections, maxSegmentLength); std::vector<SubSegmentIntersectionInfo> subSegIntersections =
spiltIntersectionSegmentsToMaxLength(wellPathGeometry, intersections, maxSegmentLength);
double initialMD = 0.0; double initialMD = 0.0;
if (wellPath->fractureCollection()->referenceMDType() == RimWellPathFractureCollection::MANUAL_REFERENCE_MD) if (wellPath->fractureCollection()->referenceMDType() == RimWellPathFractureCollection::MANUAL_REFERENCE_MD)
@ -1871,7 +1881,7 @@ RicMswExportInfo
RicExportFractureCompletionsImpl::generateCompdatValues(caseToApply, RicExportFractureCompletionsImpl::generateCompdatValues(caseToApply,
wellPath->completions()->wellNameForExport(), wellPath->completions()->wellNameForExport(),
wellPath->wellPathGeometry(), wellPath->wellPathGeometry(),
{ fracture }, {fracture},
nullptr, nullptr,
nullptr); nullptr);
@ -1910,7 +1920,8 @@ RicMswExportInfo RicWellPathExportCompletionDataFeatureImpl::generatePerforation
RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath(caseToApply->eclipseCaseData(), coords, mds); RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath(caseToApply->eclipseCaseData(), coords, mds);
double maxSegmentLength = wellPath->perforationIntervalCollection()->mswParameters()->maxSegmentLength(); double maxSegmentLength = wellPath->perforationIntervalCollection()->mswParameters()->maxSegmentLength();
std::vector<SubSegmentIntersectionInfo> subSegIntersections = spiltIntersectionSegmentsToMaxLength(wellPathGeometry, intersections, maxSegmentLength); std::vector<SubSegmentIntersectionInfo> subSegIntersections =
spiltIntersectionSegmentsToMaxLength(wellPathGeometry, intersections, maxSegmentLength);
double initialMD = 0.0; double initialMD = 0.0;
for (WellPathCellIntersectionInfo intersection : intersections) for (WellPathCellIntersectionInfo intersection : intersections)
@ -1960,10 +1971,12 @@ RicMswExportInfo RicWellPathExportCompletionDataFeatureImpl::generatePerforation
double intervalStartMD = interval->startMD(); double intervalStartMD = interval->startMD();
double intervalEndMD = interval->endMD(); double intervalEndMD = interval->endMD();
if(cellIntInfo.endMD > intervalStartMD && cellIntInfo.startMD < intervalEndMD) if (cellIntInfo.endMD > intervalStartMD && cellIntInfo.startMD < intervalEndMD)
{ {
std::vector<RigCompletionData> completionData = generatePerforationsCompdatValues(wellPath, {interval}, exportSettings); std::vector<RigCompletionData> completionData =
assignPerforationIntervalIntersections(caseToApply, interval, completionData, &location, &cellIntInfo, &foundSubGridIntersections); generatePerforationsCompdatValues(wellPath, {interval}, exportSettings);
assignPerforationIntervalIntersections(
caseToApply, interval, completionData, &location, &cellIntInfo, &foundSubGridIntersections);
} }
} }
@ -2024,7 +2037,8 @@ void RicWellPathExportCompletionDataFeatureImpl::assignFishbonesLateralIntersect
RigWellPath pathGeometry; RigWellPath pathGeometry;
pathGeometry.m_wellPathPoints = lateralCoords; pathGeometry.m_wellPathPoints = lateralCoords;
pathGeometry.m_measuredDepths = lateralMDs; pathGeometry.m_measuredDepths = lateralMDs;
std::vector<SubSegmentIntersectionInfo> subSegIntersections = spiltIntersectionSegmentsToMaxLength(&pathGeometry, intersections, maxSegmentLength); std::vector<SubSegmentIntersectionInfo> subSegIntersections =
spiltIntersectionSegmentsToMaxLength(&pathGeometry, intersections, maxSegmentLength);
double previousExitMD = lateralMDs.front(); double previousExitMD = lateralMDs.front();
double previousExitTVD = -lateralCoords.front().z(); double previousExitTVD = -lateralCoords.front().z();
@ -2094,7 +2108,8 @@ void RicWellPathExportCompletionDataFeatureImpl::assignFractureIntersections(con
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RicWellPathExportCompletionDataFeatureImpl::assignPerforationIntervalIntersections(const RimEclipseCase* caseToApply, void RicWellPathExportCompletionDataFeatureImpl::assignPerforationIntervalIntersections(
const RimEclipseCase* caseToApply,
const RimPerforationInterval* interval, const RimPerforationInterval* interval,
const std::vector<RigCompletionData>& completionData, const std::vector<RigCompletionData>& completionData,
RicMswSegment* location, RicMswSegment* location,
@ -2118,7 +2133,8 @@ void RicWellPathExportCompletionDataFeatureImpl::assignPerforationIntervalInters
cvf::Vec3st localIJK(cell.localCellIndexI(), cell.localCellIndexJ(), cell.localCellIndexK()); cvf::Vec3st localIJK(cell.localCellIndexI(), cell.localCellIndexJ(), cell.localCellIndexK());
RicMswSubSegmentCellIntersection intersection(cell.lgrName(), cell.globalCellIndex(), localIJK, cellIntInfo->intersectionLengthsInCellCS); RicMswSubSegmentCellIntersection intersection(
cell.lgrName(), cell.globalCellIndex(), localIJK, cellIntInfo->intersectionLengthsInCellCS);
subSegment.addIntersection(intersection); subSegment.addIntersection(intersection);
} }
intervalCompletion.addSubSegment(subSegment); intervalCompletion.addSubSegment(subSegment);
@ -2294,8 +2310,9 @@ double RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibility(Rim
cvf::ref<RigResultAccessor> permzAccessObject = cvf::ref<RigResultAccessor> permzAccessObject =
RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMZ"); RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMZ");
if (dxAccessObject.isNull() || dyAccessObject.isNull() || dzAccessObject.isNull() || if (dxAccessObject.isNull() || dyAccessObject.isNull() || dzAccessObject.isNull() || permxAccessObject.isNull() ||
permxAccessObject.isNull() || permyAccessObject.isNull() || permzAccessObject.isNull()) return std::numeric_limits<double>::infinity(); permyAccessObject.isNull() || permzAccessObject.isNull())
return std::numeric_limits<double>::infinity();
double ntg = 1.0; double ntg = 1.0;
{ {
@ -2362,12 +2379,13 @@ double RicWellPathExportCompletionDataFeatureImpl::calculateDFactor(RimEclipseCa
cvf::ref<RigResultAccessor> permzAccessObject = cvf::ref<RigResultAccessor> permzAccessObject =
RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMZ"); RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMZ");
if (permxAccessObject.isNull() || permyAccessObject.isNull() || permzAccessObject.isNull()) return std::numeric_limits<double>::infinity(); if (permxAccessObject.isNull() || permyAccessObject.isNull() || permzAccessObject.isNull())
return std::numeric_limits<double>::infinity();
double permx = permxAccessObject->cellScalarGlobIdx(globalCellIndex); double permx = permxAccessObject->cellScalarGlobIdx(globalCellIndex);
double permy = permyAccessObject->cellScalarGlobIdx(globalCellIndex); double permy = permyAccessObject->cellScalarGlobIdx(globalCellIndex);
double permz = permzAccessObject->cellScalarGlobIdx(globalCellIndex); double permz = permzAccessObject->cellScalarGlobIdx(globalCellIndex);
double totalPerm = permx + 0*permy + 0*permz; // TODO: Calculate total perm double totalPerm = permx + 0 * permy + 0 * permz; // TODO: Calculate total perm
eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PORO"); eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PORO");
cvf::ref<RigResultAccessor> poroAccessObject = cvf::ref<RigResultAccessor> poroAccessObject =
@ -2416,7 +2434,8 @@ double RicWellPathExportCompletionDataFeatureImpl::calculateKh(RimEclipseCase* e
cvf::ref<RigResultAccessor> permzAccessObject = cvf::ref<RigResultAccessor> permzAccessObject =
RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMZ"); RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMZ");
if (permxAccessObject.isNull() || permyAccessObject.isNull() || permzAccessObject.isNull()) return std::numeric_limits<double>::infinity(); if (permxAccessObject.isNull() || permyAccessObject.isNull() || permzAccessObject.isNull())
return std::numeric_limits<double>::infinity();
double permx = permxAccessObject->cellScalarGlobIdx(globalCellIndex); double permx = permxAccessObject->cellScalarGlobIdx(globalCellIndex);
double permy = permyAccessObject->cellScalarGlobIdx(globalCellIndex); double permy = permyAccessObject->cellScalarGlobIdx(globalCellIndex);
@ -2617,7 +2636,8 @@ void RicWellPathExportCompletionDataFeatureImpl::exportWellSegments(
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
QString RicWellPathExportCompletionDataFeatureImpl::createPressureDepletionFileNameSuffix(const RicExportCompletionDataSettingsUi& exportSettings) QString RicWellPathExportCompletionDataFeatureImpl::createPressureDepletionFileNameSuffix(
const RicExportCompletionDataSettingsUi& exportSettings)
{ {
QString suffix; QString suffix;
if (exportSettings.transScalingType() != RicExportFractureCompletionsImpl::NO_CORRECTION) if (exportSettings.transScalingType() != RicExportFractureCompletionsImpl::NO_CORRECTION)
@ -2685,7 +2705,8 @@ const RimWellPath* findWellPathFromExportName(const QString& wellNameForExport)
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::vector<SubSegmentIntersectionInfo> spiltIntersectionSegmentsToMaxLength(const RigWellPath* pathGeometry, std::vector<SubSegmentIntersectionInfo>
spiltIntersectionSegmentsToMaxLength(const RigWellPath* pathGeometry,
const std::vector<WellPathCellIntersectionInfo>& intersections, const std::vector<WellPathCellIntersectionInfo>& intersections,
double maxSegmentLength) double maxSegmentLength)
{ {
@ -2717,7 +2738,7 @@ std::vector<SubSegmentIntersectionInfo> spiltIntersectionSegmentsToMaxLength(con
double currEndMd = currStartMd; double currEndMd = currStartMd;
double lastTvd = -intersection.startPoint.z(); double lastTvd = -intersection.startPoint.z();
for(int segIndex = 0; segIndex < segCount; segIndex++) for (int segIndex = 0; segIndex < segCount; segIndex++)
{ {
bool lasti = segIndex == (segCount - 1); bool lasti = segIndex == (segCount - 1);
currEndMd = currStartMd + effectiveMaxSegLen; currEndMd = currStartMd + effectiveMaxSegLen;