From 0148f616f620d4ada86a0016970b9e9328fcecf3 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Tue, 1 Oct 2024 15:56:43 +0200 Subject: [PATCH 1/6] n50tests changed rho_default to 1.2041 This to be consistent with underlying density used when deriving massflow parameter input in baseclasses based on volumeflow user input --- IDEAS/Buildings/Validation/Tests/n50Test.mo | 10 +--------- IDEAS/Buildings/Validation/Tests/n50Test2.mo | 11 ++--------- IDEAS/Buildings/Validation/Tests/n50Test3.mo | 2 +- 3 files changed, 4 insertions(+), 19 deletions(-) diff --git a/IDEAS/Buildings/Validation/Tests/n50Test.mo b/IDEAS/Buildings/Validation/Tests/n50Test.mo index 78c1d93470..e25f3eccc8 100644 --- a/IDEAS/Buildings/Validation/Tests/n50Test.mo +++ b/IDEAS/Buildings/Validation/Tests/n50Test.mo @@ -7,15 +7,7 @@ model n50Test "n50 consistency check for OnePort" inner BoundaryConditions.SimInfoManager sim(Va=0,interZonalAirFlowType=IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort) annotation (Placement(transformation(extent={{-100,80},{-80,100}}))); - parameter Medium.ThermodynamicState sta_default=Medium.setState_pTX( - T=Medium.T_default, - p=Medium.p_default, - X=Medium.X_default) - "State of the medium at the medium default properties"; - parameter Modelica.Units.SI.Density rho_default=Medium.density(sta_default) - "Density at the medium default properties"; - - Real ach = -bou.ports[1].m_flow/rho_default/simpleZone.V*3600 "Effective air change rate"; + Real ach = -bou.ports[1].m_flow/1.2041/simpleZone.V*3600 "Effective air change rate"; IDEAS.Buildings.Components.Examples.BaseClasses.SimpleZone simpleZone( redeclare package Medium = Medium, diff --git a/IDEAS/Buildings/Validation/Tests/n50Test2.mo b/IDEAS/Buildings/Validation/Tests/n50Test2.mo index a55f46461d..e38bd5685b 100644 --- a/IDEAS/Buildings/Validation/Tests/n50Test2.mo +++ b/IDEAS/Buildings/Validation/Tests/n50Test2.mo @@ -6,13 +6,6 @@ model n50Test2 "n50 consistency check for interzonalAirFlowType=OnePort" sim(Va=0, interZonalAirFlowType=IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort), window(A=2, nWin=2)); - parameter Medium.ThermodynamicState sta_default=Medium.setState_pTX( - T=Medium.T_default, - p=Medium.p_default, - X=Medium.X_default) - "State of the medium at the medium default properties"; - parameter Modelica.Units.SI.Density rho_default=Medium.density(sta_default) - "Density at the medium default properties"; parameter Boolean disableAssert = false; @@ -36,8 +29,8 @@ model n50Test2 "n50 consistency check for interzonalAirFlowType=OnePort" IDEAS.BoundaryConditions.WeatherData.Bus weaDatBus1 "Weather data bus connectable to weaBus connector from Buildings Library" annotation (Placement(transformation(extent={{0,80},{20,100}}))); - Real ach = -bou.ports[1].m_flow/rho_default/zone.V*3600; - Real ach1 = -bou.ports[2].m_flow/rho_default/zone1.V*3600; + Real ach = -bou.ports[1].m_flow/1.2041/zone.V*3600; + Real ach1 = -bou.ports[2].m_flow/1.2041/zone1.V*3600; equation diff --git a/IDEAS/Buildings/Validation/Tests/n50Test3.mo b/IDEAS/Buildings/Validation/Tests/n50Test3.mo index fb7324ffbd..e12bc05b89 100644 --- a/IDEAS/Buildings/Validation/Tests/n50Test3.mo +++ b/IDEAS/Buildings/Validation/Tests/n50Test3.mo @@ -2,7 +2,7 @@ within IDEAS.Buildings.Validation.Tests; model n50Test3 extends n50Test2(disableAssert=true,zone1(use_custom_n50=false), zone(use_custom_n50=false)); - Real flowDelta = sum(bou.ports.m_flow) + rho_default*(zone1.V+zone.V)*sim.n50/3600; + Real flowDelta = sum(bou.ports.m_flow) + 1.2041*(zone1.V+zone.V)*sim.n50/3600; equation assert(abs(flowDelta)< 1e-6 or time<2, "Flow rate consistency check failed"); From 0f3964619c9aa177fd77b82d3b9c552e09e7a5d6 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Tue, 1 Oct 2024 15:57:34 +0200 Subject: [PATCH 2/6] Update CrackOrOperableDoor.mo update used density for vZer parameter, 1.2041 is more consistent --- IDEAS/Airflow/Multizone/CrackOrOperableDoor.mo | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/IDEAS/Airflow/Multizone/CrackOrOperableDoor.mo b/IDEAS/Airflow/Multizone/CrackOrOperableDoor.mo index 8d7ff59bec..fcc9e7e388 100644 --- a/IDEAS/Airflow/Multizone/CrackOrOperableDoor.mo +++ b/IDEAS/Airflow/Multizone/CrackOrOperableDoor.mo @@ -123,7 +123,8 @@ model CrackOrOperableDoor hOpe=hOpe, dpCloRat=dpCloRat, LClo=LClo, - vZer=vZer*MFtrans*1.2) if useDoor and interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts annotation ( + vZer=vZer*MFtrans*1.2041) + if useDoor and interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts annotation ( Placement(visible = true, transformation(origin={-2,0}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); IDEAS.Fluid.Sources.Boundary_pT bou( redeclare package Medium = Medium, From d264910db6e113ac0cca77d07a190cb04ff71c51 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Tue, 1 Oct 2024 16:03:59 +0200 Subject: [PATCH 3/6] unprotect dh in baseclasses and make final again in higher levels Test on issue with model compatibility with openModelica --- .../Multizone/BaseClasses/DoorDiscretized.mo | 3 ++- .../Airflow/Multizone/CrackOrOperableDoor.mo | 25 ++++++++++--------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/IDEAS/Airflow/Multizone/BaseClasses/DoorDiscretized.mo b/IDEAS/Airflow/Multizone/BaseClasses/DoorDiscretized.mo index b0b0e4bdcd..8becb171eb 100644 --- a/IDEAS/Airflow/Multizone/BaseClasses/DoorDiscretized.mo +++ b/IDEAS/Airflow/Multizone/BaseClasses/DoorDiscretized.mo @@ -17,9 +17,10 @@ partial model DoorDiscretized Modelica.Units.SI.Velocity vTop "Velocity at top of opening from A to B"; Modelica.Units.SI.Velocity vBot "Velocity at bottom of opening from A to B"; -protected + parameter Modelica.Units.SI.Length dh=hOpe/nCom "Height of each compartment"; +protected parameter Medium.ThermodynamicState sta_default=Medium.setState_pTX( T=Medium.T_default, p=Medium.p_default, diff --git a/IDEAS/Airflow/Multizone/CrackOrOperableDoor.mo b/IDEAS/Airflow/Multizone/CrackOrOperableDoor.mo index fcc9e7e388..f7b17270d4 100644 --- a/IDEAS/Airflow/Multizone/CrackOrOperableDoor.mo +++ b/IDEAS/Airflow/Multizone/CrackOrOperableDoor.mo @@ -95,7 +95,8 @@ model CrackOrOperableDoor Placement(visible = true, transformation(origin = {0, 70}, extent = {{50, -10}, {70, 10}}, rotation = 0))); IDEAS.Airflow.Multizone.ReversibleDensityColumn col_a1(redeclare package Medium = Medium, h=h_a1) if interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts and not useDoor "Column for port a1" annotation ( Placement(visible = true, transformation(origin = {0, 70}, extent = {{-70, -10}, {-50, 10}}, rotation = 0))); - IDEAS.Airflow.Multizone.ReversibleDensityColumn col_b2(redeclare package Medium = Medium, h=h_b2) if interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts and not useDoor"Column for port b2" annotation ( + IDEAS.Airflow.Multizone.ReversibleDensityColumn col_b2(redeclare package Medium = Medium, h=h_b2) if interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts and not useDoor + "Column for port b2" annotation ( Placement(visible = true, transformation(origin = {0, -50}, extent = {{-70, -10}, {-50, 10}}, rotation = 0))); IDEAS.Airflow.Multizone.ReversibleDensityColumn col_a2(redeclare package Medium = Medium, h=h_a2) if interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts and not useDoor "Column for port a2" annotation ( Placement(visible = true, transformation(origin = {0, -50}, extent = {{50, -10}, {70, 10}}, rotation = 0))); @@ -161,7 +162,7 @@ equation connect(col_a1.port_b, port_a1) annotation ( Line(points = {{-60, 60}, {-100, 60}}, color = {0, 127, 255})); connect(y, doo.y) annotation ( - Line(points={{-110,0},{-11,0}}, color = {0, 0, 127})); + Line(points={{-110,0},{-13,0}}, color = {0, 0, 127})); connect(bou.ports[1], port_a2) annotation ( Line(points={{-1,-80},{100,-80},{100,-60}}, color = {0, 127, 255})); if interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts then @@ -171,17 +172,17 @@ equation Line(points = {{10, 60}, {100, 60}}, color = {0, 127, 255})); end if; connect(constOne.y, doo.y) annotation ( - Line(points={{-47.4,-14},{-32,-14},{-32,0},{-11,0}}, color = {0, 0, 127})); + Line(points={{-47.4,-14},{-32,-14},{-32,0},{-13,0}}, color = {0, 0, 127})); connect(bou.ports[2], port_b2) annotation ( Line(points={{1,-80},{-100,-80},{-100,-60}}, color = {0, 127, 255})); - connect(doo.port_a1, port_a1) annotation( - Line(points = {{-10, 6}, {-30, 6}, {-30, 60}, {-100, 60}}, color = {0, 127, 255})); - connect(doo.port_b1, port_b1) annotation( - Line(points = {{10, 6}, {30, 6}, {30, 60}, {100, 60}}, color = {0, 127, 255})); - connect(doo.port_b2, port_b2) annotation( - Line(points = {{-10, -6}, {-20, -6}, {-20, -34}, {-100, -34}, {-100, -60}}, color = {0, 127, 255})); - connect(doo.port_a2, port_a2) annotation( - Line(points = {{10, -6}, {20, -6}, {20, -34}, {100, -34}, {100, -60}}, color = {0, 127, 255})); + connect(doo.port_a1, port_a1) annotation ( + Line(points={{-12,6},{-30,6},{-30,60},{-100,60}}, color = {0, 127, 255})); + connect(doo.port_b1, port_b1) annotation ( + Line(points={{8,6},{30,6},{30,60},{100,60}}, color = {0, 127, 255})); + connect(doo.port_b2, port_b2) annotation ( + Line(points={{-12,-6},{-20,-6},{-20,-34},{-100,-34},{-100,-60}}, color = {0, 127, 255})); + connect(doo.port_a2, port_a2) annotation ( + Line(points={{8,-6},{20,-6},{20,-34},{100,-34},{100,-60}}, color = {0, 127, 255})); annotation(Documentation(info="

@@ -202,4 +203,4 @@ First documented version. "), Diagram, Icon(graphics={ Polygon(lineColor = {0, 0, 255}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-30, -10}, {-16, -8}, {-16, -14}, {-30, -16}, {-30, -10}}), Line(points = {{-54, 48}, {-36, 48}}), Line(points = {{-54, 20}, {-36, 20}}), Rectangle(fillColor = {255, 255, 255}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, 100}, {100, -100}}), Line(points = {{-54, -58}, {-36, -58}}), Rectangle(lineColor = {0, 0, 255}, fillColor = {255, 128, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-46, -16}, {-20, -20}}), Rectangle(lineColor = {0, 0, 255}, fillColor = {85, 75, 55}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-60, 80}, {60, -84}}), Rectangle(fillColor = {215, 215, 215}, fillPattern = FillPattern.Solid, extent = {{-54, 72}, {56, -84}}), Polygon(fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid, points = {{56, 72}, {-36, 66}, {-36, -90}, {56, -84}, {56, 72}}), Rectangle(lineColor = {0, 0, 255}, fillColor = {255, 128, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, 2}, {-46, -2}}), Polygon(visible = false, origin = {75, 50}, rotation = 360, lineColor = {0, 128, 255}, fillColor = {0, 128, 255}, fillPattern = FillPattern.Solid, points = {{-5, 10}, {25, 10}, {-5, -10}, {-5, 10}}), Text(textColor = {0, 0, 127}, extent = {{-118, 34}, {-98, 16}}, textString = "y"), Line(points = {{-54, -6}, {-36, -6}}), Line(points = {{-54, -32}, {-36, -32}}), Polygon(visible = false, origin = {-79, -50}, rotation = 360, lineColor = {0, 128, 255}, fillColor = {0, 128, 255}, fillPattern = FillPattern.Solid, points = {{10, 10}, {-20, -10}, {10, -10}, {10, 10}}), Rectangle(lineColor = {0, 0, 255}, fillColor = {255, 128, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-46, 2}, {-40, -16}})}, coordinateSystem(extent = {{-100, -100}, {100, 100}}))); -end CrackOrOperableDoor; \ No newline at end of file +end CrackOrOperableDoor; From 1ccddc5707f42a3f343e43f24cb5b71eca528ff2 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Tue, 1 Oct 2024 16:38:47 +0200 Subject: [PATCH 4/6] Revert "unprotect dh in baseclasses and make final again in higher levels" This reverts commit d264910db6e113ac0cca77d07a190cb04ff71c51. --- .../Multizone/BaseClasses/DoorDiscretized.mo | 3 +-- .../Airflow/Multizone/CrackOrOperableDoor.mo | 25 +++++++++---------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/IDEAS/Airflow/Multizone/BaseClasses/DoorDiscretized.mo b/IDEAS/Airflow/Multizone/BaseClasses/DoorDiscretized.mo index 8becb171eb..b0b0e4bdcd 100644 --- a/IDEAS/Airflow/Multizone/BaseClasses/DoorDiscretized.mo +++ b/IDEAS/Airflow/Multizone/BaseClasses/DoorDiscretized.mo @@ -17,10 +17,9 @@ partial model DoorDiscretized Modelica.Units.SI.Velocity vTop "Velocity at top of opening from A to B"; Modelica.Units.SI.Velocity vBot "Velocity at bottom of opening from A to B"; - +protected parameter Modelica.Units.SI.Length dh=hOpe/nCom "Height of each compartment"; -protected parameter Medium.ThermodynamicState sta_default=Medium.setState_pTX( T=Medium.T_default, p=Medium.p_default, diff --git a/IDEAS/Airflow/Multizone/CrackOrOperableDoor.mo b/IDEAS/Airflow/Multizone/CrackOrOperableDoor.mo index f7b17270d4..fcc9e7e388 100644 --- a/IDEAS/Airflow/Multizone/CrackOrOperableDoor.mo +++ b/IDEAS/Airflow/Multizone/CrackOrOperableDoor.mo @@ -95,8 +95,7 @@ model CrackOrOperableDoor Placement(visible = true, transformation(origin = {0, 70}, extent = {{50, -10}, {70, 10}}, rotation = 0))); IDEAS.Airflow.Multizone.ReversibleDensityColumn col_a1(redeclare package Medium = Medium, h=h_a1) if interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts and not useDoor "Column for port a1" annotation ( Placement(visible = true, transformation(origin = {0, 70}, extent = {{-70, -10}, {-50, 10}}, rotation = 0))); - IDEAS.Airflow.Multizone.ReversibleDensityColumn col_b2(redeclare package Medium = Medium, h=h_b2) if interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts and not useDoor - "Column for port b2" annotation ( + IDEAS.Airflow.Multizone.ReversibleDensityColumn col_b2(redeclare package Medium = Medium, h=h_b2) if interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts and not useDoor"Column for port b2" annotation ( Placement(visible = true, transformation(origin = {0, -50}, extent = {{-70, -10}, {-50, 10}}, rotation = 0))); IDEAS.Airflow.Multizone.ReversibleDensityColumn col_a2(redeclare package Medium = Medium, h=h_a2) if interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts and not useDoor "Column for port a2" annotation ( Placement(visible = true, transformation(origin = {0, -50}, extent = {{50, -10}, {70, 10}}, rotation = 0))); @@ -162,7 +161,7 @@ equation connect(col_a1.port_b, port_a1) annotation ( Line(points = {{-60, 60}, {-100, 60}}, color = {0, 127, 255})); connect(y, doo.y) annotation ( - Line(points={{-110,0},{-13,0}}, color = {0, 0, 127})); + Line(points={{-110,0},{-11,0}}, color = {0, 0, 127})); connect(bou.ports[1], port_a2) annotation ( Line(points={{-1,-80},{100,-80},{100,-60}}, color = {0, 127, 255})); if interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts then @@ -172,17 +171,17 @@ equation Line(points = {{10, 60}, {100, 60}}, color = {0, 127, 255})); end if; connect(constOne.y, doo.y) annotation ( - Line(points={{-47.4,-14},{-32,-14},{-32,0},{-13,0}}, color = {0, 0, 127})); + Line(points={{-47.4,-14},{-32,-14},{-32,0},{-11,0}}, color = {0, 0, 127})); connect(bou.ports[2], port_b2) annotation ( Line(points={{1,-80},{-100,-80},{-100,-60}}, color = {0, 127, 255})); - connect(doo.port_a1, port_a1) annotation ( - Line(points={{-12,6},{-30,6},{-30,60},{-100,60}}, color = {0, 127, 255})); - connect(doo.port_b1, port_b1) annotation ( - Line(points={{8,6},{30,6},{30,60},{100,60}}, color = {0, 127, 255})); - connect(doo.port_b2, port_b2) annotation ( - Line(points={{-12,-6},{-20,-6},{-20,-34},{-100,-34},{-100,-60}}, color = {0, 127, 255})); - connect(doo.port_a2, port_a2) annotation ( - Line(points={{8,-6},{20,-6},{20,-34},{100,-34},{100,-60}}, color = {0, 127, 255})); + connect(doo.port_a1, port_a1) annotation( + Line(points = {{-10, 6}, {-30, 6}, {-30, 60}, {-100, 60}}, color = {0, 127, 255})); + connect(doo.port_b1, port_b1) annotation( + Line(points = {{10, 6}, {30, 6}, {30, 60}, {100, 60}}, color = {0, 127, 255})); + connect(doo.port_b2, port_b2) annotation( + Line(points = {{-10, -6}, {-20, -6}, {-20, -34}, {-100, -34}, {-100, -60}}, color = {0, 127, 255})); + connect(doo.port_a2, port_a2) annotation( + Line(points = {{10, -6}, {20, -6}, {20, -34}, {100, -34}, {100, -60}}, color = {0, 127, 255})); annotation(Documentation(info="

@@ -203,4 +202,4 @@ First documented version. "), Diagram, Icon(graphics={ Polygon(lineColor = {0, 0, 255}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-30, -10}, {-16, -8}, {-16, -14}, {-30, -16}, {-30, -10}}), Line(points = {{-54, 48}, {-36, 48}}), Line(points = {{-54, 20}, {-36, 20}}), Rectangle(fillColor = {255, 255, 255}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, 100}, {100, -100}}), Line(points = {{-54, -58}, {-36, -58}}), Rectangle(lineColor = {0, 0, 255}, fillColor = {255, 128, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-46, -16}, {-20, -20}}), Rectangle(lineColor = {0, 0, 255}, fillColor = {85, 75, 55}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-60, 80}, {60, -84}}), Rectangle(fillColor = {215, 215, 215}, fillPattern = FillPattern.Solid, extent = {{-54, 72}, {56, -84}}), Polygon(fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid, points = {{56, 72}, {-36, 66}, {-36, -90}, {56, -84}, {56, 72}}), Rectangle(lineColor = {0, 0, 255}, fillColor = {255, 128, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, 2}, {-46, -2}}), Polygon(visible = false, origin = {75, 50}, rotation = 360, lineColor = {0, 128, 255}, fillColor = {0, 128, 255}, fillPattern = FillPattern.Solid, points = {{-5, 10}, {25, 10}, {-5, -10}, {-5, 10}}), Text(textColor = {0, 0, 127}, extent = {{-118, 34}, {-98, 16}}, textString = "y"), Line(points = {{-54, -6}, {-36, -6}}), Line(points = {{-54, -32}, {-36, -32}}), Polygon(visible = false, origin = {-79, -50}, rotation = 360, lineColor = {0, 128, 255}, fillColor = {0, 128, 255}, fillPattern = FillPattern.Solid, points = {{10, 10}, {-20, -10}, {10, -10}, {10, 10}}), Rectangle(lineColor = {0, 0, 255}, fillColor = {255, 128, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-46, 2}, {-40, -16}})}, coordinateSystem(extent = {{-100, -100}, {100, 100}}))); -end CrackOrOperableDoor; +end CrackOrOperableDoor; \ No newline at end of file From 410cd0cc0fdbac8a65e1ac22f69d8b17d4562244 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Tue, 1 Oct 2024 17:14:26 +0200 Subject: [PATCH 5/6] unprotect dh, move to advanced and hideresults --- IDEAS/Airflow/Multizone/BaseClasses/DoorDiscretized.mo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IDEAS/Airflow/Multizone/BaseClasses/DoorDiscretized.mo b/IDEAS/Airflow/Multizone/BaseClasses/DoorDiscretized.mo index b0b0e4bdcd..914a4a35a7 100644 --- a/IDEAS/Airflow/Multizone/BaseClasses/DoorDiscretized.mo +++ b/IDEAS/Airflow/Multizone/BaseClasses/DoorDiscretized.mo @@ -17,9 +17,9 @@ partial model DoorDiscretized Modelica.Units.SI.Velocity vTop "Velocity at top of opening from A to B"; Modelica.Units.SI.Velocity vBot "Velocity at bottom of opening from A to B"; -protected - parameter Modelica.Units.SI.Length dh=hOpe/nCom "Height of each compartment"; + parameter Modelica.Units.SI.Length dh=hOpe/nCom "Height of each compartment" annotation(Dialog(tab = "Advanced", group="Override"),HideResult=true); +protected parameter Medium.ThermodynamicState sta_default=Medium.setState_pTX( T=Medium.T_default, p=Medium.p_default, From 570cbe57c458e8bedad75f06a64b48dc80becb33 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Fri, 4 Oct 2024 13:20:19 +0200 Subject: [PATCH 6/6] Overridable dh in DoorDiscretized.mo IDEAS\Airflow\Multizone\BaseClasses\DoorDiscretized.mo --- IDEAS/Airflow/Multizone/BaseClasses/DoorDiscretized.mo | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/IDEAS/Airflow/Multizone/BaseClasses/DoorDiscretized.mo b/IDEAS/Airflow/Multizone/BaseClasses/DoorDiscretized.mo index 914a4a35a7..cdc7984247 100644 --- a/IDEAS/Airflow/Multizone/BaseClasses/DoorDiscretized.mo +++ b/IDEAS/Airflow/Multizone/BaseClasses/DoorDiscretized.mo @@ -18,7 +18,7 @@ partial model DoorDiscretized Modelica.Units.SI.Velocity vBot "Velocity at bottom of opening from A to B"; - parameter Modelica.Units.SI.Length dh=hOpe/nCom "Height of each compartment" annotation(Dialog(tab = "Advanced", group="Override"),HideResult=true); + input Modelica.Units.SI.Length dh=hOpe/nCom "Height of each compartment"; protected parameter Medium.ThermodynamicState sta_default=Medium.setState_pTX( T=Medium.T_default, @@ -28,11 +28,11 @@ protected parameter Modelica.Units.SI.Density rho_default=Medium.density(sta_default) "Density, used to compute fluid volume"; - parameter Real hAg[nCom](each unit="m2/s2")= + input Real hAg[nCom](each unit="m2/s2")= {Modelica.Constants.g_n*(hA - (i - 0.5)*dh) for i in 1:nCom} "Product g*h_i for each compartment"; - parameter Real hBg[nCom](each unit="m2/s2")= + input Real hBg[nCom](each unit="m2/s2")= {Modelica.Constants.g_n*(hB - (i - 0.5)*dh) for i in 1:nCom} "Product g*h_i for each compartment"; Modelica.Units.SI.AbsolutePressure pA[nCom](each nominal=101325)