Canonical Reactors I¶
- Zero-dimensional reactors.
- No spatial dependence.
- Evolve in time (or space for the PFR).
- Batch reactors
- Constant TP
- Constant TV
- Constant HP
- Constant UV
- Plug flow reactors (PFR)
- Perfectly stirred reactor (PSR), also called a continuous stirred tank reactor (CSTR)
- These are flow reactors.
Approach¶
- Couple kinetics with conservation laws for heat and mass balances.
- These reactors provide convenient, well-characterized baselines for more complicated flow processes.
- All equations below are on a mass basis:
is J/kg, etc.
Batch reactor: TP¶
- Batch reactor is a closed system
constant mass. - Specify an initial state:
, , . - Mass balance:
, so we have- Now, write in the details, where
is the net mass generation rate of species with units of kg/m *s, and is volume.
is constant:
- Also, we have
- That is, we have
ODEs for each species mass fraction. All other terms are written in terms of the and the known , . - The last blue equation indicates the functional dependence of the species rates, which are given in terms of kinetic expressions for the given combustion mechanism.
- At constant pressure, the volume will vary. The volume per unit mass is simply
, where at any time is given by the ideal gas law in terms of the composition at any time.
Batch reactor: TV¶
- If volume (or more likely, volume per unit mass, so that the 0-D system is intensive) is given instead of pressure, then the system density is constant (and is known from the initial state.)
- The previous equations hold, but
is known. - The ideal gas law can be used to solve for
, which now varies.
Batch reactor: HP¶
- For an adiabatic, constant pressure reactor, the previous equations all hold, but now temperature will vary.
- The energy conservation equation becomes
- The system enthalpy is known from the initial state.
- At any given time, the temperature may be found by solving
for given the known , and the current . - In Cantera, if
h0
is our enthalpy, this calculation is done internally, and we would simply write:
gas.HPY = h0, P, y
T = gas.T
Temperature equation¶
- Alternatively, we can derive a temperature equation as follows.
Now divide through by
Use
Also,
Batch reactor: UV¶
- If we have an adiabatic, constant volume batch reactor, then then energy equation is written in terms of internal energy
instead of enthalpy, and instead of . - Also,
is constant as for the TV system above.
Also,
Plug flow reactors (PFR)¶
- Instead of a batch reactor evolving in time, we have a flow reactor evolving in space (flow in a tube, say).
- Radial mixing is perfect, and the "plug" of fluid moves down the tube without mixing axially.
- Hence, the plug behaves as a batch reactor, reacting in time. But the plug is at a different spatial location at each time.
- Convert time
to spatial location :
- That is, we transform from time to space using the local velocity:
. - Now, for a PFR, the mass flux is constant (even though the local velocity may vary):
Hence,
- So, in all the previous equations, wherever you see
, replace it with the relation above. - You will have to specify the mass flux.
Perfectly stirred reactor (PSR)¶
- This is a flow reactor with an inlet and an outlet.
- The outlet composition is the same as the reactor composition.
- This can be constant temperature or adiabatic.
- Characterized by the reactor size (volume
) and flow rate .- These can be combined as
, where is the PSR residence time. - The PSR has one key parameter,
, which is the mixing timescale of the reactor.
- These can be combined as
- We can write steady or unsteady versions of the reactor.
Unsteady PSR¶
- Assumptions:
- Mass
in the PSR is constant. .
- Mass
- Species balance equation:
- Energy balance equation.
- If the reactor is isothermal, we just specify a constant temperature.
- For an adiabatic reactor (with constant
and , we have
If the initial
is equal to (so make the initial composition equal to the inlet composition for consistency), then we haveTemperature can be found implicitly by solving
, as noted above.Alternatively, we can formulate and solve a temperature equation:
Temperature equation¶
- The temperature equation parallels the treatment for a batch reactor, where we also had the
equation:
- Solve for
and use our PSR equation above for :
Solution approach¶
- Note that the equations for an unsteady PSR are very similiar to those for a batch reactor, and we can use the same code to solve both systems.
- Often, an unsteady PSR is solved to steady state by solving the ODE system for long enough.
- Alternatively, we can directly solve the steady problem by setting the
terms to zero. We then have a coupled system of nonlinear algebraic equations that we can solve using, e.g., Newton's method.
PSR Note¶
- Consider again the unsteady PSR equations for species:
- At steady state we have
- That is, mixing balaces reaction.
is the mixing timescale and is a mixing rate. Hence, we have (mixing rate)=(reaction rate).- As
decreases, the mixing rate increases, and eventually the chemical reaction rate cannot match it.- At that point, the PSR blows out.
- The balance still holds, but we get the trivial solution 0 = 0.
- We can decrease
by increasing , or by decreasing volume .
Chemical timescale¶
- Combustion chemistry is complex and there is no one reaction rate (or no one reaction timescale).
- However, at the point just before blowout, we can take
as the characteristic chemical timescale. - We can then compare
to some other mixing timescale to define a Damkohler number: .
- However, at the point just before blowout, we can take
Analogy with diffusive mixing¶
- Consider the unsteady diffusion equation:
If we nondimensionalize this equation, then we need a timescale
, a lengthscale , and a scale (which cancels).The nondimensional form is
Here, starred variables are nondimensional.
If we chose appropriate reference values, then the magnitude of terms
and are both .This gives
as the characteristic diffusion timescale.Hence, we can write:
But this is just our PSR mixing term. The point is, that the PSR mixing term can be used as an analogy to more complex diffusive mixing in terms of a mixing timescale, where mixing and reaction processes are in a kind of balance.
HP Batch Reactor code¶
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from scipy.integrate import odeint
import cantera as ct
gas = ct.Solution("gri30.yaml")
#------------- Set batch reactor equation
def rhsf(y,t):
gas.HPY = h0, gas.P, y
return gas.net_production_rates * gas.molecular_weights / gas.density
#------------- set initial condition and enthalpy
gas.TPX = 1400, 101325, "CH4:1, O2:2, N2:7.52"
h0 = gas.enthalpy_mass
y0 = gas.Y
#------------- solve the ODE system
nt = 1000
times = np.linspace(0,0.01,nt)
y = odeint(rhsf, y0, times)
#------------- recover the temperature
T = np.zeros(nt)
for i in range(nt):
gas.HPY = h0, gas.P, y[i,:]
T[i] = gas.T
#------------- equilibrium state
gas.equilibrate("HP")
Teq = gas.T
yeq = gas.Y
#------------- plot results
plt.rc("font", size=14)
plt.plot(times*1000,T, label="T")
plt.plot(times[-1]*1000,Teq, 'kd', label="Teq")
plt.xlabel("time (ms)")
plt.ylabel("T (K)")
plt.legend(frameon=False);
plt.figure()
species = ["CH4", "O2", "CO2", "CO", "OH"]
for sp in species:
plt.plot(times*1000,y[:,gas.species_index(sp)], label=sp)
plt.plot(times[-1]*1000,yeq[gas.species_index(sp)], 'kd', label="eq" if sp==species[-1] else "")
plt.xlabel("time (ms)")
plt.ylabel("y")
plt.legend(frameon=False);
plt.plot(times*1000, y[:,gas.species_index("CO2")]/y[-1,gas.species_index("CO2")])
plt.plot(times*1000, y[:,gas.species_index("NO")]/y[-1,gas.species_index("NO")])
[<matplotlib.lines.Line2D at 0x106d81be0>]