Professional Documents
Culture Documents
Refinery
Engineers
Training
Ni g hti m e i n Pe t ro m i d i a
AspenTech
Process
Industry
Modeling
System
Process Industry Modeling System
Contents:
3
PRODUCTION –Refinery overview
4
PRODUCTION REPORTING- Material Balance
5
PRODUCTION REPORTING- Material Balance
Basic Principle
Must come out
6 What goes in
General description of PIMS - What is PIMS
7
General description of PIMS - What does PIMS do
The purpose:
Maximize the economic margin
8
General description of PIMS - PIMS is use in
OPERATIONAL AREA
•Monthly Operational Plan - 3 months rolling plan
•Latest Estimation
•Budget - 5Years Business Plan
•Backcasting reports STRATEGICAL AREA
9
General description of PIMS - Info flow
Feedstock Market
PPO
PIMS • Products sales : quantity and prices
• Commercial constrains
• Acquisition of crude and other
feedstock Refinery
• Crude and other feedstock prices
• Availability of crude and other
feedstock
• Units capacity / yields
• Technological constrains
• Blanding constrains
• Stocks strategy
7 8 9 10 11 12 13 7 8 9 10 11 12 13 7 8 9 10 11 12 13 7 8 9 10 11 12 13
14 15 16 17 18 19 20 14 15 16 17 18 19 20 14 15 16 17 18 19 20 14 15 16 17 18 19 20
21 22 23 24 25 26 27 21 22 23 24 25 26 27 21 22 23 24 25 26 27 21 22 23 24 25 26 27
28 29 30 31 28 29 30 31 28 29 30 31 28 29 30 31
11
General description of PIMS - Info flow
Refinery Plan
Plan
Input Final
Final
Feedstock Input Model
Model Objectives
Objectives
YES
Supply (MOP Met Plan
Plan
(MOP Runs
Runs Met (MOP)
(MOP)
Marketing Basis)
Basis)
NO
GAP
Feedback
Feedback Actual
totoPlanning Actual
Planning Results
Results
Process
Process
12
Linear Programming Concepts
Definition
A linear program (LP) is a mathematical model of a process. The process can be a refinery, chemical plant, distribution network, or any
situation with variables and constraints.
Notice there are more unknowns (variables) than equations (constraints). This means there are an infinite number of solutions to the
problem. To determine the best or optimum solution an objective function row (OBJFN) is created. This row will include feedstock
costs, operating costs, and sales prices of products to arrive at the most profitable or optimum solution to the problem. The algorithm
attempts to maximize the value of the objective function row. This value is calculated as the algebraic sum of each variable’s solution
value multiplied by its coefficient in the objective function row. Each variable’s solution value is also known as its “activity” in the
solution.
In an LP the variables and constraints must have unique names. In our example the variables are named X 1, X2, X3, X4, and X5, while
the constraints are named Eq1, Eq2, and Eq3.
X1 X2 X3 X4 X5 RHS
Eq1 +a –b +c +d = K
Eq2 –e –f +g –h L
Eq3 +i –j +k 0
13 OBJFN + yy – zz
Linear Programming Concepts
Definition
A linear program (LP) is a mathematical model of a process. The process can be a refinery, chemical plant, distribution network, or any
situation with variables and constraints.
Notice there are more unknowns (variables) than equations (constraints). This means there are an infinite number of solutions to the
problem. To determine the best or optimum solution an objective function row (OBJFN) is created. This row will include feedstock
costs, operating costs, and sales prices of products to arrive at the most profitable or optimum solution to the problem. The algorithm
attempts to maximize the value of the objective function row. This value is calculated as the algebraic sum of each variable’s solution
value multiplied by its coefficient in the objective function row. Each variable’s solution value is also known as its “activity” in the
solution.
In an LP the variables and constraints must have unique names. In our example the variables are named X 1, X2, X3, X4, and X5, while
the constraints are named Eq1, Eq2, and Eq3.
X1 X2 X3 X4 X5 RHS
Eq1 +a –b +c +d = K
Eq2 –e –f +g –h L
Eq3 +i –j +k 0
14 OBJFN + yy – zz
Linear Programming Concepts
Although this model is very similar to a PIMS model it is not complete and not completely accurate in the model structure. There must
obviously be other blend components for E5S in order to blend the Straight Run Gasoline in order to meet specifications. It is only a very
simple example of how a refinery model might look. An actual PIMS model can be very, very complex and much more detailed.
16
Linear Programming Concepts
The constraints of a process can be inequalities as well as equalities. These represent the limits of operation and are only
needed for the optimization step if the constraint will actually be limiting at some point.
The types of rows found in a process model are material balances, blending specifications, ratios, unit capacities, utility
balances, stream property balances, distributive recursion rows, and other process unit limitations.
The only thing unknown about a column is its “activity,” or value, in the optimum solution. As far as the optimizer is
concerned all other properties about the variable are known. However, this may not be true for the user of the LP. For
instance, in a petroleum refinery model the yield and properties of each fractionated stream coming from each crude oil,
component blending properties, process unit yields, process unit limits, etc. must all be determined ahead of time and made
available to the optimizer.
Columns generally represent flow in a process model. This flow can be in terms of mass, such as pounds or tons, or volume,
such as barrels or cubic feet.
In some cases it may take several columns to adequately model the stream in a process model. An example of this is a
gasoline catalytic reformer where several different severity options are available to the problem.
17
Linear Programming Concepts
Each column usually will have entries in more than one equation or row. One problem the user has is to adequately relate LP
vector properties to actual process properties. Examples of these problems are: yield decline as a result of catalyst aging,
process unit yield as a function of feed quality, physical properties of pools whose composition is determined by the optimizer
and is therefore unknown to the user when the case is submitted for solution.
The types of columns found in a PIMS model are purchases, sales, specification blending vectors, formula blending vectors,
process submodel vectors, distributive recursion property error vectors, and user specified control vectors.
The activity of a row is the algebraic sum of each column activity multiplied by its coefficient in the row.
The units of the RHS constraint must be consistent with the units of its corresponding row.
In a PIMS model the RHS of most rows is zero; with the exception of capacity rows, whose RHS will be greater than zero.
18
Linear Programming Concepts
Ranges
A range represents an upper or lower limit on a row activity. For instance, if a process unit has a maximum capacity of 120
t/day and a minimum capacity of 80 t/day the range is –40 t/day. The capacity can range from 120 t/day down to 80 t/day.
Bounds
The bounds section of an LP is used to set upper and lower limits on the activity of a column in the optimum solution. When
the upper and lower limits are equal the activity of the column is fixed at that level of activity.
All columns, by definition, will have an upper bound of plus infinity and a lower bound of zero unless the user changes them.
Matrix Coefficients
Matrix coefficients are the row entries of a column that define all relevant properties of the column including price, cost,, yield,
disposition, physical properties, utility consumption, and capacity consumption.
As an example, a crude unit charge vector will have coefficients relating how a specific crude oil will be fractionated in a
specific crude unit. A gasoline reformer severity vector will have coefficients showing a specific yield pattern for that severity
along with specific utility and capacity consumption as they relate to that severity.
The coefficients are also the column entries of a row that relate to a particular constraint for various columns.
As an example, a normal butane material balance row will have coefficients showing the yield of normal butane from various
process units in a refinery model and make the total amount of normal butane available to other processing or sales.
19
Linear Programming Concepts
Problems With LP
There are several problems using linear relationships to model non-linear process operations. In a petroleum refinery some of these
problems can be illustrated as follows:
Many process units are reactions which take place over a catalyst. As This is typically seen when blending TEL into
the catalyst is spent, the yield from the process unit deteriorates. The gasoline to improve octane. The response curve
LP can only look at one set of yields at a time. If the yield changes lends itself to a good approximation by utilizing
with time, the user must relate that to the LP by updating appropriate tangents to the response curve, the slopes of which
yield coefficients. An example of this behavior is reformer yield loss approximates the response of the blend to the
with catalyst aging. additive.
Catalyst Aging
C5+
Yield
Time
20
Linear Programming Concepts
Problems With LP
Synergism or Antagonism
In the real world when two or more streams are blended together, the resulting blend may not exhibit the properties of the same
blend when the properties are rationed mathematically in the same proportion as the blend. When the actual blend properties are
less than the calculated properties, this is known as antagonism. When the actual blend properties are greater than the calculated
properties, this is known as synergism. This is a problem for the LP because the optimizer can only recognize one set of blending
values per solution.
100 100
Synergism
Octane Average Octane
Antagonism
70 70
Component A 0 50 100
Component B 100 50 0
% In Blend
21
Linear Programming Concepts
LP Accuracy
Accuracy of data is a problem, which all users must be concerned with. This problem must also be of concern to tech service
and operations people who must help in the collection of good data. An effort must be made to collect and analyze
representative samples, as well as provide accurate utility and capacity consumption data. Efforts must be made to separate the
effects of one variable from the effects of other variables. The matrix coefficients must accurately reflect real operating data.
As an example, in the operation of a fluid catalytic cracker (FCC) the yield of each gaseous and liquid product is a function of
many variables. For instance, the amount of Cat gasoline yielded can be altered by changes in feed quality, riser temperature,
cat-to-oil ratio, heat balance, etc. Therefore, when gathering FCC yield data it is important to only allow one variable to change
at a time in order to separate out the yield effects of changes in the other variables.
The LP matrix structure must also accurately reflect the process options available. While it is not necessary to model every
pipe and valve in a plant, care must be taken that necessary variables and constraints are modeled. If an option is not
represented in the matrix it cannot be evaluated by the optimizer as a viable solution.
22
PIMS Row/Column Types
24
PIMS Computer Configuration/ Set up
Action Bar
25
PIMS Computer Configuration/ Set up
File Options
Edit Options
View Options
26
PIMS Computer Configuration/ Set up
Model Options
Run Options
27
PIMS Computer Configuration/ Set up
Tools Options
Windows Options
Help Options
28
PIMS Computer Configuration/ Set up
29
PIMS Computer Configuration/ Set up
30
PIMS Computer Configuration/ Set up
Report Settings
31
PIMS Computer Configuration/ Set up
Recursion Settings
32
PIMS Computer Configuration/ Set up
Model Tables
33
PIMS Computer Configuration/ Set up
Making a Run
35
PIMS Computer Configuration/ Set up
Full Solution
Location
Summary
Solution
Location
36
PIMS Computer Configuration/ Set up
37
PIMS Computer Configuration/ Set up
38
PIMS Computer Configuration/ Set up
39
PIMS Computer Configuration/ Set up
Model Tree
Flowsheets
Unit detail
40
PIMS Data Tables and Reports
Required Tables
BUY Defines materials that will be purchased into the plant model
SELL Material that will be sold from the plant model
Other Supply/Demand Tables
UTILBUY Defines utilities that will be purchased or produced by the plant model
UTILSELL Defines utilities that will be produced and sold from the plant model
GROUPS Aggregates materials for purchases, sales, blending, and reporting
ALTTAGS Allows tiered pricing for purchases and sales
41
PIMS Data Tables and Reports
Blending Tables
BLENDS Defines materials that are specification or formula blends
BLNMIX Defines formula blend composition and maps components to spec blends
BLNSPEC Defines specifications for spec blends
BLNxxxxx Provides properties of materials used in LP
INDEX Provides relationship between properties and their linear indices
SCALE Provides matrix scaling factors for selected properties
WSPECS Defines which specification blend properties are blended gravimetrically
42
PIMS Data Tables and Reports
ASSAYS - Defines cut yields and properties for each crude available to
the model
UNITS - Provides crude oil gravity’s and changes units of measure for
other materials
43
PIMS Data Tables and Reports
Submodel Tables
SUBMODS: List of submodel tables to include in LP and Validation Report
CAPS: Capacity limits of process units
Sxxx Process unit submodel for process xxx
Sxxx submodel tables used in the training model listed in same order as Table SUBMODS
CR1 Logical Crude Unit 1 (not a spreadsheet but appears in Validation.lst)
CR2 Logical Crude Unit 2 (not a spreadsheet but appears in Validation.lst)
UNHT - Naphtha Hydrotreater
UR94/UR98 - Catalytic Reformer
USGP- Sat Gas Plant
UKMP - Kerosene Mix Pool
UDMP – Diesel Mix Pool
UKH1/ UKH3 – Kerosene Hydrotreater ( 1 –diesel mode and 3 – kero mode)
UDH1 - Diesel Hydrotreater
UFH1/ UFH3 - Distillate Hydrotreater ( 1- cat feed mode from FCC; 3 – diesel mode)
UHKR - Mild Hydrocracker
UFCL/ UFCH - Catalytic Cracking Unit low/ high severity
UUGP – Unsat Gas Plant
UMTB- MTBE Unit
UDCK - Delayed Coker Unit
UPFS- Plant Fuel System
UFLR - Flare recovery system
UAMN - Amine Treating
USRU Sulfur Recovery Unit
UHYH / UHYN - Hydrogen Header/ Hydrogen Plant
44
PIMS Data Tables and Reports
Also in the model can be a lot of submodels used for strategical simulations. Units which are not in use but are included in business plan
or are in conservation like:
Recursion Tables
Miscellaneous Tables
CASE Defines cases that modify existing matrix
ROWS Changes sense of rows and adds additional structure to LP
BOUNDS Controls activity of non-purchase and non-sales vectors
PRNTABS List of miscellaneous tables included in Validation.lst
REPORT Provides fixed costs, report suppression, and report spreadsheet creation
VPOOL Defines Virtual Pools for automatic generation of compositional recursion pool structure
45
Distributive Recursion
Recursion
Before we address the issue of Distributive Recursion, or DR as it is referred to, let us first address the issue of Recursion.
What is Recursion?
In the early days of linear programming, when a model was built to represent a process such as a refinery, there was, of necessity,
data in the model that had to be estimated. These data were usually physical property data of materials used in the refinery to
produce refined products. For example, gasoline is blended in a refinery to meet certain specifications for octane, vapor pressure,
sulfur content, distillation, etc. Therefore, when blending data was provided for each of the blend components to be used by the
optimizer to blend gasoline, the user estimated most of these data. Unfortunately, much of these data were dependent on other
factors such as feedstock qualities and operating conditions. In other words, they were dependent on the composition of the crude
slate feeding the refinery or the way the refinery process units were operated. The cut point for each material coming from the crude
unit was a factor, as well as the severity at which the reformer was run and the ratio of C3 olefin to C4 olefin in the feed to the alky
unit.
Because much of these data were estimated or guessed at by the user, the data in the model was inaccurate or wrong. To compensate
for this, a technique was developed to try to improve the data as the model was being solved. This technique, which came to be
known as Recursion, was very ingenious. The optimizer first solved the model with the estimated data in it. After solving the model,
an external computer program written in a computer language such as, Fortran, PL/1, or Assembly Language, calculated the physical
property data being used in the model from the optimum solution. In other words, the external program examined the optimum
solution just produced by the optimizer and calculated the physical property data of the crude fractions by using the composition of
the crude slate in the solution. This data was then inserted into the model (LP matrix) thereby updating the estimated data with more
accurate data. The model was resubmitted to the optimizer and solved again. The same external program then examined this second
solution, the same data recalculated, the recalculated data inserted into the matrix and the model solved again. This process was
repeated until the changes taking place in the calculated data were small enough to be within certain tolerances specified in the
external program.
46
Distributive Recursion
Distributive Recursion is the next logical extension of the simple recursion described above. In simple recursion, the difference
between the user’s guess and the optimum solved value is calculated in an external computer program, updated, and re-optimized.
Distributive Recursion model structure moves that error calculation from outside the LP solution to inside the LP matrix itself. The
whole idea is to provide “visibility.” In other words, to allow the upstream producer of a material to see the requirements of the
downstream user, and to allow the downstream user of a material to see the production constraints of the upstream producer in the
current LP matrix being solved. This allows the optimizer to economically balance the cost of producing certain material physical
properties against the value of those properties at the downstream location. With this arrangement, the optimum solution that is
reached has physical property data for all of the recursed streams that exactly match the composition of the pools used to create
those properties.
47
Distributive Recursion
Let’s look at a very simple DR model. If we have a cat cracker unit (SCCU) in our model and we want to dynamically adjust the cat
yields based on feed quality using a delta based model structure (see section on Delta Based Modeling), we need to pool the feeds to
the cat and recurse on whatever feed qualities we want to use to drive the delta based model. The flow diagram would look like this:
LV1
DCG
And the recursion structure would look like this:
This structure creates a pool CFP from LV1, HV1, and DCG. The material balance row VBALCFP collects the pool barrels and
makes them available for processing downstream (i.e. the cat cracker unit SCCU). The RBALCFP row is a recursion balance row
which sums the pool barrels into the pool collector column SCFPCFP. The activity of column SCFPCFP in the solution will be
equal to the total amount of CFP yielded into the VBALCFP material balance row. It is very important that in all distributive
recursion structure the negative entries in a recursion balance row exactly match the negative entries in the pool material
balance row (VBAL or WBAL) if one exists.
SCFPLV1 SCFPHV1 SCFPDCG SCFPCFP RAFCCFP RHS
VBALLV1 1 0
VBALHV1 1 0
VBALDCG 1 0
VBALCFP –1 –1 –1 0
RBALCFP –1 –1 –1 1 =0
RAFCCFP –24 –20 –31 26 1 =0
48
Distributive Recursion
In this example, we have a cat cracker feed quality AFC (aromaticity factor), which we are using to adjust the yields in the cat cracker
using delta-based modeling structure. The coefficients in this row represent the property AFC for each of the feeds in the pool. In
other words, LV1 has an AFC of 24, HV1 has an AFC of 20, and DCG has an AFC of 31. We have guessed the AFC of the CFP pool
to be 26. This guess must be added to table Pguess.
In a PIMS model, material balance rows are normally inequalities. However, recursion balance rows and recursion property rows are
equalities and must equal to zero. Therefore, the activity of column SCFPCFP must equal the sum of the activities of columns
SCFPLV1, SCFPHV1, and SCFPDCG. Let’s look more closely at the RAFCCFP property recursion row. If we guess wrong on the
AFC of recursed pool CFP, there will be a difference in the pool AFC property of 26 and the actual pool AFC.
The actual pool AFC is calculated by multiplying the LV1, HV1, and DCG column activities by their respective AFC properties in
row RAFCCFP and dividing by the sum of their activities. This difference is the “error” created by guessing at the property and
guessing the wrong value. The error is summed into the activity of the “error distribution vector (column)” RAFCCFP and has units of
property-units of volume/unit of time or property-units of weight/unit of time. In our example, the units are AFC-Barrels/Day
The entire structure shown above is part of a process submodel called SCFP.xls in a PIMS model, except for the column RAFCCFP,
which is the error distribution vector. PIMS automatically generates error distribution vectors and puts the appropriate error
distribution coefficients in the proper rows for the user.
49
PIMS data
Crude data
Set on max. quantity
Quantity chosen by PIMS model –
Crude input data in PIMS PIMS results economical criteria
Crude availability info are provided by Group - Supply Chain Management Department
50 Price is the main criteria in Crude diet recipe selection.
PIMS data
Crude info
Rezultate analize/Aegean Freedom 16 aprilie 2018
Cloruri Cloruri Cloruri Vascozitate
Densitate Sediment Asfaltene CCR Acid.
Titei Apa [%v/v] anorganice organice (Petrolite) PP [°C] Sulf [%] la 37.8°C
[g/cm³] [%m/m] [%]m/m] [%m/m] [mgKOH/g]
[mg/kg] [mg/Kg] [mg/Kg] [cSt]
0.8754 0.15 0.01 53.7 6.2 29.8 -1 1.48 1.6 12.82 4.06 0.23
REZULTATE ANALIZE
% imposed by government
environmental legislation Consumption of other feedstock are used in Commercial department for
53
acquisition contracts
PIMS data
Stock management – finish/unfinished consumption and accumulation
Output PIMS
Fix quantity on min and max - After contracts and quantity for intern are made, PIMS chose
set contracts optimal economical quantity for export
56 Crude Unit run rate is limited by optimal economic and other units capacity
PIMS data
Units Yields
Input PIMS Output PIMS
Yields provided by
Process and Engineering
Department with some
degrees of freedom Shift vectors – coefficients set in
PIMS to catch the impact of feed
Flow proprieties in PIMS quality and unit parameters in
yields unit parameters set
in PIMS
Gasoline quality
P&E
PIMS results
RON 94.8
Process and MON 83.6
Engineering Arotamatics % (v/v)
Department info Benzene % (v/v) 0.98
RvP,kPa 72-76
FBP Benzina ~ 200 deg.C
in PIMS model qualities for all products ( gases, gasoline, diesel…) can be assumed or calculated
Bio content
Spec limitation
Product qualities and quantities produced by the model are based on specifications and commercial
59 assumptions.
Some logistics constraints are not in the model but can be set be the users.
PIMS data
Utilities
- PIMS model contains also info regarding utilities consumption
- Input data: utilities prices and utilities specific consumption
*Table SFC1
*
* UTILITIES
UBALFUL Fuel MMKCAL 0.015
UBALKWH
UBALS36
Power KWH
Steam 36 T
9.399
0.1838
- Based on utilities consumption PIMS optimize Units run rate
UBALS16
UBALS06
Steam 16 T
Steam 6 T
0.1197
-0.5278
- PIMS can be used to see an estimated utility consumption but utility
UBALH2D Water Demin M3 0.0000 planning and optimization is done with Aspen Utilities
UBALH2C Water Cooling M3 19.7869
UBALCAT Cat $ 2.5759
UBALCHM Chem $ 1.4510
SAP
PIMS
reports are
Daily Refinery Reports – Daily and MTD production overview
used for
61
PIMS data
Tests:
62
Благодарю за внимание!