Skip to content
LumenaryAcademy
Energy 80 min

Heating, cooling and buildings

Building energy balances, U-values, heat pumps, ventilation and comfort, district heating and cooling — and why a house in Helsinki and a house in Riyadh face opposite problems.

Code tested · 6AI-draftedAwaiting review by a mechanical engineer

Your guides: Chloe · The Designer, Margaret · The Test Engineer, Gideon · The Checker

MotivationH

Buildings as energy machines

Buildings account for about 30% of the world's final energy use, according to the IEA's tracking of the buildings sector, and most of it goes on keeping people at a comfortable temperature, with clean air and hot water. In Helsinki, Harbin or Winnipeg the problem is heat: a poorly built house can need more energy in a winter than a car uses in years. In Riyadh, Delhi or Lagos the problem is cooling: the IEA's The Future of Cooling estimated in 2018 that air conditioners and fans already used about a fifth of the electricity in buildings worldwide, and that without better efficiency the energy used for space cooling could more than triple by 2050 as incomes and temperatures rise.

A building is a machine whose working fluid is the air inside it and whose job is to hold that air within a narrow band of temperature and humidity, whatever the weather does. The tools of this lesson are the ones you already have: conduction through layers and heat exchangers from Heat transfer, the refrigeration cycle from Power and refrigeration cycles, the Carnot limit from The second law and entropy, and cogeneration from Power plants and energy conversion.

A building does three jobs: it slows heat down (insulation, airtightness, shading), it stores heat (thermal mass), and it moves heat deliberately (heating, cooling and ventilation). Good design does the first two so well that the third becomes small, and then makes the third efficient.

DefinitionsH

The energy balance of a building

Treat the heated air and everything in thermal contact with it as one control volume. In steady conditions, the heating system must supply whatever the building loses minus whatever it gains for free: Q˙heating=H (Ti−Te)−Q˙gains,H=∑kUkAk+∑jψjℓj+ρcpV˙,\dot Q_\text{heating} = H\,(T_i - T_e) - \dot Q_\text{gains}, \qquad H = \sum_k U_k A_k + \sum_j \psi_j \ell_j + \rho c_p \dot V, where TiT_i and TeT_e are the inside and outside temperatures, the gains are heat from people, appliances, cooking and sunshine through windows, and HH (W/K) is the building's heat loss coefficient. Its three terms are conduction through the fabric, extra losses at thermal bridges (junctions, lintels, balcony slabs) of length ℓj\ell_j, and ventilation, the air deliberately or accidentally exchanged, with volume flow V˙\dot V.

Definition— Thermal resistance and U-value

A layer of thickness dd and thermal conductivity kk has a thermal resistance R=d/kR = d/k (m²K/W) per square metre. Resistances in series add, including the surface resistances of the air films on each side. The U-value (thermal transmittance) of an element is U=1/∑RU = 1/\sum R, in W/(m²K): the heat flow per square metre per kelvin of temperature difference.

sunshineroofwallswindowsfloor and groundstale air outfresh air inpeople, appliances,cooking: internal gainsradiatorheating orcooling
The energy balance of a house. Heat leaks out through the roof, walls, windows and floor, and with the air that leaves; sunshine and the people and appliances inside add heat for free. In winter the heating system makes up the difference; in summer, if the gains exceed what can leak away, the house overheats unless it is cooled.

Ventilation is easy to underestimate. Air has a volumetric heat capacity of about 1.2 kJ/(m³K), so a 250 m³ house that exchanges its air once an hour loses about 84 W for every kelvin of temperature difference, as much as 300 m² of a well-insulated wall. Old houses exchange their air through cracks whether anyone wants it or not; new ones are built airtight and ventilated mechanically, often with heat recovery that warms the incoming air with the outgoing.

Annual demand follows from summing the balance over the year. The outside temperature below which heating is needed, the balance-point temperature Tb=Ti−Q˙gains/HT_b = T_i - \dot Q_\text{gains}/H, falls as a building is insulated, because the same gains cover a larger share of a smaller loss. Summing Tb−TeT_b - T_e over the days colder than TbT_b gives the heating degree-days, and the annual heating energy is roughly H×degree-days×24H \times \text{degree-days} \times 24 hours. Cooling degree-days are defined in the same way above a cooling base.

ComputationC

U-values, computed for a wall

The program computes the U-value of a brick-and-block cavity wall with mineral wool in the cavity, the temperature at each layer on a cold day, and the effect of timber studs bridging the insulation in a timber-frame wall. The conductivities are typical values; real designs use the declared values of the actual products.

python
import math

# U-value of a wall: thermal resistances in series, R = thickness / conductivity.
R_SI, R_SE = 0.13, 0.04          # m^2 K/W: conventional inside and outside surface resistances
cavity_wall = [                  # (layer, thickness m, conductivity W/(m K)), outside to inside
    ("brick", 0.102, 0.77),
    ("mineral wool", 0.100, 0.035),
    ("concrete block", 0.100, 0.50),
    ("gypsum plaster", 0.013, 0.40),
]

def u_value(layers):
    R = R_SE + sum(d / k for _, d, k in layers) + R_SI
    return 1 / R, R

U, R = u_value(cavity_wall)
U0, _ = u_value([lay for lay in cavity_wall if lay[0] != "mineral wool"])
print(f"insulated cavity wall: R = {R:.2f} m^2K/W, U = {U:.3f} W/(m^2 K)")
print(f"same wall without insulation:     U = {U0:.3f} W/(m^2 K)")

# Temperature through the wall on a winter day: 20 C inside, -5 C outside.
T_in, T_out = 20.0, -5.0
q = U * (T_in - T_out)                       # W/m^2 through the wall
print(f"\nheat flux {q:.1f} W/m^2; temperatures from outside to inside:")
T = T_out + q * R_SE
print(f"  outer surface            {T:6.1f} C")
for name, d, k in cavity_wall:
    T += q * d / k
    print(f"  inner side of {name:15}{T:6.1f} C")
print(f"  room air                 {T + q * R_SI:6.1f} C")

# Dew point of the room air (Magnus formula): where could water vapour condense?
def dew_point(T, rh):
    g = math.log(rh) + 17.62 * T / (243.12 + T)
    return 243.12 * g / (17.62 - g)
print(f"dew point of room air at 20 C and 50% humidity: {dew_point(20, 0.5):.1f} C")

# A timber-frame wall: studs (15% of the area) bridge the insulation.
frame = [("render board", 0.012, 0.25), ("insulation between studs", 0.140, 0.035), ("plasterboard", 0.0125, 0.25)]
studs = [("render board", 0.012, 0.25), ("timber stud", 0.140, 0.13), ("plasterboard", 0.0125, 0.25)]
f_stud = 0.15
R_paths = 1 / ((1 - f_stud) * u_value(frame)[0] + f_stud * u_value(studs)[0])   # parallel heat-flow paths
k_mix = (1 - f_stud) * 0.035 + f_stud * 0.13                                 # or: average each layer first
R_planes = R_SE + 0.012 / 0.25 + 0.140 / k_mix + 0.0125 / 0.25 + R_SI
print(f"\ntimber frame: U = {u_value(frame)[0]:.3f} through the insulation alone; with the studs, "
      f"{1 / R_paths:.3f} (parallel paths) or {1 / R_planes:.3f} (averaged layers),")
print(f"so about {2 / (R_paths + R_planes):.3f} W/(m^2 K) using the mean of the two resistances")
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

Ten centimetres of mineral wool cut the wall's U-value from 1.869 to 0.295 W/(m²K), a factor of more than six: on a day with 25 K between inside and outside, each square metre loses 7.4 W instead of about 47 W. Almost the whole temperature drop happens across the insulation, from −3.7 °C to 17.3 °C.

brickmineral woolconcrete blockplasteroutsideroomdew point 9.3 °C−5 °C−3.7 °C17.3 °C20 °C
Temperatures through the insulated cavity wall of the program, from −5 °C outside to 20 °C inside. The layers are drawn to scale. Nearly all of the 25 K drop happens across the mineral wool. The dashed line is the dew point of room air at 20 °C and 50% humidity (9.3 °C): it falls inside the insulation, so moist room air must be kept from reaching the cold outer part of the wall.

The timber-frame wall shows a thermal bridge at work. Through the insulation alone its U-value would be 0.234, but the studs, only 15% of the area, conduct heat about four times better, and the wall as a whole comes to about 0.316 W/(m²K), 35% worse. International practice (ISO 6946) brackets such walls between the two calculations in the program, heat flowing in parallel paths or through averaged layers, and takes the mean of the two resistances. Bridges at junctions are computed separately by two-dimensional conduction models.

ComputationC

Heating and cooling across climates

The second program puts one house, of 100 m² of floor, into seven climates in two versions: uninsulated and draughty, as many houses built before the 1970s were, and insulated and airtight, with mechanical ventilation and heat recovery. Each climate is a smooth annual cycle of daily mean temperatures, with rough values resembling a real city, and the house is heated to 20 °C and cooled when it would exceed 26 °C. When it is cooler outside than in, the occupants open windows before anyone switches on air conditioning.

python
import math

# A two-storey house of 100 m^2 floor area: areas (m^2) and U-values (W/(m^2 K)).
OLD = {"walls": (110, 1.6), "roof": (50, 2.0), "floor": (50, 0.8), "windows": (20, 4.8), "door": (2, 3.0)}
NEW = {"walls": (110, 0.20), "roof": (50, 0.12), "floor": (50, 0.15), "windows": (20, 0.9), "door": (2, 1.0)}
VOLUME = 250.0                                   # m^3 of heated air

def loss_coefficient(elements, ach, recovery=0.0, bridges=0.05):
    """Heat loss coefficient H (W/K): fabric + thermal bridges + ventilation."""
    area = sum(a for a, _ in elements.values())
    H_fabric = sum(a * u for a, u in elements.values()) + bridges * area
    H_vent = 1.2 * 1005 * VOLUME * ach / 3600 * (1 - recovery)   # rho * cp * airflow
    return H_fabric + H_vent

houses = {
    "1960s, uninsulated, draughty": loss_coefficient(OLD, ach=1.0, bridges=0.15),
    "insulated, mechanical ventilation with heat recovery": loss_coefficient(NEW, ach=0.5, recovery=0.85),
}
for name, H in houses.items():
    print(f"{name:54} H = {H:4.0f} W/K")

# Climates as a smooth annual cycle of daily mean temperature (rough, illustrative values;
# the southern hemisphere's seasons are reversed, which does not change the annual totals).
CLIMATES = {                     # (annual mean C, half the summer-winter difference K)
    "cold (like Helsinki)": (6.0, 11.0),
    "temperate oceanic (like London)": (11.5, 6.5),
    "continental (like Beijing)": (13.0, 15.0),
    "Mediterranean (like Athens)": (18.5, 8.5),
    "tropical highland (like Nairobi)": (18.0, 1.5),
    "hot desert (like Riyadh)": (26.5, 10.0),
    "hot humid (like Singapore)": (27.5, 1.0),
}
H_WINDOWS = 1.2 * 1005 * VOLUME * 4 / 3600   # W/K of extra ventilation from opening windows (4 ach)

def annual_kwh(H, mean, amp, heat_set=20.0, cool_set=26.0):
    """Heating and cooling needs (kWh/yr) from a daily steady-state balance."""
    heat = cool = 0.0
    for day in range(365):
        season = math.cos(2 * math.pi * (day - 20) / 365)      # +1 in late January, -1 in July
        T_out = mean - amp * season
        gains = 300.0 + 300.0 - 200.0 * season                  # W: internal 300, sun 100 to 500
        heat += max(0.0, H * (heat_set - T_out) - gains)        # W, averaged over the day
        H_cool = H + (H_WINDOWS if T_out < cool_set else 0.0)   # open the windows if it is cooler outside
        cool += max(0.0, gains - H_cool * (cool_set - T_out))
    return heat * 24 / 1000, cool * 24 / 1000                   # kWh per year

print("\nannual heating and cooling needs, kWh per m^2 of floor per year")
print(f"{'climate':34}{'1960s house':>20}{'insulated house':>22}")
print(f"{'':34}{'heat':>10}{'cool':>10}{'heat':>11}{'cool':>11}")
for name, (mean, amp) in CLIMATES.items():
    row = []
    for H in houses.values():
        h, c = annual_kwh(H, mean, amp)
        row += [h / 100, c / 100]
    print(f"{name:34}{row[0]:10.0f}{row[1]:10.0f}{row[2]:11.0f}{row[3]:11.0f}")
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

Insulation, airtightness and heat recovery cut the heat loss coefficient from 537 to 73 W/K, and the results show how differently that plays out by climate. In the cold climate, heating falls from 605 to 49 kWh per square metre a year; in the temperate oceanic one from 347 to 20, close to the Passivhaus target of 15. In the hot desert the uninsulated house needs 195 kWh/m² of cooling and the insulated one 56. In the tropical highlands, neither house needs much of anything, and in the hot, humid tropics cooling dominates whatever the walls are made of, because the outside air is never cooler than the house for long.

The steady daily model leaves out two important things. It ignores the swing between day and night, which in hot, dry climates is the designer's best ally. And it counts only sensible heat: in humid climates an air conditioner must also condense water out of the air, a latent load that in Singapore or Lagos can be a third or more of the total, which is why tropical systems are designed around dehumidification as much as temperature.

ComputationC

Heat pumps in buildings

A heat pump is the refrigeration cycle of Power and refrigeration cycles used for its hot side: it takes heat from outdoor air, the ground or water, and delivers it at a useful temperature, with a coefficient of performance COP=Q˙delivered/W˙\text{COP} = \dot Q_\text{delivered}/\dot W well above 1. The second law caps it at the Carnot value TH/(TH−TL)T_H/(T_H - T_L), so everything depends on the temperature lift: the colder the source and the hotter the water the heat pump must make, the lower its COP. Real machines reach roughly half of Carnot between the refrigerant's actual temperatures, which sit several kelvin beyond the air and water because heat exchangers need a temperature difference to work.

Two engineering choices follow. Emitters: underfloor heating or large radiators work with water at 35 to 45 °C, small radiators need 55 °C or more. Weather compensation: the controller lowers the water temperature on mild days, when less heat is needed. The program estimates the seasonal COP (SCOP), heat delivered over electricity used for a year, for a house with H=200H = 200 W/K in three climates, with day-to-day weather from a seeded random model.

python
import math
import numpy as np

# An air-source heat pump heating a house with heat loss coefficient H = 200 W/K.
H, GAINS, T_ROOM = 200.0, 450.0, 20.0
T_BAL = T_ROOM - GAINS / H                        # below this outdoor temperature, heating is needed

def cop(T_out, T_flow, carnot_fraction=0.55):
    """COP from the Carnot COP between evaporator (6 K below the air) and condenser (5 K above the water)."""
    T_hot, T_cold = T_flow + 5 + 273.15, T_out - 6 + 273.15
    c = carnot_fraction * T_hot / (T_hot - T_cold)
    return c * (0.9 if -5 < T_out < 5 else 1.0)    # frost forms on the outdoor coil: defrosting costs ~10%

def season(mean, amp, design_flow, seed=1):
    """Heat delivered and electricity used over a year of daily mean temperatures."""
    rng = np.random.default_rng(seed)
    anomaly, heat, elec, T_design = 0.0, 0.0, 0.0, mean - amp - 8.0   # design day: a cold snap
    for day in range(365):
        anomaly = 0.8 * anomaly + rng.normal(0.0, 2.0)                  # weather that persists for days
        T_out = mean - amp * math.cos(2 * math.pi * (day - 20) / 365) + anomaly
        load = max(0.0, H * (T_BAL - T_out))                            # W
        if load == 0.0:
            continue
        frac = min(1.0, (T_BAL - T_out) / (T_BAL - T_design))           # weather compensation:
        T_flow = T_ROOM + 10 + (design_flow - T_ROOM - 10) * frac       # cooler water on mild days
        heat += load * 24 / 1000
        elec += load / cop(T_out, T_flow) * 24 / 1000
    return heat, elec

print(f"COP at  7 C outdoors, 35 C water: {cop(7, 35):.2f};  at -7 C, 55 C water: {cop(-7, 55):.2f}")
print("\nseasonal COP (heat delivered / electricity used)")
print(f"{'climate':34}{'underfloor (35 C)':>18}{'radiators (55 C)':>18}")
for name, mean, amp in (("cold (like Helsinki)", 6.0, 11.0), ("temperate oceanic (like London)", 11.5, 6.5),
                        ("continental (like Beijing)", 13.0, 15.0)):
    s = [season(mean, amp, flow) for flow in (35.0, 55.0)]
    print(f"{name:34}{s[0][0] / s[0][1]:18.2f}{s[1][0] / s[1][1]:18.2f}")

# Carbon dioxide per kWh of heat: heat pump (temperate climate, radiators) against a gas boiler.
heat, elec = season(11.5, 6.5, 55.0)
scop = heat / elec
gas = 0.20 / 0.92                                 # kg CO2 per kWh of gas burned, boiler efficiency 92%
print(f"\ngas boiler: {gas * 1000:.0f} g CO2 per kWh of heat")
for grid in (50, 250, 500, 800):                  # g CO2 per kWh of electricity
    print(f"heat pump on a grid of {grid:3} g/kWh: {grid / scop:4.0f} g CO2 per kWh of heat")
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

The instantaneous COP falls from 4.42 on a mild day with 35 °C water to 2.51 on a frosty one with 55 °C water. Over a season, underfloor heating beats radiators everywhere (4.59 against 3.72 in the temperate climate, 3.70 against 3.05 in the cold one), and even the radiator system delivers three to nearly four units of heat for each unit of electricity. On a grid emitting 250 g of CO₂ per kWh, the heat pump's heat carries 67 g/kWh against the gas boiler's 217; only on a grid as carbon-intensive as 800 g/kWh, typical of electricity made almost entirely from coal, does the advantage vanish.

The IEA's The Future of Heat Pumps (2022) calls heat pumps powered by low-emission electricity the central technology for decarbonising heating. Heat pumps are already common in Nordic homes, despite the cold winters, and China is both the largest market and the largest manufacturer. Refrigerants are changing too: under the Kigali Amendment to the Montreal Protocol and the EU's F-gas Regulation of 2024, manufacturers are moving from high-global-warming hydrofluorocarbons to propane (R-290), R-32 and carbon dioxide (R-744). Propane is flammable, so its use is governed by charge limits and safety standards, and installing or servicing any refrigerant circuit is work for trained, certified technicians.

ExplanationH

Ventilation and thermal comfort

People need fresh air. Indoors, carbon dioxide from breathing is a convenient indicator of how well a room is ventilated: outdoor air holds about 420 ppm, and a sedentary adult breathes out roughly 0.005 litres of CO₂ per second.

Example— Ventilating a classroom

In steady state, a room's CO₂ concentration rises above outdoors by the CO₂ generation divided by the ventilation flow, Cin=Cout+G/V˙C_\text{in} = C_\text{out} + G/\dot V. To keep a classroom of 30 pupils below 1000 ppm, V˙=30×0.005/(1000−420)×106\dot V = 30 \times 0.005/(1000 - 420)\times 10^{6} L/s ≈260\approx 260 L/s, about 8.6 litres per second per person, in line with the 8 to 10 L/s per person that many guidelines recommend. On a 0 °C day, warming that air to 20 °C takes 1.2×1.005×0.26×20≈6.31.2 \times 1.005 \times 0.26 \times 20 \approx 6.3 kW, a large heater's worth, unless heat is recovered from the outgoing air.

Ventilation standards such as ASHRAE 62.1 and EN 16798-1 set rates per person and per square metre, by type of room; after the COVID-19 pandemic, attention to ventilation and filtration in schools and offices rose sharply because they reduce the airborne spread of infections.

Thermal comfort depends on more than air temperature. P. O. Fanger's comfort model, developed in Denmark around 1970 and the basis of ISO 7730 and ASHRAE 55, combines six factors: air temperature, the mean radiant temperature of the surrounding surfaces, air speed, humidity, the occupants' metabolic rate and their clothing. It predicts the average vote of a large group on a scale from cold to hot, and the percentage likely to be dissatisfied, which never falls below about 5%: no single condition pleases everyone. Cold windows and walls make a room feel colder than its air temperature, which is one reason well-insulated buildings feel comfortable at lower air temperatures.

For buildings with windows people can open, field studies by Richard de Dear, Gail Brager and others led to the adaptive comfort model: people who live with the climate, dress for it and control their surroundings accept a wider band, and the temperature they find comfortable rises with the outdoor temperature of the preceding days. Buildings in Ahmedabad, Accra or Brisbane need not be held at the same 22 °C as an office in Stockholm, and designing for that saves a great deal of energy.

ComputationC

Thermal mass and night ventilation, simulated

Traditional buildings in hot, dry climates use the large swing between day and night. Thick adobe and stone walls in Yazd, Marrakech or Santa Fe absorb heat during the day and release it at night, when wind towers (the bādgir of Iran and the Gulf), courtyards and open windows flush it out with cool night air. The program tests the idea with a lumped thermal model, one capacity CC at one temperature, CdTdt=Htotal(t) (Tout(t)−T)+Q˙gains(t),C\frac{dT}{dt} = H_\text{total}(t)\,\bigl(T_\text{out}(t) - T\bigr) + \dot Q_\text{gains}(t), integrated over a week by the explicit Euler method in five-minute steps, the same finite-difference idea as in Heat transfer. Outside, the temperature swings from 22 °C at 03:00 to 38 °C at 15:00; there is no air conditioning.

python
import math

# Thermal mass and night ventilation in a hot, dry summer, with no air conditioning.
# The house is one thermal capacity C (J/K) at one temperature T: a lumped "RC" model,
#   C dT/dt = (H_fabric + H_vent) (T_out - T) + gains.
H_FABRIC = 60.0                           # W/K: an insulated house of 100 m^2
H_AIR_PER_ACH = 1.2 * 1005 * 250 / 3600   # W/K for each air change per hour of a 250 m^3 house

def outdoor(t_h):
    return 30.0 - 8.0 * math.cos(2 * math.pi * (t_h - 3) / 24)       # 22 C at 03:00, 38 C at 15:00

def gains(t_h, shading):
    sun = max(0.0, math.sin(math.pi * (t_h - 6) / 12))               # daylight from 06:00 to 18:00
    return 300.0 + (1200.0 if not shading else 400.0) * sun           # W: people and appliances + sun

def simulate(C, night_vent, shading=False, days=7, dt=300.0):
    T, warm_hours, trace = 28.0, 0.0, []
    for step in range(int(days * 86400 / dt)):
        t_h = (step * dt / 3600) % 24
        T_out = outdoor(t_h)
        night = t_h >= 20 or t_h < 8
        ach = 6.0 if (night_vent and night and T_out < T) else 0.5   # open up at night if cooler outside
        H = H_FABRIC + ach * H_AIR_PER_ACH
        T += dt * (H * (T_out - T) + gains(t_h, shading)) / C         # explicit Euler step
        if step * dt >= (days - 1) * 86400:                           # record the last day
            trace.append(T)
            warm_hours += dt / 3600 if T > 30.0 else 0.0
    return min(trace), max(trace), warm_hours

print("outdoors: 22 C at night to 38 C in the afternoon")
print(f"{'house':36}{'indoor min':>11}{'indoor max':>11}{'hours > 30 C':>14}")
cases = [("light (8 MJ/K)", 8e6, False, False), ("light + night ventilation", 8e6, True, False),
         ("heavy (26 MJ/K)", 26e6, False, False), ("heavy + night ventilation", 26e6, True, False),
         ("heavy + night ventilation + shading", 26e6, True, True)]
for label, C, vent, shade in cases:
    lo, hi, hours = simulate(C, vent, shade)
    print(f"{label:36}{lo:9.1f} C{hi:9.1f} C{hours:12.1f}")
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.
06121824hour of the day20 °C25303540outdoorslight, closedlight, night-ventilatedheavy, night-ventilated
Temperatures over the last simulated day. Outdoors (thin line) swings from 22 to 38 °C. The light house with night ventilation (dashed) follows the outdoor swing at a lag, peaking at 33.5 °C; the heavy house with night ventilation (solid) stays between 27.1 and 29.9 °C. A closed light house (dotted) stays between 34.3 and 38.8 °C, hotter than outdoors for most of the day.

Mass alone does not help: closed up all day and night, both houses settle above 34 °C, warmer than the outdoor average, because the sunshine and the occupants' heat have nowhere to go. Night ventilation alone helps the light house, which then swings from 24.8 to 33.5 °C. Together they work: the heavy, night-ventilated house stays between 27.1 and 29.9 °C, never above 30, while outdoors reaches 38 °C. Shading the windows lowers the peak again, to 28.8 °C. The order in which designers apply these measures in hot climates is exactly this: keep the sun out, store the day's heat in mass, and purge it at night.

ExplanationH

District heating and cooling

A district heating network distributes heat from central sources through insulated pipes under the streets, so that each building needs only a heat exchanger. Its history is a steady fall in temperature, described by Henrik Lund and colleagues as five generations: steam systems from the 1880s (New York's still runs); pressurised water above 100 °C; the pre-insulated pipes at 70 to 100 °C that serve Scandinavian cities; fourth-generation networks at 50 to 70 °C, which accept low-grade heat; and fifth-generation "ambient" loops at 10 to 25 °C, from which each building's own heat pump draws. Lower temperatures cut pipe losses and, more importantly, let networks use heat that would otherwise be wasted: CHP plants, industry, sewage, data centres, large heat pumps and solar thermal fields.

Denmark is the leading example, with about two thirds of its households on district heating and pioneering solar plants with large seasonal pit stores, as at Dronninglund and Vojens. Reykjavík heats nearly the whole city with geothermal water; Helsinki draws heat from treated wastewater with large heat pumps; northern Chinese cities run some of the largest networks in the world, still mostly fed by coal CHP and moving to cleaner sources. District cooling works the same way with chilled water: Paris draws on the Seine, Toronto on the cold deep water of Lake Ontario, and Gulf cities such as Dubai and Doha cool whole districts from central chiller plants, which are more efficient and easier to maintain than thousands of small units.

ExplanationH

How it is done in practice

Building services engineers calculate U-values under ISO 6946, design heat loads under EN 12831 or the ASHRAE Handbook's methods, ventilation under ASHRAE 62.1 or EN 16798-1, and comfort under ISO 7730 and ASHRAE 55; national codes, such as the energy codes of the EU's member states under the recast Energy Performance of Buildings Directive (2024), ASHRAE 90.1 in many countries, and India's Energy Conservation Building Code, set minimum performance. Voluntary standards such as Passivhaus go further. These documents are published by ASHRAE, ISO and CEN and national bodies; this lesson describes their methods only in outline.

For design decisions, engineers simulate whole buildings hour by hour with tools such as the open-source EnergyPlus and its OpenStudio interface, TRNSYS, IDA ICE, IES VE and DesignBuilder, or the Modelica Buildings Library for control studies. Those tools solve, for every zone and every hour of a weather file, a much richer version of the lumped model above. An EnergyPlus model describes the wall of this lesson in its text input format like this (not run here):

text
Material,
  Mineral wool 100mm,      !- Name
  MediumRough,             !- Roughness
  0.100,                   !- Thickness {m}
  0.035,                   !- Conductivity {W/m-K}
  30,                      !- Density {kg/m3}
  840;                     !- Specific Heat {J/kg-K}

Construction,
  Insulated cavity wall,   !- Name
  Brick 102mm,             !- Outside Layer
  Mineral wool 100mm,      !- Layer 2
  Concrete block 100mm,    !- Layer 3
  Gypsum plaster 13mm;     !- Layer 4

The frontier in 2026 is less about single buildings than about buildings as part of the energy system: heat pumps and thermal storage that shift demand to hours of cheap, clean electricity, retrofitting the existing stock at scale, embodied carbon in materials (Sustainable engineering), and the comfort of the billions of people in hot countries who do not yet have cooling.

Common misconceptionsH

Common misconceptions

Misconception

"Thicker insulation always pays." Each layer helps less than the one before: U falls as 1/R1/R, so doubling the insulation of an already good wall saves far less than the first few centimetres did. Beyond a point, money is better spent on airtightness, windows, thermal bridges or the heating system.

Misconception

"A heat pump makes heat out of electricity, like a heater but better." A heat pump moves heat from outdoors (even from air at −10 °C, which still holds plenty of thermal energy) and adds the electricity it uses. Its COP is set by the temperature lift, which is why low water temperatures matter so much.

Misconception

"Houses need to breathe through their walls." Houses need controlled ventilation; walls need to manage moisture, letting water vapour out without letting moist air in. Uncontrolled leakage wastes energy and can carry moisture into the structure.

Misconception

"Heavy walls keep a building cool." Mass only stores heat; it keeps a building cool only if the heat it absorbs by day is removed at night. Without night ventilation, the simulated heavy house was as hot as the light one.

Exercises

Exercises

Use ρcp=1.2\rho c_p = 1.2 kJ/(m³K) for air unless an exercise says otherwise.

1. Heating, cooling and buildings

Warm-upHuman

A wall is built of 215 mm aerated concrete blocks (thermal conductivity 0.11 W/(m K)) with 15 mm of plaster inside (0.40 W/(m K)). Take surface resistances of 0.13 m²K/W inside and 0.04 m²K/W outside. How much heat, in watts, flows through 40 m² of this wall when it is 20 °C inside and −5 °C outside? Give the nearest whole number.

2. Heating, cooling and buildings

CoreHuman

A small house has 95 m² of walls at U=0.25U = 0.25, 60 m² of roof at U=0.15U = 0.15, 60 m² of ground floor at U=0.20U = 0.20 and 18 m² of windows at U=1.1U = 1.1 (all in W/(m²K)). Its 240 m³ of air is exchanged 0.6 times an hour, with no heat recovery. Ignoring thermal bridges, what is its heat loss coefficient HH in W/K, to the nearest whole number? Use ρ=1.2\rho = 1.2 kg/m³ and cp=1005c_p = 1005 J/(kg K) for air.

3. Heating, cooling and buildings

CoreHuman

An office holds 12 people, each breathing out 0.005 L/s of CO₂. Outdoor air contains 420 ppm of CO₂. What outdoor-air ventilation rate, in L/s, keeps the office at 900 ppm in steady state?

4. Heating, cooling and buildings

CoreHuman

A heat pump's refrigerant evaporates at −5 °C and condenses at 50 °C, and the machine achieves 50% of the Carnot COP between these temperatures. How much electricity, in kWh, does it use to deliver 10,000 kWh of heat? Give the nearest whole number.

5. Heating, cooling and buildings

CoreHuman

A house is to be built in a hot, dry climate where summer days reach 38 °C and nights fall to 22 °C. Which measures would most reduce overheating without air conditioning? Select all that apply.

Choose all that apply

6. Heating, cooling and buildings

CoreComputational

Write wall_profile(layers, T_in, T_out, R_si=0.13, R_se=0.04). layers is a list of (thickness_m, conductivity) from outside to inside. Return (U, temps) where U is the wall's U-value in W/(m²K) and temps is the list of temperatures (°C) at the outer surface and then at the inner side of each layer, so temps has len(layers) + 1 entries and its last entry is the inner surface temperature.

Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

7. Heating, cooling and buildings

StretchComputational

In a winter power cut, a house with thermal capacity CC (J/K) and heat loss coefficient HH (W/K) cools towards the outdoor temperature: C dT/dt=H(Tout−T)C\,dT/dt = H(T_\text{out} - T).

  1. Write cool_down(C, H, T0, T_out, hours, dt=60.0) that integrates this by the explicit Euler method with time step dt seconds and returns the temperature after hours hours, starting from T0.
  2. Write time_constant_hours(C, H).

Check your Euler result against the exact solution T=Tout+(T0−Tout)e−Ht/CT = T_\text{out} + (T_0 - T_\text{out})e^{-Ht/C}. How warm is a heavy house (C=26C = 26 MJ/K, H=100H = 100 W/K) after 12 hours at 0 °C outside, starting from 20 °C? And a light one (C=8C = 8 MJ/K)?

Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

Further reading and resources

  • The Future of Heat Pumps · International Energy Agency · 2022The IEA's special report on heat pumps for buildings and industry, their markets, costs and policies.
  • The Future of Cooling · International Energy Agency · 2018How air conditioning is growing worldwide, what it means for electricity systems, and how efficiency could change the outlook.
  • EnergyPlusThe open-source whole-building energy simulation engine funded by the US Department of Energy, used in research and practice worldwide.
  • ASHRAEPublishes the ASHRAE Handbook and standards on thermal comfort (55), ventilation and indoor air quality (62.1) and building energy performance (90.1).
  • International Organization for Standardization (ISO)Publishes the international standards for U-value calculation (ISO 6946), thermal comfort (ISO 7730) and building energy performance (the ISO 52000 family).
  • CEN and CENELECThe European standards bodies, whose standards include the design heat load of buildings (EN 12831) and indoor environment criteria (EN 16798-1).
  • Passive House InstituteThe institute in Darmstadt behind the Passivhaus standard for very low-energy buildings.
  • 4th Generation District Heating (4GDH): Integrating smart thermal grids into future sustainable energy systems · Henrik Lund and colleagues · 2014The paper that defined the generations of district heating and argued for low-temperature networks.
  • Developing an adaptive model of thermal comfort and preference · Richard de Dear and Gail Brager · 1998ASHRAE Transactions. The field-study basis of the adaptive comfort model for naturally ventilated buildings.
  • Euroheat & PowerThe international association for district heating and cooling, with country data and technical guidance.