CapeThermoMaterialWrapperCalcSinglePhaseProp Method

CalcSinglePhaseProp is used to calculate properties and property derivatives of a mixture in a single Phase at the current values of temperature, pressure and composition set in the Material Object. CalcSinglePhaseProp does not perform phase Equilibrium Calculations.

Definition

Namespace: CapeOpen
Assembly: CapeOpen (in CapeOpen.dll) Version: 1.0.0.0 (1.0.0.0)
private void CalcSinglePhaseProp(
	string[] props,
	string phaseLabel
)

Parameters

props  String
The list of identifiers for the single-phase properties or derivatives to be calculated. See sections 7.5.5 and 7.6 for the standard identifiers.
phaseLabel  String
Phase label of the Phase for which the properties are to be calculated. The Phase label must be one of the strings returned by the GetPhaseList method on the ICapeThermoPhases interface.

Remarks

CalcSinglePhaseProp calculates properties, such as enthalpy or viscosity that are defined for a single Phase. Physical Properties that depend on more than one Phase, for example surface tension or K-values, are handled by CalcTwoPhaseProp method.

Components that implement this method must get the input specification for the calculation (temperature, pressure and composition) from the associated Material Object and set the results in the Material Object.

Thermodynamic and Physical Properties Components, such as a Property Package or Property Calculator, must implement the ICapeThermoMaterialContext interface so that an ICapeThermoMaterial interface can be passed via the SetMaterial method.

A typical sequence of operations for CalcSinglePhaseProp when implemented by a Property Package component would be:

- Check that the phaseLabel specified is valid.

- Use the GetTPFraction method (of the Material Object specified in the last call to the SetMaterial method) to get the temperature, pressure and composition of the specified Phase.

- Calculate the properties.

- Store values for the properties of the Phase in the Material Object using the SetSinglePhaseProp method of the ICapeThermoMaterial interface.

CalcSinglePhaseProp will request the input Property values it requires from the Material Object through GetSinglePhaseProp calls. If a requested property is not available, the exception raised will be ECapeThrmPropertyNotAvailable. If this error occurs then the Property Package can return it to the client, or request a different property. Material Object implementations must be able to supply property values using the client’s choice of basis by implementing conversion from one basis to another.

Clients should not assume that Phase fractions and Compound fractions in a Material Object are normalised. Fraction values may also lie outside the range 0 to 1. If fractions are not normalised, or are outside the expected range, it is the responsibility of the Property Package to decide how to deal with the situation.

It is recommended that properties are requested one at a time in order to simplify error handling. However, it is recognised that there are cases where the potential efficiency gains of requesting several properties simultaneously are more important. One such example might be when a property and its derivatives are required.

If a client uses multiple properties in a call and one of them fails then the whole call should be considered to have failed. This implies that no value should be written back to the Material Object by the Property Package until it is known that the whole request can be satisfied.

It is likely that a PME might request values of properties for a Phase at conditions of temperature, pressure and composition where the Phase does not exist (according to the mathematical/physical models used to represent properties). The exception ECapeThrmPropertyNotAvailable may be raised or an extrapolated value may be returned.

It is responsibility of the implementer to decide how to handle this circumstance.

Exceptions

ECapeNoImplThe 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.
ECapeLimitedImplWould be raised if the one or more of the properties requested cannot be returned because the calculation (of the particular property) is not implemented. This exception should also be raised (rather than ECapeInvalidArgument) if the props argument is not recognised because the list of properties in section 7.5.5 is not intended to be exhaustive and an unrecognised property identifier may be valid. If no properties at all are supported ECapeNoImpl should be raised (see above).
ECapeBadInvOrderThe necessary pre-requisite operation has not been called prior to the operation request. For example, the ICapeThermoMaterial interface has not been passed via a SetMaterial call prior to calling this method.
ECapeFailedInitialisationThe pre-requisites for the property calculation are not valid. For example, the composition of the phases is not defined or any other necessary input information is not available.
ECapeThrmPropertyNotAvailableAt least one item in the requested properties cannot be returned. This could be because the property cannot be calculated at the specified conditions or for the specified phase. If the property calculation is not implemented then ECapeLimitedImpl should be returned.

See Also