How can I force a specific pattern of hydraulic grade, inflow or outflow at a specific point in the network, during the transient simulation? For example modeling a sudden change in demand or a sudden change in head at a boundary.
Patterns on demands and the pattern feature in the reservoir properties only apply to an Extended Period Simulation, so they are mainly available for use in WaterCAD and WaterGEMS (which share the same file format as HAMMER)
To control a change in boundary head or flow during the transient simulation, use the Periodic head-flow element. Select "false" for the property "Sinusoidal" if you would like to directly enter a time-based pattern:
As for controlling the flow, set the periodic head-flow element's "Transient Parameter" to "Flow" and enter the pattern of time vs. flow. Use a positive value for outflow and a negative value for inflow. More on this here:
Modeling demand patterns in Bentley HAMMER
Also note that regular demands on nodes are always pressure dependent during a transient simulation, so if the pressure drops to zero, the flow will drop to zero.