# Compressor models

class PythonModel.compressors.ReciprocatingCompressor(parameters)

  Bases: `object`

  Object for reciprocating compressor model based on Jin (2002): H. Jin. Parameter estimation based models of water source heat pumps. PhD Thesis. Oklahoma State University. Stillwater, Oklahoma, USA. 2002.

  Parameters

    - pisDis – Piston displacement (m3/s).

    - cleFac – Clearance factor (-).

    - etaEle – Electro-mechanical efficiency (-).

    - PLos – Constant part of the power losses (W).

    - pDro – Pressure drop at compressor suction and discharge (Pa).

    - dTSup – Degree of superheating (K).

  get_DischargePressure(pCon)

    Evaluate the discharge pressure (Pa).

    Parameters

      pCon – Condensing pressure (Pa).

    Returns

      Discharge pressure (Pa).

    Usage: Type

          >>> com = ReciprocatingCompressor([0.00162, 0.069, 0.696, 100.0, 99.29e3, 9.82])
          >>> '%.1f' % com.get_DischargePressure(1.879e6)
          '1978290.0'

  get_Power(vSuc, ref, pDis, pSuc, TSuc, **kargs)

    Evaluate the power input to the compressor.

    Parameters

      - vSuv – Suction specific volume (m3/kg).

      - ref – Refrigerant model.

      - pDis – Discharge pressure (Pa).

      - pSuc – Suction pressure (Pa).

      - TSuc – Suction temperature (K).

    Returns

      Power input to the compressor (W).

    Usage: Type

          >>> import refrigerants
          >>> ref = refrigerants.R410A()
          >>> com = ReciprocatingCompressor([0.00162, 0.069, 0.696, 100.0, 99.29e3, 9.82])
          >>> '%.2f' % com.get_Power(0.0288, ref, 1978290.0, 983710.0, 292.97)
          '1765.63'

  get_RefrigerantMassFlowRate(vSuc, ref, pDis, pSuc, TSuc, **kargs)

    Evaluate the refrigerant mass flow rate.

    Parameters

      - vSuv – Suction specific volume (m3/kg).

      - ref – Refrigerant model.

      - pDis – Discharge pressure (Pa).

      - pSuc – Suction pressure (Pa).

      - TSuc – Suction temperature (K).

    Returns

      Refrigerant mass flow rate (kg/s).

    Usage: Type

          >>> import refrigerants
          >>> ref = refrigerants.R410A()
          >>> com = ReciprocatingCompressor([0.00162, 0.069, 0.696, 100.0, 99.29e3, 9.82])
          >>> '%.8f' % com.get_RefrigerantMassFlowRate(0.0288, ref, 1978290.0, 983710.0, 292.97)
          '0.05358166'

  get_SuctionPressure(pEva)

    Evaluate the suction pressure.

    Parameters

      pEva – Evaporating pressure (Pa).

    Returns

      Suction pressure (Pa).

    Usage: Type

          >>> com = ReciprocatingCompressor([0.00162, 0.069, 0.696, 100.0, 99.29e3, 9.82])
          >>> '%.1f' % com.get_SuctionPressure(1.083e6)
          '983710.0'

  get_SuctionTemperature(TEva)

    Evaluate the suction temperature.

    Parameters

      TEva – Evaporating temperature (K).

    Returns

      Suction temperature (K).

    Usage: Type

          >>> com = ReciprocatingCompressor([0.00162, 0.069, 0.696, 100.0, 99.29e3, 9.82])
          >>> '%.2f' % com.get_SuctionTemperature(283.15)
          '292.97'

  initialGuessParameters(Q_nominal, P_nominal, TSou_nominal, TLoa_nominal, ref, CoolingMode)

    Initialize guess parameters for calibration of the heat pump model.

    Parameters

      - Q_nominal – Nominal heat pump capacity (W).

      - P_nominal – Nominal power input (W).

      - TSou_nominal – Source-side water temperature at nominal conditions (K).

      - TLoa_nominal – Load-side water temperature at nominal conditions (K).

      - ref – Refrigerant model.

      - CoolingMode – Boolean, True if heat pump is in cooling mode.

    Returns

      A list of parameters to the compressor model, a list of tuples of the bounds of the parameters (min, max) for the calibration routine.

  modelicaModelPath()
    Returns the full path to the compressor model in the Buildings

      library.

    Returns

      Full path to the compressor model in the Buildings library.

    Usage: Type

          >>> com = ReciprocatingCompressor([0.00162, 0.069, 0.696, 100.0, 99.29e3, 9.82])
          >>> com.modelicaModelPath()
          'Buildings.Fluid.HeatPumps.Compressors.ReciprocatingCompressor'

  printParameters()

    Prints the value of the model parameters.

  reinitializeParameters(parameters)

    Reinitializes the compressor using new parameters.

    Parameters

      - pisDis – Piston displacement (m3/s).

      - cleFac – Clearance factor (-).

      - etaEle – Electro-mechanical efficiency (-).

      - PLos – Constant part of the power losses (W).

      - pDro – Pressure drop at compressor suction and discharge (Pa).

      - dTSup – Degree of superheating (K).

class PythonModel.compressors.ScrollCompressor(parameters)

  Bases: `object`

  Object for scroll compressor model based on Jin (2002): H. Jin. Parameter estimation based models of water source heat pumps. PhD Thesis. Oklahoma State University. Stillwater, Oklahoma, USA. 2002.

  Parameters

    - volRat – Volume ratio (-).

    - v_flow – Nominal Volume flow rate (m3/s).

    - leaCoe – LEakage coefficient (kg/s).

    - etaEle – Electro-mechanical efficiency (-).

    - PLos – Constant part of the power losses (W).

    - dTSup – Degree of superheating (K).

  get_DischargePressure(pCon)

    Evaluate the discharge pressure (Pa).

    Parameters

      pCon – Condensing pressure (Pa).

    Returns

      Discharge pressure (Pa).

    Usage: Type

          >>> com = ScrollCompressor([2.362, 0.00287, 0.0041, 0.922, 398.7, 6.49])
          >>> '%.1f' % com.get_DischargePressure(1.879e6)
          '1879000.0'

  get_Power(vSuc, ref, pDis, pSuc, TSuc)

    Evaluate the power input to the compressor.

    Parameters

      - vSuv – Suction specific volume (m3/kg).

      - ref – Refrigerant model.

      - pDis – Discharge pressure (Pa).

      - pSuc – Suction pressure (Pa).

      - TSuc – Suction temperature (K).

    Returns

      Power input to the compressor (W).

    Usage: Type

          >>> import refrigerants
          >>> ref = refrigerants.R410A()
          >>> com = ScrollCompressor([2.362, 0.00287, 0.0041, 0.922, 398.7, 6.49])
          >>> '%.2f' % com.get_Power(0.025, ref, 1.879e6, 1.083e6, 289.64)
          '2940.26'

  get_RefrigerantMassFlowRate(vSuc, pDis, pSuc, **kargs)

    Evaluate the refrigerant mass flow rate.

    Parameters

      - vSuv – Suction specific volume (m3/kg).

      - pDis – Discharge pressure (Pa).

      - pSuc – Suction pressure (Pa).

      - TSuc – Suction temperature (K).

    Returns

      Refrigerant mass flow rate (kg/s).

    Usage: Type

          >>> com = ScrollCompressor([2.362, 0.00287, 0.0041, 0.922, 398.7, 6.49])
          >>> '%.6f' % com.get_RefrigerantMassFlowRate(0.025, 1.879e6, 1.083e6)
          '0.107687'

  get_SuctionPressure(pEva)

    Evaluate the suction pressure.

    Parameters

      pEva – Evaporating pressure (Pa).

    Returns

      Suction pressure (Pa).

    Usage: Type

          >>> com = ScrollCompressor([2.362, 0.00287, 0.0041, 0.922, 398.7, 6.49])
          >>> '%.1f' % com.get_SuctionPressure(1.083e6)
          '1083000.0'

  get_SuctionTemperature(TEva)

    Evaluate the suction temperature.

    Parameters

      TEva – Evaporating temperature (K).

    Returns

      Suction temperature (K).

    Usage: Type

          >>> com = ScrollCompressor([2.362, 0.00287, 0.0041, 0.922, 398.7, 6.49])
          >>> '%.2f' % com.get_SuctionTemperature(283.15)
          '289.64'

  initialGuessParameters(Q_nominal, P_nominal, TSou_nominal, TLoa_nominal, ref, CoolingMode)

    Initialize guess parameters for calibration of the heat pump model.

    Parameters

      - Q_nominal – Nominal heat pump capacity (W).

      - P_nominal – Nominal power input (W).

      - TSou_nominal – Source-side water temperature at nominal conditions (K).

      - TLoa_nominal – Load-side water temperature at nominal conditions (K).

      - ref – Refrigerant model.

      - CoolingMode – Boolean, True if heat pump is in cooling mode.

    Returns

      A list of parameters to the compressor model, a list of tuples of the bounds of the parameters (min, max) for the calibration routine.

  modelicaModelPath()
    Returns the full path to the compressor model in the Buildings

      library.

    Returns

      Full path to the compressor model in the Buildings library.

    Usage: Type

          >>> com = ScrollCompressor([2.362, 0.00287, 0.0041, 0.922, 398.7, 6.49])
          >>> com.modelicaModelPath()
          'Buildings.Fluid.HeatPumps.Compressors.ScrollCompressor'

  printParameters()

    Prints the value of the model parameters.

  reinitializeParameters(parameters)

    Reinitializes the compressor using new parameters.

    Parameters

      - volRat – Volume ratio (-).

      - v_flow – Nominal Volume flow rate (m3/s).

      - leaCoe – LEakage coefficient (kg/s).

      - etaEle – Electro-mechanical efficiency (-).

      - PLos – Constant part of the power losses (W).

      - dTSup – Degree of superheating (K).

  set_ModelicaParameters(simulator, suffix='')

    Set parameter values for simulation in dymola.

    Parameters

      - simulator – Simulator object (BuildinsPy)

      - suffix – String to add at the end of parameter names.

    Returns

      Simulator object (BuildingsPy)