Property Sets#
Due to the large number of potential thermophysical properties that are used in process applications and the complexity associated with these calculations, one of the key aspects of the IDAES CMF is to be able to only specify calculations for those properties that are actually required for a given problem. In order to support this, and allow users to understand what is supported by a given property package, each property package is expected to define a PropertySet that lists what properties are supported and how these are constructed.
PropertySets are application specific, and are intended to contain a comprehensive list of all properties of interest for the given application. Each property package should select a PropertySet appropriate for its application, and can then specify the sub-set of properties in the PropertySet are supported by that package, and how they will be constructed. The PropertySet will also define the expected units of measurement for each property by linking to the UnitSet defined for the property package.
The code below shows an example of how to set up a property package using the StandardPropertySet (suitable for most liquid and vapor phase property packages) and identify which properties are supported.
@classmethod
def define_metadata(cls, obj):
# Select StandardPropertySet
obj.define_property_set(StandardPropertySet)
# Update the flow mol property to indicate that it is supported
obj.properties.FLOW_MOL.update_property(supported=True)
Note
Any property defined in a PropertySet that is not explicitly marked as supported is assumed to not be supported (i.e., the default value of supported is False).
Core Property Sets#
A list of the existing PropertySets defined in the IDAES CMF is shown below:
Property Metadata Object#
Each individual property within a PropertySet is defined using a PropertyMetadata object, which records information such as whether the property is supported by the given property package, and what method is used to construct this property (if applicable).
- class idaes.core.base.property_set.PropertyMetadata(name=None, doc=None, units=None, indices=None, initialize=None)[source]#
Metadata object for defining a property.
This object stores all the metadata associated with a single property, including:
name of property
documentation of property
units of measurement for this property (defined via associated UnitSet)
indexing set for sub-properties (e.g. by component or by phase)
attributes for sub-properties identifying
method that constructs this property and associated constraints (if build-on-demand)
whether property is supported by this package
whether this package expects this property to be provided by another package
- property name#
Doc string for property
- property units#
Units of measurement for this property. This should be a reference to a quantity defined in the UnitSet associated with this property package.
Property Set Base Class#
The PropertySetBase class defines common methods associated with PropertySets, and should be used as the base class for defining custom PropertySets.
- class idaes.core.base.property_set.PropertySetBase(parent)[source]#
Base class for defining property sets.
This defines the common methods expected of all PropertySets.
- check_required_properties(other)[source]#
Check that other property package supports all properties marked as required by this package.
- Parameters:
other (PropertySetBase) – PropertySet to check for supported properties
- Returns:
list of properties required by this package which are not supported by other package
- define_property(name, doc=None, units=None, indices=None, method=None, required=False, supported=True, initialize=None)[source]#
Define a new property called name.
- Parameters:
name (str) – name of new property (required)
doc (str) – doc string for property
units (_PyomoUnit) – quantity defined in associated UnitSet defining the units of measurement for property
indices – list, bool or None. Indicates what sub-property indices should be added. None = use default set, False = unindexed (only ‘none’ entry)
method (str) – reference to build-on-demand method for property (optional, only if indices is None or False, default=None)
supported (bool) – bool indicating if package supports this property (optional, only if indices is None or False, default=True)
required (bool) – bool indicating if package requires this property from another package (optional, only if indices is None or False, default=False)
initialize (dict) – dict containing values for method, required and supported by sub-property indices (optional). Cannot combine with method, required or supported arguments.
- Returns:
None
- get_name_and_index(property_name)[source]#
Separates an indexed property name into the main property and index,
This method is written assuming the standard indices, and checks for ‘phase’ and then ‘component’ before checking for any custom indices. Developers of custom PropertySets may wish to overload this with custom search logic better suited to the set of defined indices.
- Returns:
strings indicating the name of the base property and indexing set.
- Return type:
name, index
- Parameters:
property_name (str)
- list_required_properties()[source]#
Return a list of properties required by this package
- Returns:
list
- list_supported_properties()[source]#
Return a list of properties supported by this package
- Returns:
list
- list_unsupported_properties()[source]#
Return a list of properties not supported by this package
- Returns:
list
- property unitset#
Reference to UnitSet associated with this PropertySet (via the parent metadata object).