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.FlowDeviceOld Module Contents --------------- .. py:class:: FlowDeviceOld(fluid, p_out, m_dot, device_type='machine', **kwargs) Unified themodynamic calculations for single flow devices, Old version Calculate the output state and state changes for single flow devices :param fluid: The fluid at is entering state. :type fluid: cb.Fluid :param p_out: Output pressure in Pa. :type p_out: float :param m_dot: mass flow rate in kg/s. :type m_dot: float :param device_type: 'machine' for compressor/expander, 'pump', or 'throttle'. The default is "machine". :type device_type: TYPE, optional :param \*\*kwargs: Optional parameters for setting the configuration and parameters - plot info : dictionary,optional, default value is {} contains 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". - name : string, optional, the name of this specific device, the default is "compressor". - calc_type : string, optional, which method shall be used (e.g.: "const_eta", "const_h"), default is "const_eta". - calc_parameters : dictionary, optional, if further parameters have to be given for the calculation. the default is None. - verbose : Boolean, optional, the default is False. :type \*\*kwargs: dictionary DESCRIPTION. the self.output dictionary contains the exit state values, and work and power. The self.fluid is at the exit state. Check self.warning and self.warning_message. There is also a self.print_device function for inspection. If a figure is passed by plot_info the plot will be updated. :rtype: None. .. py:attribute:: fluid .. py:attribute:: p_out .. py:attribute:: m_dot .. py:attribute:: device_type :value: 'machine' .. py:attribute:: plot_info .. py:attribute:: name .. py:attribute:: calc_type .. py:attribute:: calc_parameters .. py:attribute:: verbose .. py:attribute:: warning :value: 0 .. py:attribute:: warning_message :value: 'All o.k.' .. py:attribute:: input .. py:attribute:: output :value: None .. py:property:: all .. py:method:: to_dict() .. 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: cb.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'