a new nonlinear solution method for phase-change

0 downloads 0 Views 248KB Size Report
occurred. We present a fully implicit solution method for the enthalpy form of the ... We start with the definition of a two-phase-mixture energy equation appro- ... These assumptions are not necessary for our algorithm, but rather simplify the.
Numerical Heat Tr ansfer, Part B, 35:439 ± 459, 1999 Copyright Q 1999 Taylor & Fr ancis 1040± 7790 r 99 $12.00 H .00

A NEW NONLINEAR SOLUTION METHOD FOR PHASE-C HANGE PR OBLEMS D. A. Knoll, D. B. Kothe, and B. Lally

Downloaded by [Oak Ridge National Laboratory] at 17:19 19 May 2013

Los Alamos National Laboratory, M.S. D413, Los Alamos, NM 87545, USA We present a new nonlinear algorith m for the efficient and accurate solution of isothermal and nonisothermal phase-change problems. The method correctly e vol ves latent heat release in isothermal and nonisothermal phase change, and more important, it prov ides a means for the efficient and accurate coupling between temperature and concentration fields in multispecies nonisothermal phase change. Newton-like superlinear con vergence is achie v ed in the global nonlinear iteration , withou t the complexity of forming or in v erting the Jacobian matrix. This ``Jacobian-free’’ method is a combination of an outer Newton-based iteration and an inner conjugate gradient-like (Krylo v ) iteration . The effects of the Jacobian are probed only through approximate matrix- v ector products required in the conjugate gradient-like iteration .

1

INTR OD UC TION

Numerical simulation is playing an increasingly important role in support of industrial casting processes. The goal of simulations is to capture accurately the solidification dynamics in pure materials, and in multicomponent alloys. To achieve this goal a numerical algorithm must evolve accurately the latent he at in an isothermal solidification process, and it must also couple accurately the temperature and concentration fields in the nonisothermal solidification of multicomponent alloys. Implicit solution algorithms are often preferred to avoid undesirable numerical stability s time step. restrictions. The most common form of the energy equation for implicit methods uses temperature as a dependent variable w 1 ] 3x . This form of the energy equation includes a latent he at source term that is not a single-value d function of temperature for isothermal solidification. Several strategies have been developed for integrating this source term implicitly. Those strategies that attempt to conserve energy are forced to fix locations on the grid that are undergoing isothermal solidification w 1, 2x . At these locations, where the energy equation is actually being solved for enthalpy, a local change of dependent variable has occurre d. We present a fully implicit solution method for the enthalpy form of the energy equation. The front evolve s in a completely self-consistent fashion and there is no local switching of dependent variables. Enthalpy is the dependent Received 13 June 1998; accepted 25 August 1998. This work was supported under the auspices of the U.S. Department of Energy under DOE contract W-7405-ENG-36 at Los Alamos National Laboratory, and as part of the Accelerated Strategic Computing Initiative s ASCI.. Address correspondence to Dana Knoll, Los Alamos National Laboratory, M.S. D413, Los Alamos, NM 87545, USA. 439

440

D. A. KNOLL ET AL.

Downloaded by [Oak Ridge National Laboratory] at 17:19 19 May 2013

NOMENC LATUR E Cp Cl Cs h H J k L M ml St T t Te u t Tf

heat capacity solute concentration in liquid solute concentration in solid phase enthalpy enthalpy Jacobian matrix partition coefficient latent heat of fusion preconditioning matrix liquidus slope Stefan number temperature time eutectic temperature fusion temperature

Tl Tm u v x y a e e s k

liquidus temperature melting temperature velocity Krylov ve ctor position preconditioned Krylov vector thermal diffusivity small perturbation solid volume fraction thermal conductivity

Subscripts l s

liquid solid

variable in our nonlinear iterations, and temperature is represented as a local function of enthalpy and solid volume fraction in a pure material; in an alloy, temperature is represented as a local function of enthalpy, solid volume fraction, the phase diagram, and a local-scale transport model. For multicomponent problems with flow, our algorithm assumes that species advection is modeled in a time-explicit fashion, consistent with the assumption in w 2x . However, the basic numerical method presented here could be used as a general flow solver w 4 ] 6x . One could solve the coupled system for a solidification problem with flow with this technique, which is currently under investigation. We view our algorithm as a departure from existing fixed-grid implicit methods. It is an implicit method with enthalpy as the dependent variable , a global Newton iteration is performed without forming or inverting the Jacobian matrix, and the solidification front is captured rather than being tracked. With this in mind, our primary motivation is to describe clearly the details of the method. Detailed performance comparisons with existing algorithm s will be the focus of a subsequent study. In the following sections we discuss the issue of an enthalpy versus a temperature form of the energy equation. We present the structure of our discrete implicit equation for enthalpy, and the associate d temperature function. This is illustrated for a pure-material Stefan problem and for a binary eutectic alloy with a simple local scale model. Details of our Newton iteration are then presented; specifically, we discuss how the Newton iteration is accomplished without forming or inverting the Jacobian. We conclude with some typical performance results for a pure-material Stefan problem and for a binary eutectic alloy. 2

TEMPER ATUR E OR ENTHALPY FOR MULATION

We start with the definition of a two-phase-mixture energy equation appropriate for materials undergoing solid ] liquid phase change. The subscript s denote s

SOLUTION METHOD FOR PHASE-CHANGE PROBLEMS

441

the solid phase and the subscript l denotes the liquid phase. In enthalpy form, the evolution of energy of the solid ] liquid mixture is given by

­ w r Hx

q= ? s r l hlu l. y = ? s k = T . s 0

­ t

s 1.

where the mixture density is wr xse

s

r

q s 1 y e s. r

s

s 2.

l

Downloaded by [Oak Ridge National Laboratory] at 17:19 19 May 2013

and the mixture volumetric enthalpy is w r H x s e s r sh s q s 1 y e s. r l hl

s 3.

h s s Cp , sT

s 4.

h l s Cp , l T q L

s 5.

The phase enthalpies are

Here r is density, u is velocity, T is temperature, e s is the solid volume fraction, k is the thermal conductivity, C p is the he at capacity, and L is the latent heat of fusion. For simplicity and ease of communication, we present our method with the following assumptions. 1. 2. 3. 4.

One spatial dimension No flow in the liquid s u l s 0. Constant thermodynamic properties s r , k , C p , L . within phases Equal thermodynami c properties between phases s r s s r l , etc...

These assumptions are not necessary for our algorithm, but rather simplify the discussion that follows. These assumptions result in a simplified mixture enthalpy equation,

r

­ H ­ t

yk

­

t / ­ T

­ x ­ x

s 6.

s0

where H s C p T q s 1 y e s . L. Upon substitution into Eq. s 6. and rearrangement, we can obtain the temperature form of the energy equation:

­ T ­ t

ya

­

t / ­ T

­ x ­ x

sy

L ­ s 1 y e s. Cp

­ t

s 7.

where a s k r s r C p .. This form of the energy equation is most often employed in implicit fixed-grid methods for phase-change problems w 1 ] 3x . Various strategies have been developed for integrating the source term implicitly while maintaining energy conservation in the phase-change region w 1 ] 3x . The main difficulty with this

Downloaded by [Oak Ridge National Laboratory] at 17:19 19 May 2013

442

D. A. KNOLL ET AL.

Figure 1. Pure-material Hs T . relation, Tm s 0.5 and L s 0.4.

approach is evident in Figure 1, where a pure-material enthalpy ] temperature relation is depicted. It is clear that there exists a range of possible values for H at Tm s the melting temperature ., i.e., there is not a unique H s Tm .. The infinite slope at this point is also observed in nonisothermal solidification for alloys with a eutectic point. The temperature version of the energy equation at the front is therefore ill-posed because H s Tm . is not single-valued. At the front, T is constant and e s is a function of enthalpy through the relationship H y C p Tm s s 1 y e s . L. This nonuniqueness is avoided in standard implicit methods by fixing the temperature T at Tm , whereby the energy equation is solved for e s with the time derivative of temperature set to zero. This can be shown to be equivalent to solving for H at the front. Substituting H y C p Tm s s 1 y e s . L into Eq. s 7. s with ­ T r ­ t s 0., the energy equation at the front becomes

a

t /

­

­ T

­ x ­ x

s

1 ­ s H y C p Tm . Cp

­ t

t /

­ s H.

s 8.

or, upon rearrangement,

k

­

­ T

­ x ­ x

sr

­ t

s 9.

This represents a local exchange in dependent variables at the front from T to H, and requires one to fix the front position over a nonlinear iteration within a time step. This artificial ``fixing’’ of the front position may restrict time step size for nonlinear convergence and accuracy. However, this approach is certainly to be preferred to the apparent he at capacity method in terms of accuracy and energy conservation w 1x . It is insightful to note that Eq. s 9. is precisely the form of the energy equation that we started with, Eq. s 6..

Downloaded by [Oak Ridge National Laboratory] at 17:19 19 May 2013

SOLUTION METHOD FOR PHASE-CHANGE PROBLEMS

443

Figure 2. Pure-material T s H . relation, Tm s 0.5 and L s 0.4.

In employing enthalpy as the dependent variable on the entire grid, we need to evaluate T as a function of H, which is depicted in Figure 2 for a pure material. Here we can clearly see that temperature is a unique, single-valued function of enthalpy. 3

THE D ISC R ETE IMPLIC IT ENTHALPY EQUATION

In this section a discrete implicit solution to the enthalpy form of the energy equation is formulated. This results in a nonlinear system of algebraic equations. We demonstrate how to incorporate temperature as a function of enthalpy for both pure materials and alloys. A clear understanding of our nonlinear algebraic system is essential for describing the unique way in which we solve our nonlinear problem using a Newton iteration without forming the Jacobian. Assuming that we can express temperature as a function of enthalpy, T s 4 s H ., we write the enthalpy form of the energy equation as

­ H ­ t

y

k

­

­ 4 s H.

r ­ x

­ x

s0

s 10 .

Using a simple first-order in time s backward Euler., second-orde r in space discretization on a uniform grid, a discrete version of this equation can be written as Hin q1 y Hin D t

y

k r D x2

n q1 . 4 s Hinq1q1 . y 244 s Hin q1 . q44 s Hiy s0 1

s 11 .

444

D. A. KNOLL ET AL.

where i is the grid index, n is the time-step index, D t is the time step, and D x is the grid spacing. It is straightforwar d to construct a second-orde r in time, secondorder in space, method as well. One could consider the Crank-Nicolson method, Hin q1 y Hin D t

y

k

n q1 r 2 . 4 s Hinq1q1 r 2 . y 244 s Hin q1 r 2 . q44 s Hiy s 0 s 12 . 1

r D x2

where Hin q1 r 2 s s Hin qHin q1 . r 2, or an Adams-Bashford three-level method,

Downloaded by [Oak Ridge National Laboratory] at 17:19 19 May 2013

3 Hin q1 y Hin

y

D t

2 y

k

1 Hin y Hin y 1 D t

2

n q1 . 4 s Hinq1q1 . y 244 s Hin q1 . q44 s Hiy s0 1

r D x2

s 13 .

To close the problem statement, the function 4 s H . must be defined. For a pure material with a melting temperature Tm , the function is defined as

4 s H. s

í

I H rCp Tm Hy L

J

Cp

H - C p Tm C p Tm ( H ( C p Tm q L H ) C p Tm qL

which is a piecewise linear relationship between H and T s Figure 2.. This problem has been solved with a standard Newton method, where the Jacobian is formed w 7, 8x . It is our goal to construct a Newton-based method that easily extends to nonisothermal solidification problems by sidestepping the need to form the true Jacobian. Moving to a more complex multicomponent system, such as a binary eutectic alloy, the function 4 s H . becomes more complex. Assuming a straight liquidus slope on the phase diagram, we have the following temperature ] concentration relationship: T s Tf q m l Cl

s 14 .

where Tf is the fusion temperature of the pure solvent, m l is the slope of the liquidus line, and Cl is the liquid solute concentration. Assuming that thermodynamic equilibrium holds at the solid ] liquid interface results in the following relationship for the solute concentration in the solid at the interface: Cs s kCl where 0- e s model model

s 15 .

k is the partition coefficient. In nonisothermal solidification the region

- 1 is referred to as the ``mushy zone.’’ In the mushy zone a local-scale

is used to account for solute diffusion in the solid w 2, 9, 10 x . This local-scale defines the solute liquid concentration as a function of solid volume

SOLUTION METHOD FOR PHASE-CHANGE PROBLEMS

445

fraction,

Downloaded by [Oak Ridge National Laboratory] at 17:19 19 May 2013

Cl s G s e s .

s 16 .

Here a solution to the energy equation must be found which simultaneously satisfies Eqs. s 14 . and s 16., and H s C p T q s 1 y e s . L. In this study we will use simple local-scale models which assume either complete solute diffusion in the liquid and no solute diffusion in the solid s the Scheil assumption., or complete solute diffusion in both the liquid and the solid s the lever rule .. For a binary alloy s neglecting flow in the liquid., these assumptions result in the following temperature ] solid volume fraction relationships:

e

s

s 1.0 y

t

Tf y Tl Tf y T

/

y s 1y k .

s 17 .

for the Scheil assumption, and

e

s

s 1.0 y

t

Tf y T Tf y Tl

/t

1 1yk

/

s 18 .

for the lever rule. The temperature function for a eutectic can be expressed as

I 4 s H. s

H Cp

í

Teut H y s 1 y e s. L Cp Hy L

J

Cp

H - C p Te ut C p Te ut ( H ( C p Teut q s 1 y e C p Teut q s 1 y e

s, e ut

s, e ut

.L

. L ( H ( C p Tl q L

H ) C p Tl q L

where Teut is the eutectic temperature. For alloys, the additional complexity, as compared to pure materials, is that in the mushy zone s C p Te ut q s 1 y e s, eut . L ( H ( C p Tl q L ., where one must simultaneously satisfy the energy balance, the phase diagram, and a local-scale model. In this region a small nonlinear system must be solved to extract T as a function of H. If the Schiel or lever assumptions hold, the phase diagram and local-scale model can be combined to give e s as a function of T as in Eq. s 17. or Eq. s 18 .. Then the nonlinear system that needs to be solved to extract T as a function of H in the mushy zone consists of two equations, either Eq. s 17. or Eq. s 18. along with H s C p T q s 1 y e s . L. For example, if the Schiel model is being used, then the

446

D. A. KNOLL ET AL.

solution to the two-equation nonlinear system, Cp T q s 1 y e s . L y H s 0

Downloaded by [Oak Ridge National Laboratory] at 17:19 19 May 2013

e

s

q

t

Tf y Tl Tf y T

/

s 19 .

y s 1y k .

y 1.0 s 0

must be found at each finite volume in the mushy zone. This is done with a standard Newton iteration s typically in three to five iterations.. For a binary alloy possessing a more complicated phase diagram and r or local-scale model, solutions to a system of three nonlinear equations must be found, Eqs. s 14. and s 16., along with H s C p T q s 1 y e s . L. Again, this small nonlinear system is solved only for cells in the mushy zone. For an N-component alloy, a system of N q1 equations must be solved, Eq. s 14., N y 1 equations like Eq. s 16. along with H s C p T q s 1 y e s . L. The nonlinear functions resulting from the discretized energy equation w not 4 s H .x play such an important role in describing the algorithm that we define them so as to avoid any confusion. The nonlinear functions are the discretized equations at each grid cell. The functions for energy at cell i, Fi , are

Fi s

Hin q1 y Hin D t

y

k r D x2

n q1 . 4 s Hinq1q1 . y 244 s Hin q1 . q44 s Hiy 1

s 20 .

In the next section we demonstrate that this function only needs to be evaluate d with the current solution, H n , and a perturbed solution, H n q e v s where v is a general vector., to perform a Newton iteration. To evaluate Fi we need to evaluate 4 s Hiy 1 ., 4 s Hi ., and 4 s Hi q1 .. For those control volumes that reside in the mushy zone, a small nonlinear system needs to be solved. This local nonlinear iteration is inside our global outer Newton iteration. Again, the local evaluation of Fi in the mushy zone for a multicomponent system requires the solution to a small nonlinear system to extract T as a function of H. The L 2 norm of the nonlinear function, Fi , is used to declare convergence of the nonlinear iteration within a time step. 4

JAC OBIAN-FR EE NEWTON-KR YLOV METHOD

In this section we provide a detailed description of our nonlinear iterative method. The discussion of Newton’s method is standard. We will give some description of a Krylov-base d linear iterative method in order to elucidate the Jacobian-free aspect of the proposed method. We will not give a detailed description of Krylov methods, for which we recommend the following texts w 11, 12x . The nonlinear iteration scheme is an inexact, matrix-free Newton-Krylov method. By inexact Newton we mean that the convergence tolerance of the linear solver is proportional to the current nonlinear residual. By matrix-free Newton-Krylov we

SOLUTION METHOD FOR PHASE-CHANGE PROBLEMS

447

me an that the required Jacobian-vector product in each linear s Krylov. iteration is replaced by a finite-difference approximation to the true Jacobian-vector product w 13x . Newton’s method requires the solution of the linear system Jk d H k s y F s H k .

H k q1 s H k q d H k

s 21 .

Downloaded by [Oak Ridge National Laboratory] at 17:19 19 May 2013

where J is the Jacobian matrix, Fs H. is the nonlinear system of equations, H is the state vector, and k is the nonlinear iteration index. For our one-dimensional problem, discretized into N equations and N unknowns, we have F s H. s v F1 , F2 , . . . , Fi , . . . , FN 4

s 22 .

H s v H1 , H2 , . . . , Hi , . . . , HN 4

s 23 .

and

where i is the one-dimensional grid index. In vector notation, the s i, j .th element of the Jacobian matrix is Ji, j s

­ Fi s H. ­ Hj

s 24 .

Forming each element of J requires taking analytic or discrete derivative s of the system of equations with respect to H. This can be both difficult and time consuming for nonisothermal solidification problems and for problems with thermodynami c data in tabular form. 4 .1

Matrix-Free Approximation

In this study the Generalized Minimal RESidual s GMRES. w 14x algorithm is used to solve the linear system of equations given by Eq. s 21.. GMRES s or any other Krylov method such as conjugate gradients. defines and initial linear residual, r 0 given an initial guess, d H 0 s typically zero., r 0 s y F s H. y J d H 0 .

s 25 .

Note that the nonlinear iteration index, k, has been dropped. This is because the GMRES iteration is performed at a fixed k. l is the linear iteration index. The lth GMRES iteration minimizes 5J d H l q Fs H.5 2 with a least-squar es approach. d H l is constructe d from a linear combination of the Krylov vectors, v r 0 , Jr 0 , s J. 2 r 0 , . . . , s J. ly 1 r 0 4, obtained during the previous l y 1 GMRES iterations. This linear combination of Krylov vectors can be written as

d Hl s d H 0 q

ly 1

p

j b j s J. r 0

js 0

where evaluating the scalars b

j

is part of the GMRES iteration.

s 26 .

448

D. A. KNOLL ET AL.

Upon examining Eq. s 26. we see that GMRES requires the action of the Jacobian only in the form of matrix-vector products, which may be approximated by w 13x :

Downloaded by [Oak Ridge National Laboratory] at 17:19 19 May 2013

Jv f

F s H q e v . y F s H.

s 27 .

e

where v is a general Krylov vector s i.e., one of v r 0 , Jr 0 , s J. 2 r 0 , . . . , s J. ly 1 r 0 4., and e is a small perturbation. Equation s 27. is simply a first-orde r Taylor series expansion approximation to the Jacobian, J, times a vector, v. For illustration consider the two coupled nonlinear equations F1s H1 , H2 . s 0, F2 s H1 , H2 . s 0. The Jacobian matrix is

Js

­ F1

­ F1

­ H1

­ H2

­ F2

­ F2

­ H1

­ H2

Our method never forms this matrix; we instead form a vector that approximate s this matrix multiplied by a vector. Working backwards from Eq. s 27., we have

F s H q e v . y F s H.

e

s

u

F1s H1 q e v 1 , H2 q e v 2 . y F1s H1 , H2 .

e F2 s H1 q e v 1 , H2 q e v 2 . y F2 s H1 , H2 . e

0

Approximating Fs H q e v. with a first-order Taylor series expansion about H, we have F s H q e v . y F s H.

e

f

u

F1s H1 , H2 . q e v 1 s ­ F1 r ­ H1 . q e v 2 s ­ F1 r ­ H2 . y F1 s H1 , H2 .

e s . s . r F2 H1 , H2 q e v 1 ­ F2 ­ H1 q e v 2 s ­ F2 r ­ H2 . y F2 s H1 , H2 . e

which simplifies to

u

v1 v1

­ F1 ­ H1 ­ F2 ­ H1

qv2 qv2

­ F1 ­ H2 ­ F2 ­ H2

0

s Jv

0

SOLUTION METHOD FOR PHASE-CHANGE PROBLEMS

449

This matrix-free approach has unique capabilities, namely, Newton-like nonlinear convergence without forming or in v erting the true Jacobian. In practice we do form a matrix for preconditioning purposes, hence our algorithm is not entirely matrix-free. However, since the matrix we form is far simpler than the true Jacobian of the problem, our algorithm is Jacobian-fre e. To complete the description of this technique we provide a prescription for evaluating the scalar perturbation. In this study e is give n by

Downloaded by [Oak Ridge National Laboratory] at 17:19 19 May 2013

e s

N

1 N 5v 5 2

p

b < Hm

Suggest Documents