Process Calculations
Process Calculations
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
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.
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
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
10 Office 2007 33
97813/3185001
revision A
12 Januari 2009
page 4 of 34
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.
Tebodin Process Toolbox is in fact a collection of all kind of Microsoft Excel files combined with a
library of user defined functions (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
Documentation
(.PDF) Formula.EXE
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
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:
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
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
FlowIsoCrit_kgs_RO = f3_kgs
Else
FlowIsoCrit_kgs_RO = "Input error"
End If
End Function
Example 2: Visual basic function with an iteration
• 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
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.
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
Is there an older or other version of the Tebodin Toolbox installed on your computer?
If NO go to step 3
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)
5 Go to step 15
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
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.
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
- 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
5.1 Formula
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
3. by typing it in
Lists and sheets can be opened by using the pull down menu
97813/3185001
revision A
12 Januari 2009
page 20 of 34
6 Troubleshooting
In case you get this warning when you open a workbook you should choose:
o start the Engineering encyclopedia with the formula button and choose
the right formula
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
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.
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:
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
When you press OK, you get the following output in Excel:
97813/3185001
revision A
12 Januari 2009
page 28 of 34
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
8 DIPPR Functions
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
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
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
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.
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