2016-12-16 14:17:56 +01:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// Copyright (C) 2016- Statoil ASA
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2016-12-16 14:17:56 +01:00
|
|
|
// 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.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2016-12-16 14:17:56 +01:00
|
|
|
// 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.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2016-12-16 14:17:56 +01:00
|
|
|
// for more details.
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2025-10-01 13:07:26 +02:00
|
|
|
#include "RigFlowDiagDefines.h"
|
2025-11-25 07:05:00 +01:00
|
|
|
#include "RigFlowDiagTimeStepResult.h"
|
2019-09-05 09:43:17 +02:00
|
|
|
|
2016-12-16 14:17:56 +01:00
|
|
|
#include "cafPdmPointer.h"
|
|
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
#include <map>
|
2025-10-01 14:47:39 +02:00
|
|
|
#include <memory>
|
2016-12-16 14:17:56 +01:00
|
|
|
#include <string>
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
class RimEclipseResultCase;
|
2016-12-17 10:46:57 +01:00
|
|
|
class RimFlowDiagSolution;
|
2016-12-16 14:17:56 +01:00
|
|
|
|
2017-01-10 09:51:39 +01:00
|
|
|
class RigEclipseCaseData;
|
2017-05-12 12:22:50 +02:00
|
|
|
class RigOpmFlowDiagStaticData;
|
2016-12-16 14:17:56 +01:00
|
|
|
|
2025-07-16 15:16:19 +02:00
|
|
|
class RigFlowDiagSolverInterface
|
2016-12-16 14:17:56 +01:00
|
|
|
{
|
|
|
|
|
public:
|
2019-09-06 10:40:57 +02:00
|
|
|
explicit RigFlowDiagSolverInterface( RimEclipseResultCase* eclipseCase );
|
2025-07-16 15:16:19 +02:00
|
|
|
virtual ~RigFlowDiagSolverInterface();
|
2016-12-16 14:17:56 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
RigFlowDiagTimeStepResult calculate( size_t timeStepIdx,
|
|
|
|
|
RigFlowDiagResultAddress::PhaseSelection phaseSelection,
|
|
|
|
|
std::map<std::string, std::vector<int>> injectorTracers,
|
|
|
|
|
std::map<std::string, std::vector<int>> producerTracers );
|
2016-12-16 14:17:56 +01:00
|
|
|
|
2025-10-01 13:07:26 +02:00
|
|
|
RigFlowDiagDefines::FlowCharacteristicsResultFrame calculateFlowCharacteristics( const std::vector<double>* injector_tof,
|
|
|
|
|
const std::vector<double>* producer_tof,
|
|
|
|
|
const std::vector<size_t>& selected_cell_indices,
|
|
|
|
|
double max_pv_fraction );
|
2017-08-09 14:10:39 +02:00
|
|
|
|
2025-11-21 13:56:59 +01:00
|
|
|
std::vector<RigFlowDiagDefines::RelPermCurve> calculateRelPermCurves( const std::string& gridName, size_t gridLocalActiveCellIndex );
|
2021-02-10 15:05:20 +01:00
|
|
|
|
2025-10-01 13:07:26 +02:00
|
|
|
std::vector<RigFlowDiagDefines::PvtCurve> calculatePvtCurves( RigFlowDiagDefines::PvtCurveType pvtCurveType, int pvtNum );
|
|
|
|
|
bool calculatePvtDynamicPropertiesFvf( int pvtNum, double pressure, double rs, double rv, double* bo, double* bg );
|
2021-02-10 15:05:20 +01:00
|
|
|
bool calculatePvtDynamicPropertiesViscosity( int pvtNum, double pressure, double rs, double rv, double* mu_o, double* mu_g );
|
2017-10-27 09:38:24 +02:00
|
|
|
|
2016-12-16 14:17:56 +01:00
|
|
|
private:
|
2019-09-23 13:37:29 +02:00
|
|
|
std::wstring getInitFileName() const;
|
|
|
|
|
bool ensureStaticDataObjectInstanceCreated();
|
|
|
|
|
void assignPhaseCorrecedPORV( RigFlowDiagResultAddress::PhaseSelection phaseSelection, size_t timeStepIdx );
|
|
|
|
|
void reportRelPermCurveError( const QString& message );
|
|
|
|
|
void reportPvtCurveError( const QString& message );
|
2018-01-19 15:21:17 +01:00
|
|
|
|
2025-10-01 14:47:39 +02:00
|
|
|
RimEclipseResultCase* m_eclipseCase;
|
|
|
|
|
std::unique_ptr<RigOpmFlowDiagStaticData> m_opmFlowDiagStaticData;
|
2018-01-19 15:21:17 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
int m_pvtCurveErrorCount;
|
|
|
|
|
int m_relpermCurveErrorCount;
|
2016-12-16 14:17:56 +01:00
|
|
|
};
|