Challenge

Week 4.1- Handling Mixtures with Cantera

Handling Mixtures with Cantera

1. Use the "moles" method/function of the A object and explain how it was calculated.

Mole fraction:

The mole fraction can be calculated by dividing the number of moles of one component of a solution by the total number of moles of all the components of a solution. It is noted that the sum of the mole fraction of all the components in the solution should be equal to 1.

stoichiometric combustion

`CH_4 + 2(O_2+3.76N_2) = CO_2 + 2H_2O + 7.52N_2`

`text(mole fraction of oxygen = ) text(number of moles of oxygen )/text( number of moles of (oxygen + nitrogen)`

`text(number of moles of (oxygen + nitrogen)) = text(number of moles of air`

Oxygen represents about 21% of air. In a mole fraction, the moles of oxygen molecules are compared to the total molecules of air of a particular sample. In fractional form, 21 moles of oxygen in an air sample of 100 moles would be represented by 21/100 or 0.21.

`text(number of moles of air = ) text(number of moles of oxygen )/text(mole fraction of oxygen ) = 2/0.21= 9.52`

`X = text(Mole faction)`
`Y = text(Number of moles)`
`X_(O2) = Y_(O2) / (Y_(O2) + Y_(N2)) = Y_(O2) / (Y_(air)`
`Y_(air) = Y_(O2) / X_(O2) = 2/0.21 = 9.52`

2. Use the method mole_fraction_dict()/mass_fraction_dict() of the A object and explain the result that you get.

mole_fraction_dict() calculates the mole fraction of elements in given species.

mass_fraction_dict() calculates the mass fraction of elements in given species.

3. What is happening in lines 15 and 16? Make sure you explain what 1546 means? Is that reasonable?

In line number 15 we are assigning the temperature, pressure, and mole fraction to fuel.

1546 is an arbitrary number it does not have any importance when we use single fuel, 0 is not acceptable. this number is important when we use more fuels in the single combustion process.

in line 16 we are assigning a number of moles of fuel to undergo the combustion process.

4. What changes do you need to put in place to get the right value of AFT in line 22?.

To get the right values of AFT we have to calculate a correct number of moles of air required.

in this case, correct number of moles of air(A) is = 9.52 moles

Main Program

# Code to vary the temeprature of air and oxidizer individually

import cantera as ct
gas =  ct.Solution('gri30.cti') #gas object is the instance of solution class

A = ct.Quantity(gas)  # air object is the instance of Quantity class 
A.TPX = 298.15,ct.one_atm,{'O2':0.21, 'N2':0.79} # giving input parameters temperature, pressure & mole fraction to air

# X = Mole faction
# Y = Number of moles
# X_O2 = Y_O2 / (Y_O2 + Y_N2) = Y_O2 / (Y_air)
# Y_air = Y_O2 / X_O2 = 2/0.21 = 9.52

A.moles = 9.2
print("Mole fraction's of species in air =", A.mole_fraction_dict()) # prints mole fractions of elements in the species A(air)
print("Mass fraction's of species in air =", A.mass_fraction_dict()) # prints mass fractions of elements in the species A(air)

B = ct.Quantity(gas)
B.TPX= 298.15,ct.one_atm,'CH4:1546'  # there is no importance to 1546 for single fuel combustion. it may be any number except 0
B.moles = 1
print("Mole fraction's of species in fuel =", B.mole_fraction_dict())  # prints mole fractions of elements in the species B(fuel)
print("Mass fraction's of species in fuel =", B.mass_fraction_dict())  # prints mass fractions of elements in the species B(fuel)

# The following step is used to apply the right molar balance
M = A + B 	#quantitative air + fuel mixer
M.equilibrate('HP', 'auto') 
print("Adiabatic Flame Temperature of methane combustion = ", M.T, 'K')
print("mass of mixture = ", M.mass, 'g')
print("Mole fraction's of species in air fuel mixture =", M.mole_fraction_dict())  # prints mole fractions of elements in the species air fuel mixture
print("Mass fraction's of species in air fuel mixture =", M.mass_fraction_dict())  # prints mass fractions of elements in the species air fuel mixture

Solution:

Mole fractions and Mass fractions

Air

Fuel

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.