carbatpy.models.coupled.heat_pump_simple ======================================== .. py:module:: carbatpy.models.coupled.heat_pump_simple .. autoapi-nested-parse:: Version for new FlowDevices Changed on 2024-07-18 @author: atakan Attributes ---------- .. autoapisummary:: carbatpy.models.coupled.heat_pump_simple.DEFAULT_DIR carbatpy.models.coupled.heat_pump_simple.DEFAULT_FILE carbatpy.models.coupled.heat_pump_simple.changes_here Classes ------- .. autoapisummary:: carbatpy.models.coupled.heat_pump_simple.HeatPump carbatpy.models.coupled.heat_pump_simple.HpVal Functions --------- .. autoapisummary:: carbatpy.models.coupled.heat_pump_simple.set_fl_state carbatpy.models.coupled.heat_pump_simple.read_hp_results Module Contents --------------- .. py:data:: DEFAULT_DIR :value: '' .. py:data:: DEFAULT_FILE :value: '\\hp-input-dictvariables' .. py:class:: HeatPump(fixed_points, components=None) Bases: :py:obj:`carbatpy.helpers.ser_dict.Serializable` Heat pump class for simple thermodynamic calculations for energy storage Two pairwase storages at two different temperatures are assumed, always starting at room temperature (around 300K). Thus, three fluids are expected: the working fluid, the storage fluid or sink at high temperature (h) and the source storage fluid at low temperature. The minimum and maximum temperatures of all storags are fixed and the heat flow rate to the high-T storage are given. Also, isentropic efficiencies are fixed so far, but they should use a function later. Heat pump class for simple thermodynamic calculations for energy storage storages at two different temperatures, always starting at room temperature (around 300K). The minimum and maximum temperatures aof all storags are fixed and the heat flow rate to the high-T storage are given. Also, isentropic efficiencies. Example for the fixed points: .. code-block:: python fixed_points = {"ETA_S_C": _ETA_S_, "p_low": state_out_evap[1], "p_high": state_in_cond[1], "T_OUT_STORAGE_HOT": _STORAGE_T_OUT_, "h_h_out_sec": state_sec_out[2], "h_h_out_w": state_out_cond[2], "h_l_out_cold": state_cold_out[2], "h_l_out_w": state_out_evap[2], "T_hl": _STORAGE_T_IN_, "T_lh": _STORAGE_T_IN_, "T_OUT_STORAGE_COLD": _COLD_STORAGE_T_OUT_, # 256.0, "Q_DOT_MIN": _Q_DOT_MIN_, 'D_T_MIN': _D_T_MIN_, 'fluids_all': fluids, # see below} :param fluids: working fluid, secondary fluid to store at high T, cold fluid to store at low T [what, species-string, composition-list], what is one of "STORAGE_COLD", "STORAGE_HOT" or "WORKING". :type fluids: list of three lists with three values :param fixed_points: all the fixed points are summarized here, the isentropic efficiency, the lower pressure(evaporator), the high and low temperatures of the high temperature storages, the same for the low temperature storages(source), the heat to be transfered at high T, the minimum approach temperature. :type fixed_points: Dictionary :param components: DESCRIPTION. The default is []. :type components: TYPE, optional :rtype: None. .. py:attribute:: default_path :value: '' .. py:attribute:: default_filename :value: '\\hp-input-dictvariables-hp.json' .. py:attribute:: default_storage_filename :value: '\\hp-input-dictvariables-hp-last.json' .. py:attribute:: fixed_points .. py:attribute:: fluids_all .. py:attribute:: fluids :value: [] .. py:attribute:: all_states :value: [] .. py:attribute:: m_dots :value: [] .. py:attribute:: warning :value: [] .. py:attribute:: evaluation .. py:method:: calculate_hex(fluid_numbers, h_dot_min_, h_out_w_, h_limit_s_=np.nan, points_=50, d_temp_separation_min_=0.5, calc_type_='const', pinch='', name_='evaporator', plot_info={}, verbose_=False) Utility function to calculate the T-h_dot curves and secondary fluid mass flow rates for a heat exchanger. it returns the state of the working fluid at the heat exchanger exit. while :param fluid_numbers: the working fluid index and the secondary fluid index. :type fluid_numbers: list of two integers :param h_dot_min_: wanted heat flow rate [W]. :type h_dot_min_: float :param h_out_w_: specific enthalpy of the working fluid at the exit [J/kg]. :type h_out_w_: float :param h_limit_s_: specific enthalpy of the secondary fluid at the exit [J/kg]. The default is np.NAN. :type h_limit_s_: float, optional :param points_: number of t-h points along the heat exchanger. The default is 50. :type points_: integer, optional :param d_temp_separation_min_: the minimum approach temperature in K. The default is 0.5. :type d_temp_separation_min_: float, optional :param calc_type_: select the calculation type (only one implemented for now). The default is "const". :type calc_type_: string, optional :param pinch: shall a minimization of the mean temperture difference be performed? ""-> no, "secondary"-> output state of secondary fluid will be varied, "working"-> the ouput state of the working fluid will be varied. Default is "" :type pinch: string, optional :param name_: name of the heat exchanger. The default is "evaporator". :type name_: string, optional :param plot_info: if not empty 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. :type plot_info: dictionary, optional :param verbose_: additional printing/plotting. The default is False. :type verbose_: Boolean, optional :returns: **w_after_condenser** -- actual output state of the working fluid [T,p,h,v,s,q]. :rtype: list .. py:method:: calc_heat_pump(plot_info={}, variations=['', ''], verbose=False) calculate a simple compression heat pump working with two sensible storages (or source and sink). At the moment the compressor model is just for a constant isentropic efficiency. An isenthalpic throttle is used for expnsion. The initial states are provided by the Fluid-instances. The pressures have to be selected carefully, they are not tested at the moment. The two desired storage temperatures are an input, and will be varied to meet the desired minmum approach temperatures in the heat exchangers. For optimization, the pressure levels of the cycle could be used within a second script. Several parameters are fixed along a calculation, this is in the dictionary "self.fixed_points". It can turn out that the foreseen evaporator exit temperature of the secondary(cooling) fluid is below the temperature of the isenthalpic temperature of the fluid coming out of the throttle. In this case the secondary exit temperature is increased! :param temps_wanted: the two (high and low) temperatures to store at, may be varied towards the temperature of the surrounding, if the second law of thermodynamics requires this. UNUSED at the moment! :type temps_wanted: np.array([float,float]) :param verbose: should values be printed? The deault is False :type verbose: Boolean, optional :returns: **COP** -- coefficient of performace. :rtype: flaot .. py:method:: hp_plot(f_name=_RESULTS_ + '\\last_T_H_dot_plot_hp') plots the heat pump cycle and stores it to the given file (name) :rtype: None. .. py:function:: set_fl_state(fluid_values, fixed_points, **kwargs) .. py:function:: read_hp_results(filename=_RESULTS_ + '\\last_T_H_dot_plot_hp_evaluation_dict.npy') Reading the evaluation results dictionary of the heat pump :param filename: name of the numpy file. The default is _RESULTS_+"\last_T_H_dot_plot_hp". :type filename: string, optional :returns: **loaded_dict** -- the saved results. :rtype: dictionary .. py:class:: HpVal(variables_dict=None) Bases: :py:obj:`carbatpy.helpers.ser_dict.Serializable` Class to store and read the *input* dictionary values and variables for a heat pump. Best is to set them in a yaml or json file and read them with the appropriate function. The default place to search for hp-input-dictvariables is in the data directory. Part of carbatpy. .. py:attribute:: default_path :value: '' .. py:attribute:: default_filename :value: '\\hp-input-dictvariables.json' .. py:attribute:: default_storage_filename :value: '\\hp-input-dictvariables_last.json' .. py:data:: changes_here :value: False