Calculate and get values for single-phase properties. A list of supported single phase properties can be obtained using capeOpen1PhasePropList.
[values,...]=capeOpen1PhaseProp(handle,propNames,phase,T,P,X)
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.
phase: string. Phase name for the calculation. Valid phase names can be obtained with capeOpenPhases.
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.
X: composition matrix. 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.
For calculation at multiple conditions, T, P and X 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 and X 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 enthalpy), 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 fugacityCoefficient), 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 fugacityCoefficient.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.
» handle=capeOpenGetPackage('TEA (CAPE-OPEN 1.1)','C1_C2'); » capeOpen1PhaseProp(handle,'enthalpy','vapor',300,1e5,[0.5 0.5]) ans = 46.6844 » capeOpen1PhaseProp(handle,'enthalpy','vapor',[300:10:400]',1e5,[0.5 0.5]) ans = 1.0e+003 * 0.0467 0.4956 0.9525 1.4176 1.8909 2.3727 2.8631 3.3621 3.8699 4.3866 4.9123 » capeOpen1PhaseProp(handle,'enthalpy','vapor',[300:10:400]',[1e5:1e3:1.1e5]',[0.5 0.5]) ans = 1.0e+003 * 0.0467 0.4953 0.9519 1.4166 1.8897 2.3713 2.8615 3.3603 3.8680 4.3845 4.9100 » frac=0:0.1:1 frac = Columns 1 through 7 0 0.1000 0.2000 0.3000 0.4000 0.5000 0.6000 Columns 8 through 11 0.7000 0.8000 0.9000 1.0000 » X=[frac' 1-frac'] X = 0 1.0000 0.1000 0.9000 0.2000 0.8000 0.3000 0.7000 0.4000 0.6000 0.5000 0.5000 0.6000 0.4000 0.7000 0.3000 0.8000 0.2000 0.9000 0.1000 1.0000 0 » [h dhdx]=capeOpen1PhaseProp(handle,'enthalpy enthalpy.DmolFraction','vapor',300,101325,X) h = 38.8104 40.7427 42.4486 43.9290 45.1849 46.2171 47.0264 47.6137 47.9797 48.1250 48.0502 dhdx = 59.3234 38.7451 57.1637 38.8642 55.2396 39.2088 53.5487 39.7768 52.0887 40.5667 50.8575 41.6511 49.7853 42.8690 49.0126 44.3045 48.4632 45.9565 48.1358 47.8241 48.0291 49.9064 » capeOpenPropUnit('enthalpy.DmolFraction') ans = J / mol » capeOpenSetBasis('mass') » capeOpenPropUnit('fraction') ans = mass fraction » capeOpenPropUnit('enthalpy') ans = J / kg » [h dhdx]=capeOpen1PhaseProp(handle,'enthalpy enthalpy.DmolFraction','vapor',300,101325,X) h = 1.0e+003 * 1.2907 1.5189 1.7264 1.9177 2.0959 2.2635 2.4224 2.5740 2.7193 2.8595 2.9951 dhdx = 1.0e+003 * 1.9728 1.2885 2.0160 1.4137 2.0806 1.5593 2.1619 1.7211 2.2534 1.8987 2.3589 2.0833 2.4732 2.2766 2.5949 2.4769 2.7229 2.6833 2.8561 2.8949 2.9938 3.1108 » capeOpen1PhaseProp(handle,'fugacityCoefficient.DmolFraction','vapor',300,101325,X) ??? Error using ==> MatlabCapeOpenThermo Property calculations cannot be performed at multiple conditions if any property has matrix dimensions » %we can however calculate at a single composition: » capeOpen1PhaseProp(handle,'fugacityCoefficient.DmolFraction','vapor',300,101325,X(1,:)) ans = 0.0050 0.0086 -0.0000 -0.0000