mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1415 - pre-proto - Adding function for identifying the StimPlanCell though which the well pass, and use this cell in calculation of radial transmissibility to well. Some error in pointers not yet sorted out...
This commit is contained in:
@@ -103,10 +103,12 @@ bool RifEclipseExportTools::writeFracturesToTextFile(const QString& fileName, c
|
||||
out << "\n";
|
||||
|
||||
//Included for debug / prototyping only
|
||||
//printTransmissibilityFractureToWell(fractures, out, caseToApply);
|
||||
|
||||
printStimPlanFractureTrans(fractures, out);
|
||||
|
||||
printStimPlanCellsMatrixTransContributions(fractures, caseToApply, out, wellPath, simWell, mainGrid);
|
||||
|
||||
|
||||
|
||||
printBackgroundDataHeaderLine(out);
|
||||
|
||||
RiaLogging::debug(QString("Writing intermediate results from COMPDAT calculation"));
|
||||
@@ -584,3 +586,53 @@ void RifEclipseExportTools::printBackgroundData(QTextStream & out, RimWellPath*
|
||||
out << "\n";
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifEclipseExportTools::printTransmissibilityFractureToWell(const std::vector<RimFracture *>& fractures, QTextStream &out, RimEclipseCase* caseToApply)
|
||||
{
|
||||
out << "Transmissibility From Fracture To Well \n";
|
||||
|
||||
for (RimFracture* fracture : fractures)
|
||||
{
|
||||
out << qSetFieldWidth(12);
|
||||
RimEclipseWell* simWell = nullptr;
|
||||
RimWellPath* wellPath = nullptr;
|
||||
fracture->firstAncestorOrThisOfType(simWell);
|
||||
if (simWell) out << simWell->name + " "; // 1. Well name
|
||||
fracture->firstAncestorOrThisOfType(wellPath);
|
||||
if (wellPath) out << wellPath->name + " "; // 1. Well name
|
||||
|
||||
out << qSetFieldWidth(16);
|
||||
out << fracture->name().left(15) + " ";
|
||||
|
||||
if (fracture->attachedFractureDefinition()->orientation == RimFractureTemplate::TRANSVERSE_WELL_PATH)
|
||||
{
|
||||
out << "Transverse Fracture";
|
||||
|
||||
RimStimPlanFractureTemplate* fracTemplateStimPlan;
|
||||
if (dynamic_cast<RimStimPlanFractureTemplate*>(fracture->attachedFractureDefinition()))
|
||||
{
|
||||
fracTemplateStimPlan = dynamic_cast<RimStimPlanFractureTemplate*>(fracture->attachedFractureDefinition());
|
||||
}
|
||||
else continue;
|
||||
|
||||
RigStimPlanCell* stimPlanCell = fracTemplateStimPlan->getStimPlanCellAtWell();
|
||||
//TODO: Error in getting the StimPlanWellCell here!!!
|
||||
|
||||
out << stimPlanCell->getI();
|
||||
out << stimPlanCell->getJ();
|
||||
|
||||
RigFractureTransCalc transmissibilityCalculator(caseToApply, fracture);
|
||||
double RadTransInStimPlanCell = transmissibilityCalculator.computeRadialTransmissibilityToWellinStimPlanCell(stimPlanCell);
|
||||
|
||||
out << RadTransInStimPlanCell;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -63,4 +63,6 @@ public:
|
||||
static void printBackgroundData(QTextStream & out, RimWellPath* wellPath, RimEclipseWell* simWell, RimFracture* fracture, const RigMainGrid* mainGrid, RigFractureData &fracData);
|
||||
|
||||
|
||||
private:
|
||||
static void printTransmissibilityFractureToWell(const std::vector<RimFracture *>& fractures, QTextStream &out, RimEclipseCase* caseToApply);
|
||||
};
|
||||
|
||||
@@ -43,6 +43,8 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
#include <cmath>
|
||||
#include "RigFractureTransCalc.h"
|
||||
|
||||
|
||||
|
||||
@@ -816,6 +818,7 @@ void RimStimPlanFractureTemplate::setupStimPlanCells()
|
||||
QString resultUnitFromColors = activeView->stimPlanColors->unit();
|
||||
|
||||
std::vector<RigStimPlanCell> stimPlanCells;
|
||||
wellCenterStimPlanCell = nullptr;
|
||||
|
||||
std::vector<std::vector<double>> displayPropertyValuesAtTimeStep = getMirroredDataAtTimeIndex(resultNameFromColors, resultUnitFromColors, activeTimeStepIndex);
|
||||
|
||||
@@ -861,6 +864,14 @@ void RimStimPlanFractureTemplate::setupStimPlanCells()
|
||||
stimPlanCell.setDisplayValue(cvf::UNDEFINED_DOUBLE);
|
||||
}
|
||||
|
||||
if (cellPolygon[0].x() < 0.0 && cellPolygon[1].x() > 0.0)
|
||||
{
|
||||
if (cellPolygon[1].y() < 0.0 && cellPolygon[2].y() > 0.0)
|
||||
{
|
||||
wellCenterStimPlanCell = &stimPlanCell;
|
||||
}
|
||||
}
|
||||
|
||||
stimPlanCells.push_back(stimPlanCell);
|
||||
}
|
||||
}
|
||||
@@ -922,6 +933,14 @@ std::vector<cvf::Vec3d> RimStimPlanFractureTemplate::getStimPlanColPolygon(size_
|
||||
return colPolygon;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigStimPlanCell* RimStimPlanFractureTemplate::getStimPlanCellAtWell()
|
||||
{
|
||||
return wellCenterStimPlanCell;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -81,6 +81,13 @@ public:
|
||||
std::vector<cvf::Vec3d> getStimPlanRowPolygon(size_t i);
|
||||
std::vector<cvf::Vec3d> getStimPlanColPolygon(size_t j);
|
||||
|
||||
RigStimPlanCell* getStimPlanCellAtWell();
|
||||
|
||||
//TODO: Functions for finding perforated stimPlanCells
|
||||
//Radial flow: Single cell (at 0,0)
|
||||
|
||||
|
||||
|
||||
|
||||
void loadDataAndUpdate(); //TODO: Update m_stimPlanCells
|
||||
void setDefaultsBasedOnXMLfile();
|
||||
@@ -112,4 +119,5 @@ private:
|
||||
caf::PdmField<QString> m_stimPlanFileName;
|
||||
cvf::ref<RigStimPlanFractureDefinition> m_stimPlanFractureDefinitionData;
|
||||
std::vector<RigStimPlanCell> m_stimPlanCells;
|
||||
RigStimPlanCell* wellCenterStimPlanCell;
|
||||
};
|
||||
|
||||
@@ -730,7 +730,6 @@ void RigFractureTransCalc::computeUpscaledPropertyFromStimPlan( QString resultNa
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigFractureTransCalc::computeStimPlanCellTransmissibilityInFracture(RigStimPlanCell* stimPlanCell)
|
||||
{
|
||||
|
||||
double verticalSideLength = stimPlanCell->cellSizeX();
|
||||
double horisontalSideLength = stimPlanCell->cellSizeZ();
|
||||
|
||||
@@ -743,7 +742,7 @@ void RigFractureTransCalc::computeStimPlanCellTransmissibilityInFracture(RigStim
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigFractureTransCalc::computeRadialTransmissibilityToWell(RigStimPlanCell* stimPlanCell)
|
||||
double RigFractureTransCalc::computeRadialTransmissibilityToWellinStimPlanCell(RigStimPlanCell* stimPlanCell)
|
||||
{
|
||||
if (m_fracture->attachedFractureDefinition()->orientation == RimFractureTemplate::ALONG_WELL_PATH) return cvf::UNDEFINED_DOUBLE;
|
||||
|
||||
@@ -754,9 +753,9 @@ double RigFractureTransCalc::computeRadialTransmissibilityToWell(RigStimPlanCell
|
||||
}
|
||||
|
||||
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() );
|
||||
|
||||
Tc = Tc * areaScalingFactor;
|
||||
@@ -767,7 +766,7 @@ double RigFractureTransCalc::computeRadialTransmissibilityToWell(RigStimPlanCell
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigFractureTransCalc::computeLinearTransmissibilityToWell(RigStimPlanCell* stimPlanCell, double perforationLengthVertical, double perforationLengthHorizontal)
|
||||
double RigFractureTransCalc::computeLinearTransmissibilityToWellinStimPlanCell(RigStimPlanCell* stimPlanCell, double perforationLengthVertical, double perforationLengthHorizontal)
|
||||
{
|
||||
double TcPrefix = 8 * cDarcy() * stimPlanCell->getConductivtyValue();
|
||||
|
||||
@@ -801,7 +800,7 @@ double RigFractureTransCalc::cDarcy()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RigStimPlanCell*> RigFractureTransCalc::getRowOfStimPlanCells(std::vector<RigStimPlanCell> allStimPlanCells, size_t i)
|
||||
std::vector<RigStimPlanCell*> RigFractureTransCalc::getRowOfStimPlanCells(std::vector<RigStimPlanCell>& allStimPlanCells, size_t i)
|
||||
{
|
||||
std::vector<RigStimPlanCell*> stimPlanCellRow;
|
||||
|
||||
@@ -819,7 +818,7 @@ std::vector<RigStimPlanCell*> RigFractureTransCalc::getRowOfStimPlanCells(std::v
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RigStimPlanCell*> RigFractureTransCalc::getColOfStimPlanCells(std::vector<RigStimPlanCell> allStimPlanCells, size_t j)
|
||||
std::vector<RigStimPlanCell*> RigFractureTransCalc::getColOfStimPlanCells(std::vector<RigStimPlanCell>& allStimPlanCells, size_t j)
|
||||
{
|
||||
std::vector<RigStimPlanCell*> stimPlanCellCol;
|
||||
|
||||
|
||||
@@ -61,13 +61,13 @@ public:
|
||||
void calculateStimPlanCellsMatrixTransmissibility(RigStimPlanCell* stimPlanCell, RigFractureStimPlanCellData* fracStimPlanCellData);
|
||||
|
||||
static void computeStimPlanCellTransmissibilityInFracture(RigStimPlanCell* stimPlanCell);
|
||||
double computeRadialTransmissibilityToWell(RigStimPlanCell* stimPlanCell);
|
||||
double computeLinearTransmissibilityToWell(RigStimPlanCell* stimPlanCell, double perforationLengthVertical, double perforationLengthHorizontal);
|
||||
double computeRadialTransmissibilityToWellinStimPlanCell(RigStimPlanCell* stimPlanCell);
|
||||
double computeLinearTransmissibilityToWellinStimPlanCell(RigStimPlanCell* stimPlanCell, double perforationLengthVertical, double perforationLengthHorizontal);
|
||||
|
||||
|
||||
|
||||
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*> getRowOfStimPlanCells(std::vector<RigStimPlanCell>& allStimPlanCells, size_t i);
|
||||
static std::vector<RigStimPlanCell*> getColOfStimPlanCells(std::vector<RigStimPlanCell>& allStimPlanCells, size_t j);
|
||||
|
||||
private:
|
||||
double convertConductivtyValue(double Kw, RimDefines::UnitSystem fromUnit, RimDefines::UnitSystem toUnit);
|
||||
|
||||
Reference in New Issue
Block a user