Sunteți pe pagina 1din 18

Oil Stabilization with Optimization 1

Oil Stabilization with


Optimization

2001 Hyprotech Ltd. - All Rights Reserved.


1.1.10 Oil Stabilization with Optimization_3.pdf 1
2 Oil Stabilization with Optimization

Workshop
In this example, a poor-boy stabilization scheme is used to separate an
oil and gas mixture into a stabilized oil and a saleable gas. This
approach is used in many gas plants around Alberta where liquid
production is small and does not warrant a full distillation column. A
Fast Track to page 9. simple three-stage separation with heating between each stage is used
and the object of the exercise is to select the let-down pressure and
temperatures such that the products revenue less the utilities cost is
maximized. A special tool in HYSYS, the Optimizer will be used to find
the optimum operating conditions.

Learning Objectives
Once you have completed this section, you will be able to:

Use the Optimizer tool in HYSYS to optimize flowsheets


Use the Spreadsheet to perform calculations

Prerequisites
Adding Streams and Operations
Using the Spreadsheet

2
Process Overview
4 Oil Stabilization with Optimization

Building the Simulation


Defining the Simulation Basis
For this case you will be using the Peng Robinson EOS with the
following components: C1, C2, C3, i-C4, n-C4, i-C5, n-C5, C6, C7, C8, and
C9.

Modifying the Unit Set


For this case, the units for Molar Flow are in m3/d_gas, instead of the
default Molar Flow units, kgmole/h, and the units for Liquid Volume
Flow are m3/d, not the default, m3/h.

1. From the Tools menu select Preferences, and go to the Variables


tab, Units page.
2. Select the SI unit set as the default.

You cannot edit the default set, but you can make a copy of it by
pressing the Clone Unit Set button.

3. Rename the cloned unit set to Optimizer.


If you are working in Field 4. Move the cursor to the Flow cell.
units, choose MMSCFD for the
Molar Flow and bbl/d for the 5. Select m3/d_gas from the drop down menu in the Edit Bar.
Liquid Volume Flow. 6. Move the cursor to the Liq. Vol. Flow cell.
7. Select m3/d from the drop down menu in the Edit Bar.

4
Oil Stabilization with Optimization 5

Starting the Simulation


1. Add a Material stream with the following values:

In this cell... Enter...

Name Feed

Temperature 10C (50F)

Pressure 4125 kPa (600 psia)

Molar Flow 28 200 m3/d_gas (1 MMSCFD)

Component Mole Fraction

C1 0.316

C2 0.158

C3 0.105

i-C4 0.105

n-C4 0.105

i-C5 0.053

n-C5 0.053

C6 0.027

C7 0.026

C8 0.026

C9 0.026

The simulation contains three separators for separation of vapour and


liquid. The first separator pressure will be fixed at the Inlet gas pressure.
The pressure of the downstream separators is set by specifying the
pressure of their outlet vapour streams. By default, the delta P on the
Separator is 0 so you will have to delete this default value on the
Parameters tab of Stage 2 and Stage 3 before you can specify the outlet
stream pressures.

Each stage of separation has a preheater.

5
6 Oil Stabilization with Optimization

2. Add 3 Heaters to the simulation with the following information:

In this cell... Enter...

Connections

Name Heater1

Inlet Feed

Outlet HotFeed1

Energy Steam 1

Parameters

Pressure Drop 0 kPa

Duty 4.25e+05 kJ/h (4.0e+05 Btu/hr)

In this cell... Enter...

Connections

Name Heater2

Inlet Stage1 Liq

Outlet HotFeed2

Energy Steam 2

Parameters

Pressure Drop 0 kPa

Duty 3.15e+05 kJ/h (3.0e+05 Btu/hr)

In this cell... Enter...

Connections

Name Heater3

Inlet Stage2 Liq

Outlet HotFeed3

Energy Steam 3

Connections

Pressure Drop 0 kPa

Duty 1.13e+05 kJ/h (1.0e+05 Btu/hr)

6
Oil Stabilization with Optimization 7

3. Add 3 Separators with the following information:

In this cell... Enter...

Connections

Name Stage1

Feed HotFeed1

Liquid Outlet Stage1 Liq

Vapour Outlet Stage1 Vap

Parameters

Pressure Drop 0 kPa (default)

In this cell... Enter...

Connections

Name Stage2

Feed HotFeed2

Liquid Outlet Stage2 Liq

Vapour Outlet Stage2 Vap

Parameters

Pressure Drop <empty> (delete default value)

In this cell... Enter...

Connections

Name Stage3

Feed HotFeed3

Liquid Outlet Liquid Product

Vapour Outlet Stage3 Vap

Parameters

Pressure Drop <empty> (delete default value)

7
8 Oil Stabilization with Optimization

4. Add 2 Compressors with the values shown in the following tables:

In this cell... Enter...

Connections

Name Comp1

Inlet Stage2 Vap

Outlet Comp1 Out

Energy Comp1-hp

Parameters

Adiabatic Efficiency 75% (default)

In this cell... Enter...

Connections

Name Comp2

Inlet Stage3 Vap

Outlet Comp2 Out

Energy Comp2-hp

Parameters

Adiabatic Efficiency 75% (default)

5. Add a Mixer with the information provided below:

In this cell... Enter...

Connections

Name Gas Mixer

Inlets Stage1 Vap


Comp1 Out
Comp2 Out

Outlet Gas Product

Parameters

Pressure Assignment Set Outlet to Lowest Inlet (default)

8
Oil Stabilization with Optimization 9

6. Make the necessary stream specifications

In this cell... Enter...

Stage2 Vap, Pressure 2050 kPa (300 psia)


Open the case Optional10.hsc Stage3 Vap, Pressure 350 kPa (50 psia)
Complete the following
questions and then continue Comp1 Out, Pressure 4125 kPa (600 psia)
the Module.
Comp2 Out, Pressure 4125 kPa (600 psia)

What is the volumetric Liquid Product Flow?


__________
What is the molar Gas Product Flow? __________

Checking the Liquid RVP


The RVP of the Liquid Product stream should be about 96.5 kPa (14
HYSYS treats Utilities as psia) to satisfy the pipeline criterion.
stream properties and so will
recalculate the Utility every The RVP for a stream is located in the Cold Properties Utility.
time the stream is
recalculated.
The Utility can be added by selecting Utilities from the Tools menu or
from the Utility page of the Attachments tab of the Liquid Product
stream property view.

What is the current RVP of Liquid Product? __________

9
10 Oil Stabilization with Optimization

The Optimizer
HYSYS contains a multi-variable Steady State Optimizer. Once your
Flowsheet has been built and a converged solution has been obtained,
you can use the Optimizer to find the operating conditions which
minimize or maximize an Objective Function. The Optimizer owns its
own Spreadsheet for defining the Objective Functions as well as any
constraint expressions to be used. This allows you to construct
Objective Functions which maximize profit, minimize utilities or
minimize exchanger UA.

Primary Variables - these are flowsheet variables whose


values are manipulated in order to minimize (or maximize) the
objective function. You set the upper and lower bound for the
primary variables, which are used to set the search range.
Only user-specified process
variables can be used as Objective Function - this is the function which is to be
Primary Variables minimized or maximized. The function has to be defined within
the Spreadsheet. This allows the user a great deal of flexibility
in defining the function.
Restrictions on the Optimizer Constraint Functions - inequality and equality functions are
defined in the Spreadsheet. In solving the Objective Function,
only available for Steady-
the Optimizer must also meet any constraints that are defined
State calculations
by the user.
it cannot be used in
Templates. In our case, we want to maximize the total profit while achieving an
RVP of Liquid Product less than 96.5 kPa.

The Revenues from the Plant are the Gas Product and the Liquid
Product. The associated costs are the Steam Costs for each Heater plus
the Compression Cost for each Compressor.

Profit = Revenue - Cost

Profit = Gas Product + Liquid Product - Steam Costs - Compression Cost

Which Variables can we change to affect the Steam


Cost? _________
How is the Compression Cost measured? __________
Which Variables can we change to affect the
Compression Cost (remember the Compressor outlet
pressure is fixed)? __________
What should the Process (Adjusted) Variables be to
maximize profit (there are five)? __________,
__________, __________, __________, __________

10
Oil Stabilization with Optimization 11

To invoke the Optimizer, select Optimizer under Simulation in the


Menu Bar, or press <F5>.

Variables Tab

The Optimizer is not an When you invoke the Optimizer for the first time, you are placed on the
operation block and it will not Configuration tab. Select the Default model. Then move to the
show up in the PFD.
Variables tab. On the Variables tab you define the Process (Adjusted)
Variables to be used in the Optimization.

1. Press the Add button to add the first variable, Steam1, Heat Flow.
2. Set the Low Bound at 0 and the High Bound at 1.0e6 kJ/h (1.0e6
Btu/hr).
3. The complete list of Process Variables are shown in the table
below.

Variable Low High


Reasonable upper and lower Object Units
Description Bound Bound
bounds are important. Set
values which can be achieved Steam 1 Heat Flow kJ/h (Btu/hr) 0.0 (0.0) 1.0e+6
in your actual design, i.e.,
dont set a high bound for a (1.0e+6)
Steam Heat Flow that is more
than what is available at your Steam 2 Heat Flow kJ/h (Btu/hr) 0.0 (0.0) 1.0e+6
plant. (1.0e+6)

Steam 3 Heat Flow kJ/h (Btu/hr) 0.0 (0.0) 1.0e+6


(1.0e+6)

Stage2 Vap Pressure kPa (psia) 650 (95) 3500 (510)

Stage3 Vap Pressure kPa (psia) 70 (10) 1000 (145)

11
12 Oil Stabilization with Optimization

Defining the Spreadsheet


The Optimizer has its own Spreadsheet for defining the Objective and
Constraint functions. Primary Variables may be imported and
functions defined within the Optimizer Spreadsheet, which possesses
the same capabilities as the Main Flowsheet Spreadsheet.
The Spreadsheet is an
operation and thus the
Spreadsheet cells get updated 1. Press the Spreadsheet button on the Optimizer view to open the
when Flowsheet variables Spreadsheet.
change.
2. On the Parameters tab of the Spreadsheet view, increase the
Number of Rows from 10 to 15.
3. Move to the Spreadsheet tab.

Importing and Exporting Variables


You may import virtually any variable in the simulation into the
Spreadsheet and you can export a cells value to any specific field in
your simulation.

Object Inspection - object inspect (secondary mouse button)


the cell which you want to Import into, or Export from. From the
Menu that appears, select Import Variable or Export Formula
Result. Then, using the Variable Navigator, select the variable
you wish to import or export.
Connections page tab - select the Add Import or Add Export
button. Then, using the Variable Navigator, select the variable
you wish to import or export.
Drag n Drop - using the secondary mouse button, click the
variable value (from the WorkBook or Property View) you wish
to import, and drag it to the desired location in the
Spreadsheet. If you are exporting the variable, drag it from the
Spreadsheet to the exported location.

Adding Formulas
Complex mathematical formulas can be created, using syntax that is
similar to conventional Spreadsheets. Arithmetic, logarithmic and
trigonometric functions can be performed in the Spreadsheet.

All normal functions must be preceded by a + or = symbol. Special


Functions must be preceded by the @ symbol.

Some of the functions available are:

Addition (+): +A1+A2


Subtraction (-): +A1-A2

12
Oil Stabilization with Optimization 13

Multiplication (*): +A1*A2


Division (/): +A1/A2
Power (^): +A1^3
Absolute Value (@ABS): @ABS(A1)
Square Root (@SQRT): @SQRT(A1)
Press the Function Help Natural Log (@ln): @ln(A1)
button to view the Available Exponential (@exp): @exp(A1)
Spreadsheet Functions and
Expressions.
The following variables need to be imported into the Spreadsheet.

Cell... Object... Variable...

B1 Cold Properties-1 Reid VP

B4 Liquid Product Liquid Volume Flow


In order to have access to the
Utility variable needed in cell B8 Comp1-hp Heat Flow
B1. The Utility radio button in
the Navigator Scope box must B9 Comp2-hp Heat Flow
be selected.
B12 Steam 1 Heat Flow

B13 Steam 2 Heat Flow

B14 Steam 3 Heat Flow

D4 Gas Product Molar Flow

The following constants should be added to the spreadsheet

Cell... Value... Comment...

B2 96.5 kPa (14 psia) RVP spec

B6 157.25$/m3 (25$/bbl) Oil Price

B10 0.1 $/kw-h Compression Cost


(2.9e-5 $/Btu)

B15 1.819$/kw-h Steam Cost


(0.0005$/Btu)

D6 0.283 $/m3_gas Gas Price


(8 $/MSCF)

Conversion factors you may need:

1 kw-h = 3412 Btu

1 kw-h = 3600 kJ

13
14 Oil Stabilization with Optimization

Additional comments can be added, though they are not necessary.


After all of the necessary variables have been imported and the
formulas have been entered the spreadsheet should look something
like the following.

You can change the Variable


Type to Unitless for dollar
value variables.

Which Spreadsheet Cell defines the Objective Function


(i.e., which cell do we want to maximize)? __________
Define the Constraint Function (RVP < 96.5 kPa) with
reference to Spreadsheet cells. __________

14
Oil Stabilization with Optimization 15

Functions tab
The Functions tab contains two groups, the Objective Function and
the Constraint Functions.

1. In the Cell area of the Objective Function group, specify the


The Constraint Function is Spreadsheet cell that defines the Objective Function. Use the
multiplied by the Penalty drop down menu in the Edit Bar to select the appropriate cell.
Value; the higher the Penalty The Current Value of the Objective Function will be provided.
Value, the more weight that is
given to that constraint. 2. Select the Maximize radio button
3. In the Constraint Functions group, press the Add button to
define the constraint.

Parameters tab
The Parameters tab is used for selecting the Optimization Scheme.

Box - Handles inequality constraints but not equality


constraints. It generally requires a large number of iterations to
converge on the solution.
SQP - Sequential Quadratic Programming, handles inequality
For more information on the
and equality constraints. Considered by many to be the most
Optimization Schemes, refer
efficient method for minimization.
to the manual section 17.2 or Mixed - Handles inequality constraints only. It is a combination
the on-line Help. of the Box and SQP methods. It starts the minimization with the
Box method using a very loose convergence tolerance. After
convergence, the SQP method is used to locate the final
solution.

15
16 Oil Stabilization with Optimization

Fletcher Reeves - Does not handle constraints. Efficient


method for general minimization.
Quasi-Newton - Does not handle constraints. Similar method
to Fletcher Reeves.
1. Select the SQP method as the Scheme
2. Use the defaults for Tolerance and Number of Iterations
3. Change Shift A and Shift B to 1.0

Monitor tab
The Monitor tab displays the values of the Objective Function, Primary
The constraint values are Variables and Constraint Functions during the Optimizer calculations.
positive if inequality
constraints are satisfied and 1. Move to the Monitor tab and press the Start button to begin the
negative if inequality optimization.
constraints are not satisfied.

Save your case!

16
Oil Stabilization with Optimization 17

Analyzing the Results


Once the Optimization is complete, examine the results and fill in the
following Table.

Base Case Optimized Case

Gas Product Flow, 25343 (0.8950)


m3/d_gas (MMSCFD)

Liquid Product Flow, 17.247 (108.5)


m3/d (bbl/d)

Total Profit, $/d -534

Steam1 Heat Flow, kJ/h 425 000 (400,000)


(Btu/hr)

Steam2 Heat Flow, kJ/h 315 000 (300,000)


(Btu/hr)

Steam3 Heat Flow, kJ/h 113 000 (100,000)


(Btu/hr)

Stage2 Vap Pressure, 2050 (300)


kPa (psia)

Stage3 Vap Pressure, 350 (50)


kPa (psia)

RVP of Liquid Product, 97.85 (14.19)


kPa (psia)

17
18 Oil Stabilization with Optimization

Exploring with the Simulation


Exercise 1
One thing you may notice with the Optimized solution is that the
Pressure of Stage3 Vap has been decreased to 70 kPa (10 psia) which is
less than atmospheric. This is not a desired condition for the inlet of a
compressor. The inlet of the second compressor, Comp2, cannot be less
than 125 kPa (19 psia). What is the maximum profit if you adhere to this
guideline?

18

S-ar putea să vă placă și