utils#

rename_unit(unit, area)[source]#

Rename unit according to area convention.

Parameters:

Notes

The area convention follows “{letter}{area + number}” where the letter depends on the unit operation as follows:

  • C = Centrifuge

  • D = Distillation column

  • E = Evaporator

  • F = Flash tank

  • H = Heat exchange

  • K = Compressor

  • Ʞ = Turbine

  • M = Mixer

  • P = Pump (including conveying belt)

  • R = Reactor

  • S = Splitter (including solid/liquid separator)

  • T = Tank or bin for storage

  • U = Other units

  • V = Valve

  • J = Junction, not a physical unit (serves to adjust streams)

  • PS = Process specificiation, not a physical unit (serves to adjust streams)

Examples

>>> from biosteam import *
>>> main_flowsheet.clear() # Remove any previous data
>>> settings.set_thermo(['Water', 'Ethanol'], cache=True)
>>> M1 = Mixer('M1')
>>> rename_unit(M1, 200)
>>> print(M1)
M201
rename_units(units, area)[source]#

Rename units according to area convention.

Parameters:

Notes

The area convention follows “{letter}{area + number}” where the letter depends on the unit operation as follows:

  • C = Centrifuge

  • D = Distillation column

  • E = Evaporator

  • F = Flash tank

  • H = Heat exchange

  • K = Compressor

  • M = Mixer

  • P = Pump (including conveying belt)

  • R = Reactor

  • S = Splitter (including solid/liquid separator)

  • T = Tank or bin for storage

  • U = Other units

  • J = Junction, not a physical unit (serves to adjust streams)

  • PS = Process specificiation, not a physical unit (serves to adjust streams)

Examples

>>> from biosteam import *
>>> main_flowsheet.clear() # Remove any previous data
>>> settings.set_thermo(['Water', 'Ethanol'], cache=True)
>>> units = [Mixer(),
...          Mixer(),
...          ShortcutColumn(LHK=['Ethanol', 'Water'], k=1.2, Lr=0.8, Hr=0.9),
...          Flash(P=101325, V=0.5),
...          Pump(),
...          Splitter(split=0.5),
...          MixTank(),
...          StorageTank(),
...          MultiEffectEvaporator(P=[101325, 9e4], V=0.5)]
>>> rename_units(units, 200)
>>> units
[<Mixer: M201>, <Mixer: M202>, <ShortcutColumn: D201>, <Flash: F201>, <Pump: P201>, <Splitter: S201>, <MixTank: T201>, <StorageTank: T202>, <MultiEffectEvaporator: E201>]
>>> # ID conflicts are taken care of internally
>>> mixer, *other_units = units
>>> rename_units(other_units, 200)
>>> units
[<Mixer: M201>, <Mixer: M202>, <ShortcutColumn: D201>, <Flash: F201>, <Pump: P201>, <Splitter: S201>, <MixTank: T201>, <StorageTank: T202>, <MultiEffectEvaporator: E201>]
group_by_area(units)[source]#

Create a dictionary containing lists of UnitGroup objects by area.

heat_exchanger_utilities_from_units(units)[source]#

Return a list of heat utilities from all heat exchangers, including the condensers and boilers of distillation columns and flash vessel heat exchangers.

units_with_costs(units)[source]#

Filter units that have a cost or design method.

units_with_heat_exchangers(units)[source]#

Return a list of units with heat exchangers.

get_utility_flow(heat_utilities, agent)[source]#

Return the total utility duty of heat utilities for given agent in GJ/hr

get_utility_duty(heat_utilities, agent)[source]#

Return the total utility duty of heat utilities for given agent in GJ/hr

get_power_utilities(units)[source]#

Return a list of all PowerUtility objects.

get_heat_utilities(units)[source]#

Return a list of all HeatUtility objects.

get_purchase_cost(units)[source]#

Return the total equipment purchase cost of all units in million USD.

get_installed_cost(units)[source]#

Return the total installed equipment cost of all units in million USD.

get_cooling_duty(heat_utilities, filter_savings=True)[source]#

Return the total cooling duty of all heat utilities in GJ/hr.

get_heating_duty(heat_utilities, filter_savings=True)[source]#

Return the total heating duty of all heat utilities in GJ/hr.

get_electricity_consumption(power_utilities)[source]#

Return the total electricity consumption of all PowerUtility objects in MW.

get_electricity_production(power_utilities)[source]#

Return the total electricity production of all PowerUtility objects in MW.

get_tea_results(tea, product=None, feedstock=None)[source]#

Return a dictionary with general TEA results.

group_by_lines(units)[source]#

Return a dictionary of lists of units grouped by line.

group_by_types(units)[source]#

Return a dictionary of lists of units grouped by type.

filter_by_types(units, types)[source]#

Filter units by type(s).

filter_by_lines(units, lines)[source]#

Filter units by line(s).

volume_of_chemical_in_units(units, chemical)[source]#

Return volume of chemical that is occupied in given units [m^3].

set_construction_material(units, pressure_vessel_material, tray_material, tank_material, heat_exchanger_material, pump_material)[source]#

Set the construction material of all vessels, columns, trays, heat exchangers, and pumps

Parameters:
  • units (Iterable[Unit]) – Unit operations to set construction material.

  • pressure_vessel_material (str) – Construction material for pressure vessels (includes distillation columns and flash vessels).

  • tray_material (str) – Construction material for column trays.

  • tank_material (str) – Construction material for tanks.

  • pump_material (str) – Construction material for pumps.

set_construction_material_to_stainless_steel(units, kind='304')[source]#

Set the construction material of all vessels, columns, trays, heat exchangers, and pumps to stainless steel.

Parameters:

kind (str, "304" or "316") – Type of stainless steel.

set_construction_material_to_carbon_steel(units)[source]#

Set the construction material of all vessels, columns, trays, heat exchangers, and pumps to carbon steel or cast iron.

get_OSBL(units)[source]#

Return a list of unit operations that would typically be classified as out-of-boundary-limits, just as storage tanks, cooling towers, and other facilities.

heat_exchanger_operation(units)[source]#

Return a pandas DataFrame object of the capacity flow rate, inlet temperature, and outlet temperature of all heat exchangers associated to the given units.

connect_by_ID(units)[source]#

Connect unit inlets and outlets where streams have the same ID.

default_utilities()[source]#

Reset utilities back to BioSTEAM’s defaults.

default(utilities=True, CEPCI=True, flowsheet=False)[source]#

Reset utilities, flowsheets, and chemical plant cost index (CEPCI) back to BioSTEAM’s defaults (if requested).