Click or drag to resize

PropertyPackageCalcSinglePhaseProp 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.

Namespace: DWSIM.Thermodynamics.PropertyPackages
Assembly: DWSIM.Thermodynamics (in DWSIM.Thermodynamics.dll) Version: 8.4.5.0
Syntax
public virtual void CalcSinglePhaseProp(
	Object props,
	string phaseLabel
)
Request Example View Source

Parameters

props  Object
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 and the phase must be present in the Material Object.

Implements

ICapeThermoPropertyRoutine.CalcSinglePhaseProp(Object, String)
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. The component that implements the ICapeThermoPropertyRoutine interface (e.g. a Property Package or Property Calculator) must also implement the ICapeThermoPhases interface so that it is possible to get a list of supported phases. The phaseLabel passed to this method must be one of the phase labels returned by the GetPhaseList method of the ICapeThermoPhases interface and it must also be present in the Material Object, ie. one of the phase labels returned by the GetPresentPhases method of the ICapeThermoMaterial interface. This latter condition will be satisfied if the phase is made present explicitly by calling the SetPresentPhases method or if any phase properties have been set by calling the SetSinglePhaseProp or SetTwoPhaseProp methods. 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.
See Also