Menu

Executive Programs

Workshops

Projects

Blogs

Careers

Placements

Student Reviews


For Business


More

Academic Training

Informative Articles

Find Jobs

We are Hiring!


All Courses

Choose a category

Loading...

All Courses

All Courses

logo

Loading...
Executive Programs
Workshops
For Business

Success Stories

Placements

Student Reviews

More

Projects

Blogs

Academic Training

Find Jobs

Informative Articles

We're Hiring!

phone+91 9342691281Log in
  1. Home/
  2. GAURAV KHARWADE/
  3. Week 4 - Handling Mixtures with Cantera

Week 4 - Handling Mixtures with Cantera

Objective:  Use of 'mole' function on an object and explain. Use mole_fraction_dict() and mass_fraction_dict() of object. Explain line no. 17 & 18 Compute moles of A to get the right value of AFT   Results: Mole & Mass function: Here, using this function we can change the size of 'quantity' by setting…

    • GAURAV KHARWADE

      updated on 25 Sep 2020

    Objective: 

    1. Use of 'mole' function on an object and explain.
    2. Use mole_fraction_dict() and mass_fraction_dict() of object.
    3. Explain line no. 17 & 18
    4. Compute moles of A to get the right value of AFT

     

    Results:

    Mole & Mass function:

    Here, using this function we can change the size of 'quantity' by setting the mass or nos. of moles. Mass and mole fractions can also be set using 'dict' objects, which is convenient in cases where the composition is stored in a variable or is computed.

    Python Code:

    """
    Program to understand the Quantity class of Cantera
    
    By- GAURAV V. KHARWADE|| Skill-Lync 2020
    """
    import cantera as ct
    
    gas= ct.Solution('gri30.cti')
    
    # To define the composition of AIR
    A= ct.Quantity(gas)
    A.TPX= 298.15,ct.one_atm,{'O2':0.21,'N2':0.79}
    A.moles= 9.52
    
    # To define the composition of OXIDIZER
    B= ct.Quantity(gas)
    B.TPX= 298.15,ct.one_atm,'CH4:1546'
    B.moles= 1
    
    M= A + B
    
    M.equilibrate('HP', solver='auto')
    
    print(A.report())
    print(B.report())
    
    # To Know the mass fraction of object A & B
    print('Mass fraction of AIR is=',A.mass_fraction_dict())
    print('Mass fraction of OXIDIZER is=',B.mass_fraction_dict())
    
    # To Know the relative mole fraction of object A & B
    print('Mole fraction of AIR is=',A.mole_fraction_dict())
    print('Mole fraction of OXIDIZER is=',B.mole_fraction_dict())
    print('AFT is=',M.T)

    When the composition alone is changed, the temperature and density are held constant. This means that the pressure and other intensive properties will change. The composition can also be set in conjunction with the intensive properties of the mixture

    The mole numbers will be normalized to produce the mole fractions, and therefore they are “relative” mole numbers. Mass fractions can be set in this way too by changing X to Y in the above statements.

     

    As we can see in the output of this program, we have seen both mass fraction and mole fraction of objects A & B. Moles of air is set to 9.52 as we know for 2 moles of N2 2/0.79=9.52 to achieve an accurate AFT of 2224.41K. 

    For object B, we have already defined mole number to 1 hence using 1546 will not be reasonable. The state of object B is initialized by a temperature of 298.15 K, 101325 pa of Pressure, and composition on a mole basis (CH4:1546).

     

     

     

     

     

     

     

     

     

     

    Leave a comment

    Thanks for choosing to leave a comment. Please keep in mind that all the comments are moderated as per our comment policy, and your email will not be published for privacy reasons. Please leave a personal & meaningful conversation.

    Please  login to add a comment

    Other comments...

    No comments yet!
    Be the first to add a comment

    Read more Projects by GAURAV KHARWADE (44)

    Week 9 - Senstivity Analysis Assignment

    Objective:

    Objective: To write the code which will take entire reactions of GRI mechanism 3.0 and take out the most sensitive top 10 reactions. The main parameters are as follows: Write code to list out the top 10 most sensitive reactions from a list of all reactions from the GRI mechanism. The sensitivity parameters should be with…

    calendar

    04 Jan 2021 05:51 PM IST

      Read more

      Auto ignition analysis of combustible mixture methane under different conditions using Cantera and Python

      Objective:

      Objective: To study auto-ignition using Cantera. Following are the tasks to perform using Cantera: Plot the variation of Auto Ignition time of Methane with a constant temperature of 1250K and pressure varying from 1 to 5 atm. Plot the variation of Auto Ignition time…

      calendar

      06 Dec 2020 04:55 AM IST

        Read more

        Week 6 - Multivariate Newton Rhapson Solver

        Objective:

        Objective: To solve a given set of Ordinary Differential equations using the Multi-Variate Newton Raphson Method. Given: The set of ODE's are given below: dy1dt=−0.04⋅y1+104⋅y2⋅y3dy1dt=-0.04⋅y1+104⋅y2⋅y3 dy2dt=0.04⋅y1−104⋅y2⋅y3−3⋅107⋅y22dy2dt=0.04⋅y1-104⋅y2⋅y3-3⋅107⋅y22 dy3dt=3⋅107⋅y22dy3dt=3⋅107⋅y22 The jacobian should be estimated numerically and not analytically.…

        calendar

        01 Nov 2020 03:50 AM IST

          Read more

          Week 5 - Literature review: ODE Stability

          Objective:

          Objective: To review the literature about ODE and to write the python program to substantiate our results. Theory:                                                            …

          calendar

          20 Oct 2020 03:52 PM IST

            Read more

            Schedule a counselling session

            Please enter your name
            Please enter a valid email
            Please enter a valid number

            Related Courses

            coursecardcoursetype

            Accelerated Career Program in Embedded Systems (On-Campus) - Powered by NASSCOM

            Recently launched

            0 Hours of Content

            coursecard

            5G Protocol and Testing

            Recently launched

            4 Hours of Content

            coursecard

            Automotive Cybersecurity

            Recently launched

            9 Hours of Content

            coursecardcoursetype

            Pre-Graduate Program in Bioengineering and Medical Devices

            Recently launched

            90 Hours of Content

            coursecardcoursetype

            Pre-Graduate Program in 5G Design and Development

            Recently launched

            49 Hours of Content

            Schedule a counselling session

            Please enter your name
            Please enter a valid email
            Please enter a valid number

                        Do You Want To Showcase Your Technical Skills?
                        Sign-Up for our projects.