modelPartialTwoPortTransport
Extends from AixLib.Fluid.Interfaces.PartialTwoPort (Partial component with two ports).
Information
This component transports fluid between its two ports, without storing mass or energy.
Energy may be exchanged with the environment though, e.g., in the form of work.
PartialTwoPortTransport is intended as base class for devices like orifices, valves and simple fluid machines.
Three equations need to be added by an extending class using this component:
- The momentum balance specifying the relationship between the pressure drop
dpand the mass flow ratem_flow, port_b.h_outflowfor flow in design direction, andport_a.h_outflowfor flow in reverse direction.
Moreover appropriate values shall be assigned to the following parameters:
dp_startfor a guess of the pressure dropm_flow_smallfor regularization of zero flow.
Implementation
This is similar to
Modelica.Fluid.Interfaces.PartialTwoPortTransport
except that it does not use the outer system declaration.
This declaration is omitted as in building energy simulation,
many models use multiple media, and in practice,
users have not used this global definition to assign parameters.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Assumptions | |||
| Boolean | allowFlowReversal (from PartialTwoPort) | true | = false to simplify equations, assuming, but not enforcing, no flow reversal |
| Advanced | |||
| Modelica.Units.SI.PressureDifference | dp_start | 0 | Guess value of dp = port_a.p - port_b.p |
| Medium.MassFlowRate | m_flow_start | 0 | Guess value of m_flow = port_a.m_flow |
| Medium.MassFlowRate | m_flow_small | Small mass flow rate for regularization of zero flow | |
| Advanced › Diagnostics | |||
| Boolean | show_T | true | = true, if temperatures at port_a and port_b are computed |
| Boolean | show_V_flow | true | = true, if volume flow rate at inflowing 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 |
|---|---|---|---|
| Medium.MassFlowRate | m_flow | Mass flow rate in design flow direction | |
| Modelica.Units.SI.PressureDifference | dp | Pressure difference between port_a and port_b (= port_a.p - port_b.p) | |
| Modelica.Units.SI.VolumeFlowRate | V_flow | m_flow/Modelica.Fluid.Utilities.regStep(m_flow, Medium.density(Medium.setState_phX(p = port_a.p, h = inStream(port_a.h_outflow), X = inStream(port_a.Xi_outflow))), Medium.density(Medium.setState_phX(p = port_b.p, h = inStream(port_b.h_outflow), X = inStream(port_b.Xi_outflow))), m_flow_small) | Volume flow rate at inflowing port (positive when flow from port_a to port_b) |
| Medium.Temperature | port_a_T | Modelica.Fluid.Utilities.regStep(port_a.m_flow, Medium.temperature(Medium.setState_phX(p = port_a.p, h = inStream(port_a.h_outflow), X = inStream(port_a.Xi_outflow))), Medium.temperature(Medium.setState_phX(port_a.p, port_a.h_outflow, port_a.Xi_outflow)), m_flow_small) | Temperature close to port_a, if show_T = true |
| Medium.Temperature | port_b_T | Modelica.Fluid.Utilities.regStep(port_b.m_flow, Medium.temperature(Medium.setState_phX(p = port_b.p, h = inStream(port_b.h_outflow), X = inStream(port_b.Xi_outflow))), Medium.temperature(Medium.setState_phX(port_b.p, port_b.h_outflow, port_b.Xi_outflow)), m_flow_small) | Temperature close to port_b, if show_T = true |
Revisions
-
March 30, 2021, by Michael Wetter:
Added annotationHideResult=true.
This is for IBPSA, #1459. -
September 15, 2016, by Michael Wetter:
Removed wrong annotation, which caused an error in the pedantic model check of Dymola 2017 FD01. This is for #516. -
January 22, 2016, by Henning Francke:
Corrected type declaration of pressure. This is for #404. -
November 19, 2015, by Michael Wetter:
Removed assignments of parametersport_a_exposesStateandport_b_exposesStatein base class. This is for #351. -
August 15, 2015, by Filip Jorissen:
Implemented more efficient computation ofport_a.Xi_outflowandport_a.C_outflowwhenallowFlowReversal=false. This is for #305. -
June 6, 2015, by Michael Wetter:
Removed protected conditional variablesstate_aandstate_b, as they were used outside of a connect statement, which causes an error during pedantic model check in Dymola 2016. This fixes #128. -
April 1, 2015, by Michael Wetter:
Made computation ofstate_aandstate_pconditional onshow_Torshow_V_flow. This avoids computing temperature from enthalpy if temperature is a state of the medium, and the result is not used. -
October 21, 2014, by Michael Wetter:
Revised implementation. -
October 20, 2014, by Filip Jorisson:
First implementation.