{'fraction_non_alphanumeric': 0.03456414160639513, 'fraction_numerical': 0.014389036924248191, 'mean_word_length': 4.620667522464698, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
CFD analysis of thermally induced thermodynamic losses in the reciprocating compression and expansion of real gases

The efficiency of expanders is of prime importance in determining the overall performance of a variety of thermodynamic power systems, with reciprocating-piston expanders favoured at intermediate-scales of application (typically 10–100 kW). Once the mechanical losses in reciprocating machines are minimized (e.g. through careful valve design and operation), losses due to the unsteady thermal-energy exchange between the working fluid and the solid walls of the containing device can become the dominant loss mechanism. In this work, gas-spring devices are investigated numerically in order to focus explicitly on the thermodynamic losses that arise due to this unsteady heat transfer. The specific aim of the study is to investigate the behaviour of real gases in gas springs and to compare this to that of ideal gases in order to attain a better understanding of the impact of real-gas effects on the thermally induced losses in reciprocating expanders and compressors. A CFD-model of a gas spring is developed in OpenFOAM. Three different fluid models are compared: (1) an ideal-gas model with constant thermodynamic and transport properties; (2) an ideal-gas model with temperature-dependent properties; and (3) a real-gas model using the Peng-Robinson equation-of-state with temperature and pressure-dependent properties. Results indicate that, for simple, mono- and diatomic gases, like helium or nitrogen, there is a negligible difference in the pressure and temperature oscillations over a cycle between the ideal and real-gas models. However, when considering heavier (organic) molecules, such as propane, the ideal-gas model tends to overestimate the pressure compared to the real-gas model, especially if the temperature and pressure dependency of the thermodynamic properties is not taken into account. In fact, the ideal-gas model predicts higher pressures by as much as 25% (compared to the real-gas model). Additionally, both ideal-gas models underestimate the thermally induced loss compared to the real-gas model for heavier gases. This discrepancy is most pronounced at rotational speeds where the losses are highest. The real-gas model predicts a peak loss of 8.9% of the compression work, while the ideal-gas model predicts a peak loss of 5.7%. These differences in the work loss are due to the fact that the gas behaves less ideally during expansion than during compression, with the compressibility factor being lower during compression. This behaviour cannot be captured with the ideal-gas law. It is concluded that real-gas effects must be taken into account in order to predict accurately the thermally induced loss mechanism when using heavy fluid molecules in such devices.


Introduction
Reciprocating machines have potential applications in the efficient conversion of external low and medium-grade heat (e.g. solar, geothermal, waste) to useful work. Piston expanders, for instance, are a viable alternative to turbomachines and other positive displacement (volumetric) expanders in organic Rankine cycles (ORCs) at intermediate-scales of application (typically 10-100 kW). They provide higher efficiencies at these lower power outputs and at off-design operating speeds which may occur due to the intermittent nature of the aforementioned heat sources. Other examples of reciprocating external-heat conversion devices include two-phase thermofluidic oscillators [1][2][3] and liquid-piston Fluidyne engines [4,5], both of which rely on liquid pistons to transfer the hydraulic power generated by periodic oscillations of pressure and volume of a suitable working fluid within an enclosed space.
In reciprocating machines, thermodynamic losses occur due to mechanical friction between moving parts, flow losses through valves and due to leakage, and irreversibilities due to heat transfer across finite temperature differences. In reciprocating compressors, for example, the majority of thermodynamic losses do not occur due to leakage or during the discharge or suction processes but during superheating [6]. Once mechanical losses are minimized, thermally induced losses can begin to dominate and must be taken into account. In reciprocating expanders and compressors, they can reach similar values as valve losses [7,8]. Thermally induced losses tend to peak around intermediate rotational speeds with Péclet numbers (defined in Sec. 2.1) on the order of 10. Reciprocating piston expanders in ORCs have speeds ranging from 50 to 4000 RPM [9][10][11] which translates into a Péclet number from somewhere around 500 to 50000 (assuiming a bore diamter of 10 cm). Thermofluidic oscillators have frequencies on the order of 0.01 to 1 Hz [1][2][3] which is equivalent to Péclet numbers from 0.1 to 100 (assuming a cylinder diameter of 2 cm).
To understand the basic irreversibility due to the periodic heat transfer without considering inlet and exit flows, we consider a gas spring-in which a fixed mass undergoes sequential compression and expansion within a closed space. In the present paper, a gas spring is simulated numerically using computational fluid dynamics (CFD). Gas springs do not include the complex effects of valve timing and gas exchange of reciprocating-piston devices while retaining the fluctuating heat exchange phenomena between the gas and the cylinder walls. Performance losses arising due to unsteady heat transfer occur even if the overall process is globally adiabatic (in the mean), since heat exchange between the gas and the cylinder wall across a finite temperature difference is an inherently irreversible process. Heat is transferred from the gas to the wall during compression when the gas temperature is higher than the wall temperature. During expansion, heat is returned back to the gas as its temperature falls below that of the wall. Even if the net fluctuating heat transfer is zero, a finite exergetic penalty is paid. Therefore, it is of primary importance, to quantify and characterize the heat exchange fluctuations between the fluid and the solid.
Early studies in this area were undertaken by Pfriem [12], who described analytically a phase difference between the heat flux and the temperature difference between the wall and the bulk gas. Lee [13] described the oscillating heat flux by developing a model for a complex Nusselt number at low Péclet numbers (or low frequencies). Experiments were conducted by Kornhauser and Smith [14,15] from which the thermal loss was evaluated for a wide range of Péclet numbers and different compression ratios. Additionally, these authors proposed empirical N u-Re correlations which accounted for the aforementioned phase difference with imaginary components. The correlation was only developed for low compression ratios and helium as a working fluid. Later on, Lekić and Kok [16] simulated Kornhauser and Smith's experiments with CFD simulations and examined local effects of temperature and pressure in the compression space.
The heat-conversion technologies of interest here commonly use more complex organic working fluids than those classically investigated in gas spring systems. This is especially valid for ORC engines and thermofluidic oscillators, which rely on refrigerants and hydrocarbons such as pentane, HFC-245fa or HFC-134a [17]. Lee [13] considered ideal gases while Kornhauser and Smith [14,15] experimented with light or noble gases such as hydrogen, helium and argon for which the ideal-gas law is an accurate approximation. However, in the temperature and pressure ranges relevant to this study (200-700 K, 0.5-10 bar) and for organic fluids, real-gas effects need to be considered. In this work, the irreversibility due to heat transfer is quantified while accounting for real-gas effects, specifically by employing different equations-of-state and by accounting for thermodynamic property variations due to pressure and temperature.

Problem setup
The geometry of the gas-spring arrangement is defined by the following parameters: bore diameter: d = 2r = 105 mm, stroke length: L s = 2r s = 78 mm, connecting rod length: L r = 149 mm, dead volume height: L dv = 14 mm. The geometry was chosen to match an experimental gas-spring apparatus [18]. The oscillatory Péclet number, P e, is used as a dimensionless measure for the rotational speed of the gas spring: where ω is the angular frequency, α 0 = k/ρc p is the time and spatially-averaged thermal diffusivity and D h = 4V md /A md is the hydraulic diameter at mid-stroke (V md and A md are the cylinder volume and surface area at mid-stroke). The thermal diffusivity is calculated with the thermal conductivity k, the density ρ and the specific heat capacity c p .
To quantify the thermal loss over one complete oscillation cycle, we define the thermal loss parameter ψ as the ratio of net work done on the gas during one cycle W com − W exp to the work done onto the gas just during compression W com : where TDC stands for top dead centre and BDC for bottom dead centre. The pressure inside the gas spring (assumed uniform) is represented by P and the volume by V .

Geometry and mesh
The CFD model was developed in the open-source code OpenFOAM (v. 2.1.1). As the geometry is axisymmetric ( Fig. 1(a)), the gas spring is modelled in two spatial dimensions. The simulation is performed over 10 cycles in order to reach a cyclic steady state, i.e. a state where the cycleto-cycle variation is below 0.5%. The geometry consists of a wedge with a width of 0.02 rad and there is only one layer of cells in circumferential direction. The changing volume of the compression space is modelled with a dynamic mesh, with the moving lower boundary representing the face of the piston. Every node in the mesh compresses vertically relative to the stationary cylinder head (top boundary) and the moving piston head (bottom boundary). Nodes closer to the piston move to a greater extent than nodes closer to the cylinder head. Thus, the mesh is distorted during compression/expansion as in Fig. 1(b). The mesh is modelled to have a cell aspect ratio of unity at mid-stroke so that the distortion at bottom dead center (BDC) is approximately equal to that at top dead center (TDC) in terms of the ratio of a cell's larger dimension to smaller dimension (if grading is not considered). The size of the cells decreases gradually towards the boundaries to increase the mesh resolution inside the boundary layers near the walls. At mid-stroke, the smallest cell radial dimension is one fourth of the largest cell radial dimension. The same is valid in axial direction. The mesh resolution used depends on the rotational speed where the total number of cells increases for higher speeds. A convergence study was carried out to investigate the independence of the results from the mesh resolution and the Courant number. For frequencies (speeds) around 100 RPM, for example, the mesh is sufficiently resolved at 90 × 90 [19].
The time step is controlled by a user-specified maximum Courant number Co max . For a given cell, the Courant number is defined as: where |u| is the magnitude of the flow velocity (flow speed) through a cell, ∆x is the cell size in the direction of the velocity vector and ∆t is the size of the time step. The time step is chosen such that the pre-set Co max value is never exceeded. Due to the dynamic mesh, the time step not only adapts to the flow velocity but also to the change in cell size. The maximum Courant number is set to Co max = 0.1 for speeds around 100 RPM. The compressible solver uses a modified version of coldEngineFOAM, provided by OpenFOAM for piston engines without combustion. This solver is based on the PIMPLE algorithm which is a combination of the SIMPLE (semi-implicit method for pressure linked equations) and PISO (pressure-implicit split operator).

Turbulence model
The simulations have shown that during the upstroke and the downstroke the velocity profile is primarily axial and uniform. There is, however, a significant velocity gradient in radial direction near the wall due to the no-slip boundary condition. Turbulence is generated in regions of high perpendicular velocity gradients to the main flow direction (shear) which require a sufficiently high inertial force to overcome the damping effect of the viscosity. This can occur in the boundary layer during the stroke. The boundary-layer or local Reynolds number Re δ can provide some insight into the transition behaviour of the boundary layer.
To the authors' knowledge, no critical Reynolds number is currently available to predict the transition from laminar to turbulent flow in such a (gas-spring) flow configuration. Merkli and Thomann [20] investigated experimentally the flow transition of the Stokes boundary layer in oscillating pipe flow where no significant compression of the fluid occurs. They observed a critical boundary Reynolds number of Re δ,c = 2u max / √ νω ≈ 400.
It is proposed to use this empirical result to determine whether turbulence must be accounted for in our simulations, with an instantaneous Re δ (φ) defined as: where φ is the crank angle (equivalent to piston position), u(φ) is the instantaneous piston velocity equivalent to the average flow velocity and ν(φ) is the instantaneous kinematic viscosity. The critical Reynolds number of Re δ,c = 400 occurs for propane gas springs at P e > 11000 or at speeds over 280 RPM and for nitrogen gas springs at P e > 8500 or at speeds over 680 RPM. The critical Reynolds number was not attained for gas springs using helium for the speeds considered in this study below 1000 RPM. Furthermore, Lekić and Kok [16] performed direct numerical simulations of compression and expansion of helium in a gas spring and found that turbulence has a negligible impact on the governing physical phenomena. For these reasons, the momentum balance equation solved in the current model is a laminar Navier-Stokes equation.

Real-gas effects
Both real and ideal-gas equations-of-state are compared in this study. The ideal-gas equationof-state is replaced by the Peng-Robinson equation-of-state for real gases [21]. Additionally, the temperature-dependent mole-specific heat capacity c 0 p (T ), enthalpy h 0 (T ) and entropy s 0 (T ) for ideal gases are calculated with temperature-dependent polynomials often referred to as JANAF or NASA heat capacity polynomials [22]. For brevity, only the heat capacity is shown here: With c 0 v = c 0 p − R, a correction of the thermodynamic properties for the density (or pressure) can be calculated from [21]: and:

Initial and boundary conditions
The initial conditions of the pressure and temperature within the gas-spring space are set at BDC (crank angle φ = −180 • ). For all cases, the initial pressure and temperature are set to 3 bar and 330 K. The wall temperatures are uniform and constant at 350 K. Adair et al. [23] observed in their experiments that the cylinder wall temperatures in reciprocating compressors oscillate by less than 1 K. The same temperature was selected for all wall boundaries (cylinder head, piston head and cylinder wall). The CFD simulations of Lekić and Kok [16] made the same assumption of constant and uniform wall temperature.

Influence of real-gas effects on temperature and pressure
Three gases were considered in this study: helium, nitrogen and propane. A similar Péclet number ranging from P e ≈ 360 to P e ≈ 540 was adopted for all three gases. Even for the same gas there are different P e at identical speeds because of variations in the mean thermal diffusivity. The rotational speeds considered were 250 RPM for helium, 25 RPM for nitrogen and 10 RPM for propane. Figures 2 and 3 show: (a) T -V and (b) P -V curves for the three substances when modelled as ideal gases with constant (solid blue) and temperaturedependent thermodynamic/transport properties (dashed red) and as real gases with density and temperature-dependent properties (dotted green). As expected, nitrogen and helium behave similarly regardless of the model, although, the temperatures are slightly overestimated compared to the real-gas model when assuming idealgas properties. The maximum deviations between the varying-property ideal-gas and the real-gas model for helium and nitrogen are 5 K and 4 K (or ≈ 1% of the average temperature) for the temperature and 0.14 bar and 0.60 bar (< 4% of average pressure) for the pressure respectively. The maximum temperature-deviation for propane is also very small: 6 K or 2%. However, propane shows non-negligible deviations for the pressure. One can see in the the P -V plot of Fig. 3(b) that both ideal-gas models -although they are in good agreement with each otherdeviate significantly from the real-gas simulation. At BDC where the pressure and temperature are at a minimum, the constant-property ideal-gas (blue in Figs. 2/3), varying-property idealgas (red) and the real-gas model (green) calculate similar pressure values of 2.9 bar, 2.9 bar and 2.8 bar respectively. However, when the pressure and temperature are high, the deviation between the pressure values of the different models is high: 24.2 bar, 23.4 bar and 18.0 bar for the constant-property model, varying property model and real gas model respectively. Because both ideal-gas models do not have a correction for the pressure (or density) dependency of the gas properties, they both deviate in the pressure by as much as 25% at TDC from the real-gas model.
Discrepancies between ideal and real gases can be understood via the compressibility factor Z = P v/RT , which is plotted in Fig. 4. By definition, Z = 1 for ideal gases and values different (and deviating further) from unity provide a measure for the magnitude of the real-gas effects. These tend to increase when one is close to the critical point or saturation, which for the cases considered, corresponds to low temperatures and high pressures. Figure 4 shows that Z is almost always equal to 1 at all crank angles for nitrogen. When propane is used, Z moves away from 1, especially at TDC where it can go as low as 0.75. The largest differences between the ideal and real-gas models are observed at this position. id. g., He, const. c p id. g., He, c p = c p (T ) real g., He, c p = c p (T, v) id. g., N 2 , const. c p id. g., N 2 , c p = c p (T ) real g., N 2 , c p = c p (T, v) (b) Figure 2. (a): T -V diagram and (b): P -V diagram for helium (no markers) at 250 RPM and nitrogen (with markers) for the ideal-gas model with constant thermophysical properties, P e = 446 for helium and P e = 371 for nitrogen (solid blue); ideal-gas model with temperaturedependent properties, P e = 502 for helium and P e = 355 for nitrogen (dashed red); and real-gas model with temperature and density dependent properties P e = 457 and P e = 355 for nitrogen (dotted green). Figure 5 shows the loss parameter ψ for helium, nitrogen and propane for varying Péclet numbers. The general trend which has been reported in previous work [13,14,16,24] is also observed here:  at low and high P e the loss is low, and a maximum is observed at an intermediate value which is around P e ≈ 10. The losses are as high as 28.0% of the compression work for helium, 18.6% for nitrogen and 8.9% for propane. At low Péclet numbers, the oscillation frequency is small, and there is enough time for any work done by the gas to be exchanged in the form of heat with the solid walls. The gas temperature remains constant and equal to the wall temperature, and therefore the system undergoes isothermal compression. On the other hand, the oscillation frequency is high at elevated Péclet numbers. The variation between compression and expansion occurs too quickly for significant heat transfer to occur, and the system experiences adiabatic compression and expansion. At intermediate Péclet numbers, a (net) work results from the interplay between both the non-zero internal energy of the gas and the non-zero heat transfer to the solid, leading to a net loss of work during the cycle. propane nitrogen Figure 4. Compressibility Z over a cycle for nitrogen and propane.

Thermally induced losses
At low P e, all three models predict similar loss values for helium and nitrogen, as shown in Fig. 5(a). When moving to P e > 10, one can observe that the constant property model slightly underestimates the loss compared to the other two alternatives. As for propane in Fig. 5(b), both ideal-gas models underestimate the thermal loss compared to the real-gas model across the whole Péclet number range. At P e ≈ 10 (where the losses peak), the differences between the models is greatest. The temperature-dependent ideal-gas model predicts a peak loss of 0.057 and the constant-property ideal-gas model predicts a peak loss of 0.068. On the other hand, the real-gas model shows a peak loss of 0.089. Real-gas effects increase the thermally induced losses significantly, which is not captured with the ideal-gas models.
We now define parameter λ as: as a measure of how non-ideal a gas behaves. It is higher during the expansion stroke than during compression meaning that the gas is less ideal during expansion. This is shown in Fig. 6(a) where λ is plotted against the cylinder volume in one oscillation cycle. This "asymmetry" between expansion and compression for real gases leads to an increased loss compared to ideal gases. For the case from Fig. 6(a) (P e ≈ 10), for example, the mean value for λ during compression is 0.09 while during expansion it is 0.11. The gas is less ideal during expansion than during compressions. Integrating λ with respect to the instantaneous volume of the cylinder provides a good measure of the asymmetry in gas behaviour between expansion and compression: The integral Λ gives the (non-dimensionalized) area enclosed within the plot of Fig. 6(a). If Λ > 0, then the mean compressibility factor is lower during expansion than compression (the gas is more non-ideal during expansion). The higher the value of Λ, the larger the "asymmetry" in compressibility factor between the expansion and compression strokes. This is plotted for different P e numbers in Fig. 6(b) using propane. The integral Λ is always positive for all Péclet numbers, and it has a maximum around P e ≈ 10 of Λ max = 0.096 where the loss (see Fig. 5(b)) also has its maximum. The difference between the real gas and ideal-gas loss ∆ψ is also shown in the same figure. It is defined as: where ψ RG and ψ IG are the thermally induced losses for the real and temperature-dependent ideal-gas model respectively. Figure 6(b) shows that ∆ψ behaves in accordance with Λ: a high asymmetry in λ = 1 − Z (high Λ) between expansion and compression leads to a large discrepancy in the losses between the models. At P e ≈ 10, the difference between the loss terms ∆ψ peaks at ∆ψ max = 0.032 corresponding to Λ max = 0.096. This corresponds to a difference in efficiencies (ratio of expansion work to compression work, also 1 − ψ) between 91.1% for the real gases and 94.3% for the ideal gas. Since the ideal-gas model has a constant compressibility factor Z = 1, strong changes in Z in the real-gas model will lead to large deviations between the two models. The increase in real-gas behaviour during expansion means that less work can be recovered. Therefore, the losses are higher when taking real-gas effects into account, however these deviations diminish as one moves away from P e ≈ 10.

Conclusion
A two dimensional CFD model of a gas-spring wedge has been developed to simulate the compression/expansion processes and thermally induced thermodynamic losses in gas springs. The model can also take real-gas effects into account by calculating pressure and temperaturedependent thermodynamic and transport properties and by using the Peng-Robinson equationof-state. Due to the low velocity of the flow and piston, the Reynolds numbers were well below the critical Reynolds numbers for the transition to turbulence in the boundary layer thereby allowing a laminar model to be used. The wall temperatures surrounding the gas were set to be uniform and constant. Three different gas models were compared: (1) an ideal-gas model with constant thermodynamic and transport properties, (2) an ideal model with temperaturedependent properties, and (3) a real-gas model based on the Peng-Robinson equation-of-state with pressure and temperature-dependent properties.
When comparing helium and nitrogen at Péclet numbers between 350 and 550, all three models show similar variations in pressure and temperature over the cycle. For propane, the ideal-gas models deviate from real-gas models especially at the higher pressures occurring at and near TDC where the deviation was as high as 25% for pressure. When comparing to the results of the real-gas model, the ideal-gas models overestimate the pressures and to a lesser extent the temperatures in these conditions. The compressibility factor Z, which is used here to quantify deviations from ideality, is almost always 1, but for propane Z falls down to 0.75 at TDC. This explains the discrepancies between the ideal and real-gas models of propane.
Thermally induced losses were evaluated and compared for the gases over a range of Péclet numbers. Significant differences between the models were only observed for propane: both ideal-gas models underestimate the thermal loss compared to the real-gas models of this gas. This occurs over the whole Péclet number range investigated indicating that real-gas effects can increase the thermally induced losses in gas springs. The highest difference between loss values was observed at peak loss (P e ≈ 10) where the real-gas loss was 8.9% of the compression work and the ideal-gas loss was 5.7% of the compression work. The reason behind the difference in the predicted losses between is the different gas behaviour during compression and expansion. Propane has a lower compressibility factor during expansion than compression, making it behave more like a real gas during the expansion stroke. For ideal-gas models, the compressibility factor is by definition always equal to unity. This increase in real-gas behaviour during expansion means less work is recovered and therefore higher losses over the cycle.