Export4Converge
Functions
|
Export mixture fuel properties to csv files for Converge simulations. |
|
Main function to execute the export process. |
|
Validate that required fuel data files exist. |
Classes
|
Unit conversion factors and labels for different unit systems. |
- class Export4Converge.UnitConverter(units: str)
Bases:
objectUnit conversion factors and labels for different unit systems.
- create_data_dict(T, T_crit, mu, surface_tension, Lv, pv, rho, Cl, thermal_conductivity)
Create a data dictionary with converted units and appropriate labels.
- Parameters:
T (np.ndarray) – Temperature array.
T_crit (float) – Critical temperature.
mu (np.ndarray) – Viscosity array.
surface_tension (np.ndarray) – Surface tension array.
Lv (np.ndarray) – Heat of vaporization array.
pv (np.ndarray) – Vapor pressure array.
rho (np.ndarray) – Density array.
Cl (np.ndarray) – Specific heat array.
thermal_conductivity (np.ndarray) – Thermal conductivity array.
- Returns:
Dictionary with converted properties and labels.
- Return type:
dict
- Export4Converge.export_converge(fuel, path='/home/runner/work/FuelLib/FuelLib/exportData', units='mks', temp_min=0, temp_max=1000, temp_step=10, export_mix=False)
Export mixture fuel properties to csv files for Converge simulations.
- Parameters:
fuel (fl.fuel) – Fuel object containing properties to export.
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).
temp_min (float, optional (default: 0)) – Minimum temperature (K) for the property calculations.
temp_max (float, optional (default: 1000)) – Maximum temperature (K)for the property calculations.
temp_step (int, optional (default: 10)) – Step size for temperature (K).
export_mix (bool, optional (default: False)) – Whether to export individual component or mixture properties.
- Returns:
None
- Return type:
None
- Raises:
ValueError – If input parameters are invalid
TypeError – If fuel object is not a FuelLib fuel instance
- Export4Converge.main()
Main function to execute the export process.
- Parameters:
--fuel_name (str) – Name of the fuel (mandatory).
--fuel_data_dir (str, optional (default: FuelLib/fuelData)) – Directory where fuel data files are located.
--units (str, optional (default: mks)) – Units for critical properties. Options are mks or cgs.
--temp_min (float, optional (default: 0 K)) – Minimum temperature (K) for the property calculations.
--temp_max (float, optional (default: 1000 K)) – Maximum temperature (K) for the property calculations.
--temp_step (float, optional (default: 10 K)) – Step size for temperature (K).
--export_dir (str, optional (default: FuelLib/exportData)) – Directory to export the properties.
--export_mix (bool, optional (default: False)) – Whether to export individual component or mixture properties.
- Raises:
FileNotFoundError – If required files for the specified fuel are not found.
- Export4Converge.validate_fuel_files(fuel_name, fuel_data_dir)
Validate that required fuel data files exist.
- Parameters:
fuel_name (str) – Name of the fuel.
fuel_data_dir (str) – Directory containing fuel data files.
- Raises:
FileNotFoundError – If required files are missing.