CROSS-REFERENCE TO RELATED APPLICATION 
       [0001]    This application is entitled to the benefit of and incorporates by reference subject matter disclosed in the International Patent Application No. PCT/DK2014/000001 filed on Jan. 2, 2014; Danish Patent Application PA 2013 00001 filed Jan. 2, 2013; and European Patent Application Serial No. 13172404.9 filed Jul. 18, 2013. 
     
    
     TECHNICAL 
       [0002]    The present invention relates to a method for controlling an integrated cooling and heating facility. More particularly, the present invention provides a method which allows the integrated cooling and heating facility to be controlled in an energy optimizing manner, seen from a total perspective, i.e. not merely from the perspective of the isolated integrated cooling and heating facility. 
       BACKGROUND 
       [0003]    Based on the obvious society challenges symptomized by climate change, fossil fuel scarcity and rising peak demand resulting in black-outs of energy supply, the global society needs to minimize the emission of CO 2 , secure energy supplies by introducing more renewable energy resources and at the same time minimize investments in the electricity grid. To do that, new smarter methods of managing energy and reducing energy consumption are necessary. The electricity grid is challenged by the rising amount of renewable energy sources as wind and solar power which impacts the balancing of the grid (voltage, frequency). Actual price of electricity has become very volatile and even temporarily negative prices are observed. Systems acting in the smart grid are called Demand-Response (DR) enabled and have the ability to respond to demands posed by smart grid responsible parties like electricity utilities or aggregators. Various solutions have been suggested related to the above challenges. 
         [0004]    WO 2006/034718 discloses a refrigeration system, where capacity of the compressing unit is controlled based on a predicted future cooling demand rather than an actually determined cooling demand. A system is disclosed, wherein a cost value for changing the cooling capacity of the system is taken into consideration. The system may be adapted to determine for a plurality of switching sequences a cooling capacity and a cost value representing the cost of operating the system in accordance with the switching sequence. The system may further be adapted to select a cheapest mode of operating the system, being one of the switching sequences with the lowest cost value. 
         [0005]    WO 2006/034718 does not disclose the vapour compression system being connected to a thermal energy grid being external to the vapour compression system. Also, WO 2006/034718 does not disclose a cost function including monetary costs and monetary revenues for thermal energy. Furthermore, WO 2006/034718 does not disclose operating the vapour compression system in such a manner that the monetary energy costs established by the monetary cost function are minimized. 
         [0006]    EP 0 999 418 discloses a method and apparatus is provided for controlling an energy storage medium connected to an environmental control system. The controller includes an energy pricing data structure for storing a real-time energy pricing profile indicative of energy rates corresponding to time-varying production costs of energy. The controller also includes a storage medium containing rules that approximate optimal control trajectories of an energy cost function that is dependent upon the real-time energy pricing profile, with the rules governing the operation of the energy storage medium. 
         [0007]    EP 0 999 418 does not disclose the vapour compression system being connected to a thermal energy grid being external to the vapour compression system. Also, EP 0 999 418 does not disclose operating the vapour compression system, only discloses operating the energy storage medium. Furthermore, EP 0 999 418 does not disclose operating the vapour compression system in such a manner that the monetary energy costs established by the monetary cost function are minimized. 
         [0008]    U.S. Pat. No. 5,735,134 discloses a vapor compression system with set point optimization generating a set of thermodynamic operating parameters such that the system operates with optimum energy efficiency. Based on environmental conditions such as indoor and outdoor temperature as well as thermal load, the set of parameters for steady-state set point is generated. The system also monitors actual system properties in real-time and provides them as feedback to the set point computation module. Based on these actual real-time measurements, a new steady-state set point can be generated to enable the system to continue operating at maximum coefficient of performance upon change in environmental or thermal load requirements. 
         [0009]    U.S. Pat. No. 5,735,134 does not disclose the vapour compression system being connected to a thermal energy grid being external to the vapour compression system. Also, U.S. Pat. No. 5,735,134 does not disclose a cost function including monetary costs and monetary revenues for thermal energy. Furthermore, U.S. Pat. No. 5,735,134 does not disclose the vapour compression system being connected to a thermal energy grid being external to the vapour compression system. Even further, U.S. Pat. No. 5,735,134 does not disclose in such a manner that the monetary energy costs established by the monetary cost function are minimised, only discloses operating the vapour compression system to maximize a real-time coefficient of performance 
         [0010]    Cooling, such as refrigeration, consumes a high amount of energy and has a high potential for thermal storage due to free available compressor capacity. Cooling such as refrigeration represents the largest energy consumption in e.g. a food retail store. Dependent on climate conditions, up to 50% of energy consumption is used for cooling and freezing of perishable food stuff. Consequently, the efficiency of refrigeration systems has been increased throughout the years. There is a potential for being an important stakeholder in the smart grid comprising one or more energy suppliers and one or more energy consumers. Until recently focus has been on the non-refrigeration parts of the food retail stores e.g. light, rail heating and HVAC. As the refrigeration system is the most energy consuming and at the same time also the most critical process in the food retail sector, refrigeration calls for innovation to contribute to the extent its potential deserves. 
         [0011]    Besides energy efficiency food security and safety are basic strong values that have fuelled the historical developments of refrigeration. Consequently, technologies have developed during the last century to satisfy these needs and today advanced systems for optimization of the food retail business are available. There are different specific technology areas for optimization of which the most important is energy optimization, detection and diagnosis of failures in a cooling facility and finally selection of new environmentally benign refrigerants. Majority of efforts have been towards internal system optimization and only modest focus has been towards the external opportunities supported by the new energy paradigms that are rapidly developing. 
         [0012]    Refrigeration systems are normally outlined with a capacity to serve the worst conditions for the cooling needs, i.e., hot and humid summer conditions. It means that refrigeration plants are operating below capacity even during the major part of the hottest day and night and during the most of the year. Cooling, such as refrigeration, has a high potential for utilising thermal storage due to the temporarily unused compressor capacity. Thus there is a potential for being an important stakeholder in the smart grid comprising one or more energy suppliers and one or more energy consumers. 
         [0013]    New opportunities have been identified with the reintroduction of CO 2  as refrigerant.  FIG. 3  shows a comparison in compressor energy usage for similar stores using different refrigerants (R404A versus CO 2 ). The latest generation of CO 2  systems shows very good performance compared to R404A and furthermore the CO 2  systems have the advantage of being suitable for providing high temperature heating. The opportunity to run systems in combined cooling and heating mode will open up further opportunities to add value to smart energy systems 
       SUMMARY 
       [0014]    It is an object of embodiments of the invention to provide a method for controlling an integrated cooling and heating facility which allows the costs of operating the integrated cooling and heating facility to be minimised, seen from a total perspective. 
         [0015]    The invention provides a method for controlling an integrated cooling and heating facility comprising a vapour compression system with two or more heat exchangers, each arranged for providing cooling or heating, the vapour compression system being connected to an electrical energy grid being external to the vapour compression system and also being connected to a thermal energy grid being external to the vapour compression system, the method comprising the steps of:
       providing a monetary cost function for operating the integrated cooling and heating facility, said monetary cost function establishing monetary energy costs and monetary energy revenues of operating the vapour compression system,
           said monetary energy costs including monetary expenses for electrical energy received from the external electrical grid and consumed by the vapour compression system, and   said monetary energy costs also including monetary expenses for thermal energy not provide by the vapour compression system and consumed at a location of the integrated cooling and heating facility and   said monetary energy revenue including monetary revenues for thermal energy produced by the vapour compression system and provided to an external thermal grid at, or outside, the location of the integrated cooling and heating facility, and   
           operating the vapour compression system in such a manner that the monetary energy costs established by the monetary cost function are minimised.       
 
         [0021]    A method of controlling a refrigeration system of a supermarket or a cold store, the method comprising the steps of establishing the costs for operating the refrigeration system, the costs for comprising establishment of a demand-response, the demand being a demand for heat generated by the refrigeration system and to be transferred to a heat draining medium of the smart grid, which the refrigeration system is connected to, and the response being controlling the refrigeration system depending on the demand and depending on the costs for operating the refrigeration system and for responding to the demand, the response comprising controlling one or more operating parameters of the refrigeration system based on demand from the heat draining medium, and the demand comprising consume of heat of the heat draining medium, and where a supplemental energy consuming entity is capable of storing thermal energy within a thermal energy storing medium of the supplemental energy consuming entity, the thermal energy stored in the medium being transferred to an entity of the refrigeration system at a time of day later than a time of day, when the thermal energy is stored in the supplemental energy consuming entity, the heat draining medium of the smart grid draining heat generated by the refrigeration system to commercial or industrial heating installations outside the building of the refrigeration system. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0022]      FIG. 1  is a block diagram of the features of a cooling and heating facility according to an embodiment of the present application; 
           [0023]      FIG. 2  is a graph of the complexity level for optimizing refrigeration; 
           [0024]      FIG. 3  is a graph comparing compressor energy usage of similar cooling facilities using different refrigerants; 
           [0025]      FIG. 4  is a graph and block diagram of wasted energy and heat recovery; 
           [0026]      FIG. 5  is a block diagram of an integrated cooling and heating facility; 
           [0027]      FIG. 6  is a chart of cost calculations of an integrated cooling and heating facility operating in different modes; and 
           [0028]      FIG. 7  is a chart of potential energy savings of an integrated cooling and heating facility having different thermal storage capacities and different levels of Demand Response Capabilities for optimizing energy costs. 
       
    
    
     DETAILED DESCRIPTION 
       [0029]    In the present context the term ‘integrated cooling and heating facility’ should be interpreted to mean a facility which is capable of providing cooling as well as heating. The integrated cooling and heating facility comprises a vapour compression system. In the present context the term ‘vapour compression system’ should be interpreted to mean any system in which a flow of fluid medium, such as refrigerant, circulates and is alternatingly compressed and expanded, thereby providing heating and refrigeration of specific volumes. Thus, the vapour compression system will typically comprise a compressor, e.g. in the form of a compressor rack, a heat rejecting heat exchanger, e.g. in the form of a condenser or a gas cooler, an expansion device and a heat consuming heat exchanger, e.g. in the form of an evaporator, arranged in a refrigerant path. Thus, refrigerant flowing in the refrigerant path is alternatingly compressed by the compressor and expanded by the expansion device, and heat is rejected at the heat rejecting heat exchanger, and heat is consumed at the evaporator. Accordingly, the vapour compression system is capable of providing heating at the heat rejecting heat exchanger, and of providing cooling at the evaporator. 
         [0030]    Thus, the integrated cooling and heating facility may, e.g., be a cooling system, such as a refrigeration system or an air condition system, in which heat rejected from a heat rejecting heat exchanger, such as a condenser or a gas cooler, is reclaimed partly or totally. The reclaimed thermal energy, in the form of the reclaimed heat, may be used for heating rooms or water at or near the integrated cooling and heating facility, and/or it may be supplied to an external thermal grid for heating rooms or water remote from the integrated cooling and heating facility. 
         [0031]    As an alternative, the integrated cooling and heating facility may, e.g., be a heat pump, in which thermal energy in the form of cooling being provided at a heat consuming heat exchanger, such as an evaporator, is reclaimed. The reclaimed thermal energy may, in this case, be used for lowering the temperature inside rooms or smaller closed volumes, e.g., in the form of refrigerating facilities, or even for lowering the temperature of specific elements, e.g., eutectic plates or phase change materials, at or near the integrated cooling and heating facility, and/or it may be supplied to an external thermal grid for cooling rooms or water remote from the integrated cooling and heating facility. 
         [0032]    The vapour compression system is connected to an electrical grid being external to the vapour compression system. Thus, the vapour compression system receives electrical energy from the external electrical grid, the received electrical energy being used for operating the vapour compression system, in particular for operating the compressor. In return the owner of the integrated cooling and heating facility pays the electricity supplier for the consumed energy. The owner of the system will have an interest in optimising the energy consumption based on time dependent electricity prices or for offering capacity reserves either in the form of using temporarily higher or lower energy amounts. 
         [0033]    The electricity supplier may have an interest in avoiding fluctuation or ripples in the electrical grid, and in maintaining a smooth energy production. In order to obtain this, the electricity supplier may request consumers of electrical energy, such as the integrated cooling and heating facility, to adjust their energy consumption if the total energy consumption of all energy consumers connected to the grid does not match an expected total energy consumption at the time. 
         [0034]    According to the method of the invention, a monetary cost function for operating the integrated cooling and heating facility is initially provided. The monetary cost function establishes monetary energy costs of operating the vapour compression system. The monetary energy costs include monetary expenses for electrical energy received from the external electrical grid and consumed by the vapour compression system. Thus, the monetary cost function takes into account the payment to the electricity supplier for the consumed electrical energy, as described above. 
         [0035]    The monetary energy costs further include monetary expenses for thermal energy consumed at a location of the integrated cooling and heating facility and/or monetary revenue for thermal energy produced by the vapour compression system. Thus, the monetary cost function takes into account the costs for operating the integrated cooling and heating facility, where operating the integrated cooling and heating facility is for heating or cooling parts of the integrated cooling and heating facility and/or is for heating or cooling the building, where the integrated cooling and heating facility is positioned, and which require such heating or cooling. This may, e.g. include costs involved with receiving thermal energy from an external thermal grid, such as a district heating grid or a district cooling grid. Alternatively or additionally, it may include costs for fossil fuels used for operating a local heating system, such as an oil-burner or gas-burner in a central heating system. 
         [0036]    In the case that, for instance, reclaimed heat from a refrigeration system is used for providing central heating in the building where the integrated cooling and heating facility is positioned, the need for thermal energy being supplied from external sources is reduced, and thereby the costs involved with obtaining thermal energy from external sources can also be reduced. 
         [0037]    Alternatively or additionally, the monetary costs may include revenues obtained for supplying excess thermal energy to an external thermal grid. This will be described in further detail below. 
         [0038]    Thus, it may sometimes be feasible to consume more electrical energy if the resulting reduction in costs for external thermal energy exceeds the increase in costs for consumed electrical energy, and/or if the extra revenue obtained exceeds the increase in costs. 
         [0039]    Thus, the monetary cost function reflects the combined costs involved with operating the integrated cooling and heating facility, from a complete perspective, in the sense that the costs are not regarded in an isolated manner, but rather the entire facility is regarded as a whole. Thus, an increase in costs involved with operating one part of the integrated cooling and heating facility may be accepted, if it results in a decrease in costs involved with operating another part of the integrated cooling and heating facility and/or an increase in revenue, which at least compensates the increase in costs. 
         [0040]    Finally, the vapour compression system is operated in such a manner that the monetary energy costs established by the cost function are minimised. This is an advantage, because the vapour compression system is thereby operated in such a manner that the total costs involved with operating the integrated cooling and heating facility are minimised, as described above. 
         [0041]    Heating systems have mainly two purposes; to make hot water for sanitary purpose as cleaning or to produce space heat for comfort. While heat recovery from refrigeration systems is seen in several new installations, the majority of heating systems are still decoupled from the refrigeration system. With the reintroduction of CO 2  as refrigerant, the advantages of utilizing the refrigeration system for heating purposes have increased significantly. CO 2  shows very good properties for heating water at high temperatures due to CO 2 &#39;s high energy capacity at high temperatures. After leaving the hot water heat exchanger, the CO 2  discharge is finally cooled by low temperature return water from the heating system. 
         [0042]    The total energy efficiency including usable cooling energy (Qcool) and usable heating energy (QHeat) of, e.g., a supermarket store (COSP) becomes very high as much of the energy now is used. The combined Coefficient of System Performance (COSP) values of up to 6 have been reported from a case study where cooling only provides numbers below 4. Wcompr is the energy used by the compressor 
         [0000]    
       
         
           
             COSP 
             = 
             
               
                 
                   Q 
                   Cool 
                 
                 + 
                 
                   Σ 
                    
                   
                       
                   
                    
                   
                     Q 
                     Heat 
                   
                 
               
               
                 W 
                 Compr 
               
             
           
         
       
     
         [0000]    A simple outline of the energy waste or the choice of heat recovery is shown in  FIG. 4 . Facilities with online COP and COSP measurements have clearly shown the potential of introducing heat recovery, see  FIG. 4 . However, still approximately 70% of the energy in prior art systems is released to the ambient and further potential exist, if more systems are integrated. 
         [0043]    The monetary energy costs may further include monetary revenue for demand response services supplied by the vapour compression system to the external electrical grid. In the present context the term ‘demand response services’ should be interpreted to mean services provided by the integrated cooling and heating facility to the external electrical grid, where the integrated cooling and heating facility responds to demands from the external electrical grid to increase or decrease its energy consumption, in order to allow the external electrical grid to avoid fluctuations or ripples in the grid, and to maintain a smooth energy production. Such services may be rewarded by the owner of the external electrical grid, e.g. in the form of a reduction of the rates for the energy consumed by the integrated cooling and heating facility, and/or in the form of a revenue from the owner of the external electrical grid to the owner of the integrated cooling and heating facility. 
         [0044]    The vapour compression system may further be connected to a thermal grid being external to the vapour compression system, and the monetary energy costs may include monetary revenue for thermal energy supplied by the vapour compression system to the external thermal grid. According to this embodiment, apart from being connected to an external electrical grid, the vapour compression system is also connected to an external thermal grid, e.g. in the form of a district heating grid or a district cooling grid. Thus, the vapour compression system may receive thermal energy from the external thermal grid, and/or it may supply thermal energy to the external thermal grid. Accordingly, the thermal energy being reclaimed as described above may either be utilized locally, or it may be supplied to the external thermal grid. When the vapour compression system supplies thermal energy to the external thermal grid, a revenue is obtained from the owner of the external thermal grid for the supplied thermal energy. This revenue is taken into account when the total costs involved with operating the integrated cooling and heating facility are established. 
         [0045]    The step of establishing monetary energy costs may comprise establishing revenue for thermal energy supplied by the vapour compression system to the external thermal grid as a function of time. In some cases, the rate paid by the owner of the external thermal grid for the thermal energy supplied by the vapour compression system may vary as a function of time, e.g. due to ordinary market mechanisms regulating energy rates. Alternatively or additionally, the rate may vary according to the time of day, e.g. being high during the daytime and low during the night-time, and/or according to the time of year, e.g. being high during winter and low during summer, or vice versa, depending on whether the external thermal grid is a heating grid or a cooling grid. In this case it may be desirable to take the current rate into account when providing the monetary cost function for operating the integrated cooling and heating facility. For instance, it may be desirable to produce more excess thermal energy and supply it to the thermal grid, when the rate of thermal energy is high, even if this increases the electrical energy consumption of the integrated cooling and heating facility. Similarly, it may be desirable to reduce the production of excess thermal energy, when the rate of thermal energy is low. 
         [0046]    The external thermal grid may be or comprise a district cooling grid and/or a local cooling micro-grid for cooling facilities external to the vapour compression system. In this case the external thermal grid is a cooling grid, and the vapour compression system is capable of supplying thermal energy in the form of cooling provided by the evaporator to the external thermal grid. The cooling may, e.g., be in the form of air conditioning supplied to buildings. 
         [0047]    In the present context the term ‘district cooling grid’ should be interpreted to mean a thermal grid which supplies thermal energy in the form of cooling to buildings and/or facilities within a larger area, such as a larger urban area, a country district and/or a region. A district cooling grid may typically be a grid which is operated with a commercial goal, i.e. the owner of the district cooling grid aims to earn money by supplying cooling to the buildings and/or facilities connected to the grid. 
         [0048]    In the present context the term ‘local cooling micro-grid’ should be interpreted to mean a thermal grid which supplies thermal energy in the form of cooling to buildings and/or facilities within a smaller area, such as a shopping mall, a building block, a hotel, an apartment building, etc. A local cooling micro-grid may, e.g., be operated by the buildings and/or facilities connected to the cooling micro-grid, in which case the costs involved with operating the local cooling micro-grid may simply be shared among the buildings and/or facilities connected to the grid in accordance with the consumption of the individual buildings and/or facilities, but it may not be the intention that the local cooling micro-grid should produce a monetary surplus. 
         [0049]    The local cooling micro-grid may, e.g., be connected to a district cooling grid. 
         [0050]    Alternatively or additionally, the external thermal grid may be or comprise a district heating grid and/or a local heating micro-grid for heating facilities external to the vapour compression system. In this case the external thermal grid is a heating grid, and the vapour compression system is capable of supplying thermal energy in the form of heating provided by the heat rejecting heat exchanger to the external thermal grid. The heating may, e.g., be in the form of central heating supplied to buildings and/or heating of domestic water. 
         [0051]    In the present context the term ‘district heating grid’ should be interpreted to mean a thermal grid which supplies heating to buildings and/or facilities within a larger area, and the term ‘local heating micro-grid’ should be interpreted to mean a thermal grid which supplies thermal energy in the form of heating to buildings and/or facilities within a smaller area, similar to what is described above. The remarks set forth above with reference to cooling grids are equally applicable here. 
         [0052]    The external thermal grid may comprise a local thermal power generating facility. In the present context the term ‘local thermal power generating facility’ should be interpreted to mean a facility which is capable of supplying thermal energy to the integrated cooling and heating facility, and which is arranged at or near the integrated cooling and heating facility. The local thermal power generating facility may, e.g., be selected among the following facilities: Local solar thermal plants, local air-source thermal plants, or local geo-source plants. 
         [0053]    According to this embodiment, at least part of the thermal energy required at the building where the integrated cooling and heating facility is positioned, is generated by the local thermal power generating facility. Accordingly, the production of the local thermal power generating facility may be adjusted in accordance with the thermal energy being available from the vapour compression system, if this turns out to be feasible. Furthermore, the operating costs of the local thermal power generating facility may be taken into account when the monetary cost function for operating the integrated cooling and heating facility is provided. 
         [0054]    The smart grid terminology is by definition associated with electricity consumption and production. However, considering the growing interconnectivity in the modern thermal energy systems, a similar demand response system can be applied for heating systems. Heating consumers may for some instances act as producers whether the heating consumers use a heat pump with excess capacity or the heating consumers use solar thermal panels or other heating sources. This provides an opportunity for exploiting free refrigeration capacity in commercial or industrial refrigeration, especially in cases where refrigeration demand is low and electricity price is low. The exact composition of smart thermal grid connectivity may depend on various factors to obtain the best cost performance and energy efficiency. Taking into account that the fraction of renewable electricity supply sources will increase, the TEWI (Total Equivalent Warming Impact) of the heat pump process will be potentially very low in certain periods. To make the combined refrigeration and heat pump work in practice, it would be necessary to add ambient heat sources as e.g. geothermal, ground or air connected to evaporators in parallel with the evaporators in the store. This has been done in rare cases, but has a high potential for further development. 
         [0055]    The step of establishing monetary energy costs may comprise establishing expenses for electrical energy received by the vapour compression system from the external electrical grid as a function of time. In some cases, the rate charged by the supplier of the electricity for the electrical energy supplied to the vapour compression system may vary as a function of time, e.g. due to ordinary market mechanisms regulating energy rates. Alternatively or additionally, the rate may vary according to the time of day, e.g. being high during the daytime peak periods and low during the night-time, and/or according to the time of year, e.g. being high during winter and low during summer. In this case it may be desirable to take the current rate into account when providing the monetary cost function for operating the integrated cooling and heating facility. For instance, it may be desirable to consume more electrical energy, and to either store some of the energy or produce thermal energy which is used locally or supplied to a thermal grid, when the rate of electrical energy is low. Similarly, it may be desirable to reduce the electrical energy consumption, e.g. by minimising the excess thermal energy produced, and/or by using previously stored energy, when the rate of electrical energy is high. 
         [0056]    The step of establishing monetary energy costs may comprise taking ambient conditions into account. The ambient conditions may, e.g., include the time of year, weather forecasts, outdoor temperatures, precipitation, etc. 
         [0057]    The method may further comprise the step of storing work made by a compressor of the vapour compression system in a thermal storage facility of the integrated cooling and heating facility, said thermal storage facility being capable of supplying work stored therein to the vapour compression system in order to reduce energy consumption of the vapour compression system at a time subsequent to the a time when the work is stored. 
         [0058]    According to this embodiment, the electrical energy consumption of the vapour compression system, notably of a compressor of the vapour compression system, is increased at a time where this is feasible, e.g. due to the rate of electrical energy being low and/or in order to provide demand response services to the external electrical grid, where the external electrical grid requests that the integrated cooling and heating facility increases its energy consumption. This results in excess cooling or heating being produced by the vapour compression system, due to excess work being performed by the compressor. The excess work is then stored in the thermal storage facility, e.g. in the form of an ice storage or a heat reservoir. At a later point in time, e.g. when the rate of electrical energy has increased, and/or the external electrical grid requests that the integrated cooling and heating facility decreases its energy consumption, the work which was previously stored in the thermal storage facility is discharged from the thermal storage facility and supplied to the vapour compression system. Thereby the electrical energy consumption of the integrated cooling and heating facility can be reduced at this point in time. 
         [0059]    Thus, according to the embodiment described above, it is possible to shift the energy consumption of the integrated cooling and heating facility in time, e.g. in order to minimise the costs for electrical energy supplied to the integrated cooling and heating facility and/or in order to provide demand response services to the external electrical grid. 
         [0060]    Alternatively or additionally, the method may further comprise the step of shifting energy consumption of the vapour compression cycle in time by using a thermal storage facility of the integrated cooling and heating facility, said method comprising the steps of discharging said thermal storage facility in order to reduce the energy consumption from the external electrical grid of the vapour compression cycle, and charging said thermal storage facility in order to increase the energy consumption from the external electrical grid of the vapour compression cycle. 
         [0061]    This embodiment is similar to the embodiment described above, in that the thermal storage facility is used for shifting electrical energy consumption. Thus, the electrical energy consumption may be increased at one point in time, and part of the energy may be used for charging the thermal storage facility. Subsequently, the thermal storage facility may be discharged, and thereby the electrical energy consumption at that point in time is reduced. 
         [0062]    Thermal storage is an old concept which has been used for optimizing refrigeration or even making refrigeration possible at all. Thermal storage provides several opportunities for optimizing the refrigeration or cooling cycle in a time perspective and in the context of utilizing the refrigeration plant capacity for more than just refrigeration in the conventional sense. If electricity prices are very volatile, load shedding can be adjusted to optimize the energy cost, but refrigeration needs the thermal storage to perform load shedding. Some basic calculations seen in Table 1 (based on the case from  FIG. 3 ) shows that the costs for electricity can be significantly reduced dependent on volatility of kWh price deviation and the load shed ability.  FIG. 7  shows the potential for energy savings considering a store with different thermal storage capacities and different levels of Demand response capabilities for optimizing the energy costs. Electricity prices are assumed to be two levels (night/day) in the simple DR and full connected to the electricity spot market in the advanced DR. The important information is that thermal storage can be utilized using the mass of refrigerated goods or even adding a specific large thermal mass (e.g. ice bank). In the case of utilizing the food as thermal storage, it is necessary to pay attention to the food safety and quality issues which may arise when temperatures become fluctuating. 
         [0000]    
       
         
               
               
               
               
               
               
             
               
               
               
               
               
               
             
           
               
                   
                 TABLE 1 
               
               
                   
                   
               
               
                   
                 no 
                 4 hour 
                 8 hour 
                 12 hour 
                   
               
               
                   
                 storage 
                 storage 
                 storage 
                 storage 
               
               
                   
                   
               
             
             
               
                   
               
             
          
           
               
                   
                 943 
                 760 
                 605 
                 498 
                 DKK 
               
               
                   
                 storage 
                 826 
                 1628 
                 2375 
                 kWh 
               
               
                   
                 savings 
                 183 
                 338 
                 445 
                 DKK 
               
               
                   
                 savings 
                 19 
                 36 
                 47 
                 % 
               
               
                   
                   
               
             
          
         
       
     
         [0063]    The thermal storage facility may be or comprise an ice storage connected to the vapour compression system. In this case, when the thermal storage is charged, ice is created in the ice storage, and when the thermal storage is discharged, the ice which was previously created in the ice storage is used for cooling purposes (either directly or to subcool the refrigerant before expansion), and thereby the cooling provided by the vapour compression system can be reduced, thereby reducing the electrical power consumption of the vapour compression system. 
         [0064]    As an alternative, the thermal storage facility may be or comprises a heat reservoir connected to the vapour compression system. In this case, when the thermal storage is charged, a medium, such as water, at the heat reservoir is heated, thereby storing thermal energy in the heat reservoir. When the thermal storage is discharged, the heated medium is used for heating purposes, and thereby the energy necessary to provide the required heating, e.g. in the form of electrical energy consumed by the compressor or thermal energy in the form of central heating originating from a district or local heating system, is reduced. 
         [0065]    The external electrical grid may comprise an external electrical power facility. In the present context the term ‘external electrical power facility’ should be interpreted to mean a power facility which supplies electrical energy within a larger area, such as a larger urban area, a country district and/or a region, via an electrical grid. An external electrical power facility may typically be a facility which is operated with a commercial goal, i.e. the owner of the electrical power facility aims to earn money by supplying electrical energy to the buildings and/or facilities connected to the electrical grid. 
         [0066]    The external electrical power facility may be selected among the following facilities: Nuclear-powered power plant, natural gas-powered electrical power plant, coal-fuelled electrical power plant, oil-fuelled electrical power plant, external hydroelectric plants, external wind turbine plants, external biomass plants, or external fuel cells. 
         [0067]    Alternatively or additionally, the external electrical grid may comprise a local electrical power generating facility. In the present context the term ‘local electrical power generating facility’ should be interpreted to mean a power facility which supplies electrical energy to buildings and/or facilities within a smaller area, such as a smaller urban area, a shopping mall, a building block, a hotel, an apartment building, within the building where the integrated cooling and heating facility is positioned, etc. The local electrical power generating facility may be selected among the following facilities: Local hydroelectric plants, local wind turbine plants, local biomass plants, local solar photovoltaic plants, or local fuel cells. 
         [0068]    Thus, according to this embodiment, at least some of the electrical energy required in order to operate the integrated cooling and heating facility is generated locally by means of the local electrical power generating facility. In the case that the local power generation facility is a renewable power generating facility, such as a wind turbine plant or a solar photovoltaic plant, the costs involved in generating the electrical energy locally may be very low. In this case it may very well be advantageous to increase the electrical energy consumption, in particular if a revenue can be obtained by supplying thermal energy to an external thermal grid. This may also advantageously be taken into account when the monetary cost function for operating the integrated cooling and heating facility is provided. 
         [0069]    The step of establishing a monetary cost function may comprise establishing a function of the form: 
         [0000]    
       
         
           
             Cost 
             = 
             
               
                 SUM 
                  
                 
                   ( 
                   
                     
                       X 
                       COP 
                     
                     * 
                     Pe 
                   
                   ) 
                 
               
               + 
               
                 Y 
                 * 
                 Ph 
               
               - 
               
                 
                   SUM 
                    
                   
                     ( 
                     
                       X 
                       * 
                       
                         ( 
                         
                           1 
                           + 
                           
                             1 
                             COP 
                           
                         
                         ) 
                       
                       * 
                       Ph 
                     
                     ) 
                   
                 
                 . 
               
             
           
         
       
     
         [0070]    X is the cooling power multiplied with time, COP the coefficient of performance. Y is the heating energy acquired at the heating cost (Ph) The last section is the monetary income obtained by selling (internally or externally) the energy coming from the cooling process. In this formula it is shown as 100% utilisation but it could be less i.e. if the is partly heat is rejected to ambient) 
         [0071]    To describe the energy balance in the system a matrix of the cooling applications (energy source) and the heating drain sources is made, see  FIG. 5 . There are three energy sources (arrows  1 ,  2  and  3  pointing towards the integrated cooling and heating facility) and three heating drains (arrows  1 ,  2  and  3  pointing away from the integrated cooling and heating facility). Two thermal storage devices are provided, one for cold appliance (e.g. ice bank) and one for high temperature storage (e.g. hot water). In  FIG. 6  an example of the cost calculations for a system running in different modes during the year is shown. Combinations of specific energy sources and heating drains are selected. Each combination in the matrix is assigned a COP value based on best common practice together with a value of X and Y and a price for electricity (Pe) and heating. The assumption is that each of the matrix points will be run separately (but sum up to 100%). 
         [0072]    For the sake of simplicity, four applications are selected. Each application can be assigned to more degrees of Demand-Response control. Either the lowest level which is no Demand-Response (only optimized thermostatic control), a limited Demand-Response program including simple tariff schemes or an advanced Demand-Response algorithm with predictive control based on weather forecast or very fast signal for load shedding. The results of the calculations are shown in  FIG. 7 . 
         [0073]    1) Baseline application, i.e., only normal refrigeration system with heat release to the ambient. This system shows a clear improvement as Demand-Response systems are applied. Between 10% and 17% savings in cost can be obtained by adding Demand-Response to the systems. 
         [0074]    2) Baseline application as in 1) plus ice bank which can cover 25% of system capacity. The ice bank thermal storage is a very effective component to use. It will allow for flexible use of the system as the load can be shed to higher degree. Ice bank can be used twofold—either for reducing the discharge pressure and thereby obtain higher process efficiency or for direct cooling with pumped CO 2 . Demand-Response enabled controls may utilize the options for load shedding. Savings on the cooling process is significant, but total cost is still high due to the heating needs. 
         [0075]    3) Baseline application as in 1) plus heat recovery for space heating and sanitary water (heat storage). Especially CO 2  has sufficiently high discharge temperatures to heat between 65° C. to 95° C. with acceptable efficiencies. Heat recovery is seen to be very effective in reducing total cost as it eliminates the conventional heating costs. The Demand-Response enabled controls may utilize the heat storage (hot water tank) to determine when to run in less efficient condition to save overall cost. The cooling process is less efficient than the conventional optimized process and much lower in efficiency than the ice bank system. However, this is due to increased condensing pressure for obtaining high water temperatures. 
         [0076]    4) Baseline application as in 1) plus as in 2) plus as in 3) plus external heat drain (i.e. district heating). Dependent on food retail store size, there may be more high temperature discharge energy available after the basic sanitary water needs have been satisfied. In this case, it is assumed to be at the same amount as energy used for sanitary purposes. This will normally be the case, however, food retail stores with large bakery or slaughter departments may have a different ratio between sanitary water needs and high temperature discharge. Especially the opportunity of selling unlimited energy to a thermal drain (e.g. district heating) is a splendid Demand-Response feature. In the calculations, selling price of heat is assumed to be only 50% of the gas price. It is worth noting that the compressor running cost is higher than seen in  FIG. 7  showing the compressor cost minus the revenue from selling energy to the thermal grid. 
         [0077]    It has to be mentioned that Demand-Response also includes the possibility of including very short term response abilities, e.g., compressor cut-out within few seconds. Dependent on regions, this can be a very profitable capability to include. Normally, a once per year payment is submitted for having the capacity reserve available a limited amount of times per year. This extra Demand-Response benefit is not reflected in the calculations. 
         [0078]    The following section describes an example of optimization of the cost of running the combined cooling and heating system, which includes the possibility of delivering heat to both a district heating system and to the local heat system, i.e. tap water and space heating, in the supermarket. 
         [0079]    The object of optimization is to minimize the total cost of energy consumption for both the refrigeration system and the heating system. With heat reclaim the refrigeration system will be able to deliver heating by compromising the efficiency of the refrigeration process. The trade-off decision can be described by the following optimization formulation 
         [0000]    
       
         
           
             
               
                 min 
                 
                   COP 
                   , 
                   
                     
                       Q 
                       . 
                     
                     heat 
                   
                   , 
                   
                     
                       Q 
                       . 
                     
                     headdist 
                   
                   , 
                   
                     
                       Q 
                       . 
                     
                     cooldist 
                   
                 
               
                
               
                 J 
                  
                 
                   ( 
                   t 
                   ) 
                 
               
             
             = 
             
               
                 
                   α 
                    
                   
                     ( 
                     t 
                     ) 
                   
                 
                 · 
                 
                   
                     ∫ 
                     
                       τ 
                       0 
                     
                     
                       τ 
                       1 
                     
                   
                    
                   
                     
                       
                         W 
                         . 
                       
                       El 
                     
                      
                     
                         
                     
                      
                     
                        
                       τ 
                     
                   
                 
               
               + 
               
                 
                   β 
                    
                   
                     ( 
                     t 
                     ) 
                   
                 
                 · 
                 
                   
                     ∫ 
                     
                       t 
                       0 
                     
                     
                       t 
                       1 
                     
                   
                    
                   
                     
                       
                         Q 
                         . 
                       
                       heat 
                     
                      
                     
                         
                     
                      
                     
                        
                       τ 
                     
                   
                 
               
               - 
               
                 
                   γ 
                    
                   
                     ( 
                     t 
                     ) 
                   
                 
                 · 
                 
                   
                     ∫ 
                     
                       τ 
                       0 
                     
                     
                       τ 
                       1 
                     
                   
                    
                   
                     
                       
                         Q 
                         . 
                       
                       heatdist 
                     
                      
                     
                         
                     
                      
                     
                        
                       τ 
                     
                   
                 
               
               - 
               
                 
                   ɛ 
                    
                   
                     ( 
                     t 
                     ) 
                   
                 
                 · 
                 
                   
                     ∫ 
                     
                       τ 
                       0 
                     
                     
                       τ 
                       1 
                     
                   
                    
                   
                     
                       
                         Q 
                         . 
                       
                       cooldist 
                     
                      
                     
                         
                     
                      
                     
                        
                       τ 
                     
                   
                 
               
             
           
         
       
     
       Subject to: 
       [0000]    
       
         
           
             “System dynamics” 
           
         
       
     
         [0000]      COP( t )· {dot over (W)}   El   ≧{dot over (Q)}   ref  
 
         [0000]    
       
      
       {dot over (Q)} 
       reject 
       ≧{dot over (Q)} 
       heatmin  
      
     
         [0081]    The combined energy costs for refrigeration and heating is given by J(t), where the first term is the cost contribution from the refrigeration plant. The refrigeration cost is given by multiplying the price on electrical energy, α(t), with the integral of the electrical power, {dot over (W)} El . The cost contribution for the secondary heat source, e.g. district heating or gas, is described by the second term of J(t), where the time varying price of the secondary energy source, β(t), is multiplied with the integral of the heating power, {dot over (Q)} heat . The third term of J(t) denotes the possible income from delivering heat energy to a district heating system. The time variant price of the compensation is denoted by γ(t) and the delivered heat is denoted by {dot over (Q)} heatdist . The fourth term describes the possible income from absorbing energy from a district cooling system. The time variant price of the compensation is denoted by ε(t) and the absorbed energy is denoted by the integral of {dot over (Q)} cooldist . The object of optimization is then to choose COP, {dot over (Q)} heat , {dot over (Q)} heatdist  and {dot over (Q)} cooldist , such that J(t), the combined energy cost, is minimized without violating any of the constraints. The optimization will of course have to take the dynamics of the system into account when designing a control strategy for realizing an optimization of J(t). In addition, there will be a constraint on the delivery of refrigeration given by the second constraint. The combined required cooling energy is given the following equations: 
         [0000]    
       
      
       {dot over (Q)} 
       refload 
       ={dot over (Q)} 
       ref 
       +{dot over (Q)} 
       np 
       +{dot over (Q)} 
       cooldist 
       +{dot over (Q)} 
       icestorage  
      
     
         [0082]    The heat transfer rate that is required for removing sufficient amount of energy from the stored goods in the various display cases is denoted by {dot over (Q)} ref . The remaining terms denote energy contributions from different cooling applications that can be attached to the refrigeration system to ensure that delivery of heat can be fulfilled. The term {dot over (Q)} hp  denotes the heat transfer rate to a heat pump evaporator and {dot over (Q)} cooldist  is the heat transfer rate to a heat pump evaporator which is connected to a district cooling system. The last term {dot over (Q)} icestorage  denotes the heat transfer rate to the evaporator in the ice storage tank which can be used to move the consumption of energy for the refrigeration plant in time and thereby be used as an assert in cost optimization scheme. 
         [0083]    The constraint with respect to the heat transfer rate of the rejected heat, {dot over (Q)} reject , has to be equal to or larger than some minimum requirement. The combined rejected heat transfer rate can be described by the following equation: 
         [0000]    
       
      
       {dot over (Q)} 
       reject 
       ={dot over (Q)} 
       amb 
       +{dot over (Q)} 
       hr 
       +{dot over (Q)} 
       heatdist  
      
     
         [0084]    The heat transfer rate to the ambient is denoted by, {dot over (Q)} amb , and the heat transfer rate to the heat reclaim system is denoted by, {dot over (Q)} hr . The last term, {dot over (Q)} heatdist , denotes the heat transfer rate to the district heating system. The minimum requirement for, {dot over (Q)} reject , is given by the physically determined minimum, {dot over (Q)} heatmin , which is dependent on the refrigeration load, {dot over (Q)} refload , and the isentropic efficiency of the compressors in the system. The operational scenarios will determine which of the terms in the equation describing {dot over (Q)} refload  will be non-zero, other than {dot over (Q)} ref . The operational conditions can course {dot over (Q)} reject ={dot over (Q)} amb  or {dot over (Q)} reject ={dot over (Q)} hr +{dot over (Q)} heatdist  or anything in between. 
         [0085]    The optimization formulation described reduces considerably when seasonal and geographical assumptions are applied. In a winter operation mode, the natural load on the refrigeration system will be at a minimum and the heat produced will therefore also be at a minimum, thus delivering district heating becomes infeasible without absorbing energy from a heat pump evaporator, district cooling or ice storage. However, the need for district cooling will be at a minimum during winter and the price will therefore be too low. 
         [0086]    Optimization strategy will be based on the ability to predict the cost function J(t) over a reasonable period of time, e.g. 24 hours. The price on electrical energy for a given hour will typically be known 24 hours in advance; this is also assumed to be true for the other prices used in J(t). Combining the price forecast with weather forecast will provide a basis for choosing operational scenario and thereafter minimizing the total energy cost. The minimization of J(t) for a given operational scenario is achieved by choosing COP, {dot over (Q)} heat , {dot over (Q)} heatdist  and {dot over (Q)} cooldist  without violating the constraints. The optimization should be repeated at each time step by using measurements to initiate the optimization. The solution will be updated at each time step and will therefore be able to account for changes in the weather, the operational scenario and/or the prices. 
         [0087]    The invention further provides a controller for controlling an integrated cooling and heating facility, the controller being capable of controlling the integrated cooling and heating facility based on a method as described above. 
         [0088]    Furthermore, the invention provides an integrated cooling and heating facility comprising at least one controller as described above, wherein the integrated cooling and heating facility is a refrigeration facility comprising a heat recovery system, and an integrated cooling and heating facility comprising at least one controller as described above, wherein the integrated cooling and heating facility is a heat pump comprising a cooling recovery system. 
         [0089]    The present invention may be defined by means of the following clauses. 
         [0090]    1. Method of controlling a cooling facility, the method comprising the steps of: 
         [0091]    establishing the cost for operating the cooling facility, the cost comprising establishment of a Demand-Response, the demand being a demand for heat generated by the cooling facility and to be transferred to a heat consuming entity, and the response being controlling the cooling facility depending on the demand and depending on costs for operating the cooling facility and for responding to the demand, 
         [0092]    the response comprising controlling one or more operating parameters of the cooling facility based on demand from one or more heat consuming entities of a smart grid which the cooling facility is connected to, and 
         [0093]    the demand comprising consume of heat of one or more of the following heat consuming entities being part of the smart grid which the cooling facility is connected to: a heat consuming entity within a building of the cooling facility, a heat consuming entity outside the building of the cooling facility, an intermediate heat consuming entity for draining heat from the cooling entity to a heat consuming entity, and 
         [0094]    where a supplemental energy consuming entity is capable of storing thermal energy within a thermal energy storing medium of the entity, the thermal energy stored in the medium being transferred to an entity of the cooling facility at a time of day later than a time of day, when the thermal energy is stored in the entity. 
         [0095]    2. Method according to clause 1, where 
         [0096]    the cooling facility is a refrigeration system of a supermarket or a cold store, and where the heat consuming entity is commercial or industrial heating installations of the building of the cooling facility, 
         [0097]    the heat consuming entity heating an interior within the building and/or the heat consuming entity heating water consumed by persons and/or consumed by heating facilities within the building. 
         [0098]    3. Method according to clause 1, where 
         [0099]    the cooling facility is a refrigeration system of a supermarket or a cold store, and where the heat consuming entity is a heat draining medium of the smart grid which the cooling facility is connected to, 
         [0100]    the heat draining medium of the smart grid draining heat generated by the cooling facility to commercial or industrial heating installations outside the building of the cooling facility. 
         [0101]    4. Method according to any of the preceding clauses, where 
         [0102]    the cost of operating the cooling facility furthermore comprises establishment of the cost of electrical energy for operating the cooling facility, and where 
         [0103]    the method comprises comparing cost of electrical energy and possible income for transferring heat generated by the cooling facility to the one or more heat consuming entities, and 
         [0104]    operating the cooling facility so that a coefficient of performance (COP) is optimized based on the comparison between cost of electrical energy for operating the cooling facility and possible income of heat generated and transferred to the one or more heat consuming entities. 
         [0105]    5. Method of controlling a cooling facility, the method comprising establishing the cost of operating the cooling facility, the cost being established based on the following equation: 
         [0000]    
       
         
           
             Cost 
             = 
             
               
                 SUM 
                  
                 
                   ( 
                   
                     
                       X 
                       COP 
                     
                     * 
                     Pe 
                   
                   ) 
                 
               
               + 
               
                 Y 
                 * 
                 Ph 
               
               - 
               
                 SUM 
                  
                 
                   ( 
                   
                     X 
                     * 
                     
                       ( 
                       
                         1 
                         + 
                         
                           1 
                           COP 
                         
                       
                       ) 
                     
                     * 
                     Ph 
                   
                   ) 
                 
               
             
           
         
       
     
         [0000]    where X is ‘Time multiplied with cooling capacity’, Pe is ‘Price of electrical energy’, Y is ‘Amount of energy available from non-electrical energy’ such as gas, and Ph is ‘Price of non-electrical energy’. 
         [0106]    6. A method according to clause 5, where 
         [0107]    cost includes different costs of consuming electrical energy and/or non-electrical energy and possibly also cost of transferring thermal energy, preferably heat, possibly cold, during a period of time, the different costs comprising at least one of the following different cost schemes: costs of the cooling facility consuming electrical energy during the period of time, costs of cooling facility consuming non-electrical energy during the period of time, costs of one or more heat consuming entities consuming heat during the period of time, costs of one or more cold consuming entities consuming heat during the period of time costs of transferring heat from the cooling facility to one or more heat consuming entities during the period of time, costs of transferring cold from the cooling facility to one or more cold consuming entities during the period of time. 
         [0108]    7. Method according to clause 1, where the cooling facility comprises an ice bank, the ice bank being capable of storing thermal energy provided by the cooling facility, and the method furthermore comprising the step of freeing cooling capacity stored in the ice bank, when cooling capacity of the cooling facility is needed, and with the proviso that heat produced by the heat dissipating heat exchanger and to be consumed by any heat consuming entity of the smart grid, which the cooling facility is connected to, is not possible of being consumed by any heat consuming entity, when the cooling capacity of the cooling facility is needed. 
         [0109]    8. Method according to clause 1, where the cooling facility comprises an ice bank, the ice bank being capable of storing thermal energy provided by the cooling facility, and the method furthermore comprising the step of freeing cooling capacity stored in the ice bank, when cooling capacity of the cooling facility is needed, and when heat produced by the heat dissipating heat exchanger and to be consumed by any heat consuming entity of the smart grid which the cooling facility is connected to cannot be sold at a price higher than a selected limit price, when the cooling capacity of the cooling facility is needed. 
         [0110]    9. A controller for controlling a cooling facility, the controller being capable of controlling the cooling facility based on a method according to any of clauses 1-8. 
         [0111]    10. A cooling facility, the cooling facility comprising at least one controller capable of controlling the cooling facility based on a method according to any of clauses 1-8. 
         [0112]    The embodiments of the invention described above are provided by way of example only. The skilled person will be aware of many modifications, changes and substitutions that could be made without departing from the scope of the present invention. The claims of the present invention are intended to cover all such modifications, changes and substitutions as fall within the spirit and scope of the invention.
The invention describes energy cost saving potentials in a food retail system in context with a smart grid system utilising thermal storage and heat recovery technology. The invention is based on case examples and theoretical studies to describe the technology advantages. To obtain the cost optimisation in complex refrigeration systems, a method for minimisation of cost is described.