You are on page 1of 7

Simulation of casting solidification

2.7 Numerical methods


2.7.1 Finite difference method
The solution domain in parabolic equations stretches outward indefinitely in one
coordinate direction, from the given initial values. The equation is solved for the
dependent variable T by advancing, or marching, in the independent variable t, starting
with the initial conditions at t = 0. The solution must satisfy the prescribed boundary
conditions, in the other independent variable x, as the solution advances in t. The
solution at any t depends on the values of T at smaller t but is independent of those at
larger t. The solution procedures for parabolic equations are, therefore, based on
marching outward from the initial conditions in one of the independent variables, while
satisfying the given boundary conditions in the other [34].

2.7.1.1 Computer Solution with an Explicit Scheme


Let us consider the one-dimensional transient heat conduction problem, as an
example of a parabolic PDE. Therefore, the dependent variable is the temperature
T(x,t), which is governed by the equation:

2T T
2 .2.11
x t
Since the equation contains the second derivative in x and only the first derivative in
time t, two boundary conditions are needed in x and a single initial condition in t. These
may be prescribed in terms of T(x,t) as
T (a, t) =A
T (b, t) =B
T (x,0) =TO
where x = a and x = b representing the boundaries of the region and TO is the initial
condition. In general, TO may be a function of x, and A and B may be functions of

7
time. However, for simplicity these are taken as constants here. The problem, as given
above, is properly posed for obtaining the solution for > 0.
The above parabolic PDE may be solved numerically by finite difference methods. A
space-time grid, with x and t denoting the corresponding mesh sizes, is taken, as
shown in Fig.2.11. Then, the finite difference approximations to the derivatives are
applied to the given equation at each grid point. Several finite difference
approximations can be obtained, depending on the representations used for the
derivatives. For instance, a forward difference representation may be used for the partial
derivative in time to obtain
T Ti 1, j Ti , j
2.12
t t
where the subscript (i+1) denotes the values at time ( t t ), and i those at time t. The
spatial location is given by j. For the mesh shown in Fig (2.11). x =jx and == i t.
The truncation error is O ( t).

Figure 2.11 space-time grids fore the solution of a parabolic PDE by


finite difference methods [35]
8
A central difference approximation may be employed for the second derivative to
obtain the approximation at time and location x as

2T Ti , j 1 2Ti , j Ti , j 1
( 2 )i , j .2.13
x (x)2
with a truncation error of O [(x) 2]. In this expression, the second derivative in x is
approximated at time . If the above finite difference representations are substituted into
Eq (2.11), the resulting equation may be written as:
t
Ti 1, j Ti , j .(Ti , j 1 2Ti , j Ti , j 1 ) 2.14
(x) 2
where the truncation error is O ( t) + O [(x) 2]. Therefore,

Ti 1, j (1 2F )Ti, j F (Ti, j 1 Ti, j 1 ) .2.15


where F is a constant known as the grid Fourier number and is given by
t
F
(x) 2 ..2.16
Equation (2.15) gives the temperature at time ( t t ) at the grid point whose, spatial

coordinate is x ix , in terms of the temperatures at time at the grid points with


coordinates (x -x), x, and (x +x). The temperatures at x = a and x = b remain
constant at A and B, respectively, because of the given boundary conditions. The initial
condition gives the temperatures at the grid points at time t = 0 as To, where To may be
given as a constant or as a function of x. Using Eq. (2.15), the temperature distribution
at time t t may be determined from the given temperatures at t = 0. Similarly, the
distribution at the second time step t 2t is obtained employing the computed
values at the first time step. Therefore, the solution is obtained at increasing values of
time t. This time marching may be continued indefinitely. However, the process is
generally terminated when a specified time t max has been attained or when the
steady state, given by a negligible change in the solution with increasing time, is
9
reached. In most cases, a steady-state circumstance is attained at large time, and a
convergence criterion may be applied to the solution in order to terminate the
computation when the solution is sufficiently close to the steady state. [35], [36], [37]
2.7.1.2 Stability of Euler's Method
The above method becomes unstable at large values of F. and stability is assured only lf
t 1
F 2.17
(x) 2
2

Therefore, an amplification of the round-off and truncation errors arises if F > 1/2 and
may lead to a meaningless solution as the computation advances in time. This condition
for numerical stability is obtained by stability analysis, considering the growth of errors
introduced into the solution. The major problem with the stability criterion given by Eq.
(2.17) is the constraint that it imposes on the allowable time step for a given grid
spacing Ax, which is generally chosen as small to keep the truncation error small. For a
given value of the thermal diffusivity , the maximum permissible time step t is
given by the stability constraint as

1 (x) 2
t 2.18
2
A small value of t is desirable for keeping the truncation error, which is of order
t in this formulation, down to a desired level. However, the stability criterion
generally limits the time step to a value that is much smaller than that needed for
maintaining the accuracy of the solution. Therefore, the explicit method often severely
constrains the time step and results in excessive computational time. Consequently,
other methods have been developed which, although often more involved than this
method, have better stability characteristics. [35], [36]
2.7.1.3 Implicit Methods
In the explicit method, the finite difference approximation for the second spatial
2T
derivative is written, in Eq. (2.13). At time t. A family of implicit methods may
x 2
10
be obtained by approximating this derivative at a different time, between t and t t .
The resulting finite difference equation is

TI , J 1 TI , J (Ti 1, j 1 2Ti 1, j Ti 1, j 1 ) ( 1)(Ti , j 1 2Ti , j Ti , j 1 )


[ ] .2.19
t (x)2
where is a parameter that lies between 0 and 1. Therefore, the second derivative is
written as a weighted average of the finite difference approximations corresponding to
time levels t and t t .
If =0, the explicit method, is obtained. For == , the second derivative is evaluated
midway between the two time levels, and the truncation error can be shown to become
O [( t )2] + O [(x)2]. This method, known as the Crank-Nicolson method, is very
popular for the solution of parabolic equations. If = 1, the second derivative is
evaluated at time t+ t , and the formulation is known as the fully implicit method. The
truncation error is the same as that for the explicit method. From Eq. (2.19), the finite
difference equations for the Crank-Nicolson and the fully implicit methods are,
respectively,
FTi 1, j 1 2(1 F )Ti 1, j FTi 1, j 1 FTi , j 1 2(1 F )Ti , j FTi , j 1 .2.20

FTI 1, J 1 (1 2F )Ti 1, j FTi 1, j 1 Ti , j ..2.21


As seen from Eq. (2.19), a set of simultaneous linear algebraic equations must be
solved for implicit methods to obtain the temperature distribution at time t+t.
A tridiagonal system arises which is conveniently solved at each time step by Gaussian
elimination, to obtain the time-dependent temperature distribution. The solution
marches in time, starting with the known initial values, until steady state or a specified
time max is reached. The numerical procedure is more involved than the explicit
method. However, the implicit methods generally have much better stability
characteristics. The Crank-Nicolson implicit method is unconditionally stable, and
much larger time steps can be taken as compared to the explicit method. The only
constraint on the time step is generally because of accuracy considerations. However,
11
oscillations that generally remain bounded do arise in the solution for certain problems
at large values of F and may lead to a restriction on t , although at much larger values
than that given by Eq (2.18). [35], [38]
2.7.2 Finite Element and Other Solution Methods
The finite element method is based on the integral formulation of the
conservation principles. The computational region is divided into a number of finite
elements, several forms and types of which are available for different geometries and
governing equations. Triangular elements for two-dimensional problems and tetra-
hedral elements for three-dimensional problems are commonly employed, as shown in
Fig.2.12. The variation of the dependent variable is generally taken in terms of a
polynomial and frequently as linear within the elements. Integral equations that apply
for each element are derived, and the conservation postulates are satisfied by
minimization of the integrals or by reducing their weighted residuals to zero. The latter
gives rise to a commonly used method known as Galerkin ,s method. Thus, the
distribution of the dependent variable within the elements, and then in the entire region,
is obtained. As mentioned above, the method is particularly suitable for irregular
boundaries and complicated boundary conditions. Consequently, it is finding a growing
interest and application with respect to practical problems in engineering. [39]

Figure 2.12 Finite element discretization,


employing triangular elements [39]

12
Two other approaches have gained importance in recent years. These are the
boundary element method and the control volume approach. The former is similar to the
finite element method, except that the integral formulation for the computational
domain is transformed to one that applies for the bounding surface. Although somewhat
limited in its applicability, this method is finding much interest for many problems of
practical interest, particularly for those where the phenomenal of the surfaces are of
main concern. The method has the advantage, over finite element methods, of a smaller
number of elements and unknowns. [40]
The control volume approach is also based on the integral formulation. The
physical region is divided into a set of non overlapping control volumes, such as those,
obtained by drawing lines parallel to the coordinate axes midway between the nodes;
the integral conservation statement is applied to each control volume, using
interpolation between the node points to approximate the integrands. Thus, the volume
and surface integrals are approximated, using values at the nodes. The resulting
algebraic equations are similar to those obtained from the finite difference approach,
which is based on the differential equations. However, the finite volume method
satisfies the conservation principles more accurately and is particularly valuable for the
numerical formulation of the boundary conditions. [35]

13

You might also like