2017-05-15 07:13:59 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// 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
|
|
|
|
|
|
|
|
#include "cafAssert.h"
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <vector>
|
|
|
|
#include <set>
|
|
|
|
|
2017-05-27 10:51:34 -05:00
|
|
|
class RigMainGrid;
|
|
|
|
class RimStimPlanFractureTemplate;
|
2017-06-01 04:31:34 -05:00
|
|
|
class RigFractureGrid;
|
2017-05-27 10:51:34 -05:00
|
|
|
|
2017-05-15 07:13:59 -05:00
|
|
|
class RigTransmissibilityCondenser
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
class CellAddress
|
|
|
|
{
|
|
|
|
public:
|
2017-05-16 04:06:49 -05:00
|
|
|
enum CellIndexSpace { ECLIPSE, STIMPLAN, WELL};
|
2017-05-15 07:13:59 -05:00
|
|
|
|
|
|
|
CellAddress(): m_isExternal(false),
|
2017-05-16 04:06:49 -05:00
|
|
|
m_cellIndexSpace(STIMPLAN),
|
|
|
|
m_globalCellIdx(-1)
|
|
|
|
{}
|
|
|
|
CellAddress(bool isExternal,
|
|
|
|
CellIndexSpace cellType,
|
|
|
|
size_t globalCellIdx)
|
|
|
|
: m_isExternal(isExternal),
|
|
|
|
m_cellIndexSpace(cellType),
|
|
|
|
m_globalCellIdx(globalCellIdx)
|
|
|
|
{}
|
2017-05-15 07:13:59 -05:00
|
|
|
|
2017-05-16 04:06:49 -05:00
|
|
|
bool m_isExternal;
|
|
|
|
CellIndexSpace m_cellIndexSpace;
|
|
|
|
size_t m_globalCellIdx;
|
2017-05-15 07:13:59 -05:00
|
|
|
|
2017-05-16 04:06:49 -05:00
|
|
|
|
|
|
|
bool operator==(const CellAddress& o)
|
|
|
|
{
|
|
|
|
return (m_isExternal == o.m_isExternal) && (m_cellIndexSpace == o.m_cellIndexSpace) && (m_globalCellIdx == o.m_globalCellIdx);
|
|
|
|
}
|
2017-05-15 07:13:59 -05:00
|
|
|
|
|
|
|
// Ordering external after internal is important for the matrix order internally
|
2017-05-16 04:06:49 -05:00
|
|
|
|
2017-05-15 07:13:59 -05:00
|
|
|
bool operator<(const CellAddress& other) const
|
|
|
|
{
|
2017-05-16 04:06:49 -05:00
|
|
|
if (m_isExternal != other.m_isExternal) return !m_isExternal; // Internal cells < External cells
|
|
|
|
if (m_cellIndexSpace != other.m_cellIndexSpace)return m_cellIndexSpace < other.m_cellIndexSpace; // Eclipse < StimPlan
|
|
|
|
if (m_globalCellIdx != other.m_globalCellIdx) return m_globalCellIdx < other.m_globalCellIdx;
|
2017-05-15 07:13:59 -05:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
void addNeighborTransmissibility(CellAddress cell1, CellAddress cell2, double transmissibility);
|
|
|
|
|
|
|
|
std::set<CellAddress> externalCells();
|
|
|
|
|
|
|
|
double condensedTransmissibility( CellAddress externalCell1, CellAddress externalCell2);
|
|
|
|
|
2017-06-01 04:31:34 -05:00
|
|
|
std::string neighborTransDebugOutput(const RigMainGrid* mainGrid, const RigFractureGrid* fractureGrid);
|
|
|
|
std::string condensedTransDebugOutput(const RigMainGrid* mainGrid, const RigFractureGrid* fractureGrid);
|
2017-05-27 10:51:34 -05:00
|
|
|
|
2017-05-15 07:13:59 -05:00
|
|
|
private:
|
|
|
|
void calculateCondensedTransmissibilitiesIfNeeded();
|
|
|
|
|
|
|
|
std::map<CellAddress, std::map<CellAddress, double> > m_neighborTransmissibilities;
|
|
|
|
std::map<CellAddress, std::map<CellAddress, double> > m_condensedTransmissibilities;
|
|
|
|
std::set<CellAddress> m_externalCellAddrSet;
|
|
|
|
};
|