## Internal State Calculations

Every Simscape™ Fluids™ library includes two kinds of blocks: quasi-steady and dynamic. For quasi-steady blocks, the one-dimensional fluid properties are calculated at the block ports. These blocks are governed only by algebraic equations, such as the conservation of mass between ports. The Counterbalance Valve (IL) block is an example of a quasi-steady component. Some quasi-steady blocks allow you to calculate the dynamic effect of a component on the fluid, such as the fluid dynamic response when a closed valve begins to open. In this case, the block remains quasi-steady, but a lag is applied to the flow response. No internal states are calculated.

One-dimensional fluid properties are calculated at the ports and at an internal node or set of nodes in a dynamic component, as is the case for a tank or heat exchanger block. These blocks are governed by both algebraic and differential equations, which account for mass conservation and the change in variables, such as temperature and pressure, with respect to time.

Dynamic Component Some blocks provide the option of turning on or off a dynamic component of the block functionality, such as fluid dynamic compressibility or wall flexibility. This modifies the number of equations the block calculates. However, calculations are still carried out between the internal nodes and block ports in dynamic components. For example, the Condenser Evaporator (2P-MA) block calculates the fluid properties in three steps:

1. The pressure differential is calculated from the momentum balance between the entry port and internal node.

2. Heat transfer at the internal node is calculated at constant pressure.

3. The pressure differential is calculated due to momentum balance between the internal node and exit port.

### Observing Variable Discontinuity

In this example, a step function applies a controlled mass flow rate through two pipes from 1 kg/s to -1 kg/s, or a step flow reversal. The temperature and pressure are measured in between these two pipes with a Pressure & Temperature Sensor (TL) block. Reservoir (TL) is set to 353 K and Reservoir (TL)1 is set to 293 K. At the time of flow reversal, the sensed temperature changes instantaneously, due to the fact that the measurement is at the node where the connecting lines meet, which does not have an internal volume. Conversely, the internal temperatures of the pipes adjust over time due to the internal volumes of the pipes. This results in a transient difference in temperatures that are measured depending on the measurement location. As a result, using a Pressure & Temperature Sensor (TL) block as a control source may introduce discontinuous jumps in your system during flow reversals. Due to the numerical scheme employed, the upstream fluid properties are set by the preceding node in the direction of flow. The temperature at the sensor will therefore be equal to the temperature at port A of Pipe (TL) 2. Were the flow to reverse again, the temperature at the sensor would match the temperature at port B of Pipe (TL) 1.

## Support Get trial now