@@ -41,9 +41,9 @@ protected
4141 Modelica.Units.SI.VolumeFlowRate VZer_flow(fixed= false )
4242 "Minimum net volume flow rate to prevent zero flow" ;
4343
44- Modelica.Units.SI.Mass mExcAB(start= 0 , fixed= true )
44+ Modelica.Units.SI.Mass mExcAB(start= 0 , fixed= true , unbounded = true )
4545 "Air mass exchanged (for purpose of error control only)" ;
46- Modelica.Units.SI.Mass mExcBA(start= 0 , fixed= true )
46+ Modelica.Units.SI.Mass mExcBA(start= 0 , fixed= true , unbounded = true )
4747 "Air mass exchanged (for purpose of error control only)" ;
4848
4949 Medium.MassFraction Xi_a1_inflow[Medium1.nXi]
@@ -55,8 +55,8 @@ equation
5555 // gives higher robustness. The reason may be that for bi-directional flow,
5656 // (VAB_flow - VBA_flow) may be close to zero.
5757 if forceErrorControlOnFlow then
58- der (mExcAB) = mAB_flow ;
59- der (mExcBA) = mBA_flow ;
58+ der (mExcAB) = port_a1.m_flow ;
59+ der (mExcBA) = port_a2.m_flow ;
6060 else
6161 der (mExcAB) = 0 ;
6262 der (mExcBA) = 0 ;
@@ -82,14 +82,14 @@ equation
8282
8383 VZer_flow = vZer* A;
8484
85- mAB_flow = rho_a1_inflow * VAB_flow ;
86- mBA_flow = rho_a2_inflow * VBA_flow ;
85+ mAB_flow = port_a1.m_flow ;
86+ mBA_flow = port_a2.m_flow ;
8787 // Average velocity (using the whole orifice area)
8888 vAB = VAB_flow/ A;
8989 vBA = VBA_flow/ A;
9090
91- port_a1.m_flow = mAB_flow ;
92- port_a2.m_flow = mBA_flow ;
91+ port_a1.m_flow = rho_a1_inflow * VAB_flow ;
92+ port_a2.m_flow = rho_a2_inflow * VBA_flow ;
9393
9494 // Energy balance (no storage, no heat loss/gain)
9595 port_a1.h_outflow = inStream (port_b1.h_outflow);
@@ -135,6 +135,26 @@ for doors that can be open or closed as a function of an input signal.
135135revisions="<html>
136136<ul>
137137<li>
138+ September 22, 2025, by Michael Wetter:<br/>
139+ Set <code>unbounded=true</code> for <code>mExcAB_flow</code> and <code>mExcBA_flow</code>
140+ to avoid spikes in <code>port_a.m_flow</code> in
141+ <a href=\" modelica://IBPSA.Airflow.Multizone.Examples.OneOpenDoor\">
142+ IBPSA.Airflow.Multizone.Examples.OneOpenDoor</a>.<br/>
143+ This is for
144+ <a href=\" https://github.com/lbl-srg/modelica-buildings/issues/4360\">Buildings, #4360</a>.
145+ </li>
146+ <li>
147+ September 19, 2025, by Michael Wetter:<br/>
148+ Refactored implementation of underlying function that computes the flow rate
149+ to allow function to be inlined.
150+ This leads to a 20% faster simulation of
151+ <a href=\" modelica://IBPSA.Airflow.Multizone.Examples.OneOpenDoor\">
152+ IBPSA.Airflow.Multizone.Examples.OneOpenDoor</a> compared to the previous
153+ implementation.<br/>
154+ This is for
155+ <a href=\" https://github.com/ibpsa/modelica-ibpsa/issues/2043\">IBPSA, #2043</a>.
156+ </li>
157+ <li>
138158May 12, 2020, by Michael Wetter:<br/>
139159Changed assignment of <code>m1_flow_small</code> and
140160<code>m2_flow_small</code> to <code>final</code>.
0 commit comments