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; separate the properties by a space.
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.684364
-->capeOpen1PhaseProp(handle,"enthalpy","vapor",[300:10:400]',1e5,[0.5 0.5])
ans =
46.684364
495.61083
952.51195
1417.5585
1890.9062
2372.6962
2863.0557
3362.0984
3869.9252
4386.6241
4912.2714
-->capeOpen1PhaseProp(handle,"enthalpy","vapor",[300:10:400]',[1e5:1e3:1.1e5]',[0.5 0.5])
ans =
46.684364
495.27542
951.87325
1416.6454
1889.7446
2371.3097
2861.4656
3360.3242
3867.9844
4384.5329
4910.0446
-->frac=0:0.1:1
frac =
0. 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.
-->X=[frac' 1-frac']
X =
0. 1.
0.1 0.9
0.2 0.8
0.3 0.7
0.4 0.6
0.5 0.5
0.6 0.4
0.7 0.3
0.8 0.2
0.9 0.1
1. 0.
-->[h dhdx]=capeOpen1PhaseProp(handle,"enthalpy enthalpy.DmolFraction","vapor",300,101325,X)
dhdx =
59.323378 38.745096
57.163653 38.864248
55.239564 39.208789
53.548664 39.776832
52.088678 40.566654
50.8575 41.651078
49.785327 42.868954
49.012572 44.304464
48.463229 45.956491
48.135834 47.824064
48.029071 49.906359
h =
38.810411
40.742733
42.448599
43.928995
45.184853
46.217051
47.026413
47.613712
47.979669
48.124955
48.050192
-->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)
dhdx =
1972.8427 1288.4967
2016.0342 1413.6691
2080.6314 1559.3428
2161.9387 1721.0695
2253.3782 1898.6811
2358.8686 2083.3301
2473.217 2276.5546
2594.9376 2476.9289
2722.8619 2683.3294
2856.0576 2894.8579
2993.7713 3110.7873
h =
1290.6688
1518.854
1726.3878
1917.6628
2095.9031
2263.5301
2422.3987
2573.9539
2719.3387
2859.469
2995.0878
-->capeOpen1PhaseProp(handle,"fugacityCoefficient.DmolFraction","vapor",300,101325,X)
!--error 9999
Property calculations cannot be performed at multiple conditions if any property has matrix dimensions
called by :
capeOpen1PhaseProp(handle,"fugacityCoefficient.DmolFraction","vapor",300,101325,X)
-->//we can however calculate at a single composition:
-->capeOpen1PhaseProp(handle,"fugacityCoefficient.DmolFraction","vapor",300,101325,X(1,:))
ans =
1.0D-09 *
4991820.7 8570959.1
- 6.881D-09 - 3.441D-09