carbatpy.models.components.heat_exchanger_thermo_v2 =================================================== .. py:module:: carbatpy.models.components.heat_exchanger_thermo_v2 .. autoapi-nested-parse:: Created on Sun May 21 08:51:33 2023 @author: atakan Attributes ---------- .. autoapisummary:: carbatpy.models.components.heat_exchanger_thermo_v2.FLUID Classes ------- .. autoapisummary:: carbatpy.models.components.heat_exchanger_thermo_v2.StaticHeatExchanger Module Contents --------------- .. py:class:: StaticHeatExchanger(fluids, h_dot_min, h_out_w, h_limit_s, **kwargs) Class for static counter-flow heat exchanger means: no time dependence and no heat transfer coefficients * areas are used (UA)! Instead a minimum approach temperature is tried to be met. At the moment, this is mainly done by varying one of the mass flow rates. But this is sometimes not enough and a variation of the working fluid pressure will soon be included. Only the first law and second law will be checked (the latter must be improved). .. py:property:: plot_info .. py:method:: pinch_calc(verbose=False) Calculate the changes in enthalpy and temperature in the heat exchanger counter-flow hex assumed! Both flows are isobaric. Is used to check, whether the second law is violated. The factor can be used to vary the mass flow rate of the working fluid, until no violation is found (done in root finding). :param verbose: if True, several variables will be printed out. Default is False. :type verbose: boolean, optional :raises Exception: if temperatures are not consistent. :returns: * **m_dot_s** (*float*) -- secondary fluid mass flow rate (kg/s. * **d_tempall** (*numpy-array*) -- The temperature differences along the counter-flow heat exchanger. * **w_array** (*array*) -- properties of the working fluid along the heat exchanger (T,p,h, etc. see fluid class). * **s_array** (*array*) -- properties of the secondary fluid along the heat exchanger (T,p,h, etc. see fluid class). .. py:method:: pinch_root(h_out_s, secondary, verbose=False) Function for finding the minimum mean temperature difference in a heat exchanger, while not going below the minimum approach temperature. The output enthalpy of the secondary fluid is set (as default) and the heat exchanger is evaluated. :param h_out_s: the output enthalpy, default would be of the secondary fluid. :type h_out_s: float :param secondary: shall the secondary fluid output be varied (or the working fluid)? :type secondary: boolean :returns: root tries to reach a value of 0. :rtype: mean T-difference, float .. py:method:: find_pinch(secondary=True) Function tries to vary the secondary fluid enthalpy until a minimum approach temperature is reached. This also changes the mass flow rate. This is then also the new exit state within the heat exchanger. If this is also not succesful, self.warning is set to 1. This should be checked. :param secondary: shall the output state of the secondary (True) or the working (False) fluid be varied? default = True :type secondary: Boolean, optional :returns: the optimized enthalpy of the secondary fluid. :rtype: float .. py:method:: pinch_plot(plot_fname='', plotting=True) calculates the secondary fluid output state and mass flow, for the minimum approach temperature of the HeatExchanger instance. When wanted, this is also plotted :param plot_fname: file-name to store the plot. The default is "". :type plot_fname: string, optional :param plotting: should it be plotted? The default is True. :type plotting: Boolean, optional :returns: * **m_dot_s** (*float*) -- mass flow raete of the secondary fluid in SI units (kg/s). * **d_tempall** (*np.array*) -- the temperature differences between the two fluids along the heat exchanger. * **w_array** (*np.array [self.points, 7]*) -- the states of the working fluid along the heat exchanger. * **s_array** (*np.array [self.points, 7]*) -- the states of the secondary fluid along the heat exchanger. .. py:method:: _calculate_state_array(fluid, h_range) .. py:method:: _check_temperature_consistency(d_tempall) .. py:method:: _plot_heat_exchanger(w_array, s_array) .. py:method:: _print_verbose(d_tempall) .. py:method:: _handle_exception(e) .. py:data:: FLUID :value: 'Propane * Pentane'