Ask the expert Q&A: Pipeline simulation

Supporting problem-solving at all stages of a pipeline lifecycle

From the initial design of a new pipeline to supporting a pipeline operations team day-to-day, pipeline simulation software like Atmos SIM have the value of being versatile. They are used as a tool for training and assessment as well as modeling gas and liquid pipelines by having multiple applications like offline, online and look-aheads (see Figure 1). We interviewed Jason Modisette, our Chief Simulation Scientist and co-author of The Atmos book of pipeline simulation, who answered some of the key questions we get asked around pipeline simulation, including:

Question 1: How long have you worked on pipeline simulation?

I've been in this industry for 25 years. During that time, I've worked on gas, liquid and multiphase models and applications built on top of models such as optimizers, leak detection systems and online and offline models.

Question 2: What do you think of “The Atmos book of pipeline simulation”?

I'm very happy with the way it turned out. The goal with this book was to write down everything I wished I had known when I started working in this industry.

The Atmos book of pipeline simulation and the Appendices to the Atmos book of pipeline simulation

Figure 2: The Atmos book of pipeline simulation and the Appendices to the Atmos book of pipeline simulation, written by Moe Metwally and Dr Jason Modisette. Available to buy on Amazon.

The target audience is really two groups. It's aimed at mathematicians and computer scientists who want to learn about pipelines and at pipeliners who want to learn about the numerical techniques used in pipeline simulation.

Question 3: What does a pipeline simulator do?

An offline simulator produces a model in the computer of what's happening in the real pipeline. This can be useful for design purposes, for trying out different scenarios and for training.

A look ahead simulator is a type of offline simulator that can run the current operations into the future and show us what's going to happen when we do certain things in the pipeline, starting from the current state.

Finally, an online simulator uses the instrumentation installed on the pipeline to drive the model. It keeps an accurate state of what's happening in the system right now. This can tell us what pressures and flows are at places where you don't have any instrumentation. It's also useful for detecting anomalies.

Question 4: What are the main challenges for a pipeline company when using simulation software?

An online model is a more stringent piece of equipment (where its requirements on meter accuracy are concerned) than anything else a pipeline company is likely to encounter. What this means is when you first install an online model, you are going to find a bunch of problems with your existing metering that haven't really impacted you so far. These problems need to be sorted out or worked around to get the simulator working at its full performance.

As an example, if you've got a block valve and its position sensor is erroneously reading that it's closed, your operators have probably been living with that for years and know that's happening and they don't mind because they know that position sensor is unreliable. If you feed that into a model, the model is going to produce complete nonsense for results until it's sorted out. So, you're going to have to fix a number of issues like that.

In many cases, it's not feasible for cost reasons to actually go in and replace the sensor. What happens as part of the installation process of the simulator is that Atmos International would figure out some way of determining whether that valve was open via other sensors. For example, maybe there's a flow meter next to the valve. If the flow meter’s reading something other than zero, we'll say the valve’s open and if it's reading zero, we’ll say the valve’s closed.

Otherwise, you would have to just ignore the bad meter and that could cause problems in the future if someone did open the valve.

Question 5: How can a pipeline company benefit from using an online model?

An online model can tell you a lot more about what's going on in your pipeline than just looking at the instruments alone. By showing you pressures at points away from meters, it can identify possible maximum pressure violations or slack. It can also give very accurate estimates of line pack in a gas pipeline.

Online models also serve as a basis for further pipeline applications, particularly leak detection systems. On gas pipelines, any accurate leak detection system is going to need a good online model underlying it if it's going to be based on software and not require expensive additional hardware added to the line. If the instruments are maintained well, the model should be able to provide accurate leak detection with minimal false alarms and also accurate locations and leak sizes.

Finally, online models are good at a variety of other anomaly detection by looking at inconsistencies among the instruments. They can show when pumps or compressors are starting to fail and require maintenance, when liquid’s building up in a gas pipeline or when a batch in a liquid pipeline doesn't have the expected fluid properties.

Question 6: What can a pipeline company do with offline models?

An offline model can be used as a design tool to help decide what size of pipe or pumps or compressors you're going to need to meet your goals and figure out the cost of a pipeline. It can also be used as the basis of an optimizer which will determine how to run a pipeline, meaning which flow rate and pressure setpoints to use, and when to start and stop specific pumps to minimize costs.

Offline models can also be used in a design context to figure out your operating costs for a pipeline that hasn't been built yet by letting the optimizer decide how one would optimally operate that pipeline.

Separately, offline models can be used for surge analysis. This is primarily used to prove to regulators that your pipeline is going to be operating safely and within limits under various different scenarios. Surge analysis can also be used in tuning some pipeline equipment, such as adjusting the criteria for closing emergency shutdown valves to avoid accidentally triggering them during normal operation or during compressor trips.

Finally, transient offline models can be used as trainers. They simulate the behavior of the real pipeline so a trainee would be in no danger of accidentally fouling pipeline operations while learning how the pipeline works.

Question 7: How accurately can you model a pipeline?

In an online model (where the meters are carefully maintained), we can generally provide accuracies of about one PSI error across the network. This level of accuracy does require some dedication from the pipeline operator and any deviations between the meter readings and modeled values must be investigated. Any large-scale changes in the operating environment, such as thermal changes, also need to be correctly input to the model.

If you just have a model running that was good when it started but leave it going for a few years and don't do anything with it, your accuracy is probably going to be more like ten PSI errors around the network. In many circumstances, that's a good enough accuracy for a lot of applications. It will give you a pretty good line pack on a gas pipeline, and it costs money to track down meter errors and monitor the model constantly, so you have to consider what level of accuracy is worthwhile to maintain. It's important to provide the right level of attention for the pipeline applications you're looking at.

For liquid models, we run into a few environmental issues where we can have wrong parameters about the system, the biggest one being viscosity in crude oil batches. These are often poorly characterized and can produce significant model errors greater than the ten PSI number.

Finally, a line that's exposed to the atmosphere like the sunlight, clouds, wind and so on has significant error coming in from the unknown thermal conditions around the line, but that is thankfully quite rare because most pipelines are buried. The other parameters like pipe diameters and lengths are usually well known by the pipeline companies and are not a significant source of error.

Question 8: For gas pipelines, there are a lot more online or real-time simulation applications outside of the United States, what are the main reasons for such a difference?

US regulators historically haven't required leak detection on gas pipelines to the extent that regulators in other countries have done and gas venting has also been allowed till recently. The primary uses for online gas models are capacity management and online leak detection and they're very cost effective compared to the other options like hardware based leak detection.

We do see that the regulatory environment is changing and we expect in the future to see more online gas models in the US market. Recent events in Europe also highlight the importance of secure gas supply and the value North American gas can generate. The online gas models can help run the complex networks efficiently without venting. This will help reduce methane emissions too.

Question 9: What are the key elements for having a successful online or real-time simulation application?

As I mentioned previously, the first thing you need to do is get your meter problems sorted out. This would typically happen during the commissioning of the system and it's much easier to do if there's a direct channel for communications between the simulation vendor and the pipeline company, rather than having to go through the intermediary of the SCADA company, for example, which is a common arrangement.

A user interface setup for monitoring the pipelines using Atmos SIM

Figure 3: A user interface setup for monitoring the pipelines using Atmos SIM

Once the model is running, you need someone in the pipeline company who takes ownership of it and keeps an eye on it to ensure its accuracy. Over time, problems will arise and meters will start to deviate from the model results. And this will result in alarms, but someone has to look at the alarms and figure out what's causing them. Often, this is something that can be done entirely inside the pipeline company. But occasionally it will be necessary to go back to the simulation vendor and get their help with analysis.

In the case of a leak detection application, this will probably result in false alarms and it's important that the cause of every false alarm be understood. Analyzing false alarms takes time and costs money, which is why it's important that the system doesn’t produce many of them in the first place. These are the main things necessary to get accurate model applications.

Question 10: What impact will cloud computing have on simulation?

Running simulations in the cloud lets us quickly run multiple scenarios in parallel and this can be used to answer engineering questions. For instance, someone might want to know how fast they can close a valve to keep the surge pressure at a certain point below the maximum allowed pressure there. Runs with different closure times can be performed at once just to see which one comes out best.

Atmos is also exploring the usage of the cloud in operational optimization of gas pipelines, where we determine the most efficient way to perform an upcoming operation by trying various different scenarios, running them all in parallel and seeing which one is the most efficient.

Figure 4: A simulated 24-hour period in a gas pipeline control room using Atmos SIM

Finally, cloud computing can be used in online simulation applications to characterize unknown parameters of the line. This most commonly happens in crude lines where the viscosity of an incoming batch is not known well. With an online model running in the cloud, we can split it into several parallel models, try different viscosities, see which one best fits what we're seeing on the instrumentation, keep that one and then continue running from there.

Question 11: How will simulation help with the energy transition?

Pipeline companies are at the forefront of the energy transition. For gas pipelines, this consists of three main things: hydrogen blending into existing gas, shipping carbon dioxide (possibly in existing pipelines or new pipelines), and dealing with strongly peaking loads, where gas-fired power plants are used to cover gaps in the energy supplied by renewable sources like wind and solar. What's required in the case of the CO2 and hydrogen blending simulation is that it be able to accurately model the equations of state governing these fluids. Today, equations are quite accurate for carbon dioxide as long as it's pure, but what we expect to see in the future is carbon dioxide mixed with other impurities like combustion products and there's ongoing research into the equations of state necessary to accurately model that.

For peaking loads, we expect to see more interesting gas optimization as pipelines are asked to operate in new and more transient flow regimes than they have before and software can certainly provide assistance with that.

Outside the area of gas pipelines, we expect to see more compressible liquid pipelines moving things like natural gas liquids or liquefied petroleum gases. Existing simulators, including Atmos SIM, can accurately model this but it’s necessary to understand that the behavior of pumps is quite different with these things and to have accurate equations of state. Crude pipelines are experiencing declining flow rates as the fields get depleted and new fields are not drilled and this is also a place where pipeline simulation can provide help. An accurate thermal model, both of the fluid and of the thermal environment around the outside of the pipeline, is necessary to tell when the crudes will become too cold and viscous to pump without the addition of heaters or other changes in the pipeline equipment.

Question 12: What do you like most about working on pipeline simulation?

Well, one nice thing about pipeline simulators as opposed to other types of fluid dynamics application is that they're very fast to run. This is because pipelines are 1D. If you're doing something like a 3D model of airflow over an airplane wing, it can take all day to get your results back but most of our simulators can run the simple problems we run into during development in a few seconds. This makes the cycle of running the simulation, seeing what it did, fixing it or changing it in whatever way I want to change it and running it again quite quick. It’s also quick to develop new features, fix bugs and that sort of thing too. So that makes the whole process of working on it more enjoyable as well as faster. I also very much like working on optimizers.

The best thing when you're writing an optimizer is if your program comes back with a solution that you wouldn't have thought of and does something clever. It's almost like when your child does something clever. Occasionally, when we're lucky, we run into a problem where we can do something equivalent to a global search over all the solutions. These problems do come up sometimes, and they're the most fun to work on because then the optimizer is likely to produce a solution that I wouldn't have thought of myself.

Learn more about pipeline simulation

Jason Modisette co-authored the Atmos book of pipeline simulation which provides a unique and in-depth insight into pipeline simulation technology, with specific examples demonstrated using Atmos Simulation (SIM) Suite.