vclibpy.components.compressors package
Submodules
vclibpy.components.compressors.compressor module
Module for different compressor models
- class vclibpy.components.compressors.compressor.Compressor(N_max: float, V_h: float)[source]
Bases:
BaseComponent
Base compressor class to be extended for specific compressor models.
- Args:
N_max (float): Maximal rotations per second of the compressor. V_h (float): Volume of the compressor in m^3.
- Methods:
- get_lambda_h(inputs: Inputs) -> float:
Get the volumetric efficiency.
- get_eta_isentropic(p_outlet: float, inputs: Inputs) -> float:
Get the isentropic efficiency.
- get_eta_mech(inputs: Inputs) -> float:
Get the mechanical efficiency.
- get_p_outlet() -> float:
Get the outlet pressure.
- get_n_absolute(n: float) -> float:
Return the absolute compressor frequency based on the relative speed.
- calc_state_outlet(p_outlet: float, inputs: Inputs, fs_state: FlowsheetState):
Calculate the outlet state based on the high pressure level and provided inputs.
- calc_m_flow(inputs: Inputs, fs_state: FlowsheetState) -> float:
Calculate the refrigerant mass flow rate.
- calc_electrical_power(inputs: Inputs, fs_state: FlowsheetState) -> float:
Calculate the electrical power consumed by the compressor based on an adiabatic energy balance.
- calc_electrical_power(inputs: Inputs, fs_state: FlowsheetState) float [source]
Calculate the electrical power consumed by the compressor based on an adiabatic energy balance.
- Args:
inputs (Inputs): Inputs for the calculation. fs_state (FlowsheetState): Flowsheet state.
- Returns:
float: Electrical power consumed.
- calc_m_flow(inputs: Inputs, fs_state: FlowsheetState) float [source]
Calculate the refrigerant mass flow rate.
- Args:
inputs (Inputs): Inputs for the calculation. fs_state (FlowsheetState): Flowsheet state.
- Returns:
float: Refrigerant mass flow rate.
- calc_state_outlet(p_outlet: float, inputs: Inputs, fs_state: FlowsheetState)[source]
Calculate the output state based on the high pressure level and the provided inputs. The state is automatically set as the outlet state of this component.
- Args:
p_outlet (float): High pressure value. inputs (Inputs): Inputs for calculation. fs_state (FlowsheetState): Flowsheet state.
- get_eta_isentropic(p_outlet: float, inputs: Inputs) float [source]
Get the isentropic efficiency.
- Args:
p_outlet (float): High pressure value. inputs (Inputs): Inputs for the calculation.
- Returns:
float: Isentropic efficiency.
- get_eta_mech(inputs: Inputs) float [source]
Get the mechanical efficiency including motor and inverter efficiencies.
- Args:
inputs (Inputs): Inputs for the calculation.
- Returns:
float: Mechanical efficiency including motor and inverter efficiencies.
- get_lambda_h(inputs: Inputs) float [source]
Get the volumetric efficiency.
- Args:
inputs (Inputs): Inputs for the calculation.
- Returns:
float: Volumetric efficiency.
vclibpy.components.compressors.constant_effectivness module
- class vclibpy.components.compressors.constant_effectivness.ConstantEffectivenessCompressor(N_max: float, V_h: float, eta_isentropic: float, eta_mech: float, lambda_h: float)[source]
Bases:
Compressor
Compressor model with constant efficiencies.
Inherits from the Compressor class, which defines the basic properties and behavior of a compressor in a vapor compression cycle.
- Parameters:
N_max (float): Maximal rotations per second of the compressor. V_h (float): Volume of the compressor in m^3. eta_isentropic (float): Constant isentropic efficiency of the compressor. eta_mech (float): Constant mechanical efficiency of the compressor. lambda_h (float): Constant volumetric efficiency.
- Args:
N_max (float): Maximal rotations per second of the compressor. V_h (float): Volume of the compressor in m^3. eta_isentropic (float): Constant isentropic efficiency of the compressor. eta_inverter (float): Constant inverter efficiency of the compressor. eta_motor (float): Constant motor efficiency of the compressor. eta_mech (float): Constant mechanical efficiency of the compressor including motor and inverter efficiencies. lambda_h (float): Constant volumetric efficiency.
- Methods:
- get_lambda_h(inputs: Inputs) -> float:
Returns the constant volumetric efficiency of the compressor.
- get_eta_isentropic(p_outlet: float, inputs: Inputs) -> float:
Returns the constant isentropic efficiency of the compressor.
- get_eta_mech(inputs: Inputs) -> float:
Returns the constant mechanical efficiency including motor and inverter efficiencies.
- get_eta_isentropic(p_outlet: float, inputs: Inputs) float [source]
Returns the constant isentropic efficiency of the compressor.
- Args:
p_outlet (float): High pressure value. inputs (Inputs): Input parameters for the calculation.
- Returns:
float: Constant isentropic efficiency.
vclibpy.components.compressors.rotary module
- class vclibpy.components.compressors.rotary.RotaryCompressor(N_max: float, V_h: float)[source]
Bases:
Compressor
Compressor model based on the thesis of Mirko Engelpracht.
This compressor is characterized by using regressions provided by Mirko Engelpracht for a family of rotary compressors. The coefficients used in the regressions are sourced from his Master’s thesis.
- Parameters:
N_max (float): Maximal rotations per second of the compressor. V_h (float): Volume of the compressor in m^3.
- Methods:
- get_lambda_h(inputs: Inputs) -> float:
Returns the volumetric efficiency based on the regressions of Mirko Engelpracht.
- get_eta_isentropic(p_outlet: float, inputs: Inputs) -> float:
Returns the isentropic efficiency based on the regressions of Mirko Engelpracht.
- get_eta_mech(inputs: Inputs) -> float:
Returns the mechanical efficiency based on the regressions of Mirko Engelpracht.
- get_eta_isentropic(p_outlet: float, inputs: Inputs) float [source]
Returns the isentropic efficiency based on the regressions of Mirko Engelpracht.
- Args:
p_outlet (float): High pressure value. inputs (Inputs): Input parameters for the calculation.
- Returns:
float: Isentropic efficiency.
vclibpy.components.compressors.ten_coefficient module
- class vclibpy.components.compressors.ten_coefficient.BaseTenCoefficientCompressor(N_max, V_h, datasheet, **kwargs)[source]
Bases:
Compressor
,ABC
Base class for compressors using the ten-coefficient method.
Used table has to be in this format (order of the columns is not important). The values must be the same as in the example tabel. The column names can be different but must then be matched with argument parameter_names. (All typed in numbers are fictional placeholders)
Capacity(W) Input Power(W) Flow Rate(kg/h) Capacity(W) … Flow Rate(kg/h)
n n1 n1 n1 n2 … n_last P1 42 12 243 32 … 412 … … … … … … … P10 10 23 21 41 … 2434
- Args:
N_max (float): Maximal rotations per second of the compressor. V_h (float): Volume of the compressor in m^3. datasheet (str): Path of the datasheet file. **kwargs:
- parameter_names (dict, optional):
Dictionary to match internal parameter names (keys) to the names used in the table values. Default {
“m_flow”: “Flow Rate(kg/h)”, “capacity”: “Capacity(W)”, “input_power”: “Input Power(W)”, “eta_s”: “Isentropic Efficiency(-)”, “lambda_h”: “Volumentric Efficiency(-)”, “eta_mech”: “Mechanical Efficiency(-)”
}
sheet_name (str, optional): Name of the sheet in the datasheet. Defaults to None.
- get_parameter(T_eva, T_con, n, type_)[source]
Get a parameter based on temperatures, rotations, and parameter type from the datasheet.
- Args:
T_eva (float): Evaporator temperature in Celsius. T_con (float): Condenser temperature in Celsius. n (float): Rotations per second. type_ (str): Parameter type in parameter_names.
- Returns:
float: Interpolated parameter value.
- class vclibpy.components.compressors.ten_coefficient.DataSheetCompressor(N_max, V_h, datasheet, **kwargs)[source]
Bases:
BaseTenCoefficientCompressor
Compressor based on the ten coefficient method.
Used table has to be in this format (order of the columns is not important). The values must be the same as in the example tabel. The column names can be different but must then be matched with the keyword argument parameter_names. (All typed in numbers are fictional placeholders)
Isentropic Volumetric Mechanical Isentropic Mechanical Efficiency(-) Efficiency(-) Efficiency(-) Efficiency(-) … Efficiency(-)
n n1 n1 n1 n2 … n_last P1 42 12 243 32 … 412 … … … … … … … P10 10 23 21 41 … 2434
- Args:
N_max (float): Maximal rotations per second of the compressor. V_h (float): Volume of the compressor in m^3. datasheet (str): Path of the datasheet file. **kwargs:
- parameter_names (dict, optional):
Dictionary to match internal parameter names (keys) to the names used in the table values. Default {
“eta_s”: “Isentropic Efficiency(-)”, “lambda_h”: “Volumetric Efficiency(-)”, “eta_mech”: “Mechanical Efficiency(-)”
}
sheet_name (str, optional): Name of the sheet in the datasheet. Defaults to None.
- get_eta_isentropic(p_outlet: float, inputs: Inputs)[source]
Get the isentropic efficiency.
- Args:
p_outlet (float): Outlet pressure in Pa. inputs (Inputs): Input parameters.
- Returns:
float: Isentropic efficiency.
- class vclibpy.components.compressors.ten_coefficient.TenCoefficientCompressor(N_max, V_h, T_sc, T_sh, capacity_definition, assumed_eta_mech, datasheet, **kwargs)[source]
Bases:
BaseTenCoefficientCompressor
Compressor based on the ten coefficient method.
Used table has to be in this format (order of the columns is not important). The values must be the same as in the example tabel. The column names can be different but must then be matched with the keyword argument parameter_names. (All typed in numbers are fictional placeholders)
Capacity(W) Input Power(W) Flow Rate(kg/h) Capacity(W) … Flow Rate(kg/h)
n n1 n1 n1 n2 … n_last P1 42 12 243 32 … 412 … … … … … … … P10 10 23 21 41 … 2434
T_sh and T_sc have to be set according to the data sheet of your compressor. capacity_definition defines the parameter “capacity” in the datasheet. If capacity is the specific cooling capacity (h1-h4), set it on “cooling”. If capacity is the specific heating capacity (h2-h3), set it on “heating”. In the case of cooling capacity, the mechanical efficiency of the compressor has to be assumed (assumed_eta_mech) as h2 can’t be calculated otherwise. Summary:
For the case heating capacity: h2 = h3 + capacity / m_flow
For the case cooling capacity: h2 = h3 + (capacity + p_el * assumed_eta_mech) / m_flow
- Args:
N_max (float): Maximal rotations per second of the compressor. V_h (float): Volume of the compressor in m^3. T_sc (float): Subcooling according to datasheet in K. T_sh (float): Superheating according to datasheet in K. capacity_definition (str): Definition of “capacity” in the datasheet. “cooling” or “heating”. assumed_eta_mech (float): Assumed mechanical efficiency of the compressor (only needed if cooling). datasheet (str): Path of the modified datasheet. **kwargs:
- parameter_names (dict, optional):
Dictionary to match internal parameter names (keys) to the names used in the table values. Default {
“m_flow”: “Flow Rate(kg/h)”, “capacity”: “Capacity(W)”, “input_power”: “Input Power(W)”
}
sheet_name (str, optional): Name of the sheet in the datasheet. Defaults to None.
- get_eta_isentropic(p_outlet: float, inputs: Inputs)[source]
Get the isentropic efficiency.
- Args:
p_outlet (float): Outlet pressure in Pa. inputs (Inputs): Input parameters.
- Returns:
float: Isentropic efficiency.
- vclibpy.components.compressors.ten_coefficient.calc_ten_coefficients(T_eva, T_con, coef_list)[source]
Calculate the result using the ten-coefficient method.
- Args:
T_eva (float): Evaporator temperature in Celsius. T_con (float): Condenser temperature in Celsius. coef_list (list): List of coefficients.
- Returns:
float: Result of the calculation.