Name | Description |
---|---|
PartialSource | Partial component source with one fluid connector |
Partial component to model the volume interface of a source component, such as a mass flow source. The essential features are:
Type | Name | Description |
---|---|---|
FluidPorts_b | ports[nPorts] |
partial model PartialSource "Partial component source with one fluid connector" import Modelica.Constants; parameter Integer nPorts=0 "Number of ports"; replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium model within the source"; Medium.BaseProperties medium "Medium in the source";Interfaces.FluidPorts_b ports[nPorts]( redeclare each package Medium = Medium, m_flow(each max=if flowDirection==Types.PortFlowDirection.Leaving then 0 else +Constants.inf, each min=if flowDirection==Types.PortFlowDirection.Entering then 0 else -Constants.inf)); protected parameter Types.PortFlowDirection flowDirection= Types.PortFlowDirection.Bidirectional "Allowed flow direction"; equation // Only one connection allowed to a port to avoid unwanted ideal mixing for i in 1:nPorts loop assert(cardinality(ports[i]) <= 1," each ports[i] of boundary shall at most be connected to one component. If two or more connections are present, ideal mixing takes place with these connections, which is usually not the intention of the modeller. Increase nPorts to add an additional port. "); ports[i].p = medium.p; ports[i].h_outflow = medium.h; ports[i].Xi_outflow = medium.Xi; end for;end PartialSource;