HeatUtility#
HeatUtility objects take care of finding utility requirements.
- class HeatUtility(heat_transfer_efficiency=None, unit=None, hxn_ok=False)[source]#
Create an HeatUtility object that can choose a utility stream and calculate utility requirements. It can calculate required flow rate, temperature change, or phase change of utility. Calculations assume counter current flow rate.
- Parameters:
Examples
Create a heat utility:
>>> from biosteam import HeatUtility >>> hu = HeatUtility() >>> hu.show() HeatUtility: None duty: 0 flow: 0 cost: 0
Calculate utility requirement by calling it with a duty (kJ/hr), and entrance and exit temperature (K):
>>> hu(1000, 300, 350) >>> hu.show() HeatUtility: low_pressure_steam duty: 1.05e+03 kJ/hr flow: 0.0272 kmol/hr cost: 0.00647 USD/hr
All results are accessible:
>>> hu.ID, hu.duty, hu.flow, hu.cost ('low_pressure_steam', 1052.6315789473686, 0.02721274387089031, 0.006471190492497716)
All results are accessible:
>>> hu.ID, hu.duty, hu.flow, hu.cost ('low_pressure_steam', 1052.6315789473686, 0.02721274387089031, 0.006471190492497716)
-
dT:
float
= 5# Minimum approach temperature difference. Used to assign the pinch temperature of the utility stream.
- display_units: Display:py:class:`~biosteam.Unit`s = DisplayUnits(duty='kJ/hr', flow='kmol/hr', cost='USD/hr')#
Units of measure for IPython display.
-
thermo_water:
Thermo
= Thermo(chemicals=CompiledChemicals([Water]), mixture=IdealMixture(..., include_excess_energies=False), Gamma=DortmundActivityCoefficients, Phi=IdealFugacityCoefficients, PCF=MockPoyintingCorrectionFactors)# Used broadly throughout utilities.
-
thermo_propane:
Thermo
= Thermo(chemicals=CompiledChemicals([Propane]), mixture=IdealMixture(..., include_excess_energies=False), Gamma=DortmundActivityCoefficients, Phi=IdealFugacityCoefficients, PCF=MockPoyintingCorrectionFactors)# Used for refrigeration utility.
-
thermo_propylene:
Thermo
= Thermo(chemicals=CompiledChemicals([Propylene]), mixture=IdealMixture(..., include_excess_energies=False), Gamma=DortmundActivityCoefficients, Phi=IdealFugacityCoefficients, PCF=MockPoyintingCorrectionFactors)# Used for refrigeration utility.
-
thermo_ethylene:
Thermo
= Thermo(chemicals=CompiledChemicals([Ethylene]), mixture=IdealMixture(..., include_excess_energies=False), Gamma=DortmundActivityCoefficients, Phi=IdealFugacityCoefficients, PCF=MockPoyintingCorrectionFactors)# Used for refrigeration utility.
-
thermo_natural_gas:
Thermo
= Thermo(chemicals=CompiledChemicals([Methane, N2, CO2, O2, H2O]), mixture=IdealMixture(..., include_excess_energies=False), Gamma=DortmundActivityCoefficients, Phi=IdealFugacityCoefficients, PCF=MockPoyintingCorrectionFactors)# Used exclusively for furnaces.
-
characterization_factors:
dict
[tuple
[str
,str
],tuple
[float
, Absolute:py:class:`~biosteam.Unit`sOfMeasure]] = {}# Characterization factor data (value and units) by agent ID and impact key.
-
cooling_agents:
list
[UtilityAgent] = [<UtilityAgent: cooling_water>, <UtilityAgent: chilled_water>, <UtilityAgent: chilled_brine>, <UtilityAgent: propane>, <UtilityAgent: propylene>, <UtilityAgent: ethylene>]# All cooling utilities available.
-
heating_agents:
list
[UtilityAgent] = [<UtilityAgent: low_pressure_steam>, <UtilityAgent: medium_pressure_steam>, <UtilityAgent: high_pressure_steam>, <UtilityAgent: natural_gas>]# All heating utilities available.
- classmethod set_CF(ID, key, value, basis=None, units=None)[source]#
Set the characterization factor of a utility agent for a given impact key.
- Parameters:
ID (
str
) – ID of utility agent.key (
str
) – Key of impact indicator.value (
float
) – Characterization factor value.basis (
str
, optional) – Basis of characterization factor. Valid dimensions include weight, molar, and energy (e.g. ‘kg’, ‘kmol’, ‘kJ’). Defaults to ‘kg’.units (
str
, optional) – Units of impact indicator. Before using this argument, the default units of the impact indicator should be defined withsettings.define_impact_indicator
. Units must also be dimensionally consistent with the default units.
- Raises:
ValueError – When the duty characterization factor for a cooling agent is positive (should be negative).
DimensionError – When characterization factor is not given in dimensions of weight, molar, or energy.
See also
Examples
Set the GWP characterization factor for low pressure steam at 88.44 kg CO2e / mmBtu (GREET 2020; Steam Production via Small Boiler from North American Natural Gas):
>>> import biosteam as bst >>> bst.HeatUtility.set_CF('low_pressure_steam', 'GWP [kg CO2e]', 88.44, basis='MMBtu')
Retrieve the GWP characterization factor for low pressure steam on a Btu basis:
>>> bst.HeatUtility.get_CF('low_pressure_steam', 'GWP [kg CO2e]', basis='Btu') 8.844e-05
- classmethod get_CF(ID, key, basis=None, units=None)[source]#
Return the characterization factor of a utility agent for a given impact key.
- Parameters:
ID (
str
) – ID of utility agent.key (
str
) – Key of impact indicator.basis (
str
, optional) – Basis of characterization factor. Valid dimensions include weight, molar, and energy (e.g. ‘kg’, ‘kmol’, ‘kJ’). Defaults to ‘kg’.units (
str
, optional) – Units of impact indicator. Before using this argument, the default units of the impact indicator should be defined withsettings.define_impact_indicator
. Units must also be dimensionally consistent with the default units.
- Raises:
DimensionalityError – When the characterization factor cannot be converted to the given basis due to inconsistent dimensions with the original basis.
See also
-
heat_transfer_efficiency:
float
# Enforced fraction of heat transferred from utility (due to losses to environment).
- agent: UtilityAgent | None#
Utility agent being used.
- __call__(unit_duty, T_in, T_out=None, agent=None)[source]#
Calculate utility requirements given the essential parameters.
- Parameters:
unit_duty (
float
) – Unit duty requirement [kJ/hr]T_in (
float
) – Inlet process stream temperature [K]T_out (
float
, optional) – Outlet process stream temperature [K]agent (
UtilityAgent
, optional) – Utility agent to use. Defaults to a suitable agent from predefined heating/cooling utility agents.
- property inlet_process_stream: Stream#
If a heat exchanger is available, this stream is the inlet process stream to the heat exchanger.
- property outlet_process_stream: Stream#
If a heat exchanger is available, this stream is the outlet process stream to the heat exchanger.
- static heat_utilities_by_agent(heat_utilities)[source]#
Return a dictionary of heat utilities sorted by agent ID.
- classmethod sum(heat_utilities)[source]#
Return a HeatUtility object that reflects the sum of heat utilities.
- classmethod sum_by_agent(heat_utilities)[source]#
Return a list of heat utilities that reflect the sum of heat utilities by agent.
- classmethod get_suitable_heating_agent(T_pinch)[source]#
Return a heating agent that works at the pinch temperature.
- Parameters:
T_pinch (
float
) – Pinch temperature [K].
- classmethod get_suitable_cooling_agent(T_pinch)[source]#
Return a cooling agent that works at the pinch temperature.
- Parameters:
T_pinch (
float
) – Pinch temperature [K].
- reverse()[source]#
Reverse direction of utility. If utility is being consumed, the utility is produced instead, and vice-versa.
- static get_outlet_temperature(T_pinch, T_limit, iscooling)[source]#
Return outlet temperature of the utility in a counter current heat exchanger
- classmethod get_inlet_and_outlet_pinch_temperature(iscooling, T_in, T_out)[source]#
Return pinch inlet and outlet temperature of utility.
- get_property(name, units=None)#
Return property in requested units.
- set_property(name, value, units=None)#
Set property in given units.