From fa3160d9e6453b4537be7192c1a798eeb47f2a2b Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Mon, 1 Oct 2018 12:00:01 +0200 Subject: [PATCH 01/10] Add conditional arg to system argument --- AixLib/Controls/HeatPump/HPControl.mo | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AixLib/Controls/HeatPump/HPControl.mo b/AixLib/Controls/HeatPump/HPControl.mo index ba0c6889d1..d3710bd036 100644 --- a/AixLib/Controls/HeatPump/HPControl.mo +++ b/AixLib/Controls/HeatPump/HPControl.mo @@ -108,7 +108,8 @@ model HPControl TSetToNSet ConvTSetToNSet annotation (Placement(transformation(extent={{44,-8}, {76,26}}))); - Modelica.Blocks.Routing.RealPassThrough realPasThrAntLeg "No Anti Legionella" + Modelica.Blocks.Routing.RealPassThrough realPasThrAntLeg if not use_antLeg + "No Anti Legionella" annotation ( choicesAllMatching=true, Placement( transformation(extent={{-10,38},{6,54}}))); From bb0201ef087d9eb8ec0d04fcb694d5d9e954d23b Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Mon, 1 Oct 2018 16:18:59 +0200 Subject: [PATCH 02/10] Fix bugs --- .../EvaporatorCondenserWithCapacity.mo | 2 +- .../PerformanceData/LookUpTable2D.mo | 31 ++++++++++++------- AixLib/Fluid/HeatPumps/HeatPump.mo | 18 +++++------ 3 files changed, 29 insertions(+), 22 deletions(-) diff --git a/AixLib/Fluid/HeatPumps/BaseClasses/EvaporatorCondenserWithCapacity.mo b/AixLib/Fluid/HeatPumps/BaseClasses/EvaporatorCondenserWithCapacity.mo index d7b6b849e5..518a7a3165 100644 --- a/AixLib/Fluid/HeatPumps/BaseClasses/EvaporatorCondenserWithCapacity.mo +++ b/AixLib/Fluid/HeatPumps/BaseClasses/EvaporatorCondenserWithCapacity.mo @@ -15,7 +15,7 @@ model EvaporatorCondenserWithCapacity parameter Modelica.SIunits.ThermalConductance kAOut_nominal "Nominal value for thermal conductance to the ambient" annotation (Dialog(group="Heat losses", enable= use_cap)); - parameter Modelica.Blocks.Interfaces.RealOutput kAInn + Modelica.Blocks.Interfaces.RealOutput kAInn "Formular for calculation of heat transfer coefficient on the inside" annotation (Dialog(group="Heat losses", enable= use_cap)); diff --git a/AixLib/Fluid/HeatPumps/BaseClasses/PerformanceData/LookUpTable2D.mo b/AixLib/Fluid/HeatPumps/BaseClasses/PerformanceData/LookUpTable2D.mo index d8c35bfc14..fdf190a870 100644 --- a/AixLib/Fluid/HeatPumps/BaseClasses/PerformanceData/LookUpTable2D.mo +++ b/AixLib/Fluid/HeatPumps/BaseClasses/PerformanceData/LookUpTable2D.mo @@ -57,7 +57,7 @@ model LookUpTable2D "Performance data coming from manufacturer" annotation (Placement(transformation( extent={{-6,-6},{6,6}}, rotation=270, - origin={76,-80}))); + origin={76,-76}))); Modelica.Blocks.Math.Add calcRedQCon "Based on redcued heat flow to the evaporator, the heat flow to the condenser is also reduced" annotation (Placement(transformation( @@ -70,6 +70,11 @@ model LookUpTable2D "Performance data coming from manufacturer" rotation=270, origin={-8,78}))); + Modelica.Blocks.Math.Gain gain(final k=-1) + "Negate QEva to match definition of heat flow direction" + annotation (Placement(transformation(extent={{-4,-4},{4,4}}, + rotation=270, + origin={76,-92}))); protected Modelica.Blocks.Sources.RealExpression realCorr(final y=scalingFactor* sigBusHP.N) @@ -87,7 +92,7 @@ protected "Calculates evaporator heat flow with total energy balance" annotation(Placement(transformation(extent={{-10,-10}, {10,10}}, rotation=270, - origin={80,-56}))); + origin={80,-54}))); Utilities.Logical.SmoothSwitch switchPel "If HP is off, no heat will be exchanged" annotation (Placement(transformation(extent={{-10,-10},{10,10}}, @@ -149,24 +154,22 @@ equation connect(switchQCon.u1, nTimesQCon.y) annotation (Line(points={{60,-22},{60,-6.6}}, color={0,0,127})); connect(sigBusHP.iceFac, proRedQEva.u2) annotation (Line( - points={{1.075,104.07},{2,104.07},{2,46},{18,46},{18,-70},{72.4,-70},{72.4, - -72.8}}, + points={{1.075,104.07},{2,104.07},{2,46},{18,46},{18,-70},{72.4,-70},{ + 72.4,-68.8}}, color={255,204,51}, thickness=0.5), Text( string="%first", index=-1, extent={{-3,6},{-3,6}}, horizontalAlignment=TextAlignment.Right)); - connect(feedbackHeatFlowEvaporator.y, proRedQEva.u1) annotation (Line(points={{80,-65}, - {80,-68},{79.6,-68},{79.6,-72.8}}, color={0,0,127})); + connect(feedbackHeatFlowEvaporator.y, proRedQEva.u1) annotation (Line(points={{80,-63}, + {80,-68},{79.6,-68},{79.6,-68.8}}, color={0,0,127})); connect(switchPel.y, calcRedQCon.u2) annotation (Line(points={{-56,-45},{-82, -45},{-82,-78.8},{-83.6,-78.8}}, color={0,0,127})); connect(QCon, calcRedQCon.y) annotation (Line(points={{-80,-110},{-80,-92.6}}, color={0,0,127})); - connect(proRedQEva.y, QEva) annotation (Line(points={{76,-86.6},{76,-96},{80,-96}, - {80,-110}}, color={0,0,127})); - connect(proRedQEva.y, calcRedQCon.u1) annotation (Line(points={{76,-86.6},{66, - -86.6},{66,-88},{-60,-88},{-60,-62},{-76.4,-62},{-76.4,-78.8}}, color= + connect(proRedQEva.y, calcRedQCon.u1) annotation (Line(points={{76,-82.6},{66, + -82.6},{66,-88},{-60,-88},{-60,-62},{-76.4,-62},{-76.4,-78.8}}, color= {0,0,127})); connect(sigBusHP.N, greaterThreshold.u) annotation (Line( points={{1.075,104.07},{-8,104.07},{-8,85.2}}, @@ -181,13 +184,17 @@ equation connect(greaterThreshold.y, switchQCon.u2) annotation (Line(points={{-8,71.4}, {-8,48},{-20,48},{-20,-12},{52,-12},{52,-22}}, color={255,0,255})); connect(switchQCon.y, feedbackHeatFlowEvaporator.u1) - annotation (Line(points={{52,-45},{52,-48},{80,-48}}, color={0,0,127})); + annotation (Line(points={{52,-45},{52,-46},{80,-46}}, color={0,0,127})); connect(switchPel.y, feedbackHeatFlowEvaporator.u2) - annotation (Line(points={{-56,-45},{-56,-56},{72,-56}}, color={0,0,127})); + annotation (Line(points={{-56,-45},{-56,-54},{72,-54}}, color={0,0,127})); connect(realCorr.y, nTimesPel.u1) annotation (Line(points={{-14,23},{-14,12},{ -42.8,12},{-42.8,5.4}}, color={0,0,127})); connect(realCorr.y, nTimesQCon.u2) annotation (Line(points={{-14,23},{-14,12}, {56.4,12},{56.4,7.2}}, color={0,0,127})); + connect(proRedQEva.y, gain.u) + annotation (Line(points={{76,-82.6},{76,-87.2}}, color={0,0,127})); + connect(QEva, gain.y) annotation (Line(points={{80,-110},{80,-96.4},{76,-96.4}}, + color={0,0,127})); annotation (Icon(graphics={ Line(points={{-60.0,40.0},{-60.0,-40.0},{60.0,-40.0},{60.0,40.0},{30.0,40.0},{30.0,-40.0},{-30.0,-40.0},{-30.0,40.0},{-60.0,40.0},{-60.0,20.0},{60.0,20.0},{60.0,0.0},{-60.0,0.0},{-60.0,-20.0},{60.0,-20.0},{60.0,-40.0},{-60.0,-40.0},{-60.0,40.0},{60.0,40.0},{60.0,-40.0}}), Line(points={{0.0,40.0},{0.0,-40.0}}), diff --git a/AixLib/Fluid/HeatPumps/HeatPump.mo b/AixLib/Fluid/HeatPumps/HeatPump.mo index 57cb808156..1125c95ea9 100644 --- a/AixLib/Fluid/HeatPumps/HeatPump.mo +++ b/AixLib/Fluid/HeatPumps/HeatPump.mo @@ -191,7 +191,7 @@ model HeatPump "Base model of realistic heat pump" final V=VCon*scalingFactor, final C=CCon*scalingFactor, final m_flow_nominal=mFlow_conNominal, - final kAInn=3.66*(1 + GCon)^0.88) + final kAInn=GCon*(1 + abs(mFlow_con.m_flow/mFlow_conNominal))^0.88) "Heat exchanger model for the condenser" annotation (Placement(transformation(extent={{-16,76},{16,108}}))); AixLib.Fluid.HeatPumps.BaseClasses.EvaporatorCondenserWithCapacity eva( @@ -311,12 +311,12 @@ model HeatPump "Base model of realistic heat pump" final allowFlowReversal=allowFlowReversalEva, final m_flow_nominal=mFlow_evaNominal, final m_flow_small=1E-4*mFlow_evaNominal, - final tau=tauHeaTra, final initType=initType, final T_start=TEva_start, final transferHeat=transferHeat, final TAmb=TAmbEva_nominal, - final tauHeaTra=tauHeaTra) "Temperature at sink inlet" annotation ( + final tauHeaTra=tauHeaTra, + final tau=tauSenT) "Temperature at sink inlet" annotation ( Placement(transformation( extent={{10,-10},{-10,10}}, rotation=0, @@ -326,12 +326,12 @@ model HeatPump "Base model of realistic heat pump" final allowFlowReversal=allowFlowReversalEva, final m_flow_nominal=mFlow_evaNominal, final m_flow_small=1E-4*mFlow_evaNominal, - final tau=tauHeaTra, final initType=initType, final T_start=TEva_start, final transferHeat=transferHeat, final TAmb=TAmbEva_nominal, - final tauHeaTra=tauHeaTra) "Temperature at sink outlet" annotation ( + final tauHeaTra=tauHeaTra, + final tau=tauSenT) "Temperature at sink outlet" annotation ( Placement(transformation( extent={{10,-10},{-10,10}}, rotation=0, @@ -343,7 +343,6 @@ model HeatPump "Base model of realistic heat pump" extent={{10,-10},{-10,10}}, rotation=0))); Sensors.TemperatureTwoPort senT_b1( - final tau=tauHeaTra, final initType=initType, final transferHeat=transferHeat, final TAmb=TAmbEva_nominal, @@ -352,13 +351,13 @@ model HeatPump "Base model of realistic heat pump" final allowFlowReversal=allowFlowReversalCon, final m_flow_nominal=mFlow_conNominal, final m_flow_small=1E-4*mFlow_conNominal, - final T_start=TCon_start) "Temperature at sink outlet" annotation ( + final T_start=TCon_start, + final tau=tauSenT) "Temperature at sink outlet" annotation ( Placement(transformation( extent={{-10,10},{10,-10}}, rotation=0, origin={38,92}))); Sensors.TemperatureTwoPort senT_a1( - final tau=tauHeaTra, final initType=initType, final transferHeat=transferHeat, final tauHeaTra=tauHeaTra, @@ -367,7 +366,8 @@ model HeatPump "Base model of realistic heat pump" final m_flow_nominal=mFlow_conNominal, final m_flow_small=1E-4*mFlow_conNominal, final T_start=TCon_start, - final TAmb=TAmbCon_nominal) "Temperature at sink inlet" annotation ( + final TAmb=TAmbCon_nominal, + final tau=tauSenT) "Temperature at sink inlet" annotation ( Placement(transformation( extent={{-10,10},{10,-10}}, rotation=0, From 0f8261b240778d9e239330a103a0cf4e9b8fa32f Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Fri, 5 Oct 2018 13:12:39 +0200 Subject: [PATCH 03/10] Add other formular for kAInn --- AixLib/Fluid/HeatPumps/HeatPump.mo | 29 ++++++++++++------- .../Systems/HeatPumpSystems/HeatPumpSystem.mo | 4 ++- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/AixLib/Fluid/HeatPumps/HeatPump.mo b/AixLib/Fluid/HeatPumps/HeatPump.mo index 1125c95ea9..f463885ad9 100644 --- a/AixLib/Fluid/HeatPumps/HeatPump.mo +++ b/AixLib/Fluid/HeatPumps/HeatPump.mo @@ -35,21 +35,21 @@ model HeatPump "Base model of realistic heat pump" "Consider the inertia of the refrigerant cycle" annotation(choices(checkBox=true), Dialog( group="Refrigerant inertia")); - constant Modelica.SIunits.Frequency refIneFre_constant + parameter Modelica.SIunits.Frequency refIneFre_constant "Cut off frequency for inertia of refrigerant cycle" - annotation (Dialog(enable=use_refIne, group="Refrigerant inertia")); + annotation (Dialog(enable=use_refIne, group="Refrigerant inertia"),Evaluate=false); parameter Integer nthOrder=3 "Order of refrigerant cycle interia" annotation (Dialog(enable= use_refIne, group="Refrigerant inertia")); //Condenser parameter Modelica.SIunits.MassFlowRate mFlow_conNominal "Nominal mass flow rate" - annotation (Dialog(group="Parameters", tab="Condenser")); + annotation (Dialog(group="Parameters", tab="Condenser"),Evaluate=false); parameter Modelica.SIunits.Volume VCon "Volume in condenser" annotation (Evaluate=false,Dialog(group="Parameters", tab="Condenser")); parameter Modelica.SIunits.PressureDifference dpCon_nominal "Pressure drop at nominal mass flow rate" - annotation (Dialog(group="Flow resistance", tab="Condenser")); + annotation (Dialog(group="Flow resistance", tab="Condenser"), Evaluate=false); parameter Real deltaM_con=0.1 "Fraction of nominal mass flow rate where transition to turbulent occurs" annotation (Dialog(tab="Condenser", group="Flow resistance")); @@ -65,15 +65,19 @@ model HeatPump "Base model of realistic heat pump" "Constant thermal conductance of condenser material" annotation (Evaluate=false,Dialog(group="Heat Losses", tab="Condenser", enable=use_ConCap)); + parameter Modelica.SIunits.ThermalConductance GConIns + "Constant thermal conductance of condenser material" + annotation (Evaluate=false,Dialog(group="Heat Losses", tab="Condenser", + enable=use_ConCap)); //Evaporator parameter Modelica.SIunits.MassFlowRate mFlow_evaNominal - "Nominal mass flow rate" annotation (Dialog(group="Parameters", tab="Evaporator")); + "Nominal mass flow rate" annotation (Dialog(group="Parameters", tab="Evaporator"),Evaluate=false); parameter Modelica.SIunits.Volume VEva "Volume in evaporator" annotation (Evaluate=false,Dialog(group="Parameters", tab="Evaporator")); parameter Modelica.SIunits.PressureDifference dpEva_nominal "Pressure drop at nominal mass flow rate" - annotation (Dialog(group="Flow resistance", tab="Evaporator")); + annotation (Dialog(group="Flow resistance", tab="Evaporator"),Evaluate=false); parameter Real deltaM_eva=0.1 "Fraction of nominal mass flow rate where transition to turbulent occurs" annotation (Dialog(tab="Evaporator", group="Flow resistance")); @@ -89,7 +93,10 @@ model HeatPump "Base model of realistic heat pump" "Constant thermal conductance of Evaporator material" annotation (Evaluate=false,Dialog(group="Heat Losses", tab="Evaporator", enable=use_EvaCap)); - + parameter Modelica.SIunits.ThermalConductance GEvaIns + "Constant thermal conductance of Evaporator material" + annotation (Evaluate=false,Dialog(group="Heat Losses", tab="Evaporator", + enable=use_EvaCap)); //Assumptions parameter Boolean allowFlowReversalEva=true "= false to simplify equations, assuming, but not enforcing, no flow reversal" @@ -107,7 +114,7 @@ model HeatPump "Base model of realistic heat pump" annotation (Dialog(tab="Assumptions", group="Temperature sensors"),choices(checkBox=true)); parameter Modelica.SIunits.Time tauHeaTra=1200 "Time constant for heat transfer in temperature sensors, default 20 minutes" - annotation (Dialog(tab="Assumptions", group="Temperature sensors")); + annotation (Dialog(tab="Assumptions", group="Temperature sensors"),Evaluate=false); parameter Modelica.SIunits.Temperature TAmbCon_nominal=291.15 "Fixed ambient temperature for heat transfer of sensors at the condenser side" annotation ( Dialog(tab= "Assumptions", group= @@ -191,7 +198,7 @@ model HeatPump "Base model of realistic heat pump" final V=VCon*scalingFactor, final C=CCon*scalingFactor, final m_flow_nominal=mFlow_conNominal, - final kAInn=GCon*(1 + abs(mFlow_con.m_flow/mFlow_conNominal))^0.88) + final kAInn=GCon + GConIns*abs(mFlow_con.m_flow/mFlow_conNominal)^0.88) "Heat exchanger model for the condenser" annotation (Placement(transformation(extent={{-16,76},{16,108}}))); AixLib.Fluid.HeatPumps.BaseClasses.EvaporatorCondenserWithCapacity eva( @@ -215,7 +222,8 @@ model HeatPump "Base model of realistic heat pump" final V=VEva*scalingFactor, final C=CEva*scalingFactor, final m_flow_nominal=mFlow_evaNominal, - kAInn=3.66*(1 + GEva)^0.88) "Heat exchanger model for the evaporator" + kAInn=GEva + GEvaIns*abs(mFlow_eva.m_flow/mFlow_evaNominal)^0.88) + "Heat exchanger model for the evaporator" annotation (Placement(transformation(extent={{16,-70},{-16,-102}}))); Modelica.Blocks.Continuous.CriticalDamping heatFlowIneEva( final initType=initType, @@ -378,6 +386,7 @@ model HeatPump "Base model of realistic heat pump" origin={-76,60}, extent={{-10,10},{10,-10}}, rotation=0))); + equation connect(modeSet, sigBusHP.mode) annotation (Line(points={{-116,-20},{-76,-20}, diff --git a/AixLib/Systems/HeatPumpSystems/HeatPumpSystem.mo b/AixLib/Systems/HeatPumpSystems/HeatPumpSystem.mo index f77b6f56d7..32bed14981 100644 --- a/AixLib/Systems/HeatPumpSystems/HeatPumpSystem.mo +++ b/AixLib/Systems/HeatPumpSystems/HeatPumpSystem.mo @@ -41,7 +41,9 @@ model HeatPumpSystem redeclare final package Medium_con = Medium_con, redeclare final package Medium_eva = Medium_eva, redeclare final model PerDataHea = PerDataHea, - redeclare final model PerDataChi = PerDataChi)); + redeclare final model PerDataChi = PerDataChi, + GConIns=10, + GEvaIns=10)); //Heat Pump parameter Boolean use_revHP=true "True if the HP is reversible" annotation(Dialog(tab="Heat Pump"),choices(choice=true "reversible HP", choice=false "only heating", From 8f1b1fe31786079dcc075deb36819fe3dbfb7faa Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Fri, 5 Oct 2018 13:17:38 +0200 Subject: [PATCH 04/10] Change evaluate to true so warnings disappear --- AixLib/Fluid/HeatPumps/HeatPump.mo | 40 +++++++++++++++--------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/AixLib/Fluid/HeatPumps/HeatPump.mo b/AixLib/Fluid/HeatPumps/HeatPump.mo index f463885ad9..0a82cd6b41 100644 --- a/AixLib/Fluid/HeatPumps/HeatPump.mo +++ b/AixLib/Fluid/HeatPumps/HeatPump.mo @@ -37,19 +37,19 @@ model HeatPump "Base model of realistic heat pump" parameter Modelica.SIunits.Frequency refIneFre_constant "Cut off frequency for inertia of refrigerant cycle" - annotation (Dialog(enable=use_refIne, group="Refrigerant inertia"),Evaluate=false); + annotation (Dialog(enable=use_refIne, group="Refrigerant inertia"),Evaluate=true); parameter Integer nthOrder=3 "Order of refrigerant cycle interia" annotation (Dialog(enable= use_refIne, group="Refrigerant inertia")); //Condenser parameter Modelica.SIunits.MassFlowRate mFlow_conNominal "Nominal mass flow rate" - annotation (Dialog(group="Parameters", tab="Condenser"),Evaluate=false); + annotation (Dialog(group="Parameters", tab="Condenser"),Evaluate=true); parameter Modelica.SIunits.Volume VCon "Volume in condenser" - annotation (Evaluate=false,Dialog(group="Parameters", tab="Condenser")); + annotation (Evaluate=true,Dialog(group="Parameters", tab="Condenser")); parameter Modelica.SIunits.PressureDifference dpCon_nominal "Pressure drop at nominal mass flow rate" - annotation (Dialog(group="Flow resistance", tab="Condenser"), Evaluate=false); + annotation (Dialog(group="Flow resistance", tab="Condenser"), Evaluate=true); parameter Real deltaM_con=0.1 "Fraction of nominal mass flow rate where transition to turbulent occurs" annotation (Dialog(tab="Condenser", group="Flow resistance")); @@ -58,26 +58,26 @@ model HeatPump "Base model of realistic heat pump" annotation (Dialog(group="Heat Losses", tab="Condenser"), choices(checkBox=true)); parameter Modelica.SIunits.HeatCapacity CCon - "Heat capacity of Condenser (= cp*m)" annotation (Evaluate=false,Dialog(group="Heat Losses", + "Heat capacity of Condenser (= cp*m)" annotation (Evaluate=true,Dialog(group="Heat Losses", tab="Condenser", enable=use_ConCap)); parameter Modelica.SIunits.ThermalConductance GCon "Constant thermal conductance of condenser material" - annotation (Evaluate=false,Dialog(group="Heat Losses", tab="Condenser", + annotation (Evaluate=true,Dialog(group="Heat Losses", tab="Condenser", enable=use_ConCap)); parameter Modelica.SIunits.ThermalConductance GConIns "Constant thermal conductance of condenser material" - annotation (Evaluate=false,Dialog(group="Heat Losses", tab="Condenser", + annotation (Evaluate=true,Dialog(group="Heat Losses", tab="Condenser", enable=use_ConCap)); //Evaporator parameter Modelica.SIunits.MassFlowRate mFlow_evaNominal - "Nominal mass flow rate" annotation (Dialog(group="Parameters", tab="Evaporator"),Evaluate=false); + "Nominal mass flow rate" annotation (Dialog(group="Parameters", tab="Evaporator"),Evaluate=true); parameter Modelica.SIunits.Volume VEva "Volume in evaporator" - annotation (Evaluate=false,Dialog(group="Parameters", tab="Evaporator")); + annotation (Evaluate=true,Dialog(group="Parameters", tab="Evaporator")); parameter Modelica.SIunits.PressureDifference dpEva_nominal "Pressure drop at nominal mass flow rate" - annotation (Dialog(group="Flow resistance", tab="Evaporator"),Evaluate=false); + annotation (Dialog(group="Flow resistance", tab="Evaporator"),Evaluate=true); parameter Real deltaM_eva=0.1 "Fraction of nominal mass flow rate where transition to turbulent occurs" annotation (Dialog(tab="Evaporator", group="Flow resistance")); @@ -87,15 +87,15 @@ model HeatPump "Base model of realistic heat pump" choices(checkBox=true)); parameter Modelica.SIunits.HeatCapacity CEva "Heat capacity of Evaporator (= cp*m)" - annotation (Evaluate=false,Dialog(group="Heat Losses", tab="Evaporator", + annotation (Evaluate=true,Dialog(group="Heat Losses", tab="Evaporator", enable=use_EvaCap)); parameter Modelica.SIunits.ThermalConductance GEva "Constant thermal conductance of Evaporator material" - annotation (Evaluate=false,Dialog(group="Heat Losses", tab="Evaporator", + annotation (Evaluate=true,Dialog(group="Heat Losses", tab="Evaporator", enable=use_EvaCap)); parameter Modelica.SIunits.ThermalConductance GEvaIns "Constant thermal conductance of Evaporator material" - annotation (Evaluate=false,Dialog(group="Heat Losses", tab="Evaporator", + annotation (Evaluate=true,Dialog(group="Heat Losses", tab="Evaporator", enable=use_EvaCap)); //Assumptions parameter Boolean allowFlowReversalEva=true @@ -114,7 +114,7 @@ model HeatPump "Base model of realistic heat pump" annotation (Dialog(tab="Assumptions", group="Temperature sensors"),choices(checkBox=true)); parameter Modelica.SIunits.Time tauHeaTra=1200 "Time constant for heat transfer in temperature sensors, default 20 minutes" - annotation (Dialog(tab="Assumptions", group="Temperature sensors"),Evaluate=false); + annotation (Dialog(tab="Assumptions", group="Temperature sensors"),Evaluate=true); parameter Modelica.SIunits.Temperature TAmbCon_nominal=291.15 "Fixed ambient temperature for heat transfer of sensors at the condenser side" annotation ( Dialog(tab= "Assumptions", group= @@ -130,22 +130,22 @@ model HeatPump "Base model of realistic heat pump" annotation (Dialog(tab="Initialization", group="Parameters")); parameter Modelica.Media.Interfaces.Types.AbsolutePressure pCon_start= Medium_con.p_default "Start value of pressure" - annotation (Evaluate=false,Dialog(tab="Initialization", group="Condenser")); + annotation (Evaluate=true,Dialog(tab="Initialization", group="Condenser")); parameter Modelica.Media.Interfaces.Types.Temperature TCon_start=Medium_con.T_default "Start value of temperature" - annotation (Evaluate=false,Dialog(tab="Initialization", group="Condenser")); + annotation (Evaluate=true,Dialog(tab="Initialization", group="Condenser")); parameter Modelica.Media.Interfaces.Types.MassFraction XCon_start[Medium_con.nX]= Medium_con.X_default "Start value of mass fractions m_i/m" - annotation (Evaluate=false,Dialog(tab="Initialization", group="Condenser")); + annotation (Evaluate=true,Dialog(tab="Initialization", group="Condenser")); parameter Modelica.Media.Interfaces.Types.AbsolutePressure pEva_start= Medium_eva.p_default "Start value of pressure" - annotation (Evaluate=false,Dialog(tab="Initialization", group="Evaporator")); + annotation (Evaluate=true,Dialog(tab="Initialization", group="Evaporator")); parameter Modelica.Media.Interfaces.Types.Temperature TEva_start=Medium_eva.T_default "Start value of temperature" - annotation (Evaluate=false,Dialog(tab="Initialization", group="Evaporator")); + annotation (Evaluate=true,Dialog(tab="Initialization", group="Evaporator")); parameter Modelica.Media.Interfaces.Types.MassFraction XEva_start[Medium_eva.nX]= Medium_eva.X_default "Start value of mass fractions m_i/m" - annotation (Evaluate=false,Dialog(tab="Initialization", group="Evaporator")); + annotation (Evaluate=true,Dialog(tab="Initialization", group="Evaporator")); parameter Real x_start[nthOrder]=zeros(nthOrder) "Initial or guess values of states" annotation (Dialog(tab="Initialization", group="Refrigerant inertia", enable=use_refIne)); From 7c6d0c25de50bc66ac570563e29f8e96c1f2ed64 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Sat, 6 Oct 2018 09:36:53 +0200 Subject: [PATCH 05/10] Make BoundaryMap.mo with dynamic icon --- .../BaseClasses/BoundaryMap.mo | 90 +++++++++++-------- 1 file changed, 51 insertions(+), 39 deletions(-) diff --git a/AixLib/Controls/HeatPump/SecurityControls/BaseClasses/BoundaryMap.mo b/AixLib/Controls/HeatPump/SecurityControls/BaseClasses/BoundaryMap.mo index 11cb516373..448143fece 100644 --- a/AixLib/Controls/HeatPump/SecurityControls/BaseClasses/BoundaryMap.mo +++ b/AixLib/Controls/HeatPump/SecurityControls/BaseClasses/BoundaryMap.mo @@ -1,23 +1,7 @@ within AixLib.Controls.HeatPump.SecurityControls.BaseClasses; block BoundaryMap "A function yielding true if input parameters are out of the charasteristic map" - parameter Boolean use_opeEnvFroRec=true - "Use a the operational envelope given in the datasheet" annotation(choices(checkBox=true)); - parameter DataBase.HeatPump.HeatPumpBaseDataDefinition dataTable "Data Table of HP" - annotation(choicesAllMatching = true, Dialog(enable= - use_opeEnvFroRec)); - parameter Real tableLow[:,2]=fill( - 0.0, - 0, - 2) "Table matrix (grid = first column; e.g., table=[0,2])" annotation(choicesAllMatchning=true, Dialog( - enable=not use_opeEnvFroRec)); - parameter Real tableUpp[:,2]=fill( - 0.0, - 0, - 2) "Table matrix (grid = first column; e.g., table=[0,2])" - annotation (Dialog(enable=not use_opeEnvFroRec)); - - Modelica.Blocks.Interfaces.BooleanOutput noErr + Modelica.Blocks.Interfaces.BooleanOutput noErr "If an error occurs, this will be false" annotation (Placement(transformation(extent={{100,-10},{120,10}}))); Modelica.Blocks.Interfaces.RealInput x_in "Current value of x-Axis" @@ -25,11 +9,11 @@ block BoundaryMap Modelica.Blocks.Interfaces.RealInput y_in "Current value on y-Axis" annotation (Placement(transformation(extent={{-128,-74},{-100,-46}}))); - Modelica.Blocks.Tables.CombiTable1Ds uppCombiTable1Ds(final table=tableUpp_internal, smoothness= + Modelica.Blocks.Tables.CombiTable1Ds uppCombiTable1Ds(final table=tableUpp, smoothness= Modelica.Blocks.Types.Smoothness.LinearSegments) annotation (Placement(transformation(extent={{-52,50},{-32,70}}))); Modelica.Blocks.Tables.CombiTable1Ds lowCombiTable1Ds(final smoothness=Modelica.Blocks.Types.Smoothness.LinearSegments, - table=tableLow_internal) + table=tableLow) annotation (Placement(transformation(extent={{-52,16},{-32,36}}))); Modelica.Blocks.MathBoolean.Nor nor1( @@ -43,23 +27,44 @@ block BoundaryMap annotation (Placement(transformation(extent={{-6,-40},{14,-20}}))); Modelica.Blocks.Logical.Greater greaterRig annotation (Placement(transformation(extent={{-6,-70},{14,-50}}))); + parameter Real tableLow[:,2]=fill( + 0.0, + 0, + 2) "Table matrix (grid = first column; e.g., table=[0,2])"; + parameter Real tableUpp[:,2]=fill( + 0.0, + 0, + 2) "Table matrix (grid = first column; e.g., table=[0,2])"; + Modelica.Blocks.Sources.Constant conXMin(k=xMin) annotation (Placement(transformation(extent={{-50,-46},{-38,-34}}))); Modelica.Blocks.Sources.Constant conXMax(k=xMax) annotation (Placement(transformation(extent={{-50,-76},{-38,-64}}))); -protected - parameter Real tableLow_internal[:,2] = if use_opeEnvFroRec then dataTable.tableLowBou else tableLow; - parameter Real tableUpp_internal[:,2] = if use_opeEnvFroRec then dataTable.tableUppBou else tableUpp; - parameter Real xMax=min(tableLow_internal[end, 1], tableUpp_internal[end, 1]) + parameter Real xMax=min(tableLow[end, 1], tableUpp[end, 1]) "Minimal value of lower and upper table data"; - parameter Real xMin=max(tableLow_internal[1, 1], tableUpp_internal[1, 1]) + parameter Real xMin=max(tableLow[1, 1], tableUpp[1, 1]) "Maximal value of lower and upper table data"; + parameter Real yMax=max(tableUpp[:, 2]) + "Minimal value of lower and upper table data"; + parameter Real yMin=min(tableLow[:, 2]) + "Maximal value of lower and upper table data"; + final Real[size(scaledX, 1), 2] points=transpose({unScaledX,unScaledY}) annotation(Hide=false); + Real tableLowRev[:,2] = [tableLow[end,1],tableLow[end,2];tableLow[1,1],tableLow[1,2]]; + Real tableMerge[:,2] = [tableLow[1,1],tableLow[1,2];tableUpp;tableLowRev]; + input Real scaledX[:] = tableMerge[:,1]; + input Real scaledY[:] = tableMerge[:,2]; + Real unScaledX[size(scaledX, 1)](min=-100, max=100); + Real unScaledY[size(scaledX, 1)](min=-100, max=100); + Real iconMin = -70; + Real iconMax = 70; initial equation - assert(tableLow_internal[end,1]==tableUpp_internal[end,1],"The boundary values have to be the same. For now the value to the safe operational side has been selected.", level = AssertionLevel.error); - assert(tableLow_internal[1,1]==tableUpp_internal[1,1],"The boundary values have to be the same. For now the value to the safe operational side has been selected.", level = AssertionLevel.error); + assert(tableLow[end,1]==tableUpp[end,1],"The boundary values have to be the same. For now the value to the safe operational side has been selected.", level = AssertionLevel.error); + assert(tableLow[1,1]==tableUpp[1,1],"The boundary values have to be the same. For now the value to the safe operational side has been selected.", level = AssertionLevel.error); equation + scaledX = (unScaledX-fill(iconMin, size(scaledX,1)))*(xMax - xMin)/(iconMax-iconMin) + fill(xMin, size(scaledX, 1)); + scaledY = (unScaledY-fill(iconMin, size(scaledX,1)))*(yMax - yMin)/(iconMax-iconMin) + fill(yMin, size(scaledY, 1)); connect(x_in, uppCombiTable1Ds.u) annotation (Line(points={{-114,60},{-54,60}}, color={0,0,127})); connect(x_in, lowCombiTable1Ds.u) annotation (Line(points={{-114,60},{-72,60},{-72,26}, @@ -90,24 +95,31 @@ equation -68},{-8,-68}}, color={0,0,127})); connect(conXMin.y, lessLef.u2) annotation (Line(points={{-37.4,-40},{-24,-40},{-24, -38},{-8,-38}}, color={0,0,127})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{100, - 100}}), graphics={ + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, + {100,100}}), graphics={ Rectangle( extent={{-100,100},{100,-100}}, lineColor={28,108,200}, fillColor={255,255,255}, + fillPattern=FillPattern.Solid), Line(points=DynamicSelect({{-76,-74},{-76,46},{-44,66}, + {70,66},{70,-74},{-76,-74}},points), color={238,46,47}, + thickness=0.5), + Text( + extent={{-100,100},{100,84}}, + lineColor={28,108,200}, + textString="%name"), + Polygon( + points={{-90,90},{-96,68},{-84,68},{-90,90}}, + lineColor={95,95,95}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid), + Polygon( + points={{98,-86},{76,-80},{76,-92},{98,-86}}, + lineColor={95,95,95}, + fillColor={95,95,95}, fillPattern=FillPattern.Solid), - Line(points={{-88,74},{-88,-42},{-88,-88},{86,-88},{82,-86},{86,-88},{ - 82,-90}}, color={28,108,200}), - Line(points={{-88,74},{-90,70},{-88,74},{-86,70}}, color={28,108,200}), - Line(points={{-74,48},{-74,-60},{-46,-80},{46,-80},{82,-64},{82,42}}, - color={28,108,200}), - Line(points={{-74,48},{-68,58},{-50,70},{-36,70},{-20,70},{18,70},{46, - 70},{72,64},{82,42}}, color={28,108,200}), - Line(points={{-96,74},{-94,70}}, color={28,108,200}), - Line(points={{-92,74},{-96,66}}, color={28,108,200}), - Line(points={{84,-92},{88,-98}}, color={28,108,200}), - Line(points={{88,-92},{84,-98}}, color={28,108,200})}), Diagram( + Line(points={{-90,68},{-90,-92}}, color={95,95,95}), + Line(points={{-98,-86},{80,-86}}, color={95,95,95})}), Diagram( coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}})), Documentation(info="

Given an input of the x and y-Axis, the block returns true if the given point is outside of the given envelope.

The maximal and minmal y-value depend on the x-Value and are defined by the upper and lower boundaries in form of 1Ds-Tables. The maximal and minimal x-values are obtained trough the table and are constant.

From d6abee9fd715d39b9b6bf4774f2912bf501fedea Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Sat, 6 Oct 2018 09:59:54 +0200 Subject: [PATCH 06/10] Merge current dev of BoundaryMap.mo with the updated dynamicIcon version --- .../BaseClasses/BoundaryMap.mo | 43 +++++++++++-------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/AixLib/Controls/HeatPump/SecurityControls/BaseClasses/BoundaryMap.mo b/AixLib/Controls/HeatPump/SecurityControls/BaseClasses/BoundaryMap.mo index 448143fece..380071ac11 100644 --- a/AixLib/Controls/HeatPump/SecurityControls/BaseClasses/BoundaryMap.mo +++ b/AixLib/Controls/HeatPump/SecurityControls/BaseClasses/BoundaryMap.mo @@ -1,6 +1,21 @@ within AixLib.Controls.HeatPump.SecurityControls.BaseClasses; block BoundaryMap "A function yielding true if input parameters are out of the charasteristic map" + parameter Boolean use_opeEnvFroRec=true + "Use a the operational envelope given in the datasheet" annotation(choices(checkBox=true)); + parameter DataBase.HeatPump.HeatPumpBaseDataDefinition dataTable "Data Table of HP" + annotation(choicesAllMatching = true, Dialog(enable= + use_opeEnvFroRec)); + parameter Real tableLow[:,2]=fill( + 0.0, + 0, + 2) "Table matrix (grid = first column; e.g., table=[0,2])" annotation(choicesAllMatchning=true, Dialog( + enable=not use_opeEnvFroRec)); + parameter Real tableUpp[:,2]=fill( + 0.0, + 0, + 2) "Table matrix (grid = first column; e.g., table=[0,2])" + annotation (Dialog(enable=not use_opeEnvFroRec)); Modelica.Blocks.Interfaces.BooleanOutput noErr "If an error occurs, this will be false" annotation (Placement(transformation(extent={{100,-10},{120,10}}))); @@ -27,31 +42,23 @@ block BoundaryMap annotation (Placement(transformation(extent={{-6,-40},{14,-20}}))); Modelica.Blocks.Logical.Greater greaterRig annotation (Placement(transformation(extent={{-6,-70},{14,-50}}))); - parameter Real tableLow[:,2]=fill( - 0.0, - 0, - 2) "Table matrix (grid = first column; e.g., table=[0,2])"; - parameter Real tableUpp[:,2]=fill( - 0.0, - 0, - 2) "Table matrix (grid = first column; e.g., table=[0,2])"; - Modelica.Blocks.Sources.Constant conXMin(k=xMin) annotation (Placement(transformation(extent={{-50,-46},{-38,-34}}))); Modelica.Blocks.Sources.Constant conXMax(k=xMax) annotation (Placement(transformation(extent={{-50,-76},{-38,-64}}))); - - parameter Real xMax=min(tableLow[end, 1], tableUpp[end, 1]) +protected + parameter Real tableLow_internal[:,2] = if use_opeEnvFroRec then dataTable.tableLowBou else tableLow; + parameter Real tableUpp_internal[:,2] = if use_opeEnvFroRec then dataTable.tableUppBou else tableUpp; + parameter Real xMax=min(tableLow_internal[end, 1], tableUpp_internal[end, 1]) "Minimal value of lower and upper table data"; - parameter Real xMin=max(tableLow[1, 1], tableUpp[1, 1]) + parameter Real xMin=max(tableLow_internal[1, 1], tableUpp_internal[1, 1]) "Maximal value of lower and upper table data"; - parameter Real yMax=max(tableUpp[:, 2]) + parameter Real yMax=max(tableUpp_internal[:, 2]) "Minimal value of lower and upper table data"; - parameter Real yMin=min(tableLow[:, 2]) + parameter Real yMin=min(tableLow_internal[:, 2]) "Maximal value of lower and upper table data"; final Real[size(scaledX, 1), 2] points=transpose({unScaledX,unScaledY}) annotation(Hide=false); - Real tableLowRev[:,2] = [tableLow[end,1],tableLow[end,2];tableLow[1,1],tableLow[1,2]]; - Real tableMerge[:,2] = [tableLow[1,1],tableLow[1,2];tableUpp;tableLowRev]; + Real tableMerge[:,2] = [tableLow_internal[1,1],tableLow_internal[1,2];tableUpp_internal;[Modelica.Math.Vectors.reverse(tableLow_internal[:,1]),Modelica.Math.Vectors.reverse(tableLow_internal[:,2])]]; input Real scaledX[:] = tableMerge[:,1]; input Real scaledY[:] = tableMerge[:,2]; Real unScaledX[size(scaledX, 1)](min=-100, max=100); @@ -59,8 +66,8 @@ block BoundaryMap Real iconMin = -70; Real iconMax = 70; initial equation - assert(tableLow[end,1]==tableUpp[end,1],"The boundary values have to be the same. For now the value to the safe operational side has been selected.", level = AssertionLevel.error); - assert(tableLow[1,1]==tableUpp[1,1],"The boundary values have to be the same. For now the value to the safe operational side has been selected.", level = AssertionLevel.error); + assert(tableLow_internal[end,1]==tableUpp_internal[end,1],"The boundary values have to be the same. For now the value to the safe operational side has been selected.", level = AssertionLevel.error); + assert(tableLow_internal[1,1]==tableUpp_internal[1,1],"The boundary values have to be the same. For now the value to the safe operational side has been selected.", level = AssertionLevel.error); equation scaledX = (unScaledX-fill(iconMin, size(scaledX,1)))*(xMax - xMin)/(iconMax-iconMin) + fill(xMin, size(scaledX, 1)); From 62049cdc30d3150f48578dfcd23dbff5e8143443 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Wed, 10 Oct 2018 10:03:57 +0200 Subject: [PATCH 07/10] - Add units - Fix HeatingCurveFunction.mo --- .../SetPoints/Functions/HeatingCurveFunction.mo | 4 ++-- AixLib/Controls/SetPoints/HeatingCurve.mo | 6 +++--- .../BaseClasses/PartialHeatPumpSystem.mo | 12 +++++++----- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/AixLib/Controls/SetPoints/Functions/HeatingCurveFunction.mo b/AixLib/Controls/SetPoints/Functions/HeatingCurveFunction.mo index 91f4785006..af14ee8a6c 100644 --- a/AixLib/Controls/SetPoints/Functions/HeatingCurveFunction.mo +++ b/AixLib/Controls/SetPoints/Functions/HeatingCurveFunction.mo @@ -5,8 +5,8 @@ protected parameter Real TOffNig = 10 "Delta K for night mode of heating system"; algorithm if isDay then - TSet := 55 + ((TRoom-55)/(TRoom+20))*(T_oda+20); + TSet := (55) + ((TRoom-(273.15+55))/(TRoom+(273.15+20)))*(T_oda+20); else - TSet := 55 + ((TRoom-55)/(TRoom+20))*(T_oda+20)-TOffNig; + TSet := (55) + ((TRoom-(273.15+55))/(TRoom+(273.15+20)))*(T_oda+20)-TOffNig; end if; end HeatingCurveFunction; diff --git a/AixLib/Controls/SetPoints/HeatingCurve.mo b/AixLib/Controls/SetPoints/HeatingCurve.mo index bac9d15a81..61ad1c5935 100644 --- a/AixLib/Controls/SetPoints/HeatingCurve.mo +++ b/AixLib/Controls/SetPoints/HeatingCurve.mo @@ -30,12 +30,12 @@ model HeatingCurve "Model of a heating curve" parameter Real day_hour=6 "Hour of day at which day mode is enabled" annotation(Dialog(group="Night-Mode",descriptionLabel = true)); parameter Real night_hour=22 "Hour of day at which night mode is enabled" annotation (Dialog(group="Night-Mode",descriptionLabel = true)); - Modelica.Blocks.Interfaces.RealInput T_oda "Outdoor air temperature" + Modelica.Blocks.Interfaces.RealInput T_oda(unit="K") "Outdoor air temperature" annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); - Modelica.Blocks.Interfaces.RealInput TRoom_in if use_dynTRoom + Modelica.Blocks.Interfaces.RealInput TRoom_in(unit="K") if use_dynTRoom "Desired room temperature" annotation (Placement(transformation(extent={{-140,36},{-100,76}}))); - Modelica.Blocks.Interfaces.RealOutput TSet + Modelica.Blocks.Interfaces.RealOutput TSet(unit="K") "Set temperature calculated by heating curve" annotation (Placement(transformation(extent={{100,-10},{120,10}}))); diff --git a/AixLib/Systems/HeatPumpSystems/BaseClasses/PartialHeatPumpSystem.mo b/AixLib/Systems/HeatPumpSystems/BaseClasses/PartialHeatPumpSystem.mo index d322cf905d..b0f5a3cae5 100644 --- a/AixLib/Systems/HeatPumpSystems/BaseClasses/PartialHeatPumpSystem.mo +++ b/AixLib/Systems/HeatPumpSystems/BaseClasses/PartialHeatPumpSystem.mo @@ -305,7 +305,8 @@ partial model PartialHeatPumpSystem rotation=0, origin={60,-42}))); - Modelica.Blocks.Interfaces.RealInput T_oda "Outdoor air temperature" + Modelica.Blocks.Interfaces.RealInput T_oda(unit="K") + "Outdoor air temperature" annotation (Placement(transformation(extent={{-132,98},{-102,128}}))); Fluid.Interfaces.PassThroughMedium mediumPassThroughSin( final allowFlowReversal=allowFlowReversalEva, @@ -438,8 +439,9 @@ equation points={{44,34},{64,34},{64,60},{70,60}}, color={0,127,255}, pattern=LinePattern.Dash)); - connect(heatPump.port_b2, port_b2) annotation (Line(points={{-26,-15.2},{-60,-15.2}, - {-60,-60},{-100,-60}}, color={0,127,255})); + connect(heatPump.port_b2, port_b2) annotation (Line(points={{-26,-15.2},{-60, + -15.2},{-60,-60},{-100,-60}}, + color={0,127,255})); connect(pumSou.port_a, port_a2) annotation (Line( points={{68,-42},{86,-42},{86,-16},{100,-16},{100,-60}}, color={0,127,255}, @@ -462,8 +464,6 @@ equation {100,60}}, color={0,127,255})); connect(T_oda, hPSystemController.T_oda) annotation (Line(points={{-117,113},{ -90,113},{-90,133},{-56.86,133}}, color={0,0,127})); - connect(senTSup.T, hPSystemController.TSup) annotation (Line(points={{78,68.8}, - {78,172},{-64,172},{-64,147},{-56.86,147}}, color={0,0,127})); connect(hPSystemController.y_sou, pumSin.y) annotation (Line(points={{-40.2,93.1}, {-40.2,66},{-70,66},{-70,49.6}}, color={0,0,127})); connect(hPSystemController.ySecHeaGen, secHeaGen.u) annotation (Line(points={{ @@ -471,6 +471,8 @@ equation connect(hPSystemController.y_sin, pumSou.y) annotation (Line(points={{38.2,93.1}, {38.2,76},{58,76},{58,-2},{36,-2},{36,-66},{60,-66},{60,-51.6}}, color={0,0,127})); + connect(senTSup.T, hPSystemController.TSup) annotation (Line(points={{78,68.8}, + {80,68.8},{80,176},{-80,176},{-80,147},{-56.86,147}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, {100,180}}), graphics={ Rectangle( From fd6e7ddb7423d55f978432372ef97be87c25006d Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Thu, 11 Oct 2018 11:36:27 +0200 Subject: [PATCH 08/10] Change control strategy of HPSystem. Add integer output to get a better grasp on the security control --- .../HeatPump/SecurityControls/AntiFreeze.mo | 4 ++ .../BaseClasses/PartialSecurityControl.mo | 27 ++++++++++++ .../SecurityControls/OperationalEnvelope.mo | 16 ++++--- .../SecurityControls/SecurityControl.mo | 42 +++++++++++++----- .../BaseClasses/HPSystemController.mo | 17 ++++--- .../BaseClasses/PartialHeatPumpSystem.mo | 44 +++++++------------ 6 files changed, 97 insertions(+), 53 deletions(-) diff --git a/AixLib/Controls/HeatPump/SecurityControls/AntiFreeze.mo b/AixLib/Controls/HeatPump/SecurityControls/AntiFreeze.mo index 9606a0bf68..f33a301b39 100644 --- a/AixLib/Controls/HeatPump/SecurityControls/AntiFreeze.mo +++ b/AixLib/Controls/HeatPump/SecurityControls/AntiFreeze.mo @@ -48,4 +48,8 @@ equation extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); + connect(greaterThreshold.y, not1.u) annotation (Line(points={{-34.7,-7},{-21, + -7},{-21,-63}}, color={255,0,255})); + connect(booConAntFre.y, not1.u) annotation (Line(points={{16.7,-29},{36,-29}, + {36,-56},{-22,-56},{-22,-60},{-21,-63}}, color={255,0,255})); end AntiFreeze; diff --git a/AixLib/Controls/HeatPump/SecurityControls/BaseClasses/PartialSecurityControl.mo b/AixLib/Controls/HeatPump/SecurityControls/BaseClasses/PartialSecurityControl.mo index 6ba7a06d63..cbe4a34368 100644 --- a/AixLib/Controls/HeatPump/SecurityControls/BaseClasses/PartialSecurityControl.mo +++ b/AixLib/Controls/HeatPump/SecurityControls/BaseClasses/PartialSecurityControl.mo @@ -18,12 +18,39 @@ partial block PartialSecurityControl "Base Block" annotation (Placement(transformation(extent={{120,-30},{140,-10}}))); Modelica.Blocks.Interfaces.BooleanInput modeSet "Set value of HP mode" annotation (Placement(transformation(extent={{-152,-36},{-120,-4}}))); + Modelica.Blocks.MathInteger.TriggeredAdd disErr( + y_start=0, + use_reset=false, + use_set=false) + "Used to show if the error was triggered" annotation (Placement( + transformation( + extent={{-8,-8},{8,8}}, + rotation=270, + origin={0,-80}))); + Modelica.Blocks.Interfaces.IntegerOutput ERR annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=270, + origin={0,-110}))); + Modelica.Blocks.Logical.Not not1 annotation (Placement(transformation( + extent={{-5,-5},{5,5}}, + rotation=270, + origin={-21,-69}))); + Modelica.Blocks.Sources.IntegerConstant intConOne(final k=1) + "Used for display of current error" + annotation (Placement(transformation(extent={{36,-70},{24,-58}}))); equation connect(conZer.y,swiErr. u3) annotation (Line(points={{70.6,-18},{78,-18}, {78,-8},{84,-8}}, color={0,0,127})); connect(swiErr.y, nOut) annotation (Line(points={{107,0},{118,0},{118,20},{130,20}}, color={0,0,127})); + connect(disErr.y, ERR) annotation (Line(points={{-1.77636e-15,-89.6},{ + -1.77636e-15,-100},{0,-100},{0,-110}}, color={255,127,0})); + connect(not1.y, disErr.trigger) annotation (Line(points={{-21,-74.5},{-21, + -75.2},{-9.6,-75.2}}, color={255,0,255})); + connect(intConOne.y, disErr.u) annotation (Line(points={{23.4,-64},{0,-64},{0, + -68.8}}, color={255,127,0})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{ -120,-100},{120,100}}), graphics={ Polygon( diff --git a/AixLib/Controls/HeatPump/SecurityControls/OperationalEnvelope.mo b/AixLib/Controls/HeatPump/SecurityControls/OperationalEnvelope.mo index 0f5a155b1c..073552187e 100644 --- a/AixLib/Controls/HeatPump/SecurityControls/OperationalEnvelope.mo +++ b/AixLib/Controls/HeatPump/SecurityControls/OperationalEnvelope.mo @@ -28,8 +28,8 @@ block OperationalEnvelope use_opeEnv annotation (Placement(transformation(extent={{10,-36},{24,-22}}))); equation - connect(boundaryMap.noErr, swiErr.u2) annotation (Line(points={{-1.36364,-3}, - {42,-3},{42,0},{84,0}}, color={255,0,255})); + connect(boundaryMap.noErr, swiErr.u2) annotation (Line(points={{-1.1,-3},{42, + -3},{42,0},{84,0}}, color={255,0,255})); connect(nSet,swiErr.u1) annotation (Line(points={{-136,20},{32,20},{32,8}, {84,8}},color={0,0,127})); connect(booConOpeEnv.y, swiErr.u2) annotation (Line( @@ -48,9 +48,9 @@ equation extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); connect(boundaryMap.x_in, toDegCT_flow_ev.y) - annotation (Line(points={{-60.4182,12},{-69.4,12}}, color={0,0,127})); + annotation (Line(points={{-66.06,12},{-69.4,12}}, color={0,0,127})); connect(boundaryMap.y_in, toDegCT_ret_co.y) - annotation (Line(points={{-60.4182,-18},{-69.4,-18}}, color={0,0,127})); + annotation (Line(points={{-66.06,-18},{-69.4,-18}}, color={0,0,127})); connect(sigBusHP.T_ret_co, toDegCT_ret_co.u) annotation (Line( points={{-134.915,-68.925},{-98,-68.925},{-98,-18},{-83.2,-18}}, color={255,204,51}, @@ -59,6 +59,10 @@ equation index=-1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - annotation (Diagram(coordinateSystem(extent={{-120,-120},{120,100}})), Icon( - coordinateSystem(extent={{-120,-120},{120,100}}))); + connect(boundaryMap.noErr, not1.u) annotation (Line(points={{-1.1,-3},{42,-3}, + {42,-56},{-21,-56},{-21,-63}}, color={255,0,255})); + connect(booConOpeEnv.y, not1.u) annotation (Line(points={{24.7,-29},{42,-29}, + {42,-56},{-21,-56},{-21,-63}}, color={255,0,255})); + annotation (Diagram(coordinateSystem(extent={{-120,-100},{120,100}})), Icon( + coordinateSystem(extent={{-120,-100},{120,100}}))); end OperationalEnvelope; diff --git a/AixLib/Controls/HeatPump/SecurityControls/SecurityControl.mo b/AixLib/Controls/HeatPump/SecurityControls/SecurityControl.mo index 10aa943ae1..562626a45c 100644 --- a/AixLib/Controls/HeatPump/SecurityControls/SecurityControl.mo +++ b/AixLib/Controls/HeatPump/SecurityControls/SecurityControl.mo @@ -66,7 +66,7 @@ block SecurityControl "Block including all security levels" use_runPerHou=use_runPerHou, maxRunPerHou=maxRunPerHou, pre_n_start=pre_n_start) - annotation (Placement(transformation(extent={{-62,-16},{-26,20}}))); + annotation (Placement(transformation(extent={{-62,-18},{-26,18}}))); DefrostControl defrostControl( final minIceFac=minIceFac, @@ -93,15 +93,27 @@ block SecurityControl "Block including all security levels" not use_deFro "No 2. Layer" annotation (Placement(transformation(extent={{-92,-50},{-76, -34}})), choicesAllMatching=true); + Modelica.Blocks.Interfaces.IntegerOutput ERR_opeEnv if + use_opeEnv annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=270, + origin={60,-110}))); + Modelica.Blocks.Interfaces.IntegerOutput ERR_antFre if + use_antFre annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=270, + origin={100,-110}))); equation connect(conTru.y,swiErr.u2) annotation (Line(points={{70.6,0},{84,0}}, color={255,0,255})); connect(onOffController.nOut, operationalEnvelope.nSet) annotation (Line( - points={{-24.5,3.63636},{-24,3.63636},{-24,4},{-11.6,4}}, color= + points={{-24.5,1.63636},{-24,1.63636},{-24,3.2},{-11.6,3.2}}, color= {0,0,127})); connect(sigBusHP, onOffController.sigBusHP) annotation (Line( - points={{-135,-69},{-64.25,-69},{-64.25,-7.65455}}, + points={{-135,-69},{-64.25,-69},{-64.25,-9.65455}}, color={255,204,51}, thickness=0.5), Text( string="%first", @@ -109,7 +121,7 @@ equation extent={{-3,-6},{-3,-6}}, horizontalAlignment=TextAlignment.Right)); connect(sigBusHP, operationalEnvelope.sigBusHP) annotation (Line( - points={{-135,-69},{-11.5,-69},{-11.5,-4.9}}, + points={{-135,-69},{-11.5,-69},{-11.5,-6.59}}, color={255,204,51}, thickness=0.5), Text( string="%first", @@ -133,7 +145,7 @@ equation color={0,0,127}, pattern=LinePattern.Dash)); connect(realPasThrDef.y, onOffController.nSet) annotation (Line( - points={{-75.2,40},{-60,40},{-60,3.63636},{-64.4,3.63636}}, + points={{-75.2,40},{-60,40},{-60,1.63636},{-64.4,1.63636}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(modeSet, defrostControl.modeSet) annotation (Line( @@ -141,13 +153,13 @@ equation color={255,0,255}, pattern=LinePattern.Dash)); connect(defrostControl.nOut, onOffController.nSet) annotation (Line( - points={{-74.2,4},{-74.2,3.63636},{-64.4,3.63636}}, + points={{-74.2,4},{-74.2,1.63636},{-64.4,1.63636}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(defrostControl.modeOut, operationalEnvelope.modeSet) annotation ( Line( - points={{-74.2,-2.66667},{-68,-2.66667},{-68,-32},{-22,-32},{-22,0},{ - -11.6,0}}, + points={{-74.2,-2.66667},{-68,-2.66667},{-68,-32},{-22,-32},{-22,-1.2},{ + -11.6,-1.2}}, color={255,0,255}, pattern=LinePattern.Dash)); connect(modeSet, boolPasThrDef.u) annotation (Line( @@ -155,7 +167,7 @@ equation color={255,0,255}, pattern=LinePattern.Dash)); connect(boolPasThrDef.y, operationalEnvelope.modeSet) annotation (Line( - points={{-75.2,-42},{-22,-42},{-22,0},{-11.6,0}}, + points={{-75.2,-42},{-22,-42},{-22,-1.2},{-11.6,-1.2}}, color={255,0,255}, pattern=LinePattern.Dash)); connect(defrostControl.Pel_deFro, Pel_deFro) annotation (Line( @@ -163,9 +175,11 @@ equation color={0,0,127}, pattern=LinePattern.Dash)); connect(antiFreeze.nSet, operationalEnvelope.nOut) - annotation (Line(points={{22.4,4},{15,4}}, color={0,0,127})); + annotation (Line(points={{22.4,4},{18,4},{18,3.2},{15,3.2}}, + color={0,0,127})); connect(antiFreeze.modeSet, operationalEnvelope.modeOut) - annotation (Line(points={{22.4,0},{15,0}}, color={255,0,255})); + annotation (Line(points={{22.4,0},{18,0},{18,-1.2},{15,-1.2}}, + color={255,0,255})); connect(antiFreeze.nOut, swiErr.u1) annotation (Line(points={{49,4},{54,4},{54, 18},{76,18},{76,8},{84,8}}, color={0,0,127})); connect(antiFreeze.modeOut, modeOut) annotation (Line(points={{49,0},{52,0},{52, @@ -178,4 +192,10 @@ equation index=-1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); + connect(conTru.y, not1.u) annotation (Line(points={{70.6,0},{76,0},{76,-54},{ + -21,-54},{-21,-63}}, color={255,0,255})); + connect(antiFreeze.ERR, ERR_antFre) annotation (Line(points={{36,-9},{36,-50}, + {100,-50},{100,-110}}, color={255,127,0})); + connect(operationalEnvelope.ERR, ERR_opeEnv) annotation (Line(points={{2,-11.1}, + {2,-50},{60,-50},{60,-110}}, color={255,127,0})); end SecurityControl; diff --git a/AixLib/Systems/HeatPumpSystems/BaseClasses/HPSystemController.mo b/AixLib/Systems/HeatPumpSystems/BaseClasses/HPSystemController.mo index f59adb7eaa..2bdeaf67c6 100644 --- a/AixLib/Systems/HeatPumpSystems/BaseClasses/HPSystemController.mo +++ b/AixLib/Systems/HeatPumpSystems/BaseClasses/HPSystemController.mo @@ -186,10 +186,11 @@ model HPSystemController final use_tableData=use_tableData, redeclare final function HeatingCurveFunction = HeatingCurveFunction) annotation (Placement(transformation(extent={{-68,-16},{-30,20}}))); - Fluid.HeatPumps.BaseClasses.PerformanceData.calcCOP calcCOP(final lowBouPel=200) + Fluid.HeatPumps.BaseClasses.PerformanceData.calcCOP calcCOP(final lowBouPel=200) if + use_calcCOP annotation (Placement(transformation(extent={{-46,64},{-20,92}}))); Modelica.Blocks.Sources.RealExpression calcQHeat(y=sigBusHP.m_flow_co*(TSup - - sigBusHP.T_flow_co)*4180) + - sigBusHP.T_flow_co)*4180) if use_calcCOP "Calculates the heat flow added to the source medium" annotation (Placement(transformation(extent={{-90,78},{-66,96}}))); Modelica.Blocks.Routing.RealPassThrough realPasThrSec if not use_sec @@ -228,8 +229,8 @@ model HPSystemController annotation (Placement(transformation(extent={{14,-14},{-14,14}}, rotation=90, origin={-80,-114}))); - Modelica.Blocks.Math.MultiSum multiSum(k={1}, nu=1) - annotation (Placement(transformation(extent={{-72,66},{-60,78}}))); + Modelica.Blocks.Math.MultiSum multiSum(k={1}, nu=1) if use_calcCOP + annotation (Placement(transformation(extent={{-78,64},{-66,76}}))); Fluid.HeatPumps.BaseClasses.PerformanceData.IcingBlock icingBlock(redeclare final function iceFunc = Fluid.HeatPumps.BaseClasses.Functions.IcingFactor.BasicIcingApproach) @@ -242,6 +243,8 @@ model HPSystemController origin={114,80}))); Modelica.Blocks.Sources.Constant const(final k=1) if not use_deFro annotation (Placement(transformation(extent={{44,56},{60,72}}))); + parameter Boolean use_calcCOP=true + "Only relevant for Carnot system simulation"; equation connect(T_oda,hPControls.T_oda) annotation (Line(points={{-114,1.77636e-15}, {-92,1.77636e-15},{-92,2.8},{-71.8,2.8}}, @@ -298,15 +301,15 @@ equation {-38,-40},{80,-40},{80,-114}}, color={0,0,127})); connect(hPControls.y_sou, y_sou) annotation (Line(points={{-61.16,-16},{-62, -16},{-62,-58},{-80,-58},{-80,-114}}, color={0,0,127})); - connect(multiSum.y, calcCOP.Pel) annotation (Line(points={{-58.98,72},{-48,72}, + connect(multiSum.y, calcCOP.Pel) annotation (Line(points={{-64.98,70},{-48,70}, {-48,72.4},{-48.6,72.4}}, color={0,0,127})); connect(securityControl.Pel_deFro, multiSum.u[1]) annotation (Line( - points={{49.6667,20},{54,20},{54,28},{-80,28},{-80,72},{-72,72}}, + points={{49.6667,20},{54,20},{54,26},{-80,26},{-80,70},{-78,70}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(sigBusHP.Pel, multiSum.u[1]) annotation (Line( - points={{-106.925,-52.915},{-80,-52.915},{-80,72},{-72,72}}, + points={{-106.925,-52.915},{-78,-52.915},{-78,70}}, color={255,204,51}, thickness=0.5), Text( string="%first", diff --git a/AixLib/Systems/HeatPumpSystems/BaseClasses/PartialHeatPumpSystem.mo b/AixLib/Systems/HeatPumpSystems/BaseClasses/PartialHeatPumpSystem.mo index b0f5a3cae5..ea46232f55 100644 --- a/AixLib/Systems/HeatPumpSystems/BaseClasses/PartialHeatPumpSystem.mo +++ b/AixLib/Systems/HeatPumpSystems/BaseClasses/PartialHeatPumpSystem.mo @@ -307,7 +307,7 @@ partial model PartialHeatPumpSystem Modelica.Blocks.Interfaces.RealInput T_oda(unit="K") "Outdoor air temperature" - annotation (Placement(transformation(extent={{-132,98},{-102,128}}))); + annotation (Placement(transformation(extent={{-130,104},{-100,134}}))); Fluid.Interfaces.PassThroughMedium mediumPassThroughSin( final allowFlowReversal=allowFlowReversalEva, final m_flow_small=1E-4*abs(mFlow_evaNominal), @@ -354,20 +354,6 @@ partial model PartialHeatPumpSystem extent={{6,-6},{-6,6}}, rotation=180, origin={38,34}))); - Fluid.Sensors.TemperatureTwoPort - senTSup( - final transferHeat=true, - redeclare final package Medium = Medium_con, - final allowFlowReversal=allowFlowReversalCon, - final m_flow_nominal=mFlow_conNominal, - final tauHeaTra=tauHeaTra, - final m_flow_small=1E-4*mFlow_conNominal, - final initType=initType, - final T_start=TCon_start, - final TAmb=TAmbCon_nominal) "Supply temperature" - annotation (Placement(transformation(extent={{-8,-8},{8,8}}, - rotation=0, - origin={78,60}))); HPSystemController hPSystemController( final use_secHeaGen=use_secHeaGen, @@ -405,6 +391,8 @@ partial model PartialHeatPumpSystem final use_runPerHou=use_runPerHou, final maxRunPerHou=5) annotation (Placement(transformation(extent={{-50,98},{48,168}}))); + Modelica.Blocks.Interfaces.RealInput TAct(unit="K") "Outdoor air temperature" + annotation (Placement(transformation(extent={{-130,146},{-100,176}}))); equation connect(pumSin.port_b, heatPump.port_a1) annotation (Line( points={{-62,40},{-62,11.2},{-26,11.2}}, @@ -431,14 +419,6 @@ equation points={{18,11.2},{18,34},{32,34}}, color={0,127,255}, pattern=LinePattern.Dash)); - connect(secHeaGen.port_b, senTSup.port_a) annotation (Line( - points={{48,61},{48,60},{70,60}}, - color={0,127,255}, - pattern=LinePattern.Dash)); - connect(mediumPassThroughSecHeaGen.port_b, senTSup.port_a) annotation (Line( - points={{44,34},{64,34},{64,60},{70,60}}, - color={0,127,255}, - pattern=LinePattern.Dash)); connect(heatPump.port_b2, port_b2) annotation (Line(points={{-26,-15.2},{-60, -15.2},{-60,-60},{-100,-60}}, color={0,127,255})); @@ -450,8 +430,6 @@ equation points={{66,-16},{100,-16},{100,-60}}, color={0,127,255}, pattern=LinePattern.Dash)); - connect(senTSup.port_b, port_b1) - annotation (Line(points={{86,60},{100,60}}, color={0,127,255})); connect(port_a1, pumSin.port_a) annotation (Line( points={{-100,60},{-100,40},{-78,40}}, color={0,127,255}, @@ -462,8 +440,8 @@ equation pattern=LinePattern.Dash)); connect(port_b1, port_b1) annotation (Line(points={{100,60},{104,60},{104,60}, {100,60}}, color={0,127,255})); - connect(T_oda, hPSystemController.T_oda) annotation (Line(points={{-117,113},{ - -90,113},{-90,133},{-56.86,133}}, color={0,0,127})); + connect(T_oda, hPSystemController.T_oda) annotation (Line(points={{-115,119}, + {-90,119},{-90,133},{-56.86,133}},color={0,0,127})); connect(hPSystemController.y_sou, pumSin.y) annotation (Line(points={{-40.2,93.1}, {-40.2,66},{-70,66},{-70,49.6}}, color={0,0,127})); connect(hPSystemController.ySecHeaGen, secHeaGen.u) annotation (Line(points={{ @@ -471,8 +449,16 @@ equation connect(hPSystemController.y_sin, pumSou.y) annotation (Line(points={{38.2,93.1}, {38.2,76},{58,76},{58,-2},{36,-2},{36,-66},{60,-66},{60,-51.6}}, color={0,0,127})); - connect(senTSup.T, hPSystemController.TSup) annotation (Line(points={{78,68.8}, - {80,68.8},{80,176},{-80,176},{-80,147},{-56.86,147}}, color={0,0,127})); + connect(secHeaGen.port_b, port_b1) annotation (Line( + points={{48,61},{82,61},{82,60},{100,60}}, + color={0,127,255}, + pattern=LinePattern.Dash)); + connect(mediumPassThroughSecHeaGen.port_b, port_b1) annotation (Line( + points={{44,34},{82,34},{82,60},{100,60}}, + color={0,127,255}, + pattern=LinePattern.Dash)); + connect(TAct, hPSystemController.TSup) annotation (Line(points={{-115,161},{ + -88.5,161},{-88.5,147},{-56.86,147}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, {100,180}}), graphics={ Rectangle( From 2c924c8889b0a6ed0656993897109890134483fd Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Thu, 11 Oct 2018 17:11:20 +0200 Subject: [PATCH 09/10] Add senTSup to HPSystem Example --- .../Examples/HeatPumpSystem.mo | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/AixLib/Systems/HeatPumpSystems/Examples/HeatPumpSystem.mo b/AixLib/Systems/HeatPumpSystems/Examples/HeatPumpSystem.mo index d023ee6ebf..3484e55759 100644 --- a/AixLib/Systems/HeatPumpSystems/Examples/HeatPumpSystem.mo +++ b/AixLib/Systems/HeatPumpSystems/Examples/HeatPumpSystem.mo @@ -122,11 +122,22 @@ model HeatPumpSystem "Example for a heat pump system" TEva_start=283.15, redeclare model PerDataHea = AixLib.Fluid.HeatPumps.BaseClasses.PerformanceData.LookUpTable2D ( - smoothness=Modelica.Blocks.Types.Smoothness.LinearSegments, dataTable - =AixLib.DataBase.HeatPump.EN255.Vitocal350BWH113(tableP_ele=[0,-5.0, + smoothness=Modelica.Blocks.Types.Smoothness.LinearSegments, dataTable= + AixLib.DataBase.HeatPump.EN255.Vitocal350BWH113(tableP_ele=[0,-5.0, 0.0,5.0,10.0,15.0; 35,3750,3750,3750,3750,3833; 45,4833,4917,4958, 5042,5125; 55,5583,5667,5750,5833,5958; 65,7000,7125,7250,7417,7583]))) annotation (Placement(transformation(extent={{8,-86},{62,-26}}))); + AixLib.Fluid.Sensors.TemperatureTwoPort + senT_a1( + redeclare final package Medium = Medium_sin, + final m_flow_nominal=1, + final transferHeat=true, + final allowFlowReversal=true) + "Temperature at sink inlet" annotation ( + Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=270, + origin={88,-20}))); equation connect(theCon.port_b,vol. heatPort) annotation (Line( points={{58,64},{68,64},{68,44},{86,44}}, @@ -178,21 +189,24 @@ equation connect(sin.ports[1], heatPumpSystem.port_b2) annotation (Line(points={{-28,-90}, {14,-90},{14,-77.4286},{8,-77.4286}}, color={0,127,255})); - connect(heatPumpSystem.port_b1, rad.port_a) annotation (Line(points={{62, - -51.7143},{74,-51.7143},{74,12},{40,12}}, - color={0,127,255})); connect(rad.port_b, preSou.ports[1]) annotation (Line(points={{20,12},{-8,12},{-8,-22}, {-22,-22}}, color={0,127,255})); connect(preSou.ports[2], heatPumpSystem.port_a1) annotation (Line(points={{-22,-26},{-14,-26},{-14,-51.7143},{8,-51.7143}}, color={0,127,255})); connect(weaBus.TDryBul, heatPumpSystem.T_oda) annotation (Line( - points={{-68,64},{-58,64},{-58,-40.3571},{3.41,-40.3571}}, + points={{-68,64},{-58,64},{-58,-39.0714},{3.95,-39.0714}}, color={255,204,51}, thickness=0.5), Text( string="%first", index=-1, extent={{-6,3},{-6,3}})); + connect(senT_a1.port_a, heatPumpSystem.port_b1) annotation (Line(points={{88, + -30},{88,-51.7143},{62,-51.7143}}, color={0,127,255})); + connect(senT_a1.port_b, rad.port_a) annotation (Line(points={{88,-10},{90,-10}, + {90,12},{40,12}}, color={0,127,255})); + connect(senT_a1.T, heatPumpSystem.TAct) annotation (Line(points={{77,-20},{54, + -20},{54,-16},{3.95,-16},{3.95,-30.0714}}, color={0,0,127})); annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120, -120},{120,120}})), experiment(StopTime=3600), From b4ff93ff60f07332d8dde95babe3cb3ae2626fcb Mon Sep 17 00:00:00 2001 From: mlauster Date: Thu, 11 Oct 2018 17:28:07 +0200 Subject: [PATCH 10/10] increases version number for bugfix --- AixLib/package.mo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AixLib/package.mo b/AixLib/package.mo index 53bf8de4e7..bde61f8e09 100644 --- a/AixLib/package.mo +++ b/AixLib/package.mo @@ -16,7 +16,7 @@ package AixLib Modelica_DeviceDrivers(version="1.4.4"), Modelica_Synchronous(version="0.92.1"), NcDataReader2(version="2.4.0")), - version = "0.7.0", + version = "0.7.1", conversion(from( version="0.3.2", script="modelica://AixLib/Resources/Scripts/ConvertAixLib_from_0.3.2_to_0.4.mos", version="0.5.0", script="modelica://AixLib/Resources/Scripts/ConvertAixLib_from_0.5.0_to_0.5.1.mos",