mirror of
https://github.com/OPM/ResInsight.git
synced 2026-09-03 20:53:13 -05:00
#3412 Non-Darcy Perf intervals : Simplify calculations
This commit is contained in:
+39
-88
@@ -1658,27 +1658,31 @@ std::vector<RigCompletionData> RicWellPathExportCompletionDataFeatureImpl::gener
|
|||||||
CellDirection direction =
|
CellDirection direction =
|
||||||
calculateDirectionInCell(settings.caseToApply, cell.globCellIndex, cell.intersectionLengthsInCellCS);
|
calculateDirectionInCell(settings.caseToApply, cell.globCellIndex, cell.intersectionLengthsInCellCS);
|
||||||
|
|
||||||
double transmissibility = calculateTransmissibility(settings.caseToApply,
|
const double transmissibilityForCell = calculateTransmissibility(settings.caseToApply,
|
||||||
wellPath,
|
wellPath,
|
||||||
cell.intersectionLengthsInCellCS,
|
cell.intersectionLengthsInCellCS,
|
||||||
interval->skinFactor(),
|
interval->skinFactor(),
|
||||||
interval->diameter(unitSystem) / 2,
|
interval->diameter(unitSystem) / 2,
|
||||||
cell.globCellIndex,
|
cell.globCellIndex,
|
||||||
settings.useLateralNTG);
|
settings.useLateralNTG);
|
||||||
|
|
||||||
double dFactor = calculateDFactor(settings.caseToApply,
|
const double krFactor = 1.0;
|
||||||
cell.intersectionLengthsInCellCS,
|
const double effectiveTransmissibilityForCell = transmissibilityForCell * krFactor;
|
||||||
interval->diameter(unitSystem) / 2,
|
|
||||||
cell.globCellIndex,
|
|
||||||
wellPath->perforationIntervalCollection()->nonDarcyParameters());
|
|
||||||
|
|
||||||
double kh = calculateKh(settings.caseToApply, cell.intersectionLengthsInCellCS, cell.globCellIndex);
|
const double dFactor = calculateDFactor(settings.caseToApply,
|
||||||
|
cell.intersectionLengthsInCellCS,
|
||||||
|
interval->diameter(unitSystem) / 2,
|
||||||
|
cell.globCellIndex,
|
||||||
|
wellPath->perforationIntervalCollection()->nonDarcyParameters(),
|
||||||
|
transmissibilityForCell);
|
||||||
|
|
||||||
|
const double kh = effectiveTransmissibilityForCell * cell.intersectionLengthsInCellCS.length();
|
||||||
|
|
||||||
completion.setTransAndWPImultBackgroundDataFromPerforation(
|
completion.setTransAndWPImultBackgroundDataFromPerforation(
|
||||||
transmissibility, interval->skinFactor(), interval->diameter(unitSystem), dFactor, kh, direction);
|
transmissibilityForCell, interval->skinFactor(), interval->diameter(unitSystem), dFactor, kh, direction);
|
||||||
completion.addMetadata("Perforation Completion",
|
completion.addMetadata("Perforation Completion",
|
||||||
QString("MD In: %1 - MD Out: %2").arg(cell.startMD).arg(cell.endMD) +
|
QString("MD In: %1 - MD Out: %2").arg(cell.startMD).arg(cell.endMD) +
|
||||||
QString(" Transmissibility: ") + QString::number(transmissibility));
|
QString(" Transmissibility: ") + QString::number(transmissibilityForCell));
|
||||||
completionData.push_back(completion);
|
completionData.push_back(completion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2360,95 +2364,42 @@ double RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibility(Rim
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
double RicWellPathExportCompletionDataFeatureImpl::calculateDFactor(RimEclipseCase* eclipseCase,
|
double RicWellPathExportCompletionDataFeatureImpl::calculateDFactor(RimEclipseCase* eclipseCase,
|
||||||
const cvf::Vec3d& internalCellLengths,
|
const cvf::Vec3d& internalCellLengths,
|
||||||
double wellRadius,
|
const double wellRadius,
|
||||||
size_t globalCellIndex,
|
size_t globalCellIndex,
|
||||||
const RimNonDarcyPerforationParameters* nonDarcyParameters)
|
const RimNonDarcyPerforationParameters* nonDarcyParameters,
|
||||||
|
const double effectiveTransmissibilityForCell)
|
||||||
{
|
{
|
||||||
using EQ = RigPerforationTransmissibilityEquations;
|
using EQ = RigPerforationTransmissibilityEquations;
|
||||||
|
|
||||||
// Fetch data
|
double porosity = 0.0;
|
||||||
RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData();
|
{
|
||||||
|
RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData();
|
||||||
|
|
||||||
eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMX");
|
eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PORO");
|
||||||
cvf::ref<RigResultAccessor> permxAccessObject =
|
cvf::ref<RigResultAccessor> poroAccessObject =
|
||||||
RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMX");
|
RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PORO");
|
||||||
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");
|
|
||||||
|
|
||||||
if (permxAccessObject.isNull() || permyAccessObject.isNull() || permzAccessObject.isNull())
|
if (poroAccessObject.notNull())
|
||||||
return std::numeric_limits<double>::infinity();
|
{
|
||||||
|
porosity = poroAccessObject->cellScalar(globalCellIndex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
double permx = permxAccessObject->cellScalarGlobIdx(globalCellIndex);
|
const double betaFactor = EQ::betaFactor(nonDarcyParameters->inertialCoefficientBeta0(),
|
||||||
double permy = permyAccessObject->cellScalarGlobIdx(globalCellIndex);
|
effectiveTransmissibilityForCell,
|
||||||
double permz = permzAccessObject->cellScalarGlobIdx(globalCellIndex);
|
nonDarcyParameters->permeabilityScalingFactor(),
|
||||||
double totalPerm = permx + 0 * permy + 0 * permz; // TODO: Calculate total perm
|
porosity,
|
||||||
|
nonDarcyParameters->porosityScalingFactor());
|
||||||
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(),
|
return EQ::dFactor(nonDarcyParameters->unitConstant(),
|
||||||
betaFactor,
|
betaFactor,
|
||||||
effPerm,
|
effectiveTransmissibilityForCell,
|
||||||
internalCellLengths.length(),
|
internalCellLengths.length(),
|
||||||
wellRadius,
|
wellRadius,
|
||||||
nonDarcyParameters->relativeGasDensity(),
|
nonDarcyParameters->relativeGasDensity(),
|
||||||
nonDarcyParameters->gasViscosity());
|
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");
|
|
||||||
|
|
||||||
if (permxAccessObject.isNull() || permyAccessObject.isNull() || permzAccessObject.isNull())
|
|
||||||
return std::numeric_limits<double>::infinity();
|
|
||||||
|
|
||||||
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());
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
+3
-6
@@ -94,13 +94,10 @@ public:
|
|||||||
|
|
||||||
static double calculateDFactor(RimEclipseCase* eclipseCase,
|
static double calculateDFactor(RimEclipseCase* eclipseCase,
|
||||||
const cvf::Vec3d& internalCellLengths,
|
const cvf::Vec3d& internalCellLengths,
|
||||||
double wellRadius,
|
const double wellRadius,
|
||||||
size_t globalCellIndex,
|
size_t globalCellIndex,
|
||||||
const RimNonDarcyPerforationParameters* nonDarcyParameters);
|
const RimNonDarcyPerforationParameters* nonDarcyParameters,
|
||||||
|
const double effectiveTransmissibilityForCell);
|
||||||
static double calculateKh(RimEclipseCase* eclipseCase,
|
|
||||||
const cvf::Vec3d& internalCellLengths,
|
|
||||||
size_t globalCellIndex);
|
|
||||||
|
|
||||||
static void exportCompletions(const std::vector<RimWellPath*>& wellPaths,
|
static void exportCompletions(const std::vector<RimWellPath*>& wellPaths,
|
||||||
const std::vector<RimSimWellInView*>& simWells,
|
const std::vector<RimSimWellInView*>& simWells,
|
||||||
|
|||||||
+24
-31
@@ -1,17 +1,17 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Copyright (C) 2017- Statoil ASA
|
// Copyright (C) 2017- Statoil ASA
|
||||||
//
|
//
|
||||||
// ResInsight is free software: you can redistribute it and/or modify
|
// ResInsight is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
//
|
//
|
||||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
//
|
//
|
||||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||||
// for more details.
|
// for more details.
|
||||||
//
|
//
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -25,18 +25,8 @@
|
|||||||
|
|
||||||
const double RigPerforationTransmissibilityEquations::EPSILON = 1.0e-9;
|
const double RigPerforationTransmissibilityEquations::EPSILON = 1.0e-9;
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
double RigPerforationTransmissibilityEquations::effectivePermeability(double permeability,
|
|
||||||
double krFactor)
|
|
||||||
{
|
|
||||||
return permeability * krFactor;
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
double RigPerforationTransmissibilityEquations::betaFactor(double intertialCoefficient,
|
double RigPerforationTransmissibilityEquations::betaFactor(double intertialCoefficient,
|
||||||
double effectivePermeability,
|
double effectivePermeability,
|
||||||
@@ -44,13 +34,14 @@ double RigPerforationTransmissibilityEquations::betaFactor(double intertialCoeff
|
|||||||
double porosity,
|
double porosity,
|
||||||
double porosityScalingFactor)
|
double porosityScalingFactor)
|
||||||
{
|
{
|
||||||
return intertialCoefficient *
|
const double scaledEffectivePermeability = std::pow(effectivePermeability, permeabilityScalingFactor);
|
||||||
std::pow(effectivePermeability, permeabilityScalingFactor) *
|
const double scaledPorosity = std::pow(porosity, porosityScalingFactor);
|
||||||
std::pow(porosity, porosityScalingFactor);
|
|
||||||
|
return intertialCoefficient * scaledEffectivePermeability * scaledPorosity;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
double RigPerforationTransmissibilityEquations::dFactor(double unitConstant,
|
double RigPerforationTransmissibilityEquations::dFactor(double unitConstant,
|
||||||
double betaFactor,
|
double betaFactor,
|
||||||
@@ -60,17 +51,19 @@ double RigPerforationTransmissibilityEquations::dFactor(double unitConstant,
|
|||||||
double gasDenity,
|
double gasDenity,
|
||||||
double gasViscosity)
|
double gasViscosity)
|
||||||
{
|
{
|
||||||
return unitConstant *
|
// clang-format off
|
||||||
betaFactor *
|
//
|
||||||
effectivePermeability / perforationLengthInCell *
|
// Ke 1 gasDensity
|
||||||
1 / wellRadius *
|
// D = alpha * beta * -- * -- * ------------
|
||||||
gasDenity / gasViscosity;
|
// h rw gasViscosity
|
||||||
}
|
//
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
const double keOverH = effectivePermeability / perforationLengthInCell;
|
||||||
///
|
const double oneOverRw = 1.0 / wellRadius;
|
||||||
//--------------------------------------------------------------------------------------------------
|
const double gasDensityOverGasViscosity = gasDenity / gasViscosity;
|
||||||
double RigPerforationTransmissibilityEquations::kh(double effectivePermeability, double perforationLengthInCell)
|
|
||||||
{
|
const double D = unitConstant * betaFactor * keOverH * oneOverRw * gasDensityOverGasViscosity;
|
||||||
return effectivePermeability * perforationLengthInCell;
|
|
||||||
|
return D;
|
||||||
}
|
}
|
||||||
|
|||||||
-6
@@ -24,9 +24,6 @@
|
|||||||
class RigPerforationTransmissibilityEquations
|
class RigPerforationTransmissibilityEquations
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static double effectivePermeability(double permeability,
|
|
||||||
double krFactor);
|
|
||||||
|
|
||||||
static double betaFactor(double intertialCoefficient,
|
static double betaFactor(double intertialCoefficient,
|
||||||
double effectivePermeability,
|
double effectivePermeability,
|
||||||
double permeabilityScalingFactor,
|
double permeabilityScalingFactor,
|
||||||
@@ -41,9 +38,6 @@ public:
|
|||||||
double gasDensity,
|
double gasDensity,
|
||||||
double gasViscosity);
|
double gasViscosity);
|
||||||
|
|
||||||
static double kh(double effectivePermeability,
|
|
||||||
double perforationLengthInCell);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const double EPSILON;
|
static const double EPSILON;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user