MaterialStreamGetPresentPhases Method |
Returns Phase labels for the Phases that are currently present in the Material Object.
Namespace: DWSIM.Thermodynamics.StreamsAssembly: DWSIM.Thermodynamics (in DWSIM.Thermodynamics.dll) Version: 8.8.1.0
Syntax public void GetPresentPhases(
ref Object phaseLabels,
ref Object phaseStatus
)
Public Sub GetPresentPhases (
ByRef phaseLabels As Object,
ByRef phaseStatus As Object
)
Request Example
View SourceParameters
- phaseLabels Object
- 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
Implements
ICapeThermoMaterial.GetPresentPhases(Object, Object)Remarks A Phase is ‘present’ in a Material Object (or other component that implements the
ICapeThermoMaterial interface) if it has been explicitly made present by calling the
SetPresentPhases method or if any properties have been set by calling the
SetSinglePhaseProp or SetTwoPhaseProp methods. Even if a Phase is present, it does not
necessarily imply that any Physical Properties are actually set unless the phaseStatus is
Cape_AtEquilibrium or Cape_Estimates (see below). Note that calling the SetPresentPhases
method of the ICapeThermoMaterial interface will cause any phases not specified in its
phaseLabels list to not present, even if previously present as a result of a SetSingle-
PhaseProp or SetTwoPhaseProp call.
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:
Identifier Meaning
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.
GetPresentPhases is intended to be used in several contexts.
A Property Package, Property Calculator or other PMC may use this method to check
whether a phase is present in the Material Object prior to requesting and/or calculating
some properties.
An Equilibrium Calculator component will use this method to obtain the list of phases to
consider in an equilibrium calculation or when checking an equilibrium specification
(see below for more details).
The method will be used by the PME or PMC to obtain the list of phases present as the
result of an equilibrium calculation (see below for more details).
A Unit Operation (or other PMC) will use this method to get the list of phases present at
an inlet port or during its calculations.
In the context of Equilibrium Calculations the GetPresentPhases 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.
See Also