#3412 Non-Darcy Perf intervals : Simplify calculations

This commit is contained in:
Magne Sjaastad
2018-10-11 11:25:11 +02:00
parent bebd21aa47
commit 0174ee03e1
4 changed files with 66 additions and 131 deletions

View File

@@ -1658,27 +1658,31 @@ std::vector<RigCompletionData> RicWellPathExportCompletionDataFeatureImpl::gener
CellDirection direction =
calculateDirectionInCell(settings.caseToApply, cell.globCellIndex, cell.intersectionLengthsInCellCS);
double transmissibility = calculateTransmissibility(settings.caseToApply,
wellPath,
cell.intersectionLengthsInCellCS,
interval->skinFactor(),
interval->diameter(unitSystem) / 2,
cell.globCellIndex,
settings.useLateralNTG);
const double transmissibilityForCell = 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());
const double krFactor = 1.0;
const double effectiveTransmissibilityForCell = transmissibilityForCell * krFactor;
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(
transmissibility, interval->skinFactor(), interval->diameter(unitSystem), dFactor, kh, direction);
transmissibilityForCell, 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));
QString(" Transmissibility: ") + QString::number(transmissibilityForCell));
completionData.push_back(completion);
}
}
@@ -2360,95 +2364,42 @@ double RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibility(Rim
//--------------------------------------------------------------------------------------------------
double RicWellPathExportCompletionDataFeatureImpl::calculateDFactor(RimEclipseCase* eclipseCase,
const cvf::Vec3d& internalCellLengths,
double wellRadius,
const double wellRadius,
size_t globalCellIndex,
const RimNonDarcyPerforationParameters* nonDarcyParameters)
const RimNonDarcyPerforationParameters* nonDarcyParameters,
const double effectiveTransmissibilityForCell)
{
using EQ = RigPerforationTransmissibilityEquations;
// Fetch data
RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData();
double porosity = 0.0;
{
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");
eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PORO");
cvf::ref<RigResultAccessor> poroAccessObject =
RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PORO");
if (permxAccessObject.isNull() || permyAccessObject.isNull() || permzAccessObject.isNull())
return std::numeric_limits<double>::infinity();
if (poroAccessObject.notNull())
{
porosity = poroAccessObject->cellScalar(globalCellIndex);
}
}
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());
const double betaFactor = EQ::betaFactor(nonDarcyParameters->inertialCoefficientBeta0(),
effectiveTransmissibilityForCell,
nonDarcyParameters->permeabilityScalingFactor(),
porosity,
nonDarcyParameters->porosityScalingFactor());
return EQ::dFactor(nonDarcyParameters->unitConstant(),
betaFactor,
effPerm,
effectiveTransmissibilityForCell,
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");
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());
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------