Hello simulators :-)
Im working with Modelica/Dymola5 for approximately one month now. Topically I'm facing the following problem as I'm modeling a network of pipes for water containing a fraction of salt:
Several (let's say N) mass flow rates consisting of multible components (in my case two: water and salt) meet each other in a nodal-point of pipes (crotch, pipe branching) where they may split or merge or just pass if there are only two pipes meeting (a simple pipe).
Considering fluid properties like salinity (m_salt per m_water) or specific enthalpie or what you like, incoming mass flow rates with externaly determined properties transmit there properties to outgoing mass flow rates. In other words, properties of inlets are the "cause" whereas properties of outlets are results/effects. Mathematically, outgoing properties are calculated as a kind of average from the incoming ones which doesn't matter in detail here.
Now we model this pipe-node as an element with N acausal "mass-flow-connectors" for all the inlets and outlet transporting their properties. Inlet properties might be determined by such blocks from Modelica.Blocks.Sources.*
What's important for me now: Imagines that due to external pressure variations the directions of some mass flow rates may invert. Suddenly, inlets become outlets and as a consequence of that their properties may not be determined by signal sources any more. Even if we found some if-construction to handle the alternating flow directions within our nodal-point of pipes (as e.g. proposed by http://www.modelica.org/events/Conference2...vist_fluid.pdf), I cannot imagine how to handle the outer world connections to signal sources determining the porperties of (the changing) inlets. It's a kind of "flying splice" (online swap) of cause and effect.
Does anyone of you know a solution for my problem? I thank you for every useful hint.
Cheers,
Hannes