General Commands > About General Commands > model.capeopen()

model.capeopen()
Create constants and functions interfacing to a CAPE-OPEN compliant thermodynamics package.
Syntax
Creating a CAPE-OPEN property package feature.
model.capeopen().create(<ptag>, "PropertyPackage");
Setting and getting properties in a CAPE-OPEN property package feature:
model.capeopen().feature(<ptag>).set(<prop>, <value>);
model.capeopen().feature(<ptag>).getString(<prop>);
model.capeopen().feature(<ptag>).storePersistenceData();
Calling this method after a property package feature has been created, and manager_id and package_id have been set, stores information about how the CAPE-OPEN package was created in the COMSOL model. If the model is later opened on a computer with the CAPE-OPEN manager installed but without the property package, this information can be used to create the required property package.
model.capeopen().feature(<ptag>).create(<ftag>, <type>);
Creates a CAPE-OPEN constant, function, or flash calculation feature. Possible types are CompoundConstant, TemperatureDependentProperty, PressureDependentProperty, OnePhaseProperty, TwoPhaseProperty, and FlashCalculationProperty.
model.capeopen().feature(<ptag>).feature(<ftag>).set(<prop>, <value>);
model.capeopen().feature(<ptag>).feature(<ftag>).getString(<prop>);
model.capeopen().feature(<ptag>).feature(<ftag>).getStringArray(<prop>);
model.capeopen().feature(<ptag>).feature(<ftag>).getStringMatrix(<prop>);
Set and get properties in a CAPE-OPEN constant, function, or flash calculation feature.
model.capeopen().feature(<ptag>)).
getAllowedPropertyValues(property)
returns the set of allowed values for a property if the set is a finite set of strings; otherwise, it returns null.
CAPE-OPEN Constant Features
CAPE-OPEN constant features are features with the type "CompoundConstant", and are used to define constants that get their value from a thermodynamics package.
CAPE-OPEN Function Features
A CAPE-OPEN function feature defines a function that can be used to evaluate properties that depend, for example, on temperature or pressure. Different types are TemperatureDependentProperty, PressureDependentProperty, OnePhaseProperty, and TwoPhaseProperty.
Functions of type TemperatureDependentProperty and PressureDependentProperty have a single argument, which is the temperature or pressure, respectively.
Functions of type OnePhaseProperty have temperature and pressure as their first two arguments. If there is more than one compound, there are additional arguments for the fraction of each compound.
Functions of type TwoPhaseProperty have temperature and pressure as their first two arguments. If there is more than one compound, there are additional arguments for the fraction of each compound in each phase.
CAPE-OPEN Flash Calculation Features
CAPE-OPEN flash calculation features are used as an interface for flash calculations, which take amounts of different compounds and two conditions (for example, temperature and pressure) as input and compute the fraction of each compound that is present in each phase.
Each flash calculation feature defines a number of functions. All of the functions take the values of two flash conditions as their first two arguments, followed by arguments for the total amount of each compound.
See Also
model.func()