AFT Blog

Welcome to the Applied Flow Technology Blog where you will find the latest news and training on how to use AFT Fathom, AFT Arrow, AFT Impulse, AFT xStream and other AFT software products.
Font size: +
7 minutes reading time (1486 words)

Know Your Surge Codes and Use AFT Impulse: ASME B31.4

 Unnecessary Background

Codes and standards are not sexy topics, nor are they liked by the rebellious at heart. Whether you love or hate them they are a part of the world and aim to make it a safer place. One of the largest organizations to compose standards is the American Society of Mechanical Engineers (ASME). They have been around since the 19th century, creating safer engineering practices, especially in the world of piping and process systems. Our favorite.

ASME B31 is just one set of codes specifically geared toward pressure piping. It is one of the most well-known collections for chemical and mechanical engineers working with fluids. Perhaps you've heard of it.. since only someone working with pipes would read this blog in the first place. 

We will narrow our focus down to a few paragraphs about overpressure in ASME B31.4, Pipeline Transportation Systems for Liquids and Slurries.

Overpressure is a common concern. For lack of a gentler explanation, engineers and stakeholders want to make sure nothing blows up. Tragedy after tragedy in the last century has shown the need for overpressure safety guidelines.

Relevant Definitions 

The context for pipes is typically transient overpressure in the form of surge or waterhammer. Let's jot down some basic definitions to get started.

  • Steady state: Properties of the fluid & piping (pressure, temperature, flowrate, etc.) do NOT change with time. They can change with length down the pipe, but not time. E.g., a pressure reading you take at a specific location hour after hour is always the same.
  • Transient: Properties DO change with time. The pressure reading at some point will be different when you go back to look. (Transient timeframes can be on the order of milliseconds, where no one may see it, but the change was transient all the same.)
  • Surge (aka, waterhammer): A sudden rise in pressure due to a change in fluid velocity, typically from a valve closure or pump shutdown. It is an inherently transient phenomenon.
  • Operating pressure: Internal steady state pressure of the piping system during "normal" operation. This is not a useful reference for codes since every system operates differently, but knowing the maximum operating pressure for a system is useful. You can design your pipes to handle it with ample margin.
  • Design pressure: Internal pressure used for deciding what pipes and components to use in the system. This is always some margin above the maximum operating pressure and is the reference for what overpressures are allowed.
  • Transient overpressure: Pressure rise above the operating pressure due to surge or waterhammer.

What Does the Code Say?

Let's dig into what the code has to say about internal design pressures: 

Pressure rise above maximum steady state operating pressure due to surges and other variations from normal operations is allowed in accordance with para. 403.3.4.

ASME B31.4-2012 para. 401.2.2.2

Notice that pressure rises (surges) are expected and not prohibited. It is impossible to run a system without them. Instead, they make allowances according to another piece of the code, based on experience and agreed-upon values. We will find what is allowed by going to the referenced para. 403.3.4:

Surge calculations should be made and adequate controls and protective equipment shall be provided so that the 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%.

ASME B31.4-2012 para. 403.3.4

There we have it. Surge pressures cannot go above the internal design pressure by more than 10%. Most relief valves are set to blow around this point for that reason. BUT. There is always a but. BUT you need to make surge calculations to test worst-case scenarios and ensure protective equipment is adequate. Easy peasy..

Surge Calculations 

How do you do your calculations? If you use a pressure rise equation like Joukowsky, WRONG. Check out this journal article for enlightenment.

Do you account for liquid column separation or transient cavitation? Akin to high pressure waves, low pressure waves can be generated to cause the local static pressure to drop below vapor pressure. This is often more dangerous than the initial surge. Vapor collapse, ever heard of it? Do you account for check valve slam or how waves interact?

The point is that there is so much more to "surge calculations" than meets the eye. Cutting corners does not cut it. (This article on analyzing worst-case scenarios will show you life outside the Matrix.)

What? AFT Impulse you say? The worldwide savior of hydraulic & stress engineers you say?

AFT Impulse is modeling software to simulate waterhammer and surge, along with other transient behavior. Honestly, it is the only way to do real waterhammer analysis of your system. The calculations are nuclear verified, so you know you can trust. 'Nough said.

Impulse will spit out the simulation data, telling you what pressures (along with many other parameters) to expect - all from a real system perspective. It accounts for wave interaction from complex networks, line pack, check valve slam, transient cavitation, etc. All of it.

Software Tip:

Did you know you can directly import your AFT Fathom (steady state analysis) model into AFT Impulse (surge / waterhammer analysis)? Talk about a time saver! The near-identical interfaces is icing on the cake.


Below we have an example pipeline built in Impulse. Steady state operating pressures are around 500psig. The steel piping has a design pressure of 700psig. This means that the maximum allowed overpressure is 770psig (10% above 700).

We are going to test what happens when we close the red shutdown valve on the right, mimicking an emergency shutdown. We can initially run the simulation assuming the valve closes in 5sec. This will effectively be instantaneous.

Software Tip:

Design Alerts come in super handy here. Have the software warn you when the pressure anywhere goes above 770psig. No need for manual checks in every pipe.

The simulation output gives us insight into what happens when that valve closes. There is a lot to potentially look at, but we will zoom in to the area just upstream of the closing valve. The graph below shows how the pressure rises as the valve closes, and how that pressure goes above the allowed 770psig, represented by the red dotted line. (The pressure continues to rise after the initial closure due to line pack. Learn about line pack in this article.)

:(   We didn't stay within our allowed bounds. We need to find a solution. We could test adding in a relief valve. Maybe even a surge accumulator. Though, sizing and installing a new piece of equipment is a lot of work. Let's see if we can meet code by instead changing the valve closure method. 

Software Tip:

Impulse can handle all of these different test cases within the same model file. We call these independent cases "scenarios", and you can test to your heart's content without interfering with any other case.

We can make a new scenario, and test a valve closure that takes 15sec. We can also change up the closure profile to make it safer based on the valve characteristics and system behavior of the fast closure. (Learn more about the effect valve closure profiles have on surge response in this article on valve characteristics.)

She's behaving well now. Good graph. 

Much better - we stayed within our 10% max transient overpressure. What's especially cool with Impulse is that you can directly compare results from different scenarios on one graph with multi-scenario graphing, like below.

Let's see that instant replay.

That is the power of software. No worries about incorrect hand calcs. No worries about all the "hidden" concerns of waterhammer like transient cavitation, line pack, or wave interaction. Impulse does it all, and it does it efficiently.

If you are not using AFT Impulse for your surge calculations, you ain't doing it right.

There is a lot more to look at in this example, such as pump & check valve behavior, pressures through the rest of the system, or dynamic loading forces on the pipes. We could easily leverage the same output from the Impulse simulations we already ran. No problem for the curious engineer.


The fact is you need to do these calculations. Can't have surge that goes above 10% of your design pressure. You know it's serious when the code repeats it a third time:

The pressure rise due to surges (see para. 403.3.4) 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%.

ASME B31.4-2012 para. 404.1.5

How you approach these calculations is your choice, but the popularity of AFT Impulse around the world reveals which tool is best. Nothing is as trusted, comprehensive, and easy to use. Stay safe by following ASME B31.4, and use Impulse for testing and verifying methods to meet the code.

What Does the Ukrainian Fluid Flow Term “Hydro Uda...
Find Help Faster with the Documentation Portal

Related Posts



No comments made yet. Be the first to submit a comment
Saturday, 10 December 2022
Log in

Login to your account

Username *
Password *
Remember Me

Create an account

Fields marked with an asterisk (*) are required.
Name *
Username *
Password *
Verify password *
Email *
Verify email *
Captcha *
Reload Captcha
© 1996 - 2023 Applied Flow Technology