Digital twins, an emerging technology, are widely used in various industries. It builds a virtual space by mirroring a physical space and performs different simulations to solve problems that are complicated or impossible to solve in the physical space. Livestock farming in agriculture is evolving rapidly with the introduction of various information and communication technologies for digital farming. However, only few studies have examined the digital twin in terms of HVAC systems directly related to productivity in livestock farming. Here, we propose a novel digital twin framework for livestock farming focusing on pig houses. Livestock farming is one of perspective areas where digital twins can provide benefits for the growth of livestock and their operation in an efficient manner. To validate effect of the proposed digital twin framework for a pig house, we perform various simulations using a real-world dataset of a pig house. As a result of analyzing the energy demands for heating in pigsty based on the digital twin framework, the fan-coil unit was found to be the most energy efficient. In addition, when the optimal control of the HVAC system was applied, it was found to be more energy efficient than the conventional control method. The results obtained in this study show that our approach is superior to existing operational conventions, particularly in terms of energy efficiency.INDEX TERMS Digital livestock farming, digital twin, energy, simulation.