Export4Pele
Functions
|
Create DataFrame for individual compound properties. |
|
Create DataFrame for mixture properties. |
|
Export fuel properties to input file for Pele simulations. |
|
Generate appropriate filename based on parameters. |
Get git commit hash and remote URL for file header. |
|
|
Main function to execute the export process. |
|
Convert a list or numpy array to a string representation. |
Classes
|
Unit conversion factors for different unit systems used in Pele exports. |
- class Export4Pele.UnitConverter(units: str)
Bases:
objectUnit conversion factors for different unit systems used in Pele exports.
- Export4Pele.create_individual_compounds_dataframe(fuel, compound_names, converter)
Create DataFrame for individual compound properties.
- Parameters:
fuel (FuelLib.Fuel) – Fuel object containing compound properties.
compound_names (list[str]) – List of compound names.
converter (UnitConverter) – Unit converter instance.
- Returns:
DataFrame with compound properties.
- Return type:
pd.DataFrame
- Export4Pele.create_mixture_dataframe(fuel, export_mix_name, converter)
Create DataFrame for mixture properties.
- Parameters:
fuel (FuelLib.Fuel) – Fuel object containing mixture properties.
export_mix_name (str or None) – Name for the exported mixture.
converter (UnitConverter) – Unit converter instance.
- Returns:
DataFrame with mixture properties.
- Return type:
pd.DataFrame
- Export4Pele.export_pele(fuel, path='/home/runner/work/FuelLib/FuelLib/exportData', units='mks', dep_fuel_names=None, use_pp_keys=True, export_mix=False, export_mix_name=None, liq_prop_model='gcm', psat_antoine=True)
Export fuel properties to input file for Pele simulations.
- Parameters:
fuel (fuel object) – An instance of the fuel class.
path (str, optional (default: FuelLib/exportData)) – Directory to save the input file.
units (str, optional (default: "mks")) – Units for the properties (“mks” for SI, “cgs” for CGS).
dep_fuel_names (list of str, optional (default: None)) – List or single fuel that each compound deposits to.
use_pp_keys (bool, optional) – Use the PelePhysics key for each compound (True or False). Default is False.
export_mix (bool, optional (default: False)) – Option to export mixture properties of the fuel (True or False).
export_mix_name (str, optional (default: None)) – Name the mixture if different than fuel_name.
liq_prop_model (str, optional (default: "gcm")) – Model for liquid properties. Options are “gcm” (default) or “mp”.
psat_antoine (bool, optional) – Use Antoine coefficients for vapor pressure in MP model (True or False). Default is True.
- Returns:
None
- Return type:
None
- Raises:
ValueError – If input parameters are invalid
TypeError – If fuel object is not a FuelLib fuel instance
- Export4Pele.get_filename(fuel_name, liq_prop_model, export_mix, path)
Generate appropriate filename based on parameters.
- Parameters:
fuel_name (str) – Name of the fuel.
liq_prop_model (str) – Liquid property model (‘gcm’ or ‘mp’).
export_mix (bool) – Whether exporting mixture properties.
path (str) – Directory path for output file.
- Returns:
Full path to output file.
- Return type:
str
- Export4Pele.get_git_info()
Get git commit hash and remote URL for file header.
- Returns:
Tuple containing git commit hash and remote URL.
- Return type:
tuple[str, str]
- Export4Pele.main()
Main function to execute the export process.
- Parameters:
--fuel_name (str) – Name of the fuel (mandatory).
--fuel_data_dir (str, optional) – Directory where fuel data files are located. Default is FuelLib/fuelData.
--fuel_decomp_name (str, optional) – Name of the decomposition file (optional). If not provided, defaults to fuel_name.
--units (str, optional) – Units for critical properties. Options are “mks” (default) or “cgs”.
--dep_fuel_names (str, optional) – Space-separated list with len(fuel.compounds) or single fuel that all compounds deposit. Default is fuel.compounds.
--use_pp_keys (bool, optional) – Use the PelePhysics key for each compound (True or False). Default is True.
--export_dir (str, optional) – Directory to export the properties. Default is “FuelLib/exportData”.
--export_mix (bool, optional) – Option to export mixture properties of the fuel (True or False). Default is False.
--export_mix_name (str, optional) – Name the mixture if different than fuel_name. Default is fuel_name.
--liq_prop_model (str, optional) – Model for liquid properties. Options are “gcm” (default) or “mp”.
--psat_antoine (bool, optional) – Use Antoine coefficients for vapor pressure in MP model (True or False). Default is True.
- Raises:
FileNotFoundError – If required files for the specified fuel are not found.
- Export4Pele.vec_to_str(vec)
Convert a list or numpy array to a string representation.
- Parameters:
vec (list or pd.Series or pd.DataFrame) – List or numpy array to convert.
- Returns:
String representation of the vector.
- Return type:
str