719-686-1000 info@waterhammer.com


Codes give guidelines for design to help engineers know what is and is not appropriate with most of the focus on safety.

Each series of articles are written by pipe flow analysis engineers from Applied Flow Technology. As industry leaders in water hammer and surge analysis, AFT has collected models and data from projects around the world to use as reference materials for published technical papers, case studies, and blogs. Visit www.aft.com for more information on analysis tools. 

ASME B31.3 and B31.4


A large part of an engineer’s job is to design systems to comply with codes and standards. Codes give guidelines for design to help engineers know what is and is not appropriate with most of the focus on safety. In recent years, codes that apply to water hammer and surge pressures have become more prominent. As a result, engineers around the world are paying more attention to preventative measures to possible surge events.

It is important to understand the system and its responses before water hammer occurs so proper preemptive mitigation efforts can be made. This is typically done with modeling software, as it allows engineers to test different scenarios, and ensure they are meeting code, without having to test their physical system.

While each country has its own regulatory standards, this article specifically focuses on codes in the United States. Namely, the focus is on the American Society of Mechanical Engineers (ASME) codes B31.3 and B31.4. They are codes applying broadly to piping systems. They each contain many parts, but there are certain subsections that specifically relate to operating pressures. This naturally lends itself to transient analysis where pressure varies from steady-state.

This article serves as a consolidated resource to easily locate and understand water hammer codes. First, the different sections are quoted (italics), and then they are paraphrased and explained to help solidify the ideas.

ASME B31.3: Process Piping
301.2.2 Required Pressure Containment or Relief

    1. Provision shall be made to safely contain or relieve any pressure to which the piping may be subjected. Piping not protected by a pressure-relieving device, or that can be isolated from a pressure-relieving device, shall be designed for at least the highest pressure that can be developed.
    2.  Sources of pressure to be considered include ambient influences, pressure oscillations and surges, improper operation, decomposition of unstable fluids, static head, and failure of control devices.
    3. The allowances of para. 302.2.4(f) are permitted, provided that the other requirements of para. 302.2.4 are also met.

This is all about designing systems such that high pressures are accounted for. They can either be contained using pipes that are rated for the highest pressure possible, or relieved by a relief system. These sections are not quantitative, and it is the engineer’s responsibility to ensure they have defined what those “high pressures” are. This is where modeling comes in handy to determine those “high pressures”. Part (c) references the next section and essentially says that “occasional” pressure variations are allowed if they do not occur too often.

302.2.4 Allowances for Pressure and Temperature Variations

Occasional variations of pressure and/or temperature may occur in a piping system. Such variations shall be considered in selecting design pressure (para. 301.2) and design temperature (para. 301.3). The most severe coincident pressure and temperature shall determine the design conditions unless all of the following criteria are met:


  1. The piping system shall have no pressure-containing components of cast iron or other nonductile metal.
  2. Nominal pressure stresses shall not exceed the yield strength at temperature (see para. 302.3 of this Code and Sy data in BPV Code, Section II, Part D, Table Y-1).
  3. Combined longitudinal stresses shall not exceed the limits established in para. 302.3.6.
  4. The total number of pressure-temperature variations above the design conditions shall not exceed 1000 during the life of the piping system.
  5. In no case shall the increased pressure exceed the test pressure used under para. 345 for the piping system.
  6. Occasional variations above design conditions shall remain within one of the following limits for pressure design.
    1. Subject to the owner’s approval, it is permissible to exceed the pressure rating or the allowable stress for pressure design at the temperature of the increased condition by not more than
      1. 33% for no more than 10 hr at any one time and no more than 100 hr/yr, or
      2. 20% for no more than 50 hr at any one time and no more than 500 hr/yr.

This section provides quantifiable meaning to the first section. It summarizes what pressures, stresses, and variations are allowed. It is also clear that variations include things like water hammer events.

From both B31.3 extracted paragraphs the following conclusions can be drawn. Surge pressure is included in the group of loads considered “occasional�?. The piping design pressure shall take into account the maximum pressure that may occur in the system, including surge pressure due to a transient event. In any case the maximum surge pressure shall not exceed the test pressure calculated for the pipe. The maximum stress loads created by the surge pressure shall not exceed: 1.33*Sh (Sh=allowable stress for the operating temperature).

In order to meet these requirements, water hammer software should be used to identify the maximum pressures and forces. Hydraulic software in combination with pipe-stress software is the best way for an engineer to quantify the possible system extremes.


ASME B31.4: Pipeline Transportation Systems for Liquid Hydrocarbons and Other Liquids

401.2.2 Internal Design Pressure 

The piping component at any point in the piping system shall be designed for an internal design pressure which shall not be less than the maximum steady-state operating pressure at that point, or less than the static head pressure at that point with the line in a static condition. The maximum steady-state operating pressure shall be the sum of the static head pressure, the pressure required to overcome friction losses, and any required back pressure. Credit may be given for hydrostatic external pressure, in the appropriate manner, in modifying the internal design pressure for use in calculations involving the pressure design of piping components (see para.404.1.3). Pressure rise above maximum steady-state operating pressure due to surges and other variations from normal operations is allowed in accordance with para. 402.2.4.

This section effectively gives a qualitative guideline for engineers to define what the “maximum steady-state” pressure is. It hints that piping systems are to be designed around steady-state conditions, and they should be designed such that the most extreme steady-state operation can be handled without issue. Operating pressure shall be the reference for design, not the design pressure calculated for the pipe. Steady-state drives the design, but variations from that operation are unavoidable. That’s what the next section covers.

402.2.4 Ratings – Allowance for Variations From Normal Operations

Surge pressures in a liquid pipeline are produced by a change in the velocity of the moving stream that results from shutting down of a pump station or pumping unit, closing of a valve, or blockage of the moving stream.

Surge pressure attenuates (decreases in intensity) as it moves away from its point of origin.

Surge calculations shall be made, and adequate controls and protective equipment shall be provided so that the level of pressure rise due to surges and other variations from normal operations shall not exceed the internal design pressure at any point in the piping system and equipment by more than 10%.

This is where the codes get specific to water hammer. It first defines surge as something that causes a change in velocity. This definition is consistent with other definitions of water hammer found on this site. The code also assumes the pressure wave decreases, from friction and pipe expansion, as it propagates. This is true, but it does not mean the highest pressure always occurs immediately in space or time at a valve closure since immediate pressure surges do not always yield the maximum pressures.

This section of B31.4 also refers directly to the maximum value of the overpressure, establishing a limit of 10% above the internal design pressure. The reference in this code is static steady-state pressure, implying that an engineer should not assume stagnation pressure is to meet these requirements. Modeling the various water hammer events in software is vital to ensure system pressures will not go above 10% of the design pressure of the pipe in any of its transient scenarios.


The allowable pressure due to a transient event (allowable surge) varies from code to code. B31.3 not only establishes a surge pressure allowable (test pressure) but also deals with the mechanical effect in the pipe, limiting the limiting piping stresses to a maximum of 33% above Sh (Sh=allowable stress for the operating temperature). B31.4 refers directly to the maximum pressure value experienced at a single moment, establishing a limit 10% above the internal design pressure.

Codes and standards are part and parcel of engineering. Meeting their requirements is much easier when engineers start design knowing the allowed conditions up front. This requires modeling and testing before the system is operational to prevent and mitigate surge rather than attempt to react to it. Simulating both the hydraulics and the pipe stresses are important in all piping system designs to ensure safe operation.