mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
avoid nan in the density calculation
This commit is contained in:
parent
5267f3cf17
commit
775573e3b2
@ -2338,10 +2338,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