The current study presents a numerical model of a CTES unit using PCM as the storage medium and CO2 as refrigerant. The heat exchanger in the CTES unit consists of a stack of pillow plates immersed into a stainless-steel container filled with PCM. The charging and discharging processes of the PCM-CTES unit are carried out through evaporation and condensation of the CO2 circulating inside the plates, respectively. The dynamic model of the PCM-CTES unit is developed in the object-oriented programming language Modelica using the component library TIL-Suite. The model of the PCM-CTES unit is validated by using previously published experimental data from a test facility with an identical setup. Various heat exchanger configurations, storage medium and refrigerant parameters are tested, and the model demonstrates good agreement with the experimental data.