mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #2096 from totto82/avoid_nan_density
avoid nan in the density calculation
This commit is contained in:
commit
5d1e125ab9
@ -2344,10 +2344,10 @@ namespace Opm
|
|||||||
const unsigned oilpos = Indices::canonicalToActiveComponentIndex(FluidSystem::oilCompIdx);
|
const unsigned oilpos = Indices::canonicalToActiveComponentIndex(FluidSystem::oilCompIdx);
|
||||||
double rs = 0.0;
|
double rs = 0.0;
|
||||||
double rv = 0.0;
|
double rv = 0.0;
|
||||||
if (!rsmax_perf.empty() && mix[oilpos] > 0.0) {
|
if (!rsmax_perf.empty() && mix[oilpos] > 1e-12) {
|
||||||
rs = std::min(mix[gaspos]/mix[oilpos], rsmax_perf[perf]);
|
rs = std::min(mix[gaspos]/mix[oilpos], rsmax_perf[perf]);
|
||||||
}
|
}
|
||||||
if (!rvmax_perf.empty() && mix[gaspos] > 0.0) {
|
if (!rvmax_perf.empty() && mix[gaspos] > 1e-12) {
|
||||||
rv = std::min(mix[oilpos]/mix[gaspos], rvmax_perf[perf]);
|
rv = std::min(mix[oilpos]/mix[gaspos], rvmax_perf[perf]);
|
||||||
}
|
}
|
||||||
if (rs != 0.0) {
|
if (rs != 0.0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user