modelWaterHammer
Water hammer model producing shock waves
Extends from Modelica.Icons.Example.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | n | 10 | |
| SI.Length | L | 100 | Length of the pipe |
| SI.Diameter | D | 0.05 | Pipe diameter |
| SI.Density | rho | 1000 | Density of water |
| SI.Pressure | B | 21e8 | Bulk modulus of water |
| SI.Time | tClose | 0.01 | Time at which the valve closes |
| SI.MassFlowRate | Q0 | 0.0002 | Initial flow rate |
| Real | f | 0.05 | Darcy-Weisbach friction factor (dimensionless) |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| SI.Area | A | Cross-sectional area of the pipe (m^2) | |
| SI.Velocity | c | Speed of sound in water (m/s) | |
| SI.Length | dx | Length of each pipe segment (m) | |
| SI.Time | dt | Time step for stability (s) | |
| SI.Pressure[n + 1] | p | Pressure at each node (Pa) | |
| SI.VolumeFlowRate[n] | Q | Flow rate in each segment (m^3/s) | |
| SI.Velocity[n] | V | Speed of flow in each segment (m/s) | |
| SI.MassFlowRate | Qend | Flow rate at the end of the pipe (m^3/s) | |
| SI.MassFlowRate[n + 2] | QPlusEnds | ||
| Real | valveOpen | 1 if valve is open, 0 if closed |
Revisions
- 2025-05-02 by Clément Coïc: Initial version.
Copyright © 2025 Clément Coïc.