methane partial oxidation

43 views
Skip to first unread message

Archanaa Raghavan

unread,
Jun 1, 2024, 5:26:27 AMJun 1
to Cantera Users' Group
Dear all
I'm trying to simulate methane partial oxidation in a PFR .
Feed details
flow rate : 280 sccm
feed: 'CH4': 0.0714, 'O2': 0.0714, 'Ar': 0.8571
initial temperature: 893
Reactor details
Length - 0.7 meter, ID - 6 mm
Below is the code snippet I'm using. The issue is simulation is happening only till
0.019 meters of the reactor (PFA the plot for temperature and methane cosumption). I'm not
able to figure out why the entire reactor length is not covered. kindly help me to solve this
issue

import cantera as ct

import numpy as np

import matplotlib.pyplot as plt


#######################################################################

# Input Parameters

#######################################################################


# Define input conditions

flow_rate_sccm = 280 # SCCM

pressure = 6 * 101325 # 6 bar in Pa

T_0 = 893 # Standard temperature in K


# Mechanism file (using first mechanism as example to get mean molecular weight)

gas1 = ct.Solution('gri30.cti')


# Convert SCCM to kg/s

flow_rate_m3s = flow_rate_sccm * 1e-6 / 60 # SCCM to m³/s

# flow_rate_kgs = flow_rate_m3s * gas1.density


# Set initial mole fractions

X_initial = {'CH4': 0.0714, 'O2': 0.0714, 'Ar': 0.8571}


# Reactor dimensions

length = 0.7 # 70 cm in meters

diameter = 6e-3 # 6 mm in meters

area = np.pi * (diameter / 2) ** 2


# Resolution: The PFR will be simulated by 'n_steps' time steps or by a chain of 'n_steps' stirred reactors.

n_steps = 200


#####################################################################

# Import the gas model and set the initial conditions


gas1.TPX = T_0, pressure, X_initial

u_0 = flow_rate_m3s / area


# Create a new reactor

r1 = ct.IdealGasConstPressureReactor(gas1)

# Create a reactor network for performing time integration

sim1 = ct.ReactorNet([r1])

#

# Approximate a time step to achieve a similar resolution as in the next method

t_total = length / u_0

print(t_total)

dt = t_total / n_steps

print(dt)




t1 = (np.arange(n_steps) + 1) * dt

print(t1)

z1 = np.zeros_like(t1)

u1 = np.zeros_like(t1)

states1 = ct.SolutionArray(r1.thermo)



for n1, t_i in enumerate(t1):

# Perform time integration

sim1.advance(t_i)

# Compute velocity and transform into space

u1[n1] = flow_rate_kgs / area / r1.thermo.density

z1[n1] = z1[n1 - 1] + u1[n1] * dt if n1 > 0 else u1[n1] * dt

states1.append(r1.thermo.state)


#####################################################################

# Compare Results in matplotlib

#####################################################################


Plot Temperature along reactor length

plt.figure()

plt.plot(z1, states1.T, label='Temperature')

plt.xlabel('Reactor Length (m)')

plt.ylabel('Temperature (K)')

plt.legend()

plt.savefig('pfr_T_z.png')

plt.show()


# Plot Methane (CH4) Mole Fraction along reactor length

plt.figure()

plt.plot(z1, states1.X[:, gas1.species_index('CH4')], label='CH4 Mole Fraction')

plt.xlabel('Reactor Length (m)')

plt.ylabel('CH4 Mole Fraction')

plt.legend()

plt.savefig('pfr_XCH4_z.png')

plt.show()


# Plot Oxygen (O2) Mole Fraction along reactor length

plt.figure()

plt.plot(z1, states1.X[:, gas1.species_index('O2')], label='O2 Mole Fraction')

plt.xlabel('Reactor Length (m)')

plt.ylabel('O2 Mole Fraction')

plt.legend()

plt.savefig('pfr_XO2_z.png')

plt.show()


# Plot Acetylene (C2H2) Mole Fraction along reactor length

plt.figure()

plt.plot(z1, states1.X[:, gas1.species_index('C2H2')], label='C2H2 Mole Fraction')

plt.xlabel('Reactor Length (m)')

plt.ylabel('C2H2 Mole Fraction')

plt.legend()

plt.savefig('pfr_XC2H2_z.png')

plt.show()


# Plot Hydrogen (H2) Mole Fraction along reactor length

plt.figure()

plt.plot(z1, states1.X[:, gas1.species_index('H2')], label='H2 Mole Fraction')

plt.xlabel('Reactor Length (m)')

plt.ylabel('H2 Mole Fraction')

plt.legend()

plt.savefig('pfr_XH2_z.png')

plt.show()


# Plot Carbon Monoxide (CO) Mole Fraction along reactor length

plt.figure()

plt.plot(z1, states1.X[:, gas1.species_index('CO')], label='CO Mole Fraction')

plt.xlabel('Reactor Length (m)')

plt.ylabel('CO Mole Fraction')

plt.legend()

plt.savefig('pfr_XCO_z.png')

plt.show()


# Plot Carbon Dioxide (CO2) Mole Fraction along reactor length

plt.figure()

plt.plot(z1, states1.X[:, gas1.species_index('CO2')], label='CO2 Mole Fraction')

plt.xlabel('Reactor Length (m)')

plt.ylabel('CO2 Mole Fraction')

plt.legend()

plt.savefig('pfr_XCO2_z.png')

plt.show()



Thanks and regards

Archanaa

Figure_2.png
Figure_1.png

Ray Speth

unread,
Jun 10, 2024, 10:45:58 PMJun 10
to Cantera Users' Group
Hi Archanaa,

I think there are a couple of problems in how you're handling the mass and volumetric flow rates. To calculate the mass flow rate, you need to set the mixture to your inlet composition at the "standard" pressure and temperature used for defining SCCM (presumably, 1 atm and 273.15 K) and take that density times the standard volumetric flow rate. To calculate the actual initial volumetric flow rate, you should then divide this mass flow rate by the density at your inlet temperature and pressure. The initial velocity (u_0) needs to be calculated based on this flow rate.

Regards,
Ray
Reply all
Reply to author
Forward
0 new messages