Issue 1018: Division by zero error in valves
This closes #1018 (closed)
Due to a max function for the calculation of phi with zero as one option, division by zero occurs during simulation of hydraulic networks using the following valve models:
- AixLib.Fluid.Actuators.Valves.TwoWayEqualPercentage
- AixLib.Fluid.Actuators.Valves.TwoWayLinear
- AixLib.Fluid.Actuators.Valves.TwoWayPolynomial
- AixLib.Fluid.Actuators.Valves.TwoWayPressureIndependent
- AixLib.Fluid.Actuators.Valves.TwoWayQuickOpening
- AixLib.Fluid.Actuators.Valves.TwoWayTable
I changed the input of the max function as follows:
extends BaseClasses.PartialTwoWayValveKv(phi=max(0.1*l, l + y_actual*(1 - l)))
instead of
extends BaseClasses.PartialTwoWayValveKv(phi=max(0, l + y_actual*(1 - l)))