From 8679af2dbccd74d0341c90f98f4e7acd86c5ba02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20St=C3=B8ren?= Date: Thu, 8 Jun 2017 22:54:06 +0200 Subject: [PATCH 1/2] #1575 Add Fraction Truncation ui group to Fraction Template --- .../Completions/CMakeLists_files.cmake | 2 + .../RimEllipseFractureTemplate.cpp | 4 + .../Completions/RimFractureContainment.cpp | 82 +++++++++++++++++++ .../Completions/RimFractureContainment.h | 57 +++++++++++++ .../Completions/RimFractureTemplate.cpp | 7 +- .../Completions/RimFractureTemplate.h | 9 +- .../RimStimPlanFractureTemplate.cpp | 8 +- 7 files changed, 163 insertions(+), 6 deletions(-) create mode 100644 ApplicationCode/ProjectDataModel/Completions/RimFractureContainment.cpp create mode 100644 ApplicationCode/ProjectDataModel/Completions/RimFractureContainment.h diff --git a/ApplicationCode/ProjectDataModel/Completions/CMakeLists_files.cmake b/ApplicationCode/ProjectDataModel/Completions/CMakeLists_files.cmake index 1e97e8604f..a69f88a83e 100644 --- a/ApplicationCode/ProjectDataModel/Completions/CMakeLists_files.cmake +++ b/ApplicationCode/ProjectDataModel/Completions/CMakeLists_files.cmake @@ -19,6 +19,7 @@ ${CEE_CURRENT_LIST_DIR}RimWellPathCompletions.h # Fracture files goes here ${CEE_CURRENT_LIST_DIR}RimEllipseFractureTemplate.h ${CEE_CURRENT_LIST_DIR}RimFracture.h +${CEE_CURRENT_LIST_DIR}RimFractureContainment.h ${CEE_CURRENT_LIST_DIR}RimFractureExportSettings.h ${CEE_CURRENT_LIST_DIR}RimFractureTemplate.h ${CEE_CURRENT_LIST_DIR}RimFractureTemplateCollection.h @@ -45,6 +46,7 @@ ${CEE_CURRENT_LIST_DIR}RimWellPathCompletions.cpp # Fracture files goes here ${CEE_CURRENT_LIST_DIR}RimEllipseFractureTemplate.cpp ${CEE_CURRENT_LIST_DIR}RimFracture.cpp +${CEE_CURRENT_LIST_DIR}RimFractureContainment.cpp ${CEE_CURRENT_LIST_DIR}RimFractureExportSettings.cpp ${CEE_CURRENT_LIST_DIR}RimFractureTemplate.cpp ${CEE_CURRENT_LIST_DIR}RimFractureTemplateCollection.cpp diff --git a/ApplicationCode/ProjectDataModel/Completions/RimEllipseFractureTemplate.cpp b/ApplicationCode/ProjectDataModel/Completions/RimEllipseFractureTemplate.cpp index fc863070cd..f4134eb71a 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimEllipseFractureTemplate.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimEllipseFractureTemplate.cpp @@ -27,6 +27,7 @@ #include "RimDefines.h" #include "RimFracture.h" +#include "RimFractureContainment.h" #include "RimFractureTemplate.h" #include "RimProject.h" @@ -318,6 +319,9 @@ void RimEllipseFractureTemplate::defineUiOrdering(QString uiConfigName, caf::Pdm geometryGroup->add(&orientation); geometryGroup->add(&azimuthAngle); + caf::PdmUiGroup* trGr = uiOrdering.addNewGroup("Fracture Truncation"); + m_fractureContainmentField()->defineUiOrdering(uiConfigName, *trGr); + caf::PdmUiGroup* propertyGroup = uiOrdering.addNewGroup("Properties"); propertyGroup->add(&fractureConductivity); if (fractureConductivity == RimFractureTemplate::FINITE_CONDUCTIVITY) diff --git a/ApplicationCode/ProjectDataModel/Completions/RimFractureContainment.cpp b/ApplicationCode/ProjectDataModel/Completions/RimFractureContainment.cpp new file mode 100644 index 0000000000..c855592f9b --- /dev/null +++ b/ApplicationCode/ProjectDataModel/Completions/RimFractureContainment.cpp @@ -0,0 +1,82 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// +#include "RimFractureContainment.h" +#include "cafPdmUiSliderEditor.h" + + +CAF_PDM_SOURCE_INIT(RimFractureContainment, "FractureContainment"); + +namespace caf +{ +template<> +void caf::AppEnum< RimFractureContainment::FaultTruncType>::setUp() +{ + addItem(RimFractureContainment::DISABLED, "DISABLED", "Disable"); + addItem(RimFractureContainment::TRUNCATE_AT_FAULT, "TRUNCATE_AT_FAULT", "Truncate At Faults"); + addItem(RimFractureContainment::CONTINUE_IN_CONTAINMENT_ZONE, "CONTINUE_IN_CONTAINMENT_ZONE", "Continue in Containment Zone"); + + setDefault(RimFractureContainment::DISABLED); +} +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimFractureContainment::RimFractureContainment() +{ + CAF_PDM_InitObject("Fracture Containment", "", "", ""); + + CAF_PDM_InitField(&m_isUsingFractureContainment, "IsUsingFractureContainment", false, "Fracture Containment", "", "", ""); + CAF_PDM_InitField(&m_topKLayer, "topKLayer", 0, "Top Layer", "", "", ""); + //m_topKLayer.uiCapability()->setUiEditorTypeName(caf::PdmUiSliderEditor::uiEditorTypeName()); + CAF_PDM_InitField(&m_bottomKLayer, "bottomKLayer", 0, "Bottom Layer", "", "", ""); + //m_topKLayer.uiCapability()->setUiEditorTypeName(caf::PdmUiSliderEditor::uiEditorTypeName()); + + CAF_PDM_InitFieldNoDefault(&m_faultTruncation, "m_faultTruncation", "Fault Truncation", "", "", ""); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QList RimFractureContainment::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, + bool* useOptionsOnly) +{ + QList options; + if (fieldNeedingOptions == &m_faultTruncation) + { + options.push_back(caf::PdmOptionItemInfo(caf::AppEnum< FaultTruncType >::uiText(DISABLED), DISABLED)); + options.push_back(caf::PdmOptionItemInfo(caf::AppEnum< FaultTruncType >::uiText(TRUNCATE_AT_FAULT), TRUNCATE_AT_FAULT)); + if (m_isUsingFractureContainment()) + { + options.push_back(caf::PdmOptionItemInfo(caf::AppEnum< FaultTruncType >::uiText(CONTINUE_IN_CONTAINMENT_ZONE), CONTINUE_IN_CONTAINMENT_ZONE)); + } + } + return options; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimFractureContainment::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) +{ + uiOrdering.add(&m_isUsingFractureContainment); + uiOrdering.add(&m_topKLayer); + uiOrdering.add(&m_bottomKLayer); + uiOrdering.add(&m_faultTruncation); +} + diff --git a/ApplicationCode/ProjectDataModel/Completions/RimFractureContainment.h b/ApplicationCode/ProjectDataModel/Completions/RimFractureContainment.h new file mode 100644 index 0000000000..dea71b7e18 --- /dev/null +++ b/ApplicationCode/ProjectDataModel/Completions/RimFractureContainment.h @@ -0,0 +1,57 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// +#pragma once +#include "cafPdmObject.h" +#include "cafPdmField.h" +#include "cafAppEnum.h" + +class RimFractureContainment : public caf::PdmObject +{ + CAF_PDM_HEADER_INIT; + +public: + RimFractureContainment(); + + caf::PdmField m_isUsingFractureContainment; + caf::PdmField m_topKLayer; + caf::PdmField m_bottomKLayer; + + enum FaultTruncType + { + DISABLED, + TRUNCATE_AT_FAULT, + CONTINUE_IN_CONTAINMENT_ZONE + }; + + friend caf::AppEnum< FaultTruncType >; + caf::PdmField< caf::AppEnum< FaultTruncType > > m_faultTruncation; + + + virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override; +protected: + + virtual QList calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override; + + + +private: + +}; + + + diff --git a/ApplicationCode/ProjectDataModel/Completions/RimFractureTemplate.cpp b/ApplicationCode/ProjectDataModel/Completions/RimFractureTemplate.cpp index 29931e294b..fb47c444a2 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimFractureTemplate.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimFractureTemplate.cpp @@ -27,6 +27,7 @@ #include "cafPdmUiDoubleSliderEditor.h" #include "cvfVector3.h" +#include "RimFractureContainment.h" @@ -79,6 +80,10 @@ RimFractureTemplate::RimFractureTemplate(void) CAF_PDM_InitField(&fractureConductivity, "FractureCondictivity", caf::AppEnum(INFINITE_CONDUCTIVITY), "Conductivity in Fracture", "", "", ""); + CAF_PDM_InitFieldNoDefault(&m_fractureContainmentField, "fractureContainmentField", "Fracture Containment", "", "", ""); + m_fractureContainmentField = new RimFractureContainment(); + m_fractureContainmentField.uiCapability()->setUiTreeHidden(true); + m_fractureContainmentField.uiCapability()->setUiTreeChildrenHidden(true); } //-------------------------------------------------------------------------------------------------- @@ -201,7 +206,7 @@ void RimFractureTemplate::defineUiOrdering(QString uiConfigName, caf::PdmUiOrder perforationEfficiency.uiCapability()->setUiHidden(true); perforationLength.uiCapability()->setUiHidden(true); } - + } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/Completions/RimFractureTemplate.h b/ApplicationCode/ProjectDataModel/Completions/RimFractureTemplate.h index 892757fbad..2207ac3c4c 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimFractureTemplate.h +++ b/ApplicationCode/ProjectDataModel/Completions/RimFractureTemplate.h @@ -24,6 +24,7 @@ #include "cafPdmField.h" #include "cafPdmFieldHandle.h" #include "cafPdmObject.h" +#include "cafPdmChildField.h" #include "cafPdmFieldCvfVec3d.h" #include "cvfBase.h" @@ -33,6 +34,7 @@ class RigEclipseCaseData; class RigFractureGrid; +class RimFractureContainment; //================================================================================================== /// @@ -72,9 +74,6 @@ public: caf::PdmField< caf::AppEnum< RimDefines::UnitSystem > > fractureTemplateUnit; void setDefaultWellDiameterFromUnit(); - - virtual caf::PdmFieldHandle* userDescriptionField() override; - virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override; virtual void fractureGeometry(std::vector* nodeCoords, std::vector* triangleIndices, RimDefines::UnitSystem fractureTemplateUnit) = 0; virtual std::vector fracturePolygon(RimDefines::UnitSystem fractureTemplateUnit) = 0; @@ -82,6 +81,10 @@ public: virtual const RigFractureGrid* fractureGrid() const = 0; protected: + caf::PdmChildField m_fractureContainmentField; + + virtual caf::PdmFieldHandle* userDescriptionField() override; + virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override; virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering); virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute) override; diff --git a/ApplicationCode/ProjectDataModel/Completions/RimStimPlanFractureTemplate.cpp b/ApplicationCode/ProjectDataModel/Completions/RimStimPlanFractureTemplate.cpp index 88c8473916..960abd4109 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimStimPlanFractureTemplate.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimStimPlanFractureTemplate.cpp @@ -22,6 +22,8 @@ #include "RiaLogging.h" #include "RigStimPlanFractureDefinition.h" +#include "RigFractureTransCalc.h" +#include "RigFractureGrid.h" #include "RimEclipseView.h" #include "RimFracture.h" @@ -29,6 +31,7 @@ #include "RigFractureCell.h" #include "RimStimPlanColors.h" #include "RimStimPlanLegendConfig.h" +#include "RimFractureContainment.h" #include "RivWellFracturePartMgr.h" @@ -44,8 +47,6 @@ #include #include #include -#include "RigFractureTransCalc.h" -#include "RigFractureGrid.h" @@ -1092,6 +1093,9 @@ void RimStimPlanFractureTemplate::defineUiOrdering(QString uiConfigName, caf::Pd geometryGroup->add(&orientation); geometryGroup->add(&azimuthAngle); + caf::PdmUiGroup* trGr = uiOrdering.addNewGroup("Fracture Truncation"); + m_fractureContainmentField()->defineUiOrdering(uiConfigName, *trGr); + caf::PdmUiGroup* propertyGroup = uiOrdering.addNewGroup("Properties"); propertyGroup->add(&fractureConductivity); propertyGroup->add(&skinFactor); From f46e31e673bbf896e5e89d802f77c9c7eb778e4f Mon Sep 17 00:00:00 2001 From: astridkbjorke Date: Fri, 9 Jun 2017 09:28:24 +0200 Subject: [PATCH 2/2] #1554 Implementing handling of infinite/finite conductivity in fracture during transmissibility calculation. Setting default value to finite conductivity (in fracture templates). --- .../RicExportFractureCompletionsImpl.cpp | 232 ++++++++++-------- .../Completions/RimFractureTemplate.cpp | 2 +- 2 files changed, 126 insertions(+), 108 deletions(-) diff --git a/ApplicationCode/Commands/CompletionCommands/RicExportFractureCompletionsImpl.cpp b/ApplicationCode/Commands/CompletionCommands/RicExportFractureCompletionsImpl.cpp index ac59b63dfe..150ef1dd3e 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicExportFractureCompletionsImpl.cpp +++ b/ApplicationCode/Commands/CompletionCommands/RicExportFractureCompletionsImpl.cpp @@ -56,6 +56,9 @@ std::vector RicExportFractureCompletionsImpl::generateFractur for (RimFracture* fracture : fracturesAlongWellPath) { + + bool fractureFiniteCond = (fracture->attachedFractureDefinition()->fractureConductivity() == RimFractureTemplate::FINITE_CONDUCTIVITY); + using CellIdxSpace = RigTransmissibilityCondenser::CellAddress; RimFractureTemplate* fracTemplate = fracture->attachedFractureDefinition(); @@ -85,139 +88,154 @@ std::vector RicExportFractureCompletionsImpl::generateFractur for (size_t i = 0; i < fractureCellContributingEclipseCells.size(); i++) { - transCondenser.addNeighborTransmissibility({ true, CellIdxSpace::ECLIPSE, fractureCellContributingEclipseCells[i] }, - { false, CellIdxSpace::STIMPLAN, stimPlanCellIndex }, - fractureCellContributingEclipseCellTransmissibilities[i]); + if (fractureFiniteCond) + { + transCondenser.addNeighborTransmissibility({ true, CellIdxSpace::ECLIPSE, fractureCellContributingEclipseCells[i] }, + { false, CellIdxSpace::STIMPLAN, stimPlanCellIndex }, + fractureCellContributingEclipseCellTransmissibilities[i]); + + } + else + { + transCondenser.addNeighborTransmissibility({ true, CellIdxSpace::ECLIPSE, fractureCellContributingEclipseCells[i] }, + { true, CellIdxSpace::WELL, 1 }, + fractureCellContributingEclipseCellTransmissibilities[i]); + } } } ////// // Calculate Transmissibility in the fracture: From one StimPlan Cell to the other - for (size_t i = 0; i < fractureGrid->iCellCount(); i++) + if (fractureFiniteCond) { - for (size_t j = 0; j < fractureGrid->jCellCount(); j++) + for (size_t i = 0; i < fractureGrid->iCellCount(); i++) { - size_t fractureCellIndex = fractureGrid->getGlobalIndexFromIJ(i, j); - const RigFractureCell fractureCell = fractureGrid->cellFromIndex(fractureCellIndex); - - if (fractureCell.getConductivtyValue() < 1e-7) continue; - - if (i < fractureGrid->iCellCount()-1) + for (size_t j = 0; j < fractureGrid->jCellCount(); j++) { - size_t fractureCellNeighbourXIndex = fractureGrid->getGlobalIndexFromIJ(i + 1, j); - const RigFractureCell fractureCellNeighbourX = fractureGrid->cellFromIndex(fractureCellNeighbourXIndex); + size_t fractureCellIndex = fractureGrid->getGlobalIndexFromIJ(i, j); + const RigFractureCell fractureCell = fractureGrid->cellFromIndex(fractureCellIndex); - double horizontalTransToXneigbour = - RigFractureTransmissibilityEquations::centerToCenterFractureCellTrans(fractureCell.getConductivtyValue(), - fractureCell.cellSizeX(), - fractureCell.cellSizeZ(), - fractureCellNeighbourX.getConductivtyValue(), - fractureCellNeighbourX.cellSizeX(), - fractureCellNeighbourX.cellSizeZ(), - cDarcyInCorrectUnit); + if (fractureCell.getConductivtyValue() < 1e-7) continue; - transCondenser.addNeighborTransmissibility({ false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, fractureCellIndex }, - { false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, fractureCellNeighbourXIndex }, - horizontalTransToXneigbour); + if (i < fractureGrid->iCellCount()-1) + { + size_t fractureCellNeighbourXIndex = fractureGrid->getGlobalIndexFromIJ(i + 1, j); + const RigFractureCell fractureCellNeighbourX = fractureGrid->cellFromIndex(fractureCellNeighbourXIndex); + double horizontalTransToXneigbour = + RigFractureTransmissibilityEquations::centerToCenterFractureCellTrans(fractureCell.getConductivtyValue(), + fractureCell.cellSizeX(), + fractureCell.cellSizeZ(), + fractureCellNeighbourX.getConductivtyValue(), + fractureCellNeighbourX.cellSizeX(), + fractureCellNeighbourX.cellSizeZ(), + cDarcyInCorrectUnit); + + transCondenser.addNeighborTransmissibility({ false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, fractureCellIndex }, + { false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, fractureCellNeighbourXIndex }, + horizontalTransToXneigbour); + + } + + if (j < fractureGrid->jCellCount()-1) + { + size_t fractureCellNeighbourZIndex = fractureGrid->getGlobalIndexFromIJ(i, j + 1); + const RigFractureCell fractureCellNeighbourZ = fractureGrid->cellFromIndex(fractureCellNeighbourZIndex); + + double verticalTransToZneigbour = + RigFractureTransmissibilityEquations::centerToCenterFractureCellTrans(fractureCell.getConductivtyValue(), + fractureCell.cellSizeZ(), + fractureCell.cellSizeX(), + fractureCellNeighbourZ.getConductivtyValue(), + fractureCellNeighbourZ.cellSizeZ(), + fractureCellNeighbourZ.cellSizeX(), + cDarcyInCorrectUnit); + + transCondenser.addNeighborTransmissibility({ false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, fractureCellIndex }, + { false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, fractureCellNeighbourZIndex }, + verticalTransToZneigbour); + + } } - - if (j < fractureGrid->jCellCount()-1) - { - size_t fractureCellNeighbourZIndex = fractureGrid->getGlobalIndexFromIJ(i, j + 1); - const RigFractureCell fractureCellNeighbourZ = fractureGrid->cellFromIndex(fractureCellNeighbourZIndex); - - double verticalTransToZneigbour = - RigFractureTransmissibilityEquations::centerToCenterFractureCellTrans(fractureCell.getConductivtyValue(), - fractureCell.cellSizeZ(), - fractureCell.cellSizeX(), - fractureCellNeighbourZ.getConductivtyValue(), - fractureCellNeighbourZ.cellSizeZ(), - fractureCellNeighbourZ.cellSizeX(), - cDarcyInCorrectUnit); - - transCondenser.addNeighborTransmissibility({ false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, fractureCellIndex }, - { false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, fractureCellNeighbourZIndex }, - verticalTransToZneigbour); - - } - } - } + } + } ///// // Calculate transmissibility into the well - //// - //If fracture has orientation Azimuth or Transverse, assume only radial inflow - if (fracture->attachedFractureDefinition()->orientation() == RimFractureTemplate::AZIMUTH - || fracture->attachedFractureDefinition()->orientation() == RimFractureTemplate::TRANSVERSE_WELL_PATH) + if (fractureFiniteCond) { - const RigFractureGrid* fracGrid = fracture->attachedFractureDefinition()->fractureGrid(); - std::pair wellCellIJ = fracGrid->fractureCellAtWellCenter(); - size_t wellCellIndex = fracGrid->getGlobalIndexFromIJ(wellCellIJ.first, wellCellIJ.second); - const RigFractureCell wellCell = fractureGrid->cellFromIndex(wellCellIndex); - - double radialTrans = RigFractureTransmissibilityEquations::fractureCellToWellRadialTrans(wellCell.getConductivtyValue(), - wellCell.cellSizeX(), - wellCell.cellSizeZ(), - fracture->wellRadius(), - fracTemplate->skinFactor(), - cDarcyInCorrectUnit); - - transCondenser.addNeighborTransmissibility({ true, RigTransmissibilityCondenser::CellAddress::WELL, 1 }, - { false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, wellCellIndex }, - radialTrans); - } - - - //// - //If fracture has orientation along well, linear inflow along well and radial flow at endpoints - else if (fracture->attachedFractureDefinition()->orientation() == RimFractureTemplate::ALONG_WELL_PATH) - { - RigWellPathStimplanIntersector wellFractureIntersector(wellPath->wellPathGeometry(), fracture); - const std::map& fractureWellCells = wellFractureIntersector.intersections(); - - for (const auto& fracCellIdxIsectDataPair : fractureWellCells) + //// + //If fracture has orientation Azimuth or Transverse, assume only radial inflow + if (fracture->attachedFractureDefinition()->orientation() == RimFractureTemplate::AZIMUTH + || fracture->attachedFractureDefinition()->orientation() == RimFractureTemplate::TRANSVERSE_WELL_PATH) { - size_t fracWellCellIdx = fracCellIdxIsectDataPair.first; - RigWellPathStimplanIntersector::WellCellIntersection intersection = fracCellIdxIsectDataPair.second; + const RigFractureGrid* fracGrid = fracture->attachedFractureDefinition()->fractureGrid(); + std::pair wellCellIJ = fracGrid->fractureCellAtWellCenter(); + size_t wellCellIndex = fracGrid->getGlobalIndexFromIJ(wellCellIJ.first, wellCellIJ.second); + const RigFractureCell wellCell = fractureGrid->cellFromIndex(wellCellIndex); - const RigFractureCell fractureWellCell = fractureGrid->cellFromIndex(fracWellCellIdx); + double radialTrans = RigFractureTransmissibilityEquations::fractureCellToWellRadialTrans(wellCell.getConductivtyValue(), + wellCell.cellSizeX(), + wellCell.cellSizeZ(), + fracture->wellRadius(), + fracTemplate->skinFactor(), + cDarcyInCorrectUnit); - double radialTrans = 0.0; - if (intersection.endpointCount) + transCondenser.addNeighborTransmissibility({ true, RigTransmissibilityCondenser::CellAddress::WELL, 1 }, + { false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, wellCellIndex }, + radialTrans); + } + + + //// + //If fracture has orientation along well, linear inflow along well and radial flow at endpoints + else if (fracture->attachedFractureDefinition()->orientation() == RimFractureTemplate::ALONG_WELL_PATH) + { + RigWellPathStimplanIntersector wellFractureIntersector(wellPath->wellPathGeometry(), fracture); + const std::map& fractureWellCells = wellFractureIntersector.intersections(); + + for (const auto& fracCellIdxIsectDataPair : fractureWellCells) { - radialTrans = RigFractureTransmissibilityEquations::fractureCellToWellRadialTrans(fractureWellCell.getConductivtyValue(), - fractureWellCell.cellSizeX(), - fractureWellCell.cellSizeZ(), - fracture->wellRadius(), - fracTemplate->skinFactor(), - cDarcyInCorrectUnit); + size_t fracWellCellIdx = fracCellIdxIsectDataPair.first; + RigWellPathStimplanIntersector::WellCellIntersection intersection = fracCellIdxIsectDataPair.second; + + const RigFractureCell fractureWellCell = fractureGrid->cellFromIndex(fracWellCellIdx); + + double radialTrans = 0.0; + if (intersection.endpointCount) + { + radialTrans = RigFractureTransmissibilityEquations::fractureCellToWellRadialTrans(fractureWellCell.getConductivtyValue(), + fractureWellCell.cellSizeX(), + fractureWellCell.cellSizeZ(), + fracture->wellRadius(), + fracTemplate->skinFactor(), + cDarcyInCorrectUnit); + } + + double linearTrans = 0.0; + if (intersection.hlength > 0.0 || intersection.vlength > 0.0 ) + { + linearTrans = RigFractureTransmissibilityEquations::fractureCellToWellLinearTrans(fractureWellCell.getConductivtyValue(), + fractureWellCell.cellSizeX(), + fractureWellCell.cellSizeZ(), + intersection.vlength, + intersection.hlength , + fracture->perforationEfficiency, + fracTemplate->skinFactor(), + cDarcyInCorrectUnit); + } + + double totalWellTrans = 0.5 * intersection.endpointCount * radialTrans + linearTrans; + + transCondenser.addNeighborTransmissibility( { true, RigTransmissibilityCondenser::CellAddress::WELL, 1}, + { false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, fracWellCellIdx }, + totalWellTrans); } - - double linearTrans = 0.0; - if (intersection.hlength > 0.0 || intersection.vlength > 0.0 ) - { - linearTrans = RigFractureTransmissibilityEquations::fractureCellToWellLinearTrans(fractureWellCell.getConductivtyValue(), - fractureWellCell.cellSizeX(), - fractureWellCell.cellSizeZ(), - intersection.vlength, - intersection.hlength , - fracture->perforationEfficiency, - fracTemplate->skinFactor(), - cDarcyInCorrectUnit); - } - - double totalWellTrans = 0.5 * intersection.endpointCount * radialTrans + linearTrans; - - transCondenser.addNeighborTransmissibility( { true, RigTransmissibilityCondenser::CellAddress::WELL, 1}, - { false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, fracWellCellIdx }, - totalWellTrans); } } - ///// // Insert total transmissibility from eclipse-cell to well for this fracture into the map diff --git a/ApplicationCode/ProjectDataModel/Completions/RimFractureTemplate.cpp b/ApplicationCode/ProjectDataModel/Completions/RimFractureTemplate.cpp index fb47c444a2..24ef13827e 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimFractureTemplate.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimFractureTemplate.cpp @@ -78,7 +78,7 @@ RimFractureTemplate::RimFractureTemplate(void) perforationEfficiency.uiCapability()->setUiEditorTypeName(caf::PdmUiDoubleSliderEditor::uiEditorTypeName()); CAF_PDM_InitField(&wellDiameter, "wellDiameter", 0.216, "Well Diameter at Fracture", "", "", ""); - CAF_PDM_InitField(&fractureConductivity, "FractureCondictivity", caf::AppEnum(INFINITE_CONDUCTIVITY), "Conductivity in Fracture", "", "", ""); + CAF_PDM_InitField(&fractureConductivity, "FractureCondictivity", caf::AppEnum(FINITE_CONDUCTIVITY), "Conductivity in Fracture", "", "", ""); CAF_PDM_InitFieldNoDefault(&m_fractureContainmentField, "fractureContainmentField", "Fracture Containment", "", "", ""); m_fractureContainmentField = new RimFractureContainment();