scieee AI-readable full text Open interactive document viewer

The Fixed-Mesh ALE approach for the numerical approximation of flows in moving domains

Codina, Ramon,Houzeaux, Guillaume,Coppola Owen, Ángel H.,Baiges Aznar, Joan

Abstract

In this paper we propose a method to approximate flow problems in moving domains using always a given grid for the spatial discretization, and therefore the formulation to be presented falls within the category of fixed-grid methods. Even though the imposition of boundary conditions is a key ingredient that is very often used to classify the fixed-grid method, our approach can be applied together with any technique to impose approximately boundary conditions, although we also describe the one we actually favor. Our main concern is to properly account for the advection of information as the domain boundary evolves. To achieve this, we use an arbitrary Lagrangian- Eulerian framework, the distinctive feature being that at each time step results are projected onto a fixed, background mesh, that is where the problem is actually solved.

Full text

The Fixed-Mesh ALE approach for the numerical approximation of flows in moving domains Ramon Codina1,∗, Guillaume Houzeaux2, Herbert Coppola-Owen1and Joan Baiges1 1International Center for Numerical Methods in Engineering (CIMNE), Universitat Polit` ecnica de Catalunya, Jordi Girona 1-3, Edifici C1, 08034 Barcelona, Spain. 2Barcelona Supercomputing Center, Jordi Girona 29, Edifici Nexus II, 08034 Barcelona, Spain. ∗[email protected] Contents 1 Introduction 2 2 The Fixed-Mesh ALE method 3 2.1 The classical ALE method and its finite element approximation . . . . . . . . . . . . . . . . . . . . . . . . 3 2.1.1 Problem statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.1.2 The time-discrete problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2.1.3 The fully discrete problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.2 The fixed-mesh ALE approach: algorithmic steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.3 Other fixed grid methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3 Developing the Fixed-Mesh ALE method 10 3.1 Step 1. Boundary function update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 3.2 Step 2. Mesh velocity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 3.3 Step 3. Solving the flow equations I: Equations on the deformed mesh . . . . . . . . . . . . . . . . . . . . . 11 3.4 Step 4. Splitting of elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.5 Step 5. Solving the flow equations II: Equations on the background mesh . . . . . . . . . . . . . . . . . . . 12 3.6 Comparison with the classical ALE approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 4 Side numerical ingredients 13 4.1 Level set function update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 4.2 Approximate imposition of boundary conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 4.3 Data transfer between finite element meshes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 5 A numerical example 17 6 Two applications 21 6.1 Lost foam casting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 6.2 Free surface flows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 7 Conclusions 25 1 Abstract In this paper we propose a method to approximate flow problems in moving domains using always a given grid for the spatial discretization, and therefore the formulation to be presented falls within the category of fixed-grid methods. Even though the imposition of boundary conditions is a key ingredient that is very often used to classify the fixed-grid method, our approach can be applied together with any technique to impose approximately boundary conditions, although we also describe the one we actually favor. Our main concern is to properly account for the advection of information as the domain boundary evolves. To achieve this, we use an arbitrary Lagrangian- Eulerian framework, the distinctive feature being that at each time step results are projected onto a fixed, background mesh, that is where the problem is actually solved. 1 Introduction In many coupled problems of practical interest the domain of at least one of the problems evolves in time. The Arbitrary Eulerian Lagrangian (ALE) approach is a tool very often employed to cope with this domain motion. In this work we aim at describing a particular version of the ALE formulation that can be used in different coupled problems, and which we will apply to two problems in fluid mechanics. In the classical ALE approach to solve problems in computational fluid dynamics, the mesh in which the computational domain is discretized is deformed (see for example [13, 29, 27]). This is done according to a prescribed motion of part of its boundary, which is transmitted to the interior nodes in a way as smooth as possible so as to avoid mesh distortion. In this work we present an ALE-type strategy with a different motivation. Instead of assuming that the computational domain is defined by the mesh boundary, we assume that there is a function that defines the boundary of the domain where the flow takes place. We will refer to it as the boundary function. It may be given, for example, by the shape of a body that moves within the fluid, or it may need to be computed, as in the case of level set functions described in the paper. It may be also defined discretely, by a set of points. When this boundary function moves, the flow domain changes, and that must be taken into account at the moment of writing the conservation equations that govern the flow, which need to be cast in the ALE format. However, our purpose here is to explain how to use always a background fixed mesh. That requires a virtual motion of the mesh nodes followed by a projection of the new node positions onto the fixed mesh. The basic numerical formulation we will use consists of a stabilized finite element method to solve the ALE flow equations and finite difference time integration schemes. However, other discretization techniques could be applied, since the idea we want to expose is independent of the numerical method being used. This idea consists in projecting the results of the ALE deformed mesh onto a fixed background mesh at each time step, prior to solving the flow equations. It will be shown that at the end all the calculations can be performed on the fixed mesh, and in fact the ALE deformed mesh does not need to be explicitly built. We want to stress that this idea is independent on the way to impose boundary conditions on the moving boundary. The way to impose this prescription is often used to classify a particular fixed-mesh method. Since the physical boundary is contained in the domain actually discretized, these methods are often called immersed boundary methods. Moreover, since the fixed grid used is often Cartesian, these formulations can be found under the keywords Cartesian grid methods (see for example the reviews [42, 36, 35]). These methods are developed for constant-in-time domains, and then extended in a more or less ad-hoc way to time dependent domains. In spite of the fact that we want to distinguish between the way to deal with moving domains from the way of approximately imposing the boundary conditions on the moving boundary, we will briefly describe the particular approach we use. The paper is organized as follows. A general overview of the FM-ALE method is presented in 2 Section 2, starting with the discretization of the classical ALE formulation and then describing the algorithmic steps of the FM-ALE alternative. These steps are further elaborated in Section 3. Even though they are not intrinsic to the main idea of the method, there are three numerical ingredients that are essential for the success of the formulation. These are the definition and updating of the moving boundary, the approximate imposition of boundary conditions and the projection of data between two different finite element meshes. These “side ingredients” have been published before [10, 8, 24], but are here particularized to the FM-ALE method. They are described in Section 4. A simple numerical example, but containing all the features of the formulation, is presented in Section 5. We discuss then the application of the FM-ALE idea to two coupled problems of practical interest in Section 6. One is the simulation of lost foam casting [26]. In this case the flow is coupled to the heat equation because of the interface evolution, which is governed by the advance of the burning front of the molten metal used in the casting. Therefore, the boundary velocity is given and the normal stress on the fluid is unknown. The second problem considered is a classical free surface problem in which, once more, the free surface position is modeled by a level set function [12]. In this case, the velocity on the free surface is unknown, but the normal stress can be prescribed to zero (or to the atmospheric pressure). Some conclusions close the paper in Section 7. 2 The Fixed-Mesh ALE method In this section we describe the essential idea of the FM-ALE method. However, we start with the classical ALE formulation of the incompressible Navier-Stokes equations and their numerical approximation. 2.1 The classical ALE method and its finite element approximation 2.1.1 Problem statement Let us consider a region Ω0⊂Rd(d= 2,3) where a flow will take place during a time interval [0, T]. However, we consider the case in which the fluid at time toccupies only a subdomain Ω(t)⊂Ω0(note in particular that Ω(0) ⊂Ω0). Suppose also that the boundary of Ω(t)is defined by part of ∂Ω0and a moving boundary that we call Γfree(t) = ∂Ω(t)\∂Ω0∩∂Ω(t). This moving part of ∂Ω(t)may correspond to the boundary of a moving solid immersed in the fluid or can be determined by a level set function, as we will see in the applications. In order to cope with the time-dependency of Ω(t), we use the ALE approach, with the particular feature of considering a variable definition of the domain velocity. Let χtbe a family of invertible mappings, which for all t∈[0, T]map a point X∈Ω(0) to a point x=χt(X)∈Ω(t), with χ0=I, the identity. If χtis given by the motion of the particles, the resulting formulation would be Lagrangian, whereas if χt=Ifor all t,Ω(t) = Ω(0) and the formulation would be Eulerian. Let now t0∈[0, T], with t0≤t, and consider the mapping χt,t0: Ω(t0)−→ Ω(t) x07→ x=χt◦χ−1 t0(x0). Given a function f: Ω(t)×(0, T)−→ Rwe define ∂f ∂t ¯¯¯¯x0 (x, t) := ∂(f◦χt,t0) ∂t (x0, t),x∈Ω(t),x0∈Ω(t0). In particular, the domain velocity taking as a reference the coordinates of Ω(t0)is given by udom := ∂x ∂t ¯¯¯¯x0 (x, t).(1) 3 The incompressible Navier-Stokes formulated in Ω(t), accounting also for the motion of this domain, can be written as follows: find a velocity u: Ω(t)×(0, T)−→ Rdand a pressure p: Ω(t)×(0, T)−→ Rsuch that ρ·∂u ∂t ¯¯¯¯x0 (x, t) + (u−udom)· ∇u¸− ∇ · (2µ∇Su) + ∇p=ρf,(2) ∇ · u= 0,(3) where ∇Suis the symmetrical part of the velocity gradient, ρis the fluid density, µis the viscosity and fis the vector of body forces. Initial and boundary conditions have to be appended to problem (2)-(3). In the applications we have considered in Section 6, the boundary conditions on Γfree(t)can be of two different types: a) Free surface flows: p(or the normal stress) given, uunknown on Γfree; b) Lost foam casting: ugiven, p(or the normal stress) unknown on Γfree. On the rest of the boundary of Ω(t)the usual boundary conditions can be considered. In general, we consider these boundary conditions of the form u=¯ uon ΓD, n·σ=¯ ton ΓN, where nis the external normal to the boundary, σ=−pI+ 2µ∇Suis the Cauchy stress tensor and ¯ u and ¯ tare the given boundary data. The components of the boundary ΓDand ΓNare obviously disjoint and such that ΓD∪ΓN=∂Ω, and therefore time-dependent. 2.1.2 The time-discrete problem Let us start introducing some notation. Consider a uniform partition of [0, T]into Ntime intervals of length δt. Let us denote by fnthe approximation of a time dependent function fat time level tn=nδt. We will also denote δfn+1 =fn+1 −fn, δtfn+1 =fn+1 −fn δt , fn+θ=θfn+1 + (1 −θ)fn, θ ∈[1/2,1]. Even though other options are obviously possible, we will use the simple trapezoidal rule to discretize problem (2)-(3) in time. Suppose we are given a computational domain at time tn, with spatial coordinates labeled xn, and unand pnare known in this domain. The velocity un+1 and the pressure pn+1 can then be found as the solution to the problem ρhδtun+1¯¯xn+ (un+θ−un+θ dom)· ∇un+θi− ∇ · (2µ∇Sun+θ) + ∇pn+1 =ρfn+1,(4) ∇ · un+θ= 0,(5) where now δtun+1¯¯xn= (un+1(x)−un(xn))/δt, being x=χtn+θ,tn(xn)the spatial coordinates in Ω(tn+θ). The domain velocity given by (1), with x0=xn, is approximated as un+θ dom =1 θδt ¡χtn+θ,tn(xn)−xn¢.(6) Note that the order of accuracy of this approximation is consistent with the order of accuracy of (4)-(5), that is to say, it is 2 for θ= 1/2and 1 otherwise. We are interested only in the cases θ= 1/2and θ= 1 (implicit schemes are required). 4 Remark 1 The trapezoidal rule considered for the time integration, with a single mesh, satisfies the so called geometric conservation law (GCL) condition. However, there are second order accurate schemes based on multi-step time discretizations that do not satisfy it. The price to be paid is that these schemes are usually only conditionally stable, although stability conditions are often very mild and not encountered in practice (see for example the analyses in [1, 3, 16, 17, 38]). We will use one of such schemes in Section 5. 4 2.1.3 The fully discrete problem The next step is to consider the spatial discretization of problem (4)-(5). As for the time discretization, different options are possible. Here we simply describe the stabilized finite element formulation employed in our numerical simulations. Let {Ωe}n+1 be a finite element partition of the domain Ω(tn+1), with index eranging from 1 to the number of elements nel (which may be different at different time steps). We denote with a subscript h the finite element approximation to the unknown functions, and by vhand qhthe velocity and pressure test functions associated to {Ωe}n+1, respectively. An important point is that we are interested in using equal interpolation for the velocity and the pressure. Therefore, the corresponding finite element spaces are assumed to be built up using the standard continuous interpolation functions. In order to overcome the numerical problems of the standard Galerkin method, a stabilized finite element formulation is applied. This formulation is presented in [6]. It is based on the subgrid scale concept introduced in [28], although when linear elements are used it reduces to the Galerkin/leastsquares method described for example in [18]. We apply this stabilized formulation together with the finite difference approximation in time (4)-(5). The bottom line of the method is to test the continuous equations by the standard Galerkin test functions plus perturbations that depend on the operator representing the differential equation being solved. In our case, this operator corresponds to the linearized form of the time discrete Navier-Stokes equations (4)-(5). In this case, the method consists of finding un+1 hand pn+1 hsuch that mn+θ 1¡δtun+1 h¯¯xn,vh¢+an+θ(uh,vh) + cn+θ(uh−udom;uh,vh) + bn+θ 1(ph,vh) = ln+θ 1(vh), (7) mn+θ 2¡qh, δtun+1 h¯¯xn¢+bn+θ 2(qh,uh) + sn+θ(qh, ph) = ln+θ 2(qh), (8) for all test functions vhand qh, the former vanishing on the Dirichlet part of the boundary ΓD. The 5 different forms appearing in these equations are given by m1(δtuh,vh) = ZΩ vh·ρ δtuh+ nel X e=1 ZΩe ζu1·ρ δtuh, a(uh,vh) = ZΩ 2∇Svh:µ∇Suh+ nel X e=1 ZΩe ζu1·¡−2∇ · (µ∇Suh)¢+ nel X e=1 ZΩe ζu2∇ · uh, c(a;uh,vh) = ZΩ vh·(ρa· ∇uh) + nel X e=1 ZΩe ζu1·(ρa· ∇uh), b1(ph,vh) = −ZΩ ph∇ · vh+ nel X e=1 ZΩe ζu1· ∇ph, m2(qh, δtuh) = nel X e=1 ZΩe ζp·ρ δtuh, b2(qh,uh) = ZΩ qh∇ · uh+ nel X e=1 ZΩe ζp·¡ρa· ∇uh−2∇ · (µ∇Suh)¢, s(qh, ph) = nel X e=1 ZΩe ζp· ∇ph, l1(vh) = ZΩ vh·f+ nel X e=1 ZΩe ζu1·f+ZΓN vh·¯ t, l2(qh) = nel X e=1 ZΩe ζp·f, where the functions ζu1,ζu2and ζpare computed within each element as ζu1=τu£ρ(uh−udom)· ∇vh+ 2∇ · (µ∇Svh)¤,(9) ζu2=τp∇ · vh,(10) ζp=τu∇qh,(11) and the parameters τuand τpare also computed element-wise as (see [7]) τu=·4µ h2+2ρ|uh−udom| h¸−1 , τp= 4µ+ 2ρ|uh−udom|h, where his the element size for linear elements and half of it for quadratics. Remark 2 •The superscript n+θin all the terms in (7)-(8) indicates that all the forms are evaluated with the unknowns at n+θ, except for the term coming from the temporal derivative, whose superscript is explicitly indicated. Likewise, the integrals are evaluated at Ω(tn+θ). •The dependency on the advection velocity a=uh−udom has been only indicated in the from coming directly from the convective term of the equations, namely, c(a;uh,vh). However, it has to be noted that all the forms listed above depend on the stabilization parameters, and therefore depend on aas well. Moreover, the dependency of b2(qh,uh)on ais even more explicit. However, in order to keep the notation more concise only the above mentioned dependency of c(a;uh,vh)has been left. 6 •As usual, the mesh of Ω(tn+1)is assumed to be obtained from the mesh of Ω(tn)by moving the nodes of the latter with the domain velocity udom (often referred to as mesh velocity). This greatly simplifies the implementation of the ALE method, since in this case the nodal values of un+1(x) and those of un(xn)correspond to the same nodes (at time steps n+ 1 and n, respectively). •If θ= 1/2, the unknowns of the problem can be taken as un+1/2and pn+1/2, since δtun+1 h¯¯xn= 2δt−1(un+1/2(x)−un(xn)). All the calculations to be performed are the same as for θ= 1, with the only modification that once un+1/2is computed un+1 has to be updated to go to the next time step. This analogy includes the updating of the computational domain. When θ= 1/2 we need to update this domain from n−1/2to n+ 1/2to compute un+1/2and pn+1/2, whereas when θ= 1 we need to update it from nto n+ 1 to compute un+1 and pn+1. For conciseness, the latter situation is considered in the following. •From (9)-(11) it is observed that these terms are precisely the adjoints of the (linearized) operators of the differential equations to be solved applied to the test functions (observe the sign of the viscous term in (9)). This method corresponds to the algebraic version of the subgrid scale approach ([28]) and circumvents the stability problems of the Galerkin method. In particular, in this case it is possible to use equal velocity pressure interpolations, that is, we are not tight to the satisfaction of the inf-sup stability condition. For more details about this formulation, see for example [28, 6]. •In order to simplify a little bit the statement of the problem, we will consider that m2(qh, δtuh) = 0. This can be justified by using a space-time finite element method with constant-in-time interpolation (in the case θ= 1) or by using the orthogonal-subscale stabilization (OSS) method (see [7]). 4 2.2 The fixed-mesh ALE approach: algorithmic steps The purpose of this subsection is to give an overview of the FM-ALE method and to describe the main idea, leaving for the next section a more detailed description of the different steps involved. Suppose Ω0is meshed with a finite element mesh M0and that at time level tnthe domain Ω(tn)is meshed with a finite element mesh Mn(as we will see, close to M0). Let unbe the velocity already computed on Ω(tn). The purpose is to obtain the fluid region Ω(tn+1)and the velocity field un+1. The former may move according to a prescribed kinematics, for example due to the motion of a solid, or can be an unknown of the problem, as in the two applications we will describe in Section 6. If the classical ALE method is used, Mnwould deform to another mesh defined at tn+1. The key idea is not to use this mesh to compute un+1 and pn+1, but to re-mesh in such a way that the new mesh is, essentially, M0 once again. The steps of the algorithm to achieve the goal described are the following: 1. Define Γn+1 free by updating the function that defines it. 2. Deform virtually the mesh Mnto Mn+1 virt using the classical ALE concepts and compute the mesh velocity un+1 m. 3. Write down the ALE Navier-Stokes equations on Mn+1 virt . 4. Split the elements of M0cut by Γn+1 free to define a mesh on Ω(tn+1),Mn+1. 7 5. Project the ALE Navier-Stokes equations from Mn+1 virt to Mn+1. 6. Solve the equations on Mn+1 to compute un+1 and pn+1. In Section 3 we describe all these steps in detail. A global idea of the meshes involved in the process is represented in Fig. 1. Note in particular that at each time steps two sets of nodes have to be appropriately dealt with, namely, the so called newly created nodes and the boundary nodes. Contrary to other fixed grid methods, some of which are described in the next subsection, newly created nodes are treated in a completely natural way using the FM-ALE approach: the value of the velocity there is directly given by the projection step from Mn+1 virt to Mn+1. Boundary nodes require either additional unknowns with respect to those of mesh M0or an appropriate imposition of boundary conditions. This issue is treated in Section 4. Figure 1: Two dimensional FM-ALE schematic. Top-left: original finite element mesh M0of Ω0. Topright: finite element mesh Mnof Ω(tn), with the elements represented by a thick line and the elements of M0represented by thin line. The blue line represents Γn free and the red edges indicate the splitting of M0to obtain Mn. Bottom-left: updating of Mnto Mn+1 virt using the classical ALE strategy. The position of Γn+1 free is again shown using a solid blue line and the previous position Γn free using a dotted blue line. Bottom-right: Mesh Mn+1 of Ω(tn+1), represented by a thick line. The edges that split elements of M0are again indicated in red. Boundary nodes, where approximate boundary conditions need to be imposed, are drawn in green, whereas newly created nodes are drawn in gray. 2.3 Other fixed grid methods Other possibilities to use a single grid in the whole simulation can be found in the literature, each one having advantages and drawbacks. As the method presented in this paper, they were designed as an 8 alternative to body fitted meshes and are sometimes referred to as Embedded Mesh Methods. They can be divided into two main groups [9], corresponding in fact to two ways of prescribing the boundary conditions on Γfree: •Force term. The interaction of the fluid and the solid is taken into account through a force term, which appears either in the strong or in the weak form of the flow equations. Therefore, the boundary conditions on Γfree are neither imposed as Dirichlet nor as Neumann boundary conditions. Among this type of methods, let us cite for example the Immersed Boundary method as a variant of the Penalty method, where punctual forces are added to the momentum equation, and the Fictitious Domain method, where the solid boundary conditions are imposed through a Lagrange multiplier. •Approximate boundary conditions. Instead of adding a force term, these methods impose the boundary conditions in an approximate way once the discretization has been carried out, either by modifying the differential operators near the interface (in finite differences) or by modifying the unknowns near the interface. The Immersed Boundary Method in its original form [40] consists in adding punctual penalty forces in the domain boundary so that the boundary conditions are fulfilled. The forces are computed from a fluid-structure (elastic) interaction problem at the interface. The method is first order accurate even if second order approximation schemes are used, although formal second order accuracy has been reported in [32]. The more recent Immersed Interface Method achieves higher order accuracy by avoiding the use of the Dirac delta distribution to define the forcing terms (see [33, 34, 44]). The Penalty method is similar to the previous one in the sense that a force term is added to the momentum equations. The difference raises in the fact that the penalty parameter is not computed from a fluid-structure interaction as in the original immersed boundary method, but it is simply required to be large enough to enforce the boundary conditions approximately. The force terms can be of two types, depending on whether they are imposed as boundary or as volume forces [43] . Another approach is the use of Lagrange multipliers to enforce the boundary conditions. However, the finite element subspaces for the bulk and Lagrange multiplier fields must satisfy the classical infsup condition, which usually leads to the need for stabilization (see [23, 2, 30]). Moreover, additional degrees of freedom must be added to the problem. The use of Lagrange multipliers is the basis of the Fictitious Domain Method [20, 21]. Recently, hybrid Cartesian/immersed boundary methods have been developed for Cartesian grids, which use the grid nodes closest to the boundary to enforce boundary conditions [19, 45, 37]. The method is second order accurate. Most of these methods have been well tested in the literature for both steady and moving interfaces. Generally, the last case is treated by applying directly the former at each time step. However, very few authors have described the full formulation for moving interfaces, sometimes simply by ignoring the problem. The fact that the boundary moves and the subsequent advection of unknowns is often not taken into account. To explain an obvious consequence of the boundary motion, let us discuss the treatment of the newly created nodes. To explain the problem, let us consider point Pin Fig. 1. Suppose that the boundary Γfree corresponds in this case to the rigid boundary of a moving object. Physically, it is clear that the solution in the fluid cannot depend on what happens inside the solid. Mathematically, this means that the values of the unknowns at the fluid nodes are uncoupled from those at the solid nodes. Therefore, the velocity and the pressure at the solid nodes (apart from those participating to the enforcing of the boundary conditions) can be whatever at a certain time step n, in particular their value at node P(see Fig. 1, topright). Now we move on to the next time step n+ 1 as the solid moves. Some solid nodes can therefore 9 If the matrix form of the problem for uhposed in Ωin is K1,1U1+K1,00U00 =F1, the combination of this equation with (20) leads to the final system to be solved: ·K1,1K1,00 N00 M00 ¸·U1 U00¸=·F1 f00¸.(21) To conclude this subsection, let us explain how to combine methods (19) and (21). Let us first write problem (19) as   K1,1K1,00 0 K00,1K00,00 K00,out 0NΓ,00 MΓ    U1 U00 Uout  =  F1 F00 fΓ  ,(22) where the splitting of the matrices corresponds to the splitting of Uin into U1and U00. Problem (21) is obtained by considering the degrees of freedom of all nodes in layer L0as parameters to prescribe the boundary conditions, but of course the last equation in (22) can be kept, case in which the system to be solved is   K1,1K1,00 0 N00 M00 0 0NΓ,00 MΓ    U1 U00 Uout  =  F1 f00 fΓ  .(23) Clearly, Uout depends on U00, but not the other way around. If Γis very close to ∂Ωin, the coefficients in MΓcan be very small, but this does not affect the unknowns in the interior of the computational domain and, in fact, MΓcan be replaced by any matrix without altering U1and U00. Method (22) is more accurate than method (23) (even though the order of accuracy is the same; see [8]). In order to use (22) in all situations except when instability problems may appear, we have implemented a blending of methods (22) and (23). The idea is simple. When a node in layer L0is detected to be very close to Γ, its degree of freedom is used to prescribe the boundary conditions, that is to say, the row in the equation for U00 in (22) is replaced by the corresponding row in (23). This strategy has proved robust and effective. Since usually only a few equations need to be changed, the overall accuracy obtained is very close to that of method (22). 4.3 Data transfer between finite element meshes The last crucial ingredient in the FM-ALE approach is the transfer of information between meshes Mn+1 virt and Mn+1 for each time step n(see Fig. 1). In principle, it would be possible to use a simple interpolation operator. However, it is well known that this interpolation, for example when it is of Lagrangian type, may suffer from overdiffusivity, in the sense that results on the new mesh may be damped from those of the original one. Another possibility could be to use the L2projection as transfer operator. We explain here how to incorporate restrictions to the projection between meshes. The idea described in the following was introduced in [24] in the context of transmission of information through boundaries in domain decomposition methods. For a method particularly designed in the context of immersed boundary methods for the transfer of forces, see [46]. Let us consider two meshes, M1and M2, of a domain Ω. For simplicity, we assume that both are conforming (matching ∂Ω). Let ni(i= 1,2) be the number of nodes in Miand let Φi∈Rnibe the array of nodal values of a scalar variable φ. Suppose that Φ1is known and we want to project it onto M2 to obtain Φ2. If P21 ∈MatR(n2, n1)is the transfer operator from M1to M2(for example the standard 16 interpolation or the L2projection), a simple choice would be Φ2=P21Φ1. However, suppose that we require Φ2to inherit a set of properties from Φ1, written in the form R2Φ2=R1Φ1,Ri∈MatR(nr, ni),(24) where nris the number of restrictions to be imposed. The idea we propose is to take Φ2as close as possible to P21Φ1but satisfying (24). A possibility is to solve the optimization problem minimize 1 2|Φ2−P21Φ1|2, under the constraint R2Φ2=R1Φ1. This problem can be solved by optimizing the Lagrangian L(Φ2,λ), where λ∈Rnr, given by L(Φ2,λ) = 1 2|Φ2−P21Φ1|2−λt(R2Φ2−R1Φ1). This leads to the system Φ2−Rt 2λ=P21Φ1, R2Φ2=R1Φ1, which after solving for Φ2yields Φ2=P21Φ1+Rt 2(R2Rt 2)−1(R1−R2P21)Φ1. In the applications, the number of restrictions nris small, so that inverting R2Rt 2∈MatR(nr, nr) is computationally affordable. In the case of the FM-ALE method, a typical restriction would be for example to impose global conservation of momentum and of mass when projecting velocities from mesh Mn+1 virt to Mn+1 for each n. In this case, nr=d+ 1. 5 A numerical example In this section we will solve the flow over a moving cylinder with the proposed FM-ALE strategy. The objective is to apply this methodology to this simple validating example, before showing more complex applications in the next section. The corresponding flow equations are those described in Section 2, although in this case a multistep time discretization will be used. In particular, we will use the second order backward differentiation scheme (BDF2), in which the time derivative at time n+ 1 is approximated as: ∂u ∂t ¯¯¯¯ n+1 ≈1 δt µ3 2un+1 −2un+1 2un−1¶. The strategy described in Subsection 4.2 and [8] will be used to prescribe Dirichlet type boundary conditions on the surface of the moving solid, in this case the cylinder. The hold-all domain is the rectangle B= [0,2.2] ×[0,0.44]. A background mesh of 9000 linear triangles has been used. The considered solid is a cylinder of diameter D= 0.2, its trajectory being defined by the position of its center: xc(t) = 1.1 + 0.8 sin µ2π 3(t−0.75)¶, yc(t) = 0.22. 17 0 0.5 1 1.5 2 0 0.2 0.4 −1 0 1 0 0.5 1 1.5 2 0 0.2 0.4 −2 0 2 0 0.5 1 1.5 2 0 0.2 0.4 −3 −2 −1 0 1 Figure 4: Solution at t= 3.From top to bottom: x-velocity, y-velocity, pressure. The velocity is prescribed to (0,0) on the walls of the rectangular domain, except for the wall corresponding to x= 2.2, where it is left free, whereas it matches the cylinder velocity on the cylinder surface. Note that the flow is due only to the cylinder movement. Viscosity is set to 0.001, so that the maximum Reynolds number is Re ≈300 based on the cylinder diameter and the (maximum) velocity when the cylinder is located at the central section of the rectangle. The time step size has been set to δt = 0.05, and 60 time steps (a full period) have been performed, after which the flow is considered to be fully developed. Fig. 4 shows the results obtained at time t= 3. We would like to remark the smoothness of the velocity field close to the cylinder surface. It is also interesting to see which are the differences between the treatment of the newly created nodes in the proposed FM-ALE approach and other usual procedures. To this end we compare nodal values for newly created nodes at time tn(in the time step which goes from tnto tn+1) for the FM-ALE approach (information is convected and projected) and for the more usual procedure of extrapolating values from neighboring nodes mentioned earlier. Fig. 5 and Fig. 6 show velocity values (before and after the convection-projection or the extrapolation procedures) at tn= 2.25. It can be seen that for large incremental displacements, as those of the time step we are considering, extrapolated values differ significantly from convected-projected values, and are much less smooth. Also, the values before the convection-projection or extrapolation procedure are smoother for the FM-ALE approach. We would like to stress that, contrary to the convectionprojection of the FM-ALE method, the extrapolation procedure lacks physical grounds. 18 0 0.5 1 1.5 2 0 0.2 0.4 −1 0 1 2 0 0.5 1 1.5 2 0 0.2 0.4 −1 −0.5 0 0.5 0 0.5 1 1.5 2 0 0.2 0.4 −4 −2 0 0 0.5 1 1.5 2 0 0.2 0.4 −0.5 0 0.5 Figure 5: Solution at t= 2.25, extrapolation procedure. From the top to the bottom: x-velocity before extrapolating, y-velocity before extrapolating, x-velocity after extrapolating, y-velocity after extrapolating. 19 0 0.5 1 1.5 2 0 0.2 0.4 −2 0 2 0 0.5 1 1.5 2 0 0.2 0.4 −2 −1 0 1 0 0.5 1 1.5 2 0 0.2 0.4 0 0.5 1 1.5 2 0 0.2 0.4 −1 0 1 −1 0 1 Figure 6: Solution at t= 2.25, FM-ALE procedure. From the top to the bottom: x-velocity before convection-projection, y-velocity before convection-projection, x-velocity after convection-projection, y-velocity after convection-projection. 20 6 Two applications The purpose of this section is to describe briefly two applications that led us to the development of the FM-ALE method. It is not our intention here to enter into the details of the problems, but rather to formulate them to stress how to apply the methodology in these two examples. For details, the reader is referred to [26] for Subsection 6.1 and to [12] for Subsection 6.2. 6.1 Lost foam casting Lost foam casting is a casting technique in which the mold to be filled with molten metal is previously filled with a solid foam. The melt burns the foam when it contacts it, creating a residue that partly escapes through the mold walls (usually made of sand) and is partly trapped next to the boundaries of the mold. See [41] for a description of this technique. Let Ωmthe domain that is filled by the molten metal, Ωfbe the domain occupied by the foam and Ω0be the total domain (metal and foam). They are schematically shown in Fig. 7. Obviously, both Ωm and Ωfdepend on time. Figure 7: Lost foam casting: Problem setting. In this problem, apart from the Navier-Stokes equations (2)-(3), also the heat equation needs to be solved. Let ϑbe the temperature, Cpthe specific heat at constant pressure, κthe thermal conduction coefficient and αij the heat transfer coefficient between materials “i” and “j”. The subscripts “m”, “f” and “o” will be used to refer to the physical properties of the molten metal, foam and mold, respectively. Likewise, Γij will be used to denote the interface between materials “i” and “j”, and the subscript inf will refer to values at the inflow of the domain; see Fig. 7. Let us denote by umf the velocity at which the front of molten metal advances through the foam. In this problem, it turns out that this velocity can be computed from an energy budget. If umf is its norm, it turns out that (see [26]) umf =αmf (ϑm−ϑf) ρf(cpf(ϑm−ϑf) + Emel +Evap),(25) where Emel and Evap are the melting and vaporization energies, respectively, which must be determined from experiments. The direction and orientation of umf is determined by imposing this velocity to be normal to the advancing front. The key idea is to represent this front by a level set function ψ, the approximation of 21 which has been described earlier. This leads to umf =−umf |∇ψ|∇ψ. If we consider now Ω(t) = Ωm, the problem to be solved consists in solving (2)-(3) together with the energy balance equation ρCp·∂ϑ ∂t ¯¯¯¯x0 (x, t) + (u−udom)· ∇ϑ¸−κ∆ϑ= 0,(26) and the boundary conditions on the interface Γmf u=umf ,(27) −κm ∂ϑ ∂n =αmf (ϑ−ϑf),(28) and the appropriate boundary conditions on the rest of the boundary. There are several remarks to be made concerning the application of the FM-ALE method to this problem: Remark 3 •The finite element approximation in space and the time integration of (26) is performed using the same formulation as for the Navier-Stokes equations. •In view of (28), temperature is needed also in the foam domain Ωf, which is also time dependent. Thus, an equation analogous to (26) has to be solved there, with u=0but with a mesh velocity computed as for Ωm. •For the discrete problem, the transport of the level set function that determines Γmf requires the velocity uto be extrapolated from Ωmto Ωf. As mentioned earlier, we do this extrapolation by solving a Stokes problem in Ωfusing umf as boundary conditions on Γmf . •In order to avoid introducing new nodes (apart from those of the background mesh), Dirichlet boundary conditions (27) need to be approximately imposed, for example using the strategy described in Subsection 4.2. Equation (28) does not require any special treatment, as it is prescribed weakly and evaluating surface integrals on an immersed boundary does not pose any particular problem. 4 To conclude this subsection, we present the results of a simulation of a three-dimensional tee-shaped casting (see [26] for more details). The only purpose of this example is to show that the methodology proposed is feasible in real applications. The inner diameter of the vertical cylinder is 0.08 m while the inner diameter of the others is 0.10 m. The geometry is symmetrical with respect to the ingate and therefore the filling should also be symmetric. However, we want to observe the effects of variable foam density. In fact, the foam density is likely to be non-uniform, especially near the injection points. The front velocity model given by (25) is expected to take into account these effects, as the foam density appears in the denominator. Different zones of foam density are shown in Fig. 8. The time evolution of the velocity vectors in the molten metal region is shown in Fig. 9. 22  Figure 8: Geometry and foam density for the lost foam casting example. 6.2 Free surface flows This example can be considered a prototypical problem for the application of the FM-ALE method. The domain Ω(t)is the region occupied by the fluid, separated from a region without fluid by a free surface Γfree. The problem to be solved is exactly (2)-(3) with f=g, the gravity acceleration, and the boundary condition n·σ=0on Γfree. Contrary to the previous example, now the velocity is unknown on Γfree but the stress is known. This simplifies very much the imposition of boundary conditions since, as it has been mentioned in the previous subsection for the heat equation, boundary conditions imposed weakly on immersed boundaries do not represent any particular computational problem. The alternative to the free surface treatment of many problems is a two-fluid coupling, assuming that the effect of one of the fluids over the other is negligible. In this case, Γfree plays the role of an interface, rather than a free surface. In fact, in the applications the two-fluid approach is often more realistic, as in the case of water-air interfaces. However, from the numerical point of view the free-surface approach is usually more robust. We will show this in a particular example presented next. Before this, let us comment that the major difference between the free-surface and the two-fluids approach is that the former requires solving the flow equations on a moving domain, whereas the latter consists in solving on the whole domain where the flow takes place, which is constant in time, with different fluid properties in the regions occupied by the two fluids. In this second case, the stress (and the velocity) will be continuous at the moving interface. As an example of application, let us consider a 2D flow over a submerged hydrofoil. The hydrofoil section considered is a NACA0012 with an angle of attack of 5◦traveling at a speed of 1.776 m/s. It is an example that has been studied in the laboratory by Duncan [14] and used as a benchmark for numerical results by several authors [15, 4] . For the two-fluid simulation, the material properties used (SI units) are ρ1= 1000,µ1= 0.001 for the bottom fluid (water), and ρ2= 1.2,µ2= 0.000018 for the top one (air). The simulations where run for 30 seconds with a 0.04 second time step size. The acceleration of gravity is g= 10. The Reynolds number using water properties is Re = 1.776 ×106, and the Froude number is Fr = 0.5673. A 2D unstructured mesh that covers a rectangle sized [−6.0,11.0]×[−4.4,3.0] around the hydrofoil was used. It is formed by 7415 nodes and 14364 linear triangular elements refined close to the hydrofoil 23  Figure 9: Velocity vectors for the lost foam casting example. 24 and to the initial position of the interface as can be seen in Fig. 10. The boundary conditions used are prescribed inlet velocity at the left side of the rectangle, free slip at the bottom wall and at the hydrofoil, an open boundary on the top side, and the normal traction equal to minus the hydrostatic pressure corresponding to the initial water height at the right side of the rectangle. The level set function that determines the interface position is only prescribed at the left side of the domain. A constant 1.776 horizontal velocity is used as initial condition on the whole mesh except on the NACA hydrofoil, where it is zero. The interface is initially flat and positioned at y= 0.9904. Figure 10: Mesh around the NACA profile. We have compared the results obtained with the free surface model [12] with those a two-fluid approach proposed in [11], in which air is also simulated. The former turns out to be more robust than the latter with the physical properties we have chosen. In Fig. 11 results for the position of the free-surface/interface are shown. The interface position starts to deteriorate at t= 6 in the two-fluid approach, whereas for the free surface treatment the wave length and height match the experimental results satisfactorily. This is better observed in Fig. 12, where velocity vectors are plotted. Finally in Fig. 13 we show the pressure and the pressure without the hydrostatic component corresponding to the initial interface height, in both cases at t= 30 and using the free surface formulation. 7 Conclusions In this paper we have introduced in detail the concept of the FM-ALE approach. Succinctly, it consists in using the standard ALE method but “remeshing” at each time step so as to use always the same given mesh, which discretizes the whole region where the flow takes place. The first benefit is conceptual. Ad-hoc approximations to account for the advection of information that can be found in several fixed-grid methods are avoided. This is in particular reflected by the treatment of the so called newly created nodes. When a node “dry” in one time step becomes part of the flow region in the next time step, the value of the flow variables to be assigned there to approximate (local) time derivatives is perfectly determined. It has been our intention to clearly distinguish the main concept of the formulation from other related issues, and in particular from the approximate imposition of boundary conditions. Nevertheless, the way to carry out this imposition is essential for the success of the method. We have described our particular approach. Some remarks concerning the transfer of information between meshes have also been made, and the possibility to model the moving surface by level set functions has been explained. Precisely the use of level set functions is crucial in the two applications shown, which we have included to demonstrate the potential of the method to deal with problems of different nature. Another 25