carbatpy.models.coupled¶
Submodules¶
Attributes¶
Classes¶
Heat pump class for simple thermodynamic calculations for energy storage |
|
Heat pump class for simple thermodynamic calculations for energy storage |
Functions¶
|
read an Excel file with information about the cycle structure and use graphviz |
|
Reading the evaluation results dictionary of the heat pump |
Package Contents¶
- class carbatpy.models.coupled.OrganicRankineCycle(fluids, fixed_points, components=[])[source]¶
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.
- calc_orc(verbose=False)[source]¶
calculate a simple organic rankine cycle (ORC)
working with two sensible storages (or source and sink). At the moment the machine model is just for a constant isentropic efficiency. The initial states are provided by the Fluid-instances. The pressures have to be selected carefully, they are not tested at the moment. 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”.
- Parameters:
verbose (Boolean, optional) – should values be printed? The deault is False
- Returns:
eta_orc – thermal efficiency of ORC.
- Return type:
flaot
- hp_plot(f_name=_RESULTS_ + '\\last_T_H_dot_plot_orc', fig_ax=[])[source]¶
plots the heat pump cycle and stores it to the given file (name)
- Parameters:
f_name (string, optional) – where to write the results and the plot.
fig_ax (list (length 2), optional) – instances with figure and axes to plot into. If Empty a new one will be generated. default =[]
- Return type:
None.
- carbatpy.models.coupled.plot_cycle_structure(fname, dirname=DIRNAME, cycle_name='cycle', format_='png', engine='circo')[source]¶
read an Excel file with information about the cycle structure and use graphviz
for visualization, a file is generated.
- Parameters:
fname (string) – the excel filename.
dirname (string, optional) – the directory name to read the file and to store afterwards. The default is DIRNAME.
cycle_name (string, optional) – name of the cycle. The default is “cyle”.
format (String, optional) – plot-format (png, pdf etc). The default is “png”.
engine (string, optional) – an engine name from graphviz (dot, circo etc.). The default is “circo”.
- Return type:
None.
- class carbatpy.models.coupled.HeatPump(fluids, fixed_points, components=[])[source]¶
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.
- 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_=True)[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.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