New positional control valve added

This commit is contained in:
Lew Rossman
2022-08-16 11:47:44 -04:00
parent c766d4eceb
commit 6db17193f5
16 changed files with 292 additions and 33 deletions

View File

@@ -7,7 +7,7 @@
Authors: see AUTHORS
Copyright: see AUTHORS
License: see LICENSE
Last Updated: 02/03/2020
Last Updated: 08/13/2022
******************************************************************************
*/
@@ -860,7 +860,7 @@ int findtank(Network *network, int index)
/*----------------------------------------------------------------
** Input: index = node index
** Output: none
** Returns: index of tank with given node id, or NOTFOUND if tank not found
** Returns: index of tank with given node index, or NOTFOUND if tank not found
** Purpose: for use in the deletenode function
**----------------------------------------------------------------
*/
@@ -877,7 +877,7 @@ int findpump(Network *network, int index)
/*----------------------------------------------------------------
** Input: index = link ID
** Output: none
** Returns: index of pump with given link id, or NOTFOUND if pump not found
** Returns: index of pump with given link index, or NOTFOUND if pump not found
** Purpose: for use in the deletelink function
**----------------------------------------------------------------
*/
@@ -894,7 +894,7 @@ int findvalve(Network *network, int index)
/*----------------------------------------------------------------
** Input: index = link ID
** Output: none
** Returns: index of valve with given link id, or NOTFOUND if valve not found
** Returns: index of valve with given link index, or NOTFOUND if valve not found
** Purpose: for use in the deletelink function
**----------------------------------------------------------------
*/
@@ -1010,7 +1010,7 @@ void adjustcurves(Network *network, int index)
**----------------------------------------------------------------
*/
{
int j, k, setting;
int j, k, curve;
// Adjust tank volume curves
for (j = 1; j <= network->Ntanks; j++)
@@ -1025,15 +1025,25 @@ void adjustcurves(Network *network, int index)
adjustcurve(&network->Pump[j].Ecurve, index);
}
// Adjust GPV curves
// Adjust PCV & GPV curves
for (j = 1; j <= network->Nvalves; j++)
{
k = network->Valve[j].Link;
if (network->Link[k].Type == PCV)
{
if ((curve = network->Valve[j].Curve) > 0)
{
adjustcurve(&curve, index);
network->Valve[j].Curve = curve;
if (curve == 0)
network->Link[k].Kc = 0.0;
}
}
if (network->Link[k].Type == GPV)
{
setting = INT(network->Link[k].Kc);
adjustcurve(&setting, index);
network->Link[k].Kc = setting;
curve = INT(network->Link[k].Kc);
adjustcurve(&curve, index);
network->Link[k].Kc = curve;
}
}
}