Professional Documents
Culture Documents
METSIM Value Functions & Other Information
METSIM Value Functions & Other Information
METSIM Value Functions & Other Information
Functions
&
Other
Information
Density and Specific Gravity Value Functions
U VHTR R ;Heat of reaction in kcal/hr for reaction R in unit operation U. Note: U and R
references are
'not' updated with changes.
The following subroutines perform certain mathematical, editing and process functions on data
scalars, vectors, and matrices. They are programming tools used to assist in the rapid
development of other subroutines.
They are used in one of the following forms, depending on the arguments needed and the
results returned, if any.
FXXX
FXXX Rarg
Result = FXXX Rarg
Larg FXXX Rarg
Result = Larg FXX Rarg
These programs may be chained together to form complex expressions. For example, to
calculate the average of the positive values of X,
Average FAVE FPOS X
Note: In APL coding the ‘=’ is replaced by the APL left arrow ¬
FAST Alphabetic sort
Larg None
Rarg Character matrix
Result Sorted character matrix
FAVE Numeric average
Larg None
Rarg Numeric vector
Result Numerical average
FCEN Temperature conversion to degrees Celsius
Larg None
Rarg Temperatures in degrees Fahrenheit
Result Temperature in degrees Celsius
FCHC Component heat content
Larg Stream number
Rarg Component numbers
Result Heat content of components in kcal/hour
FCOL Create column matrix
Larg None
Rarg numeric of character vector of length n
Result Numeric of character matrix of dimensions n x 1
FDEF Default values
Larg Numeric vector A
Rarg Numeric vector B
Result Numeric vector A with zero plus values replaced by corresponding values of B
FDIF Difference between elements of vector or matrix
Larg None
Rarg Numeric vector or matrix of dimensions n or (m x n)
Result Numeric vector or matrix of dimensions (n-1) or (m x (n-1)) containing the
difference between adjacent values
FELE Element weight fraction of specified elements E in components C in streams S, (a vector
of stream numbers defined before calling FELE)
Larg Vector of element numbers
Rarg Vector of component numbers
Result Matrix of elemental weight fractions
FEPM Calculate EP separation factors
Larg EP value for gravity separation efficiency
Rarg SG, specific gravity of separation
Result Separation factors for each specific gravity fraction
FEWT Elemental flowrate of specified elements E in components C in stream S, (S is a scalar
or vector of stream numbers defined before calling FEWT)
Larg Vector of element numbers
Rarg Vector of component numbers
Result Matrix of elemental mass flowrates in user units
FFAR Temperature conversion to degrees Fahrenheit
Larg None
Rarg Temperature in degrees Celsius
Result Temperature in degrees Fahrenheit
FFLA Adiabatic flash of water in stream S1
Larg None
Rarg None
Result Six-element vector containing the temperature, pressure, liquid fraction, vapor
pressure, vapor fraction, and partial pressure of water in stream S1
FGWA Get washability data
Larg None
Rarg Vector of stream numbers
Result Matrix containing the washability data for the specified streams
FHTG Free energy of formation components
Larg Vector of component numbers
Rarg Temperature in degrees Kelvin
Result Free energy of formation of specified components at specified temperature in
kcal/kg-mole
FINT Interpolation of data array
Larg Scalar or vector of independent values
Rarg Matrix M with independent variable in first column
Result Dependent values, scalar if Larg is scalar and matrix M is (n x 2) vector if Larg is
a vector and matrix M is (n x m) matrix if Larg is a vector and matrix M is (n x m)
FMCL Multiply matrix by columns
Larg Numeric matrix M of dimensions (n x m)
Rarg Numeric matrix M of dimensions (n x m)
Result Numeric matrix where each column of matrix M is multiplied by the
corresponding element of vector V
FMRW Multiply matrix by rows
Larg Numeric vector V of length n
Rarg Numeric matrix M of dimensions (n x m)
Result Numeric matrix where each row of matrix M is multiplied by the corresponding
element of vector V
FMUL Multiply stream data by a constant factor. Used to adjust stream flowrates
Larg Vector of stream numbers
Rarg Scalar factor for scaling selected streams
Result None
FNEG Negative numbers from a numeric vector
Larg None
Rarg Numeric vector V
Result Numeric vector containing only the negative values of V
FNST Numeric sort into ascending order
Larg None
Rarg Numeric vector
Result Numeric vector sorted in ascending order
FNZR None zero values
Larg None
Rarg Numeric vector V
Result Numeric vector containing only the non-zero values of V
FPCP Screen analysis percent (weight fraction) passing
Larg None
Rarg Vector of mass flowrates for all mesh sizes
Result Vector of weight fraction passing each mesh size
FPCR Screen analysis percent (weight fraction) retained
Larg None
Rarg Vector of cumulative fraction passing each mesh size
Result Vector of with fraction retained on each mesh size
FPOS Positive values
Larg None
Rarg Numeric vector V
Result Numeric vector containing only the positive values of V
FPWA Store washability data, used to pack data
Larg Stream number of washability data
Rarg Washability of data of single stream
Result None
FRND Round off data to nearest integer
Larg None
Rarg Scalar, vector or matrix of numeric values
Result Scalar, vector or matrix of nearest integers
FSHC Calculate stream heat content from stream temperature
Larg None
Rarg Vector of stream numbers
Result None
FSRT Sort numeric matrix, preserve rows
Larg Column for sorting
Rarg Matrix to be sorted
Result Sorted matrix
FSSA Calculates, for selected streams, the screen size analysis in SSA from the inorganic
solids S1 in STR and the weighted screen size analysis in SSA, used to guarantee consistency
between arrays in STR and SSA
Larg None
Rarg Vector of stream numbers
Result None
FSSE Set streams in equal composition and size analysis, used to define one stream in terms
of another
Larg None
Rarg Destination stream number, factor, source stream number
Result None
FSTM Converts character string to character matrix
Larg None
Rarg Break character, character string
Result Character matrix
FSUB Subtract one string from another, A = A – B
Larg Stream number A
Rarg Stream number B
Result None
FTDA convert to two-dimensional array, converts a scalar or vector into a matrix
Larg None
Rarg Scalar, vector or matrix of dimension n, or (m x n)
Result Two-dimensional matrix of dimension (1 x n) or (m x n)
FTEM Calculate stream temperature from stream heat content
Larg None
Rarg Vector of streams
Result None
FVPR Vapor pressure of water at specified temperature
Larg None
Rarg Temperature in degrees Celsius
Result Vapor pressure of water in mm Hg at given temperature
FWPA Weight percent (fraction) of an array. Calculates weight fraction of each row in a matrix
Larg None
Rarg Numeric matrix
Result Numeric matrix of weight fractions
FWPC Weight percent (fraction) of a vector
Larg None
Rarg Numeric vector
Result Numeric vector of weight fractions
FZDV Zero divide trap, replaces zeroes, ‘0’ with ones, ‘1’. Used on divisor to prevent domain
error in division operations. Programmers must verify that operation gives valid results
Larg None
Rarg Numeric scalar, vector or matrix
Result Numeric scalar, vector or matrix with 1’s replacing 0’s
FZER Set stream data to zero
Larg None
Rarg Vector of streams numbers to be zeroed
Result None
Component Groups Phase Phase Types of components
Variable Number
Solid Components SC Includes SI & SO
Solid Inorganic SI 1 Minerals, Salts
Solid Organic SO 2 Coal, Resin, Carbon
Fluid Components FC Includes LC & GC
Liquid Components LC Includes LI, LO, M1, M2 & M3
Liquids Inorganic LI 3 Water, Acids, Dissolved Salts
Liquid Organic LO 4 Fuel, Kerosene, Organics
Molten 1 M1 5 Molten Metals, Speiss
Molten 2 M2 6 Molten Sulfides, Halides
Molten 3 M3 7 Molten Oxides, Slags
Gaseous components GC 8 Air, Gaseous, Metal Vapors
Ratio Control Using FRC
Stream 2 is defined already in the model and we want to determine the flowrate of stream 1 as a
percentage of the total output stream 3. For the following example stream 1 is 15% of stream 3,
base on the normal volumetric flow rate.
x → Nm 3 / h of stream 1
y → Nm 3 / h of stream 2
z → Nm 3 / h of stream 3
x = 0.15 z
x = 0.15( x + y )
x − 0.15 x = 0.15 y
x(1 − 0.15) = 0.15 y
x 0.15
=
y 1 − 0.15
The left hand side of the expression will constitute the value function in the flow rate controller
(FRC), while the right hand side will be the set point.