Calculates one or more properties at phase equilibrium at one or more specified conditions. Both the flash constraints and the properties that can be calculated using this method are given by capeOpenFlashPropList.
[values,...]=capeOpenEquilibriumProp(handle,props,X,prop1,val1,prop2,val2,type)
handle: package handle, as obtained from capeOpenGetPackage
propNames: string. Multiple properties can be specified; separate the properties by a space.
X: overall composition. Number of columns must match the number of compounds. Multiple rows indicate multiple evaluation conditions. X is in mole fraction or mass fraction, depending on the current basis.
prop1: string, first constraint property. A list of valid flash constraint properties can be obtained using capeOpenFlashPropList.
val1: value for the first flash constraint property. Can be a column vector for multiple conditions. The unit of measure of the value may depend on the basis.
prop2: string, second constraint property.
val2: value for the second flash constraint property. Can be a column vector for multiple conditions. The unit of measure of the value may depend on the basis.
type: string value indicating the desired solution type. Optional. Valid values are "Unspecified" (default), and if vapor fraction is part of the flash constraints, additional valid values are "Normal" or "Retrograde".
For X, val1 and val2, multiple rows mean multiple conditions. If multiple rows are specified for X, val1 or val2, those values that have multiple rows must have the same number of rows. Those values have a single row signify a constant condition or composition.
values: column vector of values. One vector will be returned for each property. The number of values in each vector matches the number of evaluation conditions.
As opposed to other functions, this function will return partial results if some of the calculations failed. Numbers that are not known are set to NaN; if the messages are turned on (default), failed calculations will produce a message.
-->handle=capeOpenGetPackage("TEA (CAPE-OPEN 1.1)","C1_C2");
-->//let's calculate and plot the phase envelope at 1 atm for this system
-->frac=0:0.05:1
frac =
column 1 to 14
0. 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65
column 15 to 21
0.7 0.75 0.8 0.85 0.9 0.95 1.
-->X=[frac' 1-frac']
X =
0. 1.
0.05 0.95
0.1 0.9
0.15 0.85
0.2 0.8
0.25 0.75
0.3 0.7
0.35 0.65
0.4 0.6
0.45 0.55
0.5 0.5
0.55 0.45
0.6 0.4
0.65 0.35
0.7 0.3
0.75 0.25
0.8 0.2
0.85 0.15
0.9 0.1
0.95 0.05
1. 0.
-->P=101325
P =
101325.
-->tbub=capeOpenEquilibriumProp(handle,"temperature",X,"pressure",P,"vaporFraction",0)
tbub =
184.55
165.12909
151.38884
142.77612
136.97314
132.74231
129.47314
126.83926
124.65081
122.78929
121.17652
119.75851
118.49664
117.36239
116.33417
115.39529
114.53258
113.73553
112.99557
112.30568
111.66
-->tdew=capeOpenEquilibriumProp(handle,"temperature",X,"pressure",P,"vaporFraction",1)
tdew =
184.55
183.62459
182.66089
181.65497
180.60223
179.49721
178.3334
177.10294
175.79617
174.4011
172.90252
171.28073
169.50954
167.55296
165.35949
162.85135
159.90232
156.28474
151.51303
144.15511
111.66
-->plot(frac',[tdew tbub])
-->//another example: we start at T = 298.15 K and 1 atm, equimolar, and
-->//we add 1 kJ/mol energy. We want to know the temperature increase
-->h0=capeOpenEquilibriumProp(handle,"enthalpy",[0.5 0.5],"pressure",P,"temperature",298.15)
h0 =
- 35.97927
-->T1=capeOpenEquilibriumProp(handle,"temperature",[0.5 0.5],"pressure",P,"enthalpy",h0+1e3)
T1 =
320.25879