Whitespace

This commit is contained in:
Magne Sjaastad 2018-08-09 11:30:18 +02:00
parent de5cced38f
commit 53b443e819
2 changed files with 158 additions and 131 deletions

View File

@ -35,23 +35,24 @@
#include "RimWellPathFractureCollection.h" #include "RimWellPathFractureCollection.h"
#include "RigEclipseCaseData.h" #include "RigEclipseCaseData.h"
#include "RigTransmissibilityCondenser.h" #include "RigEclipseToStimPlanCellTransmissibilityCalculator.h"
#include "RigFractureCell.h" #include "RigFractureCell.h"
#include "RigFractureGrid.h" #include "RigFractureGrid.h"
#include "RigEclipseToStimPlanCellTransmissibilityCalculator.h"
#include "RigFractureTransmissibilityEquations.h" #include "RigFractureTransmissibilityEquations.h"
#include "RigWellPathStimplanIntersector.h"
#include "RigMainGrid.h" #include "RigMainGrid.h"
#include "RigSimWellData.h" #include "RigSimWellData.h"
#include "RigSimulationWellCoordsAndMD.h" #include "RigSimulationWellCoordsAndMD.h"
#include "RigTransmissibilityCondenser.h"
#include "RigWellPath.h" #include "RigWellPath.h"
#include "RigWellPathStimplanIntersector.h"
#include <vector> #include <vector>
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdatValuesForWellPath(RimWellPath* wellPath, std::vector<RigCompletionData>
RicExportFractureCompletionsImpl::generateCompdatValuesForWellPath(RimWellPath* wellPath,
RimEclipseCase* caseToApply, RimEclipseCase* caseToApply,
QTextStream* outputStreamForIntermediateResultsText) QTextStream* outputStreamForIntermediateResultsText)
{ {
@ -97,7 +98,8 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdatValuesForSimWell(RimEclipseCase* eclipseCase, std::vector<RigCompletionData>
RicExportFractureCompletionsImpl::generateCompdatValuesForSimWell(RimEclipseCase* eclipseCase,
const RimSimWellInView* well, const RimSimWellInView* well,
QTextStream* outputStreamForIntermediateResultsText) QTextStream* outputStreamForIntermediateResultsText)
{ {
@ -116,7 +118,8 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
} }
} }
std::vector<RigCompletionData> branchCompletions = generateCompdatValues(eclipseCase, well->name(), branches[branchIndex], fractures, outputStreamForIntermediateResultsText); std::vector<RigCompletionData> branchCompletions = generateCompdatValues(
eclipseCase, well->name(), branches[branchIndex], fractures, outputStreamForIntermediateResultsText);
completionData.insert(completionData.end(), branchCompletions.begin(), branchCompletions.end()); completionData.insert(completionData.end(), branchCompletions.begin(), branchCompletions.end());
} }
@ -127,7 +130,8 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdatValues(RimEclipseCase* caseToApply, std::vector<RigCompletionData>
RicExportFractureCompletionsImpl::generateCompdatValues(RimEclipseCase* caseToApply,
const QString& wellPathName, const QString& wellPathName,
const RigWellPath* wellPathGeometry, const RigWellPath* wellPathGeometry,
const std::vector<RimFracture*>& fractures, const std::vector<RimFracture*>& fractures,
@ -167,7 +171,8 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
RimStimPlanFractureTemplate* fracTemplateStimPlan = dynamic_cast<RimStimPlanFractureTemplate*>(fracTemplate); RimStimPlanFractureTemplate* fracTemplateStimPlan = dynamic_cast<RimStimPlanFractureTemplate*>(fracTemplate);
if (!fracTemplateStimPlan->hasConductivity()) if (!fracTemplateStimPlan->hasConductivity())
{ {
RiaLogging::error("Trying to export completion data for stimPlan fracture without conductivity data for " + fracture->name()); RiaLogging::error("Trying to export completion data for stimPlan fracture without conductivity data for " +
fracture->name());
RiaLogging::error("No transmissibilities will be calculated for " + fracture->name()); RiaLogging::error("No transmissibilities will be calculated for " + fracture->name());
continue; continue;
@ -175,7 +180,6 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
} }
} }
using CellIdxSpace = RigTransmissibilityCondenser::CellAddress; using CellIdxSpace = RigTransmissibilityCondenser::CellAddress;
RigTransmissibilityCondenser transCondenser; RigTransmissibilityCondenser transCondenser;
@ -194,33 +198,38 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
cDarcyInCorrectUnit, cDarcyInCorrectUnit,
fractureCell); fractureCell);
const std::vector<size_t>& fractureCellContributingEclipseCells = eclToFractureTransCalc.globalIndiciesToContributingEclipseCells(); const std::vector<size_t>& fractureCellContributingEclipseCells =
const std::vector<double>& fractureCellContributingEclipseCellTransmissibilities = eclToFractureTransCalc.contributingEclipseCellTransmissibilities(); eclToFractureTransCalc.globalIndiciesToContributingEclipseCells();
const std::vector<double>& fractureCellContributingEclipseCellTransmissibilities =
eclToFractureTransCalc.contributingEclipseCellTransmissibilities();
size_t stimPlanCellIndex = fractureGrid->getGlobalIndexFromIJ(fractureCell.getI(), fractureCell.getJ()); size_t stimPlanCellIndex = fractureGrid->getGlobalIndexFromIJ(fractureCell.getI(), fractureCell.getJ());
auto truncatedFractureCellIndices = RimFractureContainmentTools::fracturedCellsTruncatedByFaults(caseToApply, fracture); auto truncatedFractureCellIndices =
RimFractureContainmentTools::fracturedCellsTruncatedByFaults(caseToApply, fracture);
for (size_t i = 0; i < fractureCellContributingEclipseCells.size(); i++) for (size_t i = 0; i < fractureCellContributingEclipseCells.size(); i++)
{ {
if ( fracture->isEclipseCellWithinContainment(caseToApply->eclipseCaseData()->mainGrid(), truncatedFractureCellIndices, fractureCellContributingEclipseCells[i]) ) if (fracture->isEclipseCellWithinContainment(caseToApply->eclipseCaseData()->mainGrid(),
truncatedFractureCellIndices,
fractureCellContributingEclipseCells[i]))
{ {
if (useFiniteConductivityInFracture) if (useFiniteConductivityInFracture)
{ {
transCondenser.addNeighborTransmissibility({ true, CellIdxSpace::ECLIPSE, fractureCellContributingEclipseCells[i] }, transCondenser.addNeighborTransmissibility(
{true, CellIdxSpace::ECLIPSE, fractureCellContributingEclipseCells[i]},
{false, CellIdxSpace::STIMPLAN, stimPlanCellIndex}, {false, CellIdxSpace::STIMPLAN, stimPlanCellIndex},
fractureCellContributingEclipseCellTransmissibilities[i]); fractureCellContributingEclipseCellTransmissibilities[i]);
} }
else else
{ {
transCondenser.addNeighborTransmissibility({ true, CellIdxSpace::ECLIPSE, fractureCellContributingEclipseCells[i] }, transCondenser.addNeighborTransmissibility(
{true, CellIdxSpace::ECLIPSE, fractureCellContributingEclipseCells[i]},
{true, CellIdxSpace::WELL, 1}, {true, CellIdxSpace::WELL, 1},
fractureCellContributingEclipseCellTransmissibilities[i]); fractureCellContributingEclipseCellTransmissibilities[i]);
} }
} }
} }
} }
////// //////
@ -243,8 +252,8 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
size_t fractureCellNeighbourXIndex = fractureGrid->getGlobalIndexFromIJ(i + 1, j); size_t fractureCellNeighbourXIndex = fractureGrid->getGlobalIndexFromIJ(i + 1, j);
const RigFractureCell& fractureCellNeighbourX = fractureGrid->cellFromIndex(fractureCellNeighbourXIndex); const RigFractureCell& fractureCellNeighbourX = fractureGrid->cellFromIndex(fractureCellNeighbourXIndex);
double horizontalTransToXneigbour = double horizontalTransToXneigbour = RigFractureTransmissibilityEquations::centerToCenterFractureCellTrans(
RigFractureTransmissibilityEquations::centerToCenterFractureCellTrans(fractureCell.getConductivityValue(), fractureCell.getConductivityValue(),
fractureCell.cellSizeX(), fractureCell.cellSizeX(),
fractureCell.cellSizeZ(), fractureCell.cellSizeZ(),
fractureCellNeighbourX.getConductivityValue(), fractureCellNeighbourX.getConductivityValue(),
@ -252,7 +261,8 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
fractureCellNeighbourX.cellSizeZ(), fractureCellNeighbourX.cellSizeZ(),
cDarcyInCorrectUnit); cDarcyInCorrectUnit);
transCondenser.addNeighborTransmissibility({ false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, fractureCellIndex }, transCondenser.addNeighborTransmissibility(
{false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, fractureCellIndex},
{false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, fractureCellNeighbourXIndex}, {false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, fractureCellNeighbourXIndex},
horizontalTransToXneigbour); horizontalTransToXneigbour);
} }
@ -262,8 +272,8 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
size_t fractureCellNeighbourZIndex = fractureGrid->getGlobalIndexFromIJ(i, j + 1); size_t fractureCellNeighbourZIndex = fractureGrid->getGlobalIndexFromIJ(i, j + 1);
const RigFractureCell& fractureCellNeighbourZ = fractureGrid->cellFromIndex(fractureCellNeighbourZIndex); const RigFractureCell& fractureCellNeighbourZ = fractureGrid->cellFromIndex(fractureCellNeighbourZIndex);
double verticalTransToZneigbour = double verticalTransToZneigbour = RigFractureTransmissibilityEquations::centerToCenterFractureCellTrans(
RigFractureTransmissibilityEquations::centerToCenterFractureCellTrans(fractureCell.getConductivityValue(), fractureCell.getConductivityValue(),
fractureCell.cellSizeZ(), fractureCell.cellSizeZ(),
fractureCell.cellSizeX(), fractureCell.cellSizeX(),
fractureCellNeighbourZ.getConductivityValue(), fractureCellNeighbourZ.getConductivityValue(),
@ -271,7 +281,8 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
fractureCellNeighbourZ.cellSizeX(), fractureCellNeighbourZ.cellSizeX(),
cDarcyInCorrectUnit); cDarcyInCorrectUnit);
transCondenser.addNeighborTransmissibility({ false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, fractureCellIndex }, transCondenser.addNeighborTransmissibility(
{false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, fractureCellIndex},
{false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, fractureCellNeighbourZIndex}, {false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, fractureCellNeighbourZIndex},
verticalTransToZneigbour); verticalTransToZneigbour);
} }
@ -287,8 +298,8 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
//// ////
// If fracture has orientation Azimuth or Transverse, assume only radial inflow // If fracture has orientation Azimuth or Transverse, assume only radial inflow
if ( fracture->fractureTemplate()->orientationType() == RimFractureTemplate::AZIMUTH if (fracture->fractureTemplate()->orientationType() == RimFractureTemplate::AZIMUTH ||
|| fracture->fractureTemplate()->orientationType() == RimFractureTemplate::TRANSVERSE_WELL_PATH) fracture->fractureTemplate()->orientationType() == RimFractureTemplate::TRANSVERSE_WELL_PATH)
{ {
const RigFractureGrid* fracGrid = fracture->fractureTemplate()->fractureGrid(); const RigFractureGrid* fracGrid = fracture->fractureTemplate()->fractureGrid();
if (fracGrid) if (fracGrid)
@ -298,26 +309,28 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
const RigFractureCell& wellCell = fractureGrid->cellFromIndex(wellCellIndex); const RigFractureCell& wellCell = fractureGrid->cellFromIndex(wellCellIndex);
double radialTrans = RigFractureTransmissibilityEquations::fractureCellToWellRadialTrans(wellCell.getConductivityValue(), double radialTrans =
RigFractureTransmissibilityEquations::fractureCellToWellRadialTrans(wellCell.getConductivityValue(),
wellCell.cellSizeX(), wellCell.cellSizeX(),
wellCell.cellSizeZ(), wellCell.cellSizeZ(),
fracture->wellRadius(), fracture->wellRadius(),
fracTemplate->skinFactor(), fracTemplate->skinFactor(),
cDarcyInCorrectUnit); cDarcyInCorrectUnit);
transCondenser.addNeighborTransmissibility({ true, RigTransmissibilityCondenser::CellAddress::WELL, 1 }, transCondenser.addNeighborTransmissibility(
{true, RigTransmissibilityCondenser::CellAddress::WELL, 1},
{false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, wellCellIndex}, {false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, wellCellIndex},
radialTrans); radialTrans);
} }
} }
else if (fracture->fractureTemplate()->orientationType() == RimFractureTemplate::ALONG_WELL_PATH) else if (fracture->fractureTemplate()->orientationType() == RimFractureTemplate::ALONG_WELL_PATH)
{ {
//// ////
// If fracture has orientation along well, linear inflow along well and radial flow at endpoints // If fracture has orientation along well, linear inflow along well and radial flow at endpoints
RigWellPathStimplanIntersector wellFractureIntersector(wellPathGeometry, fracture); RigWellPathStimplanIntersector wellFractureIntersector(wellPathGeometry, fracture);
const std::map<size_t, RigWellPathStimplanIntersector::WellCellIntersection >& fractureWellCells = wellFractureIntersector.intersections(); const std::map<size_t, RigWellPathStimplanIntersector::WellCellIntersection>& fractureWellCells =
wellFractureIntersector.intersections();
for (const auto& fracCellIdxIsectDataPair : fractureWellCells) for (const auto& fracCellIdxIsectDataPair : fractureWellCells)
{ {
@ -330,7 +343,8 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
double linearTrans = 0.0; double linearTrans = 0.0;
if (intersection.hlength > 0.0 || intersection.vlength > 0.0) if (intersection.hlength > 0.0 || intersection.vlength > 0.0)
{ {
linearTrans = RigFractureTransmissibilityEquations::fractureCellToWellLinearTrans(fractureWellCell.getConductivityValue(), linearTrans = RigFractureTransmissibilityEquations::fractureCellToWellLinearTrans(
fractureWellCell.getConductivityValue(),
fractureWellCell.cellSizeX(), fractureWellCell.cellSizeX(),
fractureWellCell.cellSizeZ(), fractureWellCell.cellSizeZ(),
intersection.vlength, intersection.vlength,
@ -340,7 +354,8 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
cDarcyInCorrectUnit); cDarcyInCorrectUnit);
} }
transCondenser.addNeighborTransmissibility({ true, RigTransmissibilityCondenser::CellAddress::WELL, 1 }, transCondenser.addNeighborTransmissibility(
{true, RigTransmissibilityCondenser::CellAddress::WELL, 1},
{false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, fracWellCellIdx}, {false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, fracWellCellIdx},
linearTrans); linearTrans);
} }
@ -357,7 +372,8 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
{ {
if (externalCell.m_cellIndexSpace == RigTransmissibilityCondenser::CellAddress::ECLIPSE) if (externalCell.m_cellIndexSpace == RigTransmissibilityCondenser::CellAddress::ECLIPSE)
{ {
double trans = transCondenser.condensedTransmissibility(externalCell, { true, RigTransmissibilityCondenser::CellAddress::WELL, 1 }); double trans = transCondenser.condensedTransmissibility(
externalCell, {true, RigTransmissibilityCondenser::CellAddress::WELL, 1});
eclCellIdxToTransPrFractureMap[externalCell.m_globalCellIdx][fracture] = trans; eclCellIdxToTransPrFractureMap[externalCell.m_globalCellIdx][fracture] = trans;
@ -399,18 +415,30 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
} }
} }
std::copy(allCompletionsForOneFracture.begin(), allCompletionsForOneFracture.end(), std::back_inserter(fractureCompletions)); std::copy(
allCompletionsForOneFracture.begin(), allCompletionsForOneFracture.end(), std::back_inserter(fractureCompletions));
if (outputStreamForIntermediateResultsText) if (outputStreamForIntermediateResultsText)
{ {
(*outputStreamForIntermediateResultsText) << "\n" << "\n" << "\n----------- All Transimissibilities " << fracture->name() << " -------------------- \n\n"; (*outputStreamForIntermediateResultsText)
(*outputStreamForIntermediateResultsText) << QString::fromStdString(transCondenser.neighborTransDebugOutput(mainGrid, fractureGrid)); << "\n"
(*outputStreamForIntermediateResultsText) << "\n" << "\n" << "\n----------- Condensed Results " << fracture->name() << " -------------------- \n\n"; << "\n"
(*outputStreamForIntermediateResultsText) << QString::fromStdString(transCondenser.condensedTransDebugOutput(mainGrid, fractureGrid)); << "\n----------- All Transmissibilities " << fracture->name() << " -------------------- \n\n";
(*outputStreamForIntermediateResultsText)
<< QString::fromStdString(transCondenser.neighborTransDebugOutput(mainGrid, fractureGrid));
(*outputStreamForIntermediateResultsText)
<< "\n"
<< "\n"
<< "\n----------- Condensed Results " << fracture->name() << " -------------------- \n\n";
(*outputStreamForIntermediateResultsText)
<< QString::fromStdString(transCondenser.condensedTransDebugOutput(mainGrid, fractureGrid));
(*outputStreamForIntermediateResultsText) << "\n"; (*outputStreamForIntermediateResultsText) << "\n";
} }
} }
return fractureCompletions; return fractureCompletions;
} }

View File

@ -18,7 +18,6 @@
#pragma once #pragma once
#include "RigCompletionData.h" #include "RigCompletionData.h"
#include <vector> #include <vector>