Practical shape optimization of a levitation device for ... - Springer Link

5 downloads 826 Views 785KB Size Report
Nov 29, 2007 - Fres,z = FB − FG − FD = 0,. (1) ... The buoyancy and gravity forces, FB and FG, are independent of the ..... a scripting language like Python.
Optim Eng (2008) 9: 179–199 DOI 10.1007/s11081-007-9027-x

Practical shape optimization of a levitation device for single droplets Edwin Groß-Hardt · Emil Slusanschi · H. Martin Bücker · Andreas Pfennig · Christian H. Bischof

Received: 12 September 2007 / Accepted: 8 October 2007 / Published online: 29 November 2007 © Springer Science+Business Media, LLC 2007

Abstract The rigorous optimization of the geometry of a glass cell with computational fluid dynamics (CFD) is performed. The cell will be used for non-invasive nuclear magnetic resonance (NMR) measurements on a single droplet levitated in a counter current of liquid in a conical tube. The objective function of the optimization describes the stability of the droplet position required for long-period NMR measurements. The direct problem and even more the optimization problem require an efficient method to handle the high numerical complexity implied. Here, the flow equations are solved two-dimensionally and in steady state with the finite-element code SEPRAN for a spherical droplet with ideally mobile interface. The optimization is performed by embedding the CFD solver SEPRAN in the optimization environment EFCOSS. The underlying derivatives are computed using the automatic differentiation software ADIFOR. An overall concept for the optimization process is developed, requiring a robust scheme for the discretization of the geometries as well as a model for horizontal stability in the axially symmetric case. The numerical results show that the previously employed measuring cell described by Schröter is less suitable to maintain a stable droplet position than the new cell. Keywords Droplet · Solvent extraction · CFD · EFCOSS · Automatic differentiation

E. Groß-Hardt · A. Pfennig Department of Chemical Engineering, Thermal Unit Operations, RWTH Aachen University, Wüllnerstr. 5, 52056 Aachen, Germany E. Slusanschi · H.M. Bücker () · C.H. Bischof Institute for Scientific Computing, RWTH Aachen University, Seffenter Weg 23, 52074 Aachen, Germany e-mail: [email protected]

180

E. Groß-Hardt et al.

1 Introduction Droplets are among the basic building blocks in various fields of science and engineering, including chemistry, process engineering, geophysics, and applied mathematics (Clift et al. 1978). For instance, a more detailed knowledge of the behavior of single droplets is crucial to understand rain fall, boiling, flotation, fermentation, and spray drying. We are particularly interested in solvent extraction (Kumar and Hartland 1994; Henschke and Pfennig 1996) where droplets of different sizes are sedimenting while simultaneously undergoing mass transfer. Although theoretical, numerical, and experimental investigations on single droplets were conducted in the past (Han et al. 2001; Han 2001; Tomiyama et al. 2002; Clift et al. 1978; Henschke 2004), the distinct influence of the behavior of the interfacial region is still an open problem. Since interfacial stress and velocity distribution cannot be directly measured, the effect of the interfacial region on the adjoining phases must be examined instead (Slattery 1990). To better understand the fundamental phenomena of single droplets, an interdisciplinary team of researchers at RWTH Aachen University is currently investigating a droplet of Octamethylcyclotetrasiloxan (OMCTS, C8 H24 O4 Si4 , density ρd = 955 kg/m3 , viscosity ηd = 2.6 mPa s) levitated in deuterated water (D2 O, ρc = 1107 kg/m3 , ηc = 1.2 mPa s). Throughout this article, the indices d and c denote droplet and continuous phase, respectively. This system is chosen because it is advantageous from an experimental point of view. The overall aim is to measure the velocity v inside a droplet, temporally and spatially averaged by nuclear magnetic resonance (NMR) spectroscopy. For the levitation cell in the NMR-magnet, we originally considered the standard cell for measuring mass transfer described in Schröter et al. (1998) and schematically given in Fig. 1 which is used at the Department of Chemical Engineering, Thermal Unit Operations. The principle layout of this experiment is as follows. A counter current of continuous phase flows from top to bottom of the cell. The droplet is produced by a precision injector at the bottom and rises until vertical force equilibrium is reached. The velocity is then measured by NMR imaging techniques. After the measurement, the counter current is switched off, so that the droplet rises to the top and is removed. We assume that there is no mixing Fig. 1 Schematic representation of a single-droplet measuring cell (Schröter et al. 1998) in an NMR spectroscope

Practical shape optimization of a levitation device for single droplets

181

between the two phases because they are mutually saturated. We further assume that the droplet does not have a self-rotating motion, though this may happen in actual experiments. For long-period measurements with NMR, a stable position and shape of the droplet are crucial. However, in the standard cell given in Fig. 1, the droplets moved from side to side so that NMR measurements were not possible. Therefore, the goal of the work described in this manuscript is to design a new cell geometry exhibiting a stable drop position. To this end, we use computational fluid dynamics (CFD) to simulate the flow in the measuring cell in two space dimensions and apply optimization algorithms to find a geometry improving the drop stability. We stress that it is beyond the scope of this work to compare numerical simulations with data obtained from actual measurements using the resulting cell. We describe the overall optimization concept restricting the cell’s shape to two characteristic geometric parameters in Sect. 2. The criteria for stability of the droplet are also discussed in that section. Since the geometry of the computational domain changes upon variation of these parameters, a robust automatic scheme for the geometry generation and discretization is developed in Sect. 3. For the optimization process outlined in Sect. 4, a gradient-based optimization scheme is applied using automatic differentiation. Similar approaches employing numerical optimization and automatic differentiation in the context of shape optimization for CFD problems are given in (Bischof et al. 2005; Carle et al. 1998; Hascoët et al. 2003). We present the evaluation of the stability criteria, the results of the optimization process, and their interpretation in Sect. 5.

2 Concept of the optimization 2.1 Overall concept To determine a subset of the parameters of the mathematical model as the free variables for the optimization, we first outline the physical experiment in which the measurement cell will be used. The experimentalist chooses some operating conditions that are relevant for solvent-extraction investigations, for instance, the volume flow rate of the continuous phase and the droplet volume set at the precision injector. The profile of the inflow is parabolic because the inflow length, determined by the physical dimension of the NMR-spectroscope, is about 1.1 m. Under these conditions the droplet rises to a certain position where the vertical force resulting from buoyancy, gravity, and flow drag disappears. Inertia forces acting on the droplet are zero because steady state is assumed. Parameters are classified as operating conditions, geometric parameters, and droplet position. The overall optimization scheme is depicted in Fig. 2. The droplet diameter D and the inflow velocity vz,in are operating conditions that are treated constant in the optimization because they should be freely selectable within a reasonable range for a given cell. We assume the principal geometry of the cell is known in advance. The characteristic geometric values effecting stability of the droplet are the value of the narrowest cross section radius r cs and the angle of inclination of

182

E. Groß-Hardt et al.

Fig. 2 Concept of optimization

the conical part αcon . We select these two geometric parameters as free variables for optimization. The vertical position zdrop is then given by the vertical equilibrium of forces representing a constraint. Alternatively, we can calculate the vertical position by a transient simulation. However, this would imply extra computational costs as there are additional restrictions on the time steps. These costs are not justified when the focus is on an equilibrium solution. In the following subsections, we first derive criteria for the stability of the droplet shape. Then, we consider criteria for its stability with respect to vertical and horizontal position. Stability is defined as the equilibrium of forces as well as the presence of reset forces when the equilibrium is disturbed. 2.2 Stability of shape Three effects influence the droplet shape: sedimentation velocity, droplet size, and the radius of the cross section rcs,drop at the position of the droplet’s center. When considering low sedimentation velocities, a fore- and aft-symmetry of the pressure distribution around the droplet is observed. For the creeping-flow regime, a droplet in unbounded media is unconditionally stable in shape (Clift et al. 1978, p. 33). Small droplets tend to be spherical due to the high curvature of the interface leading to high interfacial forces. The influence of the wall on the shape of the droplet is small for ratios of D/(2rcs,drop ) < 0.6 as mentioned in (Clift et al. 1978, p. 231). For higher ratios the wall effect leads to bullet-shaped droplets, while in unbounded media large droplets tend to be spherical caps. This suggests that the wall effect is counteracting the

Practical shape optimization of a levitation device for single droplets

183

deformation to spherical caps. A lower estimate of the maximum stable diameter D can therefore be derived for unbounded media according to Fig. 2.5 in Clift et al. (1978). If the interfacial tension is estimated roughly with σ = 35 × 10−3 N/m for the system investigated, the resulting criterion for the stability for a Morton number of Mo = gηc4 (ρd − ρc )/(ρc2 σ 3 ) = 7.0 × 10−11 and an Eötvös number of Eo = g(ρd − ρc )D 2 /σ ≤ 0.4 is given by a diameter of D ≤ 3.1 mm. We also observed the stability of shape in preliminary experimental studies. Thus, we describe the droplet as non-deformable and spherical in the following. 2.3 Stability of vertical position The sedimentation of droplets in unbounded and bounded media is studied in (Han et al. 2001; Han 2001; Tomiyama et al. 2002; Clift et al. 1978; Henschke 2004). The forces acting on the droplet in the vertical direction are the buoyancy FB , gravity FG , and drag forces FD . The resulting force in vertical direction Fres,z equals the inertia force FI = 0. The forces are depicted in Fig. 3. The stability of the vertical position is defined by the equilibrium of forces Fres,z = FB − FG − FD = 0,

(1)

and a reset force on disturbance from the equilibrium ∂Fres,z < 0. ∂z The equilibrium of forces in the vertical direction is a constraint in the optimization scheme. The buoyancy and gravity forces, FB and FG , are independent of the vertical position. The drag force FD is increasing monotonically with the velocity of the continuous phase. A backflow or contractions of the flow may occur behind the droplet. Thus, the drag forces acting on the droplet will be higher as the droplet is moved upward. The resulting force amounts to a reset force when the droplet is displaced from the equilibrium position. In fact, we use exactly this relation in the optimization scheme to find the stable vertical position of the droplet. More precisely, we derive the formulation of the objective function as follows. For a given volume V of the droplet, buoyancy and gravity forces are given by FG = gVρd Fig. 3 Forces influencing vertical stability

and FB = gVρc ,

(2)

184

E. Groß-Hardt et al.

respectively. Thus, an equivalent form of (1) is given by FD = gV (ρc − ρd ). The objective function for the vertical stability is then formulated as fver (zdrop ) =

FD (zdrop ) V (ρc − ρd )

(3)

and equals the gravity constant g when evaluated at a position zdrop in which the vertical equilibrium of forces is satisfied. For the reset forces when disturbing equilibrium, we restrict the discussion on angles αcon where no backflow occurs (Idelchik 1994). When increasing αcon , the average velocity of the surrounding fluid, and therefore the drag forces, are changing more rapidly in vertical direction. Thus, the reset forces and the stability of the vertical position also increase. 2.4 Stability of horizontal position The equilibrium of forces in the horizontal direction is given a priori for axially symmetric conditions. A horizontal displacement of the droplet results in a non-axially symmetric case. Since the simulation should be axially symmetric here, we derive a heuristic criterion by analyzing the cases of a droplet sedimenting in an unbounded fluid and of a droplet sedimenting in a narrow tube. In a first step, we consider two droplets whose horizontal positions are disturbed from equilibrium as shown in Fig. 4. For an unbounded fluid with a block profile, the stability of the horizontal position is indifferent because nothing changes geometrically when the position is disturbed. Thus, there is no reason for a reset force for a block profile. In contrast, consider the case of a droplet sedimenting in a narrow tube whose position is disturbed from equilibrium. The flow resistance acting on the continuous phase is lower on the side with the broader free cross-section. Furthermore, the velocity profile upstream of the droplet exhibits larger velocities on this side. Thus, it is obvious that the average flow velocity is higher in the wider cross section. As the fluid particles pass the droplet they are centripetally accelerated and exert a drag on the droplet surface. Higher velocities lead to a higher drag (Bernoulli effect). Thus,

Fig. 4 Forces influencing horizontal stability

Practical shape optimization of a levitation device for single droplets

185

on the side of the broader free cross-section the drag is higher than on the opposite side of the droplet. This leads to a reset force pushing the droplet to its equilibrium position. The horizontal droplet position is therefore stable. This effect can be magnified by increasing the gradient of the parabolic velocity profile of the surrounding flow in the upper vicinity of the droplet. The above discussion on the movement of droplets is also supported by the following facts. Tomiyama et al. (2002) observe bubbles sedimenting in a simple shear flow in a tank. The shear flow is induced by a belt moving downwards which is installed on only one side of the tank. The bubbles always move to the side with the higher velocities. Moreover, red blood cells are stabilized in the center of a vein leading to a lower overall viscosity of the blood (Fahraeus-Lindquist effect). It is this phenomenon that enables the heart to pump the blood through the veins. Here, the three-dimensional Magnus effect is even enhancing the reset forces. That is, the surrounding flow causes a rigid sphere to spin, leading to a non-symmetric velocity and pressure distribution, thus pushing the sphere in one direction. The spinning of a droplet was also observed by Brauer (1979). Therefore, a criterion for a stable horizontal position should be intimately connected with a parabolic profile with a large gradient in the direct vicinity of the droplet. In the following, we try to relate velocity profiles with horizontal forces exerted by the surrounding flow on the droplet surface because these forces are immediately available once the flow field is computed. Thus, the second step is to consider the horizontal forces exerted on the droplet in the equilibrium position. Notice that, in this case, the horizontal forces exerted on two opposite halves of the droplet add up to zero. However, in the remainder, we consider horizontal forces exerted on a single halve denoted by Fr . Such horizontal forces are considered positive if they are directed outwards from the symmetry axis, i.e., if they act as a suction on the droplet. An unbounded fluid with a block profile is associated with low viscous drag, high pressure drag, high sedimentation velocities, and high horizontal forces. In contrast, the desired parabolic velocity profile of the surrounding fluid is accompanied by high viscous drag, low pressure drag, low sedimentation velocities, and low horizontal forces. The reasons are as follows: High gradients of velocities caused by a parabolic profile lead to high viscous drag. The overall drag consists of a viscous and a pressure part. From (1) we conclude that the sum of both drag forces is constant for a given droplet sedimenting in steady state, since for a given droplet the buoyancy FB and gravity FG are constant according to (2). Therefore, the resulting pressure drag is low. This leads to low velocities of the surrounding fluid or, more precisely, to low sedimentation velocities. As a consequence, there is a low centripetal acceleration in the vicinity of the droplet which in turn results in a low suction Fr on the droplet surface (Bernoulli effect). Therefore, the goal of the criterion for horizontal stability is to reduce the suction on the droplet. That is, we minimize the objective function v (αcon , rcs )). fhor (αcon , rcs ) = Fr (

(4)

Here, we take into account that, in the given orientation of forces, a suction on the droplet corresponds to a positive horizontal force Fr . That is, we disallow negative forces. To evaluate the objective function at a given angle αcon and radius rcs , we first compute the flow field v from which the horizontal force Fr is computed.

186

E. Groß-Hardt et al.

The above discussion is also supported by the fact that, in a narrow long tube with a sharp parabolic profile, it is experimentally observed that droplets sediment slowly in comparison to droplets that sediment in unbounded fluid with a block profile. Finally, we mention three issues that do not conflict with the derived criterion for horizontal stability: • Flow inside of the droplet: The flow inside is induced by the shear stress generated by the surrounding flow and is converted into thermal energy by viscous dissipation. Since there is no source of momentum the forces exerted on the surface of the droplet by the flow inside are balanced and can be neglected. • Hydrodynamic instabilities: Instabilities in hydrodynamics usually occur at high Reynolds numbers, in our case, at high sedimentation velocities which in turn occur in unbounded fluid. In a flow with high viscous dissipation, instabilities are easily damped. • Three-dimensional effects: Because of axial symmetry no three-dimensional effects should occur. Furthermore, we limit the discussion to low conical angles, so that no non-symmetric backflow in the conical part can occur; compare Sect. 2.3.

3 Direct problem 3.1 Physical model The continuity and the Navier-Stokes equations without turbulence model are solved in steady state with 2D-axial symmetry for Newtonian fluids. In the domain inside the droplet, we have ρ = ρd and η = ηd whereas in the domain outside the droplet we use ρ = ρc and η = ηc . In order to arrive at a dimensionless form of the governing equations, we introduce the following scaling. The spatial variables are denoted relative to the diameter D of the droplet: r =

r , D

z =

z . D

The horizontal and vertical velocities are specified relative to the vertical inflow velocity at the inlet vz,in vr =

vr , vz,in

vz =

vz . vz,in

The divergence operator is also scaled by the diameter of the droplet div = D · div. Using the quantities Re =

ρc vz,in D , ηc

vz,in , Fr = √ gD

We =

2 D ρc vz,in



,

η∗ =

ηd , ηc

Practical shape optimization of a levitation device for single droplets

187

the continuity and the Navier-Stokes equations can be written in the dimensionless form ∂vz 1 ∂r  vr div v =  + = 0, r ∂r  ∂z vr

vr

     ∂ 1 ∂r  vr ∂vr ∂p  1 ∂ 2 vr  ∂vr + vz  = −  + + 2 , ∂r  ∂z ∂r Re ∂r  r  ∂r  ∂z

  ∂v   ∂vz 1 ∂p  1 1 ∂(r  ∂rz ) ∂ 2 vz  ∂vz + 2. + v = − + + z ∂r  ∂z ∂z Re r  ∂r  ∂r 2 Fr

The stress at the interface of the droplet is given by     η∗ ∂vt ∂vn 1 ∂vt ∂vn  τtt = +  = +  , Re ∂n ∂t d Re ∂n ∂t c     1 η∗ ∂vn 1 ∂vn   = p + , = pd − 2 − 2 τnn c   Re ∂n Re ∂n We where ∂/∂n and ∂/∂t  denote the derivative into the normal and tangential directions, respectively. The droplet is modeled as spherical and non-deformable with ideally mobile interface:   vt,d = vt,c ,   = vn,c = 0. vn,d

Since the droplet is non-deformable there is no need to take the interfacial tension into account. The resulting forces at the interface of the non-deformable droplet are given by the stress tensor integrated over the interfacial surface on both sides of the interface. Boundary conditions are given for the inlet and outlet of the flow domain for the continuous phase, the wall, and the symmetry line. At the walls, the no-slip-condition vr = vz = 0 is applied. At the symmetry line, the radial velocity and the tangential stress are zero: vr = 0 and

∂vz = 0. ∂r 

At the inlet, a constant velocity is given by vr = 0 and vz = 1. At the outlet, the flow field is undisturbed: vr = 0

and

∂vn = 0. ∂n

188

E. Groß-Hardt et al.

3.2 Discretization of geometry The physical model is solved with the general-purpose finite-element method (FEM) package SEPRAN (Segal 1993), which allows two-dimensional, axially symmetric and three-dimensional steady state or transient simulations in complex geometries. The package is used in a wide variety of engineering applications including laminar flows of incompressible liquids (Bosch and Lasance 2000; van Keken et al. 1995; Segal et al. 1998) and is developed at “Ingenieursbureau SEPRA” and Delft University of Technology. The first step is to generate and discretize the geometry. According to the optimization concept, we have to vary the angle of the cone, the radius of the narrowest cross-section, and the vertical droplet position on an automatic basis. The automatic scheme must lead to grids of high quality. That is, the nodal points must be densely distributed where high gradients of flow variables are expected and coarse where gradients are small with a smooth transition between these regions. Furthermore, the resulting elements must be nowhere distorted. In our case triangles are used for the FEM. Here, it is necessary that the area of the triangles is greater than zero so that at least one angle is noticeably different from 0° and 180° (van Kan and Segal 1995). Finally, the result of the simulation has to be independent of the discretization of the geometry, e.g., the mesh must be adequately refined. Throughout the course of the shape optimization, the geometry of the cell changes. We use the following strategy sketched in Fig. 5 to generate consistent meshes in all iterations of the optimization algorithm. First, we design a template mesh for the geometry which is capable of representing all possible mesh configurations. In SEPRAN, this is done with an input file in a bottom-up approach. User points are defined that are connected by lines with a specified number and geometric distribution of nodal points. Examples of such lines are the semi-circle and the straight lines visible in the top of this figure. Then, we define surfaces enclosed by these lines. On each surface, we choose a particular scheme of setting nodal points. Surfaces with different schemes are depicted on the bottom of that figure. After carrying out extensive numerical experiments, it turns out that separating surfaces with curvature from surfaces bounded by orthogonal lines is preferred. Therefore, we define surfaces in such a way that a curved surface is framed by a set of straight lines enabling to employ a standard scheme of setting nodal points in those surfaces without curvature. To generate a mesh for a curved surface, we treat the curve as well as the opposite straight line as the side of a rectangle. We choose the width of all these rectangles as . We mesh such a rectangle by subdividing it into smaller rectangles, also depicted in that figure. For the variation of the geometry, we have to define variables for the characteristic geometric parameters, the positions of the user points, and the distribution of the nodal points on the connecting lines. Then, we calculate the variables with a FORTRAN subroutine as a function of the characteristic parameters. While the positions of the user points can be calculated directly, we have to find the number and geometric distribution of the nodal points along the lines. Partly, this is done directly and, partly, with a Newton-Raphson approach for finding a root. We implemented this in the mesh generation source code of SEPRAN.

Practical shape optimization of a levitation device for single droplets

189

Fig. 5 Mesh concept for geometry variation

3.3 Numerical solution In SEPRAN the flow equations are discretized and solved with a Galerkin-based finite-element method. The continuity equation is decoupled and the pressure is a derived quantity when using the penalty method on Crouzeix-Raviart-triangle elements. The linear problem is solved directly, since the penalty method leads to a dense non-symmetric profile matrix. The non-linear convection is solved iteratively with the locally quadratically converging Newton-Raphson method. A starting value is found with the creeping-flow solution, and then we apply a single linearly converging Picard iteration. The boundary integrals for the resulting forces are solved with the Simpson method. In order to assure that the objective functions representing the stability are accurate, the solution provided by the numerical simulation needs to be independent of the computational grid. Therefore, we carried out an extensive set of simulations, using progressively refined computational grids, until the objective functions was independent of the underlying grid. Depending on the actual operating conditions, the geometry of the measuring cell comprises between 7,500 and 10,000 grid points. We

190

E. Groß-Hardt et al.

also considered a test problem without a droplet to make sure that the CFD model accurately simulates a single phase flow.

4 Optimization In a highly complex simulation package such as a modern CFD code, the choice of appropriate values for model and design parameters is an important and non-trivial issue. Rather than running the simulation code multiple times with different input values chosen by hand and observing the resulting effect on the objective function, we employ numerical optimization routines providing more accurate and reliable results using less computing time. The availability of exact derivatives of the objective function is often crucial for the convergence of the optimization algorithm. In order to couple the simulation package SEPRAN with an algorithm solving the design optimization problem, we use a modular framework called EFCOSS (Environment for Combining Optimization and Simulation Software) (Bischof et al. 2003a, 2003b). The EFCOSS framework provides a way for automatically interfacing simulation and optimization software packages. The environment treats the evaluation of the simulation function, the invocation of the optimization algorithm, and the computation of the objective function as a set of basic tasks, and it provides an infrastructure for automatically interconnecting these tasks. EFCOSS achieves its flexibility in supporting different platforms and languages by employing the CORBA technology and a scripting language like Python. The framework handles various simulation and optimization packages (Bischof et al. 2003c). In the present study, we use a variation on Newton’s method in which the Hessian is approximated by a quasi-Newton update. This optimization algorithm is taken from the PORT library (Gay 1990). 4.1 Derivatives obtained with automatic differentiation Providing accurate derivative information for large-scale simulations like SEPRAN is a difficult task. There are several well-known methods for computing derivatives, including analytic, symbolic, numerical, complex-step, and automatic differentiation. Automatic Differentiation (AD) offers significant advantages over the other methods, especially in the context of large-scale simulations. AD comprises a set of techniques for automatically augmenting a given computer code with statements for the computation of derivatives. SEPRAN consists of about 800,000 lines of FORTRAN code including comments. Due to its sheer size and the intricacy of its language constructs involving numerous subroutine calls, loops, and branches, the approach using analytical or symbolic differentiation is impossible (Griewank 1989). The numerical approach based on divided differencing involves truncation error that grows with increasing step sizes, whereas small step sizes result in cancellation error. Together, truncation and cancellation errors can lead to a loss of computed precision of up to half of the available digits. It should also be noted that numerical differentiation by perturbing the input may lead to different grids such that it is hard or even impossible to compute meaningful derivatives. In particular, when evaluating the derivative with

Practical shape optimization of a levitation device for single droplets

191

respect to a geometric parameter, e.g., the cone angle, on a given grid G1 , the function evaluated for the corresponding perturbation will be computed on another grid G2 . Thus, it is difficult to get an accurate estimate for the derivative on G1 without carefully controlling the underlying grid refinement. However, in automatic differentiation, the exact derivatives are directly computed on the desired grid G1 . If a function is computed exclusively using real arithmetic, i.e., all values generated during the course of the function computation are real numbers, a certain mapping to complex numbers can be used to approximate the derivatives of that function. By exploiting properties of (complex) analytic functions when carrying out divided differences, this so-called complex-step differentiation (Lyness and Moler 1967; Martins et al. 2003) avoids cancellation error making possible extremely small step sizes. However, complex-step differentiation is not applicable to second- and higherorder derivatives. Recent applications of the complex-step method are reported in (Anderson et al. 2001). The AD technology is applicable whenever the simulation code is given in the form of a high-level programming language such as FORTRAN, C or C++. In automatic differentiation any program is treated as a long sequence of elementary functions and intrinsics whose derivatives are known. Then, these step-wise derivatives are accumulated using the chain rule of differential calculus over and over again until the derivative for the whole program is computed. As a simple example, consider the FORTRAN statement x = y ∗ sin(z) where x, y, and z are scalar double precision variables. Suppose that the derivatives of y and z with respect to some scalar input variable of interest are already computed in new double precision variables g_y and g_z, respectively. Then, the derivative computation is carried forward to g_x, the derivative of x with respect to that input variable, by generating a new program which includes the additional FORTRAN statement g_x = g_y ∗ sin(z) + y ∗ cos(z) ∗ g_z just before the original statement. Further details on this technique, including the socalled forward and reverse modes of AD, are given in the books by Griewank (2000) and Rall (1981) and in the workshop proceedings (Berz et al. 1996; Corliss et al. 2002; Griewank and Corliss 1991; Bücker et al. 2005). Several AD tools are available for transforming a given code into a new differentiated code; see www.autodiff.org. In order to produce the required derivatives we applied the ADIFOR tool (Bischof et al. 1996) to SEPRAN, obtaining a derivative-enhanced version of the simulation code which delivers the original simulation function as well as the necessary sensitivities without truncation error. This is a non-trivial task, and the SEPRAN package is one of the biggest codes successfully differentiated to date. In previous studies (Bischof et al. 2003e) we reported on the differentiation of the SEPRAN package using the ADIFOR tool, and we also demonstrated the correctness of the sensitivities for the problem of a levitated droplet (Bischof et al. 2003d).

192

E. Groß-Hardt et al.

4.2 Optimization process using EFCOSS The design optimization problem of the measuring cell requires the evaluation of the two different objective functions (3) and (4). The function (3) describes the equilibrium of vertical forces and represents a constraint necessary for achieving a stable drop in the measuring cell. The function (4) details a criterion for maximum horizontal stability and is considered the objective function for the design optimization process. However, both criteria are described as functions of certain geometry parameters of the numerical simulation and therefore the evaluation and optimization of their respective values are computed in a similar way. To be able to optimize the geometry of the measuring cell, the derivatives of the objective functions with respect to the geometry parameters are required. The objective function and its derivatives are used by EFCOSS to determine the optimal geometry regarding the stability of the drop in the measuring cell. EFCOSS is designed to solve a single optimization problem at a time. However, recall from Fig. 2 that there are two optimization loops to be performed in each design optimization step. The vertical equilibrium of forces is, although physically just a constraint, a separate optimization process where the droplet position has to be determined in every iteration. This constraint has to be fulfilled so that the actual stability criterion—the horizontal component—can be optimized: Determine the best cell radius and cone angle that minimizes the horizontal stability of the drop. The EFCOSS environment was therefore adapted to solve both optimization problems in an interleaved way, showing the flexibility of the framework. The steps of the optimization process are as follows. We first choose a set of fixed operating conditions, for example, the droplet radius and inflow velocity. Then, we specify an estimate for the geometry parameters through the cell radius and cone angle and then estimate the droplet position. The next step is the generation and discretization of the geometry, followed by the simulation of a mesh-independent solution of the flow equations. We then evaluate the stability criteria together with their respective derivatives. Using these values, we optimize the droplet position so that the constraint is fulfilled. In the next step, we optimize the geometry parameters, cell radius and cone angle, such that the obtained cell exhibits a minimal criterion for the horizontal stability. The differentiated version of SEPRAN is able to compute derivatives with respect to the three geometric parameters. However, for the sake of efficiency, we have developed separate versions for the constraint problem and the optimization problem. The AD-generated code used in the constraint problem computes derivatives solely w.r.t. the drop position. Compared to the original simulation, we observe an increase in computing time and memory requirement for the differentiated version by factors of 1.66 and 1.37, respectively. For the optimization problem, we use a version computing derivatives w.r.t. the radius of the narrowest cross-section and the cone angle. Computing time and memory requirement to compute these two derivatives increase by factors of 2.41 and 1.67, respectively, compared with the original function simulation. A first-order approximation by divided differences would require at least two runs of the original simulation for each computed derivative, demonstrating that the AD approach is computationally competitive with numerical differentiation.

Practical shape optimization of a levitation device for single droplets

193

The computational and memory requirements depend on the mesh refinement levels: A more detailed mesh requires more computational resources, but the corresponding factors for the differentiated over the original version remain essentially the same. The measurements were made on a 900 MHz UltraSPARC III processor.

5 Numerical results 5.1 Evaluation of criteria for stability The criterion for the vertical stability was verified by comparing the numerical results achieved for a rigid particle in creeping flow (Re = 5 × 10−5 ) in an unbounded fluid with the analytical Stokes-solution. A mesh described in Tabata and Itakura (1998) for calculating the drag force on rigid particles was used as a template. The mesh was modified to be freely scalable in nodal-point density and extension. For a droplet of OMCTS with a radius of 1 mm in deuterated water, the relative error of the numerical solution is given in Fig. 6. For an extension of the calculated region larger than a certain value, the error is almost constant and quite small. For instance, if the smallest distance between two mesh-points is 0.0625 mm and the extension of the calculated region is 225 mm, the relative error is less than 1%. Similar results were observed in a previous study (Henschke et al. 2000). The optimization criterion for horizontal stability was numerically compared for two measuring cells. For the measuring cell which stabilizes the droplet, the resulting force on the droplet interface was found to be 208.9 µN. For the standard cell of Fig. 1 which exhibits unstable droplet positions, the resulting force was 285.2 µN. Thus, the resulting force is 37% higher for the unstable case. 5.2 Results of the optimization process Given the velocity of the inflow, the density and viscosity of the two phases, as well as the droplet and the counter current, the SEPRAN package computes the velocity and pressure fields in the entire measuring cell. Figure 7 shows the vertical component of the velocity field (left) and the derivative of this field with respect to the radius of the narrowest cross-section (right). There is a zoom in the region where the droplet stays in a stable condition. This is also the region in which the sensitivities are most significant, meaning that the largest increase in vertical velocities with respect to changes in the variable of interest occurs in the vicinity of the droplet. A series of numerical design optimization processes were conducted for various different operating conditions. The three most significant operating conditions are given in Table 1, specifying the droplet radius and the volume flow rate that directly determines the inflow velocity of the counter-current. In other configurations it was impossible to satisfy the constraint condition and, therefore, those geometries did not lead to a valid design for the measuring cell. In Table 1, the optimization parameters and the optimization criteria are grouped together. The values at the start of the optimization process are represented by the column “Initial”, whereas the values after the optimization are given in the column

Optimized

3 −8

Range: [1 : 4] Range: [−65 : −4]

Cell Radius [mm]

Cone Angle [degrees]

Droplet Position [mm]

parameters

Range: [3 : 7]

5.5

240

Optimization

Target: 0

Horizontal Stability [µN]

criteria

−5.23

1

7

43.8

9.80665

Initial

12.56

Initial Target: 9.80665

Vertical Stability [m/s2 ]

Optimization

1.75

1.5

−8

3

5.5

395

10.607

11.05

Droplet Radius [mm]

50

10.24

Inflow Velocity [mm/s]

conditions

46

Volume Flow Rate [l/h]

Operating

Table 1 Shape optimization results for three possible operating conditions

Optimized

−4.4

1

7

64

9.80665

−8

3

5.5

879

15.88

Initial

1.75

16.57

75

Optimized

−8.17

4

7

305

9.80665

194 E. Groß-Hardt et al.

Practical shape optimization of a levitation device for single droplets

195

Fig. 6 Numerical solution of drag forces on a rigid sphere in unbounded creeping flow in comparison to analytical Stokes solution

“Optimized”. The radius of the narrowest cross-section and the cone angle are optimized so that the horizontal stability is improved. The best possible theoretical value for this heuristic criterion is zero. For each of the three presented configurations, the optimization provided a significant improvement of the horizontal stability criteria compared to its initial value. Recall that, in each optimization step, the constraint specifying that the forces in the vertical direction are balanced must be fulfilled. The vertical stability criterion was always satisfied throughout the iteration for all three configurations. The initial values of the design process did not have any influence on the outcome of the process. Several initial configurations were used, and the result of the optimization process was always the same. However, in all cases the optimization process of the horizontal stability led to a broadening of the narrowest part of the measuring cell. From an analysis of the sensitivities w.r.t. the cone angle, we found that this parameter has very little impact on the specified stability criterion. This is illustrated by the fact that in two out of three cases the optimized cone angle determines a narrowing of the cone base, to one degree, and in the third it determines the widening of the cone base to four degrees.

196

E. Groß-Hardt et al.

Fig. 7 Vertical velocity flow field and its derivative with respect to the radius of the narrowest cross-section

5.3 Interpretation of results The results suggest that the standard cell for measuring mass transfer described by Schröter et al. (1998) is unsuitable for stable levitation of a single droplet needed for the NMR-measurements. The discontinuous narrowing in the upper part of the measuring cell is responsible for a momentum mixing inducing an unfavorable block profile. This view is substantiated by two facts. First, a broader cell radius is found to yield an increase in horizontal stability. Second, a negative cone angle leading to a more continuous narrowing is preferred, if this angle is not constrained to positive values. Both these optimizations are reducing the discontinuous narrowing. Thus, these findings suggest that an optimized geometry should be a thin cell with a continuous narrowing. Since positive angles have little impact on horizontal stability, a reasonable angle can be chosen by considering vertical stability. According to Idelchik (1994) a backflow in the conical part can occur for angles greater than three degrees. Such a backflow is usually developing only on one side of the cell leading to a non-symmetrical contraction of the continuous flow. This flow could lead to an off-central position of the droplet. Thus, it is reasonable to consider angles less than or equal to three degrees. The results of our study indicate a significant dependence of the geometry on the operating conditions. For a given operating condition, the proposed optimization scheme finds a suitable geometry. However, if one is interested in measuring at several different operating conditions, there is need for reformulating the objective function. Here, our results can contribute when setting up formulation involving weighted sums representing various operating conditions. Another option for future work is to consider additional parameters characterizing the geometry, giving up the restriction to consider only cone angle and cell radius as free parameters of the opti-

Practical shape optimization of a levitation device for single droplets

197

mization. A challenging problem would by to address the shape optimization problem in a formulation allowing a larger number of parameters or even without explicit parametrization. Indeed, it would be interesting to switch to a representation of the geometry in the form of a level set function that would manipulate the shape of the measuring cell implicitly.

6 Summary The shape optimization of a standard single-droplet cell regarding the stability of shape as well as vertical and horizontal position of the droplet is carried out to make possible long-time measurements with nuclear magnetic resonance (NMR) spectroscopy. First, we determine a subset of parameters, restricting the shape of the cell to a fixed topology described by two characteristic geometric parameters. Then, we derive and make plausible heuristic stability criteria for a steady state axially-symmetric simulation. For a fast convergence of the subsequent design optimization problem, we employ a gradient-based optimization scheme. Automatic differentiation is used to accurately and efficiently compute the underlying gradients. The results of the optimization suggest a thin cell with a continuous narrowing and an appropriate cone angle rather than the standard cell that was previously considered suitable for stable levitation. Acknowledgements The authors would like to thank Arno Rasch and Jacob W. Risch for their valuable contributions during various stages of this project. We also thank Guus Segal, Delft University of Technology, for continual modifications of the SEPRAN source code to meet our needs. This research is partially supported by the Deutsche Forschungsgesellschaft (DFG) within SFB 540 “Model-based experimental analysis of kinetic phenomena in fluid multi-phase reactive systems” at RWTH Aachen University, Germany.

References Anderson WK, Newman JC, Whitfield DL, Nielsen EJ (2001) Sensitivity analysis for the Navier–Stokes equations on unstructured meshes using complex variables. AIAA J 39(1):56–63 Berz M, Bischof CH, Corliss G, Griewank A (1996) Computational differentiation: techniques, applications and tools. SIAM, Philadelphia Bischof CH, Carle A, Khademi P, Mauer A (1996) ADIFOR 2.0: automatic differentiation of FORTRAN 77 programs. IEEE Comput Sci Eng 3(3):18–32 Bischof CH, Bücker HM, Lang B, Rasch A (2003a) An interactive environment for supporting the transition from simulation to optimization. Sci Program 11(4):263–272 Bischof CH, Bücker HM, Lang B, Rasch A (2003b) Solving large-scale optimization problems with EFCOSS. Adv Eng Softw 34(10):633–639 Bischof CH, Bücker HM, Rasch A, Slusanschi E (2003c) Evaluation of a computer model for wavy falling films using EFCOSS. In: Kumar V, Gavrilova ML, Tan CJK, L’Ecuyer P (eds) Computational science and its applications—ICCSA 2003, proceedings of the international conference on computational science and its applications, part II, Montreal, Canada, 18–21 May 2003. Lecture notes in computer science, vol 2668. Springer, Berlin, pp 78–84 Bischof CH, Bücker HM, Rasch A, Slusanschi E (2003d) Sensitivities for a single drop simulation. In: Sloot PMA, Abramson D, Bogdanov AV, Dongarra JJ, Zomaya AY, Gorbachev YE (eds) Computational science—ICCS 2003, proceedings of the international conference on computational science, part II, Melbourne, Australia and St. Petersburg, Russia, 2–4 June 2003. Lecture notes in computer science, vol 2658. Springer, Berlin, pp 888–896

198

E. Groß-Hardt et al.

Bischof CH, Bücker HM, Lang B, Rasch A, Risch JW (2003e) Extending the functionality of the generalpurpose finite element package SEPRAN by automatic differentiation. Int J Numer Methods Eng 58(14):2225–2238 Bischof CH, Bücker HM, Lang B, Rasch A, Slusanschi E (2005) Efficient and accurate derivatives for a software process chain in airfoil shape optimization. Future Gener Comput Syst 21(8):1333–1344 Bosch EGT, Lasance CJM (2000) High accuracy thermal interface resistance measurement using a transient method. Electron Cool Mag 6(3):26–32 Brauer H (1979) Turbulenz in mehrphasigen Strömungen. Chem Ing Tech 51(10):934–948 Bücker HM, Corliss GF, Hovland PD, Naumann U, Norris B (2005) Automatic differentiation: applications, theory, and implementations. Springer, New York Carle A, Fagan M, Green LL (1998) Preliminary results from the application of automated adjoint code generation to CFL3D. In: Proceedings of the 7th AIAA/USAF/NASA/ISSMO symposium on multidisciplinary analysis and optimization, St. Louis, MO, USA, 2–4 September 1998, AIAA Paper 98-4807 Clift R, Grace JR, Weber ME (1978) Bubbles, drops, and particles. Academic Press, New York Corliss G, Faure C, Griewank A, Hascöet L, Naumann U (eds) (2002) Automatic differentiation of algorithms: from simulation to optimization. Springer, New York Gay DM (1990) Usage summary for selected optimization routines. Computing Science Technical Report 153, AT&T Bell Laboratories, Murray Hill Griewank A (1989) On automatic differentiation. In: Iri IM, Tanabe K (eds) Mathematical programming: recent developments and applications. Kluwer Academic, Dordrecht, pp 83–108 Griewank A (2000) Evaluating derivatives: principles and techniques of algorithmic differentiation. SIAM, Philadelphia Griewank A, Corliss G (1991) Automatic differentiation of algorithms. SIAM, Philadelphia Han SI (2001) Correlation of position and motion by NMR: pipe flow, falling drop, and salt water ice. Dissertation, RWTH Aachen University Han SI, Stapf S, Blümich B (2001) NMR imaging of falling water drops. Phys Rev Lett 87(14):144501 Hascoët L, Vazquez M, Dervieux A (2003) Automatic differentiation for optimum design, Applied to sonic boom reduction. In: Kumar V, Gavrilova ML, Tan CJK, L’Ecuyer P (eds) Computational science and its applications—ICCSA 2003, proceedings of the international conference on computational science and its applications, part II, Montreal, Canada, 18–21 May 2003. Lecture notes in computer science, vol 2668. Springer, Berlin, pp 85–94 Henschke M (2004) Auslegung pulsierter Siebboden-Extraktionskolonnen. Shaker Aachen, Habilitationsschrift, RWTH Aachen, ISBN 3-8322-3511-6. Henschke M, Pfennig A (1996) Simulation of packed extraction columns with the REDROP model. In: Proceedings of the 12th international congress of chemical and process engineering, CHISA, Praha Henschke M, Waheed A, Pfennig A (2000) Wandeinfluss auf die Sedimentationsgeschwindigkeit von Kugeln. Chem Ing Tech 72(11):1376–1380 Idelchik IE (1994) Handbook of hydraulic resistance. CRC Press, Boca Raton, pp 239–331 Kumar A, Hartland S (1994) Prediction of drop size, dispersed-phase holdup, slip velocity, and limiting throughputs in packed extraction columns. Trans IChemE, Part A 72:89–104 Lyness JN, Moler CB (1967) Numerical differentiation of analytical functions. SIAM J Numer Anal 4:202– 210 Martins JRRA, Sturdza P, Alonso JJ (2003) The complex-step derivative approximation. ACM Trans Math Softw 29:245–262 Schröter J, Bäcker W, Hampe MJ (1998) Stoffaustauschmessungen an Einzeltropfen und an Tropfenschwärmen in einer Gegenstrommeßzelle. Chem Ing Tech 70(3):279–283 Rall LB (1981) Automatic differentiation: techniques and applications. Lecture notes in computer science, vol 120. Springer, Berlin Segal G (1993) SEPRAN users manual. Ingenieursbureau Sepra, Leidschendam Segal G, Vuik C, Vermolen FA (1998) Conserving discretization for the free boundary in a twodimensional Stefan problem. J Comput Phys 141(1):1–21 Slattery JC (1990) Interfacial transport phenomena. Springer, Berlin Tabata M, Itakura K (1998) A precise computation of drag coefficients of a sphere. Int J Comput Fluid Dyn 9(3–4):303–311

Practical shape optimization of a levitation device for single droplets

199

Tomiyama A, Tamai H, Zun I, Hosokawa S (2002) Transverse migration of single bubbles in simple shear flows. Chem Eng Sci 57:1849–1858 van Kan JJIM, Segal A (1995) Numerik partieller Differentialgleichungen für Ingenieure. Teubner, Stuttgart, p 117 van Keken PE, Yuen DA, Petzold LR (1995) DASPK: a new high order and adaptive time-integration technique with applications to mantle convection with strongly temperature- and pressure-dependent rheology. Geophys Astrophys Fluid Dyn 80:57–74