**4. Conclusions**

In this work, a new meshing tool developed in C++ has been proposed. The capability of this tool to manage a fully 3D CFD simulation is proven by the analysis of a commercial scroll compressor in an open-source CFD environment, i.e., OpenFOAM. The results that are presented here are in line with what has been found in previous numerical investigations of the same scroll machine. Those calculations, on the other hand, have been performed with commercial software, and this work provides a tool for performing CFD analysis in a positive displacement machine with open-source software. Moreover, an imbalance in mass of the order of 0.1%, which represents a very good level of accuracy, has been reached.

The application of *ScrollFOAM* provides a unique tool for the numerical investigation of refrigerant behaviour in scroll machine with open-source tools. The procedure has been demonstrated for an expander. This tool can be used to foresee the off-design behaviour of the ORC cycle in terms of output power performance. Variations in the boundary conditions have been tested, and the solver proves to be robust and accurate in catching over- and under-expansions. The suitability of the entire infrastructure to the investigation of ORC cycles is enhanced by the coupling of the solver with CoolFOAM, the CoolProp wrapper for OpenFOAM. With such an expedient, the real gas modeling gains in accuracy as the Helmholtz equation of state can be used. The tool developed in this work is a fundamental step for achieving the WOM infrastructure, as the state-of-the-art in fast and robust simulation of positive displacement machines in OpenFOAM is limited to piston-type expanders. The extension of the modeling capabilities to other types of machines is needed for a more spread usability of CFD in ORC cycles.

**Author Contributions:** E.F. and N.C. methodology, conceptualization, and writing original draft; E.F. software and data curation; M.P. supervision and funding acquisition; A.S. writing—review and editing. All authors have read and agreed to the published version of the manuscript.

**Funding:** The research was partially supported by the Italian Ministry of Economic Development within the framework of the Program Agreement MSE-CNR "Micro co/tri generazione di Bioenergia Efficiente e Stabile (Mi-Best)".

**Conflicts of Interest:** The authors declare no conflict of interest.
