Avoid possible NAN in leakage.c
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
Authors: see AUTHORS
|
Authors: see AUTHORS
|
||||||
Copyright: see AUTHORS
|
Copyright: see AUTHORS
|
||||||
License: see LICENSE
|
License: see LICENSE
|
||||||
Last Updated: 06/14/2024
|
Last Updated: 09/10/2025
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
@@ -432,12 +432,15 @@ int leakagehasconverged(Project *pr)
|
|||||||
|
|
||||||
// Directly compute a reference leakage at this pressure head
|
// Directly compute a reference leakage at this pressure head
|
||||||
qref = 0.0;
|
qref = 0.0;
|
||||||
// Contribution from pipes with fixed area leaks
|
if ( h > 0.0)
|
||||||
if (hyd->Leakage[i].cfa > 0.0)
|
{
|
||||||
qref = sqrt(h / hyd->Leakage[i].cfa);
|
// Contribution from pipes with fixed area leaks
|
||||||
// Contribution from pipes with variable area leaks
|
if (hyd->Leakage[i].cfa > 0.0)
|
||||||
if (hyd->Leakage[i].cva > 0.0)
|
qref = sqrt(h / hyd->Leakage[i].cfa);
|
||||||
qref += pow((h / hyd->Leakage[i].cva), 1.5);
|
// Contribution from pipes with variable area leaks
|
||||||
|
if (hyd->Leakage[i].cva > 0.0)
|
||||||
|
qref += pow((h / hyd->Leakage[i].cva), 1.5);
|
||||||
|
}
|
||||||
|
|
||||||
// Compare reference leakage to solution leakage
|
// Compare reference leakage to solution leakage
|
||||||
qtest = hyd->Leakage[i].qfa + hyd->Leakage[i].qva;
|
qtest = hyd->Leakage[i].qfa + hyd->Leakage[i].qva;
|
||||||
|
|||||||
Reference in New Issue
Block a user