You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue duplicates #8 (you can read the discussion). So I'll close it.
In a future version of PyFluids, the ability to select a units system using a configuration file will be implemented. Due to the large load in the very near future, I will not have time to implement it. I think I'll find the time next month.
If you want to speed up the process, you can make a pull request.
Could you offer the option of using Kelvin as the temperature unit for both the input and all output properties?
I have added a sample code.
from pyfluids import Fluid, FluidsList, Input
def celsius_to_kelvin(temp_c):
return temp_c + 273.15
def kelvin_to_celsius(temp_k):
return temp_k - 273.15
def fluid_properties(fluid, pressure, temperature_k):
temperature_c = kelvin_to_celsius(temperature_k)
fluid_instance = Fluid(fluid).with_state(Input.pressure(pressure), Input.temperature(temperature_c))
selected_fluid = FluidsList.Nitrogen
pressure = 100e3
temperature_k = -20 + 273.15 # Convert -20°C to Kelvin
properties = fluid_properties(selected_fluid, pressure, temperature_k)
print(properties)
The text was updated successfully, but these errors were encountered: