In class we derived the properties of a 3-dimensional gas from the Boltzmann distribution and three postulates, and you studied a 1-dimensional gas in Homework 1. Suppose you were interested instead in a 2-dimensional gas, for example gas molecules able to freely skate around on a surface but that couldn’t escape the surface.
For a 1-dimensional gas, $$P=(\frac{m}{2\pi kT})^{1/2}\exp(\frac{-mv^2}{2kT})$$ For a 3-dimensional gas, $$P=4\pi v^2(\frac{m}{2\pi kT})^{3/2}\exp(\frac{-mv^2}{2kT})$$ Where $4\pi v^2$ is the number of directions (area of sphere).
In a 2-dimensional space, the number of directions is $2\pi v$ (circumference of circle).
Therefore, $$P=2\pi v(\frac{m}{2\pi kT})^{2/2}\exp(\frac{-mv^2}{2kT})$$ $$=(\frac{m v}{k T})\exp(\frac{-mv^2}{2kT})$$ for a 2-dimensional space.
In [0]:
import numpy as np
import matplotlib.pyplot as plt
m = 32/1000/(6.022*10**23) #mass of O2 (kg/molecule)
k = 1.38064852*10**-23 # Boltzmann Constant (m^2 kg s^-2 K^-1)
v = np.linspace(0,1500,1000) #velocity (m/s)
for T in [200,400,600]:
P = (m*v/k/T)*np.exp(-m*v**2/(2*k*T)) #Maxwell-Boltzman speed distribution for a 2-D gas
plt.plot(v,P, label = '{0}K'.format(T))
plt.xlabel('Velocity(m/s)')
plt.ylabel('Probability')
plt.legend(loc='best')
plt.title('O2 Speed Distribution')
plt.show()
In [0]:
from sympy import *
T = Symbol('T',positive=True)
k = Symbol('k',positive=True)
m = Symbol('m',positive=True)
v = Symbol('v',positive=True)
#2D Gas
eqn2d = (2*pi*v)*(m/2/pi/k/T)*exp(-m*v**2/2/k/T)
vbar2top = integrate(eqn2d*(v),(v,0,oo))
vbar2bot = integrate(eqn2d,(v,0,oo))
pprint(vbar2top/vbar2bot)
pprint(vbar2top)
#1D Gas
eqn1d = (m/2/pi/k/T)**(0.5)*exp(-m*v**2/2/k/T)
vbar1top = integrate(eqn1d*(v),(v,0,oo))
vbar1bot = integrate(eqn1d,(v,0,oo))
pprint(vbar1top/vbar1bot)
#3D Gas
eqn3d = (4*pi*v**2)*(m/2/pi/k/T)**(1.5)*exp(-m*v**2/2/k/T)
vbar3top = integrate(eqn3d*(v),(v,0,oo))
vbar3bot = integrate(eqn3d,(v,0,oo))
pprint(vbar3top/vbar3bot)
In [0]:
from sympy import *
T = Symbol('T',positive=True)
k = Symbol('k',positive=True)
m = Symbol('m',positive=True)
v = Symbol('v')
#2D Gas
eqn2d = (2*pi*v)*(m/2/pi/k/T)*exp(-m*v**2/2/k/T)
vbar2top = integrate(eqn2d*(v**2/2),(v,0,oo))
vbar2bot = integrate(eqn2d,(v,0,oo))
pprint(vbar2top/vbar2bot)
#1D Gas
eqn1d = (m/2/pi/k/T)**(0.5)*exp(-m*v**2/2/k/T)
vbar1top = integrate(eqn1d*(v**2/2),(v,-oo,oo))
vbar1bot = integrate(eqn1d,(v,-oo,oo))
pprint(vbar1top/vbar1bot)
#3D Gas
eqn3d = (4*pi*v**2)*(m/2/pi/k/T)**(1.5)*exp(-m*v**2/2/k/T)
vbar3top = integrate(eqn3d*(v**2/2),(v,-oo,oo))
vbar3bot = integrate(eqn3d,(v,-oo,oo))
pprint(vbar3top/vbar3bot)
In junior Chemical Engineering laboratory, you will study the diffusion and solubility of CO$_2$ in an organic solvent using a diffusion cell like the one sketched here.
In [0]:
import numpy as np
#Constants
T = 298 #K
P = 100000 #Pa (kg/m/s^2)
d = 4*10**-10 #m
MW = 44.01 #g/mol
Na = 6.022*10**23 #molecules/mol
kB = 1.38064582*10**-23 #m^2 kg/s^2/K
m = MW/Na/1000 # kg/molecule
v = (8*kB*T/np.pi/m)**0.5 #m/s, mean speed
V = Na*kB*T/P #m^3/mol, volume
sigma = np.pi*d**2 #m^2, collision cross section
z = np.sqrt(2)*sigma*Na/V*v #1/s, molecular collision frequency
lambd = v/z #m, mean free path
D11 = 1/3*v*lambd #m^2/s, self-diffusion constant
print('The self diffusion constant D11 is',round(D11*100**2,5),'cm^2/s')
In [0]:
r = d/2 #m
eta = 14.93e-6 # Pa*s, Viscosity of CO2 at 298 K (source from engineeringtoolbox.com)
D12 = kB*T/(4*np.pi*eta*r) #m^2/s
print('The diffusion constant in the Stoddard solvent is', round(D12*100**2,7),'cm^2/s.')
print('This value is smaller in Stoddard solvent due to greater viscosity.')
In [0]:
from scipy.stats import norm
prob = norm.ppf(2/3) #cm
print('The 66.7% percentile of a normal distribution function lies at x =',round(prob,3),'cm.')
print('However, we already know that x = 1 cm here. Therefore, sigma must be greater than one.')
sigma1 = 1/prob #cm
print('sigma =',round(sigma1,3),'cm')
t = sigma1**2/2/D11/(100**2) #s
print('For 1/3 of the molecules to diffuse all the way to the surface is',round(t,2),'seconds.')
In [0]:
print('Average collisons=z*t=',round(z*t,0))
In [0]:
print('Total distance =',round(v*t,1),'m.')
In [0]:
jw = 1/4*P/kB/T*v #collisions/area/time
area = np.pi*.02**2 #m^2
n = jw*area*1
print('Wall collision frequency =',n)
In [0]:
t2 = sigma1**2/2/(D12*100**2)
print('Using the diffusion constant from #6, t =',round(t2,0),'s.')
In [0]:
print('Comparing problems 7 and 11, we see that diffusion is order-of-magnitude greater in gas phase than in liquid phase.')
print('Therefore, gas molecule dissolved into solvent will be rapidly replaced by other gas molecules.')
In [0]:
import numpy as np
V = 100/(100**3) #m^3
P0 = 1.1*101325 #Pa
t = 4*3600 #s
A = 1/(10**12) #m^2
kB = 1.38064582*10**-23 #m^2 kg/s^2/K
Tau = V/A*(2*np.pi*m/kB/T)**.5 #s
P = P0*np.exp(-t/Tau)
print ('Four hours later, P=',round(P,1),'Pa')
In [0]: