diff --git a/AixLib/Fluid/DistrictHeatingCooling/Demands/ClosedLoop/DHCSubstationHeatPumpChiller.mo b/AixLib/Fluid/DistrictHeatingCooling/Demands/ClosedLoop/DHCSubstationHeatPumpChiller.mo index 042376f2e3..ae7421b1d2 100644 --- a/AixLib/Fluid/DistrictHeatingCooling/Demands/ClosedLoop/DHCSubstationHeatPumpChiller.mo +++ b/AixLib/Fluid/DistrictHeatingCooling/Demands/ClosedLoop/DHCSubstationHeatPumpChiller.mo @@ -2,49 +2,49 @@ within AixLib.Fluid.DistrictHeatingCooling.Demands.ClosedLoop; model DHCSubstationHeatPumpChiller "Substation model for bidirctional low-temperature networks for buildings with heat pump and chiller" - replaceable package Medium = Modelica.Media.Interfaces.PartialMedium + replaceable package Medium = AixLib.Media.Water "Medium model for water" annotation (choicesAllMatching = true); - parameter Modelica.Units.SI.Pressure dp_nominal(displayUnit="Pa") = 30000 + parameter Modelica.Units.SI.Pressure dp_nominal(displayUnit="Pa", min=1) "Nominal pressure drop"; - parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=max(max((heaDem_max/( - cp_default*deltaT_heaSecSet)), -cooDem_max/(cp_default*deltaT_cooSecSet)), + parameter Modelica.Units.SI.MassFlowRate m_flow_nominal(min=0.001)=max(max((heatDemand_max/( + cp_default*deltaT_heatSecSet)), -coolingDemand_max/(cp_default*deltaT_coolingSecSet)), 0.0001) "Nominal mass flow rate based on max. demand and set temperature difference"; - parameter Modelica.Units.SI.HeatFlowRate heaDem_max + parameter Modelica.Units.SI.HeatFlowRate heatDemand_max(min=1) "Maximum heat demand for scaling of heatpump in Watt" annotation (Dialog(tab="General", group="Building System")); - parameter Modelica.Units.SI.HeatFlowRate cooDem_max + parameter Modelica.Units.SI.HeatFlowRate coolingDemand_max "Maximum cooling demand for scaling of chiller in Watt (negative values)" annotation (Dialog(tab="General", group="Building System")); - parameter Modelica.Units.SI.Temperature T_heaSecSet=273.15 + 55 + parameter Modelica.Units.SI.Temperature T_heatSecSet(min=273.15+1)=273.15 + 55 "Set supply temperature for space heating on secondary side (building system)" annotation (Dialog(tab="General", group="Building System")); - parameter Modelica.Units.SI.TemperatureDifference deltaT_heaSecSet - "Set temperature difference for heating on secondary site (building system)" + parameter Modelica.Units.SI.TemperatureDifference deltaT_heatSecSet(min=0.1) + "Set temperature difference for heating on secondary side (building system)" annotation (Dialog(tab="General", group="Building System")); - parameter Modelica.Units.SI.Temperature T_cooSecSet=273.15 + 12 + parameter Modelica.Units.SI.Temperature T_coolingSecSet=273.15 + 12 "Set supply temperature for cooling on secondary side (building system)" annotation (Dialog(tab="General", group="Building System")); - parameter Modelica.Units.SI.Temperature deltaT_cooSecSet - "Set temperature difference for cooling on secondary site (building system)" + parameter Modelica.Units.SI.TemperatureDifference deltaT_coolingSecSet(min=0.1) + "Set temperature difference for cooling on secondary side (building system)" annotation (Dialog(tab="General", group="Building System")); - parameter Modelica.Units.SI.Temperature deltaT_heaPriSet - "Set temperature difference for heating on primary site (grid)" + parameter Modelica.Units.SI.TemperatureDifference deltaT_heatPriSet(min=0.1) + "Set temperature difference for heating on primary side (grid)" annotation (Dialog(tab="General", group="Grid")); - parameter Modelica.Units.SI.Temperature deltaT_cooPriSet - "Set temperature difference for cooling on primary site (grid)" + parameter Modelica.Units.SI.TemperatureDifference deltaT_coolingPriSet(min=0.1) + "Set temperature difference for cooling on primary side (grid)" annotation (Dialog(tab="General", group="Grid")); AixLib.Fluid.Delays.DelayFirstOrder vol( @@ -57,25 +57,27 @@ model DHCSubstationHeatPumpChiller redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal) annotation (Placement(transformation(extent={{188,8},{208,28}}))); - AixLib.Fluid.Movers.FlowControlled_m_flow pumHea( + AixLib.Fluid.Movers.FlowControlled_m_flow pumpHeating( redeclare package Medium = Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, addPowerToMedium=false, + nominalValuesDefineDefaultPressureCurve=true, use_inputFilter=false, - m_flow_nominal=m_flow_nominal) + m_flow_nominal=m_flow_nominal, + dp_nominal=dp_nominal) "decentral distribution pump for heating on primary side" annotation (Placement(transformation(extent={{-80,-14},{-60,-34}}))); - AixLib.Fluid.Sources.MassFlowSource_T souHeaSec( + AixLib.Fluid.Sources.MassFlowSource_T sourceHeatingSec( use_m_flow_in=true, use_T_in=true, redeclare package Medium = Medium, nPorts=1) annotation (Placement(transformation(extent={{62,-64},{42,-44}}))); - Modelica.Blocks.Sources.Constant T_heaPumInSec(k=T_heaSecSet - - deltaT_heaSecSet) "Inlet temperatur of heat pump on secondary side" + Modelica.Blocks.Sources.Constant T_heatPumpInSec(k=T_heatSecSet - + deltaT_heatSecSet) "Inlet temperatur of heat pump on secondary side" annotation (Placement(transformation(extent={{102,-72},{88,-58}}))); - Sources.Boundary_pT sinHeaSec(redeclare package Medium = Medium, nPorts=1) + Sources.Boundary_pT sinkHeatingSec(redeclare package Medium = Medium, nPorts=1) annotation (Placement(transformation(extent={{-48,-64},{-28,-44}}))); - Modelica.Blocks.Sources.Constant const(k=(cp_default*deltaT_heaSecSet)) + Modelica.Blocks.Sources.Constant const(k=(cp_default*deltaT_heatSecSet)) annotation (Placement(transformation(extent={{128,-56},{116,-44}}))); Modelica.Blocks.Math.Division division annotation (Placement(transformation(extent={{104,-44},{90,-30}}))); @@ -89,7 +91,7 @@ public "Fluid connector for connecting the substation to the cold line of the network" annotation (Placement(transformation(extent={{210,-10},{230,10}}), iconTransformation(extent={{210,-10},{230,10}}))); - AixLib.Fluid.HeatPumps.Carnot_TCon heaPum(redeclare package Medium1 = Medium, + AixLib.Fluid.HeatPumps.Carnot_TCon heatPump(redeclare package Medium1 = Medium, redeclare package Medium2 = Medium, allowFlowReversal1=false, allowFlowReversal2=false, @@ -98,12 +100,12 @@ public use_eta_Carnot_nominal=true, show_T=true, etaCarnot_nominal=0.5, - QCon_flow_max=heaDem_max, - QCon_flow_nominal=heaDem_max) + QCon_flow_max=heatDemand_max, + QCon_flow_nominal=heatDemand_max) annotation (Placement(transformation(extent={{10,-20},{-10,-40}}))); Modelica.Blocks.Math.Division division1 annotation (Placement(transformation(extent={{-96,-78},{-80,-62}}))); - Modelica.Blocks.Interfaces.RealInput heaDem(unit="W") + Modelica.Blocks.Interfaces.RealInput heatDemand(unit="W") "Input for heat demand profile of substation" annotation (Placement( transformation(extent={{-294,-80},{-254,-40}}), iconTransformation( extent={{232,76},{192,116}}))); @@ -126,7 +128,7 @@ public portFlowDirection_3=Modelica.Fluid.Types.PortFlowDirection.Entering, m_flow_nominal=max(m_flow_nominal, 1)*{1,1,1}) annotation (Placement(transformation(extent={{136,-10},{116,10}}))); - AixLib.Fluid.Chillers.Carnot_TEva chi( + AixLib.Fluid.Chillers.Carnot_TEva chiller( redeclare package Medium1 = Medium, redeclare package Medium2 = Medium, allowFlowReversal1=false, @@ -135,27 +137,29 @@ public dp1_nominal=dp_nominal, dp2_nominal=dp_nominal, etaCarnot_nominal=0.4, - QEva_flow_min=cooDem_max, - QEva_flow_nominal=cooDem_max) + QEva_flow_min=coolingDemand_max, + QEva_flow_nominal=coolingDemand_max) annotation (Placement(transformation(extent={{-4,40},{-24,20}}))); - AixLib.Fluid.Movers.FlowControlled_m_flow pumCoo( + AixLib.Fluid.Movers.FlowControlled_m_flow pumpCooling( redeclare package Medium = Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, addPowerToMedium=false, + nominalValuesDefineDefaultPressureCurve=true, use_inputFilter=false, - m_flow_nominal=m_flow_nominal) + m_flow_nominal=m_flow_nominal, + dp_nominal=dp_nominal) "decentral distribution pump for cooling on primary side" annotation (Placement(transformation(extent={{52,14},{32,34}}))); - Modelica.Blocks.Interfaces.RealInput cooDem(unit="W") + Modelica.Blocks.Interfaces.RealInput coolingDemand(unit="W") "Input for cooling demand profile of substation" annotation (Placement( transformation(extent={{248,42},{208,82}}), iconTransformation(extent={{ -280,-120},{-240,-80}}))); - AixLib.Fluid.Sources.MassFlowSource_T souCoo( + AixLib.Fluid.Sources.MassFlowSource_T sourceCooling( use_m_flow_in=true, use_T_in=true, redeclare package Medium = Medium, nPorts=1) annotation (Placement(transformation(extent={{-66,44},{-46,64}}))); - Sources.Boundary_pT sinCoo(redeclare package Medium = Medium, nPorts=1) + Sources.Boundary_pT sinkCooling(redeclare package Medium = Medium, nPorts=1) annotation (Placement(transformation(extent={{34,44},{14,64}}))); Modelica.Blocks.Math.Add add2(k2=+1) annotation (Placement(transformation(extent={{94,68},{74,88}}))); @@ -163,47 +167,47 @@ public annotation (Placement(transformation(extent={{60,66},{46,80}}))); Modelica.Blocks.Math.Division division3 annotation (Placement(transformation(extent={{-58,100},{-72,114}}))); - Modelica.Blocks.Sources.Constant const2(k=cp_default*deltaT_cooSecSet) + Modelica.Blocks.Sources.Constant const2(k=cp_default*deltaT_coolingSecSet) annotation (Placement(transformation(extent={{-32,86},{-44,98}}))); - Modelica.Blocks.Interfaces.RealOutput P_el_heaPum(unit="W") + Modelica.Blocks.Interfaces.RealOutput P_el_heatPump(unit="W") "Power demand of heat pump" annotation (Placement(transformation(extent={{-260, 100},{-280,120}}), iconTransformation(extent={{-260,100},{-280,120}}))); - Modelica.Blocks.Interfaces.RealOutput P_el_chi(unit="W") + Modelica.Blocks.Interfaces.RealOutput P_el_chiller(unit="W") "Power demand of chiller" annotation (Placement(transformation(extent={{-260, 126},{-280,146}}), iconTransformation(extent={{-260,126},{-280,146}}))); - Modelica.Blocks.Interfaces.RealOutput P_el_subSta(unit="W") + Modelica.Blocks.Interfaces.RealOutput P_el_subStation(unit="W") "Power demand of substation for heat pump, chiller and distribution pumps on primary side (grid)" annotation (Placement(transformation(extent={{-260,74},{-280,94}}), iconTransformation(extent={{-260,74},{-280,94}}))); Modelica.Blocks.Math.Sum sum1(nin=4) annotation (Placement(transformation(extent={{-220,74},{-240,94}}))); - Modelica.Blocks.Sources.Constant T_heaPumSet(k=T_heaSecSet) + Modelica.Blocks.Sources.Constant T_heatPumpSet(k=T_heatSecSet) annotation (Placement(transformation(extent={{40,-78},{26,-64}}))); Modelica.Blocks.Sources.RealExpression - realExpression2(y=heaPum.P) + realExpression2(y=heatPump.P) annotation (Placement(transformation(extent={{-176,-78},{-164,-66}}))); Modelica.Blocks.Sources.RealExpression - realExpression1(y=heaDem) + realExpression1(y=heatDemand) annotation (Placement(transformation(extent={{138,-38},{126,-26}}))); Modelica.Blocks.Sources.RealExpression realExpression(y=cp_default* - deltaT_heaPriSet) + deltaT_heatPriSet) annotation (Placement(transformation(extent={{-128,-96},{-116,-84}}))); Modelica.Blocks.Sources.RealExpression - realExpression3(y=heaPum.P) + realExpression3(y=heatPump.P) annotation (Placement(transformation(extent={{-228,104},{-240,116}}))); Modelica.Blocks.Sources.RealExpression - realExpression4(y=chi.P) + realExpression4(y=chiller.P) annotation (Placement(transformation(extent={{-228,130},{-240,142}}))); Modelica.Blocks.Sources.RealExpression - realExpression5(y=chi.P) + realExpression5(y=chiller.P) annotation (Placement(transformation(extent={{130,66},{118,78}}))); - Modelica.Blocks.Sources.Constant const3(k=cp_default*deltaT_cooPriSet) + Modelica.Blocks.Sources.Constant const3(k=cp_default*deltaT_coolingPriSet) annotation (Placement(transformation(extent={{94,48},{80,62}}))); - Modelica.Blocks.Sources.Constant T_chiSet(k=T_cooSecSet) + Modelica.Blocks.Sources.Constant T_chillerSet(k=T_coolingSecSet) annotation (Placement(transformation(extent={{24,2},{10,16}}))); - Modelica.Blocks.Sources.RealExpression realExpression6(y=T_cooSecSet + - deltaT_cooSecSet) + Modelica.Blocks.Sources.RealExpression realExpression6(y=T_coolingSecSet + + deltaT_coolingSecSet) annotation (Placement(transformation(extent={{-106,52},{-94,64}}))); protected @@ -218,92 +222,92 @@ protected equation connect(port_a,vol. ports[1]) - annotation (Line(points={{-260,0},{-234,0},{-234,4}}, + annotation (Line(points={{-260,0},{-233,0},{-233,4}}, color={0,127,255}, thickness=1)); connect(port_b,vol1. ports[1]) - annotation (Line(points={{220,0},{196,0},{196,8}}, + annotation (Line(points={{220,0},{197,0},{197,8}}, color={0,127,255}, thickness=1)); - connect(chi.port_b1, jun.port_3) annotation (Line(points={{-24,24},{-146,24}, + connect(chiller.port_b1, jun.port_3) annotation (Line(points={{-24,24},{-146,24}, {-146,10}},color={0,127,255}, thickness=1)); - connect(heaPum.port_b2, jun1.port_3) + connect(heatPump.port_b2, jun1.port_3) annotation (Line(points={{10,-24},{126,-24},{126,-10}}, color={0,127,255}, thickness=1)); - connect(pumHea.port_b, heaPum.port_a2) annotation (Line( + connect(pumpHeating.port_b, heatPump.port_a2) annotation (Line( points={{-60,-24},{-10,-24}}, color={0,127,255}, thickness=1)); - connect(chi.port_a1, pumCoo.port_b) annotation (Line( + connect(chiller.port_a1, pumpCooling.port_b) annotation (Line( points={{-4,24},{32,24}}, color={0,127,255}, thickness=1)); - connect(heaDem, add1.u1) + connect(heatDemand, add1.u1) annotation (Line(points={{-274,-60},{-136,-60}}, color={0,0,127})); connect(add1.y, division1.u1) annotation (Line(points={{-113,-66},{-106,-66},{ -106,-65.2},{-97.6,-65.2}}, color={0,0,127})); - connect(division1.y, pumHea.m_flow_in) annotation (Line(points={{-79.2,-70},{-70, + connect(division1.y, pumpHeating.m_flow_in) annotation (Line(points={{-79.2,-70},{-70, -70},{-70,-36}}, color={0,0,127})); - connect(souHeaSec.ports[1], heaPum.port_a1) annotation (Line( + connect(sourceHeatingSec.ports[1], heatPump.port_a1) annotation (Line( points={{42,-54},{28,-54},{28,-36},{10,-36}}, color={0,127,255}, thickness=0.5)); - connect(sinHeaSec.ports[1], heaPum.port_b1) annotation (Line( + connect(sinkHeatingSec.ports[1], heatPump.port_b1) annotation (Line( points={{-28,-54},{-22,-54},{-22,-36},{-10,-36}}, color={0,127,255}, thickness=0.5)); connect(division.u2, const.y) annotation (Line(points={{105.4,-41.2},{112,-41.2}, {112,-50},{115.4,-50}}, color={0,0,127})); - connect(division.y, souHeaSec.m_flow_in) annotation (Line(points={{89.3,-37},{ + connect(division.y, sourceHeatingSec.m_flow_in) annotation (Line(points={{89.3,-37},{ 76.65,-37},{76.65,-46},{64,-46}}, color={0,0,127})); - connect(souCoo.ports[1], chi.port_a2) annotation (Line( + connect(sourceCooling.ports[1], chiller.port_a2) annotation (Line( points={{-46,54},{-30,54},{-30,36},{-24,36}}, color={0,127,255}, thickness=0.5)); - connect(chi.port_b2, sinCoo.ports[1]) annotation (Line( + connect(chiller.port_b2, sinkCooling.ports[1]) annotation (Line( points={{-4,36},{0,36},{0,54},{14,54}}, color={0,127,255}, thickness=0.5)); connect(division2.u1, add2.y) annotation (Line(points={{61.4,77.2},{67.7,77.2}, {67.7,78},{73,78}}, color={0,0,127})); - connect(division2.y, pumCoo.m_flow_in) annotation (Line(points={{45.3,73},{42, + connect(division2.y, pumpCooling.m_flow_in) annotation (Line(points={{45.3,73},{42, 73},{42,36}}, color={0,0,127})); connect(const2.y, division3.u2) annotation (Line(points={{-44.6,92},{-50,92},{ -50,102.8},{-56.6,102.8}}, color={0,0,127})); - connect(division3.y, souCoo.m_flow_in) annotation (Line(points={{-72.7,107},{ + connect(division3.y, sourceCooling.m_flow_in) annotation (Line(points={{-72.7,107},{ -86,107},{-86,62},{-68,62}}, color={0,0,127})); connect(port_a, port_a) annotation (Line(points={{-260,0},{-260,0}}, color={0,127,255})); - connect(sum1.y, P_el_subSta) + connect(sum1.y, P_el_subStation) annotation (Line(points={{-241,84},{-270,84}}, color={0,0,127})); //Power Consumptin Calculation - connect(chi.P, sum1.u[1]); - connect(heaPum.P, sum1.u[2]); - connect(pumCoo.P, sum1.u[3]); - connect(pumHea.P, sum1.u[4]); + connect(chiller.P, sum1.u[1]); + connect(heatPump.P, sum1.u[2]); + connect(pumpCooling.P, sum1.u[3]); + connect(pumpHeating.P, sum1.u[4]); connect(vol.ports[2], jun.port_1) annotation (Line( - points={{-230,4},{-230,4},{-230,0},{-156,0}}, + points={{-231,4},{-230,4},{-230,0},{-156,0}}, color={0,127,255}, thickness=1)); - connect(jun.port_2, pumHea.port_a) annotation (Line( + connect(jun.port_2, pumpHeating.port_a) annotation (Line( points={{-136,0},{-124,0},{-124,-24},{-80,-24}}, color={0,127,255}, thickness=1)); - connect(jun1.port_2, pumCoo.port_a) annotation (Line( + connect(jun1.port_2, pumpCooling.port_a) annotation (Line( points={{116,0},{104,0},{104,24},{52,24}}, color={0,127,255}, thickness=1)); connect(vol1.ports[2], jun1.port_1) annotation (Line( - points={{200,8},{196,8},{196,0},{136,0}}, + points={{199,8},{196,8},{196,0},{136,0}}, color={0,127,255}, thickness=1)); - connect(souHeaSec.T_in, T_heaPumInSec.y) annotation (Line(points={{64,-50},{80, + connect(sourceHeatingSec.T_in, T_heatPumpInSec.y) annotation (Line(points={{64,-50},{80, -50},{80,-65},{87.3,-65}}, color={0,0,127})); - connect(heaPum.TSet, T_heaPumSet.y) annotation (Line(points={{12,-39},{20,-39}, + connect(heatPump.TSet, T_heatPumpSet.y) annotation (Line(points={{12,-39},{20,-39}, {20,-71},{25.3,-71}}, color={0,0,127})); connect(realExpression2.y, add1.u2) annotation (Line(points={{-163.4,-72},{-136,-72}}, color={0,0,127})); @@ -311,22 +315,22 @@ equation {124.7,-32.8},{124.7,-32},{125.4,-32}}, color={0,0,127})); connect(realExpression.y, division1.u2) annotation (Line(points={{-115.4,-90}, {-108,-90},{-108,-74.8},{-97.6,-74.8}}, color={0,0,127})); - connect(P_el_heaPum, realExpression3.y) + connect(P_el_heatPump, realExpression3.y) annotation (Line(points={{-270,110},{-240.6,110}}, color={0,0,127})); - connect(P_el_chi, realExpression4.y) + connect(P_el_chiller, realExpression4.y) annotation (Line(points={{-270,136},{-240.6,136}}, color={0,0,127})); - connect(add2.u1, cooDem) annotation (Line(points={{96,84},{182,84},{182,62},{228, + connect(add2.u1, coolingDemand) annotation (Line(points={{96,84},{182,84},{182,62},{228, 62}}, color={0,0,127})); connect(add2.u2, realExpression5.y) annotation (Line(points={{96,72},{117.4,72}}, color={0,0,127})); connect(division2.u2, const3.y) annotation (Line(points={{61.4,68.8},{66,68.8}, {66,55},{79.3,55}}, color={0,0,127})); - connect(division3.u1, cooDem) annotation (Line(points={{-56.6,111.2},{122, + connect(division3.u1, coolingDemand) annotation (Line(points={{-56.6,111.2},{122, 111.2},{122,84},{182,84},{182,62},{228,62}}, color={0,0,127})); - connect(chi.TSet, T_chiSet.y) + connect(chiller.TSet, T_chillerSet.y) annotation (Line(points={{-2,21},{2,21},{2,9},{9.3,9}}, color={0,0,127})); - connect(realExpression6.y, souCoo.T_in) annotation (Line(points={{-93.4,58},{ + connect(realExpression6.y, sourceCooling.T_in) annotation (Line(points={{-93.4,58},{ -68,58}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-260,-180}, {220,160}}), graphics={ diff --git a/AixLib/Fluid/DistrictHeatingCooling/Demands/ClosedLoop/DHCSubstationHeatPumpDirectCooling.mo b/AixLib/Fluid/DistrictHeatingCooling/Demands/ClosedLoop/DHCSubstationHeatPumpDirectCooling.mo index 81afc84521..9f2a3358ff 100644 --- a/AixLib/Fluid/DistrictHeatingCooling/Demands/ClosedLoop/DHCSubstationHeatPumpDirectCooling.mo +++ b/AixLib/Fluid/DistrictHeatingCooling/Demands/ClosedLoop/DHCSubstationHeatPumpDirectCooling.mo @@ -50,8 +50,10 @@ model DHCSubstationHeatPumpDirectCooling "Substation model for bidirctional low- redeclare package Medium = Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, addPowerToMedium=false, + nominalValuesDefineDefaultPressureCurve=true, use_inputFilter=false, - m_flow_nominal=m_flow_nominal) + m_flow_nominal=m_flow_nominal, + dp_nominal=dp_nominal) "decentral distribution pump for heating on primary side" annotation (Placement(transformation(extent={{-60,-14},{-40,-34}}))); Sources.MassFlowSource_T souHeaSec( @@ -110,8 +112,10 @@ model DHCSubstationHeatPumpDirectCooling "Substation model for bidirctional low- redeclare package Medium = Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, addPowerToMedium=false, + nominalValuesDefineDefaultPressureCurve=true, use_inputFilter=false, - m_flow_nominal=m_flow_nominal) + m_flow_nominal=m_flow_nominal, + dp_nominal=dp_nominal) "decentral distribution pump for cooling on primary side" annotation (Placement(transformation(extent={{68,14},{48,34}}))); Modelica.Blocks.Math.Division division2 @@ -189,11 +193,11 @@ protected equation connect(port_a,vol. ports[1]) - annotation (Line(points={{-240,0},{-214,0},{-214,4}}, + annotation (Line(points={{-240,0},{-213,0},{-213,4}}, color={0,127,255}, thickness=1)); connect(port_b,vol1. ports[1]) - annotation (Line(points={{240,0},{216,0},{216,8}}, + annotation (Line(points={{240,0},{217,0},{217,8}}, color={0,127,255}, thickness=1)); connect(heaDem, add1.u1) @@ -214,7 +218,7 @@ equation connect(T_heaPumSet.y, heaPum.TSet) annotation (Line(points={{77.5,-39},{60,-39}}, color={0,0,127})); connect(dirCoo.ports[1], pumCoo.port_b) - annotation (Line(points={{4,24},{48,24}}, color={0,127,255}, + annotation (Line(points={{5,24},{48,24}}, color={0,127,255}, thickness=1)); connect(cooDem, division2.u1) annotation (Line(points={{248,62},{176,62},{176, 63.2},{103.4,63.2}}, color={0,0,127})); @@ -248,7 +252,7 @@ equation connect(division1.y, pumHeaPri.m_flow_in) annotation (Line(points={{-73.2,-62}, {-50,-62},{-50,-36}}, color={0,0,127})); connect(senT_dirCooOutPri.port_b, dirCoo.ports[2]) - annotation (Line(points={{-58,24},{8,24}}, color={0,127,255}, + annotation (Line(points={{-58,24},{7,24}}, color={0,127,255}, thickness=1)); connect(jun.port_3, senT_dirCooOutPri.port_a) annotation (Line(points={{-126, 10},{-128,10},{-128,24},{-78,24}}, color={0,127,255}, @@ -269,7 +273,7 @@ equation connect(m_flow_heaSec.u1, realExpression4.y) annotation (Line(points={{169.4, -60.8},{177.7,-60.8},{177.7,-60},{181.4,-60}}, color={0,0,127})); connect(vol.ports[2], jun.port_1) - annotation (Line(points={{-210,4},{-210,0},{-136,0}}, color={0,127,255}, + annotation (Line(points={{-211,4},{-211,0},{-136,0}}, color={0,127,255}, thickness=1)); connect(jun.port_2, pumHeaPri.port_a) annotation (Line(points={{-116,0},{-96, 0},{-96,-24},{-60,-24}}, color={0,127,255}, @@ -278,7 +282,7 @@ equation annotation (Line(points={{68,24},{108,24}}, color={0,127,255}, thickness=1)); connect(jun1.port_1, vol1.ports[2]) - annotation (Line(points={{156,0},{220,0},{220,8}}, color={0,127,255}, + annotation (Line(points={{156,0},{219,0},{219,8}}, color={0,127,255}, thickness=1)); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-240, -160},{240,160}}), diff --git a/AixLib/Fluid/DistrictHeatingCooling/Demands/ClosedLoop/SubstationCooling.mo b/AixLib/Fluid/DistrictHeatingCooling/Demands/ClosedLoop/SubstationCooling.mo new file mode 100644 index 0000000000..df3a118bc3 --- /dev/null +++ b/AixLib/Fluid/DistrictHeatingCooling/Demands/ClosedLoop/SubstationCooling.mo @@ -0,0 +1,231 @@ +within AixLib.Fluid.DistrictHeatingCooling.Demands.ClosedLoop; +model SubstationCooling + "Substation model for bidirectional low-temperature networks for buildings with only cooling demand equipped with a chiller" + + replaceable package Medium = + Modelica.Media.Interfaces.PartialMedium "Medium model for water" + annotation (choicesAllMatching = true); + + parameter Modelica.Units.SI.SpecificHeatCapacity cp_default = 4180 "Specific heat capacity of Water (cp-value)"; + + parameter Modelica.Units.SI.HeatFlowRate coolingDemand_max "Maximum cooling demand for scaling of chiller in Watt (negative values)"; + + parameter Modelica.Units.SI.Temperature deltaT_coolingSet "Set temperature difference for cooling on the building site"; + + parameter Modelica.Units.SI.Temperature deltaT_coolingGridSet "Set temperature difference for cooling on the side of the thermal network"; + + parameter Modelica.Units.SI.Pressure dp_nominal(displayUnit="Pa")=30000 "Nominal pressure drop"; + + parameter Modelica.Units.SI.MassFlowRate m_flow_nominal = -coolingDemand_max / (cp_default * deltaT_coolingGridSet) + "Nominal mass flow rate based on max. cooling demand and set temperature difference"; + + Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare package Medium = + Medium) + "Fluid connector for connecting the substation to the warm line of the network" + annotation (Placement(transformation(extent={{-152,-10},{-132,10}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare package Medium = + Medium) + "Fluid connector for connecting the substation to the cold line of the network" + annotation (Placement(transformation(extent={{90,-10},{110,10}}))); + AixLib.Fluid.Delays.DelayFirstOrder vol( + nPorts=2, + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal, + tau=60) annotation (Placement(transformation(extent={{-130,6},{-110,26}}))); + AixLib.Fluid.Delays.DelayFirstOrder vol1( + nPorts=2, + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal, + T_start=288.15, + tau=60) annotation (Placement(transformation(extent={{70,6},{90,26}}))); + AixLib.Fluid.Movers.FlowControlled_m_flow pumpCooling( + redeclare package Medium = Medium, + nominalValuesDefineDefaultPressureCurve=true, + m_flow_nominal=m_flow_nominal, + addPowerToMedium=false, + energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, + use_inputFilter=false, + dp_nominal=dp_nominal) + annotation (Placement(transformation(extent={{68,-10},{48,10}}))); + AixLib.Fluid.Chillers.Carnot_TEva chiller( + redeclare package Medium1 = Medium, + redeclare package Medium2 = Medium, + allowFlowReversal1=true, + use_eta_Carnot_nominal=true, + dp1_nominal=dp_nominal, + dp2_nominal=dp_nominal, + allowFlowReversal2=false, + etaCarnot_nominal=0.4, + QEva_flow_nominal=coolingDemand_max, + QEva_flow_min=coolingDemand_max) annotation (Placement(transformation( + extent={{-9,9},{9,-9}}, + rotation=180, + origin={3,-5}))); + AixLib.Fluid.Sources.MassFlowSource_T coolingReturnBuilding( + use_m_flow_in=true, + use_T_in=true, + redeclare package Medium = Medium, + nPorts=1) + "Mass flow source represents return flow of buildings cooling system" + annotation (Placement(transformation(extent={{-46,-64},{-26,-44}}))); + Modelica.Blocks.Sources.Constant deltaT_coolingBuildingSite(k= + deltaT_coolingSet) + annotation (Placement(transformation(extent={{-126,-94},{-106,-74}}))); + AixLib.Fluid.Sources.Boundary_pT coolingSupplyBuilding(redeclare package + Medium = Medium, nPorts=1) + "Mass flow sink represents supply flow of buildings cooling system" + annotation (Placement(transformation(extent={{64,-64},{44,-44}}))); + Modelica.Blocks.Sources.Constant const(k=-(cp_default*deltaT_coolingSet)) + annotation (Placement(transformation(extent={{-96,-46},{-84,-34}}))); + Modelica.Blocks.Math.Division division + annotation (Placement(transformation(extent={{-72,-38},{-58,-24}}))); + Modelica.Blocks.Sources.Constant const1(k=-(cp_default*deltaT_coolingGridSet)) + annotation (Placement(transformation(extent={{-24,50},{-12,62}}))); + Modelica.Blocks.Math.Division division1 + "Calculation of mass flow rate needed from dhc grid for cooling" + annotation (Placement(transformation(extent={{-2,64},{12,78}}))); + Modelica.Blocks.Interfaces.RealInput coolingDemand(unit="W") + "Input for cooling demand profile of substation (negative values for cooling)" + annotation (Placement(transformation(extent={{-166,74},{-126,114}}), + iconTransformation(extent={{-166,74},{-126,114}}))); + AixLib.Fluid.Sensors.TemperatureTwoPort senTemChiOut(redeclare package Medium + = Medium, m_flow_nominal=m_flow_nominal) + annotation (Placement(transformation(extent={{-82,-6},{-66,8}}))); + Modelica.Blocks.Interfaces.RealInput T_supplyCoolingSet(unit="K") + "Supply temperature of the cooling circuit in the building" + annotation (Placement(transformation(extent={{-166,28},{-126,68}}), + iconTransformation(extent={{-166,28},{-126,68}}))); + Modelica.Blocks.Math.Add add(k2=+1) + annotation (Placement(transformation(extent={{-92,-80},{-72,-60}}))); + Modelica.Blocks.Math.Add add1(k2=-1) + annotation (Placement(transformation(extent={{-44,64},{-24,84}}))); + Modelica.Blocks.Interfaces.RealOutput powerDemandChiller(unit="W") + "Power demand of chiller" + annotation (Placement(transformation(extent={{96,90},{116,110}}), + iconTransformation(extent={{96,90},{116,110}}))); + Modelica.Blocks.Interfaces.RealOutput powerDemandPump(unit="W") + "Power demand of distribution pump" + annotation (Placement(transformation(extent={{96,66},{116,86}}), + iconTransformation(extent={{96,66},{116,86}}))); + Modelica.Blocks.Interfaces.RealOutput powerDemandSubstation(unit="W") + "Power demand of substation (sum of chiller and distribution pump)" + annotation (Placement(transformation(extent={{96,42},{116,62}}), + iconTransformation(extent={{96,42},{116,62}}))); + Modelica.Blocks.Math.Sum sum1(nin=1) + "Adds power demand for chiller and distribution pump" + annotation (Placement(transformation(extent={{68,36},{88,56}}))); + Modelica.Blocks.Math.Gain gain(k=-1) + "switches cooling demand profile from positiv to negativ values" + annotation (Placement(transformation(extent={{-118,70},{-98,90}}))); + Sensors.TemperatureTwoPort senTemChiIn(redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal) + annotation (Placement(transformation(extent={{20,-10},{36,4}}))); +equation + connect(port_a, vol.ports[1]) + annotation (Line(points={{-142,0},{-121,0},{-121,6}}, + color={0,127,255})); + connect(port_b, vol1.ports[1]) + annotation (Line(points={{100,0},{79,0},{79,6}}, color={0,127,255})); + connect(pumpCooling.port_a, vol1.ports[2]) + annotation (Line(points={{68,0},{81,0},{81,6}}, color={0,127,255})); + connect(const1.y, division1.u2) annotation (Line(points={{-11.4,56},{-10,56},{ + -10,66},{-3.4,66},{-3.4,66.8}}, + color={0,0,127})); + connect(chiller.port_b2, coolingSupplyBuilding.ports[1]) annotation (Line( + points={{12,-10.4},{40,-10.4},{40,-54},{44,-54}}, + color={0,127,255})); + connect(add.y, coolingReturnBuilding.T_in) annotation (Line(points={{-71,-70}, + {-58,-70},{-58,-50},{-48,-50}}, color={0,0,127})); + connect(deltaT_coolingBuildingSite.y, add.u2) annotation (Line(points={{-105,-84}, + {-100,-84},{-100,-76},{-94,-76}}, color={0,0,127})); + connect(T_supplyCoolingSet, add.u1) annotation (Line(points={{-146,48},{-102,48}, + {-102,-64},{-94,-64}}, color={0,0,127})); + connect(add1.y, division1.u1) annotation (Line(points={{-23,74},{-16,74},{-16, + 75.2},{-3.4,75.2}}, color={0,0,127})); + connect(chiller.P, add1.u2) annotation (Line(points={{-6.9,-5},{-54,-5},{-54,68}, + {-46,68}}, color={0,0,127})); + connect(division1.y, pumpCooling.m_flow_in) + annotation (Line(points={{12.7,71},{58,71},{58,12}},color={0,0,127})); + connect(chiller.P, powerDemandChiller) annotation (Line(points={{-6.9,-5},{-54, + -5},{-54,100},{106,100}}, color={0,0,127})); + connect(pumpCooling.P, powerDemandPump) annotation (Line(points={{47,9},{46,9}, + {46,76},{106,76}}, color={0,0,127})); + connect(sum1.y, powerDemandSubstation) + annotation (Line(points={{89,46},{98,46},{98,52},{106,52}}, + color={0,0,127})); + connect(chiller.P, sum1.u[1]) annotation (Line(points={{-6.9,-5},{-54,-5},{-54, + 46},{66,46}}, color={0,0,127})); + connect(coolingDemand, gain.u) + annotation (Line(points={{-146,94},{-134,94},{-134,80},{-120,80}}, + color={0,0,127})); + connect(gain.y, add1.u1) + annotation (Line(points={{-97,80},{-46,80}}, color={0,0,127})); + connect(gain.y, division.u1) annotation (Line(points={{-97,80},{-90,80},{-90,-26.8}, + {-73.4,-26.8}}, color={0,0,127})); + connect(T_supplyCoolingSet, chiller.TSet) annotation (Line(points={{-146,48},{ + 36,48},{36,3.1},{13.8,3.1}}, + color={0,0,127})); + connect(const.y, division.u2) annotation (Line(points={{-83.4,-40},{-80,-40},{ + -80,-35.2},{-73.4,-35.2}}, color={0,0,127})); + connect(division.y, coolingReturnBuilding.m_flow_in) annotation (Line(points={ + {-57.3,-31},{-54,-31},{-54,-46},{-48,-46}}, color={0,0,127})); + connect(chiller.port_a2, coolingReturnBuilding.ports[1]) annotation (Line( + points={{-6,-10.4},{-22,-10.4},{-22,-54},{-26,-54}}, + color={0,127,255})); + connect(senTemChiOut.port_b, chiller.port_b1) annotation (Line(points={{-66,1}, + {-34,1},{-34,0.4},{-6,0.4}}, color={0,127,255})); + connect(vol.ports[2], senTemChiOut.port_a) annotation (Line(points={{-119,6},{ + -118,6},{-118,1},{-82,1}}, color={0,127,255})); + connect(senTemChiIn.port_b, pumpCooling.port_b) + annotation (Line(points={{36,-3},{36,0},{48,0}}, color={0,127,255})); + connect(senTemChiIn.port_a, chiller.port_a1) + annotation (Line(points={{20,-3},{20,0.4},{12,0.4}}, color={0,127,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-140,-100}, + {100,120}}), graphics={ + Rectangle( + extent={{-140,120},{100,-100}}, + lineColor={28,108,200}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-90,34},{58,-80}}, + lineColor={28,108,200}, + fillColor={28,108,200}, + fillPattern=FillPattern.Solid), + Line(points={{-90,34},{58,34}}, color={28,108,200}), + Polygon( + points={{-104,34},{-18,112},{70,34},{-104,34}}, + lineColor={28,108,200}, + fillColor={28,108,200}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-58,18},{-30,-12}}, + lineColor={28,108,200}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{0,18},{28,-12}}, + lineColor={28,108,200}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-32,-28},{-6,-80}}, + lineColor={28,108,200}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid)}), Diagram( + coordinateSystem(preserveAspectRatio=false, extent={{-140,-100},{100,120}})), + Documentation(revisions=" +", info=" +

Substation model for bidirectional low-temperature networks with chiller and fixed temperature difference (parameter) on network side. +This model uses the chiller AixLib.Fluid.Chillers.Carnot_TEva. +The supply temperature of buildings cooling system must be set be using the input T_supplyCoolingSet.

+")); +end SubstationCooling; diff --git a/AixLib/Fluid/DistrictHeatingCooling/Demands/ClosedLoop/SubstationDirectCooling.mo b/AixLib/Fluid/DistrictHeatingCooling/Demands/ClosedLoop/SubstationDirectCooling.mo new file mode 100644 index 0000000000..69a72d98ea --- /dev/null +++ b/AixLib/Fluid/DistrictHeatingCooling/Demands/ClosedLoop/SubstationDirectCooling.mo @@ -0,0 +1,182 @@ +within AixLib.Fluid.DistrictHeatingCooling.Demands.ClosedLoop; +model SubstationDirectCooling + "Substation model for bidirctional low-temperature networks for buildings with direct cooling only." + + replaceable package Medium = Modelica.Media.Interfaces.PartialMedium + "Medium model for water" + annotation (choicesAllMatching = true); + + parameter Modelica.Units.SI.SpecificHeatCapacity cp_default = 4180 "Cp-value of Water"; + + parameter Modelica.Units.SI.HeatFlowRate heatDemand_max "Maximum heat demand for scaling of heat pump"; + + parameter Modelica.Units.SI.Temperature deltaT_heatingSet "Set temperature difference for heating on the site of building"; + + parameter Modelica.Units.SI.Temperature deltaT_heatingGridSet "Set temperature difference for heating on the site of thermal network"; + parameter Modelica.Units.SI.Temperature deltaT_coolingGridSet "Set temperature difference for cooling on the side of the thermal network"; + + parameter Modelica.Units.SI.Pressure dp_nominal(displayUnit="Pa")=30000 "Nominal pressure drop"; + + parameter Modelica.Units.SI.Temperature T_supplyHeatingSet "Set supply temperature fore space heating"; + + parameter Modelica.Units.SI.MassFlowRate m_flow_nominal = m_flow_nominal + "Nominal mass flow rate"; + + AixLib.Fluid.Delays.DelayFirstOrder vol( + nPorts=2, + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal, + tau=60) annotation (Placement(transformation(extent={{-242,4},{-222,24}}))); + AixLib.Fluid.Delays.DelayFirstOrder vol1( + nPorts=2, + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal, + tau=60) annotation (Placement(transformation(extent={{188,8},{208,28}}))); +public + Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare package Medium = + Medium) + "Fluid connector for connecting the substation to the warm line of the network" + annotation (Placement(transformation(extent={{-270,-10},{-250,10}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare package Medium = + Medium) + "Fluid connector for connecting the substation to the cold line of the network" + annotation (Placement(transformation(extent={{210,-10},{230,10}}), + iconTransformation(extent={{210,-10},{230,10}}))); + + AixLib.Fluid.Delays.DelayFirstOrder del( + nPorts=2, + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal) + annotation (Placement(transformation(extent={{-112,0},{-92,20}}))); + AixLib.Fluid.Movers.FlowControlled_m_flow pumpCooling( + redeclare package Medium = Medium, + energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, + addPowerToMedium=false, + nominalValuesDefineDefaultPressureCurve=true, + use_inputFilter=false, + m_flow_nominal=m_flow_nominal, + dp_nominal=dp_nominal) + annotation (Placement(transformation(extent={{50,-10},{30,10}}))); + Modelica.Blocks.Interfaces.RealInput coolingDemand(unit = "W") + "Input for cooling demand profile of substation" + annotation (Placement( + transformation(extent={{248,42},{208,82}}), iconTransformation(extent={{-176,40}, + {-136,80}}))); + Modelica.Blocks.Math.Division division2 + annotation (Placement(transformation(extent={{68,100},{54,114}}))); + Modelica.Blocks.Sources.RealExpression + realExpression1(y=(cp_default*(273.15 + 22 + - senTem4.T))) + annotation (Placement(transformation(extent={{104,84},{92,96}}))); + AixLib.Fluid.Sensors.MassFlowRate senMasFlo_GridHeat(redeclare package Medium + = Medium) + annotation (Placement(transformation(extent={{-206,-10},{-186,10}}))); + AixLib.Fluid.Sensors.MassFlowRate senMasFlo_GridCool(redeclare package Medium + = Medium) + annotation (Placement(transformation(extent={{152,-10},{172,10}}))); + AixLib.Fluid.Sensors.MassFlowRate senMasFlo(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{90,-10},{70,10}}))); + Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow prescribedHeatFlow + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-108,88}))); + AixLib.Fluid.Sensors.TemperatureTwoPort senTem4(redeclare package Medium = + Medium, m_flow_nominal=2) + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + Modelica.Blocks.Sources.BooleanStep booleanStep(startTime=7200) + annotation (Placement(transformation(extent={{-6,-6},{6,6}}, + rotation=0, + origin={-40,94}))); + Modelica.Blocks.Logical.Switch mass_flow_heatExchangerHeating1 + "calculation of mass flow through heat exchanger (heating)" + annotation (Placement(transformation(extent={{-14,84},{6,104}}))); + Modelica.Blocks.Sources.Constant const3(k=m_flow_nominal) + annotation (Placement(transformation(extent={{-50,48},{-38,60}}))); +equation + + connect(port_a,vol. ports[1]) + annotation (Line(points={{-260,0},{-233,0},{-233,4}}, + color={0,127,255})); + connect(port_b,vol1. ports[1]) + annotation (Line(points={{220,0},{197,0},{197,8}}, + color={0,127,255})); + connect(division2.u2, realExpression1.y) annotation (Line(points={{69.4,102.8}, + {81.7,102.8},{81.7,90},{91.4,90}}, color={0,0,127})); + connect(vol.ports[2], senMasFlo_GridHeat.port_a) annotation (Line(points={{-231,4}, + {-231,0},{-206,0},{-206,0}}, color={0,127,255})); + connect(senMasFlo_GridCool.port_b, vol1.ports[2]) + annotation (Line(points={{172,0},{199,0},{199,8}}, color={0,127,255})); + connect(senMasFlo.port_b, pumpCooling.port_a) + annotation (Line(points={{70,0},{50,0}}, color={0,127,255})); + connect(port_a, port_a) + annotation (Line(points={{-260,0},{-260,0}}, color={0,127,255})); + connect(del.ports[1], pumpCooling.port_b) + annotation (Line(points={{-103,0},{30,0}}, color={0,127,255})); + connect(coolingDemand, division2.u1) annotation (Line(points={{228,62},{122, + 62},{122,111.2},{69.4,111.2}}, + color={0,0,127})); + connect(prescribedHeatFlow.port, del.heatPort) annotation (Line(points={{-108,78}, + {-112,78},{-112,10}}, color={191,0,0})); + connect(prescribedHeatFlow.Q_flow, coolingDemand) annotation (Line(points={{-108,98}, + {-108,138},{224,138},{224,62},{228,62}}, color={0,0,127})); + connect(senMasFlo.port_a, senTem4.port_a) + annotation (Line(points={{90,0},{100,0}}, color={0,127,255})); + connect(booleanStep.y,mass_flow_heatExchangerHeating1. u2) annotation (Line( + points={{-33.4,94},{-16,94}}, color={255,0,255})); + connect(const3.y,mass_flow_heatExchangerHeating1. u3) annotation (Line(points={{-37.4, + 54},{-24,54},{-24,86},{-16,86}}, color={0,0,127})); + connect(division2.y, mass_flow_heatExchangerHeating1.u1) annotation (Line( + points={{53.3,107},{-26,107},{-26,102},{-16,102}}, color={0,0,127})); + connect(mass_flow_heatExchangerHeating1.y, pumpCooling.m_flow_in) + annotation (Line(points={{7,94},{40,94},{40,12}}, color={0,0,127})); + connect(senMasFlo_GridHeat.port_b, del.ports[2]) + annotation (Line(points={{-186,0},{-101,0}}, color={0,127,255})); + connect(senTem4.port_b, senMasFlo_GridCool.port_a) + annotation (Line(points={{120,0},{152,0}}, color={0,127,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-260, + -160},{220,160}}), + graphics={ + Rectangle( + extent={{-160,160},{140,-160}}, + lineColor={28,108,200}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-90,30},{94,-146}}, + lineColor={0,0,0}, + fillColor={28,108,200}, + fillPattern=FillPattern.HorizontalCylinder), + Polygon( + points={{-106,30},{-6,140},{112,30},{-106,30}}, + lineColor={0,0,0}, + fillColor={238,46,47}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-48,6},{-12,-36}}, + lineColor={28,108,200}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-22,-72},{18,-146}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{18,6},{54,-36}}, + lineColor={28,108,200}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid)}), Diagram( + coordinateSystem(preserveAspectRatio=false, extent={{-260,-160},{220, + 160}})), + Documentation(revisions=" + +")); +end SubstationDirectCooling; diff --git a/AixLib/Fluid/DistrictHeatingCooling/Demands/ClosedLoop/SubstationDirectHeatingDirectCooling.mo b/AixLib/Fluid/DistrictHeatingCooling/Demands/ClosedLoop/SubstationDirectHeatingDirectCooling.mo new file mode 100644 index 0000000000..967cf0e977 --- /dev/null +++ b/AixLib/Fluid/DistrictHeatingCooling/Demands/ClosedLoop/SubstationDirectHeatingDirectCooling.mo @@ -0,0 +1,240 @@ +within AixLib.Fluid.DistrictHeatingCooling.Demands.ClosedLoop; +model SubstationDirectHeatingDirectCooling "Substation model for bidirctional low-temperature networks for buildings with + direct heating and direct cooling. For simultaneous cooling and heat demands, + the return flows are used as supply flows for the other application." + + replaceable package Medium = Modelica.Media.Interfaces.PartialMedium + "Medium model for water" + annotation (choicesAllMatching = true); + + parameter Modelica.Units.SI.SpecificHeatCapacity cp_default = 4180 "Cp-value of Water"; + + parameter Modelica.Units.SI.HeatFlowRate heatDemand_max "Maximum heat demand for scaling of heat pump"; + + parameter Modelica.Units.SI.Temperature deltaT_heatingSet "Set temperature difference for heating on the site of building"; + + parameter Modelica.Units.SI.Temperature deltaT_heatingGridSet "Set temperature difference for heating on the site of thermal network"; + parameter Modelica.Units.SI.Temperature deltaT_coolingGridSet "Set temperature difference for cooling on the side of the thermal network"; + + parameter Modelica.Units.SI.Pressure dp_nominal(displayUnit="Pa")=30000 "Nominal pressure drop"; + + parameter Modelica.Units.SI.Temperature T_supplyHeatingSet "Set supply temperature fore space heating"; + + parameter Modelica.Units.SI.MassFlowRate m_flow_nominal = m_flow_nominal + "Nominal mass flow rate"; + + AixLib.Fluid.Delays.DelayFirstOrder vol( + nPorts=2, + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal, + tau=60) annotation (Placement(transformation(extent={{-242,4},{-222,24}}))); + AixLib.Fluid.Delays.DelayFirstOrder vol1( + nPorts=2, + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal, + tau=60) annotation (Placement(transformation(extent={{188,8},{208,28}}))); + AixLib.Fluid.Movers.FlowControlled_m_flow pumpHeating( + redeclare package Medium = Medium, + energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, + addPowerToMedium=false, + nominalValuesDefineDefaultPressureCurve=true, + use_inputFilter=false, + m_flow_nominal=m_flow_nominal, + dp_nominal=dp_nominal) + annotation (Placement(transformation(extent={{-80,-14},{-60,-34}}))); +public + Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare package Medium = + Medium) + "Fluid connector for connecting the substation to the warm line of the network" + annotation (Placement(transformation(extent={{-270,-10},{-250,10}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare package Medium = + Medium) + "Fluid connector for connecting the substation to the cold line of the network" + annotation (Placement(transformation(extent={{210,-10},{230,10}}), + iconTransformation(extent={{210,-10},{230,10}}))); + Modelica.Blocks.Math.Division division1 + annotation (Placement(transformation(extent={{-96,-78},{-80,-62}}))); + Modelica.Blocks.Sources.Constant const3(k=(cp_default*deltaT_heatingGridSet)) + annotation (Placement(transformation(extent={{-138,-104},{-126,-92}}))); + Modelica.Blocks.Interfaces.RealInput heatDemand(unit = "W") + "Input for heat demand profile of substation" + annotation (Placement(transformation(extent={{-294,-80},{-254,-40}}), + iconTransformation(extent={{152,84},{112,124}}))); + + AixLib.Fluid.FixedResistances.Junction jun( + redeclare package Medium = Medium, + dp_nominal={0,dp_nominal,dp_nominal}, + portFlowDirection_1=Modelica.Fluid.Types.PortFlowDirection.Bidirectional, + portFlowDirection_2=Modelica.Fluid.Types.PortFlowDirection.Bidirectional, + portFlowDirection_3=Modelica.Fluid.Types.PortFlowDirection.Entering, + m_flow_nominal=m_flow_nominal*{1,1,1}) + annotation (Placement(transformation(extent={{-156,10},{-136,-10}}))); + + AixLib.Fluid.FixedResistances.Junction jun1( + redeclare package Medium = Medium, + dp_nominal={0,dp_nominal,dp_nominal}, + portFlowDirection_3=Modelica.Fluid.Types.PortFlowDirection.Entering, + m_flow_nominal=m_flow_nominal*{1,1,1}) + annotation (Placement(transformation(extent={{136,-10},{116,10}}))); + AixLib.Fluid.Delays.DelayFirstOrder del( + nPorts=2, + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal) + annotation (Placement(transformation(extent={{-24,24},{-4,44}}))); + AixLib.Fluid.Movers.FlowControlled_m_flow pumpCooling( + redeclare package Medium = Medium, + energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, + addPowerToMedium=false, + nominalValuesDefineDefaultPressureCurve=true, + use_inputFilter=false, + m_flow_nominal=m_flow_nominal, + dp_nominal=dp_nominal) + annotation (Placement(transformation(extent={{48,14},{28,34}}))); + Modelica.Blocks.Interfaces.RealInput coolingDemand(unit = "W") + "Input for cooling demand profile of substation" + annotation (Placement( + transformation(extent={{248,42},{208,82}}), iconTransformation(extent={{-176,66}, + {-136,106}}))); + Modelica.Blocks.Math.Division division2 + annotation (Placement(transformation(extent={{48,100},{34,114}}))); + Modelica.Blocks.Sources.Constant const1(k=(cp_default*deltaT_coolingGridSet)) + annotation (Placement(transformation(extent={{78,84},{66,96}}))); + AixLib.Fluid.Sensors.MassFlowRate senMasFlo_GridHeat(redeclare package + Medium = Medium) + annotation (Placement(transformation(extent={{-206,-10},{-186,10}}))); + AixLib.Fluid.Sensors.MassFlowRate senMasFlo_GridCool(redeclare package + Medium = Medium) + annotation (Placement(transformation(extent={{152,-10},{172,10}}))); + AixLib.Fluid.Sensors.MassFlowRate senMasFlo_HeatPump(redeclare package + Medium = Medium) + annotation (Placement(transformation(extent={{-114,-34},{-94,-14}}))); + AixLib.Fluid.Sensors.MassFlowRate senMasFlo(redeclare package Medium = + Medium) annotation (Placement(transformation(extent={{78,14},{58,34}}))); + Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow prescribedHeatFlow + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-40,88}))); + AixLib.Fluid.Sensors.TemperatureTwoPort senTem(redeclare package Medium = + Medium, m_flow_nominal=2) + annotation (Placement(transformation(extent={{22,-34},{42,-14}}))); + AixLib.Fluid.Sensors.TemperatureTwoPort senTem1(redeclare package Medium = + Medium, m_flow_nominal=2) + annotation (Placement(transformation(extent={{-46,-34},{-26,-14}}))); + AixLib.Fluid.Delays.DelayFirstOrder del1( + nPorts=2, + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal) + annotation (Placement(transformation(extent={{-10,-24},{10,-44}}))); + Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow prescribedHeatFlow1 + annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=-90, + origin={-40,-84}))); + Modelica.Blocks.Math.Gain gain(k=-1) + annotation (Placement(transformation(extent={{-178,-132},{-158,-112}}))); +equation + + connect(port_a,vol. ports[1]) + annotation (Line(points={{-260,0},{-233,0},{-233,4}}, + color={0,127,255})); + connect(port_b,vol1. ports[1]) + annotation (Line(points={{220,0},{197,0},{197,8}}, + color={0,127,255})); + connect(const3.y, division1.u2) annotation (Line(points={{-125.4,-98},{-108,-98}, + {-108,-74.8},{-97.6,-74.8}}, color={0,0,127})); + connect(division1.y, pumpHeating.m_flow_in) annotation (Line(points={{-79.2,-70}, + {-70,-70},{-70,-36}}, color={0,0,127})); + connect(division2.u2, const1.y) annotation (Line(points={{49.4,102.8},{57.7, + 102.8},{57.7,90},{65.4,90}}, color={0,0,127})); + connect(division2.y, pumpCooling.m_flow_in) annotation (Line(points={{33.3, + 107},{32,107},{32,66},{38,66},{38,36}}, color={0,0,127})); + connect(vol.ports[2], senMasFlo_GridHeat.port_a) annotation (Line(points={{-231,4}, + {-231,0},{-206,0},{-206,0}}, color={0,127,255})); + connect(senMasFlo_GridHeat.port_b, jun.port_1) + annotation (Line(points={{-186,0},{-156,0}}, color={0,127,255})); + connect(senMasFlo_GridCool.port_b, vol1.ports[2]) + annotation (Line(points={{172,0},{199,0},{199,8}}, color={0,127,255})); + connect(senMasFlo_GridCool.port_a, jun1.port_1) + annotation (Line(points={{152,0},{136,0}}, color={0,127,255})); + connect(jun.port_2, senMasFlo_HeatPump.port_a) annotation (Line(points={{ + -136,0},{-118,0},{-118,-24},{-114,-24}}, color={0,127,255})); + connect(senMasFlo_HeatPump.port_b, pumpHeating.port_a) + annotation (Line(points={{-94,-24},{-80,-24}}, color={0,127,255})); + connect(senMasFlo.port_a, jun1.port_2) annotation (Line(points={{78,24},{100,24}, + {100,0},{116,0}}, color={0,127,255})); + connect(senMasFlo.port_b, pumpCooling.port_a) + annotation (Line(points={{58,24},{48,24}}, color={0,127,255})); + connect(port_a, port_a) + annotation (Line(points={{-260,0},{-260,0}}, color={0,127,255})); + connect(del.ports[1], pumpCooling.port_b) + annotation (Line(points={{-15,24},{28,24}}, color={0,127,255})); + connect(jun.port_3, del.ports[2]) annotation (Line(points={{-146,10},{-148,10}, + {-148,24},{-13,24}}, color={0,127,255})); + connect(coolingDemand, division2.u1) annotation (Line(points={{228,62},{122,62}, + {122,111.2},{49.4,111.2}}, color={0,0,127})); + connect(prescribedHeatFlow.port, del.heatPort) + annotation (Line(points={{-40,78},{-40,34},{-24,34}}, color={191,0,0})); + connect(prescribedHeatFlow.Q_flow, coolingDemand) annotation (Line(points={{-40, + 98},{-40,138},{156,138},{156,62},{228,62}}, color={0,0,127})); + connect(pumpHeating.port_b, senTem1.port_a) + annotation (Line(points={{-60,-24},{-46,-24}}, color={0,127,255})); + connect(senTem.port_b, jun1.port_3) annotation (Line(points={{42,-24},{126, + -24},{126,-10}}, color={0,127,255})); + connect(senTem1.port_b,del1. ports[1]) + annotation (Line(points={{-26,-24},{-1,-24}}, color={0,127,255})); + connect(senTem.port_a,del1. ports[2]) + annotation (Line(points={{22,-24},{1,-24}}, color={0,127,255})); + connect(prescribedHeatFlow1.port,del1. heatPort) annotation (Line(points={{-40, + -74},{-40,-52},{-18,-52},{-18,-34},{-10,-34}}, color={191,0,0})); + connect(heatDemand, division1.u1) annotation (Line(points={{-274,-60},{-124,-60}, + {-124,-65.2},{-97.6,-65.2}}, color={0,0,127})); + connect(heatDemand, gain.u) annotation (Line(points={{-274,-60},{-234,-60},{ + -234,-122},{-180,-122}}, color={0,0,127})); + connect(gain.y, prescribedHeatFlow1.Q_flow) annotation (Line(points={{-157, + -122},{-40,-122},{-40,-94}}, color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-260, + -160},{220,160}}), + graphics={ + Rectangle( + extent={{-160,160},{140,-160}}, + lineColor={28,108,200}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-90,30},{94,-146}}, + lineColor={0,0,0}, + fillColor={28,108,200}, + fillPattern=FillPattern.HorizontalCylinder), + Polygon( + points={{-106,30},{-6,140},{112,30},{-106,30}}, + lineColor={0,0,0}, + fillColor={238,46,47}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-48,6},{-12,-36}}, + lineColor={28,108,200}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-22,-72},{18,-146}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{18,6},{54,-36}}, + lineColor={28,108,200}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid)}), Diagram( + coordinateSystem(preserveAspectRatio=false, extent={{-260,-160},{220, + 160}})), + Documentation(revisions=" + +")); +end SubstationDirectHeatingDirectCooling; diff --git a/AixLib/Fluid/DistrictHeatingCooling/Demands/ClosedLoop/SubstationDirectHeatingDirectCoolingDHW.mo b/AixLib/Fluid/DistrictHeatingCooling/Demands/ClosedLoop/SubstationDirectHeatingDirectCoolingDHW.mo new file mode 100644 index 0000000000..ccfa5c7193 --- /dev/null +++ b/AixLib/Fluid/DistrictHeatingCooling/Demands/ClosedLoop/SubstationDirectHeatingDirectCoolingDHW.mo @@ -0,0 +1,345 @@ +within AixLib.Fluid.DistrictHeatingCooling.Demands.ClosedLoop; +model SubstationDirectHeatingDirectCoolingDHW "Substation model for bidirctional low-temperature networks for buildings with + heat pump,direct cooling and DHW demand. For simultaneous cooling and heat demands, + the return flows are used as supply flows for the other application." + + replaceable package Medium = Modelica.Media.Interfaces.PartialMedium + "Medium model for water" + annotation (choicesAllMatching = true); + + parameter Modelica.Units.SI.SpecificHeatCapacity cp_default = 4180 "Cp-value of Water"; + + parameter Modelica.Units.SI.HeatFlowRate heatDemand_max "Maximum heat demand for scaling of heat pump"; + + parameter Modelica.Units.SI.TemperatureDifference deltaT_heatingSet "Set temperature difference for heating on the site of building"; + + parameter Modelica.Units.SI.TemperatureDifference deltaT_coolingGridSet "Set temperature difference for cooling on the side of the thermal network"; + + parameter Modelica.Units.SI.Pressure dp_nominal(displayUnit="Pa")=30000 "Nominal pressure drop"; + + parameter Modelica.Units.SI.Temperature T_supplyDHWSet "Set supply temperature for space heating"; + + parameter Modelica.Units.SI.Temperature T_returnSpaceHeatingSet "Set return temperature"; + + parameter Modelica.Units.SI.MassFlowRate m_flow_nominal = m_flow_nominal + "Nominal mass flow rate"; + + AixLib.Fluid.Delays.DelayFirstOrder vol( + T_start=305.15, + nPorts=2, + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal, + tau=60) annotation (Placement(transformation(extent={{-242,4},{-222,24}}))); + AixLib.Fluid.Delays.DelayFirstOrder vol1( + nPorts=2, + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal, + tau=60) annotation (Placement(transformation(extent={{188,8},{208,28}}))); + AixLib.Fluid.Movers.FlowControlled_m_flow pumpHeating( + redeclare package Medium = Medium, + energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, + addPowerToMedium=false, + nominalValuesDefineDefaultPressureCurve=true, + use_inputFilter=false, + m_flow_nominal=m_flow_nominal, + dp_nominal=dp_nominal) + annotation (Placement(transformation(extent={{-64,-10},{-44,10}}))); + AixLib.Fluid.Sources.MassFlowSource_T sourceHeating( + use_m_flow_in=true, + use_T_in=true, + redeclare package Medium = Medium, + nPorts=1) annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=0, + origin={146,-56}))); + Modelica.Blocks.Sources.Constant T_return(k=deltaT_heatingSet) + annotation (Placement(transformation(extent={{7,-7},{-7,7}}, + rotation=0, + origin={213,-97}))); + AixLib.Fluid.Sources.Boundary_pT sinkHeating(redeclare package Medium = + Medium, nPorts=1) + annotation (Placement(transformation(extent={{14,-62},{34,-42}}))); + Modelica.Blocks.Sources.Constant const(k=(cp_default*deltaT_heatingSet)) + annotation (Placement(transformation(extent={{6,-6},{-6,6}}, + rotation=0, + origin={214,-52}))); + Modelica.Blocks.Math.Division division + annotation (Placement(transformation(extent={{7,-7},{-7,7}}, + rotation=0, + origin={187,-39}))); +public + Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare package Medium = + Medium) + "Fluid connector for connecting the substation to the warm line of the network" + annotation (Placement(transformation(extent={{-270,-10},{-250,10}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare package Medium = + Medium) + "Fluid connector for connecting the substation to the cold line of the network" + annotation (Placement(transformation(extent={{210,-10},{230,10}}), + iconTransformation(extent={{210,-10},{230,10}}))); + AixLib.Fluid.HeatPumps.Carnot_TCon heaPum( + redeclare package Medium1 = Medium, + redeclare package Medium2 = Medium, + use_eta_Carnot_nominal=true, + show_T=true, + etaCarnot_nominal=0.5, + QCon_flow_nominal=heatDemand_max, + dp1_nominal=0, + dp2_nominal=0) + annotation (Placement(transformation(extent={{104,4},{84,-16}}))); + Modelica.Blocks.Math.Division division1 + annotation (Placement(transformation(extent={{-196,104},{-180,120}}))); + Modelica.Blocks.Interfaces.RealInput heatDemand(unit = "W") + "Input for heat demand profile of substation" + annotation (Placement(transformation(extent={{-288,128},{-248,168}}), + iconTransformation(extent={{-180,116},{-140,156}}))); + + Modelica.Blocks.Math.Add add(k2=-1) + annotation (Placement(transformation(extent={{10,-10},{-10,10}}, + rotation=0, + origin={182,-80}))); + + AixLib.Fluid.Delays.DelayFirstOrder del( + redeclare package Medium = Medium, + T_start=305.15, + m_flow_nominal=m_flow_nominal, + nPorts=2) annotation (Placement(transformation(extent={{-10,0},{10,20}}))); + Modelica.Blocks.Interfaces.RealInput coolingDemand(unit = "W") + "Input for cooling demand profile of substation" + annotation (Placement( + transformation(extent={{-290,92},{-250,132}}), + iconTransformation(extent={{-180,22}, + {-140,62}}))); + AixLib.Fluid.Sensors.MassFlowRate senMasFlo_GridCool(redeclare package Medium + = Medium) + annotation (Placement(transformation(extent={{152,-10},{172,10}}))); + Modelica.Blocks.Sources.Constant const4(k=T_supplyDHWSet) + annotation (Placement(transformation(extent={{192,-150},{172,-130}}))); + Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow prescribedHeatFlow + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-22,32}))); + AixLib.Fluid.Sensors.TemperatureTwoPort senTem2(redeclare package Medium = + Medium, m_flow_nominal=m_flow_nominal) + annotation (Placement(transformation(extent={{66,-62},{46,-42}}))); + AixLib.Fluid.Sensors.TemperatureTwoPort senTem3(redeclare package Medium = + Medium, m_flow_nominal=m_flow_nominal) + annotation (Placement(transformation(extent={{130,-66},{110,-44}}))); + Modelica.Blocks.Interfaces.RealOutput P_el_HP( unit = "W") + "Electrical power consumed by heat pump" + annotation (Placement(transformation(extent={{216,-30},{236,-10}}))); + Modelica.Blocks.Math.Add add2(k1=-1, k2=1) + annotation (Placement(transformation(extent={{-140,132},{-120,152}}))); + Modelica.Blocks.Interfaces.RealInput dhwDemand(unit="W") + "Input for domestic hot water demand profile of substation" annotation ( + Placement(transformation(extent={{-290,54},{-250,94}}), + iconTransformation(extent={{-180,70},{-140,110}}))); + Modelica.Blocks.Math.Add add3(k1=1, k2=1) + annotation (Placement(transformation(extent={{-226,40},{-206,60}}))); + Modelica.Blocks.Math.Division division2 + annotation (Placement(transformation(extent={{-196,76},{-180,92}}))); + Modelica.Blocks.Sources.Constant const1(k=(cp_default*deltaT_coolingGridSet)) + annotation (Placement(transformation(extent={{-226,70},{-214,82}}))); + Modelica.Blocks.Math.Division division3 + annotation (Placement(transformation(extent={{-152,50},{-136,66}}))); + AixLib.Fluid.Sensors.TemperatureTwoPort senTemHPin(redeclare package Medium + = Medium, m_flow_nominal=m_flow_nominal) + annotation (Placement(transformation(extent={{28,-10},{48,12}}))); + Modelica.Blocks.Sources.RealExpression realExpression(y=cp_default*(senTemIn.T + - 15 - 273.15)) + annotation (Placement(transformation(extent={{-214,0},{-194,20}}))); + Modelica.Blocks.Math.Max max + annotation (Placement(transformation(extent={{-162,90},{-142,110}}))); + Modelica.Blocks.Math.Max max1 + annotation (Placement(transformation(extent={{-122,54},{-102,74}}))); + Modelica.Blocks.Math.Max max2 + annotation (Placement(transformation(extent={{-174,6},{-154,26}}))); + Modelica.Blocks.Sources.Constant const2(k=2*cp_default) + "min temperatur difference for dhw" + annotation (Placement(transformation(extent={{-204,28},{-192,40}}))); + AixLib.Fluid.Sensors.TemperatureTwoPort senTemIn( + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal, + T_start=305.15) + annotation (Placement(transformation(extent={{-138,-12},{-118,10}}))); + Modelica.Blocks.Math.Feedback feedback + annotation (Placement(transformation(extent={{-152,-62},{-172,-42}}))); + Modelica.Blocks.Sources.Constant const5(k=T_returnSpaceHeatingSet) + annotation (Placement(transformation(extent={{-142,-78},{-154,-66}}))); + Modelica.Blocks.Math.Gain gain(k=cp_default) + annotation (Placement(transformation(extent={{-186,-62},{-206,-42}}))); + AixLib.Fluid.Sensors.TemperatureTwoPort senTemOut( + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal, + T_start=305.15) + annotation (Placement(transformation(extent={{114,-12},{134,10}}))); + Modelica.Blocks.Sources.BooleanStep booleanStep(startTime=7200) + annotation (Placement(transformation(extent={{-118,32},{-106,44}}))); + Modelica.Blocks.Logical.Switch mass_flow_heatExchangerHeating1 + "calculation of mass flow through heat exchanger (heating)" + annotation (Placement(transformation(extent={{-76,46},{-56,66}}))); + Modelica.Blocks.Sources.Constant const3(k=m_flow_nominal) + annotation (Placement(transformation(extent={{-104,12},{-92,24}}))); + Modelica.Blocks.Math.Max max3 + annotation (Placement(transformation(extent={{20,68},{40,88}}))); + Modelica.Blocks.Sources.Constant const6(k=0.1*m_flow_nominal) + annotation (Placement(transformation(extent={{26,114},{38,126}}))); +equation + + connect(port_a,vol. ports[1]) + annotation (Line(points={{-260,0},{-233,0},{-233,4}}, + color={0,127,255})); + connect(port_b,vol1. ports[1]) + annotation (Line(points={{220,0},{197,0},{197,8}}, + color={0,127,255})); + connect(division.u2, const.y) annotation (Line(points={{195.4,-43.2},{198, + -43.2},{198,-52},{207.4,-52}}, + color={0,0,127})); + connect(division.y, sourceHeating.m_flow_in) annotation (Line(points={{179.3, + -39},{168,-39},{168,-48},{158,-48}}, + color={0,0,127})); + connect(add.y, sourceHeating.T_in) annotation (Line(points={{171,-80},{166, + -80},{166,-52},{158,-52}}, + color={0,0,127})); + connect(senMasFlo_GridCool.port_b, vol1.ports[2]) + annotation (Line(points={{172,0},{199,0},{199,8}}, color={0,127,255})); + connect(port_a, port_a) + annotation (Line(points={{-260,0},{-260,0}}, color={0,127,255})); + connect(const4.y, add.u1) annotation (Line(points={{171,-140},{162,-140},{162, + -122},{202,-122},{202,-74},{194,-74}}, + color={0,0,127})); + connect(const4.y, heaPum.TSet) annotation (Line(points={{171,-140},{134,-140}, + {134,-14},{106,-14},{106,-15}}, + color={0,0,127})); + connect(prescribedHeatFlow.port, del.heatPort) annotation (Line(points={{-22,22}, + {-22,10},{-10,10}}, color={191,0,0})); + connect(senTem3.port_b, heaPum.port_a1) + annotation (Line(points={{110,-55},{110,-54},{106,-54},{106,-12},{104,-12}}, + color={0,127,255})); + connect(senTem2.port_a, heaPum.port_b1) annotation (Line(points={{66,-52},{78, + -52},{78,-12},{84,-12}}, color={0,127,255})); + connect(pumpHeating.port_b, del.ports[1]) + annotation (Line(points={{-44,0},{-1,0}}, color={0,127,255})); + connect(heatDemand, add2.u1) + annotation (Line(points={{-268,148},{-142,148}}, color={0,0,127})); + connect(coolingDemand, add2.u2) annotation (Line(points={{-270,112},{-212,112}, + {-212,136},{-142,136}}, color={0,0,127})); + connect(add2.y, prescribedHeatFlow.Q_flow) + annotation (Line(points={{-119,142},{-22,142},{-22,42}}, + color={0,0,127})); + connect(heatDemand, division1.u1) annotation (Line(points={{-268,148},{-226,148}, + {-226,116.8},{-197.6,116.8}}, color={0,0,127})); + connect(const1.y, division2.u2) annotation (Line(points={{-213.4,76},{-206,76}, + {-206,79.2},{-197.6,79.2}}, color={0,0,127})); + connect(coolingDemand, division2.u1) annotation (Line(points={{-270,112},{-228, + 112},{-228,88.8},{-197.6,88.8}}, color={0,0,127})); + connect(dhwDemand, add3.u1) annotation (Line(points={{-270,74},{-240,74},{-240, + 56},{-228,56}}, color={0,0,127})); + connect(heaPum.P, add3.u2) annotation (Line(points={{83,-6},{90,-6},{90,-20}, + {-252,-20},{-252,44},{-228,44}}, color={0,0,127})); + connect(add3.y, division3.u1) annotation (Line(points={{-205,50},{-196,50},{-196, + 62.8},{-153.6,62.8}}, color={0,0,127})); + connect(del.ports[2], senTemHPin.port_a) + annotation (Line(points={{1,0},{28,0},{28,1}}, color={0,127,255})); + connect(senTemHPin.port_b, heaPum.port_a2) annotation (Line(points={{48,1},{ + 84,1},{84,0}}, color={0,127,255})); + connect(division1.y, max.u1) annotation (Line(points={{-179.2,112},{-172,112}, + {-172,106},{-164,106}}, color={0,0,127})); + connect(division2.y, max.u2) annotation (Line(points={{-179.2,84},{-172,84},{-172, + 94},{-164,94}}, color={0,0,127})); + connect(max.y, max1.u1) annotation (Line(points={{-141,100},{-138,100},{-138,70}, + {-124,70}}, color={0,0,127})); + connect(heaPum.P, P_el_HP) annotation (Line(points={{83,-6},{90,-6},{90,-20}, + {226,-20}},color={0,0,127})); + connect(dhwDemand, division.u1) annotation (Line(points={{-270,74},{-258,74}, + {-258,72},{-248,72},{-248,-26},{204,-26},{204,-34},{196,-34},{196, + -34.8},{195.4,-34.8}}, + color={0,0,127})); + connect(division3.y, max1.u2) + annotation (Line(points={{-135.2,58},{-124,58}}, color={0,0,127})); + connect(realExpression.y, max2.u2) + annotation (Line(points={{-193,10},{-176,10}}, color={0,0,127})); + connect(const2.y, max2.u1) annotation (Line(points={{-191.4,34},{-182,34},{-182, + 22},{-176,22}}, color={0,0,127})); + connect(max2.y, division3.u2) annotation (Line(points={{-153,16},{-146,16},{-146, + 40},{-164,40},{-164,53.2},{-153.6,53.2}}, color={0,0,127})); + connect(T_return.y, add.u2) annotation (Line(points={{205.3,-97},{200,-97},{ + 200,-86},{194,-86}}, color={0,0,127})); + connect(senTem2.port_b, sinkHeating.ports[1]) + annotation (Line(points={{46,-52},{34,-52}}, color={0,127,255})); + connect(vol.ports[2], senTemIn.port_a) annotation (Line(points={{-231,4},{-231, + -1},{-138,-1}}, color={0,127,255})); + connect(senTemIn.port_b, pumpHeating.port_a) annotation (Line(points={{-118,-1}, + {-102,-1},{-102,0},{-64,0}}, color={0,127,255})); + connect(senTemIn.T, feedback.u1) annotation (Line(points={{-128,11.1},{-128,18}, + {-142,18},{-142,-52},{-154,-52}}, color={0,0,127})); + connect(gain.u, feedback.y) + annotation (Line(points={{-184,-52},{-171,-52}}, color={0,0,127})); + connect(gain.y, division1.u2) annotation (Line(points={{-207,-52},{-248,-52},{ + -248,108},{-197.6,108},{-197.6,107.2}}, color={0,0,127})); + connect(const5.y, feedback.u2) annotation (Line(points={{-154.6,-72},{-162,-72}, + {-162,-60}}, color={0,0,127})); + connect(heaPum.port_b2, senTemOut.port_a) annotation (Line(points={{104,0},{110, + 0},{110,-1},{114,-1}}, color={0,127,255})); + connect(senTemOut.port_b, senMasFlo_GridCool.port_a) annotation (Line(points={ + {134,-1},{142,-1},{142,0},{152,0}}, color={0,127,255})); + connect(max1.y, mass_flow_heatExchangerHeating1.u1) + annotation (Line(points={{-101,64},{-78,64}}, color={0,0,127})); + connect(booleanStep.y, mass_flow_heatExchangerHeating1.u2) annotation (Line( + points={{-105.4,38},{-92,38},{-92,56},{-78,56}}, color={255,0,255})); + connect(const3.y, mass_flow_heatExchangerHeating1.u3) annotation (Line(points={{-91.4, + 18},{-84,18},{-84,48},{-78,48}}, color={0,0,127})); + connect(max3.u2, mass_flow_heatExchangerHeating1.y) annotation (Line(points={ + {18,72},{-18,72},{-18,56},{-55,56}}, color={0,0,127})); + connect(const6.y, max3.u1) annotation (Line(points={{38.6,120},{68,120},{68, + 100},{4,100},{4,84},{18,84}}, color={0,0,127})); + connect(max3.y, pumpHeating.m_flow_in) annotation (Line(points={{41,78},{64, + 78},{64,36},{-54,36},{-54,12}}, color={0,0,127})); + connect(senTem3.port_a, sourceHeating.ports[1]) annotation (Line(points={{130, + -55},{130,-56},{136,-56}}, color={0,127,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-260, + -160},{220,160}}), + graphics={ + Rectangle( + extent={{-160,160},{140,-160}}, + lineColor={28,108,200}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-90,30},{94,-146}}, + lineColor={0,0,0}, + fillColor={28,108,200}, + fillPattern=FillPattern.HorizontalCylinder), + Polygon( + points={{-106,30},{-6,140},{112,30},{-106,30}}, + lineColor={0,0,0}, + fillColor={238,46,47}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-48,6},{-12,-36}}, + lineColor={28,108,200}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-22,-72},{18,-146}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{18,6},{54,-36}}, + lineColor={28,108,200}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid)}), Diagram( + coordinateSystem(preserveAspectRatio=false, extent={{-260,-160},{220, + 160}})), + Documentation(revisions=" + +")); +end SubstationDirectHeatingDirectCoolingDHW; diff --git a/AixLib/Fluid/DistrictHeatingCooling/Demands/ClosedLoop/SubstationHeating.mo b/AixLib/Fluid/DistrictHeatingCooling/Demands/ClosedLoop/SubstationHeating.mo new file mode 100644 index 0000000000..3a965e01c8 --- /dev/null +++ b/AixLib/Fluid/DistrictHeatingCooling/Demands/ClosedLoop/SubstationHeating.mo @@ -0,0 +1,221 @@ +within AixLib.Fluid.DistrictHeatingCooling.Demands.ClosedLoop; +model SubstationHeating + "Substation model for bidirectional low-temperature networks for buildings with only heating demand equipped with a heat pump" + + replaceable package Medium = AixLib.Media.Water "Medium model for water" + annotation (choicesAllMatching = true); + + parameter Modelica.Units.SI.SpecificHeatCapacity cp_default = 4180 "Specific heat capacity of Water (cp-value)"; + + parameter Modelica.Units.SI.HeatFlowRate heatDemand_max(min=1) "Maximum heat demand for scaling of heatpump in Watt"; + + parameter Modelica.Units.SI.TemperatureDifference deltaT_heatingSet(min=0.1) "Set temperature difference for heating on the site of building"; + + parameter Modelica.Units.SI.TemperatureDifference deltaT_heatingGridSet(min=0.1) "Set temperature difference for heating on the site of thermal network"; + + parameter Modelica.Units.SI.Pressure dp_nominal(displayUnit="Pa", min=100) "Nominal pressure drop"; + + parameter Modelica.Units.SI.MassFlowRate m_flow_nominal = heatDemand_max / (cp_default * deltaT_heatingGridSet) + "Nominal mass flow rate based on max. heating demand and set temperature difference"; + + AixLib.Fluid.Delays.DelayFirstOrder vol( + nPorts=2, + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal, + tau=60) annotation (Placement(transformation(extent={{-90,6},{-70,26}}))); + AixLib.Fluid.Delays.DelayFirstOrder vol1( + nPorts=2, + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal, + tau=60) annotation (Placement(transformation(extent={{132,6},{152,26}}))); + AixLib.Fluid.Movers.FlowControlled_m_flow pumpHeating( + redeclare package Medium = Medium, + energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, + addPowerToMedium=false, + nominalValuesDefineDefaultPressureCurve=true, + use_inputFilter=false, + m_flow_nominal=m_flow_nominal, + dp_nominal=dp_nominal) + annotation (Placement(transformation(extent={{-64,-10},{-44,10}}))); + AixLib.Fluid.Sources.MassFlowSource_T heatingReturnBuilding( + use_m_flow_in=true, + use_T_in=true, + redeclare package Medium = Medium, + nPorts=1) "Represents return line of buildings heating system" + annotation (Placement(transformation(extent={{88,-48},{68,-28}}))); + Modelica.Blocks.Sources.Constant deltaT_heatingBuildingSide(k= + deltaT_heatingSet) + annotation (Placement(transformation(extent={{136,-74},{124,-62}}))); + AixLib.Fluid.Sources.Boundary_pT heatingSupplyBuilding(redeclare package + Medium = Medium, nPorts=1) + "Represents supply flow of buildings heating system" + annotation (Placement(transformation(extent={{-44,-48},{-24,-28}}))); + Modelica.Blocks.Sources.Constant const(k=(cp_default*deltaT_heatingSet)) + annotation (Placement(transformation(extent={{142,-44},{130,-32}}))); + Modelica.Blocks.Math.Division division + annotation (Placement(transformation(extent={{114,-38},{98,-22}}))); +public + Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare package Medium = + AixLib.Media.Water) + "Fluid connector for connecting the substation to the warm line of the network" + annotation (Placement(transformation(extent={{-110,-10},{-90,10}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare package Medium = + AixLib.Media.Water) + "Fluid connector for connecting the substation to the cold line of the network" + annotation (Placement(transformation(extent={{150,-10},{170,10}}), + iconTransformation(extent={{150,-10},{170,10}}))); + AixLib.Fluid.HeatPumps.Carnot_TCon heatPump( + redeclare package Medium1 = Medium, + redeclare package Medium2 = Medium, + dp1_nominal=dp_nominal, + dp2_nominal=dp_nominal, + use_eta_Carnot_nominal=true, + show_T=true, + etaCarnot_nominal=0.4, + QCon_flow_nominal=heatDemand_max) + annotation (Placement(transformation(extent={{48,4},{28,-16}}))); + Modelica.Blocks.Math.Division division1 + "Calculation of mass flow rate needed from dhc grid for heating" + annotation (Placement(transformation(extent={{-36,58},{-50,72}}))); + Modelica.Blocks.Sources.Constant const3(k=(cp_default*deltaT_heatingGridSet)) + annotation (Placement(transformation(extent={{-14,52},{-26,64}}))); + AixLib.Fluid.Sensors.TemperatureTwoPort senTemHeatingSup(redeclare package + Medium = Medium, m_flow_nominal=m_flow_nominal) + "Supply temperatur of buildings heating system" + annotation (Placement(transformation(extent={{6,-48},{-14,-28}}))); + Modelica.Blocks.Interfaces.RealInput heatDemand(unit = "W") + "Input for heat demand profile of substation" + annotation (Placement(transformation(extent={{-128,74},{-88,114}}), + iconTransformation(extent={{-116,74},{-76,114}}))); + Modelica.Blocks.Interfaces.RealInput T_supplyHeatingSet(unit = "K") + "Supply temperature of the heating circuit in the building" + annotation (Placement( + transformation(extent={{-128,26},{-88,66}}), iconTransformation( + extent={{-116,30},{-76,70}}))); + Modelica.Blocks.Math.Add add(k2=-1) + annotation (Placement(transformation(extent={{114,-66},{98,-50}}))); + Modelica.Blocks.Math.Add add1(k2=-1) + annotation (Placement(transformation(extent={{8,-8},{-8,8}}, + rotation=90, + origin={2,80}))); + Modelica.Blocks.Interfaces.RealOutput powerDemandHP(unit = "W") + "Power demand of heat pump" + annotation (Placement(transformation(extent={{158,96},{178,116}}), + iconTransformation(extent={{158,96},{178,116}}))); + Modelica.Blocks.Interfaces.RealOutput powerDemandPump(unit = "W") + "Power demand of distribution pump" + annotation (Placement(transformation(extent={{158,72},{178,92}}), + iconTransformation(extent={{158,72},{178,92}}))); + Modelica.Blocks.Math.Sum sumPower(nin=1) + "Adds power demand for heat pump and distribution pump" + annotation (Placement(transformation(extent={{104,58},{124,78}}))); + Modelica.Blocks.Interfaces.RealOutput powerDemandSubstation(unit = "W") + "Power demand of substation (sum of heat pump and distribution pump)" + annotation (Placement(transformation(extent={{158,48},{178,68}}), + iconTransformation(extent={{158,48},{178,68}}))); +equation + connect(port_a,vol. ports[1]) + annotation (Line(points={{-100,0},{-81,0},{-81,6}}, color={0,127,255})); + connect(port_b,vol1. ports[1]) + annotation (Line(points={{160,0},{141,0},{141,6}}, + color={0,127,255})); + connect(vol.ports[2],pumpHeating. port_a) annotation (Line(points={{-79,6},{-79, + 0},{-64,0}}, color={0,127,255})); + connect(pumpHeating.port_b, heaPum.port_a2) annotation (Line(points={{-44,0},{ + 28,0}}, color={0,127,255})); + connect(heaPum.port_b2, vol1.ports[2]) annotation (Line(points={{48,0},{143,0}, + {143,6}}, color={0,127,255})); + connect(heatingReturnBuilding.ports[1], heaPum.port_a1) annotation (Line( + points={{68,-38},{60,-38},{60,-12},{48,-12}}, color={0,127,255})); + connect(heatingReturnBuilding.m_flow_in, division.y) + annotation (Line(points={{90,-30},{97.2,-30}}, color={0,0,127})); + connect(division.u2, const.y) annotation (Line(points={{115.6,-34.8},{120,-34.8}, + {120,-38},{129.4,-38}}, color={0,0,127})); + connect(const3.y, division1.u2) annotation (Line(points={{-26.6,58},{-30,58},{ + -30,60.8},{-34.6,60.8}}, + color={0,0,127})); + connect(division1.y,pumpHeating. m_flow_in) + annotation (Line(points={{-50.7,65},{-54,65},{-54,12}},color={0,0,127})); + connect(senTemHeatingSup.port_a, heaPum.port_b1) annotation (Line(points={{6,-38}, + {20,-38},{20,-12},{28,-12}}, color={0,127,255})); + connect(senTemHeatingSup.port_b, heatingSupplyBuilding.ports[1]) + annotation (Line(points={{-14,-38},{-24,-38}}, color={0,127,255})); + connect(division.u1,heatDemand) annotation (Line(points={{115.6,-25.2},{127.7, + -25.2},{127.7,94},{-108,94}}, color={0,0,127})); + connect(T_supplyHeatingSet, heaPum.TSet) annotation (Line(points={{-108,46},{54, + 46},{54,-14},{50,-14},{50,-15}}, + color={0,0,127})); + connect(deltaT_heatingBuildingSide.y, add.u2) annotation (Line(points={{123.4, + -68},{119.65,-68},{119.65,-62.8},{115.6,-62.8}}, + color={0,0,127})); + connect(T_supplyHeatingSet, add.u1) annotation (Line(points={{-108,46},{122,46}, + {122,-53.2},{115.6,-53.2}}, + color={0,0,127})); + connect(add.y, heatingReturnBuilding.T_in) + annotation (Line(points={{97.2,-58},{90,-58},{90,-34}}, color={0,0,127})); + connect(heaPum.P, add1.u2) annotation (Line(points={{27,-6},{18,-6},{18,92},{8, + 92},{8,89.6},{6.8,89.6}}, color={0,0,127})); + connect(division1.u1, add1.y) annotation (Line(points={{-34.6,69.2},{2,69.2},{ + 2,71.2}}, color={0,0,127})); + connect(heaPum.P, powerDemandHP) annotation (Line(points={{27,-6},{18,-6},{18, + 40},{90,40},{90,106},{168,106}}, color={0,0,127})); + connect(pumpHeating.P, powerDemandPump) annotation (Line(points={{-43,9},{66, + 9},{66,82},{168,82}}, color={0,0,127})); + connect(heaPum.P, sumPower.u[1]) annotation (Line(points={{27,-6},{18,-6},{18, + 40},{90,40},{90,68},{102,68}}, color={0,0,127})); + connect(sumPower.y, powerDemandSubstation) + annotation (Line(points={{125,68},{146,68},{146,58},{168,58}}, + color={0,0,127})); + connect(heatDemand, add1.u1) annotation (Line(points={{-108,94},{-2.8,94},{-2.8, + 89.6}}, color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{160,120}}), graphics={ + Rectangle( + extent={{-100,120},{160,-100}}, + lineColor={28,108,200}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-38,34},{110,-80}}, + lineColor={0,0,0}, + fillColor={238,46,47}, + fillPattern=FillPattern.Solid), + Line(points={{-48,34},{100,34}},color={28,108,200}), + Polygon( + points={{-52,34},{34,112},{122,34},{-52,34}}, + lineColor={0,0,0}, + fillColor={238,46,47}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-6,18},{22,-12}}, + lineColor={28,108,200}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{52,18},{80,-12}}, + lineColor={28,108,200}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{20,-28},{46,-80}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid)}), Diagram( + coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{160, + 120}})), + Documentation(revisions=" + +", info=" +

Substation model for bidirectional low-temperature networks with heat pump and fixed temperature difference (parameter) on network side. +This model uses the heat pump AixLib.Fluid.HeatPumps.Carnot_TCon. +The supply temperature of buildings heating system must be set be using the input T_supplyHeatingSet.

+")); +end SubstationHeating; diff --git a/AixLib/Fluid/DistrictHeatingCooling/Demands/ClosedLoop/SubstationHeatingCoolingFixDeltaT.mo b/AixLib/Fluid/DistrictHeatingCooling/Demands/ClosedLoop/SubstationHeatingCoolingFixDeltaT.mo new file mode 100644 index 0000000000..6d8819cf0b --- /dev/null +++ b/AixLib/Fluid/DistrictHeatingCooling/Demands/ClosedLoop/SubstationHeatingCoolingFixDeltaT.mo @@ -0,0 +1,337 @@ +within AixLib.Fluid.DistrictHeatingCooling.Demands.ClosedLoop; +model SubstationHeatingCoolingFixDeltaT "Substation model for bidirctional low-temperature networks for buildings with + heat pump and chiller." + + replaceable package Medium = Modelica.Media.Interfaces.PartialMedium + "Medium model for water" + annotation (choicesAllMatching = true); + + parameter Modelica.Units.SI.SpecificHeatCapacity cp_default = 4180 "Cp-value of Water"; + + parameter Modelica.Units.SI.HeatFlowRate heatDemand_max "Maximum heat demand for scaling of heat pump"; + parameter Modelica.Units.SI.HeatFlowRate coolingDemand_max "Maximum cooling demand for scaling of chiller (negative values)"; + + parameter Modelica.Units.SI.Temperature deltaT_heatingSet "Set temperature difference for heating on the site of building"; + parameter Modelica.Units.SI.Temperature deltaT_coolingSet "set temperature difference for cooling on the building site"; + + parameter Modelica.Units.SI.Temperature deltaT_heatingGridSet "Set temperature difference for heating on the site of thermal network"; + parameter Modelica.Units.SI.Temperature deltaT_coolingGridSet "Set temperature difference for cooling on the side of the thermal network"; + + parameter Modelica.Units.SI.Pressure dp_nominal(displayUnit="Pa")=30000 "Nominal pressure drop"; + + parameter Modelica.Units.SI.MassFlowRate m_flow_nominal = max((heatDemand_max/(cp_default*deltaT_heatingGridSet)),-coolingDemand_max/(cp_default*deltaT_coolingGridSet)) + "Nominal mass flow rate based on max. demand and set temperature difference"; + + AixLib.Fluid.Delays.DelayFirstOrder vol( + nPorts=2, + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal) + annotation (Placement(transformation(extent={{-242,4},{-222,24}}))); + AixLib.Fluid.Delays.DelayFirstOrder vol1( + nPorts=2, + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal) + annotation (Placement(transformation(extent={{188,8},{208,28}}))); + AixLib.Fluid.Movers.FlowControlled_m_flow pumpHeating( + redeclare package Medium = Medium, + nominalValuesDefineDefaultPressureCurve=true, + m_flow_nominal=m_flow_nominal, + energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, + addPowerToMedium=false, + use_inputFilter=false, + dp_nominal=dp_nominal) + annotation (Placement(transformation(extent={{-80,-14},{-60,-34}}))); + AixLib.Fluid.Sources.MassFlowSource_T sourceHeating( + use_m_flow_in=true, + use_T_in=true, + redeclare package Medium = Medium, + nPorts=1) annotation (Placement(transformation(extent={{62,-64},{42,-44}}))); + Modelica.Blocks.Sources.Constant T_return(k=deltaT_heatingSet) + annotation (Placement(transformation(extent={{118,-102},{104,-88}}))); + AixLib.Fluid.Sources.Boundary_pT sinkHeating(redeclare package Medium = + Medium, nPorts=1) + annotation (Placement(transformation(extent={{-48,-64},{-28,-44}}))); + Modelica.Blocks.Sources.Constant const(k=(cp_default*deltaT_heatingSet)) + annotation (Placement(transformation(extent={{128,-56},{116,-44}}))); + Modelica.Blocks.Math.Division division + annotation (Placement(transformation(extent={{104,-44},{90,-30}}))); +public + Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare package Medium = + Medium) + "Fluid connector for connecting the substation to the warm line of the network" + annotation (Placement(transformation(extent={{-270,-10},{-250,10}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare package Medium = + Medium) + "Fluid connector for connecting the substation to the cold line of the network" + annotation (Placement(transformation(extent={{210,-10},{230,10}}), + iconTransformation(extent={{210,-10},{230,10}}))); + AixLib.Fluid.HeatPumps.Carnot_TCon heaPum( + redeclare package Medium1 = Medium, + redeclare package Medium2 = Medium, + allowFlowReversal1=false, + allowFlowReversal2=false, + dTEva_nominal=-deltaT_heatingGridSet, + dTCon_nominal=deltaT_heatingSet, + dp1_nominal=dp_nominal, + dp2_nominal=dp_nominal, + use_eta_Carnot_nominal=true, + show_T=true, + etaCarnot_nominal=0.5, + QCon_flow_nominal=heatDemand_max) + annotation (Placement(transformation(extent={{10,-20},{-10,-40}}))); + Modelica.Blocks.Math.Division division1 + annotation (Placement(transformation(extent={{-96,-78},{-80,-62}}))); + Modelica.Blocks.Sources.Constant const3(k=(cp_default*deltaT_heatingGridSet)) + annotation (Placement(transformation(extent={{-138,-104},{-126,-92}}))); + Modelica.Blocks.Interfaces.RealInput heatDemand(unit = "W") + "Input for heat demand profile of substation" + annotation (Placement(transformation(extent={{-294,-80},{-254,-40}}), + iconTransformation(extent={{240,70},{200,110}}))); + Modelica.Blocks.Interfaces.RealInput T_supplyHeatingSet(unit = "K") + "Supply temperature of the heating circuit in the building" + annotation ( + Placement(transformation( + extent={{20,20},{-20,-20}}, + rotation=180, + origin={-270,-138}), iconTransformation(extent={{240,114},{200,154}}))); + + Modelica.Blocks.Math.Add add(k2=-1) + annotation (Placement(transformation(extent={{92,-88},{72,-68}}))); + Modelica.Blocks.Math.Add add1(k2=-1) + annotation (Placement(transformation(extent={{-134,-76},{-114,-56}}))); + AixLib.Fluid.FixedResistances.Junction jun( + redeclare package Medium = Medium, + tau=60, + dp_nominal={0,dp_nominal,dp_nominal}, + m_flow_nominal=max(m_flow_nominal, 1)*{1,1,1}, + portFlowDirection_1=Modelica.Fluid.Types.PortFlowDirection.Bidirectional, + portFlowDirection_2=Modelica.Fluid.Types.PortFlowDirection.Bidirectional, + portFlowDirection_3=Modelica.Fluid.Types.PortFlowDirection.Entering) + annotation (Placement(transformation(extent={{-156,10},{-136,-10}}))); + + AixLib.Fluid.FixedResistances.Junction jun1( + redeclare package Medium = Medium, + tau=60, + dp_nominal={0,dp_nominal,dp_nominal}, + m_flow_nominal=max(m_flow_nominal, 1)*{1,1,1}, + portFlowDirection_3=Modelica.Fluid.Types.PortFlowDirection.Entering) + annotation (Placement(transformation(extent={{134,-10},{114,10}}))); + AixLib.Fluid.Chillers.Carnot_TEva chi( + redeclare package Medium1 = Medium, + redeclare package Medium2 = Medium, + allowFlowReversal1=false, + allowFlowReversal2=false, + dTEva_nominal=-deltaT_coolingSet, + dTCon_nominal=deltaT_coolingGridSet, + use_eta_Carnot_nominal=true, + dp1_nominal=dp_nominal, + dp2_nominal=dp_nominal, + etaCarnot_nominal=0.4, + QEva_flow_nominal=coolingDemand_max) + annotation (Placement(transformation(extent={{-4,40},{-24,20}}))); + AixLib.Fluid.Movers.FlowControlled_m_flow pumpCooling( + redeclare package Medium = Medium, + nominalValuesDefineDefaultPressureCurve=true, + m_flow_nominal=m_flow_nominal, + energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, + addPowerToMedium=false, + use_inputFilter=false, + dp_nominal=dp_nominal) + annotation (Placement(transformation(extent={{48,14},{28,34}}))); + Modelica.Blocks.Interfaces.RealInput coolingDemand(unit = "W") + "Input for cooling demand profile of substation" + annotation (Placement( + transformation(extent={{248,42},{208,82}}), iconTransformation(extent={{-280,66}, + {-240,106}}))); + Modelica.Blocks.Interfaces.RealInput T_supplyCoolingSet(unit = "K") + "Supply temperature of cooling circuit in the building" + annotation ( + Placement(transformation(extent={{248,82},{208,122}}), + iconTransformation(extent={{-280,112},{-240,152}}))); + AixLib.Fluid.Sources.MassFlowSource_T sourceCooling( + use_m_flow_in=true, + use_T_in=true, + redeclare package Medium = Medium, + nPorts=1) annotation (Placement(transformation(extent={{-70,44},{-50,64}}))); + AixLib.Fluid.Sources.Boundary_pT sinkCooling(redeclare package Medium = + Medium, nPorts=1) + annotation (Placement(transformation(extent={{30,46},{10,66}}))); + Modelica.Blocks.Math.Add add2(k2=-1) + annotation (Placement(transformation(extent={{82,102},{62,122}}))); + Modelica.Blocks.Math.Division division2 + annotation (Placement(transformation(extent={{48,100},{34,114}}))); + Modelica.Blocks.Sources.Constant const1(k=-(cp_default* + deltaT_coolingGridSet)) + annotation (Placement(transformation(extent={{78,84},{66,96}}))); + Modelica.Blocks.Math.Add add3( + k2=+1) + annotation (Placement(transformation(extent={{-120,100},{-100,120}}))); + Modelica.Blocks.Sources.Constant T_return1(k=deltaT_coolingSet) + annotation (Placement(transformation(extent={{-158,76},{-138,96}}))); + Modelica.Blocks.Math.Division division3 + annotation (Placement(transformation(extent={{-58,120},{-72,134}}))); + Modelica.Blocks.Sources.Constant const2(k=-(cp_default*deltaT_coolingSet)) + annotation (Placement(transformation(extent={{-32,94},{-44,106}}))); + AixLib.Fluid.Sensors.MassFlowRate senMasFlo_GridHeat(redeclare package + Medium = Medium) + annotation (Placement(transformation(extent={{-206,-10},{-186,10}}))); + AixLib.Fluid.Sensors.MassFlowRate senMasFlo_GridCool(redeclare package + Medium = Medium) + annotation (Placement(transformation(extent={{152,-10},{172,10}}))); + AixLib.Fluid.Sensors.MassFlowRate senMasFlo_HeatPump(redeclare package + Medium = Medium) + annotation (Placement(transformation(extent={{-114,-34},{-94,-14}}))); + AixLib.Fluid.Sensors.MassFlowRate senMasFlo_chiller(redeclare package + Medium = Medium) + annotation (Placement(transformation(extent={{78,14},{58,34}}))); + Modelica.Blocks.Math.Gain gain(k=-1) + annotation (Placement(transformation(extent={{188,52},{168,72}}))); +equation + connect(port_a,vol. ports[1]) + annotation (Line(points={{-260,0},{-233,0},{-233,4}}, + color={0,127,255})); + connect(port_b,vol1. ports[1]) + annotation (Line(points={{220,0},{197,0},{197,8}}, + color={0,127,255})); + connect(chi.port_b1, jun.port_3) annotation (Line(points={{-24,24},{-146,24}, + {-146,10}},color={0,127,255})); + connect(heaPum.port_b2, jun1.port_3) + annotation (Line(points={{10,-24},{124,-24},{124,-10}}, + color={0,127,255})); + connect(pumpHeating.port_b, heaPum.port_a2) + annotation (Line(points={{-60,-24},{-10,-24}}, color={0,127,255})); + connect(chi.port_a1, pumpCooling.port_b) + annotation (Line(points={{-4,24},{28,24}},color={0,127,255})); + connect(heaPum.P, add1.u2) annotation (Line(points={{-11,-30},{-54,-30},{-54,-80}, + {-144,-80},{-144,-72},{-136,-72},{-136,-72}}, color={0,0,127})); + connect(heatDemand, add1.u1) + annotation (Line(points={{-274,-60},{-136,-60}}, color={0,0,127})); + connect(add1.y, division1.u1) annotation (Line(points={{-113,-66},{-106,-66},{ + -106,-65.2},{-97.6,-65.2}}, color={0,0,127})); + connect(const3.y, division1.u2) annotation (Line(points={{-125.4,-98},{-108,-98}, + {-108,-74.8},{-97.6,-74.8}}, color={0,0,127})); + connect(division1.y, pumpHeating.m_flow_in) annotation (Line(points={{-79.2,-70}, + {-70,-70},{-70,-36}}, color={0,0,127})); + connect(T_supplyHeatingSet, heaPum.TSet) annotation (Line(points={{-270, + -138},{20,-138},{20,-39},{12,-39}}, + color={0,0,127})); + connect(sourceHeating.ports[1], heaPum.port_a1) annotation (Line(points={{42,-54}, + {28,-54},{28,-36},{10,-36}}, color={0,127,255})); + connect(sinkHeating.ports[1], heaPum.port_b1) annotation (Line(points={{-28,-54}, + {-22,-54},{-22,-36},{-10,-36}}, color={0,127,255})); + connect(heatDemand, division.u1) annotation (Line(points={{-274,-60},{-154, + -60},{-154,-120},{132,-120},{132,-38},{105.4,-38},{105.4,-32.8}}, + color={0, + 0,127})); + connect(division.u2, const.y) annotation (Line(points={{105.4,-41.2},{112,-41.2}, + {112,-50},{115.4,-50}}, color={0,0,127})); + connect(division.y, sourceHeating.m_flow_in) annotation (Line(points={{89.3, + -37},{76.65,-37},{76.65,-46},{64,-46}}, + color={0,0,127})); + connect(T_supplyHeatingSet, add.u1) annotation (Line(points={{-270,-138},{ + 124,-138},{124,-72},{94,-72}}, color={0,0,127})); + connect(T_return.y, add.u2) annotation (Line(points={{103.3,-95},{100,-95},{100, + -84},{94,-84}}, color={0,0,127})); + connect(add.y, sourceHeating.T_in) annotation (Line(points={{71,-78},{68,-78}, + {68,-50},{64,-50}}, color={0,0,127})); + connect(sourceCooling.ports[1], chi.port_a2) annotation (Line(points={{-50,54}, + {-30,54},{-30,36},{-24,36}}, color={0,127,255})); + connect(chi.port_b2, sinkCooling.ports[1]) annotation (Line(points={{-4,36},{ + 0,36},{0,56},{10,56}}, color={0,127,255})); + connect(chi.P, add2.u2) annotation (Line(points={{-25,30},{-130,30},{-130,80}, + {88,80},{88,106},{84,106}}, color={0,0,127})); + connect(division2.u1, add2.y) annotation (Line(points={{49.4,111.2},{55.7, + 111.2},{55.7,112},{61,112}}, color={0,0,127})); + connect(division2.u2, const1.y) annotation (Line(points={{49.4,102.8},{57.7, + 102.8},{57.7,90},{65.4,90}}, color={0,0,127})); + connect(division2.y, pumpCooling.m_flow_in) annotation (Line(points={{33.3, + 107},{32,107},{32,66},{38,66},{38,36}}, color={0,0,127})); + connect(T_return1.y, add3.u2) annotation (Line(points={{-137,86},{-130,86},{ + -130,104},{-122,104}}, color={0,0,127})); + connect(T_supplyCoolingSet, add3.u1) annotation (Line(points={{228,102},{ + 106,102},{106,146},{-150,146},{-150,116},{-122,116}}, + color={0,0,127})); + connect(add3.y, sourceCooling.T_in) annotation (Line(points={{-99,110},{-94, + 110},{-94,58},{-72,58}}, color={0,0,127})); + connect(const2.y, division3.u2) annotation (Line(points={{-44.6,100},{-50,100}, + {-50,122.8},{-56.6,122.8}}, color={0,0,127})); + connect(division3.y, sourceCooling.m_flow_in) annotation (Line(points={{-72.7, + 127},{-86,127},{-86,62},{-72,62}}, color={0,0,127})); + connect(T_supplyCoolingSet, chi.TSet) annotation (Line(points={{228,102},{ + 106,102},{106,42},{8,42},{8,21},{-2,21}}, color= + {0,0,127})); + connect(vol.ports[2], senMasFlo_GridHeat.port_a) annotation (Line(points={{-231,4}, + {-231,0},{-206,0},{-206,0}}, color={0,127,255})); + connect(senMasFlo_GridHeat.port_b, jun.port_1) + annotation (Line(points={{-186,0},{-156,0}}, color={0,127,255})); + connect(senMasFlo_GridCool.port_b, vol1.ports[2]) + annotation (Line(points={{172,0},{199,0},{199,8}}, color={0,127,255})); + connect(senMasFlo_GridCool.port_a, jun1.port_1) + annotation (Line(points={{152,0},{134,0}}, color={0,127,255})); + connect(jun.port_2, senMasFlo_HeatPump.port_a) annotation (Line(points={{ + -136,0},{-118,0},{-118,-24},{-114,-24}}, color={0,127,255})); + connect(senMasFlo_HeatPump.port_b, pumpHeating.port_a) + annotation (Line(points={{-94,-24},{-80,-24}}, color={0,127,255})); + connect(senMasFlo_chiller.port_a, jun1.port_2) annotation (Line(points={{78,24}, + {100,24},{100,0},{114,0}}, color={0,127,255})); + connect(senMasFlo_chiller.port_b, pumpCooling.port_a) + annotation (Line(points={{58,24},{48,24}}, color={0,127,255})); + connect(port_a, port_a) + annotation (Line(points={{-260,0},{-260,0}}, color={0,127,255})); + connect(coolingDemand, gain.u) + annotation (Line(points={{228,62},{190,62}}, color={0,0,127})); + connect(gain.y, add2.u1) annotation (Line(points={{167,62},{98,62},{98,118},{ + 84,118}}, color={0,0,127})); + connect(gain.y, division3.u1) annotation (Line(points={{167,62},{98,62},{98, + 131.2},{-56.6,131.2}}, color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-260, + -160},{220,160}}), + graphics={ + Rectangle( + extent={{-260,160},{222,-180}}, + lineColor={28,108,200}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-154,32},{-30,142},{118,32},{-154,32}}, + lineColor={0,0,0}, + fillColor={238,46,47}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-154,32},{118,-174}}, + lineColor={0,0,0}, + fillColor={28,108,200}, + fillPattern=FillPattern.HorizontalCylinder), + Rectangle( + extent={{-102,4},{-56,-50}}, + lineColor={28,108,200}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{10,2},{58,-54}}, + lineColor={28,108,200}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-36,-100},{4,-174}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid)}), Diagram( + coordinateSystem(preserveAspectRatio=false, extent={{-260,-160},{220, + 160}})), + Documentation(revisions=" + +", info=" +Substation model for bidirectional low-temperature networks with heat pump and chiller and fixed temperature difference (parameter) on network side. +In the case of simultaneous cooling and heating demands,the return flows are used as supply flows for the other application. The mass flows are controlled equation-based. +This model uses the heat pump AixLib.Fluid.HeatPumps.Carnot_TCon +and the chiller AixLib.Fluid.Chillers.Carnot_TEva. +In case of simultanious heating and coolling operation the return flows are used as supply flows for the other application. +")); +end SubstationHeatingCoolingFixDeltaT; diff --git a/AixLib/Fluid/DistrictHeatingCooling/Demands/ClosedLoop/SubstationHeatingCoolingVarDeltaT.mo b/AixLib/Fluid/DistrictHeatingCooling/Demands/ClosedLoop/SubstationHeatingCoolingVarDeltaT.mo new file mode 100644 index 0000000000..852b490b98 --- /dev/null +++ b/AixLib/Fluid/DistrictHeatingCooling/Demands/ClosedLoop/SubstationHeatingCoolingVarDeltaT.mo @@ -0,0 +1,374 @@ +within AixLib.Fluid.DistrictHeatingCooling.Demands.ClosedLoop; +model SubstationHeatingCoolingVarDeltaT "Substation model for bidirctional low-temperature networks for buildings with + heat pump and chiller" + + replaceable package Medium = Modelica.Media.Interfaces.PartialMedium + "Medium model for water" + annotation (choicesAllMatching = true); + + final parameter Modelica.Units.SI.SpecificHeatCapacity cp_default = 4180 "Cp-value of Water"; + + parameter Modelica.Units.SI.HeatFlowRate heatDemand_max "maximum heat demand for scaling of heatpump in Watt"; + parameter Modelica.Units.SI.HeatFlowRate coolingDemand_max "maximum cooling demand for scaling of chiller in Watt (negative values)"; + + parameter Modelica.Units.SI.Temperature deltaT_heatingSet "set temperature difference for heating on the site of building"; + parameter Modelica.Units.SI.Temperature deltaT_coolingSet "set temperature difference for cooling on the building site"; + + parameter Modelica.Units.SI.Pressure dp_nominal(displayUnit="Pa")=30000 "nominal pressure drop"; + + parameter Modelica.Units.SI.MassFlowRate m_flow_nominal = max((heatDemand_max/(cp_default*deltaT_heatingSet)),-coolingDemand_max/(cp_default*deltaT_coolingSet)) + "Nominal mass flow rate based on max. demand and set temperature difference"; + + AixLib.Fluid.Delays.DelayFirstOrder vol( + nPorts=2, + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal) + annotation (Placement(transformation(extent={{-242,4},{-222,24}}))); + AixLib.Fluid.Delays.DelayFirstOrder vol1( + nPorts=2, + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal) + annotation (Placement(transformation(extent={{188,8},{208,28}}))); + AixLib.Fluid.Movers.FlowControlled_m_flow pumpHeating( + redeclare package Medium = Medium, + energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, + addPowerToMedium=false, + nominalValuesDefineDefaultPressureCurve=true, + use_inputFilter=false, + m_flow_nominal=m_flow_nominal, + dp_nominal=dp_nominal) + annotation (Placement(transformation(extent={{-80,-14},{-60,-34}}))); + AixLib.Fluid.Sources.MassFlowSource_T sourceHeating( + use_m_flow_in=true, + use_T_in=true, + redeclare package Medium = Medium, + nPorts=1) annotation (Placement(transformation(extent={{62,-64},{42,-44}}))); + Modelica.Blocks.Sources.Constant T_return(k=deltaT_heatingSet) + annotation (Placement(transformation(extent={{118,-102},{104,-88}}))); + AixLib.Fluid.Sources.Boundary_pT sinkHeating(redeclare package Medium = + Medium, nPorts=1) + annotation (Placement(transformation(extent={{-48,-64},{-28,-44}}))); + Modelica.Blocks.Sources.Constant const(k=(cp_default*deltaT_heatingSet)) + annotation (Placement(transformation(extent={{128,-56},{116,-44}}))); + Modelica.Blocks.Math.Division division + annotation (Placement(transformation(extent={{104,-44},{90,-30}}))); +public + Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare package Medium = + Medium) + "Fluid connector for connecting the substation to the warm line of the network" + annotation (Placement(transformation(extent={{-270,-10},{-250,10}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare package Medium = + Medium) + "Fluid connector for connecting the substation to the cold line of the network" + annotation (Placement(transformation(extent={{210,-10},{230,10}}), + iconTransformation(extent={{210,-10},{230,10}}))); + AixLib.Fluid.HeatPumps.Carnot_TCon heaPum( + redeclare package Medium1 = Medium, + redeclare package Medium2 = Medium, + allowFlowReversal1=false, + allowFlowReversal2=false, + dTCon_nominal=deltaT_heatingSet, + dp1_nominal=dp_nominal, + dp2_nominal=dp_nominal, + use_eta_Carnot_nominal=true, + show_T=true, + etaCarnot_nominal=0.5, + QCon_flow_nominal=heatDemand_max, + QCon_flow_max=heatDemand_max) + annotation (Placement(transformation(extent={{10,-20},{-10,-40}}))); + Modelica.Blocks.Math.Division division1 + annotation (Placement(transformation(extent={{-96,-78},{-80,-62}}))); + Modelica.Blocks.Math.Gain const3(k=cp_default) + annotation (Placement(transformation(extent={{-138,-104},{-126,-92}}))); + Modelica.Blocks.Interfaces.RealInput heatDemand(unit = "W") + "Input for heat demand profile of substation" + annotation (Placement(transformation(extent={{-294,-80},{-254,-40}}), + iconTransformation(extent={{232,76},{192,116}}))); + Modelica.Blocks.Interfaces.RealInput T_supplyHeatingSet(unit = "K") + "Supply temeprature of heating circuit in the building" + annotation ( + Placement(transformation( + extent={{20,20},{-20,-20}}, + rotation=180, + origin={-270,-130}), iconTransformation(extent={{232,124},{192,164}}))); + Modelica.Blocks.Math.Add add(k2=-1) + annotation (Placement(transformation(extent={{92,-88},{72,-68}}))); + Modelica.Blocks.Math.Add add1(k2=-1) + annotation (Placement(transformation(extent={{-134,-76},{-114,-56}}))); + AixLib.Fluid.FixedResistances.Junction jun( + redeclare package Medium = Medium, + tau=60, + dp_nominal={0,dp_nominal,dp_nominal}, + portFlowDirection_1=Modelica.Fluid.Types.PortFlowDirection.Bidirectional, + portFlowDirection_2=Modelica.Fluid.Types.PortFlowDirection.Bidirectional, + portFlowDirection_3=Modelica.Fluid.Types.PortFlowDirection.Entering, + m_flow_nominal=max(m_flow_nominal, 1)*{1,1,1}) + annotation (Placement(transformation(extent={{-156,10},{-136,-10}}))); + + AixLib.Fluid.FixedResistances.Junction jun1( + redeclare package Medium = Medium, + tau=60, + dp_nominal={0,dp_nominal,dp_nominal}, + portFlowDirection_3=Modelica.Fluid.Types.PortFlowDirection.Entering, + m_flow_nominal=max(m_flow_nominal, 1)*{1,1,1}) + annotation (Placement(transformation(extent={{136,-10},{116,10}}))); + AixLib.Fluid.Chillers.Carnot_TEva chi( + redeclare package Medium1 = Medium, + redeclare package Medium2 = Medium, + allowFlowReversal1=false, + allowFlowReversal2=false, + dTEva_nominal=-deltaT_heatingSet, + use_eta_Carnot_nominal=true, + dp1_nominal=dp_nominal, + dp2_nominal=dp_nominal, + etaCarnot_nominal=0.4, + QEva_flow_nominal=coolingDemand_max, + QEva_flow_min=coolingDemand_max) + annotation (Placement(transformation(extent={{-4,40},{-24,20}}))); + AixLib.Fluid.Movers.FlowControlled_m_flow pumpCooling( + redeclare package Medium = Medium, + energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, + addPowerToMedium=false, + nominalValuesDefineDefaultPressureCurve=true, + use_inputFilter=false, + m_flow_nominal=m_flow_nominal, + dp_nominal=dp_nominal) + annotation (Placement(transformation(extent={{48,14},{28,34}}))); + Modelica.Blocks.Interfaces.RealInput coolingDemand(unit = "W") + "Input for cooling demand profile of substation" + annotation (Placement( + transformation(extent={{248,42},{208,82}}), iconTransformation(extent={{-280, + -120},{-240,-80}}))); + Modelica.Blocks.Interfaces.RealInput T_supplyCoolingSet(unit = "K") + "Supply temperatur of cooling circuit in the building" + annotation ( + Placement(transformation(extent={{248,82},{208,122}}), + iconTransformation(extent={{-280,-72},{-240,-32}}))); + AixLib.Fluid.Sources.MassFlowSource_T sourceCooling( + use_m_flow_in=true, + use_T_in=true, + redeclare package Medium = Medium, + nPorts=1) annotation (Placement(transformation(extent={{-70,44},{-50,64}}))); + AixLib.Fluid.Sources.Boundary_pT sinkCooling(redeclare package Medium = + Medium, nPorts=1) + annotation (Placement(transformation(extent={{30,46},{10,66}}))); + Modelica.Blocks.Math.Add add2(k2=-1) + annotation (Placement(transformation(extent={{82,102},{62,122}}))); + Modelica.Blocks.Math.Division division2 + annotation (Placement(transformation(extent={{48,100},{34,114}}))); + Modelica.Blocks.Math.Gain const1(k=-cp_default) + annotation (Placement(transformation(extent={{78,84},{66,96}}))); + Modelica.Blocks.Math.Add add3( + k2=+1) + annotation (Placement(transformation(extent={{-120,100},{-100,120}}))); + Modelica.Blocks.Sources.Constant T_return1(k=deltaT_coolingSet) + annotation (Placement(transformation(extent={{-158,76},{-138,96}}))); + Modelica.Blocks.Math.Division division3 + annotation (Placement(transformation(extent={{-58,120},{-72,134}}))); + Modelica.Blocks.Sources.Constant const2(k=-(cp_default*deltaT_coolingSet)) + annotation (Placement(transformation(extent={{-32,94},{-44,106}}))); + AixLib.Fluid.Sensors.MassFlowRate senMasFlo_GridHeat(redeclare package Medium + = Medium) + annotation (Placement(transformation(extent={{-206,-10},{-186,10}}))); + AixLib.Fluid.Sensors.MassFlowRate senMasFlo_GridCool(redeclare package Medium + = Medium) + annotation (Placement(transformation(extent={{152,-10},{172,10}}))); + AixLib.Fluid.Sensors.MassFlowRate senMasFlo_HeatPump(redeclare package Medium + = Medium) + annotation (Placement(transformation(extent={{-114,-34},{-94,-14}}))); + AixLib.Fluid.Sensors.MassFlowRate senMasFlo_chiller(redeclare package Medium + = Medium) + annotation (Placement(transformation(extent={{78,14},{58,34}}))); + Modelica.Blocks.Interfaces.RealInput deltaT_heatingGridSet(unit = "K") + "Set temperature difference for heating on the site of thermal network" + annotation ( + Placement(transformation( + extent={{20,20},{-20,-20}}, + rotation=180, + origin={-268,-158}), iconTransformation(extent={{232,32},{192,72}}))); + Modelica.Blocks.Interfaces.RealInput deltaT_coolingGridSet(unit = "K") + "Set temperature difference for cooling on the site of thermal network" annotation ( + Placement(transformation( + extent={{-20,20},{20,-20}}, + rotation=180, + origin={228,142}), iconTransformation(extent={{-280,-168},{-240,-128}}))); + + Modelica.Blocks.Interfaces.RealOutput powerDemandHP(unit = "W") + "Power demand of heat pump" + annotation (Placement(transformation(extent={{-260,100},{-280,120}}), + iconTransformation(extent={{-260,100},{-280,120}}))); + Modelica.Blocks.Interfaces.RealOutput powerDemandChiller(unit = "W") + "Power demand of chiller" + annotation (Placement(transformation(extent={{-260,126},{-280,146}}), + iconTransformation(extent={{-260,126},{-280,146}}))); + Modelica.Blocks.Interfaces.RealOutput powerDemandSubstation(unit = "W") + "Power demand of heat pump and chiller (sum)" + annotation (Placement(transformation(extent={{-260,74},{-280,94}}), + iconTransformation(extent={{-260,74},{-280,94}}))); + Modelica.Blocks.Math.Sum sum1(nin=2) + annotation (Placement(transformation(extent={{-208,74},{-228,94}}))); + Modelica.Blocks.Math.Gain gain(k=-1) + annotation (Placement(transformation(extent={{188,52},{168,72}}))); +equation + connect(port_a,vol. ports[1]) + annotation (Line(points={{-260,0},{-233,0},{-233,4}}, + color={0,127,255})); + connect(port_b,vol1. ports[1]) + annotation (Line(points={{220,0},{197,0},{197,8}}, + color={0,127,255})); + connect(chi.port_b1, jun.port_3) annotation (Line(points={{-24,24},{-146,24}, + {-146,10}},color={0,127,255})); + connect(heaPum.port_b2, jun1.port_3) + annotation (Line(points={{10,-24},{126,-24},{126,-10}}, + color={0,127,255})); + connect(pumpHeating.port_b, heaPum.port_a2) + annotation (Line(points={{-60,-24},{-10,-24}}, color={0,127,255})); + connect(chi.port_a1, pumpCooling.port_b) + annotation (Line(points={{-4,24},{28,24}},color={0,127,255})); + connect(heaPum.P, add1.u2) annotation (Line(points={{-11,-30},{-54,-30},{-54,-80}, + {-144,-80},{-144,-72},{-136,-72},{-136,-72}}, color={0,0,127})); + connect(heatDemand, add1.u1) + annotation (Line(points={{-274,-60},{-136,-60}}, color={0,0,127})); + connect(add1.y, division1.u1) annotation (Line(points={{-113,-66},{-106,-66},{ + -106,-65.2},{-97.6,-65.2}}, color={0,0,127})); + connect(const3.y, division1.u2) annotation (Line(points={{-125.4,-98},{-108,-98}, + {-108,-74.8},{-97.6,-74.8}}, color={0,0,127})); + connect(division1.y, pumpHeating.m_flow_in) annotation (Line(points={{-79.2, + -70},{-70,-70},{-70,-36}}, + color={0,0,127})); + connect(T_supplyHeatingSet, heaPum.TSet) annotation (Line(points={{-270,-130}, + {20,-130},{20,-39},{12,-39}}, color={0,0,127})); + connect(sourceHeating.ports[1], heaPum.port_a1) annotation (Line(points={{42,-54}, + {28,-54},{28,-36},{10,-36}}, color={0,127,255})); + connect(sinkHeating.ports[1], heaPum.port_b1) annotation (Line(points={{-28,-54}, + {-22,-54},{-22,-36},{-10,-36}}, color={0,127,255})); + connect(heatDemand, division.u1) annotation (Line(points={{-274,-60},{-154, + -60},{-154,-120},{132,-120},{132,-38},{105.4,-38},{105.4,-32.8}}, + color={0, + 0,127})); + connect(division.u2, const.y) annotation (Line(points={{105.4,-41.2},{112,-41.2}, + {112,-50},{115.4,-50}}, color={0,0,127})); + connect(division.y, sourceHeating.m_flow_in) annotation (Line(points={{89.3, + -37},{76.65,-37},{76.65,-46},{64,-46}}, + color={0,0,127})); + connect(T_supplyHeatingSet, add.u1) annotation (Line(points={{-270,-130},{124, + -130},{124,-72},{94,-72}}, color={0,0,127})); + connect(T_return.y, add.u2) annotation (Line(points={{103.3,-95},{100,-95},{100, + -84},{94,-84}}, color={0,0,127})); + connect(add.y, sourceHeating.T_in) annotation (Line(points={{71,-78},{68,-78}, + {68,-50},{64,-50}}, color={0,0,127})); + connect(sourceCooling.ports[1], chi.port_a2) annotation (Line(points={{-50,54}, + {-30,54},{-30,36},{-24,36}}, color={0,127,255})); + connect(chi.port_b2, sinkCooling.ports[1]) annotation (Line(points={{-4,36},{ + 0,36},{0,56},{10,56}}, color={0,127,255})); + connect(chi.P, add2.u2) annotation (Line(points={{-25,30},{-130,30},{-130,80}, + {88,80},{88,106},{84,106}}, color={0,0,127})); + connect(division2.u1, add2.y) annotation (Line(points={{49.4,111.2},{55.7, + 111.2},{55.7,112},{61,112}}, color={0,0,127})); + connect(division2.u2, const1.y) annotation (Line(points={{49.4,102.8},{57.7, + 102.8},{57.7,90},{65.4,90}}, color={0,0,127})); + connect(division2.y, pumpCooling.m_flow_in) annotation (Line(points={{33.3, + 107},{32,107},{32,66},{38,66},{38,36}}, color={0,0,127})); + connect(T_return1.y, add3.u2) annotation (Line(points={{-137,86},{-130,86},{ + -130,104},{-122,104}}, color={0,0,127})); + connect(T_supplyCoolingSet, add3.u1) annotation (Line(points={{228,102},{ + 106,102},{106,146},{-150,146},{-150,116},{-122,116}}, + color={0,0,127})); + connect(add3.y, sourceCooling.T_in) annotation (Line(points={{-99,110},{-94, + 110},{-94,58},{-72,58}}, color={0,0,127})); + connect(const2.y, division3.u2) annotation (Line(points={{-44.6,100},{-50,100}, + {-50,122.8},{-56.6,122.8}}, color={0,0,127})); + connect(division3.y, sourceCooling.m_flow_in) annotation (Line(points={{-72.7, + 127},{-86,127},{-86,62},{-72,62}}, color={0,0,127})); + connect(T_supplyCoolingSet, chi.TSet) annotation (Line(points={{228,102},{ + 106,102},{106,42},{8,42},{8,21},{-2,21}}, color= + {0,0,127})); + connect(vol.ports[2], senMasFlo_GridHeat.port_a) annotation (Line(points={{-231,4}, + {-231,0},{-206,0},{-206,0}}, color={0,127,255})); + connect(senMasFlo_GridHeat.port_b, jun.port_1) + annotation (Line(points={{-186,0},{-156,0}}, color={0,127,255})); + connect(senMasFlo_GridCool.port_b, vol1.ports[2]) + annotation (Line(points={{172,0},{199,0},{199,8}}, color={0,127,255})); + connect(senMasFlo_GridCool.port_a, jun1.port_1) + annotation (Line(points={{152,0},{136,0}}, color={0,127,255})); + connect(jun.port_2, senMasFlo_HeatPump.port_a) annotation (Line(points={{ + -136,0},{-118,0},{-118,-24},{-114,-24}}, color={0,127,255})); + connect(senMasFlo_HeatPump.port_b, pumpHeating.port_a) + annotation (Line(points={{-94,-24},{-80,-24}}, color={0,127,255})); + connect(senMasFlo_chiller.port_a, jun1.port_2) annotation (Line(points={{78, + 24},{100,24},{100,0},{116,0}}, color={0,127,255})); + connect(senMasFlo_chiller.port_b, pumpCooling.port_a) + annotation (Line(points={{58,24},{48,24}}, color={0,127,255})); + connect(port_a, port_a) + annotation (Line(points={{-260,0},{-260,0}}, color={0,127,255})); + connect(deltaT_heatingGridSet, const3.u) annotation (Line(points={{-268,-158}, + {-148,-158},{-148,-98},{-139.2,-98}}, color={0,0,127})); + connect(deltaT_coolingGridSet, const1.u) annotation (Line(points={{228,142}, + {152,142},{152,90},{79.2,90}}, color={0,0,127})); + connect(chi.P, powerDemandChiller) annotation (Line(points={{-25,30},{-166,30}, + {-166,136},{-270,136}}, color={0,0,127})); + connect(heaPum.P, powerDemandHP) annotation (Line(points={{-11,-30},{-174,-30}, + {-174,110},{-270,110}}, color={0,0,127})); + connect(sum1.y, powerDemandSubstation) + annotation (Line(points={{-229,84},{-270,84}}, color={0,0,127})); + //Power Consumptin Calculation + connect(chi.P, sum1.u[1]); + connect(heaPum.P, sum1.u[2]); + //connect(pumpCooling.P, sum1.u[3]); + //connect(pumpHeating.P, sum1.u[4]); + + connect(gain.u, coolingDemand) + annotation (Line(points={{190,62},{228,62}}, color={0,0,127})); + connect(gain.y, division3.u1) annotation (Line(points={{167,62},{98,62},{98, + 131.2},{-56.6,131.2}}, color={0,0,127})); + connect(gain.y, add2.u1) annotation (Line(points={{167,62},{98,62},{98,118}, + {84,118}}, color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-260,-180}, + {220,160}}), graphics={ + Rectangle( + extent={{-260,160},{220,-180}}, + lineColor={28,108,200}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-154,32},{118,-174}}, + lineColor={0,0,0}, + fillColor={28,108,200}, + fillPattern=FillPattern.HorizontalCylinder), + Polygon( + points={{-154,32},{-30,142},{118,32},{-154,32}}, + lineColor={0,0,0}, + fillColor={238,46,47}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-102,4},{-56,-50}}, + lineColor={28,108,200}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-36,-100},{4,-174}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{10,2},{58,-54}}, + lineColor={28,108,200}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid)}), Diagram( + coordinateSystem(preserveAspectRatio=false, extent={{-260,-180},{220,160}})), + Documentation(revisions=" + +", info=" +

Substation model for bidirctional low-temperature networks for buildings with heat pump and chiller. In the case of simultaneous cooling and heating demands, +the return flows are used as supply flows for the other application. The mass flows are controlled equation-based. +This model uses the heat pump AixLib.Fluid.HeatPumps.Carnot_TCon +and the chiller AixLib.Fluid.Chillers.Carnot_TEva. +The mass flows are calculated using the heating and cooling demands and the specified temperature differences between flow and return (network side).

+")); +end SubstationHeatingCoolingVarDeltaT; diff --git a/AixLib/Fluid/DistrictHeatingCooling/Demands/ClosedLoop/package.order b/AixLib/Fluid/DistrictHeatingCooling/Demands/ClosedLoop/package.order index 97f9f8050a..e4b4e1fe16 100644 --- a/AixLib/Fluid/DistrictHeatingCooling/Demands/ClosedLoop/package.order +++ b/AixLib/Fluid/DistrictHeatingCooling/Demands/ClosedLoop/package.order @@ -1,2 +1,9 @@ DHCSubstationHeatPumpChiller DHCSubstationHeatPumpDirectCooling +SubstationCooling +SubstationHeating +SubstationHeatingCoolingFixDeltaT +SubstationHeatingCoolingVarDeltaT +SubstationDirectCooling +SubstationDirectHeatingDirectCooling +SubstationDirectHeatingDirectCoolingDHW diff --git a/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/DHCSubstationHeatPumpChiller.mo b/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/ClosedLoop/DHCSubstationHeatPumpChiller.mo similarity index 88% rename from AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/DHCSubstationHeatPumpChiller.mo rename to AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/ClosedLoop/DHCSubstationHeatPumpChiller.mo index 9790442e19..6952fee9ec 100644 --- a/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/DHCSubstationHeatPumpChiller.mo +++ b/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/ClosedLoop/DHCSubstationHeatPumpChiller.mo @@ -1,4 +1,4 @@ -within AixLib.Fluid.DistrictHeatingCooling.Demands.Examples; +within AixLib.Fluid.DistrictHeatingCooling.Demands.Examples.ClosedLoop; model DHCSubstationHeatPumpChiller import AixLib; extends Modelica.Icons.Example; @@ -35,16 +35,17 @@ model DHCSubstationHeatPumpChiller annotation (Placement(transformation(extent={{58,36},{38,56}}))); AixLib.Fluid.DistrictHeatingCooling.Demands.ClosedLoop.DHCSubstationHeatPumpChiller DHCsubstationHeatingDirectCooling( - redeclare package Medium = Modelica.Media.Water.ConstantPropertyLiquidWater, + redeclare package Medium = Medium, + dp_nominal=30000, m_flow_nominal=2, - heaDem_max=4000, - cooDem_max=-2500, - deltaT_heaSecSet(displayUnit="K") = 10, - T_heaSecSet=328.15, - T_cooSecSet=285.15, - deltaT_cooSecSet=279.15, - deltaT_heaPriSet(displayUnit="K") = 5, - deltaT_cooPriSet(displayUnit="K") = 5) + heatDemand_max=4000, + coolingDemand_max=-2500, + deltaT_heatSecSet(displayUnit="K") = 10, + T_heatSecSet=328.15, + T_coolingSecSet=285.15, + deltaT_coolingSecSet=279.15, + deltaT_heatPriSet(displayUnit="K") = 5, + deltaT_coolingPriSet(displayUnit="K") = 5) annotation (Placement(transformation(extent={{-18,-2},{30,30}}))); equation @@ -62,11 +63,11 @@ equation connect(senTem.port_b, DHCsubstationHeatingDirectCooling.port_a) annotation (Line(points={{-28,14},{-24,14},{-24,14.9412},{-18,14.9412}}, color={0,127,255})); - connect(coolingDemand.y, DHCsubstationHeatingDirectCooling.cooDem) + connect(coolingDemand.y, DHCsubstationHeatingDirectCooling.coolingDemand) annotation (Line(points={{-29,46},{-26,46},{-26,5.52941},{-18,5.52941}}, color={0,0, 127})); - connect(DHCsubstationHeatingDirectCooling.heaDem, heatDemand.y) annotation ( + connect(DHCsubstationHeatingDirectCooling.heatDemand, heatDemand.y) annotation ( Line(points={{29.2,23.9765},{34,23.9765},{34,46},{37,46}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( diff --git a/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/DHCSubstationHeatPumpDirectCooling.mo b/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/ClosedLoop/DHCSubstationHeatPumpDirectCooling.mo similarity index 98% rename from AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/DHCSubstationHeatPumpDirectCooling.mo rename to AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/ClosedLoop/DHCSubstationHeatPumpDirectCooling.mo index 0fa2edd0ae..015f78ac14 100644 --- a/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/DHCSubstationHeatPumpDirectCooling.mo +++ b/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/ClosedLoop/DHCSubstationHeatPumpDirectCooling.mo @@ -1,4 +1,4 @@ -within AixLib.Fluid.DistrictHeatingCooling.Demands.Examples; +within AixLib.Fluid.DistrictHeatingCooling.Demands.Examples.ClosedLoop; model DHCSubstationHeatPumpDirectCooling import AixLib; extends Modelica.Icons.Example; diff --git a/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/ClosedLoop/SubstationCooling.mo b/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/ClosedLoop/SubstationCooling.mo new file mode 100644 index 0000000000..b1fdc1589e --- /dev/null +++ b/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/ClosedLoop/SubstationCooling.mo @@ -0,0 +1,89 @@ +within AixLib.Fluid.DistrictHeatingCooling.Demands.Examples.ClosedLoop; +model SubstationCooling "Small example of substation for buildings with only cooling demand equipped with + chiller in closed loop low-temperature dhc network" + + extends Modelica.Icons.Example; + package Medium = AixLib.Media.Water "Fluid in the pipes"; + AixLib.Fluid.Sources.Boundary_pT hotLine( + redeclare package Medium = Medium, + use_T_in=false, + nPorts=1) "Return of substation, represents warm line of dhc network" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={-68,-16}))); + AixLib.Fluid.Sources.Boundary_pT coldLine( + redeclare package Medium = Medium, + use_T_in=true, + nPorts=1) "Cool pipe of dhc network" annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=90, + origin={82,24}))); + Modelica.Blocks.Sources.Sine sine( + f=1/3600, + startTime=0, + amplitude=2000, + offset=6000) + annotation (Placement(transformation(extent={{-50,66},{-30,86}}))); + Modelica.Blocks.Sources.Ramp tempColdLine( + height=5, + duration=7200, + offset=288.15, + startTime=72000) + annotation (Placement(transformation(extent={{44,46},{64,66}}))); + Modelica.Blocks.Sources.Step step( + startTime=18000, + height=-2, + offset=283.15) + annotation (Placement(transformation(extent={{-50,34},{-30,54}}))); + AixLib.Fluid.Sensors.TemperatureTwoPort senTemHotLine(redeclare package + Medium = Medium, m_flow_nominal=0.5) + annotation (Placement(transformation(extent={{-48,-10},{-28,10}}))); + AixLib.Fluid.Sensors.TemperatureTwoPort senTemColdLine(redeclare package + Medium = Medium, m_flow_nominal=0.5) + annotation (Placement(transformation(extent={{40,-10},{60,10}}))); + AixLib.Fluid.DistrictHeatingCooling.Demands.ClosedLoop.SubstationCooling substationCooling( + coolingDemand_max=-20000, + deltaT_coolingSet(displayUnit="K") = 6, + deltaT_coolingGridSet(displayUnit="K") = 4, + redeclare package Medium = Medium, + dp_nominal(displayUnit="bar") = 10000) + annotation (Placement(transformation(extent={{6,-10},{30,12}}))); +equation + connect(hotLine.ports[1], senTemHotLine.port_a) + annotation (Line(points={{-68,-6},{-68,0},{-48,0}}, color={0,127,255})); + connect(senTemHotLine.port_b, substationCooling.port_a) + annotation (Line(points={{-28,0},{5.8,0}}, color={0,127,255})); + connect(substationCooling.port_b, senTemColdLine.port_a) + annotation (Line(points={{30,0},{40,0}}, color={0,127,255})); + connect(coldLine.ports[1], senTemColdLine.port_b) + annotation (Line(points={{82,14},{82,0},{60,0}}, color={0,127,255})); + connect(sine.y, substationCooling.coolingDemand) annotation (Line(points={{-29,76}, + {0,76},{0,9.4},{5.4,9.4}}, color={0,0,127})); + connect(step.y, substationCooling.T_supplyCoolingSet) annotation (Line(points={{-29,44}, + {-20,44},{-20,4.8},{5.4,4.8}}, color={0,0,127})); + connect(tempColdLine.y, coldLine.T_in) + annotation (Line(points={{65,56},{78,56},{78,36}}, color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false)), + experiment(StopTime=86400, Interval=60), + Documentation(info="

+ This example shows a simple example of a closed loop substation with + chiller + AixLib.Fluid.DistrictHeatingCooling.Demands.ClosedLoop.SubstationCooling. + It illustrates the settings needed in the demand model to work in a + bidirectional low-temperature network. +

+", revisions=" +")); +end SubstationCooling; diff --git a/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/ClosedLoop/SubstationDirectHeatingDirectCooling.mo b/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/ClosedLoop/SubstationDirectHeatingDirectCooling.mo new file mode 100644 index 0000000000..a6e54d070f --- /dev/null +++ b/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/ClosedLoop/SubstationDirectHeatingDirectCooling.mo @@ -0,0 +1,91 @@ +within AixLib.Fluid.DistrictHeatingCooling.Demands.Examples.ClosedLoop; +model SubstationDirectHeatingDirectCooling + import AixLib; + extends Modelica.Icons.Example; + package Medium = AixLib.Media.Water "Fluid in the pipes"; + AixLib.Fluid.Sources.Boundary_pT warmLine( + redeclare package Medium = Medium, + use_T_in=true, + nPorts=1) "Warm Line of network" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={-66,-2}))); + AixLib.Fluid.Sources.Boundary_pT coldLine( + redeclare package Medium = Medium, + use_T_in=true, + nPorts=1) "Cold line of network" annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=90, + origin={84,42}))); + Modelica.Blocks.Sources.Constant T_coldLine(k=12 + 273.15) + annotation (Placement(transformation(extent={{38,72},{58,92}}))); + AixLib.Fluid.Sensors.TemperatureTwoPort senTem(redeclare package Medium = + Medium, m_flow_nominal=2) + annotation (Placement(transformation(extent={{-48,4},{-28,24}}))); + AixLib.Fluid.Sensors.TemperatureTwoPort senTem1(redeclare package Medium = + Medium, m_flow_nominal=2) + annotation (Placement(transformation(extent={{42,4},{62,24}}))); + Modelica.Blocks.Sources.Constant T_warmLine(k=22 + 273.15) + annotation (Placement(transformation(extent={{-98,-44},{-78,-24}}))); + Modelica.Blocks.Sources.TimeTable coolingDemand(table=[0,0; 3600,0; 3600,1500; + 7200,1500; 7200,2000; 10800,1000; 14400,0; 18000,0; 18000,2000]) + annotation (Placement(transformation(extent={{-82,36},{-62,56}}))); + Modelica.Blocks.Sources.TimeTable heatDemand(table=[0,2000; 3600,2000; 3600,0; + 7200,0; 7200,3000; 10800,4000; 14400,4000; 14400,2500; 18000,2500]) + annotation (Placement(transformation(extent={{58,38},{38,58}}))); + AixLib.Fluid.DistrictHeatingCooling.Demands.ClosedLoop.SubstationDirectHeatingDirectCooling + SubstationDirectHeatingDirectCooling( + heatDemand_max=40000, + deltaT_heatingSet(displayUnit="K") = 10, + redeclare package Medium = Modelica.Media.Water.ConstantPropertyLiquidWater, + deltaT_heatingGridSet(displayUnit="K") = 10, + deltaT_coolingGridSet(displayUnit="K") = 10, + m_flow_nominal=2, + T_supplyHeatingSet=318.15) + annotation (Placement(transformation(extent={{-18,-2},{30,30}}))); + +equation + connect(T_warmLine.y, warmLine.T_in) + annotation (Line(points={{-77,-34},{-70,-34},{-70,-14}}, color={0,0,127})); + connect(senTem1.port_b, coldLine.ports[1]) + annotation (Line(points={{62,14},{84,14},{84,32}}, color={0,127,255})); + connect(warmLine.ports[1], senTem.port_a) + annotation (Line(points={{-66,8},{-66,14},{-48,14}}, color={0,127,255})); + connect(T_coldLine.y, coldLine.T_in) + annotation (Line(points={{59,82},{80,82},{80,54}}, color={0,0,127})); + connect(SubstationDirectHeatingDirectCooling.port_b, senTem1.port_a) + annotation (Line(points={{30,14},{42,14}}, color={0,127,255})); + connect(senTem.port_b, SubstationDirectHeatingDirectCooling.port_a) + annotation (Line(points={{-28,14},{-18,14}}, color={0,127,255})); + connect(coolingDemand.y, SubstationDirectHeatingDirectCooling.coolingDemand) + annotation (Line(points={{-61,46},{-12,46},{-12,22.6},{-7.6,22.6}}, color={0, + 0,127})); + connect(heatDemand.y, SubstationDirectHeatingDirectCooling.heatDemand) + annotation (Line(points={{37,48},{21.2,48},{21.2,24.4}}, color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false)), + experiment(StopTime=86400,Interval=60,Tolerance=1e-007), + Documentation(info="

+ This example shows a simple example of a closed loop substation model + for bidirctional low-temperature networks for buildings with direct + heating and direct cooling + AixLib.Fluid.DistrictHeatingCooling.Demands.ClosedLoop.SubstationDirectHeatingDirectCooling. + It illustrates the settings needed to run the demand model. +

+", revisions=" +")); +end SubstationDirectHeatingDirectCooling; diff --git a/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/ClosedLoop/SubstationDirectHeatingDirectCoolingDHW.mo b/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/ClosedLoop/SubstationDirectHeatingDirectCoolingDHW.mo new file mode 100644 index 0000000000..f894190b58 --- /dev/null +++ b/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/ClosedLoop/SubstationDirectHeatingDirectCoolingDHW.mo @@ -0,0 +1,105 @@ +within AixLib.Fluid.DistrictHeatingCooling.Demands.Examples.ClosedLoop; +model SubstationDirectHeatingDirectCoolingDHW + import AixLib; + extends Modelica.Icons.Example; + package Medium = AixLib.Media.Water "Fluid in the pipes"; + AixLib.Fluid.Sources.Boundary_pT coo( + redeclare package Medium = Medium, + use_T_in=true, + nPorts=1) "Cool pipe" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={-56,-44}))); + AixLib.Fluid.Sources.Boundary_pT coo1( + redeclare package Medium = Medium, + use_T_in=true, + nPorts=1) "Cool pipe" annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=90, + origin={44,70}))); + Modelica.Blocks.Sources.Constant const(k=289.15) + annotation (Placement(transformation(extent={{-52,72},{-32,92}}))); + AixLib.Fluid.Sensors.TemperatureTwoPort senTem(redeclare package Medium = + Medium, m_flow_nominal=2) + annotation (Placement(transformation(extent={{-56,-18},{-36,2}}))); + AixLib.Fluid.Sensors.TemperatureTwoPort senTem1(redeclare package Medium = + Medium, m_flow_nominal=2) + annotation (Placement(transformation(extent={{22,2},{42,22}}))); + Modelica.Blocks.Sources.Constant + const1(k=273.15 + 27) + annotation (Placement(transformation(extent={{-96,-84},{-76,-64}}))); + Modelica.Blocks.Sources.TimeTable timeTable1(table=[0,0; 3600,0; 3600,1500; + 7200,1500; 7200,2000; 10800,1000; 14400,0; 18000,0; 18000,2000; 24000, + 2000; 24000,0]) + annotation (Placement(transformation(extent={{-98,2},{-78,22}}))); + Modelica.Blocks.Sources.TimeTable timeTable(table=[0,0; 24000,0; 24000,2000; + 34800,3000; 34800,0; 45600,0; 45600,4000; 63600,4000; 63600,0]) + annotation (Placement(transformation(extent={{76,-30},{56,-10}}))); + AixLib.Fluid.DistrictHeatingCooling.Demands.ClosedLoop.SubstationDirectHeatingDirectCoolingDHW + substationDirectHeatingDirectCoolingDHW( + heatDemand_max=40000, + deltaT_heatingSet(displayUnit="K") = 10, + deltaT_coolingGridSet(displayUnit="K") = 6, + redeclare package Medium = Modelica.Media.Water.ConstantPropertyLiquidWater, + + T_supplyDHWSet=333.15, + T_returnSpaceHeatingSet=283.15, + m_flow_nominal=0.1) + annotation (Placement(transformation(extent={{-34,-2},{14,30}}))); + + Modelica.Blocks.Sources.TimeTable timeTable2(table=[0,0; 3600,0; 3600,0; 7200, + 0; 7200,0; 10800,3000; 14400,3000; 18000,0; 18000,2000; 21600,2000; + 21600,0; 31200,0; 31200,2500; 42000,2500; 42000,0]) + annotation (Placement(transformation(extent={{-98,38},{-78,58}}))); +equation + connect(const1.y, coo.T_in) + annotation (Line(points={{-75,-74},{-60,-74},{-60,-56}}, color={0,0,127})); + connect(senTem1.port_b, coo1.ports[1]) + annotation (Line(points={{42,12},{44,12},{44,60}}, color={0,127,255})); + connect(coo.ports[1], senTem.port_a) + annotation (Line(points={{-56,-34},{-56,-8}}, color={0,127,255})); + connect(const.y, coo1.T_in) annotation (Line(points={{-31,82},{4,82},{4,82},{ + 40,82}}, color={0,0,127})); + connect(substationDirectHeatingDirectCoolingDHW.port_b, senTem1.port_a) + annotation (Line(points={{14,14},{18,14},{18,12},{22,12}}, color={0,127,255})); + connect(senTem.port_b, substationDirectHeatingDirectCoolingDHW.port_a) + annotation (Line(points={{-36,-8},{-36,14},{-34,14}}, color={0,127,255})); + connect(timeTable1.y, substationDirectHeatingDirectCoolingDHW.coolingDemand) + annotation (Line(points={{-77,12},{-52,12},{-52,18.2},{-24,18.2}}, color={0, + 0,127})); + connect(substationDirectHeatingDirectCoolingDHW.heatDemand, timeTable.y) + annotation (Line(points={{-24,27.6},{30.6,27.6},{30.6,-20},{55,-20}}, color + ={0,0,127})); + connect(timeTable2.y, substationDirectHeatingDirectCoolingDHW.dhwDemand) + annotation (Line(points={{-77,48},{-48,48},{-48,23},{-24,23}}, color={0,0, + 127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false)), + experiment( + StopTime=86400, + Interval=60, + Tolerance=1e-007), + Documentation(info="

+ This example shows a simple example of a closed loop substation model + for bidirctional low-temperature networks for buildings with heat + pump,direct cooling and DHW demand + AixLib.Fluid.DistrictHeatingCooling.Demands.ClosedLoop.SubstationDirectHeatingDirectCoolingDHW. + It illustrates the settings needed to run the demand model. +

+", revisions=" +")); +end SubstationDirectHeatingDirectCoolingDHW; diff --git a/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/ClosedLoop/SubstationHeating.mo b/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/ClosedLoop/SubstationHeating.mo new file mode 100644 index 0000000000..8add091f86 --- /dev/null +++ b/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/ClosedLoop/SubstationHeating.mo @@ -0,0 +1,89 @@ +within AixLib.Fluid.DistrictHeatingCooling.Demands.Examples.ClosedLoop; +model SubstationHeating "Small example of substation for buildings with only heating demand equipped with + heat pump in closed loop low-temperature dhc network" + + extends Modelica.Icons.Example; + package Medium = AixLib.Media.Water "Fluid in the pipes"; + AixLib.Fluid.Sources.Boundary_pT hotLine( + redeclare package Medium = Medium, + use_T_in=true, + nPorts=1) "Supply of substation, represents warm line of dhc network" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-54,0}))); + AixLib.Fluid.Sources.Boundary_pT coldLine( + redeclare package Medium = Medium, + use_T_in=false, + nPorts=1) "Cool pipe of dhc network" annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=0, + origin={84,0}))); + Modelica.Blocks.Sources.Sine sine( + amplitude=1000, + f=1/3600, + offset=2000, + startTime=0) + annotation (Placement(transformation(extent={{-80,72},{-60,92}}))); + Modelica.Blocks.Sources.Ramp tempHotLine( + height=10, + duration=7200, + startTime=3600, + offset=293.15) + annotation (Placement(transformation(extent={{-94,10},{-74,30}}))); + Modelica.Blocks.Sources.Step step( + height=10, + offset=313.15, + startTime=18000) + annotation (Placement(transformation(extent={{-80,42},{-60,62}}))); + AixLib.Fluid.DistrictHeatingCooling.Demands.ClosedLoop.SubstationHeating substationHeating( + redeclare package Medium = Medium, + heatDemand_max=30000, + deltaT_heatingSet(displayUnit="K") = 10, + deltaT_heatingGridSet(displayUnit="K") = 5, + dp_nominal=30000) + annotation (Placement(transformation(extent={{4,-10},{28,12}}))); + AixLib.Fluid.Sensors.TemperatureTwoPort senTemHotLine(redeclare package + Medium = Medium, m_flow_nominal=0.5) + annotation (Placement(transformation(extent={{-34,-10},{-14,10}}))); + AixLib.Fluid.Sensors.TemperatureTwoPort senTemColdLine(redeclare package + Medium = Medium, m_flow_nominal=0.5) + annotation (Placement(transformation(extent={{40,-10},{60,10}}))); +equation + connect(tempHotLine.y, hotLine.T_in) annotation (Line(points={{-73,20},{-70,20}, + {-70,4},{-66,4}}, color={0,0,127})); + connect(sine.y, substationHeating.heatDemand) annotation (Line(points={{-59,82}, + {-2,82},{-2,9.4},{4.36923,9.4}}, color={0,0,127})); + connect(substationHeating.T_supplyHeatingSet, step.y) annotation (Line(points={{4.36923, + 5},{-4,5},{-4,52},{-59,52}}, color={0,0,127})); + connect(senTemHotLine.port_b, substationHeating.port_a) + annotation (Line(points={{-14,0},{4,0}}, color={0,127,255})); + connect(hotLine.ports[1], senTemHotLine.port_a) + annotation (Line(points={{-44,0},{-34,0}}, color={0,127,255})); + connect(senTemColdLine.port_b, coldLine.ports[1]) + annotation (Line(points={{60,0},{74,0}}, color={0,127,255})); + connect(substationHeating.port_b, senTemColdLine.port_a) + annotation (Line(points={{28,0},{40,0}}, color={0,127,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false)), + experiment(StopTime=86400, Interval=60), + Documentation(info="

+ This example shows a simple example of a closed loop substation with + heat pump + AixLib.Fluid.DistrictHeatingCooling.Demands.ClosedLoop.SubstationHeating. + It illustrates the settings needed in the demand model to work in a + bidirectional low-temperature network. +

+", revisions=" +")); +end SubstationHeating; diff --git a/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/ClosedLoop/SubstationHeatingCoolingFixDeltaT.mo b/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/ClosedLoop/SubstationHeatingCoolingFixDeltaT.mo new file mode 100644 index 0000000000..c65367f175 --- /dev/null +++ b/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/ClosedLoop/SubstationHeatingCoolingFixDeltaT.mo @@ -0,0 +1,110 @@ +within AixLib.Fluid.DistrictHeatingCooling.Demands.Examples.ClosedLoop; +model SubstationHeatingCoolingFixDeltaT "Small example of substation for buildings with heating and cooling demand equipped with + heat pump and chiller in closed loop low-temperature dhc network with fixed temperature + difference on network and building side" + + import AixLib; + extends Modelica.Icons.Example; + package Medium = AixLib.Media.Water "Fluid in the pipes"; + AixLib.Fluid.Sources.Boundary_pT HeatSource( + redeclare package Medium = Medium, + use_T_in=true, + nPorts=1) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={-56,-44}))); + AixLib.Fluid.Sources.Boundary_pT ColdSource( + redeclare package Medium = Medium, + use_T_in=true, + nPorts=1) "Cold line" annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=0, + origin={90,2}))); + Modelica.Blocks.Sources.Constant const(k=289.15) + annotation (Placement(transformation(extent={{132,28},{112,48}}))); + AixLib.Fluid.Sensors.TemperatureTwoPort senTemHotLine(redeclare package + Medium = Medium, m_flow_nominal=2) + annotation (Placement(transformation(extent={{-56,-18},{-36,2}}))); + AixLib.Fluid.Sensors.TemperatureTwoPort senTemColdLine(redeclare package + Medium = Medium, m_flow_nominal=2) + annotation (Placement(transformation(extent={{44,-8},{66,14}}))); + Modelica.Blocks.Sources.Constant + const1(k=293.15) + annotation (Placement(transformation(extent={{-96,-84},{-76,-64}}))); + Modelica.Blocks.Sources.Constant + const2(k=285.15) + annotation (Placement(transformation(extent={{-80,40},{-60,60}}))); + Modelica.Blocks.Sources.Constant const3(k=323.15) + annotation (Placement(transformation(extent={{42,54},{22,74}}))); + AixLib.Fluid.DistrictHeatingCooling.Demands.ClosedLoop.SubstationHeatingCoolingFixDeltaT + substationHeatingCooling( + redeclare package Medium = Medium, + deltaT_coolingGridSet(displayUnit="K") = 4, + deltaT_coolingSet(displayUnit="K") = 6, + deltaT_heatingSet(displayUnit="K") = 6, + deltaT_heatingGridSet(displayUnit="K") = 4, + coolingDemand_max=-20000, + heatDemand_max=40000) + annotation (Placement(transformation(extent={{-22,-8},{16,18}}))); + Modelica.Blocks.Sources.TimeTable ColdDemand(table=[0,0; 3600,0; 3600,1500; + 7200,1500; 7200,2000; 10800,1000; 14400,0; 18000,0; 18000,2000]) + annotation (Placement(transformation(extent={{-80,6},{-60,26}}))); + Modelica.Blocks.Sources.TimeTable HeatDemand(table=[0,2000; 3600,2000; 3600,0; + 7200,0; 7200,3000; 10800,4000; 14400,4000; 14400,2500; 18000,2500]) + annotation (Placement(transformation(extent={{42,20},{22,40}}))); +equation + connect(substationHeatingCooling.T_supplyHeatingSet, const3.y) + annotation (Line(points={{16,15.8875},{14,15.8875},{14,64},{21,64}}, + color={ + 0,0,127})); + connect(const2.y, substationHeatingCooling.T_supplyCoolingSet) + annotation (Line(points={{-59,50},{-32,50},{-32,15.725},{-22,15.725}}, + color={0,0,127})); + connect(const1.y, HeatSource.T_in) + annotation (Line(points={{-75,-74},{-60,-74},{-60,-56}}, color={0,0,127})); + connect(HeatSource.ports[1], senTemHotLine.port_a) + annotation (Line(points={{-56,-34},{-56,-8}}, color={0,127,255})); + connect(senTemHotLine.port_b, substationHeatingCooling.port_a) annotation ( + Line(points={{-36,-8},{-30,-8},{-30,5},{-22,5}}, color={0,127,255})); + connect(substationHeatingCooling.heatDemand, HeatDemand.y) annotation (Line( + points={{16,12.3125},{14,12.3125},{14,10},{18,10},{18,30},{21,30}}, + color={0,0,127})); + connect(ColdDemand.y, substationHeatingCooling.coolingDemand) annotation ( + Line(points={{-59,16},{-42,16},{-42,11.9875},{-22,11.9875}}, color={0,0, + 127})); + connect(substationHeatingCooling.port_b, senTemColdLine.port_a) + annotation (Line(points={{16,5},{30,5},{30,3},{44,3}}, + color={0,127,255})); + connect(senTemColdLine.port_b, ColdSource.ports[1]) + annotation (Line(points={{66,3},{72,3},{72,2},{80,2}}, color={0,127,255})); + connect(const.y, ColdSource.T_in) annotation (Line(points={{111,38},{108,38}, + {108,6},{102,6}}, color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{140,100}})), Diagram( + coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{140, + 100}})), + experiment( + StopTime=86400, + Interval=60, + Tolerance=1e-007), + Documentation(revisions=" +", info="

+ This example shows a simple example of a closed loop substation with + heat pump and chiller (const. temperature difference on network and + building sides) + AixLib.Fluid.DistrictHeatingCooling.Demands.ClosedLoop.SubstationHeatingCoolingFixDeltaT. + It illustrates the settings needed in the demand model to work in a + bidirectional low-temperature network. +

+")); +end SubstationHeatingCoolingFixDeltaT; diff --git a/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/ClosedLoop/SubstationHeatingCoolingVarDeltaT.mo b/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/ClosedLoop/SubstationHeatingCoolingVarDeltaT.mo new file mode 100644 index 0000000000..a6e2cd6a1b --- /dev/null +++ b/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/ClosedLoop/SubstationHeatingCoolingVarDeltaT.mo @@ -0,0 +1,124 @@ +within AixLib.Fluid.DistrictHeatingCooling.Demands.Examples.ClosedLoop; +model SubstationHeatingCoolingVarDeltaT "Small example of substation for buildings with heating and cooling demand equipped with + heat pump and chiller in closed loop low-temperature dhc network with variable temperature + difference on network side" + + extends Modelica.Icons.Example; + package Medium = AixLib.Media.Water "Fluid in the pipes"; + AixLib.Fluid.Sources.Boundary_pT SourceHot( + redeclare package Medium = Medium, + use_T_in=true, + nPorts=1) "Hot line" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-76,-8}))); + AixLib.Fluid.Sources.Boundary_pT SourceCold( + redeclare package Medium = Medium, + use_T_in=true, + nPorts=1) "cold line" annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=0, + origin={74,-6}))); + Modelica.Blocks.Sources.Constant SourceTemperatureColdLine(k=289.15) + annotation (Placement(transformation(extent={{118,18},{98,38}}))); + AixLib.Fluid.Sensors.TemperatureTwoPort senTem(redeclare package Medium = + Medium, m_flow_nominal=2) + annotation (Placement(transformation(extent={{-56,-18},{-36,2}}))); + AixLib.Fluid.Sensors.TemperatureTwoPort senTemColdLine(redeclare package + Medium = Medium, m_flow_nominal=2) + annotation (Placement(transformation(extent={{24,-16},{44,4}}))); + Modelica.Blocks.Sources.Constant SourceTemperatureHotLine(k=293.15) + annotation (Placement(transformation(extent={{-114,-42},{-94,-22}}))); + Modelica.Blocks.Sources.Constant SupplyTemperatureCoolingSet(k=285.15) + annotation (Placement(transformation(extent={{-80,76},{-60,96}}))); + Modelica.Blocks.Sources.Constant SupplyTemperatureHeaingSet(k=323.15) + annotation (Placement(transformation(extent={{54,80},{34,100}}))); + AixLib.Fluid.DistrictHeatingCooling.Demands.ClosedLoop.SubstationHeatingCoolingVarDeltaT + substationHeatingCooling( + redeclare package Medium = Medium, + heatDemand_max=40000, + coolingDemand_max=-20000, + deltaT_coolingSet(displayUnit="K") = 4, + deltaT_heatingSet(displayUnit="K") = 4) + annotation (Placement(transformation(extent={{-24,8},{10,32}}))); + Modelica.Blocks.Sources.TimeTable ColdDemand(table=[0,0; 3600,0; 3600,1500; + 7200,1500; 7200,2000; 10800,1000; 14400,0; 18000,0; 18000,2000]) + annotation (Placement(transformation(extent={{-80,48},{-60,68}}))); + Modelica.Blocks.Sources.TimeTable HeatDemand(table=[0,2000; 3600,2000; 3600,0; + 7200,0; 7200,3000; 10800,4000; 14400,4000; 14400,2500; 18000,2500]) + annotation (Placement(transformation(extent={{54,48},{34,68}}))); + Modelica.Blocks.Sources.Ramp dT_coolingGridSet( + height=2, + duration=7200, + offset=3, + startTime=10800) + annotation (Placement(transformation(extent={{-80,18},{-60,38}}))); + Modelica.Blocks.Sources.Ramp dT_heatingGridSet( + height=-3, + duration=10800, + offset=7, + startTime=7200) + annotation (Placement(transformation(extent={{56,18},{36,38}}))); +equation + connect(SourceTemperatureColdLine.y, SourceCold.T_in) annotation (Line(points= + {{97,28},{94,28},{94,-2},{86,-2}}, color={0,0,127})); + connect(substationHeatingCooling.T_supplyHeatingSet, + SupplyTemperatureHeaingSet.y) annotation (Line(points={{9.43333,30.8706},{ + 14,30.8706},{14,90},{33,90}}, + color={0,0,127})); + connect(SupplyTemperatureCoolingSet.y, substationHeatingCooling.T_supplyCoolingSet) + annotation (Line(points={{-59,86},{-30,86},{-30,17.0353},{-24,17.0353}}, + color={0,0,127})); + connect(SourceTemperatureHotLine.y, SourceHot.T_in) annotation (Line(points={ + {-93,-32},{-92,-32},{-92,-4},{-88,-4}}, color={0,0,127})); + connect(SourceHot.ports[1], senTem.port_a) + annotation (Line(points={{-66,-8},{-56,-8}}, color={0,127,255})); + connect(senTem.port_b, substationHeatingCooling.port_a) annotation (Line( + points={{-36,-8},{-30,-8},{-30,20.7059},{-24,20.7059}}, + color={0,127,255})); + connect(substationHeatingCooling.port_b, senTemColdLine.port_a) annotation ( + Line(points={{10,20.7059},{16,20.7059},{16,-6},{24,-6}}, color={0,127,255})); + connect(senTemColdLine.port_b, SourceCold.ports[1]) + annotation (Line(points={{44,-6},{64,-6}}, color={0,127,255})); + connect(ColdDemand.y,substationHeatingCooling.coolingDemand) + annotation (Line(points={{-59,58},{-46,58},{-46,13.6471},{-24,13.6471}}, + color={0,0,127})); + connect(substationHeatingCooling.heatDemand, HeatDemand.y) annotation (Line( + points={{9.43333,27.4824},{20,27.4824},{20,58},{33,58}}, + color={0,0,127})); + connect(dT_coolingGridSet.y, substationHeatingCooling.deltaT_coolingGridSet) + annotation (Line(points={{-59,28},{-52,28},{-52,10.2588},{-24,10.2588}}, + color={0,0,127})); + connect(substationHeatingCooling.deltaT_heatingGridSet, dT_heatingGridSet.y) + annotation (Line(points={{9.43333,24.3765},{9.43333,24},{24,24},{24,28},{35, + 28}}, + color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-120, + -100},{120,100}})), Diagram( + coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120, + 100}})), + experiment( + StopTime=86400, + Interval=60, + Tolerance=1e-007), + Documentation(revisions=" +", info="

+ This example shows a simple example of a closed loop substation with + heat pump and chiller (variable temperature difference on network and + building sides) + AixLib.Fluid.DistrictHeatingCooling.Demands.ClosedLoop.SubstationHeatingCoolingVarDeltaT. + It illustrates the settings needed in the demand model to work in a + bidirectional low-temperature network. +

+")); +end SubstationHeatingCoolingVarDeltaT; diff --git a/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/ClosedLoop/package.mo b/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/ClosedLoop/package.mo new file mode 100644 index 0000000000..fa4c6eb46b --- /dev/null +++ b/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/ClosedLoop/package.mo @@ -0,0 +1,3 @@ +within AixLib.Fluid.DistrictHeatingCooling.Demands.Examples; +package ClosedLoop +end ClosedLoop; diff --git a/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/ClosedLoop/package.order b/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/ClosedLoop/package.order new file mode 100644 index 0000000000..ba67ee4b13 --- /dev/null +++ b/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/ClosedLoop/package.order @@ -0,0 +1,8 @@ +DHCSubstationHeatPumpChiller +DHCSubstationHeatPumpDirectCooling +SubstationCooling +SubstationHeating +SubstationHeatingCoolingFixDeltaT +SubstationHeatingCoolingVarDeltaT +SubstationDirectHeatingDirectCooling +SubstationDirectHeatingDirectCoolingDHW diff --git a/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/package.order b/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/package.order index 23951ff41c..becddf1772 100644 --- a/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/package.order +++ b/AixLib/Fluid/DistrictHeatingCooling/Demands/Examples/package.order @@ -1,6 +1,5 @@ -DHCSubstationHeatPumpChiller -DHCSubstationHeatPumpDirectCooling OpenLoopHeatPumpCarnot OpenLoopVarTSupplyDp OpenLoopVarTSupplyDpBypass OpenLoopVarTSupplyDpFixedTempDifferenceBypass +ClosedLoop