carbatpy.models.coupled.heat_pump_simple
Version for new FlowDevices
Changed on 2024-07-18
@author: atakan
Attributes
Classes
Heat pump class for simple thermodynamic calculations for energy storage |
|
Class to store and read the input dictionary values and variables for a heat pump. |
Functions
|
|
|
Reading the evaluation results dictionary of the heat pump |
Module Contents
- class carbatpy.models.coupled.heat_pump_simple.HeatPump(fixed_points, components=None)[source]
Bases:
carbatpy.helpers.ser_dict.SerializableHeat 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:
- 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}
- Parameters:
fluids (list of three lists with three values) – 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”.
fixed_points (Dictionary) – 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.
components (TYPE, optional) – DESCRIPTION. The default is [].
- Return type:
None.
- 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)[source]
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
- Parameters:
fluid_numbers (list of two integers) – the working fluid index and the secondary fluid index.
h_dot_min (float) – wanted heat flow rate [W].
h_out_w (float) – specific enthalpy of the working fluid at the exit [J/kg].
h_limit_s (float, optional) – specific enthalpy of the secondary fluid at the exit [J/kg]. The default is np.NAN.
points (integer, optional) – number of t-h points along the heat exchanger. The default is 50.
d_temp_separation_min (float, optional) – the minimum approach temperature in K. The default is 0.5.
calc_type (string, optional) – select the calculation type (only one implemented for now). The default is “const”.
pinch (string, optional) – 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 “”
name (string, optional) – name of the heat exchanger. The default is “evaporator”.
plot_info (dictionary, optional) – 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.
verbose (Boolean, optional) – additional printing/plotting. The default is False.
- Returns:
w_after_condenser – actual output state of the working fluid [T,p,h,v,s,q].
- Return type:
list
- calc_heat_pump(plot_info={}, variations=['', ''], verbose=False)[source]
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!
- Parameters:
temps_wanted (np.array([float,float])) – 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!
verbose (Boolean, optional) – should values be printed? The deault is False
- Returns:
COP – coefficient of performace.
- Return type:
flaot
- carbatpy.models.coupled.heat_pump_simple.set_fl_state(fluid_values, fixed_points, **kwargs)[source]
- carbatpy.models.coupled.heat_pump_simple.read_hp_results(filename=_RESULTS_ + '\\last_T_H_dot_plot_hp_evaluation_dict.npy')[source]
Reading the evaluation results dictionary of the heat pump
- Parameters:
filename (string, optional) – name of the numpy file. The default is _RESULTS_+”last_T_H_dot_plot_hp”.
- Returns:
loaded_dict – the saved results.
- Return type:
dictionary
- class carbatpy.models.coupled.heat_pump_simple.HpVal(variables_dict=None)[source]
Bases:
carbatpy.helpers.ser_dict.SerializableClass 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.