**1. Introduction**

Scroll compressors have been extensively employed in air conditioning and refrigeration since the 1980s. Their success is mostly related to a low level of noise and vibrations, together with a small number of moving parts and a compact design. In the last decade, scroll compressors and other positive displacement machines (PDMs, e.g., piston, screw, and vane machines) have been operated as expanders in Organic Rankine Cycles (ORCs) to generate power from waste heat and renewable energies [1]. Compared to its alternatives, the scroll expander is generally characterized by higher pressure ratios and efficiency and by lower flow rates and rotational speeds [2]. On the other hand, one of the major drawbacks of this technology is the maximum working temperature (maximum temperature of 250 ◦C reported by Seher et al. [3]): higher temperatures would increase excessively the thermal expansion of scroll spirals, leading to significant increments of internal leakages [4].

Scroll expanders are frequently adopted in micro-ORCs with power outputs up to 2 kW, as described in different literature works reporting experimental tests. Wang et al. [5] have tested a scroll expander with R134a over a wide range of rotational speeds, reaching a shaft work output close to 1 kW. Experimental characterizations of scroll expanders with R245fa are described in References [6,7], with maximum isoentropic efficiencies of 66.5% and 75.7%, respectively. Other tests using HCFC-123 and R134a as working fluids are analyzed in References [8,9].

The architecture of the scroll geometry is the cornerstone of the design and optimization of the whole machine. The inventor of this technology, Léon Creux, has introduced in 1905 a scroll profile based on the involute of a circle, which is still the most spread solution [10]. However, various alternative profile shapes have been developed during the XX century [11–13].

The expander is designed with a fixed built-in volume ratio, which is the volume of the discharge chamber at the beginning of the discharge phase divided by the volume of the suction chamber at its maximum extension. The built-in volume ratio determines the theoretical pressure ratio of the fluid expansion. Nonetheless, leakage flows, off-design operating conditions, and wear could commonly force the expander to work in under- or over-expansion conditions. The expander works in conditions of under-expansion when the internal pressure ratio imposed by the chambers volumes variation is lower than the system pressure ratio. Consequently, the pressure in the working chamber at the end of the expansion is higher than the pressure in the discharge area. This phenomenon produces a significant flow rate peak at the expander output when the discharge phase occurs. On the contrary, over-expansion occurs when the internal pressure ratio of the expander is higher than the system pressure ratio. The fluid is then forced to flow back, leading to a recompression, which is particularly detrimental for the machine performance [8].

Currently, the most used methods for the design and the prediction of scroll expanders performance are based on theoretical modeling, thermodynamic analysis, and experimental studies. Shaffer et al. [14] have presented a control volume approach to model the geometry of a scroll machine. The analytical and thermodynamic modeling of scroll compressors is extensively treated in References [15–19], with and without experimental validation. For what concerns the scroll expander, Ma et al. [20] have presented a dynamic model with experimental validation, introducing an overall dynamic friction coefficient of the machine to enhance the model adaptability. Lately, Bell et al. and Ziviani et al. have presented [21] and demonstrated the capabilities [22] of an open-source general framework for the simulation of various positive displacement machines, including scrolls. When the geometry of the scroll expander is not exactly known, deterministic models similar to the ones reported above are not suitable options. Lemort et al. [8] have developed and validated a semi-empirical model that requires a limited number of parameters. Examples of similiar studies for scroll and other positive displacement expanders are reported in References [23–27].

Recently, industries and researches have began to include Computational Fluid Dynamics (CFD) analyses in scroll machine designs and optimizations [28–33]. This tool allows to retrieve information about leakage flows nature, temperature distribution, and three-dimensional behavior of the flow inside the expander/compressor. Moreover, CFD could be employed to tune analytical and thermodynamic models as low-cost alternatives to experimental campaigns. One of the most challenging aspects of computational analyses of scroll machines (and positive displacement machines in general) is the grid generation process.

The nature of the problem imposes to adopt a dynamic mesh approach in order to correctly model the moving parts of the machines. Casari et al. [34] have reviewed different approaches for the dynamic mesh treatment in screw machines numerical analyses, including immersed boundary, adaptive remeshing, and key-frame remeshing. Most of the techniques presented in their work are suitable also for scroll expanders and compressors, but the most popular approach is certainly the custom predefined mesh generation [35]. This technique consists in the realization of a user-defined number of grids per rotor pitch. Each grid represents a set of control points (coordinates) through which the mesh nodes has to pass during the simulation. Several examples of this approach can be found in the literature, including applications to screw machines [36–39], root machines [40,41], and scroll machines [28,31,42,43].

In this work, the authors present a C++ library for the generation of structured body-fitted meshes of scroll compressors and expanders. Starting from the scroll profiles and main dimensions, the meshes are generated by means of an elliptic grid generation algorithm. This library has been realized in accordance with the coding standards of the open-source CFD software OpenFOAM. Furthermore, the authors have performed a full three-dimensional CFD analysis of a scroll expander suitable for micro-ORC applications. The library developed can be a useful tool for the development of structured meshes of scroll machines. One of the possible outcomes of this work could be the realization of advanced numerical analysis of ORC systems, such as the Whole ORC Model (WOM) presented in Reference [44].
