carbatpy.utils.property_eval_mixture ==================================== .. py:module:: carbatpy.utils.property_eval_mixture .. autoapi-nested-parse:: 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 ---------- .. autoapisummary:: carbatpy.utils.property_eval_mixture.FLUIDS_ACTUAL Functions --------- .. autoapisummary:: carbatpy.utils.property_eval_mixture.mixture_search carbatpy.utils.property_eval_mixture.eval_is_eff_roskosch carbatpy.utils.property_eval_mixture.get_fluid carbatpy.utils.property_eval_mixture.combine carbatpy.utils.property_eval_mixture.data_plot carbatpy.utils.property_eval_mixture.plot_cycle carbatpy.utils.property_eval_mixture.get_cycle_points Module Contents --------------- .. py:function:: mixture_search(fluids_all, temp_both, p_both, res_dir, d_temp_superheating=5, resolution=21, temp_limit=False, **kwargs) 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) :param fluids_all: up to 4 fluid names of the mixture, as defined in the fluid model (REFPROP). :type fluids_all: list of strings :param temp_both: the minimum (at low pressure) and the maximum (at high pressure) saturated vapor temperature (both dew points) in K. :type temp_both: List of two floats :param p_both: allowed min and max pressure in Pa. :type p_both: List of two floats :param res_dir: Directory name, where the results are stored. :type res_dir: string :param d_temp_superheating: super heating temperature in K. The default is 5. :type d_temp_superheating: float. optional :param resolution: inverse is the interval for the mole fraction screening (21 means every 0.05 a value is calculated). The default is 21. :type resolution: integer, optional :param temp_limit: selects only values, where the temperature of the saturated liquid at high pressure is above temp_both[0]. The default is False. :type temp_limit: Boolean, optional :param kwargs: is not implemented yet, but can be used later to select another fluid model, instead of REFPROP. :type kwargs: dict :rtype: None. .. py:function:: eval_is_eff_roskosch(data, file_out) 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 .. line-block:: a) for throttling at quality=0 b) 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. :param data: as calculated by combining the fluid screening dataFrame with the ouput of the Roskosch model (as dataFrame). :type data: pandas.dataFrame :param file_out: name of the file (incl. directory) where the resulting dataFrame shall be stored. :type file_out: string :returns: **data** -- input expanded by the results. :rtype: pandas.dataFrame .. py:function:: get_fluid(data) find the fluids used in the screening :param data: dataFrame from fluid screening with mole fractions. In the column names the names of the fluids are found. :type data: pandas.dataFrame :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. .. py:function:: combine(filenames, filename_out='automatic') 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. :param filenames: all filenames (incl. directories), to be read. :type filenames: list of strings :param filename_out: Where to store the result. The default is "automatic". Then the first filename isxpanded vy "-combined". :type filename_out: string, optional :raises ValueError: If tgere is a problem with the files. :returns: **combined** -- the combined dataFrame. :rtype: pandas.dataFrame .. py:function:: data_plot(filename, what, filename_out='automatic', fig_title='') 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. :param filename: csv-file with the data-frame to be imported. :type filename: string :param what: keys "y","x","hue", "style", size etc. values must be some column names. . :type what: dictionary :param filename_out: where to store the plot, including directory. The default is "automatic". :type filename_out: string, optional :param fig_title: Title of the figure to be plotted, default is "". :type fig_title: string, optional :returns: success? :rtype: bool .. py:function:: plot_cycle(filename, dataset) .. py:function:: get_cycle_points(data, index) .. py:data:: FLUIDS_ACTUAL :value: ['Propane', 'Ethane', 'Pentane', 'Butane']