Flow_meter.py Division by Zero Error
minix1234 opened this issue · comments
When the isentropic exponent is given as exactly 1 for meters of the type that call nozzle_expansibility (https://github.com/CalebBell/fluids/blob/master/fluids/flow_meter.py#L1306) a division by zero error occurs. This is due to the /(k-1) factor on the following line. https://github.com/CalebBell/fluids/blob/master/fluids/flow_meter.py#L1363
This function is called by the following meter types.
HOLLINGSHEAD_WEDGE
HOLLINGSHEAD_VENTURI_SMOOTH
HOLLINGSHEAD_VENTURI_SHARP
WEDGE_METER
MACHINED_CONVERGENT_VENTURI_TUBE
LONG_RADIUS_NOZZLE
MILLER_CONICAL_ORIFICE
ISO_15377_CONICAL_ORIFICE
ISA_1932_NOZZLE
VENTURI_NOZZLE
AS_CAST_VENTURI_TUBE
MACHINED_CONVERGENT_VENTURI_TUBE
ROUGH_WELDED_CONVERGENT_VENTURI_TUBE
Hi,
This one was a pretty easy fix; that method had a straightforward mathematical limit which could be taken to obtain an accurate result for the case of k=1
. The fix is now in fluids 1.0.13. Thank you for reporting it!
Sincerely,
Caleb