added Rvw argument for gas inverseFormationVolumeFactor function

This commit is contained in:
Paul Egberts 2022-06-13 15:04:40 +02:00
parent dcc6eb2e0c
commit 0168b7719f
3 changed files with 7 additions and 6 deletions

View File

@ -272,9 +272,10 @@ public:
else {
Evaluation Tref = gasdentRefTemp_[regionIdx];
Evaluation Pref = gasJTRefPres_[regionIdx];
Scalar JTC = gasJTC_[regionIdx]; // if JTC = 999 (default) then JTC calculated
Scalar JTC = gasJTC_[regionIdx]; // if JTC is default then JTC is calculated
Evaluation Rvw = 0.0;
Evaluation invB = inverseFormationVolumeFactor(regionIdx, temperature, pressure, Rv);
Evaluation invB = inverseFormationVolumeFactor(regionIdx, temperature, pressure, Rv, Rvw);
const Scalar hVap = 480.6e3; // [J / kg]
Evaluation Cp = (internalEnergyCurves_[regionIdx].eval(temperature, /*extrapolate=*/true) - hVap)/temperature;
Evaluation density = invB * (gasReferenceDensity(regionIdx) + Rv * rhoRefO_[regionIdx]);
@ -286,7 +287,7 @@ public:
else if(enableThermalDensity_) {
Scalar c1T = gasdentCT1_[regionIdx];
Scalar c2T = gasdentCT2_[regionIdx];
Evaluation alpha = (c1T + 2 * c2T * (temperature - Tref)) /
(1 + c1T *(temperature - Tref) + c2T * (temperature - Tref) * (temperature - Tref));
@ -295,7 +296,7 @@ public:
Evaluation enthalpyPresPrev = 0;
for (size_t i = 0; i < N; ++i) {
Evaluation Pnew = Pref + i * deltaP;
Evaluation rho = inverseFormationVolumeFactor(regionIdx, temperature, Pnew, Rv) *
Evaluation rho = inverseFormationVolumeFactor(regionIdx, temperature, Pnew, Rv, Rvw) *
(gasReferenceDensity(regionIdx) + Rv * rhoRefO_[regionIdx]);
// see e.g.https://en.wikipedia.org/wiki/Joule-Thomson_effect for a derivation of the Joule-Thomson coeff.
Evaluation jouleThomsonCoefficient = -(1.0/Cp) * (1.0 - alpha * temperature)/rho;

View File

@ -293,7 +293,7 @@ public:
else {
Evaluation Tref = oildentRefTemp_[regionIdx];
Evaluation Pref = oilJTRefPres_[regionIdx];
Scalar JTC = oilJTC_[regionIdx]; // if JTC = 999 (default) then JTC calculated
Scalar JTC = oilJTC_[regionIdx]; // if JTC is default then JTC is calculated
Evaluation invB = inverseFormationVolumeFactor(regionIdx, temperature, pressure, Rs);
Evaluation Cp = internalEnergyCurves_[regionIdx].eval(temperature, /*extrapolate=*/true)/temperature;

View File

@ -297,7 +297,7 @@ public:
else {
Evaluation Tref = watdentRefTemp_[regionIdx];
Evaluation Pref = watJTRefPres_[regionIdx];
Scalar JTC =watJTC_[regionIdx]; // if JTC = 999 (default) then JTC calculated
Scalar JTC =watJTC_[regionIdx]; // if JTC is default then JTC is calculated
Evaluation invB = inverseFormationVolumeFactor(regionIdx, temperature, pressure, saltconcentration);
Evaluation Cp = internalEnergyCurves_[regionIdx].eval(temperature, /*extrapolate=*/true)/temperature;