These tutorials present a complete example of thermal dynamic simulation of a building. For the sake of simplicity, a toy model is used for the building in which 5 identical two-layer walls, a glass wall, air infiltration, and an indoor temperature control system are modelled.
The tutorials go through obtaining weather data from internet, modelling the thermal transfer with thermal networks, transforming the thermal networks into systems of differential algebraic equations and state-space representation, and implementing customized control algorithms into the numerical integration loop.
The advantage of the method, as compared with other existing alternatives, is that the state-space representation is obtained; therefore eigenvalues analysis is achievable.
The disadvantage is that, in the current implementation, application on large models is tedious and prone to errors.
The notebooks can be run interactively on MyBinder.org
by clicking on the button .
Note: In the folder M
, the repository containes the MATLAB® v. 6 scripts and the PDFs of the tutorials for MATLAB® implementation.
- Weather data and solar radiation on a tilted surface.
- Thermal circuit and state-space representation for a thermal circuit with capacities in every node: simple wall.
- Thermal circuit and state-space representation for a thermal circuit with capacities in some nodes: cubic building.
- Thermal circuits assembling.
- Switch between models: heating & cooling and free-running.
- Control input: heating & cooling and free-running.
- Radiation coupled with convection.
- Sensible thermal load in steady-state.
- Air flow by ventilation.
Annexes
The assignments are written in Jupyter notebooks and posted on Github in the repository indicated in each assignment. Each repository needs to have:
README.md
file that contains at least the names of the members of the team and a link tomybinder.org
.environment.yml
file that lists the dependencies required for the project.
The Jupyter notebooks need to contain Markdown cells structured with headings and equations need to be written in LaTeX.
- Draw the plan of a two-zone building.
- Formulate the hypothesis for boundary conditions.
- Chose the types of windows, doors, and walls.
- Draw the thermal circuit:
- temperature nodes,
- flow-rate paths,
- thermal conductances for conduction, convection, long-wave radiation, advection, and P-controllers,
- sources of temperature and flow-rate,
- Number the temperature nodes and the flow-rate branches (starting from 0).
- Calculate the thermal conductances for conduction, convection, long-wave radiation, and advection.
- Calculate the thermal capacities.
- Write down the incidence matrix
$A$ , the conductance matrix$G$ and the capacity matrix$C$ of the system of Algebraic Differential Equations (DAE). - Define the inputs: temperature sources (vector
$b$ ) and flow rate sources (vector$f$ ). - Write in Pyhthon the incidence matrix
$A$ , the conductance matrix$G$ and the capacity matrix$C$ of the system of Algebraic Differential Equations (DAE). - Write in Pyhthon the vectors of pointers to the temperature sources
$b$ , flow-rate sources$f$ , and outputs$y$ . - Assignment 1: Model
- Implement in Python the matrices
$A$ ,$G$ and$C$ of the system of Diferential Algebraic Equations (DAE). - Give values to inputs (temperature sources,
$b$ , and flow rate sources$f$ ). - Calculate steady-state response of the system of Diferential Algebraic Equations (DAE).
- From the systems of Diferential Algebraic Equations (DAE), obtain the matrices
$A_s$ ,$B_s$ ,$C_s$ , and$D_s$ of the state-space representation. - Give the values of the input vector
$u = [b_T^T, f_Q^T]^T$ . - Obtain the steady-state response of the state-space representation.
- Compare the results obtained for the system of Diferential Algebraic Equations (DAE) with the results obtained for the state-space representation.
- Assignment 2: Steady-state
- Determine the time step and the settling time.
- Give the input vector
$u$ . - Integrate in time the differential equations.
- Plot the results.
- Discuss the results.
- Assignment 3: Simulate step response
- Define start and end time.
- Prepare the inputs:
- read weather data,
- calculate the solar irradiance on the walls,
- resample the weather data
- give the other inputs (e.g., internal gains),
- give the input vector in time.
- Define the initial conditions.
- Integrate in time.
- Plot the results.
- Discuss the results.
- Implement other controllers (dead-band, model predictive control).
- Discuss the results.
- Assignment 4: Simulate response to weather
- Write the report in Jupyter notebooks.
- Publish the report on GitHub and MyBinder.
- Assignment 5: Reproducible report
Support
- GitHub Docs:
- Anaconda cheetsheet
- Python
- Jupyter notebook cheatsheet
- NumPy for MATLAB users
- Get started with Binder
- Markdown and LaTeX introduction
-
C. Ghiaus (2013). Causality issue in the heat balance method for calculating the design heating and cooling load. Energy 50: 292-301 DOI 10.1016/j.energy.2012.10.024, HAL 03605823
-
C. Ghiaus, N. Ahmad (2020). Thermal circuits assembling and state-space extraction for modelling heat transfer in buildings, Energy, 195:117019 DOI 10.1016/j.energy.2020.117019, HAL 03600778
-
C. Ghiaus (2021). Dynamic Models for Energy Control of Smart Homes, in S. Ploix M. Amayri, N. Bouguila (eds.) Towards Energy Smart Homes, Online ISBN: 978-3-030-76477-7, Print ISBN: 978-3-030-76476-0, Springer, pp. 163-198 (ref.) DOI 10.1007/978-3-030-76477-7_5, HAL 03578578
-
J. Kneifel (2013). Annual Whole Building Energy Simulation of the NIST Net Zero Energy Residential Test Facility Design, NIST Technical Note 1767, DOI 10.6028/NIST.TN.1767
-
U.S. Department of Energy (2022). EnergyPlus v.22.1.0 Documentation, Engineering Reference (link)
-
Solar Energy Laboratory, University of Wisconsin-Madison (2009). TRNSYS 17 Volume 4 Mathematical Reference (link)
-
NIST (2008) Guide for the Use of the International System of Units (SI) (link)
-
BIPM (2008) Evaluation of measurement data — Guide to the expression of uncertainty in measurement (link)
-
BIPM (2019) The International System of Units (SI), 9th edition (link)
Thermal comfort
- Sensible and latent heat.
- Variation of internal (stored energy).
- Average heat rate generated by human metabolisme.
- Environmental factors that influence the thermal comfort.
- Relationship between Predicted Mean Vote (PMV) and Predicted Percentage of Dissatisfied (PPD).
- Mean radiant temperature and operative temperature.
Modeling
- Definition of science.
- Shortly describe the four paradigms of science (empirical, theoretical, computational and data science).
- Reproducibility crises: definition and how to overcome it.
- Describe the reproducibility spectrum in Computational Science.
- What is a (mathematical) model?
- Definition of physical and computational causality.
- Definition of inputs, outputs and states of a dynamic model.
- Conservation laws: two examples.
- Relation between conservation laws and symmetry in physics.
- Constitutive laws: one example of a universal law and one of a phenomenological law.
- Explain why there are only seven fundamental units in the SI system of units.
- What is the difference between the classical SI system of units and the system adopted on 20 May 2019? Why is this difference important?
- What is the relationship between energy and temperature?
- Draw the basic network for heat transfer modelling. Explain each element of the network:
- temperature nodes,
- flow branches,
- conductances,
- capacities,
- temperature sources,
- flow sources.
- Show the analogy between:
- heat transfer,
- mass transfer,
- electrical conduction.
- Draw the framework for obtaining models for transport phenomena (i.e., heat trasfer, mass transfer, momentum transfer, electrical conduction).
- Define the modes of heat transfer and give the expression of conductance for:
- conduction,
- convection,
- radiation,
- advection.
- Conservation of energy in steady-state and in dynamics.
- Definition of sensible heat.
- Surface phenomena and volume phenomena in energy balance equation.
- Draw a wall and a window. Make a thermal network model of this system.
- Explain the difference between Differential Algebraic Equations model and state-space representation.
- Explain the shape and the elements of the following matrices and vectors of a Differential Algebraic Equations model
$C \dot{\theta} = -A^T G A \theta + A^T G b + f$ :-
$A$ - incidence marix; -
$G$ - conductance matrix; -
$C$ - capacity matrix; -
$b$ - temperature source vector; -
$f$ - flow-rate source vector.
-
- What is the relationship between the eigenvalues of the state matrix and the time constants of the thermal model?
- Define the numerical stability. What is the condition for the numerical stability of Euler explicit method of integration in time?
- Explain the differences between Euler implicit and explicit methods.
- Comment on the advantages and the disadvantages of Euler implicit and explicit methods.
- Consider the the model of heat transfert through a simple wall (tutorial 29). Explain the qualitative differences between the step response to outdoor temperature input and the step response to indoor heat flow rate.
- Discuss the influence of the initial conditions on the dynamic response.
- How can be estimated the response (or settling) time of a dynamic system? What is the usefulness of the response time in dynamic simulation?
- How can be estimated the time step for the dynamic simulation? What can be done if the time step is too small as compared to the time step needed for the problem?
The report will be written in Jupyter notebook, posted on GitHub.com and liked to MyBinder.org.
The general structure of the report:
- Front page: title, author(s), date.
- Contents.
- Description of the building: drawing, dimensions, materials, material properties, etc.
- Hypothesis: location, boundary conditions, schedule for usage, etc.
- Thermal model (with justifications).
- Mathematical model: Differential Algebraic Equations (matrices
$A$ ,$G$ , and$C$ , vectors$b$ and$f$ ) and state-space representation (matrices$A$ ,$B$ ,$C$ and$D$ and vector$u$ ). - Model implementation in Python.
- Steady-state results.
- Dynamic simulation results.
- Optimization (e.g., insulation, HVAC control, ventilation rate, solar shading).
Licence
Code is released under MIT Lincence.