Automatic Mesh Motion, Topological Changes and Innovative Mesh Setup for I.C.E. CFD Simulations Tecniche Innovative per la Generazione, il Trattamento e il Moto di Mesh per la Simulazione di Motori a Combustione Interna con Codici di Calcolo CFD

Mesh generation, handling and motion have been a bottleneck for 3-D simulation of in-cylinder phenomena of internal combustion engines. The geometry is complex and there are moving boundaries such as piston and valves. Due to the complex geometry, the mesh generation can be difficult and unstructured grids are generally used. Furthermore piston and valve motion require to move the mesh points and promote the need to change the mesh topology for different piston and valve positions, to keep a high mesh quality. A new approach for moving meshes in internal combustion engine simulations is presented in this work. It combines the automatic mesh motion techniques with a series of topological changes which allow to add or remove cell layers or to deal with dynamically connected surfaces like valves or scavenging ports. The proposed approach should simplify the common methodology used for engine simulations where usually the point motion is provided from pre-calculated positions or by interaction with a pre-processor or a mesh generator. A mesh setup for both two-stroke and four-stroke engines has been proposed and an incompressible flow solver was developed in order to test if the governing equations are correctly solved on moving meshes with topological changes. INTRODUCTION Nowadays simulation tools can provide very useful information for internal combustion engine design and optimization in a relatively short time. In particular, CFD codes give a better insight into the physical processes which take place within the cylinder and some other components of the intake and exhaust systems. Concerning in-cylinder simulations, the Finite Volume Method (FVM) is applied to moving and unstructured meshes, in order to model the behaviour of turbulent, compressible and reactive flows. This makes this subject very demanding and requires a reliable computational tool. On one side it has constantly to deal with new physical and numerical models, and on the other it must be flexible with respect to mesh structure and geometry handling to accommodate moving boundaries. While the motion is solely defined on boundary points, most CFD codes require to specify the position of every vertex for any time-step in the mesh. This can be done in different ways, most commonly using "mesh generation" techniques, like smoothing. In practice this is quite limiting, as it becomes difficult to prescribe solution-dependent motion or perform mesh motion on dynamically adapting meshes. In the present work an automatic mesh motion algorithm has been adopted. It uses a second-order FEM scheme, in which the user defines how the vertices on the boundary move, using a set of boundary conditions [1]. As nothing is done in advance of the solution, the boundary motion is "built into to code" and can be an arbitrary function of the solution. Then a Laplace equation is solved on the vertices to calculate the motion of all vertices based on the boundary motion. This equation is solved directly on vertices as doing it on volumes is not satisfactory. Additionally, to create a valid mesh, it must be guaranteed that no "crossover" in the mesh is created when executing mesh motion. In this way the position of internal points is determined from the prescribed boundary motion so that the initial mesh remains valid. To preserve the mesh quality during extreme boundary deformations due to piston and valve motion, the number of the cells in the mesh needs to be changed. For this reason a set of “topological changes” has been implemented, which concerns the possibility of attaching or detaching boundaries, adding or removing cell layers and sliding cells interfaces. Finally, the proposed algorithms have been embedded in the object-oriented, open-source OpenFOAM code [2], and tested on mesh configurations aimed at reproducing the most common ones used in internal combustion engine simulations. FINITE VOLUME METHOD ON MOVING MESHES The integral form of the conservation equation for a tensorial property φ defined per unit mass in an arbitrary moving volume V bounded by a closed surface S states [1]: ( ) b V S S V d dV d d dV dt φ φ ρφ ρ ρ + ⋅ − = − ⋅ + ∫ ∫ ∫ ∫ s u u s q S (1) where ρ is the density, u is the fluid velocity, ub is the boundary velocity and qφ and Sφ are the surface and volumes sources/sinks of φ, respectively. As the volume V is no longer fixed in space, its motion is captured by the motion of its bounding surface S by the velocity ub. Compared with the FVM on a static mesh (e.g. [4]), the second-order FV discretization of the Equation (1) shows only two differences: the temporal derivative introduces the rate of change of the cell volume and the mesh motion flux accounts for the grid convection. The relationship between the two is governed by the space conservation law [5]: 0 b V S d dV d dt − ⋅ = ∫ ∫ s u (2) The unstructured FVM method splits the computational space into a finite number of polyhedral cells bounded by complex polygons which do not overlap and completely cover the domain. The temporal dimension is split into a finite number of time-steps and the equations are solved in a time-marching manner. A sample cell around the computational point P located in its centroid, a face f, its area vector sf and the neighbouring computational point N are shown in Figure 1. Figure 1 Finite volume cell. While Equation (2) is always satisfied in the integral form, it also needs to be preserved in the discrete form: 0 0 n P P S f V V F t − − = ∆ ∑ (3) For this reason, the mesh motion flux Fs is calculated as the volume swept by the face f in motion during the current time-step rather than from the grid velocity ub, making it consistent with the cell volume calculation [1]. MESH DEFINITION AND MOTION It is necessary to distinguish from boundary motion and internal point motion. In internal combustion engines boundary motion is prescribed by the engine geometry and speed. Internal point motion has to accomodate changes in the domain shape and preserve the validity and quality of the mesh. Furthermore, it influences the solution only through mesh-induced discretisation errors [6] and is therefore detached from the remainder of the problem. Consequently, internal point motion can be specified in a number of ways, ideally without user interaction [1]. Automatic mesh motion provides great advantage, both in terms of easier and faster case setup, also allowing for dynamically changing topology or automatic improvements of the mesh quality. The objective of automatic mesh motion is to determine internal point motion (not involving topological changes) to conform with given boundary motion while preserving mesh validity and quality. Mesh definition and validity. A valid mesh is a pre-requisite for a good numerical solution and a critical ingredient of automatic mesh motion. The investigation of mesh validity can be separated into topological and geometrical tests. The first group contains the tests that can be performed without knowing the actual point positions, while the second deals with the shape of cells and the boundary [1]. Face based mesh definition. In the face-addressed mesh definition, a polyhedral mesh for the FVM is defined by the following components: • A list of points. For every point, its space co-ordinates are given; the point label is implied from its location in the list. • Every point must be used in at least one face; • A list of polygonal faces, where a face is defined as an ordered list of point labels. Faces can be separated into internal (between two cells) and boundary faces. Every face must be used by at least one cell; • A list of cells defined in terms of face labels. Note that the cell shape is unknown and irrelevant for discretisation; • Boundary faces are grouped into patches, according to the boundary condition. A patch is defined as a list of boundary face labels. Face orientation is determined using the right-hand rule and the face list will first collect all internal faces and then all boundary faces patch by patch in the order of patch definition. Internal faces are ordered to contain all faces from the first cell with the increasing neighbour label, followed by the faces owned by the second cell etc. This approach has proven to be robust and easy to handle as it enforces strict and unique face ordering [1]. Topological tests. Topological validity tests consist of the following criteria: • A point can appear in a face only once; • A face can appear in a cell only once. A face cannot belong to more than two cells. A boundary face can belong to only one patch; • Two cells can share no more than one face; • Collecting all faces from one cell and decomposing faces into edges, every edge must appear in exactly two cell faces; • Collecting all faces from the boundary and decomposing faces into edges, every edge must appear in exactly two boundary faces. The first four conditions control the validity of the mesh definition while the last two check that all cells and the boundary hull are topological closed. Additionally, mesh ordering rules are checked and enforced. Geometrical tests. Geometrical tests deal with the positivity of faces areas and cell volumes, as well as convexity and orientation requirements. Geometrical validity criteria can be summarized as follows: • All faces and cells must be weakly convex; • All cells must be geometrically closed: the sum of the outward-pointing face area vectors for a cell faces must be zero to machine tolerance; • The boundary must be geometrically closed; • For all the internal faces, the dot-product of the face area vectors sf and the PN f = d , Figure 1, must be positive; this is usually termed the orthogonality test: