diff --git a/IBPSA/Airflow/Multizone/BaseClasses/Door.mo b/IBPSA/Airflow/Multizone/BaseClasses/Door.mo new file mode 100644 index 0000000000..c37ad44ccd --- /dev/null +++ b/IBPSA/Airflow/Multizone/BaseClasses/Door.mo @@ -0,0 +1,128 @@ +within IBPSA.Airflow.Multizone.BaseClasses; +partial model Door + "Door model for bi-directional flow" + extends IBPSA.Fluid.Interfaces.PartialFourPortInterface( + redeclare final package Medium1 = Medium, + redeclare final package Medium2 = Medium, + final allowFlowReversal1=true, + final allowFlowReversal2=true, + final m1_flow_nominal=10/3600*1.2, + final m2_flow_nominal=m1_flow_nominal, + final m1_flow_small=1E-4*abs(m1_flow_nominal), + final m2_flow_small=1E-4*abs(m2_flow_nominal)); + + replaceable package Medium = + Modelica.Media.Interfaces.PartialMedium "Medium in the component" + annotation (choices( + choice(redeclare package Medium = IBPSA.Media.Air "Moist air"))); + + parameter Modelica.SIunits.Length wOpe=0.9 "Width of opening" + annotation (Dialog(group="Geometry")); + parameter Modelica.SIunits.Length hOpe=2.1 "Height of opening" + annotation (Dialog(group="Geometry")); + + parameter Modelica.SIunits.PressureDifference dp_turbulent( + min=0, + displayUnit="Pa") = 0.01 + "Pressure difference where laminar and turbulent flow relation coincide. Recommended: 0.01"; + + Modelica.SIunits.VolumeFlowRate VAB_flow(nominal=0.001) + "Volume flow rate from A to B if positive"; + Modelica.SIunits.VolumeFlowRate VBA_flow(nominal=0.001) + "Volume flow rate from B to A if positive"; + Modelica.SIunits.MassFlowRate mAB_flow(nominal=0.001) + "Mass flow rate from A to B if positive"; + Modelica.SIunits.MassFlowRate mBA_flow(nominal=0.001) + "Mass flow rate from B to A if positive"; + + Modelica.SIunits.Velocity vAB(nominal=0.01) "Average velocity from A to B"; + Modelica.SIunits.Velocity vBA(nominal=0.01) "Average velocity from B to A"; + +protected + parameter Medium.ThermodynamicState sta_default=Medium.setState_pTX( + T=Medium.T_default, + p=Medium.p_default, + X=Medium.X_default); + + parameter Modelica.SIunits.Density rho_default=Medium.density(sta_default) + "Density"; + + Modelica.SIunits.Density rho_a1_inflow + "Density of air flowing in from port_a1"; + Modelica.SIunits.Density rho_a2_inflow + "Density of air flowing in from port_a2"; + +equation + // Compute the density of the inflowing media. + rho_a1_inflow = Medium1.density(state_a1_inflow); + rho_a2_inflow = Medium2.density(state_a2_inflow); + + mAB_flow = rho_a1_inflow*VAB_flow; + mBA_flow = rho_a2_inflow*VBA_flow; + // Average velocity (using the whole orifice area) + vAB = VAB_flow/A; + vBA = VBA_flow/A; + + port_a1.m_flow = mAB_flow; + port_a2.m_flow = mBA_flow; + + // Energy balance (no storage, no heat loss/gain) + port_a1.h_outflow = inStream(port_b1.h_outflow); + port_b1.h_outflow = inStream(port_a1.h_outflow); + port_a2.h_outflow = inStream(port_b2.h_outflow); + port_b2.h_outflow = inStream(port_a2.h_outflow); + + // Mass balance (no storage) + port_a1.m_flow = -port_b1.m_flow; + port_a2.m_flow = -port_b2.m_flow; + + port_a1.Xi_outflow = inStream(port_b1.Xi_outflow); + port_b1.Xi_outflow = inStream(port_a1.Xi_outflow); + port_a2.Xi_outflow = inStream(port_b2.Xi_outflow); + port_b2.Xi_outflow = inStream(port_a2.Xi_outflow); + + // Transport of trace substances + port_a1.C_outflow = inStream(port_b1.C_outflow); + port_b1.C_outflow = inStream(port_a1.C_outflow); + port_a2.C_outflow = inStream(port_b2.C_outflow); + port_b2.C_outflow = inStream(port_a2.C_outflow); + + annotation ( + Icon(graphics={ + Rectangle( + extent={{-60,80},{60,-84}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={85,75,55}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-54,72},{56,-84}}, + lineColor={0,0,0}, + fillColor={215,215,215}, + fillPattern=FillPattern.Solid), + Polygon( + points={{56,72},{-36,66},{-36,-90},{56,-84},{56,72}}, + lineColor={0,0,0}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-30,-10},{-16,-8},{-16,-14},{-30,-16},{-30,-10}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid)}), + Documentation(info=" +
+This is a partial model for the bi-directional air flow through a door. +
+", +revisions=" ++Model for bi-directional air flow through a large opening such as a door. +
++The air flow is composed of two components, a one-directional bulk air flow +due to static pressure difference in the adjoining two thermal zones, and +a two-directional airflow due to temperature-induced differences in density +of the air in the two rooms. +Although turbulent air flow is a nonlinear phenomenon and hence the +two air flow rates could only be superposed for laminar flow, +the model is based on the simplifying assumption that these two +air flow rates can be superposed. +This assumption is made because +it leads to a simple model and because there is significant uncertainty +and assumptions anyway in the model for bidirectional flow through a door. +
++The air flow rate due to static pressure difference is +
++ V̇ab,p = CD w h (2/ρ0)0.5 Δpm, +
++where +V̇ is the volume flow rate, +CD is the discharge coefficient, +w and h are the width and height of the opening +ρ0 is the mass density at the medium default pressure, temperature and humidity, +m is the flow exponent and +Δp = pa - pb is the static pressure difference between +the thermal zones. +For this discussion, we will assume pa > pb. +For turbulent flow, m=1/2 and for laminar flow m=1. +
++The air flow rate due to temperature difference in the rooms is +V̇ab,t for flow from thermal zone a to b, +and +V̇ba,t for flow from thermal zone b to a. +The net air flow rate from a to b is +
++ V̇ab = + V̇ab,p/2 + V̇ab,t, +
+and, similarly, ++ V̇ba = - V̇ab,p/2 + V̇ba,t. +
++To calculate V̇ba,p, we assume +
++ ṁab,t = -ṁba,t = ρ0 V̇ab,t = -ρ0 V̇ba,t. +
++With this assumption, the neutral height, e.g., the height where the air flow rate due to flow +induced by temperature difference is zero, is at h/2. +Hence, +
++ V̇ab,t = ∫0h/2 (∂ ⁄ ∂ z) V̇ab,t(z) dz, +
++and with +
++ V̇ab,t = CD w h (2/ρ0)0.5 Δpabm(z), +
+and ++ Δpabm(z) = g z (ρa-ρb) = g z (ρa-ρb) + ≈ ρ0 (Tb - Ta) ⁄ T0, +
++where we used +ρa = p0 /(R Ta) and +Ta Tb ≈ T0. +Substituting this expression into the integral yields +
++ V̇ab,t = CD w (2/ρ0)0.5 gm ρ0m + (h/2)m+1 (Tb-Ta)m ⁄ T0m. +
++The main assumptions are +
++that the air flow rates due to static pressure difference and due to temperature-difference can be superposed, +
++that for computing the neutral height, ṁab,t = ρ0 V̇ab,t, and +
++that for buoyancy-driven flow the air density can be approximated as ρ = p0 /(R T), +
++For a more detailed model, use + +IBPSA.Airflow.Multizone.DoorDiscretizedOpen. +
+", +revisions=" +