
Customization FAQ A-5
A-5
4. How do I use Automation to refer to a stream name which is
a number?
Ans: HYSYS assumes any variable which contains a number
(regardless of whether it is text or numeric format) is an
index number. For example,
hyStream refers to the stream object with an index
number of 1, not the stream named 1. An index number is
used to identify the order in which a stream was added. Thus
in the above examples hyStream refers to the second
stream added to the flowsheet, regardless of its name.
To be able to use numeric stream names, the following
syntax must be used:
CStr converts whatever is in the parentheses in to a string,
regardless of its original format. Therefore, a 1 is interpreted
as a “1” and Feed is interpreted as “Feed”.
5. How do I obtain a viscosity (or WatsonK or surface tension or
any number of other physical properties) from a Fluid
object?
Ans: A viscosity cannot be obtained from the Fluid object, it
must be obtained from the FluidPhase objects within the
Fluid object (FluidPhases, VapourPhase, LightLiquidPhase,
HeavyLiquidPhase). For example, if there is a heavy liquid
phase then to obtain the viscosity (in HYSYS internal units of
cP), the following syntax is used:
Stream_Name = "2"
hyStream = Streams.Item(Stream_Name)
Stream = Streams.Item(CStr(Stream_Name))
hyViscosity = hyFluid.HeavyLiquidPhase.ViscosityValue
where:
hyFluid = a Fluid object
Komentáře k této Příručce