Limn Manual
Limn Manual
10 - September 2002
4 6
8 8 10 12
Drawing a
Flowsheet
14
workbook
30
48
What is
is a Flowsheet Processor, designed to bring the same ease of use to flowsheet drawing and solution that word processors bring to the preparation of text based documents. Process oriented engineers now frequently use spreadsheets to perform the data presentation and calculation tasks associated with their jobs. functions as an add-in module to the Microsoft Windows Excel spreadsheet, to enhance the value of spreadsheets in this role by providing a comprehensive set of flowsheet specific drawing tools, within the familiar spreadsheet environment. Once drawn, the flowsheet may be coupled with general purpose flowsheet solution engine. This approach removes many of the difficulties associated with preparation of flowsheet balances using spreadsheets. By building on an existing and widely used tool such as Excel, is able to make full use of the features of the Windows operating environment. This includes the ability to incorporate flowsheets within the documents of other applications such as word processors. follows the Windows user interface standards, allowing users to apply existing skills to this package. Because is a general purpose and open package (for example, all data kept within standard Excel sheets), it can also function as a toolkit from which more specific packages may be built. In addition to the spreadsheet modelling capability, facilities are provided to incorporate user models, which may be written in any language capable of producing Windows Dynamic Link Libraries.
1
Shortcuts, hints, and tips will appear in boxes such as this on the left page.
Text formatting
Special fonts and typefaces are used in the text to indicate the following:
Bold type
Words or characters that you type. Also used to highlight Windows menu items that you must access. Place-holders for items you must supply (for example, directory or file names) Keys or combinations of keys (for example, CTRL+1, or ENTER, or ESC)
Italic type
Capital letters
Mouse buttons
For ease of reading, the text always refers to a mouse as the default pointing device, with the left button defined as the primary button. If you are using another form of pointing device (for example, a track ball), or have changed the default mouse buttons, any references to the mouse left button should be read as a reference to the device primary button as defined in the Windows Control Panel.
Important information
Remember that is meant to enhance the capabilities of Excel, not to re-invent the wheel. If you cannot find a required function in the :Draw module, it is likely that it already exists as a native Excel function. Simply exit from , and carry out the required action.
System requirements
Software
is designed to operate with Microsoft Windows Excel. The software has been tested using Excel versions 5, 7, 97 and 2000 under Windows 3.1, Windows for Workgroups 3.11, Windows95, Windows98 and WindowsNT4.0 Verify that Microsoft Windows and Excel are installed and . operating correctly before attempting to install
Hardware
Any system that is capable of running Excel in an adequate manner will be suitable for . As a guide, a Pentium 100 is probably the minimum comfortable configuration for Excel versions 5 and 7, with a Pentium 200 the minimum comfortable configuration for later versions of Excel. requires approximately 6MBytes of hard disk space.
Installing
is distributed on CDROM with updates on 1.44MByte disks. Place the CDROM into the CDROM drive. If Autoplay is enabled, setup will start automatically. Otherwise, run program SETUP.EXE from the CDROM. Where update disks are provided, load from the CDROM first, then open SETUP.HTM on the update disk, and follow the instructions shown there.
It is possible to use the Excel Add-In Manager (menu Tools, option Add-Ins...) to load the and Add-Ins. [For details, refer to Excel online Help, Search for Add-ins Command (Tools menu)]. Add-Ins loaded in this way are automatically loaded each time Excel is run. Add-Ins accessed from a toolbar button are only loaded when required. Choosing the toolbar method of loading the AddIns as detailed opposite will result in faster loading of Excel when it is required for normal spreadsheet use. The Auto-Configure option sets up Excel for this toolbar load method.
Loading the
Excel Add-Ins
If Auto-Configure was chosen during setup, the and toolbars should be present and ready for use. If you did not select Auto-Configure on the setup dialog, you will need to manually configure the Excel toolbars to allow access to . To do this: 1. Run the 2. Run Excel. 3. Using the Open command on the File menu, find and open the files LIMN.XLA and LIMNWIZD.XLA. 4. Close Excel. There should now be a new in the Excel toolbar area. toolbar with three buttons present
Limn: Draw Limn: Solve Limn: CreateNewIcon
A new
It is possible to call the module from the VBA macro language within Excel. This can be useful for optimisation studies, or automated examination of a range of scenarios. For more information on extending , see Part 4 of this manual - The Technical Reference.
Starting
The toolbar and the major components of the toolbar the four package:
Limn: Draw
provides the enhanced tools for drawing detailed process flowsheets. To start the module, click the mouse left button on the toolbar button. For more module, see Chapter 3 of information on using the Part 1 of this manual.
Limn: Solve
Once the flowsheet is defined using , and data and process models specified in Excel, may be used to calculate the flowsheet balance or solution. The module is started by clicking the toolbar. For more information on using the module, see Chapter 5 of Part 1 of this manual.
Limn: CreateNewIcon
is used to incorporate user site specific artwork into the package as process icons. The module is accessed through the toolbar button. For more information on using the module, see Part 4 of this manual - Technical Reference.
Data Wizard
The automates several of the data entry steps . The associated with setting up a flowsheet solution in wizard (series of step by step dialogs) is accessed through the button on the toolbar. More information may be found in Part 3 of this manual.
Grinding Circuit
480.9 25.0 1.1 61.8 16.3 50.0 15.3 367.9 55.0 8.4 16.6 12.7
150.2 30.0 25.0 SOLIDS t/h %Pb %SOL %Fe 62.8 40.1 55.0 12.4 43.2 34.9 35.0 13.5 15.6
19.5 51.7
55.0 10.0
Drawing a
Flowsheet
The following describes the steps involved in drawing a simple water recovery circuit containing two process units and connecting streams. To draw more complicated circuits requires only a repetition of the principles outlined. To begin: 1. Install Excel and configure the toolbars for section.) 2. Start Excel. 3. Open a new worksheet. 4. Maximise the Excel window. 5. Click the " " icon in the middle of the toolbar. . (See previous
6. The drawing mode screen should now be present. (For a detailed description of the menu and toolbar see the online Help).
The Add Icon toolbar button can be used to access the Select a Unit Icon dialog. Menu Add, option Unit Icon, or the short-cut key combination CTRL+U will also access this dialog.
From the unit icon selection dialog which pops up, navigate to the \LIMN\ICONS directory containing the icon files installed during setup.
Browse the list of icons to examine the available icon drawings. Select a suitable thickener icon name. (double click left button on icon description line, select the OK button, or position cursor on description line and press ENTER) A picture of a thickener and its product streams will appear on the screen.
treats Text Box Unit Icons in the same manner as Picture Unit Icons (i.e. they represent process units in the flowsheet sense). Text Box Unit Icons are thus useful for drawing block diagrams, or for representing an object for which no picture icon is available.
While dragging a corner selection tag, hold the Shift key down to ensure that the original aspect ratio of a drawing object is maintained during resizing.
Position the mouse cursor over the picture (note the cursor shape changes) and click the mouse left button. Note that selection tags appear about the unit icon picture, and that the name selection box on the right hand end of the toolbar is filled with a default name (Thickener).
Naming Units
Move the mouse cursor to the name selection box and click the left button to select the entire temporary name. Type in a name for the icon (e.g. Water recovery thickener) and press ENTER.
If new streams are required (additional to those associated with units), they may be started by simply dragging with the mouse left button down, on any free area of the screen. New streams attached to a unit can be started by clicking the mouse left button when the cursor is over the unit boundary rectangle. i.e. when the cursor looks like:
Drawing objects (unit icons, streams etc) may also be selected from a list accessible via the Edit menu, Select Limn Objects option, or by shortcut key combination CTRL+O.
2. Position the mouse cursor over the selection tag on the end of the selected stream flow line.
Stream flow lines may be given meaningful names in the same manner as unit icons. (Using the toolbar name selection box)
4. When satisfied with the line segment length, click the mouse left button to allow a change of direction. Note that the line segment changes from dotted to solid. Drag the cursor down to extend the flow line downwards. Double click the left button to terminate the stream line.
5. The other stream flow lines may be extended in a similar manner. 6. To create a Feed Stream for the cyclone, click and drag the mouse left button in the required stream start location, and extend the stream toward the cyclone until it just touches. (Note the cursor appearance on contact.) Double click the mouse left button to complete the stream draw operation.
The following special cursor shapes are used in the module as the cursor moves about the screen: Normal (default) cursor. Click to move object under cursor. Click to start a stream in direction shown. Click to extend stream forward in direction shown. Click to extend stream backward in direction shown. Click to move a vertical stream segment. Click to move a horizontal stream segment. Click to size object diagonally in direction shown. Click to size object in direction shown. Left button to zoom in, right to zoom out. (CTRL+SHIFT to access)
Segments of stream flow lines may be moved perpendicular to their drawn direction simply by dragging. To move the entire stream, hold the SHIFT key while dragging.
In this circuit, the high density streams from the thickener and hydrocyclone join to form a single high density product stream. To do this: 1. Select the stream flow line at the hydrocyclone underflow.
2. Extend the hydrocyclone underflow stream down and to the right, past the thickener.
3. Double click to complete this stream. Select the stream flow line at the thickener discharge. Extend it down toward the hydrocyclone underflow,
until it touches the other stream flow line: Note the change in cursor shape to indicate that a joining node will be inserted if the stream flow line is terminated at this point.
4. The following special cursor shapes are used in the :Draw module during move, draw or shape actions: Move selected object in all directions. Move a copy of the selected object. Move a vertical stream segment. Move a horizontal stream segment. Extend stream forward in direction shown. Extend stream backward in direction shown. Size object diagonally in direction shown. Size object in direction shown. Size object while maintaining aspect ratio. Terminate stream line at unit edge. Terminate a stream line at a new joining node.
Double click to complete the stream. Note that inserts a joining node and terminates the lines entering the node with arrowheads. The stream coming from the node is given a name based on the stream into which the node was inserted.
To illustrate the effect of recycle streams on the flowsheet solution, this example includes a recycle of water from the thickener overflow to the cyclone feed. This requires addition of a new product stream from the thickener. To achieve this: 1. Position the cursor on the boundary of the thickener near the overflow lip. When on the boundary, the cursor will change shape to:
2. Click the mouse left button to begin drawing the stream flow line. Extend the line up, to the left, and then down to join with the cyclone feed (at an automatically inserted joining node), clicking with the mouse left button whenever a change in line heading is needed.
To delete a unit icon, stream, text box icon, or data block, select it and press the Delete key. Once streams are connected (i.e. terminated near ) to a unit, moving the unit will move the connected streams. Where streams join two units, the stream segments closest to the moved unit are adjusted to accommodate the movement. To move a unit without moving the connected streams, hold the Shift key down while performing the move. Stream joining nodes can be moved in the same manner as a unit, and will always remain connected to their streams. To copy a unit icon, text box icon, or data block, hold the Ctrl key down while moving the object. As the copy is given an incremental name (suffix _2 etc.), it can save time to name the first object with a generic name (e.g. Cleaner). To maintain the aspect ratio of a unit icon, text box icon, or data block during sizing, hold the Shift key down while dragging the object selection tag.
4. Move the cursor to the range entry field and select the current contents (if any). If a range is selected, the range location will be displayed. Select the sheet on which the data for display is present. Select the data range (click and drag) and click the OK button on the dialog. 5. The data block is resized and will display the contents of the selected cells. A data block is a linked picture of the cells which are specified as its range. Any formatting applied to those cells (column width, row height, colour, font, borders etc.) will be displayed on the flowsheet. Best results will be gained if a special worksheet is set aside for summary data to be used in data blocks. Any required formatting and arrangement of data (e.g., 2x2, 2x1 cells etc.) can then be performed by copying data to this sheet, without affecting normal data relationships. Since it is easier to set up data blocks once the stream data has been specified, we will return to them in chapter 4.
can handle multiple flowsheets within the one Excel Workbook, but will only solve one sheet at a time. The sheet solved is either the currently selected sheet (if it is a flowsheet), or the first flowsheet encountered in the sheet tab order.
workbook
Introduction
There are many different ways to set up worksheets for problem solving using Excel. The addition of to Excel does not change this. As you gain experience in using , you will undoubtedly find your own preferred methods of arranging the problem to suit your requirements. The following is a suggested arrangement of worksheets within a workbook which can be used as the basis of your own workbooks, and which should make the data requirements for flowsheet solution with a little clearer.
The Flowsheet
As a minimum, requires one worksheet on which to draw and display the process flowsheet. Because of the way in which adjusts column heights and row widths during drawing, you will generally not find it convenient to use this sheet to perform calculations, or to store data. The default worksheet on which we have drawn our example process flowsheet during Chapter 3 is the flowsheet. It would be useful to rename the sheet at this point to represent that fact. (In Excel, click the mouse right button over the sheet tab, or double click the mouse left button over the sheet tab to access the Excel rename sheet dialog.)
3 Across the top of the sheet, in individual columns starting from the second column, enter the names of the streams on the flowsheet. 4 In the first column, enter the names of the components of each stream. For this exercise, they are tonnes per hour of solids and tonnes per hour of water. 5 Enter the formulae for any derived values (for example %solids and volume flowrate) and set up any other fields that are required for calculation of derived values (such as solids specific gravity) 6 Highlighting the cells which require user input is a useful practice. For flowsheet solution, only the feed stream data are required to be entered. 7 Another useful addition to the stream data is a column which sums the circuit products, allowing checks against the summed circuit feed data. The use of such self auditing data summaries can reduce flowsheet solution debugging time considerably. The completed sheet could look something like:
Estimates of the mass flowrates for each of the various streams could be entered at this stage if desired. These will be the start points for the flowsheet solution. Note that the data from which calculates the flowsheet solution must be in terms of mass, volume, or equivalent properties. i.e. the components must be able to simply be summed at any joining node (or when being combined for presentation to the process unit model).
Assays and other fractional or percentage measures are not suitable, and must first be converted to a property which can simply be summed (for instance, mass). This is usually done by setting up an extra worksheet to hold the data in user space (e.g. assays) and entering Excel formulae to convert to and from mass related data. (For an example and more details, see Part 2 of this manual.)
Model data
It is advisable (at least when starting out) to set up each individual unit process model on a separate worksheet. Each model should be a standalone block of calculations with no links to any other worksheet. (The engine uses the process connection matrix derived from the flowsheet to link these stand-alone models together.) In the example under consideration, there are two spreadsheet models required, one for the hydrocyclone, and one for the water recovery thickener. These will require two sheets. Set them up in the following manner: 1. Select (or add) two unused worksheets, and name them Cyclone Model and Thickener Model respectively. 2. Access the Cyclone Model sheet. We will use an elementary mass split model to describe the hydrocyclone, simply specifying the fraction of each feed component which reports to the cyclone underflow. 3. Set up columns for the feed to the unit model, for the split fraction to be used, and for the two products from the model. 4. Set up rows for each component in the feed (in this case, just Solids and Water). 5. Highlight the data to be modified by the user (the split factors).
Completed Excel Workbooks for the examples used in this manual may be found in the EXAMPLES subdirectory created when is loaded. The workbook for this Getting Started section is named DEWATER.XLS.
6. Specify the formulae which results in the feed data being allocated to each of the products according to the split factor. For the underflow, this is the feed component mass times the split fraction for that component. For the overflow, this is the feed component mass minus the mass reporting to the underflow. 7. Test the unit model by entering a set of dummy feed data and ensuring that the correct data appears in the product data fields. The result should appear something like:
8. Access the Thickener Model sheet. The model used for the thickener will be similar in concept to that for the hydrocyclone, but complicated slightly by the need to consider the amount of slimes product recycled to the circuit feed. 9. Repeat the procedure already performed for the hydrocyclone, setting up rows for each component (Solids and Water) and columns for each stream. For clarity, we will consider the thickener and subsequent slimes recycle split as two processes, and set them up on the sheet accordingly. Thus, the first stage of the model is identical to that used for the hydrocyclone, with the user specifying the fraction of each feed component reporting to the thickener solids product. The second stage of the model is set up to allow a further split factor to be specified; the total split between the recycle slimes stream and the circuit product slimes stream.
10.On completion of formulae specification, test this new model with a set of dummy feed data. 11.Results should be something like:
It is important to note that, so far, all setting up for the unit models has been done solely in Excel, and that the models are NOT linked back to the stream data sheet. They are truly stand-alone models.
Thus, to obtain appropriately formatted data blocks, the cells on which they are based must be formatted in the required manner. There is often a conflict between the formatting requirements of stream data and that required for data blocks. For this reason, a separate sheet is used to hold a copy of the stream data in a form suitable for display as data blocks on the flowsheet. To set this sheet up: 1. Rename an unused (or new) worksheet as Datablock Data. 2. Access the sheet and set up Excel formula to copy data from the Stream Data sheet to this new sheet. We will use a 2x2 data block for the example, with Solids tph and Water tph on the top line, and % Solids and volume flowrate on the bottom line. 3. A useful way to set up the data blocks is to copy the stream names (appropriately separated) into column 1, and then to set up the copied data next to them, with appropriate formatting applied. A section of the new sheet might look like:
3. Move to an area adjacent to the circuit feed stream flow line. 4. Double Click the mouse left button and select option Add a new Data Block. 5. An outline box will appear at the cursor position:
6. Position the mouse cursor over the box and double click the left button. 7. A dialog box will appear, allowing a change to the data block name, and entry of a group of cells associated with the block.
8. Change the name to something more meaningful, and click with mouse left button in the Data Range field. 9. The sheet tabs will appear at the bottom of the worksheet, allowing access to the Datablock Data sheet. Select that sheet, and select the range appropriate to the data block (in this case, the Fresh Feed data, or cell range Datablock Data!$C$5:$D$6).
10.Click the OK button (or press ENTER). The outline box will be replaced with a picture of the cells from the Datablock Data worksheet:
11.The data block may be moved about the screen in the normal manner to position it in the desired location. 12.Although the data block has selection tags which function as sizing handles in the same manner as those on unit icons and text box unit icons, it is recommended that a data block is not resized on the flowsheet unless absolutely necessary. Resizing should be done by changing the cell sizing of the linked cells of which the data block is a picture. It is a feature of Excel that Picture objects, once sized manually, will not resize automatically.
13.Other data blocks may be added to the flowsheet as required to show the flowrate and other information for each stream. A data block legend may be included if desired. The completed flowsheet looks like:
2. Position the mouse cursor over the required stream and select it by double clicking the left button. 3. A stream detail data entry dialog is displayed (similar to that used for data block data entry), in which can be entered the spreadsheet cell range corresponding to the data for this stream.
4. Use the sheet tabs to move to the Stream Data worksheet and select the cell range for the stream.
If the stream range represents an input stream, the data in this range will engine as inputs to the solution. be used by the If the stream range represents an output or intermediate stream, the engine will overwrite the data in the selected range with the results of the flowsheet solution. Unit Data The purpose of the unit detail data is to tell the engine where on the worksheet to place the combined feed data for the unit, and where to find the unit products once the worksheet has been calculated. The fields with this data have already been specified on the individual unit model worksheets. To specify the unit detail data: 1. Select the Flowsheet and enter .
2. Select the first unit (e.g. the hydrocyclone) and double click the left mouse button to open the dialog.
3. Select the Feed Range field, use the sheet tabs to access the Cyclone Model sheet and select the two cells which represent feed to the model. 4. Select the field for Product 1 Range. Note that the right hand block of the dialog has a list of the unit product streams in order as drawn on the flowsheet. Thus, Product 1 is Cyclone Overflow. 5. Tab to the Cyclone Model sheet and select the cells which represent the Cyclone Overflow stream. 6. Repeat for the second product (Cyclone Underflow)
Unit product streams are ranked in the order in which they would be encountered in moving clockwise about the perimeter of the (unrotated) unit icon, starting at the top left corner.
The data for the Thickener Model should be linked to the flowsheet in the same manner. Note that there are three product streams to specify.
Solution Options
The menu has a Solve sub-menu, one item of which allows setting of solution options. Using this dialog allows the user to obtain diagnostic flowsheet information, to control the display of error information, and to control screen updating.
The model feed and product ranges are entered into the respective fields on the unit icon detailed information dialog. The flowsheet solution engine for spreadsheet models works in the following manner: For each unit in turn: From the flowsheet drawing get a list of all streams feeding the unit. For each feed stream in turn: Get the feed stream spreadsheet data range. This range is user specified in the stream details dialog. Get the component data from this range. Add the component data to the combined feed data. Store the summed feed components in the "Model Feed Range" spreadsheet range. This range is user specified on the unit details dialog. Do the next feed stream. From the flowsheet drawing get a list of all streams exiting the unit (product streams). For each product stream in turn: Access the data in the "Model Product Range" spreadsheet range. This range is user specified on the unit details dialog, and will contain the results of the spreadsheet calculations. Get the product stream spreadsheet data range. This range is user specified in the stream details dialog.
Copy the model product data to the stream data range Do the next product stream. Do the next unit. When all units have been done, recalculate the spreadsheet. (This allows the user written spreadsheet models to operate on the newly summed "Model Feed" data, to produce the "Model Product" data for use in the next iteration) Solution is complete if there has been no significant change in the sum of all stream components since last cycle. Otherwise, repeat the cycle for all units.
Examples provided
Several examples have been provided to highlight various aspects of the package. While Excel workbook layout for data reporting and flowsheet solution is a matter of personal preference, these examples offer suggestions which can form the basis of a personal layout. As experience is gained with and Excel, re-examination of the examples could prove useful as a source of ideas for data handling and manipulation.
DEWATER.XLS
This is the example used in the tutorial. (Part 1 of this manual). It demonstrates how to set up a simple flowsheet, flowsheet solution models and data display.
2CYCS.XLS
Although this example uses data derived from a simple solids and water balance, it demonstrates a method of data block data layout and formatting which would be useful for reporting plant survey work.
CRUSHING.XLS
The engine is designed to handle properties which are additive at a joining node, such as mass, or volume. To enable properties such as a size distribution to be handled, the size fraction data must be converted to mass. This workbook demonstrates how that may be done. It also introduces two more simple flowsheet balance models, and shows how to use VBA code to calculate a %passing size.
FLOTATN.XLS
For the same reason that size data must be converted to mass, assay data must also be converted. This workbook shows a method of handling assay data for flowsheet solution using , and demonstrates how to implement flowsheet solving models based on the two-product formula.
EFFCURVE.XLS
The simplest method of flowsheet solution modelling using is to write the models using normal spreadsheet functions. While this can be a surprisingly powerful technique, it has some limitations, for example, where internal iteration is required in a model. If the cell formula approach should prove inadequate, there are several features of Excel/Windows which allow complex process models to be included in solutions. These alternatives are demonstrated in this example. This example also demonstrates how heritage code written in a (possibly outdated) high level language, can be incorporated into the structure.
0.3 0.3
115.8 115.9
DEWATER.XLS
This example is a completed workbook based on the tutorial described in Part 1 of this manual. Although a thickener would usually only have two product streams, it has been implemented in this example with three products (the third being a recycle to the head of the circuit) to demonstrate: that recycle streams can easily be handled. that extra products may be added to any unit - the user is in control, since they are writing the flowsheet solution model.
Workbook layout
The example illustrates one possible layout of a workbook for flowsheet solution work using . This layout uses separate worksheets for: the flowsheet stream data each process unit model data block formatting. Separating the components of the flowsheet solution in this manner makes it easier to see that the process unit models are individual subroutines of the overall solution. Note that the process unit model sheets have no spreadsheet cell function links with any other worksheet in the workbook. They are truly standalone models. Likewise, the stream data summary sheet has no spreadsheet cell function links to the models. (The engine handles the process of connecting the units and streams, according to the connection logic defined by the user drawn flowsheet.) Keeping the data block formatting separate from the stream data allows the stream data to be arranged in a manner suitable for data input, while the data formatting arranges it in a manner suited to display on the flowsheet.
To check that the models are indeed completely stand alone, use the menu Tools, Auditing, Trace Precedents while selecting any of the feed components. There should be no connections. Manual entry of data in the feed component cells should result in the model calculating new products for that set of feed conditions. Individual models should be debugged in this way before the engine is run.
The models
There are only two models used in this flowsheet solution, and while they are trivial, they are typical of a class of models which may be useful for simple solids and water balances. Both models are based on the concept of a split factor, which determines the fraction of a particular component (in this case, solids, or water) reporting to a particular product stream.
Cyclone model
This model simply multiplies the split factor by the feed for each component (solids and water) to define the flowrate of product to the underflow stream. The overflow stream is calculated by difference.
Thickener model
Although similar to the cyclone model, the thickener model has the added complication of an extra stream (the recycle stream). To facilitate this, the split is handled in two stages. Stage 1 is exactly analogous to the cyclone model, with the split factor for each component (solids and water) multiplied by the feed flowrate to define the flowrate of product to the underflow stream. An intermediate stream to represent the total thickener overflow product is calculated by difference. This stream is then split using the same split factor for both solids and water (as if the split were being done via a diverter valve), to produce the recycle stream, and the final thickener low density product stream.
Note the column of data at [DEWATER.XLS]Stream Data!K2:K7 which sums all products resulting from the flowsheet solution. If the solution is correct, this should equal the sum of all feed (input) streams. Such audit checks are a very useful tool for determining if the solution is functioning correctly.
Do not adjust the size of data blocks by using the sizing handles in . Rather, change the column width and row heights on the sheet to which the data blocks are linked. Since the data blocks are an Excel linked picture of the cells, the size of the data block automatically changes to reflect the cell height and width.
Stream Data
The Stream Data worksheet is formatted for ease of data entry. For this simple flowsheet solution, the only data required from the user are the flowrates of water and solids in the feed to the circuit. Derived values are calculated from the mass flow data (e.g. %solids from tph Solids and tph Water - Worksheet [DEWATER.XLS]Stream Data!B6:I6). A user input solids SG is required to allow these calculations. All of the data input fields are highlighted to prompt the user (white text on blue background). The mass flow data for solids and water for all streams other than process input streams are calculated and placed in the cell locations associated with each streams mass flow data by the engine. Note that there are no cell equations in these cells (Worksheet [DEWATER.XLS]Stream Data!C4:I5)
Datablock Data
This sheet shows one method of accessing the stream data and formatting it suitably for display on the flowsheet. See Example 2 (following) for a more flexible method. Each cell in the required 2x2 block is linked with a cell formula to the corresponding data on the Stream Data sheet. Suitable formatting (borders, cell colours, alignment, number of decimal places etc.) is then applied. The data blocks on the flowsheet are linked (Excel linked picture objects) to the 2x2 cell blocks on the Datablock Data sheet and any change in data or formatting on this sheet is immediately echoed on the flowsheet.
280.00 303.08
Legend
Solids (t/h) mass % Solids Water (t/h) Vol flowrate (m3/hr) 192.00 36.00 84.21 109.85
2CYCS.XLS
This example is included to show a more flexible method of associating formatted data blocks with the stream data (which is usually formatted for ease of data entry or for examination in tabular form).
Workbook layout
The workbook is arranged in much the same manner as the previous example - individual sheets for flowsheet, stream data and data block formatting. In this example, however, both cyclone models are present on one Cyclone Models unit data sheet. Note, however, that they are both still stand-alone models, with no cell formula relationships between them. The flowsheet is simply two cyclones in series, with all product streams re-combined; hardly a likely real-life situation. On the Stream Data sheet, an audit check is done by subtracting the combined product stream from the feed stream. The result should be zero for each component.
Excel allows many of the elements from the Forms toolbar (such as drop down lists) to be used on the worksheet. Several of these are useful for enhancing the user interface on worksheets which will be used by others. To find out more about the Forms toolbar, search the Excel on-line help with key word FORMS.
By using this method, simply changing the component index number (e.g. any cell in the range 'DataBlock Data'!B2:C3), will result in the component displayed at that location in the 2 x 2 data block grid also being changed for all stream data blocks.
2CYCS_2.XLS
Example 2CYCS_2.XLS demonstrates a further enhancement of this approach. At location Flow sheet!G3:K6 in workbook 2CYCS_2.XLS, 4 drop down lists have been placed on the flowsheet. Each drop down list has the list of components ('Stream Data'!$B$5:$B$10) as its source Input range. The Cell link for each drop down is the index location on the data block formatting sheet (e.g. 'DataBlock Data'!$B$2). By clicking the mouse on any of these drop down lists, a selection may be made from the components. The drop down list automatically places the index of the chosen component in the correct location on the data block formatting sheet. This causes a change in the OFFSET reference in each of the 2 x 2 data block grid of cells, which displays the new component. Since the data blocks on the flowsheet are linked pictures of the 2 x 2 grid of cells on the data block formatting sheet, these data blocks are updated with the correct stream data also.
20.93 100.00
32.41 63.38
To find out which worksheet data cells are connected to a particular flowsheet stream or unit, click on the stream or unit when viewing the flowsheet in Excel. This activates a macro which will cause Excel to jump to and select the data associated with each stream or unit. (For a unit, the selected block is the combined unit feed data).
CRUSHING.XLS
This example demonstrates the following: conversion of size distribution data to mass flow data to allow solution using the engine. crusher modelling using an approach similar to the manufacturers grading curve approach screen modelling using the split factor approach the use of a local function macro in VBA code to calculate a % passing size in each stream.
Worksheet StreamDataSheet
There are two blocks of data on this worksheet. The upper block (StreamDataSheet!$A$2:$L$20) is the stream data in a format suitable for data entry and analysis (in this case, cumulative % passing). The lower block (StreamDataSheet!$A$22:$L$39) is the same data, in mass flowrate form suitable for flowsheet solution using . It is this lower block which is connected to each stream on the flowsheet using the Stream Detail Data entry dialog in Note that the data entry area is highlighted (white on blue).
SB-1
1071 111
933 143
CC-1
1150 54 1071 54
VS-1
VS-2
VS-3
VS-4
352 6 347 6
366 6
354 6
CC-3
CC-4
CC-5
CC-6
2270 10 2004 11
856 19
717 19
724 18
586 18
CC-7
CC-8
677 14 895 18
VS-5
1403 13 1303 13
Screens
The screen models used in this workbook are extensions of the simple split fraction models used in the previous examples. A split fraction to coarse product is entered for each size, the feed mass flow rate is allocated to the coarse stream according to this split, while the screen undersize is calculated by difference. For the double deck screen, a second set of split fractions is provided to specify the split of the top deck fines product as it passes over the lower deck. Note that audit sums of the total flowrate of each deck product are calculated as a check.
CRUSH_2.XLS
This workbook is an example of a more complicated crushing circuit. It represents three stages of crushing, with multiple recycle. The workbook layout is much the same as for CRUSHING.XLS, but the unit models are arranged several to each page. The parameters for the unit models (split factors, product size distributions) were manually calculated from the data presented in worksheet Size Distbns. (Meas). It should be noted that this measured data has some severe mass balance inconsistencies. The flowsheet and measured data were part of the comminution simulation test set prepared for the International Comminution Research Association workshop, ICRA 95, by Dr R.P. King of the Comminution Center, University of Utah.
Grinding Circuit
480.9 25.0 1.1 61.8 16.3 50.0 15.3 367.9 55.0 8.4 16.6 12.7
150.2 30.0 25.0 SOLIDS t/h %Pb %SOL %Fe 62.8 40.1 55.0 12.4 43.2 34.9 35.0 13.5 15.6
19.5 51.7
55.0 10.0
FLOTATN.XLS
The flowsheet in this workbook depicts a typical flotation circuit, consisting of a rougher and scavenger banks, a regrind mill and retreat bank, and three stages of cleaning. This example demonstrates the following: conversion of assay data to mass flow data to allow solution using the engine. The use of the two product formula as the basis of a simple flowsheet model of a flotation bank.
Regrind Mill
The regrind mill can have no effect on the components presented to it (mass flowrates of components), so the model merely copies the feed data to the product stream.
EFFCURVE.XLS
Modelling options in
There are three main options for modelling in , which may be used in combination to provide many more possibilities. The workbook EFFCURVE.XLS gives an example of the use of each of these three options. There are four unit icons on the flowsheet, linked to four unit models, one written in the spreadsheet, one written using VBA, the macro language of Excel 5, and two written using higher level languages (one in Fortran, and one in C++).
Spreadsheet modelling
This is the most commonly used method of modelling for , and the method which has been used in all of the previous examples in this Part of the manual. In spreadsheet modelling, the mathematical description of the unit is expressed in cell formulae on a worksheet (or across multiple worksheets if necessary). A group of cells is defined to hold the data which represents the components in the feed to the unit. (e.g. worksheet [EFFCURVE.XLS]Spreadsheet Model!$C$4:$C$12, where nine cells are allocated to hold the mass flowrate of material in each size fraction of interest in the feed). If required, a group of cells is allocated to hold user entered model parameters (e.g. Spreadsheet Model!$C$15:$C$17, where the cyclone efficiency curve parameters are entered). By a combination of cell equations, the vector of feed data is transformed according to the properties of the model, producing one or more vectors of data which represent the mass flowrate of material in each size fraction of interest in each product.
In this example, the model is the Lynch/Rao hydrocyclone model, and the data is taken from Lynch Mineral Crushing and Grinding Circuits, Elsevier, 1977, Example 6-4, pages127-130. The data in columns D through J represent the various steps necessary to calculate the component mass flows in the hydrocyclone underflow and overflow streams, given the entered values of alpha, d50c, and C. Ranges Spreadsheet Model!$K$4:$K$12 and $L$4:$L$12 represent the underflow and overflow streams respectively. The model defined in this way is a stand-alone model, not unlike a subroutine written in a conventional computer language. There are no cell equations relating the feed stream vector on this sheet to any other worksheets ( uses the flowsheet to provide this information at solution time.)
Why Wizards?
With the increasing complexity of modern software, many vendors have realised that there is a need for on-line assistance to provide user access to the features of a package, without requiring the user to become totally familiar with the details. Agents, Assistants, Tutors, are all names for software helpers which guide a user through a complex operation. With Excel 5, Microsoft introduced the term Wizard to describe its version of these helpers, and the technology (and name) is now used in many of the Microsoft Office component programs.
Limn Wizards
There are several situations which arise when using , where automation would provide significant benefits. The most obvious of these is in the definition of stream component data, and the linking of spreadsheet data ranges to the process unit icons and stream flow lines which make up process flowsheet. The DataWizard which is part of the version 1.00 release of provides that automation. Also planned for release in early updates to version 1.00 of are a DatablockWizard to automate the set-up of the process flowsheet information blocks, and a PrintWizard to assist in printing of flowsheets. Where regime, is to be used in a specific modelling/flowsheet solution potential exists for more complete automation. The (available separately) is one such package which handles many of the data set-up requirements for spreadsheet based flowsheet solution work in coal processing plants.
Introduction
After drawing a flowsheet using , and before proceeding to , a user must: 1. Define the component data required for the flowsheet solution. 2. Link the flowsheet unit and stream representations to their associated data elsewhere within the spreadsheet. 3. Build the flowsheet solution models required for each of the process units. The DataWizard assists in the first task, performs the second and provides a basis for the third task, removing much of the need for tedious and potentially error prone manual configuration.
DataWizard Components
The DataWizard consists of the file, LIMNWIZD.XLA, which should be present in the installation (default \ ) subdirectory. The DataWizard has its own Excel toolbar and button which install themselves the first time LIMNWIZD.XLA is loaded into Excel (See Part 1 of this manual for more information about loading Excel AddIns.)
Feed to Cleaners
Cleaner 2
Cleaner 3
Final Concentrate
2. Start DataWizard
Having drawn a flowsheet, exit and return to Excel. With the required flowsheet as the active worksheet, press the DataWizard button on the DataWizard toolbar.
4. DataWizard Sheet 2 - component name entry Vertical & Horizontal name entry
Pressing the Next button on DataWizard Sheet 1 progresses the Wizard to Sheet 2. This sheet allows entry of the component or species name for the flowsheet solution. There are two types of components, those that play a direct part in the solution, and which must be able to be summed at a joining node by simple addition (e.g. solids flowrate in t/h, liquid volume flowrate in m3/h), and those which are calculated from the above components using spreadsheet formula (e.g. % solids, assays etc.)
Because we selected the Vertical option on DataWizard Sheet 1, Sheet 2 refers to VERTICAL component names. (See opposite) To enter mass related components, click the mouse in the top list box, then press the Insert button. A sub-dialog appears, asking for name entry.
The Edit button may be used to modify existing names (select the name in the required name list and press the Edit button, then edit the old name in the name entry sub-dialog), and the Remove button used to delete them. Normal Windows editing keys work during entry of names, allowing copying from, or pasting of names into the name entry field on the name entry sub-dialog. In the example, we wish to track the flowrates of solids and water, and the percentages of two metals in the ore minerals. To allow the engine to solve for these, we must enter mass flowrates of each of the metals required, the mass flowrate of the remainder of solids in the stream, and the mass flowrate of water. These form the Mass related components for the solution. The derived components are thus the total solids flowrate (sum of all of the solids sub-species), assays of each metal (calculated from flows) and %Solids (calculated from total solids and water flowrates). On completion of the entry of component names for the example, the component name list will contain:
2-Dimensional data
When the 2-Dimensions option is selected on Sheet 1, the number of sheets in the DataWizard is increased to 5, and two component name entry sheets are displayed in sequence. They allow entry of names for components to be displayed vertically (e.g. size distribution intervals) and those to be displayed horizontally (e.g. mineral species) respectively.
Unit Data Sheets DataWizard creates a separate unit data sheet for each process unit icon on the flowsheet. Each sheet is named Unit_ followed by the user specified name for that unit. Thus, in the example, three sheets would be created, Unit_Cleaner 1, Unit_Cleaner 2, and Unit_Cleaner 3. Each sheet is a template of a user defined spreadsheet model, with the data ranges required to link that model to the process unit representation on the flowsheet. The freshly created template for Unit_Cleaner 1 is shown opposite. Note that the derived data are also present on this sheet. This is not strictly necessary, since modelling must take place using the mass related component data. In many cases, however, the derived data provides useful information which can assist to validate or debug the model. If the derived data are not required, the cell ranges may be deleted.
Formatting Formatting of the template sheets created by the DataWizard is entirely at the discretion of the user. The only critical aspects of the sheet are the cell ranges representing the mass related components on the StreamData sheet, and the corresponding Feed and Product stream mass related components on the process unit model sheets. Because these are linked to the flowsheet representations of streams and units, care must be taken to ensure that any formatting (particularly cell insertion or deletion) does not destroy that linkage. (The linkage mechanism is the Excel Named Range. Each block of mass related component data is described by a hidden range name derived from the flowsheet object name - for more information, see Part 4 of this manual, Technical Reference, Chapter 3.)
Sources of Icons
The Excel drawing toolbar
Excel itself can be used to draw rudimentary process unit icons. An example later in this chapter shows how this may be done. Icons drawn in this manner will generally be of lower quality than those drawn using a specialist drawing package.
CAD packages
Most CAD packages which are intended for use in the Windows environment have the ability to copy data to the clipboard in Windows Metafile Format.
1. It is easier to connect and align drawing components if a large scale is used (up to 400% zoom may be manually entered, even though the Zoom Control menu stops at 200%). 2. The grid-lines on a worksheet make useful guides for drawing alignment. 3. Double clicking a Drawing toolbar button latches the button and allows that drawing object type (line, square etc.) to be repeated.
Windows Metafiles
Existing Windows Metafiles may be used as a source of icons in two ways. They may be inserted into an Excel worksheet, using the menu Insert Picture command (see example 3 below). Alternatively, will recognise files with a .WMF extent as Windows Metafiles during the Select a Unit Icon dialog, and will include them in the list of available icons as _file: filename.wmf. The disadvantage of this approach is that there are no default process unit names, or default stream connections associated with the icon.
Examples
1 - Using Excel drawing tools
The following steps demonstrate how to add a process unit icon (a simple splitter icon) to the package, when the icon is drawn using the Excel drawing tools. 1. Activate the Excel Drawing toolbar (Menu option View, Toolbars, check Drawing). 2. Draw the representation of the process unit (the icon) using a combination of the drawing tools. 3. Select all components of the new picture and using the drawing toolbar Group button.
The utility will only recognise an Excel Group, Picture or Drawing Object for conversion to an icon.
4.
the new unit icon group, and click the button on the toolbar.
5. A dialog box will appear, allowing selection of a directory and file location for the new icon Metafile, and allowing entry of a description (as displayed on the Add Icon dialog) and a default name (the /Excel object name). For the moment, ignore the fields at the bottom of the dialog referring to the default feed and product streams.
6. Select the directory and filename in which you wish to store the new icon. 7. Enter a description and default name for the Icon. 8. Press OK to close the New Icon and Icon File Details dialog. 9. Open a new Excel workbook.
Zooming to 400% within makes it easier to precisely align stream tags with the required point on the new unit icon picture.
10.Start
11.Within , select the Add a New Unit Icon option, and navigate to the subdirectory in which the new icon was placed. The icon description entered in step 7 above should now be included in the list of available icons. Clicking on that description should show the new icon picture in the preview box. 12.Click OK to place the new icon on the flowsheet. Note that at this stage it has no streams attached. 13.Using the normal stream draw methods, draw product stream tags from appropriate points on the new unit icon. These tags should be short single segment streams. Draw feed streams at this point too, if desired.
14.Exit
15.Select the new icon picture. (It will be necessary to use the mouse RIGHT button, or to hold the control key down while selecting the picture, or to use the Drawing Selection button on the Drawing toolbar. As it does for all unit icons and streams, has assigned a data access macro to the unit icon picture on this sheet. A simple click will activate this macro, rather than selecting the drawing object.) 16.Click the button on the toolbar.
17.The New Icon and Icon File Details dialog will appear. Note that there are now names for each of the stream tags which were drawn using
18.Select the original file to save the new icon picture into (now with stream tag details included). Stream names and unit icon default name or description may also be updated at this time.
is now complete.
The icon file (filename.WMF) may be moved to a suitable directory using normal windows file handling tools. If this is done, be sure to delete the file ICONWMFS.LMN if one exists in the directory into which the new icon file is moved. The file ICONWMFS.LMN is an index file, used to speed up the display of icon descriptions in the Select a Unit Icon dialog. Deleting the index file ensures that a new index, including the new unit icon, will be created next time the Select a Unit Icon dialog is accessed.
The information in this section is provided in the interests of completeness and the open nature of the package. There is no need to manually edit the INI file under normal operation. Advanced users may wish to modify entries in this file to customise the default operation of , or to access extended functionality.
INI files may be edited with any text editor which can save the file as simple text. Windows Notepad works well.
!!!WARNINGS!!!
The format of an INI file may be important. Changes to the file may prevent the parent application from functioning correctly (or at all). Make sure that a backup copy is made before attempting to edit any INI file. Spaces in parameter strings may be critical. If manually modifying INI files, ensure that the current formatting is maintained.
Introduction
INI files
Microsoft Windows programs use a special file to store user preference information (default settings, preferred screen layout etc.). Typically, these file use the name of the application, followed by the extension .INI (for INItialisation file), and are stored in the \WINDOWS subdirectory. INI files are text files, consisting of a series of SECTIONS, each of which may have several ENTRIES. A section is defined by a heading which is simply some text enclosed in square brackets. Entries follow the section heading, and are of the form entry_text=data_text, where data_text contains the parameters associated with the entry. Thus, the generic form for an INI file is: [SECTION_1] entry_1=data_1 entry_2=data_2 [SECTION_2] entry_1=data_1 entry_2=data_2
LIMN.INI
The Initialisation file for is a file named LIMN.INI, present in the subdirectory (default \LIMN). It contains various sections whose entries determine the default user interface options for the package.
Parameter definitions for Entry Patterns= in Sections: [Handles] [UnitFormat] [TextboxFormat] [NodeFormat] [LabelFormat] All parameters refer to equivalent options on the various tabbed pages of the Excel Format Object dialog box
Bauto is a number from 0 to 2 specifying border settings. If bauto is Border settings are 0 Set by the user (custom) 1 Automatic (set by Microsoft Excel) 2 None is a number from 1 to 56 corresponding to the 56 border colors in the Border tab. is a number from 1 to 8 corresponding to the eight border styles in the Border tab. is a number from 1 to 4 corresponding to the four border weights in the Border tab. If bwt is Border is 1 Hairline 2 Thin 3 Medium 4 Thick
Shadow is a logical value corresponding to the Shadow check box. If shadow is 1, Microsoft Excel adds a shadow; if 0, Microsoft Excel removes the shadow. Aauto is a number from 0 to 2 specifying area settings (that is, the object's "surface area"). If aauto is Area settings are 0 Set by the user (custom) 1 Automatic (set by Microsoft Excel) 2 None is a number from 1 to 56 corresponding to the 56 area background colors in the Patterns tab. is a number from 1 to 56 corresponding to the 56 area foreground colors in the Patterns tab.
Aback Afore
Apattern is a number corresponding to the area patterns in the Patterns tab. Apattern can be from 1 to 18. Rounded is a logical value corresponding to the Round Corners check box. If rounded is 1, the corners are rounded; if 0, the corners are square. Newui is a logical value that specifies whether to use the new user interface features introduced in Microsoft Excel 5.0. It should always be 1.
Section [HitTest]
There is only one entry in this section. Entry: BaseSize= This entry defines the sensitive area around the mouse cursor which is used when determining which object is under the cursor. It corresponds approximately to a number of points from the cursor hot spot. The size of the HitTest spot also determines the size of the object selection, or sizing handles on each Excel/ object. The default entry is: BaseSize=2
Section [MACROS]
The entries in this section define two Excel Macro names which are used by to control aspects of Excel operation.
Although the Assigned Macro name for an Excel/ object may be manually altered (Menu Tools, option Assign Macro), so that a new macro is called on object selection, this is not particularly useful. If is entered subsequent to the manual alteration, the altered macro name will be overwritten with the LIMN.INI default macro name during normal exit processing.
Entry: ObjectSelect= as the macro name assigned to any This entry is used by Excel/ objects on exit from a session. A macro with this name is called whenever a user selects the object in Excel. The default entry is: OnLimnObjectSelect OnLimnObjectSelect is a macro defined on a hidden VBA sheet created whenever is run for the first time in a workbook. (See Hidden Sheets later in Part 5 of this manual - this Part). The default action of this macro is to jump to the data associated with the Excel/ object, or to warn if no such data exists. There are two ways to specify alternative behaviour: 1. A different macro name may be specified in the LIMN.INI file. On subsequent sessions, this macro will become the assigned macro for all Excel/ objects on the worksheet. 2. The hidden macro OnLimnObjectSelect may be modified to produce the desired behaviour. checks for the presence of this macro, and will not overwrite it if it already exists within a workbook.
Entry: SolveCallback= If a macro name is specified using this entry, it will be called once during each iteration of the engine. This facility is most often used to apply constraints to the solution. The default entry specifies no call-back routine: If a call-back routine is specified e.g.: [MACROS] SolveCallback=MyCallbackRoutine the macro routine (MyCallbackRoutine) must exist in the current workbook, or an Excel error will occur and a warning message will be displayed on each iteration of the engine. A dummy routine consisting simply of: Sub MyCallbackRoutine() End Sub may be used if the functionality of the call-back routine is not initially required.
SolveCallback=
Automatically Updated
This group is used to store internal data from one next. There is only one INI file section in this category. session to the
Section [IconPath]
Entry: MRU= This section and entry stores the full file system path to the location of the Most Recently Used process unit icon. This allows the icon selection dialog to be opened at the location from which the most recent selection was made. There is no default.
Section [DatablockFormat]
This section determines the default appearance of the datablocks on a flowsheet. There may be up to two entries. Entry: Pattern= This entry has 11 required parameters. The parameters are integer values, and must be in the following order: (see earlier table opposite Section [Handles] for meanings of each parameter)
bauto, bstyle, bcolor, bwt, shadow, aauto, apattern, afore, aback, rounded, newui
The default entry is: Pattern=1 1 1 1 0 1 1 1 1 0 1 Entry: ExtentOption= This entry has one parameter which records the latest user selection on the Format Object dialog. It may have either of two values. A value of 1 means to apply formatting changes to all like objects on the flowsheet. A value of 0 means to record the formatting changes for use as future default patterns. The default entry is: ExtentOption=1
Section [NodeFormat]
This section determines the default appearance of the stream connecting nodes on a flowsheet. The entries are identical to those for Section [DatablockFormat] (above). The default entries are:
Pattern=0 1 1 1 0 0 1 1 1 0 1 ExtentOption=1
Parameter definitions for Entry Font= in Sections: [TextboxFormat] [LabelFormat] All parameters refer to equivalent options on the various tabbed pages of the Excel Format Font dialog box
Size_num Bold Italic Underline Strike Color is the font size, in points. corresponds to the Bold item in the Font Style list box. corresponds to the Italic item in the Font Style list box. corresponds to the Underline check box. corresponds to the Strikethrough check box. is a number from 0 to 56 corresponding to the colors in the Font tab; 0 corresponds to automatic color.
Section [UnitFormat]
This section determines the default appearance of the process unit icons on a flowsheet. The entries are identical to those for Section [DatablockFormat] (above). The default entries are:
Pattern=2 1 1 1 0 2 1 1 1 0 1 ExtentOption=1
Section [LabelFormat]
This section determines the default appearance of the labels on a flowsheet. Entry: Pattern= This entry is identical to that for Section [DatablockFormat] (above). The default entry is: Pattern=1 1 1 1 0 1 1 1 1 0 1 Entry: ExtentOption= This entry is identical to that for Section [DatablockFormat] (above). The default entry is: ExtentOption=1 Entry: FontName= This entry records the user preferred font name for labels on the flowsheet. The default entry is: FontName=Arial Entry: Font= This entry records the user preferred font attributes for labels on the flowsheet. This entry has 6 required parameters. The first parameter is a decimal number and the remaining 5 parameters are integer values. They must be in the following order: (see table opposite for the meanings of each parameter).
size_num, bold, italic, underline, strike, color
Parameter definitions for Entry Align= in Sections: [TextboxFormat] [LabelFormat] All parameters refer to equivalent options on the Excel Format Object - Alignment dialog.
X_align is a number from 1 to 4 specifying the horizontal alignment of the text. X_align Horizontal alignment 1 Left 2 Centre 3 Right 4 Justify Y_align is a number from 1 to 4 specifying the vertical alignment of the text. Y_align Vertical alignment 1 Top 2 Centre 3 Bottom 4 Justify Orient_num is a number from 0 to 3 specifying the orientation of the text. Orient_num Text orientation 0 Horizontal 1 Vertical 2 Upward 3 Downward Auto_size corresponds to the Automatic Size check box. Automatic size makes the border fit exactly around the text no matter how you change the text.
Entry: Align= This entry records the user preferred text alignment for labels on the flowsheet. This entry has 4 required parameters which are all integer values. The parameters - in order - are: (see table opposite for the meanings of each parameter).
x_align, y_align, orient_num, auto_size
Section [TextboxFormat]
This section determines the default appearance of the textbox unit icons on a flowsheet. Entry: Pattern= Entry: ExtentOption= Entry: FontName= Entry: Font= Entry: Align= These entries are identical to those for Section [LabelFormat] (above). The default entries are:
Pattern=2 1 1 1 0 2 1 1 1 0 1 ExtentOption=1 FontName=Arial Font=10.00 0 0 0 0 1 Align=2 2 0 0
Entry: DefaultText= This entry defines the default text displayed in the text box unit icon. The default entry is: DefaultText=Your Text Here
Section [Grid]
This section stores the user preferences for the drawing grid. The grid show and snap states may be independently manipulated. Entry: ShowGrid= This entry requires one integer parameter. 1 means show the grid, 0 means hide it. The default entry is: ShowGrid=0 Entry: SnapToGrid= This entry requires one integer parameter. 1 means force objects to align (Snap) to the grid, 0 means allow free placement. The default entry is: SnapToGrid=0 Entry: SizingIndex= This entry requires one integer parameter. The number in the range 1 to 5 refers to the required grid interval, i.e.: Sizing Index Grid Interval 1 Very Coarse 2 Coarse 3 Medium 4 Fine 5 Very Fine The default entry is: SizingIndex=4
Section [Solution]
This section stores the user preferences for the entered from the Solution Options dialog accessed via the menu Solve. engine, as
Entry: UpdateInterval= This entry requires one integer parameter which represents the number of solution iterations between successive screen updates. The default entry is:
UpdateInterval=1
Entry: UpdateOption= This entry requires one integer parameter which represents the Screen Update option button selection on the Solution Options dialog, where: Screen Update Option Means 1 Do not display 2 Display after first iteration 3 Display after solution convergence The default entry is: UpdateOption=3 Entry: LimitIndex= This entry requires one integer parameter which represents the index into the convergence limit menu. The convergence limit decreases by a factor of 10 for each unit index increase, based on a start value of 10e+4, i.e. an index of 1 represents a convergence limit of 10e+4, an index of 2 represents a convergence limit of 10e+3, an index of 3 represents a convergence limit of 10e+2, and so on. An index of 10 represents a convergence limit of 10e-5. The default entry is: LimitIndex=10 Entry: DiagnosticOption= This entry requires seven integer parameters. The first parameter represents the Diagnostic / Error Display options option button selection on the Solution Options dialog, where: Diagnostic / Error Display option Means 1 Do not display 2 Display after first iteration 3 Display after solution convergence Parameters 2 to 4 represent the state of the check boxes in the Warning options sections of the Solution Options dialog, where: Parameter If set to 1 means 2 Warn if units have no feed streams 3 Warn if streams come from no unit 4 Warn if streams have no data ranges
Parameters 5 to 7 represent the state of the check boxes in the Diagnostic display options sections of the Solution Options dialog, where: Parameter If set to 1 means 5 Display unit/stream connections 6 Display unit data ranges 7 Display stream data ranges Setting the parameters to zero disables the corresponding warning or diagnostic display option. The default entry is: DiagnosticOption=3 1 1 1 0 0 0
Introduction
functions by using the component objects of Excel, and has no to native data or objects of its own. It is thus necessary for impose a set of naming conventions over certain Excel resources in order to determine which aspects of an Excel workbook belong to . The two distinct areas where imposes its own naming conventions are on graphical objects used to make up the flowsheet, and spreadsheet data ranges used to hold the process data relating to those objects. In order to distinguish specific names from other names in a workbook, they are prefixed by a four character code. The first character is a character such an underscore or back slash, which is used to divide the names into classes, and which is chosen to minimise the likelihood of name clashes with normal Excel user defined names. The second character is an alpha object type identifier, and the third and fourth characters are numeric indices, specific to the object type.
naming convention for Flowsheet Graphical Objects Flowsheet object Picture unit icon Prefix _Unn Valid codes (nn) 00 01 02 03 Textbox unit icon Datablock Label Stream _T00 _D00 _L00 _Snn 00 00 00 00-99 Meaning Unit is unrotated Unit is flipped top to bottom Unit is flipped side to side Unit is flipped top to bottom and side to side none none none 00 = segment 1 01 = segment 2 02 = segment 3 etc. none
Node joiner
_N00
00
Excel range names cannot include a space character. For this reason, range names used to define ranges for data have any spaces in the user defined name replaced with the underscore character.
naming convention for Spreadsheet Data Ranges Object Stream Unit (Spreadsheet model) Prefix \Snn \Unn Valid codes (nn) 01 01 02 03 04 05 06 07 21 22 23 24 25 Meaning 01 = stream data Unit Feed data Unit Product 1 data Unit Product 2 data Unit Product 3 data Unit Product 4 data Unit Product 5 data Unit Product 6 data Model parameter data DLL library name Model name in DLL always = UserDLL Model return data
\Unn
Hidden names
The Spreadsheet Data Range names referred to in this section have been implemented in as sheet specific hidden names. This means that they are not accessible from the Excel menu Insert Name Define dialog. They are, however, accessible from VBA macro code. The following subroutine will list all of the names in the active workbook, and list the ranges or data they refer to:
Sub ListNames() Dim aName As Object Dim i As Integer i = 1 For Each aName In ActiveWorkbook.Names ActiveCell.Offset(i, 0) = aName.Name ActiveCell.Offset(i, 1) = " " & aName.RefersTo i = i + 1 Next aName End Sub
Temporary names
:Solve
Two names are created by the engine for use by user written VBA Macros during the flowsheet solution. They are only valid for the life of the engine. \IterationCount contains the number of times the engine has calculated all units and all streams, i.e. the cycle, or iteration number. After the engine completes, this name contains 0. \Convergence contains the current convergence factor, i.e., the sum of the absolute differences between all components in all streams on successive cycles or iterations of the engine. After the engine completes, this name contains the largest possible positive double precision number.