carbatpy.models.components.heat_exchanger_thermo_v2
Created on Sun May 21 08:51:33 2023
@author: atakan
Attributes
Classes
Class for static counter-flow heat exchanger |
Module Contents
- class carbatpy.models.components.heat_exchanger_thermo_v2.StaticHeatExchanger(fluids, h_dot_min, h_out_w, h_limit_s, **kwargs)[source]
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)
- Parameters:
fluids (list of 2 fprop.Fluid) – The definition of the two fluids, as they enter the heat exchangers. Typically at room temperature.
h_dot_min (float) – enthalpy flow rate (W) which has to be transfered.
h_out_w (float) – exit enthalpy of the working fluid.
h_limit_s (float,) – 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.
kwargs (dict, optional) –
Optional parameters for the heat exchanger configuration:
- pointsint, for how many points (array) shall the minimum approach temperature
be checked and properties be returned (for plotting etc.). default 50
- d_temp_separation_minfloat, Minimium approach temperature (
pinch point) between the two fluids. default 0.5
- calc_typestr, which calculation type shall be performed; only one implemented so
far, default “const”
name : str, name of the heat exchanger .default “evaporator”
- plot_infodict, 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 {}
- Return type:
None.
- pinch_calc(verbose=False)[source]
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).
- Parameters:
verbose (boolean, optional) – if True, several variables will be printed out. Default is False.
- 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).
- opti_hex_p_pinch(secondary=True)[source]
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.
- Parameters:
secondary (bool, optional) – 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.
- Returns:
h_opt – The optimized enthalpy of the secondary (or working) fluid in J/kg.
- Return type:
float
Notes
Check the warning attribute of the component after execution to ensure the optimization converged.
- find_pinch(secondary=True, verbose=False)[source]
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.
- Parameters:
secondary (Boolean, optional) – shall the output state of the secondary (True) or the working (False) fluid be varied? default = True
- Returns:
the optimized enthalpy of the secondary fluid.
- Return type:
float
- pinch_plot(plot_fname='', plotting=True, **kwargs)[source]
calculates the secondary fluid output state and mass flow, for the minimum approach temperature of the HeatExchanger instance. When wanted, this is also plotted
- Parameters:
plot_fname (string, optional) – file-name to store the plot. The default is “”.
plotting (Boolean, optional) – should it be plotted? The default is True.
- 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.