rizer.transport.loaders#

Build momentum-transfer collision-frequency/cross-section models from config.

Species-name dispatch and YAML/LXCat-file-driven model construction for rizer.transport.collision_frequency and rizer.transport.cross_sections – config/IO plumbing, not the transport-property physics itself (which stays in those two modules).

Attributes#

logger

DEFAULT_COLLISION_FREQUENCY_MODEL_PATH

Path to the repo-wide default per-species collision-frequency model mapping.

Functions#

get_momentum_transfer_cross_section_model(species[, ...]) → rizer.transport.cross_sections.MomentumTransferCrossSectionModel

Get the momentum transfer cross section model for a given species.

get_momentum_transfer_collision_frequency_model(species) → rizer.transport.collision_frequency.MomentumTransferCollisionFrequencyModel

Get the momentum transfer collision frequency model for a given species.

get_default_collision_frequency_model() → dict[str, dict[str, str | float]]

Load the repo-wide default per-species collision-frequency model mapping.

get_momentum_transfer_collision_frequencies_list(...) → list[rizer.transport.collision_frequency.MomentumTransferCollisionFrequencyModel]

Get a list of momentum transfer collision frequency models for the given species.

get_default_momentum_transfer_collision_frequencies(...) → list[rizer.transport.collision_frequency.MomentumTransferCollisionFrequencyModel]

Momentum-transfer collision frequencies for species_names, default model.

Module Contents#

rizer.transport.loaders.logger#
rizer.transport.loaders.DEFAULT_COLLISION_FREQUENCY_MODEL_PATH#

Path to the repo-wide default per-species collision-frequency model mapping.

Loaded by get_default_collision_frequency_model(), using the same loose-YAML-number parsing (parse_convert_yaml()) as any other simulation input YAML.

rizer.transport.loaders.get_momentum_transfer_cross_section_model(species: str, use_default_radius: bool = False, use_first_available: bool = False, database_to_use: str | None = None, default_radius: float = 1e-10) → rizer.transport.cross_sections.MomentumTransferCrossSectionModel#

Get the momentum transfer cross section model for a given species.

Parameters:
  • species (str) – Name of the species (e.g. “CH4”, “Ar”, “N2”).

  • use_default_radius (bool, optional) – If True, use the default radius for the species if the cross section data is not found in the database.

  • use_first_available (bool, optional) – If True, use the first available cross section data file for the species if multiple files are found in the database. If False, raise an error if multiple files are found.

  • database_to_use (str, optional) – If specified, use this file for the cross section data. This is useful if you want to use a specific file from the database, regardless of the species name.

  • default_radius (float, optional) – Default radius in m to use if the cross section data is not found in the database. By default, it is set to 1e-10 m.

Returns:

The momentum transfer cross section model for the given species.

Return type:

MomentumTransferCrossSectionModel

rizer.transport.loaders.get_momentum_transfer_collision_frequency_model(species: str, use_default_radius: bool = False, use_first_available: bool = False, database_to_use: str | None = None, default_radius: float = 1e-10) → rizer.transport.collision_frequency.MomentumTransferCollisionFrequencyModel#

Get the momentum transfer collision frequency model for a given species.

Parameters:
  • species (str) – Name of the species (e.g. “CH4”, “Ar”, “N2”).

  • use_default_radius (bool, optional) – If True, use the default radius for the species if the cross section data is not found in the database.

  • use_first_available (bool, optional) – If True, use the first available cross section data file for the species if multiple files are found in the database. If False, raise an error if multiple files are found.

  • database_to_use (str, optional) – If specified, use this file for the cross section data. This is useful if you want to use a specific file from the database, regardless of the species name.

  • default_radius (float, optional) – Default radius in m to use if the cross section data is not found in the database. By default, it is set to 1e-10 m.

Returns:

The momentum transfer collision frequency model for the given species.

Return type:

MomentumTransferCollisionFrequencyModel

rizer.transport.loaders.get_default_collision_frequency_model() → dict[str, dict[str, str | float]]#

Load the repo-wide default per-species collision-frequency model mapping.

The mapping is stored in a standalone YAML file next to this module (rather than duplicated in every simulation input YAML), and reused as-is by get_momentum_transfer_collision_frequencies_list().

Returns:

Parsed content of DEFAULT_COLLISION_FREQUENCY_MODEL_PATH, in the format expected by get_momentum_transfer_collision_frequencies_list().

Return type:

dict of str to dict of str to str or float

rizer.transport.loaders.get_momentum_transfer_collision_frequencies_list(species_names: list[str], collision_frequency_model: dict[str, dict[str, str | float]]) → list[rizer.transport.collision_frequency.MomentumTransferCollisionFrequencyModel]#

Get a list of momentum transfer collision frequency models for the given species.

Parameters:
  • species_names (list of str) – List of species names for which to get the momentum transfer collision frequency models.

  • collision_frequency_model (dict of str to dict of str to str or float) –

    A dictionary containing the collision frequency model information for each species. The keys are the species names and the values are dictionaries containing the model information. The expected keys in the inner dictionaries are:

    • ”model”: The type of collision frequency model to use. Supported values are “tabulated”, “hard-sphere” and “alias”.

    • For “tabulated” model:

      • ”database”: The name of the database to use for the tabulated cross section. This should correspond to a file in the data/cross_section folder.

    • For “hard-sphere” model:

      • ”radius”: The effective radius of the species in meters to use for the hard-sphere cross section.

    • For “alias” model:

      • ”data_from”: The path/species to use for the alias. This should correspond to a file in the data/cross_section folder.

      • ”database”: The name of the database to use for the alias.

Returns:

A list of momentum transfer collision frequency models corresponding to the given species names and the specified collision frequency models in the input dictionary.

Return type:

list of MomentumTransferCollisionFrequencyModel

Raises:
  • ValueError – If the collision frequency model specified for a species is unknown or if required parameters are missing for the specified model.

  • ValueError – If the database name for a tabulated model is not a string.

rizer.transport.loaders.get_default_momentum_transfer_collision_frequencies(species_names: list[str]) → list[rizer.transport.collision_frequency.MomentumTransferCollisionFrequencyModel]#

Momentum-transfer collision frequencies for species_names, default model.

The two-call spelling get_momentum_transfer_collision_frequencies_list(names, get_default_collision_frequency_model()) is what almost every caller wants; this is that pair, so a caller that is not choosing a non-default model does not have to name one.

Parameters:

species_names (list of str) – Species of the phase the models are built for, in its own order.

Returns:

One entry per species, in the same order.

Return type:

list of MomentumTransferCollisionFrequencyModel