modelWaterHammer

Water hammer model producing shock waves

Extends from Modelica.Icons.Example.

Parameters

TypeNameDefaultDescription
Integern10
SI.LengthL100Length of the pipe
SI.DiameterD0.05Pipe diameter
SI.Densityrho1000Density of water
SI.PressureB21e8Bulk modulus of water
SI.TimetClose0.01Time at which the valve closes
SI.MassFlowRateQ00.0002Initial flow rate
Realf0.05Darcy-Weisbach friction factor (dimensionless)

Components

TypeNameDefaultDescription
SI.AreaACross-sectional area of the pipe (m^2)
SI.VelocitycSpeed of sound in water (m/s)
SI.LengthdxLength of each pipe segment (m)
SI.TimedtTime step for stability (s)
SI.Pressure[n + 1]pPressure at each node (Pa)
SI.VolumeFlowRate[n]QFlow rate in each segment (m^3/s)
SI.Velocity[n]VSpeed of flow in each segment (m/s)
SI.MassFlowRateQendFlow rate at the end of the pipe (m^3/s)
SI.MassFlowRate[n + 2]QPlusEnds
RealvalveOpen1 if valve is open, 0 if closed

Revisions

  • 2025-05-02 by Clément Coïc: Initial version.

Copyright © 2025 Clément Coïc.