mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
pre-proto - Cleanups in code. Renamings and adding functions global index in array of RigStimPlanCell for simplified interaction with these
This commit is contained in:
@@ -119,7 +119,7 @@ bool RifEclipseExportTools::writeFracturesToTextFile(const QString& fileName, c
|
|||||||
RigFractureTransCalc transmissibilityCalculator(caseToApply, fracture);
|
RigFractureTransCalc transmissibilityCalculator(caseToApply, fracture);
|
||||||
|
|
||||||
//TODO: Check that there is a fracture template available for given fracture....
|
//TODO: Check that there is a fracture template available for given fracture....
|
||||||
transmissibilityCalculator.computeTransmissibility();
|
transmissibilityCalculator.computeTransmissibilityFromPolygonWithInfiniteConductivityInFracture();
|
||||||
std::vector<RigFractureData> fracDataVector = fracture->attachedRigFracture()->fractureData();
|
std::vector<RigFractureData> fracDataVector = fracture->attachedRigFracture()->fractureData();
|
||||||
|
|
||||||
for (RigFractureData fracData : fracDataVector)
|
for (RigFractureData fracData : fracDataVector)
|
||||||
@@ -335,6 +335,8 @@ void RifEclipseExportTools::printStimPlanCellsMatrixTransContributions(const std
|
|||||||
|
|
||||||
out << "\n";
|
out << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO: add RigFractureStimPlanCellData to m_StimPlanCellsFractureData i RigFracture???
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -380,7 +382,7 @@ void RifEclipseExportTools::printStimPlanFractureTrans(const std::vector<RimFrac
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
RigFractureTransCalc::computeStimPlanCellTransmissibilityInFracture(&stimPlanCell);
|
RigFractureTransCalc::computeStimPlanCellTransmissibilityInFracture(stimPlanCell);
|
||||||
|
|
||||||
out << qSetFieldWidth(5);
|
out << qSetFieldWidth(5);
|
||||||
size_t spi = stimPlanCell.getI();
|
size_t spi = stimPlanCell.getI();
|
||||||
@@ -593,7 +595,21 @@ void RifEclipseExportTools::printBackgroundData(QTextStream & out, RimWellPath*
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RifEclipseExportTools::printTransmissibilityFractureToWell(const std::vector<RimFracture *>& fractures, QTextStream &out, RimEclipseCase* caseToApply)
|
void RifEclipseExportTools::printTransmissibilityFractureToWell(const std::vector<RimFracture *>& fractures, QTextStream &out, RimEclipseCase* caseToApply)
|
||||||
{
|
{
|
||||||
out << "Transmissibility From Fracture To Well \n";
|
out << "-- Transmissibility From Fracture To Well \n";
|
||||||
|
|
||||||
|
out << qSetFieldWidth(12);
|
||||||
|
out << "Well name ";
|
||||||
|
|
||||||
|
out << qSetFieldWidth(16);
|
||||||
|
out << "Fracture name ";
|
||||||
|
out << "Inflow type ";
|
||||||
|
|
||||||
|
out << qSetFieldWidth(5);
|
||||||
|
out << " i ";
|
||||||
|
out << " j ";
|
||||||
|
|
||||||
|
out << "Tw";
|
||||||
|
out << "\n";
|
||||||
|
|
||||||
for (RimFracture* fracture : fractures)
|
for (RimFracture* fracture : fractures)
|
||||||
{
|
{
|
||||||
@@ -609,11 +625,10 @@ void RifEclipseExportTools::printTransmissibilityFractureToWell(const std::vecto
|
|||||||
out << fracture->name().left(15) + " ";
|
out << fracture->name().left(15) + " ";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (fracture->attachedFractureDefinition()->orientation == RimFractureTemplate::ALONG_WELL_PATH)
|
if (fracture->attachedFractureDefinition()->orientation == RimFractureTemplate::ALONG_WELL_PATH)
|
||||||
{
|
{
|
||||||
out << "Linear inflow";
|
out << "Linear inflow";
|
||||||
|
out << qSetFieldWidth(5);
|
||||||
|
|
||||||
RimStimPlanFractureTemplate* fracTemplateStimPlan;
|
RimStimPlanFractureTemplate* fracTemplateStimPlan;
|
||||||
if (dynamic_cast<RimStimPlanFractureTemplate*>(fracture->attachedFractureDefinition()))
|
if (dynamic_cast<RimStimPlanFractureTemplate*>(fracture->attachedFractureDefinition()))
|
||||||
@@ -635,24 +650,23 @@ void RifEclipseExportTools::printTransmissibilityFractureToWell(const std::vecto
|
|||||||
double perforationLengthVert = fracture->perforationLength * cos(wellDip);
|
double perforationLengthVert = fracture->perforationLength * cos(wellDip);
|
||||||
double perforationLengthHor = fracture->perforationLength * sin(wellDip);
|
double perforationLengthHor = fracture->perforationLength * sin(wellDip);
|
||||||
|
|
||||||
RigStimPlanCell* stimPlanCell = fracTemplateStimPlan->getStimPlanCellAtWell();
|
std::pair<size_t, size_t> wellCenterStimPlanCellIJ = fracTemplateStimPlan->getStimPlanCellAtWellCenter();
|
||||||
//TODO: Error in getting the StimPlanWellCell here!!!
|
out << qSetFieldWidth(5);
|
||||||
|
out << wellCenterStimPlanCellIJ.first;
|
||||||
|
out << wellCenterStimPlanCellIJ.second;
|
||||||
|
|
||||||
out << stimPlanCell->getI();
|
|
||||||
out << stimPlanCell->getJ();
|
|
||||||
|
|
||||||
//TODO: Check if perforation length is larger than cell - expand to neightbour cells if needed!
|
//RigStimPlanCell* stimPlanCell = fracTemplateStimPlan->getStimPlanCellAtIJ(wellCenterStimPlanCellIJ.first, wellCenterStimPlanCellIJ.second);
|
||||||
|
const RigStimPlanCell& stimPlanCell = fracTemplateStimPlan->stimPlanCellFromIndex(fracTemplateStimPlan->getGlobalIndexFromIJ(wellCenterStimPlanCellIJ.first, wellCenterStimPlanCellIJ.second));
|
||||||
|
|
||||||
RigFractureTransCalc transmissibilityCalculator(caseToApply, fracture);
|
RigFractureTransCalc transmissibilityCalculator(caseToApply, fracture);
|
||||||
double RadTransInStimPlanCell = transmissibilityCalculator.computeLinearTransmissibilityToWellinStimPlanCell(stimPlanCell, perforationLengthVert, perforationLengthHor);
|
double RadTransInStimPlanCell = transmissibilityCalculator.computeLinearTransmissibilityToWellinStimPlanCell(stimPlanCell, perforationLengthVert, perforationLengthHor);
|
||||||
|
|
||||||
out << RadTransInStimPlanCell;
|
out << RadTransInStimPlanCell;
|
||||||
|
out << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (fracture->attachedFractureDefinition()->orientation == RimFractureTemplate::TRANSVERSE_WELL_PATH
|
if (fracture->attachedFractureDefinition()->orientation == RimFractureTemplate::TRANSVERSE_WELL_PATH
|
||||||
|| fracture->attachedFractureDefinition()->orientation == RimFractureTemplate::AZIMUTH)
|
|| fracture->attachedFractureDefinition()->orientation == RimFractureTemplate::AZIMUTH)
|
||||||
{
|
{
|
||||||
@@ -665,16 +679,22 @@ void RifEclipseExportTools::printTransmissibilityFractureToWell(const std::vecto
|
|||||||
}
|
}
|
||||||
else continue;
|
else continue;
|
||||||
|
|
||||||
RigStimPlanCell* stimPlanCell = fracTemplateStimPlan->getStimPlanCellAtWell();
|
std::pair<size_t, size_t> wellCenterStimPlanCellIJ = fracTemplateStimPlan->getStimPlanCellAtWellCenter();
|
||||||
//TODO: Error in getting the StimPlanWellCell here!!!
|
out << qSetFieldWidth(5);
|
||||||
|
out << wellCenterStimPlanCellIJ.first;
|
||||||
|
out << wellCenterStimPlanCellIJ.second;
|
||||||
|
|
||||||
out << stimPlanCell->getI();
|
//RigStimPlanCell* stimPlanCell = fracTemplateStimPlan->getStimPlanCellAtIJ(wellCenterStimPlanCellIJ.first, wellCenterStimPlanCellIJ.second);
|
||||||
out << stimPlanCell->getJ();
|
const RigStimPlanCell& stimPlanCell = fracTemplateStimPlan->stimPlanCellFromIndex(fracTemplateStimPlan->getGlobalIndexFromIJ(wellCenterStimPlanCellIJ.first, wellCenterStimPlanCellIJ.second));
|
||||||
|
|
||||||
|
//TODO: Error - stimPlanCell blir ikke riktig... Har ikke polygon!?!
|
||||||
|
|
||||||
RigFractureTransCalc transmissibilityCalculator(caseToApply, fracture);
|
RigFractureTransCalc transmissibilityCalculator(caseToApply, fracture);
|
||||||
double RadTransInStimPlanCell = transmissibilityCalculator.computeRadialTransmissibilityToWellinStimPlanCell(stimPlanCell);
|
double RadTransInStimPlanCell = transmissibilityCalculator.computeRadialTransmissibilityToWellinStimPlanCell(stimPlanCell);
|
||||||
|
|
||||||
out << RadTransInStimPlanCell;
|
out << RadTransInStimPlanCell;
|
||||||
|
out << "\n";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -682,4 +702,5 @@ void RifEclipseExportTools::printTransmissibilityFractureToWell(const std::vecto
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
out << "\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ public:
|
|||||||
static void performStimPlanUpscalingAndPrintResults(const std::vector<RimFracture *>& fractures, RimEclipseCase* caseToApply, QTextStream &out, RimWellPath* wellPath, RimEclipseWell* simWell, const RigMainGrid* mainGrid);
|
static void performStimPlanUpscalingAndPrintResults(const std::vector<RimFracture *>& fractures, RimEclipseCase* caseToApply, QTextStream &out, RimWellPath* wellPath, RimEclipseWell* simWell, const RigMainGrid* mainGrid);
|
||||||
static void printStimPlanCellsMatrixTransContributions(const std::vector<RimFracture *>& fractures, RimEclipseCase* caseToApply, QTextStream &out, RimWellPath* wellPath, RimEclipseWell* simWell, const RigMainGrid* mainGrid);
|
static void printStimPlanCellsMatrixTransContributions(const std::vector<RimFracture *>& fractures, RimEclipseCase* caseToApply, QTextStream &out, RimWellPath* wellPath, RimEclipseWell* simWell, const RigMainGrid* mainGrid);
|
||||||
static void printStimPlanFractureTrans(const std::vector<RimFracture *>& fractures, QTextStream &out);
|
static void printStimPlanFractureTrans(const std::vector<RimFracture *>& fractures, QTextStream &out);
|
||||||
|
static void printTransmissibilityFractureToWell(const std::vector<RimFracture *>& fractures, QTextStream &out, RimEclipseCase* caseToApply);
|
||||||
|
|
||||||
|
|
||||||
static void printCOMPDATvalues(QTextStream & out, RigFractureData &fracData, RimFracture* fracture, RimWellPath* wellPath, RimEclipseWell* simWell, const RigMainGrid* mainGrid);
|
static void printCOMPDATvalues(QTextStream & out, RigFractureData &fracData, RimFracture* fracture, RimWellPath* wellPath, RimEclipseWell* simWell, const RigMainGrid* mainGrid);
|
||||||
@@ -64,5 +65,4 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static void printTransmissibilityFractureToWell(const std::vector<RimFracture *>& fractures, QTextStream &out, RimEclipseCase* caseToApply);
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -65,8 +65,10 @@ RimStimPlanFractureTemplate::RimStimPlanFractureTemplate(void)
|
|||||||
|
|
||||||
CAF_PDM_InitField(¶meterForPolygon, "parameterForPolyton", QString(""), "Parameter", "", "", "");
|
CAF_PDM_InitField(¶meterForPolygon, "parameterForPolyton", QString(""), "Parameter", "", "", "");
|
||||||
CAF_PDM_InitField(&activeTimeStepIndex, "activeTimeStepIndex", 0, "Active TimeStep Index", "", "", "");
|
CAF_PDM_InitField(&activeTimeStepIndex, "activeTimeStepIndex", 0, "Active TimeStep Index", "", "", "");
|
||||||
CAF_PDM_InitField(&showStimPlanMesh, "showStimPlanMesh", true, "Show StimPlan Mesh", "", "", "")
|
CAF_PDM_InitField(&showStimPlanMesh, "showStimPlanMesh", true, "Show StimPlan Mesh", "", "", "");
|
||||||
|
|
||||||
|
//TODO: Is this correct way of doing this...?
|
||||||
|
wellCenterStimPlanCellIJ = std::make_pair(0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -818,7 +820,8 @@ void RimStimPlanFractureTemplate::setupStimPlanCells()
|
|||||||
QString resultUnitFromColors = activeView->stimPlanColors->unit();
|
QString resultUnitFromColors = activeView->stimPlanColors->unit();
|
||||||
|
|
||||||
std::vector<RigStimPlanCell> stimPlanCells;
|
std::vector<RigStimPlanCell> stimPlanCells;
|
||||||
wellCenterStimPlanCell = nullptr;
|
|
||||||
|
bool wellCenterStimPlanCellFound = false;
|
||||||
|
|
||||||
std::vector<std::vector<double>> displayPropertyValuesAtTimeStep = getMirroredDataAtTimeIndex(resultNameFromColors, resultUnitFromColors, activeTimeStepIndex);
|
std::vector<std::vector<double>> displayPropertyValuesAtTimeStep = getMirroredDataAtTimeIndex(resultNameFromColors, resultUnitFromColors, activeTimeStepIndex);
|
||||||
|
|
||||||
@@ -835,20 +838,20 @@ void RimStimPlanFractureTemplate::setupStimPlanCells()
|
|||||||
std::vector<double> depthCoords;
|
std::vector<double> depthCoords;
|
||||||
for (int i = 0; i < depthCoordsAtNodes.size() - 1; i++) depthCoords.push_back((depthCoordsAtNodes[i] + depthCoordsAtNodes[i + 1]) / 2);
|
for (int i = 0; i < depthCoordsAtNodes.size() - 1; i++) depthCoords.push_back((depthCoordsAtNodes[i] + depthCoordsAtNodes[i + 1]) / 2);
|
||||||
|
|
||||||
for (int j = 0; j < xCoords.size() - 1; j++)
|
for (int i = 0; i < xCoords.size() - 1; i++)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < depthCoords.size() - 1; i++)
|
for (int j = 0; j < depthCoords.size() - 1; j++)
|
||||||
{
|
{
|
||||||
std::vector<cvf::Vec3d> cellPolygon;
|
std::vector<cvf::Vec3d> cellPolygon;
|
||||||
cellPolygon.push_back(cvf::Vec3d(static_cast<float>(xCoords[j]), static_cast<float>(depthCoords[i]), 0.0));
|
cellPolygon.push_back(cvf::Vec3d(static_cast<float>(xCoords[i]), static_cast<float>(depthCoords[j]), 0.0));
|
||||||
cellPolygon.push_back(cvf::Vec3d(static_cast<float>(xCoords[j + 1]), static_cast<float>(depthCoords[i]), 0.0));
|
cellPolygon.push_back(cvf::Vec3d(static_cast<float>(xCoords[i + 1]), static_cast<float>(depthCoords[j]), 0.0));
|
||||||
cellPolygon.push_back(cvf::Vec3d(static_cast<float>(xCoords[j + 1]), static_cast<float>(depthCoords[i + 1]), 0.0));
|
cellPolygon.push_back(cvf::Vec3d(static_cast<float>(xCoords[i + 1]), static_cast<float>(depthCoords[j + 1]), 0.0));
|
||||||
cellPolygon.push_back(cvf::Vec3d(static_cast<float>(xCoords[j]), static_cast<float>(depthCoords[i + 1]), 0.0));
|
cellPolygon.push_back(cvf::Vec3d(static_cast<float>(xCoords[i]), static_cast<float>(depthCoords[j + 1]), 0.0));
|
||||||
|
|
||||||
RigStimPlanCell stimPlanCell(cellPolygon, i, j);
|
RigStimPlanCell stimPlanCell(cellPolygon, i, j);
|
||||||
if (conductivityValuesAtTimeStep.size() > 0) //Assuming vector to be of correct length, or no values
|
if (conductivityValuesAtTimeStep.size() > 0) //Assuming vector to be of correct length, or no values
|
||||||
{
|
{
|
||||||
stimPlanCell.setConductivityValue(conductivityValuesAtTimeStep[i + 1][j + 1]);
|
stimPlanCell.setConductivityValue(conductivityValuesAtTimeStep[j + 1][i + 1]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -857,7 +860,7 @@ void RimStimPlanFractureTemplate::setupStimPlanCells()
|
|||||||
|
|
||||||
if (displayPropertyValuesAtTimeStep.size() > 0)
|
if (displayPropertyValuesAtTimeStep.size() > 0)
|
||||||
{
|
{
|
||||||
stimPlanCell.setDisplayValue(displayPropertyValuesAtTimeStep[i + 1][j + 1]);
|
stimPlanCell.setDisplayValue(displayPropertyValuesAtTimeStep[j + 1][i + 1]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -866,9 +869,13 @@ void RimStimPlanFractureTemplate::setupStimPlanCells()
|
|||||||
|
|
||||||
if (cellPolygon[0].x() < 0.0 && cellPolygon[1].x() > 0.0)
|
if (cellPolygon[0].x() < 0.0 && cellPolygon[1].x() > 0.0)
|
||||||
{
|
{
|
||||||
if (cellPolygon[1].y() < 0.0 && cellPolygon[2].y() > 0.0)
|
if (cellPolygon[1].y() > 0.0 && cellPolygon[2].y() < 0.0)
|
||||||
{
|
{
|
||||||
wellCenterStimPlanCell = &stimPlanCell;
|
wellCenterStimPlanCellIJ = std::make_pair(stimPlanCell.getI(), stimPlanCell.getJ());
|
||||||
|
RiaLogging::debug(QString("Setting wellCenterStimPlanCell at cell %1, %2").
|
||||||
|
arg(QString::number(stimPlanCell.getI()), QString::number(stimPlanCell.getJ())));
|
||||||
|
|
||||||
|
wellCenterStimPlanCellFound = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -876,6 +883,12 @@ void RimStimPlanFractureTemplate::setupStimPlanCells()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!wellCenterStimPlanCellFound)
|
||||||
|
{
|
||||||
|
RiaLogging::error("Did not find stim plan cell at well crossing!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
m_stimPlanCells = stimPlanCells;
|
m_stimPlanCells = stimPlanCells;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -936,9 +949,40 @@ std::vector<cvf::Vec3d> RimStimPlanFractureTemplate::getStimPlanColPolygon(size_
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RigStimPlanCell* RimStimPlanFractureTemplate::getStimPlanCellAtWell()
|
std::pair<size_t, size_t> RimStimPlanFractureTemplate::getStimPlanCellAtWellCenter()
|
||||||
{
|
{
|
||||||
return wellCenterStimPlanCell;
|
return wellCenterStimPlanCellIJ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
size_t RimStimPlanFractureTemplate::getGlobalIndexFromIJ(size_t i, size_t j)
|
||||||
|
{
|
||||||
|
size_t length_I = stimPlanGridNumberOfRows() - 1;
|
||||||
|
size_t globIndex = j * length_I + i;
|
||||||
|
|
||||||
|
return globIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
const RigStimPlanCell& RimStimPlanFractureTemplate::stimPlanCellFromIndex(size_t index) const
|
||||||
|
{
|
||||||
|
if (index < m_stimPlanCells.size())
|
||||||
|
{
|
||||||
|
const RigStimPlanCell& cell = m_stimPlanCells[index];
|
||||||
|
return cell;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//TODO: Better error handling?
|
||||||
|
RiaLogging::error("Requesting non-existent StimPlanCell");
|
||||||
|
RiaLogging::error("Returning cell 0, results will be invalid");
|
||||||
|
const RigStimPlanCell& cell = m_stimPlanCells[0];
|
||||||
|
return cell;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -81,7 +81,10 @@ public:
|
|||||||
std::vector<cvf::Vec3d> getStimPlanRowPolygon(size_t i);
|
std::vector<cvf::Vec3d> getStimPlanRowPolygon(size_t i);
|
||||||
std::vector<cvf::Vec3d> getStimPlanColPolygon(size_t j);
|
std::vector<cvf::Vec3d> getStimPlanColPolygon(size_t j);
|
||||||
|
|
||||||
RigStimPlanCell* getStimPlanCellAtWell();
|
std::pair<size_t, size_t> getStimPlanCellAtWellCenter();
|
||||||
|
|
||||||
|
size_t getGlobalIndexFromIJ(size_t i, size_t j); //TODO: should be const?
|
||||||
|
const RigStimPlanCell& stimPlanCellFromIndex(size_t index) const;
|
||||||
|
|
||||||
//TODO: Functions for finding perforated stimPlanCells
|
//TODO: Functions for finding perforated stimPlanCells
|
||||||
//Radial flow: Single cell (at 0,0)
|
//Radial flow: Single cell (at 0,0)
|
||||||
@@ -96,6 +99,7 @@ public:
|
|||||||
|
|
||||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
|
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
|
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
|
||||||
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute * attribute) override;
|
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute * attribute) override;
|
||||||
@@ -119,5 +123,5 @@ private:
|
|||||||
caf::PdmField<QString> m_stimPlanFileName;
|
caf::PdmField<QString> m_stimPlanFileName;
|
||||||
cvf::ref<RigStimPlanFractureDefinition> m_stimPlanFractureDefinitionData;
|
cvf::ref<RigStimPlanFractureDefinition> m_stimPlanFractureDefinitionData;
|
||||||
std::vector<RigStimPlanCell> m_stimPlanCells;
|
std::vector<RigStimPlanCell> m_stimPlanCells;
|
||||||
RigStimPlanCell* wellCenterStimPlanCell;
|
std::pair<size_t, size_t> wellCenterStimPlanCellIJ;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -65,6 +65,9 @@ public:
|
|||||||
void addContributingEclipseCell(size_t eclipseCell, double transmissibility);
|
void addContributingEclipseCell(size_t eclipseCell, double transmissibility);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
double performationLenghtVertical;
|
||||||
|
double performationLenghtHorizontal;
|
||||||
|
|
||||||
std::vector<size_t> contributingEclipseCells;
|
std::vector<size_t> contributingEclipseCells;
|
||||||
std::vector<double> contributingEclipseCellTransmisibilities;
|
std::vector<double> contributingEclipseCellTransmisibilities;
|
||||||
|
|
||||||
@@ -90,10 +93,12 @@ public:
|
|||||||
std::vector<RigFractureData> m_fractureData;
|
std::vector<RigFractureData> m_fractureData;
|
||||||
|
|
||||||
void addStimPlanCellFractureCell(RigFractureStimPlanCellData fracStimPlanCellData);
|
void addStimPlanCellFractureCell(RigFractureStimPlanCellData fracStimPlanCellData);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<cvf::uint> m_triangleIndices;
|
std::vector<cvf::uint> m_triangleIndices;
|
||||||
std::vector<cvf::Vec3f> m_nodeCoords;
|
std::vector<cvf::Vec3f> m_nodeCoords;
|
||||||
|
|
||||||
std::vector<RigFractureStimPlanCellData> m_stimPlanCellsFractureData;
|
std::vector<RigFractureStimPlanCellData> m_stimPlanCellsFractureData;
|
||||||
|
std::vector<size_t> m_perforatedStimPlanCellsIndex;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ RigFractureTransCalc::RigFractureTransCalc(RimEclipseCase* caseToApply, RimFract
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
/// TODO: Document equation
|
/// TODO: Document equation
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RigFractureTransCalc::computeTransmissibility()
|
void RigFractureTransCalc::computeTransmissibilityFromPolygonWithInfiniteConductivityInFracture()
|
||||||
{
|
{
|
||||||
if (m_fracture->attachedFractureDefinition()->fractureConductivity == RimFractureTemplate::FINITE_CONDUCTIVITY)
|
if (m_fracture->attachedFractureDefinition()->fractureConductivity == RimFractureTemplate::FINITE_CONDUCTIVITY)
|
||||||
{
|
{
|
||||||
@@ -728,21 +728,22 @@ void RigFractureTransCalc::computeUpscaledPropertyFromStimPlan( QString resultNa
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RigFractureTransCalc::computeStimPlanCellTransmissibilityInFracture(RigStimPlanCell* stimPlanCell)
|
void RigFractureTransCalc::computeStimPlanCellTransmissibilityInFracture(const RigStimPlanCell& stimPlanCell)
|
||||||
{
|
{
|
||||||
double verticalSideLength = stimPlanCell->cellSizeX();
|
double verticalSideLength = stimPlanCell.cellSizeX();
|
||||||
double horisontalSideLength = stimPlanCell->cellSizeZ();
|
double horisontalSideLength = stimPlanCell.cellSizeZ();
|
||||||
|
|
||||||
double verticalTrans = stimPlanCell->getConductivtyValue() * verticalSideLength / (horisontalSideLength / 2);
|
double verticalTrans = stimPlanCell.getConductivtyValue() * verticalSideLength / (horisontalSideLength / 2);
|
||||||
double horizontalTrans = stimPlanCell->getConductivtyValue() * horisontalSideLength / (verticalSideLength / 2);
|
double horizontalTrans = stimPlanCell.getConductivtyValue() * horisontalSideLength / (verticalSideLength / 2);
|
||||||
|
|
||||||
stimPlanCell->setTransmissibilityInFracture(verticalTrans, horizontalTrans);
|
//TODO: Ta bort const???
|
||||||
|
// stimPlanCell.setTransmissibilityInFracture(verticalTrans, horizontalTrans);
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
double RigFractureTransCalc::computeRadialTransmissibilityToWellinStimPlanCell(RigStimPlanCell* stimPlanCell)
|
double RigFractureTransCalc::computeRadialTransmissibilityToWellinStimPlanCell(const RigStimPlanCell& stimPlanCell)
|
||||||
{
|
{
|
||||||
if (m_fracture->attachedFractureDefinition()->orientation == RimFractureTemplate::ALONG_WELL_PATH) return cvf::UNDEFINED_DOUBLE;
|
if (m_fracture->attachedFractureDefinition()->orientation == RimFractureTemplate::ALONG_WELL_PATH) return cvf::UNDEFINED_DOUBLE;
|
||||||
|
|
||||||
@@ -753,9 +754,9 @@ double RigFractureTransCalc::computeRadialTransmissibilityToWellinStimPlanCell(R
|
|||||||
}
|
}
|
||||||
|
|
||||||
double ro = 0.14 * cvf::Math::sqrt(
|
double ro = 0.14 * cvf::Math::sqrt(
|
||||||
pow(stimPlanCell->cellSizeX(), 2.0) + pow(stimPlanCell->cellSizeZ(), 2));
|
pow(stimPlanCell.cellSizeX(), 2.0) + pow(stimPlanCell.cellSizeZ(), 2));
|
||||||
|
|
||||||
double Tc = 2 * cvf::PI_D * cDarcy() * stimPlanCell->getConductivtyValue() /
|
double Tc = 2 * cvf::PI_D * cDarcy() * stimPlanCell.getConductivtyValue() /
|
||||||
(log(ro / m_fracture->wellRadius()) + m_fracture->attachedFractureDefinition()->skinFactor() );
|
(log(ro / m_fracture->wellRadius()) + m_fracture->attachedFractureDefinition()->skinFactor() );
|
||||||
|
|
||||||
Tc = Tc * areaScalingFactor;
|
Tc = Tc * areaScalingFactor;
|
||||||
@@ -766,18 +767,18 @@ double RigFractureTransCalc::computeRadialTransmissibilityToWellinStimPlanCell(R
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
double RigFractureTransCalc::computeLinearTransmissibilityToWellinStimPlanCell(RigStimPlanCell* stimPlanCell, double perforationLengthVertical, double perforationLengthHorizontal)
|
double RigFractureTransCalc::computeLinearTransmissibilityToWellinStimPlanCell(const RigStimPlanCell& stimPlanCell, double perforationLengthVertical, double perforationLengthHorizontal)
|
||||||
{
|
{
|
||||||
double TcPrefix = 8 * cDarcy() * stimPlanCell->getConductivtyValue();
|
double TcPrefix = 8 * cDarcy() * stimPlanCell.getConductivtyValue();
|
||||||
|
|
||||||
double DzPerf = perforationLengthVertical * m_fracture->perforationEfficiency();
|
double DzPerf = perforationLengthVertical * m_fracture->perforationEfficiency();
|
||||||
double DxPerf = perforationLengthHorizontal * m_fracture->perforationEfficiency();
|
double DxPerf = perforationLengthHorizontal * m_fracture->perforationEfficiency();
|
||||||
|
|
||||||
double TcZ = TcPrefix * DzPerf /
|
double TcZ = TcPrefix * DzPerf /
|
||||||
(stimPlanCell->cellSizeX() + m_fracture->attachedFractureDefinition()->skinFactor() * DzPerf / cvf::PI_D);
|
(stimPlanCell.cellSizeX() + m_fracture->attachedFractureDefinition()->skinFactor() * DzPerf / cvf::PI_D);
|
||||||
|
|
||||||
double TcX = TcPrefix * DxPerf /
|
double TcX = TcPrefix * DxPerf /
|
||||||
(stimPlanCell->cellSizeZ() + m_fracture->attachedFractureDefinition()->skinFactor() * DxPerf / cvf::PI_D);
|
(stimPlanCell.cellSizeZ() + m_fracture->attachedFractureDefinition()->skinFactor() * DxPerf / cvf::PI_D);
|
||||||
|
|
||||||
double Tc = cvf::Math::sqrt(pow(TcX, 2) + pow(TcZ, 2));
|
double Tc = cvf::Math::sqrt(pow(TcX, 2) + pow(TcZ, 2));
|
||||||
return Tc;
|
return Tc;
|
||||||
|
|||||||
@@ -46,25 +46,23 @@ class RigFractureTransCalc
|
|||||||
public:
|
public:
|
||||||
explicit RigFractureTransCalc(RimEclipseCase* caseToApply, RimFracture* fracture);
|
explicit RigFractureTransCalc(RimEclipseCase* caseToApply, RimFracture* fracture);
|
||||||
|
|
||||||
void computeTransmissibility();
|
// Calculations based on fracture polygon and eclipse grid cells
|
||||||
|
void computeTransmissibilityFromPolygonWithInfiniteConductivityInFracture();
|
||||||
bool planeCellIntersectionPolygons(size_t cellindex, std::vector<std::vector<cvf::Vec3d> > & polygons, cvf::Vec3d & localX, cvf::Vec3d & localY, cvf::Vec3d & localZ);
|
bool planeCellIntersectionPolygons(size_t cellindex, std::vector<std::vector<cvf::Vec3d> > & polygons, cvf::Vec3d & localX, cvf::Vec3d & localY, cvf::Vec3d & localZ);
|
||||||
|
|
||||||
|
// Functions needed for upscaling from StimPlan grid to Eclipse Grid, for transmissibility calculations on eclipse grid
|
||||||
|
// Obsolete if final calculations will be done on the stimPlan grid
|
||||||
void computeUpscaledPropertyFromStimPlan(QString resultName, QString resultUnit, size_t timeStepIndex);
|
void computeUpscaledPropertyFromStimPlan(QString resultName, QString resultUnit, size_t timeStepIndex);
|
||||||
std::pair<double, double> flowAcrossLayersUpscaling(QString resultName, QString resultUnit, size_t timeStepIndex, RimDefines::UnitSystem unitSystem, size_t eclipseCellIndex);
|
std::pair<double, double> flowAcrossLayersUpscaling(QString resultName, QString resultUnit, size_t timeStepIndex, RimDefines::UnitSystem unitSystem, size_t eclipseCellIndex);
|
||||||
double computeHAupscale(RimStimPlanFractureTemplate* fracTemplateStimPlan, std::vector<RigStimPlanCell> stimPlanCells, std::vector<cvf::Vec3d> planeCellPolygon, cvf::Vec3d directionAlongLayers, cvf::Vec3d directionAcrossLayers);
|
double computeHAupscale(RimStimPlanFractureTemplate* fracTemplateStimPlan, std::vector<RigStimPlanCell> stimPlanCells, std::vector<cvf::Vec3d> planeCellPolygon, cvf::Vec3d directionAlongLayers, cvf::Vec3d directionAcrossLayers);
|
||||||
double computeAHupscale(RimStimPlanFractureTemplate* fracTemplateStimPlan, std::vector<RigStimPlanCell> stimPlanCells, std::vector<cvf::Vec3d> planeCellPolygon, cvf::Vec3d directionAlongLayers, cvf::Vec3d directionAcrossLayers);
|
double computeAHupscale(RimStimPlanFractureTemplate* fracTemplateStimPlan, std::vector<RigStimPlanCell> stimPlanCells, std::vector<cvf::Vec3d> planeCellPolygon, cvf::Vec3d directionAlongLayers, cvf::Vec3d directionAcrossLayers);
|
||||||
|
|
||||||
static double arithmeticAverage(std::vector<double> values);
|
static double arithmeticAverage(std::vector<double> values);
|
||||||
double cDarcy();
|
|
||||||
|
|
||||||
|
// Calculations based on StimPlan grid
|
||||||
void calculateStimPlanCellsMatrixTransmissibility(RigStimPlanCell* stimPlanCell, RigFractureStimPlanCellData* fracStimPlanCellData);
|
void calculateStimPlanCellsMatrixTransmissibility(RigStimPlanCell* stimPlanCell, RigFractureStimPlanCellData* fracStimPlanCellData);
|
||||||
|
static void computeStimPlanCellTransmissibilityInFracture(const RigStimPlanCell& stimPlanCell);
|
||||||
static void computeStimPlanCellTransmissibilityInFracture(RigStimPlanCell* stimPlanCell);
|
double computeRadialTransmissibilityToWellinStimPlanCell(const RigStimPlanCell& stimPlanCell);
|
||||||
double computeRadialTransmissibilityToWellinStimPlanCell(RigStimPlanCell* stimPlanCell);
|
double computeLinearTransmissibilityToWellinStimPlanCell(const RigStimPlanCell& stimPlanCell, double perforationLengthVertical, double perforationLengthHorizontal);
|
||||||
double computeLinearTransmissibilityToWellinStimPlanCell(RigStimPlanCell* stimPlanCell, double perforationLengthVertical, double perforationLengthHorizontal);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static std::vector<RigStimPlanCell*> getRowOfStimPlanCells(std::vector<RigStimPlanCell>& allStimPlanCells, size_t i);
|
static std::vector<RigStimPlanCell*> getRowOfStimPlanCells(std::vector<RigStimPlanCell>& allStimPlanCells, size_t i);
|
||||||
static std::vector<RigStimPlanCell*> getColOfStimPlanCells(std::vector<RigStimPlanCell>& allStimPlanCells, size_t j);
|
static std::vector<RigStimPlanCell*> getColOfStimPlanCells(std::vector<RigStimPlanCell>& allStimPlanCells, size_t j);
|
||||||
@@ -78,5 +76,6 @@ private:
|
|||||||
RimDefines::UnitSystem m_unitForCalculation;
|
RimDefines::UnitSystem m_unitForCalculation;
|
||||||
|
|
||||||
double calculateMatrixTransmissibility(double permX, double NTG, double Ay, double dx, double skinfactor, double fractureAreaWeightedlength);
|
double calculateMatrixTransmissibility(double permX, double NTG, double Ay, double dx, double skinfactor, double fractureAreaWeightedlength);
|
||||||
|
double cDarcy();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -56,17 +56,19 @@ void RigStimPlanCell::setTransmissibilityInFracture(double valueHorizontal, doub
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
double RigStimPlanCell::cellSizeX()
|
double RigStimPlanCell::cellSizeX() const
|
||||||
{
|
{
|
||||||
//The polygon corners are always stored in the same order
|
//The polygon corners are always stored in the same order
|
||||||
return (m_polygon[1] - m_polygon[0]).length();
|
if (m_polygon.size()>1) return (m_polygon[1] - m_polygon[0]).length();
|
||||||
|
return cvf::UNDEFINED_DOUBLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
double RigStimPlanCell::cellSizeZ()
|
double RigStimPlanCell::cellSizeZ() const
|
||||||
{
|
{
|
||||||
return (m_polygon[2] - m_polygon[1]).length();
|
if (m_polygon.size()>2) return (m_polygon[2] - m_polygon[1]).length();
|
||||||
|
return cvf::UNDEFINED_DOUBLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ public:
|
|||||||
virtual ~RigStimPlanCell();
|
virtual ~RigStimPlanCell();
|
||||||
|
|
||||||
std::vector<cvf::Vec3d> getPolygon() { return m_polygon; }
|
std::vector<cvf::Vec3d> getPolygon() { return m_polygon; }
|
||||||
double getConductivtyValue() { return m_concutivityValue; }
|
double getConductivtyValue() const { return m_concutivityValue; }
|
||||||
double getDisplayValue() { return m_displayValue; }
|
double getDisplayValue() { return m_displayValue; }
|
||||||
size_t getI() { return m_i; }
|
size_t getI() { return m_i; }
|
||||||
size_t getJ() { return m_j; }
|
size_t getJ() { return m_j; }
|
||||||
@@ -50,8 +50,8 @@ public:
|
|||||||
void setDisplayValue(double value) { m_displayValue = value; };
|
void setDisplayValue(double value) { m_displayValue = value; };
|
||||||
void setTransmissibilityInFracture(double valueHorizontal, double valueVertical);
|
void setTransmissibilityInFracture(double valueHorizontal, double valueVertical);
|
||||||
|
|
||||||
double cellSizeX();
|
double cellSizeX() const;
|
||||||
double cellSizeZ();
|
double cellSizeZ() const;
|
||||||
private:
|
private:
|
||||||
std::vector<cvf::Vec3d> m_polygon;
|
std::vector<cvf::Vec3d> m_polygon;
|
||||||
double m_displayValue;
|
double m_displayValue;
|
||||||
|
|||||||
Reference in New Issue
Block a user