Challenge

Handling Mixtures with Cantera   (Cantera, Skill Lync, Easy)

Aim:

To use 'Quantity' class in cantera to perform combustion of methane.

Introduction:

The combustion of methane using cantera can be done by passing temperature, pressure and mole fractions of species to a single object instance like:

gas.TPX = 298.15, ct.one_atm, {'CH4': 1, 'O2': 2, 'N2': 7.52}

But by doing so, we assume that the fuel and air are at same temperature. In cases like preheating of air, the air temperature is different than fuel's. So to provide different properties of air and fuel, we use 'Quantity' class of cantera.

In this report it is assumed that air and fuel are at same temperature. This is done in order to compare the codes written in previous reports. The values can also be changed if required. Also, it is assumed that the combustion takes place in constant pressure condition with initial STP conditions.

Theory:

While representing the properties of fuel and air seperately, it is required that mole fractions and number of moles be represented appropriately. For combustion of single mole of methane, two moles of oxygen and 7,52 moles of nitogen are required. Also, the air contains 21% Oxygen and 79% Nitrogen in mole fraction basis. Given below is the balanced reaction:

The total moles of nitrogen in balanced reaction can be found using:

Total number of moles of air required for combustion are the sum of total moles of species in air is (2 + 7.52) = 9.52

This is the number of moles which to be fed to obtain a stoichiometric combustion reaction. It is written as:

A_ir.TPX  = 298.15, ct.one_atm, {'O2': 0.21,'N2': 0.79}
A_ir.moles = 9.52

Code:

import cantera as ct

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

A_ir = ct.Quantity(gas)
A_ir.TPX = 298.15, ct.one_atm, {'O2':0.21, 'N2':0.79}
A_ir.moles = 9.52

F_uel = ct.Quantity(gas)
F_uel.TPX = 298.15, ct.one_atm, {'CH4':1564}
F_uel.moles = 1

Mix_ture = A_ir + F_uel
Mix_ture.equilibrate('HP','auto')

print('The AFT is ' + str(round(Mix_ture.T,4)) + ' K') 
print(Mix_ture.mass_fraction_dict())

How does the code work?

1)The 'Quantity' class is made from 'Solution' class. So a 'gas' object is made for solution class.

2) The air is defined using name 'A_ir'. The Temperature, Pressure and mole fractions of species are assigned to it. Here, the inlet temperature of air is same as of fuel, but it is just for demonstration purpose.

3) The total moles of air required are 9.52 moles, attributed using method 'moles'. This air would contain 2 moles of pure oxygen which is useful in combustion.

4) The steps 2 and 3 are similar for fuel.

5) These two gas phases are mixed together to form a mixture named 'Mix_ture'. This mixing is represented using '+' sign.

6) The combustion is then carried out using 'equilibrate' method, which solves using Element Potential method or Equilibrium constant method. It chooses on it own since it is kept on 'auto'.

7) The AFT and mass fraction of species are then displayed.

(It can be seen in the mass fraction of fuel that the it is written as 1564. This is done purposely to show that if we write any number in place of mass fraction, the fraction of all species is divided by a number such that the final sum of all mass fractions will be 1. In this case the fuel has a single specie of CH4 so the mass fraction is internally divided by 1564 to get final fraction as 1)

Results:

1) Inlet Air at 298.15 K and equivalence ratio as 1

The major species having high mass fractions are highlighted. Other species have very less mass fractions. This is because the reaction is in stoichiometric condition.

2) Inlet Air at 398.15 K and equivalence ratio as 1

The AFT is higher and there is minor change in mass fractions.

3) Inlet Air at 298.15 K and equivalence ratio as 0.8

The AFT is lower and change in mass fractions are quite distinct such as of O2.

4) Inlet Air at 298.15 K and equivalence ratio as 1.1

The AFT is higher and change in mass fractions are quite distinct such as of CO and O2.

Conclusion:

The 'Quantity' class is used to apply different temperatures to fuel and air and obtained results are valid as they are expected to be.

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.