CONTINUOUS_MODEL SimBoil ABSTRACT "SIMplified BOILer and water pump w ideal control. Heats incoming water to specified temperature, with a given efficiency and max capacity, using some primary energy source. Pressurizes outgoing water to specified pressure, using electricity with a given pump efficiency. Simplified power control. Boiler tank mass is added as if it was just a tank AFTER the boiler. Current tank temperature has no impact on boiler control. MV 980929 mode is reorganized and pmin default value is changed PS 980518 Limits for QMax changed PS 980420 Default and limits for DomWatF and TDomWatOut changed PS 980416 QMax in kW PS 980407 DHW is added as primary energy consumer, plus some cosmetics. New type PrimPowerCons for supplied primary energy MV 980324 domestic hot water (DHW) is added MV 980318 event removed from mode calc. MV 971125 Powers of coresponding flows are added for presentation purposes. MV 971005 Change Mode section to avoid event, when pump is off 970918 PS Reformulated equation for POut 970509 PS Added internal mass. A lot of consequent redesign. " EQUATIONS /* outlet pressure head */ POut - PIn = pSetMax * PumpOn + pSetMin * (1 - PumpOn) ; /* Inlet pressure is given as reference pressure for massflow circuit. This corresponds to the grounding of an electrical circuit, or an expansion vessel for a fluid circuit */ PIn = 0; /* total massflow */ Mtot := SUM i=1, nIn M_In[i] END_SUM; /* pump electrical power */ PPump := (POut - PIn)*Mtot/(RHO_WAT*etaPump); /* Domestic Hot Water (DHW)*/ /* Added by MV 980324 */ QDomWat := DomWatSch * DomWatF/1000 * rho_wat * cp_wat * (TDomWatOut - TDomWatIn); /* required useful power to satisfy requested temperature */ Temp := (Mtot*cpLiq*TOutReq - SUM i=1, nIn M_In[i]*cpLiq*TIn[i] END_SUM); IF NINT(MODE) == 2 THEN /* maximum capacity has been reached */ QSup := (QMax*1000 + QDomWat) / etaPrimary; Qtemp := QMax*1000; ELSE_IF NINT(MODE) == 0 THEN /* no heat required, leaving water too warm */ QSup := QDomWat / etaPrimary; Qtemp := 0; ELSE /* normal operating regime */ QSup := (Temp + QDomWat) / etaPrimary; Qtemp := Temp; END_IF; mass*cpLiq*TOut' = Qtemp + SUM i=1, nIn M_In[i]*cpLiq*TIn[i] END_SUM - Mtot*cpLiq*TOut; IF NINT(NOut) == NINT(NIn) THEN FOR i = 1, NOut Q[i] := M_Out[i] * cpLiq * (TOut-TIn[i]); END_FOR ELSE FOR i = 1, NOut Q[i] := 0; END_FOR END_IF; Mode := IF PumpOn < 0.5 OR Temp < 0 THEN 0 ELSE_IF Temp - QMax*1000 > 0 THEN 2 ELSE 1 END_IF; LINKS FOR i = 1, nIn PMT Inlet[i] PIn, POS_IN M_In[i], TIn[i] END_FOR; FOR i = 1, nOut PMT Outlet[i] POut, POS_OUT M_Out[i], TOut END_FOR; T TempSetpoint TOutReq; /*leaving liquid temperature setpoint*/ ControlLink PumpControl PumpOn; /*pump control signal*/ /* Domestic hot water links */ T TempWat TDomWatIn; ControlLink DomWatControl DomWatSch; VARIABLES /* type name role def min max description */ Pressure POut OUT 10000 0 BIG "Outlet pressure" Pressure PIn OUT 0 0 BIG "Inlet pressure, fixed, as from expansion vessel" MassFlow Mtot LOC 0.002 0 BIG "Total massflow" MassFlow M_Out[nOut] IN 0.002 0 BIG "Outlet[i] massflow" MassFlow M_In[nIn] IN 0.002 0 BIG "Inlet[i] massflow" Temp TOut OUT 60 ABS_ZERO BIG "Temp of leaving liquid" Temp TOutReq IN 70 ABS_ZERO BIG "Requested leaving temperture" Temp TIn[nIn] IN 50 ABS_ZERO BIG "Temp of entering liquid" PrimPowerCons QSup LOC 1186 0 BIG "Supplied primary power" ElPowerCons PPump LOC 0.6 0 BIG "Pump electrical power" Control PumpOn IN 1 0 BIG "Pump control signal" Power Temp LOC -40 -BIG BIG "Temporary variable" Temp Qtemp LOC 0 0 BIG "Temporary variable" Generic Mode A_S 1 0 2 "Boiler mode 0 = Off 1 = Normal regime 2 = Full capacity" Generic G0 A_S 0 0 BIG "G-stop memory " Power Q[nOut] LOC -40 -BIG BIG "Power added to each flow circuit" Temp TDomWatIn IN 5 SMALL BIG "Incoming domestic water temp" Control DomWatSch IN 0 0 1 "DHW consumption schedule 0-1" Power QDomWat LOC 0 0 BIG "Power for DHW heating" MODEL_PARAMETERS /* type name role def min max description */ Int nIn SMP 1 1 BIGINT "Number of inlet terminals" Int nOut SMP 1 1 BIGINT "Number of outlet terminals" PARAMETERS /* type name role def min max description */ Factor etaPrimary S_P 0.66 SMALL 10 "Boiler Overall efficiency" Factor etaPump S_P 1 SMALL 1 "Pump efficiency" Power_k QMax S_P 99999 0.001 BIG "Maximum heating capacity (excl. DHW)" Pressure pSetMax S_P 3000 SMALL BIG "Outlet pressure at full pump speed" Pressure pSetMin S_P 1 SMALL BIG "Outlet pressure at PumpOn = 0 (>0 for numerical reasons)" HeatCapM cpLiq S_P 4187 SMALL BIG "Liquid specific heat" Mass mass S_P 100 SMALL BIG "Boiler and circuit mass" Temp TDomWatOut S_P 55 SMALL 99 "Domestic hot water supply temperature" VolFlow_m DomWatF S_P 0 0 BIG "Maximum domestic hot water vol flow [l/s]" END_MODEL