Guard against "too small" max saturation.

This parameter might well be user configurable ...
This commit is contained in:
osae 2014-08-12 19:42:30 +02:00
parent 64231809f5
commit ca046987a7
2 changed files with 4 additions and 2 deletions

View File

@ -208,6 +208,7 @@ namespace Opm
"Inconsistent number of phases in pvt data (" << phase_usage_.num_phases "Inconsistent number of phases in pvt data (" << phase_usage_.num_phases
<< ") and saturation-dependent function data (" << satprops_->numPhases() << ")."); << ") and saturation-dependent function data (" << satprops_->numPhases() << ").");
} }
vap_satmax_guard_ = 0.01;
} }
//////////////////////////// ////////////////////////////
@ -1081,7 +1082,7 @@ namespace Opm
const int n = cells.size(); const int n = cells.size();
V factor = V::Ones(n, 1); V factor = V::Ones(n, 1);
for (int i=0; i<n; ++i) { for (int i=0; i<n; ++i) {
if (satOilMax_[cells[i]] > 0.01 && so[i] < satOilMax_[cells[i]]) { if (satOilMax_[cells[i]] > vap_satmax_guard_ && so[i] < satOilMax_[cells[i]]) {
factor[i] = std::pow(so[i]/satOilMax_[cells[i]], vap); factor[i] = std::pow(so[i]/satOilMax_[cells[i]], vap);
} }
} }
@ -1104,7 +1105,7 @@ namespace Opm
V factor = V::Ones(n, 1); V factor = V::Ones(n, 1);
//V dfactor_dso = V::Zero(n, 1); TODO: Consider effect of complete jacobian (including so-derivatives) //V dfactor_dso = V::Zero(n, 1); TODO: Consider effect of complete jacobian (including so-derivatives)
for (int i=0; i<n; ++i) { for (int i=0; i<n; ++i) {
if (satOilMax_[cells[i]] > 0.01 && so.value()[i] < satOilMax_[cells[i]]) { if (satOilMax_[cells[i]] > vap_satmax_guard_ && so.value()[i] < satOilMax_[cells[i]]) {
factor[i] = std::pow(so.value()[i]/satOilMax_[cells[i]], vap); factor[i] = std::pow(so.value()[i]/satOilMax_[cells[i]], vap);
//dfactor_dso[i] = vap*std::pow(so.value()[i]/satOilMax_[cells[i]], vap-1.0)/satOilMax_[cells[i]]; //dfactor_dso[i] = vap*std::pow(so.value()[i]/satOilMax_[cells[i]], vap-1.0)/satOilMax_[cells[i]];
} }

View File

@ -435,6 +435,7 @@ namespace Opm
double vap1_; double vap1_;
double vap2_; double vap2_;
std::vector<double> satOilMax_; std::vector<double> satOilMax_;
double vap_satmax_guard_; //Threshold value to promote stability
}; };
} // namespace Opm } // namespace Opm