2. Scope
• Traditional building simulation programs
• Modelica
• Equation-based language
• Features for model development :object-instantiation, object-
inheritance
• Examples and results
• Validation of Buildings Library
• Challenges
• Modelica: for a Mechanical/Equipment Engineer
2
3. Traditional Building
Simulation Programs
• Written in FORTRAN, C, C++
• Procedural programming
• Developer writes a sequence of computer instructions that
assigns values to variables in predefined order of execution
• Mix of physical model and numerical solution algorithm,
example: implementation of pump-system curve
• Idealized controllers within HVAC components: hard to
implement control algorithms
3
Physical
model
Fixed
program
flow
logic
Own solver
Hard to
maintain &
add new
models
4. Modelica: Equation-based
language
• Components/Models described by algebraic and differential
equations
• Equations encapsulated and represented by an icon
• Standardized interface enable modeling across multiple
engineering domains: electrical, mechanical, thermal
4
Encapsulation of
equations
Standardized
interface
Model reuse and
easy model
exchange
5. • Write equations as they are.
• Number of unknowns = Number of equations
5
𝑈𝑈𝑈𝑈
𝑐𝑐𝑝𝑝
= 𝑚𝑚̇ ln(𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏_𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓)
𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏_𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓=
ℎ𝑜𝑜 − ℎ𝐴𝐴𝐴𝐴𝐴𝐴
ℎ𝑖𝑖 − ℎ𝐴𝐴𝐴𝐴𝐴𝐴
ℎ𝐴𝐴𝐴𝐴𝐴𝐴 = 𝐸𝐸𝐸𝐸𝐸𝐸𝐸(𝜔𝜔𝐴𝐴𝐴𝐴𝐴𝐴, 𝑇𝑇𝐴𝐴𝐴𝐴𝐴𝐴, 𝑝𝑝)
𝜔𝜔𝐴𝐴𝐴𝐴𝐴𝐴 = 𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴(𝜑𝜑𝐴𝐴𝐴𝐴𝐴𝐴, 𝑇𝑇𝐴𝐴𝐴𝐴𝐴𝐴, 𝑝𝑝)
𝑇𝑇𝑜𝑜 − 𝑇𝑇𝑖𝑖
𝑇𝑇𝐴𝐴𝐴𝐴𝐴𝐴 − 𝑇𝑇𝑖𝑖
=
𝜔𝜔𝑜𝑜 − 𝜔𝜔𝑖𝑖
𝜔𝜔𝐴𝐴𝐴𝐴𝐴𝐴 − 𝜔𝜔𝑖𝑖
Modelica: for a Mechanical
Engineer
6. Modelica Features: Object-
instantiation
• To use and parameterize an
object in a model
• Two-port HX: No source-side
mass flow rate or heat exchange is
independent of source mass flow.
e.g. GLHE, DX coil (air cooled
condenser), cooling tower
• Four-port HX: parallel and
counter flow HX, heat pumps
6
Instantaneously
mixed volume:
no pressure
drop, exchange
heat through its
heatport
Flow
resistance:
fixed flow
coefficient
Four port heat exchanger: Model transporting
two fluid streams between four ports with
storing mass or energy
7. Modelica Features: Object-
inheritance
• To reuse existing
basic models and
refine their
implementation
• Four port heat
exchanger now can be
modified as chiller,
water to water heat
pump
• Final model depends
on how the physics of
heat exchange and
control system are
designed
7
8. Modelica Features: Object-
inheritance
• Medium = Air
• Latent heat: moisture added
or condensed
8
Instantaneously
mixed volume:
with heatPort and
latent heat
calculation
(moisture
added/removed)
Multi-stage water to air heat pump
12. Buildings Library Validation:
ASHRAE Standard 140
• Standard 140 used for testing the accuracy of building
simulation models
• Standard 140 documents energy performance of a thermal
zone using different building energy simulation tools
• Validation cases: 600, 610, 620, 630, 600FF, 900, and 900FF
(low and high mass building )
• Presented at 9th International Modelica Conference 2012
12
13. Buildings Library Validation:
ASHRAE Standard 140
• Results are not the same
• Each simulation tool use different assumptions, physical
models and implementations
• The variation of the results is usually in a reasonable range.
13
Source: LBNL-5932E
14. Modelica: Challenges
• Cost, proprietary solvers
• Open source tools do not support all the features: Fluid
package
• High simulation time for multi-zone building envelopes
• Limited number of models
14
15. Modelica: Promising future
• Expands capability of building simulation tools: interfacing
with multiple engineering domains
• Flexible environment for modeling
• Reuse of models
• Less time required for model development
15
16. Modelica: for
Mechanical/Equipment Engineer
• Easy to read and understand
• Less lines of code
• Similarity with physical systems
• Closely represent actual components
• Easy to modify or write new model
• More focus on model development rather than struggling
with implementation issues
• Easy to use: drag and drop
• Easy to control the boundary conditions
16