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

FLUID

Classes

FlowDeviceOld

Unified themodynamic calculations for single flow devices, Old version

Module Contents

class carbatpy.models.components.single_flow.FlowDeviceOld(fluid, p_out, m_dot, device_type='machine', **kwargs)[source]

Unified themodynamic calculations for single flow devices, Old version

Calculate the output state and state changes for single flow devices

Parameters:
  • fluid (cb.Fluid) – The fluid at is entering state.

  • p_out (float) – Output pressure in Pa.

  • m_dot (float) – mass flow rate in kg/s.

  • device_type (TYPE, optional) – ‘machine’ for compressor/expander, ‘pump’, or ‘throttle’. The default is “machine”.

  • **kwargs

    Optional parameters for setting the configuration and parameters

    • plot infodictionary,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”.

    • namestring, optional, the name of this specific device, the default is

      ”compressor”.

    • calc_typestring, optional, which method shall be used (e.g.: “const_eta”,

      ”const_h”), default is “const_eta”.

    • calc_parametersdictionary, optional, if further parameters have to be

      given for the calculation. the default is None.

    • verbose : Boolean, optional, the default is False.

Return type:

None.

fluid[source]
p_out[source]
m_dot[source]
device_type = 'machine'[source]
plot_info[source]
name[source]
calc_type[source]
calc_parameters[source]
verbose[source]
warning = 0[source]
warning_message = 'All o.k.'[source]
input[source]
output = None[source]
property all[source]
to_dict()[source]
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 (cb.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.

print_device()[source]
state_w_p()[source]
carbatpy.models.components.single_flow.FLUID = 'Propane * Pentane'[source]