mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
threshold pressures: consider the saturated case and fix a typo
the typo was caused the surface density of the oil phase to be used instead of the one of gas. This caused the density to be off by a factor of typically about 900. using saturated FVFs does not change much, but it does not hurt because it is also done that way in the simulator. This makes the defaults for the threshold pressures reasonable again, but for some reason they are not exactly the same as in the old implementation. (although the differences are very tolerable.) On the question why only "Model 2" is affected by this: the other decks don't use threshold pressures (SPE-X) or do not default any values (Norne).
This commit is contained in:
parent
1f1dfbfc65
commit
bf283f8684
@ -198,18 +198,25 @@ void computeMaxDp(std::map<std::pair<int, int>, double>& maxDp,
|
|||||||
double T = initialState.temperature()[cellIdx];
|
double T = initialState.temperature()[cellIdx];
|
||||||
double p = initialState.pressure()[cellIdx];
|
double p = initialState.pressure()[cellIdx];
|
||||||
double Rs = initialState.gasoilratio()[cellIdx];
|
double Rs = initialState.gasoilratio()[cellIdx];
|
||||||
double b = pvto.inverseFormationVolumeFactor(pvtRegionIdx, T, p, Rs);
|
double RsSat = pvto.saturatedGasDissolutionFactor(pvtRegionIdx, T, p);
|
||||||
|
|
||||||
rho[opos][cellIdx] = surfaceDensity[pvtRegionIdx][opos]*b;
|
if (Rs >= RsSat) {
|
||||||
if (pu.phase_used[BlackoilPhases::Vapour]) {
|
double b = pvto.saturatedInverseFormationVolumeFactor(pvtRegionIdx, T, p);
|
||||||
int gpos = pu.phase_pos[BlackoilPhases::Vapour];
|
rho[opos][cellIdx] = surfaceDensity[pvtRegionIdx][opos]*b;
|
||||||
rho[opos][cellIdx] += surfaceDensity[pvtRegionIdx][gpos]*Rs*b;
|
}
|
||||||
|
else {
|
||||||
|
double b = pvto.inverseFormationVolumeFactor(pvtRegionIdx, T, p, Rs);
|
||||||
|
rho[opos][cellIdx] = surfaceDensity[pvtRegionIdx][opos]*b;
|
||||||
|
if (pu.phase_used[BlackoilPhases::Vapour]) {
|
||||||
|
int gpos = pu.phase_pos[BlackoilPhases::Vapour];
|
||||||
|
rho[opos][cellIdx] += surfaceDensity[pvtRegionIdx][gpos]*Rs*b;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pu.phase_used[BlackoilPhases::Vapour]) {
|
if (pu.phase_used[BlackoilPhases::Vapour]) {
|
||||||
const int gpos = pu.phase_pos[BlackoilPhases::Liquid];
|
const int gpos = pu.phase_pos[BlackoilPhases::Vapour];
|
||||||
const auto& pvtg = props.gasPvt();
|
const auto& pvtg = props.gasPvt();
|
||||||
for (int cellIdx = 0; cellIdx < numCells; ++ cellIdx) {
|
for (int cellIdx = 0; cellIdx < numCells; ++ cellIdx) {
|
||||||
int pvtRegionIdx = pvtRegion[cellIdx];
|
int pvtRegionIdx = pvtRegion[cellIdx];
|
||||||
@ -217,12 +224,20 @@ void computeMaxDp(std::map<std::pair<int, int>, double>& maxDp,
|
|||||||
double T = initialState.temperature()[cellIdx];
|
double T = initialState.temperature()[cellIdx];
|
||||||
double p = initialState.pressure()[cellIdx];
|
double p = initialState.pressure()[cellIdx];
|
||||||
double Rv = initialState.rv()[cellIdx];
|
double Rv = initialState.rv()[cellIdx];
|
||||||
double b = pvtg.inverseFormationVolumeFactor(pvtRegionIdx, T, p, Rv);
|
double RvSat = pvtg.saturatedOilVaporizationFactor(pvtRegionIdx, T, p);
|
||||||
|
|
||||||
rho[gpos][cellIdx] = surfaceDensity[pvtRegionIdx][gpos]*b;
|
if (Rv >= RvSat) {
|
||||||
if (pu.phase_used[BlackoilPhases::Liquid]) {
|
double b = pvtg.saturatedInverseFormationVolumeFactor(pvtRegionIdx, T, p);
|
||||||
int opos = pu.phase_pos[BlackoilPhases::Liquid];
|
rho[gpos][cellIdx] = surfaceDensity[pvtRegionIdx][gpos]*b;
|
||||||
rho[gpos][cellIdx] += surfaceDensity[pvtRegionIdx][opos]*Rv*b;
|
}
|
||||||
|
else {
|
||||||
|
double b = pvtg.inverseFormationVolumeFactor(pvtRegionIdx, T, p, Rv);
|
||||||
|
rho[gpos][cellIdx] = surfaceDensity[pvtRegionIdx][gpos]*b;
|
||||||
|
|
||||||
|
if (pu.phase_used[BlackoilPhases::Liquid]) {
|
||||||
|
int opos = pu.phase_pos[BlackoilPhases::Liquid];
|
||||||
|
rho[gpos][cellIdx] += surfaceDensity[pvtRegionIdx][opos]*Rv*b;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user