|
| 1 | +within IDEAS.Airflow.Multizone; |
| 2 | +model CrackOrOperableDoor |
| 3 | + "Infiltration or large opening model used for the embeded airflow implementation in IDEAS.Buildings.Components" |
| 4 | + extends IDEAS.Fluid.Interfaces.PartialFourPortInterface( |
| 5 | + redeclare final package Medium1 = Medium, |
| 6 | + redeclare final package Medium2 = Medium, |
| 7 | + final allowFlowReversal1=true, |
| 8 | + final allowFlowReversal2=true, |
| 9 | + final m1_flow_nominal=10/3600*rho_default, |
| 10 | + final m2_flow_nominal=m1_flow_nominal, |
| 11 | + final m1_flow_small=1E-4*abs(m1_flow_nominal), |
| 12 | + final m2_flow_small=1E-4*abs(m2_flow_nominal)); |
| 13 | + extends IDEAS.Airflow.Multizone.BaseClasses.ErrorControl(forceErrorControlOnFlow=true); //force error control on flow rates |
| 14 | + |
| 15 | + replaceable package Medium = |
| 16 | + Modelica.Media.Interfaces.PartialMedium "Medium in the component" |
| 17 | + annotation (choices( |
| 18 | + choice(redeclare package Medium = IDEAS.Media.Air "Moist air"))); |
| 19 | + |
| 20 | + parameter Modelica.Units.SI.Velocity vZer=0.001 |
| 21 | + "Minimum velocity to prevent zero flow. Recommended: 0.001"; |
| 22 | + parameter Modelica.Units.SI.Length wOpe=0.9 "Width of opening" |
| 23 | + annotation (Dialog(group="Geometry")); |
| 24 | + parameter Modelica.Units.SI.Length hOpe=2.1 "Height of opening" |
| 25 | + annotation (Dialog(group="Geometry")); |
| 26 | + |
| 27 | + parameter BoundaryConditions.Types.InterZonalAirFlow interZonalAirFlowType |
| 28 | + "Interzonal air flow type"; |
| 29 | + final parameter Modelica.Units.SI.PressureDifference dpCloRat(displayUnit="Pa")=50 |
| 30 | + "Pressure drop at rating condition of closed door" |
| 31 | + annotation (Dialog(group="Rating conditions")); |
| 32 | + |
| 33 | + parameter Modelica.Units.SI.Length h_b1 "Height at port b1 (hasCavity=false)"; |
| 34 | + parameter Modelica.Units.SI.Length h_b2 = 0 "Height at port b2(hasCavity=false)"; |
| 35 | + parameter Modelica.Units.SI.Length h_a1 = 0 "Height at port a1(hasCavity=false)"; |
| 36 | + parameter Modelica.Units.SI.Length h_a2 "Height at port a2(hasCavity=false)"; |
| 37 | + |
| 38 | + parameter SI.Length hA=(h_a1 + h_b2)/2 |
| 39 | + "Height of reference pressure at port a1 for opening (hasCavity=true) model"; |
| 40 | + parameter SI.Length hB=(h_a2 + h_b1)/2 |
| 41 | + "Height of reference pressure at port b1 for opening (hasCavity=true) model"; |
| 42 | + |
| 43 | + final parameter Real CDCloRat(min=0, max=1)=1 |
| 44 | + "Discharge coefficient at rating conditions of closed door" |
| 45 | + annotation (Dialog(group="Rating conditions")); |
| 46 | + parameter Modelica.Units.SI.Area A_q50 "Surface area for leakage computation (closed door)"; |
| 47 | + parameter Real q50(unit="m3/(h.m2)") "Surface air tightness"; |
| 48 | + |
| 49 | + final parameter Modelica.Units.SI.Area LClo(min=0) = ((q50*A_q50/3600)/(dpCloRat)^mClo)/(((dpCloRat)^(0.5-mClo))*sqrt(2/rho_default)) |
| 50 | + "Effective leakage area of internal wall (when door is fully closed)" |
| 51 | + annotation (Dialog(group="Crack or Closed door")); |
| 52 | + |
| 53 | + parameter Real CDOpe=0.78 "Discharge coefficient of open door" |
| 54 | + annotation (Dialog(group="Open door")); |
| 55 | + |
| 56 | + |
| 57 | + parameter Real mOpe = 0.5 "Flow exponent for door of open door" |
| 58 | + annotation (Dialog(group="Open door")); |
| 59 | + parameter Real mClo= 0.65 "Flow exponent for crack or crack of closed door" |
| 60 | + annotation (Dialog(group="Crack or Closed door")); |
| 61 | + |
| 62 | + parameter Integer nCom=if abs(hOpe*sin(inc)) < 0.01 then 2 else max(2,integer(abs(hOpe*sin(inc))/4)) "Number of compartments for the discretization"; |
| 63 | + |
| 64 | + parameter Boolean useDoor = false "=true, to use operable door instead of a crack"; |
| 65 | + parameter Boolean use_y = true "=true, to use control input"; |
| 66 | + parameter Boolean openDoorOnePort = false "Sets whether a door is open or closed in one port configuration"; |
| 67 | + |
| 68 | + parameter Modelica.Units.SI.PressureDifference dp_turbulent( |
| 69 | + min=0, |
| 70 | + displayUnit="Pa") = 0.01 |
| 71 | + "Pressure difference where laminar and turbulent flow relation coincide. Recommended: 0.01"; |
| 72 | + |
| 73 | + parameter Modelica.Units.SI.PressureDifference dp_turbulent_ope(min=0,displayUnit="Pa") = (MFtrans/(rho_default*(CDOpe * hOpe*wOpe * sqrt(2/rho_default))))^(1/mOpe) |
| 74 | + if useDoor and interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "Pressure difference where laminar and turbulent flow relation coincide for large cavities"; |
| 75 | + parameter Modelica.Units.SI.MassFlowRate MFtrans=(hOpe*wOpe)*VItrans*REtrans/DOpe if useDoor and interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "Recommended massflowrate used for reguralisation"; |
| 76 | + parameter Modelica.Units.SI.Length DOpe=4*hOpe*wOpe/(2*hOpe+2*wOpe) if useDoor and interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "Estimated hydraulic diameter of the opening - 4*A/Perimeter"; |
| 77 | + constant Modelica.Units.SI.ReynoldsNumber REtrans=30 if useDoor and interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "Assumed Reynolds number at transition"; |
| 78 | + constant Modelica.Units.SI.DynamicViscosity VItrans=0.0000181625 if useDoor and interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "Assumed dynamic viscosity of air at transition"; |
| 79 | + |
| 80 | + final parameter Medium.ThermodynamicState state_default=Medium.setState_pTX( |
| 81 | + T=Medium.T_default, |
| 82 | + p=Medium.p_default, |
| 83 | + X=Medium.X_default[1:Medium.nXi]) "Medium state at default values"; |
| 84 | + final parameter Modelica.Units.SI.Density rho_default=Medium.density(state=state_default) "Medium default density"; |
| 85 | + |
| 86 | + |
| 87 | + |
| 88 | + Modelica.Blocks.Interfaces.RealInput y(min=0, max=1, unit="1") if useDoor and use_y |
| 89 | + "Opening signal, 0=closed, 1=open" |
| 90 | + annotation (Placement(transformation(extent={{-120,-10},{-100,10}}), iconTransformation(extent={{-120,-10},{-100,10}}))); |
| 91 | + IDEAS.Airflow.Multizone.Point_m_flow point_m_flow1( |
| 92 | + redeclare package Medium = Medium, |
| 93 | + dpMea_nominal = dpCloRat, |
| 94 | + forceErrorControlOnFlow=true, |
| 95 | + mMea_flow_nominal=if openDoorOnePort and interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort |
| 96 | + then wOpe*hOpe*rho_default*CDCloRat*(2*dpCloRat/rho_default)^mClo else (if |
| 97 | + interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts |
| 98 | + then 0.5 else 1)*(q50/3600*rho_default)*A_q50, |
| 99 | + m = if openDoorOnePort and interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort then mOpe else mClo, |
| 100 | + useDefaultProperties = false) if not useDoor or (useDoor and interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort) "Pressure drop equation" annotation ( |
| 101 | + Placement(visible = true, transformation(origin = {0, 60}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); |
| 102 | + IDEAS.Airflow.Multizone.MediumColumnReversible col_b1(redeclare package |
| 103 | + Medium = Medium, h=h_b1) if interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts |
| 104 | + and not useDoor "Column for port b1" annotation (Placement(visible=true, |
| 105 | + transformation( |
| 106 | + origin={0,70}, |
| 107 | + extent={{50,-10},{70,10}}, |
| 108 | + rotation=0))); |
| 109 | + IDEAS.Airflow.Multizone.MediumColumnReversible col_a1(redeclare package |
| 110 | + Medium = Medium, h=h_a1) if interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts |
| 111 | + and not useDoor "Column for port a1" annotation (Placement(visible=true, |
| 112 | + transformation( |
| 113 | + origin={0,70}, |
| 114 | + extent={{-70,-10},{-50,10}}, |
| 115 | + rotation=0))); |
| 116 | + IDEAS.Airflow.Multizone.MediumColumnReversible col_b2(redeclare package |
| 117 | + Medium = Medium, h=h_b2) if interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts |
| 118 | + and not useDoor "Column for port b2" annotation (Placement(visible=true, |
| 119 | + transformation( |
| 120 | + origin={0,-50}, |
| 121 | + extent={{-70,-10},{-50,10}}, |
| 122 | + rotation=0))); |
| 123 | + IDEAS.Airflow.Multizone.MediumColumnReversible col_a2(redeclare package |
| 124 | + Medium = Medium, h=h_a2) if interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts |
| 125 | + and not useDoor "Column for port a2" annotation (Placement(visible=true, |
| 126 | + transformation( |
| 127 | + origin={0,-50}, |
| 128 | + extent={{50,-10},{70,10}}, |
| 129 | + rotation=0))); |
| 130 | + IDEAS.Airflow.Multizone.Point_m_flow point_m_flow2( |
| 131 | + redeclare package Medium = Medium, |
| 132 | + dpMea_nominal = dpCloRat, |
| 133 | + forceErrorControlOnFlow=true, |
| 134 | + m = mClo, |
| 135 | + mMea_flow_nominal = (q50/3600*rho_default)*A_q50*0.5, |
| 136 | + useDefaultProperties = false) if not useDoor and interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "Pressure drop equation" annotation ( |
| 137 | + Placement(visible = true, transformation(origin = {0, -60}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); |
| 138 | + IDEAS.Airflow.Multizone.DoorDiscretizedOperable doo( |
| 139 | + final dh=doo.hOpe*sin(inc)/nCom, |
| 140 | + redeclare package Medium = Medium, |
| 141 | + final hA=hA, |
| 142 | + final hB=hB, |
| 143 | + dp_turbulent=dp_turbulent_ope, |
| 144 | + nCom=nCom, |
| 145 | + CDOpe=CDOpe, |
| 146 | + CDClo=CDCloRat, |
| 147 | + mOpe=mOpe, |
| 148 | + mClo=mClo, |
| 149 | + CDCloRat=CDCloRat, |
| 150 | + wOpe=wOpe, |
| 151 | + hOpe=hOpe, |
| 152 | + dpCloRat=dpCloRat, |
| 153 | + LClo=LClo, |
| 154 | + vZer=vZer*MFtrans*rho_default) |
| 155 | + if useDoor and interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts annotation ( |
| 156 | + Placement(visible = true, transformation(origin={-2,0}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); |
| 157 | + IDEAS.Fluid.Sources.Boundary_pT bou( |
| 158 | + redeclare package Medium = Medium, |
| 159 | + nPorts = 2) |
| 160 | + if interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts |
| 161 | + "Sets absolute pressure when the ports are not connected externally" annotation ( |
| 162 | + Placement(visible = true, transformation(origin = {0, -90}, extent = {{-10, 10}, {10, -10}}, rotation = 90))); |
| 163 | + Modelica.Blocks.Sources.Constant constOne(final k=1) |
| 164 | + if not use_y |
| 165 | + "Door constantly opened" annotation ( |
| 166 | + Placement(visible = true, transformation(origin = {-54, -14}, extent = {{-6, -6}, {6, 6}}, rotation = 0))); |
| 167 | + |
| 168 | + parameter SI.Angle inc=Modelica.Constants.pi/2 |
| 169 | + "inclination angle (vertical=pi/2)"; |
| 170 | +initial equation |
| 171 | + assert( not (interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts and useDoor and use_y), |
| 172 | + "In " +getInstanceName() + ": Cannot use a controllable door unless interZonalAirFlowType == TwoPorts."); |
| 173 | + |
| 174 | +equation |
| 175 | + connect(col_a1.port_a, point_m_flow1.port_a) annotation ( |
| 176 | + Line(points = {{-60, 80}, {-60, 84}, {-20, 84}, {-20, 60}, {-10, 60}}, color = {0, 127, 255})); |
| 177 | + connect(col_b1.port_a, point_m_flow1.port_b) annotation ( |
| 178 | + Line(points = {{60, 80}, {60, 84}, {20, 84}, {20, 60}, {10, 60}}, color = {0, 127, 255})); |
| 179 | + connect(col_b2.port_a, point_m_flow2.port_a) annotation ( |
| 180 | + Line(points = {{-60, -40}, {-60, -36}, {-20, -36}, {-20, -60}, {-10, -60}}, color = {0, 127, 255})); |
| 181 | + connect(col_a2.port_a, point_m_flow2.port_b) annotation ( |
| 182 | + Line(points = {{60, -40}, {60, -36}, {20, -36}, {20, -60}, {10, -60}}, color = {0, 127, 255})); |
| 183 | + connect(col_b2.port_b, port_b2) annotation ( |
| 184 | + Line(points = {{-60, -60}, {-100, -60}}, color = {0, 127, 255})); |
| 185 | + connect(col_a2.port_b, port_a2) annotation ( |
| 186 | + Line(points = {{60, -60}, {100, -60}}, color = {0, 127, 255})); |
| 187 | + connect(col_b1.port_b, port_b1) annotation ( |
| 188 | + Line(points = {{60, 60}, {100, 60}}, color = {0, 127, 255})); |
| 189 | + connect(col_a1.port_b, port_a1) annotation ( |
| 190 | + Line(points = {{-60, 60}, {-100, 60}}, color = {0, 127, 255})); |
| 191 | + connect(y, doo.y) annotation ( |
| 192 | + Line(points={{-110,0},{-13,0}}, color = {0, 0, 127})); |
| 193 | + connect(bou.ports[1], port_a2) annotation ( |
| 194 | + Line(points={{-1,-80},{100,-80},{100,-60}}, color = {0, 127, 255})); |
| 195 | + if interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts then |
| 196 | + connect(point_m_flow1.port_a, port_a1) annotation ( |
| 197 | + Line(points = {{-10, 60}, {-100, 60}}, color = {0, 127, 255})); |
| 198 | + connect(point_m_flow1.port_b, port_b1) annotation ( |
| 199 | + Line(points = {{10, 60}, {100, 60}}, color = {0, 127, 255})); |
| 200 | + end if; |
| 201 | + connect(constOne.y, doo.y) annotation ( |
| 202 | + Line(points={{-47.4,-14},{-32,-14},{-32,0},{-13,0}}, color = {0, 0, 127})); |
| 203 | + connect(bou.ports[2], port_b2) annotation ( |
| 204 | + Line(points={{1,-80},{-100,-80},{-100,-60}}, color = {0, 127, 255})); |
| 205 | + connect(doo.port_a1, port_a1) annotation ( |
| 206 | + Line(points={{-12,6},{-30,6},{-30,60},{-100,60}}, color = {0, 127, 255})); |
| 207 | + connect(doo.port_b1, port_b1) annotation ( |
| 208 | + Line(points={{8,6},{30,6},{30,60},{100,60}}, color = {0, 127, 255})); |
| 209 | + connect(doo.port_b2, port_b2) annotation ( |
| 210 | + Line(points={{-12,-6},{-20,-6},{-20,-34},{-100,-34},{-100,-60}}, color = {0, 127, 255})); |
| 211 | + connect(doo.port_a2, port_a2) annotation ( |
| 212 | + Line(points={{8,-6},{20,-6},{20,-34},{100,-34},{100,-60}}, color = {0, 127, 255})); |
| 213 | + |
| 214 | +annotation(Documentation(info="<html> |
| 215 | +<p> |
| 216 | +This models an open/closed door depending on the number of available fluid ports. |
| 217 | +</p> |
| 218 | +<p> |
| 219 | +When only one port is available then an orrifice equation is used to approximate the closed door. |
| 220 | +There is no support for open doors when using only a single fluid port. |
| 221 | +</p> |
| 222 | +</html>", |
| 223 | +revisions="<html> |
| 224 | +<ul> |
| 225 | +<li> |
| 226 | +October 30, 2024, by Klaas De Jonge:<br/> |
| 227 | +Changes for column heights,used default density and transition point to laminar flow at low dp. |
| 228 | +</li> |
| 229 | +<li> |
| 230 | +October 20, 2023 by Filip Jorissen:<br/> |
| 231 | +First documented version. |
| 232 | +</li> |
| 233 | +</ul> |
| 234 | +</html>"), |
| 235 | + Diagram, |
| 236 | + 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}}))); |
| 237 | +end CrackOrOperableDoor; |
0 commit comments