Project

Handling Mixtures with Cantera

  1. In Adiabatic conditions for complete burning of one mole of methane(CH4) need two moles of oxygen(O2). The one mole of air contains 0.21 moles of oxygen as per the adiabatic condition the 2/0.21 of moles of air should participate in the combustion for complete burning of one-mole methane.
  2. print(A.mole_fraction_dict())- The output of this command will be the mole fraction of the number of elements in component A. print(A.mass_fraction_dict())- The output of this command will be the mass fraction of the number of elements in component A. {\'N2\': 0.7670829987741036, \'O2\': 0.23291700122589645}-mass fraction of the program for component A.
    {\'N2\': 0.79, \'O2\': 0.21}- mole fraction of the program for component A as we provided.
  3. B.TPX = 298.15,ct.one_atm,\'CH4:1546\'

B- It specifies the component in the line

TPX- These are the input conditions that we need to provide for the simulation T-initial temperature(K), P-pressure(pa), X- mole fraction of the specified element

298.15- The temperature we provided in Kelvin, ct.one_atm- The pressure we provided, CH4:1546- The CH4 is the component for the simulation since we are specifying only one element in component B it automatically takes the mass fraction as 1 but we to provide the number >0 so that it will consider a one-mole fraction of the element.

\"B.moles = 1\"- it the line 16 which simply represents the number of moles of component B.

import cantera as ct 
gas = ct.Solution(\'gri30.cti\')

A = ct.Quantity(gas)
A.TPX = 298.15,ct.one_atm,{\'O2\':0.21, \'N2\':0.79}
A.moles = 2/0.21




B = ct.Quantity(gas)
B.TPX = 298.15,ct.one_atm,\'CH4:1546\'
B.moles = 1



M = A+B
M.equilibrate(\'HP\')
print(M.T)
print(A.mass_fraction_dict())
print(A.mole_fraction_dict())

4.No change is needed inline 22 for calculating AFT. The number of moles of A should be provided inline 10.

2224.224370856459
{\'O2\': 0.23291700122589645, \'N2\': 0.7670829987741036}
{\'O2\': 0.21, \'N2\': 0.79}

The result of this simulation

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.