Dynamic Modelling and Exergy Analysis of a Smart Building Heating System