compute ref densities based on std conditions in co2/brine pvt modules

This commit is contained in:
Tor Harald Sandve 2022-04-12 07:41:54 +02:00
parent d5b6152d6d
commit 39712270b5
3 changed files with 29 additions and 7 deletions

View File

@ -91,19 +91,16 @@ int main(int argc, char **argv)
if (argc > 6)
rs = atof(argv[6]);
//double p_ref = 101325;
//double T_ref = 298; // 25C
std::vector<double> ref_den_co2 = {1.80914};
std::vector<double> ref_den_water = {996.206};
Opm::Co2GasPvt<double> co2Pvt(ref_den_co2);
size_t num_regions = 1;
Opm::Co2GasPvt<double> co2Pvt(num_regions);
const double MmNaCl = 58e-3; // molar mass of NaCl [kg/mol]
// convert to mass fraction
std::vector<double> salinity = {0.0};
if (molality > 0.0)
salinity[0] = 1 / ( 1 + 1 / (molality*MmNaCl));
Opm::BrineCo2Pvt<double> brineCo2Pvt(ref_den_water, ref_den_co2, salinity);
Opm::BrineCo2Pvt<double> brineCo2Pvt(salinity);
double value;
if (prop == "density") {
if (phase == "CO2") {

View File

@ -87,6 +87,21 @@ public:
{
Brine::salinity = salinity[0];
}
BrineCo2Pvt(const std::vector<Scalar>& salinity,
Scalar T_ref = 288.71, //(273.15 + 15.56)
Scalar P_ref = 101325)
: salinity_(salinity)
{
int num_regions = salinity_.size();
co2ReferenceDensity_.resize(num_regions);
brineReferenceDensity_.resize(num_regions);
for (int i = 0; i < num_regions; ++i) {
co2ReferenceDensity_[i] = CO2::gasDensity(T_ref, P_ref, true);
brineReferenceDensity_[i] = Brine::liquidDensity(T_ref, P_ref, true);
}
Brine::salinity = salinity[0];
}
#if HAVE_ECL_INPUT
/*!
* \brief Initialize the parameters for Brine-CO2 system using an ECL deck.

View File

@ -68,6 +68,16 @@ public:
: gasReferenceDensity_(gasReferenceDensity)
{
}
Co2GasPvt(size_t numRegions,
Scalar T_ref = 288.71, //(273.15 + 15.56)
Scalar P_ref = 101325)
{
setNumRegions(numRegions);
for (size_t i = 0; i < numRegions; ++i) {
gasReferenceDensity_[i] = CO2::gasDensity(T_ref, P_ref, true);
}
}
#if HAVE_ECL_INPUT
/*!
* \brief Initialize the parameters for co2 gas using an ECL deck.