Name | Description |
---|---|
HydronicHeating | Model of a hydronic heating system with energy storage |
VAVSystemCTControl | VAV system model of MIT building with continuous time control for static pressure reset |
BaseClasses | Package with base classes for example models |
Type | Name | Default | Description |
---|---|---|---|
Integer | nRoo | 2 | Number of rooms |
Volume | VRoo | 8*5*3 | Volume of one room [m3] |
Real | ACH | 0.5 | Outside air exchange per hour |
Area | AHeaTra | (8 + 5)*3 | Heat transfer area of one room [m2] |
Power | Q_flow_nominal | 2500 | Nominal power [W] |
Temperature | dT_nominal | 20 | Nominal temperature difference [K] |
MassFlowRate | m_flow_nominal | Q_flow_nominal/dT_nominal/4200 | Nominal mass flow rate [kg/s] |
Pressure | dpPip_nominal | 10000 | Pressure difference of pipe (without valve) [Pa] |
Pressure | dpVal_nominal | 1000 | Pressure difference of valve [Pa] |
Pressure | dpRoo_nominal | 6000 | Pressure difference of flow leg that serves a room [Pa] |
Pressure | dpThrWayVal_nominal | 6000 | Pressure difference of three-way valve [Pa] |
Pressure | dp_nominal | dpPip_nominal + dpVal_nomina... | Pressure difference of loop [Pa] |
model HydronicHeating "Model of a hydronic heating system with energy storage" // package Medium = Buildings.Media.ConstantPropertyLiquidWater "Medium model"; package Medium = Buildings.Media.ConstantPropertyLiquidWater "Medium model"; //package Medium = Modelica.Media.Air.SimpleAir "Medium model"; //package Medium = Buildings.Media.GasesPTDecoupled.SimpleAir "Medium model"; parameter Integer nRoo = 2 "Number of rooms"; parameter Modelica.SIunits.Volume VRoo = 8*5*3 "Volume of one room"; parameter Real ACH = 0.5 "Outside air exchange per hour"; parameter Modelica.SIunits.Area AHeaTra=(8+5)*3 "Heat transfer area of one room"; parameter Modelica.SIunits.Power Q_flow_nominal = 2500 "Nominal power"; parameter Modelica.SIunits.Temperature dT_nominal = 20 "Nominal temperature difference"; parameter Modelica.SIunits.MassFlowRate m_flow_nominal = Q_flow_nominal/dT_nominal/4200 "Nominal mass flow rate"; parameter Modelica.SIunits.Pressure dpPip_nominal = 10000 "Pressure difference of pipe (without valve)"; parameter Modelica.SIunits.Pressure dpVal_nominal = 1000 "Pressure difference of valve"; parameter Modelica.SIunits.Pressure dpRoo_nominal = 6000 "Pressure difference of flow leg that serves a room"; parameter Modelica.SIunits.Pressure dpThrWayVal_nominal = 6000 "Pressure difference of three-way valve"; parameter Modelica.SIunits.Pressure dp_nominal = dpPip_nominal + dpVal_nominal + dpRoo_nominal "Pressure difference of loop";Buildings.Fluid.Boilers.BoilerPolynomial boi( a={0.9}, effCur=Buildings.Fluid.Types.EfficiencyCurves.Constant, Q_flow_nominal=Q_flow_nominal, dT_nominal=dT_nominal, redeclare package Medium = Medium, allowFlowReversal=false, dp_nominal=3000, T_start=293.15) "Boiler"; inner Modelica.Fluid.System system; Modelica.Thermal.HeatTransfer.Sources.FixedTemperature TAmb(T=288.15) "Ambient temperature in boiler room"; Fluid.Movers.FlowMachine_y pumRad( redeclare package Medium = Medium, redeclare function flowCharacteristic = Buildings.Fluid.Movers.BaseClasses.Characteristics.linearFlow ( V_flow_nominal=m_flow_nominal/1000*{0,2}, dp_nominal=dp_nominal*{2,0}), m_flow_nominal=m_flow_nominal, dynamicBalance=true) "Pump that serves the radiators"; Buildings.Fluid.FixedResistances.FixedResistanceDpM res1( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, dp_nominal=dpPip_nominal/2); Buildings.Fluid.FixedResistances.FixedResistanceDpM res2( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, dp_nominal=dpPip_nominal/2); Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor TRoo2; Modelica.Blocks.Sources.Constant dpSet(k=dp_nominal) "Pressure set point"; Controls.Continuous.PIDHysteresisTimer conPum( Ti=60, yMax=1, yMin=0.3, eOn=1, k=0.1, Td=60, controllerType=Modelica.Blocks.Types.SimpleController.P) "Controller for pump"; Modelica.Thermal.HeatTransfer.Components.HeatCapacitor roo2(T(fixed=true), C= 10*30*1006) "Heat capacity of room"; Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TOut2 "Outside temperature boundary condition"; Modelica.Blocks.Sources.Sine TOutBC( freqHz=1/86400, offset=283.15, amplitude=5, phase=-1.5707963267949) "Outside air temperature"; Buildings.Fluid.Sensors.RelativePressure dpSen(redeclare package Medium = Medium); Fluid.Actuators.Valves.TwoWayEqualPercentage val2( redeclare package Medium = Medium, dp_nominal(displayUnit="Pa") = dpVal_nominal, Kv_SI=m_flow_nominal/nRoo/sqrt(dpVal_nominal), m_flow_nominal=m_flow_nominal/nRoo) "Radiator valve"; Controls.Continuous.LimPID conRoo2( yMax=1, yMin=0, Ti=60, Td=60, k=1, controllerType=Modelica.Blocks.Types.SimpleController.P) "Controller for room temperature"; Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor TRoo1; Modelica.Thermal.HeatTransfer.Components.HeatCapacitor roo1( T( fixed=true), C=VRoo*1006) "Heat capacity of room"; Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TOut1 "Outside temperature boundary condition"; Fluid.Actuators.Valves.TwoWayEqualPercentage val1( redeclare package Medium = Medium, dp_nominal(displayUnit="Pa") = dpVal_nominal, Kv_SI=m_flow_nominal/nRoo/sqrt(dpVal_nominal), m_flow_nominal=m_flow_nominal/nRoo) "Radiator valve"; Controls.Continuous.LimPID conRoo1( yMax=1, yMin=0, Ti=60, Td=60, k=1, controllerType=Modelica.Blocks.Types.SimpleController.P) "Controller for room temperature"; Buildings.Fluid.HeatExchangers.Radiators.RadiatorEN442_2 rad1( redeclare package Medium = Medium, dT_nominal=(60 + 40)/2 - 20, m_flow_nominal=m_flow_nominal/nRoo, Q_flow_nominal=1.8*Q_flow_nominal/nRoo) "Radiator"; Buildings.Fluid.HeatExchangers.Radiators.RadiatorEN442_2 rad2( redeclare package Medium = Medium, dT_nominal=(60 + 40)/2 - 20, m_flow_nominal=m_flow_nominal/nRoo, Q_flow_nominal=1.8*Q_flow_nominal/nRoo) "Radiator"; Buildings.Fluid.Actuators.Valves.ThreeWayEqualPercentageLinear thrWayVal( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, dp_nominal=dpThrWayVal_nominal, l={0.01,0.01}, dynamicBalance=true, tau=10) "Three-way valve"; Controls.Continuous.LimPID conVal( k=1, Ti=60, yMax=1, yMin=0, initType=Modelica.Blocks.Types.InitPID.InitialState, xi_start=1, controllerType=Modelica.Blocks.Types.SimpleController.P, Td=60) "Controller for pump"; Fluid.Storage.StratifiedEnhanced tan( m_flow_nominal=m_flow_nominal, dIns=0.3, redeclare package Medium = Medium, hTan=2, nSeg=5, show_T=true, VTan=0.2) "Storage tank"; Fluid.Movers.FlowMachine_y pumBoi( redeclare package Medium = Medium, allowFlowReversal=false, redeclare function flowCharacteristic = Buildings.Fluid.Movers.BaseClasses.Characteristics.linearFlow ( dp_nominal=1.5*5000*{1,2}, V_flow_nominal=2*{ m_flow_nominal/1000,0.5*m_flow_nominal/1000}), m_flow_nominal=2*m_flow_nominal, dynamicBalance=true); Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor tanTemBot "Tank temperature"; Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor tanTemTop "Tank temperature"; Modelica.Blocks.Logical.GreaterThreshold greThr(threshold=273.15 + 52); Modelica.Blocks.Math.BooleanToReal booToRea; Buildings.Fluid.FixedResistances.FixedResistanceDpM res3( redeclare package Medium = Medium, m_flow_nominal=2*m_flow_nominal, dp_nominal=2000); Buildings.Fluid.FixedResistances.FixedResistanceDpM res4( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, dp_nominal=100); Modelica.StateGraph.InitialStepWithSignal iniSte; Modelica.StateGraph.TransitionWithSignal transition(enableTimer=false, waitTime=0); Modelica.StateGraph.StepWithSignal onSta(nIn=2) "State for furnace on"; inner Modelica.StateGraph.StateGraphRoot stateGraphRoot; Modelica.Blocks.Logical.LessThreshold lesThr(threshold=273.15 + 50); Modelica.StateGraph.TransitionWithSignal toOff(enableTimer=false); Modelica.StateGraph.StepWithSignal offSta(nIn=1) "State for furnace off"; Modelica.StateGraph.TransitionWithSignal toOn(enableTimer=false); Buildings.Fluid.Sensors.Temperature temSup(redeclare package Medium = Medium); Buildings.Fluid.Sensors.Temperature temRet(redeclare package Medium = Medium); Buildings.Controls.SetPoints.HotWaterTemperatureReset heaCha( use_TRoo_in=false, dTOutHeaBal=0, TSup_nominal=333.15, TRet_nominal=313.15, TOut_nominal=268.15); Modelica.Thermal.HeatTransfer.Components.ThermalConductor venLos1(G=VRoo*ACH/ 3600*1.2*1006) "Ventilation heat loss"; Modelica.Thermal.HeatTransfer.Components.ThermalConductor venLos2(G=VRoo*ACH/ 3600*1.2*1006) "Ventilation heat loss"; Controls.SetPoints.OccupancySchedule occSch1(occupancy=3600*{7,8,10,11,11.5, 15,19,21}) "Occupancy schedule"; Modelica.Blocks.Logical.Switch switch1; Modelica.Blocks.Sources.RealExpression occ1(y=200) "Heat gain if occupied in room 1"; Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow preHeaFlo1 "Prescribed heat flow to model occupancy"; Modelica.Blocks.Sources.Constant zer(k=0) "Outputs zero"; Controls.SetPoints.OccupancySchedule occSch2( firstEntryOccupied=false, occupancy=3600*{7,10,12,22}) "Occupancy schedule"; Modelica.Blocks.Logical.Switch switch2; Modelica.Blocks.Sources.RealExpression occ2(y=200) "Heat gain if occupied in room 2"; Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow preHeaFlo2 "Prescribed heat flow to model occupancy"; Buildings.Fluid.FixedResistances.FixedResistanceDpM resRoo1( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal/nRoo, dp_nominal=dpRoo_nominal, from_dp=true) "Resistance of pipe leg that serves the room"; Buildings.Fluid.FixedResistances.FixedResistanceDpM resRoo2( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal/nRoo, dp_nominal=dpRoo_nominal, from_dp=true) "Resistance of pipe leg that serves the room"; Modelica.Thermal.HeatTransfer.Components.Convection con1 "Convective heat transfer"; Modelica.Thermal.HeatTransfer.Components.Convection con2 "Convective heat transfer"; Modelica.Blocks.Sources.RealExpression hACon1(y=8*AHeaTra) "Convective heat transfer"; Modelica.Blocks.Sources.RealExpression hACon2(y=8*AHeaTra) "Convective heat transfer"; Controls.SetPoints.OccupancySchedule occSch "Occupancy schedule"; Modelica.Blocks.Logical.Switch switch3; Modelica.Blocks.Sources.Constant TRooNig(k=273.15 + 16) "Room temperature set point at night"; Modelica.Blocks.Sources.Constant TRooSet(k=273.15 + 21); Fluid.Storage.ExpansionVessel expVes(redeclare package Medium = Medium, VTot= 1) "Expansion vessel"; HeatTransfer.Data.OpaqueConstructions.Generic extWalCon(nLay=2, material={ insul,brick}) "Record for exterior wall construction"; HeatTransfer.Data.Solids.Brick brick(x=0.24, nStaRef=3) "Brick for exterior wall"; HeatTransfer.Data.Solids.InsulationBoard insul(x=0.2, nStaRef=3) "Insulation for exterior wall"; HeatTransfer.ConductorMultiLayer extWal1(A=AHeaTra, layers=extWalCon) "Exterior wall construction"; HeatTransfer.ConductorMultiLayer extWal2(A=AHeaTra, layers=extWalCon) "Exterior wall construction"; Utilities.Math.Max maxYVal(nin=2) "Maximum radiator valve position"; Modelica.Blocks.Logical.Hysteresis hysPum(uHigh=0.1, uLow=0.01) "Hysteresis for pump"; Modelica.Blocks.Logical.Switch swiPum "Pump switch"; Modelica.Blocks.Sources.Constant dpSetOff(k=0) "Pressure set point to switch pump off"; equationconnect(TAmb.port,boi. heatPort); connect(TOutBC.y, TOut2.T); connect(roo2.port, TRoo2.port); connect(TRoo2.T, conRoo2.u_m); connect(pumRad.port_b, dpSen.port_a); connect(roo1.port, TRoo1.port); connect(TRoo1.T, conRoo1.u_m); connect(rad1.heatPortCon, roo1.port); connect(dpSen.port_b, pumRad.port_a); connect(dpSen.p_rel, conPum.u_m); connect(val1.port_b, rad1.port_a); connect(val2.port_b, rad2.port_a); connect(conRoo1.y, val1.y); connect(conRoo2.y, val2.y); connect(pumRad.port_a, thrWayVal.port_2); connect(boi.port_b,pumBoi. port_a); connect(tan.heaPorVol[1], tanTemTop.port); connect(tanTemBot.port, tan.heaPorVol[tan.nSeg]); connect(tanTemBot.T, greThr.u); connect(pumBoi.port_b, res3.port_a); connect(res4.port_b, tan.port_b); connect(tanTemTop.T, lesThr.u); connect(iniSte.outPort[1], transition.inPort); connect(transition.outPort, onSta.inPort[1]); connect(onSta.outPort[1], toOff.inPort); connect(toOff.outPort, offSta.inPort[1]); connect(toOn.outPort, onSta.inPort[2]); connect(offSta.outPort[1], toOn.inPort); connect(lesThr.y, toOn.condition); connect(pumRad.port_b, res1.port_a); connect(pumRad.port_b, temSup.port); connect(temSup.T, conVal.u_m); connect(res2.port_b, temRet.port); connect(onSta.active, booToRea.u); connect(lesThr.y, transition.condition); connect(greThr.y, toOff.condition); connect(heaCha.TSup, conVal.u_s); connect(TOutBC.y, heaCha.TOut); connect(TOutBC.y, TOut1.T); connect(booToRea.y,boi. y); connect(tan.port_b, boi.port_a); connect(tan.port_a, thrWayVal.port_1); connect(res3.port_b, tan.port_a); connect(res4.port_a, res2.port_b); connect(res2.port_b, thrWayVal.port_3); connect(venLos1.port_a, TOut1.port); connect(venLos1.port_b, roo1.port); connect(venLos2.port_a, TOut2.port); connect(venLos2.port_b, roo2.port); connect(occSch1.occupied, switch1.u2); connect(occ1.y, switch1.u1); connect(switch1.y, preHeaFlo1.Q_flow); connect(zer.y, switch1.u3); connect(occSch2.occupied, switch2.u2); connect(switch2.y, preHeaFlo2.Q_flow); connect(occ2.y, switch2.u1); connect(zer.y, switch2.u3); connect(rad1.port_b, resRoo1.port_a); connect(rad2.port_b, resRoo2.port_a); connect(con1.fluid, roo1.port); connect(con2.fluid, roo2.port); connect(hACon1.y, con1.Gc); connect(hACon2.y, con2.Gc); connect(preHeaFlo2.port, roo2.port); connect(preHeaFlo1.port, roo1.port); connect(rad2.heatPortCon, roo2.port); connect(booToRea.y, pumBoi.y); connect(res2.port_a, resRoo2.port_b); connect(res2.port_a, resRoo1.port_b); connect(res1.port_b, val2.port_a); connect(val1.port_a, res1.port_b); connect(TRooSet.y, switch3.u1); connect(occSch.occupied, switch3.u2); connect(TRooNig.y, switch3.u3); connect(switch3.y, conRoo1.u_s); connect(switch3.y, conRoo2.u_s); connect(expVes.port_a, boi.port_a); connect(TOut2.port, extWal2.port_a); connect(extWal2.port_b, con2.solid); connect(TOut1.port, extWal1.port_a); connect(extWal1.port_b, con1.solid); connect(maxYVal.y, hysPum.u); connect(hysPum.y, swiPum.u2); connect(dpSet.y, swiPum.u1); connect(dpSetOff.y, swiPum.u3); connect(swiPum.y, conPum.u_s); connect(conRoo1.y, maxYVal.u[1]); connect(conRoo2.y, maxYVal.u[2]); connect(conVal.y, thrWayVal.y); connect(conPum.y, pumRad.y); end HydronicHeating;
Type | Name | Default | Description |
---|---|---|---|
MassFlowRate | mMIT_flow | roo.m0Tot_flow | Nominal mass flow rate of MIT system model as in ASHRAE 825-RP [kg/s] |
Pressure | dpSuiSup_nominal | 95 | Pressure drop supply air leg with splitters of one suite (obtained from simulation) [Pa] |
Pressure | dpSuiRet_nominal | 233 | Pressure drop return air leg with splitters of one suite (obtained from simulation) [Pa] |
Pressure | dpFanSupMIT_nominal | 1050 | Pressure increase over supply fan in MIT system model as in ASHRAE 825-RP (obtained from simulation) [Pa] |
Pressure | dpFanRetMIT_nominal | 347 | Pressure increase over supply fan in MIT system model as in ASHRAE 825-RP (obtained from simulation) [Pa] |
Real | scaM_flow | 1 | Scaling factor for mass flow rate |
Real | scaDpFanSup_nominal | 1 | Scaling factor for supply fan pressure lift with NSui number of suites |
Real | scaDpFanRet_nominal | 1 | Scaling factor for supply fan pressure lift with NSui number of suites |
model VAVSystemCTControl "VAV system model of MIT building with continuous time control for static pressure reset" // package Medium = Buildings.Media.IdealGases.SimpleAir; package Medium = Buildings.Media.GasesPTDecoupled.SimpleAir(extraPropertiesNames={"CO2"}); // package Medium = Buildings.Media.GasesPTDecoupled.MoistAir; parameter Modelica.SIunits.MassFlowRate mMIT_flow = roo.m0Tot_flow "Nominal mass flow rate of MIT system model as in ASHRAE 825-RP"; parameter Modelica.SIunits.Pressure dpSuiSup_nominal = 95 "Pressure drop supply air leg with splitters of one suite (obtained from simulation)"; parameter Modelica.SIunits.Pressure dpSuiRet_nominal = 233 "Pressure drop return air leg with splitters of one suite (obtained from simulation)"; parameter Modelica.SIunits.Pressure dpFanSupMIT_nominal = 1050 "Pressure increase over supply fan in MIT system model as in ASHRAE 825-RP (obtained from simulation)"; parameter Modelica.SIunits.Pressure dpFanRetMIT_nominal = 347 "Pressure increase over supply fan in MIT system model as in ASHRAE 825-RP (obtained from simulation)"; parameter Real scaM_flow = 1 "Scaling factor for mass flow rate"; parameter Real scaDpFanSup_nominal = 1 "Scaling factor for supply fan pressure lift with NSui number of suites"; parameter Real scaDpFanRet_nominal = 1 "Scaling factor for supply fan pressure lift with NSui number of suites";Modelica.Blocks.Sources.Constant PAtm(k=101325); Modelica.Blocks.Sources.Constant yDam(k=0.5); Buildings.Fluid.FixedResistances.FixedResistanceDpM res31( dp_nominal=0.546, m_flow_nominal=scaM_flow*1, dh=sqrt(scaM_flow)*1, redeclare package Medium = Medium); Buildings.Fluid.FixedResistances.FixedResistanceDpM res33( dp_nominal=0.164, dh=sqrt(scaM_flow)*1, m_flow_nominal=scaM_flow*1, redeclare package Medium = Medium); Buildings.Fluid.FixedResistances.FixedResistanceDpM res57( dp_nominal=0.118000, m_flow_nominal=scaM_flow*1, dh=sqrt(scaM_flow)*1, redeclare package Medium = Medium); BaseClasses.Suite roo(redeclare package Medium = Medium, scaM_flow=scaM_flow); Fluid.Actuators.Dampers.MixingBox mixBox( dpOut_nominal=0.467, dpRec_nominal=0.665, AOut=scaM_flow*1.32, AExh=scaM_flow*1.05, ARec=scaM_flow*1.05, mOut_flow_nominal=scaM_flow*1, mRec_flow_nominal=scaM_flow*1, mExh_flow_nominal=scaM_flow*1, redeclare package Medium = Medium, dpExh_nominal=0.467) "mixing box"; Buildings.Fluid.Sources.Boundary_pT bouIn( redeclare package Medium = Medium, use_p_in=true, nPorts=3, T=293.15); inner Modelica.Fluid.System system; Buildings.Controls.Continuous.LimPID PID( Ti=60, yMax=1, yMin=0, initType=Modelica.Blocks.Types.InitPID.InitialState, y_start=0, Td=60, controllerType=Modelica.Blocks.Types.SimpleController.P, k=0.1); Modelica.Blocks.Sources.Constant const(k=120); Fluid.Movers.FlowMachine_y fan32( redeclare package Medium = Medium, m_flow_nominal=mMIT_flow, redeclare function flowCharacteristic = Buildings.Fluid.Movers.BaseClasses.Characteristics.quadraticFlow ( V_flow_nominal={0,11.08,14.9}, dp_nominal={1508,743,100}), energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyStateInitial, addHeatToMedium=false, dynamicBalance=true); Fluid.Movers.FlowMachine_y fan56( redeclare package Medium = Medium, m_flow_nominal=mMIT_flow, redeclare function flowCharacteristic = Buildings.Fluid.Movers.BaseClasses.Characteristics.linearFlow ( V_flow_nominal={2.676,11.05}, dp_nominal={600,100}), energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyStateInitial, addHeatToMedium=false, dynamicBalance=true); equationconnect(PAtm.y, bouIn.p_in); connect(bouIn.ports[2], mixBox.port_Out); connect(bouIn.ports[3], mixBox.port_Exh); connect(const.y, PID.u_s); connect(roo.p_rel, PID.u_m); connect(yDam.y, mixBox.y); connect(roo.p, PAtm.y); connect(mixBox.port_Sup, res31.port_a); connect(res31.port_b, fan32.port_a); connect(fan32.port_b, res33.port_a); connect(fan56.port_a, roo.port_bExh); connect(res57.port_b, mixBox.port_Ret); connect(res57.port_a, fan56.port_b); connect(res33.port_b, roo.port_aSup); connect(PID.y, fan32.y); connect(PID.y, fan56.y); end VAVSystemCTControl;