Skip to content

Instantly share code, notes, and snippets.

@mackstann
Created January 12, 2016 00:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mackstann/3438973b274f3737837a to your computer and use it in GitHub Desktop.
Save mackstann/3438973b274f3737837a to your computer and use it in GitHub Desktop.
building_volume_cu_ft = 8*8*20
natural_ventilation_cfm = 1
# this is for a human at rest.
o2_to_co2_cu_ft_per_minute = 0.009
# starting/natural conditions -- typical
# see http://www.molecularproducts.com/pdf/technical-library/A%20Guide%20to%20Breathing%20Rates%20in%20Confined%20Environments%20Technical%20Article.pdf
co2_percent_start = 0.000314
o2_percent_start = 0.2095
co2_cu_ft = building_volume_cu_ft * co2_percent_start
o2_cu_ft = building_volume_cu_ft * o2_percent_start
co2_percent = co2_percent_start
o2_percent = o2_percent_start
for i in range(60*24*2): # step through each minute over two days
# account for respiration of one person
co2_cu_ft += o2_to_co2_cu_ft_per_minute
o2_cu_ft -= o2_to_co2_cu_ft_per_minute
# account for natural exfiltration
co2_cu_ft -= natural_ventilation_cfm * co2_percent
o2_cu_ft -= natural_ventilation_cfm * o2_percent
# account for natural infiltration
co2_cu_ft += natural_ventilation_cfm * co2_percent_start
o2_cu_ft += natural_ventilation_cfm * o2_percent_start
co2_percent = co2_cu_ft / building_volume_cu_ft
o2_percent = o2_cu_ft / building_volume_cu_ft
co2_ppm = int(co2_percent * 1000000)
print("{} minutes: {:0.2f}% O2; {}PPM CO2".format(i+1, o2_percent*100, co2_ppm))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment