Main Content

Networks and Network Connections

Simscape™ Fluids™ models can include multiple fluid networks, with each network representing a single fluid. To prevent errors or unexpected results, follow these guidelines to properly connect your fluid networks.

Connections Between Fluid Networks

Fluid networks are distinct if they belong to different Simscape domains or if domains of the same type are not directly connected. Ensure each distinct network has a fluid properties block. Adding more than one fluid properties block to a network may result in model compilation errors.

You can use the blocks in the Fluid Network Interfaces Library to connect different domains. For example, the Condenser and Evaporator Heat Transfer example uses a Condenser Evaporator (2P-MA) block to model heat exchange between a two-phase and moist air network.

Condenser and evaporator heat exchange between moist air and two phase networks

If your model contains multiple fluid networks of the same domain, each network must have its own fluid properties block. For example, the Engine Cooling System example uses a Heat Exchanger (TL-TL) block to model the heat exchange between two distinct thermal liquid networks, one that models the coolant and one that models the oil.

Engine cooling system example

Grounding a Network

Every fluid network must contain at least one block that models fluid volume. Blocks with fluid volume serve as a reference node to ground the fluid network. Simulating a network without grounding results in a solver error. In the model below, the Fluid dynamic compressibility parameter in the Pipe (TL) block is cleared, which means the block does not model fluid volume.

Thermal liquid model with no reference node

To fix this model, you can:

  • In the Pipe (TL) block, select the Fluid dynamic compressibility parameter.

  • Add a Tank (TL), Reservoir (TL), Controlled Reservoir (TL), or Constant Volume Chamber (TL) block to the model.

The requirement to include at least one block with fluid volume applies to all domains, not just the Thermal Liquid domain. By default, pipes in the Moist Air, Gas, and Two-Phase Fluid libraries do model fluid compressibility and will serve to ground a network.

Temperature Drift in a Closed-Loop Network

If you model a close-loop fluid system that is perfectly insulated and has a source that drives the fluid, the temperature of the fluid in the loop increases over time. In the model below, the pipe blocks are perfectly insulated and the Flow Rate Source (TL) block does work on the system. If you use the Simscape Results Explorer to observe the model behavior, you can see that the temperature and pressure rise steadily because there is nowhere for the energy to escape to.

Perfectly insulated modelRoughly linear pressure and temperature increase

You can change this behavior by connecting the Pipe (TL) blocks to a block that allows heat to escape the thermal liquid network. In the model below, both pipes are connected to a Temperature Source block with the Temperature parameter set to 293.15 K. Because the thermal liquid network is no longer perfectly insulated, the temperature and pressure in the network level off at a steady state controlled by the Temperature Source block.

Model that allows for heat transferTemperature and pressure steady state

Elevation Change Within a Network

If you specify elevation change in one component, such as a pipe, you must ensure that the rest of the network is consistent with this elevation change, including the inlet heights in tank blocks. The net elevation change in a fluid loop must sum to zero after a full circle around the loop. If the elevation gain does not sum to zero, you may see non-physical results. For example, consider this network loop with no flow source.

Network with no flow source

Because the loop contains two Pipe (TL) blocks and no flow source, the temperature and pressure should not change during simulation. However, if you set the Elevation gain from port A to port B parameter in one pipe block to 4 m and to 0 m in the other block, the net elevation change across the loop does not sum to zero. In this scenario, the mass flow rate through the pipes decreases and the temperature and pressure rise.

Plot showing falling mass flow rate over the time of the simulationPlot showing increasing pressure and temperature over the time of the simulation

If you set the Elevation gain from port A to port B parameter in one pipe block to 4 m and in the other block to -4 m, the net elevation change across the loop sums to zero and the mass flow rate, temperature, and pressure remain at 0.

Network with no flow source

Plot showing constant mass flow rate over the time of the simulationPlot showing constant pressure and temperature over the time of the simulation

To account for components that contribute to elevation change but not to the physical length of the pipe, such as a valve at the end of the pipe, include the valve height in the height of the adjoining pipe. In this case, the pipe elevation change can be greater than the pipe length. (since R2023b)

Related Topics