Skip to content

Commit

Permalink
remove obsolete parameter n and its values different from 2 where the…
Browse files Browse the repository at this point in the history
…re is no information where they are coming from #1443
  • Loading branch information
DaJansenGit committed Dec 16, 2024
2 parents 8fb8bc0 + 7b8b4c8 commit 6817b3f
Show file tree
Hide file tree
Showing 289 changed files with 3,301 additions and 1,288 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

include:
project: 'EBC/EBC_all/gitlab_ci/templates'
ref: AixLibCI
ref: AixLibCI2024
file: 'modelica-ci-tests/scripts/.gitlab-ci.yml'
43 changes: 0 additions & 43 deletions AixLib/Controls/HeatPump/BaseClasses/InverterControlledHP.mo

This file was deleted.

29 changes: 0 additions & 29 deletions AixLib/Controls/HeatPump/BaseClasses/OnOffHP.mo

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
within AixLib.Controls.HeatPump.BaseClasses;
partial model PartialHPController
"Base class of a heat pump controller with bus interface"
AixLib.Controls.Interfaces.VapourCompressionMachineControlBus heatPumpControlBus
AixLib.Fluid.HeatPumps.ModularReversible.BaseClasses.RefrigerantMachineControlBus heatPumpControlBus
annotation (Placement(transformation(
extent={{-29.5,-29.5},{29.5,29.5}},
rotation=270,
Expand Down
72 changes: 40 additions & 32 deletions AixLib/Controls/HeatPump/BaseClasses/PartialTSetToNSet.mo
Original file line number Diff line number Diff line change
Expand Up @@ -5,84 +5,92 @@ partial model PartialTSetToNSet
"True to choose a bivalent system" annotation(choices(checkBox=true));

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

AixLib.Utilities.Logical.SmoothSwitch swiNullHP "If HP is off, zero is passed"
annotation (Placement(transformation(extent={{66,-10},{86,10}})));
Modelica.Blocks.Logical.Switch swiNullHP "If HP is off, zero is passed"
annotation (Placement(transformation(extent={{60,-20},{80,0}})));
Modelica.Blocks.Sources.Constant conZer(final k=0)
"If an error occurs, the compressor speed is set to zero"
annotation (Placement(transformation(extent={{38,-24},{50,-12}})));
annotation (Placement(transformation(extent={{20,-50},{40,-30}})));
Modelica.Blocks.Interfaces.RealInput TSet(
final quantity="ThermodynamicTemperature",
final unit="K",
final displayUnit="degC") "Set temperature"
annotation (Placement(transformation(extent={{-132,44},{-100,76}})));
Modelica.Blocks.Interfaces.RealOutput nOut "Relative speed of compressor. From 0 to 1"
annotation (Placement(transformation(extent={{100,-10},{120,10}})));
AixLib.Controls.Interfaces.VapourCompressionMachineControlBus sigBusHP
annotation (Placement(transformation(extent={{-124,-42},{-90,-12}})));
AixLib.Fluid.HeatPumps.ModularReversible.BaseClasses.RefrigerantMachineControlBus sigBusHP
annotation (Placement(transformation(extent={{-124,-46},{-90,-16}})));
Modelica.Blocks.Interfaces.RealOutput ySecHeaGen if use_secHeaGen
"Relative power of second heat generator, from 0 to 1"
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=-90,
origin={12,-108})));
Modelica.Blocks.Interfaces.RealInput TAct(
origin={0,-110})));
Modelica.Blocks.Interfaces.RealInput TMea(
final quantity="ThermodynamicTemperature",
final unit="K",
final displayUnit="degC") "Actual temperature, control variable"
annotation (Placement(transformation(
extent={{16,16},{-16,-16}},
rotation=180,
origin={-116,-80})));
Utilities.Logical.SmoothSwitch swiNullsecHeaGen if use_secHeaGen
AixLib.Utilities.Logical.SmoothSwitch swiNullsecHeaGen if use_secHeaGen
"If second heater is off, zero is passed" annotation (Placement(
transformation(
extent={{8,-8},{-8,8}},
extent={{10,-10},{-10,10}},
rotation=90,
origin={12,-84})));
Utilities.Math.MovingAverage movAve(final aveTime=movAveTime)
origin={0,-70})));
AixLib.Utilities.Math.MovingAverage movAve(final aveTime=movAveTime, final u_start=0)
if use_heaLim
"Moving average to account for fluctuations in the outdoor air temperature"
annotation (Placement(transformation(extent={{-88,-34},{-76,-20}})));
annotation (Placement(transformation(extent={{-92,-40},{-72,-20}})));
Modelica.Blocks.Logical.And andHeaLim
"Check if control and heating limit temperature yield true to turn the device on"
annotation (Placement(transformation(extent={{38,-6},{50,6}})));
annotation (Placement(transformation(extent={{20,-20},{40,0}})));
Modelica.Blocks.Logical.LessThreshold lessThreshold(final threshold=
T_heaLim)
annotation (Placement(transformation(extent={{-66,-34},{-52,-20}})));
T_heaLim) if use_heaLim
annotation (Placement(transformation(extent={{-60,-40},{-40,-20}})));



Modelica.Blocks.Sources.BooleanConstant booleanConstant(final k=true)
if not use_heaLim
annotation (Placement(transformation(extent={{-60,-80},{-40,-60}})));
equation
connect(conZer.y, swiNullHP.u3) annotation (Line(points={{50.6,-18},{58,-18},
{58,-8},{64,-8}}, color={0,0,127}));
connect(conZer.y, swiNullHP.u3) annotation (Line(points={{41,-40},{54,-40},{
54,-18},{58,-18}},color={0,0,127}));
connect(swiNullHP.y, nOut)
annotation (Line(points={{87,0},{110,0}}, color={0,0,127}));
annotation (Line(points={{81,-10},{98,-10},{98,0},{110,0}},
color={0,0,127}));
connect(swiNullsecHeaGen.y, ySecHeaGen)
annotation (Line(points={{12,-92.8},{12,-108}},
color={0,0,127}));
connect(conZer.y, swiNullsecHeaGen.u3) annotation (Line(points={{50.6,-18},{
70,-18},{70,-74.4},{18.4,-74.4}},
color={0,0,127}));
annotation (Line(points={{-8.88178e-16,-81},{-8.88178e-16,-98},{0,-98},{0,
-110}}, color={0,0,127}));
connect(conZer.y, swiNullsecHeaGen.u3) annotation (Line(points={{41,-40},{70,
-40},{70,-58},{8,-58}}, color={0,0,127}));
connect(sigBusHP.T_oda, movAve.u) annotation (Line(
points={{-107,-27},{-94,-27},{-94,-27},{-89.2,-27}},
points={{-107,-31},{-94,-31},{-94,-30}},
color={255,204,51},
thickness=0.5), Text(
string="%first",
index=-1,
extent={{-3,-6},{-3,-6}},
horizontalAlignment=TextAlignment.Right));
connect(movAve.y, lessThreshold.u)
annotation (Line(points={{-75.4,-27},{-67.4,-27}}, color={0,0,127}));
connect(lessThreshold.y, andHeaLim.u2) annotation (Line(points={{-51.3,-27},{-26,
-27},{-26,-4.8},{36.8,-4.8}}, color={255,0,255}));
annotation (Line(points={{-71,-30},{-62,-30}}, color={0,0,127}));
connect(lessThreshold.y, andHeaLim.u2) annotation (Line(points={{-39,-30},{
-26,-30},{-26,-18},{18,-18}}, color={255,0,255}));
connect(andHeaLim.y, swiNullHP.u2)
annotation (Line(points={{50.6,0},{64,0}}, color={255,0,255}));
annotation (Line(points={{41,-10},{58,-10}},
color={255,0,255}));
connect(booleanConstant.y, andHeaLim.u2) annotation (Line(points={{-39,-70},{
-26,-70},{-26,-18},{18,-18}}, color={255,0,255}));
annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={
Rectangle(
extent={{-100,100},{100,-100}},
Expand Down
2 changes: 0 additions & 2 deletions AixLib/Controls/HeatPump/BaseClasses/package.order
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
InverterControlledHP
OnOffHP
PartialHPController
PartialTSetToNSet
179 changes: 179 additions & 0 deletions AixLib/Controls/HeatPump/DefrostControl.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
within AixLib.Controls.HeatPump;
model DefrostControl
"Control block to ensure no frost limits heat flow at the evaporator"
parameter Real minIceFac "Minimal value above which no defrost is necessary";

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.";
Modelica.Blocks.Interfaces.BooleanInput hea
annotation (Placement(transformation(extent={{-132,-36},{-100,-4}})));
Modelica.Blocks.Interfaces.RealInput ySet
"Set value relative speed of compressor. Analog from 0 to 1"
annotation (Placement(transformation(extent={{-132,4},{-100,36}})));
Utilities.Logical.SmoothSwitch swiErr
"If an error occurs, the value of the conZero block will be used(0)"
annotation (Placement(transformation(extent={{58,2},{78,22}})));
Modelica.Blocks.Sources.Constant conOne(final k=1)
"If Defrost is enabled, HP runs at full power"
annotation (Placement(transformation(extent={{0,-10},{20,10}})));
Modelica.Blocks.Interfaces.RealOutput yOut
"Relative speed of compressor. From 0 to 1"
annotation (Placement(transformation(extent={{100,10},{120,30}})));
Modelica.Blocks.Interfaces.BooleanOutput heaOut
annotation (Placement(transformation(extent={{100,-30},{120,-10}})));
Fluid.HeatPumps.ModularReversible.BaseClasses.RefrigerantMachineControlBus sigBus
annotation (Placement(transformation(extent={{-120,-76},{-92,-48}})));
Modelica.Blocks.Logical.Hysteresis iceFacGreMinChi(
final uLow=minIceFac,
final uHigh=minIceFac + deltaIceFac,
final pre_y_start=true)
"Check if icing factor is greater than a boundary" annotation (Placement(
transformation(
extent={{-10.5,-10.5},{10.5,10.5}},
rotation=0,
origin={-49.5,-61.5})));
Modelica.Blocks.Logical.LogicalSwitch logicalSwitch
"If a chiller is used to defrost, mode will be false"
annotation (Placement(transformation(extent={{58,-42},{78,-22}})));
Modelica.Blocks.Sources.BooleanConstant conTrueUseChi(final k=false)
"Set mode to false to simulate the defrost cycle"
annotation (Placement(transformation(extent={{20,-80},{40,-60}})));
equation
connect(conOne.y, swiErr.u3) annotation (Line(points={{21,0},{46,0},{46,4},{
56,4}}, color={0,0,127}));
connect(swiErr.y,yOut) annotation (Line(points={{79,12},{96,12},{96,20},{110,
20}}, color={0,0,127}));
connect(ySet, swiErr.u1) annotation (Line(points={{-116,20},{56,20}},
color={0,0,127}));

connect(sigBus.iceFacMea, iceFacGreMinChi.u) annotation (Line(
points={{-106,-62},{-84.05,-62},{-84.05,-61.5},{-62.1,-61.5}},
color={255,204,51},
thickness=0.5), Text(
string="%first",
index=-1,
extent={{-6,3},{-6,3}},
horizontalAlignment=TextAlignment.Right));
connect(iceFacGreMinChi.y, swiErr.u2) annotation (Line(
points={{-37.95,-61.5},{8,-61.5},{8,-32},{44,-32},{44,12},{56,12}},
color={255,0,255}));
connect(logicalSwitch.y, heaOut) annotation (Line(points={{79,-32},{84,-32},{84,
-20},{110,-20}}, color={255,0,255}));
connect(hea, logicalSwitch.u1) annotation (Line(points={{-116,-20},{-32,-20},{
-32,-24},{56,-24}}, color={255,0,255}));
connect(iceFacGreMinChi.y, logicalSwitch.u2) annotation (Line(
points={{-37.95,-61.5},{8,-61.5},{8,-32},{56,-32}},
color={255,0,255}));
connect(conTrueUseChi.y, logicalSwitch.u3) annotation (Line(
points={{41,-70},{48,-70},{48,-40},{56,-40}},
color={255,0,255}));
annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,
-100},{100,80}}), graphics={
Rectangle(
extent={{-100,100},{100,-100}},
lineColor={28,108,200},
fillColor={255,255,170},
fillPattern=FillPattern.Solid),
Line(
points={{-36,34},{-36,-6}},
color={28,108,200}),
Line(
points={{0,20},{0,-20}},
color={28,108,200},
origin={-36,14},
rotation=90),
Line(
points={{-14,14},{14,-14}},
color={28,108,200},
origin={-36,14},
rotation=90),
Line(
points={{14,14},{-14,-14}},
color={28,108,200},
origin={-36,14},
rotation=90),
Line(
points={{8,64},{8,24}},
color={28,108,200}),
Line(
points={{0,20},{0,-20}},
color={28,108,200},
origin={8,44},
rotation=90),
Line(
points={{-14,14},{14,-14}},
color={28,108,200},
origin={8,44},
rotation=90),
Line(
points={{14,14},{-14,-14}},
color={28,108,200},
origin={8,44},
rotation=90),
Line(
points={{-34,-22},{-34,-62}},
color={28,108,200}),
Line(
points={{0,20},{0,-20}},
color={28,108,200},
origin={-34,-42},
rotation=90),
Line(
points={{-14,14},{14,-14}},
color={28,108,200},
origin={-34,-42},
rotation=90),
Line(
points={{14,14},{-14,-14}},
color={28,108,200},
origin={-34,-42},
rotation=90),
Line(
points={{14,6},{14,-34}},
color={28,108,200}),
Line(
points={{0,20},{0,-20}},
color={28,108,200},
origin={14,-14},
rotation=90),
Line(
points={{-14,14},{14,-14}},
color={28,108,200},
origin={14,-14},
rotation=90),
Line(
points={{14,14},{-14,-14}},
color={28,108,200},
origin={14,-14},
rotation=90),
Text(
extent={{-104,100},{106,76}},
lineColor={28,108,200},
lineThickness=0.5,
fillColor={255,255,255},
fillPattern=FillPattern.None,
textString="%name")}), Diagram(
coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,
100}})),
Documentation(info="<html><p>
Basic model for a defrost control. The icing factor is calculated in
the heat pump based on functions or other models.
</p>
<p>
If a given lower boundary is surpassed, the mode of the heat pump
will be set to false(eq. Chilling) and the compressor speed is set to
1 to make the defrost process as fast as possible.
</p>
<ul>
<li>
<i>August 27, 2024</i> by Fabian Wüllhorst:<br/>
Adapted to new heat pump approach (see issue <a href=
\"https://github.com/RWTH-EBC/AixLib/issues/1520\">#1520</a>)
</li>
<li>
<i>November 26, 2018&#160;</i> by Fabian Wüllhorst:<br/>
First implementation (see issue <a href=
\"https://github.com/RWTH-EBC/AixLib/issues/577\">#577</a>)
</li>
</ul>
</html>"));
end DefrostControl;
Loading

0 comments on commit 6817b3f

Please sign in to comment.