citysim_components_hydraulics
Functions to compute pressure and its derivatives for citysim components
- compute_dp_pump_cs(mdot: float | ndarray, rpm: float | ndarray = 2500.0, rpm_max: float | ndarray = 5000.0, a0: float | ndarray = 1200000.0, a1: float | ndarray = 0.0, a2: float | ndarray = 0.0) float | ndarray [source]
Computes the differential pressure in pumps using the following equation:
\[\Delta p = -\left( a_0 \frac{n^2}{n_0^2} + a_1 \frac{n}{n_0} + a_2 \ \right), \; \text{if } \dot m \geq 0\]\[\Delta p = - a_0 \frac{n^2}{n_0^2}, \; \text{otherwise}\]- Parameters:
mdot (float | ndarray) – Mass flow (kg/s).
rpm (float | ndarray, optional) – Speed in revolutions per minute \(n\): (1/min). The default is 2500.0.
rpm_max (float | ndarray, optional) – Maximum speed in revolutions per minute \(n_0\): (1/min). The default is 5000.0.
a0 (float | ndarray, optional) – First pump parameter. The default is 1200000.0.
a1 (float | ndarray, optional) – Second pump parameter. The default is 0.0.
a2 (float | ndarray, optional) – Third pump parameter. The default is 0.0.
- Returns:
Pressure difference (Pa).
- Return type:
float | ndarray
- compute_dp_pump_cs_der(mdot: float | ndarray[float], rpm: float | ndarray = 2500.0, rpm_max: float | ndarray = 5000.0, a0: float | ndarray = 1200000.0, a1: float | ndarray = 0.0, a2: float | ndarray = 0.0) float | ndarray [source]
Returns the derivative of
compute_dp_pump_cs()
.- Parameters:
mdot (float | ndarray) – Mass flow (kg/s).
rpm (float | ndarray, optional) – Speed in revolutions per minute \(n\): (1/min). The default is 2500.0.
rpm_max (float | ndarray, optional) – Maximum speed in revolutions per minute \(n_0\): (1/min). The default is 5000.0.
a0 (float | ndarray, optional) – First pump parameter. The default is 1200000.0.
a1 (float | ndarray, optional) – Second pump parameter. The default is 0.0.
a2 (float | ndarray, optional) – Third pump parameter. The default is 0.0.
- Returns:
Value of the derivative.
- Return type:
float | ndarray
- compute_dp_valve_cs(mdot: float | ndarray, kv: float | ndarray = 0.0, rho_fluid: float | ndarray = 990.0) float | ndarray [source]
Computes the differential pressure in valves according to the formula:
\[\Delta p = \frac{1.296 \cdot 10^9}{\rho K_v^2} \| \dot m \| \dot m\]- Parameters:
mdot (float | ndarray) – Mass flow in kg/s.
kv (float | ndarray, optional) – Flow coefficient \(K_v\). The default is 0.0.
rho_fluid (float | ndarray, optional) – Density (kg/m^3) of the fluid. The default is 990.0.
- Returns:
Pressure difference (Pa).
- Return type:
float | ndarray
- compute_dp_valve_cs_der(mdot: float | ndarray, kv: float | ndarray = 0.0, rho_fluid: float | ndarray = 990.0) float | ndarray [source]
Returns the derivative of
compute_dp_valve_cs()
.- Parameters:
mdot (float | ndarray) – Mass flow in kg/s.
kv (float | ndarray, optional) – Flow coefficient \(K_v\). The default is 0.0.
rho_fluid (float | ndarray, optional) – Density (kg/m^3) of the fluid. The default is 990.0.
- Returns:
Value of the derivative.
- Return type:
float | ndarray