= 150 + 273.15
T = 25 + 273.15
TR
= -11020
hf_nh3 = 0
hf_n2 = 0
hf_h2
# N2 + 3H2 -> 2 NH3
= -1
nu_n2 = -3
nu_h2 = 2
nu_nh3
# Getting the Cp values from Perry's handbook (@green2019)
= 6.992 # cal/mol H2 K
cp_h2 = 6.984 # cal/mol N2 K
cp_n2 = 8.92 # cal/mol NH3 K
cp_nh3
= (nu_nh3 * hf_nh3) + (nu_n2 * hf_n2 + nu_h2 * hf_h2)
delta_h_tr = (nu_nh3 * cp_nh3) + (nu_n2 * cp_n2 + nu_h2 * cp_h2)
delta_cp
= delta_h_tr + delta_cp * (T - TR)
delta_h
= 4.184 # J
cal = cal * delta_h_tr + delta_cp * (T - TR) delta_h_kj
In class activity: Non-isothermal reactor design
Lecture notes for chemical reaction engineering
Heat of reaction
Calculate the heat of reaction for the synthesis of ammonia from hydrogen and nitrogen at 150 °C in kcal/mol of N2 reacted and also in kJ/mol of H2 reacted.
\ce{N2 + 3H2 -> 2NH3}
The enthalpy of formation of ammonia at 25 °C is H_{NH_3}^\circ (T_R) = -11020 \ cal/(mol\ \ce{NH3})
The enthalpy of formations at 25 °C
H_{NH_3}^\circ (T_R) = -11020 \ cal/(mol\ \ce{NH3})
H_{N_2}^\circ (T_R) = 0 \ cal/(mol\ \ce{NH3})
H_{H_2}^\circ (T_R) = 0 \ cal/(mol\ \ce{NH3})
Heats of formation of pure components are 0.
\Delta H_{Rx}^\circ(T_R) = \sum_{i=1}^{N} \nu_i H_i^\circ (T_R)
\Delta H_{Rx}(T) = \Delta H_{Rx}^\circ(T_R) + \Delta C_{P}(T - T_R)
Getting the C_{P} values from Perry’s handbook (Green and Southard (2019))
C_{P_{H_2}} = 6.992 cal/mol\ H_2\ K; C_{P_{N_2}} = 6.984 cal/mol\ N_2\ K; C_{P_{NH_3}} = 8.92 cal/mol\ NH_3\ K
\Delta H_{Rx}^\circ(T_R) = -22.04 kcal/mol\ N_2\ reacted
\Delta H_{Rx}(T) at 423.15 K = -93.48 kJ/mol\ N_2\ reacted
\Delta H_{Rx}(T)|_{H_2} = \frac{\nu_{N_2}}{\nu_{H_2}} \Delta H_{Rx}(T)|_{N_2}
\Delta H_{Rx}(T) at 423.15 K = -31.16 kJ/mol\ H_2\ reacted
Adiabatic Liquid-Phase Isomerization of Normal Butane
Normal butane, C_4H_{10}, is to be isomerized to isobutane in a plug-flow reactor. Isobutane is a valuable product that is used in the manufacture of gasoline additives. For example, isooctane can be further reacted to form iso-octane. The 2014 selling price of n-butane was $1.5/gal, while the trading price of isobutane was $1.75/gal.
This elementary reversible reaction is to be carried out adiabatically in the liquid phase under high pressure using essentially trace amounts of a liquid catalyst that gives a specific reaction rate of 31.1 \, \text{h}^{-1} at 360 \, K. The feed enters at 330 \, K.
Calculate the PFR volume necessary to process 100,000 \, \text{gal/day} (163 \, \text{kmol/h}) at 70\% conversion of a mixture 90 \, \text{mol \%} \, n-butane and 10 \, \text{mol \%} \, i-pentane, which is considered an inert.
Plot and analyze X, X_e, T_r, and -r_A down the length of the reactor.
Calculate the CSTR volume for 40\% conversion.
Additional information:
\Delta H^{\circ}_{Rx} = -6900 \, \text{J/mol} \, n-butane,
Activation energy = 65.7 \, \text{kJ/mol}
K_c = 3.03 at 60°C,
C_{A0} = 9.3 \, \text{mol/dm}^3 = 9.3 \, \text{kmol/m}^3
Butane: C_{P_{n-B}} = 141 \, J/mol \cdot K; C_{P_{i-B}} = 141 \, J/mol \cdot K
i-Pentane: C_{P_{i-P}} = 161 \, J/mol \cdot K
PFR algorithm
- Mole balance
F_{A0} \frac{dX}{dV} = -r_A \tag{1}
- Rate law
-r_A = k \left( C_A - \frac{C_B}{K_C}\right) \tag{2}
k = k(T_1) \exp \left[ \frac{E}{R} \left( \frac{1}{T_1} - \frac{1}{T}\right)\right] \tag{3}
K_C = K_C(T_2) \exp \left[ \frac{\Delta H_{Rx}}{R} \left( \frac{1}{T_2} - \frac{1}{T}\right)\right] \tag{4}
- Stoichiometry
C_A = C_{A0} (1 - X) \tag{5}
C_B = C_{A0} X \tag{6}
- Energy balance
\dot Q - \dot W_s - F_{A0} \sum_{i=1}^{N} \Theta_i C_{P_i} \left[ T_{i} - T_{i0}\right] - \Delta H_{Rx} F_{A0} X = 0 \tag{7}
From problem statement:
Adiabatic: \dot Q = 0
No work: \dot W_s = 0
\Delta C_{P} = C_{P_A} - C_{P_B} = 141 - 141 = 0
Substituting in Equation 7
T = T_0 + \frac{ \left( -\Delta H^\circ_{Rx} \right) X_{EB}}{\sum \Theta_i C_{Pi}} \tag{8}
- Solve
Solve equations 1 to 7 simultaneously.
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import solve_ivp
# Constants
= 31.1 # 1/h
K0 = 360 # K
T_K0
= 3.3
KC0 = 60 + 273.15 # K
T_KC0
= 65700 # J/mol
E = 8.314 # J/mol K
R
= -6900 # J/mol
DELTAHR
def adiabatic_pfr( V, y, *args ):
= y[0]
X = args
(fa0,ca0, T0, theta, cp)
= np.sum(theta * cp)
sum_cp
= T0 + (-DELTAHR) * X / sum_cp
T
= K0 * np.exp((E/R) * (1/T_K0 - 1/T))
k = KC0 * np.exp((DELTAHR/R) * (1/T_KC0 - 1/T))
Kc
= ca0 * ( 1 - X )
ca = ca0 * X
cb
= k * (ca - cb/Kc)
rate
= rate/fa0
dXdV
return dXdV
# Problem data
= 0.9
ya0 = 0.1
yi0 = 163.0 # kmol/h
fa = ya0 * fa
fa0 = 9.3 # kmol/m3
ca0
= 330 # K
T0
# n-butane = comp 1; i-butane = comp 2; i-Pentane = component 3
= np.array([1, 0, yi0/ya0])
theta = np.array([141, 141, 161])
cp
# Initial condition
= [0]
y0 = (fa0, ca0, T0, theta, cp)
args = 5
v_final = solve_ivp(adiabatic_pfr, [0, v_final], y0, args=args, dense_output=True)
sol
= np.linspace(0,v_final, 1000)
v = sol.sol(v)[0]
x
= v[np.argmax(x > 0.7)] pfr_07
PFR volume required to obtain a conversion of 0.7 = 2.24 m^3.
# recalculate other quantities for plotting
= np.sum(theta * cp)
sum_cp = T0 + (-DELTAHR) * x / sum_cp
T = KC0 * np.exp((DELTAHR/R) * (1/T_KC0 - 1/T))
Kc = Kc/(1 + Kc) xe
Temperature profile
='Temperature')
plt.plot(v,T, label
'Volume ($m^3$)')
plt.xlabel('Temperature (K)')
plt.ylabel(
0,v_final)
plt.xlim(
plt.ylim(T0,)
plt.show()
Conversion profile
='$X$')
plt.plot(v,x, label='$X_e$')
plt.plot(v,xe, label
'Volume ($m^3$)')
plt.xlabel('Conversion')
plt.ylabel(
0,v_final)
plt.xlim(0,1)
plt.ylim(
plt.legend() plt.show()
CSTR volume
= v[np.argmax(x > 0.4)]
pfr_04
= T[np.argmax(x > 0.4)]
temp_04 = Kc[np.argmax(x > 0.4)]
kc_04 = K0 * np.exp((E/R) * (1/T_K0 - 1/temp_04))
k_04
= ca0 * ( 1 - 0.4 )
ca = ca0 * 0.4
cb = k_04 * (ca - cb/kc_04)
rate
= fa0 * 0.4/ rate cstr_04
PFR volume required to obtain a conversion of 0.4 = 1.14 m^3.
CSTR volume required to obtain a conversion of 0.4 = 0.97 m^3.
Adiabatic Equilibrium Temperature
For the elementary liquid-phase reaction
\ce{A <=> B}
Make a plot of equilibrium conversion as a function of temperature.
Combine the rate law and stoichiometric table to write -r_A as a function of k, C_{A0}, X, and X_e.
Determine the adiabatic equilibrium temperature and conversion when pure A is fed to the reactor at a temperature of 300 K.
What is the CSTR volume to achieve 90% of the adiabatic equilibrium conversion for \dot{v}_0 = 5 \, \text{dm}^3/\text{min}?
Additional information:†
H_A^\circ(298 \, K) = -40,000 \, \text{cal/mol}
H_B^\circ(298 \, K) = -60,000 \, \text{cal/mol}
C_{P,A} = 50 \, cal/mol \cdot K
C_{P,B} = 50 \, cal/mol \cdot K
K_c = 100,000 at 298 K, k = 10^{-3} \exp \left( \frac{E}{R} \left( \frac{1}{298} - \frac{1}{T} \right) \right) \text{min}^{-1} with E = 10,000 \, \text{cal/mol}
- Rate law
-r_A = k \left( C_A - \frac{C_B}{K_C}\right) \tag{9}
k = k(T_1) \exp \left[ \frac{E}{R} \left( \frac{1}{T_1} - \frac{1}{T}\right)\right] \tag{10}
K_C = K_C(T_2) \exp \left[ \frac{\Delta H_{Rx}}{R} \left( \frac{1}{T_2} - \frac{1}{T}\right)\right] \tag{11}
- Equilibrium
K_e = \frac{C_{Be}}{C_{Ae}} \tag{12}
- Stoichiometry
C_A = C_{A0} (1 - X) \tag{13}
C_B = C_{A0} X \tag{14}
Combining Equation 9, Equation 12, Equation 13, and Equation 14
X_e = \frac{K_e(T)}{1 + K_e(T)} \tag{15}
- Energy balance
\dot Q - \dot W_s - F_{A0} \sum_{i=1}^{N} \Theta_i C_{P_i} \left[ T_{i} - T_{i0}\right] - \Delta H_{Rx} F_{A0} X = 0 \tag{16}
From problem statement:
Adiabatic: \dot Q = 0
No work: \dot W_s = 0
\Delta C_{P} = C_{P_A} - C_{P_B} = 141 - 141 = 0
Substituting in Equation 16
X_{EB} = \frac { \sum \Theta_i C_{P_i} \left[ T_{i} - T_{0}\right] } {- \Delta H_{Rx}^\circ (T_R) } \tag{17}
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import solve_ivp
from scipy.optimize import fsolve
# Constants
= -40000 # cal/mol
HF_A = -60000 # cal/mol
HF_B
= 50 # cal/mol K
CP_A = 50 # cal/mol K
CP_B
# A <-> B
= CP_B - CP_A
D_CP
= 100000
KE0 = 298 # K
T_KE0
= 1e-3 # 1/h
K0 = 298 # K
T_K0
= 10000 # cal/mol
E = 1.987 # cal/mol K
R
= HF_B - HF_A
DELTAHR
= 300 # K
T0
= lambda T: KE0 * np.exp((DELTAHR/R) * (1/T_KE0 - 1/T))
Ke = lambda T: Ke(T)/(1 + Ke(T))
Xe = lambda T, T0: CP_A * (T - T0)/(-DELTAHR)
Xeb
= lambda T: Xe(T) - Xeb(T, T0)
intersect
= fsolve(intersect, T0)
sol
= sol[0]
T_adiab = Xe( T_adiab ) X_eadiab
Adiabatic equilibrium temperature = 460.40 K.
Adiabatic equilibrium conversion = 0.40.
= T0 + 300
T_final = np.linspace(T0, T_final , 100)
temperatures = Xeb(temperatures, T0)
conv_eb = Xe(temperatures)
conv_eq
="$X_{eb}$")
plt.plot(temperatures,conv_eb, label="$X_{eq}$")
plt.plot(temperatures,conv_eq, label
'Temperature (K)')
plt.xlabel('Conversion')
plt.ylabel(
plt.xlim(T0, T_final)0,1)
plt.ylim(
plt.legend() plt.show()
CSTR Volume
V = \frac{F_{A0} X}{ -r_A } \tag{18}
Calculate temperature corresponding to X = 0.9 Xe
T = T_0 + \frac{ \left( -\Delta H^\circ_{Rx} \right) X_{EB}}{\sum \Theta_i C_{Pi}} \tag{19}
Calculate rate at this temperature using Equation 9 and Equation 10.
= lambda T: K0 * np.exp((E/R) * (1/T_K0 - 1/T))
k
= 5 # dm^3/min
v_0 = 0.9 * X_eadiab
x_cstr
def v_cstr(x, xin, t0, ca0, v_0):
= t0 + (x - xin)*(-DELTAHR)/CP_A
t_cstr = k(t_cstr) * ca0 * (1 - (x/Xe(t_cstr)))
rate = v_0 * ca0 * x/rate
v_cstr return v_cstr,t_cstr
= v_cstr(x_cstr,0,T0,1.0,v_0) V_cstr,T_cstr
For a CSTR to achieve a conversion of 90% of X_e (= 0.36), volume required is 17.57 dm^3. The CSTR operates at 444.36 K.
Interstage Cooling for Highly Exothermic Reactions
What conversion could be achieved in the previous example if two interstage coolers that had the capacity to cool the exit stream to 350 K were available? Also, determine the heat duty of each exchanger for a molar feed rate of A of 40 mol/s. Assume that 95% of the equilibrium conversion is achieved in each reactor. The feed temperature to the first reactor is 300 K.
# Stage 1
= 40.0 # mol/s
fa0
= 0.95 * X_eadiab
x1 = v_cstr(x1,0,T0,1.0,v_0) v_cstr1, t_cstr1
Stage 1: X_{1} = 0.38. V_{CSTR} = 25.69 dm^3. T_{CSTR} = 452.38 K.
Heat Load:
\dot Q - \dot W_s - \sum F_{i} C_{P_i}(T_2 - T_1) = 0 \tag{20}
\dot W_s = 0; C_{P_A} = C_{P_B}
\dot Q = (F_{A} + F_B) C_{P_A}(T_2 - T_1) \tag{21}
= 350
T_ic = fa0 * CP_A * (T_ic - t_cstr1) qdot1
Stage 1 cooling requirement : \dot Q_1 = -204.76 kcal/s.
# Stage 2
# find adiabatic conversion and temperature for second stage
= lambda T: Xe(T) - ( x1 + Xeb(T, T_ic))
intersect
= fsolve(intersect, T0)
sol
= sol[0]
T2_adiab = Xe( T2_adiab )
X2_eadiab
= X2_eadiab * 0.95
x2
= v_cstr(x2,x1,T_ic,1.0,v_0)
v_cstr2, t_cstr2 = fa0 * CP_A * (T_ic - t_cstr2) qdot2
Stage 2: X_{2} = 0.58. T_{adiab,2} = 442.93 K. V_{CSTR,2} = 71.24 dm^3. T_{CSTR,2} = 430.66 K.
Stage 2 cooling requirement : \dot Q_2 = -161.33 kcal/s.
# Stage 3
# find adiabatic conversion and temperature for second stage
= lambda T: Xe(T) - ( x2 + Xeb(T, T_ic))
intersect
= fsolve(intersect, T0)
sol
= sol[0]
T3_adiab = Xe( T3_adiab )
X3_eadiab
= X3_eadiab * 0.95
x3
= v_cstr(x3,x2,T_ic,1.0,v_0)
v_cstr3, t_cstr3 = fa0 * CP_A * (T_ic - t_cstr3) qdot3
Stage 3: X_{3} = 0.74. T_{adiab,3} = 428.03 K. V_{CSTR,3} = 195.40 dm^3. T_{CSTR,3} = 412.47 K.
Stage 3 cooling requirement : \dot Q_3 = -124.95 kcal/s.
Production of Acetic Anhydride
Jeffreys, in a treatment of the design of an acetic anhydride manufacturing facility, states that one of the key steps is the endothermic vapor-phase cracking of acetone to ketene and methane.
The reaction is as follows: \ce{ CH3COCH3 -> CH2CO + CH4}
He states further that this reaction is first-order with respect to acetone and that the specific reaction rate can be expressed by
\ln k = 34.34 - \frac{34,222}{T}
where k is in reciprocal seconds and T is in Kelvin. In this design it is desired to feed 7850 kg of acetone per hour to a tubular reactor. The reactor consists of a bank of 1000 one-inch schedule 40 tubes. We shall consider four cases of heat exchanger operation. The inlet temperature and pressure are the same for all cases at 1035 K and 162 kPa (1.6 atm) and the entering heating-fluid temperature available is 1250 K.
A bank of 1000 one-inch, schedule 40 tubes 1.79 m in length corresponds to 1.0 m³ (0.001 m³/tube = 1.0 dm³/tube) and gives 20% conversion. Ketene is unstable and tends to explode, which is a good reason to keep the conversion low. However, the pipe material and schedule size should be checked to learn if they are suitable for these temperatures and pressures. The heat-exchange fluid has a flow rate, \dot{m}_c, of 0.111 mol/s, with a heat capacity of 34.5 J/mol·K.
The cases are as follows:
- Case 1: The reactor is operated adiabatically.
- Case 2: Constant heat-exchange fluid temperature T_a = 1250 K.
- Case 3: Co-current heat exchange with T_{a0} = 1250 K.
- Case 4: Countercurrent heat exchange with T_{a0} = 1250 K.
Additional information:
- For acetone (A): \Delta H^{\circ}_{A}(T_R) = -216.67 kJ/mol, C_{p,A} = 163 J/mol·K
- For ketene (B): \Delta H^{\circ}_{B}(T_R) = -61.09 kJ/mol, C_{p,B} = 83 J/mol·K
- For methane (C): \Delta H^{\circ}_{C}(T_R) = -74.81 kJ/mol, C_{p,C} = 71 J/mol·K
The overall heat transfer coefficient Ua = 110 J/s \cdot m^3 \cdot K.
Reaction: \ce {A -> B + C}
- Mole balance
\frac{dX}{dV} = -\frac{r_A}{F_{A0}}
- Rate law
-r_A = k C_A
Stoichiometry C_A = \frac{ C_{A0} (1 - X) }{ (1 + \epsilon X) } \frac{ T_0 }{ T }
Energy balance
Reactor balance
\frac{dT}{dV} = \frac{ U a (T_a - T) + r_A \left[ \Delta H_{Rx}^\circ+ \Delta C_P (T - T_R)\right] }{ F_{A0} \left( \sum \Theta_i C_{P_i} + X \Delta C_P \right) }
Heat exchanger
\frac{dT_a}{dV} = \frac{ U a (T - T_a) }{ \dot m_C C_{P_C} }
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import solve_ivp
# Constants
= 8.314 # J/mol K
R = 298 # K
TR # Components: 1: A(acetone), 2: B(ketene), 3: C(methane)
= np.array ([-216.67, -61.09, -74.81])*1000 # J/mol
HF = np.array ([163.0, 83.0, 71.0]) # J/mol K
CP = np.array ([58.0, 42.0, 20.0]) # g/mol
MW
= lambda t: np.exp( 34.34 - 34222/t )
k # k = lambda t: 3.58 * np.exp( 34222 * (1/1035 - 1/t))
def pfr (v, x, *args):
= x
X, T, Ta = args
(fa0, ca0, T0, epsilon, delta_hr_tr, delta_cp, theta, UA, mc, cpc)
= ca0 * (( 1 - X ) / ( 1 + epsilon * X )) * (T0/T)
ca = k(T) * ca # -r_A
rate = delta_hr_tr + delta_cp * (T - TR)
delta_h
= rate/fa0
dxdv = (UA * ( Ta - T ) + (-rate * delta_h))/( fa0 * ( np.sum(theta * CP) + X * delta_cp) )
dtdv = UA * ( T - Ta )/ (mc * cpc)
dtadv
return [dxdv, dtdv, dtadv]
# Data
= np.array ([-1.0, 1.0, 1.0]) # stoichiometric coefficients
nu
= 7850 # kg/h
f0 = 1035.0 # K
T0 = 162.0e3 # Pa
P0
= 1000
n_tubes = 26.64e-3 # 1" schedule 40 pipe inner diameter mm
d_tube = 1250 # K
Ta0 = 4/d_tube
a = 110.0 # J/s m^3 K
U = U * a
UA
= 0.111 # mol/s
mc = 34.5 # J/mol K
cpc
# inlet mole fraction
= np.array ([1.0, 0.0, 0.0])
y0 = np.array([1.0, 0.0, 0.0])
theta
= (f0 / ( y0[0] * MW[0])) / n_tubes # kmol/h
fa0 = fa0 * (1000/3600) # mol/s
fa0
= y0[0] * P0
pa0 = pa0/(R * T0)
ca0 = fa0/ca0
v_0 = y0[0]
ya0
# Heat of reaction at 298K
= np.sum(HF * nu)
delta_hr_tr = np.sum(CP * nu)
delta_cp
= ya0 * np.sum(nu) epsilon
Parameter values | ||
---|---|---|
\Delta H^\circ_{Rx} (T_R) = 80770.00 J/mol | \Delta C_P = -9.00 J/mol\ K | T_0 = 1035.00 K |
F_{A0} = 3.76e-02 mol/s | C_{A0} = 18.83 mol/m^3 | T_R = 298.00 K |
C_{P_A} = 163.00 J/mol\ K | Ua = 16516.52 J/m^3\ s\ K | \dot m_C = 0.11 mol/s |
C_{P_C} = 34.50 J/mol\ K | V_f = 0.001 m^3 |
= (fa0, ca0, T0, epsilon, delta_hr_tr, delta_cp, theta, 0, mc, cpc)
args
= np.array([0, T0, Ta0])
initial_conditions = 0.005
v_final
= solve_ivp(pfr, [0, v_final], initial_conditions, args=args, dense_output=True)
sol = np.linspace(0,v_final, 1000)
v = sol.sol(v)[0]
x = sol.sol(v)[1]
T = sol.sol(v)[2]
Ta
= plt.subplots()
fig, ax1
# Plot x on the original y-axis
= ax1.plot(v, x, color='#105e5d', label='X')
plt_x 'volume ($m^3$)')
ax1.set_xlabel('Conversion')
ax1.set_ylabel(0,v[-1])
ax1.set_xlim(0,)
ax1.set_ylim(
# Create a second y-axis for T and Ta
= ax1.twinx()
ax2 = ax2.plot(v, T, label='T')
plt_t # plt_ta = ax2.plot(v, Ta, label='Ta')
'Temperature (K)')
ax2.set_ylabel(
0,v[-1])
ax2.set_xlim(=T0)
ax2.set_ylim(top
= dict(arrowstyle="<-,head_length=0.7,head_width=0.25",
arrow_properties ="black")
color
'', xy=(v[100],x[100]), xytext=(v[0], x[100]),arrowprops=dict(arrowstyle="<-"))
ax1.annotate('', xy=(v[100],T[100]), xytext=(v[200], T[100]),arrowprops=dict(arrowstyle="<-"))
ax2.annotate(
# fig.tight_layout()
= [], []
handles, labels for ax in [ax1, ax2]:
for handle, label in zip(*ax.get_legend_handles_labels()):
handles.append(handle)
labels.append(label)
plt.legend(handles, labels) plt.show()
def pfr_const_heatex_fluid_T (v, x, *args):
= x
X, T, Ta = args
(fa0, ca0, T0, epsilon, delta_hr_tr, delta_cp, theta, UA, mc, cpc)
= ca0 * (( 1 - X ) / ( 1 + epsilon * X )) * (T0/T)
ca = k(T) * ca # -r_A
rate = delta_hr_tr + delta_cp * (T - TR)
delta_h
= rate/fa0
dxdv = (UA * ( Ta - T ) + (-rate * delta_h))/( fa0 * ( np.sum(theta * CP) + X * delta_cp) )
dtdv = 0.0
dtadv
return [dxdv, dtdv, dtadv]
= (fa0, ca0, T0, epsilon, delta_hr_tr, delta_cp, theta, UA, mc, cpc)
args
= np.array([0, T0, Ta0])
initial_conditions = 0.001
v_final
= solve_ivp(pfr_const_heatex_fluid_T, [0, v_final], initial_conditions, args=args, dense_output=True)
sol = np.linspace(0,v_final, 1000)
v = sol.sol(v)[0]
x = sol.sol(v)[1]
T = sol.sol(v)[2]
Ta
= plt.subplots()
fig, ax1
# Plot x on the original y-axis
= ax1.plot(v, x, color='#105e5d', label='X')
plt_x 'volume ($m^3$)')
ax1.set_xlabel('Conversion')
ax1.set_ylabel(0,v[-1])
ax1.set_xlim(0,)
ax1.set_ylim(
# Create a second y-axis for T and Ta
= ax1.twinx()
ax2 = ax2.plot(v, T, label='T')
plt_t # plt_ta = ax2.plot(v, Ta, label='Ta')
'Temperature (K)')
ax2.set_ylabel(
0,v[-1])
ax2.set_xlim(
= dict(arrowstyle="<-,head_length=0.7,head_width=0.25",
arrow_properties ="black")
color
'', xy=(v[100],x[100]), xytext=(v[0], x[100]),arrowprops=dict(arrowstyle="<-"))
ax1.annotate('', xy=(v[100],T[100]), xytext=(v[200], T[100]),arrowprops=dict(arrowstyle="<-"))
ax2.annotate(
# fig.tight_layout()
= [], []
handles, labels for ax in [ax1, ax2]:
for handle, label in zip(*ax.get_legend_handles_labels()):
handles.append(handle)
labels.append(label)
plt.legend(handles, labels) plt.show()
= (fa0, ca0, T0, epsilon, delta_hr_tr, delta_cp, theta, UA, mc, cpc)
args
= np.array([0, T0, Ta0])
initial_conditions = 0.001
v_final
= solve_ivp(pfr, [0, v_final], initial_conditions, args=args, dense_output=True)
sol = np.linspace(0,v_final, 1000)
v = sol.sol(v)[0]
x = sol.sol(v)[1]
T = sol.sol(v)[2]
Ta
= plt.subplots()
fig, ax1
# Plot x on the original y-axis
= ax1.plot(v, x, color='#105e5d', label='X')
plt_x 'volume ($m^3$)')
ax1.set_xlabel('Conversion')
ax1.set_ylabel(0,v[-1])
ax1.set_xlim(0,)
ax1.set_ylim(
# Create a second y-axis for T and Ta
= ax1.twinx()
ax2 = ax2.plot(v, T, label='T')
plt_t = ax2.plot(v, Ta, label='Ta')
plt_ta 'Temperature (K)')
ax2.set_ylabel(
0,v[-1])
ax2.set_xlim(=Ta0)
ax2.set_ylim(top
= dict(arrowstyle="<-,head_length=0.7,head_width=0.25",
arrow_properties ="black")
color
'', xy=(v[100],x[100]), xytext=(v[0], x[100]),arrowprops=dict(arrowstyle="<-"))
ax1.annotate('', xy=(v[100],T[100]), xytext=(v[200], T[100]),arrowprops=dict(arrowstyle="<-"))
ax2.annotate('', xy=(v[100],Ta[100]), xytext=(v[200], Ta[100]),arrowprops=dict(arrowstyle="<-"))
ax2.annotate(
# fig.tight_layout()
= [], []
handles, labels for ax in [ax1, ax2]:
for handle, label in zip(*ax.get_legend_handles_labels()):
handles.append(handle)
labels.append(label)
plt.legend(handles, labels) plt.show()
def pfr_countercurrent_exchange (v, x, *args):
= x
X, T, Ta = args
(fa0, ca0, T0, epsilon, delta_hr_tr, delta_cp, theta, UA, mc, cpc)
= ca0 * (( 1 - X ) / ( 1 + epsilon * X )) * (T0/T)
ca = k(T) * ca # -r_A
rate = delta_hr_tr + delta_cp * (T - TR)
delta_h
= rate/fa0
dxdv = (UA * ( Ta - T ) + (-rate * delta_h))/( fa0 * ( np.sum(theta * CP) + X * delta_cp) )
dtdv = - UA * ( T - Ta )/ (mc * cpc)
dtadv
return [dxdv, dtdv, dtadv]
= 0.001
v_final
# This temperature needs to be guessed for Ta to be 1250 at V = V_final
= 995.15
Ta0
= (fa0, ca0, T0, epsilon, delta_hr_tr, delta_cp, theta, UA, mc, cpc)
args
= np.array([0, T0, Ta0])
initial_conditions
= solve_ivp(pfr_countercurrent_exchange, [0, v_final], initial_conditions, args=args, dense_output=True)
sol = np.linspace(0,v_final, 1000)
v = sol.sol(v)[0]
x = sol.sol(v)[1]
T = sol.sol(v)[2]
Ta
= plt.subplots()
fig, ax1
# Plot x on the original y-axis
= ax1.plot(v, x, color='#105e5d', label='X')
plt_x 'volume ($m^3$)')
ax1.set_xlabel('Conversion')
ax1.set_ylabel(0,v[-1])
ax1.set_xlim(0,)
ax1.set_ylim(
# Create a second y-axis for T and Ta
= ax1.twinx()
ax2 = ax2.plot(v, T, label='T')
plt_t = ax2.plot(v, Ta, label='Ta')
plt_ta 'Temperature (K)')
ax2.set_ylabel(
0,v[-1])
ax2.set_xlim(
= dict(arrowstyle="<-,head_length=0.7,head_width=0.25",
arrow_properties ="black")
color
'', xy=(v[200],x[200]), xytext=(v[100], x[200]),arrowprops=dict(arrowstyle="<-"))
ax1.annotate('', xy=(v[100],T[100]), xytext=(v[200], T[100]),arrowprops=dict(arrowstyle="<-"))
ax2.annotate('', xy=(v[400],Ta[400]), xytext=(v[500], Ta[400]),arrowprops=dict(arrowstyle="<-"))
ax2.annotate(
# fig.tight_layout()
= [], []
handles, labels for ax in [ax1, ax2]:
for handle, label in zip(*ax.get_legend_handles_labels()):
handles.append(handle)
labels.append(label)
plt.legend(handles, labels) plt.show()
References
Citation
@online{utikar2024,
author = {Utikar, Ranjeet},
title = {In Class Activity: {Non-isothermal} Reactor Design},
date = {2024-04-01},
url = {https://cre.smilelab.dev//content/notes/07-non-isothermal-reactor-design/in-class-activities.html},
langid = {en}
}