Challenge

Week 4 - Handling Mixtures with Cantera

Aim

To Find the Adiabatic Flame Temperature (AFT) at the stoichiometric condition using Cantera which is obtained as 2224 k

study molar faction input in Cantera to get AFT

Introduction

General Form of stoichiometric condition

`C_xH_y+a(o_2+3.76*N2)= x*co_2 +y/2*H2O+3.76*a*N2`

mole base convection

consider only at reactant side

Air fuel ratio

`(A/F)_(stioc)=((m_(air))/(m_(fuel)))_(stioc)=(a+3.76a)/1=4.76a`

 Mole Fraction

`(M_(species))=(M_(mix)/M_(species))`

Python code

"""
sample code to vary the temperature of air & oxidizer individually
"""
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=9.52 # m_air/m_fuel=4.76a/1
print('air_molar_fraction=',A.mass_fraction_dict())
print('air_mass_fraction=',A.mole_fraction_dict())

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

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


1. Use the "moles" method/function of the A object and explain how it was calculated. You need to use this after line number 9.

the class definition of Temperature, Pressure, molar fraction (A.TPX) with standard atmospheric condition

Use the "moles" method/function of the A object

can be calculated by Air fuel ratio at the stoichiometric condition

`(A/F)_(stoic)=4.76*2=9.52` or can also define `a/(o2_(Fraction))=2/0.21`

2. Use the method mole_fraction_dict() of the A object and explain the result that you get. Here is how you need to use it. 

mass fraction

air=1

N2=0.79,O=0.21

To find molecular weight can be found by-product of the number of moles

`O_2=2*2*16=64`

`N_2=2*2*3.76*14=210.56`

`air=210.56+64=274.56`

mole fraction

`m_(O_2)=O_2/(air)=64/274.56=0.23`

`m_(N_2)=N_2/(air)=210.56/274.56=0.76689`

which can be validated below

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

CH4=1 which define moles as in B.moles also default value as 1 so it is not reasonable to define 1546 in CH4 it only takes moles value.

What changes do you need to put in place to get the right value of AFT inline 22?. The right answer is 2224K. 

By giving mole fraction value of air to get value AFT as 2224k

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.