mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1487 - pre-proto - starting to use trans condenser in export function. Adding transmissibilities to condenser and getting output trans from eclipse cells to well. Not yet summarizing values from multiple fractures or printing COMPDAT values.
This commit is contained in:
@@ -46,6 +46,7 @@
|
||||
#include <QString>
|
||||
#include <QTextStream>
|
||||
#include "RigStimPlanUpscalingCalc.h"
|
||||
#include "RigTransmissibilityCondenser.h"
|
||||
|
||||
|
||||
|
||||
@@ -110,7 +111,7 @@ bool RifFractureExportTools::exportFracturesToEclipseDataInputFile(const QString
|
||||
//Included for debug / prototyping only
|
||||
printTransmissibilityFractureToWell(fractures, out, caseToApply);
|
||||
|
||||
printStimPlanFractureTrans(fractures, out);
|
||||
printStimPlanFractureTrans(fractures, caseToApply, out);
|
||||
|
||||
printStimPlanCellsMatrixTransContributions(fractures, caseToApply, out, wellName, mainGrid);
|
||||
|
||||
@@ -171,12 +172,6 @@ bool RifFractureExportTools::exportFracturesToEclipseDataInputFile(const QString
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifFractureExportTools::exportWellPathFracturesToEclipseDataInputFile(const QString& fileName,
|
||||
const RimWellPath* wellPath,
|
||||
const RimEclipseCase* caseToApply)
|
||||
{
|
||||
|
||||
// Loop over fractures in well path (all)
|
||||
// Loop over stimplancells
|
||||
// if cell Is Contributing cond > 0
|
||||
@@ -192,6 +187,163 @@ void RifFractureExportTools::exportWellPathFracturesToEclipseDataInputFile(const
|
||||
// Use LinT + 1/2 radialT on each end if endpoints are inside cell
|
||||
// Add to condenser
|
||||
// Add eclipse cell transmissibilities to a map <eclipsecell index, map<fractureptr, transmissibility> >
|
||||
// For all transmissibilities
|
||||
// summarize all fractures contributions pr cell,
|
||||
// Print COMPDAT entry
|
||||
//
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifFractureExportTools::exportWellPathFracturesToEclipseDataInputFile(const QString& fileName,
|
||||
const RimWellPath* wellPath,
|
||||
const RimEclipseCase* caseToApply)
|
||||
{
|
||||
|
||||
double cDarcyInCorrectUnit = caseToApply->eclipseCaseData()->darchysValue();
|
||||
std::map <size_t, std::map<RimFracture*, double>> transmissibilitiesMap; //eclipseCellIndex (size_t), fracture (RimFracture) and trans value
|
||||
|
||||
//Getting fractures for well path
|
||||
std::vector<RimFracture*> fractures;
|
||||
wellPath->descendantsIncludingThisOfType(fractures);
|
||||
|
||||
|
||||
// Loop over fractures in well path (all)
|
||||
for (RimFracture* fracture : fractures)
|
||||
{
|
||||
|
||||
RimStimPlanFractureTemplate* fracTemplateStimPlan;
|
||||
if (dynamic_cast<RimStimPlanFractureTemplate*>(fracture->attachedFractureDefinition()))
|
||||
{
|
||||
fracTemplateStimPlan = dynamic_cast<RimStimPlanFractureTemplate*>(fracture->attachedFractureDefinition());
|
||||
}
|
||||
else continue;
|
||||
|
||||
RigTransmissibilityCondenser condenser;
|
||||
|
||||
// Loop over stimplancells
|
||||
for (const RigStimPlanFracTemplateCell stimPlanCell : fracTemplateStimPlan->getStimPlanCells())
|
||||
{
|
||||
// if cell Is Contributing cond > 0
|
||||
if (stimPlanCell.getConductivtyValue() < 1e-7) continue;
|
||||
|
||||
size_t stimPlanCellIndex = fracTemplateStimPlan->getGlobalIndexFromIJ(stimPlanCell.getI(), stimPlanCell.getJ());
|
||||
|
||||
// Calculate Matrix To Fracture Trans
|
||||
RigEclipseToStimPlanCellTransmissibilityCalculator eclToStimPlanTransCalc(caseToApply,
|
||||
fracture->transformMatrix(),
|
||||
fracture->attachedFractureDefinition()->skinFactor,
|
||||
cDarcyInCorrectUnit,
|
||||
stimPlanCell);
|
||||
|
||||
std::vector<size_t> stimPlanContributingEclipseCells = eclToStimPlanTransCalc.globalIndeciesToContributingEclipseCells();
|
||||
std::vector<double> stimPlanContributingEclipseCellTransmissibilities = eclToStimPlanTransCalc.contributingEclipseCellTransmissibilities();
|
||||
|
||||
// Add to condenser
|
||||
for (int i = 0; i < stimPlanContributingEclipseCells.size(); i++)
|
||||
{
|
||||
condenser.addNeighborTransmissibility({ true, RigTransmissibilityCondenser::CellAddress::ECLIPSE, stimPlanContributingEclipseCells[i]},
|
||||
{ false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, stimPlanCellIndex},
|
||||
stimPlanContributingEclipseCellTransmissibilities[i]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Loop over stimplanecells (i, j)
|
||||
for (int i = 0; i < fracTemplateStimPlan->stimPlanGridNumberOfColums(); i++)
|
||||
{
|
||||
for (int j = 0; j < fracTemplateStimPlan->stimPlanGridNumberOfRows(); j++)
|
||||
{
|
||||
//TODO: Check that cond > 0
|
||||
size_t stimPlanCellIndex = fracTemplateStimPlan->getGlobalIndexFromIJ(i, j);
|
||||
const RigStimPlanFracTemplateCell stimPlanCell = fracTemplateStimPlan->stimPlanCellFromIndex(stimPlanCellIndex);
|
||||
|
||||
if (stimPlanCell.getConductivtyValue() < 1e-7)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (i < fracTemplateStimPlan->stimPlanGridNumberOfColums() - 1)
|
||||
{
|
||||
size_t stimPlanCellNeighbourXIndex = fracTemplateStimPlan->getGlobalIndexFromIJ(i + 1, j);
|
||||
const RigStimPlanFracTemplateCell stimPlanCellNeighbourX = fracTemplateStimPlan->stimPlanCellFromIndex(stimPlanCellNeighbourXIndex);
|
||||
|
||||
double horizontalTransToXneigbour =
|
||||
RigFractureTransmissibilityEquations::computeStimPlanCellTransmissibilityInFractureCenterToCenterForTwoCells(stimPlanCell.getConductivtyValue(),
|
||||
stimPlanCell.cellSizeX(),
|
||||
stimPlanCell.cellSizeZ(),
|
||||
stimPlanCellNeighbourX.getConductivtyValue(),
|
||||
stimPlanCellNeighbourX.cellSizeX(),
|
||||
stimPlanCellNeighbourX.cellSizeZ(),
|
||||
cDarcyInCorrectUnit);
|
||||
|
||||
condenser.addNeighborTransmissibility({ false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, stimPlanCellIndex },
|
||||
{ false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, stimPlanCellNeighbourXIndex },
|
||||
horizontalTransToXneigbour);
|
||||
|
||||
}
|
||||
|
||||
if (j < fracTemplateStimPlan->stimPlanGridNumberOfRows() - 1)
|
||||
{
|
||||
size_t stimPlanCellNeighbourZIndex = fracTemplateStimPlan->getGlobalIndexFromIJ(i, j + 1);
|
||||
const RigStimPlanFracTemplateCell stimPlanCellNeighbourZ = fracTemplateStimPlan->stimPlanCellFromIndex(stimPlanCellNeighbourZIndex);
|
||||
|
||||
double verticalTransToZneigbour =
|
||||
RigFractureTransmissibilityEquations::computeStimPlanCellTransmissibilityInFractureCenterToCenterForTwoCells(stimPlanCell.getConductivtyValue(),
|
||||
stimPlanCell.cellSizeZ(),
|
||||
stimPlanCell.cellSizeX(),
|
||||
stimPlanCellNeighbourZ.getConductivtyValue(),
|
||||
stimPlanCellNeighbourZ.cellSizeZ(),
|
||||
stimPlanCellNeighbourZ.cellSizeX(),
|
||||
cDarcyInCorrectUnit);
|
||||
|
||||
condenser.addNeighborTransmissibility({ false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, stimPlanCellIndex },
|
||||
{ false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, stimPlanCellNeighbourZIndex },
|
||||
verticalTransToZneigbour);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Find well cells (Perforated Well Path, Radius, Positioned Fracture)
|
||||
// For each well cell
|
||||
// Find path intersection
|
||||
// Use LinT + 1/2 radialT on each end if endpoints are inside cell
|
||||
// Add to condenser
|
||||
|
||||
//Adding well cell to condenser
|
||||
std::pair<size_t, size_t> centerCellIJ = fracTemplateStimPlan->getStimPlanCellAtWellCenter();
|
||||
size_t wellCellIndex = fracTemplateStimPlan->getGlobalIndexFromIJ(centerCellIJ.first, centerCellIJ.second);
|
||||
const RigStimPlanFracTemplateCell stimPlanWellCell = fracTemplateStimPlan->stimPlanCellFromIndex(wellCellIndex);
|
||||
|
||||
double wellTrans = RigFractureTransmissibilityEquations::computeRadialTransmissibilityToWellinStimPlanCell(stimPlanWellCell.getConductivtyValue(),
|
||||
stimPlanWellCell.cellSizeX(),
|
||||
stimPlanWellCell.cellSizeZ(),
|
||||
fracture->wellRadius(),
|
||||
fracTemplateStimPlan->skinFactor(),
|
||||
cDarcyInCorrectUnit);
|
||||
|
||||
condenser.addNeighborTransmissibility({true, RigTransmissibilityCondenser::CellAddress::WELL, 1},
|
||||
{false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, wellCellIndex},
|
||||
wellTrans);
|
||||
|
||||
// std::map <size_t, std::map<RimFracture*, double>> transmissibilitiesMap; //eclipseCellIndex (size_t), fracture (RimFracture) and trans value
|
||||
|
||||
// Add eclipse cell transmissibilities to a map <eclipsecell index, map<fractureptr, transmissibility> >
|
||||
|
||||
std::set<RigTransmissibilityCondenser::CellAddress> externalCells = condenser.externalCells();
|
||||
|
||||
for (RigTransmissibilityCondenser::CellAddress externalCell : externalCells)
|
||||
{
|
||||
if (externalCell.m_cellIndexSpace == RigTransmissibilityCondenser::CellAddress::ECLIPSE)
|
||||
{
|
||||
double trans = condenser.condensedTransmissibility(externalCell, { true, RigTransmissibilityCondenser::CellAddress::WELL, 1 });
|
||||
|
||||
transmissibilitiesMap[externalCell.m_globalCellIdx][fracture] = trans;
|
||||
}
|
||||
}
|
||||
} //end loop fractures
|
||||
|
||||
|
||||
|
||||
// For all transmissibilities
|
||||
// summarize all fractures contributions pr cell,
|
||||
// Print COMPDAT entry
|
||||
@@ -371,8 +523,11 @@ void RifFractureExportTools::printStimPlanCellsMatrixTransContributions(const st
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifFractureExportTools::printStimPlanFractureTrans(const std::vector<RimFracture *>& fractures, QTextStream &out)
|
||||
void RifFractureExportTools::printStimPlanFractureTrans(const std::vector<RimFracture *>& fractures, RimEclipseCase* caseToApply, QTextStream &out)
|
||||
{
|
||||
|
||||
double cDarcyInCorrectUnit = caseToApply->eclipseCaseData()->darchysValue();
|
||||
|
||||
out << "StimPlan cells' fracture transmissibility \n";
|
||||
|
||||
out << qSetFieldWidth(4);
|
||||
@@ -410,10 +565,12 @@ void RifFractureExportTools::printStimPlanFractureTrans(const std::vector<RimFra
|
||||
|
||||
double verticalTrans = RigFractureTransmissibilityEquations::computeStimPlanCellTransmissibilityInFracture(stimPlanCell.getConductivtyValue(),
|
||||
stimPlanCell.cellSizeX(),
|
||||
stimPlanCell.cellSizeZ());
|
||||
stimPlanCell.cellSizeZ(),
|
||||
cDarcyInCorrectUnit);
|
||||
double horizontalTrans = RigFractureTransmissibilityEquations::computeStimPlanCellTransmissibilityInFracture(stimPlanCell.getConductivtyValue(),
|
||||
stimPlanCell.cellSizeZ(),
|
||||
stimPlanCell.cellSizeX());
|
||||
stimPlanCell.cellSizeX(),
|
||||
cDarcyInCorrectUnit);
|
||||
|
||||
out << qSetFieldWidth(5);
|
||||
size_t spi = stimPlanCell.getI();
|
||||
|
||||
@@ -72,7 +72,9 @@ private:
|
||||
QTextStream &out,
|
||||
const QString& wellName,
|
||||
const RigMainGrid* mainGrid);
|
||||
static void printStimPlanFractureTrans(const std::vector<RimFracture *>& fractures, QTextStream &out);
|
||||
static void printStimPlanFractureTrans(const std::vector<RimFracture *>& fractures,
|
||||
RimEclipseCase* caseToApply,
|
||||
QTextStream &out);
|
||||
static void printTransmissibilityFractureToWell(const std::vector<RimFracture *>& fractures,
|
||||
QTextStream &out,
|
||||
RimEclipseCase* caseToApply);
|
||||
|
||||
@@ -83,7 +83,7 @@ public:
|
||||
|
||||
std::pair<size_t, size_t> getStimPlanCellAtWellCenter();
|
||||
|
||||
size_t getGlobalIndexFromIJ(size_t i, size_t j); //TODO: should be const?
|
||||
size_t getGlobalIndexFromIJ(size_t i, size_t j);
|
||||
const RigStimPlanFracTemplateCell& stimPlanCellFromIndex(size_t index) const;
|
||||
|
||||
//TODO: Functions for finding perforated stimPlanCells
|
||||
|
||||
@@ -434,7 +434,7 @@ void RigEclipseCaseData::computeActiveCellBoundingBoxes()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigEclipseCaseData::darchysValue()
|
||||
double RigEclipseCaseData::darchysValue() const
|
||||
{
|
||||
// See "Cartesian transmissibility calculations" in the "Eclipse Technical Description"
|
||||
// CDARCY Darcys constant
|
||||
|
||||
@@ -94,7 +94,7 @@ public:
|
||||
|
||||
UnitsType unitsType() const { return m_unitsType; }
|
||||
void setUnitsType(UnitsType unitsType) { m_unitsType = unitsType; }
|
||||
double darchysValue();
|
||||
double darchysValue() const;
|
||||
|
||||
private:
|
||||
void computeActiveCellIJKBBox();
|
||||
|
||||
@@ -25,12 +25,34 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigFractureTransmissibilityEquations::computeStimPlanCellTransmissibilityInFracture(double conductivity, double sideLengthParallellTrans, double sideLengthNormalTrans)
|
||||
double RigFractureTransmissibilityEquations::computeStimPlanCellTransmissibilityInFracture(double conductivity,
|
||||
double sideLengthParallellTrans,
|
||||
double sideLengthNormalTrans,
|
||||
double cDarcyForRelevantUnit)
|
||||
{
|
||||
double transmissibility = conductivity * sideLengthNormalTrans / (sideLengthParallellTrans / 2);
|
||||
double transmissibility = cDarcyForRelevantUnit * conductivity * sideLengthNormalTrans / (sideLengthParallellTrans / 2);
|
||||
return transmissibility;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigFractureTransmissibilityEquations::computeStimPlanCellTransmissibilityInFractureCenterToCenterForTwoCells(double conductivityCell1,
|
||||
double sideLengthParallellTransCell1,
|
||||
double sideLengthNormalTransCell1,
|
||||
double conductivityCell2,
|
||||
double sideLengthParallellTransCell2,
|
||||
double sideLengthNormalTransCell2,
|
||||
double cDarcyForRelevantUnit)
|
||||
{
|
||||
double transCell1 = computeStimPlanCellTransmissibilityInFracture(conductivityCell1, sideLengthParallellTransCell1, sideLengthNormalTransCell1, cDarcyForRelevantUnit);
|
||||
double transCell2 = computeStimPlanCellTransmissibilityInFracture(conductivityCell2, sideLengthParallellTransCell2, sideLengthNormalTransCell2, cDarcyForRelevantUnit);
|
||||
|
||||
double totalTrans = 1 / ( (1 / transCell1) + (1 / transCell2));
|
||||
|
||||
return totalTrans;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,16 @@ class RigFractureTransmissibilityEquations
|
||||
public:
|
||||
static double computeStimPlanCellTransmissibilityInFracture(double conductivity,
|
||||
double sideLengthParallellTrans,
|
||||
double sideLengthNormalTrans);
|
||||
double sideLengthNormalTrans,
|
||||
double cDarcyForRelevantUnit);
|
||||
|
||||
static double computeStimPlanCellTransmissibilityInFractureCenterToCenterForTwoCells(double conductivityCell1,
|
||||
double sideLengthParallellTransCell1,
|
||||
double sideLengthNormalTransCell1,
|
||||
double conductivityCell2,
|
||||
double sideLengthParallellTransCell2,
|
||||
double sideLengthNormalTransCell2,
|
||||
double cDarcyForRelevantUnit);
|
||||
|
||||
static double computeRadialTransmissibilityToWellinStimPlanCell(double stimPlanCellConductivity,
|
||||
double stimPlanCellSizeX,
|
||||
|
||||
@@ -40,8 +40,8 @@ public:
|
||||
std::vector<cvf::Vec3d> getPolygon() const { return m_polygon; }
|
||||
double getConductivtyValue() const { return m_concutivityValue; }
|
||||
double getDisplayValue() { return m_displayValue; }
|
||||
size_t getI() { return m_i; }
|
||||
size_t getJ() { return m_j; }
|
||||
size_t getI() const { return m_i; }
|
||||
size_t getJ() const { return m_j; }
|
||||
double getVerticalTransmissibilityInFracture() { return m_transmissibilityInFractureVertical; }
|
||||
double getHorizontalTransmissibilityInFracture() { return m_transmissibilityInFractureHorizontal; }
|
||||
|
||||
|
||||
@@ -295,6 +295,7 @@ std::vector<RigFracturedEclipseCellExportData> RigStimPlanUpscalingCalc::comput
|
||||
|
||||
for (size_t fracCell : fracCells)
|
||||
{
|
||||
//TODO: Lage ny classe for <20> holde upscaledData
|
||||
RigFracturedEclipseCellExportData fracData;
|
||||
fracData.reservoirCellIndex = fracCell;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user