0% found this document useful (0 votes)
116 views34 pages

Process Calculations

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
116 views34 pages

Process Calculations

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

Tebodin Process Toolbox

client Tebodin

project
order number 97813
document number 3185001
revision A
date 12 Januari 2009
authors F.J. Reurings and T.H.A. Lavrijssen

Tebodin B.V.

Franciscus Romanusweg 2
6221 AE Maastricht
P.O. Box 3102
6202 NC Maastricht
the Netherlands

telephone +31 43 329 47 77


telefax +31 43 325 15 47
e-mail [email protected] / [email protected]

D:\Formula\Process Calculations 11-03-09.doc


97813/3185001
revision A
12 Januari 2009
page 2 of 34

Tebodin Process Toolbox

A 12-01-09 Release of the Tebodin Toolbox version 3.0 bèta T.H.A. Lavrijssen
0 1-5-05 For comments F.J. Reurings
rev. date description author ckd.

© Copyright Tebodin 2009

All rights reserved. No part of this publication may be reproduced or transmitted in any form or by any means without
permission of the publisher.
97813/3185001
revision A
12 Januari 2009
page 3 of 34

Tebodin Process Toolbox

Table of contents page

1 The objectives of the Tebodin Process Toolbox 4

2 Structure of the Tebodin Process Toolbox 5


2.1 Content of the Tebodin Process Toolbox 5
2.2 Structure of Formula 6
2.3 Writing a function in Visual Basic 7
2.3.1 Preferred units 7
2.3.2 Structure of the function 8
2.3.3 Making a reference to Formula.xla 11
2.4 Structure of Modules in Formula.xla 12

3 Installation of the Tebodin Process Toolbox 13

4 Uninstall the Tebodin Toolbox 17

5 Operating manual of the Tebodin Process Toolbox 18


5.1 Formula 18
5.2 Lists and sheets 19
5.3 PFD symbols 20
5.4 Standard calculations 20
5.5 Data sheets 21
5.6 Help Tebodin Toolbox 21
5.7 Uninstall Tebodin Toolbox 21

6 Troubleshooting 22
6.1 Problems with linking 22
6.2 Existing calculation with #NAME? In cell 23
6.3 Problems with more instances of Excel.exe 23

7 Formula.exe 24
7.1 Starting up 24
7.2 Select a cell range 26
7.3 Output cell only 27

8 DIPPR Functions 29
8.1 Component Search 29
8.2 Physical properties from Toolbox Calculation 31

9 Development of the Tebodin Process Toolbox 32

10 Office 2007 33
97813/3185001
revision A
12 Januari 2009
page 4 of 34

Tebodin Process Toolbox

1 The objectives of the Tebodin Process Toolbox

An important part of the work of a process engineer is to make calculations in order to design an
installation. There are programs for some special problems. For example: flow sheeting programs like
Aspen and ChemCAD for the set up of mass and heat balances and HTRI for the calculation of heat
exchangers .

The problems that need to be solved by a process engineer are very diverse. Usually there’s no special
program available to solve his problem. In that case he or she will make the calculation in a
spreadsheet program like Excel. The calculation itself is often based on open available literature like
Perry or articles from Chemical Engineering. Which method is used is based on the experience of the
process engineer.

Tebodin itself is over 60 years old. So it can be stated that every possible problem has already been
solved in the past. However the know how gathered in this period has never been put to paper and was
always stored in the head of the process engineer. The Tebodin-organisation had no tool for storing
knowledge and transferring know how from senior to junior process engineers, until now.

The objectives of the Tebodin Process Toolbox are:

1. Creating a place where knowledge of experienced process engineers can be stored.


2. Creating a place where stored knowledge is easy accessible for all process engineers within the
Tebodin organisation.
3. Reducing calculation hours.
4. Reducing the chance of making mistakes in the calculations.
5. Improving layout and presentation of calculations.
97813/3185001
revision A
12 Januari 2009
page 5 of 34

Tebodin Process Toolbox

2 Structure of the Tebodin Process Toolbox

2.1 Content of the Tebodin Process Toolbox

Tebodin Process Toolbox is in fact a collection of all kind of Microsoft Excel files combined with a
library of user defined functions (Formula).

Pull-down menu “Tebodin Toolbox”


97813/3185001
revision A
12 Januari 2009
page 6 of 34

Tebodin Process Toolbox

2.2 Structure of Formula

The variation of the problems that need to be solved is quite large. However the number of formulas
used by a process engineer to solve these problems is limited. A function can be written for these
formulas and combined into a library. A library is called an add-in (.XLA-file) in Excel. An add-in is
loaded automatically when the program starts. The functions in the add-in can be used in the same
way as the standard Excel functions like LN or SIN.

Each function in the library is accommodated by an Acrobat-file (.PDF-file) describing all relevant
details about this function. The program Formula.exe is developed to make the interaction between the
library, the Acrobat-files and an empty calculation sheet easier.

Microsoft Excel

Library (Add-in, .XLA)

Documentation
(.PDF) Formula.EXE

Empty calculation sheet Standard calculation


(.XLS) (.XLS)

Structure of the library in Excel


97813/3185001
revision A
12 Januari 2009
page 7 of 34

Tebodin Process Toolbox

2.3 Writing a function in Visual Basic

2.3.1 Preferred units

In principle, any unit can be used as input for a function.


However the preferred units are stated in table 1.

Physical property Preferred unit


Area m2
Density kg/m3
Diameter pipeline mm
Duty, power kW
Energy kJ
Heat capacity kW/kg°C
Heat transfer coefficient W/m2°C
Length m
Mass flow rate kg/s
Pressure bara
Pressure drop bar
Surface tension mN.m
Temperature °C
Thermal conductivity W/m°C
Viscosity mPa.s
Volume m3
Volume flow rate m3/h
Wall roughness mm
Table 1: Preferred units

The user of the function is likely to make mistakes when in 9 out of 10 functions degree Centigrade is
used as unit for the temperature and in one function Kelvin is used, the same goes for bara and barg.
Therefore be careful that all common input parameters are equal.
97813/3185001
revision A
12 Januari 2009
page 8 of 34

Tebodin Process Toolbox

2.3.2 Structure of the function

The Visual Basic function must be written according to the guidelines stated in this paragraph. It is very
important that a function in the library is working properly. The function must be well protected.
Calculations errors like division by zero should not be possible. A function should not give a value
outside its application limit. The function must give error messages in that case. Some guidelines must
be followed when a function is created in Visual Basic:

• A fixed structure of the function in Visual Basic is preferred.


• Adequate protection against wrong use of the function is preferred.
• Results of the function must be checked carefully.

Example 1: Preferred structure of a function written in Visual Basic

Please define the variables you use in your function. This can be done in the Function statement or at
the start of the function using the Dim statement.
For help on data types, see Microsoft Visual Basic Help, subject: Data Type Summary.
Most used data types are: String, Double, Integer, Boolean and Variant
97813/3185001
revision A
12 Januari 2009
page 9 of 34

Tebodin Process Toolbox

Function FlowIsoCrit_kgs_RO(Pup_bara, temp_C, Molweight, Compres, FrictionFac, _


Length_m, Diameter_mm, ResisCoefK)
Rem This function calculates the maximum flow rate through a pipe for a
Rem isothermal gas flow.
Rem
Rem INPUT PARAMETERS
Rem
Rem Pup_bara Upstream pressure in bara
Rem Temp_C Temperature in °C
Rem Molweight Molweight in kg/kgmol
Rem Compres Compressibility
Rem FrictionFac Fanning friction factor
Rem Length_m Length of the pipe in m
Rem Diameter_mm Inside diameter of the pipe in mm
Rem ResisCoefKs Resistance coefficient of appandages
Rem
Rem OUTPUT PARAMETER
Rem
Rem FlowIsoCrit_kgs Flow of a isothermal gas throug a pipe
Rem
If Pup_bara > 0 And _
temp_C > -273.15 And _
Molweight >= 1 And _
Compres > 0 And _
FrictionFac > 0 And _
Length_m >= 0 And _
Diameter_mm > 0 And _
ResisCoefK >= 0 Then

MaxIter = 2000
teller = 0
P_bara = Pup_bara
Pstep_bar = Pup_bara / 2000
Do
teller = teller + 1
Pdown1_bara = P_bara
Pdown2_bara = P_bara - Pstep_bar * 1
Pdown3_bara = P_bara - Pstep_bar * 2
F1_kgs = FlowGasIso_kgs_RO(Pup_bara, Pdown1_bara, temp_C, Molweight, _
Compres, FrictionFac, Length_m, Diameter_mm, ResisCoefK)
F2_kgs = FlowGasIso_kgs_RO(Pup_bara, Pdown2_bara, temp_C, Molweight, _
Compres, FrictionFac, Length_m, Diameter_mm, ResisCoefK)
f3_kgs = FlowGasIso_kgs_RO(Pup_bara, Pdown3_bara, temp_C, Molweight, _
Compres, FrictionFac, Length_m, Diameter_mm, ResisCoefK)
P_bara = Pdown3_bara
Loop Until (teller > MaxIter) Or (f3_kgs < F2_kgs)
97813/3185001
revision A
12 Januari 2009
page 10 of 34

Tebodin Process Toolbox

FlowIsoCrit_kgs_RO = f3_kgs
Else
FlowIsoCrit_kgs_RO = "Input error"
End If
End Function
Example 2: Visual basic function with an iteration

Some remarks about the example in figure 9:

• Use clear variable names and add the unit to the name. For example Flow in m3/h will have
Flow_m3h as variable name. “_RO” indicates the revision of the function, in this case revision O.
• Use remark statements. The function should start with a short description of the purpose of the
function, the input parameters, output parameter and the source. Add remark statements to explain
the function.
• An underscore ( _ ) indicates that the statement will continue on the next line. This can be used
when the statement is too long.
• Use If … Then statement to protect the function against wrong input data. A calculation error
should not be possible.
• When more functions have the same input parameters, put these input parameters in the same
order. DensW_kgm3_RO(Temp_C, Pres_bara) and ViscW_mPas_RO(Temp_C, Pres_bara)
97813/3185001
revision A
12 Januari 2009
page 11 of 34

Tebodin Process Toolbox

2.3.3 Making a reference to Formula.xla

When you write your own function for the Toolbox you will probably want to use some of the functions
in Formula.xla.
You can use them in your own module if you make a reference to Formula.xla
- Choose References… in the menu of Microsoft Visual Basic

- The following window appears, choose Formula in the list. If it is not in the list you can
Browse to it.

- In your project tree of VBAProject (Book1) the


reference to Formula.xla appears
Functions in VBAProject (Book1) can now use all
(public) functions and sub routines in Formula.xla
(The same way as you can use these functions in
an Excel sheet).
97813/3185001
revision A
12 Januari 2009
page 12 of 34

Tebodin Process Toolbox

2.4 Structure of Modules in Formula.xla

The functions in the library Formula.xla


are grouped in modules.

Besides those groups there are two other


modules.

These are:

Environment_Variables
In this module you can store
constants which can be used in
all modules.

Macros
In this module the sub routines are
stored relating to buttons, forms
menus (all other than functions)
97813/3185001
revision A
12 Januari 2009
page 13 of 34

Tebodin Process Toolbox

3 Installation of the Tebodin Process Toolbox

1 Close Microsoft Excel

Is there an older or other version of the Tebodin Toolbox installed on your computer?
If NO go to step 3

2 Delete the complete folder of your current installation


In most cases this is D:\Formula or C:\Formula

Do you want to install the Tebodin Toolbox in the same folder as your previous installation?
If NO go to step 10
3 Copy Formula.zip to the root of your previous installation.
Extract Formula.zip to the folder of your previous installation (by right clicking on Formula.zip)
In most cases this is D:\Formula or C:\Formula. (You have to change the path manually)

Extracting Formula.zip using Extract All… (right click on Formula.zip)

4 Start Microsoft Excel, the Tebodin Toolbox is now installed

5 Go to step 15

6 Start Microsoft Excel

7 Go to Add-Ins… in the Tools menu


97813/3185001
revision A
12 Januari 2009
page 14 of 34

Tebodin Process Toolbox

8 Click on Formula, Microsoft Excel will ask you a question like:


“Cannot find add-in ‘D:\Formula.xla’. Delete from list?”
Choose Yes

9 Close Microsoft Excel


97813/3185001
revision A
12 Januari 2009
page 15 of 34

Tebodin Process Toolbox

10 Extract Formula.zip to the folder of your choice


In most cases this is D:\Formula or C:\Formula but you are free to use another folder
(Sometimes people have made references in their documents to D:\Formula\Formula.xla this
link will be broken if you choose another directory, be aware of this when you choose another
location.)

Extracting Formula.zip using Extract All… (right click on Formula.zip)

11 Go to Add-Ins… in the Tools menu

In Excel 2007 the Add-Ins menu can be found


under the Office button, Options for Excel,
Addins, Excel-addins, Start, see chapter 10
for screenshots.

12 Click on Browse
Browse to the location of Formula (see step 10), select Formula.xla and click OK
97813/3185001
revision A
12 Januari 2009
page 16 of 34

Tebodin Process Toolbox

13 Depending on if the location you chose in step 10 the following message appears. If it appears
choose NO.
The message will appear if the location you choose is on a network drive or an USB stick.
It is better not to run the Toolbox from a shared network drive as it is not (sure if it is) possible
to use Formula.xla by more than one user.

14 Microsoft Excel shows the following message:

15 As the message says, the Tebodin Toolbox version 3.0 is now installed
The Tebodin Toolbox menu is now visible and the Formula Toolbar is now somewhere on
your worksheet. You can drag the Formula Toolbar to the menu-bar. Next time you start
Microsoft Excel the Toolbar will be there again.

.
97813/3185001
revision A
12 Januari 2009
page 17 of 34

Tebodin Process Toolbox

4 Uninstall the Tebodin Toolbox

- In the menu Tebodin Toolbox choose Uninstall Tebodin Toolbox

- A popup appears: “Are you sure?”


(If you choose Cancel, nothing happens.)

- A popup appears: “Formula.xla is now being disabled”


(If you have installed Formula.xla more than once this message will appear more than once)

- A popup appears: “The Tebodin Toolbox is now uninstalled as addin. To install just check the
box before Formula in the Add-Ins menu.”
97813/3185001
revision A
12 Januari 2009
page 18 of 34

Tebodin Process Toolbox

5 Operating manual of the Tebodin Process Toolbox

5.1 Formula

A formula can be entered:


1. using Formula.exe by pressing:

or
If the active cell is not empty the contents of the cell can be lost. This cannot be restored by
pressing Ctrl-Z, be aware of this.
If you press Cancel the original contents of the cell are restored. (This does not work correctly
in case of more instances of Formula.exe)
97813/3185001
revision A
12 Januari 2009
page 19 of 34

Tebodin Process Toolbox

(A formula can be entered:)


2. using Insert Function

3. by typing it in

5.2 Lists and sheets

Lists and sheets can be opened by using the pull down menu
97813/3185001
revision A
12 Januari 2009
page 20 of 34

Tebodin Process Toolbox

5.3 PFD symbols

PDF symbols can be entered by using the pull down menu.


Place the cursor on the location where you want the symbol to be placed, otherwise it will be placed on
the same location as in the sheet where it is copied from.

5.4 Standard calculations

Standard calculations can be opened by using the pull down menu.


97813/3185001
revision A
12 Januari 2009
page 21 of 34

Tebodin Process Toolbox

5.5 Data sheets

Data sheets can be opened by using the pull down menu

5.6 Help Tebodin Toolbox

This file can be opened by pressing in the pull down menu.

5.7 Uninstall Tebodin Toolbox

The Tebodin Toolbox (Formula.xla) can be disabled by pressing in


the pull down menu. See Uninstall the Tebodin Toolbox
97813/3185001
revision A
12 Januari 2009
page 22 of 34

Tebodin Process Toolbox

6 Troubleshooting

6.1 Problems with linking

In case you get this warning when you open a workbook you should choose:

In the menu you choose

A message will appear:

Links in every workbook and worksheets are removed now


An adaptation is made in all open workbooks to prevent future problems with linking
97813/3185001
revision A
12 Januari 2009
page 23 of 34

Tebodin Process Toolbox

6.2 Existing calculation with #NAME? In cell

• The .XLA-file is not active


o Load Formula.xla as addin, see Chapter 3
• The formula you typed in is not an existing formula in the Tebodin Toolbox

o start the Engineering encyclopedia with the formula button and choose
the right formula

6.3 Problems with more instances of Excel.exe

More instances of Excel.exe are not allowed. When Formula.exe is started the first instance of
Excel.exe will be used.
Of course opening of more Excel documents is possible, but this must be done by opening this
document in the Excel instance that is already open.
97813/3185001
revision A
12 Januari 2009
page 24 of 34

Tebodin Process Toolbox

7 Formula.exe

7.1 Starting up

When you start the Engineering encyclopedia with the formula button or via the menu one
of the following screens will appear. If the current cell contains a formula which is present in the
Engineering encyclopedia, Formula.exe starts with the menu structure tree expanded to that formula.
All the values, cell references or text are already filled in for you in the input boxes.

Startup screen when starting up from a cell without formula


97813/3185001
revision A
12 Januari 2009
page 25 of 34

Tebodin Process Toolbox

Startup screen when starting up from a cell with formula


97813/3185001
revision A
12 Januari 2009
page 26 of 34

Tebodin Process Toolbox

7.2 Select a cell range

The most annoying of the older version of Formula.exe was that you couldn’t select a range as a value.
Therefore a lot of people used the Fx function of Microsoft Excel. But as most problems this problem is
solved in this version.
By pressing on the button you get the following screen:

Now you can select a cell. As the message box already says: if you select more cells, the cell in the
topleft corner will be used.

If the cell you selected is the same as the cell for output you get a warning:

Please select another cell.

After you have selected a cell you can press OK, you will return to Formula.exe

When you have selected a cell with no data in it the Result will be: Empty Cell.
If there is data in the cell this will be displayed as Result.
97813/3185001
revision A
12 Januari 2009
page 27 of 34

Tebodin Process Toolbox

7.3 Output cell only

Suppose you entered the following data in Formula.exe

When you press OK, you get the following output in Excel:
97813/3185001
revision A
12 Januari 2009
page 28 of 34

Tebodin Process Toolbox

In this example some new features were used.

For the Viscosity a reference is made to cell $E$3, the row and column are set to absolute ($) by
selecting the checkboxes Row and Absolute. The cell $E$3 contains the number 5, so this is used as
Result.

For the Diameter a reference is made to cell D$7, in this case only the row is set to absolute ($).
D$7 was an empty cell. Formula.exe has put “Enter value for Diameter” in the cell and set the interior
color to pink.
(If you select two times the same empty cell only a description for the last value will be in the cell.)
97813/3185001
revision A
12 Januari 2009
page 29 of 34

Tebodin Process Toolbox

8 DIPPR Functions

8.1 Component Search

For finding the correct component name a separate form was made. The form can be opened by
pressing the Component Search button. This button is only available for the DIPPR functions.

By default searching in de DIPPR database is in all of the fields: Nr, CAS Nr, Component, Category,
CAS Name, IUPAC Name, Structural, Molecular and Other Names.
For every match in one of the fields an item is added to the dropdown list behind that field. The number
of matches is also displayed.
In the dropdown lists the component is given.

When you select a component in a dropdown list the result is displayed right to the dropdown lists. All
the other dropdown lists become gray. If you want to select another component you have to do this in
the same dropdown list. When you choose Select your component in the list you can select again
from the other dropdown lists.
97813/3185001
revision A
12 Januari 2009
page 30 of 34

Tebodin Process Toolbox

The example above gives the search results for toluene. The result is 17 hits in Component, 18 hits in
IUPAC Name, and 44 hits in Other Names.

In this example m-Xylene was selected from Other Names. Because the list of Other names/ Trivial
names is usually quite long the result is displayed as a tooltip text which you see when you hover with
the mouse above Other names / Trivial names. (The other fields have also a tooltip text).

If available the structural formula is displayed below the search results. By clicking on it with the mouse
you go to the website of NIST, the source of the picture.

Other links based on the CAS Nr can be found under Some useful links:
At the moment two websites are available:
http://webbbook.nist.gov
http://www.chemexper.com
97813/3185001
revision A
12 Januari 2009
page 31 of 34

Tebodin Process Toolbox

8.2 Physical properties from Toolbox Calculation

In the Excel sheet Physical Properties from Toolbox Calculation, accessible by the Tebodin
Toolbox menu, you can find all the physical properties for the DIPPR and HTRI components.
A comparison is made between the DIPPR and HTRI database. For a given component the values for
all available functions are given.
For each temperature dependent function a graph is made for both DIPPR and HTRI values. It is also
possible to make a graph of Measured values. Subsequently you can determine which database gives
the best results for your application.
97813/3185001
revision A
12 Januari 2009
page 32 of 34

Tebodin Process Toolbox

9 Development of the Tebodin Process Toolbox

One person (= application manager) coordinates all activities related to the formula library. The
application manager is responsible for all activities related to the function library. The tasks of the
application manager are:

Set up of an inventory of functions still to be created and make a planning for the realisation of
these functions.
Gathering and handling of feed back from users.
Distribution of updates.
Editor-in-chief, to make sure that all functions are in the same format.

The application manager for the function library is presently Fred Reurings, Tebodin Maastricht. All
remarks and comments must be sent by e-mail ([email protected]) or by internal mail.

Everybody can send in new items, make remarks or make improvements.

The toolbox is for us all by us all.


97813/3185001
revision A
12 Januari 2009
page 33 of 34

Tebodin Process Toolbox

10 Office 2007

Finding the addins-menu is somewhat more difficult in Excel 2007, for the rest working with the
Toolbox is almost the same as in Excel 2003.
When more people start using Excel 2007 a new manual will be written, for the moment the following
screenshots should be sufficient.
97813/3185001
revision A
12 Januari 2009
page 34 of 34

Tebodin Process Toolbox

You might also like