carbatpy.models.components.single_flow ====================================== .. py:module:: carbatpy.models.components.single_flow .. autoapi-nested-parse:: Class FlowDevice functions for compressor and expander output state calcultations so far/here: only for fixed isentropic efficiencies pumps and throttles added. ((Part of carbatpy.)) Created on Sun May 21 08:51:33 2023 @author: atakan Attributes ---------- .. autoapisummary:: carbatpy.models.components.single_flow.FLUID Classes ------- .. autoapisummary:: carbatpy.models.components.single_flow.FlowDevice Module Contents --------------- .. py:class:: FlowDevice(fluid, p_out, m_dot, device_type='machine', **kwargs) Unified themodynamic calculations for single flow devices .. py:method:: compressor() compressor or expander output state calculation so far only for a constant isentropic efficiency, according to the pressure change an expansion or compression is detected and handled. :param p_out: output pressure. :type p_out: float :param eta_s: isentropic efficiency. :type eta_s: float :param fluid: entering fluid, including properties, composition, and model. :type fluid: fprop.Fluid :param m_dot: mass flow rate (in kg/s). Default is 1 :type m_dot: float, optional :param calc_type: how to calculate, so far, only one implemented. The default is "const_eta". :type calc_type: string, optional :param name: name of the device. The default is "compressor". :type name: string, optional :param plot_info: 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. :type plot_info: dictionary, optional :returns: * **state_out** (*array of float*) -- compressor output state containing [T,p,h,v,s,q]. * **work_specific** (*float*) -- work per kg of fluid, positive for compressor; units:J/kg. .. py:method:: pump() Calculate the exit state of a pump assuming an incompressible fluid. Only formulated for constant isentropic efficiency :param p_out: output pressure. :type p_out: float :param eta_s: isentropic efficiency. :type eta_s: float :param fluid: entering fluid, including properties, composition, and model. :type fluid: fprop.Fluid :param m_dot: mass flow rate (in kg/s). Default is 1 :type m_dot: float, optional :param calc_type: how to calculate, so far, only one implemented. The default is "const_eta". :type calc_type: string, optional :param name: name of the device. The default is "pump". :type name: string, optional :param plot_info: 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. :type plot_info: dictionary, optional :returns: * **state_out** (*array of float*) -- compressor output state containing [T,p,h,v,s,q]. * **work_specific** (*float*) -- work per kg of fluid, positive for compressor; units:J/kg. .. py:method:: throttle() throttle output state calculation so far only for a constant enthalpy :param p_out: output pressure. :type p_out: float :param fluid: entering fluid, including properties, composition, and model. :type fluid: fprop.Fluid :param m_dot: mass flow rate (in kg/s). Default is 1 :type m_dot: float, optional :param calc_type: how to calculate, so far, only one implemented. The default is "const_h". :type calc_type: string, optional :param name: name of the device. The default is "throttle". :type name: string, optional :param plot_info: 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. :type plot_info: dictionary, optional :returns: **state_out** -- compressor output state containing [T,p,h,v,s,q]. :rtype: array of float .. py:method:: plot_temp_h_flow() plotting a T-H-dot diagram for simple flows (compressor, throttle etc.) :param _state_in: entering state [T,p,h,v,s,...]. :type _state_in: np.array :param _state_out: exiting state. :type _state_out: np.array :param _m_dot: mass flow rate (kg/s). :type _m_dot: float :param _plot_info: 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". :type _plot_info: dictionary :rtype: None. .. py:method:: print_device() .. py:method:: state_w_p() .. py:data:: FLUID :value: 'Propane * Pentane'