The present study presents CFD simulations of a liquid-piston compressor with metal foam inserts. The term "liquid-piston" implies that the compression of the gas is done with a rising liquid-gas interface created by pumping liquid into the lower section of the compression chamber. The liquid-piston compressor is an essential part of a Compressed Air Energy Storage (CAES) system. The reason for inserting metal foam in the compressor is to reduce the temperature rise of the gas during compression, since a higher temperature rise leads to more input work being converted into internal energy, which is wasted during the storage period as the compressed gas cools. Liquid, gas, and solid coexist in the compression chamber. The two-energy equation model is used; the energy equations of the fluid mixture and the solid are coupled through an interfacial heat transfer term. The fluid mixture, which includes both the gas phase and the liquid phase, is modeled using the Volume of Fluid (VOF) method. Commercial CFD software, ANSYS FLUENT, is used, by applying its default VOF code, with user-defined functions to incorporate the two-energy equation formulation for porous media. The CFD simulation requires modeling of a negative momentum source term (drag), and an interfacial heat transfer term. The first one is the pressure drop due to the metal foam, which is obtained from experimental measurements. To obtain the interfacial heat transfer term, a compression experiment is done, which provides instantaneous pressure and volume data. These data are compared to solutions of a zero-dimensional compression model based on different heat transfer correlations from published references. By this comparison, a heat transfer correlation which is most suitable for the present study is chosen for use in the CFD simulation. The CFD simulations investigate two types of metal foam inserts, two different layouts of the insert (partial vs. full), and two different liquid piston speeds. The results show the influence of the metal foam inserts on secondary flows and temperature distributions.