add SALINITY. Unit is molality [mol/kg] for all unit systems

This commit is contained in:
Tor Harald Sandve
2020-09-25 09:39:11 +02:00
parent 2e20dc5d43
commit dfdb844d69
4 changed files with 31 additions and 0 deletions
@@ -189,6 +189,8 @@ namespace Opm {
double rtemp() const;
double salinity() const;
bool operator==(const TableManager& data) const;
template<class Serializer>
@@ -239,6 +241,7 @@ namespace Opm {
stcond.serializeOp(serializer);
serializer(m_gas_comp_index);
serializer(m_rtemp);
serializer(m_salinity);
m_tlmixpar.serializeOp(serializer);
if (!serializer.isSerializing()) {
m_simpleTables = simpleTables;
@@ -534,6 +537,7 @@ namespace Opm {
StandardCond stcond;
std::size_t m_gas_comp_index;
double m_rtemp;
double m_salinity;
struct SplitSimpleTables {
size_t plyshMax = 0;
@@ -113,6 +113,8 @@ namespace Opm {
m_rtemp = ParserKeywords::RTEMP::TEMP::defaultValue;
m_rtemp += Metric::TemperatureOffset; // <- default values always use METRIC as the unit system!
m_salinity = ParserKeywords::SALINITY::MOLALITY::defaultValue;
initDims( deck );
initSimpleTables( deck );
initFullTables(deck, "PVTG", m_pvtgTables);
@@ -143,6 +145,9 @@ namespace Opm {
else if (deck.hasKeyword( "RTEMPA" ) )
m_rtemp = deck.getKeyword("RTEMPA").getRecord(0).getItem("TEMP").getSIDouble( 0 );
if( deck.hasKeyword( "SALINITY" ) )
m_salinity = deck.getKeyword("SALINITY").getRecord(0).getItem("MOLALITY").get<double>( 0 ); //unit independent of unit systems
if ( deck.hasKeyword( "ROCK2D") )
initRockTables(deck, "ROCK2D", m_rock2dTables );
@@ -234,6 +239,7 @@ namespace Opm {
if (data.jfunc)
jfunc = std::make_shared<JFunc>(*data.jfunc);
m_rtemp = data.m_rtemp;
m_salinity = data.m_salinity;
gasDenT = data.gasDenT;
oilDenT = data.oilDenT;
watDenT = data.watDenT;
@@ -285,6 +291,7 @@ namespace Opm {
result.stcond = StandardCond::serializeObject();
result.m_gas_comp_index = 77;
result.m_rtemp = 1.0;
result.m_salinity = 1.0;
result.m_tlmixpar = TLMixpar::serializeObject();
return result;
}
@@ -1131,6 +1138,10 @@ namespace Opm {
return this->m_rtemp;
}
double TableManager::salinity() const {
return this->m_salinity;
}
std::size_t TableManager::gas_comp_index() const {
return this->m_gas_comp_index;
}
@@ -1180,6 +1191,7 @@ namespace Opm {
stcond == data.stcond &&
jfuncOk &&
m_rtemp == data.m_rtemp &&
m_salinity == data.m_salinity &&
m_gas_comp_index == data.m_gas_comp_index;
}
@@ -0,0 +1,14 @@
{
"name": "SALINITY",
"sections": [
"PROPS"
],
"size": 1,
"items": [
{
"name": "MOLALITY",
"value_type": "DOUBLE",
"default": 0.0
}
]
}
@@ -1065,6 +1065,7 @@ set( keywords
001_Eclipse300/O/OPTIONS3
001_Eclipse300/P/PREF
001_Eclipse300/P/PREFS
001_Eclipse300/S/SALINITY
001_Eclipse300/S/STCOND
001_Eclipse300/T/TEMPI
001_Eclipse300/T/TEMPVD