Category Archives: flotools

Pigging Displacement Volume Calculation

One of the most common practices during the operation of pipelines is “pigging”. Buildup of solids or liquids in flowlines can result in plugging, cracks, or flaws in the line, all of which could cause severe damage to the line. Pigging operations may be designed with objectives that include cleaning, inspecting of flowlines, or other maintenance operations. Thus, understanding pigging is necessary for flow assurance engineers to ensure the flow assets continue to run smoothly.

Correctly anticipating the total liquid volumes displaced during pigging operations is very important for operators, as this affects the designing and operations of receiving process equipment, such as separators and slug catchers located at the outlet of pipelines. This discussion will cover how one can run a batch of simulations and analyze the transient liquid response in terms of the pigging displacement volumes and peak liquid flowrates. This analysis can be performed with improved efficiency using evoleap’s flotools software, as compared to traditional methods. We will compare the flotools methodology with more conventional methods using the OLGA GUI and Excel.


flotools gives the ability to build a study consisting of many cases and then immediately process the results.  In this discussion we will analyze the pigging displacement volume and peak flowrates in a pipeline system by varying the following parameters:

  • Inlet Liquid Flowrate
  • Watercut
  • Gas Lift Rate
  • Inlet temperature

One of flotools most powerful features, its Parametric Studies tool, makes this process very simple and streamlined.

For a study that contains many cases, manually creating the varying cases using the OLGA GUI can be repetitive and sometimes impractical, especially if it is a particularly large case matrix, as the probability of making errors is high. If the OLGA GUI parametric tool was to be used, for every parameter to be varied, a comma separated list of each value for each individual case would need to be provided. Typically, an Excel spreadsheet would be used to organize and visualize how each induvial case’s parameters would look. The parametric studies tool in flotools simplifies this process. After creating a base case with a specific parameter set at a specific value, flotools allows you to create different cases with that specific parameter varied with different values by providing a comma-separated list of those values. For instance, if the base created for a study has the watercut for the inlet liquid rates set at 0.2 and the study requires the watercut to vary between 0.2 and 0.8 with increments of 0.2, a comma-separated list like “(0.2, 0.4, 0.6, 0.8)”, could be provided and then flotools will generate the differing cases consisting of those values.

Graphical user interface

Description automatically generated
Figure 1 – Parametric study definition example

After defining the study variables, the next important step in generating the cases for the parametric study is defining the naming convention for the numerous cases. flotools provides an easy way to do this by providing an integer index value for every study variable specified while generating the parametric study. An example of the file naming pattern using study variable references is provided in the following figure.

Graphical user interface, text, application, chat or text message, timeline

Description automatically generated
Figure 2 – Interactive naming of cases

As can be seen in the image above, each study variable has an index associated with it, for example watercut (WC) is linked to %3, the third study variable. Using these indexes to name the cases results with a systematic naming convention for the cases which makes each one identifiable. flotools also give you the option to add unlinked variables that can be referenced by other variables. These are potentially useful as they could provide a more descriptive way of naming the cases.

The total number of cases to be generated is indicated as a badge on the generate cases button. Once selected, flotools will create the indicated number of cases in a location specified in your file system. The cases are then available to be ran.


Post processing the results of the study using the OLGA GUI was time consuming due to limitations with the GUI. When using the OLGA GUI to extract the results, the number of cases that can be loaded into the GUI simultaneously is limited. We found that only 47 of the completed cases could be loaded into the OLGA GUI simultaneously. Also, when extracting trend and profile data, only data at one specific simulation time could be considered; what if we wanted to obtain the maximum value during the simulation instead of the value at the last time step? Overall to get the full data set for this project, 4 separate extractions were required.

However, using flotools made this process much more streamlined. The cases just need to be loaded into a flotools workspace and then the results are available for plotting.

After obtaining the data, the next step with the traditional method is to use Excel to create plots of the pig displacement volumes. For each case, the pig exit time was extracted from the pig position in branch (ZPIG) outputs. Then using Liquid Standard Flowrate (QLST) plots, the displacement volumes were obtained for each case by integrating the QLST between the pig launch and exit time. Then the rest of the data must be formatted appropriately to generate the pivot table.

With flotools, the liquid volume rate can be plotted against the desired parameters using the parametric plots tool. The pig displacement volume, maximum liquid rate and maximum gas rate can all be calculated with flotools using its calculations tool.

A comparison of the two post processing methods can be summarized in the following figure:

Figure 3 – Comparison of workflows between OLGA/Excel and flotools/flowpad

Creating all the cases to run for a study is very fast and streamlined with flotools. Even for a case matrix with over 50 cases, the entire process was done in a few minutes (or less for expert users).

However, using the OLGA GUI and Excel took about approximately 10 times as long to create the desired plots due to the limitations of the OLGA GUI. These limitations include how many cases that could be loaded into the GUI simultaneously, and how much info could be exported at one time. Exporting the data in segments was the rate limiting part of this workflow method.

An example of a desired plot for this project can be seen below:

Chart, line chart, scatter chart

Description automatically generated
Figure 4 – Peak liquid outlet rate vs. Inlet liquid rate

To summarize, a time breakdown of each method is given below:

OLGA/Excel method:

  • Open cases in GUI and export QLST and ZPIG to .csv (11 minutes)
  • Find time pig exits from ZPIG data (2 minutes)
  • Integrate QLST between pig launch and exit times (7 minutes)
  • Generate pivot tables (3 minutes)
  • Format plots (create titles, axis labels, etc.) (10 minutes)
  • Total (34 minutes)

flotools method:

  • Open flotools and load cases (5 minutes)
  • Open parametric study tool and select variables and filters/slices. (2 minutes)
  • Format plots (2 minutes)
  • Duplicate plots and change filters (2 minutes)
  • Total (11 minutes)

The difference in the processing times can be especially crucial if the case matrix needs to be modified and thus the simulations re-run. Using the parametric study tool in flotools, the existing parametric study can be copied over and then modified instead of making a new one from scratch therefore reducing the amount of time that would have potentially been spent on project. Likewise, parametric plots generated to analyze the results of a parametric study, can also be duplicated then slightly varied to cover a variety of different comparisons.


Using flotools for a common flow assurance task like studying pig displacement volumes can result in a much more streamlined process compared to using traditional methods like the OLGA GUI. The efficiency boost with flotools is due to several factors; namely flotools ability to process all case files in a single instance, calculations leveraged within flotools, and the ease of data handling and visualization in flotools.  To expand on these arguments, it should be noted that flotools can handle all the cases in the potential case matrix, even cases that have large data files, whereas the OLGA GUI has a limit for the number of cases it can handle at once. Using flotools also would eliminate the need for further post-processing tools like Excel and ensures repeatability of results when using calculations within flotools.  Finally, the workflows in flotools have been designed specifically for flow assurance engineering applications, thus deriving meaningful results can be quickly achieved based on a complete understanding of both input and output data inherent to the design of flotools.

Field-Tested Calculation Saves Hydrate Inhibition Costs during a Cold Well Start Up

This blog post will describe how flotools’ calculation feature was used to calculate the hydrate formation temperature as a function of time and location for a methanol-inhibited system during a cold-well start up.   The analysis demonstrated that a less conservative use of hydrate inhibitor was acceptable.  The well and flowline were successfully started up based on this analysis.  This example is an advanced use of the flotool calculation feature. 

The scenario is a well and flowline where the well is initially shut-in;  the flowline is filled with a seawater/methanol mixture (15% methanol by volume); and a methanol pill has been placed just downstream of the wellhead choke. The choke will be opened, and the hydrocarbons will push the methanol pill and methanol-seawater mixture out of the flowline.  Unfortunately, due to the pipeline profile and the different densities of the hydrocarbon liquid, gas, and aqueous phases, the displacement of the methanol-seawater mixture will not be clean.  The hydrocarbons can potentially flow past the methanol pill, contact the methanol-seawater mixture, and form hydrates if the temperature/pressures conditions are suitable. 

The goals are to ensure that the flowline will not be susceptible to hydrate formation conditions at any point in time or location during the startup sequence and to minimize the size of the methanol pill.  This analysis is a combination of 6 calculations: 5 simple ones, and a final complicated calculation that does the heavy lifting.

First, let us go through the supplementary calculations:

  • The first calculation calculates the water volume in each pipe section. (The density must be calculated instead of using the OLGA water density variable because methanol is considered to be included in the aqueous phase in OLGA)
  • The second calculation determines the methanol volume in each pipe section.
  • The third calculation uses the two previous calculations to determine the percent methanol in the water in each pipe section.

Note that the three calculations shown above could be done in a single calculation, but to be able to output the water and methanol volumes separately as their own variable they are required to be standalone calculations.

Then, because hydrates can only form under specific conditions, the fourth calculation checks for:

  • The existence of hydrocarbon in each section.
  • Whether water is present in each section.
  • Whether the methanol concentration in the water is sufficiently high that hydrates cannot form at any practical temperature/pressure conditions in the flowline.  This is a user specified threshold that can be manually changed.  For this case the threshold is 50% methanol in the aqueous phase.

Now to the fifth calculation, which is the most complicated and calculates the DTHYD variable.  DTHYD is a flotools variable and is defined as the ΔT between the fluid temperature and the hydrate formation temperature at the pressure at a given location and time.  The most difficult of the calculations so far, this one includes the use of lookup tables, interpolations, and the above calculated variables.

The process order inside the flotools calculation module is shown below:

  1. The hydrate curves for differing levels of methanol are generated from a 3rd party program, in this case MULTIFLASH, and imported into flotools.
  2. The pressure inside each pipe section is identified.
  3. The corresponding hydrate formation temperature at the pipe section pressure for each of the hydrate curves, representing different methanol concentration, that have been imported is calculated (6 curves for this example as shown in Figure 1).
  4. Using the methanol concentration variable already calculated for each section, the two curves that bound the methanol concentration are determined.  That is, if the methanol concentration is 22% then the calculation should use the 20% and 30% hydrate curves.
  5. The final hydrate formation temperature is calculated by interpolating between the values that we looked up in Step 3 for the two bounding curves found in Step 4.  This gives the hydrate formation temperature at the specified pressure and methanol concentration.
  6. Subtract the actual temperature in each section from the interpolated hydrate formation temperature in each section at every time the profile was output.
Figure 1:  Imported Hydrate Curves from Multiflash

This fifth calculation would be much simpler if there were only two hydrate formation curves to interpolate between, but because we are using a fine grid for the methanol content, the difficulty comes in determining which two curves to interpolate between in the flotools calculation.  The selection of the correct two curves is done by using the methanol concentration calculated in the third calculation and a series of nested IF statements.

The nested IF statements work somewhat like a stepladder, it first checks whether the methanol concentration is above 0% and if so checks if it is above 10%, then 20%…etc.  Once the IF statement finds a value that it is not above, it exits the nested IF and declares that that value is the upper bound. i.e.,  if the actual percent inhibition is 37%, once it realizes that it is not greater than 40% it then decides that 40% is the upper bound of the two curves. To identify the lower bound we first check if the upper bound is greater than 0 and if it is, we subtract 10% from the upper bound to calculate the lower bound. This is easy because the hydrate curves we generated were generated in uniform 10% increments.  

If the methanol increments were not uniform another set of nested IF statements would be needed.  The IF statements would follow the same stepladder approach but once a value was found to be above the actual methanol concentration, the IF statement would output the previous value, i.e., from our 37% example above, the IF statements would need to output next to the last value as well (i.e., the value before 40% which would be 30%).

The sixth calculation is the final output of the entire analysis.   The sixth calculation does a final check to see if all three of the above conditions are met (the conditions in the fourth calculation), and if so, outputs the DTHYD results from the interpolation, otherwise it outputs a null number that can be manually changed (in this case -50).

We can see the actual application of the calculation in a case described below. This case has a methanol pill placed at the beginning of a flowline with a well shut in upstream.  The rest of the flowline is saturated with a seawater-methanol mixture of 15% methanol by volume (Figure 2).

Figure 2:  Flowline Initial Conditions

The well is then opened, and the hydrocarbons begin to push the methanol pill out of the flowline.  The methanol pill disperses slightly and some gas that had accumulated at the top of the well during the shut-in squeezes past the methanol pill.  The gas has the potential to form hydrates as the three conditions in the fourth calculation are met when gas moves in front of the methanol pill.

Figure 3:  Methanol Pill Displaced by Wellbore Fluids

Figure 3 is quite complicated, but it very nicely illustrates exactly where hydrates can form and the ΔT between the fluid temperature and the hydrate formation temperature (Note:  when DTHYD > 0 hydrates can form).

  1. The red curve is the methane fraction as a function of distance.  Methane is used as a proxy to determine whether hydrocarbons are present.
  2. The blue curve is the methanol concentration (volume %) as a function of distance.
  3. The green curve is DTHYD = fluid temperature minus hydrate formation temperature.

Three distinct regions are evident on Figure 3.  Two of the regions are not at risk for hydrate formation.  On the right-hand side (shaded) of the graph there is a steep drop-off of the Green DTHYD curve because there are no hydrocarbons in this region as shown by the red, methane-fraction curve.  

The left-hand side (shaded) is a trickier region as there are two constraints to hydrate formation:

  1. Either there is no seawater left (it has all been pushed out)
  2. Or the hydrocarbon fluid is more than 50% inhibited with methanol (our specified criterion for full hydrate inhibition).  Note that on the left-hand side, there could be produced water but for this example the produced water was sufficiently salty to inhibit hydrate formation.

In the middle (unshaded), hydrocarbons are present, and the methanol concentration is below our threshold of 50%.  To determine if hydrate formation is possible, we must look at the DTHYD variable.  In this region, the maximum value of DTHYD is -4 °F, indicating that hydrate formation is not possible.  Therefore, the methanol pill size is acceptable for preventing hydrates.