-
Notifications
You must be signed in to change notification settings - Fork 83
Open
Description
Summary
Added the parameter m (mass flow rate) to size_control_valve_g. If m is provided, the function automatically calculates the required standard volumetric flow Q based on the gas molecular weight and standard conditions (, ).
Changes
- New Parameter:
m(mass flow rate in ). - Logic: If
mis specified andQisNone, is derived using the Ideal Gas Law at standard conditions.
Technical Implementation
The conversion follows this simple logic:
- Standard Density:
- Conversion:
Example Usage
from fluids.control_valve import size_control_valve_g
# Old way (Manual conversion to standard m^3/s)
# Q_std = 0.5
# Kv = size_control_valve_g(..., Q=Q_std)
# New way (Directly using mass flow)
Kv = size_control_valve_g(T1=300, MW=28.97, mu=1.8e-5, gamma=1.4, Z=0.99,
P1=1e6, P2=8e5, m=2.5) # m in kg/sWhy this is better
- Reduced Error: Users often confuse "Standard" () and "Normal" ( or ) conditions. Handling this internally ensures the math matches the ISA-75.01.01 standard used by the library.
- Cleaner Code: Removes the need for the user to import constants () and perform density calculations before calling the function.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels