pymars

Contains main driver function for pyMARS program.

pymars.pymars.METHODS = ['DRG', 'DRGEP', 'PFA']

Supported reduction methods

class pymars.pymars.ReductionInputs

Collects inputs for overall reduction process.

property error

Alias for field number 1

property flame_conditions

Alias for field number 4

property ignition_conditions

Alias for field number 2

property method

Alias for field number 5

property model

Alias for field number 0

property phase_name

Alias for field number 11

property psr_conditions

Alias for field number 3

property safe_species

Alias for field number 7

property sensitivity_analysis

Alias for field number 8

property sensitivity_type

Alias for field number 10

property target_species

Alias for field number 6

property upper_threshold

Alias for field number 9

pymars.pymars.main(model_file, error_limit, ignition_conditions, psr_conditions=[], flame_conditions=[], method=None, target_species=[], safe_species=[], phase_name='', run_sensitivity_analysis=False, upper_threshold=None, sensitivity_type='greedy', path='', num_threads=1)

Driver function for reducing a chemical kinetic model.

Parameters
  • model_file (str) – Cantera-format model to be reduced (e.g., ‘mech.cti’).

  • error_limit (float) – Maximum error percentage for the reduced model.

  • ignition_conditions (list of InputIgnition) – List of autoignition initial conditions.

  • psr_conditions (list of InputPSR, optional) – List of PSR simulation conditions.

  • flame_conditions (list of InputLaminarFlame, optional) – List of laminar flame simulation conditions.

  • method ({'DRG', 'DRGEP', 'PFA'}, optional) – Skeletal reduction method to use.

  • target_species (list of str, optional) – List of target species for graph-based reduction.

  • safe_species (list of str, optional) – List of non-target species to always retain.

  • phase_name (str, optional) – Optional name for phase to load from CTI file (e.g., ‘gas’).

  • run_sensitivity_analysis (bool, optional) – Flag to run sensitivity analysis after completing another method.

  • upper_threshold (float, optional) – Upper threshold (epsilon^*) used to determine species for sensitivity analysis in combination with DRG or DRGEP method

  • sensitivity_type ({'initial', 'greedy'}, optional) – Type of sensitivity analysis

  • path (str) – Path to directory for writing files

  • num_threads (int, optional) – Number of CPU threads to use for performing simulations in parallel. Optional; default = 1, in which the multiprocessing module is not used. If 0, then use the available number of cores minus one. Otherwise, use the specified number of threads.

pymars.pymars.parse_inputs(input_dict)

Parses and checks dictionary of inputs for consistency and correctness.

Parameters

input_dict (dict) – Inputs for reduction

Returns

Object with checked inputs

Return type

ReductionInputs

pymars.pymars.pymars(argv)