Calculate and get values for two-phase properties. A list of supported two-phase properties can be obtained using capeOpen2PhasePropList.
[values,...]=capeOpen2PhaseProp(handle,propNames,phase1,phase2,T,P,X1,X2)
handle: package handle, as obtained from capeOpenGetPackage
propNames: string. Multiple properties can be specified; either separate the properties by a space, or use a string matrix for multiple properties.
phase1: string. Name of the first phase for the calculation. Valid phase names can be obtained with capeOpenPhases.
phase2: string. Name of the second phase for the calculation.
T: scalar or column vector of temperatures at which to calculate the values.
P: scalar or column vector of pressures at which to calculate the values.
X1: composition matrix for the first phase. Number of columns must match compound count. Can have a single row, or multiple rows for multiple compositions. X is in mole fraction or mass fraction, depending on the current basis.
X2: composition matrix for the second phase.
For calculation at multiple conditions, T, P, X1 and X2 must have a consistent number of rows. Any of them can have a single row, meaning constant T, P or composition. The number of evaluations will depend on the maximum number of rows. For all T, P, X1 and X2 that have multiple rows, the number of rows must be equal. Evaluation at multiple conditions is not supported for properties for which the value is a matrix.
values: matrix of values. One matrix will be returned for each property. If the calculated property is a scalar (such as surfaceTension), the returned matrix will be a column vector with the size of the number of evaluation conditions. If the calculated property is a vector (such as Kvalues), the number of rows will match the number of conditions, and the number of columns will match the number of compounds. For properties that are a matrix (such as Kvalues.DmolFraction), evaluation at multiple conditions is not supported, and the returned matrix will be square, with the number of rows and columns equal to the number of compounds. For composition derivatives (such as surfaceTension.DmolFraction or Kvalues.Dmolfraction) the return value will not be a single matrix, but a list of two matrices; the first matrix contains the composition derivative w.r.t. phase 1, and the second matrix the composition derivative w.r.t. phase 2.
» handle=capeOpenGetPackage('TEA (CAPE-OPEN 1.1)','C1_C2'); » capeOpen2PhasePropList(handle) ans = 'surfaceTension' 'surfaceTension.Dmoles' 'surfaceTension.DmolFraction' 'surfaceTension.Dtemperature' » XV=[0.5 0.5] XV = 0.5000 0.5000 » XL=[1 0] XL = 1 0 » capeOpen2PhaseProp(handle,'surfaceTension','vapor','liquid',298.15,101325,XV,XL) ans = 1.0000e-010 » %well outside of the two-phase region; let's lower the temperature: » capeOpen2PhaseProp(handle,'surfaceTension','vapor','liquid',150,101325,XV,XL) ans = 0.0061 » [st stdx]=capeOpen2PhaseProp(handle,'surfaceTension surfaceTension.DmolFraction','vapor','liquid',150,101325,XV,XL) st = 0.0061 stdx = [1x2 double] [1x2 double] » stdx{1} ans = 0 0 » stdx{2} ans = 0.0061 0.0218 » %notice how surface tension for this package does not depend on vapor composition » [st stdx]=capeOpen2PhaseProp(handle,'surfaceTension surfaceTension.DmolFraction','vapor','liquid',[150:1:170]',101325,XV,XL) st = 0.0061 0.0059 0.0058 0.0056 0.0055 0.0053 0.0051 0.0050 0.0048 0.0047 0.0045 0.0044 0.0042 0.0040 0.0039 0.0037 0.0036 0.0034 0.0033 0.0031 0.0030 stdx = [21x2 double] [21x2 double] » stdx{1} ans = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 » stdx{2} ans = 0.0061 0.0218 0.0059 0.0216 0.0058 0.0215 0.0056 0.0213 0.0055 0.0211 0.0053 0.0210 0.0051 0.0208 0.0050 0.0206 0.0048 0.0205 0.0047 0.0203 0.0045 0.0202 0.0044 0.0200 0.0042 0.0198 0.0040 0.0197 0.0039 0.0195 0.0037 0.0193 0.0036 0.0192 0.0034 0.0190 0.0033 0.0189 0.0031 0.0187 0.0030 0.0185