Buildings Library for Building Energy and Control …putes air leakage. It describes a...

10
Recent Developments of the Modelica “Buildings” Library for Building Energy and Control Systems Michael Wetter, Wangda Zuo, Thierry Stephane Nouidui Simulation Research Group, Building Technologies Department, Environmental Energy Technologies Division, Lawrence Berkeley National Laboratory, Berkeley, CA 94720, USA Abstract At the Modelica 2009 conference, we introduced the Buildings library, a freely available Model- ica library for building energy and control sys- tems [16]. This paper reports the updates of the library and presents example applications for a range of heating, ventilation and air conditioning (HVAC) systems. Over the past two years, the library has been further developed. The number of HVAC components models has been doubled and various components have been revised to increase numer- ical robustness. The paper starts with an overview of the li- brary architecture and a description of the main packages. To demonstrate the features of the Buildings library, applications that include mul- tizone airflow simulation as well as supervisory and local loop control of a variable air volume (VAV) system are briefly described. The paper closes with a discussion of the current develop- ment. Keywords: building energy systems, heating, ventilation, air-conditioning, controls 1 Introduction Buildings account for a large portion of energy consumption and related green house gas emis- sions. For example, in the United States, build- ings consume 2/3 of electricity and 40% of total energy [4]. In order to reduce global green house gas emissions, it is critical to reduce building en- ergy consumption by increasing energy-efficiency and by using more renewable energy. To support the design and operation of low energy buildings, a simulation program should support: 1. rapid prototyping of new building systems, 2. comparison of the performance of different de- signs of the building, its energy system and its control algorithms, 3. analysis of the operation of existing building systems, 4. development and specification of building control sequences, and 5. reuse of models during operation for energy- minimizing controls, fault detection and diag- nostics. To support these use cases, we develop an open-source Modelica library for building en- ergy and control systems. The library is freely available from http://www.modelica.org/ libraries/Buildings. At the 7th Modelica conference in 2009, we introduced the Buildings library, version 0.6.0, which had 73 non-partial models and blocks, as well as 26 functions. The latest version, 0.10.0, has 129 non-partial models and blocks and 39 func- tions. This paper highlights some of these updates to inform users about the new capabilities. The paper is structured as follows: Section 2 gives an overview of the Buildings library. Sec- tion 3 describes the updates in detail. Section 4 presents applications with models for multizone airflow simulation and for co-simulation. Section 5 describes classes which are currently under devel- opment and will be available in future releases. 2 Summary of the Buildings Li- brary The Buildings library is based on the Modelica.Fluid library [8]. The Buildings li- brary is organized into the packages shown in Fig. 1. Components in these packages augment models from the Modelica Standard Library and from the Modelica.Fluid library. Base classes, which are typically not of interest to the end-user, but are used to construct other classes, are stored in packages called BaseClasses. Most packages Proceedings 8th Modelica Conference, Dresden, Germany, March 20-22, 2011 266

Transcript of Buildings Library for Building Energy and Control …putes air leakage. It describes a...

Page 1: Buildings Library for Building Energy and Control …putes air leakage. It describes a one-directional pressure driven air ow through a crack-like open-ing. The opening is modeled

Recent Developments of the Modelica “Buildings”Library for Building Energy and Control Systems

Michael Wetter, Wangda Zuo, Thierry Stephane NouiduiSimulation Research Group, Building Technologies Department,

Environmental Energy Technologies Division, Lawrence Berkeley National Laboratory,Berkeley, CA 94720, USA

Abstract

At the Modelica 2009 conference, we introducedthe Buildings library, a freely available Model-ica library for building energy and control sys-tems [16].

This paper reports the updates of the libraryand presents example applications for a range ofheating, ventilation and air conditioning (HVAC)systems. Over the past two years, the library hasbeen further developed. The number of HVACcomponents models has been doubled and variouscomponents have been revised to increase numer-ical robustness.

The paper starts with an overview of the li-brary architecture and a description of the mainpackages. To demonstrate the features of theBuildings library, applications that include mul-tizone airflow simulation as well as supervisoryand local loop control of a variable air volume(VAV) system are briefly described. The papercloses with a discussion of the current develop-ment.

Keywords: building energy systems, heating,ventilation, air-conditioning, controls

1 Introduction

Buildings account for a large portion of energyconsumption and related green house gas emis-sions. For example, in the United States, build-ings consume 2/3 of electricity and 40% of totalenergy [4]. In order to reduce global green housegas emissions, it is critical to reduce building en-ergy consumption by increasing energy-efficiencyand by using more renewable energy. To supportthe design and operation of low energy buildings,a simulation program should support:

1. rapid prototyping of new building systems,2. comparison of the performance of different de-

signs of the building, its energy system and its

control algorithms,3. analysis of the operation of existing building

systems,4. development and specification of building

control sequences, and5. reuse of models during operation for energy-

minimizing controls, fault detection and diag-nostics.

To support these use cases, we develop anopen-source Modelica library for building en-ergy and control systems. The library isfreely available from http://www.modelica.org/

libraries/Buildings.

At the 7th Modelica conference in 2009, weintroduced the Buildings library, version 0.6.0,which had 73 non-partial models and blocks, aswell as 26 functions. The latest version, 0.10.0, has129 non-partial models and blocks and 39 func-tions. This paper highlights some of these updatesto inform users about the new capabilities.

The paper is structured as follows: Section 2gives an overview of the Buildings library. Sec-tion 3 describes the updates in detail. Section 4presents applications with models for multizoneairflow simulation and for co-simulation. Section 5describes classes which are currently under devel-opment and will be available in future releases.

2 Summary of the Buildings Li-brary

The Buildings library is based on theModelica.Fluid library [8]. The Buildings li-brary is organized into the packages shown inFig. 1. Components in these packages augmentmodels from the Modelica Standard Library andfrom the Modelica.Fluid library. Base classes,which are typically not of interest to the end-user,but are used to construct other classes, are storedin packages called BaseClasses. Most packages

Proceedings 8th Modelica Conference, Dresden, Germany, March 20-22, 2011

266

Page 2: Buildings Library for Building Energy and Control …putes air leakage. It describes a one-directional pressure driven air ow through a crack-like open-ing. The opening is modeled

contain a package called Examples, which con-tains example applications. The examples illus-trate typical use of components in the parent di-rectories. They are also used to conduct unit tests.

The current Buildings library contains six ma-jor packages, including a new package Airflow.The package Airflow provides models to computethe airflow inside the buildings and between thebuilding and the ambient environment. It cur-rently has a package Multizone for multizone air-flow models, which is discussed in Section 3.1.The Controls package contains components forcontinuous time control, discrete time control andscheduling of set points. The package Fluid isthe largest package of the Buildings library. Itcontains components for fluid flow systems, suchas pumps, boilers, chillers, valves and sensors,which are described in Section 3.3. The pack-age HeatTransfer contains models for heat trans-fer in buildings (Section 3.4). It provides mod-els and functions for heat transfer due to con-vection, conduction and radiation. It also hasthermal property data for different solid mate-rials. The Media package contains media mod-els that are simpler and generally computation-ally more efficient than the ones in the ModelicaStandard Library. The simplifications have beendone by taking into account that HVAC systemsin buildings typically have a smaller range of op-erating conditions compared to other thermody-namic applications. The Utilities package pro-vides utilities such as for the calculation of ther-mal comfort and psychrometric properties. It alsohas an interface to the Building Control VirtualTest Bed (BCVTB) [17], which can connect Mod-elica to other simulation programs, such as Ener-gyPlus, MATLAB/Simulink and Radiance, for co-simulation. The BCVTB can also connect Mod-elica models to building automation systems formodel-based operation.

3 Updates of the Buildings Li-brary

This section compares the newest Buildings li-brary, version 0.10.0, with version 0.6.0 which wasreported in the last Modelica conference [16]. Thepurpose is to explain to users the new packages,models and blocks, as well as their new features.

3.1 Package AirflowThe airflow package provides models for com-

puting air flow inside a building and between abuilding and its exterior environment. For build-

Buildings.Airflow.Multizone.Controls.Continuous

.Discrete

.SetPoints.Fluid.Actuators.Dampers

.Motors

.Valves.Boilers.Chillers.Delays.FixedResistances.HeatExchangers.HeatExchangers.CoolingTowers

.Radiators.Interfaces.MassExchangers.MixingVolumes.Movers.Sensors.Sources.Storage.Utilities

.HeatTransfer

.Media.ConstantPropertyLiquidWater.GasesPTDecoupled.GasConstantDensity.IdealGases.PerfectGases

.Utilities.Comfort.Diagnostics.IO.BCVTB.Math.Psychometrics.Reports

Figure 1: Package structure of the Buildings li-brary. Only the major packages are shown. Boldindicates a new package and italic indicates exist-ing packages with new models added.

ing simulation, many different indoor airflow mod-els are generally used, such as multizone networkmodels [3], zonal models [12], computational fluiddynamics [13], and fast fluid dynamics [18]. For in-door airflow simulation, multizone network modelswith the well-mixed air assumption are fast butnot appropriate if the air is stratified. By solv-ing the Navier-Stokes equations and equations forconservation of mass and energy, computationalfluid dynamics (CFD) is the most detailed andaccurate modeling method. However, computingtime for CFD is large for flow simulation in a largebuilding or over a long time horizon. To fill thegap between multizone and CFD, fast fluid dy-namics models solve the Navier-Stokes equationswith simplified schemes that are much faster butless accurate than CFD.

Proceedings 8th Modelica Conference, Dresden, Germany, March 20-22, 2011

267

Page 3: Buildings Library for Building Energy and Control …putes air leakage. It describes a one-directional pressure driven air ow through a crack-like open-ing. The opening is modeled

Currently, the Airflow package contains mul-tizone airflow models in the package Multizone.These models compute the airflow and contam-inant transport between different rooms, as wellas between a room and the exterior. Multizoneairflow models assume that air and contaminantsin each room volume are completely mixed. Thedriving force for the air flow is pressure differenceinduced by flow imbalance of the HVAC system,density difference across large openings (such asopen doors or windows), stack effects in high risebuildings, and wind pressure on the building fa-cade.

The air volume in each room is modeled byan instantaneously mixed volume that providesdifferential equations for conservation of mass,species concentration, trace substances and inter-nal energy. As in Modelica.Fluid, a parametercan be used to switch between steady-state andtransient simulation, and to switch the initializa-tion equations between steady-state initializationand prescribed state variables.

The flow resistance between these volumes iscomputed using the orifice equation

V̇ = CdA√

2/ρ∆Pm, (1)

where V̇ is the volume flow rate, Cd is the dimen-sionless discharge coefficient, A is the cross sectionarea of the opening, ρ is the density of the fluid,∆P is the static pressure difference and m is theflow exponent. Large openings are characterizedby m very close to 0.5, while values near 0.65 havebeen found for small crack-like openings. Typicalvalues for Cd and m can be found in [15] and inthe citations therein. For pressure differences thatare smaller in magnitude than a user-specified pa-rameter, equation (1) is regularized to ensure thatit is differentiable with a continuous derivative.

The model EffectiveAirLeakageArea com-putes air leakage. It describes a one-directionalpressure driven air flow through a crack-like open-ing. The opening is modeled as an orifice. Theorifice area is parameterized by processing the ef-fective air leakage area, the discharge coefficientand pressure drop at a reference condition. Theeffective air leakage area can be obtained, for ex-ample, from the ASHRAE fundamentals [1]. Asimilar model is also used in the multizone airflowmodeling software CONTAM [5].

To compute the bi-directional flow across largeopenings, such as doors, the opening is dis-cretized along its height into compartments.Then, the orifice equation (1) is used to com-pute the flow for each compartment as explained

in [15]. The model DoorDiscretizedOpen de-scribes a door that is always open, and themodel DoorDiscretizedOperable describes adoor whose opening area can be changed usinga control signal.

To model the pressure difference caused by stackeffect, one can use the model MediumColumn fora steady-state and MediumColumnDynamic for atransient model. The model MediumColumn com-putes the pressure difference at its ports using

∆p = h ρ g, (2)

where h is the height of the medium column, ρis the density and g is the earth acceleration.The model MediumColumn can be parameterizedto use for ρ the density of either port, or the den-sity of the inflowing medium. The latter situa-tion allows, for example, modeling of a verticalshaft, such as a chimney, whose density may beequal to the one of the inflowing medium. Themodel MediumColumnDynamic contains, in addi-tion to (2), also a mixing volume that may beused to approximate the transient response of themedium column, or to inject heat into the airstream as may happen in a solar chimney in whichwalls absorb solar radiation and heat the fluid in-side the chimney to increase the buoyancy force.

The models ZonalFlow ACS andZonalFlow m flow can be used to exchangea fixed flow rate between two volumes. As aninput, they use the air exchange rate per secondand the mass flow rate, respectively.

The Multizone package was implemented basedon the multizone package described in [15], whichhas been contributed by the United Technolo-gies Research Center (UTRC) for inclusion in theBuildings library. However, several changes havebeen done when migrating the models to Mod-elica 3.1, which led to a simpler implementationbased on the stream function [9]. A comparisonbetween the two implementations is described inSection 4.1.

3.2 Package ControlsThe package Controls contains blocks that can

be used in conjunction with the controls mod-els from the Modelica Standard Library to im-plement controllers of building energy systems.The package Controls.Continuous has a newmodel LimPID, which can provide P, PI, PD, andPID controllers with limited output, anti-windupcompensation and setpoint weighting. The pack-age Controls.SetPoints has a new model Table,which allows setting a time-varying set point.

Proceedings 8th Modelica Conference, Dresden, Germany, March 20-22, 2011

268

Page 4: Buildings Library for Building Energy and Control …putes air leakage. It describes a one-directional pressure driven air ow through a crack-like open-ing. The opening is modeled

3.3 Package FluidThe Fluid package contains component mod-

els for thermo-fluid flow systems. The level ofmodeling detail is comparable with the mod-els of the Modelica.Fluid library. Most mod-els in Buildings.Fluid extend models fromModelica.Fluid to form components that aretypically needed when modeling building energysystems. The Fluid package is the largest pack-age in the Buildings library, and it has 15 sub-packages. This section will discuss seven sub-packages to which new models have been added.

3.3.1 Package Fluid.Chillers

The package Fluid.Chillers contains two newchiller models. The first chiller model is an elec-tric chiller based on the EnergyPlus chiller modelChiller:Electric:EIR. This model uses threefunctions to predict its capacity and its power con-sumption:

• a biquadratic function is used to predict itscooling capacity as a function of condenserentering and evaporator leaving fluid temper-ature,• a quadratic function is used to predict its

power input to cooling capacity ratio as afunction of the part load ratio,• a biquadratic function is used to predict its

power input to cooling capacity ratio as afunction of condenser entering and evapora-tor leaving fluid temperature.

The second implemented chiller model is anelectric chiller based on the model by Hy-deman et al. [10]. This model is alsoimplemented in EnergyPlus as the modelChiller:Electric:ReformulatedEIR and is sim-ilar to the first chiller model. The main dif-ference is that to compute its performance, thismodel uses the condenser leaving temperature in-stead of the entering temperature, and it uses abicubic polynomial instead of a quadratic func-tion to compute the part load performance. Thismodel is reported to provide higher accuracy forvariable-speed compressor drive and variable con-denser water flow applications compared to themodel Chiller:Electric:EIR.

The package Fluid.Chillers.Data containsperformance data for more than 300 chillers.

3.3.2 Package Fluid.Interfaces

Similarly to Modelica.Fluid.Interfaces,there is a package Buildings.Fluid.Interfaces.It contains partial models for algebraic and dy-namic components that exchange heat or

mass with one or two fluid streams. Themodel PartialLumpedVolume has been addedto provide a base class for an ideally mixedfluid volume with the ability to store massand energy. This model is similar to thepartial model PartialLumpedVolume fromModelica.Fluid.Interfaces, except that itallows modeling the air humidity using a differ-ential equation, while modeling the total massbalance using a steady-state equation.

3.3.3 Package Fluid.Actuators

The package Fluid.Actuators contains mod-els of actuators. There are models of valves withtwo and three fluid ports and with various openingcharacteristics as well as models of air dampers.There are also models of motors that can be usedin conjunction with the actuators.

The main change to this package was a redesignof the three-way-valves. The new implementa-tion allows the optional addition of a fluid volumewhere the two fluid streams mix. The fluid vol-ume can be conditionally added or removed basedon the parameter dynamicBalance. The use ofthis fluid volume often leads to a more robust andfaster simulation.

3.3.4 Package Fluid.HeatExchangers

This package contains algebraic and dynamicheat exchanger models, some of which com-pute condensation of water vapor that mayoccur at a cooling coil. Several new modelshave been added. For example, the modelHeatExchangers.DryEffectivenessNTU de-scribes a heat exchanger without water vaporcondensation that is based on the effectiveness-NTU relation [11]. This model transfers heat inthe amount of

Q̇ = ε Q̇max, (3)

where Q̇max is the maximum heat that can betransferred, and ε is the heat transfer effective-ness, defined as

ε = f(NTU,Z, flowRegime), (4)

where NTU is number of transfer units, Z isthe ratio of minimum to maximum capacity flowrate and flowRegime is the heat exchanger flowregime, such as parallel flow, cross flow or counterflow.

Also new in this package are the modelsDryCoilCounterFlow and WetCoilCounterFlow,which are finite volume models of counter flowheat exchanger without and with water vapor con-densation if the air is cooled below its saturationtemperature.

Proceedings 8th Modelica Conference, Dresden, Germany, March 20-22, 2011

269

Page 5: Buildings Library for Building Energy and Control …putes air leakage. It describes a one-directional pressure driven air ow through a crack-like open-ing. The opening is modeled

3.3.5 Package Fluid.Movers

This package contains component models forfans and pumps. Four new models have beenadded that can be parameterized by performancecurves that compute pressure rise, electrical powerdraw or efficiency as a function of the flow rate.The four models differ in their implementation ofthe input signal, which can be a control signal, aprescribed speed, a prescribed mass flow rate or aprescribed pressure rise.

The models FlowMachine y andFlowMachine Nrpm take a control signal or anumber of revolutions as an input, and thencompute the resulting pressure difference for thecurrent flow rate. The models FlowMachine dp

and FlowMachine m flow take the pressure differ-ence or the mass flow rate as an input signal. Thepressure difference or the mass flow rate will thenbe provided by the fan or the pump. These twomodels do not have a performance curve for theflow characteristics, because solving for the flowrate and the revolution at zero pressure differencecan lead to a singularity.

All models can be configured to have a fluidvolume at the low-pressure side. Adding such avolume sometimes helps the solver find a solutionduring initialization and time integration of largemodels.

All models compute the motor power draw Pele,the hydraulic power input Whyd, the flow work

Wflo and the heat dissipated into the medium Q̇.The governing equations are

Wflo = |V̇ ∆p|, (5)

Whyd = Wflo + Q̇, (6)

η = Wflo/Pele = ηhyd ηmot, (7)

ηhyd = Wflo/Whyd, (8)

ηmot = Whyd/Pele, (9)

where V̇ is the volume flow rate, ∆p is the pres-sure rise, η is the overall efficiency, ηhyd is thehydraulic efficiency, and ηmot is the motor effi-ciency. All models take as a parameter an effi-ciency curve for the motor. This function has theform ηmot = f(V̇ /V̇max), where V̇max is the max-imum flow rate. The models FlowMachine y andFlowMachine Nrpm set V̇max = fc(∆p = 0, rN =1) where fc(·, ·) is a user-specified flow characteris-tic and rN is the ratio of actual to nominal speed.Since FlowMachine dp and FlowMachine m flow

are not parametrized by the function fc(·, ·), theparameter V̇max must be set by the user for thesemodels.

These models have similar param-eters as the models in the packageModelica.Fluid.Machines. However, themodels in this package differ primarily in thefollowing points:

• They use a different base class, which al-lows having zero mass flow rate for thefan and pump models. The models inModelica.Fluid.Machines restrict the num-ber of revolutions, and hence the flow rate, tobe non-zero.• For the model with prescribed pressure, the

input signal is the pressure difference betweentwo ports, and not the absolute pressure atthe outlet port.• The pressure calculations are based on to-

tal pressure in Pascals instead of the pumphead in meters. This change has been madeto avoid ambiguities in the parameterizationif the models are used as a fan with air asthe medium. The original formulation inModelica.Fluid.Machines converts head topressure using the density of the medium. Forfans, head would be converted to pressure us-ing the density of air. However, manufac-turers of fans typically publish the head inmillimeters water (mmH20). Therefore, toavoid confusion when using these models withmedia other than water, our implementationuses total pressure in Pascals instead of headin meters.• Additional performance curves

have been added to the packageBuildings.Fluid.Movers.BaseClasses.-

Characteristics.

3.3.6 Package Fluid.Sensors

This package consists of idealized sensor com-ponents that provide variables of the medium.These signals can be further processed with com-ponents of the Modelica.Blocks library. One canalso build more realistic sensor models by fur-ther processing their output signal (e.g., by at-taching the block Modelica.Blocks.FirstOrder

to model the time constant of the sensor). Thenew version of the library increased the number ofsensors from 4 to 22. Sensors are now available fordensity, enthalpy, mass flow rate, volume flow rate,pressure, relative humidity, dry bulb temperature,wet bulb temperature, species concentration, suchas water vapor, and trace substances, such as car-bon dioxide.

Proceedings 8th Modelica Conference, Dresden, Germany, March 20-22, 2011

270

Page 6: Buildings Library for Building Energy and Control …putes air leakage. It describes a one-directional pressure driven air ow through a crack-like open-ing. The opening is modeled

3.3.7 Package Fluid.Sources

This package contains models for fixed or pre-scribed boundary conditions for thermo-fluid sys-tems. The new version of the library adds fivedifferent combinations of boundary sources. Forexample, the model Boundary ph prescribes pres-sure, specific enthalpy, mass fraction and tracesubstances. The model MassFlowSource T is anideal flow source that produces a prescribed massflow rate with prescribed temperature, mass frac-tion and trace substances.

3.3.8 Package Fluid.Storage

This package contains models of ther-mal energy storage tanks. For the modelStratifiedEnhanced, a new model using theQUICK scheme [6] for the discretization of thefluid volume has been implemented. It computesa heat flux that needs to be added to each volumein order to give the results that a third-orderupwind discretization scheme would give. Ifa standard third-order upwind discretizationscheme were to be used, then the temperatures ofthe elements that face the tank inlet and outletports would overshoot by a few tenths of a Kelvin.To reduce this overshoot, the model uses a firstorder scheme at the boundary elements, and itadds a term that ensures that the energy balanceis satisfied. Without this term, small numericalerrors in the energy balance, introduced by thethird order discretization scheme, would occur.

3.4 Package HeatTransfer

This package contains models for heat trans-fer elements. Based on a single-layer con-duction model ConductorSingleLayer, thenew version of the library adds the modelConductorMultiLayer for one-dimensionaldynamic and steady-state heat conductionthrough multi-layer constructions. In addition,a convection model Convection and a modelfor combination of convection and conductionfor opaque constructions ConstructionOpaque

are also implemented. The models for heatconvection are parameterized by different func-tions that compute heat convection based ontemperature differences, or based on a constantvalue. These functions are available in the packageHeatTransfer.Functions.ConvectiveHeatFlux.

3.5 Package Media

This package contains media models thatcan be used in addition to the models fromModelica.Media. Some of the media models

in this package are based on simplified stateequations and property equations. The sim-plification can generally lead to a faster andmore robust simulation compared to the mod-els of Modelica.Media. The new version adds asub-package Media.GasesConstantDensity. Themodels in this sub-package use a constant massdensity to avoid having pressure as a state vari-able in mixing volumes. The advantage of usingconstant mass density is that fast transients intro-duced by a change in pressure are avoided. Thedisadvantage is that the dimensionality of the cou-pled nonlinear equation system is typically largerfor flow networks.

3.6 Package Utilities

This package contains various utility mod-els and functions, including diagnostics models,mathematical functions and a package for co-simulation with the Building Controls Virtual TestBed (BCVTB). The BCVTB is a middle-ware thatcan connect Modelica with different simulationprograms, such as MATLAB/Simulink, Energy-Plus and Radiance. The BCVTB can also link tobuilding automation systems through a BACnetinterface [2] and through analog/digital convert-ers.

More interfaces, such as a model forthe boundary condition for HVAC sys-tems that use a medium with moist airBCVTB.MoistAirInterface and blocks fortemperature conversions BCVTB.to degC,BCVTB.from degC, are introduced in the newversion to facilitate the communication betweenModelica and the BCVTB. For illustration, Fig. 2shows an air-based heating system with an idealheater and an ideal humidifier in the supply duct.The heating system is coupled to the BCVTB forco-simulation with EnergyPlus. The heater andhumidifier are controlled with a feedback loopthat tracks the room air temperature and roomair humidity. These quantities are simulated inthe EnergyPlus building simulation program.The component bouBCVTB models the boundarybetween the domain that models the air system(simulated in Modelica) and the room response(simulated in EnergyPlus).

To assess comfort conditions in rooms, the newversion of the library adds a sub-package Comfort.This package contains a model that computesthe thermal comfort according to the relations ofFanger [1]. In Fanger’s model, the thermal sensa-tion of a human is mainly related to the thermal

Proceedings 8th Modelica Conference, Dresden, Germany, March 20-22, 2011

271

Page 7: Buildings Library for Building Energy and Control …putes air leakage. It describes a one-directional pressure driven air ow through a crack-like open-ing. The opening is modeled

Figure 2: Modelica model that is used for co-simulation of a simple HVAC system that is connectedto an EnergyPlus building model.

balance of its body. This balance is influencedby two groups of factors: personal and physical.The activity level and clothing thermal insulationof the subject form the group of personal factors,while the environmental parameters (e.g., air tem-perature, mean radiant temperature, air velocity,and air humidity) compose the group of physicalfactors. When the personal factors have been es-timated and the physical factors have been mea-sured, the average thermal sensation of a largegroup of people can be predicted by calculatingthe PMV (Predicted Mean Vote) index. The PPD(Predicted Percentage of Dissatisfied) index, ob-tained from the PMV index, provides informationon thermal discomfort (thermal dissatisfaction) bypredicting the percentage of people likely to feeltoo hot or too cold in the given thermal environ-ment.

4 Applications

4.1 Multizone Air Flow Model

The multizone air flow model in the Buildings

library is based on the library implemented byUTRC, which is presented in [15]. We convertedthe library to use the stream connectors [9], andimplemented it in the Buildings library. Fig. 3compares model diagrams for modeling airflow inthree rooms. The diagram using stream connec-tors in Fig.3(a) is much simpler than the one with-

out the stream connectors in Fig. 3(b). The mod-els became simpler, since with stream connectors,the inStream operator can be used to obtain theproperties of the medium inside the volumes thatare connected to the model that computes thestack effect.

We also compared the mass flow rates throughthe door and the openings in the walls. The massflow rates computed by the new version are thesame as in the original implementation [15], whichindicates that the implementation of the multi-zone airflow models using stream connectors wassuccessful.

4.2 Modelica EnergyPlus Co-simulation for the Control of aVAV System

This example illustrates the use of co-simulationbetween Modelica and EnergyPlus through theBCVTB. In Modelica, we implemented a variableair volume flow system for a building with fivethermal zones. The Modelica model implementsthe airflow network, the fans and heat exchangers,and the supervisory and local loop control. At theair inlet and outlet of the five thermal zones, anenergy balance is made for the sensible and la-tent heat exchange. These heat flows are thenadded to the model of the thermal zones in Ener-gyPlus. EnergyPlus then computes the new roomtemperatures and water vapor concentrations, as

Proceedings 8th Modelica Conference, Dresden, Germany, March 20-22, 2011

272

Page 8: Buildings Library for Building Energy and Control …putes air leakage. It describes a one-directional pressure driven air ow through a crack-like open-ing. The opening is modeled

oriOut…

oriOut…

volOut

oriWe…

dooOp…y

open

k=1

oriE

as…

system

gde…

TTop

T=2…K

TWes

T=2…K

TEas

T=2…K

(a) With stream connectors.

(b) Without stream connectors.

Figure 3: Comparison between diagrams of threeroom problem implemented by Modelica multi-zone airflow models with and without stream con-nectors. Subfigure (b) is the model presentedin [15].

well as the current weather conditions. Energy-Plus also computes the heat balance of the build-ing and the lighting control as a function of theavailable daylight. Thus, the co-simulation allowsusers to utilize Modelica for the implementationand performance assessment of control sequences,and to utilize EnergyPlus for its whole buildingheat transfer and daylighting models.

Fig. 4 illustrates the HVAC system as imple-mented in Modelica. The total system model con-tained 970 components that led to a differentialalgebraic equation system with 5,000 scalar equa-tions. The translated model had 90 continuoustime states and 20 nonlinear systems of equationswith dimensions up to 6. There are no numer-

ical Jacobians. The Modelica models are linkedthrough the BCVTB to EnergyPlus, as shown inFig. 5. For a more detailed description about thissystem and its simulation results, see [17].

Figure 5: BCVTB model for the co-simulation be-tween Modelica and EnergyPlus.

5 Ongoing WorkThe next major addition to the Buildings li-

brary will be a package with models for a ther-mal zone that compute heat transfer through thebuilding envelope and within a room. While theBuildings library can already be linked to En-ergyPlus, for some situations, it is more practicalto have all models implemented in Modelica. Thisrequires the implementation of such a room modelthat can be used to assemble buildings with sev-eral thermal zones.

For the building envelope, we have implementedmodels for heat conduction through opaque multi-layer materials, which are available in the pack-age Buildings.HeatTransfer. Currently, we areworking on the implementation of models for win-dow systems. The window model will computea layer-by-layer radiation, convection and conduc-tion heat balance, using equations that are similarto the ones in the Window 5 program [7].

We are also working on the implementation ofmodels for short-wave, long-wave and convectiveheat transfer in a room. These models will besimilar to the models described in [14].

To obtain boundary conditions,we have implemented a packageBuildings.BoundaryConditions, which willbe released in the next version. This packageincludes models for the sky black-body temper-ature, the path of the sun, and incidence angleson tilted surfaces. There will also be a weather

Proceedings 8th Modelica Conference, Dresden, Germany, March 20-22, 2011

273

Page 9: Buildings Library for Building Energy and Control …putes air leakage. It describes a one-directional pressure driven air ow through a crack-like open-ing. The opening is modeled

(a) Plant of VAV system.

(b) Distribution of VAV system with five thermal zones.

Figure 4: Modelica model of the VAV system that is linked to EnergyPlus for co-simulation.

Proceedings 8th Modelica Conference, Dresden, Germany, March 20-22, 2011

274

Page 10: Buildings Library for Building Energy and Control …putes air leakage. It describes a one-directional pressure driven air ow through a crack-like open-ing. The opening is modeled

data reader. Weather data can be obtained forfree from http://www.energyplus.gov, andthen converted to Modelica format with a Javaprogram that is provided with the Buildings

library.

6 ConclusionThe Modelica Buildings library has been sig-

nificantly expanded since the last Modelica con-ference. A new Airflow package has been addedfor indoor air flow simulation. Many models havebeen added into existing packages to provide morefunctionality, and existing models have been re-vised to improve the numerical efficiency. How-ever, for large fluid flow systems with feedbackcontrol, such as the ones shown in Fig. 4, com-puting consistent initial conditions and perform-ing the time integration can still lead to numericalproblems. The robust simulation of such systemsstill requires further research.

7 AcknowledgmentsThis research was supported by the Assistant

Secretary for Energy Efficiency and RenewableEnergy, Office of Building Technologies of the U.S.Department of Energy, under Contract No. DE-AC02-05CH11231.

We would also like to thank the United Tech-nologies Research Center for contributing theMultizone package to the Buildings library.

References

[1] ASHRAE. ASHRAE fundamentals, 1997.

[2] ASHRAE. ANSI/ASHRAE Standard 135-2004,BACnet, a data communication protocol forbuilding automation and control networks, 2004.

[3] J. Axley. Multizone airflow modeling in build-ings: History and theory. HVAC&R Research,13(6):907–928, 2007.

[4] DOE. Buildings energy data book. Technical Re-port DOE/EE-0325, Department of Energy, 2009.

[5] W. S. Dols and G. N. Walton. CONTAMW 2.0user manual, multizone airflow and contaminanttransport analysis software. Technical Report NI-STIR 6921, National Institute of Standards andTechnology, 2002.

[6] J. H. Ferziger and M. Peric. Computational meth-ods for fluid dynamics. Springer, Berlin, NewYork, 3rd, rev. edition, 2002.

[7] E. U. Finlayson, D. K. Arasteh, C. Huizenga,M. D. Rubin, and M. S. Reilly. WINDOW

4.0: Documentation of Calculation Procedures.Lawrence Berkeley National Laboratory, Berke-ley, CA, USA, 1993.

[8] R. Franke, F. Casella, M. Otter, K. Proelss,M. Sielemann, and M. Wetter. Standardizationof thermo-fluid modeling in modelica.fluid. InF. Casella, editor, Proc. of the 7-th InternationalModelica Conference, Como, Italy, Sept. 2009.

[9] R. Franke, F. Casella, M. Otter, M. Sielemann,H. Elmqvist, S. E. Mattsson, and H. Olsson.Stream connectors: an extension of modelica fordevice-oriented modeling of convective transportphenomena. In F. Casella, editor, the 7th Inter-national Modelica Conference, Como, Italy, 2009.

[10] M. Hydeman, N. Webb, P. Sreedharan, andS. Blanc. Development and testing of a refor-mulated regression-based electric chiller model.ASHRAE Transactions, 108(2), 2002.

[11] F. P. Incropera and D. P. D. Witt. Fundamentalsof Heat and Mass Transfer. John Wiley & Sons,5th edition, 2001.

[12] A. C. Megri and F. Haghighat. Zonal modelingfor simulating indoor environment of buildings:Review, recent developments, and applications.HVAC&R Research, 13(6):887–905, 2007.

[13] P. V. Nielsen. Computational fluid dynamicsand room air movement. Indoor Air, 14:134–143,2004.

[14] M. Wetter. Simulation-Based Building EnergyOptimization. PhD thesis, University of Califor-nia, Berkeley, 2004.

[15] M. Wetter. Multizone airflow model in model-ica. In the 5th International Modelica Conference,pages 431–440, Vienna, Austria, 2006.

[16] M. Wetter. Modelica library for building heat-ing, ventilation and air-conditioning systems. Inthe 7th International Modelica Conference, Como,Italy, 2009.

[17] M. Wetter. Co-simulation of building energy andcontrol systems with the building controls virtualtest bed. In press: Journal of Building Perfor-mance Simulation, 2010.

[18] W. Zuo and Q. Chen. Real-time or faster-than-real-time simulation of airflow in buildings. In-door Air, 19(1):33–44, 2009.

Proceedings 8th Modelica Conference, Dresden, Germany, March 20-22, 2011

275