carbatpy.models.components.single_flow¶
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¶
Classes¶
Unified themodynamic calculations for single flow devices |
Module Contents¶
- class carbatpy.models.components.single_flow.FlowDevice(fluid, p_out, m_dot, device_type='machine', **kwargs)[source]¶
Unified themodynamic calculations for single flow devices
- compressor()[source]¶
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.
- Parameters:
p_out (float) – output pressure.
eta_s (float) – isentropic efficiency.
fluid (fprop.Fluid) – entering fluid, including properties, composition, and model.
m_dot (float, optional) – mass flow rate (in kg/s). Default is 1
calc_type (string, optional) – how to calculate, so far, only one implemented. The default is “const_eta”.
name (string, optional) – name of the device. The default is “compressor”.
plot_info (dictionary, optional) – 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.
- 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.
- pump()[source]¶
Calculate the exit state of a pump assuming an incompressible fluid.
Only formulated for constant isentropic efficiency
- Parameters:
p_out (float) – output pressure.
eta_s (float) – isentropic efficiency.
fluid (fprop.Fluid) – entering fluid, including properties, composition, and model.
m_dot (float, optional) – mass flow rate (in kg/s). Default is 1
calc_type (string, optional) – how to calculate, so far, only one implemented. The default is “const_eta”.
name (string, optional) – name of the device. The default is “pump”.
plot_info (dictionary, optional) – 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.
- 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.
- throttle()[source]¶
throttle output state calculation
so far only for a constant enthalpy
- Parameters:
p_out (float) – output pressure.
fluid (fprop.Fluid) – entering fluid, including properties, composition, and model.
m_dot (float, optional) – mass flow rate (in kg/s). Default is 1
calc_type (string, optional) – how to calculate, so far, only one implemented. The default is “const_h”.
name (string, optional) – name of the device. The default is “throttle”.
plot_info (dictionary, optional) – 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.
- Returns:
state_out – compressor output state containing [T,p,h,v,s,q].
- Return type:
array of float
- plot_temp_h_flow()[source]¶
plotting a T-H-dot diagram for simple flows (compressor, throttle etc.)
- Parameters:
_state_in (np.array) – entering state [T,p,h,v,s,…].
_state_out (np.array) – exiting state.
_m_dot (float) – mass flow rate (kg/s).
_plot_info (dictionary) – 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”.
- Return type:
None.