Property Interrogator Tool

When preparing to model a process flowsheet, it is necessary to specify models for all the thermophysical and kinetic properties that will be required by the different unit operations to simulate the process. However, it is often difficult to know what properties will be required a priori. The IDAES Property Interrogator tool allows a user to define a general flowsheet structure and interrogate it for the full list of properties that will be required, thus informing them of what methods they will need to define in their property package(s).

Tool Usage

The IDAES Properties Interrogator tool consists of two classes; a PropertiesInterrogatorBlock and a ReactionInterrogatorBlock. These blocks are used in place of the normal PhysicalParameterBlock and ReactionParameterBlock whilst declaring a flowsheet, however rather than constructing a solvable flowsheet they record all calls for properties made whilst constructing the flowsheet. These Blocks then contain a number of methods for reporting the logged property calls for the user.

An example of how Property Interrogator tool is used is shown below:

import pyomo.environ as pyo  # Pyomo environment
from idaes.core import FlowsheetBlock
from idaes.generic_models.unit_models import CSTR
from idaes.generic_models.properties.interrogator import PropertyInterrogatorBlock, ReactionInterrogatorBlock

m = pyo.ConcreteModel()
m.fs = FlowsheetBlock(default={"dynamic": True})

m.fs.params = PropertyInterrogatorBlock()
m.fs.rxn_params = ReactionInterrogatorBlock(
        default={"property_package": m.fs.params})

m.fs.R01 = CSTR(default={"property_package": m.fs.params,
                         "reaction_package": m.fs.rxn_params,
                         "has_heat_of_reaction": True})

Note

Flowsheets constructed using the Property Interrogator tools are not solvable flowsheets, and will result in errors if sent to a solver.

Output and Display Methods

Both the PropertiesInterrogatorBlock and ReactionInterrogatorBlock support the following methods for reporting the results of the flowsheet interrogation. The PropertiesInterrogatorBlock will contain a summary of all thermophysical properties expected of a StateBlock in the flowsheet, whilst the ReactionInterrogatorBlock will contain a summary of all reaction related properties required of a ReactionBlock.

  • list_required_properties() - returns a list containing all properties called for by the flowsheet.

  • print_required_properties() - prints a summary of the required properties

  • list_models_requiring_property(property) - returns a list of unit models within the flowsheet that require the given property

  • print_models_requiring_property(property) - prints the name of all unit models within the flowsheet that require the given property

  • list_properties_required_by_model(model) - returns a list of all properties required by a given unit model in the flowsheet

  • print_properties_required_by_model(model) - prints a summary of all properties required by a given unit model in the flowsheet

For more details on these methods, see the detailed class documentation below.

Additionally, the PropertiesInterrogatorBlock and ReactionInterrogatorBlock contain a dict named required_properties which stores the data regarding the properties required by the model. The keys of this dict are the names of all the properties required (as strings) and the values are a list of names for the unit models requiring the given property.

Class Documentation

class idaes.generic_models.properties.interrogator.properties_interrogator.PropertyInterrogatorBlock(*args, **kwargs)
Parameters
  • rule (function) – A rule function or None. Default rule calls build().

  • concrete (bool) – If True, make this a toplevel model. Default - False.

  • ctype (str) – Pyomo ctype of the block. Default - “Block”

  • default (dict) –

    Default ProcessBlockData config

    Keys
    default_arguments

    Default arguments to use with Property Package

  • initialize (dict) – ProcessBlockData config for individual elements. Keys are BlockData indexes and values are dictionaries described under the “default” argument above.

  • idx_map (function) – Function to take the index of a BlockData element and return the index in the initialize dict from which to read arguments. This can be provided to overide the default behavior of matching the BlockData index exactly to the index in initialize.

Returns

(PropertyInterrogatorBlock) New instance

class idaes.generic_models.properties.interrogator.properties_interrogator.PropertyInterrogatorData(component)[source]

Interrogator Parameter Block Class

This class contains the methods and attributes for recording and displaying the properties requried by the flowsheet.

build()[source]

Callable method for Block construction.

classmethod define_metadata(obj)[source]

Set all the metadata for properties and units.

This method should be implemented by subclasses. In the implementation, they should set information into the object provided as an argument.

Parameters

pcm (PropertyClassMetadata) – Add metadata to this object.

Returns

None

list_models_requiring_property(prop)[source]

Method to list all models in the flowsheet requiring the given property.

Parameters

prop – the property of interest

Returns

A list of unit model names which require prop

list_properties_required_by_model(model)[source]

Method to list all thermophysical properties required by a given unit model.

Parameters

model – the unit model of interest. Can be given as either a model component or the unit name as a string

Returns

A list of thermophysical properties required by model

list_required_properties()[source]

Method to list all thermophysical properties required by the flowsheet.

Parameters

None

Returns

A list of properties required

print_models_requiring_property(prop, ostream=None)[source]

Method to print a summary of the models in the flowsheet requiring a given property.

Parameters
  • prop – the property of interest.

  • ostream – output stream to print to. If not provided will print to sys.stdout

Returns

None

print_properties_required_by_model(model, ostream=None)[source]

Method to print a summary of the thermophysical properties required by a given unit model.

Parameters
  • model – the unit model of interest.

  • ostream – output stream to print to. If not provided will print to sys.stdout

Returns

None

print_required_properties(ostream=None)[source]

Method to print a summary of the thermophysical properties required by the flowsheet.

Parameters

ostream – output stream to print to. If not provided will print to sys.stdout

Returns

None

class idaes.generic_models.properties.interrogator.reactions_interrogator.ReactionInterrogatorBlock(*args, **kwargs)
Parameters
  • rule (function) – A rule function or None. Default rule calls build().

  • concrete (bool) – If True, make this a toplevel model. Default - False.

  • ctype (str) – Pyomo ctype of the block. Default - “Block”

  • default (dict) –

    Default ProcessBlockData config

    Keys
    property_package

    Reference to associated PropertyPackageParameter object

    default_arguments

    Default arguments to use with Property Package

  • initialize (dict) – ProcessBlockData config for individual elements. Keys are BlockData indexes and values are dictionaries described under the “default” argument above.

  • idx_map (function) – Function to take the index of a BlockData element and return the index in the initialize dict from which to read arguments. This can be provided to overide the default behavior of matching the BlockData index exactly to the index in initialize.

Returns

(ReactionInterrogatorBlock) New instance

class idaes.generic_models.properties.interrogator.reactions_interrogator.ReactionInterrogatorData(*args, **kwargs)[source]

Interrogator Parameter Block Class

This class contains the methods and attributes for recording and displaying the reaction properties requried by the flowsheet.

build()[source]

Callable method for Block construction.

classmethod define_metadata(obj)[source]

Set all the metadata for properties and units.

This method should be implemented by subclasses. In the implementation, they should set information into the object provided as an argument.

Parameters

pcm (PropertyClassMetadata) – Add metadata to this object.

Returns

None

list_models_requiring_property(prop)[source]

Method to list all models in the flowsheet requiring the given property.

Parameters

prop – the property of interest

Returns

A list of unit model names which require prop

list_properties_required_by_model(model)[source]

Method to list all reaction properties required by a given unit model.

Parameters

model – the unit model of interest. Can be given as either a model component or the unit name as a string

Returns

A list of reaction properties required by model

list_required_properties()[source]

Method to list all reaction properties required by the flowsheet.

Parameters

None

Returns

A list of properties required

print_models_requiring_property(prop, ostream=None)[source]

Method to print a summary of the models in the flowsheet requiring a given property.

Parameters
  • prop – the property of interest.

  • ostream – output stream to print to. If not provided will print to sys.stdout

Returns

None

print_properties_required_by_model(model, ostream=None)[source]

Method to print a summary of the reaction properties required by a given unit model.

Parameters
  • model – the unit model of interest.

  • ostream – output stream to print to. If not provided will print to sys.stdout

Returns

None

print_required_properties(ostream=None)[source]

Method to print a summary of the reaction properties required by the flowsheet.

Parameters

ostream – output stream to print to. If not provided will print to sys.stdout

Returns

None