Beruflich Dokumente
Kultur Dokumente
Introduction to cantera
Srisha Rao M V
Introduction
Srisha Rao M V About cantera
January 15, 2018 cantera structure
Introduction
How is it relevant?
Using Cantera
Solvers in cantera
Using Cantera
Sample plots to highlight difference
Few important classes
Few useful functions
Importance of equilibrate function
Resources
2
Introduction to Introduction
cantera
About cantera
Srisha Rao M V
• Cantera is an open-source chemical kinetics software used for solving
January 15, 2018
chemically reacting laminar flows developed by Prof. Dave Goodwin of
Introduction
About cantera
California Institute of Technology
cantera structure
How is it relevant?
• The source code is written in C++ but it can be used from Python and
Solvers in cantera
Matlab, or in applications written in C++ and Fortran 90
Using Cantera
• More details can be found on Cantera official website
• The software can be downloaded on Cantera download page
• The instructions to install on various OS can be read on Cantera
Installation Instruction
3
Introduction to Introduction
cantera
cantera structure
Srisha Rao M V
Introduction
About cantera
cantera structure
How is it relevant?
Solvers in cantera
Using Cantera
4
Introduction to Introduction
cantera
How is it relevant?
Srisha Rao M V
5
Introduction to Introduction
cantera
Solvers in cantera
1250
Introduction
Using Cantera
Sample plots to 1200
highlight difference
Few important
classes
Few useful functions 1150
Importance of
equilibrate function
Resources
1100
1050
1000
0 1000 2000 3000 4000 5000 6000
Temperature [k]
7
Introduction to Using Cantera
cantera
Sample plots to highlight difference
C v Variation of Air as function of Temperature
1050
950
Introduction
Using Cantera
Sample plots to 900
highlight difference
Few important
classes
Few useful functions 850
Importance of
equilibrate function
Resources
800
750
700
0 1000 2000 3000 4000 5000 6000
Temperature [k]
8
Introduction to Using Cantera
cantera
Sample plots to highlight difference
Gamma variation of Air as function of Temperature
1.42
1.3
1.28
1.26
0 1000 2000 3000 4000 5000 6000
Temperature [k]
9
Introduction to Using Cantera
cantera
Few important classes
Solution
Srisha Rao M V
10
Introduction to Using Cantera
cantera
Few important classes
Srisha Rao M V
importPhase
January 15, 2018
Introduction
• To import a phase from a CTI file
Using Cantera • Syntax : importPhase(file, name)
example
Sample plots to gas = importPhase(’gas.cti’);
highlight difference
Few important
• Parameters:
classes
Few useful functions • file – CTI file containing phase Note: importPhase is deprecated and may not be accessible
on updates after cantera 2.3
Importance of
equilibrate function definition solution() can be used as an alternative
Resources
• name – Name of the phase
• Returns:
• Instance of class Solution()
11
Introduction to Using Cantera
cantera
Few important classes
example
Introduction • mixtures of one or more phases gas = importPhase(’gas.cti’);
Using Cantera
Sample plots to
of matter. graphite =
highlight difference
Few important • Parameters: importPhase(’graphite.cti’);
classes
Few useful functions • phases – Cell array of phases mix = Mixture(gas, 1.0; graphite,
Importance of
equilibrate function
Resources
and mole numbers 0.1);
• Returns:
• Instance of class Mixture()
12
Introduction to Using Cantera
cantera
Few useful functions
To specify gas state
Function set()
Srisha Rao M V
13
Introduction to To retrive a thermodynamic property Using Cantera
cantera
Few useful functions
Use the corresponding function
To get the following properties
Srisha Rao M V • Pressure P • P = pressure(gas);
January 15, 2018
• Temperature T • T =temperature(gas);
Introduction
• specific heat at constant pressure • Cp = cp_mass(gas);
Using Cantera
Sample plots to • specific heat at constant volume • Cv = cv_mass(gas);
highlight difference
Few important
classes • Mass fractions Y • Y = massFractions(gas);
Few useful functions
Importance of
equilibrate function • Mole fractions X • X = moleFractions(gas);
Resources
1250
Introduction
Using Cantera
Sample plots to 1200
highlight difference
Few important
classes
Few useful functions
1150
Importance of
equilibrate function
Resources
1100
1050
1000
0 1000 2000 3000 4000 5000 6000
Temperature [k]
16
Introduction to Using Cantera
cantera
Importance of equilibrate function
C v Variation of Air as function of Temperature
1050
Frozen flow
Reacting flow(incorporates Equilibrate function)
950
Introduction
Using Cantera
Sample plots to 900
highlight difference
Few important
classes
Few useful functions
850
Importance of
equilibrate function
Resources
800
750
700
0 1000 2000 3000 4000 5000 6000
Temperature [k]
17
Introduction to Using Cantera
cantera
Importance of equilibrate function
Gamma variation of Air as function of Temperature
1.42
Frozen flow
Reacting flow(incorporates Equilibrate function)
1.4
Srisha Rao M V
Introduction
1.36
Using Cantera
Specific heat ratio
Sample plots to
highlight difference
Few important 1.34
classes
Few useful functions
Importance of
equilibrate function 1.32
Resources
1.3
1.28
1.26
0 1000 2000 3000 4000 5000 6000
Temperature [k]
18
Introduction to Using Cantera
cantera
Resources
Srisha Rao M V
19