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

outletSheet.Cells(STREAM_ROW_STD_VAP_VOLRATE, STREAM_COL_UNITS).value = stdVRateUnit

outletSheet.Cells(STREAM_ROW_COMPFLOW_VALUE, STREAM_COL_NAMES).value = compCategory

outletSheet.Cells(STREAM_ROW_COMPFLOW_VALUE, STREAM_COL_UNITS).value = compUnit

'intletSheet.Cells(STREAM_ROW_STD_VAP_VOLRATE, STREAM_COL_VALUE + 1).Value = TotalStdVVolFlowRate()

Dim compIndex As Integer

Dim compCount As Integer

Dim curRow As Integer

Dim compName As String

Dim compID As Integer

curRow = STREAM_ROW_COMPFLOW_VALUE

compCount = strInfo.GetNoOfComponents

For compIndex = 1 To compCount Step 1

    compName = strInfo.GetComponentNameByPosBaseOne(compIndex)

    compID = strInfo.GetComponentIDByPosBaseOne(compIndex)

    outletSheet.Cells(curRow + compIndex, STREAM_COL_NAMES).value = compName

    outletSheet.Cells(curRow + compIndex, STREAM_COL_UNITS).value = compID

Next compIndex

' prepare flash data

Dim tempR As Single

Dim presPsia As Single

Dim vapFrac As Single

Dim enthBtu_Hr As Single

Dim compLbmol_Hr(1 To SIZE_COMP_ARRAY) As Single

Dim pressure As Single

Dim enthalpy As Single

Dim temperature As Single

Dim mvf As Single

Dim moleRate As Single

Dim massRate As Single

Dim stdLRate As Single

Dim stdVRate As Single

Dim compRate(1 To SIZE_COMP_ARRAY) As Single

Dim streamIndex As Integer

Dim id As Integer

Dim idcopy As Integer

Dim col As Integer

Dim curCol As Integer

curCol = STREAM_COL_VALUE

Dim valKeeper As Integer

For streamIndex = 1 To nOutlets Step 1

    valKeeper = streamIndex

    id = outletIDs(streamIndex)

    idcopy = id

    check = strInfo.GetStreamByID(id, tempR, presPsia, vapFrac, enthBtu_Hr, compLbmol_Hr)

    check = strConv.DefineStreamInInternalUnit(tempR, presPsia, enthBtu_Hr, compLbmol_Hr)

    check = strConv.GetStreamInCurUserUnit(temperature, pressure, enthalpy, moleRate, massRate, stdLRate, stdVRate, compRate)

    col = curCol + valKeeper

    outletSheet.Cells(STREAM_ROW_ID, col).value = outletIDs(valKeeper)

    outletSheet.Cells(STREAM_ROW_LABEL, col).value = strInfo.GetStreamLabelByID(idcopy)

    outletSheet.Cells(STREAM_ROW_TEMPERATURE, col).value = temperature

    outletSheet.Cells(STREAM_ROW_PRESSURE, col).value = pressure

    outletSheet.Cells(STREAM_ROW_ENTHALPY, col).value = enthalpy

    outletSheet.Cells(STREAM_ROW_MOLE_FRACTION, col).value = vapFrac

    outletSheet.Cells(STREAM_ROW_MOLE_FLOWRATE, col).value = moleRate

    outletSheet.Cells(STREAM_ROW_MASS_FLOWRATE, col).value = massRate

    outletSheet.Cells(STREAM_ROW_STD_LIQ_VOLRATE, col).value = stdLRate

    outletSheet.Cells(STREAM_ROW_STD_VAP_VOLRATE, col).value = stdVRate

    For compIndex = 1 To compCount Step 1

        outletSheet.Cells(curRow + compIndex, col).value = compRate(compIndex)

    Next compIndex

    streamIndex = valKeeper

Next streamIndex

End Sub

PHYSICAL PROPERTIES OF PURE COMPONENTS

Description      This interface provides the connection to retrieve pure component data for any component on current component list. The following component physical properties are made available.

Property ID

Physical Property of Pure Component

Units

1

2

3

4

5

6

7

8

Molecular weight

Critical temperature

Critical pressure

Acentric factor

Normal boiling point

Specific gravity

Ideal gas heat of formation

Ideal gas Gibbs free energy of formation

R

Psia

R

Btu/lbmol

Btu/lbmol

Definition        dispinterface ICompPPData

        {

        methods:

short GetDataInInternalUnit(short compPos, short compPPID, float* value);

        };

Methods

                        Method             GetDataInInternalUnit

                        Returns                        number of item returned

(0 – pos or/and id is invalid; 1 – value found)

Argument

Type

Description

CompPos

CompPPID

short

short

Component position [in]

Stream property ID [in]

Example

Reference

[1]                    CHEMCAD 5 user-added module manual.