carbatpy.utils.property_eval_mixture_test¶
A script to evaluate mixtures, in order to find some with vapor pressures in some limits at given temperatures, together with the temperature glide. The results are stored as figure, as csv and in a json-file(Input); all in the given directory.
The csv output file structure is as follows:
number of calculation
the four mole fractions, species names are in the title
index l: the properties for saturated vapor at the given low temperature
index sup: the poperties at superheating at pressure p_l for a prescribed superheating
index h: the properties for saturated vapor at the given high temperature
index is: the properties for the isentropic state (sup ->p_h) at the given low temperature
index is80: the properties for the isentropic effic. of 80 % (sup ->p_h) at the given low temperature
index dew: the properties for the saturated liquid at p_h
index mid: the properties at the mean enthalpy between q=0 and q=1 at p_h
index thr: the properties for the isenthalpic throtteling from saturated liquid to p_l
index hplT: the properties at T_l and p_h
index thrlow: the properties for the isenthalpic throtteling from hplt ->p_l
index bol: the properties for saturated liquid at the low pressure p_l
p_ratio: the pressure ratio
T_glide_h: the temperature glide at high pressure
dv/v’’: (ca.) the mean change in volume along throtteling relative to the specific volume of the vapor, this is a measure of how much work is ‘lost’ along throtteling
dv/v’’-b: similar volume ratio after subcooling to thrlow, answer the question: will subcooling reduce losses (strongly)?
COP_is: What is the predicted COP for isentropic compression (losses along throtteling are seen here)
For each indexed state : T,p,h,v,s,q,u in SI units(mass base) are listed.
part of carbatpy
Created on Thu Oct 19 14:11:14 2023
@author: atakan
Attributes¶
Functions¶
|
Mixtures are evaluated/screened to find mixtures with a given temperature |
|
Evalutes the data in the combined dataFrame with the initial fluid screening |
|
find the fluids used in the screening |
|
Combine two data frames out of two or more files with same number of lines |
|
Plotting a dataframe from a file using a dictionary with the keys |
|
|
|
Module Contents¶
- carbatpy.utils.property_eval_mixture_test.mixture_search(fluids_all, temp_both, p_both, res_dir, d_temp_superheating=5, resolution=21, temp_limit=False, **kwargs)[source]¶
Mixtures are evaluated/screened to find mixtures with a given temperature glide in a certain pressure range. For all possible mixture compositions first the saturated vapor pressure at the given low temperature and composition is evaluated, if it is in the allowed regime, the saturated vapor pressure (p_h) of the mixture at the high temperature is evaluated. If this is below the allowed high pressure, the saturated liquid temperature at this p_h is evaluated and the temperature difference is taken as temperature glide. The pressure ratio is plotted as a function of temperature glide. The plot, the states (as csv-file) and the input parameters (as .json-file) are stored. in the csv-File first the mole fractions are given followed by the properties of the low temperature sat.vapor, after superheating, for thehigh temperature sat. vapor, the isentropic state after compression, high pressure sat.liquid, low pressuer isenthalpic (throtteling) state to the high pressure sat. liquid, and the low pressure saturated liquis state. For each of them: T,p,h,v,s,q,u in SI units(mass base)
- Parameters:
fluids_all (list of strings) – up to 4 fluid names of the mixture, as defined in the fluid model (REFPROP).
temp_both (List of two floats) – the minimum (at low pressure) and the maximum (at high pressure) saturated vapor temperature (both dew points) in K.
p_both (List of two floats) – allowed min and max pressure in Pa.
res_dir (string) – Directory name, where the results are stored.
d_temp_superheating (float. optional) – super heating temperature in K. The default is 5.
resolution (integer, optional) – inverse is the interval for the mole fraction screening (21 means every 0.05 a value is calculated). The default is 21.
temp_limit (Boolean, optional) – selects only values, where the temperature of the saturated liquid at high pressure is above temp_both[0]. The default is False.
kwargs (dict) – is not implemented yet, but can be used later to select another fluid model, instead of REFPROP.
- Return type:
None.
- carbatpy.utils.property_eval_mixture_test.eval_is_eff_roskosch(data, file_out)[source]¶
Evalutes the data in the combined dataFrame with the initial fluid screening
and the output of the Roskosch compressor model (h_aus, s_aus, h_e) for exactly the states calculated along the screening. The column names are quite special and one has to know that the Roskosch model calculates in kJ, while carbatpy uses SI units (J). With the output enthalpy of the Roskosch model, the COP_comp is calculated. Using the enthalpies and entropies along the isobaric heat ransfer, mean temperatures are calculated.Here are again two cases
a) for throttling at quality=0b) throttling after subcooling to T_low (names: _lowT).With these mean temperatures, the COPs for two reversible cases are calculated: for the isentropic efficieciecy of 80% COP_rev80 and for the Roskosch ‘real’ case COP_rev_r. Finally, the (pseudo-)real COP is compared to the reversible COP, giving a second law efficiency eff_sec_law_r for the Roskosch efficiencies and eff_sec_law_80 for the fixed 80% efficiency, which include the compressor and the throttling, but no heat transfer!
The Roskosch piston compressor model is described here: http://dx.doi.org/10.1016/j.ijrefrig.2017.08.011
Is part of carbatpy.
- Parameters:
data (pandas.dataFrame) – as calculated by combining the fluid screening dataFrame with the ouput of the Roskosch model (as dataFrame).
file_out (string) – name of the file (incl. directory) where the resulting dataFrame shall be stored.
- Returns:
data – input expanded by the results.
- Return type:
pandas.dataFrame
- carbatpy.utils.property_eval_mixture_test.get_fluid(data)[source]¶
find the fluids used in the screening
- Parameters:
data (pandas.dataFrame) – dataFrame from fluid screening with mole fractions. In the column names the names of the fluids are found.
- Returns:
fluids (list of strings) – names of the fluids.
fluid_col (list of strings) – List with the column names (includes a sarting”x_”.
fluid_str (string) – Fluid composition string as accepted by RefProp.
- carbatpy.utils.property_eval_mixture_test.combine(filenames, filename_out='automatic')[source]¶
Combine two data frames out of two or more files with same number of lines
and fitting to each other. Can be used, when after fluid screening machine efficienceies, costs, etc. are calculated as post-processing. Can help in evaluation and plotting.
- Parameters:
filenames (list of strings) – all filenames (incl. directories), to be read.
filename_out (string, optional) – Where to store the result. The default is “automatic”. Then the first filename isxpanded vy “-combined”.
- Raises:
ValueError – If tgere is a problem with the files.
- Returns:
combined – the combined dataFrame.
- Return type:
pandas.dataFrame
- carbatpy.utils.property_eval_mixture_test.data_plot(filename, what, filename_out='automatic', fig_title='')[source]¶
Plotting a dataframe from a file using a dictionary with the keys
being the plotted parameters “x”, “y”, “hue” etc. and storing it to a file.
- Parameters:
filename (string) – csv-file with the data-frame to be imported.
what (dictionary) – keys “y”,”x”,”hue”, “style”, size etc. values must be some column names. .
filename_out (string, optional) – where to store the plot, including directory. The default is “automatic”.
fig_title (string, optional) – Title of the figure to be plotted, default is “”.
- Returns:
success?
- Return type:
bool