#1417 - pre-proto - Adding function for calculating perforation length in center cell - need to be extended for cases where perforation interval goes outside the center stimPlan cell.

This commit is contained in:
astridkbjorke
2017-04-20 14:35:12 +02:00
parent 8351c6f9d0
commit ed03d1fb8e
5 changed files with 108 additions and 9 deletions

View File

@@ -43,6 +43,7 @@
#include "RimFractureTemplate.h"
#include "RimStimPlanFractureTemplate.h"
#include "RigStimPlanCell.h"
#include "RimSimWellFracture.h"
@@ -103,7 +104,7 @@ bool RifEclipseExportTools::writeFracturesToTextFile(const QString& fileName, c
out << "\n";
//Included for debug / prototyping only
//printTransmissibilityFractureToWell(fractures, out, caseToApply);
printTransmissibilityFractureToWell(fractures, out, caseToApply);
printStimPlanFractureTrans(fractures, out);
@@ -607,9 +608,55 @@ void RifEclipseExportTools::printTransmissibilityFractureToWell(const std::vecto
out << qSetFieldWidth(16);
out << fracture->name().left(15) + " ";
if (fracture->attachedFractureDefinition()->orientation == RimFractureTemplate::TRANSVERSE_WELL_PATH)
if (fracture->attachedFractureDefinition()->orientation == RimFractureTemplate::ALONG_WELL_PATH)
{
out << "Transverse Fracture";
out << "Linear inflow";
RimStimPlanFractureTemplate* fracTemplateStimPlan;
if (dynamic_cast<RimStimPlanFractureTemplate*>(fracture->attachedFractureDefinition()))
{
fracTemplateStimPlan = dynamic_cast<RimStimPlanFractureTemplate*>(fracture->attachedFractureDefinition());
}
else continue;
//TODO: Can be removed when implementation of dip angle is more general:
RimSimWellFracture* simWellFrac;
if (dynamic_cast<RimSimWellFracture*>(fracture))
{
simWellFrac = dynamic_cast<RimSimWellFracture*>(fracture);
}
else continue;
double wellDip = simWellFrac->wellDipAtFracturePosition();
double perforationLengthVert = fracture->perforationLength * cos(wellDip);
double perforationLengthHor = fracture->perforationLength * sin(wellDip);
RigStimPlanCell* stimPlanCell = fracTemplateStimPlan->getStimPlanCellAtWell();
//TODO: Error in getting the StimPlanWellCell here!!!
out << stimPlanCell->getI();
out << stimPlanCell->getJ();
//TODO: Check if perforation length is larger than cell - expand to neightbour cells if needed!
RigFractureTransCalc transmissibilityCalculator(caseToApply, fracture);
double RadTransInStimPlanCell = transmissibilityCalculator.computeLinearTransmissibilityToWellinStimPlanCell(stimPlanCell, perforationLengthVert, perforationLengthHor);
out << RadTransInStimPlanCell;
}
if (fracture->attachedFractureDefinition()->orientation == RimFractureTemplate::TRANSVERSE_WELL_PATH
|| fracture->attachedFractureDefinition()->orientation == RimFractureTemplate::AZIMUTH)
{
out << "Radial inflow";
RimStimPlanFractureTemplate* fracTemplateStimPlan;
if (dynamic_cast<RimStimPlanFractureTemplate*>(fracture->attachedFractureDefinition()))

View File

@@ -110,6 +110,15 @@ double RimSimWellFracture::wellAzimuthAtFracturePosition()
return simWellAzimuth;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimSimWellFracture::wellDipAtFracturePosition()
{
updateBranchGeometry();
double simWellDip = m_branchCenterLines[m_branchIndex].simWellDipAngle(fracturePosition());
return simWellDip;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -45,6 +45,7 @@ public:
void updateAzimuthFromFractureDefinition() override;
double wellAzimuthAtFracturePosition() override;
double wellDipAtFracturePosition();
protected:

View File

@@ -138,7 +138,7 @@ double RigSimulationWellCoordsAndMD::simWellAzimuthAngle(const cvf::Vec3d& posit
size_t closestIndex = findClosestIndex(position);
//For vertical well (x-component of direction = 0) returned angle will be 0.
double AzimuthAngle = 0.0;
double azimuthAngle = 0.0;
if (closestIndex != cvf::UNDEFINED_DOUBLE)
{
@@ -162,13 +162,55 @@ double RigSimulationWellCoordsAndMD::simWellAzimuthAngle(const cvf::Vec3d& posit
if (abs(direction.x()) > 1e-5)
{
double atanValue = direction.y() / direction.x();
AzimuthAngle = atan(atanValue);
AzimuthAngle = cvf::Math::toDegrees(AzimuthAngle);
AzimuthAngle = -AzimuthAngle;
azimuthAngle = atan(atanValue);
azimuthAngle = cvf::Math::toDegrees(azimuthAngle);
azimuthAngle = -azimuthAngle;
}
}
return AzimuthAngle;
return azimuthAngle;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RigSimulationWellCoordsAndMD::simWellDipAngle(const cvf::Vec3d& position) const
{
size_t closestIndex = findClosestIndex(position);
double dipAngle = 0.0;
if (closestIndex != cvf::UNDEFINED_DOUBLE)
{
cvf::Vec3d p1;
cvf::Vec3d p2;
if (closestIndex > 0)
{
p1 = m_wellPathPoints[closestIndex - 1];
p2 = m_wellPathPoints[closestIndex - 0];
}
else
{
p1 = m_wellPathPoints[closestIndex + 1];
p2 = m_wellPathPoints[closestIndex + 0];
}
cvf::Vec3d direction = p1 - p2;
double horizonal = sqrt(pow(direction.x(), 2) + pow(direction.y(), 2));
double vertical = direction.z();
if (abs(vertical) > 1e-5)
{
double atanValue = vertical / horizonal;
dipAngle = atan(atanValue);
dipAngle = cvf::Math::toDegrees(dipAngle);
}
}
return dipAngle;
}
//--------------------------------------------------------------------------------------------------

View File

@@ -44,7 +44,7 @@ public:
size_t findClosestIndex(const cvf::Vec3d& position) const;
double simWellAzimuthAngle(const cvf::Vec3d& position) const;
double simWellDipAngle(const cvf::Vec3d& position) const;
private:
void computeMeasuredDepths();