Network validity checks added to openhyd()

Checks on illegal valve connections made whenever API creates a new link, changes its end nodes, or changes its type.
This commit is contained in:
Lew Rossman
2018-12-20 08:36:05 -05:00
parent a66f5a2c92
commit 3ce0361c1d
6 changed files with 118 additions and 77 deletions

View File

@@ -771,11 +771,19 @@ void pumpcoeff(Project *pr, int k)
return;
}
// Obtain reference to pump object & its speed setting
// Obtain reference to pump object
q = ABS(hyd->LinkFlow[k]);
p = findpump(&pr->network, k);
pump = &pr->network.Pump[p];
// If no pump curve treat pump as an open valve
if (pump->Ptype == NOCURVE)
{
hyd->P[k] = 1.0 / CSMALL;
hyd->Y[k] = hyd->LinkFlow[k];
return;
}
// Get pump curve coefficients for custom pump curve
// (Other pump types have pre-determined coeffs.)
if (pump->Ptype == CUSTOM)