bird.preprocess.species_gen package

bird.preprocess.species_gen.setup_thermo_prop module

bird.preprocess.species_gen.setup_thermo_prop.compare_old_new_prop(key_seq_old: list[str], key_seq_new: list[str], old_dict: dict, new_dict: dict, spec_name: str, phase: str, type_name='float') str

Compare old and new thermo properties and report any mismatch

Parameters:
  • key_seq_old (list[str]) – Sequence of keys in the old dict that gives access to the old property value

  • key_seq_new (list[str]) – Sequence of keys in the new dict that gives access to the new property value

  • old_dict (dict) – Old dictionary of values

  • new_dict (dict) – New dictionary of values

  • spec_name (str) – Name of the species (useful for reporting mismatch)

  • phase (str) – Name of the phase (useful for reporting mismatch)

  • type_name (str) – Name of the data type compared (useful for detecting mismatch). Can be ‘float’ or ‘list’ for now

Returns:

status – Whether comparison was successful or not, allows for handling missing keys

Return type:

str

bird.preprocess.species_gen.setup_thermo_prop.get_species_key_pair(thermo_properties: dict, species_name: list[str]) dict

Find the key where are stored the species info

Parameters:
  • thermo_properties (dict) – Dictionary of thermo properties

  • species_name (list[str]) – List of species names

Returns:

pair_species_keys – Pair of species names and dictionary key

Return type:

dict

bird.preprocess.species_gen.setup_thermo_prop.get_species_properties(species_name: list[str]) dict

Get thermo properties of species

Parameters:

species_name (list[str]) – List of species names

Returns:

species_prop – Dictionary of species properties

Return type:

dict

bird.preprocess.species_gen.setup_thermo_prop.update_gas_thermo_prop(thermo_properties: dict, species_prop: dict, pair_species_keys: dict) dict

Update gas thermo properties

Parameters:
  • thermo_properties (dict) – Dictionary of thermo properties

  • species_prop (dict) – Dictionary of species properties

  • pair_species_keys (dict) – Dictionary that maps species name to thermo properties key

Returns:

thermo_properties – Updated gas thermo properties

Return type:

dict

bird.preprocess.species_gen.setup_thermo_prop.update_liq_thermo_prop(thermo_properties: dict, species_prop: dict, pair_species_keys: dict) dict

Update liquid thermo properties

Parameters:
  • thermo_properties (dict) – Dictionary of thermo properties

  • species_prop (dict) – Dictionary of species properties

  • pair_species_keys (dict) – Dictionary that maps species name to thermo properties key

Returns:

thermo_properties – Updated liquid thermo properties

Return type:

dict

bird.preprocess.species_gen.setup_thermo_prop.write_species_properties(case_folder: str, phase: str = 'gas') None

Write thermo properties open foam dict

Parameters:
  • case_folder (str) – Path to OpenFOAM case

  • phase (str) – Name of phase where to find the species