From 704e7dbb581aff07f291330a69a52c0e5650a3d6 Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Wed, 27 Aug 2014 09:46:14 +0200 Subject: [PATCH 1/2] Currectly handling GOC below and WOC above the reservoir The phase pressure of water and gas is set to inf when WOC and GOC is above and below the reservoir. This make sure the minimum saturation values are picked for these cases. --- opm/core/simulator/initStateEquil_impl.hpp | 31 +++++++++++----------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/opm/core/simulator/initStateEquil_impl.hpp b/opm/core/simulator/initStateEquil_impl.hpp index 84e14667..f8092bbd 100644 --- a/opm/core/simulator/initStateEquil_impl.hpp +++ b/opm/core/simulator/initStateEquil_impl.hpp @@ -394,14 +394,12 @@ namespace Opm assign(G, opress, z0, cells, press); - // Default pressure at WOC and GOC to -inf - po_woc = -std::numeric_limits::max(); - po_goc = -std::numeric_limits::max(); - const double woc = reg.zwoc(); // Compute Oil pressure at WOC, - // if WOC is within the reservoir. - if ( ( woc > span[0] ) && ( woc < span[1] ) ){ + if ( woc > span[1] ) { po_woc = std::numeric_limits::max(); } // WOC above reservoir (model is entirely water filled) + else if ( woc < span[0] ) { po_woc = -std::numeric_limits::max(); } // WOC below reservoir + else{ + // if WOC is within the reservoir. if (z0 > woc) { po_woc = opress[0](woc); } // WOC above datum else if (z0 < woc) { po_woc = opress[1](woc); } // WOC below datum else { po_woc = p0; } // WOC *at* datum @@ -409,8 +407,10 @@ namespace Opm const double goc = reg.zgoc(); // Compute Oil pressure at GOC, - // if GOC is within the reservoir. - if ( ( goc > span[0] ) && ( goc < span[1] ) ){ + if ( goc > span[1] ) { po_goc = -std::numeric_limits::max(); } // GOC above reservoir + else if ( goc < span[0] ) { po_goc = std::numeric_limits::max(); } // GOC below reservoir (model is entirely gas filled) + else{ + // if GOC is within the reservoir. if (z0 > goc) { po_goc = opress[0](goc); } // GOC above datum else if (z0 < goc) { po_goc = opress[1](goc); } // GOC below datum else { po_goc = p0; } // GOC *at* datum @@ -484,9 +484,9 @@ namespace Opm const int wix = PhaseIndex::water(pu); // If woc is above or below the reservoar, - // po_woc is -inf and the water pressure - // is set to -inf. - if ( po_woc > 0 ){ + // po_woc is set to inf and -inf, respectivly + // and so is the water pressure + if ( std::abs(po_woc) < std::numeric_limits::max() ){ PhasePressure::water(G, reg, span, grav, po_woc, cells, press[ wix ]); } else { @@ -498,10 +498,11 @@ namespace Opm if (PhaseUsed::gas(pu)) { const int gix = PhaseIndex::gas(pu); - // If woc is above or below the reservoar, - // po_woc is -inf and the water pressure - // is set to -inf. - if (po_goc > 0){ + // If goc is above or below the reservoar, + // po_goc is set to -inf and inf, respectivly + // and so is the gas pressure + + if ( std::abs(po_goc) < std::numeric_limits::max()){ PhasePressure::gas(G, reg, span, grav, po_goc, cells, press[ gix ]); } else { From 37e526a04660e8ba69cd622cd0e48d720dde3749 Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Wed, 27 Aug 2014 14:35:01 +0200 Subject: [PATCH 2/2] Fix sign error in the specified oil pressures at at WOC and GOC The oil pressure at the contact for the special cases: contact location po(contact) GOC above -inf GOC below +inf WOC above -inf WOC below +inf --- opm/core/simulator/initStateEquil_impl.hpp | 33 ++++++++++++++++------ 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/opm/core/simulator/initStateEquil_impl.hpp b/opm/core/simulator/initStateEquil_impl.hpp index f8092bbd..fb5de4fa 100644 --- a/opm/core/simulator/initStateEquil_impl.hpp +++ b/opm/core/simulator/initStateEquil_impl.hpp @@ -394,11 +394,20 @@ namespace Opm assign(G, opress, z0, cells, press); + + const double inf = std::numeric_limits::max(); const double woc = reg.zwoc(); - // Compute Oil pressure at WOC, - if ( woc > span[1] ) { po_woc = std::numeric_limits::max(); } // WOC above reservoir (model is entirely water filled) - else if ( woc < span[0] ) { po_woc = -std::numeric_limits::max(); } // WOC below reservoir - else{ + + // Oil pressure at WOC, Pc_ow = Po - Pw, dPc_ow/dSw <= 0 + if ( woc < span[0] ) { + // WOC above reservoir (model entirely water filled) + po_woc = - inf; + } + else if ( woc > span[1] ) { + // WOC below reservoir (no mobile water) + po_woc = inf; + } + else { // if WOC is within the reservoir. if (z0 > woc) { po_woc = opress[0](woc); } // WOC above datum else if (z0 < woc) { po_woc = opress[1](woc); } // WOC below datum @@ -406,10 +415,18 @@ namespace Opm } const double goc = reg.zgoc(); - // Compute Oil pressure at GOC, - if ( goc > span[1] ) { po_goc = -std::numeric_limits::max(); } // GOC above reservoir - else if ( goc < span[0] ) { po_goc = std::numeric_limits::max(); } // GOC below reservoir (model is entirely gas filled) - else{ + + // Oil pressure at GOC, Pc_go = Pg - Po, dPc_go/dSg >= 0 + if ( goc < span[0] ) { + // GOC above reservoir (no gas phase) + po_goc = -inf; + } + + else if ( goc > span[1] ) { + // GOC below reservoir (model entirely gas filled) + po_goc = inf; + } + else { // if GOC is within the reservoir. if (z0 > goc) { po_goc = opress[0](goc); } // GOC above datum else if (z0 < goc) { po_goc = opress[1](goc); } // GOC below datum