ebos: avoid potential division by zero in transmissibility calculation

in practice this could happen if the NTG value for a cell is set to zero.
This commit is contained in:
Andreas Lauser 2016-02-25 12:49:14 +01:00
parent 704389d14f
commit 0012aac5bd

View File

@ -215,7 +215,12 @@ public:
// convert half transmissibilities to full face
// transmissibilities using the harmonic mean
Scalar trans = 1.0 / (1.0/halfTrans1 + 1.0/halfTrans2);
Scalar trans;
if (std::abs(halfTrans1) < 1e-20 || std::abs(halfTrans2) < 1e-20)
// avoid division by zero
trans = 0.0;
else
trans = 1.0 / (1.0/halfTrans1 + 1.0/halfTrans2);
// apply the full face transmissibility multipliers
// for the inside ...