© 2024 Jasper van Baten, AmsterCHEM

capeOpenEquilibrium

Calculate a thermodynamic phase equilibrium and return full info on phases, phase fractions, compositions, pressure and temperature.

Syntax

[phases,phaseFractions,phaseCompositions,T,P]=capeOpenEquilibrium(handle,X,prop1,val1,prop2,val2,type)

Arguments

handle: package handle, as obtained from capeOpenGetPackage

X: overall composition. Must be a row vector with the number of elements equal to the number of compounds. 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. 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. 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".

Returns

phases: column vector with names of the phases present at equilibrium. The state of aggregation for each phase can be obtained with capeOpenAggregationState.

phaseFractions: column vector with the phase fractions of the phases present at equilibrium. The phase fractions are mole or mass fractions, depending on the current basis.

phaseCompositions: Equilibrium composition of the present phases. Number of rows matches the number of present phases, and number of columns matches the compound count. Composition is in mole or mass fractions, depending on the current basis.

T: the temperature at the calculated equilibrium

P: the pressure at the calculated equilibrium

Example


» handle=capeOpenGetPackage('TEA (CAPE-OPEN 1.1)','C1_C2');
» [phases,phaseFracs,phaseComp]=capeOpenEquilibrium(handle,[0.5 0.5],'pressure',1e5,'temperature',300)
Warning: CAPE-OPEN: TEA warning: temperature above TC for determining Yen and
Woods liquid density; using TR=1.0 

phases = 

    'Vapor'


phaseFracs =

     1


phaseComp =

    0.5000
    0.5000

» [phases,phaseFracs,phaseComp,T]=capeOpenEquilibrium(handle,[0.5 0.5],'vaporFraction',0.5,'pressure',1e5)

phases = 

    'Vapor'
    'Liquid'


phaseFracs =

    0.5000    0.5000


phaseComp =

    0.9008    0.0992
    0.0992    0.9008


T =

  151.2583

» [phases,phaseFracs,phaseComp]=capeOpenEquilibrium(handle,[0.5 0.5],'pressure',1e5,'temperature',151.25826)

phases = 

    'Vapor'
    'Liquid'


phaseFracs =

    0.5000    0.5000


phaseComp =

    0.9008    0.0992
    0.0992    0.9008 
INDEX
Basis conversions
Calculations
capeOpen1PhaseProp
capeOpen1PhasePropList
capeOpen2PhaseProp
capeOpen2PhasePropList
capeOpenAbout
capeOpenAggregationState
capeOpenCompoundConstant
capeOpenCompounds
capeOpenConstantList
capeOpenEquilibrium
capeOpenEquilibriumProp
capeOpenFlashPropList
capeOpenGetPackage
capeOpenGetPackageName
capeOpenGetPackages
capeOpenHelp
capeOpenKillAllPackages
capeOpenKillPackage
capeOpenPackageManagers
capeOpenPackages
capeOpenPDepPropList
capeOpenPhases
capeOpenPropUnit
capeOpen Quick Reference
capeOpenSetBasis
capeOpenShowMessages
capeOpenTDepProp
capeOpenTDepPropList
capeOpenThermoVersion
Disclaimer
Equilibrium calculations
Information
License
Matrix dimension conventions
Obtaining package information
Package information
Package maintenance
Property calculations
Registration with Matlab
pathdef.m
System requirements
Welcome
CONTENT
 Welcome
 Introduction
 Package Maintenance
 Package information
 Property and equilibrium calculations
 capeOpenCompoundConstant
 capeOpenTDepProp
 capeOpenPDepProp
 capeOpen1PhaseProp
 capeOpen2PhaseProp
 capeOpenEquilibrium
 capeOpenEquilibriumProp
 General functions
 License and disclaimer