Challenge

Week 4 - Handling Mixtures with Cantera

Week 4 - Handling Mixtures with Cantera

Theory

Mixtures are substances composed of two or more forms of matter. We can separate them by physical methods. Examples include a solution of salt and water, a mixture of sugar and water, different gasses, air, ...etc. In any mixtures, the various components do not combine through any kind of chemical change. Therefore, the components do not lose their individual properties.

Types of mixtures:-

Based on their composition, they can be divided into two types-

1. Homogeneous mixture

2. Heterogeneous mixture

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

ANS.:- Object A is air. Consider any fuel (i.e. hydrocarbon) reaction with air. The equation is written in the following form-

CxHy + b(O2 + 3.76N2) => xCO2 + y/2(H2O) + 3.76bN2

So the mole fraction of air is = b/(b + 3.76b) = 0.21. One mole of air contains 0.21 moles of oxygen. Hence the methane at stoichiometric condition b= 2 and 2/0.21 = 9.52 moles of air takes part in the combustion.

2. Use the method mole_fraction_dict() of the A object and explain the results that we get.

ANS. :- To calculate mass fraction we just need to multiply by no. of moles of the compound with molecular weight.

For O2 no. of moles = 2 & mass in gms = 2*32 = 64 gms

For N2 no. of moles = 7.52 & mass in gms = 7.52*28 = 210.56gms

Mole fraction of O2 = 64/(64+210.56) = 0.23 and

Mole fraction of N2 = 210.56/(64+210.56) = 0.77 approx.

3. What do you mean by “CH4:1546”? Is that reasonable?

ANS.:- Basically here in these lines we are defining the fuel i.e. methane CH4 with pressure, temperature, and mole fraction values, and no. of moles are defined so as to avoid any pre-defined values assumed by the software.

Also, as methane is only the gas defined hence it has no. of moles and mole fraction as 1. Therefore defining 1546 has no effect as it gives the value of mole fraction as one.

4. What changes do we need to get the right value of AFT? The right answer is 2224K.

ANS. :- As the mole fraction is known we just need to define the no. of moles gas object A has i.e. 2/0.21 each for O2 and N2 = 9.52 with command as A.moles = 2/0.21 as written in the program.

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
print(A.mass_fraction_dict())



B = ct.Quantity(gas)
B.TPX = 298.15, ct.one_atm, {'CH4':1546}
B.moles = 1
print(B.mass_fraction_dict())




# The following step is used to apply the right molar balance 
M = A+B
M.equilibrate('HP')
print(M.T)

Result/Output.

{'N2': 0.7670829987741036, 'O2': 0.23291700122589645}
{'CH4': 1.0}
2224.224370856459
[Finished in 1.2s]

Conclusion.

  1. TPX values depend on no. of moles. If no. of moles changes TPX value changes.

  2. The number of moles we can calculate from general hydrocarbon reactions.
  3. As the methane is only gas defined and hence it has no. of moles and mole fraction as 1. Therefore defining 1546 has no effect as it gives the values of moles fraction as one.

  4. The right temperature value is 2224K which we need to calculate by balancing entering air into the chamber.

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.