Update project.c

This commit is contained in:
Lew Rossman
2025-04-24 09:40:56 -04:00
parent 3c42061a1f
commit 6a3d3d5b8a

View File

@@ -873,6 +873,9 @@ int changevalvetype(Project *pr, int index, int type)
case PBV: case PBV:
setting *= pr->Ucf[PRESSURE]; setting *= pr->Ucf[PRESSURE];
break; break;
case GPV:
setting = 0.0;
break;
} }
switch (type) switch (type)
{ {
@@ -886,8 +889,10 @@ int changevalvetype(Project *pr, int index, int type)
break; break;
} }
// If converting to a GPV set its head loss curve to 0 (i.e., none) // Save setting
if (type == GPV) setting = 0.0; if (type == GPV) setting = 0.0;
if (type == PCV) setting = MIN(setting, 100.0);
link->Kc = setting;
link->InitSetting = setting; link->InitSetting = setting;
// Change valve link's type // Change valve link's type