The FluidPort connector is the base of all the Interfaces package. Its composition is:
- replaceable package Medium = FreeFluids.TMedia.Fluids.Water constrainedby Modelica.Media.Interfaces.PartialMedium;
- SI.AbsolutePressure P(displayUnit = "bar") "Pressure";
- flow SI.MassFlowRate G(displayUnit = "kg/h") "Mass flow";
- replaceable SI.Height Elevation(start = 0) "Port Height";
- replaceable SI.SpecificEnthalpy H "Specific enthalpy";
- replaceable Medium.MassFraction X[Medium.nX] "mass fractions composition";
An explanation is needed regarding why and how each element is defined.
The package Medium is included in the connector mainly because it seems the standard in Modelica.Fluid. It will be useful if the propagation of the Medium package is done, in the future, by the connectors. It is useful also for initialization.
P and G are according to the Modelica implementation of a connector: one potential variable and one flow variable. This aids to grant that the number of equations and the number of variables are the same if the relationship between elements is done only by connections.
The variables Elevation and H don't conform to the Modelica.Fluid way, that uses stream variables. The Elevation could be avoid, as the only information needed inside the elements with connectors is the elevation difference between ports, not the absolute elevation. But its absence would avoid to enter information, based on elevation data at the ends, directly.
The enthalpy is absolutely necessary if we want to pass energy information between connectors. The solution adopted by Modelica 3.0 was the creation of stream variables, but I think that this complicates too much the situation. The alternative is to declare them as causal (input or output). This seems to prevent from allowing reverse flow, but it is not totally true, as can be seen in several examples. They are declared replaceable in order to allow its declaration as causal in derived connectors.
From the FluidPort connector, a FluidPortA as normal input, and FluidPortB as normal output are derived. The difference is the appearance, the default value for G (positive for the normal input, and negative for the normal output), and the causality of the extra variables. Initialization is also provided for the H and P of FluidPortB, based in the default values of the Medium.
Contents
Generated at 2024-11-22T19:25:38Z
by OpenModelicaOpenModelica 1.24.2 using GenerateDoc.mos