CONTINUOUS_MODEL PMTContr ABSTRACT "Idealized CONTRoller for liquid w PMT links. If massflow control signal is positive, ideal internal massflow control is enabled. Requested massflow is maintained by adjusting pressure drop down to dp0. When Dp is below dp0, linear (laminar) flow is assumed and requested massflow is nolonger maintained, in which case M = mmim * Dp/dp0. Flow control can also be turned off by giving a negative control signal, in which case M = mmax * Dp/dp0. 971001 MV Contr > -1E-6 is changed to Contr > -0.5 to avoid mode change due to 'numerical noise'. 981012 MV IF dp < dp0 and Contr > - 0.5 equation M = mmim * Dp/dp0 is used to avoid unreasonable big flows when pump is turned on. " EQUATIONS Dp := P1 - P2; /* massflow */ M = IF Mode > 0.5 THEN mmax*Contr + mmin*(1 - Contr) ELSE_IF Contr > -0.5 THEN mmin * Dp/dp0 ELSE mmax * Dp/dp0 END_IF; Mode := IF Event(Dpm, Dp - dp0) > 0 AND Contr > -0.5 THEN 1 ELSE 0 END_IF; LINKS PMT Inlet P1, POS_IN M, T; PMT Outlet P2, POS_OUT M, T; ControlLink Control Contr; VARIABLES MassFlow M OUT 0.01 0 BIG "Fluid massflow" Temp T IN 30 -BIG BIG "Fluid temperature" Pressure Dp LOC 0 0 BIG "Valve total pressure drop" Pressure P1 IN 0 0 BIG "Pressure at inlet" Pressure P2 IN 0 0 BIG "Pressure at outlet" Pressure Dpm A_S "Pressure drop at previous timestep" Control Contr IN 0.5 -BIG BIG "Controller input 1 -> mmax, 0 -> mmin, a negative value (< -0.5) turns off control action" GENERIC Mode A_S 1 0 1 "Mode memory" PARAMETERS Pressure dp0 S_P 50 0 BIG "Pressure drop under which requested flow is nolonger maintained" MassFlow mmax S_P 0.01 SMALL BIG "Fluid massflow at Contr = 1 and Dp > dp0" MassFlow mmin S_P 1.e-6 SMALL BIG "Fluid massflow at Contr = 0 and Dp > dp0" END_MODEL