diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Controller.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Controller.mo index 1385924af7b..56248cc33cd 100644 --- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Controller.mo +++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Controller.mo @@ -2,92 +2,127 @@ within Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant; model Controller "Boiler plant controller" - parameter Buildings.Controls.OBC.CDL.Types.SimpleController controllerType_priPum= Buildings.Controls.OBC.CDL.Types.SimpleController.PI + parameter Buildings.Controls.OBC.CDL.Types.SimpleController controllerType_priPum[nPriLoo]= fill(Buildings.Controls.OBC.CDL.Types.SimpleController.PI, nPriLoo) "Type of controller" - annotation (Dialog(tab="Primary pump control parameters", group="PID parameters")); + annotation (Dialog(tab="Primary pump control parameters", + group="PID parameters")); parameter Buildings.Controls.OBC.CDL.Types.SimpleController controllerType_bypVal= Buildings.Controls.OBC.CDL.Types.SimpleController.PI "Type of controller" annotation(Dialog(tab="Bypass valve control parameters")); - parameter Buildings.Controls.OBC.CDL.Types.SimpleController controllerType_secPum= Buildings.Controls.OBC.CDL.Types.SimpleController.PI + parameter Buildings.Controls.OBC.CDL.Types.SimpleController controllerType_secPum[nSecLoo]= fill(Buildings.Controls.OBC.CDL.Types.SimpleController.PI, nSecLoo) "Type of controller" - annotation(Dialog(tab="Secondary pump control parameters", group="PID parameters")); + annotation(Dialog(tab="Secondary pump control parameters", + group="PID parameters")); + + parameter Integer nPriLoo( + final min=1) + "Number of legs in the primary loop; Must be 1 for primary-only boiler + plant" + annotation(Dialog(group="Boiler plant configuration parameters", + enable = not have_priOnl)); - parameter Boolean have_priOnl = false - "Is the boiler plant a primary-only, condensing boiler plant?" - annotation(Dialog(tab="General", group="Boiler plant configuration parameters")); + parameter Integer boiLooMat[nPriLoo, :] + "Matrix describing the primary loops and their constituent boilers" + annotation(Dialog(group="Boiler plant configuration parameters", + enable = not have_priOnl)); - parameter Boolean have_heaPriPum = true - "True: Headered primary hot water pumps; - False: Dedicated primary hot water pumps" - annotation(Dialog(tab="General", group="Boiler plant configuration parameters")); + parameter Boolean have_priOnl + "Is the boiler plant a primary-only boiler plant?" + annotation(Dialog(group="Boiler plant configuration parameters")); - parameter Boolean have_varPriPum = false + parameter Integer nSecLoo + "Number of legs in the secondary loop" + annotation(Dialog(group="Boiler plant configuration parameters", + enable = not have_priOnl)); + + parameter Boolean have_heaPriPum[nPriLoo] + "True: Headered primary pumps; + False: Dedicated primary pumps" + annotation(Dialog(group="Boiler plant configuration parameters")); + + parameter Boolean have_varPriPum[nPriLoo] "True: Variable-speed primary pumps; - False: Fixed-speed primary pumps" - annotation(Dialog(tab="General", group="Boiler plant configuration parameters")); + False: Fixed-speed primary pumps" + annotation(Dialog(group="Boiler plant configuration parameters")); - parameter Boolean have_secFloSen=false - "True: Flowrate sensor in secondary loop; - False: Flowrate sensor in decoupler" - annotation(Dialog(tab="General", - group="Boiler plant configuration parameters", + parameter Boolean have_priFloSen[nPriLoo] + "True: Flowrate sensor in primary loop in primary-secondary plants; + False: No flowrate sensor in primary loop" + annotation(Dialog(group="Boiler plant configuration parameters", enable = not have_priOnl)); - parameter Boolean have_priSecTemSen=false - "True: Temperature sensors in primary and secondary loops; - False: Temperature sensors in boiler supply and secondary loop" - annotation (Dialog(tab="Primary pump control parameters", - group="General parameters", + parameter Boolean have_secFloSen_PriCon[nSecLoo] + "True: Flowrate sensor in secondary loop downstream of decoupler for primary pump control; + False: No flowrate sensor in secondary loop" + annotation(Dialog(group="Boiler plant configuration parameters", + enable = (not have_priOnl and speConTypPri == fill(Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Types.PrimaryPumpSpeedControlTypes.flowrate, nPriLoo)))); + + parameter Boolean have_secFloSen_SecCon[nSecLoo] + "True: Flowrate sensor in secondary loop for secondary pump control; + False: No flowrate sensor in secondary loop" + annotation(Dialog(group="Boiler plant configuration parameters", + enable = (not have_priOnl and have_varSec))); + + parameter Boolean have_decFloSen[nPriLoo] + "True: Flowrate sensor in decoupler leg; + False: No flowrate sensor in decoupler leg" + annotation(Dialog(group="Boiler plant configuration parameters", + enable = not have_priOnl)); + + parameter Boolean have_priTemSen[nPriLoo] + "True: Temperature sensors in primary loop; + False: Temperature sensors in boiler supply" + annotation (Dialog(group="Boiler plant configuration parameters", enable = speConTypPri == Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Types.PrimaryPumpSpeedControlTypes.temperature)); - parameter Boolean have_varSecPum = false + parameter Boolean have_varSecPum[nSecLoo] "True: Variable-speed secondary pumps; False: Fixed-speed secondary pumps" - annotation (Dialog(group="Boiler plant configuration parameters")); + annotation (Dialog(group="Boiler plant configuration parameters", + enable = not have_priOnl)); parameter Integer nIgnReq( final min=0) = 0 "Number of hot-water requests to be ignored before enabling boiler plant loop" - annotation(dialog(tab="Plant enable/disable parameters")); - - parameter Integer nSchRow( - final min=1) = 4 - "Number of rows to be created for plant schedule table" - annotation(dialog(tab="Plant enable/disable parameters")); + annotation(Dialog(tab="Plant enable/disable parameters")); - parameter Integer nBoi + parameter Integer nBoi[nPriLoo] "Number of boilers" - annotation(Dialog(tab="General", group="Boiler plant configuration parameters")); + annotation(Dialog(tab="General", + group="Boiler plant configuration parameters")); - parameter Integer boiTyp[nBoi]={ - Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Types.BoilerTypes.condensingBoiler, - Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Types.BoilerTypes.nonCondensingBoiler} - "Boiler type" - annotation(Dialog(tab="General", group="Boiler plant configuration parameters")); + parameter Integer boiTyp[nBoi] + "Boiler type for each boiler in plant staging logic" + annotation(Dialog(tab="General", + group="Boiler plant configuration parameters")); parameter Integer nSta "Number of boiler plant stages" - annotation(Dialog(tab="General", group="Boiler plant configuration parameters")); + annotation(Dialog(tab="General", + group="Boiler plant configuration parameters")); parameter Integer staMat[nSta, nBoi] "Staging matrix with stage as row index and boiler as column index" - annotation(Dialog(tab="General", group="Boiler plant configuration parameters")); + annotation(Dialog(tab="General", + group="Boiler plant configuration parameters")); - parameter Integer nPumPri - "Number of primary pumps in the boiler plant loop" - annotation(Dialog(tab="General", group="Boiler plant configuration parameters")); + parameter Integer nPumPri[nPriLoo] + "Number of primary pumps in each primary loop in the boiler plant" + annotation(Dialog(tab="General", + group="Boiler plant configuration parameters")); parameter Integer nHotWatResReqIgn = 2 "Number of hot-water supply temperature reset requests to be ignored" - annotation(Dialog(tab="Supply temperature reset parameters", group="Trim-and-Respond Logic parameters")); + annotation(Dialog(tab="Supply temperature reset parameters", + group="Trim-and-Respond Logic parameters")); - parameter Integer nSenPri - "Total number of remote differential pressure sensors in primary loop" + parameter Integer nDifPreSen + "Total number of remote differential pressure sensors" annotation(Dialog(tab="General", group="Boiler plant configuration parameters", - enable = have_remDPRegPri or have_locDPRegPri)); + enable = have_remDPRegPri or have_locDPRegPri or have_varSecPum)); parameter Integer numIgnReq = 0 "Number of ignored requests" @@ -95,59 +130,53 @@ model Controller group="Temperature-based speed regulation", enable= speConTypPri == Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Types.PrimaryPumpSpeedControlTypes.temperature)); - parameter Integer nPumPri_nominal( - final max=nPumPri, - final min=1) = nPumPri - "Total number of pumps that operate at design conditions" + parameter Integer nPumPri_nominal[nPriLoo]( + final max=fill(nPumPri, nPriLoo), + final min=fill(1, nPriLoo)) = fill(nPumPri, nPriLoo) + "Total number of pumps that operate at design conditions in each primary loop" annotation (Dialog(group="Boiler plant configuration parameters")); - parameter Integer nPumSec - "Total number of secondary hot water pumps" - annotation (Dialog(group="Boiler plant configuration parameters")); - - parameter Integer nSenSec - "Total number of remote differential pressure sensors in secondary loop" - annotation (Dialog(group="Boiler plant configuration parameters")); - - parameter Integer nPumSec_nominal( - final max=nPumSec) = nPumSec - "Total number of pumps that operate at design conditions in secondary loop" - annotation (Dialog(group="Boiler plant configuration parameters")); + parameter Integer nPumSec[nSecLoo] + "Total number of secondary hot water pumps in each secondary loop" + annotation (Dialog(group="Boiler plant configuration parameters", + enable = not have_priOnl)); - parameter Real schTab[nSchRow,2] = [0,1;6,1;18,1;24,1] - "Table defining schedule for enabling plant" - annotation(dialog(tab="Plant enable/disable parameters")); + parameter Integer nPumSec_nominal[nSecLoo]( + final max=nPumSec) = fill(nPumSec, nSecLoo) + "Total number of pumps that operate at design conditions in each secondary loop" + annotation (Dialog(group="Boiler plant configuration parameters", + enable = not have_priOnl)); parameter Real TOutLoc( final unit="K", - displayUnit="K") = 300 + displayUnit="degC") = 300 "Boiler lock-out temperature for outdoor air" - annotation(dialog(tab="Plant enable/disable parameters")); + annotation(Dialog(tab="Plant enable/disable parameters")); parameter Real locDt( final unit="K", - displayUnit="K", + displayUnit="degC", final quantity="ThermodynamicTemperature") = 1 "Temperature deadband for boiler lockout" - annotation(dialog(tab="Plant enable/disable parameters", group="Advanced")); + annotation(Dialog(tab="Plant enable/disable parameters", group="Advanced")); parameter Real plaOffThrTim( final unit="s", displayUnit="s") = 900 "Minimum time for which the plant has to stay off once it has been disabled" - annotation(dialog(tab="Plant enable/disable parameters")); + annotation(Dialog(tab="Plant enable/disable parameters")); parameter Real plaOnThrTim( final unit="s", displayUnit="s") = plaOffThrTim "Minimum time for which the boiler plant has to stay on once it has been enabled" - annotation(dialog(tab="Plant enable/disable parameters")); + annotation(Dialog(tab="Plant enable/disable parameters")); parameter Real staOnReqTim( final unit="s", displayUnit="s") = 180 "Time-limit for receiving hot-water requests to maintain enabled plant on" - annotation(dialog(tab="Plant enable/disable parameters")); + annotation(Dialog(tab="Plant enable/disable parameters")); parameter Real boiDesCap[nBoi]( final unit="W", @@ -159,7 +188,7 @@ model Controller parameter Real boiFirMin[nBoi]( final unit="1", displayUnit="1") - "Boiler minimum firing ratio" + "Boiler minimum firing rate ratio" annotation(Dialog(tab="General", group="Boiler plant configuration parameters")); parameter Real delStaCha( @@ -199,7 +228,7 @@ model Controller parameter Real TDif( final unit="K", - displayUnit="K", + displayUnit="degC", final quantity="TemperatureDifference") = 10 "Required temperature difference between setpoint and measured temperature" annotation(Dialog(tab="Staging setpoint parameters", group="Failsafe condition parameters")); @@ -219,7 +248,7 @@ model Controller parameter Real TDifHys( final unit="K", - displayUnit="K", + displayUnit="degC", final quantity="TemperatureDifference") = 1 "Temperature deadband for hysteresis loop" annotation (Dialog(tab="Staging setpoint parameters", group="Advanced")); @@ -236,85 +265,76 @@ model Controller displayUnit="s", final quantity="Time") = 300 "Delay for staging based on minimum firing rate of current stage" - annotation(Dialog(tab="Staging setpoint parameters", group="Staging down parameters")); + annotation(Dialog(tab="Staging setpoint parameters", + group="Staging down parameters")); parameter Real fraDesCap( final unit="1", displayUnit="1") = 0.8 "Fraction of design capacity of next lower stage that heating capacity needs to be for staging down" - annotation(Dialog(tab="Staging setpoint parameters", group="Staging down parameters")); + annotation(Dialog(tab="Staging setpoint parameters", + group="Staging down parameters")); parameter Real delDesCapNonConBoi( final unit="s", displayUnit="s", final quantity="Time") = 600 "Enable delay for capacity requirement condition for non-condensing boilers" - annotation(Dialog(tab="Staging setpoint parameters", group="Staging down parameters")); + annotation(Dialog(tab="Staging setpoint parameters", + group="Staging down parameters")); parameter Real delDesCapConBoi( final unit="s", displayUnit="s", final quantity="Time") = 300 "Enable delay for capacity requirement condition for condensing boilers" - annotation(Dialog(tab="Staging setpoint parameters", group="Staging down parameters")); + annotation(Dialog(tab="Staging setpoint parameters", + group="Staging down parameters")); parameter Real delBypVal( final unit="s", displayUnit="s", final quantity="Time") = 300 "Enable delay for bypass valve condition for primary-only plants" - annotation ( - Evaluate=true, - Dialog( - enable=have_priOnl, - tab="Staging setpoint parameters", - group="Staging down parameters")); + annotation (Dialog(enable=have_priOnl, + tab="Staging setpoint parameters", + group="Staging down parameters")); parameter Real TCirDif( final unit="K", - displayUnit="K", + displayUnit="degC", final quantity="TemperatureDifference") = 3 "Required return water temperature difference between primary and secondary circuits for staging down" - annotation ( - Evaluate=true, - Dialog( - enable=not - (have_priOnl), - tab="Staging setpoint parameters", - group="Staging down parameters")); + annotation (Dialog(enable=not have_priOnl, + tab="Staging setpoint parameters", + group="Staging down parameters")); parameter Real delTRetDif( final unit="s", displayUnit="s", final quantity="Time") = 300 "Enable delay for measured hot water return temperature difference condition" - annotation ( - Evaluate=true, - Dialog( - enable=not - (have_priOnl), - tab="Staging setpoint parameters", - group="Staging down parameters")); + annotation (Dialog(enable=not have_priOnl, + tab="Staging setpoint parameters", + group="Staging down parameters")); parameter Real bypValClo( final unit="1", displayUnit="1") = 0 "Adjustment for signal received when bypass valve is closed" - annotation ( - Evaluate=true, - Dialog( - enable=have_priOnl, - tab="Staging setpoint parameters", - group="Advanced")); + annotation (Dialog(enable=have_priOnl, + tab="Staging setpoint parameters", + group="Advanced")); parameter Real dTemp( final unit="K", - displayUnit="K", + displayUnit="degC", final quantity="TemperatureDifference") = 0.1 "Hysteresis deadband for measured temperatures" - annotation (Dialog(tab="Staging setpoint parameters", group="Advanced")); + annotation (Dialog(tab="Staging setpoint parameters", + group="Advanced")); parameter Real minFloSet[nBoi]( final unit="m3/s", @@ -323,7 +343,8 @@ model Controller final min=1e-6, final max=maxFloSet) "Design minimum hot water flow through each boiler" - annotation(Dialog(tab="General", group="Boiler plant configuration parameters")); + annotation(Dialog(tab="General", + group="Boiler plant configuration parameters")); parameter Real maxFloSet[nBoi]( final unit="m3/s", @@ -331,120 +352,137 @@ model Controller final quantity="VolumeFlowRate", final min=minFloSet) "Design maximum hot water flow through each boiler" - annotation(Dialog(tab="General", group="Boiler plant configuration parameters")); + annotation(Dialog(tab="General", + group="Boiler plant configuration parameters")); parameter Real bypSetRat( final unit="m3/s2", displayUnit="m3/s2", final min=0) = 0.001 "Rate at which to reset bypass valve setpoint during stage change" - annotation(Dialog(tab="Staging setpoint parameters", group="General parameters")); + annotation(Dialog(tab="Staging setpoint parameters", + group="General parameters")); parameter Real TPlaHotWatSetMax( final unit="K", - displayUnit="K", + displayUnit="degC", final quantity="ThermodynamicTemperature") = 353.15 "The maximum allowed hot-water setpoint temperature for the plant" - annotation(Dialog(tab="Supply temperature reset parameters", group="Trim-and-Respond Logic parameters")); + annotation(Dialog(tab="Supply temperature reset parameters", + group="Trim-and-Respond Logic parameters")); parameter Real TConBoiHotWatSetMax( final unit="K", - displayUnit="K", + displayUnit="degC", final quantity="ThermodynamicTemperature") = 353.15 "The maximum allowed hot water setpoint temperature for condensing boilers" - annotation(Dialog(tab="Supply temperature reset parameters", group="Trim-and-Respond Logic parameters")); + annotation(Dialog(tab="Supply temperature reset parameters", + group="Trim-and-Respond Logic parameters")); parameter Real TConBoiHotWatSetOff( final unit="K", - displayUnit="K", + displayUnit="degC", final quantity="TemperatureDifference") = -10 "The offset for hot water setpoint temperature for condensing boilers in non-condensing stage type" - annotation(Dialog(tab="Supply temperature reset parameters", group="General parameters")); + annotation(Dialog(tab="Supply temperature reset parameters", + group="General parameters")); parameter Real THotWatSetMinNonConBoi( final unit="K", - displayUnit="K", + displayUnit="degC", final quantity="ThermodynamicTemperature") = 341.48 "The minimum allowed hot-water setpoint temperature for non-condensing boilers" - annotation(Dialog(tab="Supply temperature reset parameters", group="Trim-and-Respond Logic parameters")); + annotation(Dialog(tab="Supply temperature reset parameters", + group="Trim-and-Respond Logic parameters")); parameter Real THotWatSetMinConBoi( final unit="K", - displayUnit="K", + displayUnit="degC", final quantity="ThermodynamicTemperature") = 305.37 "The minimum allowed hot-water setpoint temperature for condensing boilers" - annotation(Dialog(tab="Supply temperature reset parameters", group="Trim-and-Respond Logic parameters")); + annotation(Dialog(tab="Supply temperature reset parameters", + group="Trim-and-Respond Logic parameters")); parameter Real delTimVal( final unit="s", displayUnit="s", final quantity="Time") = 600 "Delay time" - annotation(Dialog(tab="Supply temperature reset parameters", group="Trim-and-Respond Logic parameters")); + annotation(Dialog(tab="Supply temperature reset parameters", + group="Trim-and-Respond Logic parameters")); parameter Real samPerVal( final unit="s", displayUnit="s", final quantity="Time") = 300 "Sample period" - annotation(Dialog(tab="Supply temperature reset parameters", group="Trim-and-Respond Logic parameters")); + annotation(Dialog(tab="Supply temperature reset parameters", + group="Trim-and-Respond Logic parameters")); parameter Real triAmoVal( final unit="K", - displayUnit="K", + displayUnit="degC", final quantity="TemperatureDifference") = -2 "Setpoint trim value" - annotation(Dialog(tab="Supply temperature reset parameters", group="Trim-and-Respond Logic parameters")); + annotation(Dialog(tab="Supply temperature reset parameters", + group="Trim-and-Respond Logic parameters")); parameter Real resAmoVal( final unit="K", - displayUnit="K", + displayUnit="degC", final quantity="TemperatureDifference") = 3 "Setpoint respond value" - annotation(Dialog(tab="Supply temperature reset parameters", group="Trim-and-Respond Logic parameters")); + annotation(Dialog(tab="Supply temperature reset parameters", + group="Trim-and-Respond Logic parameters")); parameter Real maxResVal( final unit="K", - displayUnit="K", + displayUnit="degC", final quantity="TemperatureDifference") = 7 "Setpoint maximum respond value" - annotation(Dialog(tab="Supply temperature reset parameters", group="Trim-and-Respond Logic parameters")); + annotation(Dialog(tab="Supply temperature reset parameters", + group="Trim-and-Respond Logic parameters")); parameter Real holTimVal( final unit="s", displayUnit="s", final quantity="Time") = 600 "Minimum setpoint hold time for stage change process" - annotation(Dialog(tab="Supply temperature reset parameters", group="General parameters")); + annotation(Dialog(tab="Supply temperature reset parameters", + group="General parameters")); parameter Real TMinSupNonConBoi( final unit="K", - displayUnit="K", + displayUnit="degC", final quantity="ThermodynamicTemperature") = 333.2 "Minimum supply temperature required for non-condensing boilers" - annotation(Dialog(tab="General", group="Boiler plant configuration parameters")); + annotation(Dialog(tab="General", + group="Boiler plant configuration parameters")); parameter Real delProSupTemSet( final unit="s", displayUnit="s", final quantity="time")=300 "Process time-out for hot water supply temperature setpoint reset" - annotation (Dialog(tab="Staging process parameters",group="Time and delay parameters")); + annotation (Dialog(tab="Staging process parameters", + group="Time and delay parameters")); parameter Real delEnaMinFloSet( final unit="s", displayUnit="s", final quantity="time")=60 "Enable delay after minimum flow setpoint is achieved in bypass valve" - annotation (Dialog(tab="Staging process parameters",group="Time and delay parameters")); + annotation (Dialog(tab="Staging process parameters", + group="Time and delay parameters")); parameter Real chaIsoValRat( final unit="1/s", displayUnit="1/s") = 1/60 "Rate at which to slowly change isolation valve position, should be determined in the field" - annotation (Dialog(tab="Staging process parameters",group="Time and delay parameters")); + annotation (Dialog(tab="Staging process parameters", + group="Time and delay parameters")); parameter Real chaIsoValTim( final unit="s", @@ -452,7 +490,8 @@ model Controller final quantity="time") = 1/chaIsoValRat "Time to slowly change isolation valve position from fully closed to fully open, should be determined in the field" - annotation (Dialog(tab="Staging process parameters", group="Time and delay parameters")); + annotation (Dialog(tab="Staging process parameters", + group="Time and delay parameters")); parameter Real delPreBoiEna( final unit="s", @@ -460,7 +499,8 @@ model Controller final quantity="time") = 30 "Time delay after valve and pump change process has been completed before starting boiler change process" - annotation (Dialog(tab="Staging process parameters",group="Time and delay parameters")); + annotation (Dialog(tab="Staging process parameters", + group="Time and delay parameters")); parameter Real boiChaProOnTim( final unit="s", @@ -468,7 +508,8 @@ model Controller final quantity="time") = 300 "Enabled boiler operation time to indicate if it is proven on during a staging process where one boiler is turned on and the other is turned off" - annotation (Dialog(tab="Staging process parameters",group="Time and delay parameters")); + annotation (Dialog(tab="Staging process parameters", + group="Time and delay parameters")); parameter Real delBoiEna( final unit="s", @@ -476,7 +517,8 @@ model Controller final quantity="time") = 180 "Time delay after boiler change process has been completed before turning off excess valves and pumps" - annotation (Dialog(tab="Staging process parameters",group="Time and delay parameters")); + annotation (Dialog(tab="Staging process parameters", + group="Time and delay parameters")); parameter Real k_bypVal( final min=0, @@ -507,7 +549,8 @@ model Controller final min=0, final max=maxPumSpePri) = 0.1 "Minimum pump speed" - annotation (Dialog(tab="Primary pump control parameters", group="General parameters", enable=have_varPriPum)); + annotation (Dialog(tab="Primary pump control parameters", + group="General parameters", enable=have_varPriPum)); parameter Real maxPumSpePri( final unit="1", @@ -515,7 +558,8 @@ model Controller final min=minPumSpePri, final max=1) = 1 "Maximum pump speed" - annotation (Dialog(tab="Primary pump control parameters", group="General parameters", enable=have_varPriPum)); + annotation (Dialog(tab="Primary pump control parameters", + group="General parameters", enable=have_varPriPum)); parameter Real VHotWatPri_flow_nominal( final min=1e-6, @@ -539,7 +583,8 @@ model Controller final quantity="PressureDifference", final min=1e-6) = 5*6894.75 "Maximum primary loop local differential pressure setpoint" - annotation (Dialog(tab="Primary pump control parameters", group="DP-based speed regulation", + annotation (Dialog(tab="Primary pump control parameters", + group="DP-based speed regulation", enable = speConTypPri == Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Types.PrimaryPumpSpeedControlTypes.localDP or speConTypPri == Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Types.PrimaryPumpSpeedControlTypes.remoteDP)); @@ -560,7 +605,8 @@ model Controller final quantity="time", final min=0) = 180 "Threshold to check lead boiler off time" - annotation (Dialog(tab="Primary pump control parameters", group="Pump staging parameters")); + annotation (Dialog(tab="Primary pump control parameters", + group="Pump staging parameters")); parameter Real timPer_priPum( final unit="s", @@ -568,19 +614,22 @@ model Controller final quantity="time", final min=0) = 600 "Delay time period for enabling and disabling lag pumps" - annotation (Dialog(tab="Primary pump control parameters", group="Pump staging parameters")); + annotation (Dialog(tab="Primary pump control parameters", + group="Pump staging parameters")); parameter Real staCon_priPum( final unit="1", displayUnit="1") = -0.03 "Constant used in the staging equation" - annotation (Dialog(tab="Primary pump control parameters", group="Pump staging parameters")); + annotation (Dialog(tab="Primary pump control parameters", + group="Pump staging parameters")); parameter Real relFloHys_priPum( final unit="1", displayUnit="1") = 0.01 "Constant value used in hysteresis for checking relative flow rate" - annotation (Dialog(tab="Primary pump control parameters", group="Pump staging parameters")); + annotation (Dialog(tab="Primary pump control parameters", + group="Pump staging parameters")); parameter Real delTim_priPum( final unit="s", @@ -628,7 +677,7 @@ model Controller parameter Real twoReqLimLow_priPum( final unit="K", - displayUnit="K", + displayUnit="degC", final quantity="TemperatureDifference") = 1.2 "Lower limit of hysteresis loop sending two requests" annotation (Dialog(tab="Primary pump control parameters", @@ -637,7 +686,7 @@ model Controller parameter Real twoReqLimHig_priPum( final unit="K", - displayUnit="K", + displayUnit="degC", final quantity="TemperatureDifference") = 2 "Higher limit of hysteresis loop sending two requests" annotation (Dialog(tab="Primary pump control parameters", @@ -646,7 +695,7 @@ model Controller parameter Real oneReqLimLow_priPum( final unit="K", - displayUnit="K", + displayUnit="degC", final quantity="TemperatureDifference") = 0.2 "Lower limit of hysteresis loop sending one request" annotation (Dialog(tab="Primary pump control parameters", @@ -655,7 +704,7 @@ model Controller parameter Real oneReqLimHig_priPum( final unit="K", - displayUnit="K", + displayUnit="degC", final quantity="TemperatureDifference") = 1 "Higher limit of hysteresis loop sending one request" annotation (Dialog(tab="Primary pump control parameters", @@ -675,7 +724,8 @@ model Controller final quantity="time", final min=0) = 0.5 "Time constant of integrator block" - annotation (Dialog(tab="Primary pump control parameters", group="PID parameters")); + annotation (Dialog(tab="Primary pump control parameters", + group="PID parameters")); parameter Real Td_priPum( final unit="s", @@ -683,18 +733,19 @@ model Controller final quantity="time", final min=0) = 0.1 "Time constant of derivative block" - annotation (Dialog(tab="Primary pump control parameters", group="PID parameters")); + annotation (Dialog(tab="Primary pump control parameters", + group="PID parameters")); parameter Real TRetSet( final unit="K", - displayUnit="K", + displayUnit="degC", final quantity="ThermodynamicTemperature") = 333.15 "Minimum hot water return temperature for optimal non-condensing boiler performance" annotation(Dialog(tab="Condensation control parameters")); parameter Real TRetMinAll( final unit="K", - displayUnit="K", + displayUnit="degC", final quantity="ThermodynamicTemperature") = 330.35 "Minimum allowed hot water return temperature for non-condensing boiler" annotation(Dialog(tab="Condensation control parameters")); @@ -738,9 +789,10 @@ model Controller parameter Real VHotWatSec_flow_nominal( final unit="m3/s", displayUnit="m3/s", - final quantity="VolumeFlowRate") = 0.5 + final quantity="VolumeFlowRate") "Secondary loop design hot water flow rate" - annotation (Dialog(group="Boiler plant configuration parameters")); + annotation (Dialog(group="Boiler plant configuration parameters", + enable = not have_priOnl)); parameter Real maxLocDpSec( final unit="Pa", @@ -748,7 +800,8 @@ model Controller final quantity="PressureDifference", final min=1e-6) = 5*6894.75 "Maximum hot water loop local differential pressure setpoint in secondary loop" - annotation (Dialog(tab="Secondary pump control parameters", group="DP-based speed regulation", + annotation (Dialog(tab="Secondary pump control parameters", + group="DP-based speed regulation", enable = speConTypSec == Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Types.PrimaryPumpSpeedControlTypes.localDP)); parameter Real minLocDpSec( @@ -899,6 +952,11 @@ model Controller annotation (Placement(transformation(extent={{-440,-460},{-400,-420}}), iconTransformation(extent={{-140,-250},{-100,-210}}))); + Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uSchEna + "Signal indicating if schedule allows plant to be enabled" + annotation (Placement(transformation(extent={{-440,400},{-400,440}}), + iconTransformation(extent={{-140,330},{-100,370}}))); + Buildings.Controls.OBC.CDL.Interfaces.IntegerInput plaReq "Plant requests" annotation (Placement(transformation(extent={{-440,330},{-400,370}}), @@ -936,15 +994,15 @@ model Controller Buildings.Controls.OBC.CDL.Interfaces.RealInput VHotWatPri_flow( final unit="m3/s", displayUnit="m3/s", - final quantity="VolumeFlowRate") + final quantity="VolumeFlowRate") if have_priOnl "Measured hot water primary circuit flowrate" annotation (Placement(transformation(extent={{-440,170},{-400,210}}), iconTransformation(extent={{-140,150},{-100,190}}))); - Buildings.Controls.OBC.CDL.Interfaces.RealInput dpHotWatPri_rem[nSenPri]( - final unit=fill("Pa", nSenPri), - displayUnit=fill("Pa", nSenPri), - final quantity=fill("PressureDifference", nSenPri)) if have_varPriPum and (have_remDPRegPri or have_locDPRegPri) + Buildings.Controls.OBC.CDL.Interfaces.RealInput dpHotWatPri_rem[nDifPreSen]( + final unit=fill("Pa", nDifPreSen), + displayUnit=fill("Pa", nDifPreSen), + final quantity=fill("PressureDifference", nDifPreSen)) if have_varPriPum and (have_remDPRegPri or have_locDPRegPri) "Measured differential pressure between hot water supply and return in primary circuit" annotation (Placement(transformation(extent={{-440,90},{-400,130}}), iconTransformation(extent={{-140,90},{-100,130}}))); @@ -957,28 +1015,28 @@ model Controller annotation (Placement(transformation(extent={{-440,130},{-400,170}}), iconTransformation(extent={{-140,120},{-100,160}}))); - Buildings.Controls.OBC.CDL.Interfaces.RealInput VHotWatSec_flow( + Buildings.Controls.OBC.CDL.Interfaces.RealInput VHotWatSecPriPumCon_flow[nPriLoo]( final unit="m3/s", displayUnit="m3/s", final quantity="VolumeFlowRate") if not have_priOnl and have_secFloSen - "Measured hot water secondary circuit flowrate" + "Measured hot water secondary circuit flowrate for primary pump control (from just downstream of decoupler)" annotation (Placement(transformation(extent={{-440,-90},{-400,-50}}), - iconTransformation(extent={{-140,30},{-100,70}}))); + iconTransformation(extent={{-140,30},{-100,70}}))); - Buildings.Controls.OBC.CDL.Interfaces.RealInput VHotWatDec_flow( + Buildings.Controls.OBC.CDL.Interfaces.RealInput VHotWatDec_flow[nPriLoo]( final unit="m3/s", displayUnit="m3/s", final quantity="VolumeFlowRate") if not have_priOnl and have_varPriPum and have_floRegPri and not have_secFloSen - "Measured hot water flowrate through decoupler leg" - annotation (Placement(transformation(extent={{-440,-130},{-400,-90}}), - iconTransformation(extent={{-140,0},{-100,40}}))); + "Measured hot water flowrate through decoupler leg" annotation (Placement( + transformation(extent={{-440,-130},{-400,-90}}), iconTransformation( + extent={{-140,0},{-100,40}}))); Buildings.Controls.OBC.CDL.Interfaces.RealInput TSupSec( final unit="K", displayUnit="degC", final quantity="ThermodynamicTemperature") if not have_priOnl and - have_varPriPum and have_temRegPri and have_priSecTemSen + have_varPriPum and have_temRegPri and have_priTemSen "Measured hot water supply temperature in secondary circuit" annotation (Placement(transformation(extent={{-440,-170},{-400,-130}}), iconTransformation(extent={{-140,-40},{-100,0}}))); @@ -987,15 +1045,15 @@ model Controller final unit=fill("K", nBoi), displayUnit=fill("degC", nBoi), final quantity=fill("ThermodynamicTemperature", nBoi)) if not have_priOnl - and have_varPriPum and have_temRegPri and not have_priSecTemSen - "Measured hot water supply temperatureat boiler outlets" + and have_varPriPum and have_temRegPri and not have_priTemSen + "Measured hot water supply temperature at boiler outlets" annotation (Placement(transformation(extent={{-440,-210},{-400,-170}}), iconTransformation(extent={{-140,-70},{-100,-30}}))); - Buildings.Controls.OBC.CDL.Interfaces.RealInput dpHotWatSec_rem[nSenSec]( - final unit=fill("Pa", nSenSec), - displayUnit=fill("Pa", nSenSec), - final quantity=fill("PressureDifference", nSenSec)) if not + Buildings.Controls.OBC.CDL.Interfaces.RealInput dpHotWatSec_rem[nDifPreSen]( + final unit=fill("Pa", nDifPreSen), + displayUnit=fill("Pa", nDifPreSen), + final quantity=fill("PressureDifference", nDifPreSen)) if not have_priOnl and have_varSecPum and (have_remDPRegSec or have_locDPRegSec) "Measured differential pressure between hot water supply and return in secondary circuit" annotation (Placement(transformation(extent={{-440,-250},{-400,-210}}), @@ -1015,7 +1073,7 @@ model Controller final quantity="PressureDifference") if not have_priOnl and have_varSecPum and have_locDPRegSec "Measured differential pressure between hot water supply and return in secondary circuit" - annotation (Placement(transformation(extent={{-440,-330},{-400,-290}}), + annotation (Placement(transformation(extent={{-440,-320},{-400,-280}}), iconTransformation(extent={{-140,-160},{-100,-120}}))); Buildings.Controls.OBC.CDL.Interfaces.RealInput uHotWatIsoVal[nBoi]( @@ -1061,7 +1119,7 @@ model Controller Buildings.Controls.OBC.CDL.Interfaces.RealOutput TPlaHotWatSupSet( final unit="K", - displayUnit="K", + displayUnit="degC", final quantity="ThermodynamicTemperature") "Plant hot water supply temperature setpoint" annotation (Placement(transformation(extent={{400,220},{440,260}}), @@ -1105,8 +1163,6 @@ model Controller Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.PlantEnable plaEna( final nIgnReq=nIgnReq, - final nSchRow=nSchRow, - final schTab=schTab, final TOutLoc=TOutLoc, final plaOffThrTim=plaOffThrTim, final plaOnThrTim=plaOnThrTim, @@ -1154,6 +1210,16 @@ model Controller annotation (Placement(transformation(extent={{250,310},{270,330}}))); protected + parameter Boolean use_priSecFloSen = (speConTypPri == Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Types.PrimaryPumpSpeedControlTypes.flowrate + and (have_secFloSen and not have_decFloSen)) + "True: Use flowrate sensors in primary/secondary loops for speed regulation; + False: Flowrate sensor in decoupler leg for speed regulation"; + + parameter Boolean use_priTemSen = (speConTypPri == Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Types.PrimaryPumpSpeedControlTypes.temperature + and have_priTemSen) + "True: Use Temperature sensors in primary loop for speed control; + False: Use temperature sensors in boiler supply for speed control"; + parameter Boolean have_remDPRegPri = (speConTypPri == Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Types.PrimaryPumpSpeedControlTypes.remoteDP) "Boolean flag for primary pump speed control with remote differential pressure"; @@ -1181,6 +1247,19 @@ protected parameter Integer secPumInd[nPumSec]={i for i in 1:nPumSec} "Vector of secondary pump indices up to total number of secondary pumps"; + Buildings.Controls.OBC.CDL.Routing.BooleanScalarReplicator booScaRep( + final nout=nPriLoo) + "Replicate pump change signal to each primary leg" + annotation (Placement(transformation(extent={{68,-220},{88,-200}}))); + + Buildings.Controls.OBC.CDL.Interfaces.RealInput VHotWatSecPumCon_flow[nSecLoo]( + final unit="m3/s", + displayUnit="m3/s", + final quantity="VolumeFlowRate") if not have_priOnl and have_secFloSen + "Measured hot water secondary circuit flowrate used for secondary pump control" + annotation (Placement(transformation(extent={{-440,-348},{-400,-308}}), + iconTransformation(extent={{-140,30},{-100,70}}))); + Buildings.Controls.OBC.CDL.Continuous.IntegratorWithReset intWitRes "Used to break algebraic loop and sample staging setpoint signal" annotation (Placement(transformation(extent={{-210,360},{-190,380}}))); @@ -1247,16 +1326,17 @@ protected "Stage-down process controller" annotation (Placement(transformation(extent={{120,20},{140,60}}))); - Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Pumps.PrimaryPumps.Controller priPumCon( + Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Pumps.PrimaryPumps.Controller + priPumCon[nPriLoo]( final controllerType=controllerType_priPum, final have_heaPriPum=have_heaPriPum, final have_priOnl=have_priOnl, final have_varPriPum=have_varPriPum, - final have_secFloSen=have_secFloSen, - final have_priSecTemSen=have_priSecTemSen, + final use_priSecFloSen=use_priSecFloSen, + final use_priTemSen=use_priTemSen, final nPum=nPumPri, final nBoi=nBoi, - final nSen=nSenPri, + final nSen=nDifPreSen, final numIgnReq=numIgnReq, final nPum_nominal=nPumPri, final minPumSpe=minPumSpePri, @@ -1282,7 +1362,7 @@ protected final k=k_priPum, final Ti=Ti_priPum, final Td=Td_priPum, - final speConTyp=speConTypPri) + final speConTyp=Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Types.PrimaryPumpSpeedControlTypes.temperature) "Primary pump controller" annotation (Placement(transformation(extent={{120,-208},{140,-152}}))); @@ -1371,7 +1451,7 @@ protected "Constant stage Integer source" annotation (Placement(transformation(extent={{-390,-40},{-370,-20}}))); - Buildings.Controls.OBC.CDL.Integers.Sources.Constant conInt2[nPumPri]( + Buildings.Controls.OBC.CDL.Integers.Sources.Constant conInt2[nPriLoo,nPumPri]( final k=priPumInd) "Constant stage Integer source" annotation (Placement(transformation(extent={{60,-138},{80,-118}}))); @@ -1388,7 +1468,7 @@ protected "Integer to Real converter" annotation (Placement(transformation(extent={{-190,-50},{-170,-30}}))); - Buildings.Controls.OBC.CDL.Continuous.Sources.Constant dpHotWatSet( + Buildings.Controls.OBC.CDL.Continuous.Sources.Constant dpHotWatSet[nPriLoo]( final k=maxLocDpPri) if have_priOnl "Differential pressure setpoint for primary circuit" annotation (Placement(transformation(extent={{60,-180},{80,-160}}))); @@ -1443,14 +1523,15 @@ protected "Plant disable process controller" annotation (Placement(transformation(extent={{240,60},{260,80}}))); - Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Pumps.SecondaryPumps.Controller secPumCon( + Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Pumps.SecondaryPumps.Controller + secPumCon[nSecLoo]( final controllerType=controllerType_secPum, final have_varSecPum=true, final have_secFloSen=have_secFloSen, final nPum=nPumSec, final nPumPri=nPumPri, final nBoi=nBoi, - final nSen=nSenSec, + final nSen=nDifPreSen, final nPum_nominal=nPumSec, final minPumSpe=minPumSpeSec, final maxPumSpe=maxPumSpeSec, @@ -1478,19 +1559,19 @@ protected "Switch input signal between stage-up and stage-down processes" annotation (Placement(transformation(extent={{64,280},{84,300}}))); - Buildings.Controls.OBC.CDL.Integers.Sources.Constant conInt3[nPumSec]( + Buildings.Controls.OBC.CDL.Integers.Sources.Constant conInt3[nSecLoo,nPumSec]( final k=secPumInd) if not have_priOnl "Constant stage Integer source" annotation (Placement(transformation(extent={{60,-290},{80,-270}}))); - Buildings.Controls.OBC.CDL.Continuous.Sources.Constant dpHotWatSet1( + Buildings.Controls.OBC.CDL.Continuous.Sources.Constant dpHotWatSet1[nSecLoo]( final k=maxLocDpSec) if not have_priOnl "Differential pressure setpoint for secondary circuit" annotation (Placement(transformation(extent={{60,-390},{80,-370}}))); Buildings.Controls.OBC.CDL.Logical.Or or1 if not have_priOnl "Or operator for pump stage change signal from up-staging, down-staging and plant disable process controllers" - annotation (Placement(transformation(extent={{58,-220},{78,-200}}))); + annotation (Placement(transformation(extent={{42,-220},{62,-200}}))); Buildings.Controls.OBC.CDL.Logical.And and2 "Ensure stage-down process is not initiated when plant is disabled" @@ -1552,7 +1633,7 @@ equation 86,-128},{86,-152.933},{118,-152.933}}, color={255,127,0})); connect(plaReq, plaEna.supResReq) annotation (Line(points={{-420,350},{-360,350}, - {-360,334},{-342,334}}, color={255,127,0})); + {-360,330},{-342,330}}, color={255,127,0})); connect(reaToInt.u, triSam.y) annotation (Line(points={{-130,-40},{-138,-40}}, color={0,0,127})); @@ -1563,7 +1644,7 @@ equation {-80,-60},{-220,-60},{-220,-13},{-212,-13}}, color={255,127,0})); connect(TOut, plaEna.TOut) annotation (Line(points={{-420,310},{-360,310},{-360, - 326},{-342,326}}, + 324},{-342,324}}, color={0,0,127})); connect(TSupPri, staSetCon.THotWatSup) annotation (Line(points={{-420,270},{-240, 270},{-240,8},{-212,8}}, color={0,0,127})); @@ -1698,8 +1779,8 @@ equation connect(plaEna.yPla, priPumCon.uPlaEna) annotation (Line(points={{-318,330},{ -230,330},{-230,-78},{90,-78},{90,-158.533},{118,-158.533}}, color={255,0,255})); - connect(hotWatSupTemRes.TPlaHotWatSupSet, upProCon.THotWatSupSet) annotation - (Line(points={{-118,184},{-100,184},{-100,107},{118,107}}, color={0,0,127})); + connect(hotWatSupTemRes.TPlaHotWatSupSet, upProCon.THotWatSupSet) annotation ( + Line(points={{-118,184},{-100,184},{-100,107},{118,107}}, color={0,0,127})); connect(TRetPri, staSetCon.THotWatRetPri) annotation (Line(points={{-420,230}, {-260,230},{-260,-1},{-212,-1}}, color={0,0,127})); connect(TRetSec, staSetCon.THotWatRetSec) annotation (Line(points={{-420,150}, @@ -1726,8 +1807,9 @@ equation color={0,0,127})); connect(conInt3.y, secPumCon.uPumLeaLag) annotation (Line(points={{82,-280},{90, -280},{90,-341.8},{118,-341.8}}, color={255,127,0})); - connect(VHotWatSec_flow, priPumCon.VHotWatSec_flow) annotation (Line(points={{-420, - -70},{8,-70},{8,-224},{114,-224},{114,-195.867},{118,-195.867}}, + connect(VHotWatSecPriPumCon_flow, priPumCon.VHotWatSec_flow) annotation (Line( + points={{-420,-70},{8,-70},{8,-224},{114,-224},{114,-195.867},{118, + -195.867}}, color={0,0,127})); connect(VHotWatDec_flow, priPumCon.VHotWatDec_flow) annotation (Line(points={{-420, -110},{-190,-110},{-190,-212},{6,-212},{6,-226},{116,-226},{116, @@ -1751,8 +1833,8 @@ equation 350},{-154,20},{14,20},{14,-354},{118,-354}}, color={255,127,0})); connect(plaEna.yPla, secPumCon.uPlaEna) annotation (Line(points={{-318,330},{-230, 330},{-230,-78},{12,-78},{12,-350},{118,-350}}, color={255,0,255})); - connect(VHotWatSec_flow, secPumCon.VHotWat_flow) annotation (Line(points={{-420, - -70},{8,-70},{8,-358},{118,-358}}, color={0,0,127})); + connect(VHotWatSecPriPumCon_flow, secPumCon.VHotWat_flow) annotation (Line( + points={{-420,-70},{8,-70},{8,-358},{118,-358}}, color={0,0,127})); connect(conSet.yMaxSecPumSpe, secPumCon.uMaxSecPumSpeCon) annotation (Line( points={{-38,-108},{94,-108},{94,-378},{118,-378}},color={0,0,127})); connect(dpHotWatSet1.y, secPumCon.dpHotWatSet) annotation (Line(points={{82,-380}, @@ -1764,7 +1846,7 @@ equation -270},{-180,-270},{-180,-234},{96,-234},{96,-184.667},{118,-184.667}}, color={0,0,127})); connect(dpHotWatSec_loc, secPumCon.dpHotWat_local) annotation (Line(points={{-420, - -310},{100,-310},{100,-366},{118,-366}}, color={0,0,127})); + -300},{100,-300},{100,-366},{118,-366}}, color={0,0,127})); connect(reaToInt2.y, priPumCon.uLasDisBoi) annotation (Line(points={{142,380}, {150,380},{150,340},{288,340},{288,-210},{102,-210},{102,-181.867},{ 118,-181.867}}, color={255,127,0})); @@ -1774,13 +1856,12 @@ equation -10},{372,-64},{78,-64},{78,26},{118,26}}, color={255,0,255})); connect(pre1.y, upProCon.uStaChaPro) annotation (Line(points={{322,-10},{372, -10},{372,-64},{78,-64},{78,80},{118,80}}, color={255,0,255})); - connect(upProCon.yPumChaPro, or1.u1) annotation (Line(points={{142,84},{160,84}, - {160,14},{32,14},{32,-210},{56,-210}}, color={255,0,255})); - connect(dowProCon.yPumChaPro, or1.u2) annotation (Line(points={{142,28},{156,28}, - {156,18},{28,18},{28,-218},{56,-218}}, color={255,0,255})); - connect(or1.y, priPumCon.uPumChaPro) annotation (Line(points={{80,-210},{100, - -210},{100,-175.333},{118,-175.333}}, - color={255,0,255})); + connect(upProCon.yPumChaPro, or1.u1) annotation (Line(points={{142,84},{160, + 84},{160,14},{32,14},{32,-210},{40,-210}}, + color={255,0,255})); + connect(dowProCon.yPumChaPro, or1.u2) annotation (Line(points={{142,28},{156, + 28},{156,18},{28,18},{28,-218},{40,-218}}, + color={255,0,255})); connect(staSetCon.yChaDowEdg, and2.u2) annotation (Line(points={{-188,-6},{-40, -6},{-40,52},{-30,52}}, color={255,0,255})); connect(plaEna.yPla, and2.u1) annotation (Line(points={{-318,330},{-230,330},{ @@ -1859,16 +1940,22 @@ equation connect(plaEna.yPla, yPla) annotation (Line(points={{-318,330},{-230,330},{-230, 252},{-80,252},{-80,192},{380,192},{380,300},{420,300}}, color={255,0, 255})); + connect(uSchEna, plaEna.uSchEna) annotation (Line(points={{-420,420},{-350,420}, + {-350,336},{-342,336}}, color={255,0,255})); + connect(or1.y, booScaRep.u) + annotation (Line(points={{64,-210},{66,-210}}, color={255,0,255})); + connect(booScaRep.y, priPumCon.uPumChaPro) annotation (Line(points={{90,-210}, + {98,-210},{98,-175.333},{118,-175.333}}, color={255,0,255})); annotation (defaultComponentName="boiPlaCon", - Icon(coordinateSystem(extent={{-100,-340},{100,340}}), + Icon(coordinateSystem(extent={{-100,-360},{100,360}}), graphics={ Rectangle( - extent={{-100,-340},{100,340}}, + extent={{-100,-360},{100,360}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), Text( - extent={{-120,378},{100,338}}, + extent={{-120,400},{100,360}}, textColor={0,0,255}, textString="%name"), Rectangle( @@ -1882,7 +1969,7 @@ equation lineColor={175,175,175}, fillColor={175,175,175}, fillPattern=FillPattern.Solid)}), Diagram( - coordinateSystem(preserveAspectRatio=false, extent={{-400,-620},{400,400}}), + coordinateSystem(preserveAspectRatio=false, extent={{-400,-580},{400,440}}), graphics={ Rectangle( extent={{-394,392},{-266,290}}, diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/PlantEnable.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/PlantEnable.mo index fee4e54e247..35743bc2197 100644 --- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/PlantEnable.mo +++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/PlantEnable.mo @@ -6,13 +6,6 @@ block PlantEnable final min=0) = 0 "Number of hot-water requests to be ignored before enablng boiler plant loop"; - parameter Integer nSchRow( - final min=1) = 4 - "Number of rows to be created for plant schedule table"; - - parameter Real schTab[nSchRow,2] = [0,1; 6,1; 18,1; 24,1] - "Table defining schedule for enabling plant"; - parameter Real TOutLoc( final unit="K", final displayUnit="K") = 300 @@ -40,10 +33,15 @@ block PlantEnable "Temperature deadband for boiler lockout" annotation (Dialog(tab="Advanced")); + Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uSchEna + "Signal indicating if schedule allows plant to be enabled" + annotation (Placement(transformation(extent={{-200,-130},{-160,-90}}), + iconTransformation(extent={{-140,40},{-100,80}}))); + Buildings.Controls.OBC.CDL.Interfaces.IntegerInput supResReq "Number of heating hot-water requests" annotation (Placement(transformation(extent={{-200,30},{-160,70}}), - iconTransformation(extent={{-140,20},{-100,60}}))); + iconTransformation(extent={{-140,-20},{-100,20}}))); Buildings.Controls.OBC.CDL.Interfaces.RealInput TOut( final unit="K", @@ -51,20 +49,13 @@ block PlantEnable final quantity="ThermodynamicTemperature") "Measured outdoor air temperature" annotation (Placement(transformation(extent={{-200,-40},{-160,0}}), - iconTransformation(extent={{-140,-60},{-100,-20}}))); + iconTransformation(extent={{-140,-80},{-100,-40}}))); Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yPla "Plant enable signal" annotation (Placement(transformation(extent={{160,-20},{200,20}}), iconTransformation(extent={{100,-20},{140,20}}))); - Buildings.Controls.OBC.CDL.Continuous.Sources.TimeTable enaSch( - final table=schTab, - final smoothness=Buildings.Controls.OBC.CDL.Types.Smoothness.ConstantSegments, - final timeScale=3600) - "Table defining when plant can be enabled" - annotation (Placement(transformation(extent={{-150,-120},{-130,-100}}))); - Buildings.Controls.OBC.CDL.Logical.Timer tim(t=plaOnThrTim) "Time since plant has been enabled" annotation (Placement(transformation(extent={{10,0},{30,20}}))); @@ -79,11 +70,6 @@ protected "Invert signal for subtraction" annotation (Placement(transformation(extent={{-152,-30},{-132,-10}}))); - Buildings.Controls.OBC.CDL.Continuous.GreaterThreshold greThr( - final t=0.5) - "Check if schedule lets the controller enable the plant or not" - annotation (Placement(transformation(extent={{-120,-120},{-100,-100}}))); - Buildings.Controls.OBC.CDL.Integers.GreaterThreshold intGreThr( final t=nIgnReq) "Check if number of requests is greater than number of requests to be ignored" @@ -145,8 +131,6 @@ protected equation connect(yPla, yPla) annotation (Line(points={{180,0},{180,0}}, color={255,0,255})); - connect(greThr.y, not1.u) - annotation (Line(points={{-98,-110},{-12,-110}}, color={255,0,255})); connect(hys.u, addPar.y) annotation (Line(points={{-122,-50},{-128,-50},{-128, -34},{-96,-34},{-96,-20},{-98,-20}}, color={0,0,127})); connect(not3.y, tim1.u) @@ -159,13 +143,10 @@ equation {-72,-30}}, color={255,0,255})); connect(pre1.y, not4.u) annotation (Line(points={{-38,50},{-30,50},{-30,70},{-22, 70}}, color={255,0,255})); - connect(greThr.y, mulAnd.u[1]) annotation (Line(points={{-98,-110},{-92,-110}, - {-92,125.25},{78,125.25}}, - color={255,0,255})); - connect(hys.y, mulAnd.u[2]) annotation (Line(points={{-98,-50},{-86,-50},{-86, - 121.75},{78,121.75}}, color={255,0,255})); - connect(intGreThr.y, mulAnd.u[3]) annotation (Line(points={{-98,50},{-80,50},{ - -80,118.25},{78,118.25}}, color={255,0,255})); + connect(hys.y, mulAnd.u[1]) annotation (Line(points={{-98,-50},{-86,-50},{-86, + 125.25},{78,125.25}}, color={255,0,255})); + connect(intGreThr.y, mulAnd.u[2]) annotation (Line(points={{-98,50},{-80,50},{ + -80,121.75},{78,121.75}}, color={255,0,255})); connect(mulAnd.y, lat.u) annotation (Line(points={{102,120},{110,120},{110,0}, {118,0}}, color={255,0,255})); connect(and2.y, lat.clr) annotation (Line(points={{102,-30},{110,-30},{110,-6}, @@ -185,10 +166,8 @@ equation 30},{-70,50},{-62,50}}, color={255,0,255})); connect(pre1.y, tim.u) annotation (Line(points={{-38,50},{-30,50},{-30,10},{8, 10}}, color={255,0,255})); - connect(enaSch.y[1], greThr.u) - annotation (Line(points={{-128,-110},{-122,-110}}, color={0,0,127})); - connect(tim2.passed, mulAnd.u[4]) annotation (Line(points={{32,62},{60,62},{60, - 114},{78,114},{78,114.75}}, color={255,0,255})); + connect(tim2.passed, mulAnd.u[3]) annotation (Line(points={{32,62},{40,62},{40, + 118},{78,118},{78,118.25}}, color={255,0,255})); connect(tim.passed, and2.u1) annotation (Line(points={{32,2},{70,2},{70,-30},{ 78,-30}}, color={255,0,255})); connect(tim1.passed, mulOr.u[3]) annotation (Line(points={{-18,-38},{20,-38}, @@ -197,6 +176,10 @@ equation annotation (Line(points={{-122,-20},{-130,-20}}, color={0,0,127})); connect(TOut, gai.u) annotation (Line(points={{-180,-20},{-154,-20}}, color={0,0,127})); + connect(uSchEna, not1.u) + annotation (Line(points={{-180,-110},{-12,-110}}, color={255,0,255})); + connect(uSchEna, mulAnd.u[4]) annotation (Line(points={{-180,-110},{-92,-110}, + {-92,114.75},{78,114.75}}, color={255,0,255})); annotation (defaultComponentName = "plaEna", Icon(graphics={ Rectangle( diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/Validation/PlantEnable.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/Validation/PlantEnable.mo index 3f64d5b9f4b..f96fd144b59 100644 --- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/Validation/PlantEnable.mo +++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/Validation/PlantEnable.mo @@ -1,12 +1,17 @@ within Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.Validation; -model PlantEnable "Validation model for PlantEnable sequence" +model PlantEnable + "Validation model for PlantEnable sequence" + + parameter Integer nSchRow( + final min=1) = 4 + "Number of rows to be created for plant schedule table"; + + parameter Real schTab[nSchRow,2] = [0,1; 6,1; 18,1; 24,1] + "Table defining schedule for enabling plant"; Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.PlantEnable plaEna( - final nIgnReq=2, - final plaOffThrTim=15*60, - final plaOnThrTim=15*60, - final schTab=[0,0; 1,1; 18,1; 24,1]) + final nIgnReq=2) "Testing time-variance for all inputs" annotation (Placement(transformation(extent={{-20,50},{0,70}}))); @@ -24,12 +29,18 @@ model PlantEnable "Validation model for PlantEnable sequence" Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.PlantEnable plaEna3( - final nIgnReq=2, - final schTab=[0,0; 1,1; 18,1; 24,1]) + final nIgnReq=2) "Testing time-varying boiler plant enable schedule" annotation (Placement(transformation(extent={{80,-50},{100,-30}}))); protected + Buildings.Controls.OBC.CDL.Continuous.Sources.TimeTable enaSch( + final table=schTab, + final smoothness=Buildings.Controls.OBC.CDL.Types.Smoothness.ConstantSegments, + final timeScale=3600) + "Table defining when plant can be enabled" + annotation (Placement(transformation(extent={{-110,110},{-90,130}}))); + Buildings.Controls.OBC.CDL.Continuous.Sources.Sine sin( final amplitude=2, final freqHz=1/(6*60), @@ -100,6 +111,11 @@ protected "Input for outdoor air temperature" annotation (Placement(transformation(extent={{10,-70},{30,-50}}))); + Buildings.Controls.OBC.CDL.Continuous.GreaterThreshold greThr( + final t=0.5) + "Check if schedule lets the controller enable the plant or not" + annotation (Placement(transformation(extent={{-80,110},{-60,130}}))); + equation connect(sin.y, reaToInt.u) annotation (Line(points={{-68,80},{-62,80}}, @@ -114,31 +130,41 @@ equation annotation (Line(points={{38,-20},{32,-20}}, color={0,0,127})); connect(plaEna1.supResReq, reaToInt1.y) - annotation (Line(points={{-22,-36},{-30,-36},{-30,-20},{-38,-20}}, + annotation (Line(points={{-22,-40},{-30,-40},{-30,-20},{-38,-20}}, color={255,127,0})); connect(plaEna2.supResReq, reaToInt2.y) - annotation (Line(points={{78,64},{70,64},{70,80},{62,80}}, + annotation (Line(points={{78,60},{70,60},{70,80},{62,80}}, color={255,127,0})); connect(plaEna2.TOut, sin5.y) - annotation (Line(points={{78,56},{70,56},{70,40},{32,40}}, + annotation (Line(points={{78,54},{70,54},{70,40},{32,40}}, color={0,0,127})); connect(plaEna3.supResReq, reaToInt3.y) - annotation (Line(points={{78,-36},{70,-36},{70,-20},{62,-20}}, + annotation (Line(points={{78,-40},{70,-40},{70,-20},{62,-20}}, color={255,127,0})); connect(plaEna3.TOut, con3.y) - annotation (Line(points={{78,-44},{70,-44},{70,-60},{32,-60}}, + annotation (Line(points={{78,-46},{70,-46},{70,-60},{32,-60}}, color={0,0,127})); connect(reaToInt.y, plaEna.supResReq) - annotation (Line(points={{-38,80},{-30,80},{-30,64},{-22,64}}, + annotation (Line(points={{-38,80},{-30,80},{-30,60},{-22,60}}, color={255,127,0})); connect(sin1.y, plaEna.TOut) - annotation (Line(points={{-68,40},{-30,40},{-30,56},{-22,56}}, + annotation (Line(points={{-68,40},{-30,40},{-30,54},{-22,54}}, color={0,0,127})); connect(con1.y, plaEna1.TOut) - annotation (Line(points={{-68,-60},{-30,-60},{-30,-44},{-22,-44}}, + annotation (Line(points={{-68,-60},{-30,-60},{-30,-46},{-22,-46}}, color={0,0,127})); + connect(enaSch.y[1], greThr.u) + annotation (Line(points={{-88,120},{-82,120}}, color={0,0,127})); + connect(greThr.y, plaEna.uSchEna) annotation (Line(points={{-58,120},{-26,120}, + {-26,66},{-22,66}}, color={255,0,255})); + connect(greThr.y, plaEna1.uSchEna) annotation (Line(points={{-58,120},{-26,120}, + {-26,-34},{-22,-34}}, color={255,0,255})); + connect(greThr.y, plaEna2.uSchEna) annotation (Line(points={{-58,120},{74,120}, + {74,66},{78,66}}, color={255,0,255})); + connect(greThr.y, plaEna3.uSchEna) annotation (Line(points={{-58,120},{74,120}, + {74,-34},{78,-34}}, color={255,0,255})); annotation ( - Icon(coordinateSystem(preserveAspectRatio=false), + Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={Ellipse( lineColor = {75,138,73}, fillColor={255,255,255}, @@ -151,7 +177,7 @@ equation fillPattern = FillPattern.Solid, points={{-36,60},{64,0},{-36,-60},{-36,60}})}), Diagram(coordinateSystem( - preserveAspectRatio=false), + preserveAspectRatio=false, extent={{-140,-140},{140,140}}), graphics={Text( extent={{-72,26},{-24,18}}, textColor={28,108,200}, diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/Validation/ZeroIndexCorrection.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/Validation/ZeroIndexCorrection.mo new file mode 100644 index 00000000000..46efa0e4bbf --- /dev/null +++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/Validation/ZeroIndexCorrection.mo @@ -0,0 +1,85 @@ +within Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.Validation; +model ZeroIndexCorrection + "Validation model for zero stage index correction block" + + Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection + zerStaIndCor + "Validation instance with zero index signal" + annotation (Placement(transformation(extent={{-40,-10},{-20,10}}))); + + Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection + zerStaIndCor1 + "Validation instance with index signal one" + annotation (Placement(transformation(extent={{60,-10},{80,10}}))); + +protected + Buildings.Controls.OBC.CDL.Continuous.Sources.Constant conCap( + final k=10) + "Constant capacity value" + annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}))); + + Buildings.Controls.OBC.CDL.Integers.Sources.Constant conIntZer( + final k=0) + "Zero integer signal" + annotation (Placement(transformation(extent={{-80,30},{-60,50}}))); + + Buildings.Controls.OBC.CDL.Integers.Sources.Constant conIntOne( + final k=1) + "Constant integer one signal" + annotation (Placement(transformation(extent={{20,30},{40,50}}))); + +equation + + connect(conCap.y, zerStaIndCor.uCap) annotation (Line(points={{-58,-40},{-50,-40}, + {-50,-4},{-42,-4}}, color={0,0,127})); + connect(conCap.y, zerStaIndCor1.uCap) annotation (Line(points={{-58,-40},{50,-40}, + {50,-4},{58,-4}}, color={0,0,127})); + connect(conIntZer.y, zerStaIndCor.uInd) annotation (Line(points={{-58,40},{-50, + 40},{-50,4},{-42,4}}, color={255,127,0})); + connect(conIntOne.y, zerStaIndCor1.uInd) annotation (Line(points={{42,40},{50, + 40},{50,4},{58,4}}, color={255,127,0})); +annotation ( + __Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/Up.mos" + "Simulate and plot"), + Documentation(info=" +
+ This example validates + + Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection. +
++ It contains two instances: +
+ This block has been implemented to overcome the zero-index errors being + reported in the block + + Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.Capacities. + The current staging setpoint logic uses an index value of 0 to represent the + block being turned off. This is resulting in errors reported in the instances + of the + + RealExtractor block. +
+
+ To overcome this, the block accepts input signals uInd
for the
+ current index value, and uCap
for the current capacity signal.
+ It outputs a modified index signal yIndMod
and a modified
+ capacity signal yCapMod
.
+
yIndMod
is set to 1 and yCapMod
is set to zero
+ when uInd
is zero.
+ yIndMod
is set to uInd
and yCapMod
is
+ set to uCap
when uInd
is not zero.
+ + For an example of usage, check the + + Capacities block. +
+ ", revisions=" +maxPumSpe
) at 100%.
primarySecondarySensors = true
, the measured flowrate in primary
+use_priSecSen = true
, the measured flowrate in primary
loop VHotWatPri_flow
and the measured flowrate in secondary loop
VHotWatSec_flow
is used to calculate the flow through the decoupler
(VHotWatPri_flow - VHotWatSec_flow
) and generate the control signal.
primarySecondarySensors = false
, the measured flowrate through the
+use_priSecSen = false
, the measured flowrate through the
decoupler is used to calculate the control signal.
oneReqLimLow
.
When there is no single temperature sensor in the primary loop and instead there
are temperature sensors at each boiler supply outlet THotWatBoiSup
,
-primarySecondarySensors = false
, the primary loop temperature is
+use_priSen = false
, the primary loop temperature is
calculated as the weighted average of THotWatBoiSup
, weighted by the
boiler design flowrates boiDesFlo
of the enabled boilers
uBoiSta
.
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Pumps/SecondaryPumps/Controller.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Pumps/SecondaryPumps/Controller.mo
index 5261b8728dc..433e95d4b8c 100644
--- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Pumps/SecondaryPumps/Controller.mo
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Pumps/SecondaryPumps/Controller.mo
@@ -17,20 +17,20 @@ block Controller
annotation (Dialog(group="Plant parameters",
enable=have_varSecPum));
- parameter Integer nPum = 2
+ parameter Integer nPum
"Total number of secondary hot water pumps"
annotation (Dialog(group="Plant parameters"));
- parameter Integer nPumPri = 2
+ parameter Integer nPumPri
"Total number of primary hot water pumps"
annotation (Dialog(group="Plant parameters",
enable=not have_varSecPum));
- parameter Integer nBoi = 2
+ parameter Integer nBoi
"Total number of boilers"
annotation (Dialog(group="Plant parameters"));
- parameter Integer nSen=2
+ parameter Integer nSen
"Total number of remote differential pressure sensors"
annotation (Dialog(group="Plant parameters"));
@@ -60,7 +60,7 @@ block Controller
final min=1e-6,
final unit="m3/s",
displayUnit="m3/s",
- final quantity="VolumeFlowRate") = 0.5
+ final quantity="VolumeFlowRate")
"Total plant design hot water flow rate"
annotation (Dialog(group="Plant parameters"));
@@ -68,7 +68,7 @@ block Controller
final unit="Pa",
displayUnit="Pa",
final quantity="PressureDifference",
- final min=1e-6) = 5*6894.75
+ final min=1e-6)
"Maximum hot water loop local differential pressure setpoint"
annotation (Dialog(tab="Pump control parameters", group="DP-based speed regulation",
enable = speConTyp == Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Types.PrimaryPumpSpeedControlTypes.localDP));
@@ -77,7 +77,7 @@ block Controller
final unit="Pa",
displayUnit="Pa",
final quantity="PressureDifference",
- final min=1e-6) = 5*6894.75
+ final min=1e-6)
"Minimum hot water loop local differential pressure setpoint"
annotation (Dialog(tab="Pump control parameters",
group="DP-based speed regulation",
@@ -337,6 +337,16 @@ protected
parameter Integer pumInd[nPum]={i for i in 1:nPum}
"Pump index, {1,2,...,n}";
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection
+ zerStaIndCor
+ "Block to resolve zero index errors"
+ annotation (Placement(transformation(extent={{-102,-84},{-82,-64}})));
+
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection
+ zerStaIndCor1
+ "Block to resolve zero index errors"
+ annotation (Placement(transformation(extent={{-114,-134},{-94,-114}})));
+
Buildings.Controls.OBC.CDL.Discrete.UnitDelay uniDel(
final samplePeriod=1) if have_varSecPum and not have_secFloSen
"Unit delay for pump speed"
@@ -382,9 +392,7 @@ protected
annotation (Placement(transformation(extent={{-40,220},{-20,240}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor nexLagPum(
- final allowOutOfRange=true,
- final nin=nPum,
- final outOfRangeValue=0)
+ final nin=nPum)
"Next lag pump"
annotation (Placement(transformation(extent={{-80,-60},{-60,-40}})));
@@ -393,9 +401,7 @@ protected
annotation (Placement(transformation(extent={{-8,-60},{12,-40}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor lasLagPum(
- final allowOutOfRange=true,
- final nin=nPum,
- final outOfRangeValue=0)
+ final nin=nPum)
"Last lag pump"
annotation (Placement(transformation(extent={{-80,-110},{-60,-90}})));
@@ -414,7 +420,7 @@ protected
Buildings.Controls.OBC.CDL.Integers.Add addInt
"Integer add"
- annotation (Placement(transformation(extent={{-120,-80},{-100,-60}})));
+ annotation (Placement(transformation(extent={{-132,-80},{-112,-60}})));
Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt1[nPumPri] if not have_varSecPum
"Convert boolean to integer"
@@ -562,20 +568,14 @@ equation
connect(booToInt.y, mulSumInt.u)
annotation (Line(points={{-228,-120},{-202,-120}}, color={255,127,0}));
- connect(addInt.y, nexLagPum.index)
- annotation (Line(points={{-98,-70},{-70,-70},{-70,-62}}, color={255,127,0}));
-
connect(mulSumInt.y, addInt.u2)
- annotation (Line(points={{-178,-120},{-128,-120},{-128,-76},{-122,-76}},
+ annotation (Line(points={{-178,-120},{-166,-120},{-166,-76},{-134,-76}},
color={255,127,0}));
connect(conInt.y, addInt.u1)
- annotation (Line(points={{-252,200},{-140,200},{-140,-64},{-122,-64}},
+ annotation (Line(points={{-252,200},{-140,200},{-140,-64},{-134,-64}},
color={255,127,0}));
- connect(mulSumInt.y, lasLagPum.index)
- annotation (Line(points={{-178,-120},{-70,-120},{-70,-112}}, color={255,127,0}));
-
connect(reaToInt.y, chaPumSta1.uNexLagPum) annotation (Line(points={{-18,230},
{46,230},{46,74},{56,74}}, color={255,127,0}));
@@ -663,12 +663,6 @@ equation
connect(or2.y, chaPumSta3.uLasLagPumSta) annotation (Line(points={{56,-218},{58,
-218},{58,-167},{60,-167}}, color={255,0,255}));
- connect(nexLagPum.y, reaToInt1.u)
- annotation (Line(points={{-58,-50},{-10,-50}}, color={0,0,127}));
-
- connect(lasLagPum.y, reaToInt2.u)
- annotation (Line(points={{-58,-100},{-10,-100}}, color={0,0,127}));
-
connect(mulSumInt.y, intLesEquThr.u) annotation (Line(points={{-178,-120},{-166,
-120},{-166,-218},{-160,-218}}, color={255,127,0}));
@@ -736,9 +730,25 @@ equation
connect(logSwi.y, pumSpeRemDp.uHotWatPum) annotation (Line(points={{214,0},{274,
0},{274,-264},{-74,-264},{-74,-362},{-62,-362}}, color={255,0,255}));
connect(booToInt1.y, mulSumInt1.u[1:2]) annotation (Line(points={{-228,-156},{
- -216,-156},{-216,-159.5},{-202,-159.5}}, color={255,127,0}));
+ -216,-156},{-216,-156},{-202,-156}}, color={255,127,0}));
connect(min.y, yPumSpe)
annotation (Line(points={{182,-400},{300,-400}}, color={0,0,127}));
+ connect(addInt.y, zerStaIndCor.uInd)
+ annotation (Line(points={{-110,-70},{-104,-70}}, color={255,127,0}));
+ connect(zerStaIndCor.yIndMod, nexLagPum.index) annotation (Line(points={{-80,-70},
+ {-70,-70},{-70,-62}}, color={255,127,0}));
+ connect(zerStaIndCor.yCapMod, reaToInt1.u) annotation (Line(points={{-80,-78},
+ {-46,-78},{-46,-50},{-10,-50}}, color={0,0,127}));
+ connect(nexLagPum.y, zerStaIndCor.uCap) annotation (Line(points={{-58,-50},{-52,
+ -50},{-52,-32},{-108,-32},{-108,-78},{-104,-78}}, color={0,0,127}));
+ connect(mulSumInt.y, zerStaIndCor1.uInd)
+ annotation (Line(points={{-178,-120},{-116,-120}}, color={255,127,0}));
+ connect(zerStaIndCor1.yIndMod, lasLagPum.index) annotation (Line(points={{-92,
+ -120},{-70,-120},{-70,-112}}, color={255,127,0}));
+ connect(zerStaIndCor1.yCapMod, reaToInt2.u) annotation (Line(points={{-92,-128},
+ {-44,-128},{-44,-100},{-10,-100}}, color={0,0,127}));
+ connect(lasLagPum.y, zerStaIndCor1.uCap) annotation (Line(points={{-58,-100},{
+ -50,-100},{-50,-86},{-122,-86},{-122,-128},{-116,-128}}, color={0,0,127}));
annotation (defaultComponentName="secPumCon",
Diagram(coordinateSystem(preserveAspectRatio=false,
extent={{-280,-440},{280,260}}),
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/MinimumFlowSetPoint.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/MinimumFlowSetPoint.mo
index 3e3d1c94743..1f48b7b1bca 100644
--- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/MinimumFlowSetPoint.mo
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/MinimumFlowSetPoint.mo
@@ -76,6 +76,22 @@ protected
"Boiler maximum design flowrate expanded for element-wise multiplication
with the staging matrix";
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection zerStaIndCor
+ "Block to resolve errors caused by zero index"
+ annotation (Placement(transformation(extent={{-80,20},{-60,40}})));
+
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection zerStaIndCor1
+ "Block to resolve errors caused by zero index"
+ annotation (Placement(transformation(extent={{-110,-288},{-90,-268}})));
+
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection zerStaIndCor2
+ "Block to resolve errors caused by zero index"
+ annotation (Placement(transformation(extent={{-40,-310},{-20,-290}})));
+
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection zerStaIndCor3
+ "Block to resolve errors caused by zero index"
+ annotation (Placement(transformation(extent={{-8,70},{12,90}})));
+
Buildings.Controls.OBC.CDL.Continuous.IntegratorWithReset intWitRes
"Used to break algebraic loop and sample the minimum flow setpoint at the start
of stage change process to use as reference for calculations"
@@ -175,9 +191,7 @@ protected
annotation (Placement(transformation(extent={{60,-60},{80,-40}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor extIndSig1(
- final allowOutOfRange=true,
- final nin=nSta,
- final outOfRangeValue=1e-6)
+ final nin=nSta)
"Extract flow ratio of previous setpoint during stage-up"
annotation (Placement(transformation(extent={{60,70},{80,90}})));
@@ -204,11 +218,9 @@ protected
annotation (Placement(transformation(extent={{60,30},{80,50}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor extIndSig3(
- final allowOutOfRange=true,
- final nin=nBoi,
- final outOfRangeValue=1e-6)
+ final nin=nBoi)
"Extract max flowrate of boiler being disabled during stage-up"
- annotation (Placement(transformation(extent={{-20,40},{0,60}})));
+ annotation (Placement(transformation(extent={{-12,40},{8,60}})));
Buildings.Controls.OBC.CDL.Continuous.Switch swi
"Pass minimum flow setpoint based on whether stage-up involves a boiler being disabled"
@@ -245,12 +257,10 @@ protected
Buildings.Controls.OBC.CDL.Integers.Add addInt1
"Previous stage during stage change"
- annotation (Placement(transformation(extent={{-90,-310},{-70,-290}})));
+ annotation (Placement(transformation(extent={{-80,-310},{-60,-290}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor extIndSig4(
- final allowOutOfRange=true,
- final nin=nSta,
- final outOfRangeValue=1e-6)
+ final nin=nSta)
"Extract flow ratio of previous setpoint during stage-down"
annotation (Placement(transformation(extent={{60,-280},{80,-260}})));
@@ -259,9 +269,7 @@ protected
annotation (Placement(transformation(extent={{100,-260},{120,-240}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor extIndSig5(
- final allowOutOfRange=true,
- final nin=nBoi,
- final outOfRangeValue=1e-6)
+ final nin=nBoi)
"Extract max flowrate of boiler being disabled during stage-down"
annotation (Placement(transformation(extent={{-40,-270},{-20,-250}})));
@@ -381,9 +389,6 @@ equation
-128,100},{-72,100},{-72,86},{-62,86}},
color={255,127,0}));
- connect(subInt.y, extIndSig1.index) annotation (Line(points={{-38,80},{40,80},
- {40,60},{70,60},{70,68}},color={255,127,0}));
-
connect(matGai.y, extIndSig2.u)
annotation (Line(points={{-18,-220},{-2,-220}},
color={0,0,127}));
@@ -392,7 +397,7 @@ equation
{-128,-240},{10,-240},{10,-232}}, color={255,127,0}));
connect(con3.y, extIndSig3.u) annotation (Line(points={{-58,-220},{-54,-220},{
- -54,50},{-22,50}}, color={0,0,127}));
+ -54,50},{-14,50}}, color={0,0,127}));
connect(max.y, pro2.u1) annotation (Line(points={{122,100},{130,100},{130,76},
{138,76}}, color={0,0,127}));
@@ -445,36 +450,21 @@ equation
connect(pro3.y, swi2.u3) annotation (Line(points={{114,-90},{120,-90},{120,-158},
{138,-158}}, color={0,0,127}));
- connect(extIndSig3.y, add2.u1) annotation (Line(points={{2,50},{40,50},{40,46},
- {58,46}}, color={0,0,127}));
-
connect(extIndSig2.y, add2.u2) annotation (Line(points={{22,-220},{46,-220},{46,
34},{58,34}}, color={0,0,127}));
- connect(uLasDisBoi, extIndSig3.index)
- annotation (Line(points={{-160,30},{-10,30},{-10,38}}, color={255,127,0}));
-
connect(extIndSig.y, max.u2) annotation (Line(points={{82,-50},{88,-50},{88,94},
{98,94}}, color={0,0,127}));
- connect(extIndSig1.y, max.u1) annotation (Line(points={{82,80},{84,80},{84,106},
- {98,106}}, color={0,0,127}));
-
connect(conInt1.y, addInt1.u2) annotation (Line(points={{-108,-320},{-100,-320},
- {-100,-306},{-92,-306}}, color={255,127,0}));
+ {-100,-306},{-82,-306}}, color={255,127,0}));
connect(uStaSet, addInt1.u1) annotation (Line(points={{-160,-90},{-128,-90},{-128,
- -294},{-92,-294}}, color={255,127,0}));
+ -294},{-82,-294}}, color={255,127,0}));
connect(matMax.y, extIndSig4.u) annotation (Line(points={{42,-150},{52,-150},{
52,-270},{58,-270}}, color={0,0,127}));
- connect(addInt1.y, extIndSig4.index) annotation (Line(points={{-68,-300},{70,-300},
- {70,-282}}, color={255,127,0}));
-
- connect(extIndSig4.y, max1.u2) annotation (Line(points={{82,-270},{88,-270},{88,
- -256},{98,-256}}, color={0,0,127}));
-
connect(extIndSig.y, max1.u1) annotation (Line(points={{82,-50},{88,-50},{88,-244},
{98,-244}}, color={0,0,127}));
@@ -484,9 +474,6 @@ equation
connect(extIndSig2.y, add1.u1) annotation (Line(points={{22,-220},{46,-220},{46,
-294},{98,-294}}, color={0,0,127}));
- connect(extIndSig5.y, add1.u2) annotation (Line(points={{-18,-260},{0,-260},{0,
- -306},{98,-306}}, color={0,0,127}));
-
connect(max1.y, pro4.u1) annotation (Line(points={{122,-250},{130,-250},{130,-264},
{138,-264}}, color={0,0,127}));
@@ -496,9 +483,6 @@ equation
connect(pro4.y, swi2.u1) annotation (Line(points={{162,-270},{166,-270},{166,-170},
{132,-170},{132,-142},{138,-142}}, color={0,0,127}));
- connect(uLasDisBoi, extIndSig5.index) annotation (Line(points={{-160,30},{-134,
- 30},{-134,-280},{-30,-280},{-30,-272}}, color={255,127,0}));
-
connect(swi.y, lin.f2) annotation (Line(points={{162,10},{166,10},{166,-8},{258,
-8}}, color={0,0,127}));
connect(swi2.y, lin1.f2) annotation (Line(points={{162,-150},{254,-150},{254,-148},
@@ -563,6 +547,39 @@ equation
172,-136},{258,-136}}, color={0,0,127}));
connect(intWitRes.y, sub3.u2) annotation (Line(points={{162,-100},{172,-100},{
172,-136},{220,-136},{220,-206},{228,-206}}, color={0,0,127}));
+ connect(uLasDisBoi, zerStaIndCor.uInd) annotation (Line(points={{-160,30},{-86,
+ 30},{-86,34},{-82,34}}, color={255,127,0}));
+ connect(zerStaIndCor.yIndMod, extIndSig3.index)
+ annotation (Line(points={{-58,34},{-2,34},{-2,38}}, color={255,127,0}));
+ connect(zerStaIndCor.yCapMod, add2.u1) annotation (Line(points={{-58,26},{38,26},
+ {38,46},{58,46}}, color={0,0,127}));
+ connect(extIndSig3.y, zerStaIndCor.uCap) annotation (Line(points={{10,50},{20,
+ 50},{20,66},{-90,66},{-90,26},{-82,26}}, color={0,0,127}));
+ connect(uLasDisBoi, zerStaIndCor1.uInd) annotation (Line(points={{-160,30},{-132,
+ 30},{-132,-274},{-112,-274}}, color={255,127,0}));
+ connect(zerStaIndCor1.yIndMod, extIndSig5.index) annotation (Line(points={{-88,
+ -274},{-30,-274},{-30,-272}}, color={255,127,0}));
+ connect(zerStaIndCor1.yCapMod, add1.u2) annotation (Line(points={{-88,-282},{0,
+ -282},{0,-306},{98,-306}}, color={0,0,127}));
+ connect(extIndSig5.y, zerStaIndCor1.uCap) annotation (Line(points={{-18,-260},
+ {-10,-260},{-10,-244},{-120,-244},{-120,-282},{-112,-282}}, color={0,0,
+ 127}));
+ connect(addInt1.y, zerStaIndCor2.uInd) annotation (Line(points={{-58,-300},{-50,
+ -300},{-50,-296},{-42,-296}}, color={255,127,0}));
+ connect(zerStaIndCor2.yIndMod, extIndSig4.index) annotation (Line(points={{-18,
+ -296},{70,-296},{70,-282}}, color={255,127,0}));
+ connect(zerStaIndCor2.yCapMod, max1.u2) annotation (Line(points={{-18,-304},{90,
+ -304},{90,-256},{98,-256}}, color={0,0,127}));
+ connect(extIndSig4.y, zerStaIndCor2.uCap) annotation (Line(points={{82,-270},{
+ 86,-270},{86,-320},{-50,-320},{-50,-304},{-42,-304}}, color={0,0,127}));
+ connect(subInt.y, zerStaIndCor3.uInd) annotation (Line(points={{-38,80},{-20,80},
+ {-20,84},{-10,84}}, color={255,127,0}));
+ connect(zerStaIndCor3.yIndMod, extIndSig1.index) annotation (Line(points={{14,
+ 84},{30,84},{30,60},{70,60},{70,68}}, color={255,127,0}));
+ connect(zerStaIndCor3.yCapMod, max.u1) annotation (Line(points={{14,76},{20,76},
+ {20,106},{98,106}}, color={0,0,127}));
+ connect(extIndSig1.y, zerStaIndCor3.uCap) annotation (Line(points={{82,80},{84,
+ 80},{84,100},{-14,100},{-14,76},{-10,76}}, color={0,0,127}));
annotation (
defaultComponentName="minBoiFloSet",
Icon(coordinateSystem(extent={{-100,-100},{100,100}}),
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/Validation/MinimumFlowSetPoint.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/Validation/MinimumFlowSetPoint.mo
index f3966daa1ab..41217b894bb 100644
--- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/Validation/MinimumFlowSetPoint.mo
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/Validation/MinimumFlowSetPoint.mo
@@ -36,6 +36,21 @@ model MinimumFlowSetPoint "Validation model for MinimumFlowSetPoint sequence"
annotation (Placement(transformation(extent={{0,-90},{20,-70}})));
protected
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection
+ zerStaIndCor
+ "Block to resolve zero index errors"
+ annotation (Placement(transformation(extent={{-80,50},{-60,70}})));
+
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection
+ zerStaIndCor1
+ "Block to resolve zero index errors"
+ annotation (Placement(transformation(extent={{-90,-190},{-70,-170}})));
+
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection
+ zerStaIndCor2
+ "Block to resolve zero index errors"
+ annotation (Placement(transformation(extent={{-20,-60},{0,-40}})));
+
Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ram(
final height=3,
final duration=45,
@@ -54,9 +69,7 @@ protected
annotation (Placement(transformation(extent={{-90,90},{-70,110}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor extIndSig(
- final allowOutOfRange=true,
- final nin=3,
- final outOfRangeValue=0)
+ final nin=3)
"Extract scalar out of vector"
annotation (Placement(transformation(extent={{-60,90},{-40,110}})));
@@ -90,22 +103,20 @@ protected
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant con2[3](
final k={2,1,0})
"Last boiler being disabled during stage change"
- annotation (Placement(transformation(extent={{-90,-30},{-70,-10}})));
+ annotation (Placement(transformation(extent={{-90,-150},{-70,-130}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor extIndSig1(
- final allowOutOfRange=true,
- final nin=3,
- final outOfRangeValue=0)
+ final nin=3)
"Extract scalar out of vector"
- annotation (Placement(transformation(extent={{-60,-30},{-40,-10}})));
+ annotation (Placement(transformation(extent={{-60,-150},{-40,-130}})));
Buildings.Controls.OBC.CDL.Conversions.RealToInteger reaToInt3
"Real to Integer conversion"
- annotation (Placement(transformation(extent={{20,-30},{40,-10}})));
+ annotation (Placement(transformation(extent={{20,-150},{40,-130}})));
Buildings.Controls.OBC.CDL.Continuous.GreaterThreshold greThr1
"Check if current stage setpoint involves boilers being turned on and off"
- annotation (Placement(transformation(extent={{-30,-60},{-10,-40}})));
+ annotation (Placement(transformation(extent={{20,-30},{40,-10}})));
Buildings.Controls.OBC.CDL.Integers.Change cha2
"Detect change in setpoint"
@@ -118,14 +129,12 @@ protected
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant con3[3](
final k={1,0,0})
"Vector indicating if stage change involves boilers being turned on and off"
- annotation (Placement(transformation(extent={{-90,-60},{-70,-40}})));
+ annotation (Placement(transformation(extent={{-90,-30},{-70,-10}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor extIndSig2(
- final allowOutOfRange=true,
- final nin=3,
- final outOfRangeValue=0)
+ final nin=3)
"Extract scalar out of vector"
- annotation (Placement(transformation(extent={{-60,-60},{-40,-40}})));
+ annotation (Placement(transformation(extent={{-30,-30},{-10,-10}})));
equation
connect(ram.y, reaToInt.u)
@@ -137,18 +146,9 @@ equation
connect(con1.y, extIndSig.u)
annotation (Line(points={{-68,100},{-62,100}}, color={0,0,127}));
- connect(reaToInt.y, extIndSig.index) annotation (Line(points={{-38,20},{64,20},
- {64,86},{-50,86},{-50,88}}, color={255,127,0}));
-
- connect(extIndSig.y, reaToInt1.u)
- annotation (Line(points={{-38,100},{18,100}}, color={0,0,127}));
-
connect(reaToInt1.y, minBoiFloSet.uLasDisBoi) annotation (Line(points={{42,100},
{66,100},{66,66},{68,66}}, color={255,127,0}));
- connect(extIndSig.y, greThr.u) annotation (Line(points={{-38,100},{-34,100},{-34,
- 70},{-32,70}}, color={0,0,127}));
-
connect(greThr.y, minBoiFloSet.uOnOff) annotation (Line(points={{-8,70},{60,70},
{60,62},{68,62}}, color={255,0,255}));
@@ -171,19 +171,14 @@ equation
{64,-100},{64,-66},{68,-66}}, color={255,127,0}));
connect(con2.y, extIndSig1.u)
- annotation (Line(points={{-68,-20},{-62,-20}}, color={0,0,127}));
-
- connect(reaToInt2.y, extIndSig1.index) annotation (Line(points={{-38,-100},{64,
- -100},{64,-34},{-50,-34},{-50,-32}}, color={255,127,0}));
-
- connect(extIndSig1.y, reaToInt3.u)
- annotation (Line(points={{-38,-20},{18,-20}}, color={0,0,127}));
+ annotation (Line(points={{-68,-140},{-62,-140}},
+ color={0,0,127}));
- connect(reaToInt3.y, minBoiFloSet1.uLasDisBoi) annotation (Line(points={{42,-20},
- {66,-20},{66,-54},{68,-54}}, color={255,127,0}));
+ connect(reaToInt3.y, minBoiFloSet1.uLasDisBoi) annotation (Line(points={{42,-140},
+ {56,-140},{56,-54},{68,-54}},color={255,127,0}));
- connect(greThr1.y, minBoiFloSet1.uOnOff) annotation (Line(points={{-8,-50},{60,
- -50},{60,-58},{68,-58}}, color={255,0,255}));
+ connect(greThr1.y, minBoiFloSet1.uOnOff) annotation (Line(points={{42,-20},{60,
+ -20},{60,-58},{68,-58}}, color={255,0,255}));
connect(reaToInt2.y, cha2.u) annotation (Line(points={{-38,-100},{-36,-100},{-36,
-80},{-32,-80}}, color={255,127,0}));
@@ -198,14 +193,35 @@ equation
{60,-80},{60,-62},{68,-62}}, color={255,0,255}));
connect(con3.y, extIndSig2.u)
- annotation (Line(points={{-68,-50},{-62,-50}}, color={0,0,127}));
-
- connect(extIndSig2.y, greThr1.u)
- annotation (Line(points={{-38,-50},{-32,-50}}, color={0,0,127}));
-
- connect(reaToInt2.y, extIndSig2.index) annotation (Line(points={{-38,-100},{64,
- -100},{64,-64},{-50,-64},{-50,-62}}, color={255,127,0}));
-
+ annotation (Line(points={{-68,-20},{-32,-20}}, color={0,0,127}));
+
+ connect(reaToInt.y, zerStaIndCor.uInd) annotation (Line(points={{-38,20},{64,20},
+ {64,84},{-90,84},{-90,64},{-82,64}}, color={255,127,0}));
+ connect(zerStaIndCor.yIndMod, extIndSig.index)
+ annotation (Line(points={{-58,64},{-50,64},{-50,88}}, color={255,127,0}));
+ connect(zerStaIndCor.yCapMod, reaToInt1.u) annotation (Line(points={{-58,56},{
+ -34,56},{-34,100},{18,100}}, color={0,0,127}));
+ connect(zerStaIndCor.yCapMod, greThr.u) annotation (Line(points={{-58,56},{-34,
+ 56},{-34,70},{-32,70}}, color={0,0,127}));
+ connect(extIndSig.y, zerStaIndCor.uCap) annotation (Line(points={{-38,100},{-36,
+ 100},{-36,80},{-86,80},{-86,56},{-82,56}}, color={0,0,127}));
+ connect(reaToInt2.y, zerStaIndCor1.uInd) annotation (Line(points={{-38,-100},{
+ -30,-100},{-30,-120},{-96,-120},{-96,-176},{-92,-176}}, color={255,127,
+ 0}));
+ connect(zerStaIndCor1.yIndMod, extIndSig1.index) annotation (Line(points={{-68,
+ -176},{-50,-176},{-50,-152}}, color={255,127,0}));
+ connect(zerStaIndCor1.yCapMod, reaToInt3.u) annotation (Line(points={{-68,-184},
+ {0,-184},{0,-140},{18,-140}}, color={0,0,127}));
+ connect(extIndSig1.y, zerStaIndCor1.uCap) annotation (Line(points={{-38,-140},
+ {-30,-140},{-30,-196},{-96,-196},{-96,-184},{-92,-184}}, color={0,0,127}));
+ connect(reaToInt2.y, zerStaIndCor2.uInd) annotation (Line(points={{-38,-100},{
+ -36,-100},{-36,-46},{-22,-46}}, color={255,127,0}));
+ connect(zerStaIndCor2.yIndMod, extIndSig2.index) annotation (Line(points={{2,-46},
+ {8,-46},{8,-34},{-20,-34},{-20,-32}}, color={255,127,0}));
+ connect(extIndSig2.y, zerStaIndCor2.uCap) annotation (Line(points={{-8,-20},{-4,
+ -20},{-4,0},{-40,0},{-40,-54},{-22,-54}}, color={0,0,127}));
+ connect(zerStaIndCor2.yCapMod, greThr1.u) annotation (Line(points={{2,-54},{12,
+ -54},{12,-20},{18,-20}}, color={0,0,127}));
annotation (
Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}),
graphics={Ellipse(
@@ -220,7 +236,7 @@ equation
fillPattern = FillPattern.Solid,
points={{-36,60},{64,0},{-36,-60},{-36,60}})}),
Diagram(coordinateSystem(
- preserveAspectRatio=false, extent={{-100,-120},{100,120}})),
+ preserveAspectRatio=false, extent={{-100,-220},{100,120}})),
experiment(
StopTime=10,
Interval=1,
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Capacities.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Capacities.mo
index 090ff09856b..b62d96dadd4 100644
--- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Capacities.mo
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Capacities.mo
@@ -89,6 +89,26 @@ protected
final parameter Real larGai = 10
"Large gain";
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection zerStaIndCor
+ "Modify real extractor inputs and outputs"
+ annotation (Placement(transformation(extent={{-120,110},{-100,130}})));
+
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection zerStaIndCor1
+ "Modify real extractor inputs and outputs"
+ annotation (Placement(transformation(extent={{-20,40},{0,60}})));
+
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection zerStaIndCor2
+ "Modify real extractor inputs and outputs"
+ annotation (Placement(transformation(extent={{-120,-10},{-100,10}})));
+
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection zerStaIndCor3
+ "Modify real extractor inputs and outputs"
+ annotation (Placement(transformation(extent={{-40,-60},{-20,-40}})));
+
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection zerStaIndCor4
+ "Modify real extractor inputs and outputs"
+ annotation (Placement(transformation(extent={{-40,-100},{-20,-80}})));
+
Buildings.Controls.OBC.CDL.Routing.RealExtractor cap(
final nin=nSta)
"Extracts the design capacity at the current stage"
@@ -135,17 +155,9 @@ protected
equation
connect(swi2.y, yUpDes) annotation (Line(points={{182,60},{220,60}}, color={0,0,127}));
- connect(upCap.y, swi2.u3) annotation (
- Line(points={{22,80},{80,80},{80,52},{158,52}}, color={0,0,127}));
connect(yMin, yMin)
annotation (Line(points={{220,-20},{220,-20}}, color={0,0,127}));
- connect(upCapMin.y, swi4.u3) annotation (Line(points={{22,-30},{40,-30},{40,-98},
- {158,-98}}, color={0,0,127}));
connect(swi4.y, yUpMin) annotation (Line(points={{182,-90},{220,-90}}, color={0,0,127}));
- connect(capMin.y, yMin) annotation (Line(points={{22,-70},{80,-70},{80,-20},{220,
- -20}}, color={0,0,127}));
- connect(dowCap.y, swi1.u3) annotation (Line(points={{-78,80},{-40,80},{-40,12},
- {98,12}}, color={0,0,127}));
connect(uMinCap, upCapMin.u) annotation (Line(points={{-220,-180},{-120,-180},
{-120,-30},{-2,-30}}, color={0,0,127}));
connect(uMinCap, capMin.u) annotation (Line(points={{-220,-180},{-120,-180},{-120,
@@ -162,30 +174,58 @@ equation
{158,60}}, color={255,0,255}));
connect(uHig, swi4.u2) annotation (Line(points={{-220,-120},{140,-120},{140,-90},
{158,-90}}, color={255,0,255}));
- connect(cap.y, gai.u) annotation (Line(points={{-78,150},{-70,150},{-70,120},{
- -62,120}}, color={0,0,127}));
connect(gai.y, swi2.u1) annotation (Line(points={{-38,120},{100,120},{100,68},
{158,68}}, color={0,0,127}));
connect(gai.y, swi4.u1) annotation (Line(points={{-38,120},{60,120},{60,-82},{
158,-82}}, color={0,0,127}));
connect(swi1.y, yDowDes) annotation (Line(points={{122,20},{220,20}}, color={0,0,127}));
- connect(u, cap.index) annotation (Line(points={{-220,120},{-90,120},{-90,138}},
- color={255,127,0}));
- connect(uDown, dowCap.index) annotation (Line(points={{-220,0},{-90,0},{-90,68}},
- color={255,127,0}));
- connect(uUp, upCap.index) annotation (Line(points={{-220,60},{10,60},{10,68}},
- color={255,127,0}));
- connect(uUp, upCapMin.index) annotation (Line(points={{-220,60},{-60,60},{-60,
- -50},{10,-50},{10,-42}}, color={255,127,0}));
- connect(cap.y, yDes) annotation (Line(points={{-78,150},{220,150}},
- color={0,0,127}));
- connect(capMin.y, swi1.u1) annotation (Line(points={{22,-70},{80,-70},{80,28},
- {98,28}},color={0,0,127}));
- connect(u, capMin.index) annotation (Line(points={{-220,120},{-160,120},{-160,
- -90},{10,-90},{10,-82}}, color={255,127,0}));
connect(yUpMin, yUpMin)
annotation (Line(points={{220,-90},{220,-90}}, color={0,0,127}));
+ connect(u, zerStaIndCor.uInd) annotation (Line(points={{-220,120},{-160,120},{
+ -160,124},{-122,124}}, color={255,127,0}));
+ connect(zerStaIndCor.yIndMod, cap.index) annotation (Line(points={{-98,124},{-90,
+ 124},{-90,138}}, color={255,127,0}));
+ connect(cap.y, zerStaIndCor.uCap) annotation (Line(points={{-78,150},{-74,150},
+ {-74,172},{-130,172},{-130,116},{-122,116}}, color={0,0,127}));
+ connect(zerStaIndCor.yCapMod, gai.u) annotation (Line(points={{-98,116},{-70,116},
+ {-70,120},{-62,120}}, color={0,0,127}));
+ connect(zerStaIndCor.yCapMod, yDes) annotation (Line(points={{-98,116},{-70,116},
+ {-70,150},{220,150}}, color={0,0,127}));
+ connect(zerStaIndCor1.yIndMod, upCap.index)
+ annotation (Line(points={{2,54},{10,54},{10,68}}, color={255,127,0}));
+ connect(uUp, zerStaIndCor1.uInd) annotation (Line(points={{-220,60},{-60,60},{
+ -60,54},{-22,54}}, color={255,127,0}));
+ connect(upCap.y, zerStaIndCor1.uCap) annotation (Line(points={{22,80},{30,80},
+ {30,100},{-30,100},{-30,46},{-22,46}}, color={0,0,127}));
+ connect(zerStaIndCor1.yCapMod, swi2.u3) annotation (Line(points={{2,46},{20,46},
+ {20,52},{158,52}}, color={0,0,127}));
+ connect(uDown, zerStaIndCor2.uInd) annotation (Line(points={{-220,0},{-128,0},
+ {-128,4},{-122,4}}, color={255,127,0}));
+ connect(zerStaIndCor2.yIndMod, dowCap.index)
+ annotation (Line(points={{-98,4},{-90,4},{-90,68}}, color={255,127,0}));
+ connect(dowCap.y, zerStaIndCor2.uCap) annotation (Line(points={{-78,80},{-70,80},
+ {-70,100},{-132,100},{-132,-4},{-122,-4}}, color={0,0,127}));
+ connect(zerStaIndCor2.yCapMod, swi1.u3) annotation (Line(points={{-98,-4},{-80,
+ -4},{-80,12},{98,12}}, color={0,0,127}));
+ connect(uUp, zerStaIndCor3.uInd) annotation (Line(points={{-220,60},{-60,60},{
+ -60,-46},{-42,-46}}, color={255,127,0}));
+ connect(zerStaIndCor3.yIndMod, upCapMin.index) annotation (Line(points={{-18,-46},
+ {-10,-46},{-10,-50},{10,-50},{10,-42}}, color={255,127,0}));
+ connect(upCapMin.y, zerStaIndCor3.uCap) annotation (Line(points={{22,-30},{30,
+ -30},{30,-10},{-50,-10},{-50,-54},{-42,-54}}, color={0,0,127}));
+ connect(zerStaIndCor3.yCapMod, swi4.u3) annotation (Line(points={{-18,-54},{40,
+ -54},{40,-98},{158,-98}}, color={0,0,127}));
+ connect(u, zerStaIndCor4.uInd) annotation (Line(points={{-220,120},{-160,120},
+ {-160,-86},{-42,-86}}, color={255,127,0}));
+ connect(zerStaIndCor4.yIndMod, capMin.index)
+ annotation (Line(points={{-18,-86},{10,-86},{10,-82}}, color={255,127,0}));
+ connect(zerStaIndCor4.yCapMod, swi1.u1) annotation (Line(points={{-18,-94},{70,
+ -94},{70,28},{98,28}}, color={0,0,127}));
+ connect(zerStaIndCor4.yCapMod, yMin) annotation (Line(points={{-18,-94},{70,-94},
+ {70,-20},{220,-20}}, color={0,0,127}));
+ connect(capMin.y, zerStaIndCor4.uCap) annotation (Line(points={{22,-70},{30,-70},
+ {30,-110},{-50,-110},{-50,-94},{-42,-94}}, color={0,0,127}));
annotation (defaultComponentName = "cap",
Icon(graphics={
Rectangle(
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Down.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Down.mo
index 4e02a279727..d5ce52f41d0 100644
--- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Down.mo
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Down.mo
@@ -234,19 +234,29 @@ block Down
annotation (Placement(transformation(extent={{-160,120},{-140,140}})));
protected
+ Buildings.Controls.OBC.CDL.Continuous.AddParameter addParDivZer(
+ final p=1e-6)
+ "Add small value to input signal to prevent divide by zero"
+ annotation (Placement(transformation(extent={{-166,10},{-146,30}})));
+
+ Buildings.Controls.OBC.CDL.Continuous.AddParameter addParDivZer1(
+ final p=1e-6)
+ "Add small value to input signal to prevent divide by zero"
+ annotation (Placement(transformation(extent={{-166,-66},{-146,-46}})));
+
Buildings.Controls.OBC.CDL.Logical.Not not1
"Logical Not"
annotation (Placement(transformation(extent={{-120,120},{-100,140}})));
Buildings.Controls.OBC.CDL.Continuous.Divide div
"Thermal capacity ratio"
- annotation (Placement(transformation(extent={{-150,34},{-130,54}})));
+ annotation (Placement(transformation(extent={{-150,44},{-130,64}})));
Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys(
final uLow=fraMinFir,
final uHigh=fraMinFir + sigDif)
"Hysteresis loop"
- annotation (Placement(transformation(extent={{-120,34},{-100,54}})));
+ annotation (Placement(transformation(extent={{-120,44},{-100,64}})));
Buildings.Controls.OBC.CDL.Logical.Or or2 if have_priOnl
"Logical Or"
@@ -254,13 +264,13 @@ protected
Buildings.Controls.OBC.CDL.Continuous.Divide div1
"Thermal capacity ratio"
- annotation (Placement(transformation(extent={{-160,-50},{-140,-30}})));
+ annotation (Placement(transformation(extent={{-160,-40},{-140,-20}})));
Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys1(
final uLow=fraDesCap,
final uHigh=fraDesCap + sigDif)
"Hysteresis loop"
- annotation (Placement(transformation(extent={{-130,-50},{-110,-30}})));
+ annotation (Placement(transformation(extent={{-130,-40},{-110,-20}})));
Buildings.Controls.OBC.CDL.Logical.And3 and3
"Logical And"
@@ -308,17 +318,17 @@ protected
Buildings.Controls.OBC.CDL.Logical.Not not2
"Logical Not"
- annotation (Placement(transformation(extent={{-90,34},{-70,54}})));
+ annotation (Placement(transformation(extent={{-90,44},{-70,64}})));
Buildings.Controls.OBC.CDL.Logical.Not not3
"Logical Not"
- annotation (Placement(transformation(extent={{-90,-50},{-70,-30}})));
+ annotation (Placement(transformation(extent={{-90,-40},{-70,-20}})));
Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys4(
final uLow=bypValClo,
final uHigh=bypValClo + sigDif) if have_priOnl
"Hysteresis loop"
- annotation (Placement(transformation(extent={{-158,-10},{-138,10}})));
+ annotation (Placement(transformation(extent={{-140,-10},{-120,10}})));
Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys2(
final uLow=sigDif,
@@ -386,7 +396,7 @@ protected
Buildings.Controls.OBC.CDL.Logical.And and5
"Turn on timer when hysteresis turns on and reset it when hysteresis turns
off or stage change process is completed"
- annotation (Placement(transformation(extent={{-50,-50},{-30,-30}})));
+ annotation (Placement(transformation(extent={{-50,-40},{-30,-20}})));
Buildings.Controls.OBC.CDL.Logical.And and6 if not have_priOnl
"Turn on timer when hysteresis turns on and reset it when hysteresis turns
@@ -408,15 +418,11 @@ equation
connect(faiSafCon.TSup, THotWatSup)
annotation (Line(points={{-162,130},{-170,130},{-170,120},{-200,120}},
color={0,0,127}));
- connect(div.u2, uCapMin) annotation (Line(points={{-152,38},{-160,38},{-160,30},
- {-200,30}}, color={0,0,127}));
connect(hys.u, div.y)
- annotation (Line(points={{-122,44},{-128,44}},
+ annotation (Line(points={{-122,54},{-124,54},{-124,54},{-128,54}},
color={0,0,127}));
- connect(div1.u2, uCapDowDes) annotation (Line(points={{-162,-46},{-172,-46},{-172,
- -30},{-200,-30}}, color={0,0,127}));
connect(hys1.u, div1.y)
- annotation (Line(points={{-132,-40},{-138,-40}},
+ annotation (Line(points={{-132,-30},{-134,-30},{-134,-30},{-138,-30}},
color={0,0,127}));
connect(and3.y, yStaDow)
annotation (Line(points={{202,0},{240,0}}, color={255,0,255}));
@@ -444,16 +450,18 @@ equation
color={255,0,255}));
connect(and3.u2, logSwi1.y) annotation (Line(points={{178,0},{134,0},{134,-20},
{170,-20},{170,-90},{162,-90}}, color={255,0,255}));
- connect(div.u1, uCapReq) annotation (Line(points={{-152,50},{-160,50},{-160,60},
- {-200,60}}, color={0,0,127}));
- connect(div1.u1, uCapReq) annotation (Line(points={{-162,-34},{-166,-34},{-166,
+ connect(div.u1, uCapReq) annotation (Line(points={{-152,60},{-200,60}},
+ color={0,0,127}));
+ connect(div1.u1, uCapReq) annotation (Line(points={{-162,-24},{-172,-24},{-172,
60},{-200,60}}, color={0,0,127}));
connect(not2.u, hys.y)
- annotation (Line(points={{-92,44},{-98,44}}, color={255,0,255}));
+ annotation (Line(points={{-92,54},{-94,54},{-94,54},{-98,54}},
+ color={255,0,255}));
connect(hys1.y, not3.u)
- annotation (Line(points={{-108,-40},{-92,-40}},color={255,0,255}));
+ annotation (Line(points={{-108,-30},{-104,-30},{-104,-30},{-92,-30}},
+ color={255,0,255}));
connect(hys4.u, uBypValPos)
- annotation (Line(points={{-160,0},{-200,0}}, color={0,0,127}));
+ annotation (Line(points={{-142,0},{-200,0}}, color={0,0,127}));
connect(hys2.y, not4.u)
annotation (Line(points={{-124,-80},{-122,-80}},
color={255,0,255}));
@@ -489,18 +497,20 @@ equation
connect(tim3.u, and1.y)
annotation (Line(points={{-22,44},{-28,44}}, color={255,0,255}));
connect(and1.u1, not2.y)
- annotation (Line(points={{-52,44},{-68,44}}, color={255,0,255}));
+ annotation (Line(points={{-52,44},{-60,44},{-60,54},{-68,54}},
+ color={255,0,255}));
connect(tim1.u, and4.y)
annotation (Line(points={{-22,0},{-28,0}}, color={255,0,255}));
connect(and5.y, tim.u)
- annotation (Line(points={{-28,-40},{30,-40},{30,-20},{48,-20}},
+ annotation (Line(points={{-28,-30},{30,-30},{30,-20},{48,-20}},
color={255,0,255}));
connect(tim2.u, and6.y)
annotation (Line(points={{-22,-100},{-28,-100}}, color={255,0,255}));
connect(hys4.y, and4.u1)
- annotation (Line(points={{-136,0},{-52,0}}, color={255,0,255}));
+ annotation (Line(points={{-118,0},{-52,0}}, color={255,0,255}));
connect(not3.y, and5.u1)
- annotation (Line(points={{-68,-40},{-52,-40}}, color={255,0,255}));
+ annotation (Line(points={{-68,-30},{-64,-30},{-64,-30},{-52,-30}},
+ color={255,0,255}));
connect(and2.y, and6.u1)
annotation (Line(points={{-68,-100},{-52,-100}}, color={255,0,255}));
connect(not5.u, uStaChaProEnd)
@@ -509,8 +519,8 @@ equation
-52,36}}, color={255,0,255}));
connect(not5.y, and4.u2) annotation (Line(points={{-98,90},{-60,90},{-60,-8},{
-52,-8}}, color={255,0,255}));
- connect(not5.y, and5.u2) annotation (Line(points={{-98,90},{-60,90},{-60,-48},
- {-52,-48}}, color={255,0,255}));
+ connect(not5.y, and5.u2) annotation (Line(points={{-98,90},{-60,90},{-60,-38},
+ {-52,-38}}, color={255,0,255}));
connect(not5.y, and6.u2) annotation (Line(points={{-98,90},{-60,90},{-60,-108},
{-52,-108}}, color={255,0,255}));
@@ -520,7 +530,7 @@ equation
{58,-98}}, color={255,0,255}));
connect(tim1.passed, or2.u2) annotation (Line(points={{2,-8},{50,-8},{50,10},{
58,10}}, color={255,0,255}));
- connect(and5.y, tim4.u) annotation (Line(points={{-28,-40},{30,-40},{30,-60},{
+ connect(and5.y, tim4.u) annotation (Line(points={{-28,-30},{30,-30},{30,-60},{
48,-60}}, color={255,0,255}));
connect(tim.passed, logSwi.u1) annotation (Line(points={{72,-28},{90,-28},{90,
-32},{98,-32}}, color={255,0,255}));
@@ -528,6 +538,14 @@ equation
-48},{98,-48}}, color={255,0,255}));
connect(tim2.passed, or1.u2) annotation (Line(points={{2,-108},{40,-108},{40,-106},
{58,-106}}, color={255,0,255}));
+ connect(uCapMin, addParDivZer.u) annotation (Line(points={{-200,30},{-176,30},
+ {-176,20},{-168,20}}, color={0,0,127}));
+ connect(addParDivZer.y, div.u2) annotation (Line(points={{-144,20},{-134,20},{
+ -134,40},{-160,40},{-160,48},{-152,48}}, color={0,0,127}));
+ connect(uCapDowDes, addParDivZer1.u) annotation (Line(points={{-200,-30},{-176,
+ -30},{-176,-56},{-168,-56}}, color={0,0,127}));
+ connect(addParDivZer1.y, div1.u2) annotation (Line(points={{-144,-56},{-132,-56},
+ {-132,-42},{-172,-42},{-172,-36},{-162,-36}}, color={0,0,127}));
annotation(defaultComponentName = "staDow",
Icon(coordinateSystem(extent={{-100,-160},{100,190}}),
graphics={
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/EfficiencyCondition.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/EfficiencyCondition.mo
index e697a0c036e..b824821e1f1 100644
--- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/EfficiencyCondition.mo
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/EfficiencyCondition.mo
@@ -95,12 +95,23 @@ block EfficiencyCondition
iconTransformation(extent={{100,-20},{140,20}})));
protected
+ Buildings.Controls.OBC.CDL.Continuous.AddParameter addParDivZer(
+ final p=1e-6)
+ "Add small value to input signal to prevent divide by zero"
+ annotation (Placement(transformation(extent={{-110,90},{-90,110}})));
+
+ Buildings.Controls.OBC.CDL.Continuous.AddParameter addParDivZer1(
+ final p=1e-6)
+ "Add small value to input signal to prevent divide by zero"
+ annotation (Placement(transformation(extent={{-112,10},{-92,30}})));
+
Buildings.Controls.OBC.CDL.Continuous.Divide div
"Divider to get relative value of required heating capacity"
annotation (Placement(transformation(extent={{-80,20},{-60,40}})));
Buildings.Controls.OBC.CDL.Continuous.AddParameter addPar(
final p=1e-6)
+ "Add small value to input signal to prevent divide by zero"
annotation (Placement(transformation(extent={{-80,-80},{-60,-60}})));
Buildings.Controls.OBC.CDL.Continuous.Divide div1
@@ -187,11 +198,6 @@ protected
annotation (Placement(transformation(extent={{-40,-190},{-20,-170}})));
equation
- connect(div.u2,uCapUpMin)
- annotation (Line(points={{-82,24},{-110,24},{-110,20},{-140,20}},
- color={0,0,127}));
- connect(div1.u2, uCapDes) annotation (Line(points={{-82,64},{-90,64},{-90,70},
- {-114,70},{-114,100},{-140,100}}, color={0,0,127}));
connect(sub1.u1, VHotWat_flow) annotation (Line(points={{-82,-34},{-110,-34},{
-110,-20},{-140,-20}}, color={0,0,127}));
connect(sub1.u2, VUpMinSet_flow) annotation (Line(points={{-82,-46},{-110,-46},
@@ -268,6 +274,14 @@ equation
{-110,-70},{-82,-70}}, color={0,0,127}));
connect(addPar.y, div2.u2) annotation (Line(points={{-58,-70},{-50,-70},{-50,-56},
{-42,-56}}, color={0,0,127}));
+ connect(uCapDes, addParDivZer.u)
+ annotation (Line(points={{-140,100},{-112,100}}, color={0,0,127}));
+ connect(addParDivZer.y, div1.u2) annotation (Line(points={{-88,100},{-86,100},
+ {-86,64},{-82,64}}, color={0,0,127}));
+ connect(uCapUpMin, addParDivZer1.u)
+ annotation (Line(points={{-140,20},{-114,20}}, color={0,0,127}));
+ connect(addParDivZer1.y, div.u2) annotation (Line(points={{-90,20},{-86,20},{-86,
+ 24},{-82,24}}, color={0,0,127}));
annotation (
defaultComponentName = "effCon",
Icon(
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Validation/Controller.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Validation/Controller.mo
index c70da3b199e..011376162d5 100644
--- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Validation/Controller.mo
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Validation/Controller.mo
@@ -2,6 +2,13 @@ within Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Validation;
model Controller
"Validation model for boiler plant control sequence"
+ parameter Integer nSchRow(
+ final min=1) = 4
+ "Number of rows to be created for plant schedule table";
+
+ parameter Real schTab[nSchRow,2] = [0,1; 6,1; 18,1; 24,1]
+ "Table defining schedule for enabling plant";
+
Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Controller controller(
final have_priOnl=true,
final nBoi=2,
@@ -347,146 +354,193 @@ protected
"Measured hot water volume flowrate in secondary loop"
annotation (Placement(transformation(extent={{140,-100},{160,-80}})));
+ Buildings.Controls.OBC.CDL.Continuous.GreaterThreshold greThr(
+ final t=0.5)
+ "Check if schedule lets the controller enable the plant or not"
+ annotation (Placement(transformation(extent={{-300,190},{-280,210}})));
+
+ Buildings.Controls.OBC.CDL.Continuous.Sources.TimeTable enaSch(
+ final table=schTab,
+ final smoothness=Buildings.Controls.OBC.CDL.Types.Smoothness.ConstantSegments,
+ final timeScale=3600)
+ "Table defining when plant can be enabled"
+ annotation (Placement(transformation(extent={{-340,190},{-320,210}})));
+
equation
- connect(TOut.y, controller.TOut) annotation (Line(points={{-318,100},{-262,100}},
+ connect(TOut.y, controller.TOut) annotation (Line(points={{-318,100},{-290,
+ 100},{-290,98.5556},{-262,98.5556}},
color={0,0,127}));
- connect(uBoiAva.y, controller.uBoiAva) annotation (Line(points={{-318,-50},{-288,
- -50},{-288,82},{-262,82}}, color={255,0,255}));
+ connect(uBoiAva.y, controller.uBoiAva) annotation (Line(points={{-318,-50},{
+ -288,-50},{-288,81.5556},{-262,81.5556}},
+ color={255,0,255}));
- connect(TSup.y, controller.TSupPri) annotation (Line(points={{-318,70},{-310,70},
- {-310,97},{-262,97}}, color={0,0,127}));
+ connect(TSup.y, controller.TSupPri) annotation (Line(points={{-318,70},{-310,
+ 70},{-310,95.7222},{-262,95.7222}},
+ color={0,0,127}));
- connect(TRet.y, controller.TRetPri) annotation (Line(points={{-318,40},{-300,40},
- {-300,94},{-262,94}}, color={0,0,127}));
+ connect(TRet.y, controller.TRetPri) annotation (Line(points={{-318,40},{-300,
+ 40},{-300,92.8889},{-262,92.8889}},
+ color={0,0,127}));
connect(dPHotWat.y, controller.dpHotWatPri_rem) annotation (Line(points={{-318,
- -20},{-294,-20},{-294,85},{-262,85}}, color={0,0,127}));
+ -20},{-294,-20},{-294,84.3889},{-262,84.3889}},
+ color={0,0,127}));
connect(VHotWat_flow[4].y, controller.VHotWatPri_flow) annotation (Line(
- points={{-318,10},{-298,10},{-298,91},{-262,91}}, color={0,0,127}));
+ points={{-318,10},{-298,10},{-298,90.0556},{-262,90.0556}},
+ color={0,0,127}));
connect(sin.y, reaToInt.u)
annotation (Line(points={{-318,130},{-302,130}}, color={0,0,127}));
- connect(TOut1.y, controller1.TOut) annotation (Line(points={{-58,100},{-2,100}},
+ connect(TOut1.y, controller1.TOut) annotation (Line(points={{-58,100},{-30,
+ 100},{-30,98.5556},{-2,98.5556}},
color={0,0,127}));
- connect(uBoiAva1.y, controller1.uBoiAva) annotation (Line(points={{-58,-50},{-34,
- -50},{-34,82},{-2,82}}, color={255,0,255}));
+ connect(uBoiAva1.y, controller1.uBoiAva) annotation (Line(points={{-58,-50},{
+ -34,-50},{-34,81.5556},{-2,81.5556}},
+ color={255,0,255}));
- connect(TSup1.y, controller1.TSupPri) annotation (Line(points={{-58,70},{-50,70},
- {-50,97},{-2,97}}, color={0,0,127}));
+ connect(TSup1.y, controller1.TSupPri) annotation (Line(points={{-58,70},{-50,
+ 70},{-50,95.7222},{-2,95.7222}},
+ color={0,0,127}));
- connect(TRet1.y, controller1.TRetPri) annotation (Line(points={{-58,40},{-40,40},
- {-40,94},{-2,94}}, color={0,0,127}));
+ connect(TRet1.y, controller1.TRetPri) annotation (Line(points={{-58,40},{-40,
+ 40},{-40,92.8889},{-2,92.8889}},
+ color={0,0,127}));
connect(VHotWat_flow1[4].y, controller1.VHotWatPri_flow) annotation (Line(
- points={{-58,10},{-38,10},{-38,91},{-2,91}}, color={0,0,127}));
+ points={{-58,10},{-38,10},{-38,90.0556},{-2,90.0556}},
+ color={0,0,127}));
connect(sin1.y, reaToInt1.u)
annotation (Line(points={{-58,130},{-42,130}}, color={0,0,127}));
connect(VHotWatSec_flow.y, controller1.VHotWatSec_flow) annotation (Line(
- points={{-58,-90},{-30,-90},{-30,79},{-2,79}},
+ points={{-58,-90},{-30,-90},{-30,78.7222},{-2,78.7222}},
color={0,0,127}));
connect(dPHotWat1.y, controller1.dpHotWatSec_rem) annotation (Line(points={{-58,-20},
- {-26,-20},{-26,66},{-2,66}}, color={0,0,127}));
+ {-26,-20},{-26,66.4444},{-2,66.4444}},
+ color={0,0,127}));
- connect(TRet1.y, controller1.TRetSec) annotation (Line(points={{-58,40},{-40,40},
- {-40,88},{-2,88}}, color={0,0,127}));
+ connect(TRet1.y, controller1.TRetSec) annotation (Line(points={{-58,40},{-40,
+ 40},{-40,87.2222},{-2,87.2222}},
+ color={0,0,127}));
- connect(TOut2.y,controller2. TOut) annotation (Line(points={{162,100},{218,100}},
+ connect(TOut2.y,controller2. TOut) annotation (Line(points={{162,100},{190,
+ 100},{190,98.5556},{218,98.5556}},
color={0,0,127}));
- connect(uBoiAva2.y,controller2. uBoiAva) annotation (Line(points={{162,-50},{192,
- -50},{192,82},{218,82}},color={255,0,255}));
+ connect(uBoiAva2.y,controller2. uBoiAva) annotation (Line(points={{162,-50},{
+ 192,-50},{192,81.5556},{218,81.5556}},
+ color={255,0,255}));
- connect(TSup2.y,controller2. TSupPri) annotation (Line(points={{162,70},{170,70},
- {170,97},{218,97}}, color={0,0,127}));
+ connect(TSup2.y,controller2. TSupPri) annotation (Line(points={{162,70},{170,
+ 70},{170,95.7222},{218,95.7222}},
+ color={0,0,127}));
- connect(TRet2.y,controller2. TRetPri) annotation (Line(points={{162,40},{180,40},
- {180,94},{218,94}}, color={0,0,127}));
+ connect(TRet2.y,controller2. TRetPri) annotation (Line(points={{162,40},{180,
+ 40},{180,92.8889},{218,92.8889}},
+ color={0,0,127}));
connect(VHotWat_flow2[4].y,controller2. VHotWatPri_flow) annotation (Line(
- points={{162,10},{182,10},{182,91},{218,91}}, color={0,0,127}));
+ points={{162,10},{182,10},{182,90.0556},{218,90.0556}},
+ color={0,0,127}));
connect(sin2.y,reaToInt2. u)
annotation (Line(points={{162,130},{178,130}}, color={0,0,127}));
connect(VHotWatSec_flow1.y, controller2.VHotWatSec_flow) annotation (Line(
- points={{162,-90},{196,-90},{196,79},{218,79}}, color={0,0,127}));
+ points={{162,-90},{196,-90},{196,78.7222},{218,78.7222}},
+ color={0,0,127}));
connect(dPHotWat2.y,controller2. dpHotWatSec_rem) annotation (Line(points={{162,-20},
- {200,-20},{200,66},{218,66}}, color={0,0,127}));
+ {200,-20},{200,66.4444},{218,66.4444}},
+ color={0,0,127}));
- connect(TRet2.y,controller2. TRetSec) annotation (Line(points={{162,40},{180,40},
- {180,88},{218,88}}, color={0,0,127}));
+ connect(TRet2.y,controller2. TRetSec) annotation (Line(points={{162,40},{180,
+ 40},{180,87.2222},{218,87.2222}},
+ color={0,0,127}));
- connect(controller.yBoi, truDel.u) annotation (Line(points={{-238,84},{-230,
- 84},{-230,140},{-222,140}},
+ connect(controller.yBoi, truDel.u) annotation (Line(points={{-238,83.4444},{
+ -230,83.4444},{-230,140},{-222,140}},
color={255,0,255}));
- connect(controller.yPriPum, truDel1.u) annotation (Line(points={{-238,68},{
- -230,68},{-230,50},{-222,50}},
+ connect(controller.yPriPum, truDel1.u) annotation (Line(points={{-238,68.3333},
+ {-230,68.3333},{-230,50},{-222,50}},
color={255,0,255}));
- connect(controller.yBypValPos, uniDel.u) annotation (Line(points={{-238,72},{
- -224,72},{-224,80},{-222,80}},
+ connect(controller.yBypValPos, uniDel.u) annotation (Line(points={{-238,
+ 72.1111},{-224,72.1111},{-224,80},{-222,80}},
color={0,0,127}));
- connect(uniDel.y, controller.uBypValPos) annotation (Line(points={{-198,80},{-150,
- 80},{-150,20},{-272,20},{-272,45},{-262,45}}, color={0,0,127}));
- connect(controller.yHotWatIsoVal, uniDel1.u) annotation (Line(points={{-238,76},
- {-226,76},{-226,110},{-222,110}}, color={0,0,127}));
- connect(uniDel1.y, controller.uHotWatIsoVal) annotation (Line(points={{-198,110},
- {-144,110},{-144,-16},{-278,-16},{-278,48},{-262,48}}, color={0,0,127}));
- connect(controller1.yBoi, truDel2.u) annotation (Line(points={{22,84},{26,84},
- {26,140},{38,140}}, color={255,0,255}));
- connect(controller1.yHotWatIsoVal, uniDel2.u) annotation (Line(points={{22,76},
- {28,76},{28,110},{38,110}}, color={0,0,127}));
- connect(controller1.yPriPum, truDel3.u) annotation (Line(points={{22,68},{34,
- 68},{34,70},{38,70}},
+ connect(uniDel.y, controller.uBypValPos) annotation (Line(points={{-198,80},{
+ -150,80},{-150,20},{-272,20},{-272,46.6111},{-262,46.6111}},
+ color={0,0,127}));
+ connect(controller.yHotWatIsoVal, uniDel1.u) annotation (Line(points={{-238,
+ 75.8889},{-226,75.8889},{-226,110},{-222,110}},
+ color={0,0,127}));
+ connect(uniDel1.y, controller.uHotWatIsoVal) annotation (Line(points={{-198,
+ 110},{-144,110},{-144,-16},{-278,-16},{-278,49.4444},{-262,49.4444}},
+ color={0,0,127}));
+ connect(controller1.yBoi, truDel2.u) annotation (Line(points={{22,83.4444},{
+ 26,83.4444},{26,140},{38,140}},
+ color={255,0,255}));
+ connect(controller1.yHotWatIsoVal, uniDel2.u) annotation (Line(points={{22,
+ 75.8889},{28,75.8889},{28,110},{38,110}},
+ color={0,0,127}));
+ connect(controller1.yPriPum, truDel3.u) annotation (Line(points={{22,68.3333},
+ {34,68.3333},{34,70},{38,70}},
color={255,0,255}));
connect(uniDel2.y, controller1.uHotWatIsoVal) annotation (Line(points={{62,110},
- {106,110},{106,-16},{-18,-16},{-18,48},{-2,48}}, color={0,0,127}));
- connect(controller1.ySecPum, truDel4.u) annotation (Line(points={{22,60},{30,
- 60},{30,10},{38,10}},
+ {106,110},{106,-16},{-18,-16},{-18,49.4444},{-2,49.4444}},
+ color={0,0,127}));
+ connect(controller1.ySecPum, truDel4.u) annotation (Line(points={{22,60.7778},
+ {30,60.7778},{30,10},{38,10}},
color={255,0,255}));
connect(reaRep.y, uniDel4.u)
annotation (Line(points={{62,40},{68,40}}, color={0,0,127}));
- connect(controller1.yPriPumSpe, reaRep.u) annotation (Line(points={{22,64},{
- 32,64},{32,40},{38,40}},
+ connect(controller1.yPriPumSpe, reaRep.u) annotation (Line(points={{22,
+ 64.5556},{32,64.5556},{32,40},{38,40}},
color={0,0,127}));
- connect(uniDel4.y, controller1.uPriPumSpe) annotation (Line(points={{92,40},{96,
- 40},{96,-10},{-6,-10},{-6,42},{-2,42}}, color={0,0,127}));
- connect(controller2.yBoi, truDel5.u) annotation (Line(points={{242,84},{250,
- 84},{250,130},{258,130}},
+ connect(uniDel4.y, controller1.uPriPumSpe) annotation (Line(points={{92,40},{
+ 96,40},{96,-10},{-6,-10},{-6,43.7778},{-2,43.7778}},
+ color={0,0,127}));
+ connect(controller2.yBoi, truDel5.u) annotation (Line(points={{242,83.4444},{
+ 250,83.4444},{250,130},{258,130}},
color={255,0,255}));
connect(truDel6.u, controller2.yPriPum) annotation (Line(points={{258,100},{
- 254,100},{254,68},{242,68}},
+ 254,100},{254,68.3333},{242,68.3333}},
color={255,0,255}));
connect(reaRep1.y, uniDel3.u)
annotation (Line(points={{282,70},{288,70}}, color={0,0,127}));
- connect(controller2.yPriPumSpe, reaRep1.u) annotation (Line(points={{242,64},
- {254,64},{254,70},{258,70}},color={0,0,127}));
- connect(uniDel3.y, controller2.uPriPumSpe) annotation (Line(points={{312,70},{
- 320,70},{320,10},{216,10},{216,42},{218,42}}, color={0,0,127}));
- connect(controller2.ySecPum, truDel7.u) annotation (Line(points={{242,60},{
- 252,60},{252,40},{258,40}},
+ connect(controller2.yPriPumSpe, reaRep1.u) annotation (Line(points={{242,
+ 64.5556},{254,64.5556},{254,70},{258,70}},
+ color={0,0,127}));
+ connect(uniDel3.y, controller2.uPriPumSpe) annotation (Line(points={{312,70},
+ {320,70},{320,10},{216,10},{216,43.7778},{218,43.7778}},
+ color={0,0,127}));
+ connect(controller2.ySecPum, truDel7.u) annotation (Line(points={{242,60.7778},
+ {252,60.7778},{252,40},{258,40}},
color={255,0,255}));
- connect(conInt.y, controller.TSupResReq) annotation (Line(points={{-318,160},{
- -266,160},{-266,106},{-262,106}}, color={255,127,0}));
+ connect(conInt.y, controller.TSupResReq) annotation (Line(points={{-318,160},
+ {-266,160},{-266,104.222},{-262,104.222}},
+ color={255,127,0}));
connect(conInt.y, controller1.TSupResReq) annotation (Line(points={{-318,160},
- {-6,160},{-6,106},{-2,106}}, color={255,127,0}));
+ {-6,160},{-6,104.222},{-2,104.222}},
+ color={255,127,0}));
connect(conInt.y, controller2.TSupResReq) annotation (Line(points={{-318,160},
- {212,160},{212,106},{218,106}}, color={255,127,0}));
+ {212,160},{212,104.222},{218,104.222}},
+ color={255,127,0}));
connect(truDel.y, pre1.u)
annotation (Line(points={{-198,140},{-192,140}}, color={255,0,255}));
- connect(pre1.y, controller.uBoi) annotation (Line(points={{-168,140},{-130,140},
- {-130,-30},{-284,-30},{-284,57},{-262,57}}, color={255,0,255}));
+ connect(pre1.y, controller.uBoi) annotation (Line(points={{-168,140},{-130,
+ 140},{-130,-30},{-284,-30},{-284,57.9444},{-262,57.9444}},
+ color={255,0,255}));
connect(pre2.u, truDel1.y)
annotation (Line(points={{-192,50},{-198,50}}, color={255,0,255}));
- connect(pre2.y, controller.uPriPum) annotation (Line(points={{-168,50},{-154,50},
- {-154,8},{-274,8},{-274,54},{-262,54}}, color={255,0,255}));
+ connect(pre2.y, controller.uPriPum) annotation (Line(points={{-168,50},{-154,
+ 50},{-154,8},{-274,8},{-274,55.1111},{-262,55.1111}},
+ color={255,0,255}));
connect(truDel2.y, pre3.u)
annotation (Line(points={{62,140},{68,140}}, color={255,0,255}));
connect(truDel3.y, pre4.u)
@@ -494,29 +548,49 @@ equation
connect(truDel4.y, pre5.u)
annotation (Line(points={{62,10},{68,10}}, color={255,0,255}));
connect(pre5.y, controller1.uSecPum) annotation (Line(points={{92,10},{100,10},
- {100,-12},{-14,-12},{-14,51},{-2,51}}, color={255,0,255}));
+ {100,-12},{-14,-12},{-14,52.2778},{-2,52.2778}},
+ color={255,0,255}));
connect(pre4.y, controller1.uPriPum) annotation (Line(points={{92,70},{108,70},
- {108,-20},{-10,-20},{-10,54},{-2,54}}, color={255,0,255}));
+ {108,-20},{-10,-20},{-10,55.1111},{-2,55.1111}},
+ color={255,0,255}));
connect(pre3.y, controller1.uBoi) annotation (Line(points={{92,140},{110,140},
- {110,-22},{-20,-22},{-20,57},{-2,57}}, color={255,0,255}));
+ {110,-22},{-20,-22},{-20,57.9444},{-2,57.9444}},
+ color={255,0,255}));
connect(pre6.u, truDel5.y)
annotation (Line(points={{288,130},{282,130}}, color={255,0,255}));
connect(pre6.y, controller2.uBoi) annotation (Line(points={{312,130},{340,130},
- {340,0},{202,0},{202,57},{218,57}}, color={255,0,255}));
+ {340,0},{202,0},{202,57.9444},{218,57.9444}},
+ color={255,0,255}));
connect(pre7.u, truDel6.y)
annotation (Line(points={{288,100},{282,100}}, color={255,0,255}));
- connect(pre7.y, controller2.uPriPum) annotation (Line(points={{312,100},{338,100},
- {338,2},{204,2},{204,54},{218,54}}, color={255,0,255}));
+ connect(pre7.y, controller2.uPriPum) annotation (Line(points={{312,100},{338,
+ 100},{338,2},{204,2},{204,55.1111},{218,55.1111}},
+ color={255,0,255}));
connect(truDel7.y, pre8.u)
annotation (Line(points={{282,40},{288,40}}, color={255,0,255}));
- connect(pre8.y, controller2.uSecPum) annotation (Line(points={{312,40},{336,40},
- {336,4},{206,4},{206,51},{218,51}}, color={255,0,255}));
+ connect(pre8.y, controller2.uSecPum) annotation (Line(points={{312,40},{336,
+ 40},{336,4},{206,4},{206,52.2778},{218,52.2778}},
+ color={255,0,255}));
connect(reaToInt.y, controller.plaReq) annotation (Line(points={{-278,130},{
- -272,130},{-272,103},{-262,103}}, color={255,127,0}));
+ -272,130},{-272,101.389},{-262,101.389}},
+ color={255,127,0}));
connect(reaToInt1.y, controller1.plaReq) annotation (Line(points={{-18,130},{
- -12,130},{-12,103},{-2,103}}, color={255,127,0}));
+ -12,130},{-12,101.389},{-2,101.389}},
+ color={255,127,0}));
connect(reaToInt2.y, controller2.plaReq) annotation (Line(points={{202,130},{
- 208,130},{208,103},{218,103}}, color={255,127,0}));
+ 208,130},{208,101.389},{218,101.389}},
+ color={255,127,0}));
+ connect(enaSch.y[1], greThr.u)
+ annotation (Line(points={{-318,200},{-302,200}}, color={0,0,127}));
+ connect(greThr.y, controller.uSchEna) annotation (Line(points={{-278,200},{
+ -264,200},{-264,107.056},{-262,107.056}},
+ color={255,0,255}));
+ connect(greThr.y, controller1.uSchEna) annotation (Line(points={{-278,200},{
+ -4,200},{-4,108},{-2,108},{-2,107.056}},
+ color={255,0,255}));
+ connect(greThr.y, controller2.uSchEna) annotation (Line(points={{-278,200},{
+ 216,200},{216,107.056},{218,107.056}},
+ color={255,0,255}));
annotation (
Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}),
graphics={Ellipse(
diff --git a/Buildings/Controls/OBC/ASHRAE/package.order b/Buildings/Controls/OBC/ASHRAE/package.order
index a20c96ab04e..4d8c195216a 100644
--- a/Buildings/Controls/OBC/ASHRAE/package.order
+++ b/Buildings/Controls/OBC/ASHRAE/package.order
@@ -1,2 +1,2 @@
G36
-PrimarySystem
\ No newline at end of file
+PrimarySystem
diff --git a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Controls_OBC_ASHRAE_PrimarySystem_BoilerPlant_Generic_Validation_ZeroIndexCorrection.txt b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Controls_OBC_ASHRAE_PrimarySystem_BoilerPlant_Generic_Validation_ZeroIndexCorrection.txt
new file mode 100644
index 00000000000..02101bd0fe9
--- /dev/null
+++ b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Controls_OBC_ASHRAE_PrimarySystem_BoilerPlant_Generic_Validation_ZeroIndexCorrection.txt
@@ -0,0 +1,14 @@
+last-generated=2023-04-04
+statistics-simulation=
+{
+ "linear": " ",
+ "nonlinear": " ",
+ "numerical Jacobians": "0"
+}
+time=[0e+00, 1e+01]
+zerStaIndCor.uInd=[0e+00, 0e+00]
+zerStaIndCor.yIndMod=[1e+00, 1e+00]
+zerStaIndCor.yCapMod=[0e+00, 0e+00]
+zerStaIndCor1.uInd=[1e+00, 1e+00]
+zerStaIndCor1.yIndMod=[1e+00, 1e+00]
+zerStaIndCor1.yCapMod=[1e+01, 1e+01]
diff --git a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Controls_OBC_ASHRAE_PrimarySystem_BoilerPlant_SetPoints_Validation_MinimumFlowSetPoint.txt b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Controls_OBC_ASHRAE_PrimarySystem_BoilerPlant_SetPoints_Validation_MinimumFlowSetPoint.txt
index 1e69561575c..19b694e5fa1 100644
--- a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Controls_OBC_ASHRAE_PrimarySystem_BoilerPlant_SetPoints_Validation_MinimumFlowSetPoint.txt
+++ b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Controls_OBC_ASHRAE_PrimarySystem_BoilerPlant_SetPoints_Validation_MinimumFlowSetPoint.txt
@@ -1,4 +1,4 @@
-last-generated=2022-11-22
+last-generated=2023-04-04
statistics-simulation=
{
"linear": " ",
@@ -18,7 +18,7 @@ minBoiFloSet.maxFloSet[2]=[8.999999761581421e-01, 8.999999761581421e-01]
minBoiFloSet.VHotWatMinSet_flow=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 2.999995045371726e-02, 8.999994486552741e-02, 9.999999403953552e-02, 9.999999403953552e-02, 9.999999403953552e-02, 9.999999403953552e-02, 9.999999403953552e-02, 9.999999403953552e-02, 9.999999403953552e-02, 9.999999403953552e-02, 9.999999403953552e-02, 9.999999403953552e-02, 9.999999403953552e-02, 9.999999403953552e-02, 9.999999403953552e-02, 9.999999403953552e-02, 9.999999403953552e-02, 9.999999403953552e-02, 9.999999403953552e-02, 9.999999403953552e-02, 9.999999403953552e-02, 9.999999403953552e-02, 9.999999403953552e-02, 9.999999403953552e-02, 9.999999403953552e-02, 1.300000566239389e-01, 1.900000059601805e-01, 2.499999552965164e-01, 3.099999046328524e-01, 3.699998390680275e-01, 4.299999940389672e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.500000262258617e-01, 3.900000023838069e-01, 3.299998176103557e-01, 2.999999821186066e-01, 2.999999821186066e-01, 2.999999821186066e-01, 2.999999821186066e-01, 2.999999821186066e-01, 2.999999821186066e-01, 2.999999821186066e-01, 2.999999821186066e-01, 2.999999821186066e-01, 2.999999821186066e-01, 2.999999821186066e-01, 2.999999821186066e-01, 2.999999821186066e-01, 2.999999821186066e-01, 3.300000596052887e-01, 3.899997735062908e-01, 4.499998986721039e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.599999785423279e-01, 4.599999785423279e-01]
minBoiFloSet1.uStaSet=[4e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00]
minBoiFloSet1.uOnOff=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00]
-truFalHol1.y=[1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 0e+00, 0e+00, 0e+00, 0e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 3.814682717262485e-06, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 3.814682699498917e-06, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00]
+truFalHol1.y=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 3.814682717262485e-06, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 3.814682699498917e-06, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00]
minBoiFloSet1.uLasDisBoi=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00]
minBoiFloSet1.minFloSet[1]=[1.000000014901161e-01, 1.000000014901161e-01]
minBoiFloSet1.minFloSet[2]=[3.00000011920929e-01, 3.00000011920929e-01]
diff --git a/Buildings/Resources/Scripts/Dymola/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/Validation/ZeroIndexCorrection.mos b/Buildings/Resources/Scripts/Dymola/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/Validation/ZeroIndexCorrection.mos
new file mode 100644
index 00000000000..38e605e66f9
--- /dev/null
+++ b/Buildings/Resources/Scripts/Dymola/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/Validation/ZeroIndexCorrection.mos
@@ -0,0 +1,8 @@
+simulateModel("Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.Validation.ZeroIndexCorrection", method="cvode", stopTime=10, tolerance=1e-06, resultFile="ZeroIndexCorrection");
+
+createPlot(id=1, position={95, 95, 534, 336}, y={"zerStaIndCor.uInd"}, range={0.0, 10.0, -1.5, 1.5}, grid=true, colors={{28,108,200}});
+createPlot(id=1, position={95, 95, 534, 108}, y={"zerStaIndCor.yIndMod"}, range={0.0, 10.0, 0.85, 1.15}, grid=true, subPlot=2, colors={{28,108,200}});
+createPlot(id=1, position={95, 95, 534, 109}, y={"zerStaIndCor.yCapMod"}, range={0.0, 10.0, -1.5, 1.5}, grid=true, subPlot=3, colors={{28,108,200}});
+createPlot(id=2, position={0, 0, 971, 830}, y={"zerStaIndCor1.uInd"}, range={0.0, 10.0, 0.85, 1.15}, grid=true, colors={{28,108,200}});
+createPlot(id=2, position={0, 0, 971, 274}, y={"zerStaIndCor1.yIndMod"}, range={0.0, 10.0, 0.85, 1.15}, grid=true, subPlot=2, colors={{28,108,200}});
+createPlot(id=2, position={0, 0, 971, 273}, y={"zerStaIndCor1.yCapMod"}, range={0.0, 10.0, 8.5, 11.5}, grid=true, subPlot=3, colors={{28,108,200}});
diff --git a/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.Validation.ZeroIndexCorrection.mos b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.Validation.ZeroIndexCorrection.mos
new file mode 100644
index 00000000000..721d7840d9d
--- /dev/null
+++ b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.Validation.ZeroIndexCorrection.mos
@@ -0,0 +1,9 @@
+compareVars :=
+ {
+ "zerStaIndCor.uInd",
+ "zerStaIndCor.yIndMod",
+ "zerStaIndCor.yCapMod",
+ "zerStaIndCor1.uInd",
+ "zerStaIndCor1.yIndMod",
+ "zerStaIndCor1.yCapMod"
+ };