Fixes issues pointed out in the PR comments

This commit is contained in:
Tor Harald Sandve 2014-08-18 08:57:23 +02:00 committed by Andreas Lauser
parent b1d20aa83d
commit ba54cd84c2

View File

@ -401,7 +401,7 @@ namespace Opm
const double woc = reg.zwoc(); const double woc = reg.zwoc();
// Compute Oil pressure at WOC, // Compute Oil pressure at WOC,
// if WOC is within the reservoir. // if WOC is within the reservoir.
if ( ( woc > span[0] ) & ( woc < span[1] ) ){ if ( ( woc > span[0] ) && ( woc < span[1] ) ){
if (z0 > woc) { po_woc = opress[0](woc); } // WOC above datum if (z0 > woc) { po_woc = opress[0](woc); } // WOC above datum
else if (z0 < woc) { po_woc = opress[1](woc); } // WOC below datum else if (z0 < woc) { po_woc = opress[1](woc); } // WOC below datum
else { po_woc = p0; } // WOC *at* datum else { po_woc = p0; } // WOC *at* datum
@ -410,7 +410,7 @@ namespace Opm
const double goc = reg.zgoc(); const double goc = reg.zgoc();
// Compute Oil pressure at GOC, // Compute Oil pressure at GOC,
// if GOC is within the reservoir. // if GOC is within the reservoir.
if ( ( goc > span[0] ) & ( goc < span[1] ) ){ if ( ( goc > span[0] ) && ( goc < span[1] ) ){
if (z0 > goc) { po_goc = opress[0](goc); } // GOC above datum if (z0 > goc) { po_goc = opress[0](goc); } // GOC above datum
else if (z0 < goc) { po_goc = opress[1](goc); } // GOC below datum else if (z0 < goc) { po_goc = opress[1](goc); } // GOC below datum
else { po_goc = p0; } // GOC *at* datum else { po_goc = p0; } // GOC *at* datum
@ -487,18 +487,12 @@ namespace Opm
// po_woc is -inf and the water pressure // po_woc is -inf and the water pressure
// is set to -inf. // is set to -inf.
if ( po_woc > 0 ){ if ( po_woc > 0 ){
PhasePressure::water(G, reg, span, grav, po_woc, PhasePressure::water(G, reg, span, grav, po_woc,
cells, press[ wix ]); cells, press[ wix ]);
} else { } else {
std::vector<double>::size_type local_index = 0; press[wix].assign(cells.size(),po_woc);
for (typename CellRange::const_iterator ci = cells.begin(); ci != cells.end(); ++ci, ++local_index) {
const int cell = *ci;
press[wix][cell] = po_woc;
}
} }
} }
if (PhaseUsed::gas(pu)) { if (PhaseUsed::gas(pu)) {
@ -508,15 +502,10 @@ namespace Opm
// po_woc is -inf and the water pressure // po_woc is -inf and the water pressure
// is set to -inf. // is set to -inf.
if (po_goc > 0){ if (po_goc > 0){
PhasePressure::gas(G, reg, span, grav, po_goc, PhasePressure::gas(G, reg, span, grav, po_goc,
cells, press[ gix ]); cells, press[ gix ]);
} else { } else {
std::vector<double>::size_type local_index = 0; press[gix].assign(cells.size(),po_goc);
for (typename CellRange::const_iterator ci = cells.begin(); ci != cells.end(); ++ci, ++local_index) {
const int cell = *ci;
press[gix][cell] = po_goc;
}
} }
} }