when Reynolds number is zero, return zero friction factor

which means there is not friction pressure loss. The formualtion has
problem in handling zero-value Reynolds number.
This commit is contained in:
Kai Bao 2017-10-10 09:57:25 +02:00
parent 6366087efd
commit 8a19b719d6
2 changed files with 7 additions and 3 deletions

View File

@ -104,7 +104,11 @@ namespace mswellhelpers
// Reynolds number
const double re = std::abs(diameter * w / (area * mu));
assert(re > 0.0);
if ( re == 0.0 ) {
// make sure it is because the mass rate is zero
assert(w == 0.);
return 0.0;
}
const double re_value1 = 200.;
const double re_value2 = 4000.;

View File

@ -581,7 +581,7 @@ namespace Opm
duneB_.mv(x, Bx);
// invDBx = duneD^-1 * Bx_
BVectorWell invDBx = mswellhelpers::invDX(duneD_, Bx);
const BVectorWell invDBx = mswellhelpers::invDX(duneD_, Bx);
// Ax = Ax - duneC_^T * invDBx
duneC_.mmtv(invDBx,Ax);
@ -597,7 +597,7 @@ namespace Opm
apply(BVector& r) const
{
// invDrw_ = duneD^-1 * resWell_
BVectorWell invDrw = mswellhelpers::invDX(duneD_, resWell_);
const BVectorWell invDrw = mswellhelpers::invDX(duneD_, resWell_);
// r = r - duneC_^T * invDrw
duneC_.mmtv(invDrw, r);
}