Physical Property Package Classes

Physical property packages represent a collection of calculations necessary to determine the state properties of a given material. Property calculations form a critical part of any process model, and thus property packages form the core of the IDAES modeling framework.

Physical property packages consist of two parts:

  • PhysicalParameterBlocks, which contain a set of parameters associated with the specific material(s) being modeled, and

  • StateBlocks, which contain the actual calculations of the state variables and functions.

Physical Parameter Blocks

Physical Parameter blocks serve as a central location for linking to a property package, and contain all the parameters and indexing sets used by a given property package.

PhysicalParameterBlock Class

The role of the PhysicalParameterBlock class is to set up the references required by the rest of the IDAES framework for constructing instances of StateBlocks and attaching these to the PhysicalParameter block for ease of use. This allows other models to be pointed to the PhysicalParameter block in order to collect the necessary information and to construct the necessary StateBlocks without the need for the user to do this manually.

Physical property packages form the core of any process model in the IDAES modeling framework, and are used by all of the other modeling components to inform them of what needs to be constructed. In order to do this, the IDAES modeling framework looks for a number of attributes in the PhysicalParameter block which are used to inform the construction of other components.

  • state_block_class - a pointer to the associated class that should be called when constructing StateBlocks. This should only be set by the property package developer.

  • phase_list - a Pyomo Set object defining the valid phases of the mixture of interest.

  • component_list - a Pyomo Set defining the names of the chemical species present in the mixture.

  • element_list - (optional) a Pyomo Set defining the names of the chemical elements that make up the species within the mixture. This is used when doing elemental material balances.

  • element_comp - (optional) a dict-like object which defines the elemental composition of each species in component_list. Form: component: {element_1: value, element_2: value, …}.

  • supported properties metadata - a list of supported physical properties that the property package supports, along with instruction to the framework on how to construct the associated variables and constraints, and the units of measurement used for the property. This information is set using the add_properties attribute of the define_metadata class method.

Physical Parameter Configuration Arguments

Physical Parameter blocks have one standard configuration argument:

  • default_arguments - this allows the user to provide a set of default values for construction arguments in associated StateBlocks, which will be passed to all StateBlocks when they are constructed.

class idaes.core.property_base.PhysicalParameterBlock(component)[source]

This is the base class for thermophysical parameter blocks. These are blocks that contain a set of parameters associated with a specific thermophysical property package, and are linked to by all instances of that property package.

build()[source]

General build method for PropertyParameterBlocks. Inheriting models should call super().build.

Parameters

None

Returns

None

build_state_block(*args, **kwargs)[source]

Methods to construct a StateBlock assoicated with this PhysicalParameterBlock. This will automatically set the parameters construction argument for the StateBlock.

Returns

StateBlock

get_component(comp)[source]

Method to retrieve a Component object based on a name from the component_list.

Parameters

comp – name of Component object to retrieve

Returns

Component object

get_default_scaling(attrbute, index=None)[source]

Returns a default scale factor for a property

Parameters
  • attribute – property attribute name

  • index – optional index for indexed properties

Returns

None

get_phase(phase)[source]

Method to retrieve a Phase object based on a name from the phase_list.

Parameters

phase – name of Phase object to retrieve

Returns

Phase object

get_phase_component_set()[source]

Method to get phase-component set for property package. If a phase- component set has not been constructed yet, this method will construct one.

Parameters

None

Returns

Phase-Component Set object

set_default_scaling(attrbute, value, index=None)[source]

Set a default scaling factor for a property.

Parameters
  • attribute – property attribute name

  • value – default scaling factor

  • index – for indexed properties, if this is not provied the scaling factor default applies to all indexed elements where specific indexes are no specifcally specified.

Returns

None

unset_default_scaling(attrbute, index=None)[source]

Remove a previously set default value

Parameters
  • attribute – property attribute name

  • index – optional index for indexed properties

Returns

None

State Blocks

State Blocks are used within all IDAES Unit models (generally within ControlVolume Blocks) in order to calculate physical properties given the state of the material. State Blocks are notably different to other types of Blocks within IDAES as they are always indexed by time (and possibly space as well). There are two base Classes associated with State Blocks:

  • StateBlockData forms the base class for all StateBlockData objects, which contain the instructions on how to construct each instance of a State Block.

  • StateBlock is used for building classes which contain methods to be applied to sets of Indexed State Blocks (or to a subset of these). See the documentation on declare_process_block_class and the IDAES tutorials and examples for more information.

State Block Construction Arguments

State Blocks have the following construction arguments:

  • parameters - a reference to the associated Physical Parameter block which will be used to make references to all necessary parameters.

  • defined_state - this argument indicates whether the State Block should expect the material state to be fully defined by another part of the flowsheet (such as by an upstream unit operation). This argument is used to determine whether constraints such as sums of mole fractions should be enforced.

  • has_phase_equilibrium - indicates whether the associated Control Volume or Unit model expects phase equilibrium to be enforced (if applicable).

Constructing State Blocks

State Blocks can be constructed directly from the associated Physical Parameter Block by calling the build_state_block() method on the Physical Parameter Block. The parameters construction argument will be automatically set, and any other arguments (including indexing sets) may be provided to the build_state_block method as ususal.

StateBlockData Class

StateBlockData contains the code necessary for implementing the as needed construction of variables and constraints.

class idaes.core.property_base.StateBlockData(*args, **kwargs)[source]

This is the base class for state block data objects. These are blocks that contain the Pyomo components associated with calculating a set of thermophysical and transport properties for a given material.

build()[source]

General build method for StateBlockDatas.

Parameters

None

Returns

None

calculate_bubble_point_pressure(*args, **kwargs)[source]

Method which computes the bubble point pressure for a multi- component mixture given a temperature and mole fraction.

calculate_bubble_point_temperature(*args, **kwargs)[source]

Method which computes the bubble point temperature for a multi- component mixture given a pressure and mole fraction.

calculate_dew_point_pressure(*args, **kwargs)[source]

Method which computes the dew point pressure for a multi- component mixture given a temperature and mole fraction.

calculate_dew_point_temperature(*args, **kwargs)[source]

Method which computes the dew point temperature for a multi- component mixture given a pressure and mole fraction.

define_display_vars()[source]

Method used to specify components to use to generate stream tables and other outputs. Defaults to define_state_vars, and developers should overload as required.

define_port_members()[source]

Method used to specify components to populate Ports with. Defaults to define_state_vars, and developers should overload as required.

define_state_vars()[source]

Method that returns a dictionary of state variables used in property package. Implement a placeholder method which returns an Exception to force users to overload this.

get_energy_density_terms(*args, **kwargs)[source]

Method which returns a valid expression for enthalpy density to use in the energy balances.

get_energy_diffusion_terms(*args, **kwargs)[source]

Method which returns a valid expression for energy diffusion to use in the energy balances.

get_enthalpy_flow_terms(*args, **kwargs)[source]

Method which returns a valid expression for enthalpy flow to use in the energy balances.

get_material_density_terms(*args, **kwargs)[source]

Method which returns a valid expression for material density to use in the material balances .

get_material_diffusion_terms(*args, **kwargs)[source]

Method which returns a valid expression for material diffusion to use in the material balances.

get_material_flow_basis(*args, **kwargs)[source]

Method which returns an Enum indicating the basis of the material flow term.

get_material_flow_terms(*args, **kwargs)[source]

Method which returns a valid expression for material flow to use in the material balances.

is_property_constructed(attr)[source]

Returns True if the attribute attr already exists, or false if it would be added in __getattr__, or does not exist.

Parameters

attr (str) – Attribute name to check

Returns

True if the attribute is already constructed, False otherwise

lock_attribute_creation_context()[source]

Returns a context manager that does not allow attributes to be created while in the context and allows attributes to be created normally outside the context.

StateBlock Class

class idaes.core.property_base.StateBlock(*args, **kwds)[source]

This is the base class for state block objects. These are used when constructing the SimpleBlock or IndexedBlock which will contain the PropertyData objects, and contains methods that can be applied to multiple StateBlockData objects simultaneously.

initialize(*args, **kwargs)[source]

This is a default initialization routine for StateBlocks to ensure that a routine is present. All StateBlockData classes should overload this method with one suited to the particular property package

Parameters

None

Returns

None

report(index=0, true_state=False, dof=False, ostream=None, prefix='')[source]

Default report method for StateBlocks. Returns a Block report populated with either the display or state variables defined in the StateBlockData class.

Parameters
  • index – tuple of Block indices indicating which point in time (and space if applicable) to report state at.

  • true_state – whether to report the display variables (False default) or the actual state variables (True)

  • dof – whether to show local degrees of freedom in the report (default=False)

  • ostream – output stream to write report to

  • prefix – string to append to the beginning of all output lines

Returns

Printed output to ostream