Merge pull request #495 from osae/endscale

Endpoint scaling and hysteresis for gwseg.
This commit is contained in:
Atgeirr Flø Rasmussen 2014-03-04 10:29:50 +01:00
commit b40d2e63d0
3 changed files with 17 additions and 2 deletions

View File

@ -76,8 +76,8 @@ namespace Opm
// Unfortunate lack of pointer smartness here... // Unfortunate lack of pointer smartness here...
const int sat_samples = param.getDefault("sat_tab_size", 0); const int sat_samples = param.getDefault("sat_tab_size", 0);
std::string threephase_model = param.getDefault<std::string>("threephase_model", "simple"); std::string threephase_model = param.getDefault<std::string>("threephase_model", "simple");
if (deck.hasField("ENDSCALE") && threephase_model != "simple") { if (deck.hasField("ENDSCALE") && threephase_model != "gwseg") {
OPM_THROW(std::runtime_error, "Sorry, end point scaling currently available for the 'simple' model only."); OPM_THROW(std::runtime_error, "Sorry, end point scaling currently available for the 'gwseg' model only.");
} }
if (sat_samples > 1) { if (sat_samples > 1) {
if (threephase_model == "stone2") { if (threephase_model == "stone2") {

View File

@ -1103,6 +1103,13 @@ namespace Opm
{ {
if (scr.empty() && su.empty() && (sxcr.empty() || !do_3pt_) && s0.empty()) { if (scr.empty() && su.empty() && (sxcr.empty() || !do_3pt_) && s0.empty()) {
data.doNotScale = true; data.doNotScale = true;
data.smin = sl_tab;
if (oil) {
data.smax = (s0_tab < 0.0) ? 1.0 - su_tab : 1.0 - su_tab - s0_tab;
} else {
data.smax = su_tab;
}
data.scr = scr_tab;
} else { } else {
data.doNotScale = false; data.doNotScale = false;
data.do_3pt = do_3pt_; data.do_3pt = do_3pt_;

View File

@ -74,6 +74,14 @@ namespace Opm
double* smin, double* smin,
double* smax) const = 0; double* smax) const = 0;
/// Update saturation state for the hysteresis tracking
/// \param[in] n Number of data points.
/// \param[in] s Array of nP saturation values.
virtual void updateSatHyst(const int n,
const int* cells,
const double* s) = 0;
}; };