#1593 Use well path unit system for completions on well path

This commit is contained in:
Bjørnar Grip Fjær
2017-06-20 10:40:39 +02:00
parent 9ccd033c91
commit d3f512f783
20 changed files with 373 additions and 105 deletions

View File

@@ -28,8 +28,8 @@ public:
{
UNITS_METRIC,
UNITS_FIELD,
UNITS_LAB,
UNITS_UNKNOWN,
//UNITS_LAB
};
typedef caf::AppEnum< RiaEclipseUnitTools::UnitSystem > UnitSystemType;
@@ -41,6 +41,7 @@ public:
static double feetToMeter(double feet) { return feet*meterPerFeet();}
static double meterToInch(double meter) { return meter*feetPerMeter()*12; }
static double inchToMeter(double inch) { return (inch / 12)*meterPerFeet(); }
static double inchToFeet(double inch) { return inch / 12.0; }
static double darcysConstant(UnitSystem unitSystem);

View File

@@ -185,6 +185,8 @@ void RicExportFishbonesWellSegmentsFeature::generateWelsegsTable(RifEclipseDataT
const RicExportWellSegmentsSettingsUi& settings,
const std::vector<WellSegmentLocation>& locations)
{
RiaEclipseUnitTools::UnitSystem unitSystem = settings.caseToApply->eclipseCaseData()->unitsType();
formatter.keyword("WELSEGS");
double startMD = wellPath->fishbonesCollection()->startMD();
@@ -246,7 +248,8 @@ void RicExportFishbonesWellSegmentsFeature::generateWelsegsTable(RifEclipseDataT
length += location.fishbonesSubs->measuredDepth(location.subIndex) - previousMD;
}
double diameter = computeEffectiveDiameter(wellPath->fishbonesCollection()->linerDiameter(), wellPath->fishbonesCollection()->mainBoreDiameter());
double diameter = computeEffectiveDiameter(wellPath->fishbonesCollection()->linerDiameter(unitSystem),
wellPath->fishbonesCollection()->mainBoreDiameter(unitSystem));
formatter.comment(QString("Segment for sub %1").arg(location.subIndex));
formatter.add(location.segmentNumber).add(location.segmentNumber);
@@ -255,7 +258,7 @@ void RicExportFishbonesWellSegmentsFeature::generateWelsegsTable(RifEclipseDataT
formatter.add(length);
formatter.add(depth);
formatter.add(diameter);
formatter.add(wellPath->fishbonesCollection()->roughnessFactor());
formatter.add(wellPath->fishbonesCollection()->roughnessFactor(unitSystem));
formatter.rowCompleted();
previousMD = location.measuredDepth;
@@ -269,7 +272,8 @@ void RicExportFishbonesWellSegmentsFeature::generateWelsegsTable(RifEclipseDataT
formatter.comment("Rough: MSW - Open Hole Roughness Factor");
for (const WellSegmentLocation& location : locations)
{
double diameter = computeEffectiveDiameter(wellPath->fishbonesCollection()->linerDiameter(), wellPath->fishbonesCollection()->mainBoreDiameter());
double diameter = computeEffectiveDiameter(wellPath->fishbonesCollection()->linerDiameter(unitSystem),
wellPath->fishbonesCollection()->mainBoreDiameter(unitSystem));
formatter.comment("ICD");
formatter.add(location.icdSegmentNumber).add(location.icdSegmentNumber);
formatter.add(location.icdBranchNumber);
@@ -277,7 +281,7 @@ void RicExportFishbonesWellSegmentsFeature::generateWelsegsTable(RifEclipseDataT
formatter.add(0.1); // ICDs have 0.1 length
formatter.add(0); // Depth change
formatter.add(diameter);
formatter.add(wellPath->fishbonesCollection()->roughnessFactor());
formatter.add(wellPath->fishbonesCollection()->roughnessFactor(unitSystem));
formatter.rowCompleted();
for (const WellSegmentLateral& lateral : location.laterals)
@@ -299,7 +303,7 @@ void RicExportFishbonesWellSegmentsFeature::generateWelsegsTable(RifEclipseDataT
depth += intersection.depth;
length += intersection.length;
}
double diameter = computeEffectiveDiameter(location.fishbonesSubs->tubingDiameter(), location.fishbonesSubs->holeDiameter());
double diameter = computeEffectiveDiameter(location.fishbonesSubs->tubingDiameter(unitSystem), location.fishbonesSubs->holeDiameter(unitSystem));
formatter.add(intersection.segmentNumber);
formatter.add(intersection.segmentNumber);
formatter.add(lateral.branchNumber);
@@ -307,7 +311,7 @@ void RicExportFishbonesWellSegmentsFeature::generateWelsegsTable(RifEclipseDataT
formatter.add(length);
formatter.add(depth);
formatter.add(diameter);
formatter.add(location.fishbonesSubs->openHoleRoughnessFactor());
formatter.add(location.fishbonesSubs->openHoleRoughnessFactor(unitSystem));
formatter.rowCompleted();
}
}
@@ -383,6 +387,8 @@ void RicExportFishbonesWellSegmentsFeature::generateWsegvalvTable(RifEclipseData
const RicExportWellSegmentsSettingsUi& settings,
const std::vector<WellSegmentLocation>& locations)
{
RiaEclipseUnitTools::UnitSystem unitSystem = settings.caseToApply->eclipseCaseData()->unitsType();
{
formatter.keyword("WSEGVALV");
std::vector<RifEclipseOutputTableColumn> header = {
@@ -399,7 +405,7 @@ void RicExportFishbonesWellSegmentsFeature::generateWsegvalvTable(RifEclipseData
formatter.add(location.icdSegmentNumber);
formatter.add(location.fishbonesSubs->icdFlowCoefficient());
double icdOrificeRadius = location.fishbonesSubs->icdOrificeDiameter() / 2;
double icdOrificeRadius = location.fishbonesSubs->icdOrificeDiameter(unitSystem) / 2;
double icdArea = icdOrificeRadius * icdOrificeRadius * cvf::PI_D;
formatter.add(icdArea * static_cast<double>(location.fishbonesSubs->icdCount()));
formatter.rowCompleted();

View File

@@ -31,7 +31,6 @@
#include "RimFishboneWellPathCollection.h"
#include "RimWellPathCompletions.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -41,6 +40,8 @@ void RicFishbonesTransmissibilityCalculationFeatureImp::findFishboneLateralsWell
const RigEclipseCaseData* caseData = settings.caseToApply()->eclipseCaseData();
std::vector<WellSegmentLocation> locations = RicWellPathExportCompletionDataFeature::findWellSegmentLocations(settings.caseToApply, wellPath);
RiaEclipseUnitTools::UnitSystem unitSystem = caseData->unitsType();
// Filter out cells where main bore is present
if (settings.removeLateralsInMainBoreCells())
{
@@ -60,7 +61,7 @@ void RicFishbonesTransmissibilityCalculationFeatureImp::findFishboneLateralsWell
{
if (intersection.mainBoreCell && settings.removeLateralsInMainBoreCells()) continue;
double diameter = location.fishbonesSubs->holeDiameter() / 1000;
double diameter = location.fishbonesSubs->holeDiameter(unitSystem);
QString completionMetaData = (location.fishbonesSubs->name() + QString(" Sub: %1 Lateral: %2").arg(location.subIndex).arg(lateral.lateralIndex));
WellBorePartForTransCalc wellBorePart = WellBorePartForTransCalc(intersection.lengthsInCell,
diameter / 2,
@@ -153,7 +154,6 @@ std::vector<RigCompletionData> RicFishbonesTransmissibilityCalculationFeatureImp
}
CellDirection direction = RicWellPathExportCompletionDataFeature::calculateDirectionInCell(settings.caseToApply,
cellIndex,
wellBorePart.lengthsInCell);
@@ -162,19 +162,22 @@ std::vector<RigCompletionData> RicFishbonesTransmissibilityCalculationFeatureImp
wellBorePart.skinFactor,
wellBorePart.wellRadius *2,
direction);
completionData.push_back(completion);
}
}
return completionData;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicFishbonesTransmissibilityCalculationFeatureImp::findFishboneImportedLateralsWellBoreParts(std::map<size_t, std::vector<WellBorePartForTransCalc> >& wellBorePartsInCells, const RimWellPath* wellPath, const RicExportCompletionDataSettingsUi& settings)
{
RiaEclipseUnitTools::UnitSystem unitSystem = settings.caseToApply->eclipseCaseData()->unitsType();
std::vector<size_t> wellPathCells = RicWellPathExportCompletionDataFeature::findIntersectingCells(settings.caseToApply()->eclipseCaseData(), wellPath->wellPathGeometry()->m_wellPathPoints);
bool isMainBore = false;
double diameter = wellPath->fishbonesCollection()->wellPathCollection()->holeDiameter() / 1000;
double diameter = wellPath->fishbonesCollection()->wellPathCollection()->holeDiameter(unitSystem);
for (const RimFishboneWellPath* fishbonesPath : wellPath->fishbonesCollection()->wellPathCollection()->wellPaths())
{
std::vector<WellPathCellIntersectionInfo> intersectedCells = RigWellPathIntersectionTools::findCellsIntersectedByPath(settings.caseToApply->eclipseCaseData(), fishbonesPath->coordinates());
@@ -197,10 +200,13 @@ void RicFishbonesTransmissibilityCalculationFeatureImp::findFishboneImportedLate
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicFishbonesTransmissibilityCalculationFeatureImp::findMainWellBoreParts(std::map<size_t, std::vector<WellBorePartForTransCalc>>& wellBorePartsInCells, const RimWellPath* wellPath, const RicExportCompletionDataSettingsUi& settings)
void RicFishbonesTransmissibilityCalculationFeatureImp::findMainWellBoreParts(std::map<size_t, std::vector<WellBorePartForTransCalc>>& wellBorePartsInCells,
const RimWellPath* wellPath,
const RicExportCompletionDataSettingsUi& settings)
{
RiaEclipseUnitTools::UnitSystem unitSystem = settings.caseToApply->eclipseCaseData()->unitsType();
bool isMainBore = true;
double holeDiameter = wellPath->fishbonesCollection()->mainBoreDiameter();
double holeDiameter = wellPath->fishbonesCollection()->mainBoreDiameter(unitSystem);
double FishboneStartMD = wellPath->fishbonesCollection()->startMD();
std::vector<double> wellPathMD = wellPath->wellPathGeometry()->m_measuredDepths;

View File

@@ -169,12 +169,7 @@ void RicWellPathExportCompletionDataFeature::exportCompletions(const std::vector
bool unitSystemMismatch = false;
for (const RimWellPath* wellPath : usedWellPaths)
{
if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_FIELD && exportSettings.caseToApply->eclipseCaseData()->unitsType() != RigEclipseCaseData::UNITS_FIELD)
{
unitSystemMismatch = true;
break;
}
else if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_METRIC && exportSettings.caseToApply->eclipseCaseData()->unitsType() != RigEclipseCaseData::UNITS_METRIC)
if (wellPath->unitSystem() != exportSettings.caseToApply->eclipseCaseData()->unitsType())
{
unitSystemMismatch = true;
break;
@@ -505,6 +500,8 @@ void RicWellPathExportCompletionDataFeature::generateWpimultTable(RifEclipseData
//--------------------------------------------------------------------------------------------------
std::vector<RigCompletionData> RicWellPathExportCompletionDataFeature::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(RifReaderInterface::MATRIX_RESULTS);
@@ -524,21 +521,20 @@ std::vector<RigCompletionData> RicWellPathExportCompletionDataFeature::generateP
settings.caseToApply->eclipseCaseData()->mainGrid()->ijkFromCellIndex(cell.cellIndex, &i, &j, &k);
RigCompletionData completion(wellPath->completions()->wellNameForExport(), IJKCellIndex(i, j, k));
completion.addMetadata("Perforation", QString("StartMD: %1 - EndMD: %2").arg(interval->startMD()).arg(interval->endMD()));
CellDirection direction = calculateDirectionInCell(settings.caseToApply, cell.cellIndex, cell.internalCellLengths);
double transmissibility = RicWellPathExportCompletionDataFeature::calculateTransmissibility(settings.caseToApply,
wellPath,
cell.internalCellLengths,
interval->skinFactor(),
interval->diameter() / 2,
interval->diameter(unitSystem) / 2,
cell.cellIndex);
completion.setTransAndWPImultBackgroundDataFromPerforation(transmissibility,
interval->skinFactor(),
interval->diameter(),
interval->diameter(unitSystem),
direction);
completionData.push_back(completion);
}
@@ -847,20 +843,9 @@ double RicWellPathExportCompletionDataFeature::calculateTransmissibilityAsEclips
double permy = permxAccessObject->cellScalarGlobIdx(cellIndex);
double permz = permxAccessObject->cellScalarGlobIdx(cellIndex);
//TODO: EclipseCaseData should use RiaEclipseUnitTools to simplify this!!!
RiaEclipseUnitTools::UnitSystem units = RiaEclipseUnitTools::UNITS_UNKNOWN;
if (eclipseCase->eclipseCaseData()->unitsType() == RigEclipseCaseData::UNITS_FIELD)
{
units = RiaEclipseUnitTools::UNITS_FIELD;
}
else if (eclipseCase->eclipseCaseData()->unitsType() == RigEclipseCaseData::UNITS_METRIC)
{
units = RiaEclipseUnitTools::UNITS_METRIC;
}
RiaEclipseUnitTools::UnitSystem units = eclipseCaseData->unitsType();
double darcy = RiaEclipseUnitTools::darcysConstant(units);
double trans = cvf::UNDEFINED_DOUBLE;
if (direction == CellDirection::DIR_I)
{

View File

@@ -691,16 +691,16 @@ void RifReaderEclipseOutput::buildMetaData()
}
// Default units type is METRIC
RigEclipseCaseData::UnitsType unitsType = RigEclipseCaseData::UNITS_METRIC;
RiaEclipseUnitTools::UnitSystem unitsType = RiaEclipseUnitTools::UNITS_METRIC;
{
int unitsTypeValue = m_dynamicResultsAccess->readUnitsType();
if (unitsTypeValue == 2)
{
unitsType = RigEclipseCaseData::UNITS_FIELD;
unitsType = RiaEclipseUnitTools::UNITS_FIELD;
}
else if (unitsTypeValue == 3)
{
unitsType = RigEclipseCaseData::UNITS_LAB;
unitsType = RiaEclipseUnitTools::UNITS_LAB;
}
}
@@ -985,8 +985,8 @@ RigWellResultPoint RifReaderEclipseOutput::createWellResultPoint(const RigGridBa
double fieldGasToOilEquivalent = 1.0e6/5800; // Mega ft^3 to BOE
double metricGasToOilEquivalent = 1.0/1.0e3; // Sm^3 Gas to Sm^3 oe
if (m_eclipseCase->unitsType() == RigEclipseCaseData::UNITS_FIELD) gasRate = fieldGasToOilEquivalent * gasRate;
if (m_eclipseCase->unitsType() == RigEclipseCaseData::UNITS_METRIC) gasRate = metricGasToOilEquivalent * gasRate;
if (m_eclipseCase->unitsType() == RiaEclipseUnitTools::UNITS_FIELD) gasRate = fieldGasToOilEquivalent * gasRate;
if (m_eclipseCase->unitsType() == RiaEclipseUnitTools::UNITS_METRIC) gasRate = metricGasToOilEquivalent * gasRate;
resultPoint.m_gasRate = gasRate;
}

View File

@@ -23,6 +23,8 @@
#include "RimFishboneWellPath.h"
#include "RimFishbonesPipeProperties.h"
#include "RiaEclipseUnitTools.h"
#include "cafPdmObject.h"
#include "cafPdmChildArrayField.h"
#include "cafPdmChildField.h"
@@ -45,7 +47,7 @@ public:
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
std::vector<const RimFishboneWellPath*> wellPaths() const;
double holeDiameter() const { return m_pipeProperties->holeDiameter(); }
double holeDiameter(RiaEclipseUnitTools::UnitSystem unitSystem) const { return m_pipeProperties->holeDiameter(unitSystem); }
double skinFactor() const { return m_pipeProperties->skinFactor(); }
protected:

View File

@@ -84,6 +84,39 @@ void RimFishbonesCollection::fieldChangedByUi(const caf::PdmFieldHandle* changed
proj->createDisplayModelAndRedrawAllViews();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFishbonesCollection::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
{
RimWellPath* wellPath;
firstAncestorOrThisOfType(wellPath);
if (wellPath)
{
if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_METRIC)
{
m_startMD.uiCapability()->setUiName("Start MD [m]");
m_mainBoreDiameter.uiCapability()->setUiName("Main Bore Diameter [m]");
m_linerDiameter.uiCapability()->setUiName("Liner Inner Diameter [m]");
m_roughnessFactor.uiCapability()->setUiName("Roughness Factor [m]");
}
else if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_FIELD)
{
m_startMD.uiCapability()->setUiName("Start MD [ft]");
m_mainBoreDiameter.uiCapability()->setUiName("Main Bore Diameter [ft]");
m_linerDiameter.uiCapability()->setUiName("Liner Inner Diameter [ft]");
m_roughnessFactor.uiCapability()->setUiName("Roughness Factor [ft]");
}
}
}
uiOrdering.add(&m_startMD);
uiOrdering.add(&m_mainBoreDiameter);
uiOrdering.add(&m_linerDiameter);
uiOrdering.add(&m_roughnessFactor);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -157,3 +190,57 @@ void RimFishbonesCollection::recalculateStartMD()
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFishbonesCollection::mainBoreDiameter(RiaEclipseUnitTools::UnitSystem unitSystem) const
{
RimWellPath* wellPath;
firstAncestorOrThisOfTypeAsserted(wellPath);
if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_FIELD && unitSystem == RiaEclipseUnitTools::UNITS_METRIC)
{
return RiaEclipseUnitTools::feetToMeter(m_mainBoreDiameter());
}
else if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_METRIC && unitSystem == RiaEclipseUnitTools::UNITS_FIELD)
{
return RiaEclipseUnitTools::meterToFeet(m_mainBoreDiameter());
}
return m_mainBoreDiameter();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFishbonesCollection::linerDiameter(RiaEclipseUnitTools::UnitSystem unitSystem) const
{
RimWellPath* wellPath;
firstAncestorOrThisOfTypeAsserted(wellPath);
if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_FIELD && unitSystem == RiaEclipseUnitTools::UNITS_METRIC)
{
return RiaEclipseUnitTools::feetToMeter(m_linerDiameter());
}
else if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_METRIC && unitSystem == RiaEclipseUnitTools::UNITS_FIELD)
{
return RiaEclipseUnitTools::meterToFeet(m_linerDiameter());
}
return m_linerDiameter();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFishbonesCollection::roughnessFactor(RiaEclipseUnitTools::UnitSystem unitSystem) const
{
RimWellPath* wellPath;
firstAncestorOrThisOfTypeAsserted(wellPath);
if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_FIELD && unitSystem == RiaEclipseUnitTools::UNITS_METRIC)
{
return RiaEclipseUnitTools::feetToMeter(m_roughnessFactor());
}
else if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_METRIC && unitSystem == RiaEclipseUnitTools::UNITS_FIELD)
{
return RiaEclipseUnitTools::meterToFeet(m_roughnessFactor());
}
return m_roughnessFactor();
}

View File

@@ -20,6 +20,8 @@
#include "RimCheckableNamedObject.h"
#include "RiaEclipseUnitTools.h"
#include "cafPdmChildArrayField.h"
#include "cafPdmChildField.h"
#include "cafPdmFieldCvfColor.h"
@@ -47,13 +49,14 @@ public:
caf::PdmChildArrayField<RimFishbonesMultipleSubs*> fishbonesSubs;
void recalculateStartMD();
double startMD() const { return m_startMD(); }
double mainBoreDiameter() const { return m_mainBoreDiameter(); }
double linerDiameter() const { return m_linerDiameter(); }
double roughnessFactor() const { return m_roughnessFactor(); }
double startMD() const { return m_startMD; }
double mainBoreDiameter(RiaEclipseUnitTools::UnitSystem unitSystem) const;
double linerDiameter(RiaEclipseUnitTools::UnitSystem unitSystem) const;
double roughnessFactor(RiaEclipseUnitTools::UnitSystem unitSystem) const;
protected:
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
virtual void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
private:
cvf::Color3f nextFishbonesColor() const;

View File

@@ -174,11 +174,88 @@ double RimFishbonesMultipleSubs::buildAngle() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFishbonesMultipleSubs::tubingDiameter() const
double RimFishbonesMultipleSubs::tubingDiameter(RiaEclipseUnitTools::UnitSystem unitSystem) const
{
return m_lateralTubingDiameter;
RimWellPath* wellPath;
firstAncestorOrThisOfTypeAsserted(wellPath);
if (unitSystem == RiaEclipseUnitTools::UNITS_METRIC)
{
if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_FIELD)
{
return RiaEclipseUnitTools::inchToMeter(m_lateralTubingDiameter());
}
else
{
return m_lateralTubingDiameter() / 1000;
}
}
else if (unitSystem == RiaEclipseUnitTools::UNITS_FIELD)
{
if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_METRIC)
{
return RiaEclipseUnitTools::meterToFeet(m_lateralTubingDiameter() / 1000);
}
else
{
return RiaEclipseUnitTools::inchToFeet(m_lateralTubingDiameter());
}
}
CVF_ASSERT(false);
return 0.0;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFishbonesMultipleSubs::openHoleRoughnessFactor(RiaEclipseUnitTools::UnitSystem unitSystem) const
{
RimWellPath* wellPath;
firstAncestorOrThisOfTypeAsserted(wellPath);
if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_FIELD && unitSystem == RiaEclipseUnitTools::UNITS_METRIC)
{
return RiaEclipseUnitTools::feetToMeter(m_lateralOpenHoleRoghnessFactor());
}
else if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_METRIC && unitSystem == RiaEclipseUnitTools::UNITS_FIELD)
{
return RiaEclipseUnitTools::meterToFeet(m_lateralOpenHoleRoghnessFactor());
}
return m_lateralOpenHoleRoghnessFactor();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFishbonesMultipleSubs::icdOrificeDiameter(RiaEclipseUnitTools::UnitSystem unitSystem) const
{
RimWellPath* wellPath;
firstAncestorOrThisOfTypeAsserted(wellPath);
if (unitSystem == RiaEclipseUnitTools::UNITS_METRIC)
{
if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_FIELD)
{
return RiaEclipseUnitTools::inchToMeter(m_icdOrificeDiameter());
}
else
{
return m_icdOrificeDiameter() / 1000;
}
}
else if (unitSystem == RiaEclipseUnitTools::UNITS_FIELD)
{
if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_METRIC)
{
return RiaEclipseUnitTools::meterToFeet(m_icdOrificeDiameter() / 1000);
}
else
{
return RiaEclipseUnitTools::inchToFeet(m_icdOrificeDiameter());
}
}
CVF_ASSERT(false);
return 0.0;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -352,6 +429,44 @@ void RimFishbonesMultipleSubs::computeRangesAndLocations()
//--------------------------------------------------------------------------------------------------
void RimFishbonesMultipleSubs::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
{
RimWellPath* wellPath;
firstAncestorOrThisOfType(wellPath);
if (wellPath)
{
if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_METRIC)
{
m_lateralLength.uiCapability()->setUiName("Length(s) [m]");
m_lateralBuildAngle.uiCapability()->setUiName("Build Angle [deg/m]");
m_lateralTubingDiameter.uiCapability()->setUiName("Tubing Diameter [mm]");
m_lateralOpenHoleRoghnessFactor.uiCapability()->setUiName("Open Hole Roughness Factor [m]");
m_lateralTubingRoghnessFactor.uiCapability()->setUiName("Tubing Roughness Factor [m]");
m_icdOrificeDiameter.uiCapability()->setUiName("ICD Orifice Diameter [mm]");
m_locationOfSubs.uiCapability()->setUiName("Measured Depths [m]");
m_rangeStart.uiCapability()->setUiName("Start MD [m]");
m_rangeEnd.uiCapability()->setUiName("End MD [m]");
m_rangeSubSpacing.uiCapability()->setUiName("Spacing [m]");
}
else if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_FIELD)
{
m_lateralLength.uiCapability()->setUiName("Length(s) [ft]");
m_lateralBuildAngle.uiCapability()->setUiName("Build Angle [deg/ft]");
m_lateralTubingDiameter.uiCapability()->setUiName("Tubing Diameter [in]");
m_lateralOpenHoleRoghnessFactor.uiCapability()->setUiName("Open Hole Roughness Factor [ft]");
m_lateralTubingRoghnessFactor.uiCapability()->setUiName("Tubing Roughness Factor [ft]");
m_icdOrificeDiameter.uiCapability()->setUiName("ICD Orifice Diameter [in]");
m_locationOfSubs.uiCapability()->setUiName("Measured Depths [ft]");
m_rangeStart.uiCapability()->setUiName("Start MD [ft]");
m_rangeEnd.uiCapability()->setUiName("End MD [ft]");
m_rangeSubSpacing.uiCapability()->setUiName("Spacing [ft]");
}
}
}
{
caf::PdmUiGroup* group = uiOrdering.addNewGroup("Appearance");

View File

@@ -22,6 +22,8 @@
#include "Rim3dPropertiesInterface.h"
#include "RimFishbonesPipeProperties.h"
#include "RiaEclipseUnitTools.h"
#include "cvfBase.h"
#include "cvfVector3.h"
#include "cvfColor3.h"
@@ -79,11 +81,11 @@ public:
double exitAngle() const;
double buildAngle() const;
double tubingDiameter() const;
double holeDiameter() const { return m_pipeProperties()->holeDiameter(); }
double tubingDiameter(RiaEclipseUnitTools::UnitSystem unitSystem) const;
double holeDiameter(RiaEclipseUnitTools::UnitSystem unitSystem) const { return m_pipeProperties()->holeDiameter(unitSystem); }
double skinFactor() const { return m_pipeProperties()->skinFactor(); }
double openHoleRoughnessFactor() const { return m_lateralOpenHoleRoghnessFactor(); }
double icdOrificeDiameter() const { return m_icdOrificeDiameter(); }
double openHoleRoughnessFactor(RiaEclipseUnitTools::UnitSystem unitSystem) const;
double icdOrificeDiameter(RiaEclipseUnitTools::UnitSystem unitSystem) const;
double icdFlowCoefficient() const { return m_icdFlowCoefficient(); }
size_t icdCount() const { return m_icdCount(); }
std::vector<double> lateralLengths() const;

View File

@@ -18,6 +18,8 @@
#include "RimFishbonesPipeProperties.h"
#include "RimWellPath.h"
#include <cstdlib>
@@ -42,11 +44,60 @@ RimFishbonesPipeProperties::~RimFishbonesPipeProperties()
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFishbonesPipeProperties::holeDiameter(RiaEclipseUnitTools::UnitSystem unitSystem) const
{
RimWellPath* wellPath;
firstAncestorOrThisOfTypeAsserted(wellPath);
if (unitSystem == RiaEclipseUnitTools::UNITS_METRIC)
{
if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_FIELD)
{
return RiaEclipseUnitTools::inchToMeter(m_lateralHoleDiameter());
}
else
{
return m_lateralHoleDiameter() / 1000;
}
}
else if (unitSystem == RiaEclipseUnitTools::UNITS_FIELD)
{
if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_METRIC)
{
return RiaEclipseUnitTools::meterToFeet(m_lateralHoleDiameter() / 1000);
}
else
{
return RiaEclipseUnitTools::inchToFeet(m_lateralHoleDiameter());
}
}
CVF_ASSERT(false);
return 0.0;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFishbonesPipeProperties::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering & uiOrdering)
{
{
RimWellPath* wellPath;
firstAncestorOrThisOfType(wellPath);
if (wellPath)
{
if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_METRIC)
{
m_lateralHoleDiameter.uiCapability()->setUiName("Hole Diameter [mm]");
}
else if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_FIELD)
{
m_lateralHoleDiameter.uiCapability()->setUiName("Hole Diameter [in]");
}
}
}
uiOrdering.add(&m_lateralHoleDiameter);
uiOrdering.add(&m_skinFactor);
}

View File

@@ -18,6 +18,8 @@
#pragma once
#include "RiaEclipseUnitTools.h"
#include "cvfBase.h"
#include "cvfVector3.h"
#include "cvfColor3.h"
@@ -41,7 +43,7 @@ public:
virtual ~RimFishbonesPipeProperties();
double skinFactor() const { return m_skinFactor(); }
double holeDiameter() const { return m_lateralHoleDiameter(); }
double holeDiameter(RiaEclipseUnitTools::UnitSystem unitSystem) const;
protected:
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;

View File

@@ -36,9 +36,9 @@ RimPerforationInterval::RimPerforationInterval()
{
CAF_PDM_InitObject("Perforation", ":/PerforationInterval16x16.png", "", "");
CAF_PDM_InitField(&m_startMD, "StartMeasuredDepth", 0.0, "Start MD [m]", "", "", "");
CAF_PDM_InitField(&m_endMD, "EndMeasuredDepth", 0.0, "End MD [m]", "", "", "");
CAF_PDM_InitField(&m_diameter, "Diameter", 0.216, "Diameter [m]", "", "", "");
CAF_PDM_InitField(&m_startMD, "StartMeasuredDepth", 0.0, "Start MD", "", "", "");
CAF_PDM_InitField(&m_endMD, "EndMeasuredDepth", 0.0, "End MD", "", "", "");
CAF_PDM_InitField(&m_diameter, "Diameter", 0.216, "Diameter", "", "", "");
CAF_PDM_InitField(&m_skinFactor, "SkinFactor", 0.0, "Skin Factor", "", "", "");
CAF_PDM_InitField(&m_startOfHistory, "StartOfHistory", true, "Start of History", "", "", "");
CAF_PDM_InitField(&m_date, "StartDate", QDateTime::currentDateTime(), "Start Date", "", "", "");
@@ -97,6 +97,24 @@ void RimPerforationInterval::setSkinFactor(double skinFactor)
m_skinFactor = skinFactor;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimPerforationInterval::diameter(RiaEclipseUnitTools::UnitSystem unitSystem) const
{
RimWellPath* wellPath;
firstAncestorOrThisOfTypeAsserted(wellPath);
if (unitSystem == RiaEclipseUnitTools::UNITS_METRIC && wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_FIELD)
{
return RiaEclipseUnitTools::feetToMeter(m_diameter());
}
else if (unitSystem == RiaEclipseUnitTools::UNITS_FIELD && wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_METRIC)
{
return RiaEclipseUnitTools::meterToFeet(m_diameter());
}
return m_diameter();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -158,6 +176,25 @@ void RimPerforationInterval::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTree
//--------------------------------------------------------------------------------------------------
void RimPerforationInterval::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
{
RimWellPath* wellPath;
firstAncestorOrThisOfType(wellPath);
if (wellPath)
{
if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_METRIC)
{
m_startMD.uiCapability()->setUiName("Start MD [m]");
m_endMD.uiCapability()->setUiName("End MD [m]");
m_diameter.uiCapability()->setUiName("Diameter [m]");
}
else if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_FIELD)
{
m_startMD.uiCapability()->setUiName("Start MD [ft]");
m_endMD.uiCapability()->setUiName("End MD [ft]");
m_diameter.uiCapability()->setUiName("Diameter [ft]");
}
}
}
m_date.uiCapability()->setUiReadOnly(m_startOfHistory());
uiOrdering.add(&m_startMD);

View File

@@ -22,6 +22,8 @@
#include "RimCheckableNamedObject.h"
#include "Rim3dPropertiesInterface.h"
#include "RiaEclipseUnitTools.h"
#include "cafPdmField.h"
#include "cafPdmObject.h"
@@ -45,7 +47,7 @@ public:
void setSkinFactor(double skinFactor);
double startMD() const { return m_startMD(); }
double endMD() const { return m_endMD(); }
double diameter() const { return m_diameter(); }
double diameter(RiaEclipseUnitTools::UnitSystem unitSystem) const;
double skinFactor() const { return m_skinFactor(); }
bool isActiveOnDate(const QDateTime& date) const;

View File

@@ -356,7 +356,7 @@ std::map<QString, const std::vector<double> *> RimWellAllocationPlot::findReleva
//--------------------------------------------------------------------------------------------------
void RimWellAllocationPlot::updateWellFlowPlotXAxisTitle(RimWellLogTrack* plotTrack)
{
RigEclipseCaseData::UnitsType unitSet = m_case->eclipseCaseData()->unitsType();
RiaEclipseUnitTools::UnitSystem unitSet = m_case->eclipseCaseData()->unitsType();
if (m_flowDiagSolution)
@@ -364,13 +364,13 @@ void RimWellAllocationPlot::updateWellFlowPlotXAxisTitle(RimWellLogTrack* plotTr
QString unitText;
switch ( unitSet )
{
case RigEclipseCaseData::UNITS_METRIC:
case RiaEclipseUnitTools::UNITS_METRIC:
unitText = "[m<sup>3</sup>/day]";
break;
case RigEclipseCaseData::UNITS_FIELD:
case RiaEclipseUnitTools::UNITS_FIELD:
unitText = "[Brl/day]";
break;
case RigEclipseCaseData::UNITS_LAB:
case RiaEclipseUnitTools::UNITS_LAB:
unitText = "[cm<sup>3</sup>/hr]";
break;
default:
@@ -384,13 +384,13 @@ void RimWellAllocationPlot::updateWellFlowPlotXAxisTitle(RimWellLogTrack* plotTr
QString unitText;
switch ( unitSet )
{
case RigEclipseCaseData::UNITS_METRIC:
case RiaEclipseUnitTools::UNITS_METRIC:
unitText = "[Liquid Sm<sup>3</sup>/day], [Gas kSm<sup>3</sup>/day]";
break;
case RigEclipseCaseData::UNITS_FIELD:
case RiaEclipseUnitTools::UNITS_FIELD:
unitText = "[Liquid BBL/day], [Gas BOE/day]";
break;
case RigEclipseCaseData::UNITS_LAB:
case RiaEclipseUnitTools::UNITS_LAB:
unitText = "[cm<sup>3</sup>/hr]";
break;
default:

View File

@@ -1575,25 +1575,7 @@ double RimReservoirCellResultsStorage::darchysValue()
if (rimCase && rimCase->eclipseCaseData())
{
RigEclipseCaseData::UnitsType unitsType = rimCase->eclipseCaseData()->unitsType();
if (unitsType == RigEclipseCaseData::UNITS_FIELD)
{
darchy = 0.001127;
}
else if (unitsType == RigEclipseCaseData::UNITS_METRIC)
{
darchy = 0.008527;
}
else if (unitsType == RigEclipseCaseData::UNITS_LAB)
{
darchy = 3.6;
}
else
{
darchy = 0.00864; // Assuming (PVT - M)
CVF_TIGHT_ASSERT(false); // The enum and doc does not state that the PVT-M actually exists, so to trap this in debug
}
darchy = RiaEclipseUnitTools::darcysConstant(rimCase->eclipseCaseData()->unitsType());
}
return darchy;

View File

@@ -349,8 +349,8 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate()
eclExtractor->curveData(resAcc.p(), &values);
}
RigEclipseCaseData::UnitsType eclipseUnitsType = eclipseCase->eclipseCaseData()->unitsType();
if (eclipseUnitsType == RigEclipseCaseData::UNITS_FIELD)
RiaEclipseUnitTools::UnitSystem eclipseUnitsType = eclipseCase->eclipseCaseData()->unitsType();
if (eclipseUnitsType == RiaEclipseUnitTools::UNITS_FIELD)
{
// See https://github.com/OPM/ResInsight/issues/538

View File

@@ -439,14 +439,7 @@ RiaEclipseUnitTools::UnitSystemType RimWellPathCollection::findUnitSystemForWell
if (caseBoundingBox.intersects(wellPathBoundingBox))
{
if (eclipseCaseData->unitsType() == RigEclipseCaseData::UNITS_FIELD)
{
return RiaEclipseUnitTools::UNITS_FIELD;
}
else if (eclipseCaseData->unitsType() == RigEclipseCaseData::UNITS_METRIC)
{
return RiaEclipseUnitTools::UNITS_METRIC;
}
return eclipseCaseData->unitsType();
}
return RiaEclipseUnitTools::UNITS_UNKNOWN;
}

View File

@@ -45,7 +45,7 @@ RigEclipseCaseData::RigEclipseCaseData()
m_matrixModelResults->setActiveCellInfo(m_activeCellInfo.p());
m_fractureModelResults->setActiveCellInfo(m_fractureActiveCellInfo.p());
m_unitsType = UNITS_METRIC;
m_unitsType = RiaEclipseUnitTools::UNITS_METRIC;
}
//--------------------------------------------------------------------------------------------------

View File

@@ -23,6 +23,8 @@
#include "RifReaderInterface.h"
#include "RiaEclipseUnitTools.h"
#include "cvfAssert.h"
#include "cvfArray.h"
#include "cvfObject.h"
@@ -48,14 +50,6 @@ struct RigWellResultPoint;
//--------------------------------------------------------------------------------------------------
class RigEclipseCaseData : public cvf::Object
{
public:
enum UnitsType
{
UNITS_METRIC,
UNITS_FIELD,
UNITS_LAB
};
public:
RigEclipseCaseData();
~RigEclipseCaseData();
@@ -92,8 +86,8 @@ public:
void computeActiveCellBoundingBoxes();
UnitsType unitsType() const { return m_unitsType; }
void setUnitsType(UnitsType unitsType) { m_unitsType = unitsType; }
RiaEclipseUnitTools::UnitSystem unitsType() const { return m_unitsType; }
void setUnitsType(RiaEclipseUnitTools::UnitSystem unitsType) { m_unitsType = unitsType; }
private:
void computeActiveCellIJKBBox();
@@ -115,5 +109,5 @@ private:
cvf::Collection<cvf::UByteArray> m_wellCellsInGrid; //< A bool array pr grid with one bool pr cell telling wether the cell is a well cell or not
cvf::Collection<cvf::UIntArray> m_gridCellToResultWellIndex; //< Array pr grid with index to well pr cell telling which well a cell is in
UnitsType m_unitsType;
RiaEclipseUnitTools::UnitSystem m_unitsType;
};