From a1cf104860eb3f822e9b1fdae6c1d96aacd64dce Mon Sep 17 00:00:00 2001 From: marcusfuchs Date: Thu, 12 Jun 2014 16:35:24 +0200 Subject: [PATCH 01/14] Change energy balances FlowMachine_y Dynamics with free initial values lead to default start values, which is to be avoided. Therefore this is changed to fixed initial dynamics. #31 --- Annex60/Fluid/Movers/Examples/FlowMachine_y.mo | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Annex60/Fluid/Movers/Examples/FlowMachine_y.mo b/Annex60/Fluid/Movers/Examples/FlowMachine_y.mo index b5255e94b6..f73c97edf8 100644 --- a/Annex60/Fluid/Movers/Examples/FlowMachine_y.mo +++ b/Annex60/Fluid/Movers/Examples/FlowMachine_y.mo @@ -8,12 +8,14 @@ model FlowMachine_y redeclare package Medium = Medium, pressure(V_flow={0,m_flow_nominal,2*m_flow_nominal}/1.2, dp={2*dp_nominal,dp_nominal,0}), - filteredSpeed=false), + filteredSpeed=false, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial), redeclare Annex60.Fluid.Movers.FlowMachine_y floMacDyn( redeclare package Medium = Medium, pressure(V_flow={0,m_flow_nominal,2*m_flow_nominal}/1.2, dp={2*dp_nominal,dp_nominal,0}), - filteredSpeed=false)); + filteredSpeed=false, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)); equation connect(gain.y, floMacDyn.y) annotation (Line( From 28b8f6db2b43994342cda703a7309a9f86160523 Mon Sep 17 00:00:00 2001 From: marcusfuchs Date: Thu, 12 Jun 2014 16:41:53 +0200 Subject: [PATCH 02/14] Change energy balances in FlowMachine_dp To avoid the use of default start values, the energy balances of the flow machines have been set to fixed initial. #31 --- Annex60/Fluid/Movers/Examples/FlowMachine_dp.mo | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Annex60/Fluid/Movers/Examples/FlowMachine_dp.mo b/Annex60/Fluid/Movers/Examples/FlowMachine_dp.mo index 7c038a0fe7..b6662b2891 100644 --- a/Annex60/Fluid/Movers/Examples/FlowMachine_dp.mo +++ b/Annex60/Fluid/Movers/Examples/FlowMachine_dp.mo @@ -6,11 +6,13 @@ model FlowMachine_dp "Fan with zero mass flow rate and head as input" redeclare Annex60.Fluid.Movers.FlowMachine_dp floMacSta( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, - filteredSpeed=false), + filteredSpeed=false, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial), redeclare Annex60.Fluid.Movers.FlowMachine_dp floMacDyn( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, - filteredSpeed=false)); + filteredSpeed=false, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)); equation connect(gain.y, floMacSta.dp_in) annotation (Line( From f9aaa17d885bec797bb5a20d993bbc164f4cd2f4 Mon Sep 17 00:00:00 2001 From: marcusfuchs Date: Thu, 12 Jun 2014 16:44:24 +0200 Subject: [PATCH 03/14] Change energy balances in FlowMachines_m_flow To avoid the use of default start values, the energy balances have been set to fixed initial. #31 --- Annex60/Fluid/Movers/Examples/FlowMachine_m_flow.mo | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Annex60/Fluid/Movers/Examples/FlowMachine_m_flow.mo b/Annex60/Fluid/Movers/Examples/FlowMachine_m_flow.mo index c6b737b9b6..5010d6cd18 100644 --- a/Annex60/Fluid/Movers/Examples/FlowMachine_m_flow.mo +++ b/Annex60/Fluid/Movers/Examples/FlowMachine_m_flow.mo @@ -7,11 +7,13 @@ model FlowMachine_m_flow redeclare Annex60.Fluid.Movers.FlowMachine_m_flow floMacSta( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, - filteredSpeed=false), + filteredSpeed=false, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial), redeclare Annex60.Fluid.Movers.FlowMachine_m_flow floMacDyn( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, - filteredSpeed=false)); + filteredSpeed=false, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)); equation connect(gain.y, floMacSta.m_flow_in) annotation (Line( From 3fa3b5a45e7b5bdbba41bfd7c2c797739978e769 Mon Sep 17 00:00:00 2001 From: marcusfuchs Date: Thu, 12 Jun 2014 16:46:12 +0200 Subject: [PATCH 04/14] Change energy balances in FlowMachine_Nrpm To avoid the use of default start values, the energy balances have been set to fixed initial. #31 --- Annex60/Fluid/Movers/Examples/FlowMachine_Nrpm.mo | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Annex60/Fluid/Movers/Examples/FlowMachine_Nrpm.mo b/Annex60/Fluid/Movers/Examples/FlowMachine_Nrpm.mo index d1a9ab5083..22f480c1ce 100644 --- a/Annex60/Fluid/Movers/Examples/FlowMachine_Nrpm.mo +++ b/Annex60/Fluid/Movers/Examples/FlowMachine_Nrpm.mo @@ -7,12 +7,14 @@ model FlowMachine_Nrpm "Fan with zero mass flow rate and speed as input" redeclare package Medium = Medium, pressure(V_flow={0,m_flow_nominal,2*m_flow_nominal}/1.2, dp={2*dp_nominal,dp_nominal,0}), - filteredSpeed=false), + filteredSpeed=false, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial), redeclare Annex60.Fluid.Movers.FlowMachine_Nrpm floMacDyn( redeclare package Medium = Medium, pressure(V_flow={0,m_flow_nominal,2*m_flow_nominal}/1.2, dp={2*dp_nominal,dp_nominal,0}), - filteredSpeed=false)); + filteredSpeed=false, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)); equation connect(gain.y, floMacSta.Nrpm) annotation (Line( From 597fb5072ed71f83125931e67ae84ae64b654035 Mon Sep 17 00:00:00 2001 From: marcusfuchs Date: Thu, 12 Jun 2014 16:53:03 +0200 Subject: [PATCH 05/14] Change energy balance in MassFraction example To avoid the use of default start values, the energy balance has been set to fixed initial. #31 --- Annex60/Fluid/Sensors/Examples/MassFraction.mo | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Annex60/Fluid/Sensors/Examples/MassFraction.mo b/Annex60/Fluid/Sensors/Examples/MassFraction.mo index 10213bac12..292d036ddf 100644 --- a/Annex60/Fluid/Sensors/Examples/MassFraction.mo +++ b/Annex60/Fluid/Sensors/Examples/MassFraction.mo @@ -2,8 +2,7 @@ within Annex60.Fluid.Sensors.Examples; model MassFraction "Test model for the mass fraction sensor" extends Modelica.Icons.Example; - package Medium = Annex60.Media.Air - "Medium model"; + package Medium = Annex60.Media.Air "Medium model"; Annex60.Fluid.Sources.Boundary_pT sin( redeclare package Medium = Medium, @@ -27,7 +26,8 @@ model MassFraction "Test model for the mass fraction sensor" redeclare package Medium = Medium, V=1, nPorts=3, - m_flow_nominal=10) "Volume" + m_flow_nominal=10, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) "Volume" annotation (Placement(transformation(extent={{0,10},{20,30}}))); Annex60.Fluid.FixedResistances.FixedResistanceDpM dp( redeclare package Medium = Medium, From 8e3a6959c676814c4884d848b93cc44202e9e9a7 Mon Sep 17 00:00:00 2001 From: marcusfuchs Date: Thu, 12 Jun 2014 16:55:59 +0200 Subject: [PATCH 06/14] Change energy balance in Radiator442_2 example To avoid the use of default start values, the energy balance has been set to fixed initial. #31 --- .../HeatExchangers/Radiators/Examples/RadiatorEN442_2.mo | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Annex60/Fluid/HeatExchangers/Radiators/Examples/RadiatorEN442_2.mo b/Annex60/Fluid/HeatExchangers/Radiators/Examples/RadiatorEN442_2.mo index 5064a878e5..97577c470a 100644 --- a/Annex60/Fluid/HeatExchangers/Radiators/Examples/RadiatorEN442_2.mo +++ b/Annex60/Fluid/HeatExchangers/Radiators/Examples/RadiatorEN442_2.mo @@ -39,13 +39,13 @@ model RadiatorEN442_2 "Test model for radiator" annotation (Placement(transformation(extent={{90,-68},{70,-48}}))); inner Modelica.Fluid.System system annotation (Placement(transformation(extent={{-100,-100},{-80,-80}}))); - Annex60.Fluid.HeatExchangers.Radiators.RadiatorEN442_2 rad1(redeclare - package Medium = - Medium, + Annex60.Fluid.HeatExchangers.Radiators.RadiatorEN442_2 rad1(redeclare package + Medium = Medium, T_a_nominal=T_a_nominal, T_b_nominal=T_b_nominal, Q_flow_nominal=Q_flow_nominal, - TAir_nominal=TRoo) "Radiator" + TAir_nominal=TRoo, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) "Radiator" annotation (Placement(transformation(extent={{-10,-2},{10,18}}))); Annex60.Fluid.HeatExchangers.Radiators.RadiatorEN442_2 rad2( redeclare package Medium = Medium, From 4f84c42dfbd673c270b8058fa8c9beaf3ab0becb Mon Sep 17 00:00:00 2001 From: marcusfuchs Date: Thu, 12 Jun 2014 16:59:00 +0200 Subject: [PATCH 07/14] Change energy balances in ThreeWayValves example To avoid the use of default start values, the energy balances have been set to fixed initial. #31 --- .../Fluid/Actuators/Valves/Examples/ThreeWayValves.mo | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Annex60/Fluid/Actuators/Valves/Examples/ThreeWayValves.mo b/Annex60/Fluid/Actuators/Valves/Examples/ThreeWayValves.mo index a6dfdf1112..bc1c5df2b5 100644 --- a/Annex60/Fluid/Actuators/Valves/Examples/ThreeWayValves.mo +++ b/Annex60/Fluid/Actuators/Valves/Examples/ThreeWayValves.mo @@ -2,15 +2,16 @@ within Annex60.Fluid.Actuators.Valves.Examples; model ThreeWayValves "Three way valves with different opening characteristics" extends Modelica.Icons.Example; - package Medium = Annex60.Media.Water - "Medium in the component"; + package Medium = Annex60.Media.Water "Medium in the component"; Annex60.Fluid.Actuators.Valves.ThreeWayLinear valLin( redeclare package Medium = Medium, l={0.05,0.05}, m_flow_nominal=2, filteredOpening=false, - dpValve_nominal=6000) "Valve model, linear opening characteristics" + dpValve_nominal=6000, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) + "Valve model, linear opening characteristics" annotation (Placement(transformation(extent={{0,-8},{20,12}}, rotation=0))); Modelica.Blocks.Sources.Ramp y( @@ -42,7 +43,8 @@ model ThreeWayValves "Three way valves with different opening characteristics" R=10, m_flow_nominal=2, filteredOpening=false, - dpValve_nominal=6000) + dpValve_nominal=6000, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) annotation (Placement(transformation(extent={{0,-60},{20,-40}}, rotation=0))); Annex60.Fluid.Sources.Boundary_pT ret( redeclare package Medium = Medium, From 6d285acf53adaf29ad62ac3d3d78865d79610c39 Mon Sep 17 00:00:00 2001 From: marcusfuchs Date: Thu, 12 Jun 2014 17:01:53 +0200 Subject: [PATCH 08/14] Change energy balances in ReverseFlowHumidifier To avoid the use of default start values, the energy balances in this example have been set to fixed initial. #31 --- .../Interfaces/Examples/ReverseFlowHumidifier.mo | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Annex60/Fluid/Interfaces/Examples/ReverseFlowHumidifier.mo b/Annex60/Fluid/Interfaces/Examples/ReverseFlowHumidifier.mo index 19211957e2..669a68af2b 100644 --- a/Annex60/Fluid/Interfaces/Examples/ReverseFlowHumidifier.mo +++ b/Annex60/Fluid/Interfaces/Examples/ReverseFlowHumidifier.mo @@ -17,16 +17,18 @@ package Medium = Annex60.Media.Air; dp_nominal=0, m_flow(start=1), m_flow_nominal=1, - T=283.15, - mWat_flow_nominal=0.1) "Humidifier with backward flow" + mWat_flow_nominal=0.1, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + T=283.15) "Humidifier with backward flow" annotation (Placement(transformation(extent={{-32,-16},{-52,4}}))); Annex60.Fluid.MassExchangers.HumidifierPrescribed humFor( redeclare package Medium = Medium, dp_nominal=0, m_flow(start=1), m_flow_nominal=1, - T=283.15, - mWat_flow_nominal=0.1) "Humidifier with forward flow" + mWat_flow_nominal=0.1, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + T=283.15) "Humidifier with forward flow" annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); Modelica.Blocks.Sources.Constant u2(k=0.01) "Control input" annotation (Placement(transformation(extent={{-92,54},{-80,66}}))); @@ -140,7 +142,7 @@ equation color={0,127,255}, smooth=Smooth.None)); connect(humBac.port_a, res2.port_a) annotation (Line( - points={{-32,-6},{-26.5,-6},{-26.5,-6},{-21,-6},{-21,-6},{-10,-6}}, + points={{-32,-6},{-10,-6}}, color={0,127,255}, smooth=Smooth.None)); connect(res2.port_b, sink1.ports[2]) annotation (Line( From 445281cca673e26ba9d9bafee5da44feed1cc3e2 Mon Sep 17 00:00:00 2001 From: marcusfuchs Date: Thu, 12 Jun 2014 17:05:44 +0200 Subject: [PATCH 09/14] Change energy balance in Delay example To avoid the use of default start values, the energy balance has been set to fixed initial. #31 --- Annex60/Fluid/Delays/Examples/Delay.mo | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Annex60/Fluid/Delays/Examples/Delay.mo b/Annex60/Fluid/Delays/Examples/Delay.mo index e8dce492b1..c2418518c2 100644 --- a/Annex60/Fluid/Delays/Examples/Delay.mo +++ b/Annex60/Fluid/Delays/Examples/Delay.mo @@ -1,6 +1,6 @@ within Annex60.Fluid.Delays.Examples; model Delay - extends Modelica.Icons.Example; + extends Modelica.Icons.Example; // We set X_default to a small enough value to avoid saturation at the medium temperature // that is used in this model. package Medium = Annex60.Media.Air(X_default={0.001, 0.999}); @@ -39,8 +39,9 @@ model Delay rotation=0))); Annex60.Fluid.Delays.DelayFirstOrder del( m_flow_nominal=5, redeclare package Medium = Medium, - T_start=283.15, - nPorts=2) + nPorts=2, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + T_start=283.15) annotation (Placement(transformation(extent={{-2,6},{18,26}}, rotation=0))); inner Modelica.Fluid.System system annotation (Placement(transformation(extent={{-100,-100},{-80,-80}}))); @@ -69,5 +70,6 @@ equation -100},{100,100}}), graphics), experiment(StopTime=300), -__Dymola_Commands(file="modelica://Annex60/Resources/Scripts/Dymola/Fluid/Delays/Examples/Delay.mos" "Simulate and plot")); +__Dymola_Commands(file="modelica://Annex60/Resources/Scripts/Dymola/Fluid/Delays/Examples/Delay.mos" + "Simulate and plot")); end Delay; From 55b80a52601b19354ee7b0c9d9520f203aabacfa Mon Sep 17 00:00:00 2001 From: marcusfuchs Date: Mon, 30 Jun 2014 11:03:49 +0200 Subject: [PATCH 10/14] Undo white space changes #31 --- Annex60/Fluid/Actuators/Valves/Examples/ThreeWayValves.mo | 3 ++- Annex60/Fluid/Delays/Examples/Delay.mo | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Annex60/Fluid/Actuators/Valves/Examples/ThreeWayValves.mo b/Annex60/Fluid/Actuators/Valves/Examples/ThreeWayValves.mo index bc1c5df2b5..ab73da8aea 100644 --- a/Annex60/Fluid/Actuators/Valves/Examples/ThreeWayValves.mo +++ b/Annex60/Fluid/Actuators/Valves/Examples/ThreeWayValves.mo @@ -2,7 +2,8 @@ within Annex60.Fluid.Actuators.Valves.Examples; model ThreeWayValves "Three way valves with different opening characteristics" extends Modelica.Icons.Example; - package Medium = Annex60.Media.Water "Medium in the component"; + package Medium = Annex60.Media.Water + "Medium in the component"; Annex60.Fluid.Actuators.Valves.ThreeWayLinear valLin( redeclare package Medium = Medium, diff --git a/Annex60/Fluid/Delays/Examples/Delay.mo b/Annex60/Fluid/Delays/Examples/Delay.mo index c2418518c2..1c8c821853 100644 --- a/Annex60/Fluid/Delays/Examples/Delay.mo +++ b/Annex60/Fluid/Delays/Examples/Delay.mo @@ -1,6 +1,6 @@ within Annex60.Fluid.Delays.Examples; model Delay - extends Modelica.Icons.Example; + extends Modelica.Icons.Example; // We set X_default to a small enough value to avoid saturation at the medium temperature // that is used in this model. package Medium = Annex60.Media.Air(X_default={0.001, 0.999}); From 3249dd4271ca45809b13878a829cb98a22dbb75b Mon Sep 17 00:00:00 2001 From: marcusfuchs Date: Mon, 30 Jun 2014 11:06:44 +0200 Subject: [PATCH 11/14] Undo white space changes #31 --- .../HeatExchangers/Radiators/Examples/RadiatorEN442_2.mo | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Annex60/Fluid/HeatExchangers/Radiators/Examples/RadiatorEN442_2.mo b/Annex60/Fluid/HeatExchangers/Radiators/Examples/RadiatorEN442_2.mo index 97577c470a..c1220cd4f7 100644 --- a/Annex60/Fluid/HeatExchangers/Radiators/Examples/RadiatorEN442_2.mo +++ b/Annex60/Fluid/HeatExchangers/Radiators/Examples/RadiatorEN442_2.mo @@ -39,8 +39,9 @@ model RadiatorEN442_2 "Test model for radiator" annotation (Placement(transformation(extent={{90,-68},{70,-48}}))); inner Modelica.Fluid.System system annotation (Placement(transformation(extent={{-100,-100},{-80,-80}}))); - Annex60.Fluid.HeatExchangers.Radiators.RadiatorEN442_2 rad1(redeclare package - Medium = Medium, + Annex60.Fluid.HeatExchangers.Radiators.RadiatorEN442_2 rad1(redeclare + package Medium = + Medium, T_a_nominal=T_a_nominal, T_b_nominal=T_b_nominal, Q_flow_nominal=Q_flow_nominal, From 8e7574cab6ad8735a59ef53164e846bb4e5468ee Mon Sep 17 00:00:00 2001 From: marcusfuchs Date: Mon, 30 Jun 2014 11:11:06 +0200 Subject: [PATCH 12/14] Undo change in graphical representation of connect for #31 --- Annex60/Fluid/Interfaces/Examples/ReverseFlowHumidifier.mo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Annex60/Fluid/Interfaces/Examples/ReverseFlowHumidifier.mo b/Annex60/Fluid/Interfaces/Examples/ReverseFlowHumidifier.mo index 669a68af2b..ad6b9a9f91 100644 --- a/Annex60/Fluid/Interfaces/Examples/ReverseFlowHumidifier.mo +++ b/Annex60/Fluid/Interfaces/Examples/ReverseFlowHumidifier.mo @@ -142,7 +142,7 @@ equation color={0,127,255}, smooth=Smooth.None)); connect(humBac.port_a, res2.port_a) annotation (Line( - points={{-32,-6},{-10,-6}}, + points={{-32,-6},{-26.5,-6},{-26.5,-6},{-21,-6},{-21,-6},{-10,-6}}, color={0,127,255}, smooth=Smooth.None)); connect(res2.port_b, sink1.ports[2]) annotation (Line( From f428981f78cbbba9b9f93aa8dc13e01aee328861 Mon Sep 17 00:00:00 2001 From: marcusfuchs Date: Mon, 30 Jun 2014 11:20:36 +0200 Subject: [PATCH 13/14] Undo white space change #31 --- Annex60/Fluid/Actuators/Valves/Examples/ThreeWayValves.mo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Annex60/Fluid/Actuators/Valves/Examples/ThreeWayValves.mo b/Annex60/Fluid/Actuators/Valves/Examples/ThreeWayValves.mo index ab73da8aea..231808836d 100644 --- a/Annex60/Fluid/Actuators/Valves/Examples/ThreeWayValves.mo +++ b/Annex60/Fluid/Actuators/Valves/Examples/ThreeWayValves.mo @@ -3,7 +3,7 @@ model ThreeWayValves "Three way valves with different opening characteristics" extends Modelica.Icons.Example; package Medium = Annex60.Media.Water - "Medium in the component"; + "Medium in the component"; Annex60.Fluid.Actuators.Valves.ThreeWayLinear valLin( redeclare package Medium = Medium, From e56dbc7d828bde7e3f2f6c93d4e2bfc3dce5b072 Mon Sep 17 00:00:00 2001 From: marcusfuchs Date: Mon, 30 Jun 2014 11:22:28 +0200 Subject: [PATCH 14/14] Undo white space changes #31 --- Annex60/Fluid/Sensors/Examples/MassFraction.mo | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Annex60/Fluid/Sensors/Examples/MassFraction.mo b/Annex60/Fluid/Sensors/Examples/MassFraction.mo index 292d036ddf..b9205148eb 100644 --- a/Annex60/Fluid/Sensors/Examples/MassFraction.mo +++ b/Annex60/Fluid/Sensors/Examples/MassFraction.mo @@ -2,7 +2,8 @@ within Annex60.Fluid.Sensors.Examples; model MassFraction "Test model for the mass fraction sensor" extends Modelica.Icons.Example; - package Medium = Annex60.Media.Air "Medium model"; + package Medium = Annex60.Media.Air + "Medium model"; Annex60.Fluid.Sources.Boundary_pT sin( redeclare package Medium = Medium,