From Bpswiki

Jump to: navigation, search

HAMLab (Heat, Air and Moisture Laboratory) is basically an all-in-one collection of models and tools suitable for MatLab and/or Simulink and/or COMSOL, developed by students and researchers under supervision of dr.ir. Jos van Schijndel expert on Computational Science and Engineering (CSE) for the Built Environment at the Eindhoven University of Technology.

Please note that every thing on the webstite is free for research & education. However, if our models have inspired you, please refer to the scientific publication directly related with HAMLab : Schijndel, A.W.M. van (2007). Integrated heat air and moisture modeling and simulation. Eindhoven: Technische Universiteit, PhD thesis, 200 pages.




HAMBASE (Heat Air and Moisture model for Building And Systems Evaluation). HAMBase is a simulation model for the heat and vapour flows in a building. With the model the indoor temperature, the indoor air humidity and energy use for heating and cooling of a multi-zone building can be simulated. A first version of this model (ELAN, see Figure 1.1a) was published in 1987 (de Wit 1987;1988).

Separately a model for simulating the indoor air humidity (AHUM) was developed (de Wit 1990). In 1992 the two models were combined (WAVO) and programmed in the MATLAB environment. The choice of MATLAB turned out to be crucial for the further development. The powerful tools for matrix manipulation of MATLAB together with a very transparent code make it easy to implement improvements and extensions of the model. With the evolution of MATLAB capabilities e.g. the cell-arrays, also WAVO evolved. The maximal use of general purpose software in order not to loose precious time with programming but use that for modelling took the place of the search for simplicity. The approach of WAVO turned out to be excellent for making S-functions for MATLAB-SIMULINK and enabling the simulation of complicated HVAC installations and controls simultaneously with the building. This new development started recently (van Schijndel 2007) and will go on in future. In 2004 the model got a new name: HAMBASE. Find out how to start using the HAMBase start guide. The following MatLab files and documents of HAMBase are available The HAMBase model , the accompanying Scientific report and the Userguide. Figures 1.1.b and 1.1.c show the validation results using the IEA Annex 41 Common Exercise 3, the following files are available the mfiles for this validation study and the accompanying report . The newest HAMBase version (MatLab release 2010 required!) can be download here HAMBase 2013apr beta version, including documentation. There is also a beta version of a student HAMBase-getting-Started guide for HAMBase that can be download here pdf, mfiles,including documentation and mfiles.

1.2 HAMBASE Applications

  • Figure 1.2a presents an example of how HAMBase can be used as sensitivity analysis tool applied for Case 600 of the BESTest. The aim of this work is to provide a starting point for performing parameter sensitivity studies for other HAMBase models. Here you can find the Guideline, the Solution of the provided exercises and mfiles.
  • Figure 1.2b presents an example of how HAMBase can is used for the Annex 41 sensitivity studies. Here you can find the paper and mfiles.
  • Figure 1.2c presents the work of Rik Kramer. He used HAMBase to simulate the indoor climate in two specific monumental buildings using future climate REMO data of de Bilt from 2010 - 2100. Here you can find the report and mfiles.
  • Figure 1.2d This figure shows a tool to calculate the solar irradiation: Gh Global horizontal and Dh Diffuse horizontal from a (meteonorm) file into HAMBase Diffuse and Direct (beam) radiation Click here for the mfiles.
  • Figure 1.2e presents a powerfull example of how HAMBase can be used to simulate the indoor climates of a reference building that is exposed to (>130) reference external climate locations spread over whole Europe. The main mfile reads all external climates in a directory automatically. For each external climate it simulates the indoor climates and saves the results in a indoor climate (ic) text file. Thus for each provided external climate a corresponding indoor climate is produced. Click here for the mfiles.
  • Figure 1.2f shows a EU mapping function developed for the Climate for Culture project. Input is a data (txt) file with: Column 1: Longitudes, Column 2: Lattitudes, Column 3-n: the parameters to be mapped. Click here for the mfiles. Please note that the MatLab Mapping Toolbox is required!
  • Together with Stan van Kleef, we developed a tool to import climate data from the KNMI website to be used with HAMBase. The provided file imports the climate files for Eindhoven for 2011 - now Click here for the mfiles. The user can adapt this mfile to get climate date for HAMBase for other locations and other years. Please read and implement this Update before using.
  • Tjeerd Spruijt and Joep Bischoff developed models for natural air flow simulation including benchmarks from literature. Here you can find the report and mfiles.

1.3 Building Physics Toolbox

  • A first version of our building physics toolbox was published in 1999 (van Schijndel & de Wit 1999). This toolbox provides additional functions voor building physics and systems calculations including: (1) Glaser method with monthly means, checking a construction, (2) irradiance on a inclined surface, (3) Saturation vapour pressure (4) Solar position (elevation and azimuth), (5) Dewpoint (6) View factor. Click here for the mfiles
  • Figure 1.3b presents the Physics of Monuments Plots toolbox (Martens/Schellen 2009) including Climate Evaluation Charts (CECs). Click here for a userguide including accompanying mfiles.
  • We have developed a few stand-alone applications including a Glaser method that can be used without MatLab. Click here for the zipfile

1.4 Inverse Modeling Applications

  • The first tool is presented Figure 1.4. It is an example of how Matlab can be used inverse modeling tool applied for indoor climate modeling. The aim of this work is to provide a starting point for performing inverse modeling studies for indoor climate problems. Here you can find the Main Guideline, an ODE solving exercise and mfiles.
  • The second collection is provided by Rick Kramer. It contains inverse models for the indoor climate of several mostly unheated monumental buildings. Click here for the complete report including accompanying matlab files.


2.1 HAMBase_S

The HAMBase model is implemented in an S-Function by splitting the energy and vapour flows into two parts. First, a discrete part was developed for modeling ‘slow responses’ i.e. the transmittance through walls. Second, a continuous part was developed for the ’fast responses’ i.e. admittance, ventilation, heat gains, etc.

Detailed information can be found at (de Wit 2006). This new model, named HAMBase_S (abbreviation for HAMBase model in SimuLink) to avoid confusion, is able to simulate complicated HVAC installations and controls simultaneously with the building. The main advantages are: a) The dynamics of the building systems where small time scales play an important role (for example on/off switching) are accurately simulated. b) The model becomes time efficient because the computation of the ‘slow response’ part of the model only takes place at an hourly intervals and not on every (much smaller) time step of the ‘fast response’ part of the model. c) The moisture (vapour) transport model of HAMBase_S is also included. With this feature, the (de-) humidification of HVAC systems can also be simulated. So the main difference between HAMBase and HAMBase_S is time stepping. HAMBase has fixed step sizes of one hour. HAMBase_S has variable step sizes (ranging from smaller than a second to 15 minutes) depending on the model parameters.

The codes in the S-Functions, used for ODEs and PDEs are quite comprehensible meaning that the relation between implemented code and mathematical model is clear and the code itself is concise. However the code of the whole building model in the S-Function is much more complex. In order the gain confidence in the modeling i.e. HAMBase_S, two benchmark studies are presented now for the evaluation of the modeling approach using S-Functions. Click here on How to export HAMBase mfile to SimuLink and add control, Click here for the exercise on building a standard office & cooling control model in SimuLink including accompanying mfiles.

2.2 ODE based models using S-Functions

ODE based models have been integrated into SimuLink using the continuous states part of an S-Function. A heat pump as used as an illustrative example. The first step is to develop a mathematical model of the heat pump, based on first principles, in the form of ODEs:

Where T is temperature [oC], COP Coefficient of Performance [-], k heat pump efficiency [-], cw specific heat capacity of water [J/kgK], C heat capacity of the water and pipes in the heat pump [J/K], t time[s], F mass flow [kg/s], Ehp heat pump electric power supply [W]. Subscript c means water at the condenser, v water at the evaporator, in means incoming, out means outgoing.The second step is to prepare the input-output definition of the model. This is presented in the table. The third step is to build the input-output structure connected with the S-function block. The fourth step is to write code into a S-Function. The technical detail of this step is presented in (van Schijndel 2007). The importance of these details is that the relation between mathematical model and implemented model is clear and it is useful for developers who want to create their own ODE based models. It should be mentioned that the time scale problem (i.e. the lowest time constant present in the dynamic system is an order of magnitude 5 lower than the highest one) seems less relevant in case of ODE based models because there are special designed solvers for this case. So-called stiff solvers can handle such a problem accurately and time efficient (Ashino et al. 2000). On the other hand, simulating controllers for example (rapid) on/off switching can generate small time steps during simulation. Although accurate results are obtained in this case, it could still lead to relative long simulation duration times. For validation (simulated data compared with experimental data), use has been made of a test site at the Eindhoven University. This test site contained a configuration with the following subsystems: a heat pump, a heat exchanger on the roof (energy roof) and a thermal energy storage system Click here for these models and description. All subsystems were modelled using the modeling approach of this Section. The experimental results obtained from the test site were used to validate the models of respectively a heat pump, an energy roof and thermal energy storage. From this work, published in van Schijndel (2007), the validation results of the heat pump are presented in figure 2.2.1c Click here for a complete example on using S-Functions including accompanying mfiles.

2.3 Building Systems Toolbox

Currently the toolbox consists of the following collections of models. Some examples are shown in the figures:

Putting all models together in a single Toolbox is under construction.

2.4 Sustainable Energy Technology (SET) Toolbox

Currently the toolbox consists of the following models, see also figures:

  • The first collection is provided by Ralph van Oorschot (2010). It contains models for: desiccant evaporative cooling (DEC), solar thermal panel, thermal water storage buffer, desiccant wheel, heat recovery wheel, humidifier, fan. Click here for the complete report including accompanying mdl-files.
  • The second collection is provided by Coen Hoogervorst (2010, in Dutch). It contains models for: Urban area, heat pump, heat exchanger, hot water profiles. Click here for the complete report including accompanying mdl-files.
  • Some SimuLink models contain so-called embedded functions. This can cause problems when running the models with a different MatLab version. A method to solve this is provided in this zip file.
  • The third collection is provided by the top case studies of the Master Course 7y700 Sustainable Building and Systems Modeling (2011-2014):

2.5 ISE

ISE (Indoor temperature Simulink Engineering tool) is a tool for simulating the indoor temperature of 1 zone of a building. ISE is a simplified model (compared with HAMBase) and has a user-friendly graphical userinterface in SimuLink, providing quick results. ISE can be used in SimuLink for (a) a quick evaluation of the indoor temperature performance; (b) a quick estimation of heating, cooling amounts and capacities; (c) a building model for the design and evaluation of systems and controllers. Click here for the user guide including accompanying mdl-files.


3.1 Introduction

Many scientific problems in building physics can be described by PDEs. There are a lot of software programs available in which one specific PDE is solved. They are developed in order to get the simulation results in a short time and most often a lot of effort has been put into the simplicity of input of data, e.g. geometrical data. A disadvantage is that they often are not very flexible when the user wants to change or combine models. Another drawback is that they most often act as black boxes. Another category of commercially available software like Comsol [Comsol 2006] is developed specifically for solving PDEs where the user in principle can simulate any system of coupled PDEs. Practical physics/engineering problems in the area of heat transfer, electromagnetism, structural mechanics and fluid dynamics can be solved with the software. The practical problems solved in this chapter are: a 2D thermal bridge problem, a 1D moisture transport problem, a 2D airflow problem and a 3D combined heat and moisture transport problem. One of the main advantages of Comsol is that the user can focus on the model (PDE coefficients on the domain and the domain boundary) and does not have to spend much time on solving and visualization. The scientist can concentrate on the physics behind the models and the engineer can calculate details for designing purposes using validated models. Below you can find examples using earlier versions of Comsol (i.e. 3.5a en 4).

3.2 Comsol Applications

4 COMSOL models integrated into SimuLink

Click here for the paper including accompanying SimuLink Comsol files.

5 Education

5.1 MSc Courses

The following MSc courses (2015) are related with HAMLab:

5.2 COMSOL Educational applications

The following studies are included by the work of Bram Kersten:

6 Other

Climate for Culture project


  • 1988 Martin de Wit, Driessen, H.H. ELAN- A Computer Model for Building Energy Design. Building and Environment 23, pp. 285-289
  • 1999 Jos van Schijndel, Wit, M.H. de., A Building Physics Toolbox in Matlab. 5th Symposium on Building Physics in the Nordic Countries. Gothenburg, Sweden.,1999
  • 2006 Martin de Wit, HAMBase, Heat, Air and Moisture Model for Building and Systems Evaluation, Bouwstenen 100, Eindhoven University of Technology, 112 pages
  • 2007 Jos van Schijndel, Integrated heat air and moisture modeling and simulation. Eindhoven: Technische Universiteit, PhD thesis, 200 pages
  • 2010 Jos van Schijndel, HAMLab (this website)
Personal tools
BPS computing Facilities