# -*- coding: utf-8"""Module for class Sink.This file is part of project TESPy (github.com/oemof/tespy). It's copyrightedby the contributors recorded in the version control history of the file,available from its original location tespy/components/basics/sink.pySPDX-License-Identifier: MIT"""importnumpyasnpfromtespy.components.componentimportComponentfromtespy.components.componentimportcomponent_registry
[docs]@component_registryclassSink(Component):r""" A flow drains in a Sink. Parameters ---------- label : str The label of the component. design : list List containing design parameters (stated as String). offdesign : list List containing offdesign parameters (stated as String). design_path : str Path to the components design case. local_offdesign : boolean Treat this component in offdesign mode in a design calculation. local_design : boolean Treat this component in design mode in an offdesign calculation. char_warnings : boolean Ignore warnings on default characteristics usage for this component. printout : boolean Include this component in the network's results printout. Example ------- Create a sink and specify a label. >>> from tespy.components import Sink >>> si = Sink('a labeled sink') >>> si.component() 'sink' >>> si.label 'a labeled sink' """
[docs]defexergy_balance(self,T0):r"""Exergy balance calculation method of a sink. A sink does not destroy or produce exergy. The value of :math:`\dot{E}_\mathrm{bus}` is set to the exergy of the mass flow to make exergy balancing methods more simple as in general a mass flow can be fuel, product or loss. Parameters ---------- T0 : float Ambient temperature T0 / K. Note ---- .. math:: \dot{E}_\mathrm{bus} = \dot{E}_\mathrm{in}^\mathrm{PH} """self.E_P=np.nanself.E_F=np.nanself.E_bus={"chemical":self.inl[0].Ex_chemical,"physical":self.inl[0].Ex_physical,"massless":0}self.E_D=np.nanself.epsilon=self._calc_epsilon()