In [29]:
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import cantera as ct
In [123]:
gas = ct.Solution("gri30.yaml")
P = 101325
Compute stoichiometric T$_{ad}$¶
Stoichiometric reactants¶
In [127]:
Tr = 298.15
gas.TPX = Tr, P, "CH4:1, O2:2, N2:7.52"
hR = gas.enthalpy_mass
Stoichiometric products¶
In [128]:
gas.HPX = hR, P, "CO2:1, H2O:2, N2:7.52" # note, enthalpy is reactant enthalpy
yst = gas.Y
print("Tad =", gas.T, "K")
Tad = 2325.5981297600447 K
T$_{ad}$ for all $\xi$¶
Species mass fractions are peicewise linear.
- That is, the lean compositions are linear between $\xi=0$ and stoichiometric, and the rich compositions are linear between $\xi=\xi_{st}$ and $\xi=1$.
- So, find the mass fractions at $\xi=0$, $\xi=\xi_{st}$, and $\xi=1$.
Lean:
- $(y-y_0)/(\xi-0) = (y_{st} - y_0)/(\xi_{st}-0)$
- $\rightarrow y = y_0 + (y_{st} - y_0)\xi/\xi_{st}.$
Rich:
- $(y-y_{st})/(\xi-\xi_{st}) = (y_1 - y_{st})/(1-\xi_{st})$
- $\rightarrow y = y_{st} + (y_1 - y_{st})(\xi-\xi_{st})/(1-\xi_{st})$
Enthalpy is a conserved scalar, so
- $h = h_0\cdot(1-\xi) + h_1\cdot(\xi)$
Get the state at $\xi=0$¶
In [129]:
gas.TPX = 298.15, P, "O2:1, N2:3.76"
y0 = gas.Y
h0 = gas.enthalpy_mass
Get the state at $\xi=1$¶
In [130]:
gas.TPX = 298.15, P, "CH4:1"
y1 = gas.Y
h1 = gas.enthalpy_mass
Get T$_{ad}$ at all $\xi$¶
In [131]:
ξ_st = gas.molecular_weights[gas.species_index("CH4")] / (
gas.molecular_weights[gas.species_index("CH4")] +
gas.molecular_weights[gas.species_index("O2")] * 2 +
gas.molecular_weights[gas.species_index("N2")] * 2*3.76 )
n = 1000
ξ = np.linspace(0.0,1,n)
T = np.zeros(n)
for i in range(n):
if ξ[i] <= ξ_st:
y = y0 + (yst-y0)*ξ[i]/ξ_st
else:
y = yst + (y1-yst)*(ξ[i]-ξ_st)/(1-ξ_st)
h = h0*(1-ξ[i]) + h1*ξ[i]
gas.HPY = h, P, y
T[i] = gas.T
#--------------------
plt.rc('font', size=14)
plt.plot(ξ,T)
plt.xlabel('ξ')
plt.ylabel('T (K)')
plt.xlim([0,1])
plt.ylim([298.15,2500]);