sensitivity_analysis

Module containing sensitivity analysis reduction stage.

pymars.sensitivity_analysis.evaluate_species_errors(starting_model, ignition_conditions, metrics, species_limbo, phase_name='', num_threads=1)

Calculate error induced by removal of each limbo species

Parameters
  • starting_model (ReducedModel) – Container with model and file information

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

  • metrics (numpy.ndarray) – Calculated metrics for starting model, used for evaluating error

  • species_limbo (list of str) – List of species to consider removal

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

  • 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.

Returns

species_errors – Maximum errors induced by removal of each limbo species

Return type

numpy.ndarray

pymars.sensitivity_analysis.run_sa(model_file, starting_error, ignition_conditions, psr_conditions, flame_conditions, error_limit, species_safe, phase_name='', algorithm_type='greedy', species_limbo=[], num_threads=1, path='')

Runs a sensitivity analysis to remove species on a given model.

Parameters
  • model_file (str) – Model being analyzed

  • starting_error (float) – Error percentage between the reduced and original models

  • 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.

  • error_limit (float) – Maximum allowable error level for reduced model

  • species_safe (list of str) – List of species names to always be retained

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

  • algorithm_type ({'initial', 'greedy'}) – Type of sensitivity analysis: initial (order based on initial error), or greedy (all species error re-evaluated after each removal)

  • species_limbo (list of str, optional) – List of species to consider; if empty, consider all not in species_safe

  • 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.

  • path (str, optional) – Optional path for writing files

Returns

Return reduced model and associated metadata

Return type

ReducedModel