mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Fix reference pressure for oil-water problem
In opm-material the wetting phase is the reference phase for two-phase problems i.e water for oil-water system, but for flow it is always oil. Add oil capillary pressure value to shift the reference phase to oil
This commit is contained in:
parent
5641876d1d
commit
3247aaa557
@ -139,6 +139,7 @@ namespace Opm
|
|||||||
assert(cells != 0);
|
assert(cells != 0);
|
||||||
|
|
||||||
const int np = numPhases();
|
const int np = numPhases();
|
||||||
|
|
||||||
if (dpcds) {
|
if (dpcds) {
|
||||||
ExplicitArraysSatDerivativesFluidState fluidState(phaseUsage_);
|
ExplicitArraysSatDerivativesFluidState fluidState(phaseUsage_);
|
||||||
typedef ExplicitArraysSatDerivativesFluidState::Evaluation Evaluation;
|
typedef ExplicitArraysSatDerivativesFluidState::Evaluation Evaluation;
|
||||||
@ -153,10 +154,13 @@ namespace Opm
|
|||||||
// copy the values calculated using opm-material to the target arrays
|
// copy the values calculated using opm-material to the target arrays
|
||||||
for (int pcPhaseIdx = 0; pcPhaseIdx < np; ++pcPhaseIdx) {
|
for (int pcPhaseIdx = 0; pcPhaseIdx < np; ++pcPhaseIdx) {
|
||||||
double sign = (pcPhaseIdx == BlackoilPhases::Aqua)? -1.0 : 1.0;
|
double sign = (pcPhaseIdx == BlackoilPhases::Aqua)? -1.0 : 1.0;
|
||||||
pc[np*i + pcPhaseIdx] = sign*capillaryPressures[pcPhaseIdx].value;
|
// in opm-material the wetting phase is the reference phase
|
||||||
|
// for two-phase problems i.e water for oil-water system,
|
||||||
|
// but for flow it is always oil. Add oil (liquid) capillary pressure value
|
||||||
|
// to shift the reference phase to oil
|
||||||
|
pc[np*i + pcPhaseIdx] = capillaryPressures[BlackoilPhases::Liquid].value + sign * capillaryPressures[pcPhaseIdx].value;
|
||||||
for (int satPhaseIdx = 0; satPhaseIdx < np; ++satPhaseIdx)
|
for (int satPhaseIdx = 0; satPhaseIdx < np; ++satPhaseIdx)
|
||||||
dpcds[np*np*i + satPhaseIdx*np + pcPhaseIdx] = sign*capillaryPressures[pcPhaseIdx].derivatives[satPhaseIdx];
|
dpcds[np*np*i + satPhaseIdx*np + pcPhaseIdx] = capillaryPressures[BlackoilPhases::Liquid].derivatives[satPhaseIdx] + sign * capillaryPressures[pcPhaseIdx].derivatives[satPhaseIdx];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -172,7 +176,11 @@ namespace Opm
|
|||||||
// copy the values calculated using opm-material to the target arrays
|
// copy the values calculated using opm-material to the target arrays
|
||||||
for (int pcPhaseIdx = 0; pcPhaseIdx < np; ++pcPhaseIdx) {
|
for (int pcPhaseIdx = 0; pcPhaseIdx < np; ++pcPhaseIdx) {
|
||||||
double sign = (pcPhaseIdx == BlackoilPhases::Aqua)? -1.0 : 1.0;
|
double sign = (pcPhaseIdx == BlackoilPhases::Aqua)? -1.0 : 1.0;
|
||||||
pc[np*i + pcPhaseIdx] = sign*capillaryPressures[pcPhaseIdx];
|
// in opm-material the wetting phase is the reference phase
|
||||||
|
// for two-phase problems i.e water for oil-water system,
|
||||||
|
// but for flow it is always oil. Add oil (liquid) capillary pressure value
|
||||||
|
// to shift the reference phase to oil
|
||||||
|
pc[np*i + pcPhaseIdx] = capillaryPressures[BlackoilPhases::Liquid] + sign * capillaryPressures[pcPhaseIdx];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user