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; \
|
||||
} while (0)
|
||||
|
||||
#define DISKVAL(foo) \
|
||||
do { \
|
||||
std::ofstream os(#foo); \
|
||||
os.precision(16); \
|
||||
os << foo.value() << std::endl; \
|
||||
} while (0)
|
||||
|
||||
|
||||
namespace Opm {
|
||||
@ -1573,10 +1579,18 @@ namespace {
|
||||
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) {
|
||||
if (phaseIdx == BlackoilPhases::Aqua) {
|
||||
pressure[phaseIdx] = state.pressure - pressure[phaseIdx];
|
||||
} else {
|
||||
pressure[phaseIdx] += state.pressure;
|
||||
}
|
||||
}
|
||||
|
||||
return pressure;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user