ICape Thermo MaterialSet Present Phases Method
Definition
Assembly: CapeOpen (in CapeOpen.dll) Version: 1.0.0.0 (1.0.0.0)
[DispIdAttribute(11)]
void SetPresentPhases(
Object phaseLabels,
Object phaseStatus
)<DispIdAttribute(11)>
Sub SetPresentPhases (
phaseLabels As Object,
phaseStatus As Object
)Parameters
- phaseLabels Object
- CapeArrayString The list of Phase labels for the Phases present. 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
- Array of Phase status flags corresponding to each of the Phase labels. See description below.
Remarks
SetPresentPhases may be used:
• to restrict an Equilibrium Calculation (using the CalcEquilibrium method of a component that implements the ICapeThermoEquilibriumRoutine interface) to a subset of the Phases supported by the Property Package component;
• when the component that implements the ICapeThermoEquilibriumRoutine interface needs to specify which Phases are present in a Material Object after an Equilibrium Calculation has been performed.
If a Phase in the list is already present, its Physical Properties are unchanged by the action of this method. Any Phases not in the list when SetPresentPhases is called are removed from the Material Object. This means that any Physical Property values that may have been stored on the removed Phases are no longer available (i.e. a call to GetSinglePhaseProp or GetTwoPhaseProp including this Phase will return an exception). A call to the GetPresentPhases method of the Material Object will return the same list as specified by SetPresentPhases.
The phaseStatus argument must contain 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 must have properties that correspond to an equilibrium state, i.e. equal temperature, pressure and fugacities of each Compound (this does not imply that the fugacities are set as a result of the Equilibrium Calculation). The Cape_AtEquilibrium status should be set by the CalcEquilibrium method of a component that implements the ICapeThermoEquilibriumRoutine interface following a successful Equilibrium Calculation. If the temperature, pressure or composition of an equilibrium Phase is changed, the Material Object implementation is responsible for resetting the status of the Phase to Cape_UnknownPhaseStatus. Other property values stored for that Phase should not be affected.
Phases with an Estimates status must 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.
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. |
| ECapeInvalidArgument | To be used when an invalid argument value was passed, that is a value that does not belong to the valid list described above, for example if phaseLabels contains UNDEFINED or phaseStatus contains a value that is not in the above table. |
| ECapeUnknown | The error to be raised when other error(s), specified for this operation, are not suitable. |