Buildings.Examples.VAVCO2.BaseClasses

Package with base classes for Buildings.Examples.VAVCO2

Information

This package contains base classes that are used to construct the models in Buildings.Examples.VAVCO2.

Extends from Modelica.Icons.BasesPackage (Icon for packages containing base classes).

Package Content

Name Description
Buildings.Examples.VAVCO2.BaseClasses.DamperControl DamperControl Local loop controller for damper
Buildings.Examples.VAVCO2.BaseClasses.Occupancy Occupancy Model for occupancy
Buildings.Examples.VAVCO2.BaseClasses.RoomLeakage RoomLeakage Room leakage model
Buildings.Examples.VAVCO2.BaseClasses.RoomVAV RoomVAV Model for CO2 emitted by people
Buildings.Examples.VAVCO2.BaseClasses.Suite Suite Model of a suite consisting of five rooms of the MIT system model

Buildings.Examples.VAVCO2.BaseClasses.DamperControl Buildings.Examples.VAVCO2.BaseClasses.DamperControl

Local loop controller for damper

Buildings.Examples.VAVCO2.BaseClasses.DamperControl

Information

Extends from Modelica.Blocks.Interfaces.SISO (Single Input Single Output continuous control block).

Parameters

TypeNameDefaultDescription
RealCO2Set700E-6CO2 set point in volume fraction
RealKp10Gain

Connectors

TypeNameDescription
input RealInputuConnector of Real input signal
output RealOutputyConnector of Real output signal

Modelica definition

block DamperControl "Local loop controller for damper" extends Modelica.Blocks.Interfaces.SISO; parameter Real CO2Set = 700E-6 "CO2 set point in volume fraction"; parameter Real Kp = 10 "Gain"; Buildings.Controls.Continuous.LimPID con( yMin=0, y_start=0.5, Ti=1, controllerType=Modelica.Blocks.Types.SimpleController.P, k=Kp, yMax=1, reverseActing=false, Td=60); protected Modelica.Blocks.Sources.Constant xSetNor(k=1) "CO2 set point (normalized)"; Modelica.Blocks.Math.Gain gain1(k=1/CO2Set) "Gain. Division by CO2Set is to normalize the control error"; equation connect(con.y, y); connect(xSetNor.y, con.u_s); connect(gain1.y, con.u_m); connect(u, gain1.u); end DamperControl;

Buildings.Examples.VAVCO2.BaseClasses.Occupancy Buildings.Examples.VAVCO2.BaseClasses.Occupancy

Model for occupancy

Buildings.Examples.VAVCO2.BaseClasses.Occupancy

Information

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Connectors

TypeNameDescription
output RealOutputy1[2]Connector of Real output signals
output RealOutputy2[2]Connector of Real output signals
output RealOutputy3[2]Connector of Real output signals

Modelica definition

model Occupancy "Model for occupancy" extends Modelica.Blocks.Icons.Block; Modelica.Blocks.Sources.CombiTimeTable office1( extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic, smoothness=Modelica.Blocks.Types.Smoothness.ConstantSegments, tableOnFile=false, table=[-6,0.0; 8,2; 9,3; 12,2; 13,6; 15,3; 16,4; 18,0], timeScale=3600) "Office with double occupancy"; Modelica.Blocks.Sources.CombiTimeTable office2( extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic, smoothness=Modelica.Blocks.Types.Smoothness.ConstantSegments, tableOnFile=false, table=[-6,0.0; 8,2; 9,3; 12,2; 13,5; 15,3; 16,6; 18,0], timeScale=3600) "Office with double occupancy"; Modelica.Blocks.Sources.CombiTimeTable cla1( extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic, smoothness=Modelica.Blocks.Types.Smoothness.ConstantSegments, tableOnFile=false, table=[-6,0.0; 8,25; 9,20; 10,30; 12,0; 13,30; 15,40; 16,20; 18,0], timeScale=3600) "Class room"; Modelica.Blocks.Sources.CombiTimeTable cla2( extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic, smoothness=Modelica.Blocks.Types.Smoothness.ConstantSegments, tableOnFile=false, table=[-6,0.0; 8,20; 9,10; 10,20; 11,15; 12,0; 13,30; 15,20; 16,25; 18,0], timeScale=3600) "Class room"; Modelica.Blocks.Sources.CombiTimeTable smaRoo1( extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic, smoothness=Modelica.Blocks.Types.Smoothness.ConstantSegments, tableOnFile=false, table=[-6,0.0; 8,0.4; 9,1; 12,1; 13,0.5; 14,1.0; 16,0.5; 18,0], timeScale=3600) "Small rooms"; Modelica.Blocks.Sources.CombiTimeTable smaRoo2( extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic, smoothness=Modelica.Blocks.Types.Smoothness.ConstantSegments, tableOnFile=false, table=[-6,0.0; 8,0.4; 9,1; 10,0.4; 12,1; 13,0.3; 14,0.4; 16,0.2; 18,0], timeScale=3600) "Small rooms"; Modelica.Blocks.Interfaces.RealOutput y1[2] "Connector of Real output signals"; Modelica.Blocks.Interfaces.RealOutput y2[2] "Connector of Real output signals"; Modelica.Blocks.Interfaces.RealOutput y3[2] "Connector of Real output signals"; Modelica.Blocks.Math.Gain sca1(k=2) "Scaling for occupancy"; Modelica.Blocks.Math.Gain sca2(k=3) "Scaling for occupancy"; Modelica.Blocks.Math.Gain sca3(k=3) "Scaling for occupancy"; Modelica.Blocks.Math.Gain sca4(k=2) "Scaling for occupancy"; Modelica.Blocks.Math.Gain sca5(k=3) "Scaling for occupancy"; Modelica.Blocks.Math.Gain sca6(k=3) "Scaling for occupancy"; Modelica.Blocks.Routing.Multiplex2 mul1( final n1=1, final n2=1) "Multiplex to route signals"; Modelica.Blocks.Routing.Multiplex2 mul2( final n1=1, final n2=1) "Multiplex to route signals"; Modelica.Blocks.Routing.Multiplex2 mul3( final n1=1, final n2=1) "Multiplex to route signals"; equation connect(y1, mul1.y); connect(mul1.u1[1], sca1.y); connect(mul1.u2[1], sca4.y); connect(mul2.y, y2); connect(mul3.y, y3); connect(sca2.y, mul2.u1[1]); connect(sca5.y, mul2.u2[1]); connect(sca3.y, mul3.u1[1]); connect(sca6.y, mul3.u2[1]); connect(cla1.y[1], sca1.u); connect(cla2.y[1], sca4.u); connect(office1.y[1], sca2.u); connect(office2.y[1], sca5.u); connect(smaRoo1.y[1], sca3.u); connect(smaRoo2.y[1], sca6.u); end Occupancy;

Buildings.Examples.VAVCO2.BaseClasses.RoomLeakage Buildings.Examples.VAVCO2.BaseClasses.RoomLeakage

Room leakage model

Buildings.Examples.VAVCO2.BaseClasses.RoomLeakage

Information

Room leakage used in the MIT system model.

Extends from Buildings.BaseClasses.BaseIcon (Base icon).

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Interfaces.Pa...Medium in the component

Connectors

TypeNameDescription
replaceable package MediumMedium in the component
input RealInputpPressure
FluidPort_bport_b 

Modelica definition

model RoomLeakage "Room leakage model" extends Buildings.BaseClasses.BaseIcon; replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium in the component"; Buildings.Fluid.FixedResistances.PressureDrop res( m_flow_nominal=1, redeclare package Medium = Medium, dp_nominal=1000) "Resistance model"; Modelica.Blocks.Interfaces.RealInput p "Pressure"; Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare package Medium = Medium); Buildings.Fluid.Sources.Boundary_pT amb( redeclare package Medium =Medium, nPorts=1, use_p_in=true, p=101325, T=293.15); equation connect(res.port_b, port_b); connect(p, amb.p_in); connect(amb.ports[1], res.port_a); end RoomLeakage;

Buildings.Examples.VAVCO2.BaseClasses.RoomVAV Buildings.Examples.VAVCO2.BaseClasses.RoomVAV

Model for CO2 emitted by people

Buildings.Examples.VAVCO2.BaseClasses.RoomVAV

Information

Model of a room and a plenum. CO2 is injected into the room. An air damper controls how much air flows into the room to track the CO2 level.

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Interfaces.Pa...Medium in the component
VolumeVRoo Volume of room [m3]
VolumeVPle Volume of plenum [m3]
AreaADam Damper face area [m2]
MassFlowRatem_flow_nominal Nominal mass flow rate [kg/s]
Damper coefficients
Reall0.0001Damper leakage, ratio of flow coefficients k(y=0)/k(y=1)

Connectors

TypeNameDescription
replaceable package MediumMedium in the component
FluidPort_aportRoo1Fluid port
FluidPort_aportSupFluid port
FluidPort_aportRetFluid port
FluidPort_aportRoo2Fluid port
output RealOutputyDamDamper control signal
input RealInputnPeoNumber of people

Modelica definition

model RoomVAV "Model for CO2 emitted by people" replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium in the component"; parameter Modelica.SIunits.Volume VRoo "Volume of room"; parameter Modelica.SIunits.Volume VPle "Volume of plenum"; parameter Modelica.SIunits.Area ADam "Damper face area"; parameter Modelica.SIunits.MassFlowRate m_flow_nominal "Nominal mass flow rate"; parameter Real l(min=1e-10, max=1) = 0.0001 "Damper leakage, ratio of flow coefficients k(y=0)/k(y=1)"; Buildings.Fluid.Actuators.Dampers.Exponential vav( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, from_dp=false, dpDamper_nominal=0.27, dpFixed_nominal=1E2 - 0.27, final l=l); Buildings.Fluid.MixingVolumes.MixingVolume vol( redeclare package Medium = Medium, V=VRoo, nPorts=5, m_flow_nominal=m_flow_nominal, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, use_C_flow=true) "Room volume"; Buildings.Fluid.Sensors.TraceSubstances senCO2( redeclare package Medium = Medium, warnAboutOnePortConnection=false) "Sensor at volume"; Buildings.Fluid.MixingVolumes.MixingVolume ple( redeclare package Medium = Medium, V=VPle, m_flow_nominal=m_flow_nominal, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, nPorts=2) "Plenum volume"; Modelica.Fluid.Interfaces.FluidPort_a portRoo1( redeclare package Medium = Medium) "Fluid port"; Modelica.Fluid.Interfaces.FluidPort_a portSup( redeclare package Medium = Medium) "Fluid port"; Modelica.Fluid.Interfaces.FluidPort_a portRet( redeclare package Medium = Medium) "Fluid port"; Modelica.Fluid.Interfaces.FluidPort_a portRoo2( redeclare package Medium = Medium) "Fluid port"; Modelica.Blocks.Interfaces.RealOutput yDam "Damper control signal"; Modelica.Blocks.Interfaces.RealInput nPeo "Number of people"; Modelica.Blocks.Math.Gain gaiCO2(k=8.18E-6) "CO2 emission per person"; Buildings.Fluid.Sensors.Conversions.To_VolumeFraction volFraCO2( MMMea=Modelica.Media. IdealGases.Common.SingleGasesData.CO2.MM) "CO2 volume fraction"; DamperControl con(Kp=1) "Damper controller"; Modelica.Blocks.Math.Gain peoDen(k=2.5/VRoo) "People density per m2"; Modelica.Blocks.Sources.RealExpression vavACH( y=vav.m_flow*3600/VRoo/1.2) "VAV box air change per hour"; Buildings.Fluid.FixedResistances.PressureDrop dpPle( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, dp_nominal=20, from_dp=true); equation connect(senCO2.C, volFraCO2.m); connect(volFraCO2.V, con.u); connect(con.y, yDam); connect(con.y, vav.y); connect(nPeo, gaiCO2.u); connect(nPeo, peoDen.u); connect(portSup, vav.port_a); connect(portRoo1, vol.ports[1]); connect(vav.port_b, vol.ports[2]); connect(senCO2.port, vol.ports[3]); connect(portRoo2, vol.ports[4]); connect(dpPle.port_a, vol.ports[5]); connect(vol.C_flow[1], gaiCO2.y); connect(dpPle.port_b, ple.ports[1]); connect(ple.ports[2], portRet); end RoomVAV;

Buildings.Examples.VAVCO2.BaseClasses.Suite Buildings.Examples.VAVCO2.BaseClasses.Suite

Model of a suite consisting of five rooms of the MIT system model

Buildings.Examples.VAVCO2.BaseClasses.Suite

Information

Model of a suite consisting of five rooms for the MIT system model.

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Interfaces.Pa...Medium in the component
RealscaM_flow Scaling factor for mass flow rate
MassFlowRatem0Tot_flowscaM_flow*(5.196 + 2.8428 + ...[kg/s]
Damper coefficients
Reall0.0001Damper leakage, ratio of flow coefficients k(y=0)/k(y=1)

Connectors

TypeNameDescription
replaceable package MediumMedium in the component
input RealInputpPressure
FluidPort_bport_aSup 
FluidPort_bport_bExh 
output RealOutputp_relRelative pressure signal
output RealOutputyDam[6]VAV damper positions
output RealOutputdPRooRoom pressurization

Modelica definition

model Suite "Model of a suite consisting of five rooms of the MIT system model" replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium in the component"; Modelica.Blocks.Interfaces.RealInput p "Pressure"; Modelica.Fluid.Interfaces.FluidPort_b port_aSup( redeclare package Medium = Medium); parameter Real scaM_flow "Scaling factor for mass flow rate"; parameter Modelica.SIunits.MassFlowRate m0Tot_flow= scaM_flow*(5.196+2.8428+1.0044+0.9612+0.3624+0.1584); parameter Real l(min=1e-10, max=1) = 0.0001 "Damper leakage, ratio of flow coefficients k(y=0)/k(y=1)"; Buildings.Fluid.FixedResistances.Junction spl34( redeclare package Medium = Medium, m_flow_nominal=scaM_flow*{1,-1,-1}, dp_nominal={0.176,-0.844,-0.0662}, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState); Buildings.Fluid.FixedResistances.Junction mix55( redeclare package Medium = Medium, m_flow_nominal=scaM_flow*{-1,1,1}, dp_nominal=1E3*{-0.263200E-02,0.999990E-03,0.649000E-03}, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState); Buildings.Fluid.FixedResistances.PressureDrop res13( m_flow_nominal=scaM_flow*1, dp_nominal=0.1E3, redeclare package Medium = Medium); Buildings.Fluid.FixedResistances.PressureDrop res14( m_flow_nominal=scaM_flow*1, dp_nominal=0.1E3, redeclare package Medium = Medium); Buildings.Fluid.FixedResistances.PressureDrop res15( m_flow_nominal=scaM_flow*1, dp_nominal=0.1E3, redeclare package Medium = Medium); Buildings.Fluid.FixedResistances.PressureDrop res16( m_flow_nominal=scaM_flow*1, dp_nominal=0.1E3, redeclare package Medium = Medium); Buildings.Fluid.FixedResistances.PressureDrop res17( m_flow_nominal=scaM_flow*1, dp_nominal=0.1E3, redeclare package Medium = Medium); Buildings.Fluid.FixedResistances.Junction spl35( redeclare package Medium = Medium, m_flow_nominal=scaM_flow*{1,-1,-1}, dp_nominal=1E3*{0.371000E-04,-0.259000E-02,-0.131000E-02}, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState); Buildings.Fluid.FixedResistances.Junction spl36( redeclare package Medium = Medium, m_flow_nominal=scaM_flow*{1,-1,-1}, dp_nominal=1E3*{0.211000E-03,-0.128000E-01,-0.223000E-02}, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState); Buildings.Fluid.FixedResistances.Junction spl37( redeclare package Medium = Medium, m_flow_nominal=scaM_flow*{1,-1,-1}, dp_nominal=1E3*{0.730000E-03,-0.128000E-01,-0.938000E-02}, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState); Buildings.Fluid.FixedResistances.Junction spl38( redeclare package Medium = Medium, m_flow_nominal=scaM_flow*{1,-1,-1}, dp_nominal=1E3*{0.731000E-02,-0.895000E-01,-0.942000E-01}, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState); Buildings.Fluid.FixedResistances.Junction mix54( redeclare package Medium = Medium, m_flow_nominal=scaM_flow*{-1,1,1}, dp_nominal=1E3*{-0.653000E-02,0.271000E-03,0.402000E-04}, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState); Buildings.Fluid.FixedResistances.Junction mix53( redeclare package Medium = Medium, m_flow_nominal=scaM_flow*{-1,1,1}, dp_nominal=1E3*{-0.566000E-01,0.541000E-02,0.749000E-04}, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState); Buildings.Fluid.FixedResistances.Junction mix52( redeclare package Medium = Medium, m_flow_nominal=scaM_flow*{-1,1,1}, dp_nominal=1E3*{-0.353960,0.494000E-03,0.922000E-03}, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState); Buildings.Fluid.FixedResistances.Junction mix51( redeclare package Medium = Medium, m_flow_nominal=scaM_flow*{-1,1,1}, dp_nominal=1E3*{-0.847600E-01,1.89750,0.150000E-02}, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState); Modelica.Fluid.Interfaces.FluidPort_b port_bExh( redeclare package Medium = Medium); Buildings.Fluid.FixedResistances.PressureDrop res1( m_flow_nominal=scaM_flow*1, dp_nominal=0.1E3, redeclare package Medium = Medium); RoomVAV roo45( redeclare package Medium = Medium, ADam=scaM_flow*0.49, m_flow_nominal=scaM_flow*5.196, VRoo=1820, VPle=396, final l=l) "Room model"; RoomVAV roo46( redeclare package Medium = Medium, ADam=scaM_flow*0.245, m_flow_nominal=scaM_flow*2.8428, VRoo=1210, VPle=330, final l=l) "Room model"; RoomVAV roo47( redeclare package Medium = Medium, ADam=scaM_flow*0.128, m_flow_nominal=scaM_flow*1.0044, VRoo=647, VPle=125, final l=l) "Room model"; RoomVAV roo48( redeclare package Medium = Medium, ADam=scaM_flow*0.128, m_flow_nominal=scaM_flow*0.9612, VRoo=385, VPle=107, final l=l) "Room model"; RoomVAV roo49( redeclare package Medium = Medium, ADam=scaM_flow*0.0494, m_flow_nominal=scaM_flow*0.3624, VRoo=48, VPle=13, final l=l) "Room model"; RoomVAV roo50( redeclare package Medium = Medium, ADam=scaM_flow*0.024, m_flow_nominal=scaM_flow*0.1584, VRoo=155, VPle=43, final l=l) "Room model"; Occupancy occ "Occupancy"; Buildings.Fluid.Sensors.RelativePressure dpMea( redeclare package Medium = Medium) "Static pressure measurement"; Modelica.Blocks.Interfaces.RealOutput p_rel "Relative pressure signal"; Modelica.Blocks.Interfaces.RealOutput yDam[6] "VAV damper positions"; Buildings.Fluid.Sensors.Pressure pRoo(redeclare package Medium = Medium) "Room pressure"; Modelica.Blocks.Math.Feedback feeBac; Modelica.Blocks.Interfaces.RealOutput dPRoo "Room pressurization"; equation connect(spl38.port_2, roo50.portSup); connect(port_aSup, spl34.port_1); connect(spl34.port_2, spl35.port_1); connect(spl35.port_2, spl36.port_1); connect(spl36.port_2, spl37.port_1); connect(spl37.port_2, spl38.port_1); connect(dpMea.port_a, spl38.port_1); connect(pRoo.p, feeBac.u2); connect(roo50.portRoo2, pRoo.port); connect(spl34.port_3, roo45.portSup); connect(spl35.port_3, roo46.portSup); connect(spl36.port_3, roo47.portSup); connect(spl37.port_3, roo48.portSup); connect(spl38.port_3, roo49.portSup); connect(dpMea.port_b, res16.port_b); connect(p, feeBac.u1); connect(dPRoo, feeBac.y); connect(dpMea.p_rel, p_rel); connect(roo45.yDam, yDam[1]); connect(roo46.yDam, yDam[2]); connect(roo47.yDam, yDam[3]); connect(roo48.yDam, yDam[4]); connect(roo49.yDam, yDam[5]); connect(roo50.yDam, yDam[6]); connect(occ.y1[1], roo45.nPeo); connect(occ.y1[2], roo46.nPeo); connect(occ.y2[1], roo47.nPeo); connect(occ.y2[2], roo48.nPeo); connect(occ.y3[1], roo49.nPeo); connect(occ.y3[2], roo50.nPeo); connect(port_bExh, mix55.port_1); connect(mix55.port_2, mix54.port_1); connect(mix54.port_2, mix53.port_1); connect(mix53.port_2, mix52.port_1); connect(mix52.port_2, mix51.port_1); connect(mix51.port_2, roo50.portRet); connect(roo48.portRet, mix51.port_3); connect(mix52.port_3, roo49.portRet); connect(roo47.portRet, mix53.port_3); connect(roo46.portRet, mix54.port_3); connect(roo45.portRet, mix55.port_3); connect(res1.port_b, roo45.portRoo1); connect(roo45.portRoo2, res13.port_a); connect(res13.port_b, roo46.portRoo1); connect(roo46.portRoo2, res14.port_a); connect(res14.port_b, roo47.portRoo1); connect(roo47.portRoo2, res15.port_a); connect(res15.port_b, roo48.portRoo1); connect(roo48.portRoo2, res16.port_a); connect(res16.port_b, roo49.portRoo1); connect(roo49.portRoo2, res17.port_a); connect(res17.port_b, roo50.portRoo1); connect(roo50.portRoo2, res1.port_a); end Suite;