## Appendix A  
The conservation of energy during the energy efficient DHW generation operation mode (c)--cf. Figure 1c--in the process water cycle is given by:  
\[\dot{Q}_{\rm con}+\ \dot{Q}_{\rm RPW,P}+\dot{Q}_{\rm RPW,R}-\dot{Q}_{\rm DHW}= \ 0, \tag{1}\]  
where \(\dot{Q}_{\rm con}\) is the heat transferred from the refrigerant to the water by the condenser, \(\dot{Q}_{\rm RPW,P}\) is the heat transferred by discharging the PCM in the RPW-HEX to the water, \(\dot{Q}_{\rm RPW,R}\) is the heat transferred from the refrigerant in the RPW-HEX directly to the water and \(\dot{Q}_{\rm DHW}\) is the heat transferred to the DHW storages. The latter can be calculated by the in- and outlet temperature of the water:  
\[\dot{Q}_{\rm DHW}=\ \dot{m}_{\rm w}c_{\rm p,w}\Big{(}s^{\rm(in)}_{\rm DHW}-s^{ \rm(out)}_{\rm DHW}\Big{)}, \tag{2}\]  
and if the HP is running, the contribution of the condenser can be described with:  
\[\dot{Q}_{\rm con}=\ \dot{m}_{\rm w}c_{\rm p,w}\Big{(}s_{\rm sp}-s^{\rm(out)}_{ \rm DHW}\Big{)}, \tag{3}\]where \(\delta_{\text{SP}}\) is the set-point temperature for heating which is also used for DHW generation in operating mode (c) to preheat the water at a high _COP_. The sensible energy of the hot gas transferred through the RPW-HEX can be calculated from the efficiency of the RPW-HEX  
\[\dot{\text{Q}}_{\text{RPW,R}}=\ \dot{\text{Q}}_{\text{con}}\frac{\varepsilon_{ \text{RPW}}}{1-\varepsilon_{\text{RPW}}}, \tag{10}\]  
where \(\varepsilon_{\text{RPW}}\) is the fraction of the total heat at the hot side of the HP that can be transferred to the RPW-HEX and has to be taken from experiments or simulations (cf. [15]). The heat transfer rate needed to be transferred from the PCM to the DHW \(\Delta Q_{\text{RPW,P}}\) is the heat that cannot be provided by the refrigerant of the HP. It can be calculated from (10) and the energy extracted from the RPW-HEX after the time \(\tau\) is:  
\[\Delta Q_{\text{RPW,P}}=\ \int_{0}^{\tau}\bigl{(}\dot{\text{Q}}_{\text{DHW}}- \dot{\text{Q}}_{\text{con}}-\dot{\text{Q}}_{\text{RPW,R}}\bigr{)}\text{d}t, \tag{11}\]  
To calculate the energies (11-1) the change in time of the outlet temperature of the DHW storage (\(\delta_{\text{DHW}}^{\text{(out)}}\)) is crucial, because this temperature strongly influences the contribution of the HP to the heat transferred to the DHW storages. If \(\delta_{\text{DHW}}^{\text{(out)}}\) is significantly smaller than the set point temperature \(\delta_{\text{SP}}\), the HP can operate at a high part load (since the volume flow rate is fixed) and therefore can provide a high share of thermal energy to the DHW charging process. If \(\delta_{\text{DHW}}^{\text{(out)}}\) is close to the condensing temperature or even higher, the HP will turn off, and all the energy must be provided by the PCM. Hence, \(\delta_{\text{DHW}}^{\text{(out)}}\) has a high impact to the RPW-HEX storage capacity needed for providing a certain amount of thermal energy for the DHW storages. In the present work, we use a moving boundary approach to describe the thermocline behavior of the DHW storages to find an analytic solution for 11. Figure 10 shows the principle of the approach. The storage consists of an upper volume at hot temperature (\(\delta_{\text{h}}\)), which is always heated to a temperature corresponding to the constant inlet temperature and a lower volume at cold temperature (\(\delta_{\rm c}\)), whose temperature corresponds to the fresh water temperature. Both volumes are separated by a moving boundary (\(\ell\)) which depends directly on the stored energy:  
\[\ell=L-\frac{Q_{\rm DHW}}{A_{\rm DHW}\ p_{\rm w}\ c_{\rm p,w}\ \bigg{(}s_{\rm DHW}^{ \rm(in)}-\delta_{\rm c}\bigg{)}}, \tag{10}\]  
where \(A_{\rm DHW}\) is the ground area of the DHW storage, \(L\) is the height of the DHW storage, \(\rho_{\rm w}\) is the density and \(c_{\rm p,w}\) is the specific heat capacity of water.