To be used by equipment with two fluid ports.
This partial model
contains a FluidPortA PortA, and a FluidPortB PortB connectors, and
some equations linking the values of both connectors variables. The
more fundamental equation is:
0=PortA.G+PortB.G.
This grants that all massic flow entering one port goes out by the
other. G is considered positive if the flow enters the port.
Some parameters will
configure more possible links between the ports variables:
- parameter Boolean useElevDifference=true
will activate the use of an extra equation for ports
elevation.
- parameter FreeFluids.Types.ElevationOption
elevCalcMethod. If useElevDifference=true, selects the equation to
use for the elevation calculation. If the selection is
“differential” the equation
PortB.elevation=PortA.Elevation+elevDifference is applied. If the
selection is “absolute” the equation PortB.Elevation=
portBelevation is applied. Being elevDifference and portBelevation
parameters with default value of 0.
- parameter Boolean
calcEnthalpyDifference=true will control if a calculation of the
difference of enthalpy between ports is applied or not. But the
calculation to apply remains undefined.
- parameter Boolean passComposition = true
will control if the composition of both ports is made equal or
not.
Finally two
variables, with the equations to solve them are added: Hdiff =
PortB.H-PortA.H, and Pdiff=PortB.P-PortA.P.
With this
implementation, the model is imbalanced in two ways: For the two
pairs of potential/flow variables, there are three
equations(PortA.G=0, PortB.G=0, PortA.G=-PortB.G), so an equation
linking these variables is missing. Normally it will be the
calculation of the pressure drop as function of flow. The second
point of imbalance is that there is no equation for the calculation
of the output PortB.H. The extending models must provide the
missing equations.
Although not correct
according to the Modelica standard, the model is prepared for the
connection of more than one PortB to a PortA, with the idea of
making simpler and faster some connections. When doing so we must
take into account that, in a connection, point elevation, enthalpy,
and composition, must be supplied only by one connector. If not, we
will have an over specification for the value. The situation is
different for elevation than for enthalpy and composition. In a
connection point all the ports must have the same elevation, so the
only thing that we have to do is to inhibit the duplicate
propagation of the elevation, making useHeightDifference=true only
in one of the elements that can supply the elevation value to the
connection. For enthalpy and composition, it must be possible to
connect elements with different enthalpy or composition output, and
this can be done using mixers, that for simplification are coded as
no reverse flow. But, if the enthalpy variation inside the elements
is only due to elevation changes, we can grant that all connectors
have the same enthalpy at the connection point, and solve the
problem in the same way that we did with elevation, allowing
reverse flow. The same is applicable for composition, if
composition is constant.
A second point must
be considered: In a connection of more than two connectors,
regardless the physical size of the connections could be the same,
there is normally a change in velocity, so in kinetic energy and
enthalpy. This means that the equal enthalpy solution is only an
approximate solution valid when the velocity is low (liquids and
gases at not high velocity).
As a resume, we will
develop elements allowing for reverse flow, based in a fixed
enthalpy and composition at each connection point, and elements
without reverse flow capability, valid for situations with
different enthalpy, or composition, of the connectors.
Contents
| Name |
Description |
Medium |
Medium model |
Generated at 2026-04-14T18:18:34Z by OpenModelicaOpenModelica 1.26.3 using
GenerateDoc.mos