mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1092 - pre-proto - Update export function to be able to handle multple cells for each fracture. Calculated / exported values not yet correct.
This commit is contained in:
@@ -18,6 +18,12 @@
|
||||
|
||||
#include "RifEclipseExportTools.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RigFracture.h"
|
||||
#include "RigFracture.h"
|
||||
#include "RigMainGrid.h"
|
||||
|
||||
#include "RimEclipseResultDefinition.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimEclipseWell.h"
|
||||
#include "RimFracture.h"
|
||||
@@ -77,42 +83,70 @@ bool RifEclipseExportTools::writeFracturesToTextFile(const QString& fileName, co
|
||||
for (i = 0; i < fractures.size(); i++)
|
||||
{
|
||||
fracture = fractures.at(i);
|
||||
fracture->computeTransmissibility();
|
||||
std::vector<RigFractureData> fracDataVector = fracture->attachedRigFracture()->fractureData();
|
||||
|
||||
out << qSetFieldWidth(8);
|
||||
wellPath, simWell = nullptr;
|
||||
fracture->firstAncestorOrThisOfType(simWell);
|
||||
if (simWell) out << simWell->name; // 1. Well name
|
||||
fracture->firstAncestorOrThisOfType(wellPath);
|
||||
if (wellPath) out << wellPath->name; // 1. Well name
|
||||
for (RigFractureData fracData : fracDataVector)
|
||||
{
|
||||
out << qSetFieldWidth(8);
|
||||
if (fracData.transmissibility == cvf::UNDEFINED_DOUBLE || !(fracture->attachedFractureDefinition())) out << "--"; //Commenting out line in output file
|
||||
|
||||
wellPath, simWell = 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(5);
|
||||
ijk = fracture->getIJK();
|
||||
out << ijk[0]; // 2. I location grid block
|
||||
out << ijk[1]; // 3. J location grid block
|
||||
out << ijk[2]; // 4. K location of upper connecting grid block
|
||||
out << ijk[2]; // 5. K location of lower connecting grid block
|
||||
out << qSetFieldWidth(5);
|
||||
|
||||
out << "OPEN"; // 6. Open / Shut flag of connection
|
||||
out << "1* "; // 7. Saturation table number for connection rel perm. Default value
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
RimView* activeView = RiaApplication::instance()->activeReservoirView();
|
||||
if (!activeView) return false;
|
||||
RimEclipseView* activeRiv = dynamic_cast<RimEclipseView*>(activeView);
|
||||
if (!activeRiv) return false;
|
||||
|
||||
out << qSetFieldWidth(8);
|
||||
out << 123456789; // 8. Transmissitivity //TODO: Calculate value
|
||||
const RigMainGrid* mainGrid = activeRiv->mainGrid();
|
||||
if (!mainGrid) return false;
|
||||
|
||||
out << qSetFieldWidth(4);
|
||||
out << "1* "; // 9. Well bore diameter. Set to default
|
||||
size_t i, j, k;
|
||||
mainGrid->ijkFromCellIndex(fracData.cellindex, &i, &j, &k);
|
||||
out << i; // 2. I location grid block
|
||||
out << j; // 3. J location grid block
|
||||
out << k; // 4. K location of upper connecting grid block
|
||||
out << k; // 5. K location of lower connecting grid block
|
||||
|
||||
out << qSetFieldWidth(8);
|
||||
out << fracture->attachedFractureDefinition()->effectiveKh(); // 10. Effective Kh (perm times width)
|
||||
out << qSetFieldWidth(4);
|
||||
out << fracture->attachedFractureDefinition()->skinFactor; // 11. Skin factor
|
||||
out << "OPEN"; // 6. Open / Shut flag of connection
|
||||
out << "1* "; // 7. Saturation table number for connection rel perm. Default value
|
||||
|
||||
out << "1*"; // 12. D-factor for handling non-Darcy flow of free gas. Default value.
|
||||
out << "Z"; // 13. Direction well is penetrating the grid block. Z is default.
|
||||
out << "1*"; // 14. Pressure equivalent radius, Default
|
||||
out << qSetFieldWidth(8);
|
||||
// 8. Transmissibility
|
||||
if (fracData.transmissibility != cvf::UNDEFINED_DOUBLE) out << fracData.transmissibility;
|
||||
else out << "UNDEF";
|
||||
|
||||
out << "/" << "\n";
|
||||
out << qSetFieldWidth(4);
|
||||
out << "1* "; // 9. Well bore diameter. Set to default
|
||||
|
||||
out << qSetFieldWidth(8);
|
||||
if (fracture->attachedFractureDefinition())
|
||||
{
|
||||
out << fracture->attachedFractureDefinition()->effectiveKh(); // 10. Effective Kh (perm times width)
|
||||
out << qSetFieldWidth(4);
|
||||
out << fracture->attachedFractureDefinition()->skinFactor; // 11. Skin factor
|
||||
}
|
||||
else //If no attached fracture definition these parameters are set to UNDEF
|
||||
{
|
||||
out << "UNDEF";
|
||||
out << qSetFieldWidth(4);
|
||||
out << "UNDEF";
|
||||
}
|
||||
|
||||
out << "1*"; // 12. D-factor for handling non-Darcy flow of free gas. Default value.
|
||||
out << "Z"; // 13. Direction well is penetrating the grid block. Z is default.
|
||||
out << "1*"; // 14. Pressure equivalent radius, Default
|
||||
|
||||
out << "/" << "\n";
|
||||
}
|
||||
|
||||
pi.setProgress(i);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user