diff --git a/AixLib/Fluid/DistrictHeatingCooling/Demands/OpenLoop/HeatPumpCarnot.mo b/AixLib/Fluid/DistrictHeatingCooling/Demands/OpenLoop/HeatPumpCarnot.mo index 6e08aac203..2e179bc9c7 100644 --- a/AixLib/Fluid/DistrictHeatingCooling/Demands/OpenLoop/HeatPumpCarnot.mo +++ b/AixLib/Fluid/DistrictHeatingCooling/Demands/OpenLoop/HeatPumpCarnot.mo @@ -78,7 +78,7 @@ public extent={{10,10},{-10,-10}}, rotation=180, origin={-90,50}))); - Modelica.Blocks.Math.Gain gain(k=cp_default) + Modelica.Blocks.Math.Gain gain(k(unit="J/(kg.K)")=cp_default, y(unit="J/(kg.K)")) annotation (Placement(transformation(extent={{-32,40},{-12,60}}))); Modelica.Blocks.Math.Division hea2MasFlo annotation (Placement(transformation( extent={{-10,-10},{10,10}}, diff --git a/AixLib/Fluid/DistrictHeatingCooling/Demands/OpenLoop/VarTSupplyDp.mo b/AixLib/Fluid/DistrictHeatingCooling/Demands/OpenLoop/VarTSupplyDp.mo index 050ab1bc9c..40bc9ded68 100644 --- a/AixLib/Fluid/DistrictHeatingCooling/Demands/OpenLoop/VarTSupplyDp.mo +++ b/AixLib/Fluid/DistrictHeatingCooling/Demands/OpenLoop/VarTSupplyDp.mo @@ -61,7 +61,7 @@ public extent={{10,10},{-10,-10}}, rotation=180, origin={-90,46}))); - Modelica.Blocks.Math.Gain gain(k=cp_default) + Modelica.Blocks.Math.Gain gain(k(unit="J/(kg.K)")=cp_default, y(unit="J/(kg.K)")) annotation (Placement(transformation(extent={{-26,54},{-6,74}}))); Modelica.Blocks.Math.Division hea2MasFlo annotation (Placement(transformation( extent={{-10,-10},{10,10}}, diff --git a/AixLib/Fluid/DistrictHeatingCooling/Demands/OpenLoop/VarTSupplyDpBypass.mo b/AixLib/Fluid/DistrictHeatingCooling/Demands/OpenLoop/VarTSupplyDpBypass.mo index e3fa261ac2..e1b44bf712 100644 --- a/AixLib/Fluid/DistrictHeatingCooling/Demands/OpenLoop/VarTSupplyDpBypass.mo +++ b/AixLib/Fluid/DistrictHeatingCooling/Demands/OpenLoop/VarTSupplyDpBypass.mo @@ -64,7 +64,7 @@ public extent={{10,10},{-10,-10}}, rotation=180, origin={-90,46}))); - Modelica.Blocks.Math.Gain gain(k=cp_default) + Modelica.Blocks.Math.Gain gain(k(unit="J/(kg.K)")=cp_default, y(unit="J/(kg.K)")) annotation (Placement(transformation(extent={{-26,54},{-6,74}}))); Modelica.Blocks.Math.Division hea2MasFlo annotation (Placement(transformation( extent={{-10,-10},{10,10}}, diff --git a/AixLib/Fluid/DistrictHeatingCooling/Demands/OpenLoop/VarTSupplyDpFixedTempDifferenceBypass.mo b/AixLib/Fluid/DistrictHeatingCooling/Demands/OpenLoop/VarTSupplyDpFixedTempDifferenceBypass.mo index e08d00d5d3..0b9ee225f1 100644 --- a/AixLib/Fluid/DistrictHeatingCooling/Demands/OpenLoop/VarTSupplyDpFixedTempDifferenceBypass.mo +++ b/AixLib/Fluid/DistrictHeatingCooling/Demands/OpenLoop/VarTSupplyDpFixedTempDifferenceBypass.mo @@ -54,7 +54,7 @@ public annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0, origin={80,0}))); - Modelica.Blocks.Math.Gain gain(k=cp_default) + Modelica.Blocks.Math.Gain gain(k(unit="J/(kg.K)")=cp_default, y(unit="J/(kg.K)")) annotation (Placement(transformation(extent={{-40,104},{-20,124}}))); Modelica.Blocks.Math.Division hea2MasFlo annotation (Placement(transformation( extent={{-10,-10},{10,10}}, diff --git a/AixLib/Fluid/DistrictHeatingCooling/Pipes/DHCPipe.mo b/AixLib/Fluid/DistrictHeatingCooling/Pipes/DHCPipe.mo index 3da3ace663..62680b42ff 100644 --- a/AixLib/Fluid/DistrictHeatingCooling/Pipes/DHCPipe.mo +++ b/AixLib/Fluid/DistrictHeatingCooling/Pipes/DHCPipe.mo @@ -1,6 +1,6 @@ within AixLib.Fluid.DistrictHeatingCooling.Pipes; model DHCPipe "Generic pipe model for DHC applications" - extends AixLib.Fluid.Interfaces.PartialTwoPortVector(show_T=true); + extends AixLib.Fluid.Interfaces.PartialTwoPortInterface(show_T=true); parameter Boolean use_zeta=false "= true HydraulicResistance is implemented, zeta value has to be given next" @@ -177,11 +177,11 @@ model DHCPipe "Generic pipe model for DHC applications" // See also AixLib.Fluid.FixedResistances.Validation.PlugFlowPipes.TransportWaterAir // for why mSenFac is 10 and not 1000, as this gives more reasonable // temperature step response - Fluid.MixingVolumes.MixingVolume vol( + AixLib.Fluid.MixingVolumes.MixingVolume vol( redeclare final package Medium = Medium, final m_flow_nominal=m_flow_nominal, final V=if rho_default > 500 then VEqu else VEqu/1000, - final nPorts=nPorts + 1, + final nPorts=2, final T_start=T_start_out, final energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, final mSenFac = if rho_default > 500 then 1 else 10) @@ -284,11 +284,9 @@ equation der(Q_los) = min(0, pipCor.heatPort.Q_flow); der(Q_gai) = max(0, pipCor.heatPort.Q_flow); - for i in 1:nPorts loop - connect(vol.ports[i + 1], ports_b[i]) - annotation (Line(points={{70,20},{72,20},{72,6},{72,0},{100,0}}, + connect(vol.ports[2], port_b) + annotation (Line(points={{71,20},{72,20},{72,6},{72,0},{100,0}}, color={0,127,255})); - end for; connect(pipCor.port_b, vol.ports[1]) annotation (Line(points={{10,0},{70,0},{70,20}}, color={0,127,255})); diff --git a/AixLib/Fluid/DistrictHeatingCooling/Pipes/Examples/DHCPipe.mo b/AixLib/Fluid/DistrictHeatingCooling/Pipes/Examples/DHCPipe.mo index 93b829a206..4ff557128e 100644 --- a/AixLib/Fluid/DistrictHeatingCooling/Pipes/Examples/DHCPipe.mo +++ b/AixLib/Fluid/DistrictHeatingCooling/Pipes/Examples/DHCPipe.mo @@ -15,11 +15,10 @@ model DHCPipe "Simple example of DHCPipe and its four different modes" nPorts=1, p(displayUnit="Pa") = 101325) "Pressure boundary condition" annotation (Placement(transformation(extent={{72,40},{52,60}}))); - AixLib.Fluid.DistrictHeatingCooling.Pipes.DHCPipe pip( + AixLib.Fluid.DistrictHeatingCooling.Pipes.DHCPipe pip( redeclare package Medium = Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, redeclare BaseClassesStatic.StaticCore pipCor "Static core", - nPorts=1, dh=0.1, length=100, dIns=0.05, @@ -66,11 +65,10 @@ model DHCPipe "Simple example of DHCPipe and its four different modes" nPorts=1, p(displayUnit="Pa") = 101325) "Pressure boundary condition" annotation (Placement(transformation(extent={{72,0},{52,20}}))); - AixLib.Fluid.DistrictHeatingCooling.Pipes.DHCPipe pip1( + AixLib.Fluid.DistrictHeatingCooling.Pipes.DHCPipe pip1( redeclare package Medium = Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, redeclare FixedResistances.BaseClasses.PlugFlowCore pipCor "PlugFlow core", - nPorts=1, dh=0.1, length=100, dIns=0.05, @@ -113,12 +111,11 @@ model DHCPipe "Simple example of DHCPipe and its four different modes" nPorts=1, p(displayUnit="Pa") = 101325) "Pressure boundary condition" annotation (Placement(transformation(extent={{72,-42},{52,-22}}))); - AixLib.Fluid.DistrictHeatingCooling.Pipes.DHCPipe pip2( + AixLib.Fluid.DistrictHeatingCooling.Pipes.DHCPipe pip2( redeclare package Medium = Medium, use_soil=true, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, redeclare FixedResistances.BaseClasses.PlugFlowCore pipCor "PlugFlow core", - nPorts=1, dh=0.1, length=100, dIns=0.05, @@ -161,12 +158,11 @@ model DHCPipe "Simple example of DHCPipe and its four different modes" nPorts=1, p(displayUnit="Pa") = 101325) "Pressure boundary condition" annotation (Placement(transformation(extent={{72,-80},{52,-60}}))); - AixLib.Fluid.DistrictHeatingCooling.Pipes.DHCPipe pip3( + AixLib.Fluid.DistrictHeatingCooling.Pipes.DHCPipe pip3( redeclare package Medium = Medium, sum_zetas=2.5, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, redeclare FixedResistances.BaseClasses.PlugFlowCore pipCor "PlugFlow core", - nPorts=1, dh=0.1, length=100, dIns=0.05, @@ -203,7 +199,7 @@ equation connect(Tin.y, sou.T_in) annotation (Line(points={{-79,54},{-72,54}}, color={0,0,127})); - connect(pip.ports_b[1], senTemOut.port_a) + connect(pip.port_b, senTemOut.port_a) annotation (Line(points={{10,50},{20,50}}, color={0,127,255})); connect(senTemOut.port_b, sin.ports[1]) @@ -219,7 +215,7 @@ equation annotation (Line(points={{-80,90},{0,90},{0,20}}, color={191,0,0})); connect(Tin1.y, sou1.T_in) annotation (Line(points={{-79,14},{-72,14}}, color={0,0,127})); - connect(pip1.ports_b[1], senTemOut1.port_a) + connect(pip1.port_b, senTemOut1.port_a) annotation (Line(points={{10,10},{20,10}}, color={0,127,255})); connect(senTemOut1.port_b, sin1.ports[1]) annotation (Line(points={{40,10},{52,10}}, color={0,127,255})); @@ -231,7 +227,7 @@ equation annotation (Line(points={{-80,90},{0,90},{0,-22}}, color={191,0,0})); connect(Tin2.y, sou2.T_in) annotation (Line(points={{-79,-28},{-72,-28}}, color={0,0,127})); - connect(pip2.ports_b[1], senTemOut2.port_a) + connect(pip2.port_b, senTemOut2.port_a) annotation (Line(points={{10,-32},{20,-32}}, color={0,127,255})); connect(senTemOut2.port_b, sin2.ports[1]) annotation (Line(points={{40,-32},{52,-32}}, color={0,127,255})); @@ -243,7 +239,7 @@ equation annotation (Line(points={{-80,90},{0,90},{0,-60}}, color={191,0,0})); connect(Tin3.y, sou3.T_in) annotation (Line(points={{-79,-66},{-72,-66}}, color={0,0,127})); - connect(pip3.ports_b[1], senTemOut3.port_a) + connect(pip3.port_b, senTemOut3.port_a) annotation (Line(points={{10,-70},{20,-70}}, color={0,127,255})); connect(senTemOut3.port_b, sin3.ports[1]) annotation (Line(points={{40,-70},{52,-70}}, color={0,127,255})); diff --git a/AixLib/Fluid/DistrictHeatingCooling/Pipes/Examples/PlugFlowPipeEmbedded.mo b/AixLib/Fluid/DistrictHeatingCooling/Pipes/Examples/PlugFlowPipeEmbedded.mo index abb939f6e8..a9e75adf96 100644 --- a/AixLib/Fluid/DistrictHeatingCooling/Pipes/Examples/PlugFlowPipeEmbedded.mo +++ b/AixLib/Fluid/DistrictHeatingCooling/Pipes/Examples/PlugFlowPipeEmbedded.mo @@ -19,7 +19,6 @@ model PlugFlowPipeEmbedded "Simple example of PlugFlowPipeEmbedded" pip( redeclare package Medium = Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyStateInitial, - nPorts=1, dh=0.1, length=100, dIns=0.05, @@ -60,7 +59,7 @@ equation color={191,0,0})); connect(Tin.y, sou.T_in) annotation (Line(points={{-71,4},{-62,4}}, color={0,0,127})); - connect(pip.ports_b[1], senTemOut.port_a) + connect(pip.port_b, senTemOut.port_a) annotation (Line(points={{20,0},{30,0}}, color={0,127,255})); connect(senTemOut.port_b, sin.ports[1]) annotation (Line(points={{50,0},{62,0}}, color={0,127,255})); diff --git a/AixLib/Fluid/DistrictHeatingCooling/Pipes/Examples/PlugFlowPipeZeta.mo b/AixLib/Fluid/DistrictHeatingCooling/Pipes/Examples/PlugFlowPipeZeta.mo index 581ef000c5..6a3d0babab 100644 --- a/AixLib/Fluid/DistrictHeatingCooling/Pipes/Examples/PlugFlowPipeZeta.mo +++ b/AixLib/Fluid/DistrictHeatingCooling/Pipes/Examples/PlugFlowPipeZeta.mo @@ -17,7 +17,6 @@ model PlugFlowPipeZeta "Simple example of PlugFlowPipe" annotation (Placement(transformation(extent={{82,-10},{62,10}}))); AixLib.Fluid.DistrictHeatingCooling.Pipes.PlugFlowPipeZeta pip( redeclare package Medium = Medium, - nPorts=1, dh=0.1, length=100, dIns=0.05, @@ -57,7 +56,7 @@ equation annotation (Line(points={{-20,70},{10,70},{10,10}}, color={191,0,0})); connect(Tin.y, sou.T_in) annotation (Line(points={{-71,4},{-62,4}}, color={0,0,127})); - connect(pip.ports_b[1], senTemOut.port_a) + connect(pip.port_b, senTemOut.port_a) annotation (Line(points={{20,0},{30,0}}, color={0,127,255})); connect(senTemOut.port_b, sin.ports[1]) annotation (Line(points={{50,0},{62,0}}, color={0,127,255})); diff --git a/AixLib/Fluid/DistrictHeatingCooling/Pipes/Examples/StaticPipe.mo b/AixLib/Fluid/DistrictHeatingCooling/Pipes/Examples/StaticPipe.mo index e274ce4d09..2ba6eae122 100644 --- a/AixLib/Fluid/DistrictHeatingCooling/Pipes/Examples/StaticPipe.mo +++ b/AixLib/Fluid/DistrictHeatingCooling/Pipes/Examples/StaticPipe.mo @@ -17,7 +17,6 @@ model StaticPipe "Simple example of StaticPipe" annotation (Placement(transformation(extent={{82,-10},{62,10}}))); AixLib.Fluid.DistrictHeatingCooling.Pipes.StaticPipe pip( redeclare package Medium = Medium, - nPorts=1, dh=0.1, length=100, dIns=0.05, @@ -57,7 +56,7 @@ equation annotation (Line(points={{-20,70},{10,70},{10,10}}, color={191,0,0})); connect(Tin.y, sou.T_in) annotation (Line(points={{-71,4},{-62,4}}, color={0,0,127})); - connect(pip.ports_b[1], senTemOut.port_a) + connect(pip.port_b, senTemOut.port_a) annotation (Line(points={{20,0},{30,0}}, color={0,127,255})); connect(senTemOut.port_b, sin.ports[1]) annotation (Line(points={{50,0},{62,0}}, color={0,127,255})); diff --git a/AixLib/Fluid/DistrictHeatingCooling/Pipes/PlugFlowPipeEmbedded.mo b/AixLib/Fluid/DistrictHeatingCooling/Pipes/PlugFlowPipeEmbedded.mo index 51b9f7f8c4..a5d95414c5 100644 --- a/AixLib/Fluid/DistrictHeatingCooling/Pipes/PlugFlowPipeEmbedded.mo +++ b/AixLib/Fluid/DistrictHeatingCooling/Pipes/PlugFlowPipeEmbedded.mo @@ -2,7 +2,7 @@ model PlugFlowPipeEmbedded "Embedded pipe model using spatialDistribution for temperature delay" - extends AixLib.Fluid.Interfaces.PartialTwoPortVector(show_T=true); + extends AixLib.Fluid.Interfaces.PartialTwoPortInterface(show_T=true); parameter Modelica.Fluid.Types.Dynamics energyDynamics=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial "Type of energy balance: dynamic (3 initialization options) or steady state" @@ -61,11 +61,11 @@ model PlugFlowPipeEmbedded parameter Modelica.Units.SI.Length thickness=0.0035 "Pipe wall thickness" annotation (Dialog(group="Material")); - parameter Modelica.Units.SI.Temperature T_start_in(start=Medium.T_default) = + parameter Modelica.Units.SI.Temperature T_start_in(start=Medium.T_default)= Medium.T_default "Initialization temperature at pipe inlet" annotation (Dialog(tab="Initialization")); - parameter Modelica.Units.SI.Temperature T_start_out(start=Medium.T_default) - = T_start_in "Initialization temperature at pipe outlet" + parameter Modelica.Units.SI.Temperature T_start_out(start=Medium.T_default)= + T_start_in "Initialization temperature at pipe outlet" annotation (Dialog(tab="Initialization")); parameter Boolean initDelay(start=false) = false "Initialize delay for a constant mass flow rate if true, otherwise start from 0" @@ -135,7 +135,6 @@ model PlugFlowPipeEmbedded final R=R, final fac=fac, final sum_zetas=sum_zetas, - nPorts=nPorts, final use_zeta=true) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); @@ -215,7 +214,7 @@ equation annotation (Line(points={{0,90.8},{0,104}}, color={191,0,0})); connect(port_a, plugFlowPipeZeta.port_a) annotation (Line(points={{-100,0},{-10,0}}, color={0,127,255})); - connect(plugFlowPipeZeta.ports_b, ports_b) annotation (Line(points={{10,0},{56, + connect(plugFlowPipeZeta.port_b, port_b) annotation (Line(points={{10,0},{56, 0},{56,0},{100,0}}, color={0,127,255})); annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ Rectangle( diff --git a/AixLib/Fluid/DistrictHeatingCooling/Pipes/PlugFlowPipeZeta.mo b/AixLib/Fluid/DistrictHeatingCooling/Pipes/PlugFlowPipeZeta.mo index 534405568f..b2398e1204 100644 --- a/AixLib/Fluid/DistrictHeatingCooling/Pipes/PlugFlowPipeZeta.mo +++ b/AixLib/Fluid/DistrictHeatingCooling/Pipes/PlugFlowPipeZeta.mo @@ -1,7 +1,7 @@ within AixLib.Fluid.DistrictHeatingCooling.Pipes; model PlugFlowPipeZeta "Pipe model using spatialDistribution for temperature delay and conditional HydraulicResistance" - extends AixLib.Fluid.Interfaces.PartialTwoPortVector(show_T=true); + extends AixLib.Fluid.Interfaces.PartialTwoPortInterface(show_T=true); parameter Boolean use_zeta=false "= true HydraulicResistance is implemented, zeta value has to be given next" @@ -56,11 +56,11 @@ model PlugFlowPipeZeta parameter Modelica.Units.SI.Length thickness=0.0035 "Pipe wall thickness" annotation (Dialog(group="Material")); - parameter Modelica.Units.SI.Temperature T_start_in(start=Medium.T_default) = + parameter Modelica.Units.SI.Temperature T_start_in(start=Medium.T_default)= Medium.T_default "Initialization temperature at pipe inlet" annotation (Dialog(tab="Initialization")); - parameter Modelica.Units.SI.Temperature T_start_out(start=Medium.T_default) - = T_start_in "Initialization temperature at pipe outlet" + parameter Modelica.Units.SI.Temperature T_start_out(start=Medium.T_default)= + T_start_in "Initialization temperature at pipe outlet" annotation (Dialog(tab="Initialization")); parameter Boolean initDelay(start=false) = false "Initialize delay for a constant mass flow rate if true, otherwise start from 0" @@ -128,7 +128,7 @@ model PlugFlowPipeZeta redeclare final package Medium = Medium, final m_flow_nominal=m_flow_nominal, final V=if rho_default > 500 then VEqu else VEqu/1000, - final nPorts=nPorts + 1, + final nPorts=2, final T_start=T_start_out, final energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, final mSenFac = if rho_default > 500 then 1 else 10) @@ -178,16 +178,14 @@ equation //calculation of the flow velocity of medium in the pipes v_med = (4 * port_a.m_flow) / (Modelica.Constants.pi * rho_default * dh * dh); - for i in 1:nPorts loop - connect(vol.ports[i + 1], ports_b[i]) - annotation (Line(points={{70,20},{72,20},{72,6},{72,0},{100,0}}, + connect(vol.ports[2], port_b) + annotation (Line(points={{71,20},{72,20},{72,6},{72,0},{100,0}}, color={0,127,255})); - end for; connect(plugFlowCore.heatPort, heatPort) annotation (Line(points={{0,10},{0,10},{0,100}}, color={191,0,0})); connect(plugFlowCore.port_b, vol.ports[1]) - annotation (Line(points={{10,0},{70,0},{70,20}}, color={0,127,255})); + annotation (Line(points={{10,0},{69,0},{69,20}}, color={0,127,255})); if use_zeta then connect(hydraulicResistance.port_b, plugFlowCore.port_a) annotation (Line(points={{-40,20},{-20,20},{-20,0},{-10,0}}, diff --git a/AixLib/Fluid/DistrictHeatingCooling/Pipes/StaticPipe.mo b/AixLib/Fluid/DistrictHeatingCooling/Pipes/StaticPipe.mo index 09ae7f1ff5..5986218d4d 100644 --- a/AixLib/Fluid/DistrictHeatingCooling/Pipes/StaticPipe.mo +++ b/AixLib/Fluid/DistrictHeatingCooling/Pipes/StaticPipe.mo @@ -1,7 +1,7 @@ within AixLib.Fluid.DistrictHeatingCooling.Pipes; model StaticPipe "Static Pipe model using conditional HydraulicResistance" - extends AixLib.Fluid.Interfaces.PartialTwoPortVector(show_T=true); + extends AixLib.Fluid.Interfaces.PartialTwoPortInterface(show_T=true); parameter Boolean use_zeta=false "= true HydraulicResistance is implemented, zeta value has to be given next" @@ -56,11 +56,11 @@ model StaticPipe parameter Modelica.Units.SI.Length thickness=0.0035 "Pipe wall thickness" annotation (Dialog(group="Material")); - parameter Modelica.Units.SI.Temperature T_start_in(start=Medium.T_default) = + parameter Modelica.Units.SI.Temperature T_start_in(start=Medium.T_default)= Medium.T_default "Initialization temperature at pipe inlet" annotation (Dialog(tab="Initialization")); - parameter Modelica.Units.SI.Temperature T_start_out(start=Medium.T_default) - = T_start_in "Initialization temperature at pipe outlet" + parameter Modelica.Units.SI.Temperature T_start_out(start=Medium.T_default)= + T_start_in "Initialization temperature at pipe outlet" annotation (Dialog(tab="Initialization")); parameter Boolean initDelay(start=false) = false "Initialize delay for a constant mass flow rate if true, otherwise start from 0" @@ -129,7 +129,7 @@ model StaticPipe redeclare final package Medium = Medium, final m_flow_nominal=m_flow_nominal, final V=if rho_default > 500 then VEqu else VEqu/1000, - final nPorts=nPorts + 1, + final nPorts=2, final T_start=T_start_out, final energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, final mSenFac = if rho_default > 500 then 1 else 10) @@ -179,16 +179,14 @@ equation //calculation of the flow velocity of medium in the pipes v_med = (4 * port_a.m_flow) / (Modelica.Constants.pi * rho_default * dh * dh); - for i in 1:nPorts loop - connect(vol.ports[i + 1], ports_b[i]) - annotation (Line(points={{70,20},{72,20},{72,6},{72,0},{100,0}}, + connect(vol.ports[2], port_b) + annotation (Line(points={{71,20},{72,20},{72,6},{72,0},{100,0}}, color={0,127,255})); - end for; connect(staticCore.heatPort, heatPort) annotation (Line(points={{0,10},{0,10},{0,100}}, color={191,0,0})); connect(staticCore.port_b, vol.ports[1]) - annotation (Line(points={{10,0},{70,0},{70,20}}, color={0,127,255})); + annotation (Line(points={{10,0},{69,0},{69,20}}, color={0,127,255})); //Connect hydraulicResistance if use_zeta then connect(hydraulicResistance.port_b, staticCore.port_a) diff --git a/AixLib/Fluid/HeatExchangers/Examples/HeatingRod.mo b/AixLib/Fluid/HeatExchangers/Examples/HeatingRod.mo index 0aad8d9791..968043fcd2 100644 --- a/AixLib/Fluid/HeatExchangers/Examples/HeatingRod.mo +++ b/AixLib/Fluid/HeatExchangers/Examples/HeatingRod.mo @@ -3,7 +3,7 @@ model HeatingRod "Example for the usage of the heating rod model" extends Modelica.Icons.Example; extends AixLib.Fluid.HeatExchangers.Examples.BaseClasses.Heater( redeclare package Medium = AixLib.Media.Water, - m_flow_nominal=V*heatingRod.rho_default/3600, + m_flow_nominal=V*rhoWat/3600, Q_flow_nominal=100, conPI(k=10), vol(V=V/1000), @@ -23,6 +23,10 @@ model HeatingRod "Example for the usage of the heating rod model" Modelica.Blocks.Interfaces.RealOutput Pel "Electrical power used to provide current heat flow" annotation (Placement(transformation(extent={{120,-70},{140,-50}}))); + +protected + parameter Modelica.Units.SI.Density rhoWat=1000 "Density of water"; + equation connect(mov.port_b, heatingRod.port_a) annotation (Line(points={{-50,-40},{-30,-40}}, color={0,127,255})); diff --git a/AixLib/Fluid/Humidifiers/GenericHumidifier_u.mo b/AixLib/Fluid/Humidifiers/GenericHumidifier_u.mo index 8d7deeb678..524f4f526f 100644 --- a/AixLib/Fluid/Humidifiers/GenericHumidifier_u.mo +++ b/AixLib/Fluid/Humidifiers/GenericHumidifier_u.mo @@ -37,7 +37,7 @@ model GenericHumidifier_u extent={{100,90},{120,110}}), iconTransformation(extent={{100,90},{120, 110}}))); Modelica.Blocks.Sources.RealExpression steamEnthalpyFlow(y= - Medium.enthalpyOfCondensingGas(T=Tsteam.y)*mWat_flow) if steamHumidifier + Medium.enthalpyOfCondensingGas(T=Tsteam_intern)*mWat_flow) if steamHumidifier annotation (Placement(transformation(extent={{-100,-50},{-80,-30}}))); Modelica.Blocks.Sources.RealExpression waterEnthalpyFlow(y=Medium.enthalpyOfLiquid(T=TLiqWat_in)*mWat_flow) annotation (Placement(transformation(extent={{-100,-70},{-80,-50}}))); Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow prescribedHeatFlow @@ -49,27 +49,28 @@ model GenericHumidifier_u annotation (Placement(transformation(extent={{-100,-104},{-80,-84}}))); Modelica.Blocks.Routing.RealPassThrough Tsteam if steamHumidifier annotation (Placement(transformation(extent={{-60,-98},{-40,-78}}))); - + Modelica.Blocks.Sources.RealExpression realExpression(y = mWat_flow_nominal) annotation( + Placement(visible = true, transformation(origin = {-62, 32}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Math.Product product annotation( + Placement(visible = true, transformation(origin = {-20, 60}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); protected + Modelica.Blocks.Interfaces.RealInput Tsteam_intern; Modelica.Blocks.Nonlinear.Limiter limiter(uMax=1, uMin=0) annotation (Placement(transformation(extent={{-90,50},{-70,70}}))); - Modelica.Blocks.Math.Gain gai(final k=mWat_flow_nominal) "Gain" - annotation (Placement(transformation(extent={{-58,50},{-38,70}}))); - Modelica.Blocks.Math.Add add(k2=-1) if steamHumidifier annotation (Placement(transformation(extent={{20,-60},{40,-40}}))); equation - connect(gai.y, vol.mWat_flow) annotation (Line( - points={{-37,60},{-30,60},{-30,-18},{-11,-18}}, - color={0,0,127})); + if not steamHumidifier then + Tsteam_intern = 273.15; + end if; - connect(gai.y, mWat_flow) - annotation (Line(points={{-37,60},{110,60}}, color={0,0,127})); + connect(Tsteam.y, Tsteam_intern); + connect(product.y, vol.mWat_flow) annotation (Line( + points={{-9,60},{-30,60},{-30,-18},{-11,-18}}, + color={0,0,127})); connect(u, limiter.u) annotation (Line(points={{-120,60},{-92,60}}, color={0,0,127})); - connect(limiter.y, gai.u) - annotation (Line(points={{-69,60},{-60,60}}, color={0,0,127})); connect(prescribedHeatFlow.port, vol.heatPort) annotation (Line(points={{-20,-40}, {-20,-10},{-9,-10}}, color={191,0,0})); @@ -99,142 +100,42 @@ equation points={{-79,-94},{-72,-94},{-72,-88},{-62,-88}}, color={0,0,127}, pattern=LinePattern.Dash)); + connect(limiter.y, product.u1) annotation ( + Line(points={{-69,60},{-48,60},{-48,66},{-32,66}}, color = {0, 0, 127})); + connect(realExpression.y, product.u2) annotation ( + Line(points={{-51,32},{-40,32},{-40,54},{-32,54}}, color = {0, 0, 127})); + connect(product.y, mWat_flow) annotation ( + Line(points = {{-9, 60}, {110, 60}}, color = {0, 0, 127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, - -100},{100,100}}), graphics={ - Text( - extent={{-52,-60},{58,-120}}, - textString="m=%m_flow_nominal", - pattern=LinePattern.None, - lineColor={0,0,127}), - Rectangle( - extent={{-100,61},{-70,58}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={0,0,127}, - fillPattern=FillPattern.Solid), - Text( - extent={{-118,104},{-74,76}}, - lineColor={0,0,127}, - textString="u"), - Rectangle( - extent={{-100,5},{101,-5}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={0,0,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-70,60},{70,-60}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={95,95,95}, - fillPattern=FillPattern.Solid), - Polygon( - points={{42,42},{54,34},{54,34},{42,28},{42,30},{50,34},{50,34},{42, - 40},{42,42}}, - lineColor={255,255,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{58,-54},{54,52}}, - lineColor={255,255,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{70,61},{100,58}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={0,0,127}, - fillPattern=FillPattern.Solid), - Text( - extent={{32,98},{98,44}}, - lineColor={0,0,127}, - textString="mWat_flow"), - Polygon( - points={{42,10},{54,2},{54,2},{42,-4},{42,-2},{50,2},{50,2},{42,8},{ - 42,10}}, - lineColor={255,255,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Polygon( - points={{42,-26},{54,-34},{54,-34},{42,-40},{42,-38},{50,-34},{50,-34}, - {42,-28},{42,-26}}, - lineColor={255,255,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Text(extent={{30,130},{96,76}}, - lineColor={0,0,127}, - textString="powerEva", - visible=steamHumidifier), - Ellipse(visible=steamHumidifier, - extent={{-14,44},{10,30}}, - lineColor={28,108,200}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Ellipse(visible=steamHumidifier, - extent={{24,38},{34,32}}, - lineColor={28,108,200}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Ellipse(visible=steamHumidifier, - extent={{26,30},{8,42}}, - lineColor={28,108,200}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Ellipse(visible=steamHumidifier, - extent={{-28,12},{-4,-2}}, - lineColor={28,108,200}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Ellipse(visible=steamHumidifier, - extent={{12,-2},{-6,10}}, - lineColor={28,108,200}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Ellipse(visible=steamHumidifier, - extent={{10,6},{20,0}}, - lineColor={28,108,200}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Ellipse(visible=steamHumidifier, - extent={{-12,-24},{12,-38}}, - lineColor={28,108,200}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Ellipse(visible=steamHumidifier, - extent={{28,-38},{10,-26}}, - lineColor={28,108,200}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Ellipse(visible=steamHumidifier, - extent={{26,-30},{36,-36}}, - lineColor={28,108,200}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Line(visible=not steamHumidifier, - points={{28,40},{14,40}}, color={28, - 108,200}, - thickness=0.5), - Line(visible=not steamHumidifier,points={{-6,36},{-20,30}},color={28, - 108,200}, - thickness=0.5), - Line(visible=not steamHumidifier,points={{30,4},{16,6}}, color={28, - 108,200}, - thickness=0.5), - Line(visible=not steamHumidifier,points={{0,4},{-14,-2}}, color={28, - 108,200}, - thickness=0.5), - Line(visible=not steamHumidifier,points={{30,-32},{16,-30}}, color={28, - 108,200}, - thickness=0.5), - Line(visible=not steamHumidifier,points={{0,-34},{-14,-40}}, color={28, - 108,200}, - thickness=0.5), - Line(visible=not steamHumidifier,points={{-32,-24},{-42,-38}},color={28, - 108,200}, - thickness=0.5), - Line(visible=not steamHumidifier,points={{-32,10},{-42,-4}}, color={28, - 108,200}, - thickness=0.5)}), + -100},{100,100}}), graphics={Text(lineColor = {0, 0, 127}, extent = {{-52, -60}, {58, -120}}, textString = "m=%m_flow_nominal"), + Rectangle(lineColor = {0, 0, 255}, fillColor = {0, 0, 127}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, 61}, {-70, 58}}), + Text(lineColor = {0, 0, 127}, extent = {{-118, 104}, {-74, 76}}, textString = "u"), + Rectangle(lineColor = {0, 0, 255}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, 5}, {101, -5}}), + Rectangle(lineColor = {0, 0, 255}, fillColor = {95, 95, 95}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-70, 60}, {70, -60}}), + Polygon(lineColor = {255, 255, 255}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, points = {{42, 42}, {54, 34}, {54, 34}, {42, 28}, {42, 30}, {50, 34}, {50, 34}, {42, 40}, {42, 42}}), + Rectangle(lineColor = {255, 255, 255}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{58, -54}, {54, 52}}), + Rectangle(lineColor = {0, 0, 255}, fillColor = {0, 0, 127}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{70, 61}, {100, 58}}), + Text(lineColor = {0, 0, 127}, extent = {{32, 98}, {98, 44}}, textString = "mWat_flow"), + Polygon(lineColor = {255, 255, 255}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, points = {{42, 10}, {54, 2}, {54, 2}, {42, -4}, {42, -2}, {50, 2}, {50, 2}, {42, 8}, {42, 10}}), + Polygon(lineColor = {255, 255, 255}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, points = {{42, -26}, {54, -34}, {54, -34}, {42, -40}, {42, -38}, {50, -34}, {50, -34}, {42, -28}, {42, -26}}), + Text(lineColor = {0, 0, 127}, extent = {{30, 130}, {96, 76}}, textString = "powerEva"), + Ellipse(lineColor = {28, 108, 200}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-14, 44}, {10, 30}}), + Ellipse(lineColor = {28, 108, 200}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{24, 38}, {34, 32}}), + Ellipse(lineColor = {28, 108, 200}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{26, 30}, {8, 42}}), + Ellipse(lineColor = {28, 108, 200}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-28, 12}, {-4, -2}}), + Ellipse(lineColor = {28, 108, 200}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{12, -2}, {-6, 10}}), + Ellipse(lineColor = {28, 108, 200}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{10, 6}, {20, 0}}), + Ellipse(lineColor = {28, 108, 200}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-12, -24}, {12, -38}}), + Ellipse(lineColor = {28, 108, 200}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{28, -38}, {10, -26}}), + Ellipse(lineColor = {28, 108, 200}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{26, -30}, {36, -36}}), + Line(visible = false, points = {{28, 40}, {14, 40}}, color = {28, 108, 200}, thickness = 0.5), + Line(visible = false, points = {{-6, 36}, {-20, 30}}, color = {28, 108, 200}, thickness = 0.5), + Line(visible = false, points = {{30, 4}, {16, 6}}, color = {28, 108, 200}, thickness = 0.5), + Line(visible = false, points = {{0, 4}, {-14, -2}}, color = {28, 108, 200}, thickness = 0.5), + Line(visible = false, points = {{30, -32}, {16, -30}}, color = {28, 108, 200}, thickness = 0.5), + Line(visible = false, points = {{0, -34}, {-14, -40}}, color = {28, 108, 200}, thickness = 0.5), + Line(visible = false, points = {{-32, -24}, {-42, -38}}, color = {28, 108, 200}, thickness = 0.5), + Line(visible = false, points = {{-32, 10}, {-42, -4}}, color = {28, 108, 200}, thickness = 0.5)}), defaultComponentName="hum", Documentation(info="

Model for an air humidifier. @@ -264,6 +165,9 @@ Documentation(info="

", revisions="