mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Ignore limits to rs and rv changes.
As implemented with a relative limit, even with 1e9 default limit it would still be impossible to get away from a zero value. It is possible that the limits may return later, implemented in a less buggy way, however for now they do not seem necessary.
This commit is contained in:
@@ -888,20 +888,24 @@ namespace Opm {
|
|||||||
double& rs = state_.reservoir_state.gasoilratio()[cell];
|
double& rs = state_.reservoir_state.gasoilratio()[cell];
|
||||||
const double rs_old = rs;
|
const double rs_old = rs;
|
||||||
if (hcstate == HydroCarbonState::OilOnly) {
|
if (hcstate == HydroCarbonState::OilOnly) {
|
||||||
const double max_allowed_change = std::fabs(rs_old) * Base::drMaxRel();
|
// const double max_allowed_change = std::fabs(rs_old) * Base::drMaxRel();
|
||||||
const double drs = dx[1];
|
const double drs = dx[1];
|
||||||
const double factor = std::min(1.0, max_allowed_change / std::fabs(drs));
|
// const double factor = std::min(1.0, max_allowed_change / std::fabs(drs));
|
||||||
rs += factor*drs;
|
// rs += factor*drs;
|
||||||
|
rs += drs;
|
||||||
|
rs = std::max(rs, 0.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update rv.
|
// Update rv.
|
||||||
double& rv = state_.reservoir_state.rv()[cell];
|
double& rv = state_.reservoir_state.rv()[cell];
|
||||||
const double rv_old = rv;
|
const double rv_old = rv;
|
||||||
if (hcstate == HydroCarbonState::GasOnly) {
|
if (hcstate == HydroCarbonState::GasOnly) {
|
||||||
const double max_allowed_change = std::fabs(rv_old) * Base::drMaxRel();
|
// const double max_allowed_change = std::fabs(rv_old) * Base::drMaxRel();
|
||||||
const double drv = dx[1];
|
const double drv = dx[1];
|
||||||
const double factor = std::min(1.0, max_allowed_change / std::fabs(drv));
|
// const double factor = std::min(1.0, max_allowed_change / std::fabs(drv));
|
||||||
rv += factor*drv;
|
// rv += factor*drv;
|
||||||
|
rv += drv;
|
||||||
|
rv = std::max(rv, 0.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
const double epsilon = std::sqrt(std::numeric_limits<double>::epsilon());
|
const double epsilon = std::sqrt(std::numeric_limits<double>::epsilon());
|
||||||
|
|||||||
Reference in New Issue
Block a user