PropertyPackageCalcAndGetLnPhi Method |
This method is used to calculate the natural logarithm of the fugacity coefficients (and
optionally their derivatives) in a single Phase mixture. The values of temperature, pressure
and composition are specified in the argument list and the results are also returned through
the argument list.
Namespace: DWSIM.Thermodynamics.PropertyPackagesAssembly: DWSIM.Thermodynamics (in DWSIM.Thermodynamics.dll) Version: 8.8.1.0
Syntax public virtual void CalcAndGetLnPhi(
string phaseLabel,
double temperature,
double pressure,
Object moleNumbers,
int fFlags,
ref Object lnPhi,
ref Object lnPhiDT,
ref Object lnPhiDP,
ref Object lnPhiDn
)
Public Overridable Sub CalcAndGetLnPhi (
phaseLabel As String,
temperature As Double,
pressure As Double,
moleNumbers As Object,
fFlags As Integer,
ByRef lnPhi As Object,
ByRef lnPhiDT As Object,
ByRef lnPhiDP As Object,
ByRef lnPhiDn As Object
)
Request Example
View SourceParameters
- 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.
- temperature Double
- The temperature (K) for the calculation.
- pressure Double
- The pressure (Pa) for the calculation.
- moleNumbers Object
- Number of moles of each Compound in the mixture.
- fFlags Int32
- Code indicating whether natural logarithm of the fugacity coefficients and/or derivatives
should be calculated (see notes).
- lnPhi Object
- Natural logarithm of the fugacity coefficients (if requested).
- lnPhiDT Object
- Derivatives of natural logarithm of the fugacity coefficients w.r.t. temperature (if requested).
- lnPhiDP Object
- Derivatives of natural logarithm of the fugacity coefficients w.r.t. pressure (if requested).
- lnPhiDn Object
- Derivatives of natural logarithm of the fugacity coefficients w.r.t. mole numbers (if requested).
Implements
ICapeThermoPropertyRoutine.CalcAndGetLnPhi(String, Double, Double, Object, Int32, Object, Object, Object, Object)Remarks This method is provided to allow the natural logarithm of the fugacity coefficient, which is
the most commonly used thermodynamic property, to be calculated and returned in a highly
efficient manner.
The temperature, pressure and composition (mole numbers) for the calculation are specified
by the arguments and are not obtained from the Material Object by a separate request. Likewise,
any quantities calculated are returned through the arguments and are not stored in the
Material Object. The state of the Material Object is not affected by calling this method. It
should be noted however, that prior to calling CalcAndGetLnPhi a valid Material Object
must have been defined by calling the SetMaterial method on the
ICapeThermoMaterialContext interface of the component that implements the
ICapeThermoPropertyRoutine interface. The compounds in the Material Object must have
been identified and the number of values supplied in the moleNumbers argument must be
equal to the number of Compounds in the Material Object.
The fugacity coefficient information is returned as the natural logarithm of the fugacity
coefficient. This is because thermodynamic models naturally provide the natural logarithm
of this quantity and also a wider range of values may be safely returned.
The quantities actually calculated and returned by this method are controlled by an integer
code fFlags. The code is formed by summing contributions for the property and each
derivative required using the enumerated constants eCapeCalculationCode (defined in the
Thermo version 1.1 IDL) shown in the following table. For example, to calculate log
fugacity coefficients and their T-derivatives the fFlags argument would be set to
CAPE_LOG_FUGACITY_COEFFICIENTS + CAPE_T_DERIVATIVE.
code numerical value
no calculation CAPE_NO_CALCULATION 0
log fugacity coefficients CAPE_LOG_FUGACITY_COEFFICIENTS 1
T-derivative CAPE_T_DERIVATIVE 2
P-derivative CAPE_P_DERIVATIVE 4
mole number derivatives CAPE_MOLE_NUMBERS_DERIVATIVES 8
If CalcAndGetLnPhi is called with fFlags set to CAPE_NO_CALCULATION no property
values are returned.
A typical sequence of operations for this method when implemented by a Property Package
component would be:
- Check that the phaseLabel specified is valid.
- Check that the moleNumbers array contains the number of values expected
(should be consistent with the last call to the SetMaterial method).
- Calculate the requested properties/derivatives at the T/P/composition specified in
the argument list.
- Store values for the properties/derivatives in the corresponding arguments.
Note that this calculation can be carried out irrespective of whether the Phase actually exists
in the Material Object.
See Also