BuildingSystems.Fluid.Interfaces.PartialFourPortInterface

# .BuildingSystems.Fluid.Interfaces.PartialFourPortInterface

Partial model with four ports and declaration of quantities that are used by many models

## Information

This component defines the interface for models with four fluid ports and two fluid streams. It is similar to BuildingSystems.Fluid.Interfaces.PartialTwoPortInterface, but it has four ports instead of two.

The model is used by other models in this package that add heat transfer, mass transfer and pressure drop equations.

## Revisions

- September 22, 2023, by Michael Wetter:
  Improved documentation.
  This is for IBPSA, #1796.
- February 3, 2022, by Michael Wetter:
  If `allowFlowReversal==false`, removed `noEvent()` declaration for `sta_a` and for `sta_b` because the variable is either already used with `inStream()` in the computation of `state_*_inflow`, or the result of a variable of the model that already may generate an event.
  This is for IBPSA, #1578.
- February 2, 2022, by Hongxiang Fu:
  If `allowFlowReversal==false`, replaced `actualStream()` with `inStream()` for `sta_a` and removed `actualStream()` for `sta_b`.
  This is for IBPSA, #1578.
- March 30, 2021, by Michael Wetter:
  Added annotation `HideResult=true`.
  This is for IBPSA, #1459.
- November 3, 2016, by Michael Wetter:
  Moved computation of pressure drop to variable assignment so that the model won't mix graphical with textual modeling if used as a base class for a graphically implemented model.
- November 3, 2016, by Michael Wetter:
  Removed start values for mass flow rate and pressure difference to simplify the parameter window.
  This is for #552.
- January 22, 2016, by Michael Wetter:
  Corrected type declaration of pressure difference. This is for #404.
- November 13, 2013 by Michael Wetter:
  Removed assignment of `min` and `max` attributes of port mass flow rates, as this is already done in the base class.
- November 12, 2013 by Michael Wetter:
  Removed `import Modelica.Constants;` statement.
- November 11, 2013 by Michael Wetter:
  Removed the parameter `homotopyInitialization` as it is no longer used in this model.
- November 10, 2013 by Michael Wetter:
  In the computation of `sta_a1`, `sta_a2`, `sta_b1` and `sta_b2`, removed the branch that uses the homotopy operator. The rational is that these variables are conditionally enables (because of `... if show_T`). Therefore, the Modelica Language Specification does not allow for these variables to be used in any equation. Hence, the use of the homotopy operator is not needed here.
- October 10, 2013 by Michael Wetter:
  Added `noEvent` to the computation of the states at the port. This is correct, because the states are only used for reporting, but not to compute any other variable. Use of the states to compute other variables would violate the Modelica language, as conditionally removed variables must not be used in any equation.
- October 8, 2013 by Michael Wetter:
  Removed the computation of `V_flow` and removed the parameter `show_V_flow`. The reason is that the computation of `V_flow` required the use of `sta_a` (to compute the density), but `sta_a` is also a variable that is conditionally enabled. However, this was not correct Modelica syntax as conditional variables can only be used in a `connect` statement, not in an assignment. Dymola 2014 FD01 beta3 is checking for this incorrect syntax. Hence, `V_flow` was removed as its conditional implementation would require a rather cumbersome implementation that uses a new connector that carries the state of the medium.
- April 26, 2013 by Marco Bonvini:
  Moved the definitions of `dp1` and `dp2` because they cause some problem with PyFMI.
- March 27, 2012 by Michael Wetter:
  Replaced the erroneous function call `Medium.density` with `Medium1.density` and `Medium2.density`. Changed condition to remove `sta_a1` and `sta_a2` to also compute the states at the inlet port if `show_V_flow=true`. The previous implementation resulted in a translation error if `show_V_flow=true`, but worked correctly otherwise because the erroneous function call is removed if `show_V_flow=false`.
- March 27, 2011 by Michael Wetter:
  Added `homotopy` operator.
- March 21, 2010 by Michael Wetter:
  Changed pressure start value from `system.p_start` to `Medium.p_default` since HVAC models may have water and air, which are typically at different pressures.
- September 19, 2008 by Michael Wetter:
  Added equations for the mass balance of extra species flow, i.e., `C` and `mC_flow`.
- April 28, 2008, by Michael Wetter:
  First implementation.

Generated at 2026-05-09T18:18:56Z by OpenModelicaOpenModelica 1.26.7 using GenerateDoc.mos