mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-10 15:36:09 -06:00
#4169 Saturation-Pressure plot : Add RigEquil
This commit is contained in:
parent
dfd4539786
commit
03c9853b6e
@ -70,7 +70,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RigPolyLinesData.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigCaseCellResultCalculator.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigGridCrossPlotCurveGrouping.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigEclipseCrossPlotDataExtractor.h
|
||||
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigEquil.h
|
||||
)
|
||||
|
||||
|
||||
@ -138,6 +138,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RigGeoMechBoreHoleStressCalculator.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigPolyLinesData.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigCaseCellResultCalculator.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigEclipseCrossPlotDataExtractor.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigEquil.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
158
ApplicationCode/ReservoirDataModel/RigEquil.cpp
Normal file
158
ApplicationCode/ReservoirDataModel/RigEquil.cpp
Normal file
@ -0,0 +1,158 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2019- Equinor 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RigEquil.h"
|
||||
|
||||
#include <QStringList>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigEquil::RigEquil(double datumDepth,
|
||||
double datuDepthPressure,
|
||||
double waterOilContactDepth,
|
||||
double waterOilContactCapillaryPressure,
|
||||
double gasOilContactDepth,
|
||||
double gasOilContactCapillaryPressure,
|
||||
bool liveOilInitConstantRs,
|
||||
bool wetGasInitConstantRv,
|
||||
int initializationTargetAccuracy)
|
||||
: datum_depth(datumDepth)
|
||||
, datum_depth_ps(datuDepthPressure)
|
||||
, water_oil_contact_depth(water_oil_contact_depth)
|
||||
, water_oil_contact_capillary_pressure(water_oil_contact_capillary_pressure)
|
||||
, gas_oil_contact_depth(gas_oil_contact_depth)
|
||||
, gas_oil_contact_capillary_pressure(gas_oil_contact_capillary_pressure)
|
||||
, live_oil_init_proc(live_oil_init_proc)
|
||||
, wet_gas_init_proc(wetGasInitConstantRv)
|
||||
, init_target_accuracy(initializationTargetAccuracy)
|
||||
{
|
||||
}
|
||||
|
||||
double RigEquil::datumDepth() const
|
||||
{
|
||||
return this->datum_depth;
|
||||
}
|
||||
|
||||
double RigEquil::datumDepthPressure() const
|
||||
{
|
||||
return this->datum_depth_ps;
|
||||
}
|
||||
|
||||
double RigEquil::waterOilContactDepth() const
|
||||
{
|
||||
return this->water_oil_contact_depth;
|
||||
}
|
||||
|
||||
double RigEquil::waterOilContactCapillaryPressure() const
|
||||
{
|
||||
return this->water_oil_contact_capillary_pressure;
|
||||
}
|
||||
|
||||
double RigEquil::gasOilContactDepth() const
|
||||
{
|
||||
return this->gas_oil_contact_depth;
|
||||
}
|
||||
|
||||
double RigEquil::gasOilContactCapillaryPressure() const
|
||||
{
|
||||
return this->gas_oil_contact_capillary_pressure;
|
||||
}
|
||||
|
||||
bool RigEquil::liveOilInitConstantRs() const
|
||||
{
|
||||
return this->live_oil_init_proc;
|
||||
}
|
||||
|
||||
bool RigEquil::wetGasInitConstantRv() const
|
||||
{
|
||||
return this->wet_gas_init_proc;
|
||||
}
|
||||
|
||||
int RigEquil::initializationTargetAccuracy() const
|
||||
{
|
||||
return this->init_target_accuracy;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigEquil RigEquil::parseString(const QString& keywordData)
|
||||
{
|
||||
double datumDepth = 0.0;
|
||||
double datuDepthPressure = 0.0;
|
||||
double waterOilContactDepth = 0.0;
|
||||
double waterOilContactCapillaryPressure = 0.0;
|
||||
double gasOilContactDepth = 0.0;
|
||||
double gasOilContactCapillaryPressure = 0.0;
|
||||
bool liveOilInitConstantRs = false;
|
||||
bool wetGasInitConstantRv = false;
|
||||
int initializationTargetAccuracy = -5;
|
||||
|
||||
QString line(keywordData);
|
||||
line.replace("\t", " ");
|
||||
|
||||
QStringList items = line.split(" ");
|
||||
if (items.size() > 0)
|
||||
{
|
||||
datumDepth = items.at(0).toDouble();
|
||||
}
|
||||
|
||||
if (items.size() > 1)
|
||||
{
|
||||
datuDepthPressure = items.at(1).toDouble();
|
||||
}
|
||||
if (items.size() > 2)
|
||||
{
|
||||
waterOilContactDepth = items.at(2).toDouble();
|
||||
}
|
||||
if (items.size() > 3)
|
||||
{
|
||||
waterOilContactCapillaryPressure = items.at(3).toDouble();
|
||||
}
|
||||
if (items.size() > 4)
|
||||
{
|
||||
gasOilContactDepth = items.at(4).toDouble();
|
||||
}
|
||||
if (items.size() > 5)
|
||||
{
|
||||
gasOilContactCapillaryPressure = items.at(5).toDouble();
|
||||
}
|
||||
if (items.size() > 6)
|
||||
{
|
||||
liveOilInitConstantRs = items.at(6).toInt() > 0 ? true : false;
|
||||
}
|
||||
if (items.size() > 7)
|
||||
{
|
||||
wetGasInitConstantRv = items.at(7).toInt() > 0 ? true : false;
|
||||
}
|
||||
if (items.size() > 8)
|
||||
{
|
||||
initializationTargetAccuracy = items.at(8).toInt();
|
||||
}
|
||||
|
||||
return RigEquil(datumDepth,
|
||||
datuDepthPressure,
|
||||
waterOilContactDepth,
|
||||
waterOilContactCapillaryPressure,
|
||||
gasOilContactDepth,
|
||||
gasOilContactCapillaryPressure,
|
||||
liveOilInitConstantRs,
|
||||
wetGasInitConstantRv,
|
||||
initializationTargetAccuracy);
|
||||
}
|
65
ApplicationCode/ReservoirDataModel/RigEquil.h
Normal file
65
ApplicationCode/ReservoirDataModel/RigEquil.h
Normal file
@ -0,0 +1,65 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2019- Equinor 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 <QString>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
//
|
||||
// Inspired by /opm-common/src/opm/parser/eclipse/EclipseState/InitConfig/Equil.cpp
|
||||
//
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
class RigEquil
|
||||
{
|
||||
public:
|
||||
explicit RigEquil(double datumDepth,
|
||||
double datuDepthPressure,
|
||||
double waterOilContactDepth,
|
||||
double waterOilContactCapillaryPressure,
|
||||
double gasOilContactDepth,
|
||||
double gasOilContactCapillaryPressure,
|
||||
bool liveOilInitConstantRs,
|
||||
bool wetGasInitConstantRv,
|
||||
int initializationTargetAccuracy);
|
||||
|
||||
double datumDepth() const;
|
||||
double datumDepthPressure() const;
|
||||
double waterOilContactDepth() const;
|
||||
double waterOilContactCapillaryPressure() const;
|
||||
double gasOilContactDepth() const;
|
||||
double gasOilContactCapillaryPressure() const;
|
||||
|
||||
bool liveOilInitConstantRs() const;
|
||||
bool wetGasInitConstantRv() const;
|
||||
int initializationTargetAccuracy() const;
|
||||
|
||||
static RigEquil parseString(const QString& keywordData);
|
||||
|
||||
private:
|
||||
double datum_depth;
|
||||
double datum_depth_ps;
|
||||
double water_oil_contact_depth;
|
||||
double water_oil_contact_capillary_pressure;
|
||||
double gas_oil_contact_depth;
|
||||
double gas_oil_contact_capillary_pressure;
|
||||
|
||||
bool live_oil_init_proc;
|
||||
bool wet_gas_init_proc;
|
||||
int init_target_accuracy;
|
||||
};
|
@ -3,6 +3,7 @@
|
||||
#include "RiaTestDataDirectory.h"
|
||||
#include "RifEclipseInputFileTools.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigEquil.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QFile>
|
||||
@ -186,7 +187,7 @@ TEST(RifEclipseInputFileToolsTest, EquilData)
|
||||
const qint64 startPositionInFile = 0;
|
||||
QStringList keywordContent;
|
||||
std::vector<QString> fileNamesContainingKeyword;
|
||||
bool isEditKeywordDetected = false;
|
||||
bool isStopParsingKeywordDetected = false;
|
||||
const QString includeStatementAbsolutePathPrefix;
|
||||
|
||||
RifEclipseInputFileTools::readKeywordAndParseIncludeStatementsRecursively(keyword,
|
||||
@ -196,16 +197,15 @@ TEST(RifEclipseInputFileToolsTest, EquilData)
|
||||
pathAliasDefinitions,
|
||||
&keywordContent,
|
||||
&fileNamesContainingKeyword,
|
||||
&isEditKeywordDetected,
|
||||
&isStopParsingKeywordDetected,
|
||||
includeStatementAbsolutePathPrefix);
|
||||
EXPECT_EQ((int)10, keywordContent.size());
|
||||
|
||||
/*
|
||||
for (const auto& s : keywordContent)
|
||||
{
|
||||
qDebug() << s;
|
||||
RigEquil equilRec = RigEquil::parseString(s);
|
||||
// qDebug() << s;
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@ -233,7 +233,7 @@ TEST(RifEclipseInputFileToolsTest, FaultData)
|
||||
const qint64 startPositionInFile = 0;
|
||||
QStringList keywordContent;
|
||||
std::vector<QString> fileNamesContainingKeyword;
|
||||
bool isEditKeywordDetected = false;
|
||||
bool isStopParsingKeywordDetected = false;
|
||||
const QString includeStatementAbsolutePathPrefix;
|
||||
|
||||
RifEclipseInputFileTools::readKeywordAndParseIncludeStatementsRecursively(keyword,
|
||||
@ -243,7 +243,7 @@ TEST(RifEclipseInputFileToolsTest, FaultData)
|
||||
pathAliasDefinitions,
|
||||
&keywordContent,
|
||||
&fileNamesContainingKeyword,
|
||||
&isEditKeywordDetected,
|
||||
&isStopParsingKeywordDetected,
|
||||
includeStatementAbsolutePathPrefix);
|
||||
|
||||
EXPECT_EQ((int)1041, keywordContent.size());
|
||||
|
Loading…
Reference in New Issue
Block a user