From charlesreid1

 
(52 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Outline=
Introduction: Cantera in Short
Part I: Cantera Core
Part II: Cantera for Python
Part III: Cantera for Reaction Engineering
=Overview of Cantera=
=Overview of Cantera=


Line 22: Line 32:
** Transport
** Transport
** ZeroD - classes relating to zero-dimensional Reactors (Reactor, Wall, etc.)
** ZeroD - classes relating to zero-dimensional Reactors (Reactor, Wall, etc.)
=Thermodynamics=
* Somewhere in our algorithm, looping over domain (or for the single reactor control volume), and we're saying, "update thermo and transport parameters" - focus on how this is being done, what classes its using, what capabilities are available
* Phase objects
** [[Cantera/Gases]] - information about gas phase objects in Cantera
** [[Cantera/Surfaces]] - information about surface phase objects in Cantera
* Single phase gas calculations
** Temperature/power calculations
** Basic Python numerics + simple Cantera gas stuff
** Isenthalpic valve drops
** Plain reactors: piston-cylinder problems
** [[Cantera/Phase Equilibrium]] Solvers for determining gas equilibrium state (e.g., you set U, you get T)
* Introductory CHEE type calculations
** Solving simple matrix systems, using Cantera's MW/density/properties functionality


=Kinetics=
=Kinetics=


* Discussion of kinetics
* Discussion of kinetics
** Separate from reactors themselves
 
** Reaction rate source terms
** [[Cantera/Reaction Rate Source Terms]] <s>Reaction rate source terms, separate from reactors</s>
** Kinetic mechanisms
 
** [[Cantera/Kinetic Mechanisms]] <s>Kinetic mechanisms</s>
*** Theory of chemical reactions
*** Definitions of quantities involved in chemical reactions
*** Theoretical information needed (by Cantera) to define reaction mechanisms
*** [[Cantera/CTI Files]] Specification of reaction kinetics in CTI files (useful info here: http://www.et.byu.edu/~tom/classes/641/Cantera/InputFile/definingphases.pdf)
**** [[Cantera/CTI Files/Phases]] Specification of phases
**** [[Cantera/CTI Files/Species]] Specification of species
**** [[Cantera/CTI Files/Reactions]] Specification of reactions
*** Specification of reaction kinetics in XML files
 
** Cantera kinetics examples
*** [[Cantera/Simple Reaction]] <s>A very simple reaction</s>
*** [[Cantera/Simple Reaction Network]] A very simple reaction network
*** [[Cantera/Complex Reaction Network]] A more complex reaction network
** Single phase kinetics
** Single phase kinetics
*** Source code abstraction
*** Source code abstraction
Line 34: Line 76:
*** Graphene - how to really USE this information
*** Graphene - how to really USE this information
** Multiphase surface kinetics
** Multiphase surface kinetics
*** Surface coverage, site density, formulation of approach
*** [[Cantera/Surface Coverage]] <s>Surface coverage, site density, formulation of approach</s>
*** Source code abstraction - Walls vs. SurfPhase vs. (etc.)
*** Source code abstraction - Walls vs. SurfPhase vs. (etc.)
=Thermodynamics=
* Somewhere in our algorithm, looping over domain (or for the single reactor control volume), and we're saying, "update thermo and transport parameters" - focus on how this is being done, what classes its using, what capabilities are available
* Single phase
** Mixtures
** Equations of state
** Equilibrium
** Piston-cylinder systems
* Multiphase
** What thermodynamics is there for multiphase systems?
** Heat transfer to-from surface


=Transport=
=Transport=


* Follow BSL a bit on this one...
* BSL


* Mass transfer
* Mass transfer
** Diffusion
** [[Cantera/Diffusion]] <s>Mixture vs. multicomponent diffusion</s>
*** Mixture vs. multicomponent diffusion
** [[Cantera/Diffusion Coefficients]] - Diffusion coefficient models
*** Diffusion coefficient models
** Mass transfer coefficients
** Mass transfer coefficients


Line 66: Line 93:


* Momentum transfer
* Momentum transfer
** Viscosity
** [[Cantera/Viscosity]]


* General discussion: non-dimensional analysis, how it relates to Cantera
* General discussion: non-dimensional analysis, how it relates to Cantera
** Prandtl matlab examples - comparing transport properties (Prandtl number) for mixture-averaged and multicomponent models


=Reactor Design=
=Reactor Design=


* Integral vs. differential reactors
==Overview of Cantera Reactors==
* Isothermal vs. non-isothermal reactors
 
Theory:
* Description of generic Cantera reactors, canonical CHE reactor types
 
Practice: introduction to reactors
* [[Cantera/Reactors]] - general information about reactors, how to create them, how to turn energy equation on/off, really brief "how it works"
* [[Cantera/Batch Reactors]]
* [[Cantera/Stirred Tank Reactors]]
* [[Cantera/Plug Flow Reactors]] - how to create them - good opportunity to demonstrate object-oriented programming, by creating a class that is a PFR.
 
==Cantera Reactors In-Depth==
 
Theory:
* [[Cantera/Reactor Equations]] <s>General Cantera reactor equations</s>
* [[Cantera/Integral and Differential Reactors]] <s>Integral vs. differential reactors</s>
* [[Cantera/Isothermal and Nonisothermal Reactors]] <s>Isothermal vs. non-isothermal reactors</s>
 
* Heterogeneous vs. homogeneous
* Heterogeneous vs. homogeneous
* Transport effects in reactors
* Transport effects in reactors
* Fogler, Froment/Bischoff, Belfiore
==Hacking Cantera Reactors==


* Start with Fogler-type problems
Focus on use of Python to extend the Reactor object itself, so that you don't have to redefine everything.
* Move to Froment/Bischoff and Belfiore problems


=Numerics=
Simple "EnhancedReactor" that uses an inlet dictionary.


* Division of "numerics" layer and "constitutive equations" layer
Simple "SurfaceReactor" that stores surface information.


* Topics
(Illustrate test-driven development: write intuitive code to simulate the reactors, and design the class around that.)
** Newton's method
** Linear algebra
** Jacobians
** ODEs


* Zero-dimensional ordinary differential equations
=Cantera Numerics=
** Problem type
** Problem solution techniques


* One-dimensional ordinary differential equations
* [[Cantera/Structure]] <s>Structure of Cantera: "numerics" layer and "constitutive equations" layer</s>
** Simplification of a more complex problem (PDE) with assumptions like axisymmetric flow


* Initial value problems
* Ordinary differential equations
* Boundary value problems
** Cantera formulation, reactor equations
* Advanced boundary conditions
** ODE as primary problem type being solved in Cantera
** Cantera numerics, ODE solver sophistication
** Have ALREADY shown, with a simple Fipy time integrator, that Sundials has a lot of sophistication... that sophistication is NECESSARY for kinetics/reaction equations


* Surface coverage equations
* Surface coverage equations
** Surface species treated as control volume properties
** Surface species treated as control volume properties
** Packaged up into the Reactor's solution vector
** Packaged up into the Reactor's solution vector
** The hack that makes a boundary condition into part of the domain
** The Green's Function hack that makes a boundary condition into part of the domain
 
* Partial differential equations
** Cantera solutions to one-dimensional systems
** Assumptions being made for each problem type (axisymmetric, stagnation, etc.)
 
* Assorted numerical topics
** Newton's method
** Linear algebra
** Jacobians - Sandia report with definitions of Jacobians
 
* Initial value problems
* Boundary value problems
* Advanced boundary conditions


* Strategies for coupling Cantera with CFD
* Strategies for coupling Cantera with CFD
** [[Cantera/Fipy PFR]] <s>external numerical library for solving spatial boundary value problem</s>
** Interfacing with Chemkin-like programs (Fluent)
** Interfacing with Chemkin-like programs (Fluent)
** Constructing your own numerical ODE/PDE solver
** Constructing your own numerical ODE/PDE solver
Line 112: Line 167:
** Fipy: simple diffusion problem, coupling with Cantera
** Fipy: simple diffusion problem, coupling with Cantera
** Fipy: more complex reactor equation(s) and coupling with Cantera
** Fipy: more complex reactor equation(s) and coupling with Cantera
=Using Cantera with Python=
* Strategies for object-oriented Python, particularly as applied to physics problems
* Strategies for combining Python-related libraries/modules/utilities with Cantera
** matplotlib
** numpy
** itertools
** pandas
* Numerics (outside of Cantera)
* Optimization
* Creating bottled gases - ways of conveniently wrapping gas objects, without loading XML file every single time, to allow for quick creation of a gas
* [[Cantera/Composition Helper Functions]] - defining helper functions to wrap Cantera
* Object oriented reactor extension example - aidt? adiabatic flame temp?


=Optimization=
=Optimization=
Line 121: Line 193:
=Mechanics=
=Mechanics=


* Debugging
* [[Cantera/Debugging Cantera]] <s>Debugging Cantera</s>
** Diving in
* [[Cantera/Debugging Cantera from Python]] <s>Debugging Cantera from Python</s>
** Picking apart
 
* [[Cantera/Extending_C_API]] <s>Hacking, extending C API</s>
 
 
 
=Cantera for Engineers=
 
Throughout the coverage of the core capabilities of Cantera, we've covered a lot of theoretical aspects of what Cantera does and how it works
 
Now would like to supplement with some illustrative engineering calculations that use these lower-level constitutive models for practical engineering design
 
Revisit structure of everything else, but show how you can use each feature to do practical engineering calculations
 
Start with gases only:
* heat capacities, integration, evaluation of physical properties
* creating gas mixtures
* equilibrating gases
* reaction rates, rate constants, molecular weights, what reacts into what, stoichiometric coefficients
* all that bookkeeping stuff
 
Move on to non-reacting reactors:
* piston-cylinder problems
* heaters
* coolers
* etc.
 
Modeling piston-cylinder problems
 
Modeling heat duties
 
Equilibrium thermodynamics
* the Delta-G problem from CHE phase equilibria, surface minimization, etc.
 
Reacting reactors
* engineering calculations related to reacting reactors
* wrapping the simple reactor calculations for actual engineering design calculations
 
[[Cantera/Adiabatic Flame Temperature Dilution]] - investigating the effect of dilution on adiabatic flame temperature with nitrogen and carbon dioxide
 
Separations/mass transfer unit ops
* Distillation columns - series of reactors operating at steady state
 
=Flags=


* Hacking
{{CanteraFlag}}

Latest revision as of 08:59, 17 April 2017

Outline

Introduction: Cantera in Short

Part I: Cantera Core

Part II: Cantera for Python

Part III: Cantera for Reaction Engineering

Overview of Cantera

  • Capabilities
    • High level division of Cantera's capabilities
    • Zero-D, One-D, phase objects, numerics
  • Division of capabilities should roughly follow how Cantera source code is divided
    • Apps - utilities for converting between Chemkin and Cantera file formats, parsing input files, comparing output files, etc.
    • Base - more utilities for array storage, printing and logging, XML file parsing, Cantera errors/exceptions,
    • Clib - code for C API
    • Converters
    • Equil
    • Fortran - code for Fortran API
    • Kinetics - classes for getting/setting/calculating reaction network quantities (net production rate source terms, reaction rate parameters, etc.)
    • Matlab - code for Matlab API
    • Numerics - classes for solving ordinary differential equations, evaluating Jacobians, Newton methods, constructing and solving matrices, etc.
    • OneD - classes relating to one-dimensional simulations (domains, stacks, one-dimensional flame simulations, etc.)
    • Python - code for Python API
    • Spectra
    • Thermo
    • TPX
    • Transport
    • ZeroD - classes relating to zero-dimensional Reactors (Reactor, Wall, etc.)

Thermodynamics

  • Somewhere in our algorithm, looping over domain (or for the single reactor control volume), and we're saying, "update thermo and transport parameters" - focus on how this is being done, what classes its using, what capabilities are available
  • Phase objects
  • Single phase gas calculations
    • Temperature/power calculations
    • Basic Python numerics + simple Cantera gas stuff
    • Isenthalpic valve drops
    • Plain reactors: piston-cylinder problems
    • Cantera/Phase Equilibrium Solvers for determining gas equilibrium state (e.g., you set U, you get T)
  • Introductory CHEE type calculations
    • Solving simple matrix systems, using Cantera's MW/density/properties functionality

Kinetics

  • Discussion of kinetics

Transport

  • BSL
  • Heat transfer
    • Heat diffusivity
    • Heat transfer coefficients
  • General discussion: non-dimensional analysis, how it relates to Cantera
    • Prandtl matlab examples - comparing transport properties (Prandtl number) for mixture-averaged and multicomponent models

Reactor Design

Overview of Cantera Reactors

Theory:

  • Description of generic Cantera reactors, canonical CHE reactor types

Practice: introduction to reactors

Cantera Reactors In-Depth

Theory:

  • Heterogeneous vs. homogeneous
  • Transport effects in reactors
  • Fogler, Froment/Bischoff, Belfiore

Hacking Cantera Reactors

Focus on use of Python to extend the Reactor object itself, so that you don't have to redefine everything.

Simple "EnhancedReactor" that uses an inlet dictionary.

Simple "SurfaceReactor" that stores surface information.

(Illustrate test-driven development: write intuitive code to simulate the reactors, and design the class around that.)

Cantera Numerics

  • Cantera/Structure Structure of Cantera: "numerics" layer and "constitutive equations" layer
  • Ordinary differential equations
    • Cantera formulation, reactor equations
    • ODE as primary problem type being solved in Cantera
    • Cantera numerics, ODE solver sophistication
    • Have ALREADY shown, with a simple Fipy time integrator, that Sundials has a lot of sophistication... that sophistication is NECESSARY for kinetics/reaction equations
  • Surface coverage equations
    • Surface species treated as control volume properties
    • Packaged up into the Reactor's solution vector
    • The Green's Function hack that makes a boundary condition into part of the domain
  • Partial differential equations
    • Cantera solutions to one-dimensional systems
    • Assumptions being made for each problem type (axisymmetric, stagnation, etc.)
  • Assorted numerical topics
    • Newton's method
    • Linear algebra
    • Jacobians - Sandia report with definitions of Jacobians
  • Initial value problems
  • Boundary value problems
  • Advanced boundary conditions
  • Strategies for coupling Cantera with CFD
    • Cantera/Fipy PFR external numerical library for solving spatial boundary value problem
    • Interfacing with Chemkin-like programs (Fluent)
    • Constructing your own numerical ODE/PDE solver
    • Scipy: simple kinetic equation integration using Scipy
    • Fipy: simple diffusion problem, coupling with Cantera
    • Fipy: more complex reactor equation(s) and coupling with Cantera

Using Cantera with Python

  • Strategies for object-oriented Python, particularly as applied to physics problems
  • Strategies for combining Python-related libraries/modules/utilities with Cantera
    • matplotlib
    • numpy
    • itertools
    • pandas
  • Numerics (outside of Cantera)
  • Optimization
  • Creating bottled gases - ways of conveniently wrapping gas objects, without loading XML file every single time, to allow for quick creation of a gas
  • Object oriented reactor extension example - aidt? adiabatic flame temp?

Optimization

  • Not going into too much depth
  • Optimizing kinetic parameters to fit data
  • Optimizing other variables to maximize reactor performance

Mechanics


Cantera for Engineers

Throughout the coverage of the core capabilities of Cantera, we've covered a lot of theoretical aspects of what Cantera does and how it works

Now would like to supplement with some illustrative engineering calculations that use these lower-level constitutive models for practical engineering design

Revisit structure of everything else, but show how you can use each feature to do practical engineering calculations

Start with gases only:

  • heat capacities, integration, evaluation of physical properties
  • creating gas mixtures
  • equilibrating gases
  • reaction rates, rate constants, molecular weights, what reacts into what, stoichiometric coefficients
  • all that bookkeeping stuff

Move on to non-reacting reactors:

  • piston-cylinder problems
  • heaters
  • coolers
  • etc.

Modeling piston-cylinder problems

Modeling heat duties

Equilibrium thermodynamics

  • the Delta-G problem from CHE phase equilibria, surface minimization, etc.

Reacting reactors

  • engineering calculations related to reacting reactors
  • wrapping the simple reactor calculations for actual engineering design calculations

Cantera/Adiabatic Flame Temperature Dilution - investigating the effect of dilution on adiabatic flame temperature with nitrogen and carbon dioxide

Separations/mass transfer unit ops

  • Distillation columns - series of reactors operating at steady state

Flags