From c7e8e73807a1fc3bd6cbed81069584b6bf3bf5b3 Mon Sep 17 00:00:00 2001 From: Martin Stiller Date: Mon, 30 Sep 2019 09:57:44 +0200 Subject: [PATCH] * added one more valve due to simulation abortion with pyDMPC, #55 --- .../BaseClasses/GeothermalHeatPumpBase.mo | 23 +++++++++++++++---- .../GeothermalHeatPumpSystem.mo | 17 +++++++------- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/pyDMPC/ModelicaModels/ModelicaModels/BaseClasses/GeothermalHeatPumpBase.mo b/pyDMPC/ModelicaModels/ModelicaModels/BaseClasses/GeothermalHeatPumpBase.mo index 840fd22..bec0200 100644 --- a/pyDMPC/ModelicaModels/ModelicaModels/BaseClasses/GeothermalHeatPumpBase.mo +++ b/pyDMPC/ModelicaModels/ModelicaModels/BaseClasses/GeothermalHeatPumpBase.mo @@ -287,9 +287,20 @@ partial model GeothermalHeatPumpBase annotation (Placement(transformation( extent={{-6,7},{6,-7}}, rotation=180, - origin={-72,22}))); + origin={-78,32}))); 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}}, @@ -383,10 +394,14 @@ equation 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})); connect(heatPumpTab.port_b_sink, valve1.port_a) annotation (Line(points={{ - -5.8,14.9},{-6,14.9},{-6,22},{-66,22}}, color={0,127,255})); - connect(valve1.port_b, returnTemSensor.port_a) annotation (Line(points={{-78, - 22},{-100,22},{-100,18}}, color={0,127,255})); + -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})); annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-160, -120},{160,80}})), Icon(coordinateSystem( preserveAspectRatio=false, extent={{-160,-120},{160,80}})), diff --git a/pyDMPC/ModelicaModels/ModelicaModels/ControlledSystems/GeothermalHeatPumpSystem.mo b/pyDMPC/ModelicaModels/ModelicaModels/ControlledSystems/GeothermalHeatPumpSystem.mo index 2142c07..90de694 100644 --- a/pyDMPC/ModelicaModels/ModelicaModels/ControlledSystems/GeothermalHeatPumpSystem.mo +++ b/pyDMPC/ModelicaModels/ModelicaModels/ControlledSystems/GeothermalHeatPumpSystem.mo @@ -52,7 +52,7 @@ model GeothermalHeatPumpSystem AixLib.Fluid.Examples.GeothermalHeatPump.Control.geothermalFieldController geothermalFieldControllerCold( temperature_low=273.15 + 6, temperature_high=273.15 + 8) "Controls the heat exchange with the geothermal field and the cold storage" - annotation (Placement(transformation(extent={{-100,28},{-84,44}}))); + annotation (Placement(transformation(extent={{-104,40},{-88,56}}))); AixLib.Fluid.Examples.GeothermalHeatPump.Control.geothermalFieldController geothermalFieldControllerHeat "Controls the heat exchange with the geothermal field and the heat storage" annotation (Placement(transformation(extent={{-100,-34},{-84,-18}}))); @@ -81,13 +81,13 @@ equation points={{-89,-45.6},{-89,-36},{62,-36},{62,6},{65.4,6}}, color={0, 0,127})); connect(getTStorageLower.y,geothermalFieldControllerCold. temperature) - annotation (Line(points={{-139,58},{-122,58},{-108,58},{-108,36},{-100,36}}, + annotation (Line(points={{-139,58},{-108,58},{-108,48},{-104,48}}, color={0,0,127})); connect(geothermalFieldControllerCold.valveOpening1, valveColdStorage.y) - annotation (Line(points={{-83.04,40.8},{-82,40.8},{-82,40},{-82,52},{-82,54}, - {-52,54},{-52,46.4}}, color={0,0,127})); + annotation (Line(points={{-87.04,52.8},{-82,52.8},{-82,54},{-52,54},{-52, + 46.4}}, color={0,0,127})); connect(geothermalFieldControllerCold.valveOpening2, valveHeatSource.y) - annotation (Line(points={{-83.04,31.2},{-82,31.2},{-82,1},{-68.4,1}}, color= + annotation (Line(points={{-87.04,43.2},{-86,43.2},{-86,1},{-68.4,1}}, color= {0,0,127})); connect(getTStorageUpper.y,geothermalFieldControllerHeat. temperature) annotation (Line(points={{-139,74},{-122,74},{-122,-26},{-100,-26}}, color= @@ -120,11 +120,12 @@ equation 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={{-83.04,31.2},{-82,31.2},{-82,2},{-86,2},{-86,-3.6}}, color= - {0,0,127})); + Line(points={{-87.04,43.2},{-86,43.2},{-86,-3.6}}, color={0,0,127})); connect(geothermalFieldControllerCold.valveOpening1, valve1.y) annotation ( - Line(points={{-83.04,40.8},{-70,40.8},{-70,30.4},{-72,30.4}}, color={0,0, + Line(points={{-87.04,52.8},{-70,52.8},{-70,40.4},{-78,40.4}}, 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})); annotation (experiment(StopTime=86400, Interval=10), Documentation(revisions="