Merge pull request #638 from totto82/fix_GOC_below
Currectly handling GOC below and WOC above the reservoir
This commit is contained in:
		@@ -394,23 +394,40 @@ namespace Opm
 | 
			
		||||
 | 
			
		||||
                assign(G, opress, z0, cells, press);
 | 
			
		||||
 | 
			
		||||
                // Default pressure at WOC and GOC to -inf
 | 
			
		||||
                po_woc = -std::numeric_limits<double>::max();
 | 
			
		||||
                po_goc = -std::numeric_limits<double>::max();
 | 
			
		||||
 | 
			
		||||
                const double inf = std::numeric_limits<double>::max();
 | 
			
		||||
                const double woc = reg.zwoc();
 | 
			
		||||
                // Compute Oil pressure at WOC,
 | 
			
		||||
                // if WOC is within the reservoir.
 | 
			
		||||
                if ( ( woc > span[0] ) && ( woc < span[1] ) ){
 | 
			
		||||
 | 
			
		||||
                // 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
 | 
			
		||||
                    else               { po_woc = p0;             } // WOC *at*  datum
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                const double goc = reg.zgoc();
 | 
			
		||||
                // Compute Oil pressure at GOC,
 | 
			
		||||
                // if GOC is within the reservoir.
 | 
			
		||||
                if ( ( goc > span[0] ) && ( goc < span[1] ) ){
 | 
			
		||||
 | 
			
		||||
                // 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
 | 
			
		||||
                    else               { po_goc = p0;             } // GOC *at*  datum
 | 
			
		||||
@@ -484,9 +501,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<double>::max() ){
 | 
			
		||||
                    PhasePressure::water(G, reg, span, grav, po_woc,
 | 
			
		||||
                                         cells, press[ wix ]);
 | 
			
		||||
                } else {
 | 
			
		||||
@@ -498,10 +515,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<double>::max()){
 | 
			
		||||
                    PhasePressure::gas(G, reg, span, grav, po_goc,
 | 
			
		||||
                                       cells, press[ gix ]);
 | 
			
		||||
                } else {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user