This example is interactive. Click the play button on any cell to execute it, or run all cells in sequence.

Valve Flow Characteristics

Exploring the flow behaviour of the Valve block under varying pressure drop conditions. The valve models isenthalpic flow using a standard Cv equation:

MATHDISPLAY0ENDMATH

This example is inspired by MiniSim's ValveExample, adapted to PathSim's dynamic framework.

Python
Loading...

Pressure Drop Sweep

Hold the outlet pressure at 1 bar and ramp the inlet pressure from 1 bar to 10 bar. Compare valves with different Cv coefficients.

Python
Loading...
18:18:23 - INFO - LOGGING (log: True)
18:18:23 - INFO - BLOCKS (total: 5, dynamic: 0, static: 5, eventful: 0)
18:18:23 - INFO - GRAPH (nodes: 5, edges: 5, alg. depth: 2, loop depth: 0, runtime: 0.058ms)
18:18:23 - INFO - STARTING -> TRANSIENT (Duration: 90.00s)
18:18:23 - INFO - --------------------   1% | 0.0s<0.0s | 7220.4 it/s
18:18:23 - INFO - ####----------------  20% | 0.0s<0.0s | 39536.1 it/s
18:18:23 - INFO - ########------------  40% | 0.0s<0.0s | 41161.2 it/s
18:18:23 - INFO - ############--------  60% | 0.0s<0.0s | 41113.1 it/s
18:18:23 - INFO - ################----  80% | 0.0s<0.0s | 38117.6 it/s
18:18:23 - INFO - #################### 100% | 0.0s<--:-- | 36675.6 it/s
18:18:23 - INFO - FINISHED -> TRANSIENT (total steps: 180, successful: 180, runtime: 9.39 ms)
18:18:23 - INFO - LOGGING (log: True)
18:18:23 - INFO - BLOCKS (total: 5, dynamic: 0, static: 5, eventful: 0)
18:18:23 - INFO - GRAPH (nodes: 5, edges: 5, alg. depth: 2, loop depth: 0, runtime: 0.042ms)
18:18:23 - INFO - STARTING -> TRANSIENT (Duration: 90.00s)
18:18:23 - INFO - --------------------   1% | 0.0s<0.0s | 9917.3 it/s
18:18:23 - INFO - ####----------------  20% | 0.0s<0.0s | 33817.5 it/s
18:18:23 - INFO - ########------------  40% | 0.0s<0.0s | 39566.3 it/s
18:18:23 - INFO - ############--------  60% | 0.0s<0.0s | 37319.4 it/s
18:18:23 - INFO - ################----  80% | 0.0s<0.0s | 38476.2 it/s
18:18:23 - INFO - #################### 100% | 0.0s<--:-- | 38275.5 it/s
18:18:23 - INFO - FINISHED -> TRANSIENT (total steps: 180, successful: 180, runtime: 9.18 ms)
18:18:23 - INFO - LOGGING (log: True)
18:18:23 - INFO - BLOCKS (total: 5, dynamic: 0, static: 5, eventful: 0)
18:18:23 - INFO - GRAPH (nodes: 5, edges: 5, alg. depth: 2, loop depth: 0, runtime: 0.049ms)
18:18:23 - INFO - STARTING -> TRANSIENT (Duration: 90.00s)
18:18:23 - INFO - --------------------   1% | 0.0s<0.0s | 9310.9 it/s
18:18:23 - INFO - ####----------------  20% | 0.0s<0.0s | 34886.0 it/s
18:18:23 - INFO - ########------------  40% | 0.0s<0.0s | 35361.1 it/s
18:18:23 - INFO - ############--------  60% | 0.0s<0.0s | 37876.6 it/s
18:18:23 - INFO - ################----  80% | 0.0s<0.0s | 34697.3 it/s
18:18:23 - INFO - #################### 100% | 0.0s<--:-- | 38006.0 it/s
18:18:23 - INFO - FINISHED -> TRANSIENT (total steps: 180, successful: 180, runtime: 9.18 ms)
18:18:23 - INFO - LOGGING (log: True)
18:18:23 - INFO - BLOCKS (total: 5, dynamic: 0, static: 5, eventful: 0)
18:18:23 - INFO - GRAPH (nodes: 5, edges: 5, alg. depth: 2, loop depth: 0, runtime: 0.033ms)
18:18:23 - INFO - STARTING -> TRANSIENT (Duration: 90.00s)
18:18:23 - INFO - --------------------   1% | 0.0s<0.0s | 9671.1 it/s
18:18:23 - INFO - ####----------------  20% | 0.0s<0.0s | 37116.7 it/s
18:18:23 - INFO - ########------------  40% | 0.0s<0.0s | 35938.0 it/s
18:18:23 - INFO - ############--------  60% | 0.0s<0.0s | 38437.1 it/s
18:18:23 - INFO - ################----  80% | 0.0s<0.0s | 37710.8 it/s
18:18:23 - INFO - #################### 100% | 0.0s<--:-- | 38826.8 it/s
18:18:23 - INFO - FINISHED -> TRANSIENT (total steps: 180, successful: 180, runtime: 9.17 ms)
Python
Loading...

The square-root relationship between pressure drop and flow rate is clearly visible. Doubling the Cv coefficient doubles the flow at the same pressure drop.

Isenthalpic Expansion

The valve is an isenthalpic device — outlet temperature equals inlet temperature regardless of pressure drop. Verify this across the full sweep.

Python
Loading...
18:18:23 - INFO - LOGGING (log: True)
18:18:23 - INFO - BLOCKS (total: 5, dynamic: 0, static: 5, eventful: 0)
18:18:23 - INFO - GRAPH (nodes: 5, edges: 5, alg. depth: 2, loop depth: 0, runtime: 0.040ms)
18:18:23 - INFO - STARTING -> TRANSIENT (Duration: 90.00s)
18:18:23 - INFO - --------------------   1% | 0.0s<0.0s | 8135.7 it/s
18:18:23 - INFO - ####----------------  20% | 0.0s<0.0s | 36980.3 it/s
18:18:23 - INFO - ########------------  40% | 0.0s<0.0s | 37365.3 it/s
18:18:23 - INFO - ############--------  60% | 0.0s<0.0s | 35318.5 it/s
18:18:23 - INFO - ################----  80% | 0.0s<0.0s | 37263.6 it/s
18:18:23 - INFO - #################### 100% | 0.0s<--:-- | 35724.3 it/s
18:18:23 - INFO - FINISHED -> TRANSIENT (total steps: 180, successful: 180, runtime: 14.61 ms)
T_out range: 350.00 K to 350.00 K
T_in = 350.00 K (constant) -> isenthalpic confirmed