2018-01-31 00:55:24 -06:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2017 Statoil ASA
|
|
|
|
//
|
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "RigCompletionData.h"
|
|
|
|
|
|
|
|
#include "RicExportCompletionDataSettingsUi.h"
|
2018-08-09 04:33:48 -05:00
|
|
|
#include "RicWellPathFractureReportItem.h"
|
2018-01-31 00:55:24 -06:00
|
|
|
|
2018-08-29 06:36:33 -05:00
|
|
|
#include <QFile>
|
|
|
|
|
2018-01-31 03:18:37 -06:00
|
|
|
#include "cvfBase.h"
|
|
|
|
#include "cvfVector3.h"
|
2018-11-26 05:46:32 -06:00
|
|
|
#include "cvfVector2.h"
|
2018-01-31 00:55:24 -06:00
|
|
|
|
2018-01-31 03:18:37 -06:00
|
|
|
#include <vector>
|
2018-08-29 06:36:33 -05:00
|
|
|
#include <memory>
|
2018-01-31 00:55:24 -06:00
|
|
|
|
2018-12-03 08:37:50 -06:00
|
|
|
class RicMswCompletion;
|
2018-01-31 00:55:24 -06:00
|
|
|
class RigCell;
|
|
|
|
class RigEclipseCaseData;
|
|
|
|
class RigMainGrid;
|
|
|
|
class RimEclipseCase;
|
|
|
|
class RimFishbonesMultipleSubs;
|
|
|
|
class RimSimWellInView;
|
2018-09-06 01:05:18 -05:00
|
|
|
class RimPerforationInterval;
|
2018-01-31 00:55:24 -06:00
|
|
|
class RimWellPath;
|
2018-12-03 08:37:50 -06:00
|
|
|
class RimWellPathValve;
|
2018-08-15 08:46:32 -05:00
|
|
|
class RimWellPathFracture;
|
2018-10-02 05:36:47 -05:00
|
|
|
class RimNonDarcyPerforationParameters;
|
2018-01-31 03:18:37 -06:00
|
|
|
class RifEclipseDataTableFormatter;
|
2018-03-12 05:07:46 -05:00
|
|
|
class RigVirtualPerforationTransmissibilities;
|
2018-09-24 04:17:48 -05:00
|
|
|
class SubSegmentIntersectionInfo;
|
2018-01-31 00:55:24 -06:00
|
|
|
|
2018-08-29 06:36:33 -05:00
|
|
|
//==================================================================================================
|
|
|
|
///
|
|
|
|
//==================================================================================================
|
|
|
|
typedef std::shared_ptr<QFile> QFilePtr;
|
|
|
|
|
2018-11-26 02:42:48 -06:00
|
|
|
class TransmissibilityData
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TransmissibilityData()
|
|
|
|
: m_isValid(false)
|
|
|
|
, m_effectiveH(0.0)
|
|
|
|
, m_effectiveK(0.0)
|
|
|
|
, m_connectionFactor(0.0)
|
|
|
|
, m_kh(0.0)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
bool isValid() const
|
|
|
|
{
|
|
|
|
return m_isValid;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setData(double effectiveH, double effectiveK, double connectionFactor, double kh)
|
|
|
|
{
|
|
|
|
m_isValid = true;
|
|
|
|
|
|
|
|
m_effectiveH = effectiveH;
|
|
|
|
m_effectiveK = effectiveK;
|
|
|
|
m_connectionFactor = connectionFactor;
|
|
|
|
m_kh = kh;
|
|
|
|
}
|
|
|
|
|
|
|
|
double effectiveH() const
|
|
|
|
{
|
|
|
|
return m_effectiveH;
|
|
|
|
}
|
|
|
|
|
|
|
|
double effectiveK() const
|
|
|
|
{
|
|
|
|
return m_effectiveK;
|
|
|
|
}
|
|
|
|
double connectionFactor() const
|
|
|
|
{
|
|
|
|
return m_connectionFactor;
|
|
|
|
}
|
|
|
|
double kh() const
|
|
|
|
{
|
|
|
|
return m_kh;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool m_isValid;
|
|
|
|
double m_effectiveH;
|
|
|
|
double m_effectiveK;
|
|
|
|
double m_connectionFactor;
|
|
|
|
double m_kh;
|
|
|
|
};
|
|
|
|
|
2018-01-31 00:55:24 -06:00
|
|
|
//==================================================================================================
|
|
|
|
///
|
|
|
|
//==================================================================================================
|
|
|
|
class RicWellPathExportCompletionDataFeatureImpl
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
2018-09-06 01:05:18 -05:00
|
|
|
|
2018-10-11 04:55:42 -05:00
|
|
|
static CellDirection calculateCellMainDirection(RimEclipseCase* eclipseCase,
|
|
|
|
size_t globalCellIndex,
|
|
|
|
const cvf::Vec3d& lengthsInCell);
|
2018-10-12 06:00:37 -05:00
|
|
|
|
2018-11-26 02:42:48 -06:00
|
|
|
static TransmissibilityData
|
|
|
|
calculateTransmissibilityData(RimEclipseCase* eclipseCase,
|
2018-10-12 06:00:37 -05:00
|
|
|
const RimWellPath* wellPath,
|
|
|
|
const cvf::Vec3d& internalCellLengths,
|
|
|
|
double skinFactor,
|
|
|
|
double wellRadius,
|
|
|
|
size_t globalCellIndex,
|
|
|
|
bool useLateralNTG,
|
|
|
|
size_t volumeScaleConstant = 1,
|
|
|
|
CellDirection directionForVolumeScaling = CellDirection::DIR_I);
|
2018-08-13 05:59:45 -05:00
|
|
|
|
2018-10-02 05:36:47 -05:00
|
|
|
static double calculateDFactor(RimEclipseCase* eclipseCase,
|
2018-11-26 02:42:48 -06:00
|
|
|
double effectiveH,
|
2018-10-02 05:36:47 -05:00
|
|
|
size_t globalCellIndex,
|
2018-10-11 04:25:11 -05:00
|
|
|
const RimNonDarcyPerforationParameters* nonDarcyParameters,
|
2018-10-12 06:00:37 -05:00
|
|
|
const double effectivePermeability);
|
2018-08-13 05:59:45 -05:00
|
|
|
|
|
|
|
static void exportCompletions(const std::vector<RimWellPath*>& wellPaths,
|
|
|
|
const std::vector<RimSimWellInView*>& simWells,
|
|
|
|
const RicExportCompletionDataSettingsUi& exportSettings);
|
|
|
|
|
|
|
|
static std::vector<RigCompletionData> computeStaticCompletionsForWellPath(RimWellPath* wellPath,
|
|
|
|
RimEclipseCase* eclipseCase);
|
|
|
|
|
|
|
|
static std::vector<RigCompletionData> computeDynamicCompletionsForWellPath(RimWellPath* wellPath,
|
|
|
|
RimEclipseCase* eclipseCase,
|
|
|
|
size_t timeStepIndex);
|
|
|
|
|
2018-12-06 06:29:34 -06:00
|
|
|
static std::vector<RigCompletionData> generatePerforationsCompdatValues(const RimWellPath* wellPath,
|
|
|
|
const std::vector<const RimPerforationInterval*>& intervals,
|
|
|
|
const RicExportCompletionDataSettingsUi& settings);
|
2018-08-09 08:44:58 -05:00
|
|
|
|
2018-01-31 00:55:24 -06:00
|
|
|
private:
|
2018-12-03 08:37:50 -06:00
|
|
|
|
2018-08-13 05:59:45 -05:00
|
|
|
static double calculateTransmissibilityAsEclipseDoes(RimEclipseCase* eclipseCase,
|
|
|
|
double skinFactor,
|
|
|
|
double wellRadius,
|
|
|
|
size_t globalCellIndex,
|
|
|
|
CellDirection direction);
|
2018-01-31 00:55:24 -06:00
|
|
|
|
2018-08-13 05:59:45 -05:00
|
|
|
static RigCompletionData combineEclipseCellCompletions(const std::vector<RigCompletionData>& completions,
|
|
|
|
const RicExportCompletionDataSettingsUi& settings);
|
2018-01-31 00:55:24 -06:00
|
|
|
|
2018-08-29 06:36:33 -05:00
|
|
|
static std::vector<RigCompletionData> mainGridCompletions(std::vector<RigCompletionData>& allCompletions);
|
|
|
|
|
|
|
|
static std::map<QString, std::vector<RigCompletionData>> subGridsCompletions(std::vector<RigCompletionData>& allCompletions);
|
|
|
|
|
2018-08-29 07:16:20 -05:00
|
|
|
static void exportWellPathFractureReport(RimEclipseCase* sourceCase,
|
|
|
|
QFilePtr exportFile,
|
|
|
|
const std::vector<RicWellPathFractureReportItem>& wellPathFractureReportItems);
|
|
|
|
|
2018-08-29 06:36:33 -05:00
|
|
|
static void exportWelspecsToFile(RimEclipseCase* gridCase,
|
|
|
|
QFilePtr exportFile,
|
|
|
|
const std::vector<RigCompletionData>& completions);
|
|
|
|
|
|
|
|
static void exportWelspeclToFile(RimEclipseCase* gridCase,
|
|
|
|
QFilePtr exportFile,
|
|
|
|
const std::map<QString, std::vector<RigCompletionData>>& completions);
|
|
|
|
|
2018-08-13 05:59:45 -05:00
|
|
|
static void sortAndExportCompletionsToFile(RimEclipseCase* eclipseCase,
|
2018-08-09 04:33:48 -05:00
|
|
|
const QString& exportFolder,
|
2018-02-07 03:12:07 -06:00
|
|
|
const QString& fileName,
|
|
|
|
std::vector<RigCompletionData>& completions,
|
2018-08-09 04:33:48 -05:00
|
|
|
const std::vector<RicWellPathFractureReportItem>& wellPathFractureReportItems,
|
2018-02-07 03:12:07 -06:00
|
|
|
RicExportCompletionDataSettingsUi::CompdatExportType exportType);
|
2018-01-31 00:55:24 -06:00
|
|
|
|
2018-08-13 05:59:45 -05:00
|
|
|
static void exportCompdatAndWpimultTables(RimEclipseCase* sourceCase,
|
2018-08-29 06:36:33 -05:00
|
|
|
QFilePtr exportFile,
|
2018-02-07 03:12:07 -06:00
|
|
|
const std::map<QString, std::vector<RigCompletionData>>& completionsPerGrid,
|
|
|
|
RicExportCompletionDataSettingsUi::CompdatExportType exportType);
|
2018-01-31 00:55:24 -06:00
|
|
|
|
2018-08-13 05:59:45 -05:00
|
|
|
static void exportCompdatTableUsingFormatter(RifEclipseDataTableFormatter& formatter,
|
|
|
|
const QString& gridName,
|
|
|
|
const std::vector<RigCompletionData>& completionData);
|
|
|
|
|
|
|
|
static void exportWpimultTableUsingFormatter(RifEclipseDataTableFormatter& formatter,
|
|
|
|
const QString& gridName,
|
|
|
|
const std::vector<RigCompletionData>& completionData);
|
|
|
|
|
2018-11-14 04:40:23 -06:00
|
|
|
static void appendCompletionData(std::map<size_t, std::vector<RigCompletionData>>* completionData,
|
2018-08-13 05:59:45 -05:00
|
|
|
const std::vector<RigCompletionData>& data);
|
2018-08-29 06:36:33 -05:00
|
|
|
|
2018-11-26 05:46:32 -06:00
|
|
|
static std::pair<double, cvf::Vec2i> wellPathUpperGridIntersectionIJ(const RimEclipseCase* gridCase,
|
|
|
|
const RimWellPath* wellPath,
|
|
|
|
const QString& gridName = "");
|
2018-09-05 06:26:09 -05:00
|
|
|
|
2018-11-09 02:40:30 -06:00
|
|
|
static void exportCarfinForTemporaryLgrs(const RimEclipseCase* sourceCase, const QString& folder);
|
|
|
|
|
2018-12-06 03:11:06 -06:00
|
|
|
static bool isCompletionWellPathEqual(const RigCompletionData& completion, const RimWellPath* wellPath);
|
2018-02-07 03:12:07 -06:00
|
|
|
};
|