ThermostaticValve: Condition for leakageOpening
Condition for leakageOpening must be changed from:
if TempDiff > P then
opening = leakageOpening;
else
opening = min(1, (P - TempDiff) * Kv_setT / Kvs / P);
end if;
to (first line changes):
if TempDiff > P * (1- leakageOpening * Kvs / Kv_setT) then
opening = leakageOpening;
else
opening = min(1, (P - TempDiff) * Kv_setT / Kvs / P);
end if;
I have attached an example model and the corresponding result plot showing the valve opening for 3 cases.
leakageOpening
is set to 0.01, but opening stays at 0 for the case TempDiff = P
(blue line). In case thatTempDiff
approaches from below P
and exceeds the threshold a step occurs (red line). Only the new condition is correct (green line) as the opening never drops below leakageOpening.