ChemCAD 5 services to visual basic applications: User Manual, страница 14

        };

Methods          It takes two methods calls to complete a unit conversion for stream data. The first method defines a set of stream data and the following method call returns the converted stream data to the caller.

To convert stream data in current user units, user first call

Method             DefineStreamInCurUserUnit

Returns                        number of data items received from array compFlow

Argument

Type

Description

temp

pres

enth

flow

flowOption

compFlow

float

float

float

float

short

float[]

temperature [in]

pressure [in]

enthalpy [in]

total flowrate [in]

definition of total flowrate [in]

component flowrates or compositions [in]

Note that the argument flowOption identifies the meaning of argument flow. It may be one the four choices 1 – mole rate; 2 – mass rate; 3 – standard liquid volume rate; 4 – standard vapor volume rate. After defining a set of stream data, user calls

                        Method             GetStreamInInternalUnit

Returns            numbre of data items returned in array compFlowLbmol_Hr

Argument

Type

Description

tempR

presPsia

enthBtu_Hr

rateLbmol_Hr

compFlowLbmol_Hr

float

float

float

float

float[]

temperature [out]

pressure [out]

enthalpy [out]

total flowrate [out]

component flowrates [out]

The next pair of methods is for conversion of stream data in internal units to current user units.

Method             DefineStreamInInternalUnit

Returns                        number of data items received from array compFlowLbmol_Hr

Argument

Type

Description

tempR

presPsia

enthBtu_Hr

compFlowLbmol_Hr

float

float

float

float[]

temperature [in]

pressure [in]

enthalpy [in]

component flowrates [in]

Method             GetStreamInCurUserUnit

Returns                        number of data items returned in array compFlow

Argument

Type

Description

temp

pres

enth

tMoleRate

tMassRate

tStdLVolRate

tStdVVolRate

compFlow

float

float

float

float

float

float

float

float[]

temperature [out]

pressure [out]

enthalpy [out]

total mole rate [out]

total mass rate [out]

total standard liquid volume rate [out]

total standard vapor volume rate [out]

component flowrates or compositions [out]

When tabulating the stream data, one more method can be called to get the engineering unit strings of the current user units.

Method             GetCurUserUnitString

Argument

Type

Description

tempUnit

presUnit

enthUnit

tMoleRateUnit

tMassRateUnit

tStdLVolRateUnit

tStdVVolRateUnit

compUnit

compCate

BSTR

BSTR

BSTR

BSTR

BSTR

BSTR

BSTR

BSTR

BSTR

temperature unit string[out]

pressure unit string [out]

enthalpy unit string [out]

total mole rate unit string [out]

total mass rate unit string [out]

total standard liquid volume rate unit string [out]

total standard vapor volume rate unit string [out]

component data unit string [out]

component data category [out]

The argument compCate gives the representation of component data in the current user units, i.e., either Flowrates or Components. In the case of Flowrates, the units are given by compUnit. If it is Components, the definition of the compositions is given by compUnit. For example, the compCate returns Components, compUnit returns mole fractions indicating the component data in current user units are in mole fractions.

Description      IUnitOpSpecUnitConversion interface exposes methods for engineering unit conversions of the unit specification parameters. The unit specifications are organized as a one-dimensional array of float type. User should prepare this array along with the second array for receiving converted data before calling the methods of this interface.