///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2016- 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 "RigFlowDiagResultAddress.h" #include "cvfBase.h" #include "cvfObject.h" #include "cafPdmPointer.h" #include #include #include class RimEclipseResultCase; class RimFlowDiagSolution; class RigFlowDiagTimeStepResult { public: explicit RigFlowDiagTimeStepResult(size_t activeCellCount); void setTracerTOF (const std::string& tracerName, RigFlowDiagResultAddress::PhaseSelection phaseSelection, const std::map& cellValues); void setTracerFraction(const std::string& tracerName, RigFlowDiagResultAddress::PhaseSelection phaseSelection, const std::map& cellValues); void setInjProdWellPairFlux(const std::string& injectorTracerName, const std::string& producerTracerName, const std::pair& injProdFluxes) ; using Curve = std::pair< std::vector, std::vector >; // Used to "steal" the data from this one using swap std::map >& nativeResults() { return m_nativeResults; } std::map, std::pair > & injProdWellPairFluxes() { return m_injProdWellPairFluxes; } private: void addResult(const RigFlowDiagResultAddress& resAddr, const std::map& cellValues); std::map > m_nativeResults; std::map, std::pair > m_injProdWellPairFluxes; size_t m_activeCellCount; }; class RigEclipseCaseData; class RigOpmFlowDiagStaticData; class RigFlowDiagSolverInterface : public cvf::Object { public: struct FlowCharacteristicsResultFrame { FlowCharacteristicsResultFrame(); using Curve = std::pair< std::vector, std::vector >; Curve m_flowCapStorageCapCurve; Curve m_sweepEfficiencyCurve; double m_lorenzCoefficient; }; struct RelPermCurve { enum Ident { KRW, KRG, KROW, KROG, PCOW, PCOG }; enum EpsMode { EPS_ON, EPS_OFF }; Ident ident; std::string name; EpsMode epsMode; std::vector xVals; std::vector yVals; }; struct PvtCurve { enum Ident { FVT_OIL, FVT_GAS, FVT_WATER }; Ident ident; std::string name; std::vector xVals; std::vector yVals; }; public: explicit RigFlowDiagSolverInterface(RimEclipseResultCase * eclipseCase); virtual ~RigFlowDiagSolverInterface(); RigFlowDiagTimeStepResult calculate(size_t timestep, RigFlowDiagResultAddress::PhaseSelection phaseSelection, std::map > injectorTracers, std::map > producerTracers); FlowCharacteristicsResultFrame calculateFlowCharacteristics(const std::vector* injector_tof, const std::vector* producer_tof, const std::vector& selected_cell_indices, double max_pv_fraction); std::vector calculateRelPermCurvesForActiveCell(size_t activeCellIndex); std::vector calculatePvtFvfCurvesForActiveCell(size_t activeCellIndex); private: std::string getInitFileName() const; bool ensureStaticDataObjectInstanceCreated(); RimEclipseResultCase * m_eclipseCase; cvf::ref m_opmFlowDiagStaticData; };