model.thermodynamics()
Create constants and functions interfacing to a thermodynamics property package.
Syntax
Creating a thermodynamics property package feature.
model.thermodynamics().create(<ptag>,"PropertyPackage");
Setting and getting properties in a thermodynamics property package feature:
model.thermodynamics().feature(<ptag>).set(<prop>,<value>);
model.thermodynamics().feature(<ptag>).getString(<prop>);
model.thermodynamics().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 thermodynamics package was created in the COMSOL model. If the model is later opened on a computer with the thermodynamics manager installed but without the property package, this information can be used to create the required property package.
model.thermodynamics().feature(<ptag>).create(<ftag>, <type>);
Creates a thermodynamics constant, function, or flash calculation feature. Possible types are CompoundConstant, TemperatureDependentProperty, PressureDependentProperty, OnePhaseProperty, TwoPhaseProperty, and FlashCalculationProperty.
model.thermodynamics().feature(<ptag>).feature(<ftag>).set(<prop>,<value>);
model.thermodynamics().feature(<ptag>).feature(<ftag>).getString(<prop>);
model.thermodynamics().feature(<ptag>).feature(<ftag>).getStringArray(<prop>);
model.thermodynamics().feature(<ptag>).feature(<ftag>).getStringMatrix(<prop>);
Set and get properties in a thermodynamics constant, function, or flash calculation feature.
Thermodynamics Constant Features
The thermodynamics constant features are features with the type "CompoundConstant", and are used to define constants that get their value from a thermodynamics package.
Thermodynamics Function Features
A thermodynamics 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.
Thermodynamics Flash Calculation Features
Thermodynamics 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()