Skip to content

Commit

Permalink
Merge pull request #1387 from kldjonge/project_itz_fixes_v2_kdj
Browse files Browse the repository at this point in the history
.mos files, revision notes and finished two examples
  • Loading branch information
jelgerjansen authored Oct 30, 2024
2 parents 37cb732 + 3ad0a7e commit 71a236a
Show file tree
Hide file tree
Showing 26 changed files with 307 additions and 277 deletions.
4 changes: 4 additions & 0 deletions IDEAS/Airflow/Multizone/BaseClasses/DoorDiscretized.mo
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ using the model for a door that can be open or closed.
revisions="<html>
<ul>
<li>
October 29, 2024, by Klaas De Jonge:<br/>
Unprotected <code>dh</code> and changed prefixes of <code>dh</code>,<code>hAg</code> and <code>hBg</code> to <code>input</code>.This is for <a href=\\\"https://github.com/ibpsa/modelica-ibpsa/issues/1935\\\">#1935</a>.
</li>
<li>
January 8, 2019, by Michael Wetter:<br/>
Moved parameter <code>CD</code> from
<a href=\"modelica://IDEAS.Airflow.Multizone.BaseClasses.DoorDiscretized\">
Expand Down
64 changes: 44 additions & 20 deletions IDEAS/Airflow/Multizone/CrackOrOperableDoor.mo
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
within IDEAS.Airflow.Multizone;
model CrackOrOperableDoor
"Door model using discretization along height coordinate"
"Infiltration or large opening model used for the embeded airflow implementation in IDEAS.Buildings.Components"
extends IDEAS.Fluid.Interfaces.PartialFourPortInterface(
redeclare final package Medium1 = Medium,
redeclare final package Medium2 = Medium,
Expand Down Expand Up @@ -99,14 +99,34 @@ model CrackOrOperableDoor
m = if openDoorOnePort and interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort then mOpe else mClo,
useDefaultProperties = false) if not useDoor or (useDoor and interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort) "Pressure drop equation" annotation (
Placement(visible = true, transformation(origin = {0, 60}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
IDEAS.Airflow.Multizone.ReversibleDensityColumn col_b1(redeclare package Medium = Medium, h=h_b1) if interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts and not useDoor "Column for port b1" annotation (
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 (
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)));
IDEAS.Airflow.Multizone.MediumColumnReversible col_b1(redeclare package
Medium = Medium, h=h_b1) if interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts
and not useDoor "Column for port b1" annotation (Placement(visible=true,
transformation(
origin={0,70},
extent={{50,-10},{70,10}},
rotation=0)));
IDEAS.Airflow.Multizone.MediumColumnReversible 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.MediumColumnReversible 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.MediumColumnReversible 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)));
IDEAS.Airflow.Multizone.Point_m_flow point_m_flow2(
redeclare package Medium = Medium,
dpMea_nominal = dpCloRat,
Expand Down Expand Up @@ -169,7 +189,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
Expand All @@ -179,17 +199,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="<html>
<p>
Expand All @@ -203,11 +223,15 @@ There is no support for open doors when using only a single fluid port.
revisions="<html>
<ul>
<li>
October 30, 2024, by Klaas De Jonge:<br/>
Changes for column heights,used default density and transition point to laminar flow at low dp.
</li>
<li>
October 20, 2023 by Filip Jorissen:<br/>
First documented version.
</li>
</ul>
</html>"),
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;
28 changes: 14 additions & 14 deletions IDEAS/Airflow/Multizone/Examples/TrickleVentIDEAS.mo
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@ within IDEAS.Airflow.Multizone.Examples;
model TrickleVentIDEAS
"Model with a trickle vent modelled using the models with flow based on tabulated data"
extends IDEAS.Airflow.Multizone.Examples.TrickleVent(west(nPorts=2), east(nPorts=2));

IDEAS.Airflow.Multizone.TrickleVent vent(
redeclare package Medium = Medium,
dp_nominal = 10,
m_flow_nominal = 0.02614,
use_y = true)
"Analytic trickle vent implementation" annotation(
dp_nominal = 10,
m_flow_nominal = 0.02614,
use_y = true)
"Analytic trickle vent implementation" annotation (
Placement(visible = true, transformation(origin = {20, -70}, extent = {{-10, 10}, {10, -10}}, rotation = 0)));
Modelica.Blocks.Sources.Ramp ramp(
duration = 1e6,
height = -1,
offset = 1,
startTime = 1592000)
"Step control signal" annotation(
duration = 1e6,
height = -1,
offset = 1,
startTime = 1592000)
"Step control signal" annotation (
Placement(visible = true, transformation(origin = {-90, -88}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
connect(vent.port_a, east.ports[2]) annotation(
connect(vent.port_a, east.ports[2]) annotation (
Line(points = {{10, -70}, {-25, -70}, {-25, -30}, {-30, -30}}, color = {0, 127, 255}));
connect(vent.port_b, west.ports[2]) annotation(
connect(vent.port_b, west.ports[2]) annotation (
Line(points = {{30, -70}, {65, -70}, {65, -30}, {70, -30}}, color = {0, 127, 255}));
connect(ramp.y, vent.y) annotation(
connect(ramp.y, vent.y) annotation (
Line(points = {{-79, -88}, {20.5, -88}, {20.5, -82}, {20, -82}}, color = {0, 0, 127}));
annotation (__Dymola_Commands(file="modelica://IDEAS/Resources/Scripts/Dymola/Airflow/Multizone/Examples/TrickleVentIDEAS.mos"
"Simulate and plot"),
Expand Down Expand Up @@ -50,4 +50,4 @@ First implementation.
</ul>
</html>"),
Diagram);
end TrickleVentIDEAS;
end TrickleVentIDEAS;
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
within IDEAS.Airflow.Multizone;
model ReversibleDensityColumn
model MediumColumnReversible
"Vertical shaft with no friction and no storage of heat and mass, reversible because it can handle negative column heights"

extends IDEAS.Airflow.Multizone.MediumColumn(
h(min=-Modelica.Constants.inf),
h(min=-Modelica.Constants.inf),
final densitySelection = IDEAS.Airflow.Multizone.Types.densitySelection.fromBottom);
// by convention, port_b must be connected to a zone instead of a flow element
// h is allowed to be negative to accomodate for this convention

annotation (
Icon(graphics={
Line(
Expand Down Expand Up @@ -39,4 +39,4 @@ This makes port_a not nececarilly always the top port.
</li>
</ul>
</html>"));
end ReversibleDensityColumn;
end MediumColumnReversible;
Loading

0 comments on commit 71a236a

Please sign in to comment.