internalize StCond keyword
This commit is contained in:
@@ -143,6 +143,7 @@ if(ENABLE_ECL_INPUT)
|
||||
src/opm/parser/eclipse/EclipseState/Tables/PvtxTable.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Tables/SimpleTable.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Tables/PolyInjTables.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Tables/StandardCond.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Tables/TableColumn.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Tables/TableContainer.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Tables/TableIndex.cpp
|
||||
@@ -541,6 +542,7 @@ if(ENABLE_ECL_INPUT)
|
||||
opm/parser/eclipse/EclipseState/EndpointScaling.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/DenT.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/SimpleTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/StandardCond.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/PolyInjTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/PdvdTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/TlpmixpaTable.hpp
|
||||
|
||||
42
opm/parser/eclipse/EclipseState/Tables/StandardCond.hpp
Normal file
42
opm/parser/eclipse/EclipseState/Tables/StandardCond.hpp
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
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_STANDARDCOND_HPP
|
||||
#define OPM_PARSER_STANDARDCOND_HPP
|
||||
|
||||
namespace Opm {
|
||||
|
||||
struct StandardCond {
|
||||
StandardCond();
|
||||
StandardCond(double temp, double press)
|
||||
: temperature(temp)
|
||||
, pressure(press)
|
||||
{}
|
||||
|
||||
bool operator==(const StandardCond& data) const {
|
||||
return temperature == data.temperature &&
|
||||
pressure == data.pressure;
|
||||
}
|
||||
|
||||
double temperature;
|
||||
double pressure;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -39,6 +39,7 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/PvtwsaltTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/BrineDensityTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/SolventDensityTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/StandardCond.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/FlatTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/SorwmisTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/SgcwmisTable.hpp>
|
||||
@@ -89,6 +90,7 @@ namespace Opm {
|
||||
const DenT& oilDenT,
|
||||
const DenT& gasDenT,
|
||||
const DenT& watDenT,
|
||||
const StandardCond& stcond,
|
||||
std::size_t gas_comp_index,
|
||||
double rtemp);
|
||||
|
||||
@@ -165,6 +167,7 @@ namespace Opm {
|
||||
const DenT& WatDenT() const;
|
||||
const DenT& GasDenT() const;
|
||||
const DenT& OilDenT() const;
|
||||
const StandardCond& stCond() const;
|
||||
std::size_t gas_comp_index() const;
|
||||
const PvtwTable& getPvtwTable() const;
|
||||
const std::vector<PvtwsaltTable>& getPvtwSaltTables() const;
|
||||
@@ -443,6 +446,7 @@ namespace Opm {
|
||||
DenT oilDenT;
|
||||
DenT gasDenT;
|
||||
DenT watDenT;
|
||||
StandardCond stcond;
|
||||
std::size_t m_gas_comp_index;
|
||||
double m_rtemp;
|
||||
};
|
||||
|
||||
37
src/opm/parser/eclipse/EclipseState/Tables/StandardCond.cpp
Normal file
37
src/opm/parser/eclipse/EclipseState/Tables/StandardCond.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
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/parser/eclipse/EclipseState/Tables/StandardCond.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ParserKeywords/S.hpp>
|
||||
#include <opm/parser/eclipse/Units/UnitSystem.hpp>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
|
||||
StandardCond::StandardCond() {
|
||||
using ST = ParserKeywords::STCOND;
|
||||
double input_temp = ST::TEMPERATURE::defaultValue;
|
||||
double input_pressure = ST::PRESSURE::defaultValue;
|
||||
UnitSystem units( UnitSystem::UnitType::UNIT_TYPE_METRIC );
|
||||
this->temperature = units.to_si(UnitSystem::measure::temperature, input_temp);
|
||||
this->pressure = units.to_si(UnitSystem::measure::pressure, input_pressure);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -123,6 +123,7 @@ namespace Opm {
|
||||
const DenT& oilDenT_,
|
||||
const DenT& gasDenT_,
|
||||
const DenT& watDenT_,
|
||||
const StandardCond& stcond_,
|
||||
std::size_t gas_comp_index,
|
||||
double rtemp)
|
||||
:
|
||||
@@ -154,6 +155,7 @@ namespace Opm {
|
||||
oilDenT(oilDenT_),
|
||||
gasDenT(gasDenT_),
|
||||
watDenT(watDenT_),
|
||||
stcond(stcond_),
|
||||
m_gas_comp_index(gas_comp_index),
|
||||
m_rtemp(rtemp)
|
||||
{
|
||||
@@ -227,6 +229,12 @@ namespace Opm {
|
||||
if (deck.hasKeyword<ParserKeywords::WATDENT>())
|
||||
this->watDenT = DenT( deck.getKeyword<ParserKeywords::WATDENT>());
|
||||
|
||||
if (deck.hasKeyword<ParserKeywords::STCOND>()) {
|
||||
auto stcondKeyword = deck.getKeyword("STCOND");
|
||||
this->stcond.temperature = stcondKeyword.getRecord(0).getItem("TEMPERATURE").getSIDouble(0);
|
||||
this->stcond.pressure = stcondKeyword.getRecord(0).getItem("PRESSURE").getSIDouble(0);
|
||||
}
|
||||
|
||||
using GC = ParserKeywords::GCOMPIDX;
|
||||
if (deck.hasKeyword<GC>())
|
||||
this->m_gas_comp_index = deck.getKeyword<GC>().getRecord(0).getItem<GC::GAS_COMPONENT_INDEX>().get<int>(0);
|
||||
@@ -262,6 +270,7 @@ namespace Opm {
|
||||
gasDenT = data.gasDenT;
|
||||
oilDenT = data.oilDenT;
|
||||
watDenT = data.watDenT;
|
||||
stcond = data.stcond;
|
||||
m_gas_comp_index = data.m_gas_comp_index;
|
||||
|
||||
return *this;
|
||||
@@ -342,6 +351,10 @@ namespace Opm {
|
||||
return this->oilDenT;
|
||||
}
|
||||
|
||||
const StandardCond& TableManager::stCond() const {
|
||||
return this->stcond;
|
||||
}
|
||||
|
||||
const TableContainer& TableManager::operator[](const std::string& tableName) const {
|
||||
return getTables(tableName);
|
||||
}
|
||||
@@ -1097,6 +1110,7 @@ namespace Opm {
|
||||
gasDenT == data.gasDenT &&
|
||||
oilDenT == data.oilDenT &&
|
||||
watDenT == data.watDenT &&
|
||||
stcond == data.stcond &&
|
||||
jfuncOk &&
|
||||
m_rtemp == data.m_rtemp &&
|
||||
m_gas_comp_index == data.m_gas_comp_index;
|
||||
|
||||
Reference in New Issue
Block a user