Tutorial: NPV Maximization by Optimizing a Multi-Stage Separation Process

Level: Intermediate

Required Knowledge: Basic Pipe-It knowledge, Tutorial "Optimization of a Multi-Stage Separation Process"

Keywords: Process Simulation, EOS Calculations, Economics, NPV Calculation, Optimization

Pipe-It Utilities: Pipe-It Optimizer, Streamz Tabulator, Linkz, Map Linkz?, Excel Integration.

Introduction

Objective

The objective of this tutorial is to optimize the conditions of a multi-stage separation process to maximize the NPV of the field.

Sketch of the multi-stage separation process used in the tutorial

Both oil and gas are sold. Constant oil and gas prices have been assumed for the economical calculation. The discount rate is assumed to be equal to 10 %.

Conditions (pressure and temperature) of the three first stages are variables of the optimization problem. The objective is to maximize the total field NPV.

The historical molar rates are available and input to the optimization. It is assumed in this tutorial that changing the process conditions does not affect the reservoir depletion.

Getting Started

You can download the required input files here. You will need to login to the server using your existing username and password or register as new user.

Download the file : "Maximization_NPV_By_Optimizing_Process.zip" and un-zip it on your disk.

The folder contains the Pipe-It project built in the tutorial Optimization of a Multi-Stage Separation Process. We advise you to first do the tutorial Optimization of a Multi-Stage Separation Process before starting this tutorial.

Open the Pipe-It project. The canvas should be similar to this:

Pipe-It project used as starting point for the tutorial

Modifications to the Pipe-It Project

Change the Feed Stream File

Select the file "Feed_2_process.str" and right-click on it and select "Set Resource File" (or press F on the keyboard).

Change the input stream file (1/2)

A new window appears. Select the file "Historical_Rates.str" and click on "Save".

Change the input stream file (2/2)

Note that the fluid characterization for this file is still "EOS11". You can check this by right-clicking on the file and select "Set characterization" (or by pressing F3).

You can open the file "Historical_Rates.str" by double-clicking on it. A Strexzel window appears.

"Historical_Rates.str" open in Strexzel

The file contains the field molar rates (in kg-moles/day) of each component for each given time step. This file might be an output of a compositional reservoir simulator.

Re-Configure the Streamz Tabulator to Gather the Gas Streams

Double-click on the composite to navigate into it. Then, double-click on the process element called "Commingle Gas Streams".

Re-configure the Streamz tabulator (1/2)

A new window appears. In the tab "Basics", click on "Add" and then "Add all vars:". This will indicate to Pipe-It that only gas streams produced during the same time step need to be commingled together.

Re-configure the Streamz tabulator (2/2)

Run the Pipe-It Project

You can now run the pipe-It project. Note that the flash calculations (happening in each of the four Streamz separator elements) are performed for all time steps. The EOS gas and oil volume conversion are also performed for all time steps.

You can open the file "Oil_Volume.str" by double clicking on it.

"Oil_volume.str" open in Strexzel

Calculate Yearly Oil and Gas Productions

The economical calculations will be performed on an annual basis. Therefore, we need to calculate the yearly oil and gas production.

Calculate the Yearly Oil Production

Insert a new Streamz Tabulator Element

  1. Insert a new Streamz tabulator.
  1. You need to insert a new resource element. When setting the file name, typewrite "Oil_yearly_rate.str" and set the characterization to "OIL"
  1. Connect the file "Oil_Volume.str" to the tabulator. Choose "INPUT STREAMS".
  1. Connect the tabulator to the output file "Oil_yearly_rate.str". Choose "OUTPUT STREAMS".

You should build something similar to this:

Insert a new Streamz tabulator element

Configure the Streamz Tabulator Element

  1. Double click on the new Streamz tabulator element.
  1. A new window appears. In the tab "Basic", tick the check box "Tabulate"

Configure the new tabulator (1/6)

  1. Click on "Add" and then choose "Add all vars:".

Configure the new tabulator (2/6)

  1. To compute the monthly production, we need to multiply the daily rate (in m3/day) by the number of days. Here we are assuming that in average a month has 30.5 days. To multiply the daily rates by 30.5, you have to tick the check box "Scale" and enter "30.5" in the text box next to it.

Configure the new tabulator (3/6)

  1. In the tab "Advanced", tick the box "Gathering options". Then select the option "Gather streams and put them in order".

Configure the new tabulator (4/6)

  1. We now need to indicate to Pipe-It on which interval production has to be summed up. We want to have yearly production. Clikc on "Choose Domain" and select "Time".

Configure the new tabulator (5/6)

  1. Enter "0" in the text box "Divide into ranges by collation points". This will indicate that the first collation point is at time zero.
  1. Enter "1000*12" in the text box "More collations points by list of steps". This indicates that the next 1000 collation points are separated by the an interval of 12 months (= 1year).

Configure the new tabulator (6/6)

  1. Click on "OK".

Run the Pipe-It Project

You can now run again the Pipe-It project. Open the file "Oil_yearly_rate.str" by double clicking on it.

"Oil_yearly_rate.str" open in Strexzel

This file contains the oil production (in m3) for each year of production. Pipe-It has performed automatically the conversion from daily rates (in m3/day) into monthly production (in m3) by multiplying the rates by 30.5. Then, Pipe-It has summed the monthly production into yearly production.

Calculate the Yearly Gas Production

Copy the New Streamz Tabulator

To avoid having to configure a new Streamz tabulator, we can just copy and paste it on the canvas:

  1. Select the new Streamz tabulator which you have just finished to configure. Right click on it and select "copy". This operation can also be performed by pressing CTRL + C.

Copy a process element

  1. Richt click on the canvas and select "Paste". You can also press CTRL + V.

Paste a process element

Set the Connections

Insert a new resource element on the canvas. When setting the file, typewrite "Gas_yearly_rate.str". Set the characterization to "GAS".

Connect the file "Gas_volume.str" to the tabulator. Choose "INPUT STREAMS".

Connect the tabulator to teh file Gas_yearly_rate.str". Choose "OUTPUT STREAMS".

Rename the Streamz Tabulator =

Rename respectively the tabulators "Compute Gas yearly production" and "Compute Oil yearly production".

At this moment, your canvas should be similar to this:

Current status of the canvas

Economics Calculations

The economics calculations in this tutorial consist of a simple NPV calculation done a yearly basis. You can open the Excel file "NPV_calculations.xlsx" located in the tutorial folder.

Excel file "NPV_calculations.xls"

The oil and gas rates (in purple) need to be linked to the rates calculated by Pipe-It. This will be done using Linkz and a process element called Map Linkz?. Maplinkz is capable of automatically doing "copy-paste" operations from one file to another. Input and output links need to be defined first.

  1. Open the file "Oil_yearly_rates.str" in Linkz.
  1. Double click on the first number of the oil production column ("220160").
  1. A new window appears. Change the name of the Linkz and rename it "Oil_yearly_Rate".

4.Change the link type to Column.

Create a link for the yearly oil production (1/3)

  1. Tick the check box below.

Create a link for the yearly oil production (2/3)

Note that the entire column is now highlighted in green.

  1. Change the keyword to "DATA" using the arrows.

Create a link for the yearly oil production (3/3)

You can test the number of occurrences and make sure the link is defined in a unique way by clicking on "TEST".

  1. Click on "OK".

You have now defined a new link for the entire column.

Follow the same procedure to create a link for the entire column containing the yearly gas production (in the file "Gas_yearly_Rates.str"). Call the link "Gas_Yearly_rate".

  1. Insert a new resource element on the canvas. When setting the file, choose "NPV_Calculation.xls". Note that this resource does not need a characterization.
  1. Select the new resource element and right click on it. Choose "Open in Linkz"

Open an Excel file in Linkz

  1. The owrkbook is now open in Linkz. Pin point an double click on the cell "Row 12 Column 2". A new window appears.
  1. Re-name the link "Oil_xls".
  1. Change the type and choose column.
  1. Tick the check box below. Now the entire Oil Production column should be highlighted in green.
  1. Change the keyword to "Year" using the arrows.
  1. Click on "Ok".

Define a link for the oil rate inside the Excel workbook

Follow the same procedure to create a link for the yearly gas rates. Call it "Gas_xls".

Once you have created the link for the gas yearly production, create a link for the NPV:

  1. Pin-point and double click on the NPV. (Row 24 Column 8). A new window appears.
  1. Re-name the link "NPV".
  1. Change the keyword to "TOTAL NPV" using the arrows.
  1. Click on "OK".

Define a link for the NPV inside the Excel workbook

We now want to map the oil and gas productions from the Stream files to the Excel workbook. This can be done easily using the Map Linkz? element of Pipe-It.

Insert a New Map Linkz? Process Element

Insert a new Map Linkz? element either by:

Insert a new MapLinkz element

Set-up the Connections

  1. Connect the file "Gas_yearly_rates.str" to the Map Linkz? element. Choose "INPUT FILES WITH LINKS".

MapLinkz connections (1/2)

  1. Connect the file "Oil_yearly_rates.str" to the Maplinkz element, following the same instructions.
  1. Connect the Maplinkz element to the Excel file "NPV_calculation.xls". Choose "OUTPUT FILES WITH LINKS".

MapLinkz connections (2/2)

Configure the Map Linkz? Element

  1. Double click on the Map Linkz? Element. A new window appears.
  1. Double click on "Input".

Configure the MapLinkz element (1/5)

  1. A new window appears. Choose "Oil yearly_Rate" and click on "OK".

Configure the MapLinkz element (2/5)

  1. Double click on "Output". A new window appears. Choose "Oil_xls" and click on "OK".

Configure the MapLinkz element (3/5)

Now, the links "Oil yearly_Rate" and "oil_xls" are associated. The column containing the yearly oil production will be automatically copied to the right place in the Excel file.

  1. Add a new link mapping by clicking on the + button.

Configure the MapLinkz element (4/5)

  1. Following the same instructions, associate the link "Gas_yearly_rate" to "Gas_xls".

Configure the MapLinkz element (5/5)

  1. Click on "OK".

You can now run the Pipe-It project.

Note that Map Linkz? will not work if the Excel file is open. You first need to close it before running the Pipe-It project.

NPV Optimization

  1. Open Pipe-It Optimizer.
  1. To open an existing configuration, click on "Open". Then, select "Optimization_File.ppo" and click on "Open". This will open the optimizer configuration of the tutorial Optimization of a Multi-Stage Separation Process.

Open an existing optimization configuration

  1. Rename the objective and call it "NPV". Double click on the corresponding link cell.

Re-configure the optimizer (1/2)

  1. Typewrite "NPV" in the text box at the top of the new window and then select the link called "NPV".

Re-configure the optimizer (2/2)

The optimizer is ready for being launched. You can save the configuration by clicking on the "Save" button.

Variables and constraints remain unchanged. The objective is now mapped to the NPV calculated by Excel. When you launch the optimizer, the following actions will occure:

  1. Process simulation (4-stage process with the current pressure and temperature conditions)
  1. Volumetric calculation for all time steps.
  1. Calculate the yearly production of gas and oil.
  1. Transfer the yearly oil and gas production to Excel.
  1. Read the new NPV calculated by Excel based on the yearly oil and gas production.
  1. Choose new pressure and temperature conditions and go back to step 1.

This set of actions occurs until (1) a maximum is reached or (2) the maximum number of iterations has been reached.




Copyright © 2008-2013 Petrostreamz