From ee9313aa24a291faee8fa76a7a0299dc51edfbd7 Mon Sep 17 00:00:00 2001 From: Lew Rossman Date: Sat, 19 Apr 2025 14:39:12 -0400 Subject: [PATCH] Update hydraul.c --- src/hydraul.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/hydraul.c b/src/hydraul.c index 35d6d09..903e7b9 100755 --- a/src/hydraul.c +++ b/src/hydraul.c @@ -127,11 +127,17 @@ void inithyd(Project *pr, int initflag) hyd->LinkStatus[i] = link->InitStatus; hyd->LinkSetting[i] = link->InitSetting; - // Set runtime setting of non-ACTIVE valves to "MISSING" - if (link->Type >= PRV && link->InitStatus != ACTIVE) + // Setting of non-ACTIVE FCV, PRV, PSV valves is "MISSING" + switch (link->Type) { - link->Kc = MISSING; - hyd->LinkSetting[i] = MISSING; + case FCV: + case PRV: + case PSV: + if (link->InitStatus != ACTIVE) + { + link->Kc = MISSING; + hyd->LinkSetting[i] = MISSING; + } } // Compute flow resistance