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). class to calculate (static/steady state) heat-exchangers includes pinch-point analysis and plotting, only implemented for simple thermodynamic calculations (no convection coefficients and heat exchanger areas regarded yet) :param fluids: The definition of the two fluids, as they enter the heat exchangers. Typically at room temperature. :type fluids: list of 2 fprop.Fluid :param h_dot_min: enthalpy flow rate (W) which has to be transfered. :type h_dot_min: float :param h_out_w: exit enthalpy of the working fluid. :type h_out_w: float :param h_limit_s: if there is a limit in enthalpy for the secondary fluid, it can be given here. It is also a starting value for possible iterations. :type h_limit_s: float, :param kwargs: Optional parameters for the heat exchanger configuration: - points : int, for how many points (array) shall the minimum approach temperature be checked and properties be returned (for plotting etc.). default 50 - d_temp_separation_min : float, Minimium approach temperature ( pinch point) between the two fluids. default 0.5 - calc_type : str, which calculation type shall be performed; only one implemented so far, default "const" - name : str, name of the heat exchanger .default "evaporator" - plot_info : dict, if not None, a Figure, an Axes, a list of What shall be plotted, a list with the colour/styles and a list with the labels must be passed. in "what", the two numbers coincide with the fluid THERMO order. The x-shift can be used in cycle calculations, to shift the curves, by the value (it will be added). The names in the dictionary are: "fig", "ax", "what","col", "label", "x-shift". Default is empty.default {} :type kwargs: dict, optional :rtype: None. .. py:attribute:: fluids .. py:attribute:: m_dot_s :value: 0 .. py:attribute:: h_limit_s .. py:attribute:: q_dot .. py:attribute:: m_dot_w .. py:attribute:: h_out_w .. py:attribute:: h_out_s .. py:attribute:: points .. py:attribute:: d_temp_separation_min .. py:attribute:: calc_type .. py:attribute:: name .. py:property:: plot_info .. py:attribute:: heating :value: -1 .. py:attribute:: all_states .. py:attribute:: h_in_out .. py:attribute:: dt_mean :value: None .. py:attribute:: dt_min :value: None .. py:attribute:: dt_max :value: None .. py:attribute:: warning :value: 0 .. py:attribute:: warning_message :value: 'All o.k.' .. py:property:: all .. py:method:: to_dict() .. py:method:: from_dict_old(data) :classmethod: .. py:method:: save_to_file(file_path) .. py:method:: load_from_file(file_path) :classmethod: .. py:method:: from_dict(input_hex, exchanger_name='condenser', temp_ambient=None, **kwargs) :classmethod: .. 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:: opti_hex_p_pinch(secondary=True) Varies fluid pressure to reach the minimum approach temperature. The function adjusts the pressure (and consequently the mass flow rate) until the specified minimum approach temperature is achieved. This defines the new exit state within the heat exchanger. If no solution is found, `self.warning` is set to 1. :param secondary: Determines which fluid's output state is varied. If True, the secondary fluid is adjusted; if False, the working fluid is adjusted. The default is True. :type secondary: bool, optional :returns: **h_opt** -- The optimized enthalpy of the secondary (or working) fluid in J/kg. :rtype: float .. rubric:: Notes Check the `warning` attribute of the component after execution to ensure the optimization converged. .. py:method:: find_pinch(secondary=True, verbose=False) 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, **kwargs) 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:data:: FLUID :value: 'Propane * Pentane'