This article was downloaded by: [University of Limerick], [S. L. Mitchell] On: 08 October 013, At: 07:59 Publisher: Taylor & Francis Informa Ltd Registered in England and Wales Registered Number: 107954 Registered office: Mortimer House, 37-41 Mortimer Street, London W1T 3JH, UK Numerical Heat Transfer, Part B: Fundamentals: An International Journal of Comutation and Methodology Publication details, including instructions for authors and subscrition information: htt://www.tandfonline.com/loi/unhb0 On the Accuracy of a Finite-Difference Method for Parabolic Partial Differential Equations with Discontinuous Boundary Conditions M. Vynnycky a & S. L. Mitchell a a Mathematics Alications Consortium for Science and Industry (MACSI), Deartment of Mathematics and Statistics, University of Limerick, Limerick, Ireland To cite this article: M. Vynnycky & S. L. Mitchell (013) On the Accuracy of a Finite-Difference Method for Parabolic Partial Differential Equations with Discontinuous Boundary Conditions, Numerical Heat Transfer, Part B: Fundamentals: An International Journal of Comutation and Methodology, 64:4, 75-9 To link to this article: htt://dx.doi.org/10.1080/10407790.013.79731 PLEASE SCROLL DOWN FOR ARTICLE Taylor & Francis makes every effort to ensure the accuracy of all the information (the Content ) contained in the ublications on our latform. However, Taylor & Francis, our agents, and our licensors make no reresentations or warranties whatsoever as to the accuracy, comleteness, or suitability for any urose of the Content. Any oinions and views exressed in this ublication are the oinions and views of the authors, and are not the views of or endorsed by Taylor & Francis. The accuracy of the Content should not be relied uon and should be indeendently verified with rimary sources of information. Taylor and Francis shall not be liable for any losses, actions, claims, roceedings, demands, costs, exenses, damages, and other liabilities whatsoever or howsoever caused arising directly or indirectly in connection with, in relation to or arising out of the use of the Content. This article may be used for research, teaching, and rivate study uroses. Any substantial or systematic reroduction, redistribution, reselling, loan, sub-licensing, systematic suly, or distribution in any form to anyone is exressly forbidden. Terms &
Conditions of access and use can be found at htt://www.tandfonline.com/age/termsand-conditions
Numerical Heat Transfer, Part B, 64: 75 9, 013 Coyright # Taylor & Francis Grou, LLC ISSN: 1040-7790 rint=151-066 online DOI: 10.1080/10407790.013.79731 ON THE ACCURACY OF A FINITE-DIFFERENCE METHOD FOR PARABOLIC PARTIAL DIFFERENTIAL EQUATIONS WITH DISCONTINUOUS BOUNDARY CONDITIONS M. Vynnycky and S. L. Mitchell Mathematics Alications Consortium for Science and Industry (MACSI), Deartment of Mathematics and Statistics, University of Limerick, Limerick, Ireland Although the numerical solution of arabolic artial differential equations (PDEs) is widely documented, the effect of discontinuous boundary conditions on numerical accuracy is not. This article emloys the Keller box finite-difference method to study the effect of such discontinuities when solving the linear one-demensional transient heat equation. We demonstrate that this formally second-order-accurate scheme can lose accuracy, but that an analytical understanding of the behavior of the solution hels in roviding an accuracyrestoring formulation. Benchmark comutations are resented that will rovide guidance in the numerical solution of nonlinear arabolic PDEs for which there are no closed-form analytical solutions. 1. INTRODUCTION Parabolic artial differential equations (PDEs) arise in a wide range of alications in natural science, engineering, and technology; tyically, they must be solved numerically and there are, by now, many finite-difference and finite-element schemes in order to do this. While the numerical accuracy of such methods is well established when there are no discontinuities in the boundary conditions, this is often not the case: Examles are the trailing edge of a Blasius boundary layer flow [1 4], the leading and trailing edges of a circular sleeve in a Batchelor flow [5, 6], at the onset of hase change in ablation and the continuous casting of metals [7 9], and in the concentration boundary layer at the edges of electrodes in electrolytic cells [10 1]. In site of this common occurrence, there aears to be no systematic understanding of the imact of discontinuities on numerical accuracy, nor how it can be alleviated; this is in contrast to the state of the art in roblems that have discontinuities in initial conditions, for which analysis is already available [13]. Thus, the urose of this Received 10 Setember 01; acceted 8 Aril 013. The authors acknowledge the suort of the Mathematics Alications Consortium for Science and Industry (MACSI, www.macsi.ul.ie), funded by the Science Foundation Ireland Mathematics Initiative Grant 06=MI=005. Address corresondence to Sarah L. Mitchell, MACSI, Deartment of Mathematics and Statistics, University of Limerick, Limerick, Ireland. E-mail: sarah.mitchell@ul.ie 75
76 M. VYNNYCKY AND S. L. MITCHELL article is to study the numerical solution of test roblems that have discontinuous boundary conditions. Among numerical schemes for the solution of arabolic PDEs, one of the most versatile is the Keller box finite-difference method, and hence we consider it here; in addition to its original alication to fixed-boundary roblems [14 16], it has recently also been alied extensively to moving-boundary roblems [9, 17 19]. Although the scheme is often stated to be formally second-order-accurate in both the streamwise (timelike) and transverse (sacelike) variables, it is only quite recently that the meaning of this statement has been scrutinized more closely. For examle, what should be used as the criterion for determining the accuracy of the method is unclear, since the Keller box scheme reformulates an mth-order system for a function F as a system of first-order PDEs consequently, should one use F or the deendent variable in each of the first-order PDEs? If it is the latter, then F and its sace derivatives u to F (m 1) should all be second-order-accurate. Of relevance to this discussion is the observation that early alications of the method were for the steadystate boundary-layer equations that arise in fluid mechanics and heat transfer, for which the governing equations were reformulated in terms of similarity-like variables; subsequently, the PDEs reduced to ordinary differential equations (ODEs) in the limit as the leading edge of the boundary layer is aroached. However, although not noted in [14 16], this transformation aears to be crucial for ensuring that the scheme is second-order-accurate for F and its first (m 1) derivatives; without this transformation, more recent comutations when m ¼ indicate that the method is second-order-accurate for F, but of lower accuracy for its first derivative [9, 18]. In fact, more often than not, it will not be ossible to commence a numerical integration using a similarity solution, which suggests otential limitations with regard to the accuracy of the method. A further imortant oint is the distinction between the accuracy of the solution and the accuracy of the scheme [13]. Whereas the accuracy of the scheme can always be determined, the accuracy of the solution can only be found if there is an analytical solution against which the numerical solution can be comared; consequently, in the majority of cases, it is not ossible to determine the accuracy of the solution and, furthermore, nor is it ossible to infer it from the accuracy of the scheme. Thus, it is hoed that the results of this article can then serve as a benchmark for roblems that have discontinuous boundary conditions but do not have analytical solutions; consequently, the focus here is roblems with analytical solutions. The simlest examle of the more general situation that we wish to consider is given by the linear 1-D transient heat equation, qt qt ¼ q T qx for 0 < x < 1 ð1þ the initial condition T ¼ f ðxþ at t ¼ 0 ðþ and the boundary conditions T ¼ g 1 ðtþ at x ¼ 0 ð3þ
ON THE ACCURACY OF A FINITE-DIFFERENCE METHOD 77 or and qt qx ¼ g ðtþ at x ¼ 0 ð4þ T! f ð1þ as x!1 ð5þ where f(1) is taken to be finite. Although there is no evident discontinuity in the boundary condition at x ¼ 0, the imlication is that Eq. (1) has been integrated u to t ¼ 0 some boundary condition at x ¼ 0 which gives rise to T ¼ f(x) at t ¼ 0, and is then considered as the initial condition for the roblem for t > 0. In the remainder of this article, we shall look in turn at solutions to Eq. (1), subject to (), (5), and A. Equation (3), with f(0) 6¼ g 1 (0) B. Equation (3), with f(0) ¼ g 1 (0) C. Equation (4), with f 0 (0) 6¼ g (0), where 0 denotes differentiation with resect to x D. Equation (4), f 0 (0) ¼ g (0) The layout of the article is as follows. In Section we resent analysis related to these four cases, whereas in Section 3 we give details of the numerical imlementation. In Section 4 we show the results, and conclusions are drawn in Section 5.. ANALYTICAL SOLUTIONS.1. Case A In this case, we use boundary equation (3) and we suose that f(0) 6¼ g 1 (0); it is clear that T is inconsistent at (0, 0), in the sense that lim t!0 Tð0; tþ 6¼ lim x!0 Tðx; 0Þ As highlighted in [9], an inconsistency of this sort leads to a loss of numerical accuracy if an attemt is made to solve the equations (1) (3) and (5) as they stand; we define formally what is meant by accuracy in Section 3. To avoid this loss of accuracy, we set Tðx; tþ ¼g 1 ð0þþ½f ð0þ g 1 ð0þšerf x ffiffi t þtðx; tþ ð6þ which leads to q T qx ¼ qt qt for 0 < x < 1 ð7þ
78 M. VYNNYCKY AND S. L. MITCHELL T ¼ g 1 ðtþ g 1 ð0þ at x ¼ 0 ð8þ T! f ð1þ f ð0þ as x!1 ð9þ T ¼ f ðxþ f ð0þ at t ¼ 0 ð10þ So, T is consistent at (0, 0), since lim t!0 Tð0; tþ ¼lim x!0 Tðx; 0Þ ¼0 but T x might not be; this situation is considered next... Case B For this case, we consider, as a convenient examle, f ðxþ :¼ 1 þ e ax g 1 ðtþ :¼ 0 ð11þ so that f(0) ¼ g 1 (0); this has been chosen because it is relatively straightforward to construct a closed-form exression for T: x Tðx; tþ ¼ erf ffiffi þ 1 t eað xþatþ erfc at x ffiffi 1 t eaðxþatþ erfc at þ x ffiffi ð1þ t From (11), we know that T is consistent at (0, 0), whereas from (1), so that T x ðx; tþ ¼ a eað xþatþ erfc at x ffiffi t T x ð0; tþ ¼ ae at erfc a ffiffi t a eaðxþatþ erfc at þ x ffiffi t Also, we have T x (x, 0)¼ ae ax ; thus, T x is also consistent at (0, 0), since ð13þ ð14þ lim t!0 T x ð0; tþ ¼lim x!0 T x ðx; 0Þ ¼ a ð15þ For the case when both T and T x are consistent, Mitchell and Vynnycky [9] found that integrating a corresonding system of equations with x and t as the indeendent variables would give second-order accuracy for T, but not for T x. In addition to introducing a similarity variable, it turned out to be necessary to reformulate the roblem into one that did have an inconsistency. This is easily done by simly differentiating the governing equations with resect to x, and introducing F: ¼ @T=qx as the deendent variable. The resulting equations are
ON THE ACCURACY OF A FINITE-DIFFERENCE METHOD 79 q F qx ¼ qf qt for 0 < x < 1 ð16þ qf ¼ 0 at x ¼ 0 ð17þ qx F! 0 as x!1 ð18þ F ¼ ae ax at t ¼ 0 ð19þ which has the exact solution given in (13); note that (17) is arrived at by differentiating (3) with resect to t and then using Eq. (1). From initial condition (19) it follows that F x (x, 0)¼ a e ax and so F x is inconsistent at (0, 0) as required, since lim t!0 F x ð0; tþ ¼0 lim x!0 F x ðx; 0Þ ¼a ð0þ Tied in with introducing an inconsistency is the use of a variable transformation, g ¼ x ffiffi s ¼ ffiffi t t in order to achieve second-order accuracy for both the scheme and the solution, for both F and F x. In the case of constant initial conditions, it is ossible to find a self-starting similarity solution in the limit as s! 0; here, however, the initial conditions are not constant, and this constitutes the next level of comlication. In general, the solution for s > 0 develos a double-deck structure [, 5]: In the lower deck, where x s, there is a self-starting similarity solution; in the uer deck, where x O(1), the solution evolves from the initial condition, although the two decks must match to each other. The numerical imlementation given in [, 5] results in nonuniform meshes, which would render it imossible to calculate the accuracy of the scheme and the solution; however, Mitchell and Vynnycky [9] found that this difficulty could be avoided by subtracting off the initial condition and defining a new deendent variable. In the resent context, we set F(x, t) ¼ ae ax þ G(x, t), which leads to ð1þ q G qx ¼ qg qt þ a3 e ax for 0 < x < 1 ðþ qg qx ¼ a at x ¼ 0 ð3þ G! 0 as x!1 ð4þ G ¼ 0 at t ¼ 0 ð5þ
80 M. VYNNYCKY AND S. L. MITCHELL Finally, using substitution (1) and G(x, t) ¼ sh(g, s), we obtain q H qg ¼ 1 H þ s qh qs g qh qg þ a3 se asg for 0 < g < 1 ð6þ qh qg ¼ a at g ¼ 0 ð7þ H! 0 as g!1 ð8þ Now, in the limit as s! 0, the system (6) (8) becomes d H dg ¼ 1 H 1 g dh dg ð9þ dh dg ¼ a at g ¼ 0 ð30þ H! 0 as g!1 ð31þ which can be solved to give HðgÞ ¼a ffiffiffi e g =4 g erfc g this serves as the initial condition for (6)..3. Case C Consider now the situation where boundary condition (4) is used and f 0 (0) 6¼ g (0); thus, T x is not consistent at (0,0), since ð3þ lim t!0 T x ð0; tþ 6¼ lim x!0 T x ðx; 0Þ ð33þ Furthermore, without local analysis on a case-by-case basis, it is not clear whether or not T is consistent at (0, 0); for the roblems considered in [9, 18, 19], T was consistent. As a articular examle which is different to those in [9, 18, 19], we will consider the case when f ðxþ :¼ 1 þ e ax g ðtþ :¼ b ð34þ where a and b are real constants such that a 6¼ b and with b 6¼ 0. This gives the exact solution
ON THE ACCURACY OF A FINITE-DIFFERENCE METHOD 81 rffiffiffi x Tðx; tþ ¼ 1 bx erfc ffiffi t þ b t þ 1 eað xþatþ erfc at x ffiffi t ex x 4t þ 1 eaðxþatþ erfc at þ x ffiffi t ð35þ and so rffiffiffi t Tð0; tþ ¼ 1 þ b þ e at erfc a ffiffi t indicating that T is consistent at (0, 0), since lim Tð0; tþ ¼lim Tðx; 0Þ ¼0 ð37þ t!0 x!0 The resulting roblem for T can now be handled in the same way as that for F in case B. We set Tðx; tþ ¼f ðxþþgðx; tþ which then, with f as given in Eq. (34), yields ð36þ ð38þ q G qx ¼ qg qt a e ax for 0 < x < 1 ð39þ qg ¼ a b at x ¼ 0 ð40þ qx G! 0 as x!1 ð41þ G ¼ 0 at t ¼ 0 ð4þ Finally, using Eq. (1) and setting G(x, t) ¼ sh (g, s), we arrive at q H qg ¼ 1 H þ s qh qs g qh qg a se asg for 0 < g < 1 ð43þ qh ¼ a b at g ¼ 0 ð44þ qg Now, in the limit as s! 0, the system (43) (45) becomes H! 0 as g!1 ð45þ d H dg ¼ 1 H 1 g dh dg ð46þ
8 M. VYNNYCKY AND S. L. MITCHELL dh ¼ a b at g ¼ 0 ð47þ dg H! 0 as g!1 ð48þ which can be solved to give HðgÞ ¼ ða bþ ffiffiffi e g =4 g erfc g This is the initial condition for the system (43) (45)..4. Case D This time, we have f 0 (0) ¼ g (0), i.e., a ¼ b, so that T x is consistent at (0, 0); in fact, the exact solution is given by Eq. (35) with a ¼ b, which indicates that T will also be consistent at (0, 0). Thus, with T and T x both consistent, we again introduce F ¼ qt=qx as the deendent variable. Then, q F qx ¼ qf qt for 0 < x < 1 ð49þ ð50þ F ¼ a at x ¼ 0 ð51þ F! 0 as x!1 ð5þ F ¼ ae ax at t ¼ 0 ð53þ which has the exact solution Fx; ð tþ ¼ a eaðxþatþ erfc at þ x ffiffi e að xþatþ erfc at x t ffiffi t x erfc ffiffi : ð54þ t Now, F is consistent, but F x is not, so the situation is not entirely identical to that in case B. With ^F :¼ qf=qx, the system (50) (53) becomes q ^F qx ¼ q^f qt for 0 < x < 1 ð55þ q^f ¼ 0 at x ¼ 0 ð56þ qx
ON THE ACCURACY OF A FINITE-DIFFERENCE METHOD 83 ^F! 0 as x!1 ð57þ Then, by setting Gðx; tþ ¼a e ax þ ^Fðx; tþ, we have ^F ¼ a e ax at t ¼ 0 ð58þ q G qx ¼ qg qt þ a4 e ax for 0 < x < 1 ð59þ qg qx ¼ a3 at x ¼ 0 ð60þ G! 0 as x!1 ð61þ G ¼ 0 at t ¼ 0 ð6þ Finally, we use the substitution (1) and G(x, t) ¼ sh (g, s) to obtain q H qg ¼ 1 H þ s qh qs g qh qg þ a4 se asg for 0 < g < 1 ð63þ qh qg ¼ a3 at g ¼ 0 ð64þ H! 0 as g!1 ð65þ Now, in the limit as s! 0, the system (63) (65) becomes d H dg ¼ 1 H 1 g dh dg ð66þ dh dg ¼ a3 at g ¼ 0 ð67þ H! 0 as g!1 ð68þ and this can be solved to give HðgÞ ¼a 3 ffiffiffi e g =4 g erfc g ð69þ which becomes the initial condition for (63) (65).
84 M. VYNNYCKY AND S. L. MITCHELL 3. NUMERICAL IMPLEMENTATION 3.1. Discretization In essence, the numerical task that remains is to solve the three systems of equations (6) (8), (43) (45) and (63) (65), initial conditions (3), (49), and (69), resectively. Clearly, they are qualitatively very similar, so we address directly only one of these; we choose (6) (8) and (3). More articularly, the task is to demonstrate that both the numerical scheme and the solution are second-orderaccurate for H and H g. In addition, we will also wish to investigate the effect on numerical accuracy of not taking adequate account of discontinuities; to this end, we will comute solutions to Eqs. () (5) and (50) (53) also, as these give numerical accuracy for the deendent variable and its first satial derivative that is different to that for H and H g. First, we exlain the alication of the Keller box scheme to Eqs. (6) (8) and (3); for Eqs () (5) and (50) (53), the rocedure is similar. It is convenient to rewrite (6) as a system of two first-order equations by setting V ¼ qh=qg. This gives with boundary conditions H g ¼ V V g ¼ 1 H þ s H s g V þ a3 se asg and initial conditions Hðg; 0Þ ¼a ffiffiffi e g =4 g erfc g ð70þ ð71þ V ¼ a at g ¼ 0 ð7þ H! 0 as g!1 ð73þ Vðg; 0Þ ¼ a erfc g For a variable v and indeendent variables s and g, we define the following finite-difference oerators: m s v nþ1= iþ1= ¼ vnþ1 iþ1= þ vn iþ1= m g v nþ1= iþ1= ¼ vnþ1= iþ1 þ v nþ1= i d s v nþ1= iþ1= ¼ vnþ1 iþ1= vn iþ1= Ds iþ1= ¼ vnþ1= iþ1 d g v nþ1= v nþ1= i Dg ð74þ ð75þ ð76þ where Dg and Ds are the uniform mesh sacings in the g and s directions, resectively, and n and i are their resective indices. The box scheme alied to Eqs. (70) and (71) therefore gives, for n ¼ 0, 1,,..., and with I þ 1 mesh oints in g, m s d g H nþ1= iþ1= ¼ m sm g V nþ1= iþ1= ; ð77þ
ON THE ACCURACY OF A FINITE-DIFFERENCE METHOD 85 m s d g V nþ1= iþ1= ¼ 1 m gd s s nþ1= H nþ1= iþ1= 1 þ m s m g Hnþ1= iþ1= 1 g iþ1=v nþ1= iþ1= þ a3 s nþ1= e as nþ1=g iþ1= ð78þ which holds for i ¼ 1,..., I 1; note that (78) gives rise to a arameter, n: ¼ Ds=Dg. Boundary conditions (7) and (73) are V n 0 ¼ a ð79þ H n I ¼ 0 resectively. From (74), the initial conditions are written as H 0 i ¼ a ffiffiffi e g i =4 g i erfc g i V 0 i ¼ a erfc g i 3.. Order of Accuracy We will also wish to determine the order of accuracy of the scheme and of the solution. We start this discussion by considering a sequence Dg k where Dg k ¼ k Dg 0 k ¼ 1; ; and we denote the sace coordinates of meshes associated with this sequence by g i;k ¼ idg k i ¼ 0; 1; ; I k k ¼ 0; 1; ; where I k ¼ k I 0 k ¼ 1; ; : As discussed in [13], for a general numerical solution H n and corresonding k i exact solution h(g i, k, s n ) at the nth time ste, s n, the error and corresonding order of convergence, E n H;k and H,k, resectively, are given by E n H;k ¼ ( X ) I 1= 0 ¼ lnðenh;k =EnH;kþ1 Þ H;k Dg k i¼0 h i hðg i;0 ; s n Þ H n k i for k ¼ 0, 1,,...; furthermore, the accuracy of the solution with resect to H, H, is then H ¼ lim H;k ð83þ k!1 ln ð80þ ð81þ ð8þ As for the accuracy of the scheme with resect to H, H, we first define " # E n H;k ¼ XI 0 1= H n k i Hn k 1 i H;k ¼ lnðen H;k =En H;kþ1 Þ ln i¼0 ð84þ
86 M. VYNNYCKY AND S. L. MITCHELL for k ¼ 1,,...; then H ¼ lim k!1 H;k ð85þ In cases where an exact solution was known and there were no discontinuities in the boundary conditions after reformulation, Mitchell and Vynnycky [17] showed that H ¼ H. Furthermore, Mitchell et al. [18] demonstrated that it was also ossible to aly this idea to the satial derivative of H; thus, we set, for k ¼ 0, 1,,..., E n V;k ¼ ( X ) I 1= 0 ¼ lnðenv;k =EnV;kþ1 Þ V;k Dg k where v ¼ qh=qg, and for k ¼ 1,,... i¼0 h i vðg i;0 ; s n Þ V n k i ln " # E n V;k ¼ XI 0 1= V n V n k i k 1 i V;k ¼ lnðen V;k =En V;kþ1 Þ ln i¼0 3.3. Further Considerations The fact that f is not constant, which manifests itself as the fourth term call it f on the right-hand side of Eq. (71), leads to several interrelated numerical issues that must be treated. First of all, although it is clear that, in ractice, a finite comutational domain of extent g 1 is chosen, considerably greater care must be taken regarding this choice than in earlier work in order to ensure that the correct asymtotic behavior is catured as g!1. When f is constant, so that f ¼ 0, then, since H is known to decay exonentially as g!1, g 1 ¼ 10 roves to be large enough. However, when f 6¼ 0, it is necessary to know how it decays as x!1, since this decay must be correctly reflected in the discretized version of Eq. (71); for reference, this is shown for ex( ax) for a ¼ 1 and 4 in Figure 1. Since x ¼ gs, this means that if the value of g 1 is too small, then the asymtotic decay of f will not be catured in the numerical solution; so, it aears, at first sight, necessary to take g 1 Ds 1=a However, the rocess of determining the accuracy, as described in [13] and alied below, relies on decreasing the value of Ds, and it is evident that as k increases, inequality (88) will no longer be satisfied, no matter how large we take g 1. In fact, there turns out to be a neat resolution to this articular issue. Because the accuracy check requires that solutions be comuted numerically for meshes that have different Dg, it does not require g 1 be the same for each refinement; consequently, if we double g 1 and increase I fourfold, then we will simultaneously halve the size of Dg exactly what is necessary when erforming accuracy checks for roblems osed on finite domains. ð86þ ð87þ ð88þ
ON THE ACCURACY OF A FINITE-DIFFERENCE METHOD 87 Figure 1. ex( ax) versus x for a ¼ 1 and 4. On a more general note, e.g., in ablation and continuous casting, an analytical exression for f (x) will not exist; it will tyically have been comuted following numerical integration u to t ¼ 0. This leads to a dilemma as to what to use for f (x), or rather f (gs), in Eq. (71), since f (s n g i ) will not have been comuted for all the values of s n and g i at which it is required. One of the aealing features of the double-deck schemes in [, 5] was that this issue was resolved simly by droing oints systematically from the uer deck; thus, there was no need to introduce new arbitrary oints. Here, we adot a different aroach: When f is required at (s n, g i ), we interolate the value of f (s n g i ) from ðf l Þ i¼0; ; I if s ng i < x I ; otherwise, if s n g i x I, we set f ðs n g i Þ¼f I : As we will show in Section 4, this turns out to have no adverse effects on either the accuracy of the scheme or the accuracy of the solution. 4. RESULTS We resent first results for the formulations that do not give otimal accuracy, i.e., Eqs. () (5) and (50) (53); then, we will resent the results for the formulation which ultimately does, i.e., Eqs. (6) (8) and (3). Table 1 shows results from solving () (5) for two different values of a; in these runs, the outer edge of the comutational domain, x 1, was set at 10. It is evident that and for both U and G seem to be converging toward 1, although the trend is slower for the higher value of a. Table shows results from solving (50) (53) for the same values of a and x 1. This case gives different, and seemingly more ambiguous, convergence behavior to the first one. First of all, there is strong evidence that the accuracy of the numerical scheme for the temerature-like variable, F, is, but that for the heat flux like variable, W, is just 1. The corresonding accuracies for the solution, F and W, give considerably less meaningful values, however. In view of the inferior accuracy of
88 M. VYNNYCKY AND S. L. MITCHELL Table 1. Comarison of the order of accuracy of the numerical solution of () (5) for G and U at fixed t n ¼ 1 with Dt=Dx ¼ 1 x 1 ¼ 10, a ¼ 1 x 1 ¼ 10, a ¼ 4 Dx (k) G G U U G G U U 1=10 (k ¼ 1) 1.08553 1.15753 1.3588 1.54780 1=0 (k ¼ ) 1.03863 1.09413 1.0785 1.41818 1.0543 1.43436 1.31969 1.80477 1=40 (k ¼ 3) 1.01979 1.04079 1.03900 1.09960 1.11318 1.6668 1.17703 1.4399 1=80 (k ¼ 4) 1.00995 1.01601 1.01893 1.03966 1.05954 1.1481 1.0908 1.954 Table. Comarison of the order of accuracy of the numerical solution of (50) (53) for F and W ¼ qf=qx at fixed t n ¼ 1 with Dt=Dx ¼ 1 Dx (k) x 1 ¼ 10, a ¼ 1 x 1 ¼ 10, a ¼ 4 F F W W F F W W 1=10 (k ¼ 1).14940 1.53377.5041 1.4711 1=0 (k ¼ ) 1.74570.48805 1.505.65619.39787 3.37548 1.50599.57860 1=40 (k ¼ 3) 0.5846.0898 1.49878 1.04406.4164 3.10736 1.51051 1.0417 1=80 (k ¼ 4) 0.06116.00999 1.47477 1.01630.37817.09754 1.5074 1.04987 these two formulations, we have not investigated them exhaustively, although it should be noted that caution is necessary in interreting the values of the accuracy indices. Tables 1 and are for when t ¼ 1, but it is evident that different values would have been obtained had we comuted them for a different value of t. This is because of the way that the analytical solutions that are used to comute Eqs. (13) and (54) evolve with time; an indication of this is given in Figure for a ¼ 1at Figure. T x in Eq. (13) versus x for a ¼ 1att ¼ 0,, 10.
ON THE ACCURACY OF A FINITE-DIFFERENCE METHOD 89 Table 3. Comarison of the order of accuracy of the numerical solution of (6) (8) and (3) for H and V at fixed s n ¼ 1 with n ¼ Ds=Dg ¼ 1 g 1 ¼ 1, a ¼ 1 g 1 ¼ 1, a ¼ 4 Dg (k) H H V V H H V V 1=10 (k ¼ 1) 0.133 0.49040.04095.08669 1=0 (k ¼ ) 0.0165.8159 0.1090.80811.3543 1.91969.04710.1017 1=40 (k ¼ 3) 0.00657.40 0.0379.74 1.7143 1.8786.14861 1.9674 1=80 (k ¼ 4) 0.00149.04155 0.00580.04160 0.74366 1.94500 0.8055 1.98353 Table 4. Comarison of the order of accuracy of the numerical solution of (6) (8) and (3), with a ¼ 4, for H and V at fixed s n ¼ 0.5 Dg (k) g 1 ¼ 100, n ¼ 0.5 g 1 ¼ 100, n ¼ 0.1 H H V V H H V V 1=10 (k ¼ 1) 0.70686 1.5868.01658.3598 1=0 (k ¼ ) 4.74083 1.949.978.63686.05199 1.9938.005.4661 1=40 (k ¼ 3) 1.7433 1.847.05073.07418.4780 1.99135.0794 1.99338 1=80 (k ¼ 4) 0.53586 1.7576 1.93384.05154.80663 1.99418.07957 1.99691 t ¼ 0,, 10. On the other hand, the comutational domain extends only as far as x ¼ 10, at which boundary conditions (4) and (5) are rescribed; eventually, for large enough values of t, an error will arise because of this. Consequently, it is better to avoid this roblem by solving in transformed variables, to which we turn next. Table 3 shows results from solving (6) (8) and (3) for g 1 ¼ 1 for the same values of a as in Tables 1 and. Observe here that here aears to be tending to for both H and V, although does not. On considering whether (88) is being satisfied, it is clear that it is not, since even when Dg ¼ 1=80 we have ag 1 Ds ¼ 0.6. In Table 4, we have increased the value of g 1 considerably and have exerimented with the value of n for the case when a ¼ 4; behaves as desired for the lower value of n, although once again there is concern with regard to the behavior of. Lastly, we decided to test the convergence by doubling g 1 on each iteration; the results are shown in Table 5 for n ¼ 1=4 andn ¼ 1=6 and with a ¼ 4. Here, we find that and both converge to for both the temerature-like and heat flux like Table 5. Comarison of the order of accuracy of the numerical solution of (6) (8) and (3), with a ¼ 4, for H and V at fixed s n ¼ 0.5 n ¼ 0.5 n ¼ 0.1667 Dg (k) g 1 H H V V H H V V 1=10 (k ¼ 1) 4.0038.0516.00447.36676 1=0 (k ¼ ) 48.00154 1.99988.01556.091.00390 1.99690.00771.47509 1=40 (k ¼ 3) 96 1.9996 1.99810.01304.01646.00189 1.9987.00580.00840 1=80 (k ¼ 4) 19 1.99780 1.99740.0136.0138.00051 1.99906.00531.00597
90 M. VYNNYCKY AND S. L. MITCHELL Table 6. Comarison of the order of accuracy of the numerical solution of (6) (8) and (3) using interolation for f with a ¼ 4, for H and V at fixed s n ¼ 0.5 n ¼ 0.1667 Dg (k) g 1 H H V V 1=10 (k ¼ 1) 4.5966.77614 1=0 (k ¼ ) 48.04967.3107 1.78156.63645 1=40 (k ¼ 3) 96.00690.0591.01079.0594 1=80 (k ¼ 4) 19.0006.00598.00569.0113 variables, as desired. Furthermore, we tested what would haen if we interolate f, in the manner described as the end of Section 3.3; the results are given in Table 6, which shows that and both converged to a significant finding, since it indicates that the method should rove reliable even if there is no closed-form exression for f. A remaining loose end is why we have managed to obtain ¼ for all variables in Tables 5 and 6, even though inequality (88) is not satisfied on the finest mesh. The reason aears to be that the equation being solved Eq.(6) contains s ex( asg) rather than just ex( asg); consequently, as Ds is decreased, the size of this source term decreases. It is evident that the largest value that this term can take and hence which the method neglects, because of the finiteness of the comutational domain occurs when s ¼ 1=ag 1 and is equal to e 1 =ag 1. Thus, in Tables 5 and 6, this aears to be small enough to ensure that and still both converge to. As a corollary, we can note this as being a further ositive side effect of using similarity-like variables rather than the original hysical variables, even though the roblem does not actually have a similarity solution. 5. CONCLUSIONS This article has considered the effect of discontinuous boundary conditions on the accuracy of the Keller box finite-difference method for arabolic PDEs. Via a detailed study of four articular cases involving the linear 1-D transient heat equation, for which there were analytical solutions, we have established a systematic methodology for handling discontinuities in either the temerature or the heat flux. In articular, it was found that the scheme, which is second-order-accurate when there are no discontinuities, can lose numerical accuracy if due care is not taken through the choice of aroriate deendent and indeendent variables for numerical integration. For examle, if the temerature and heat flux, T and T x, resectively, are both continuous at the boundary, then T x is still only first-orderaccurate; however, by identifying the aroriate similarity-like variables, it was ossible to reformulate the roblem in a way that gave second-order accuracy for both T and T x. There are a number of ways in which these results can be used. First of all, the benchmark roblems that were considered should rovide guidance in the numerical solution of nonlinear arabolic PDEs for which there are no closed-form analytical solutions. Furthermore, the analysis resented will assist in the formulation of secondorder-accurate numerical schemes for moving-boundary (Stefan) roblems in continuous casting and ablation, in which the time for onset of hase change, corresonding
ON THE ACCURACY OF A FINITE-DIFFERENCE METHOD 91 to a discontinuous boundary condition, is arioriunknown [7 9]; in this context, our method should comete well against other ones for Stefan roblems that have recently been derived [0, 1]. REFERENCES 1. A. J. V. de Vooren and D. Djikstra, The Navier-Stokes Solution for Laminar Flow Past a Semi-infinite Plate, J. Eng. Math., vol. 4,. 9 7, 1970.. F. T. Smith, Boundary-Layer Flow Near a Discontinuity in Wall Conditions, J. Inst. Math. Al., vol. 13,. 17 145, 1974. 3. A. E. P. Veldman, A New Calculation of the Wake of a Plate, J. Eng. Math., vol. 9,. 65 70, 1975. 4. T. Cebeci, F. Thiele, P. G. Williams, and K. Stewartson, On the Calculation of Symmetric Wakes. I. Two-Dimensional Flows, Num. Heat Transfer, vol.,. 35 60, 1979. 5. M. Vynnycky, Concerning Closed-Streamline Flows with Discontinuous Boundary Conditions, J. Eng. Math., vol. 33,. 141 156, 1998. 6. G. K. Batchelor, On Steady Laminar Flow with Closed Streamlines at Large Reynolds Number, J. Fluid Mech., vol. 1,. 177 190, 1956. 7. J. Åberg, M. Vynnycky, and H. Fredriksson, Heat-Flux Measurements of Industrial On-Site Continuous Coer Casting and Their Use as Boundary Conditions for Numerical Simulations, Trans. Ind. Inst. Metals, vol. 6,. 443 446, 009. 8. M. Vynnycky, A Mathematical Model for Air-Ga Formation in Vertical Continuous Casting: The Effect of Suerheat, Trans. Ind. Inst. Metals, vol. 6,. 495 498, 009. 9. S. L. Mitchell, and M. Vynnycky, An Accurate Finite-Difference Method for Ablation-Tye Problems, J. Comut. Al. Math., vol. 36,. 4181 419, 01. 10. M. Vynnycky and N. Iek, Reaction-Layer Asymtotics and the Electrochemical Pickling of Steel, Proc. R. Soc. A, vol. 467,. 534 560, 011. 11. M. Vynnycky and K. I. Borg, On the Alication of Concentrated Solution Theory to the Forced Convective Flow of Excess Suorting Electrolyte, Electrochim. Acta, vol. 55,. 7109 7117, 010. 1. M. Vynnycky and N. Iek, Suorting Electrolyte Asymtotics and the Electrochemical Pickling of Steel, Proc. R. Soc. A, vol. 465,. 3771 3797, 009. 13. J. C. Strikwerda, Finite Difference Schemes and Partial Differential Equations, nd ed., Society for Industrial Mathematics, Philadelhia, PA, 004. 14. T. Cebeci and P. Bradshaw, Momentum Transfer in Boundary Layers, Hemishere, Washington, DC, 1977. 15. T. Cebeci and P. Bradshaw, Physical and Comutational Asects of Convective Heat Transfer, Sringer-Verlag, New York, NY, 1984. 16. T. Cebeci and J. Cousteix, Modeling and Comutation of Boundary-Layer Flows, Horizons Publishing Inc., CA, 005. 17. S. L. Mitchell and M. Vynnycky, Finite-Difference Methods with Increased Accuracy and Correct Initialization for One-Dimensional Stefan Problems, Al. Math. Comut., vol. 15,. 1609 161, 009. 18. S. L. Mitchell, M. Vynnycky, I. G. Gusev, and S. S. Sazhin, An Accurate Numerical Solution for the Transient Heating of An Evaorating Drolet, Al. Math. Comut., vol. 17,. 919 933, 011. 19. M. Vynnycky and S. L. Mitchell, On the Solution of Stefan Problems with Delayed Onset of Phase Change, Proc. 7th HEFAT Conference, Antalya, Turkey,. 709 714, 010 (CD-ROM).
9 M. VYNNYCKY AND S. L. MITCHELL 0. A. Ayasoufi, R. K. Rahmani, and T. G. Keith, Stefan Number-Insensitive Numerical Simulation of the Enthaly Method for Stefan Problems Using the Sace-Time CE=SE Method, Numer. Heat Transfer., B, vol. 55,. 57 7, 009. 1. D. Slota, Homotoy Perturbation Method for Solving the Two-Phase Inverse Stefan Problem, Numer. Heat Transfer., A, vol. 59,. 755 768, 011.