Flowsheet#

class Flowsheet(ID)[source]#

Create a Flowsheet object which stores references to all stream, unit, and system objects. For a tutorial on flowsheets, visit Managing flowsheets.

flowsheet: FlowsheetRegistry = <FlowsheetRegistry: default>#

All flowsheets.

temporary()[source]#

Return a TemporaryFlowsheet object that, through context management, will temporarily register all objects in this flowsheet instead of the main flowsheet.

Examples

>>> import biosteam as bst
>>> bst.settings.set_thermo(['Water'], cache=True)
>>> f = bst.Flowsheet('f')
>>> with f.temporary():
...     M1 = bst.Mixer('M1')
>>> M1 in bst.main_flowsheet.unit
False
>>> M1 in f.unit
True
classmethod from_flowsheets(ID, flowsheets)[source]#

Return a new flowsheet with all registered objects from the given flowsheets.

diagram(kind=None, file=None, format=None, display=True, number=None, profile=None, label=None, title=None, **graph_attrs)[source]#

Display a Graphviz diagram of all unit operations.

Parameters:
  • kind (int | str, optional) –

    • 0 or ‘cluster’: Display all units clustered by system.

    • 1 or ‘thorough’: Display every unit within the path.

    • 2 or ‘surface’: Display only elements listed in the path.

    • 3 or ‘minimal’: Display a single box representing all units.

  • file (str, optional) – File name to save diagram.

  • format (str, optional) – File format (e.g. “png”, “svg”). Defaults to ‘png’

  • display (bool, optional) – Whether to display diagram in console or to return the graphviz object.

  • number (bool, optional) – Whether to number unit operations according to their order in the system path.

  • profile (bool, optional) – Whether to clock the simulation time of unit operations.

  • label (bool, optional) – Whether to label the ID of streams with sources and sinks.

create_system(ID='', ends=None, facility_recycle=None, operating_hours=None, **kwargs)[source]#

Create a System object from all units and streams defined in the flowsheet.

Parameters:
  • ID (str, optional) – Name of system.

  • ends (Stream], optional) – End streams of the system which are not products. Specify this argument if only a section of the complete system is wanted, or if recycle streams should be ignored.

  • facility_recycle (Stream, optional) – Recycle stream between facilities and system path. This argument defaults to the outlet of a BlowdownMixer facility (if any).

  • operating_hours (float, optional) – Number of operating hours in a year. This parameter is used to compute annualized properties such as utility cost and material cost on a per year basis.

__call__(ID, strict=False)[source]#

Return requested biosteam item or a list of all matching items.

Parameters:
  • ID (str | type[Unit]) – ID of the requested item or Unit subclass.

  • strict (bool, optional) – Whether an exact match is required.