mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #1901 from totto82/fixMSWThrow
Make sure rvmax and rsmax is non-negtive in the getSurfaceVolume for MSW
This commit is contained in:
commit
dfe22cb1a4
@ -2172,7 +2172,10 @@ namespace Opm
|
|||||||
const unsigned gasCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::gasCompIdx);
|
const unsigned gasCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::gasCompIdx);
|
||||||
if (FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx)) {
|
if (FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx)) {
|
||||||
const unsigned oilCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::oilCompIdx);
|
const unsigned oilCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::oilCompIdx);
|
||||||
const EvalWell rvmax = FluidSystem::gasPvt().saturatedOilVaporizationFactor(pvt_region_index, temperature, seg_pressure);
|
EvalWell rvmax = FluidSystem::gasPvt().saturatedOilVaporizationFactor(pvt_region_index, temperature, seg_pressure);
|
||||||
|
if (rvmax < 0.0) { // negative rvmax can happen if the seg_pressure is outside the range of the table
|
||||||
|
rvmax = 0.0;
|
||||||
|
}
|
||||||
if (mix_s[oilCompIdx] > 0.0) {
|
if (mix_s[oilCompIdx] > 0.0) {
|
||||||
if (mix_s[gasCompIdx] > 0.0) {
|
if (mix_s[gasCompIdx] > 0.0) {
|
||||||
rv = mix_s[oilCompIdx] / mix_s[gasCompIdx];
|
rv = mix_s[oilCompIdx] / mix_s[gasCompIdx];
|
||||||
@ -2200,7 +2203,10 @@ namespace Opm
|
|||||||
const unsigned oilCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::oilCompIdx);
|
const unsigned oilCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::oilCompIdx);
|
||||||
if (FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx)) {
|
if (FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx)) {
|
||||||
const unsigned gasCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::gasCompIdx);
|
const unsigned gasCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::gasCompIdx);
|
||||||
const EvalWell rsmax = FluidSystem::oilPvt().saturatedGasDissolutionFactor(pvt_region_index, temperature, seg_pressure);
|
EvalWell rsmax = FluidSystem::oilPvt().saturatedGasDissolutionFactor(pvt_region_index, temperature, seg_pressure);
|
||||||
|
if (rsmax < 0.0) { // negative rsmax can happen if the seg_pressure is outside the range of the table
|
||||||
|
rsmax = 0.0;
|
||||||
|
}
|
||||||
if (mix_s[gasCompIdx] > 0.0) {
|
if (mix_s[gasCompIdx] > 0.0) {
|
||||||
if (mix_s[oilCompIdx] > 0.0) {
|
if (mix_s[oilCompIdx] > 0.0) {
|
||||||
rs = mix_s[gasCompIdx] / mix_s[oilCompIdx];
|
rs = mix_s[gasCompIdx] / mix_s[oilCompIdx];
|
||||||
|
Loading…
Reference in New Issue
Block a user