mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Fix bug in use of capillary pressure.
Pcow must be subtracted, not added to oil pressure to obtain water pressure.
This commit is contained in:
parent
4b4bb07d71
commit
17400cebaf
@ -56,6 +56,12 @@
|
|||||||
<< foo.value() << std::endl; \
|
<< foo.value() << std::endl; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
#define DISKVAL(foo) \
|
||||||
|
do { \
|
||||||
|
std::ofstream os(#foo); \
|
||||||
|
os.precision(16); \
|
||||||
|
os << foo.value() << std::endl; \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
namespace Opm {
|
namespace Opm {
|
||||||
@ -1573,9 +1579,17 @@ namespace {
|
|||||||
pressure[phaseIdx] = pressure[phaseIdx] - pressure[BlackoilPhases::Liquid];
|
pressure[phaseIdx] = pressure[phaseIdx] - pressure[BlackoilPhases::Liquid];
|
||||||
}
|
}
|
||||||
|
|
||||||
// add the total pressure to the capillary pressures
|
// Since pcow = po - pw, but pcog = pg - po,
|
||||||
|
// we have
|
||||||
|
// pw = po - pcow
|
||||||
|
// pg = po + pcgo
|
||||||
|
// This is an unfortunate inconsistency, but a convention we must handle.
|
||||||
for (int phaseIdx = 0; phaseIdx < BlackoilPhases::MaxNumPhases; ++phaseIdx) {
|
for (int phaseIdx = 0; phaseIdx < BlackoilPhases::MaxNumPhases; ++phaseIdx) {
|
||||||
pressure[phaseIdx] += state.pressure;
|
if (phaseIdx == BlackoilPhases::Aqua) {
|
||||||
|
pressure[phaseIdx] = state.pressure - pressure[phaseIdx];
|
||||||
|
} else {
|
||||||
|
pressure[phaseIdx] += state.pressure;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return pressure;
|
return pressure;
|
||||||
|
Loading…
Reference in New Issue
Block a user