ICape Thermo MaterialGet Present Phases Method
Definition
Assembly: CapeOpen (in CapeOpen.dll) Version: 1.0.0.0 (1.0.0.0)
[DispIdAttribute(6)]
void GetPresentPhases(
out Object phaseLabels,
out Object phaseStatus
)<DispIdAttribute(6)>
Sub GetPresentPhases (
<OutAttribute> ByRef phaseLabels As Object,
<OutAttribute> ByRef phaseStatus As Object
)Parameters
- phaseLabels Object
- A reference to a String array that contains the list of Phase labels (identifiers – names) for the Phases present in the Material Object. The Phase labels in the Material Object must be a subset of the labels returned by the GetPhaseList method of the ICapeThermoPhases interface.
- phaseStatus Object
- A CapeArrayEnumeration which is an array of Phase status flags corresponding to each of the Phase labels. See description below.
Remarks
This method is intended to work in conjunction with the SetPresentPhases method. Together these methods provide a means of communication between a PME (or another client) and an Equilibrium Calculator (or other component that implements the ICapeThermoEquilibriumRoutine interface). The following sequence of operations is envisaged.
1. Prior to requesting an Equilibrium Calculation, a PME will use the SetPresentPhases method to define a list of Phases that may be considered in the Equilibrium Calculation. Typically, this is necessary because an Equilibrium Calculator may be capable of handling a large number of Phases but for a particular application, it may be known that only certain Phases will be involved. For example, if the complete Phase list contains Phases with the following labels (with the obvious interpretation): vapour, hydrocarbonLiquid and aqueousLiquid and it is required to model a liquid decanter, the present Phases might be set to hydrocarbonLiquid and aqueousLiquid.
2. The GetPresentPhases method is then used by the CalcEquilibrium method of the ICapeThermoEquilibriumRoutine interface to obtain the list of Phase labels corresponding to the Phases that may be present at equilibrium.
3. The Equilibrium Calculation determines which Phases actually co-exist at equilibrium. This list of Phases may be a sub-set of the Phases considered because some Phases may not be present at the prevailing conditions. For example, if the amount of water is sufficiently small the aqueousLiquid Phase in the above example may not exist because all the water dissolves in the hydrocarbonLiquid Phase.
4. The CalcEquilibrium method uses the SetPresentPhases method to indicate the Phases present following the equilibrium calculation (and sets the phase properties).
5. The PME uses the GetPresentPhases method to find out the Phases present following the calculation and it can then use the GetSinglePhaseProp or GetTPFraction methods to get the Phase properties.
To indicate that a Phase is ‘present’ in a Material Object (or other component that implements the ICapeThermoMaterial interface) it must be specified by the SetPresentPhases method of the ICapeThermoMaterial interface. Even if a Phase is present, it does not imply that any Physical Properties are actually set unless the phaseStatus is Cape_AtEquilibrium or Cape_Estimates (see below).
If no Phases are present, UNDEFINED should be returned for both the phaseLabels and phaseStatus arguments.
The phaseStatus argument contains as many entries as there are Phase labels. The valid settings are listed in the following table:
Cape_UnknownPhaseStatus - This is the normal setting when a Phase is specified as being available for an Equilibrium Calculation.
Cape_AtEquilibrium - The Phase has been set as present as a result of an Equilibrium Calculation.
Cape_Estimates - Estimates of the equilibrium state have been set in the Material Object.
All the Phases with a status of Cape_AtEquilibrium have values of temperature, pressure, composition and Phase fraction set that correspond to an equilibrium state, i.e. equal temperature, pressure and fugacities of each Compound. Phases with a Cape_Estimates status have values of temperature, pressure, composition and Phase fraction set in the Material Object. These values are available for use by an Equilibrium Calculator component to initialise an Equilibrium Calculation. The stored values are available but there is no guarantee that they will be used.
Using the ClearAllProps method results in a Material Object that is in the same state as when it was first created. It is an alternative to using the CreateMaterial method but it is expected to have a smaller overhead in operating system resources.
Exceptions
| ECapeNoImpl | The operation is “not” implemented even if this method can be called for reasons of compatibility with the CAPE-OPEN standards. That is to say that the operation exists but it is not supported by the current implementation |
| ECapeUnknown | The error to be raised when other error(s), specified for this operation, are not suitable. |