J.C. Kantor (Kantor.1@nd.edu)
This notebook demonstrates several routine chemical calculations in the context of a hypothetical air quality analysis for a classroom.
Imagine the classroom is suddenly sealed off from the external world. Doors are sealed, the ventilation is cut off. How long could we hold out before we reach a point of inadequate air quality? What about real danger?
We want to avoid a situation like this (image from the classic submarine movie Das Boot (1981)):
Assumptions:
The volume of the room is
$$ V = 20 \mbox{m} \times 12 \mbox{m} \times 3 \mbox{m} = \fbox{720} \mbox{ m}^3$$By the ideal gas law, the total moles of air present in the room is given by
$$n_\mbox{air} = \frac{PV}{RT} = \frac{101,325 \mbox{Pa} \times 720\mbox{m}^3}{8.314\frac{\mbox{Pa}\cdot\mbox{m}^3}{\mbox{gmol}\cdot\mbox{K}} \times 298.16\mbox{K} } = \fbox{29,430}\mbox{ gmol of air}$$Air is a mixture of gases. We use $y_n$ to denote the fraction of all molecules in the mixture that are of type $n$. For this problem
Species | Mole Fraction | Value |
---|---|---|
$O_2$ | $y_{O_2}$ | 0.21 |
$N_2$ | $y_{N_2}$ | 0.79 |
$CO_2$ | $y_{CO_2}$ | 0.00 |
Total | 1.00 |
One of these is unknown? How can we find a value for $y_{Ar}$?
The key is recognize that mole fractions must sum to one, that is
$$\sum_{n=1}^N y_n = 1$$For this problem
$$ y_{O_2} + y_{N_2} + y{CO_2} + y_{Ar} = 1 $$Solving for $y_{Ar}$
\begin{align*} y_{Ar} & = 1 - y_{O_2} - y_{N_2} - y{CO_2} \\ & = 1 - 0.21 - 0.78 - 0.003 = \fbox{0.007} \end{align*}We can use this to complete this table of mole fractions for this mixture.
Species | Mole Fraction | Value |
---|---|---|
$O_2$ | $y_{O_2}$ | 0.21 |
$N_2$ | $y_{N_2}$ | 0.78 |
$CO_2$ | $y_{CO_2}$ | 0.003 |
$Ar$ | $y_{Ar}$ | 0.007 |
Air is a mixture of gases. We use $y_i$ to denote the fraction of all molecules in the mixture that are of type $i$. For this problem
Species | Mole Fraction | Value | MW |
---|---|---|---|
$O_2$ | $y_{O_2}$ | 0.21 | 32.0 |
$N_2$ | $y_{N_2}$ | 0.78 | 28.0 |
$CO_2$ | $y_{CO_2}$ | 0.003 | 44.0 |
$Ar$ | $y_{Ar}$ | 0.007 | 39.9 |
yO2 = 0.21
yN2 = 0.78
yCO2 = 0.003
yAr = 0.007
MO2 = 32.0
MN2 = 28.0
MCO2 = 44.0
MAr = 39.9
Mair = yO2*MO2 + yN2*MN2 + yCO2*MCO2 + yAr*MAr
print("Average Molecular Mass of Air =", Mair)
Average Molecular Mass of Air = 28.9713
The ideal gas law reads
$$PV = nRT$$The molar density of a gas is given by
$$ \frac{n}{V} = \frac{P}{RT} $$The mass density of a gas is given by
$$ \rho = M \frac{n}{V} = M \frac{P}{RT}$$where $M$ refers to molecular mass.
This problem requires us to perform a material balance for CO2 in the atmosphere. We'll perform the using a 10 step approach outlined in the textbook.
The system of interest is the global atmosphere which we assume is well mixed and of uniform composition.
The chemical component to model is CO2. The stream variables are the mass flowrates of CO
This problem could be done on either a molar or mass basis. We'll arbitrarily choose to do this in mass units of kg/year. First we convert global emissions to kg/year.
mCO2_in = 34.5e9 # inflow, metric tonnes per year
mCO2_in = mCO2_in*1000 # inflow, kg per year
print "Global CO2 emissions = {:8.3g} kg/yr".format(mCO2_in)
File "<ipython-input-3-082ec678f608>", line 3 print "Global CO2 emissions = {:8.3g} kg/yr".format(mCO2_in) ^ SyntaxError: invalid syntax
The rate of accumulation is given as ppm by volume per year. For ideal gases, volume fraction is equivalent to mole fraction. We need to convert the mole fraction, which is the ratio of kg-moles of CO2 to kg-moles of air, to mass fraction which has units of kg of CO2 to kg of air per year.
nCO2_accum = 2.4e-6 # accumulation, kg-mol CO2/kg-mol air/yr
mwAir = 28.97 # kg air/kg-mol air
mwCO2 = 44.01 # kg CO2/kg-mol CO2
wCO2_accum = nCO2_accum*mwCO2/mwAir # kg CO2/kg air/yr
print "Accumulation Rate of CO2 = {:8.3g} kg CO2/kg air".format(wCO2_accum)
Accumulation Rate of CO2 = 3.65e-06 kg CO2/kg air
The basis for the calculation are flows and change in one year. No additional work is required.
The system variable is the rate of accumulation of CO2 in kg CO2/year. We need to convert from change in concentration per year to change in total mass per year. The first step is to estimate the total mass of air.
# Earth Radius in meters
R = 6371000 # m
# Earth Area in square meters
A = 4*pi*R**2 # m**2
# Mass of the atmosphere in kg
g = 9.81 # N/kg
P = 101325 # N/m**2
mAir = A*P/g # kg
print "Estimated mass of the atmosphere = {:8.3g} kg".format(mAir)
Estimated mass of the atmosphere = 5.27e+18 kg
To get the rate of change of total CO2, multiply the total mass of by the rate of change of mass fraction of CO2.
mCO2_accum = wCO2_accum*mAir # kg CO2/year
print "Change in CO2 = {:8.3g} kg CO2/year".format(mCO2_accum)
Change in CO2 = 1.92e+13 kg CO2/year
The inflow and rate of change of CO2 are specified, and calculated above.
mCO2_out = mCO2_in - mCO2_accum
print "Global CO2 outflow = {:8.3g} kg CO2/yr".format(mCO2_out)
Global CO2 outflow = 1.53e+13 kg CO2/yr
Fraction retained in the atmosphere
fCO2 = mCO2_accum/mCO2_in
print "Fraction of CO2 retained in the atmosphere = {:<.2g} ".format(fCO2)
Fraction of CO2 retained in the atmosphere = 0.56