Model for a water to water heat pump with a reciprocating compressor, as described in Jin (2002). The thermodynamic heat pump cycle is represented below.

The rate of heat transferred to the evaporator is given by:
Q̇Eva = ṁref ( hVap(TEva) - hLiq(TCon) ).
The power consumed by the compressor is given by a linear efficiency relation:
P = PTheoretical / η + PLoss,constant.
Heat transfer in the evaporator and condenser is calculated using an ε-NTU method, assuming constant refrigerant temperature and constant heat transfer coefficient between fluid and refrigerant.
Variable speed is acheived by multiplying the full load piston displacement by the normalized compressor speed. The power and heat transfer rates are forced to zero if the resulting heat pump state has higher evaporating pressure than condensing pressure.
Parameters TConMax and TEvaMin may be
used to set an upper or lower bound for the condenser and
evaporator. The compressor is disabled when these conditions are
not satisfied, or when the evaporator temperature is larger than
the condenser temperature. This mimics the temperature protection
of heat pumps and moreover it avoids non-converging algebraic loops
of equations, or freezing of evaporator medium. This option can be
disabled by setting enable_temperature_protection =
false.
The compression process is assumed isentropic. The thermal energy of superheating is ignored in the evaluation of the heat transferred to the refrigerant in the evaporator. There is no supercooling.
H. Jin. Parameter estimation based models of water source heat pumps. PhD Thesis. Oklahoma State University. Stillwater, Oklahoma, USA. 2002.