#1560 Add support for computing fishbones transmissibilities

This commit is contained in:
Bjørnar Grip Fjær 2017-06-08 10:40:56 +02:00
parent ce76134a8d
commit 0f188a2200
8 changed files with 84 additions and 4 deletions

View File

@ -29,6 +29,8 @@ RicExportCompletionDataSettingsUi::RicExportCompletionDataSettingsUi()
CAF_PDM_InitField(&timeStep, "TimeStepIndex", 0, "Time Step", "", "", "");
CAF_PDM_InitField(&computeTransmissibility, "ComputeTransmissibility", true, "Compute Transmissibility", "", "", "");
CAF_PDM_InitField(&includePerforations, "IncludePerforations", true, "Include Perforations", "", "", "");
CAF_PDM_InitField(&includeFishbones, "IncludeFishbones", true, "Include Fishbones", "", "", "");

View File

@ -33,6 +33,7 @@ public:
RicExportCompletionDataSettingsUi();
caf::PdmField<bool> computeTransmissibility;
caf::PdmField<bool> includePerforations;
caf::PdmField<bool> includeFishbones;

View File

@ -42,6 +42,7 @@
#include "RigMainGrid.h"
#include "RigWellPath.h"
#include "RigResultAccessorFactory.h"
#include "RigTransmissibilityEquations.h"
#include "cafSelectionManager.h"
#include "cafPdmUiPropertyViewDialog.h"
@ -330,8 +331,20 @@ std::vector<RigCompletionData> RicWellPathExportCompletionDataFeature::generateF
RigCompletionData completion(wellPath->name(), IJKCellIndex(i, j, k));
completion.addMetadata(location.fishbonesSubs->name(), QString("Sub: %1 Lateral: %2").arg(location.subIndex).arg(lateral.lateralIndex));
double diameter = location.fishbonesSubs->holeDiameter() / 1000;
CellDirection direction = calculateDirectionInCell(settings.caseToApply, intersection.cellIndex, intersection.lengthsInCell);
completion.setFromFishbone(diameter, direction);
if (settings.computeTransmissibility())
{
double transmissibility = calculateTransmissibility(settings.caseToApply,
wellPath,
intersection.lengthsInCell,
location.fishbonesSubs->skinFactor(),
location.fishbonesSubs->holeDiameter(),
intersection.cellIndex);
completion.setFromFishbone(transmissibility, location.fishbonesSubs->skinFactor());
}
else {
CellDirection direction = calculateDirectionInCell(settings.caseToApply, intersection.cellIndex, intersection.lengthsInCell);
completion.setFromFishbone(diameter, direction);
}
completionData.push_back(completion);
}
}
@ -357,8 +370,21 @@ std::vector<RigCompletionData> RicWellPathExportCompletionDataFeature::generateF
settings.caseToApply->eclipseCaseData()->mainGrid()->ijkFromCellIndex(cell.cellIndex, &i, &j, &k);
RigCompletionData completion(wellPath->name(), IJKCellIndex(i, j, k));
completion.addMetadata(fishbonesPath->name(), "");
CellDirection direction = calculateDirectionInCell(settings.caseToApply, cell.cellIndex, cell.internalCellLengths);
completion.setFromFishbone(diameter, direction);
if (settings.computeTransmissibility())
{
double skinFactor = wellPath->fishbonesCollection()->wellPathCollection()->skinFactor();
double transmissibility = calculateTransmissibility(settings.caseToApply,
wellPath,
cell.internalCellLengths,
skinFactor,
wellPath->fishbonesCollection()->wellPathCollection()->holeDiameter(),
cell.cellIndex);
completion.setFromFishbone(transmissibility, skinFactor);
}
else {
CellDirection direction = calculateDirectionInCell(settings.caseToApply, cell.cellIndex, cell.internalCellLengths);
completion.setFromFishbone(diameter, direction);
}
completionData.push_back(completion);
}
}
@ -610,3 +636,40 @@ CellDirection RicWellPathExportCompletionDataFeature::calculateDirectionInCell(R
return CellDirection::DIR_K;
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RicWellPathExportCompletionDataFeature::calculateTransmissibility(RimEclipseCase* eclipseCase, const RimWellPath* wellPath, const cvf::Vec3d& internalCellLengths, double skinFactor, double wellRadius, size_t cellIndex)
{
RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData();
eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RimDefines::STATIC_NATIVE, "DX");
cvf::ref<RigResultAccessor> dxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "DX");
eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RimDefines::STATIC_NATIVE, "DY");
cvf::ref<RigResultAccessor> dyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "DY");
eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RimDefines::STATIC_NATIVE, "DZ");
cvf::ref<RigResultAccessor> dzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "DZ");
eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RimDefines::STATIC_NATIVE, "PERMX");
cvf::ref<RigResultAccessor> permxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "PERMX");
eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RimDefines::STATIC_NATIVE, "PERMY");
cvf::ref<RigResultAccessor> permyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "PERMY");
eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RimDefines::STATIC_NATIVE, "PERMZ");
cvf::ref<RigResultAccessor> permzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "PERMZ");
double dx = dxAccessObject->cellScalarGlobIdx(cellIndex);
double dy = dyAccessObject->cellScalarGlobIdx(cellIndex);
double dz = dzAccessObject->cellScalarGlobIdx(cellIndex);
double permx = permxAccessObject->cellScalarGlobIdx(cellIndex);
double permy = permxAccessObject->cellScalarGlobIdx(cellIndex);
double permz = permxAccessObject->cellScalarGlobIdx(cellIndex);
double darcy = RimUnitSystem::darcysConstant(wellPath->unitSystem());
double transx = RigTransmissibilityEquations::wellBoreTransmissibilityComponent(internalCellLengths.x(), permy, permz, dy, dz, wellRadius, skinFactor, darcy);
double transy = RigTransmissibilityEquations::wellBoreTransmissibilityComponent(internalCellLengths.y(), permx, permz, dx, dz, wellRadius, skinFactor, darcy);
double transz = RigTransmissibilityEquations::wellBoreTransmissibilityComponent(internalCellLengths.z(), permy, permx, dy, dx, wellRadius, skinFactor, darcy);
return RigTransmissibilityEquations::totalConnectionFactor(transx, transy, transz);
}

View File

@ -151,4 +151,6 @@ private:
static void appendCompletionData(std::map<IJKCellIndex, RigCompletionData>* completionData, const std::vector<RigCompletionData>& data);
static CellDirection calculateDirectionInCell(RimEclipseCase* eclipseCase, size_t cellIndex, const cvf::Vec3d& lengthsInCell);
static double calculateTransmissibility(RimEclipseCase* eclipseCase, const RimWellPath* wellPath, const cvf::Vec3d& internalCellLengths, double skinFactor, double wellRadius, size_t cellIndex);
};

View File

@ -46,6 +46,7 @@ public:
std::vector<const RimFishboneWellPath*> wellPaths() const;
double holeDiameter() const { return m_pipeProperties->holeDiameter(); }
double skinFactor() const { return m_pipeProperties->skinFactor(); }
protected:
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;

View File

@ -81,6 +81,7 @@ public:
double tubingDiameter() const;
double holeDiameter() const { return m_pipeProperties()->holeDiameter(); }
double skinFactor() const { return m_pipeProperties()->skinFactor(); }
double openHoleRoughnessFactor() const { return m_lateralOpenHoleRoghnessFactor(); }
double icdOrificeDiameter() const { return m_icdOrificeDiameter(); }
double icdFlowCoefficient() const { return m_icdFlowCoefficient(); }

View File

@ -125,6 +125,15 @@ void RigCompletionData::setFromFishbone(double diameter, CellDirection direction
m_direction = direction;
}
//==================================================================================================
///
//==================================================================================================
void RigCompletionData::setFromFishbone(double transmissibility, double skinFactor)
{
m_transmissibility = transmissibility;
m_skinFactor = skinFactor;
}
//==================================================================================================
///
//==================================================================================================

View File

@ -102,6 +102,7 @@ public:
void setFromFracture(double transmissibility, double skinFactor);
void setFromFishbone(double diameter, CellDirection direction);
void setFromFishbone(double transmissibility, double skinFactor);
void setFromPerforation(double diameter, CellDirection direction);
void addMetadata(const QString& name, const QString& comment);
static bool isDefaultValue(double val);