modelPartialFourPortInterface
Partial model with four ports and declaration of quantities that are used by many models
Extends from Buildings.Fluid.Interfaces.PartialFourPort (Partial model with four ports).
Information
This component defines the interface for models with four fluid ports and two fluid streams. It is similar to Buildings.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.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Assumptions | |||
| Boolean | allowFlowReversal1 (from PartialFourPort) | true | = false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1 |
| Boolean | allowFlowReversal2 (from PartialFourPort) | true | = false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2 |
| Nominal condition | |||
| Modelica.Units.SI.MassFlowRate | m1_flow_nominal | Nominal mass flow rate | |
| Modelica.Units.SI.MassFlowRate | m2_flow_nominal | Nominal mass flow rate | |
| Advanced | |||
| Medium1.MassFlowRate | m1_flow_small | 1E-4*abs(m1_flow_nominal) | Small mass flow rate for regularization of zero flow |
| Medium2.MassFlowRate | m2_flow_small | 1E-4*abs(m2_flow_nominal) | Small mass flow rate for regularization of zero flow |
| Advanced › Diagnostics | |||
| Boolean | show_T | false | = true, if actual temperature at port is computed |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Fluid.Interfaces.FluidPort_a | port_a1 (from PartialFourPort) | Fluid connector a1 (positive design flow direction is from port_a1 to port_b1) | |
| Modelica.Fluid.Interfaces.FluidPort_b | port_b1 (from PartialFourPort) | Fluid connector b1 (positive design flow direction is from port_a1 to port_b1) | |
| Modelica.Fluid.Interfaces.FluidPort_a | port_a2 (from PartialFourPort) | Fluid connector a2 (positive design flow direction is from port_a2 to port_b2) | |
| Modelica.Fluid.Interfaces.FluidPort_b | port_b2 (from PartialFourPort) | Fluid connector b2 (positive design flow direction is from port_a2 to port_b2) |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Medium1.MassFlowRate | m1_flow | port_a1.m_flow | Mass flow rate from port_a1 to port_b1 (m1_flow > 0 is design flow direction) |
| Modelica.Units.SI.PressureDifference | dp1 | port_a1.p - port_b1.p | Pressure difference between port_a1 and port_b1 |
| Medium2.MassFlowRate | m2_flow | port_a2.m_flow | Mass flow rate from port_a2 to port_b2 (m2_flow > 0 is design flow direction) |
| Modelica.Units.SI.PressureDifference | dp2 | port_a2.p - port_b2.p | Pressure difference between port_a2 and port_b2 |
| Medium1.ThermodynamicState | sta_a1 | if allowFlowReversal1 then Medium1.setState_phX(port_a1.p, noEvent(actualStream(port_a1.h_outflow)), noEvent(actualStream(port_a1.Xi_outflow))) else Medium1.setState_phX(port_a1.p, inStream(port_a1.h_outflow), inStream(port_a1.Xi_outflow)) | Medium properties in port_a1 |
| Medium1.ThermodynamicState | sta_b1 | if allowFlowReversal1 then Medium1.setState_phX(port_b1.p, noEvent(actualStream(port_b1.h_outflow)), noEvent(actualStream(port_b1.Xi_outflow))) else Medium1.setState_phX(port_b1.p, port_b1.h_outflow, port_b1.Xi_outflow) | Medium properties in port_b1 |
| Medium2.ThermodynamicState | sta_a2 | if allowFlowReversal2 then Medium2.setState_phX(port_a2.p, noEvent(actualStream(port_a2.h_outflow)), noEvent(actualStream(port_a2.Xi_outflow))) else Medium2.setState_phX(port_a2.p, inStream(port_a2.h_outflow), inStream(port_a2.Xi_outflow)) | Medium properties in port_a2 |
| Medium2.ThermodynamicState | sta_b2 | if allowFlowReversal2 then Medium2.setState_phX(port_b2.p, noEvent(actualStream(port_b2.h_outflow)), noEvent(actualStream(port_b2.Xi_outflow))) else Medium2.setState_phX(port_b2.p, port_b2.h_outflow, port_b2.Xi_outflow) | Medium properties in port_b2 |
Revisions
-
September 22, 2023, by Michael Wetter:
Improved documentation.
This is for IBPSA, #1796. -
February 3, 2022, by Michael Wetter:
IfallowFlowReversal==false, removednoEvent()declaration forsta_aand forsta_bbecause the variable is either already used withinStream()in the computation ofstate_*_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:
IfallowFlowReversal==false, replacedactualStream()withinStream()forsta_aand removedactualStream()forsta_b.
This is for IBPSA, #1578. -
March 30, 2021, by Michael Wetter:
Added annotationHideResult=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 ofminandmaxattributes of port mass flow rates, as this is already done in the base class. -
November 12, 2013 by Michael Wetter:
Removedimport Modelica.Constants;statement. -
November 11, 2013 by Michael Wetter:
Removed the parameterhomotopyInitializationas it is no longer used in this model. -
November 10, 2013 by Michael Wetter:
In the computation ofsta_a1,sta_a2,sta_b1andsta_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:
AddednoEventto 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 ofV_flowand removed the parametershow_V_flow. The reason is that the computation ofV_flowrequired the use ofsta_a(to compute the density), butsta_ais also a variable that is conditionally enabled. However, this was not correct Modelica syntax as conditional variables can only be used in aconnectstatement, not in an assignment. Dymola 2014 FD01 beta3 is checking for this incorrect syntax. Hence,V_flowwas 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 ofdp1anddp2because they cause some problem with PyFMI. -
March 27, 2012 by Michael Wetter:
Replaced the erroneous function callMedium.densitywithMedium1.densityandMedium2.density. Changed condition to removesta_a1andsta_a2to also compute the states at the inlet port ifshow_V_flow=true. The previous implementation resulted in a translation error ifshow_V_flow=true, but worked correctly otherwise because the erroneous function call is removed ifshow_V_flow=false. -
March 27, 2011 by Michael Wetter:
Addedhomotopyoperator. -
March 21, 2010 by Michael Wetter:
Changed pressure start value fromsystem.p_starttoMedium.p_defaultsince 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.,CandmC_flow. -
April 28, 2008, by Michael Wetter:
First implementation.