Skip to content

Commit 830d7fc

Browse files
committed
add water usage indicator and minor edits
1 parent d0b7d1e commit 830d7fc

File tree

2 files changed

+6
-36
lines changed

2 files changed

+6
-36
lines changed

thermosteam/_settings.py

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -174,41 +174,6 @@ def mixture(self) -> tmo.Mixture:
174174
"""Default mixture package."""
175175
return self.thermo.mixture
176176

177-
def define_impact_indicator(self, key: str, units: str):
178-
"""
179-
Define the units of measure for an LCA impact indicator key.
180-
181-
Parameters
182-
----------
183-
key :
184-
Name of impact indicator.
185-
units :
186-
Units of measure for impact indicator.
187-
188-
Notes
189-
-----
190-
This method is useful for setting characterization factors of
191-
streams and utilities in different units of measure.
192-
193-
LCA displacement allocation tables also use the impact indicator
194-
units of measure defined here.
195-
196-
Examples
197-
--------
198-
:doc:`../tutorial/Life_cycle_assessment`
199-
200-
"""
201-
self.impact_indicators[key] = UnitsOfMeasure(units)
202-
203-
def get_impact_indicator_units(self, key):
204-
try:
205-
return tmo.settings.impact_indicators[key]
206-
except KeyError:
207-
raise ValueError(
208-
f"impact indicator key '{key}' has no defined units; "
209-
"units can be defined through `settings.define_impact_indicator`"
210-
)
211-
212177
def get_default_thermo(self, thermo):
213178
"""
214179
Return the default :class:`~thermosteam.Thermo` object if `thermo` is None.

thermosteam/_stream.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,12 @@ def set_CF(self, key: str, value: float, basis: Optional[str] = None, units: Opt
667667
def get_impact(self, key):
668668
"""Return hourly rate of the impact indicator given the key."""
669669
cfs = self.characterization_factors
670-
return cfs[key] * self.F_mass if key in cfs else 0.
670+
if key in cfs:
671+
return cfs[key] * self.F_mass
672+
elif key == 'WU' and self.sink:
673+
return self.imass['Water']
674+
else:
675+
return 0.
671676

672677
def empty_negative_flows(self):
673678
"""

0 commit comments

Comments
 (0)