You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The FlowReactor can produce output that does not satisfy the constraint that $\sum Y_k = 1$ when the last species in the mechanism has a non-zero net rate of production from surface reactions. It's a little surprising that the last gas phase species is special here. While there is special handling of the last surface phase species for each attached surface related to this constraint, since the coverages are algebraic variables, there is no corresponding treatment for the gas, where the variables are differential.
Steps to reproduce
Run the following simplification / modification of the surf_pfr.py example, which swaps the last two gas phase species (CO2 and AR).
importcanteraasctcm=0.01minute=60.0T0=1073.0length=0.3*cm# Catalyst bed lengtharea=1.0*cm**2# Catalyst bed areacat_area_per_vol=1000.0/cm# Catalyst particle surface area per unit volumevelocity=40.0*cm/minute# gas velocityporosity=0.3# Catalyst bed porositygas_def="""phases: - name: gas thermo: ideal-gas elements: [O, H, C, N, Ar] species: [{methane_pox_on_pt.yaml/species: [H2, O2, H2O, CH4, CO, AR, CO2]}] skip-undeclared-elements: true state: T: 300.0 P: 1.01325e+05 X: {CH4: 0.095, O2: 0.21}"""gas=ct.Solution(yaml=gas_def)
surf=ct.Interface('methane_pox_on_pt.yaml', 'Pt_surf', adjacent=[gas])
surf.TP=T0, ct.one_atmgas.TPX=T0, ct.one_atm, 'CH4:1, O2:1.5, H2:0.1, CO2:0.5'# create a new reactorr=ct.FlowReactor(gas)
r.area=arear.surface_area_to_volume_ratio=cat_area_per_vol*porosityr.mass_flow_rate=velocity*gas.density*area*porosityr.energy_enabled=False# Add the reacting surface to the reactorrsurf=ct.ReactorSurface(surf, r)
sim=ct.ReactorNet([r])
n=0print(' distance Y_CH4 Y_H2 Y_CO Y_CO2 sum(Y)')
print(' {:10f} {:10f} {:10f} {:10f} {:10f} {:10f}'.format(
0, *r.thermo['CH4', 'H2', 'CO', 'CO2'].Y, sum(r.thermo.Y)))
whilesim.distance<length:
dist=sim.distance*1e3# convert to mmsim.step()
ifn%500==0or (dist>1andn%20==0):
print(' {:10f} {:10f} {:10f} {:10f} {:10f} {:10f}'.format(
dist, *r.thermo['CH4', 'H2', 'CO', 'CO2'].Y, sum(r.thermo.Y)))
n+=1
Problem description
The$\sum Y_k = 1$ when the last species in the mechanism has a non-zero net rate of production from surface reactions. It's a little surprising that the last gas phase species is special here. While there is special handling of the last surface phase species for each attached surface related to this constraint, since the coverages are algebraic variables, there is no corresponding treatment for the gas, where the variables are differential.
FlowReactor
can produce output that does not satisfy the constraint thatSteps to reproduce
Run the following simplification / modification of the
surf_pfr.py
example, which swaps the last two gas phase species (CO2 and AR).Behavior
The above code outputs the following:
Modifying the species definition to be:
instead produces output that satisfies the$\sum Y_k = 1$ constraint:
System information
Additional context
Based on an issue posted in the Cantera Users' Group.
The text was updated successfully, but these errors were encountered: