@@ -244,37 +244,30 @@ def RecoverableHeat(Twater_degC: float) -> float:
244
244
245
245
246
246
@lru_cache
247
- def vapor_pressure_water_kPa (Twater_degC : float , pressure : Optional [ PlainQuantity ] = None ) -> float :
247
+ def vapor_pressure_water_kPa (temperature_degC : float ) -> float :
248
248
"""
249
249
Calculate the vapor pressure of water as a function of temperature.
250
250
251
251
Args:
252
- Twater_degC: the temperature of water in degrees C
253
- pressure: Pressure - should be provided as a Pint quantity that knows its units
252
+ temperature_degC: the temperature of water in degrees C
254
253
Returns:
255
254
The vapor pressure of water as a function of temperature in kPa
256
255
Raises:
257
- ValueError: If Twater_degC is not a float or convertible to float.
258
- ValueError: If Twater_degC is below 0.
256
+ ValueError: If temperature_degC is not a float or convertible to float.
257
+ ValueError: If temperature_degC is below 0.
259
258
"""
260
259
261
- if not isinstance (Twater_degC , (int , float )):
262
- raise ValueError (f'Twater_degC ( { Twater_degC } ) must be a number' )
263
- if Twater_degC < 0 :
264
- raise ValueError (f'Twater_degC ( { Twater_degC } ) must be greater than or equal to 0' )
260
+ if not isinstance (temperature_degC , (int , float )):
261
+ raise ValueError (f'Input temperature ( { temperature_degC } ) must be a number' )
262
+ if temperature_degC < 0 :
263
+ raise ValueError (f'Input temperature ( { temperature_degC } C ) must be greater than or equal to 0' )
265
264
266
265
try :
267
- if pressure is not None :
268
- return (quantity (
269
- CP .PropsSI ('P' , 'T' , celsius_to_kelvin (Twater_degC ), 'P' , pressure .to ('Pa' ).magnitude , 'Water' ), 'Pa' )
270
- .to ('kPa' ).magnitude )
271
- else :
272
- _logger .warning (f'vapor_pressure_water: No pressure provided, using vapor quality=0 instead' )
273
- return (quantity (CP .PropsSI ('P' , 'T' , celsius_to_kelvin (Twater_degC ), 'Q' , 0 , 'Water' ), 'Pa' )
266
+ return (quantity (CP .PropsSI ('P' , 'T' , celsius_to_kelvin (temperature_degC ), 'Q' , 0 , 'Water' ), 'Pa' )
274
267
.to ('kPa' ).magnitude )
275
268
276
269
except (NotImplementedError , ValueError ) as e :
277
- raise ValueError (f'Input temperature { Twater_degC } is out of range or otherwise not implemented' ) from e
270
+ raise ValueError (f'Input temperature ( { temperature_degC } C) is out of range or otherwise not implemented' ) from e
278
271
279
272
280
273
@lru_cache
0 commit comments