#1507 Setting up fractureGrid for ellipse fracture template, and adapting transmissibility calculation to be able to handle both ellipse and stimplan fractures. Missing setup of fractureCells for ellipse when loading old project.

This commit is contained in:
astridkbjorke
2017-06-01 11:31:34 +02:00
parent 935299b3df
commit e6fea6130b
8 changed files with 166 additions and 36 deletions

View File

@@ -181,7 +181,7 @@ void RigTransmissibilityCondenser::calculateCondensedTransmissibilitiesIfNeeded(
void printCellAddress(std::stringstream& str,
const RigMainGrid* mainGrid,
const RimStimPlanFractureTemplate* fractureGrid,
const RigFractureGrid* fractureGrid,
RigTransmissibilityCondenser::CellAddress cellAddr)
{
using CellAddress = RigTransmissibilityCondenser::CellAddress;
@@ -200,7 +200,7 @@ void printCellAddress(std::stringstream& str,
case CellAddress::STIMPLAN:
{
str << "STP ";
const RigFractureCell& stpCell = fractureGrid->fractureGrid()->cellFromIndex(cellAddr.m_globalCellIdx);
const RigFractureCell& stpCell = fractureGrid->cellFromIndex(cellAddr.m_globalCellIdx);
str << std::setw(5) << stpCell.getI()+1 << std::setw(5) << stpCell.getJ()+1 << std::setw(5) << " ";
}
break;
@@ -220,7 +220,7 @@ void printCellAddress(std::stringstream& str,
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::string RigTransmissibilityCondenser::neighborTransDebugOutput(const RigMainGrid* mainGrid, const RimStimPlanFractureTemplate* fractureGrid)
std::string RigTransmissibilityCondenser::neighborTransDebugOutput(const RigMainGrid* mainGrid, const RigFractureGrid* fractureGrid)
{
std::stringstream debugText;
for ( const auto& adrEqIdxPair : m_neighborTransmissibilities )
@@ -243,7 +243,7 @@ std::string RigTransmissibilityCondenser::neighborTransDebugOutput(const RigMain
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::string RigTransmissibilityCondenser::condensedTransDebugOutput(const RigMainGrid* mainGrid, const RimStimPlanFractureTemplate* fractureGrid)
std::string RigTransmissibilityCondenser::condensedTransDebugOutput(const RigMainGrid* mainGrid, const RigFractureGrid* fractureGrid)
{
std::stringstream debugText;
for ( const auto& adrEqIdxPair : m_condensedTransmissibilities )

View File

@@ -26,6 +26,7 @@
class RigMainGrid;
class RimStimPlanFractureTemplate;
class RigFractureGrid;
class RigTransmissibilityCondenser
{
@@ -74,8 +75,8 @@ public:
double condensedTransmissibility( CellAddress externalCell1, CellAddress externalCell2);
std::string neighborTransDebugOutput(const RigMainGrid* mainGrid, const RimStimPlanFractureTemplate* fractureGrid);
std::string condensedTransDebugOutput(const RigMainGrid* mainGrid, const RimStimPlanFractureTemplate* fractureGrid);
std::string neighborTransDebugOutput(const RigMainGrid* mainGrid, const RigFractureGrid* fractureGrid);
std::string condensedTransDebugOutput(const RigMainGrid* mainGrid, const RigFractureGrid* fractureGrid);
private:
void calculateCondensedTransmissibilitiesIfNeeded();

View File

@@ -20,18 +20,15 @@ RigWellPathStimplanIntersector::RigWellPathStimplanIntersector(const RigWellPath
std::vector<cvf::Vec3f> fracturePolygonf ;
std::vector<std::vector<cvf::Vec3d> > stpCellPolygons;
{
auto stimPlanFractureTemplate = dynamic_cast<RimStimPlanFractureTemplate*> (rimFracture->attachedFractureDefinition());
RimFractureTemplate* fractureTemplate = rimFracture->attachedFractureDefinition();
CVF_ASSERT(stimPlanFractureTemplate);
fracturePolygonf = stimPlanFractureTemplate->fracturePolygon(rimFracture->fractureUnit());
{
const std::vector<RigFractureCell>& stpCells = stimPlanFractureTemplate->fractureGrid()->fractureCells();
const std::vector<RigFractureCell>& stpCells = fractureTemplate->fractureGrid()->fractureCells();
for ( const auto& stpCell: stpCells ) stpCellPolygons.push_back(stpCell.getPolygon());
}
}
calculate(fractureXf, fracturePolygonf, wellPathPoints, wellRadius, stpCellPolygons, m_stimPlanCellIdxToIntersectionInfoMap);
calculate(fractureXf, wellPathPoints, wellRadius, stpCellPolygons, m_stimPlanCellIdxToIntersectionInfoMap);
}
@@ -40,7 +37,6 @@ RigWellPathStimplanIntersector::RigWellPathStimplanIntersector(const RigWellPath
//--------------------------------------------------------------------------------------------------
void RigWellPathStimplanIntersector::calculate(const cvf::Mat4f &fractureXf,
const std::vector<cvf::Vec3f>& fracturePolygonf,
const std::vector<cvf::Vec3d>& wellPathPointsOrg,
double wellRadius,
const std::vector<std::vector<cvf::Vec3d> >& stpCellPolygons,
@@ -48,8 +44,22 @@ void RigWellPathStimplanIntersector::calculate(const cvf::Mat4f &fractureXf,
{
cvf::Mat4d toFractureXf = cvf::Mat4d(fractureXf.getInverted());
std::vector<cvf::Vec3d> fracturePolygon;
for ( auto fpv: fracturePolygonf ) fracturePolygon.push_back(cvf::Vec3d(fpv));
//Find bounding box
cvf::BoundingBox polygonBBox;
for (std::vector<cvf::Vec3d> fracCellPolygon : stpCellPolygons)
{
for (cvf::Vec3d nodeCoord : fracCellPolygon) polygonBBox.add(nodeCoord);
}
cvf::Vec3d bboxCorners[8];
polygonBBox.cornerVertices(bboxCorners);
//put BB corners into polygon, to use clipPolylineByPolygon function below
//Since we are in 2D, the 4 corners of the boundingbox are repeated so only 4 are included in the polygon
std::vector<cvf::Vec3d> boundingBoxPolygon;
for (int i = 0; i < 4; i++)
{
boundingBoxPolygon.push_back(bboxCorners[i]);
}
// Convert well path to fracture template system
@@ -59,7 +69,7 @@ void RigWellPathStimplanIntersector::calculate(const cvf::Mat4f &fractureXf,
// Clip well path to fracture domain
std::vector<std::vector<cvf::Vec3d> > wellPathPartsWithinFracture =
RigCellGeometryTools::clipPolylineByPolygon(fractureRelativeWellPathPoints, fracturePolygon, RigCellGeometryTools::INTERPOLATE_LINE_Z);
RigCellGeometryTools::clipPolylineByPolygon(fractureRelativeWellPathPoints, boundingBoxPolygon, RigCellGeometryTools::INTERPOLATE_LINE_Z);
// Remove the part of the well path that is more than well radius away from the fracture plane

View File

@@ -45,7 +45,6 @@ public:
private:
friend class RigWellPathStimplanIntersectorTester;
static void calculate(const cvf::Mat4f& fractureXf,
const std::vector<cvf::Vec3f>& fracturePolygon,
const std::vector<cvf::Vec3d>& wellPathPoints,
double wellRadius,
const std::vector<std::vector<cvf::Vec3d> >& stpCellPolygons,
@@ -65,7 +64,7 @@ public:
const std::vector<std::vector<cvf::Vec3d> >& stpCellPolygons,
std::map<size_t, RigWellPathStimplanIntersector::WellCellIntersection>& stimPlanCellIdxToIntersectionInfoMap)
{
RigWellPathStimplanIntersector::calculate(fractureXf, fracturePolygon, wellPathPoints, wellRadius, stpCellPolygons, stimPlanCellIdxToIntersectionInfoMap);
RigWellPathStimplanIntersector::calculate(fractureXf, wellPathPoints, wellRadius, stpCellPolygons, stimPlanCellIdxToIntersectionInfoMap);
}
};