DEV Community

Cover image for Air Changes per Hour in Python: Why 1 ACH Only Removes 63% of the Air
Evgenii Konkin
Evgenii Konkin

Posted on

Air Changes per Hour in Python: Why 1 ACH Only Removes 63% of the Air

Airflow for a room is usually sized with one line of arithmetic:

CFM = volume_ft3 * ACH / 60
Enter fullscreen mode Exit fullscreen mode

A 20 × 15 × 9 ft office at 6 air changes per hour needs 270 CFM. Done.

That formula answers "how much air?" It doesn't answer the question people actually care about: how long until the room is clean? The answer is not "10 minutes at 6 ACH," and a few lines of Python show why.

An air change is a volume, not a replacement

One air change means the fan has moved one room volume of air. But incoming air mixes with the air already in the room, and the exhaust pulls out that mixture. In a well-mixed room the concentration of anything in the air (steam, odor, CO2 from a past meeting, an aerosol) decays exponentially:

C(t) = C0 * exp(-ACH * t)      # t in hours
Enter fullscreen mode Exit fullscreen mode

After one air change (ACH * t = 1) you are left with exp(-1), about 37%. Here's the whole model:

import math

def ach(cfm, volume_ft3):
    """Air changes per hour from airflow (CFM) and room volume (ft³)."""
    return cfm * 60 / volume_ft3

def minutes_to_remove(fraction, ach_value, mixing=1.0):
    """Well-mixed decay: C(t) = C0 * exp(-ACH * mixing * t).
    mixing=1.0 is a perfectly mixed room; lower values model poor mixing."""
    return -math.log(1 - fraction) / (ach_value * mixing) * 60

def remaining_after(air_changes):
    return math.exp(-air_changes)

for n in (1, 2, 3):
    print(f"after {n} air change(s): {1 - remaining_after(n):.1%} removed")

print()
for a in (2, 6, 12, 20):
    print(f"{a:>2} ACH -> 99%: {minutes_to_remove(0.99, a):5.0f} min, "
          f"99.9%: {minutes_to_remove(0.999, a):5.0f} min")

print()
bath = 8 * 5 * 8  # ft³
for cfm in (20, 50, 80):
    a = ach(cfm, bath)
    print(f"{cfm} CFM in {bath} ft³: {a:5.2f} ACH, "
          f"95% in {minutes_to_remove(0.95, a):4.1f} min, "
          f"with mixing 0.7: {minutes_to_remove(0.95, a, 0.7):4.1f} min")

def cfm_for_clearance(volume_ft3, fraction, minutes, mixing=1.0):
    """Airflow needed to remove `fraction` within `minutes`."""
    needed_ach = -math.log(1 - fraction) / (minutes / 60) / mixing
    return needed_ach * volume_ft3 / 60

print()
print(f"bath, 95% in 10 min: {cfm_for_clearance(bath, 0.95, 10):.0f} CFM")
print(f"office 2700 ft³, 90% in 15 min: {cfm_for_clearance(2700, 0.90, 15):.0f} CFM")
Enter fullscreen mode Exit fullscreen mode

Output:

after 1 air change(s): 63.2% removed
after 2 air change(s): 86.5% removed
after 3 air change(s): 95.0% removed

 2 ACH -> 99%:   138 min, 99.9%:   207 min
 6 ACH -> 99%:    46 min, 99.9%:    69 min
12 ACH -> 99%:    23 min, 99.9%:    35 min
20 ACH -> 99%:    14 min, 99.9%:    21 min

20 CFM in 320 ft³:  3.75 ACH, 95% in 47.9 min, with mixing 0.7: 68.5 min
50 CFM in 320 ft³:  9.38 ACH, 95% in 19.2 min, with mixing 0.7: 27.4 min
80 CFM in 320 ft³: 15.00 ACH, 95% in 12.0 min, with mixing 0.7: 17.1 min

bath, 95% in 10 min: 96 CFM
office 2700 ft³, 90% in 15 min: 414 CFM
Enter fullscreen mode Exit fullscreen mode

What the output tells you

One air change removes 63%. Three remove 95%. A 99% clear-out takes about 4.6 air changes. The tail is always the slow part.

The 2/6/12/20 ACH rows match a published table. The CDC's environmental infection control guidelines (Appendix B, Table B.1) list the minutes needed for 99% and 99.9% removal in an empty, perfectly mixed room: 138/207 at 2 ACH, 46/69 at 6, 23/35 at 12, 14/21 at 20. The function reproduces every one, because the CDC table is built on the same formula: t = -ln(C2/C1) / (Q/V) * 60.

Bathroom fans need run time. IRC-based codes ask for at least 50 CFM intermittent or 20 CFM continuous for a bathroom. In an 8 × 5 × 8 ft bathroom, 50 CFM is about 9.4 ACH, and it still needs about 19 minutes to clear 95% of the steam, on paper. Turn it off when you leave the room and most of the moisture stays.

Mixing matters as much as airflow. The CDC table explicitly assumes perfect mixing and warns that removal takes longer with poor mixing or stagnant air. The mixing parameter is a crude way to see the effect: at 0.7, the 50 CFM fan needs about 27 minutes instead of 19. The 0.7 is an illustration, not a measured value. Real numbers depend on where supply and exhaust are and how air moves between them.

Flip it: size airflow for a clearance time

The last function solves the problem backward. If you want 95% of shower steam gone within 10 minutes in that bathroom, you need about 96 CFM delivered, nearly double the code minimum. If you want an office to clear 90% of anything released in 15 minutes, 2,700 ft³ needs about 414 CFM, more than the 270 CFM a 6 ACH rule gives.

Two notes before you use this for design:

  • Delivered, not rated, CFM. Fan ratings assume a specific duct pressure. Long or crushed ducts cut real airflow.
  • Outdoor air vs total air. In a recirculating system, only the outdoor air (and real filtration) removes contaminants. Six ACH of supply air with a small outdoor-air fraction does much less cleaning than the ACH number suggests.

Quick rule

For a well-mixed room, hours to remove 95% ≈ 3 / ACH. At 6 ACH that's 30 minutes; at 3 ACH, an hour. Double the airflow, halve the time.

Your turn: what's the slowest-clearing room you've had to deal with, a bathroom, a shop, a conference room? Post the dimensions and fan CFM in the comments and I'll run the numbers.

Top comments (0)