Skip to content

Commit

Permalink
Fix pump bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mdbartos committed Nov 13, 2023
1 parent 0328cc5 commit 2551362
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pipedream_solver/nsuperlink.py
Original file line number Diff line number Diff line change
Expand Up @@ -2716,8 +2716,8 @@ def numba_pump_flow_coefficients(_alpha_p, _beta_p, _chi_p, H_j, _z_inv_j, _Qp,
cond_0 = _H_up > _z_inv_up + _z_p
# Condition 1: Head difference is within range of pump curve
cond_1 = (_dHp > _dHp_min) & (_dHp < _dHp_max)
_dHp[_dHp > _dHp_max] = _dHp_max
_dHp[_dHp < _dHp_min] = _dHp_min
_dHp[_dHp > _dHp_max] = _dHp_max[_dHp > _dHp_max]
_dHp[_dHp < _dHp_min] = _dHp_min[_dHp < _dHp_min]
# Compute universal coefficients
_gamma_p = gamma_p(_Qp, _b_p, _c_p, u)
# Fill coefficient arrays
Expand Down Expand Up @@ -2748,8 +2748,8 @@ def numba_solve_pump_flows(H_j, u, _z_inv_j, _z_p, _dHp_max, _dHp_min, _a_p, _b_
_z_inv_up = _z_inv_j[_J_up]
# Create conditionals
_dHp = _H_dp - _H_up
_dHp[_dHp > _dHp_max] = _dHp_max
_dHp[_dHp < _dHp_min] = _dHp_min
_dHp[_dHp > _dHp_max] = _dHp_max[_dHp > _dHp_max]
_dHp[_dHp < _dHp_min] = _dHp_min[_dHp < _dHp_min]
cond_0 = _H_up > _z_inv_up + _z_p
# Compute universal coefficients
_Qp_next = (u / _b_p * (_a_p - _dHp))**(1 / _c_p)
Expand Down

0 comments on commit 2551362

Please sign in to comment.