mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3412 Non-Darcy perforations. Calculate d-factor and KH. Export to file
This commit is contained in:
parent
464c0b9d15
commit
2f027f0de0
@ -35,6 +35,7 @@
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigMainGrid.h"
|
||||
#include "RigPerforationTransmissibilityEquations.h"
|
||||
#include "RigResultAccessorFactory.h"
|
||||
#include "RigTransmissibilityEquations.h"
|
||||
#include "RigWellLogExtractionTools.h"
|
||||
@ -46,6 +47,7 @@
|
||||
#include "RimFishbonesCollection.h"
|
||||
#include "RimFishbonesMultipleSubs.h"
|
||||
#include "RimFractureTemplate.h"
|
||||
#include "RimNonDarcyPerforationParameters.h"
|
||||
#include "RimPerforationCollection.h"
|
||||
#include "RimPerforationInterval.h"
|
||||
#include "RimProject.h"
|
||||
@ -1632,17 +1634,26 @@ std::vector<RigCompletionData> RicWellPathExportCompletionDataFeatureImpl::gener
|
||||
CellDirection direction =
|
||||
calculateDirectionInCell(settings.caseToApply, cell.globCellIndex, cell.intersectionLengthsInCellCS);
|
||||
|
||||
double transmissibility =
|
||||
RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibility(settings.caseToApply,
|
||||
wellPath,
|
||||
cell.intersectionLengthsInCellCS,
|
||||
interval->skinFactor(),
|
||||
interval->diameter(unitSystem) / 2,
|
||||
cell.globCellIndex,
|
||||
settings.useLateralNTG);
|
||||
double transmissibility = calculateTransmissibility(settings.caseToApply,
|
||||
wellPath,
|
||||
cell.intersectionLengthsInCellCS,
|
||||
interval->skinFactor(),
|
||||
interval->diameter(unitSystem) / 2,
|
||||
cell.globCellIndex,
|
||||
settings.useLateralNTG);
|
||||
|
||||
double dFactor = calculateDFactor(settings.caseToApply,
|
||||
cell.intersectionLengthsInCellCS,
|
||||
interval->diameter(unitSystem) / 2,
|
||||
cell.globCellIndex,
|
||||
wellPath->perforationIntervalCollection()->nonDarcyParameters());
|
||||
|
||||
double kh = calculateKh(settings.caseToApply,
|
||||
cell.intersectionLengthsInCellCS,
|
||||
cell.globCellIndex);
|
||||
|
||||
completion.setTransAndWPImultBackgroundDataFromPerforation(
|
||||
transmissibility, interval->skinFactor(), interval->diameter(unitSystem), direction);
|
||||
transmissibility, interval->skinFactor(), interval->diameter(unitSystem), dFactor, kh, direction);
|
||||
completion.addMetadata("Perforation Completion",
|
||||
QString("MD In: %1 - MD Out: %2").arg(cell.startMD).arg(cell.endMD) +
|
||||
QString(" Transmissibility: ") + QString::number(transmissibility));
|
||||
@ -2311,6 +2322,94 @@ double RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibility(Rim
|
||||
return RigTransmissibilityEquations::totalConnectionFactor(transx, transy, transz);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RicWellPathExportCompletionDataFeatureImpl::calculateDFactor(RimEclipseCase* eclipseCase,
|
||||
const cvf::Vec3d& internalCellLengths,
|
||||
double wellRadius,
|
||||
size_t globalCellIndex,
|
||||
const RimNonDarcyPerforationParameters* nonDarcyParameters)
|
||||
{
|
||||
using EQ = RigPerforationTransmissibilityEquations;
|
||||
|
||||
// Fetch data
|
||||
RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData();
|
||||
|
||||
eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMX");
|
||||
cvf::ref<RigResultAccessor> permxAccessObject =
|
||||
RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMX");
|
||||
eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMY");
|
||||
cvf::ref<RigResultAccessor> permyAccessObject =
|
||||
RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMY");
|
||||
eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMZ");
|
||||
cvf::ref<RigResultAccessor> permzAccessObject =
|
||||
RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMZ");
|
||||
|
||||
double permx = permxAccessObject->cellScalarGlobIdx(globalCellIndex);
|
||||
double permy = permyAccessObject->cellScalarGlobIdx(globalCellIndex);
|
||||
double permz = permzAccessObject->cellScalarGlobIdx(globalCellIndex);
|
||||
double totalPerm = permx + 0*permy + 0*permz; // TODO: Calculate total perm
|
||||
|
||||
eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PORO");
|
||||
cvf::ref<RigResultAccessor> poroAccessObject =
|
||||
RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PORO");
|
||||
|
||||
double porosity = poroAccessObject->cellScalar(globalCellIndex);
|
||||
|
||||
// Calculations
|
||||
double krFactor = 1.0;
|
||||
double effPerm = EQ::effectivePermeability(totalPerm, krFactor);
|
||||
|
||||
double betaFactor = EQ::betaFactor(nonDarcyParameters->inertialCoefficientBeta0(),
|
||||
effPerm,
|
||||
nonDarcyParameters->permeabilityScalingFactor(),
|
||||
porosity,
|
||||
nonDarcyParameters->porosityScalingFactor());
|
||||
|
||||
return EQ::dFactor(nonDarcyParameters->unitConstant(),
|
||||
betaFactor,
|
||||
effPerm,
|
||||
internalCellLengths.length(),
|
||||
wellRadius,
|
||||
nonDarcyParameters->relativeGasDensity(),
|
||||
nonDarcyParameters->gasViscosity());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RicWellPathExportCompletionDataFeatureImpl::calculateKh(RimEclipseCase* eclipseCase,
|
||||
const cvf::Vec3d& internalCellLengths,
|
||||
size_t globalCellIndex)
|
||||
{
|
||||
using EQ = RigPerforationTransmissibilityEquations;
|
||||
|
||||
// Fetch data
|
||||
RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData();
|
||||
|
||||
eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMX");
|
||||
cvf::ref<RigResultAccessor> permxAccessObject =
|
||||
RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMX");
|
||||
eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMY");
|
||||
cvf::ref<RigResultAccessor> permyAccessObject =
|
||||
RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMY");
|
||||
eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMZ");
|
||||
cvf::ref<RigResultAccessor> permzAccessObject =
|
||||
RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMZ");
|
||||
|
||||
double permx = permxAccessObject->cellScalarGlobIdx(globalCellIndex);
|
||||
double permy = permyAccessObject->cellScalarGlobIdx(globalCellIndex);
|
||||
double permz = permzAccessObject->cellScalarGlobIdx(globalCellIndex);
|
||||
double totalPerm = permx + 0 * permy + 0 * permz; // TODO: Calculate total perm
|
||||
|
||||
// Calculations
|
||||
double krFactor = 1.0;
|
||||
double effPerm = EQ::effectivePermeability(totalPerm, krFactor);
|
||||
|
||||
return EQ::kh(effPerm, internalCellLengths.length());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -41,6 +41,7 @@ class RimSimWellInView;
|
||||
class RimPerforationInterval;
|
||||
class RimWellPath;
|
||||
class RimWellPathFracture;
|
||||
class RimNonDarcyPerforationParameters;
|
||||
class RifEclipseDataTableFormatter;
|
||||
class RigVirtualPerforationTransmissibilities;
|
||||
class SubSegmentIntersectionInfo;
|
||||
@ -91,6 +92,15 @@ public:
|
||||
size_t volumeScaleConstant = 1,
|
||||
CellDirection directionForVolumeScaling = CellDirection::DIR_I);
|
||||
|
||||
static double calculateDFactor(RimEclipseCase* eclipseCase,
|
||||
const cvf::Vec3d& internalCellLengths,
|
||||
double wellRadius,
|
||||
size_t globalCellIndex,
|
||||
const RimNonDarcyPerforationParameters* nonDarcyParameters);
|
||||
|
||||
static double calculateKh(RimEclipseCase* eclipseCase,
|
||||
const cvf::Vec3d& internalCellLengths,
|
||||
size_t globalCellIndex);
|
||||
|
||||
static void exportCompletions(const std::vector<RimWellPath*>& wellPaths,
|
||||
const std::vector<RimSimWellInView*>& simWells,
|
||||
|
@ -8,6 +8,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RigFractureTransmissibilityEquations.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigWellPathStimplanIntersector.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigVirtualPerforationTransmissibilities.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigEclipseToStimPlanCalculator.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigPerforationTransmissibilityEquations.h
|
||||
)
|
||||
|
||||
|
||||
@ -20,6 +21,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RigFractureTransmissibilityEquations.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigWellPathStimplanIntersector.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigVirtualPerforationTransmissibilities.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigEclipseToStimPlanCalculator.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigPerforationTransmissibilityEquations.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
@ -160,13 +160,17 @@ void RigCompletionData::setTransAndWPImultBackgroundDataFromFishbone(double
|
||||
void RigCompletionData::setTransAndWPImultBackgroundDataFromPerforation(double transmissibility,
|
||||
double skinFactor,
|
||||
double diameter,
|
||||
double dFactor,
|
||||
double kh,
|
||||
CellDirection direction)
|
||||
{
|
||||
m_completionType = PERFORATION;
|
||||
m_transmissibility = transmissibility;
|
||||
m_skinFactor = skinFactor;
|
||||
m_diameter = diameter;
|
||||
m_dFactor = dFactor;
|
||||
m_direction = direction;
|
||||
m_kh = kh;
|
||||
m_isMainBore = true;
|
||||
}
|
||||
|
||||
|
@ -89,6 +89,8 @@ public:
|
||||
void setTransAndWPImultBackgroundDataFromPerforation(double transmissibility,
|
||||
double skinFactor,
|
||||
double diameter,
|
||||
double dFactor,
|
||||
double kh,
|
||||
CellDirection direction);
|
||||
|
||||
void setCombinedValuesExplicitTrans(double transmissibility,
|
||||
|
@ -0,0 +1,76 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RigPerforationTransmissibilityEquations.h"
|
||||
|
||||
#include "cvfBase.h"
|
||||
#include "cvfMath.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
const double RigPerforationTransmissibilityEquations::EPSILON = 1.0e-9;
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigPerforationTransmissibilityEquations::effectivePermeability(double permeability,
|
||||
double krFactor)
|
||||
{
|
||||
return permeability * krFactor;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigPerforationTransmissibilityEquations::betaFactor(double intertialCoefficient,
|
||||
double effectivePermeability,
|
||||
double permeabilityScalingFactor,
|
||||
double porosity,
|
||||
double porosityScalingFactor)
|
||||
{
|
||||
return intertialCoefficient *
|
||||
std::pow(effectivePermeability, permeabilityScalingFactor) *
|
||||
std::pow(porosity, porosityScalingFactor);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigPerforationTransmissibilityEquations::dFactor(double unitConstant,
|
||||
double betaFactor,
|
||||
double effectivePermeability,
|
||||
double perforationLengthInCell,
|
||||
double wellRadius,
|
||||
double gasDenity,
|
||||
double gasViscosity)
|
||||
{
|
||||
return unitConstant *
|
||||
betaFactor *
|
||||
effectivePermeability / perforationLengthInCell *
|
||||
1 / wellRadius *
|
||||
gasDenity / gasViscosity;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigPerforationTransmissibilityEquations::kh(double effectivePermeability, double perforationLengthInCell)
|
||||
{
|
||||
return effectivePermeability * perforationLengthInCell;
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
class RigPerforationTransmissibilityEquations
|
||||
{
|
||||
public:
|
||||
static double effectivePermeability(double permeability,
|
||||
double krFactor);
|
||||
|
||||
static double betaFactor(double intertialCoefficient,
|
||||
double effectivePermeability,
|
||||
double permeabilityScalingFactor,
|
||||
double porosity,
|
||||
double porosityScalingFactor);
|
||||
|
||||
static double dFactor(double unitConstant,
|
||||
double betaFactor,
|
||||
double effectivePermeability,
|
||||
double perforationLengthInCell,
|
||||
double wellRadius,
|
||||
double gasDensity,
|
||||
double gasViscosity);
|
||||
|
||||
static double kh(double effectivePermeability,
|
||||
double perforationLengthInCell);
|
||||
|
||||
private:
|
||||
static const double EPSILON;
|
||||
};
|
Loading…
Reference in New Issue
Block a user