Challenge

Week 4 - Handling Mixtures with Cantera

1. Finding Moles of A so that we get correct AFT

Air contains 21% oxygen by volume and 79% nitrogen, i,e 1 mol of air contains 0.21 mol of o2 and 0.79 mol of n2 technically. Total mass of air as 29kg/kmol. Dividing and multiplying the below equation oxidiser portion with 0.21, we get

Ch4+2(o2+3.76 n2)=co2+2h2o+3.76n2

ch4+2/0.21(0.21o2+0.79n2) on the reactant side, which means 1 mol of fuel requires 9.52( i.e. 2/0.21) moles of oxidizer (i.e. o2+n2). The formula for the moles of oxidizer become,

2*(moles of o2+moles of n2)/moles of o2

We can also write acc to moles of fuel , here,

moles of B( i.e. fuel)

moles of A(oxidiser)= moles of B*2*(moles of o2+moles of n2)*1/moles of o2

Conditions to be satisfied:

Always,Moles of o2 and n2 should always satisfy the 1:3.76 mol ratio, the mass ratio is 23:76 ( the mole ratio is 21:79)

Always, the mole of oxidiser mixture will be 9.52 for 1 mole of fuel in this reaction.

2. Using the mass fraction dict command, we get mass fraction in A={'N2': 0.7670829987741036, 'O2': 0.23291700122589645}, Understanding this,

0.21 moles of 02 means =0.21*32 =6.72g of oxygen

0.79moles of n2 means =0.79*28=22.12g of nitrogen

finding mass fraction of o2= 6.72/(6.72+22.12)

which is, 0.233

finding mass fraction of n2=22.12/(6.72+22.12)

which is,0.766

3. In Line 15, we write the conditions for class B ie here we mention what components /quanitities are there in B, here ch4 only, its temperature and pressure. In Line 16 we define the mole attribute for the class B, i.e B.moles=1. Quantity is an instance of gas and B&A are instances of quantity.

4.Significance of '1564' for ch4,

This has no significance here, in B , there is only one element i.e methane itself , it occupies all quanity in B class and we define the moles of B are 1, so moles of B always remain 1 and the value of X in ch4 does not matter but the fraction matters and because it is the only quantity there fraction will be 1 always for this . when the quantity we take is greater than 1, then cantera takes fraction only.We can put any value of ch4 and answer wil remain same because mole defined is still 1 and that matters here, although we cannot change the value of X to anything arbitrarily for o2 and n2 because here the ratio of both these should always be maintained, moles of o2: mole of n2 should be always 21:79.

The code:

import cantera as ct 
gas=ct.Solution('gri30.cti')
a=0.21
b=0.79
A=ct.Quantity(gas)
#what matters is the ratio of o2 and n2 should be correct and the moles of oxidiser should be exactly those as per required for combustion with fuel
A.TPX=298.15,ct.one_atm,{'o2':a,'n2':b}
A.moles=2*(a+b)*1/a
B=ct.Quantity(gas) 
B.TPX=298.15,ct.one_atm,'ch4:1564'
B.moles=1

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

print(A.mass_fraction_dict())

RESULTS:

The temperature comes as:2224.224370856459K

mole fraction in A={'N2': 0.79, 'O2': 0.21}

mass fraction in A={'N2': 0.7670829987741036, 'O2': 0.23291700122589645}

The result are accurate as the mass fraction comes as 23:76 for o2:n2, also the adiabatic flame temperature is correct as2224K.

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.