gas_eq = ct.Solution(input_file) #Load gas phase at inlet conditions gas_in = ct.Solution(input_file) gas_in.TPX = 273.15, 1e05, X_in #Inlet mass flow rate [kg/s] at 3 SLPM mdot0 = 3 * 1.66667e-5 * gas_in.density #Temperature range to simulate Trange = [T_in] Trange = list(np.linspace(273.15 + 300, 273.15 + 700, 50)) #u_in = np.geomspace(1,1e05,len(Trange))*1.0 #Initialize reactor r = pfr.PlugFlowReactor(gas, z_out=0.01, diam=0.01520) #Initialize reacting wall rs = pfr.ReactingSurface(r, surf, cat_area_pvol=1.75e04) #Create a ReactorSolver object sim = pfr.ReactorSolver(r, tcovs=1e03, atol=1e-10, rtol=1e-06, grid=250, max_steps=5000, solver_type='dae') #Create dict to store results at each temperature temp = {
length = 0.6 #Axial length [m] tube_d = 0.0508 #Reactor diameter [m] carea = np.pi / 4 * tube_d**2 #Reactor cross-sectional area [m**2] #Wall area [m**2] wallarea = np.pi * tube_d * length #Catalytic area per volume [m**-] cat_area_pvol = wallarea / (length * carea) #Volumetric flow [m**3/s] vdot_in = 0.02337 u_in = vdot_in / carea #Initialize reactor r = pfr.PlugFlowReactor(gas, momentum=1, z_out=length, diam=tube_d) #Initialize the reacting wall rs = pfr.ReactingSurface(r, surf, bulk=[bulk_n, bulk_si], cat_area_pvol=cat_area_pvol) #Set inlet thermo state r.TPX = T_in, P_in, X_in #Set inlet mass flow rate [kg/s] r.u = u_in #Create a ReactorSolver object sim = pfr.ReactorSolver(r,
carea = np.pi * 0.0195**2 / 4 #Total inlet mass flow rate [kg/s] at 5 SLPM mdot_tot = 5 * 1.66667e-5 * gas_in.density #Monolith properties: dcell = 1e-03 #Monolith cell size [m] porosity = 0.7 #Monolith porosity [-] sv = 4 * porosity / dcell #Monolith specific surface [m**-1] #Initialize reactor r = pfr.PlugFlowReactor(gas, energy=1, momentum=0, z_out=0.01, diam=0.0195, support_type='honeycomb', sp_area=sv, porosity=0.7, dc=1e-03, ext_mt=0) #Initialize the reacting wall rs = pfr.ReactingSurface(r, surf, cat_area_pvol=sv * 8.5, int_mt=1, lim_species=wc_spc, thickness=4e-05, pore_diam=2.5e-08, epsilon=0.3, tortuosity=5)
#Inlet gas solution object gas_in = ct.Solution(input_file) gas_in.TPX = 273.15, 1e05, X_in #Inlet mass flow rate [kg/s] at 3 SLPM mdot0 = 3 * 1.66667e-5 * gas_in.density #Temperature range to simulate Trange = [T_in] Trange = list(np.linspace(273.15 + 300, 273.15 + 700, 30)) #Catalytic area per volume [m**-1] cat_area = 1.75e04 #Initialize reactors r0 = pfr.PlugFlowReactor(gas0, energy=0, z_out=0.01, diam=0.01520) r = pfr.PlugFlowReactor(gas, energy=0, z_out=0.01, diam=0.01520) #Initialize the reacting wall rs0 = pfr.ReactingSurface(r0, surf0, cat_area_pvol=cat_area) rs = pfr.ReactingSurface(r, surf, cat_area_pvol=cat_area) #Create a ReactorSolver object sim0 = pfr.ReactorSolver(r0, tcovs=1e03, atol=1e-12, rtol=1e-07, grid=100, max_steps=5000,
T_in = 668 P_in = 101325.0 #Inlet gas solution object gas_in = ct.Solution(input_file) gas_in.TPX = 273.15, 1e05, X_in #Inlet mass flow rate [kg/s] at 0.12 SLPM mdot0 = 0.12 * 1.66667e-5 * gas_in.density #temperature range to simulate Trange = [T_in] Trange = np.linspace(273.15 + 300, 273.15 + 400, 10) #Initialize reactor r = pfr.PlugFlowReactor(gas, energy=0, z_out=0.01, diam=0.012) #Initialize the reacting wall rs = pfr.ReactingSurface(r, surf, bulk=[bulk], cat_area_pvol=7e04) #Create a ReactorSolver object sim = pfr.ReactorSolver(r, tcovs=1e03, atol=1e-14, rtol=1e-06, grid=300, max_steps=5000, solver_type='dae') #Ethanol index et_idx = r.gas.species_index('CH3CH2OH')
#Channel cross-sectional area [m**2] carea_c = np.pi * dcell**2 / 4 #Total inlet mass flow rate [kg/s] at 5 SLPM mdot_tot = 5 * 1.66667e-5 * gas_in.density #Single channel inlet mass flow rate [kg/s] mdot0 = mdot_tot * carea_c / carea #Initialize reactor r0 = pfr.PlugFlowReactor( gas, energy=1, z_out=length, diam=dcell, support_type='honeycomb', porosity=1.0, #Simulates a clear channel dc=dcell, ext_mt=0) r = pfr.PlugFlowReactor( gas, energy=1, z_out=length, diam=dcell, support_type='honeycomb', porosity=1.0, #Simulates a clear channel dc=dcell, ext_mt=0)
import time start = time.time() #### Input mechanism data ####: input_file = 'diesel_surrogate_reduced_mech.cti' #### Current thermo state ####: X_in = {'C12H24-1': 1.0, 'O2': 18 / 1.576} T_in = 680 P_in = 9.718e06 #Load Cantera solution objects gas = ct.Solution(input_file) #Initialize reactor r = pfr.PlugFlowReactor(gas, energy=1, momentum=0, z_out=2, diam=1.25) #Reactor current thermo state r.TPX = T_in, P_in, X_in #Set reactor mass flow rate [kg/s] r.mdot = 271.4 #Create a ReactorSolver object sim = pfr.ReactorSolver(r, atol=1e-08, rtol=1e-06, grid=80000, max_steps=1000) #Solve the reactor sim.solve() #Gas molar fractions, temperature and pressure along the reactor mdot = sim.mdot
#Monolith cross-sectional area [m**2] Ac = np.pi / 4.0 * 0.019**2 #Total volumetric flow rate is 4 SLPM vdot_in = 4.0 * 1.66667e-5 #[m**3/s] u_in = vdot_in / Ac #Catalytic active area per reactor volume [m**-1] cat_area_pvol = 3.5e02 #Initialize reactor r = pfr.PlugFlowReactor(gas, z_out=0.001, diam=d_channel, support_type='foam', sp_area=3e03, dc=1e-04, porosity=0.8, ext_mt=1) #Initialize the reacting wall rs = pfr.ReactingSurface(r, surf, cat_area_pvol=cat_area_pvol) #Set inlet thermo state r.TPX = T_in, P_in, X_in #Set inlet velocity [m/s] r.u = u_in #Create a ReactorSolver object sim = pfr.ReactorSolver(r,
u_in_600 = 5 #Inlet gas properties @600 K gas_600 = ct.Solution(input_file) gas_600.TPX = 600, P_in, X_in gas_600.transport_model = 'Mix' #Compute inlet mass flow rate @600 K vdot_in = carea * u_in_600 #Volumetric flow rate [m**3/s] mdot_in = vdot_in * gas_600.density #Mass flow rate [kg/s] #Compute Reynolds number (at inlet conditions) Re = gas_600.density * u_in_600 * tube_d / gas_600.viscosity #Initialize reactor r1 = pfr.PlugFlowReactor(gas, z_in=0.01, z_out=0.1, diam=tube_d) #Initialize the reacting wall rwall1 = pfr.ReactingSurface(r1, surf, cat_area_pvol=cat_area_pvol) #Set inlet thermo state r1.TPX = T_in, P_in, X_in #Set inlet mass flow rate [kg/s] r1.mdot = mdot_in #Create a ReactorSolver object sim1 = pfr.ReactorSolver(r1, atol=1e-10, rtol=1e-08, grid=300,
#### Current thermo state ####: X_in = 'C2H5OH:0.0565, O2:0.02786, N2:0.96649' T_in = 1100.0 P_in = 101325.0 #Load Cantera solution objects gas = ct.Solution(input_file) #Reactor parameters: carea = 1e-04 tube_d = np.sqrt(4*carea/np.pi) #Initialize reactor r = pfr.PlugFlowReactor(gas, energy = 1, momentum = 0, z_out = 0.01, diam = tube_d) #Reactor current thermo state r.TPX = T_in, P_in, X_in #Set reactor inlet flow velocity [m/s] r.u = 0.167 #Create a ReactorSolver object sim = pfr.ReactorSolver(r, atol = 1e-15, rtol = 1e-08, grid = 300, max_steps = 1000,
#Load gas phase at inlet conditions gas_in = ct.Solution(input_file) gas_in.TPX = 273.15, 1e05, X_in #Inlet mass flow rate [kg/s] at 3 SLPM mdot0 = 3 * 1.66667e-5 * gas_in.density #Temperature range to simulate Trange = [T_in] #Trange = list(np.linspace(273.15+300,273.15+700,30)) #Initialize reactor r0 = pfr.PlugFlowReactor(gas, z_out=length, diam=diam, sp_area=sv, support_type='foam', porosity=porosity, dc=ds_foam, ext_mt=0) r = pfr.PlugFlowReactor(gas, z_out=length, diam=diam, sp_area=sv, support_type='foam', porosity=porosity, dc=ds_foam, ext_mt=0) #Initialize reacting wall rs0 = pfr.ReactingSurface(r0,
#Load phases solution objects gas = ct.Solution(input_file) surf = ct.Interface(input_file, surf_name, [gas]) #### Inlet thermo state ####: T_in = 773.15 #Inlet temperature [K] P_in = 101325.0 #Inlet molar composition: X_in = {'CH4': 1, 'O2': 1.5, 'AR': 5} #Reactor diameter [m]: tube_d = np.sqrt(4 * 1e-04 / np.pi) carea = np.pi * tube_d**2 / 4 #Initialize reactor r = pfr.PlugFlowReactor(gas, energy=1, z_out=0.001, diam=tube_d) #Initialize the reacting wall rs = pfr.ReactingSurface(r, surf, cat_area_pvol=355) #Set inlet thermo state r.TPX = T_in, P_in, X_in #Set inlet velocity [m/s] r.u = 0.005 #Create a ReactorSolver object sim = pfr.ReactorSolver(r, atol=1e-15, rtol=1e-05, grid=1000,