---
url: /dyad/stable/stdlib/HVACComponents/components/Components.Compressor.md
description: >-
  Dyad Components.Compressor docs.  Positive-displacement compressor with no
  mass or energy storage.
---

# `Components.Compressor` {#Components.Compressor}

Positive-displacement compressor with no mass or energy storage.

port_a is the suction side and port_b the discharge side; m_flow > 0 means flow enters through port_a. input_speed is the commanded shaft speed in rev/s. Volumetric and shaft-power behaviour are set by the polynomial coefficient arrays c_vol (length 6) and c_pow (length 5); shaft power is capped at maxPower.

## Usage {#Usage}

`HVACComponents.Components.Compressor(medium_data, speed_start, m_flow_start, hDischarge_start, hSuction_start, p_a_start, p_b_start, dp_start, dSuction_start=HVACComponents.Density_ph(p_a_start, hSuction_start, medium_data), c_vol, c_pow, Vmax, Vrel, zFw_shell, maxPower, zFw, scP, scCF, scVdot, V=Vrel * Vmax)`

## Parameters: {#Parameters:}

|               Name |                                                               Description | Units |                                                     Default value |
| ------------------:| -------------------------------------------------------------------------:| -----:| -----------------------------------------------------------------:|
|      `medium_data` |                                             Refrigerant medium properties |     – |                                                                   |
|      `speed_start` |                           Initial compressor speed \[rev/s] (solver guess) |     – |                                                                   |
|     `m_flow_start` |                       Initial refrigerant mass flow \[kg/s] (solver guess) |     – |                                                                   |
| `hDischarge_start` |                 Initial discharge specific enthalpy \[J/kg] (solver guess) |     – |                                                                   |
|   `hSuction_start` |                   Initial suction specific enthalpy \[J/kg] (solver guess) |     – |                                                                   |
|        `p_a_start` |                         Initial suction-side pressure \[Pa] (solver guess) |     – |                                                                   |
|        `p_b_start` |                       Initial discharge-side pressure \[Pa] (solver guess) |     – |                                                                   |
|         `dp_start` |           Initial pressure rise across the compressor \[Pa] (solver guess) |     – |                                                                   |
|   `dSuction_start` | Initial suction density \[kg/m^3] (derived from p_a_start, hSuction_start) |     – | HVACComponents.Density_ph(p_a_start, hSuction_start, medium_data) |
|            `c_vol` |                  Volumetric efficiency polynomial coefficients (length 6) |     – |                                                                   |
|            `c_pow` |                            Shaft power polynomial coefficients (length 5) |     – |                                                                   |
|             `Vmax` |              Maximum (geometric) displacement volume per revolution \[m^3] |     – |                                                                   |
|             `Vrel` |    Relative displacement fraction of Vmax used for the effective volume V |     – |                                                                   |
|        `zFw_shell` |      Fraction of (shaftPower - refrigerantPortPower) lost as housing heat |     – |                                                                   |
|         `maxPower` |                                            Upper bound on shaft power \[W] |     – |                                                                   |
|              `zFw` |                                  Thermal efficiency assigned to eta_therm |     – |                                                                   |
|              `scP` |               Pressure scaling factor used in the polynomial correlations |     – |                                                                   |
|             `scCF` |                  Speed scaling factor used in the polynomial correlations |     – |                                                                   |
|           `scVdot` |        Volumetric-flow scaling factor used in the polynomial correlations |     – |                                                                   |
|                `V` |        Effective displacement volume per revolution \[m^3] (= Vrel \* Vmax) |     – |                                                       Vrel \* Vmax |

## Connectors {#Connectors}

* `input_speed` - This connector represents a real signal as an input to a component ([`RealInput`](/stdlib/Dyad/connectors/RealInput#RealInput))

* `port_a` - ([`FluidPort`](/stdlib/HVACComponents/connectors/FluidPort#FluidPort))

* `port_b` - ([`FluidPort`](/stdlib/HVACComponents/connectors/FluidPort#FluidPort))

## Variables {#Variables}

|                   Name |                                                                           Description | Units |
| ----------------------:| -------------------------------------------------------------------------------------:| -----:|
|                `speed` |                           Compressor shaft speed \[rev/s] (clamped at 1e-3 from below) |     – |
|          `m_flow_comp` |                                   Refrigerant mass flow through the compressor \[kg/s] |     – |
|           `hDischarge` |                                          Discharge specific enthalpy at port_b \[J/kg] |     – |
|                `eta_v` |                                                             Volumetric efficiency \[-] |     – |
|            `eta_therm` |                                                                Thermal efficiency \[-] |     – |
|                   `dp` |                                                    Pressure rise port_b - port_a \[Pa] |     – |
|                 `pRat` |                                                Pressure ratio port_b.p / port_a.p \[-] |     – |
|             `dSuction` |                                             Suction-side refrigerant density \[kg/m^3] |     – |
|             `H_flow_a` |                                                           Enthalpy flow at port_a \[W] |     – |
|             `H_flow_b` |                                                           Enthalpy flow at port_b \[W] |     – |
|           `hSuctionIs` |             Isentropic suction enthalpy \[J/kg] (simplified: pass-through from port_b) |     – |
|             `hSuction` |                              Suction specific enthalpy entering through port_a \[J/kg] |     – |
|           `shaftPower` |                                         Shaft power \[W] (clamped to \[1e-3, maxPower]) |     – |
| `refrigerantPortPower` |                                       Net power into the refrigerant at the ports \[W] |     – |
|    `housingHeatLosses` | Heat lost through the housing \[W] (= zFw_shell \* (shaftPower - refrigerantPortPower)) |     – |
|           `TDischarge` |                                                   Discharge temperature at port_b \[K] |     – |
|             `TSuction` |                                                     Suction temperature at port_a \[K] |     – |
|                   `ps` |                                              Suction pressure alias for port_a.p \[Pa] |     – |
|                   `pd` |                                            Discharge pressure alias for port_b.p \[Pa] |     – |
|                 `vdot` |                                    Volumetric flow rate \[m^3/s] (= eta_v \* V \* speed) |     – |
|               `ratPow` |          Rated power per unit suction-density flow used in the enthalpy rise equation |     – |
|                 `CFSc` |                                              Scaled compressor speed (= scCF \* speed) |     – |
|               `PDisSc` |                                                Scaled discharge pressure (= scP \* pd) |     – |
|               `PSucSc` |                                                  Scaled suction pressure (= scP \* ps) |     – |
|             `deltaPSc` |                                        Scaled pressure difference (= PDisSc - PSucSc) |     – |
|               `PRatSc` |                                             Scaled pressure ratio (= PDisSc / PSucSc) |     – |
|               `VdotSc` |                             Scaled volumetric flow rate (= scVdot \* eta_v \* V \* CFSc) |     – |
|          `shaftPower1` |                                    Speed-dependent term of the shaft-power polynomial |     – |
|          `shaftPower2` |                            Pressure/flow-dependent term of the shaft-power polynomial |     – |
