Property Metadata Classes

Property Metadata Classes#

All property packages (both for thermophysical and reaction properties) are expected to define a set of metadata that contains the following:

  1. A UnitSet object that records the units of measurement used within the property package.

  2. A PropertySet object that describes what properties are supported by the property package, how these are constructed, and what dependencies this property package may have (primarily for reaction packages that depend on thermophysical properties from another package).

More information on UnitSets and PropertySets can be found through the links below.

Property Class Metadata#

Each property package should create an instance of a PropertyClassMetadata object to contain the necessary metadata. This class contains methods that are used hold and interact with the UnitSet and PropertySet for a specific property package.

class idaes.core.base.property_meta.PropertyClassMetadata[source]#

Container for metadata about the property class, which includes default units and properties.

Example usage:

foo = PropertyClassMetadata()
foo.add_default_units(time = pyo.units.fortnights,
                      mass = pyo.units.stones)
foo.add_properties({'under_sea': {'method': 'submarine', 'units': 'leagues', 'required': False, 'supported': True},
                    'tentacle_size': {'method': 'kraken', 'units': 'yards', 'required': True, 'supported': True}})
add_default_units(u)[source]#

Set units of measurement for base quantities used in this property package. Units should be provided as a dict with keys being the seven base quantities and values being Pyomo unit expressions. These will be used to update the UnitSet associated with this property package.

Parameters:

u (dict) – Key=property, Value=units

Returns:

None

Raises:

TypeError if definitions for unexpected quantities are found

add_properties(p)[source]#

Add properties to the metadata.

For each property, the value should be another dict which may contain the following keys:

  • ‘units’: (optional) units of measurement for the property.

  • ‘indices’: (optional) list of sub-property indices for this property. If None, use default set, if False unindexed.

  • ‘method’: (optional, only if ‘indices’ is None or False) the name of a method to construct the

    property as a str, or None if the property will be constructed by default.

  • ‘supported’: (optional, only if ‘indices’ is None or False) bool indicating if this property is

    supported by this package.

  • ‘required’: (optional, only if ‘indices’ is None or False) bool indicating if this property is

    required by this package.

  • ‘valid_range’: (optional, only if ‘indices’ is None or False) 2-tuple containing range of validity for

    property values (lower, upper).

  • ‘initialize’: (optional) dict indicating ‘method’, ‘required’, ‘supported’ and ‘valid_range’ values for sub-properties by index.

Parameters:

p (dict) – Key=property, Value=dict

Returns:

None

add_required_properties(p)[source]#

Add required properties to the metadata.

Update ‘required’ attribute of specified properties. Note that argument must be a dict for backwards compatibility.

Parameters:

p (dict) – Key=property, Value=(ignored)

Returns:

None

property default_units#
define_custom_properties(p)[source]#

Add custom properties to the metadata.

For each property, the value should be another dict which may contain the following keys:

  • ‘units’: (optional) units of measurement for the property.

  • ‘indices’: (optional) list of sub-property indices for this property. If None, use default set, if False unindexed.

  • ‘method’: (optional, only if ‘indices’ is None or False) the name of a method to construct the

    property as a str, or None if the property will be constructed by default.

  • ‘supported’: (optional, only if ‘indices’ is None or False) bool indicating if this property is

    supported by this package.

  • ‘required’: (optional, only if ‘indices’ is None or False bool indicating if this property is

    required by this package.

  • ‘initialize’: (optional) dict indicating ‘method’, ‘required’ and ‘supported’ values for sub-properties by index.

Parameters:

p (dict) – Key=property, Value=dict

Returns:

None

define_property_set(propset)[source]#

Define the type of property set to use for this package.

Parameters:

propset (PropertySetBase) – PropertySet class (must derive from PropertySetBase)

Returns:

None

property derived_units#
get_derived_units(units)[source]#
Parameters:

units (str) –

property properties#