Skip to content

Commit aa7a87f

Browse files
authored
Merge pull request #1532 from RWTH-EBC/1520_newHPModels
1520 new hp models
2 parents ab02aa0 + 80e62bb commit aa7a87f

255 files changed

Lines changed: 3223 additions & 1217 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AixLib/Controls/HeatPump/BaseClasses/InverterControlledHP.mo

Lines changed: 0 additions & 43 deletions
This file was deleted.

AixLib/Controls/HeatPump/BaseClasses/OnOffHP.mo

Lines changed: 0 additions & 29 deletions
This file was deleted.

AixLib/Controls/HeatPump/BaseClasses/PartialHPController.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
within AixLib.Controls.HeatPump.BaseClasses;
22
partial model PartialHPController
33
"Base class of a heat pump controller with bus interface"
4-
AixLib.Controls.Interfaces.VapourCompressionMachineControlBus heatPumpControlBus
4+
AixLib.Fluid.HeatPumps.ModularReversible.BaseClasses.RefrigerantMachineControlBus heatPumpControlBus
55
annotation (Placement(transformation(
66
extent={{-29.5,-29.5},{29.5,29.5}},
77
rotation=270,

AixLib/Controls/HeatPump/BaseClasses/PartialTSetToNSet.mo

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,84 +5,92 @@ partial model PartialTSetToNSet
55
"True to choose a bivalent system" annotation(choices(checkBox=true));
66

77
// Heating limit temperature
8+
parameter Boolean use_heaLim=true "=false to disable moving average heating limit" annotation (Dialog(group="Heating limit temperature"));
89
parameter Modelica.Units.SI.Temperature T_heaLim=293.15
9-
"Heating limit temperature. If the filtered outdoor air temperature surpasses this threshold, the device will be shut down"
10-
annotation (Dialog(group="Heating limit temperature"));
10+
"Heating limit temperature. If the filtered outdoor air temperature surpasses this threshold, the device will be shut down" annotation(Dialog(group=
11+
"Heating limit temperature", enable=use_heaLim));
1112
parameter Modelica.Units.SI.Time movAveTime=300
12-
"Time span for building the average of the outdoor air temperature. Used for heating limit temperature"
13-
annotation (Dialog(group="Heating limit temperature"));
13+
"Time span for building the average of the outdoor air temperature. Used for heating limit temperature" annotation (Dialog(group=
14+
"Heating limit temperature", enable=use_heaLim));
1415

15-
AixLib.Utilities.Logical.SmoothSwitch swiNullHP "If HP is off, zero is passed"
16-
annotation (Placement(transformation(extent={{66,-10},{86,10}})));
16+
Modelica.Blocks.Logical.Switch swiNullHP "If HP is off, zero is passed"
17+
annotation (Placement(transformation(extent={{60,-20},{80,0}})));
1718
Modelica.Blocks.Sources.Constant conZer(final k=0)
1819
"If an error occurs, the compressor speed is set to zero"
19-
annotation (Placement(transformation(extent={{38,-24},{50,-12}})));
20+
annotation (Placement(transformation(extent={{20,-50},{40,-30}})));
2021
Modelica.Blocks.Interfaces.RealInput TSet(
2122
final quantity="ThermodynamicTemperature",
2223
final unit="K",
2324
final displayUnit="degC") "Set temperature"
2425
annotation (Placement(transformation(extent={{-132,44},{-100,76}})));
2526
Modelica.Blocks.Interfaces.RealOutput nOut "Relative speed of compressor. From 0 to 1"
2627
annotation (Placement(transformation(extent={{100,-10},{120,10}})));
27-
AixLib.Controls.Interfaces.VapourCompressionMachineControlBus sigBusHP
28-
annotation (Placement(transformation(extent={{-124,-42},{-90,-12}})));
28+
AixLib.Fluid.HeatPumps.ModularReversible.BaseClasses.RefrigerantMachineControlBus sigBusHP
29+
annotation (Placement(transformation(extent={{-124,-46},{-90,-16}})));
2930
Modelica.Blocks.Interfaces.RealOutput ySecHeaGen if use_secHeaGen
3031
"Relative power of second heat generator, from 0 to 1"
3132
annotation (Placement(transformation(
3233
extent={{-10,-10},{10,10}},
3334
rotation=-90,
34-
origin={12,-108})));
35-
Modelica.Blocks.Interfaces.RealInput TAct(
35+
origin={0,-110})));
36+
Modelica.Blocks.Interfaces.RealInput TMea(
3637
final quantity="ThermodynamicTemperature",
3738
final unit="K",
3839
final displayUnit="degC") "Actual temperature, control variable"
3940
annotation (Placement(transformation(
4041
extent={{16,16},{-16,-16}},
4142
rotation=180,
4243
origin={-116,-80})));
43-
Utilities.Logical.SmoothSwitch swiNullsecHeaGen if use_secHeaGen
44+
AixLib.Utilities.Logical.SmoothSwitch swiNullsecHeaGen if use_secHeaGen
4445
"If second heater is off, zero is passed" annotation (Placement(
4546
transformation(
46-
extent={{8,-8},{-8,8}},
47+
extent={{10,-10},{-10,10}},
4748
rotation=90,
48-
origin={12,-84})));
49-
Utilities.Math.MovingAverage movAve(final aveTime=movAveTime)
49+
origin={0,-70})));
50+
AixLib.Utilities.Math.MovingAverage movAve(final aveTime=movAveTime, final u_start=0)
51+
if use_heaLim
5052
"Moving average to account for fluctuations in the outdoor air temperature"
51-
annotation (Placement(transformation(extent={{-88,-34},{-76,-20}})));
53+
annotation (Placement(transformation(extent={{-92,-40},{-72,-20}})));
5254
Modelica.Blocks.Logical.And andHeaLim
5355
"Check if control and heating limit temperature yield true to turn the device on"
54-
annotation (Placement(transformation(extent={{38,-6},{50,6}})));
56+
annotation (Placement(transformation(extent={{20,-20},{40,0}})));
5557
Modelica.Blocks.Logical.LessThreshold lessThreshold(final threshold=
56-
T_heaLim)
57-
annotation (Placement(transformation(extent={{-66,-34},{-52,-20}})));
58+
T_heaLim) if use_heaLim
59+
annotation (Placement(transformation(extent={{-60,-40},{-40,-20}})));
5860

5961

6062

63+
Modelica.Blocks.Sources.BooleanConstant booleanConstant(final k=true)
64+
if not use_heaLim
65+
annotation (Placement(transformation(extent={{-60,-80},{-40,-60}})));
6166
equation
62-
connect(conZer.y, swiNullHP.u3) annotation (Line(points={{50.6,-18},{58,-18},
63-
{58,-8},{64,-8}}, color={0,0,127}));
67+
connect(conZer.y, swiNullHP.u3) annotation (Line(points={{41,-40},{54,-40},{
68+
54,-18},{58,-18}},color={0,0,127}));
6469
connect(swiNullHP.y, nOut)
65-
annotation (Line(points={{87,0},{110,0}}, color={0,0,127}));
70+
annotation (Line(points={{81,-10},{98,-10},{98,0},{110,0}},
71+
color={0,0,127}));
6672
connect(swiNullsecHeaGen.y, ySecHeaGen)
67-
annotation (Line(points={{12,-92.8},{12,-108}},
68-
color={0,0,127}));
69-
connect(conZer.y, swiNullsecHeaGen.u3) annotation (Line(points={{50.6,-18},{
70-
70,-18},{70,-74.4},{18.4,-74.4}},
71-
color={0,0,127}));
73+
annotation (Line(points={{-8.88178e-16,-81},{-8.88178e-16,-98},{0,-98},{0,
74+
-110}}, color={0,0,127}));
75+
connect(conZer.y, swiNullsecHeaGen.u3) annotation (Line(points={{41,-40},{70,
76+
-40},{70,-58},{8,-58}}, color={0,0,127}));
7277
connect(sigBusHP.T_oda, movAve.u) annotation (Line(
73-
points={{-107,-27},{-94,-27},{-94,-27},{-89.2,-27}},
78+
points={{-107,-31},{-94,-31},{-94,-30}},
7479
color={255,204,51},
7580
thickness=0.5), Text(
7681
string="%first",
7782
index=-1,
7883
extent={{-3,-6},{-3,-6}},
7984
horizontalAlignment=TextAlignment.Right));
8085
connect(movAve.y, lessThreshold.u)
81-
annotation (Line(points={{-75.4,-27},{-67.4,-27}}, color={0,0,127}));
82-
connect(lessThreshold.y, andHeaLim.u2) annotation (Line(points={{-51.3,-27},{-26,
83-
-27},{-26,-4.8},{36.8,-4.8}}, color={255,0,255}));
86+
annotation (Line(points={{-71,-30},{-62,-30}}, color={0,0,127}));
87+
connect(lessThreshold.y, andHeaLim.u2) annotation (Line(points={{-39,-30},{
88+
-26,-30},{-26,-18},{18,-18}}, color={255,0,255}));
8489
connect(andHeaLim.y, swiNullHP.u2)
85-
annotation (Line(points={{50.6,0},{64,0}}, color={255,0,255}));
90+
annotation (Line(points={{41,-10},{58,-10}},
91+
color={255,0,255}));
92+
connect(booleanConstant.y, andHeaLim.u2) annotation (Line(points={{-39,-70},{
93+
-26,-70},{-26,-18},{18,-18}}, color={255,0,255}));
8694
annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={
8795
Rectangle(
8896
extent={{-100,100},{100,-100}},
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
InverterControlledHP
2-
OnOffHP
31
PartialHPController
42
PartialTSetToNSet
Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
within AixLib.Controls.HeatPump;
2+
model DefrostControl
3+
"Control block to ensure no frost limits heat flow at the evaporator"
4+
parameter Real minIceFac "Minimal value above which no defrost is necessary";
5+
6+
parameter Real deltaIceFac = 0.1 "Bandwitdth for hystereses. If the icing factor is based on the duration of defrost, this value is necessary to avoid state-events.";
7+
Modelica.Blocks.Interfaces.BooleanInput hea
8+
annotation (Placement(transformation(extent={{-132,-36},{-100,-4}})));
9+
Modelica.Blocks.Interfaces.RealInput ySet
10+
"Set value relative speed of compressor. Analog from 0 to 1"
11+
annotation (Placement(transformation(extent={{-132,4},{-100,36}})));
12+
Utilities.Logical.SmoothSwitch swiErr
13+
"If an error occurs, the value of the conZero block will be used(0)"
14+
annotation (Placement(transformation(extent={{58,2},{78,22}})));
15+
Modelica.Blocks.Sources.Constant conOne(final k=1)
16+
"If Defrost is enabled, HP runs at full power"
17+
annotation (Placement(transformation(extent={{0,-10},{20,10}})));
18+
Modelica.Blocks.Interfaces.RealOutput yOut
19+
"Relative speed of compressor. From 0 to 1"
20+
annotation (Placement(transformation(extent={{100,10},{120,30}})));
21+
Modelica.Blocks.Interfaces.BooleanOutput heaOut
22+
annotation (Placement(transformation(extent={{100,-30},{120,-10}})));
23+
Fluid.HeatPumps.ModularReversible.BaseClasses.RefrigerantMachineControlBus sigBus
24+
annotation (Placement(transformation(extent={{-120,-76},{-92,-48}})));
25+
Modelica.Blocks.Logical.Hysteresis iceFacGreMinChi(
26+
final uLow=minIceFac,
27+
final uHigh=minIceFac + deltaIceFac,
28+
final pre_y_start=true)
29+
"Check if icing factor is greater than a boundary" annotation (Placement(
30+
transformation(
31+
extent={{-10.5,-10.5},{10.5,10.5}},
32+
rotation=0,
33+
origin={-49.5,-61.5})));
34+
Modelica.Blocks.Logical.LogicalSwitch logicalSwitch
35+
"If a chiller is used to defrost, mode will be false"
36+
annotation (Placement(transformation(extent={{58,-42},{78,-22}})));
37+
Modelica.Blocks.Sources.BooleanConstant conTrueUseChi(final k=false)
38+
"Set mode to false to simulate the defrost cycle"
39+
annotation (Placement(transformation(extent={{20,-80},{40,-60}})));
40+
equation
41+
connect(conOne.y, swiErr.u3) annotation (Line(points={{21,0},{46,0},{46,4},{
42+
56,4}}, color={0,0,127}));
43+
connect(swiErr.y,yOut) annotation (Line(points={{79,12},{96,12},{96,20},{110,
44+
20}}, color={0,0,127}));
45+
connect(ySet, swiErr.u1) annotation (Line(points={{-116,20},{56,20}},
46+
color={0,0,127}));
47+
48+
connect(sigBus.iceFacMea, iceFacGreMinChi.u) annotation (Line(
49+
points={{-106,-62},{-84.05,-62},{-84.05,-61.5},{-62.1,-61.5}},
50+
color={255,204,51},
51+
thickness=0.5), Text(
52+
string="%first",
53+
index=-1,
54+
extent={{-6,3},{-6,3}},
55+
horizontalAlignment=TextAlignment.Right));
56+
connect(iceFacGreMinChi.y, swiErr.u2) annotation (Line(
57+
points={{-37.95,-61.5},{8,-61.5},{8,-32},{44,-32},{44,12},{56,12}},
58+
color={255,0,255}));
59+
connect(logicalSwitch.y, heaOut) annotation (Line(points={{79,-32},{84,-32},{84,
60+
-20},{110,-20}}, color={255,0,255}));
61+
connect(hea, logicalSwitch.u1) annotation (Line(points={{-116,-20},{-32,-20},{
62+
-32,-24},{56,-24}}, color={255,0,255}));
63+
connect(iceFacGreMinChi.y, logicalSwitch.u2) annotation (Line(
64+
points={{-37.95,-61.5},{8,-61.5},{8,-32},{56,-32}},
65+
color={255,0,255}));
66+
connect(conTrueUseChi.y, logicalSwitch.u3) annotation (Line(
67+
points={{41,-70},{48,-70},{48,-40},{56,-40}},
68+
color={255,0,255}));
69+
annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,
70+
-100},{100,80}}), graphics={
71+
Rectangle(
72+
extent={{-100,100},{100,-100}},
73+
lineColor={28,108,200},
74+
fillColor={255,255,170},
75+
fillPattern=FillPattern.Solid),
76+
Line(
77+
points={{-36,34},{-36,-6}},
78+
color={28,108,200}),
79+
Line(
80+
points={{0,20},{0,-20}},
81+
color={28,108,200},
82+
origin={-36,14},
83+
rotation=90),
84+
Line(
85+
points={{-14,14},{14,-14}},
86+
color={28,108,200},
87+
origin={-36,14},
88+
rotation=90),
89+
Line(
90+
points={{14,14},{-14,-14}},
91+
color={28,108,200},
92+
origin={-36,14},
93+
rotation=90),
94+
Line(
95+
points={{8,64},{8,24}},
96+
color={28,108,200}),
97+
Line(
98+
points={{0,20},{0,-20}},
99+
color={28,108,200},
100+
origin={8,44},
101+
rotation=90),
102+
Line(
103+
points={{-14,14},{14,-14}},
104+
color={28,108,200},
105+
origin={8,44},
106+
rotation=90),
107+
Line(
108+
points={{14,14},{-14,-14}},
109+
color={28,108,200},
110+
origin={8,44},
111+
rotation=90),
112+
Line(
113+
points={{-34,-22},{-34,-62}},
114+
color={28,108,200}),
115+
Line(
116+
points={{0,20},{0,-20}},
117+
color={28,108,200},
118+
origin={-34,-42},
119+
rotation=90),
120+
Line(
121+
points={{-14,14},{14,-14}},
122+
color={28,108,200},
123+
origin={-34,-42},
124+
rotation=90),
125+
Line(
126+
points={{14,14},{-14,-14}},
127+
color={28,108,200},
128+
origin={-34,-42},
129+
rotation=90),
130+
Line(
131+
points={{14,6},{14,-34}},
132+
color={28,108,200}),
133+
Line(
134+
points={{0,20},{0,-20}},
135+
color={28,108,200},
136+
origin={14,-14},
137+
rotation=90),
138+
Line(
139+
points={{-14,14},{14,-14}},
140+
color={28,108,200},
141+
origin={14,-14},
142+
rotation=90),
143+
Line(
144+
points={{14,14},{-14,-14}},
145+
color={28,108,200},
146+
origin={14,-14},
147+
rotation=90),
148+
Text(
149+
extent={{-104,100},{106,76}},
150+
lineColor={28,108,200},
151+
lineThickness=0.5,
152+
fillColor={255,255,255},
153+
fillPattern=FillPattern.None,
154+
textString="%name")}), Diagram(
155+
coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,
156+
100}})),
157+
Documentation(info="<html><p>
158+
Basic model for a defrost control. The icing factor is calculated in
159+
the heat pump based on functions or other models.
160+
</p>
161+
<p>
162+
If a given lower boundary is surpassed, the mode of the heat pump
163+
will be set to false(eq. Chilling) and the compressor speed is set to
164+
1 to make the defrost process as fast as possible.
165+
</p>
166+
<ul>
167+
<li>
168+
<i>August 27, 2024</i> by Fabian Wüllhorst:<br/>
169+
Adapted to new heat pump approach (see issue <a href=
170+
\"https://github.com/RWTH-EBC/AixLib/issues/1520\">#1520</a>)
171+
</li>
172+
<li>
173+
<i>November 26, 2018&#160;</i> by Fabian Wüllhorst:<br/>
174+
First implementation (see issue <a href=
175+
\"https://github.com/RWTH-EBC/AixLib/issues/577\">#577</a>)
176+
</li>
177+
</ul>
178+
</html>"));
179+
end DefrostControl;

0 commit comments

Comments
 (0)