Skip to content

Commit

Permalink
* corrections in Geothermal Field control, #55
Browse files Browse the repository at this point in the history
- no longer hysteresis
- now with bandwidth
  • Loading branch information
MStillerEBC committed Sep 30, 2019
1 parent 103e62e commit e8a343d
Show file tree
Hide file tree
Showing 10 changed files with 325 additions and 114 deletions.
2 changes: 1 addition & 1 deletion pyDMPC/ControlFramework/Init.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
res_path.append(glob_res_path + "\\" + name_wkdir)
dym_path.append(glob_dym_path)
mod_path.append(r'ModelicaModels.SubsystemModels.DetailedModels.Geo.GeothermalHeatPump')
command_names.append(["T_set_storage"]) #controlled System
command_names.append(["T_set_HeatStorage"]) #controlled System
command_variables.append(["decisionVariables.table[1,2]"]) #subsystem
commands.append(range(308,313,5))
traj_points.append([])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ partial model GeothermalHeatPumpBase
dpValve_nominal=5000)
"Valve connecting cold storage to the evaporator of the heat pump"
annotation (Placement(transformation(
extent={{6,7},{-6,-7}},
extent={{-6,7},{6,-7}},
rotation=180,
origin={-86,-12})));
Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixedTemperature(T=285.65)
Expand All @@ -287,20 +287,9 @@ partial model GeothermalHeatPumpBase
annotation (Placement(transformation(
extent={{-6,7},{6,-7}},
rotation=180,
origin={-78,32})));
origin={-78,24})));
equation

public
AixLib.Fluid.Actuators.Valves.TwoWayQuickOpening valve2(
redeclare package Medium = Water,
m_flow_nominal=0.5,
dpValve_nominal=5000)
"Valve connecting cold storage to the evaporator of the heat pump"
annotation (Placement(transformation(
extent={{-6,-7},{6,7}},
rotation=180,
origin={-78,10})));
equation
connect(resistanceGeothermalSource.port_b, valveHeatSink.port_a) annotation (
Line(
points={{-64,-54},{-36,-54}},
Expand Down Expand Up @@ -390,18 +379,15 @@ equation
connect(vol.ports[3], returnTemSensor.port_b) annotation (Line(points={{
-133.333,-16},{-150,-16},{-150,14},{-114,14},{-114,18}},
color={0,127,255}));
connect(returnTemSensor.port_a, valve.port_a) annotation (Line(points={{-100,
18},{-100,-12},{-92,-12}}, color={0,127,255}));
connect(valve.port_b, heatPumpTab.port_b_source) annotation (Line(points={{
-80,-12},{-58,-12},{-58,-8.9},{-38.2,-8.9}}, color={0,127,255}));
connect(valve1.port_b, returnTemSensor.port_a) annotation (Line(points={{-84,
32},{-100,32},{-100,18}}, color={0,127,255}));
24},{-100,24},{-100,18}}, color={0,127,255}));
connect(heatPumpTab.port_b_sink, valve1.port_a) annotation (Line(points={{
-5.8,14.9},{-5.8,24},{-68,24},{-68,32},{-72,32}}, color={0,127,255}));
connect(valve2.port_a, valve1.port_a) annotation (Line(points={{-72,10},{-68,
10},{-68,32},{-72,32}}, color={0,127,255}));
connect(valve2.port_b, returnTemSensor.port_a) annotation (Line(points={{-84,
10},{-100,10},{-100,18}}, color={0,127,255}));
-5.8,14.9},{-5.8,24},{-72,24}}, color={0,127,255}));
connect(valve.port_a, heatPumpTab.port_b_source) annotation (Line(points={{
-80,-12},{-48,-12},{-48,-12},{-44,-12},{-44,-8.9},{-38.2,-8.9}},
color={0,127,255}));
connect(valve.port_b, returnTemSensor.port_a) annotation (Line(points={{-92,
-12},{-100,-12},{-100,-12},{-100,-12},{-100,18}}, color={0,127,255}));
annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-160,
-120},{160,80}})), Icon(coordinateSystem(
preserveAspectRatio=false, extent={{-160,-120},{160,80}})),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,11 @@ partial model GeothermalHeatPumpControlledBase
Modelica.Blocks.Sources.Constant const1(k=0)
"Infiltration rate"
annotation (Placement(transformation(extent={{200,-64},{190,-54}})));
Modelica.Thermal.HeatTransfer.Sources.FixedTemperature cellarTemperature(T=284.15)
annotation (Placement(transformation(
extent={{6,-6},{-6,6}},
rotation=0,
origin={194,-76})));
equation
connect(getTStorageLower.y, coldStorageTemperature) annotation (Line(points={{-139,58},
{78,58},{78,80}}, color={0,0,127}));
Expand Down Expand Up @@ -323,6 +328,11 @@ equation
{168,-17.6},{159.6,-17.6}},color={0,0,127}));
connect(const1.y, switch1.u3) annotation (Line(points={{189.5,-59},{168,-59},
{168,-6.4},{159.6,-6.4}},color={0,0,127}));
connect(cellarTemperature.port, coldStorage.heatPort)
annotation (Line(points={{188,-76},{50,-76},{50,6},{49.2,6}},
color={191,0,0}));
connect(cellarTemperature.port, heatStorage.heatPort)
annotation (Line(points={{188,-76},{49.2,-76}}, color={191,0,0}));
annotation (experiment(StopTime=86400, Interval=10), Documentation(info="<html>
<p>Base class of an example demonstrating the use of a heat pump connected to two storages and a geothermal source. A replaceable model is connected in the flow line of the heating circuit. A peak load device can be added here. This model also includes basic controllers.</p>
</html>", revisions="<html>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ model GeothermalHeatPumpAggregated
annotation (Placement(transformation(extent={{-30,-20},{36,16}})));
Modelica.Blocks.Interfaces.RealInput traj "Connector of Real input signal 2"
annotation (Placement(transformation(extent={{-120,-42},{-80,-2}})));
Modelica.Blocks.Interfaces.RealInput T_set_storage
Modelica.Blocks.Interfaces.RealInput T_set_HeatStorage
"Connector of Real input signal 2"
annotation (Placement(transformation(extent={{-120,24},{-80,64}})));
equation
connect(geothermalHeatPumpSystem.traj, traj) annotation (Line(points={{-30,
-12.8},{-80,-12.8},{-80,-22},{-100,-22}}, color={0,0,127}));
connect(geothermalHeatPumpSystem.T_set_storage, T_set_storage) annotation (
Line(points={{-18.2667,13.84},{-57.1334,13.84},{-57.1334,44},{-100,44}},
color={0,0,127}));
connect(T_set_HeatStorage, geothermalHeatPumpSystem.T_set_HeatStorage)
annotation (Line(points={{-100,44},{-70,44},{-70,4.12},{-30,4.12}}, color={
0,0,127}));
annotation (
Icon(coordinateSystem(preserveAspectRatio=false)),
Diagram(coordinateSystem(preserveAspectRatio=false)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ model GeothermalHeatPumpSystem
Subsystems.Geo.BaseClasses.TEASER_DataBase.TEASER_Office()),
negate1(k=-1),
negate(k=-1),
heatPumpTab(tablePower=[0,266.15,275.15,280.15,283.15,293.15; 308.15,1650,
1700,1750,1850,1900; 323.15,2250,2200,2300,2500,2550],
tableHeatFlowCondenser=[0,266.16,275.15,280.15,283.15,293.15; 308.15,
4850,5800,6500,7400,8150; 323.15,5000,5600,6450,8350,8750]));
heatPumpTab(tablePower=[0,266.15,275.15,280.15,283.15,293.15; 308.15,1650,1700,
1750,1850,1900; 323.15,2250,2200,2300,2500,2550],
tableHeatFlowCondenser=[0,266.16,275.15,280.15,283.15,293.15; 308.15,4850,
5800,6500,7400,8150; 323.15,5000,5600,6450,8350,8750]));


AixLib.Fluid.Sources.Boundary_pT coldConsumerFlow(redeclare package Medium =
Water,
Expand All @@ -49,11 +50,12 @@ model GeothermalHeatPumpSystem
extent={{-6,-6},{6,6}},
rotation=180,
origin={72,6})));
AixLib.Fluid.Examples.GeothermalHeatPump.Control.geothermalFieldController geothermalFieldControllerCold(
temperature_low=273.15 + 6, temperature_high=273.15 + 8)
Subsystems.Geo.BaseClasses.geothermalFieldController geothermalFieldControllerCold(bandwidth
=275.15)
"Controls the heat exchange with the geothermal field and the cold storage"
annotation (Placement(transformation(extent={{-104,40},{-88,56}})));
AixLib.Fluid.Examples.GeothermalHeatPump.Control.geothermalFieldController geothermalFieldControllerHeat
Subsystems.Geo.BaseClasses.geothermalFieldController geothermalFieldControllerHeat(bandwidth
=275.15)
"Controls the heat exchange with the geothermal field and the heat storage"
annotation (Placement(transformation(extent={{-100,-34},{-84,-18}})));
Modelica.Blocks.Interfaces.RealInput traj "Connector of Real input signal 2"
Expand All @@ -63,9 +65,21 @@ model GeothermalHeatPumpSystem
AixLib.Controls.HeatPump.HPControllerOnOff hPControllerOnOff(bandwidth=5)
"Controls the temperature in the heat storage by switching the heat pump on or off"
annotation (Placement(transformation(extent={{-78,62},{-58,82}})));
Modelica.Blocks.Interfaces.RealInput T_set_storage
"Connector of Real input signal 2"
annotation (Placement(transformation(extent={{-102,62},{-90,74}})));
Modelica.Blocks.Interfaces.RealInput T_set_HeatStorage
"Setpoint of the Heat Storage"
annotation (Placement(transformation(extent={{-166,8},{-154,20}})));
Modelica.Blocks.Sources.Constant const2(k=4)
"Infiltration rate"
annotation (Placement(transformation(extent={{5,-5},{-5,5}},
rotation=180,
origin={-153,29})));
Buildings.Controls.OBC.CDL.Continuous.Add add1
annotation (Placement(transformation(extent={{-134,16},{-124,26}})));
Modelica.Blocks.Sources.Constant T_set_ColdStorage(k=279.15)
"Infiltration rate" annotation (Placement(transformation(
extent={{5,-5},{-5,5}},
rotation=180,
origin={-153,45})));
equation
connect(pressureDifference.y, pumpColdConsumer.dp_in) annotation (Line(points={{65.4,6},
{55,6},{55,-11.6}}, color={0,0,127}));
Expand Down Expand Up @@ -110,21 +124,27 @@ equation
extent={{6,3},{6,3}}));
connect(getTStorageUpper.y, hPControllerOnOff.T_meas) annotation (Line(points=
{{-139,74},{-108.5,74},{-108.5,76},{-78,76}}, color={0,0,127}));
connect(T_set_storage, hPControllerOnOff.T_set)
annotation (Line(points={{-96,68},{-78,68}}, color={0,0,127}));
connect(coldConsumerFlow.ports[1], vol1.ports[3]) annotation (Line(points={{
94,-20},{90,-20},{90,30},{86,30}}, color={0,127,255}));
connect(heatConsumerReturn.ports[1], vol2.ports[3]) annotation (Line(points={
{112,-106},{110,-106},{110,-54},{106,-54}}, color={0,127,255}));
connect(coldConsumerFlow.ports[1], vol1.ports[3]) annotation (Line(points={{94,
-20},{90,-20},{90,30},{86,30}}, color={0,127,255}));
connect(heatConsumerReturn.ports[1], vol2.ports[3]) annotation (Line(points={{
112,-106},{110,-106},{110,-54},{106,-54}}, color={0,127,255}));
connect(geothermalFieldControllerCold.valveOpening2, valve.y) annotation (
Line(points={{-87.04,43.2},{-86,43.2},{-86,-3.6}}, color={0,0,127}));
connect(geothermalFieldControllerHeat.valveOpening1, valve2.y) annotation (
Line(points={{-83.04,-21.2},{-78,-21.2},{-78,1.6}}, color={0,0,127}));
connect(geothermalFieldControllerCold.valveOpening1, valveColdStorage.y)
annotation (Line(points={{-87.04,52.8},{-52,52.8},{-52,46.4}}, color={0,0,
127}));
annotation (Line(points={{-87.04,52.8},{-52,52.8},{-52,46.4}}, color={0,0,127}));
connect(geothermalFieldControllerCold.valveOpening1, valve1.y) annotation (
Line(points={{-87.04,52.8},{-78,52.8},{-78,40.4}}, color={0,0,127}));
Line(points={{-87.04,52.8},{-78,52.8},{-78,32.4}}, color={0,0,127}));
connect(const2.y, add1.u1) annotation (Line(points={{-147.5,29},{-135,29},{-135,
24}}, color={0,0,127}));
connect(add1.y, geothermalFieldControllerHeat.Setpoint) annotation (Line(
points={{-123.5,21},{-120,21},{-120,-20.4},{-100,-20.4}}, color={0,0,127}));
connect(T_set_HeatStorage, hPControllerOnOff.T_set)
annotation (Line(points={{-160,14},{-160,68},{-78,68}}, color={0,0,127}));
connect(T_set_HeatStorage, add1.u2) annotation (Line(points={{-160,14},{-150,
14},{-150,18},{-135,18}}, color={0,0,127}));
connect(T_set_ColdStorage.y, geothermalFieldControllerCold.Setpoint)
annotation (Line(points={{-147.5,45},{-128,45},{-128,53.6},{-104,53.6}},
color={0,0,127}));
annotation (experiment(StopTime=86400, Interval=10), Documentation(revisions="<html>
<ul>
<li>
Expand Down
Loading

0 comments on commit e8a343d

Please sign in to comment.