#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 = { 'Xg': [], 'covs': [], 'co_conv': [], 'co_conv_eq': [], 'tau': [], 'qf': [], 'qb': [] }
#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, atol=1e-08, rtol=1e-06, grid=7, max_steps=1000, solver_type='dae') #Solve the PFR sim.solve() #Gas molar fractions, temperature and pressure along the reactor zcoord = sim.z * 1e03 covs = sim.coverages Xg = sim.X Pg = sim.P uz = sim.u rho = sim.rho rt = sim.rtime mdot = sim.mdot
#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) #Create a ReactorSolver object sim = pfr.ReactorSolver(r, tcovs=1e5, atol=1e-09, rtol=1e-07, grid=300, solver_type='dae') #Set up equilibrium gas phase gas_eq = ct.Solution(input_file) #Create lists to store results at each temperature output = [] neff = [] X_eq = [] #Loop over temperature range for temp in Trange: #Current inlet temperature
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 Pg = sim.P Tg = sim.T Xg = sim.X uz = sim.u rho = sim.rho #Axial coordinates zcoord = sim.z
#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, solver_type='dae') sim = pfr.ReactorSolver(r, tcovs=1e03, atol=1e-12, rtol=1e-07, grid=100, max_steps=5000, solver_type='dae') #Ethanol index co_idx = r.gas.species_index('CO')
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, atol=1e-14, rtol=1e-06, grid=300, tcovs=1e04, solver_type='dae') #Solve the PFR sim.solve() #Gas results zcoord = sim.z covs = sim.coverages Xg = sim.X #Print time elapsed print('It took {0:0.8f} seconds'.format(time.time() - start)) vis = 1
surf, cat_area_pvol=cat_area_pvol, int_mt=2, thickness=wc.thickness, pore_diam=wc.pore_diam, epsilon=wc.epsilon, tortuosity=wc.tortuosity, gas_wc=gas_wc, surf_wc=surf_wc, ngrid=15, stch=1.1) #Create a ReactorSolver object sim0 = pfr.ReactorSolver(r0, tcovs=1e05, atol=1e-10, rtol=1e-07, grid=200, solver_type='dae') sim = pfr.ReactorSolver(r, tcovs=1e05, atol=1e-10, rtol=1e-05, grid=200, solver_type='dae') #CO index co_idx = gas.species_index('CO') #Create lists to store results at each temperature output0 = []
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, atol=1e-14, rtol=1e-06, grid=300, tcovs=1e04, solver_type='dae', implementation='assimulo') #Solve the PFR sim.solve() #Gas results zcoord = sim.z covs = sim.coverages Xg = sim.X #Print time elapsed print('It took {0:0.8f} seconds'.format(time.time() - start))
#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, max_steps=1000, solver_type='dae') #Solve the PFR sim1.solve() #Gas molar fractions, temperature and pressure along the reactor covs1 = sim1.coverages Yg1 = sim1.Y uz1 = sim1.u rho1 = sim1.rho #Axial coordinates [cm] zcoord = sim1.z * 1e02
vdot_in = np.geomspace(20, 1.0, 15) #Inlet mass flow rate [kg/s] at variable SLPM mdot_in = list(vdot_in * 1.66667e-5 * gas_in.density) #Initialize reactor r = pfr.PlugFlowReactor(gas, energy=0, z_out=0.004, diam=0.01) #Initialize the reacting wall rs = pfr.ReactingSurface(r, surf, bulk=[bulk], cat_area_pvol=30) #Create a ReactorSolver object sim = pfr.ReactorSolver(r, tcovs=1e02, atol=1e-14, rtol=1e-07, grid=300, max_steps=5000, solver_type='dae') #CO index et_idx = r.gas.species_index('CH3CH2OH') #Create lists to store results at each temperature X = [] C = [] covs = [] et_conv = [] #Loop over temperature range for m in mdot_in:
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, solver_type = 'ode') #Solve the PFR sim.solve() #Gas molar fractions, temperature and pressure along the reactor Pg = sim.P Tg = sim.T Xg = sim.X #Axial coordinates zcoord = sim.z #Print time elapsed
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, max_steps=1000, solver_type='dae', implementation='assimulo') #Solve the PFR sim1.solve() #Gas molar fractions, temperature and pressure along the reactor covs1 = sim1.coverages Yg1 = sim1.Y uz1 = sim1.u rho1 = sim1.rho #Axial coordinates [cm] zcoord = sim1.z * 1e02
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, max_steps=1000, solver_type='dae', implementation='assimulo') #Solve the PFR sim.solve() #Gas molar fractions, temperature and pressure along the reactor zcoord = sim.z * 1e03 covs = sim.coverages Xg = sim.X Tg = sim.T uz = sim.u rho = sim.rho mdot = sim.mdot
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, max_steps = 1000, solver_type = 'dae') #Solve the PFR sim.solve() #Gas molar fractions, temperature and pressure along the reactor zcoord = sim.z*1e03 covs = sim.coverages Xg = sim.X Tg = sim.T uz = sim.u rho = sim.rho mdot = sim.mdot