mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-24 07:16:53 -06:00
#2868 Completion Type : Remove obsolete code
This commit is contained in:
parent
a986f3a4d2
commit
e820bd44c7
@ -20,66 +20,20 @@
|
||||
|
||||
#include "RiaDefines.h"
|
||||
|
||||
#include "RigCellGeometryTools.h"
|
||||
#include "RigCompletionData.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigFractureCell.h"
|
||||
#include "RigFractureGrid.h"
|
||||
#include "RigHexIntersectionTools.h"
|
||||
#include "RigMainGrid.h"
|
||||
#include "RigVirtualPerforationTransmissibilities.h"
|
||||
#include "RigWellPath.h"
|
||||
#include "RigWellPathIntersectionTools.h"
|
||||
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimFishbonesCollection.h"
|
||||
#include "RimFishbonesMultipleSubs.h"
|
||||
#include "RimFracture.h"
|
||||
#include "RimFractureTemplate.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimPerforationCollection.h"
|
||||
#include "RimPerforationInterval.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSimWellFracture.h"
|
||||
#include "RimSimWellFractureCollection.h"
|
||||
#include "RimSimWellInView.h"
|
||||
#include "RimSimWellInViewCollection.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
#include "RimWellPathCompletions.h"
|
||||
#include "RimWellPathFracture.h"
|
||||
#include "RimWellPathFractureCollection.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include <QDateTime>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimCompletionCellIntersectionCalc::calculateCompletionTypeResult(const RimProject* project,
|
||||
const RimEclipseCase* eclipseCase,
|
||||
std::vector<double>& completionTypeCellResults,
|
||||
const QDateTime& fromDate)
|
||||
{
|
||||
CVF_ASSERT(eclipseCase && eclipseCase->eclipseCaseData());
|
||||
|
||||
const RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData();
|
||||
|
||||
if (project->activeOilField()->wellPathCollection->isActive)
|
||||
{
|
||||
for (const RimWellPath* wellPath : project->activeOilField()->wellPathCollection->wellPaths)
|
||||
{
|
||||
if (wellPath->showWellPath())
|
||||
{
|
||||
calculateWellPathIntersections(wellPath, eclipseCaseData, completionTypeCellResults, fromDate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE : Never compute completion type result for simulation well fractures, as these are defined per view
|
||||
}
|
||||
|
||||
std::vector<RiaDefines::CompletionType> fromCompletionData(const std::vector<RigCompletionData>& data)
|
||||
{
|
||||
std::vector<RiaDefines::CompletionType> appCompletionTypes;
|
||||
@ -166,174 +120,3 @@ void RimCompletionCellIntersectionCalc::calculateCompletionTypeResult(RimEclipse
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimCompletionCellIntersectionCalc::calculateWellPathIntersections(const RimWellPath* wellPath,
|
||||
const RigEclipseCaseData* eclipseCaseData,
|
||||
std::vector<double>& values,
|
||||
const QDateTime& fromDate)
|
||||
{
|
||||
if (wellPath->wellPathGeometry())
|
||||
{
|
||||
auto intersectedCells = RigWellPathIntersectionTools::findIntersectedGlobalCellIndices(
|
||||
eclipseCaseData, wellPath->wellPathGeometry()->m_wellPathPoints);
|
||||
for (auto& intersection : intersectedCells)
|
||||
{
|
||||
values[intersection] = RiaDefines::WELL_PATH;
|
||||
}
|
||||
}
|
||||
|
||||
if (wellPath->fishbonesCollection()->isChecked())
|
||||
{
|
||||
for (const RimFishbonesMultipleSubs* fishbones : wellPath->fishbonesCollection()->fishbonesSubs)
|
||||
{
|
||||
if (fishbones->isActive())
|
||||
{
|
||||
calculateFishbonesIntersections(fishbones, eclipseCaseData, values);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (wellPath->fractureCollection()->isChecked())
|
||||
{
|
||||
const RigMainGrid* grid = eclipseCaseData->mainGrid();
|
||||
|
||||
for (const RimWellPathFracture* fracture : wellPath->fractureCollection()->fractures())
|
||||
{
|
||||
if (fracture->isChecked())
|
||||
{
|
||||
calculateFractureIntersections(grid, fracture, values);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (wellPath->perforationIntervalCollection()->isChecked())
|
||||
{
|
||||
for (const RimPerforationInterval* perforationInterval : wellPath->perforationIntervalCollection()->perforations())
|
||||
{
|
||||
if (perforationInterval->isChecked() && perforationInterval->isActiveOnDate(fromDate))
|
||||
{
|
||||
calculatePerforationIntersections(wellPath, perforationInterval, eclipseCaseData, values);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimCompletionCellIntersectionCalc::calculateFishbonesIntersections(const RimFishbonesMultipleSubs* fishbonesSubs,
|
||||
const RigEclipseCaseData* eclipseCaseData,
|
||||
std::vector<double>& values)
|
||||
{
|
||||
for (auto& sub : fishbonesSubs->installedLateralIndices())
|
||||
{
|
||||
for (size_t lateralIndex : sub.lateralIndices)
|
||||
{
|
||||
auto intersectedCells = RigWellPathIntersectionTools::findIntersectedGlobalCellIndices(
|
||||
eclipseCaseData, fishbonesSubs->coordsForLateral(sub.subIndex, lateralIndex));
|
||||
for (auto& intersection : intersectedCells)
|
||||
{
|
||||
values[intersection] = RiaDefines::FISHBONES;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimCompletionCellIntersectionCalc::calculatePerforationIntersections(const RimWellPath* wellPath,
|
||||
const RimPerforationInterval* perforationInterval,
|
||||
const RigEclipseCaseData* eclipseCaseData,
|
||||
std::vector<double>& values)
|
||||
{
|
||||
using namespace std;
|
||||
pair<vector<cvf::Vec3d>, vector<double>> clippedWellPathData =
|
||||
wellPath->wellPathGeometry()->clippedPointSubset(perforationInterval->startMD(), perforationInterval->endMD());
|
||||
|
||||
auto intersections = RigWellPathIntersectionTools::findIntersectedGlobalCellIndices(
|
||||
eclipseCaseData, clippedWellPathData.first, clippedWellPathData.second);
|
||||
for (auto& intersection : intersections)
|
||||
{
|
||||
values[intersection] = RiaDefines::PERFORATION_INTERVAL;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimCompletionCellIntersectionCalc::calculateFractureIntersections(const RigMainGrid* mainGrid,
|
||||
const RimWellPathFracture* fracture,
|
||||
std::vector<double>& values)
|
||||
{
|
||||
if (!fracture->fractureTemplate()) return;
|
||||
if (!fracture->fractureTemplate()->fractureGrid()) return;
|
||||
|
||||
for (const RigFractureCell& fractureCell : fracture->fractureTemplate()->fractureGrid()->fractureCells())
|
||||
{
|
||||
if (!fractureCell.hasNonZeroConductivity()) continue;
|
||||
|
||||
std::vector<cvf::Vec3d> fractureCellTransformed;
|
||||
for (const auto& v : fractureCell.getPolygon())
|
||||
{
|
||||
cvf::Vec3d polygonNode = v;
|
||||
polygonNode.transformPoint(fracture->transformMatrix());
|
||||
fractureCellTransformed.push_back(polygonNode);
|
||||
}
|
||||
|
||||
std::vector<size_t> potentialCells;
|
||||
|
||||
{
|
||||
cvf::BoundingBox boundingBox;
|
||||
|
||||
for (const cvf::Vec3d& nodeCoord : fractureCellTransformed)
|
||||
{
|
||||
boundingBox.add(nodeCoord);
|
||||
}
|
||||
|
||||
mainGrid->findIntersectingCells(boundingBox, &potentialCells);
|
||||
}
|
||||
|
||||
for (size_t cellIndex : potentialCells)
|
||||
{
|
||||
if (!fracture->isEclipseCellWithinContainment(mainGrid, cellIndex)) continue;
|
||||
|
||||
std::array<cvf::Vec3d, 8> hexCorners;
|
||||
mainGrid->cellCornerVertices(cellIndex, hexCorners.data());
|
||||
|
||||
std::vector<std::vector<cvf::Vec3d>> planeCellPolygons;
|
||||
|
||||
bool isPlaneIntersected =
|
||||
RigHexIntersectionTools::planeHexIntersectionPolygons(hexCorners, fracture->transformMatrix(), planeCellPolygons);
|
||||
if (!isPlaneIntersected || planeCellPolygons.empty()) continue;
|
||||
|
||||
{
|
||||
cvf::Mat4d invertedTransformMatrix = cvf::Mat4d(fracture->transformMatrix().getInverted());
|
||||
for (std::vector<cvf::Vec3d>& planeCellPolygon : planeCellPolygons)
|
||||
{
|
||||
for (cvf::Vec3d& v : planeCellPolygon)
|
||||
{
|
||||
v.transformPoint(invertedTransformMatrix);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (const std::vector<cvf::Vec3d>& planeCellPolygon : planeCellPolygons)
|
||||
{
|
||||
std::vector<std::vector<cvf::Vec3d>> clippedPolygons =
|
||||
RigCellGeometryTools::intersectPolygons(planeCellPolygon, fractureCell.getPolygon());
|
||||
for (const auto& clippedPolygon : clippedPolygons)
|
||||
{
|
||||
if (!clippedPolygon.empty())
|
||||
{
|
||||
values[cellIndex] = RiaDefines::FRACTURE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,18 +18,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <vector>
|
||||
|
||||
class RigMainGrid;
|
||||
class RimEclipseCase;
|
||||
class RimFishbonesMultipleSubs;
|
||||
class RimWellPathFracture;
|
||||
class RimPerforationInterval;
|
||||
class RimProject;
|
||||
class RimWellPath;
|
||||
class RigEclipseCaseData;
|
||||
|
||||
class QDateTime;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@ -38,31 +30,7 @@ class QDateTime;
|
||||
class RimCompletionCellIntersectionCalc
|
||||
{
|
||||
public:
|
||||
static void calculateCompletionTypeResult(const RimProject* project,
|
||||
const RimEclipseCase* eclipseCase,
|
||||
std::vector<double>& completionTypeCellResult,
|
||||
const QDateTime& fromDate);
|
||||
|
||||
static void calculateCompletionTypeResult(RimEclipseCase* eclipseCase,
|
||||
std::vector<double>& completionTypeCellResult,
|
||||
size_t timeStep);
|
||||
|
||||
private:
|
||||
static void calculateWellPathIntersections(const RimWellPath* wellPath,
|
||||
const RigEclipseCaseData* eclipseCaseData,
|
||||
std::vector<double>& values,
|
||||
const QDateTime& fromDate);
|
||||
|
||||
static void calculateFishbonesIntersections(const RimFishbonesMultipleSubs* fishbonesSubs,
|
||||
const RigEclipseCaseData* eclipseCaseData,
|
||||
std::vector<double>& values);
|
||||
|
||||
static void calculatePerforationIntersections(const RimWellPath* wellPath,
|
||||
const RimPerforationInterval* perforationInterval,
|
||||
const RigEclipseCaseData* eclipseCaseData,
|
||||
std::vector<double>& values);
|
||||
|
||||
static void calculateFractureIntersections(const RigMainGrid* mainGrid,
|
||||
const RimWellPathFracture* fracture,
|
||||
std::vector<double>& values);
|
||||
static void calculateCompletionTypeResult(RimEclipseCase* eclipseCase,
|
||||
std::vector<double>& completionTypeCellResult,
|
||||
size_t timeStep);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user