Skip to content

Commit

Permalink
Protect against division by zero
Browse files Browse the repository at this point in the history
Fixes  #55
  • Loading branch information
dietmarw committed Jan 4, 2024
1 parent cba81dd commit ddc8b9e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion OpenHPL/ElectroMech/Turbines/Turbine.mo
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ equation
look_up_table.u[1] = u_t "Link the guide vane opening";
C_v_ = if ValveCapacity then C_v else Vdot_n/sqrt(H_n*data.g*data.rho/data.p_a)/u_n
"Define guide vane 'valve capacity' base on the Nominal turbine parameters";
dp = Vdot ^ 2 * data.p_a / (C_v_ * u_t) ^ 2 "Turbine valve equation for pressure drop";
dp = Vdot ^ 2 * data.p_a / (C_v_ * max(1e-6, u_t)) ^ 2 "Turbine valve equation for pressure drop";
dp = i.p - o.p "Link the pressure drop to the ports";
Kdot_i_tr = dp * Vdot "Turbine energy balance";
if ConstEfficiency then
Expand Down

0 comments on commit ddc8b9e

Please sign in to comment.