Merge pull request #3029 from plgbrts/new-jt-table

Joule-Thomson keywords for gas, oil and water phase
This commit is contained in:
Markus Blatt
2022-06-07 13:17:06 +02:00
committed by GitHub
9 changed files with 256 additions and 0 deletions

View File

@@ -180,6 +180,7 @@ if(ENABLE_ECL_INPUT)
src/opm/input/eclipse/EclipseState/Tables/Aqudims.cpp
src/opm/input/eclipse/EclipseState/Tables/ColumnSchema.cpp
src/opm/input/eclipse/EclipseState/Tables/DenT.cpp
src/opm/input/eclipse/EclipseState/Tables/JouleThomson.cpp
src/opm/input/eclipse/EclipseState/Tables/Eqldims.cpp
src/opm/input/eclipse/EclipseState/Tables/JFunc.cpp
src/opm/input/eclipse/EclipseState/Tables/PvtxTable.cpp
@@ -706,6 +707,7 @@ if(ENABLE_ECL_INPUT)
opm/input/eclipse/EclipseState/TracerConfig.hpp
opm/input/eclipse/EclipseState/MICPpara.hpp
opm/input/eclipse/EclipseState/Tables/DenT.hpp
opm/input/eclipse/EclipseState/Tables/JouleThomson.hpp
opm/input/eclipse/EclipseState/Tables/SimpleTable.hpp
opm/input/eclipse/EclipseState/Tables/StandardCond.hpp
opm/input/eclipse/EclipseState/Tables/PolyInjTable.hpp

View File

@@ -0,0 +1,70 @@
/*
Copyright (C) 2020 by Equinor
This file is part of the Open Porous Media project (OPM).
OPM 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.
OPM 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 for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_PARSER_JOULETHOMSON_HPP
#define OPM_PARSER_JOULETHOMSON_HPP
#include <cstddef>
#include <vector>
namespace Opm {
class DeckKeyword;
class DeckRecord;
class JouleThomson {
public:
struct entry {
double P0;
double C1;
entry() = default;
entry(double P0_, double C1_);
explicit entry(const DeckRecord& record);
bool operator==(const entry& other) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(P0);
serializer(C1);
}
};
JouleThomson() = default;
explicit JouleThomson(const DeckKeyword& keyword);
static JouleThomson serializeObject();
const entry& operator[](const std::size_t index) const;
bool operator==(const JouleThomson& other) const;
std::size_t size() const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.vector(m_records);
}
private:
std::vector<entry> m_records;
};
}
#endif

View File

@@ -26,6 +26,7 @@
#include <set>
#include <opm/input/eclipse/EclipseState/Tables/DenT.hpp>
#include <opm/input/eclipse/EclipseState/Tables/JouleThomson.hpp>
#include <opm/input/eclipse/EclipseState/Tables/PvtgTable.hpp>
#include <opm/input/eclipse/EclipseState/Tables/PvtgwTable.hpp>
#include <opm/input/eclipse/EclipseState/Tables/PvtgwoTable.hpp>
@@ -145,6 +146,9 @@ namespace Opm {
const DenT& WatDenT() const;
const DenT& GasDenT() const;
const DenT& OilDenT() const;
const JouleThomson& WatJT() const;
const JouleThomson& GasJT() const;
const JouleThomson& OilJT() const;
const StandardCond& stCond() const;
std::size_t gas_comp_index() const;
const PvtwTable& getPvtwTable() const;
@@ -240,6 +244,9 @@ namespace Opm {
oilDenT.serializeOp(serializer);
gasDenT.serializeOp(serializer);
watDenT.serializeOp(serializer);
oilJT.serializeOp(serializer);
gasJT.serializeOp(serializer);
watJT.serializeOp(serializer);
stcond.serializeOp(serializer);
serializer(m_gas_comp_index);
serializer(m_rtemp);
@@ -385,6 +392,9 @@ namespace Opm {
DenT oilDenT;
DenT gasDenT;
DenT watDenT;
JouleThomson oilJT;
JouleThomson gasJT;
JouleThomson watJT;
StandardCond stcond;
std::size_t m_gas_comp_index = 77;
double m_rtemp {288.7056}; // 60 Fahrenheit in Kelvin

View File

@@ -0,0 +1,68 @@
/*
Copyright (C) 2020 by Equinor ASA
This file is part of the Open Porous Media project (OPM).
OPM 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.
OPM 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 for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#include <opm/input/eclipse/EclipseState/Tables/JouleThomson.hpp>
#include <opm/input/eclipse/Deck/DeckKeyword.hpp>
#include <opm/input/eclipse/Deck/DeckRecord.hpp>
namespace Opm {
JouleThomson::JouleThomson(const DeckKeyword& keyword) {
for (const auto& record : keyword)
this->m_records.emplace_back(record);
}
JouleThomson::entry::entry(const DeckRecord& record) :
P0(record.getItem(0).getSIDouble(0)),
C1(record.getItem(1).getSIDouble(0))
{
}
JouleThomson JouleThomson::serializeObject()
{
JouleThomson result;
result.m_records = {{1,2}, {3,4}};
return result;
}
std::size_t JouleThomson::size() const {
return this->m_records.size();
}
JouleThomson::entry::entry(double P0_, double C1_) :
P0(P0_),
C1(C1_)
{}
bool JouleThomson::entry::operator==(const JouleThomson::entry& other) const {
return this->P0 == other.P0 &&
this->C1 == other.C1;
}
bool JouleThomson::operator==(const JouleThomson& other) const {
return this->m_records == other.m_records;
}
const JouleThomson::entry& JouleThomson::operator[](const std::size_t index) const {
return this->m_records.at(index);
}
}

View File

@@ -251,6 +251,16 @@ DensityTable make_density_table(const GravityTable& gravity) {
if (deck.hasKeyword<ParserKeywords::WATDENT>())
this->watDenT = DenT( deck.get<ParserKeywords::WATDENT>().back());
if (deck.hasKeyword<ParserKeywords::GASJT>())
this->gasJT = JouleThomson( deck.get<ParserKeywords::GASJT>().back());
if (deck.hasKeyword<ParserKeywords::OILJT>())
this->oilJT = JouleThomson( deck.get<ParserKeywords::OILJT>().back());
if (deck.hasKeyword<ParserKeywords::WATJT>())
this->watJT = JouleThomson( deck.get<ParserKeywords::WATJT>().back());
if (deck.hasKeyword<ParserKeywords::STCOND>()) {
auto stcondKeyword = deck["STCOND"].back();
@@ -323,6 +333,9 @@ DensityTable make_density_table(const GravityTable& gravity) {
result.oilDenT = DenT::serializeObject();
result.gasDenT = DenT::serializeObject();
result.watDenT = DenT::serializeObject();
result.oilJT = JouleThomson::serializeObject();
result.gasJT = JouleThomson::serializeObject();
result.watJT = JouleThomson::serializeObject();
result.stcond = StandardCond::serializeObject();
result.m_gas_comp_index = 77;
result.m_rtemp = 1.0;
@@ -404,6 +417,18 @@ DensityTable make_density_table(const GravityTable& gravity) {
return this->oilDenT;
}
const JouleThomson& TableManager::WatJT() const {
return this->watJT;
}
const JouleThomson& TableManager::GasJT() const {
return this->gasJT;
}
const JouleThomson& TableManager::OilJT() const {
return this->oilJT;
}
const StandardCond& TableManager::stCond() const {
return this->stcond;
}
@@ -1278,6 +1303,9 @@ DensityTable make_density_table(const GravityTable& gravity) {
gasDenT == data.gasDenT &&
oilDenT == data.oilDenT &&
watDenT == data.watDenT &&
gasJT == data.gasJT &&
oilJT == data.oilJT &&
watJT == data.watJT &&
stcond == data.stcond &&
jfunc == data.jfunc &&
m_rtemp == data.m_rtemp &&

View File

@@ -0,0 +1,25 @@
{
"name": "GASJT",
"sections": [
"PROPS"
],
"size": {
"keyword": "TABDIMS",
"item": "NTPVT"
},
"items": [
{
"name": "PREF",
"value_type": "DOUBLE",
"dimension": "Pressure",
"default": 1.0132
},
{
"name": "JOULE_THOMSON_COEFFICIENT",
"value_type": "DOUBLE",
"dimension": "Temperature/Pressure",
"default": 0,
"comment": "if defaulted the JT coefficient is calculated"
}
]
}

View File

@@ -0,0 +1,25 @@
{
"name": "OILJT",
"sections": [
"PROPS"
],
"size": {
"keyword": "TABDIMS",
"item": "NTPVT"
},
"items": [
{
"name": "PREF",
"value_type": "DOUBLE",
"dimension": "Pressure",
"default": 1.0132
},
{
"name": "JOULE_THOMSON_COEFFICIENT",
"value_type": "DOUBLE",
"dimension": "Temperature/Pressure",
"default": 0,
"comment": "if defaulted the JT coefficient is calculated"
}
]
}

View File

@@ -0,0 +1,25 @@
{
"name": "WATJT",
"sections": [
"PROPS"
],
"size": {
"keyword": "TABDIMS",
"item": "NTPVT"
},
"items": [
{
"name": "PREF",
"value_type": "DOUBLE",
"dimension": "Pressure",
"default": 1.0132
},
{
"name": "JOULE_THOMSON_COEFFICIENT",
"value_type": "DOUBLE",
"dimension": "Temperature/Pressure",
"default": 0,
"comment": "if defaulted the JT coefficient is calculated"
}
]
}

View File

@@ -1094,12 +1094,14 @@ set( keywords
900_OPM/E/EXIT
900_OPM/G/GCOMPIDX
900_OPM/G/GASDENT
900_OPM/G/GASJT
900_OPM/M/MICP
900_OPM/M/MICPPARA
900_OPM/M/MINPVFIL
900_OPM/M/MINNPCOL
900_OPM/O/OCOMPIDX
900_OPM/O/OILDENT
900_OPM/O/OILJT
900_OPM/P/PERMFACT
900_OPM/P/PINTDIMS
900_OPM/P/PLYVMH
@@ -1130,6 +1132,7 @@ set( keywords
900_OPM/S/SWOFLET
900_OPM/T/TLPMIXPA
900_OPM/V/VAPWAT
900_OPM/W/WATJT
900_OPM/W/WMICP
900_OPM/W/WPMITAB
900_OPM/W/WSKPTAB)