modelPartialTwoPortInterface
Partial model with two ports and declaration of quantities that are used by many models
Extends from Buildings.Fluid.Interfaces.PartialTwoPort (Partial component with two ports).
Information
This component defines the interface for models with two fluid ports. It is similar to Modelica.Fluid.Interfaces.PartialTwoPortTransport, but it does not include the species balance
port_b.Xi_outflow = inStream(port_a.Xi_outflow);
Thus, it can be used as a base class for a heat and mass transfer component
The partial model extends
Buildings.Fluid.Interfaces.PartialTwoPort
and adds quantities that are used by many models such as
m_flow_nominal, m_flow and dp.
The model is used by other models in this package that add heat transfer, mass transfer and pressure drop equations. See for example Buildings.Fluid.Interfaces.StaticTwoPortHeatMassExchanger.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Assumptions | |||
| Boolean | allowFlowReversal (from PartialTwoPort) | true | = false to simplify equations, assuming, but not enforcing, no flow reversal |
| Nominal condition | |||
| Modelica.Units.SI.MassFlowRate | m_flow_nominal | Nominal mass flow rate | |
| Advanced | |||
| Modelica.Units.SI.MassFlowRate | m_flow_small | 1E-4*abs(m_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_a (from PartialTwoPort) | Fluid connector a (positive design flow direction is from port_a to port_b) | |
| Modelica.Fluid.Interfaces.FluidPort_b | port_b (from PartialTwoPort) | Fluid connector b (positive design flow direction is from port_a to port_b) |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Units.SI.MassFlowRate | m_flow | port_a.m_flow | Mass flow rate from port_a to port_b (m_flow > 0 is design flow direction) |
| Modelica.Units.SI.PressureDifference | dp | port_a.p - port_b.p | Pressure difference between port_a and port_b |
| Medium.ThermodynamicState | sta_a | if allowFlowReversal then Medium.setState_phX(port_a.p, noEvent(actualStream(port_a.h_outflow)), noEvent(actualStream(port_a.Xi_outflow))) else Medium.setState_phX(port_a.p, noEvent(inStream(port_a.h_outflow)), noEvent(inStream(port_a.Xi_outflow))) | Medium properties in port_a |
| Medium.ThermodynamicState | sta_b | if allowFlowReversal then Medium.setState_phX(port_b.p, noEvent(actualStream(port_b.h_outflow)), noEvent(actualStream(port_b.Xi_outflow))) else Medium.setState_phX(port_b.p, noEvent(port_b.h_outflow), noEvent(port_b.Xi_outflow)) | Medium properties in port_b |
Revisions
-
September 22, 2023, by Michael Wetter:
Improved documentation.
This is for IBPSA, #1796. -
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:
Renamed protected parameterm_flow_startto avoid a name clash with Buildings.Fluid.Movers.FlowControlled_m_flow which leads to an error as the definition were different, and also renamed protected parameterdp_start. This is for #552
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. -
October 3, 2014, by Michael Wetter:
Changed assignment of nominal value to avoid in OpenModelica the warning alias set with different nominal values. -
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_aandsta_b, 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 definition ofdpbecause it causes some problem with PyFMI. -
March 27, 2012 by Michael Wetter:
Changed condition to removesta_ato also compute the state 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. -
March 11, 2008, by Michael Wetter:
First implementation.