mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-18 21:43:27 -06:00
Computes saturations based on depths
For constant capillar pressure function the saturation is determined by cell depths: Sg_max, Sw_min ----- goc ---- Sg_min, Sw_min ----- woc ---- Sg_min, Sw_max
This commit is contained in:
parent
aed3add8ae
commit
bf635f3fe9
@ -745,6 +745,7 @@ namespace Opm
|
||||
const PcEq f(props, phase, cell, target_pc);
|
||||
const double f0 = f(s0);
|
||||
const double f1 = f(s1);
|
||||
|
||||
if (f0 <= 0.0) {
|
||||
return s0;
|
||||
} else if (f1 > 0.0) {
|
||||
@ -833,6 +834,46 @@ namespace Opm
|
||||
}
|
||||
}
|
||||
|
||||
/// Compute saturation from depth. Used for constant capillary pressure function
|
||||
inline double satFromDepth(const BlackoilPropertiesInterface& props,
|
||||
const double cellDepth,
|
||||
const double contactDepth,
|
||||
const int phase,
|
||||
const int cell,
|
||||
const bool increasing = false)
|
||||
{
|
||||
// Find minimum and maximum saturations.
|
||||
double sminarr[BlackoilPhases::MaxNumPhases];
|
||||
double smaxarr[BlackoilPhases::MaxNumPhases];
|
||||
props.satRange(1, &cell, sminarr, smaxarr);
|
||||
const double s0 = increasing ? smaxarr[phase] : sminarr[phase];
|
||||
const double s1 = increasing ? sminarr[phase] : smaxarr[phase];
|
||||
|
||||
if (cellDepth < contactDepth){
|
||||
return s0;
|
||||
} else {
|
||||
return s1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// Return true if capillary pressure function is constant
|
||||
bool isConstPc(const BlackoilPropertiesInterface& props,
|
||||
const int phase,
|
||||
const int cell)
|
||||
{
|
||||
// Find minimum and maximum saturations.
|
||||
double sminarr[BlackoilPhases::MaxNumPhases];
|
||||
double smaxarr[BlackoilPhases::MaxNumPhases];
|
||||
props.satRange(1, &cell, sminarr, smaxarr);
|
||||
|
||||
// Create the equation f(s) = pc(s);
|
||||
const PcEq f(props, phase, cell, 0);
|
||||
const double f0 = f(sminarr[phase]);
|
||||
const double f1 = f(smaxarr[phase]);
|
||||
return std::abs(f0 - f1 < std::numeric_limits<double>::epsilon());
|
||||
}
|
||||
|
||||
} // namespace Equil
|
||||
} // namespace Opm
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user