5.11. Thermochemistry mechanism management

mirgecom.mechanisms: Utilities for managing thermochemistry mechanisms.

mirgecom.mechanisms.get_mechanisms_pkgname()[source]

Get a qualified package name for the location of mechanism data.

Return type:

str

mirgecom.mechanisms.get_mechanism_file_name(mechanism_name)[source]

Form the YAML file name for a mechanism.

Parameters:

mechanism_name (str)

Return type:

str

mirgecom.mechanisms.get_mechanism_input(mechanism_name)[source]

Get the contents of a mechanism YAML input file.

Parameters:

mechanism_name (str)

Return type:

str

mirgecom.mechanisms.import_mechdata()[source]

Import the mechanism data as a mechanism data resource.

Returns:

Object of type importlib.resources.abc.Traversable representing the container (think directory) of the thermochemistry mechanism data (think YAML files).

Return type:

importlib.resources.abc.Traversable

mirgecom.thermochemistry provides a wrapper class for pyrometheus.

This module provides an interface to the Pyrometheus Thermochemistry package’s Thermochemistry object which provides a thermal and chemical kinetics model for the the mirgecom.eos.MixtureEOS, and some helper routines to create the wrapper class.

Note

The wrapper addresses a couple of issues with the default interface:

  • Lazy eval is currently incapable of dealing with data-dependent behavior (like that of an iterative Newton solve). This wrapper allows us to hard-code the number of Newton iterations to temperature_niter.

  • Small species mass fractions can trigger reaction rates which drive species fractions significantly negative over a single timestep. The wrapper provides the zero_level parameter to set concentrations falling below zero_level to be pinned to zero.

mirgecom.thermochemistry.get_pyrometheus_wrapper_class(pyro_class, temperature_niter=5, zero_level=0.0)[source]

Return a MIRGE-compatible wrapper for a pyrometheus mechanism class.

Dynamically creates a class that inherits from a Thermochemistry class and overrides a couple of the methods to adapt it to mirgecom’s needs.

  • get_concentrations: overrides Thermochemistry version of the same function, pinning any concentrations less than the zero_level due to small or slightly negative mass fractions (which are OK) back to 0.

  • get_temperature: MIRGE-specific interface to use a hard-coded Newton solver to find a temperature from an input state. This routine hard-codes the number of Newton solve iterations to temperature_niter.

  • get_heat_release: evaluate heat release due to reactions.

Parameters:
  • pyro_class (Thermochemistry) – Pyro thermochemical mechanism to wrap

  • temperature_niter (int) – Number of Newton iterations in get_temperature (default=5)

  • zero_level (float) – Squash concentrations below this level to 0. (default=0.)

mirgecom.thermochemistry.get_pyrometheus_wrapper_class_from_cantera(cantera_soln, temperature_niter=5, zero_level=0.0)[source]

Return a MIRGE-compatible wrapper for a pyrometheus mechanism class.

Cantera-based interface that creates a Pyrometheus mechanism Thermochemistry class on-the-fly using a Cantera solution.

Parameters:
  • cantera_soln – Cantera solution from which to create the thermochemical mechanism

  • temperature_niter (int) – Number of Newton iterations in get_temperature (default=5)

  • zero_level (float) – Squash concentrations below this level to 0. (default=0.)

mirgecom.thermochemistry.get_thermochemistry_class_by_mechanism_name(mechanism_name, temperature_niter=5, zero_level=0.0)[source]

Grab a pyrometheus mechanism class from the mech name.

Parameters:

mechanism_name (str)