Tutorial METSIM HATCH

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 50

ISO 9001-94

Page 1 of 50

METSIM Training Notes


Mass and Energy Balance Modules
For Version 11.03

1. Introduction ......................................................................................................................... 2
1.1 Capabilities and Limitations .......................................................................................... 2
1.2 Uses of METSIM .......................................................................................................... 3
1.3 Installation .................................................................................................................... 3
1.4 Need More Help? ......................................................................................................... 3
2. Navigating METSIM for Windows ....................................................................................... 4
2.1 Streams ........................................................................................................................ 5
2.2 Unit Operations............................................................................................................. 7
2.3 Controllers .................................................................................................................... 9
2.3.1 Feedback Controllers ........................................................................................... 9
2.3.2 Feed forward controllers .................................................................................... 11
2.3.3 Flowrate Controllers ........................................................................................... 11
2.3.4 Percent Controllers ............................................................................................ 12
2.3.5 Instrument .......................................................................................................... 13
3. Icons Description .............................................................................................................. 14
3.1 General Commands ................................................................................................... 14
3.2 Flowsheet movements ................................................................................................ 15
3.3 Flowsheet item commands ......................................................................................... 15
3.4 Tool Commands ......................................................................................................... 17
3.5 Navigate and Calculate............................................................................................... 18
3.6 Others ........................................................................................................................ 19
4. APL (A Programming Language) ..................................................................................... 19
4.1 Mathematical Expressions in APL .............................................................................. 19
4.2 APL Symbols .............................................................................................................. 19
4.3 Value Functions .......................................................................................................... 22
5. User Objects ...................................................................................................................... 22
6. Heat Balance...................................................................................................................... 24
7. Extracting information from METSIM............................................................................... 25
7.1 Display ....................................................................................................................... 25
7.1.1 Creating Reports ................................................................................................ 25
7.1.2 Generating reports ............................................................................................. 26
7.2 Dynamic Data Exchange ............................................................................................ 26
7.2.1 Uses 27
7.2.2 Steps ................................................................................................................. 27
7.2.3 Use imported values .......................................................................................... 32
7.2.4 Vectors and Matrices ......................................................................................... 33
7.2.5 Automatic DDE .................................................................................................. 33
7.3 Screen Outputs........................................................................................................... 34
8. Converging a Model .......................................................................................................... 37
8.1 Convergence Window................................................................................................. 37
8.2 Tolerances.................................................................................................................. 38
8.3 Debugging .................................................................................................................. 39
c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01
ISO 9001-94
Page 2 of 50

9. Inheriting a METSIM model ............................................................................................... 39


9.1 Convergence .............................................................................................................. 39
9.2 Syntax of Functions .................................................................................................... 39
9.3 Components List......................................................................................................... 40
9.4 Controller Numbering ................................................................................................. 40
9.5 Stream numbering ...................................................................................................... 41
9.6 Revisit convergence ................................................................................................... 41
10. Other Tips .......................................................................................................................... 41
10.1 Deleting and Renumbering Specific Objects ............................................................... 41
10.2 Steps to Building a Model ........................................................................................... 41
10.3 Controller Configuration .............................................................................................. 42

1. Introduction

METSIM is a simulation package used to facilitate the modelling of complex minerals


processing as well as chemical, metallurgical and environmental processes. It was created
by Mr. John T. Bartlett (PROWARE) and is licensed to companies for a fee. A physical key
(Sentinel) and a license number are required to run this program, otherwise, one can only
open the demonstration (demo) version, which has limited capabilities. The program was
originally created for DOS, however it is now widely used in Windows. It is desired within
Hatch to use Windows for new models and eventually stop the use of the DOS version
altogether. The DOS version is no longer supported by the supplier. APL is the computer
language used by this software.

Currently, METSIM is one of the preferred packages for process simulation throughout the
various echelons of HATCH.

1.1 Capabilities and Limitations

METSIM is sold by PROWARE in various modules, depending on the needs of the users. In
Australia, the basic module (mass balance) and the energy balance module are mostly used.
Other modules available include:

Dynamic simulation Multicomponent particle size analysis

Heap leach Solar/weather

Operating Cost Gravity separation

Particle size analysis

For these notes, only the mass and energy balance modules will be covered.

Some additional points to be made about METSIM:

Has an extensive component database, steam tables and heat of formation data;
Interface to other network software;
Does not predict chemical reactions, kinetics or thermodynamic equilibrium;

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 3 of 50

1.2 Uses of METSIM

A METSIM model is a good location for storing process information about a plant‟s
operation. Generally, METSIM is used for

Plant material and energy balances Process optimisation

To build continuous models Sensitivity studies

Detailed design studies Make flow tables

Evaluate test data Flowsheet development

Operator training Control system analysis

1.3 Installation

From Windows Explorer, open the Win folder of the METSIM CD and run “Install.exe”.
METSIM must be installed in the folder c:\metsim, otherwise it will not run. After installing
METSIM, start the application. You will be prompted to enter the license number that
corresponds to this version and your location (normally printed on the case of the installation
disk). Ensure that there are no typos otherwise you will have the demo version permanently
on your machine and will have to reinstall the software. To run the program, click on the
Windows Start menu, select Program Files, then METSIM.

Note that multiple versions of METSIM can be installed on the same computer, but they
cannot share the same c:\metsim folder. The only way around this is to rename the
METSIM folder depending on the version to be used. For example, if one has version 11.03
and desires to have also version 12.06 on her computer, she can rename the c:\metsim
folder to c:\metsim 11.03 while the 12.06 version is installed. If the folder is not renamed,
then version 12.06 would replace the old version 11.03.

Your screen resolution should be at 1024 by 768 pixels to be able to best view the METSIM
window.

If you plan to work on a large model, you may find it impossible to save it. It is likely that
there is insufficient APL workspace allocated in your computer. To avoid this from the start, it
is recommended to do the following immediately after installing METSIM. The METSIM
default size of APL workspace is set in the METSIM.INI or configuration file located in the
windows folder of the c: drive root directory. To open the file, open windows explorer, go to
the computer c: drive, open the windows folder, open file METSIM configuration file. The first
line reads Wssize = 32M. Set the Wssize for a 128 Meg machine to 72M, for a 160 Meg
machine set to 96M, etc.

1.4 Need More Help?

METSIM (http://members.ozemail.com.au/~ozmetsim/)
Mr. John T. Bartlett metsim@primenet.com

Mr. Kevin Charlesworth ozmetsim@ozemail.com.au


(Australian representative)

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 4 of 50

Users in Australia:

Caroline Palmer (hydro, DOS and Win) CCPalmer@hatch.com.au


Irena Ivanova IIvanova@hatch.com.au
Kirstin Taske ktaske@hatch.com.au
Users in Mississauga, Canada:
Ida Fok (hydro)
IFok@hatch.ca

2. Navigating METSIM for Windows

To open METSIM once it has been installed, simply click on the Start menu, select
Programs, then METSIM. When METSIM is first opened, the screen will look like Figure
1.4-1. There are a number of drop down menus at the top to select from and a number of
icons at the top and to the right. Each icon serves a different purpose which will be
discussed in later sections. Note that by moving the mouse over each icon, you can see the
name of the icon and generally that is sufficient to give an idea as to the icon‟s purpose.

Take care when clicking on the Save Model icon, it is a shortcut and will not allow you to
save your model with a new name. It is best to use the Files menu instead and Save As…
to save using a new name. It is advised to frequently save your model before performing
major runs.

If you wish to rename a METSIM file, it is best to open the file and Save As another
name. If you take a shortcut through Windows explorer to change the name, it will
appear to change the file name, but when you open METSIM and save the file, it will
save it as its original name, thus potentially losing information you wanted to keep
in your original file.

Figure 1.4-1: Initial METSIM for Windows Screen

As most METSIM modellers often end-up working on an existing model, learning to navigate
around one is the best place to start learning about METSIM.

Open the file named Navigate.sfw and save it with a different name, say Navigate1.sfw.

You may find that the text fonts are very large immediately after you first install METSIM. It is
possible to reduce these by clicking on Setup, then Select Fonts. Change the font sizes

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 5 of 50

from there. A font size of 16 for GRAPHICS SMALL font and a font size of 24 for GRAPHICS
MEDIUM and GRAPHICS LARGE should be adequate. It is not necessary to change the
PRINTER fonts.

Note that the flowsheet displayed on the screen uses various colours to represent different
things. For example, unit operations (the blocks) are yellow, some streams are blue, some
are green, etc. METSIM uses default colours to represent items. In this instance, blue
streams are mainly aqueous streams, green ones are mainly gas streams, etc. Default
colours can be changed via the Setup menu, then Select Object Colors. For now, lets
leave them as they are.

Now to have a look at the various objects on the flowsheet and to get a start in
understanding some of the icons and menu items in METSIM.

2.1 Streams

First click on the Edit Object Data icon ( ), then on the number of the stream to edit, for
now stream 10;

A new window will open, as shown in Figure 2.1-1 below;

This is where the stream is defined (temperature, flowrates, components, etc.);

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 6 of 50

Components

Mass flowrates

Elements

Figure 2.1-1: Edit Stream Data Screen


When allocating stream numbers, it is a good idea to number streams so as to leave
space to add some in between the existing numbers (e.g. 10, 20, 30…);

The stream phase is displayed by colour on the flowsheet. For mixed streams, it defaults
to the majority phase.

The Time entry is most likely for dynamic modelling. It is not active when the dynamic
function is turned off;

There are some very useful features to know about in this stream window. For example:

When entering flowrates for a slurry stream, you can start at making a guess for the
aqueous and for the solid phase mass flows. METSIM will then report the % solids
(which is in fact shown as a weight fraction) associated with your guesses. You can then
change the % solids entry directly and METSIM will correct the aqueous phase mass

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 7 of 50

flow accordingly. This done, you can then change the total flow entry that METSIM
calculated, and it will change all phase flowrates while keeping the % solids the same.

Changing a component‟s weight fraction will automatically change its mole fraction or
concentration, depending on the phase you are looking at. Any component content
change also automatically updates the element values.

Elemental compositions can be also changed to suit assays, however if more than one
component contains the particular element, for example in this case sulphur, then
METSIM can return an error, unable to update all the sulphur containing components.

The buttons ate the top allow you to see the content of the phases they represent. SI for
solid inorganic, LO for liquid organic, and so forth.

Experiment with the stream edit window to see how it behaves.

METSIM does not differentiate between input and calculated values and thus will
not indicate to the user which are input and which are calculated by METSIM.

2.2 Unit Operations

Unit operations represent actual process steps or functions. There are several basic unit
operations and many more specialised ones. This example model uses the more basic units.
These are described in detail in Appendix 5 and it is recommended to review this section to
understand how these units function. Some tips are discussed here:

Click on the Edit Object Data icon ( ) and click on the number of the unit operation to
edit, for example, unit operation 9;

The first tab displayed shows generic information about the unit operation. This is very
similar for all types of unit operations. It generally contains:

EX: switch to turn on/off the unit operation during convergence. This can be useful
when debugging a model.

UC: unit operation code. It is advised not to change this. If it is desired to change the
unit operation type, it is best to add a new unit operation and reconnect the streams
to it instead. Each unit operation type has its own three-letter code.

UN: Unit operation name.

EN: Unit equipment number. This is not a required field but can be useful when
someone new picks-up a model.

FS: Feed stream numbers.

IX: Inventory. This is only used in dynamic simulation mode.

DS: Discharge stream numbers.

OP: Unit operation number. This number is sequential and defines the calculation
order. It is advised not to change this value and to use the IFLS function instead.
(See Appendix 1)

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 8 of 50

ME, NO, KW, HP: These are related to equipment sizing and operating costs, both of
which are not covered here.

Each unit operation has its own set of reactions;

Reactions are executed in order, not proportionally;

The reaction extent (a fraction, not a %) is based on the first component defined in
the reaction;

It is sometimes useful to react reagents into elements, distribute the elements


between the phases and then react to the desired products;

The heat of reaction is based on the heat of formation of the reactants and products;

To use a controller for extent of reaction, use VCTL # (# = controller number), make
sure to select Reaction extent, enter an expression in the drop down menu;

There is also the possibility to use IF statements directly for extent of reaction (not to
be confused with the Logic Controller tab). This is useful when the extent depends on
temperature. As for using a controller for the reaction extent, make sure to select
Reaction extent, enter an expression in the drop down menu.

An example of an APL IF statement would be (1 0)[1+(VTEM s2)>50]. This


expression works as follows:

Checks temperature of stream 2;


If temperature of stream 2 is greater than 50, the squared bracket expression equals
2, and the second entry in the round bracket array is applied as the reaction
extent;
If the temp of stream 2 is less than 50, the squared bracket expression equals 1, and
the first entry in the round bracket array is applied as the reaction extent;

Using expressions in the round bracket array instead of constant numbers also works
(just remember the way APL works and use parentheses if unsure, as discussed in
Section 4).

Make sure to balance the reactions, especially for a phase change. E.g. for the reaction
of water evaporation H2O-li  H2O-g, the first time you click on balance, the
stoichiometric coefficients will be 0. Click again and these coefficients become 1.

Energy information, including heat input and heat output are specified by selecting the
heat balance tab within the unit operation;

Heat input is positive and heat output is negative;

Heat of formation is at 25°C, normally;

The heat input/output can be based on a fixed amount, a percent of total heat input
(which includes the heat of reaction) or as a calculated function of other parameters
(using APL);

Logic controllers are used for IF, THEN, ELSE statements;

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 9 of 50

To specify an output temperature for a unit operation, either enter the desired
temperature in the Contrl C field within the stream data window, or run ISTQ (see
Appendix 1), then select the stream to Edit and change TC manually. If this is not
done, the output temperature will be calculated by METSIM.

There is another trick for entering temperatures, however it is not recommended to


use this method unless all other options have been exhausted. The ISTQ mentioned
above is linked to an internal METSIM matrix, STQ. The entry for temperature is in
the 11th column. So to specify a temperature for stream 50, one would use STQ[50;11].

2.3 Controllers

Controllers form an important part of any METSIM model. Generally one will try to set-up
controllers to mimic those that would be found in an actual plant, but there are other uses for
controllers, as will be evident through the tutorials.

Controllers appear as valves on the flowsheet ( or ). When building the flowsheet,


there are a number of controller types available for selection. These are:

FFC: ( ) Feed forward (ratio controller) – vary an input proportionally to another input

FBC: ( ) Feedback - vary an input to control an output (slows down convergence)

FRC: ( ) Flowrate – fixes an input stream‟s flowrate.

PSC: ( ) Percent stream – Achieves a set solids content in a unit operation outlet
stream by varying a selected a feed stream flowrate. Note that this unit is
only useful when no reactions are present in the unit operation.

INS: ( ) Instrument – Is used to display values on the screen while the model is
converging.

2.3.1 Feedback Controllers


Click on the Edit Object Data icon ( ), then click on one of the feedback controllers. As the
name suggests, feedback controllers manipulate an input variable (called manipulated
variable) to control an output variable (called controlled variable).

Feedback controllers will slow down the convergence of a model. If there is any way not to
use one, then that option should always be considered first.

Fields must be entered when they have a , depending on the modules selected when first
starting the model. The fields in the edit window are as follows:

Tab FBC1

ON: Switch to turn on or off the controller. This is useful when debugging a model or
to speed up convergence.

CN: This is the controller number. Take great care before changing this value. (See
Section 9.4 about numbering)

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 10 of 50

TY: This is the controller type. It is best not to change this value to switch from one
type of controller to another. Rather, insert a new controller and turn the original
controller off and eventually delete it once you are satisfied that it is safe to do so.
(See Section 10.1 about deleting objects)

ID: This is the controller description or name. A good idea is to include what the
controller controls and what it manipulates to achieve the set point.

OP: Unit operation where set point is to be calculated. (Tip: This value should be
equal to or greater than the NO value)

NO: Unit operation where control variable is used.

SN: Adjusted stream or manipulated variable. If manipulating a stream, enter the


stream number, preceded with a lower case s, like so: s100 for stream 100. If the
manipulated variable is not a stream, enter 0 here. There are instructions included in
this window. Take a moment to read them.

OV: Output value of adjusted variable. Enter a first guess here when first setting-up
the controller.

LV and HV: Make limits as tight as possible. There are adjusted depending on
whether the convergence can be achieved. When a controller is unable to achieve its
setpoint, it is often because it has reached one of these limits.

Note that when the model converges, it only needs to hit these limits once to display
a warning or error message. This does not mean that the controller has not recovered
since.

Tab FBC2

VF is the controlled variable (an APL expression)

SP is the desired set point (a value or an APL expression)

DB is not used.

SL: proportionality switch

1 if value  when function 


-1 if value  when function ;

CO: Switch for dynamic modelling, which is not covered here. Leave it turned off.

KP, KI and KD are used for dynamic modelling. Leave these blank.

EE, PG and PV: These give an indication to how well the controller is behaving. It
contains the last three iterations from the controller. EE is the error between the set
point and the controlled variable. The controller tries to make this value zero. PG is
the manipulated variable value and PV is the controlled variable. To reset a FBC,
make all nine of these fields zero.

When the limits are for reaction extents or split parameters, might want to use values
close to 0 and 1 instead of 0 and 1 exactly (e.g. 0.001 and 0.999).

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 11 of 50

2.3.2 Feed forward controllers


Click on Edit Object Data icon ( ) and then click on the controller located on stream 210. A
feedforward controller will vary an input stream‟s flowrate automatically based on a ratio to
another input stream. The ratio can be for a particular component‟s flowrate, solids flowrate,
or any other parameter that the stream should be varied to meet.

The fields in the edit window are as follows:

ON: Switch to turn on or off the controller. This is useful when debugging a model or
to speed up convergence.

CN: This is the controller number. Take great care before changing this value. (See
Section 9.4 about numbering)

TY: This is the controller type. It is best not to change this value to switch from one
type of controller to another. Rather, insert a new controller and turn the original
controller off (or delete it).

ID: This is the controller description or name.

OP: Unit operation where set point is to be calculated.

SN: Adjusted stream. Unlike the feedback controller, this controller does not require a
small s in front of the stream number.

SP: the desired set point (a value or an APL expression)

VF: the APL expression for the ratio to restrict the stream to. There is a good
description inside METSIM in that window about how this ratio is to be set up. Just
remember, the stream being adjusted must be directly proportional to the numerator
of the ratio.

Instead of repeating the stream number of the adjusted stream in VF, you can use SN
instead. For example, if adjusting the flowrate of stream 210 and the ratio would
normally contain a value function like (c8 VMFR s210) in the numerator, instead use
(c8 VMFR SN). Within this controller, SN is a variable given the value you entered in
its corresponding field. In this case, the adjusted stream number.

2.3.3 Flowrate Controllers


There are no flowrate controllers in the example model. They are simple to set-up, much like
a feedforward controller, the difference is that the set point does not represent a ratio,
although a flowrate controller could be set-up in a way that it will behave identically to a
feedforward controller. We will be adding one controller here on the feed stream to the
model.

On the right of the screen, click on the controls icon ( ), then on the FRC icon from the
series of icons that is presented.

Place the FRC directly on top of the stream number for stream 10. Left-click to place the
controller. METSIM will then suggest a controller number to use, for now, accept the
suggested number.

Take a moment to read the description at the top of the edit window that opens up.

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 12 of 50

The fields in the edit window are as follows:

ON: Switch to turn on or off the controller. This is useful when debugging a model or
to speed up convergence. Check this box to turn the controller on.

CN: This is the controller number. Take great care before changing this value. (See
Section 9.4 about numbering) Leave this value as it is at the moment.

TY: This is the controller type. It is best not to change this value to switch from one
type of controller to another. Rather, insert a new controller and turn the original
controller off. Leave this as it is at the moment.

ID: This is the controller description or name. In this case, use “Matte Slurry
Feedrate”

OP: Unit operation where set point is to be calculated. In this case, it is for unit
operation 2.

SN: Adjusted stream. Unlike the feedback controller, this controller does not require a
small s in front of the stream number. If the value here is not 10, then change it to 10
now.

SP: the desired set point (a value or an APL expression). In this case 11.487 (tonnes
per hour)

VF: the APL expression for the stream‟s flowrate. In this case, use (VSTR SN), which
represents the mass flowrate of stream SN (which was set at 10) in the units
specified by the user (set in IPAR, described in Appendix 1), which in this case is
tonnes/h.

Click on OK, and the controller is now set-up.

2.3.4 Percent Controllers


There are no percent controllers in the example model. We will be adding one controller here
in the Navigate1 model, on the water to the hydro feed stream.

On the right of the screen, click on the controls icon ( ), then on the PSC icon from the
series of icons that is presented.

Place the PSC directly on top of the stream number for stream 20. Left-click to place the
controller. METSIM will then suggest a number to use, for now, accept the suggested
number.

Take a moment to read the description at the top of the edit window that opens up.

The fields in the edit window are as follows:

ON: Switch to turn on or off the controller. This is useful when debugging a model or
to speed up convergence. Check this box to turn the controller on.

CN: This is the controller number. Take great care before changing this value. (See
Section 9.4 about numbering) Leave this value as it is at the moment.

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 13 of 50

TY: This is the controller type. It is best not to change this value to switch from one
type of controller to another. Rather, insert a new controller and turn the original
controller off. Leave this as it is at the moment.

ID: This is the controller description or name. In this case, use “Feed moisture”.

OP: Unit operation where set point is to be calculated. In this case, it is for unit
operation 2.

SN: Adjusted stream. Unlike the feedback controller, this controller does not require a
small s in front of the stream number. If the value here is not 20, then change it to 20
now.

PS: the desired concentration or fraction of solids in the feed stream to the unit
operation. In this case, enter 0.77.

CO: calculation option to specify whether the value entered in PS is a weight fraction
or a molar fraction. In this case, it is a weight fraction, so enter 0 here.

CM: if the value in PS is specific to one component, the component number is


entered here. Otherwise, for all solids, the value to enter is 0. Leave it at 0 for now.

Click on OK, and the controller is now set-up.

Now, turn off the other controller on this stream, that is feedback controller 1.

Remember this type of controller should not be used for unit operations where reactions
involving phase changes occur.

2.3.5 Instrument
There are instruments in the example model. We will be adding one controller here.

On the right of the screen, click on the controls icon ( ), then on the INS icon from the
series of icons that is presented.

Place the INS anywhere on the screen. METSIM will then suggest a controller number to
use, for now, accept the suggested number.

Take a moment to read the description at the top of the edit window that opens up.

The fields in the edit window are as follows:

ON: Switch to turn on or off the controller. As instruments do not affect the model,
there is no real purpose to turn them off. Check this box to turn the controller on.

CN: This is the controller number. Take great care before changing this value. (See
Section 9.4 about numbering) Leave this value as it is at the moment.

TY: This is the controller type. It is best not to change this value to switch from one
type of controller to another. Rather, insert a new controller and turn the original
controller off. Leave this as it is at the moment.

ID: This is the controller description or name. In this case, use “Nickel concentration
in hydro slurry”.

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 14 of 50

OP: Unit operation where this controller is to be used. In this case, it is for unit
operation 4.

VF: The value function of what is to be displayed by the instrument. In this case, type
(28 VGLE s80), which will give the g/L of nickel in stream 40.

OV: will be calculated by METSIM.

CO, LV, HV, PC, SM, ND, DL: are only useful for the dynamic simulation module and
will not be covered here.

Click on OK, and the instrument is now set-up

When the model is run, the instrument value is displayed in a window as shown in Figure
2.3-1, in the top-right corner of the window.

Instrument

Figure 2.3-1: Instrument Display

3. Icons Description

Just above the flowsheet are a number of shortcut buttons that perform a variety of
commands. These can be grouped as discussed here.

Load model Save model

New model
Print flowsheet

Model parameters
Error checking
3.1 General Commands

These are generally self-explanatory. The ones that require further explanation are as
follows:

Print flowsheet: When clicking on this icon, a window showing a list of all sections of the
model will be displayed. From this list, one can print one or multiple sections by using the
Shift and Ctrl keys on the keyboard.

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 15 of 50

Model parameters: this is the same as the IPAR menu. (See Appendix 1)

Error checking: This will give you a report on errors detected within the model.

3.2 Flowsheet movements

Enlarge Centre flowsheet


Zoom in
and reduce
and out
drawing
size
Redraw flowsheet
Box items to move Move
flowsheet
The buttons generally are use to place the flowsheet where the user desires it to be. The
redraw flowsheet button refreshes the screen, which is particularly useful after having moved
individual items around.

Try some of these on your Navigate1 model.

3.3 Flowsheet item commands

Renumber Move Move Text


controls Object
Renumber Copy Object
streams Data
Locate
Stream
Delete Edit
object Reverse Change Object
Unit Op Object Size Data

These are some of the most used icons in METSIM. They are here described in more detail.

Locate stream: By clicking on this icon and typing the desired stream number, METSIM
will immediately take you to the stream and highlight it in fushia. If the stream connects
more than one section, it will give you the option of which section to go to. Try locating
stream 250 from your Navigate1 model.

Renumber streams: This is where a stream or all streams in an area of the flowsheet
are renumbered. Clicking on this icon brings up a window where you can define your
stream renumbering parameters.

To renumber a single stream, check the box RN1 and click on OK. Then click on the
stream to renumber. Try this on stream 210. Change it to stream 211. Doing this has
automatically updated the controller that is on this stream and any functions that refer
to this stream (provided there is a small s in front of the stream number and it is not
used in a vector or matrix – see Section 4.3) Have a try at this, but do not save your
file with the changes. It is best to reopen it before moving on.

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 16 of 50

To renumber all the streams on the current section, simply fill-in the information
required under the RENUMBER STREAMS ON CURRENT PAGE heading. Have a
try at this, but do not save your file with the changes. It is best to reopen it before
moving on.

Renumber controls: When clicking on this icon, you are prompted to enter a starting
controller number. It is suggested to make this number 1000 x section number. So for
section 4, 4000 would be selected. Then an increment number is to be specified. Using
the default 10 is fine. When this is done, click on Yes to start the renumbering process.
Only the current section is renumbered this way. Have a try at this, but do not save your
file with the changes. It is best to reopen it before moving on. This is also discussed in
Section 9.4. Remember that if you want to renumber all the controllers, it is best to start
from the last section and move up towards the start of the model.

Delete object: Click on the icon and then on the unit operation number, stream number
or controller to delete. Please see Section 10.1 for more information about deleting
objects.

Reverse Unit Op: Click on this icon and then on the unit operation that needs to be
flipped horizontally. Remember that yellow circles indicate input streams while the yellow
ones are output streams. If you don‟t see the circles on the unit operations, refresh the
screen ( ). Doing this may require that some streams are moved and redrawn.

Change Object Size: Once you click on this icon, left-click on a specific unit operation to
enlarge its size, right-click to reduce it.

Move Object: Once this icon has been selected, simply click on the object number to
move and drag it to a new location. Take care when moving a stream, it takes a little bit
of patience and practice to do it right. Generally, to move a stream, one needs to „redraw‟
it and left-click at every desired bend and right click when it is finished. Practice this on
streams now. It is important to feel comfortable with moving streams around as it is
something that is frequently done.

Move Text: This icon is used only to move text. This includes stream numbers and unit
operation names. A trick to do this right is to click towards the left-end of the text to be
moved. Try this on your example model now place stream number to more appropriate
placements and save your Navigate1 model.

Copy Object Data: This icon is used to mirror the data from one unit operation to
another or from one stream to another. It presents you with a number of items to chose
to copy over. It is a great time saver particularly when copying reactions from one unit
operation to the other.

When you have selected all the items to be copied, click on OK and then left click on
the original item to copy and right click on the item to copy it to.

If the second item is on another section, click on the icon, left click on the item to
copy from, then go to the section where your second item is located, click on the
copy object data icon again and right click on the second item.

Edit Object Data: This will allow you to see inside streams, unit operations and
controllers. Simply click on the icon and then on the number of the unit operation, the
stream number or directly on the controller to edit.

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 17 of 50

3.4 Tool Commands

Unit Operations
APL Keyboard
Phases
Value Functions

Elements User Objects

Components
Math Functions
Streams Instrumentation
and Controls
There are two lots of icons that can be generally considered as tools. The first series above
is described here:

Elements: gives a list of elements in the current section. Note that the number to the
right of the element is the actual element number to use in various value functions.

Components: gives a list of components in the current section.

Phases: gives a list of phases in the current section.

Streams: gives a list of streams in the current section.

Unit Operations: gives a list of unit operations in the current section.

Instrumentation and Controls: gives a list of controllers in the current section.

APL keyboard: the APL keyboard is a very useful tool where APL commands can be
tested and in some instances, even executed. (See Section 4.2)

Math Functions: Gives a list of various mathematical operations that can be performed
in METSIM. These are not used as widely as normal operations like multiplication or
division, but they can be useful.

Value Functions: Gives a list of METSIM value functions. These have also been placed
in Appendix 3.

User Objects: This will open a window of all user-created objects. These can be

Display Section Plot Dynamic Data


Spreadsheet
Dynamic Data
Exchange
Check elemental
balance Help

Display Value
Lock Model for
Function for Stream
Security
Plot Screen Analysis
c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx
Display Instrument Spreadsheet TEXT-P.DOT, 00/01
ISO 9001-94
Page 18 of 50

functions, vectors, scalars and text strings. (See Section5)

Following is a description of the second series of tool icons:

Check elemental balance: allows the user to check for any elemental imbalances in the
displayed section. This is a great debugging tool.

Display Value Function for Stream: This is the same as DVAL (See Appendix 1)

Display Section Spreadsheet: Displays a spreadsheet of items defined as “flowsheet”


in DSDO and as “all reports” in DCSI (See Appendix 1)

Plot Screen Analysis: This is used when the Particle Size Analysis module is turned on
and will not be covered here.

Plot Dynamic Data: This is used when the Dynamic Simulation module is turned on and
will not be covered here.

Display Instrument Spreadsheet: It is unknown what this function does. To be further


investigated.

Dynamic Data Exchange: This is the same as IDDE (See Appendix 1)

Lock Model for Security: For enhanced security of the model, this can be used. Note
that once activated, this cannot be reversed.

Help: Brings up the help menu for METSIM. This is constantly being updated with every
new version of METSIM and can be very useful when finding information about various
functions or unit operations.

3.5 Navigate and Calculate

Calculate Current
Next Section
Section
Follow
Connecting Arrow Calculate Unit
Operation Range

Select
Section Calculate All
Sections
Previous Stop
Section Execution

Calculate One Unit


Operation

These are some of the most used icons in METSIM. They are here described in more detail.

Select Section: This icon will bring up a window to select a model Section. Clicking on
the desired section will take the user to that section immediately.

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 19 of 50

Follow Connecting Arrow: Click on this icon, then click on a connecting arrow. It will
take the user to the Section the stream is connected to.

Previous and Next Section: Allows the user to browse up and down various sections.

Calculate One Unit Operation: To calculate a single unit operation, click on this icon,
then click on the number of the unit operation to calculate.

Calculate the Current Section: As implied, this will only calculate the displayed section.

Stop Execution: Stops model convergence.

Calculate Unit Operation Range: Before using this icon, the range of unit operation to
be calculated must be defined in IPAR, Calc Parameters, ROP. (See Appendix 1)

Calculate All Sections: Calculates the whole model.

3.6 Others

These require special modules to be used and will not be covered here. Take care not to
press on these icons by mistake, some will actually freeze METSIM and you will be forced to
close your model and restart from your last saved version.

4. APL (A Programming Language)

This is the language used by METSIM to define equations, mathematical expressions and
assign values. It uses special functions and symbols and does not comply with the universal
rules of executing mathematical expressions.

4.1 Mathematical Expressions in APL

APL reads mathematical expressions from right to left, however each operation is read from
left to right, there is no specific hierarchy. To illustrate this, consider the following examples:

5 4 is equivalent to 5/4 and not 4/5.

5 4 + 3 is equivalent to 5/(4 + 3) and not (3 + 4)/5 and not 5/4 +3.

A good way to avoid confusion is to use parentheses though these tend to clutter APL
expressions significantly.

(5 4) +3 would now be 5/4 + 3 (but not 3 + 4/5). The correct APL way to write this
without using parentheses is 3 + 5 4

Getting used to not using unnecessary parentheses is good modelling practice and will help
keep your models „clean‟ and uncluttered.

4.2 APL Symbols

Special symbols are required when entering APL expressions. A complete list of these can
be found by clicking on the APL keyboard icon ( ). The APL keyboard is depicted in
Figure 4.2-2. For example, the division is normally done using the slash "/", but for APL, the

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 20 of 50

division sign is used " ". There are numerous symbols that can perform other tasks. See
Appendix 2 for a list of these symbols, or look in the Help menu in METSIM. Note that, as
shown in Figure 4.2-1, the symbols to the left of each icon are the normal keyboard keys and
those to the right of each icon are the APL symbols. To type those in, just click on Alt and
the key that matches the symbol. Note that some require the Alt-Shift combination when they
are in the location of an uppercase. If entering an APL expression directly in the APL
keyboard window in Figure 4.2-2, clicking on the desired symbol will save the pain of using
Alt combinations.

Eg. Alt = equates to APL


Alt Shift + equates to APL

APL
Keyboard

Normal
Keyboard

Figure 4.2-1: Keyboard Keys

The APL keyboard can be used to perform calculations "outside" the model. That is, if one
wants to verify a certain value or confirm the syntax of an expression, the APL expression
can be entered in this window to obtain an immediate value. Matrices can also be viewed, as
well as user objects. METSIM will remember the last APL expression that was used in this
window.

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 21 of 50

Figure 4.2-2: APL Keyboard

Note that METSIM makes a distinction between the substraction symbol (-) and the
negative sign (alt-2), so be careful when using these.

Following are some more examples of APL expressions. Note that Alt-o =  in this case, not
to be confused with alt-`

+3 4=3 4 100 = 1 to 100

- 3 4 = -3 -4 1 = sin

3 4 = ⅓ ¼ (reciprocal) 2 = cos

х -3 4 = -1 1 (gives sign of values) 3 = tan

 3 4 = e 3 e4 -1 = arcsin

10 3 4 = log3 log4 -2 = arccos

2 3 4 = log23 log24 -3 = arctan

1 = 3 45 180 = tan(45°)

45 180 will convert 45° to radians +/29 10 29 10 293 (this will place a +
between each entry and give an added
52 3 4 = 25 125 625 result)

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 22 of 50

23 = 2³ 20 30 40 10 20 60 10 = 4 (index)

There are many more examples in Appendix 2.

4.3 Value Functions

Value functions are expressions that define a particular value which is specific to a particular
component (C), stream (S), phase (P) or element (E). In order to reference one of these
characteristics, it must be know that the:

Components are numbered and a list can be obtained by running DCOM (see Appendix
1) or clicking on . When used in a value function a “c” must be specified before the
component number, for instance c15 would represent component 15;

Streams are also numbered when they are first defined. An “s” is required before the
stream number: s60 would represent stream 60;

Phases are numbered according to the METSIM predefined list of phases (Section 9.3).
No “p” is required when specified within a value function;

Elements are numbered using their own atomic numbers. No "e" is required when
specified within a value function.

Examples of some value function include:


c25 VCMF s140 = Mole fraction of component 25 in stream 140.
1 VPWT s140 = Mass flowrate of solids inorganic per unit time in stream 140.
8 VEWF s140 = Weight fraction of oxygen in stream 140.

It is always a good idea to put each APL function between parentheses to separate it from
the rest of your APL expression. e.g. (8 VEWF s140)x(VSTR s140)

A list of value functions if found in Appendix 3. This can also be accessed directly in
METSIM using the Value Functions icon ( )

5. User Objects

There are various user objects that can be created for models. These help customise a
model to the user‟s needs and can also help simplify expressions used throughout the
model. The disadvantage of using these is that when a new user takes ownership of the
model, it takes time to learn the various user objects. It is recommended to keep a list of
these with explanations detailing what they should be used for and what they calculate.

The various types of user objects that can be created are: BATCH, PRECALC, Function,
Scalar, Vector, Matrix and Text. The BATCH and PRECALC functions will not be covered
here as they are rarely used and are advanced user objects.

To access the user defined objects, click on the User Objects icon ( )

Function:

To create a user defined function, select New from the User Objects window and then
select Function:

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 23 of 50

Give it a name, use something which will be meaningful, e.g. VCO2 (for value of carbon
dioxide).

The function is entered in the following format, where the first line must always contain
the name of the function:

M  VCO2 S;A;B;C;M
A  (6 VELI S)
B  (3 VPSG S)
C  ((A×B)×(44.00995÷12.01115)×1000)
MC

Feel free to try to create this function in your model.

The function can then be used in the model this way (VCO2 s#) where # is a stream
number. It will return the concentration of carbon expressed as CO 2 in g/L.

METSIM uses outdated IUPAC atomic weights. It is highly recommended to use the
exact values that METSIM uses in any APL expression that requires molecular
weights. For quick reference, these have been listed in Appendix 3.

The user-defined function can be written into a separate file (e.g. VCO2.cr) which can
then be reused in another model. Once the function is created, simply run SFNC (see
Appendix 1). Write the name of the function to save (e.g. VCO2). The file will be then
saved into the c:\Metsim\Fnc\ directory. To extract this file again from another model,
simply run RFNC (see Appendix 1). This will import ALL the function.cr files. Once in
within your model, they can be edited without affecting the original function.cr file.

Scalar, Vector and Matrix:

To create one of these types of user defined object screen, select New from the User
Objects screen and then select Scalar, Vector or Matrix.

The names for these will start with US, UV and UM respectively. The rest of the name is
up to you. Eg: Usval, UVvec or UMmat. Try to use something which will be meaningful.

These functions use numerical entries only and they are exactly what their names
suggest.

For a Scalar, enter a single value.

For example: 4.5

To recall this value in the model, simply use the scalar‟s name, e.g. USval.

For a Vector, enter one or multiple values in a single line, separated by spaces.

For example: 4.5 6 20 50 0.67

To recall values from this vector, the following syntax is used, UVvec[] will recall the
entire vector. UVvec[x] will recall the xth value of the vector.

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 24 of 50

For a Matrix, enter one or multiple values in one or multiple lines, separated by
spaces.

For example: 4.5 6 20 50 0.67

2 10 0.2 5 66

1 2 3 4 5

To recall values from this matrix, the following syntax is used. UMmat[;] will recall the
entire matrix. UMmat[x;] will recall the x th row of the matrix. UMmat[;y] will recall the
yth column of the matrix. UMmat[x;y] will recall the value positioned in row x, column
y.

Text:

To create a text user object, select New from the User Objects screen and then select
Text.

The name of the variable will start with UT. E.g. UTmattegrade.

First type the description in the top field and then the desired expression in the next
field. This can be text, numbers or even APL expressions.

In the case of an APL expression, one can later use the expression as it is written in the
text object by using the “execute” function ( ) (alt-;). Without specifying execute,
METSIM will return the actual text instead of the answer that would result from
executing the APL expression.
e.g. use “ Utmattegrade” instead of “Utmattegrade”.

Do not use the “c” or the “s” in APL expressions for the Create User Object screen. It
does not recognise them. (Section 4.3)

6. Heat Balance

In addition to the points raised in Section 2.2 regarding the flow of heat involved for each unit
operation, overspecifying unit operation outputs will force METSIM to calculate any excess
or required energy into an “excess energy” column in the heat balance summary. This is a
good tool for working out heat losses when all stream information is known.

Another point that is raised on the units of all heat-related values. kcal/hr is always used. In
the case of heat of reaction, always use kcal/kmol. These units are used even when defining
your model in metric units.

How does one get information about the heat balance?

Run OHBS (See Appendix 1). A window in 3 sections appears; including the HOP matrix,
the heats of reactions and a table which includes stream temperatures and enthalpies. Refer
to Appendix 4 for an example of the Heat Balance Summary.

Section 1: The HOP matrix

The HOP matrix is a table containing the heat balance summary for each unit operation.
Columns 1 and 2 define the unit operation whilst columns 3 to 10 define the various
heats which contribute to the overall heat balance for each unit operation. The Heat

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 25 of 50

RQRD column shows what imbalances are present. This is usually present when the unit
operation is overspecified. This value gives the heat required by the unit operation or the
heat to be removed.

HOP[5;2] where 5 is the unit operation number (row 5) and 2 is the HEAT REACT
(column).

HOP[5;] will return the 5th row‟s values.

HOP[;2] will return the 2nd column‟s values.

HOP[;] will return the whole matrix.

In the event that the flowsheet is modified and the order of unit operations change, it
will be necessary to manually update the HOP[ ] DDE command. They do not get
updated automatically.

Section 2: Heat of reaction

1st number is given in 1000 kcal/hr (+ve for exothermic, -ve for endothermic)

2nd number is given in kcal/mol of reactant

Reaction corresponding is then shown.

Section 3: Stream temperatures and enthalpies

For sensible heat use SHC[s140] (kcal/hr) where 140 is the stream number.

This Heat Balance Summary output can be sent directly to the printer: Run PRNT, then run
OHBS (See Appendix 1)

The HOP matrix can be copied directly into Excel using MTRX (See Appendix 1).

7. Extracting information from METSIM

7.1 Display

In order to extract data from the METSIM simulation, the Display menu contains a few
options that allow the user to customise what should be included in the spreadsheets
generated by METSIM –called reports. The displayed report can be copied and pasted into
Excel using the copy button.

There are 3 different reports which can be produced.

1. Detailed report;

2. Intermediate report;

3. Summary report.

7.1.1 Creating Reports


Within the Display menu, there are two options available to create a report

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 26 of 50

DSDO (Spreadsheet Items, Standard) are in-built METSIM functions. They are chosen
simply by entering this menu and allocating the required items to their respective reports.
It is best to avoid using this, particularly for assays and concentrations as METSIM will
only display the components that are being used in the model. If a new component is
used at a later time, then METSIM will automatically add this new component, shifting all
the columns or rows, which can affect the spreadsheets where model outputs are pasted
into.

DCSI (Spreadsheet Items, Custom) are user defined value functions which can be added
to a report. Simply enter the value function into the field specified and allocate it a report
level. This allows for much more flexibility with outputs than DSDO.

7.1.2 Generating reports


First, run DLEV (See Appendix 1). This is where one selects the report to be generated.
Generate the report by selecting between the options in Table 7.1-1.

Table 7.1-1: Reports Available in METSIM


Report Description
DSTR (Display Selected Stream Data) To select which streams are to be displayed.
DSEC (Display Current Stream Data) For all the streams in the active section of
the model –ie, the one displayed on the
screen.
DNOS (Display All Stream Data) For all the streams within the whole model.
DUOP (Display Unit Operation Stream Data) To display all input and output streams for a
particular unit.

When displaying molar flowrates, METSIM will always show the unit of mol,
however the actual value depends on the type of units selected at the beginning of
the model. If metric tones, then moles are actually Mmoles. If kilograms, then moles
are actually kmoles.

It is recommended to create an empty Section at the end of the model where all the
overall model reports can be created. This is because each report creation will remain
within the sheet that was displayed at the time of the creation. Each sheet can have
its own set of reports.

7.2 Dynamic Data Exchange

For this section, use the model named DDE example and also open the Excel spreadsheet
with an identical name.

Dynamic data exchange (or DDE) is the term used when one application shares data with
another application “live”, or dynamically. In the case of METSIM for example, information
can be shared between it and Excel or even other applications where DDE is made possible.
When using a dynamic simulation, this becomes an „online‟ interaction where parameters
can be changed while METSIM is running.

This description is confined within the steady state mode of METSIM.

The Excel spreadsheet where the DDE is to occur must be open and must be the last
Excel workbook viewed on the screen for the data transfer to occur.

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 27 of 50

7.2.1 Uses
DDE is commonly used to export values to Excel that the normal model output would not
make readily easy, or that are of particular interest to the modeller. Some examples include:

The heat content of a stream

The heat capacity of a stream (Cp)

A temperature or concentration which needs to be monitored closely

Manual controls

DDE is commonly used to import values from Excel where user input is required on a
regular basis, most particularly with manual controls.

7.2.2 Steps
Setting-up Excel
The steps for setting up DDE are fairly straightforward. First, the Excel spreadsheet needs to
be configured to the modeller‟s requirements. This involves:

Naming of cells where DDE is to be used – this allows for formatting of a particular
worksheet without affecting the DDE, as long as the cells used keep the same name.
Each modeller might use a different system. For example, perhaps all cells METSIM
uses to export data might be called METSIMoutXXX and all cells METSIM uses to import
data might be called METSIMinXXX (where XXX is a three digit number). This is the
naming system used in this example.

Allocating values where METSIM is to import data from Excel.

Using unusual formatting may not work in METSIM. For example, using percentages
or dollar representations is not recognised by METSIM. METSIM will only take what
is shown on the screen, so whatever digits the modeller can see on the screen, that is
what METSIM uses.

Naming of worksheet

Refer to the following image for an example set-up.

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 28 of 50

Named cell

Data to input
into METSIM

Named worksheet

Export to Excel
Once the spreadsheet is set-up, METSIM needs to be configured to match the spreadsheet.
To start, the following example shows how to export from METSIM:

1. Run IDDE (see Appendix 1)

2. Ensure that the New DDE line is selected and click on Edit

3. Enter required data:

ID is the name that will identify this particular DDE entry. Including units is a good
idea to keep track of the value being exported.

MV is the actual APL expression that will calculate the value being exported to
Excel. In this case [24 hours x 365 days/year x Ni t/h in total ore feed].

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 29 of 50

IO is a drop down menu. Select Output when exporting to Excel

SN is the name of the workbook where the data is to be sent.

CN is the excel Cell name where the data is to be sent.

Please refer to the following image for an example

4. Click OK when all this information has been entered and OK again to exit the IDDE
menu.

5. Give it a test by running TDDE (see Appendix 1)

6. See in Excel if the value was exported properly, as shown in the following image.

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 30 of 50

Import from Excel


To import values from Excel, these are the steps to follow:

1. Run IDDE (see Appendix 1)


2. Ensure that the New DDE line is selected and click on Edit
3. Enter required data:
ID is the name that will identify this particular DDE entry. Including units is a good
idea to keep track of the value being exported.

MV needs to be a valid variable name, preferably one that is user defined ( ).


This can be a scalar or even a position within a vector or a matrix. For this
example, all data imported from Excel is placed into a vector, using the matching
position to its Excel cell name.

To do this a vector named UVMETSIMin was created.

In this vector, spaces had to be reserved before DDE could be used. Entering
many zeroes works well: 0 0 0 0 0 0 0 0 0, as long as there are more of these
than there are DDE values to be imported.

IO is a drop down menu. Select Input when importing from Excel

SN is the name of the workbook where the data is to be taken from.

CN is the excel Cell name where the data is to be taken from.

Please refer to the following image for an example

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 31 of 50

4. Click OK when all this information has been entered and OK again to exit the IDDE
window.
5. Give it a test! Click on Tools and select TDDE (Test DDE Data Exchange)
6. See in the user objects if the values were imported properly, as shown in the
following image.

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 32 of 50

Extra zero
METSIMin001 entries for
in the future DDE
UVMETSIMin[1]
position

7.2.3 Use imported values


Now, we are ready to use the imported values in the actual model. In this example, they
were used to construct an ore feed based on ore flowrate and composition. This required 7
DDE entries. There are methods to import matrices, which will be covered later.

To achieve this a mixer unit (MIX) was used where each stream feeding it was made-up of
one component in the ore make-up. A flowrate controller was used on each stream to set the
flowrate. Note that the UVMETSIMin vector previously created was used for the set points
(SP), as shown in the following diagram.

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 33 of 50

7.2.4 Vectors and Matrices


The same method applies for importing and exporting vectors and matrices. The difference
is that a range of cells in Excel will need to be named instead of individual cells. If importing
from Excel, make sure the METSIM user object is larger or equal to the range of cells
specified in Excel. If exporting, then the reverse is true.

Note that using vectors and matrices does not allow for any format manipulation in
Excel unless the order of the cells is kept exactly the same.

7.2.5 Automatic DDE


DDE can be activated manually via the TDDE command in the Tools menu, or alternatively,
one can switch it on such that it performs automatically a TDDE at the beginning and at the
end of each calculation. This requires that the workbook being used for the DDE is the last
one being viewed by the modeller and is considered the „active‟ Excel window before the
model is run. If this is not the case, an error will be generated.

To turn on the automatic DDE, run IPAR (see Appendix 1), then the Calc Options tab.
Check the DDES box to activate this feature, as shown in the image below.

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 34 of 50

Try changing some of the parameters in the DDE spreadsheet now and then run the
METSIM example. See how METSIM automatically updated all the relevant values.

7.3 Screen Outputs

There are several outputs available from METSIM (from the Output menu) that can only be
displayed on the screen or printed directly to the printer. There is a way to capture this
information into Excel, however there are a few steps that must be followed.

For example, to capture the model chemistry, run OCHE (See Appendix 1). The information
will be displayed in a text format as follows:

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 35 of 50

Figure 7.3-1: Chemistry Output in METSIM


Select the whole content of this window by highlighting it with the mouse.

Then type Ctrl-C to copy the information to the clipboard.

Open Notepad and then paste the information directly in there.

Save the Notepad file.

Open Excel and then open the Notepad file from Excel. To be able to open it you will
need to select All Files in the Files of type drop down menu, as follows:

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 36 of 50

Figure 7.3-2: Select Files of type in Excel


The Text Import Wizard will open. Depending on the output to be opened in Excel, different
options will be used. It is best to try the various options in this Wizard to manipulate the
output. One possible outcome is shown in Figure 7.3-3. Cells can be merged, manipulated
or concatenated to format the output as desired.

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 37 of 50

Figure 7.3-3: Example of Exported Screen Output into Excel


Note that this method allows you to manipulate the output and separate it into cells.
If this is not the desired outcome, after copying the information, it can directly be
pasted into Excel, but the text will remain together line by line.

8. Converging a Model

It is during the convergence of a model that everything finally comes together. Unfortunately,
this is also when modelling errors become evident and debugging needs to be done.

8.1 Convergence Window

Depending on the various calculation settings used, METSIM will display a number of
windows while converging to allow the user to monitor convergence. These are illustrated in
Figure 8.1-1. Note that in all these windows except for the Alarms, anything in green
indicate no change, in yellow indicates a change, in red indicates a non-convergence.

Convergence
windows

Figure 8.1-1: Convergence Window


These are explained below

Run Parameter. This window will give you basic convergence information.

Star is the first unit operation run in the convergence

UOP is the current unit operation being calculated

Stop is the last unit operation run in the convergence

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 38 of 50

Low is the lower level of tolerance selected in IPAR under the Calc Parameter tab.

TOL is the last achieved level of tolerance.

High is the highest level of tolerance set in IPAR under the Calc Parameter tab..

TI and CTI are currently unknown and are being investigated

Time will give you the number of seconds convergence took to reach the last level of
tolerance in Tol.

Feedback Controller. This window allows you to monitor the various feedback
controllers in your model. This is a good place to look at first when alarms indicate
controller troubles. Sometimes you will see that they are behaving correctly, despite the
alarms and even sometimes when values are highlighted in red.

CTRL is the feedback controller number

SET is the setpoint

VALUE is the current value. METSIM will try to make this value equal to the set point.

Recycle Streams. This window is perhaps not used as often, but when non-
convergence errors occur, it will help determine why they happen.

Str is the number of the recycle stream.

Iter is the number of iterations the recycle stream has gone through before
converging at the current tolerance level.

Flo is the recycle stream‟s flowrate or the component‟s flowrate if a component


number is shown in Com.

Com is the component number being converged.

Chan is the relative change in the value of Flo.

Alarms. This window is by far, the most important. While most types of errors are
classified under certain numbers, this is not as important as keeping a close eye on the
alarms as they light up this window. Simply click on a lit number to see the error
messages. This will tell you whether a controller has reached an upper or lower limit, if a
unit operation is not converging or if a controller is not converging. Note that when these
are highlighted in yellow, METSIM will continue to converge. If only one highlights in red,
METSIM will stop the model with a critical failure error.

8.2 Tolerances

The level of tolerance used in METSIM is very important. The higher the tolerance (i.e., the
smaller the number), then the closer to steady state the model will be. Generally, while
working on a model, it is best to leave the tolerance relatively low, say about 10 -4. For final
convergence, 10-6 is recommended. It is sometimes desired to force the model to keep
converging for longer periods, making the tolerance higher than 10 -6 is on trick used to do
this.

Alarms in various tolerance levels might indicate different types of issues with your model.

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 39 of 50

At 10-5 and 10-6, these are usually feedback controller instabilities and are usually not
serious if the model converges well.

At 10-3 and 10-4, there might be S.G. changes occurring or two controllers in conflict.

At 10-2, there are serious issues to be fixed in the model.

8.3 Debugging

There is no easy way to describe how one can go about debugging a model. Mostly, it is
from experience that one learns the various tricks and the things to look out for. Sometimes
debugging is as simple as adjusting the limits on a feeback controller, sometimes it is
something more complex, like evaluating the order of reactions in a unit operation or
checking that there is sufficient reagent for a reaction to reach its intended extent. Following
is a list of possible items to look out for while debugging a model:

Controller limits

Order of reactions

Quantity of reagents available

Order of controllers

Syntax of APL expressions

Referring to a deleted stream

Numbering in user objects that has not been updated

9. Inheriting a METSIM model

Often a modeller will inherit a model that has already been created and often worked on by
various other modellers. It is important to be consistent and systematic when modelling in
METSIM as it is likely that you will pass the model onto another user eventually. Here is a
checklist of suggested actions to undertake when receiving a model to take ownership of:

9.1 Convergence

Check that the model has been fully converged. Run it at its current settings.

Run it at a low tolerance of 10 -6.

Save it with a different name.

9.2 Syntax of Functions

Check that small „s‟ and small „c‟ have been used in value functions where necessary as
well as in FBC‟s SN field.

Take note of user objects and whether they use value functions specific to certain
components. Remember, that when the component list is updated, the user object
functions are not automatically updated like the rest of the model is.

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 40 of 50

Check for APL expressions that will also not update automatically if the component order
is changed. These include vectors and matrices, particularly if they use specific
component numbers.

Save the model.

9.3 Components List

There are 8 phases in METSIM, as shown in Table 2. It is good practice to first order the
components by phase number, but as well, within each phase, a proper order should be
kept to ensure that METSIM will operate correctly. When receiving a model and after
having checked the syntax throughout the model described in the section above, it is
recommended to reorder the components as follows (Do this from ICOM, as shown in
Appendix 1):

Table 2: Phases and Order of Components


First: Phase Order Second: Component order required by METSIM
1. Solid Inorganic 1. Component like SiO2, or inert component.
2. The rest in alphabetical order
2. Solid Organic
3. Liquid Inorganic 1. H2O or solvent in organic phase
2. The rest in alphabetical order
4. Liquid Organic
5. Molten Metal 1. Component like SiO2, or inert component.
2. The rest in alphabetical order.
6. Molten Sulphide - Halide
7. Molten Oxide - Slag
8. Gas 1. N2
2. O2
3. H2O
4. The rest in alphabetical order

Save the model using a different name.

Update any user objects affected by this change and any APL expressions that will not
have updated automatically.

Run the model to ensure that it has not been affected by this change.

9.4 Controller Numbering

Once the two steps above have been performed, it is recommended to renumber the
controllers such that they can then be reordered and found easily on the flowsheet. See
Section 3.3 for a description of how this is done.

Save the model using a different name.

Run ICTL, then click on the column heading LOOP to order the controllers by number.

Run the model section by section, starting from the back to ensure it has not been
affected by this change. Some controllers may not have been renumbered if they are
turned off, so be careful.

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 41 of 50

9.5 Stream numbering

It is not recommended to renumber streams at this point as it is far more difficult to keep
track of the effect of doing this on the model.

9.6 Revisit convergence

At this stage it is a good idea to do a few diagnostic checks to ensure the model converges
properly. Run various checks from the Calc menu until you feel you understand where
imbalances may occur in the model. You can then decide whether to address those now or
later.

10. Other Tips

10.1 Deleting and Renumbering Specific Objects

Unless you have extensive knowledge of a particular model, it is always difficult to know
whether it is safe to delete a stream or a controller, or even a unit operation. There are often
places where we do not remember or simply are not aware that their numbers are being
used elsewhere. Perhaps in a user defined object or in DDE or somewhere completely
different in the model.

What is important to remember is that when a stream is deleted, METSIM does not zero it. It
keeps the last value it had and thus, consequences of deleting the stream are not always
obvious.

It is important to be systematic before deleting anything. First, run OIDT on your screen (see
Appendix 1). Select the whole text and paste it into Word. From there, you can do a search
for the object you wish to delete. For example s120 or just 120 to find that particular stream.
You will know from there precisely where the stream has been referred to throughout the
model and you will be able to make appropriate changes to your model before deleting the
stream. The same goes with controllers, but here you could do a search for VCTL 1000 as
an example.

This same check might be performed when renumbering specific objects as well.

10.2 Steps to Building a Model

Here is a quick reference to the model building steps to follow. The first tutorial example in
Appendix 6 covers these steps in detail.

1. Draw your flowsheet on paper.


a. Select unit operation sequence
b. Select unit operation type
c. Number the streams

2. Set-up model in METSIM


a. Title
b. Modules
c. Redraw/refresh the screen

3. Select components
a. Remember order of phases and components
b. Modify any components as necessary
c. Rename the abbreviated name to include the phase

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 42 of 50

4. Build the model

This can be done one unit operation at a time or in totality. It depends on the size of the
model and your own preference.
a. Draw the flowsheet in METSIM
b. Define input streams
c. Define unit operations
i. Reactions
ii. Heat balance
iii. Parameters
d. Define control strategy
e. Run the model
f. Debug any errors

5. Run model with smaller tolerance

It maybe a good idea to converge one unit operation at a time, then a small range, then a
whole section as you build your model. This works particularly well for very large models or
for newly acquired models

10.3 Controller Configuration

When using a feedback controller to vary a reagent‟s flowrate into a unit operation in order to
have a small residual of the reagent left in the discharge stream of that unit operation, it is
possible that the controller sends insufficient quantities such that there is zero residual in the
output. When this happens, usually the controller stops functioning and never recovers. One
way to reduce the occurrence of this happening (though it rarely completely eliminates it), is
to use a master-slave controller set-up, as described in the following example, illustrated in
Figure 10.3-1.

Master
Acid (FBC)

Set-point
Neutralisation
Slave
Product
(FFC)

Feed

Figure 10.3-1: Controller Configuration


In this case, an acid stream is added to neutralise a feed stream. It is desired to leave a very
small concentration of acid in the stream, or to reach a pH that is only slightly acidic. Instead
of using a FBC directly on the acid stream, it is recommended to use a FFC that is ratioed to
some key components in the feed stream or to the flowrate of the feed stream. Then use a
FBC to vary the setpoint on the FFC until the desired final set point on the product is
achieved. This is easily done by placing the expression VCTL X in the set point field of the
FFC, where X is the controller number of the FBC.

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 43 of 50

This tends to work because the acid stream will be adjusted even before the unit operation is
calculating, which in general stops the final set point from reaching zero. The feeback
controller then slightly adjusts the feedforward controller set point for fine tuning.

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 44 of 50

Appendix 1: Drop down menus

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 45 of 50

Appendix 2: APL

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 46 of 50

Appendix 3: Value Functions and Molecular Weights

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 47 of 50

Appendix 4: Heat Balance Summary

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 48 of 50

Appendix 5: Generic Unit Operations

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 49 of 50

Appendix 6: Tutorial Example 1

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01


ISO 9001-94
Page 50 of 50

Appendix 7: Tutorial Example 2

4.

c:\documents and settings\rafael\mis documentos\tutorial metsim hatch.docx TEXT-P.DOT, 00/01

You might also like