Semi-analytical solution of multilayer diffusion problems with time-varying boundary conditions and general interface conditions
Elliot J. Carr, Nathan G. March

TL;DR
This paper introduces a semi-analytical method for solving complex multilayer diffusion problems with time-varying boundaries and multiple layers, offering improved accuracy and efficiency over existing methods.
Contribution
A novel semi-analytical approach that handles time-varying boundary conditions and multiple layers, surpassing previous methods in accuracy and applicability.
Findings
The method converges faster with more eigenvalues.
It outperforms the unified transform method in accuracy and efficiency.
It can handle problems with many layers and time-varying conditions.
Abstract
We develop a new semi-analytical method for solving multilayer diffusion problems with time-varying external boundary conditions and general internal boundary conditions at the interfaces between adjacent layers. The convergence rate of the semi-analytical method, relative to the number of eigenvalues, is investigated and the effect of varying the interface conditions on the solution behaviour is explored. Numerical experiments demonstrate that solutions can be computed using the new semi-analytical method that are more accurate and more efficient than the unified transform method of Sheils [Appl. Math. Model., 46:450-464, 2017]. Furthermore, unlike classical analytical solutions and the unified transform method, only the new semi-analytical method is able to correctly treat problems with both time-varying external boundary conditions and a large number of layers. The paper is concluded…
| Runtime | Relative errors | |||
|---|---|---|---|---|
| Method | (secs) | |||
| Unified transform | 114.93 | 2.86e-10 | 4.65e-11 | 1.98e-11 |
| Semi-analytical [] | 0.54 | 7.18e-05 | 2.26e-06 | 7.50e-07 |
| Semi-analytical [] | 1.06 | 4.56e-06 | 1.43e-07 | 1.99e-08 |
| Semi-analytical [] | 2.43 | 4.43e-07 | 1.31e-08 | 5.86e-09 |
| Semi-analytical [] | 7.33 | 5.34e-08 | 1.70e-09 | 7.33e-10 |
| Semi-analytical [] | 15.78 | 6.55e-09 | 1.98e-10 | 9.09e-11 |
| Semi-analytical [] | 26.66 | 1.93e-09 | 5.98e-11 | 2.70e-11 |
| Semi-analytical [] | 32.88 | 8.13e-10 | 2.56e-11 | 1.16e-11 |
| Semi-analytical [] | 44.38 | 4.15e-10 | 1.29e-11 | 6.04e-12 |
| Semi-analytical [] | 57.02 | 2.40e-10 | 7.53e-12 | 3.21e-12 |
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Semi-analytical solution of multilayer diffusion problems with time-varying boundary conditions and general interface conditions
Elliot J. Carr111Corresponding author: [email protected]. and Nathan G. March
School of Mathematical Sciences, Queensland University of Technology (QUT),
Brisbane, Australia
Abstract
We develop a new semi-analytical method for solving multilayer diffusion problems with time-varying external boundary conditions and general internal boundary conditions at the interfaces between adjacent layers. The convergence rate of the semi-analytical method, relative to the number of eigenvalues, is investigated and the effect of varying the interface conditions on the solution behaviour is explored. Numerical experiments demonstrate that solutions can be computed using the new semi-analytical method that are more accurate and more efficient than the unified transform method of Sheils [Appl. Math. Model., 46:450–464, 2017]. Furthermore, unlike classical analytical solutions and the unified transform method, only the new semi-analytical method is able to correctly treat problems with both time-varying external boundary conditions and a large number of layers. The paper is concluded by replicating solutions to several important industrial, environmental and biological applications previously reported in the literature, demonstrating the wide applicability of the work.
Keywords: multilayer diffusion; semi-analytical solution; transient boundary conditions; general interface conditions; partition coefficient; jump conditions
1 Introduction
Mathematical models of diffusion in layered materials arise in many industrial, environmental, biological and medical applications, such as heat conduction in composite materials [4, 14, 15], transport of contaminants, chemicals and gases in layered porous media [11, 25], brain tumour growth [1, 13], heat conduction through skin [19], transdermal drug delivery [21, 16] and greenhouse gas emissions [12]. Another important application is in the field of multiscale modelling: for a large number of layers, layered diffusion is one of the simplest examples of a multiscale problem and is ideal for prototyping macroscopic and multiscale modelling approaches [2, 3]. Analytical solutions to such problems are highly valuable as they provide a greater level of insight into the solution behaviour and can be used to benchmark numerical solutions.
The most popular analytical solution approach for multilayer diffusion is classical separation of variables (see, e.g., [14, 7, 23]). By assuming a separated solution in each layer, one immediately finds that the eigenfunctions are coupled via the internal boundary conditions (BCs) at the interfaces between adjacent layers. Together with the external BCs, a system of algebraic equations is obtained, linear in the (unknown) eigenfunction coefficients. With the requirement that this linear system possess non-trivial solutions, one obtains a transcendental equation satisfied by the unknown eigenvalues formulated by setting the determinant of the coefficient matrix of the linear system equal to zero. Since computing the matrix determinant is numerically unstable for large matrices, using this method to compute the analytical solution performs poorly for a large number of layers as either erroneous eigenvalues/roots are returned during the solution procedure or eigenvalues/roots are skipped altogether (as reported by Carr and Turner [2]).
To overcome these issues, Carr and Turner [2] recently developed a semi-analytical solution approach for multilayer diffusion based on the Laplace transform and an appropriately-defined orthogonal eigenfunction expansion. The attractiveness of this approach is that the solution formulas involve a local set of eigenvalues in each layer satisfying simple transcendental equations, resembling those of the single layer problem, which in most cases can be solved explicitly. As a result, the solution performs well for a large number of layers [2] with the approach classified as semi-analytical since computing the inverse Laplace transforms appearing in the solution formulas are carried out numerically.
Recently, Sheils [18] applied the unified transform method, initially proposed by Fokas [5], to the layered diffusion problem and compared the approach to the semi-analytical method of Carr and Turner [2]. Sheils reported that her approach is more accurate, but less efficient and also faulty near the boundaries whenever nonhomogeneous external BCs were applied. We note that her assessment of the accuracy was based on using the default value of 50 terms/eigenvalues in the solution expansions in Carr and Turner [2]’s code. Sheils [18] also remarked that a notable difference between the two methods is that only the unified transform method is applicable to time-dependent external BCs.
In this paper, several key contributions to the literature on multilayer diffusion are presented. Specifically, we:
- (i)
develop a new semi-analytical solution approach for time-dependent external BCs and a general set of internal BCs (Section 3);
- (ii)
study the convergence rate of the new semi-analytical method in (i) and compare it to the classical analytical method (Section 4.2);
- (iii)
carry out a more comprehensive comparison between our semi-analytical method and Sheils’ [18] unified transform method, in terms of accuracy and efficiency, by performing an investigation into the effect of the number of terms/eigenvalues on the solution accuracy (Section 4.3);
- (iii)
explore the effect that changing the interface conditions has on the solution behaviour (Section 4.1);
- (iv)
extend the classical analytical solution approach to a general set of internal BCs by proposing the correct form of the weight function in the orthogonality condition (Appendix C).
The treatment of time-dependent external BCs addresses a deficiency of Carr and Turner [2]’s semi-analytical method, as reported by Sheils [18], and allows for application of the method to a wider range of problems, for example, contaminant transport modelling in layered porous media involving a time-varying inlet concentration [11]. Our method is also not faulty at the end points as is the case for Sheil’s [18] unified transform method whenever nonhomogeneous external BCs are applied. Moreover, general interface conditions permit additional features to be incorporated in the layered diffusion model, such as the volumetric heat capacity in heat conduction problems [8] or the sorption coefficient and partitioning phenomena in chemical transport problems [23].
The remaining sections of this paper are organised in the following manner. Section 2 formulates the multilayer diffusion problem considered in this work while the derivation and implementation of the semi-analytical solution method is outlined in Section 3. Numerical experiments are reported in Section 4. The paper then concludes with a summary and overview of key findings.
2 Multilayer diffusion problem
The one-dimensional multilayer diffusion problem is formulated as follows. Consider a diffusion process on the interval , which is partitioned into subintervals (see Figure 1):
[TABLE]
The resulting domain is represented using the notation . On each subinterval (layer) , that is for all , we define the diffusion equation:
[TABLE]
where , is the solution (temperature, concentration, etc.) at position and time in the th layer, and is the diffusion coefficient in the th layer. The initial conditions are given by
[TABLE]
for all , and the external BCs are defined as
[TABLE]
for , where the coefficients , , and are non-negative constants satisfying and , and and are specified time-dependent functions. Note that the restriction on the coefficients is a classical constraint placed on the single-layer problem () [24], which ensures all of the eigenvalues (see Appendix C) are non-negative and the solution remains bounded as .
Closing the problem requires equations (2)–(5) to be coupled with appropriate internal BCs at the interfaces between adjacent layers: for all . Typically, continuity of the solution and the diffusive flux is implicitly assumed at each interface, that is,
[TABLE]
for and for all . In this work, in addition to the above interface conditions (6), we also consider the following choices of interface conditions.
Perfect contact conditions. Consider the following interface condition at the th interface:
[TABLE]
for , where . These interface conditions generalise (6) and permit a wider array of problems to be considered as and/or can be different from and , respectively. For example, in heat transfer, where is the thermal diffusivity ( and are the thermal conductivity and volumetric heat capacity in layer , respectively), the interface conditions (7) allow continuity of the heat flux to be imposed at the interface by setting .
Jump conditions. Consider the following interface condition at the th interface:
[TABLE]
for , where is the contact transfer coefficient at . These interfaces conditions are a more general form of the perfect contact conditions (7) since dividing equation (8a) by yields (7a) in the limit . For a finite value of , the interface conditions (8) produce a discontinuity or jump in the solution field at the interfaces. This is useful in applications involving contact resistance at the interfaces, for example in heat transfer, where a very thin resistive (low conductive) layer causes a jump in the temperature [8].
Partition conditions. Consider the following interface condition at the th interface:
[TABLE]
for , where is the partition coefficient at . Again, these interface conditions are a more general form of the perfect contact conditions (7), which are given by the special case: . The interface conditions (9) maintain a constant ratio between the discontinuous solution values at the interface. This phenomena is common in applications such as analyte transport in porous media [23] and drug release from multi-layer capsules [10].
General interface conditions. Each of the above sets of internal BCs can be expressed in the general form:
[TABLE]
as setting , and , and taking produces (6); setting and taking yields the perfect contact conditions (7); setting produces the jump conditions (8); and taking yields the partition conditions (9).
3 Semi-analytical solution
We now develop our new semi-analytical method for solving the multilayer diffusion problem with time-varying external BCs (2)–(5) subject to the general internal BCs (10).
3.1 Reformulation of problem
Define the interface functions [2]:
[TABLE]
for all . Equations (2)–(5) and (10b) can now be reformulated as a sequence of single layer problems [17]:
- •
First Layer ():
[TABLE]
- •
Middle Layers ():
[TABLE]
- •
Last Layer ():
[TABLE]
Clearly, the solution of each of the above problems will involve the interface functions (11), which are unknown. The general idea is therefore to solve the above single layer problems subject to the constraint that the solutions satisfy the, as yet unused, interface condition (10a) [2, 17], which can be rewritten in terms of as follows
[TABLE]
for all . In summary, solving the single layer problems (12)–(14) subject to the constraint (15) is equivalent to solving the multilayer diffusion problem described by equations (2)–(5) and (10).
3.2 Solution of the single layer problems
To solve each of the single-layer problems (12)–(14), we introduce the substitution:
[TABLE]
for all , where is chosen so that satisfies homogeneous versions of the BCs given in equations (12b), (13b) and (14b). For example, in the first layer, satisfies the BCs:
[TABLE]
If , then one choice222This choice, while not unique, does not effect the uniqueness of the final solution as the initial conditions and source/sink terms are appropriately corrected in (23)–(24). for is a linear function in with time-dependent coefficients. Substituting into (17) and solving for and gives
[TABLE]
and hence
[TABLE]
Repeating this process, one sees that, in general, the function can be expressed as a linear combination of the unknown interface functions at and , that is
[TABLE]
for all . The functions and are identified in equation (18) for and . The remaining cases are summarised in Appendix A. Substituting (16) into (12)–(14), we see that the functions satisfy the following problems with homogeneous BCs:
- •
First Layer ():
[TABLE]
- •
Middle Layers ():
[TABLE]
- •
Last Layer ():
[TABLE]
The modified initial conditions and the source/sink terms are defined as:
[TABLE]
for all . The solution of each of the single layer problems (20)–(22) can be expressed as an eigenfunction expansion [24]:
[TABLE]
with coefficients and orthonormal eigenfunctions defined as
[TABLE]
The eigenvalues () and non-normalized eigenfunctions () satisfy:
[TABLE]
for and , subject to the following BCs:
- •
First Layer (): and .
- •
Middle Layers (): and .
- •
Last Layer (): and .
Note that both the eigenvalues and eigenfunctions are local to each layer and simple to obtain. The form of the eigenvalues and normalized eigenfunctions for can be found in [2, Appendix B]. The coefficients satisfy the ordinary differential equation:
[TABLE]
which is formulated by taking the inner product of both sides of (21a) with and setting:
[TABLE]
The general solution of (25) is given by
[TABLE]
The unknown coefficient is identified using the initial condition (21b):
[TABLE]
and hence we have that:
[TABLE]
Applying integration by parts to the third and fourth integrals in the expression for (28) yields:
[TABLE]
where we have set
[TABLE]
We express the above expression for in terms of the inverse Laplace transform for reasons that will become clear later. Using the convolution property of the Laplace transform allows an equivalent expression to be obtained:
[TABLE]
where, for example, . It follows therefore that our solution approach assumes the Laplace transformations of the boundary functions, namely and , are known, that is, they exist and can be evaluated analytically or numerically. With identified, we have solved (20)–(22) for (). The solution of the single layer problems (12)–(14) are hence given by:
[TABLE]
for all .
3.3 Evaluation of the solution expressions
To evaluate the solution expressions, described by equations (29) and (30), the summations are truncated after a finite number of terms/eigenvalues :
[TABLE]
for all . The inverse Laplace transformations appearing in the coefficients (29) are evaluated using the strategy proposed by Carr and Turner [2], which involves applying the quadrature formula described by Trefethen et al. [22] to the integral representation of the inverse Laplace transform. Given , the Laplace transform can be inverted numerically as follows:
[TABLE]
where denotes the real part, and are the residues and poles of the best rational approximation to on the negative real line (see, e.g., [22, 2])333Note that because we are dealing with diffusion problems, our interest is in functions that have the functional form , where . In this case, , which yields and therefore the limit of (32) is well behaved as and .. Using (32) gives, for example, the following approximation [2]:
[TABLE]
Note that the quadrature formula (33) requires evaluating , which is the Laplace transformation of the unknown interface function . To compute these evaluations the solutions are constrained to satisfy the interface condition (15) [2]. Taking Laplace transforms of (15) and rearranging yields:
[TABLE]
where is given by:
[TABLE]
The Laplace transformation is linear in the functions ()
[TABLE]
With the forms of and given, substituting (35) into (34) for all produces a tridiagonal matrix system in the form:
[TABLE]
where , and . The individual entries of and are given in Appendix B. Solving the linear system (37) evaluated at allows the required evaluations () to be computed444Note that in the limit as () and () the entries of and , which arise from the coefficients of and and the first term in the expression for (36) (see Appendix B) are well behaved.. For each time at which the semi-analytical solution is sought, the dimensional matrix system (37) must be solved times.
In contrast to the case of time-independent BCs [2], for and , the coefficients (29) feature terms involving inverse Laplace transformations of expressions involving and . Since the external boundary functions and are known a priori, these terms can be computed directly using the convolution property, for example:
[TABLE]
For a general and flexible code and to reduce user input, numerically evaluating the integral (38) is preferred. However, preliminary investigation found that the quadrature formula (33) performed better for large than MATLAB’s in-built integral function, which uses global adaptive Gauss-Kronrod quadrature. Therefore, we use (33) for all .
The only thing left to address is evaluating the unknown interface functions () at a given time . Note these evaluations appear in both the expression for (30) and the coefficients (29). Since , we can use the approximation (32), giving:
[TABLE]
for . Note here that the evaluations of are the same as those appearing in (33). Finally, we remark that it is due to approximations such as (33) that both the method developed in this paper and the method of Carr and Turner [2] are classified as semi-analytical.
3.4 MATLAB code
The semi-analytical solution developed originally by Carr and Turner [2] is available at
https://github.com/elliotcarr/MultDiff. This repository has now been updated to include the semi-analytical solution developed in this paper, which is applicable to time-dependent external BCs and more general interface conditions.
4 Results and discussion
4.1 Effect of interface conditions
Consider the multilayer diffusion problem described by equations (2)–(5) and (10) with layers, domain , diffusivities and , and external boundary condition data , , , , and . Figures 2a–2d depict the semi-analytical solution over time for four different choices of interface conditions:
- •
Case A: Perfect contact with and .
- •
Case B: Jump conditions with , and .
- •
Case C: Partition conditions with , and .
- •
Case D: Perfect contact with .
For Case A, the solution gradient is discontinuous at the interface (see Figure 2a) as (see interface condition (7b)) while for Case B, the solution is discontinuous at the interface (see Figure 2b) since the transfer coefficient is finite. Using equation (8a), the step change in the solution at the interface can be expressed as:
[TABLE]
For given values of and , the difference in solution values at the interface is proportional to the gradient appearing in (40), which explains why the jump discontinuity is absent from the solution at (at least visibly), large at and small at (see Figure 2b). Case C also exhibits a jump discontinuity at the interface with:
[TABLE]
which means that, for a given value of the partition coefficient , the size of the jump discontinuity is directly proportional to the value of . This is confirmed in Figure 2c with the step change in the solution across the interface (41) growing over time. In contrast to the jump conditions of Case B (Figure 2b), the steady state solution is dependent upon the partition coefficient. For Case , both the solution and gradient are continuous at the interface even though the diffusivities and are not equal (Figure 2d). This is explained by the interface condition (7b) describing continuity of the flux, which reduces to continuity of the gradient if . Indeed, because of this cancellation, the solutions are invariant under the condition regardless of the value of .
4.2 Convergence of semi-analytical solution
In this section, we investigate the rate of convergence exhibited by our semi-analytical method by comparing the error against the number of eigenvalues used in the solution expansions (31). Let denote the exact solution of the multilayer diffusion problem in the th layer evaluated at grid point where the grid spacing and is the constant number of divisions in each layer. Furthermore, let denote an approximate analytical solution computed using terms/eigenvalues in each layer. The relative error of this approximate analytical solution is computed as
[TABLE]
where the maximum is taken over and . Using the above error definition, we compare the accuracy of the semi-analytical solution (31) to the classical analytical solution derived using separation of variables (see, e.g., [2, 7, 23]). The classical analytical solution subject to the general interface conditions (10) is described briefly in Appendix C.
Figure 3 gives the relative error for both the semi-analytical and analytical solutions versus the number of eigenvalues for Case of Section 4.1 for both a small and large contrast in diffusivity. For increasing , due to the presence of the exponential in the analytical solution (see Appendix C), the terms in the solution expansion tend to zero extremely rapidly provided isn’t too small: for the exact solution is effectively obtained (i.e., the error falls below the machine epsilon of in MATLAB) after eigenvalues, respectively.
This behaviour is not observed for the semi-analytical solution and this is the price paid for reformulating the problem (see Section 3.1) to avoid solving a complex transcendental equation arising from a matrix determinant to determine the eigenvalues. While the first term of (29) approaches zero extremely rapidly for increasing , the second two terms, which arise due to the reformulation, do not. Little difference is observed when comparing Figures 3a and 3b, which demonstrates that the semi-analytical method performs well for both small and large contrasts in the diffusivity.
Both plots in Figure 3 suggest the following linear relationship exists between the logarithm of the error for the semi-analytical method and the number of eigenvalues :
[TABLE]
or equivalently:
[TABLE]
where denotes the negative slope of the linear error curves given in Figures 3a and 3b, which is essentially independent across the three values of time . Successive computation of the slopes for increasing indicates that for each time , the slope approximately approaches a value of as increases. Together these observations suggest the following proposition.
Proposition 1**.**
The convergence rate for the semi-analytical method is
[TABLE]
Proof. This result can be derived by studying the coefficient appearing in the solution expression (31) and noting that each integral in equation (28) is for large . For example, applying integration by parts to the second integral in equation (28) yields:
[TABLE]
for large . Additionally, one can show that each of the constants defined in equation (26) and (27) is either or equal to zero. For example, consider the values of (26) and (27) in the first layer () subject to a Dirichlet BC at . Since:
[TABLE]
(see Appendix A and Appendix B of Carr and Turner [2], respectively), clearly as while:
[TABLE]
for large . Verifying the remaining cases follows similarly. With the above results for large . Hence, subtracting (31) from (30) gives the following expression for the error:
[TABLE]
for large . By considering the possible cases for the eigenvalues (see Appendix B of Carr and Turner [2]), we observe that for each case involving explicit expressions for the eigenvalues. This is also true for the remaining cases (i.e., the first and last layers under Robin BCs) since the eigenvalues, and , get closer and closer to and , respectively, for large (large ) [20]. It follows that and therefore from (45) we get the desired result.
We remark that this slowed convergence is typical of problems with time-dependent BCs. For example, consider the following single-layer problem with a time-dependent Dirichlet BC at :
[TABLE]
The solution, truncated after terms/eigenvalues, is given by
[TABLE]
where the eigenvalues and the coefficients are defined as
[TABLE]
For this problem the convergence rate is also since due to the presence of the additional integral term involving the boundary function , which is following (44).
4.3 Comparison to Sheils’ UTM Heat Code
We now compare our MATLAB implementation of the semi-analytical solution derived in Section 3, available at https://github.com/elliotcarr/MultDiff, to the unified transform method of Sheils [18], available at https://github.com/nsheils/UTM_Heat. The chosen test case is an layer version of Case A (from Section 4.1) with domain , interfaces for , diffusivities and for , and external boundary condition data , , , , and . Recall that Sheils’ method is faulty at the end points whenever nonhomogeneous external BCs are applied [18]. To circumvent this issue, we first decompose the solution into its steady state and transient parts: for each layer , and solve for , which satisfies homogeneous external BCs.
Table 1 compares the runtimes555All tests cases were carried out in MATLAB R2014b on a MacBook Pro (mid 2014) running MAC OS X Version 10.10.5 with 16 GB of RAM and a 3.0GHz dual-core Intel Core i7 processor. and relative errors of our semi-analytical method (for different numbers of eigenvalues ) to Sheils’ unified transform method (with the default solver options). While the semi-analytical method is less accurate for our default number of eigenvalues (), as reported by Sheils [18], highly accurate solutions can be computed by simply taking more terms/eigenvalues in the solution expansions (31): with terms, the semi-analytical solution is more accurate for all three times reported and twice as fast as the unified transform method. Moreover, for smaller values of , the semi-analytical solution is very fast with an accuracy that is probably sufficient for most applications.
For time-independent external BCs, one can always homogenise the external BCs before applying the unified transform method (as above), however, it is not clear how to do this for time-dependent external BCs. For example, with , it is not immediately obvious how to avoid the faulty behaviour of Sheils’ unified transform method at the left end point (Figure 4). This detail, together with the fact that the analytical solution (Appendix C) doesn’t perform well for a large number of layers (as reported by Carr and Turner [2]), leads us to the conclusion that only the semi-analytical method introduced in this paper is able to correctly handle both time-dependent external BCs and a large number of layers.
4.4 Applications
In this section, we apply the semi-analytical solution described in Section 3 to some environmental, industrial and biological applications. The primary aim is to highlight the wide array of problems that can be solved by the code and confirm the validity of the derived semi-analytical solution by reproducing results previously reported in the literature.
4.4.1 Contaminant transport in an aquitard
Liu and Ball [11] define the following governing equations for diffusion of a dissolved contaminant in a layered porous medium:
[TABLE]
for , and , where is the volume-based aqueous contaminant concentration [] in the th layer, and and are constants defined as the dimensionless retardation factor and effective diffusion coefficient in the th layer, respectively. At the interface between adjacent layers (), continuity of mass flux and aqueous concentration is imposed:
[TABLE]
for and , where the constant is the porosity in the th layer.
We consider the two-layer test problem described by Liu and Ball [11], where initially in both layers (). The concentration at the top of the first layer is assumed to be a known but arbitrary function of time, denoted by , while zero mass flux is assumed at the bottom boundary:
[TABLE]
for . The function is assumed to take a Gaussian form:
[TABLE]
where the constant is the peak concentration, and and are constants. The semi-analytical solution requires the Laplace transformation of , which is found to be:
[TABLE]
Note that the quadrature formula (33) requires evaluation of for . To compute the error function for complex arguments, which isn’t available for the inbuilt MATLAB function erf, we use the erfz function developed by Godfrey [6].
Figure 5 depicts the concentration profiles computed using the semi-analytical solution over time for , , , , , , and . To allow comparison with the figure presented by Liu and Ball [11] the total concentration is shown in Figure 5, which is defined in the th layer as [], where is the bulk density of the soil in the th layer with .
The plot clearly depicts the time-varying inlet concentration, reaching a peak concentration after (). Note that the total concentration is discontinuous at the interface due to the different retardation factors in both layers. The solutions are in excellent agreement with those given by Liu and Ball [11], giving us confidence that our new semi-analytical method has been formulated correctly for time-dependent external BCs.
4.4.2 Heat conduction in composite materials
Consider the classical heat conduction problem in a composite medium comprising layers [14], where the temperature distribution in each layer is governed by the heat equation:
[TABLE]
for , and , and interface conditions
[TABLE]
for and , where is the temperature at position and time in the th layer and is the heat transfer coefficient between layers and . The remaining constants , and denote the density, specific heat capacity and thermal conductivity, respectively, in the th layer. Note that in general the solution to the above problem cannot be obtained using the semi-analytical method described by Carr and Turner [2] since it is the thermal conductivities not the thermal diffusivities that appear in the second interface condition (54).
As an illustrative example, we consider a classical heat conduction problem that has been solved by several authors, including Mulholland and Cobble [15], Mikhailov et al. [14] and Johnston [9]. The test case considers layers, domain and the following parameter values: for all (i.e., perfect thermal contact at the interfaces), thermal conductivities , and [units )], densities , and [units ], and specific heat capacities , and [units ]. The initial conditions and external BCs are defined as
[TABLE]
Figure 6, which shows the temperature distribution obtained using the semi-analytical solution at various times, reproduces the results previously reported in the literature [15, 14, 9].
4.4.3 Analyte transport in composite media
Chemical concentration profiles in composite media can be sharply discontinuous at material interfaces due to partitioning phenomena [21, 23]. Trefry and Whyte [23] present the following mathematical model governing analyte transport in a composite medium comprising laminates/media, consisting of the diffusion equation
[TABLE]
for , and , subject to the following interface conditions:
[TABLE]
for and . In the above equations, is the mobile phase concentration at position and time in the th layer, is the mobile phase partition coefficient at the interface between layers and (), and and are the diffusion coefficient for the analyte and the linear sorption coefficient in medium , respectively. Note that the solution of this problem can only be computed using the semi-analytical solution given by Carr and Turner [2] if for all and for all .
Consider the test case described by Trefry and Whyte [23] with layers, domain , diffusion coefficients and , partition coefficient and zero sorption coefficients . Initially, medium is fully concentrated with analyte, medium 2 has zero initial concentration. A zero flux condition applies at the left boundary and a zero concentration condition applies at the right boundary.
Figure 7 plots the concentration profile for obtained using the semi-analytical solution. The included three-dimensional plot is in excellent agreement to the one featuring in the paper by Trefry and Whyte [23].
4.4.4 Brain tumour growth
Mantzavinos et al. [13] and Asvestas et al. [1] both consider a one-dimensional reaction-diffusion model for the growth of brain tumours. Due to the heterogeneity of brain tissue, the diffusion coefficient is assumed to be piecewise constant over several regions consisting of either white or grey matter. The spread of malignant cells is governed by the equation [13]:
[TABLE]
for and . The equation system (55) is converted into the required form of the multilayer diffusion problem considered in this paper (i.e., without the source term) via the substitution [13], which yields the multilayer diffusion problem described by equations (2)–(5) and (6) with , and .
We consider the test case described by Mantzavinos et al. [13] with regions, domain , diffusion coefficients (grey matter) and (white matter), and initial point sources of tumour cells at and :
[TABLE]
where is the Dirac delta function. To treat the above initial conditions in our code, we use the approximation:
[TABLE]
with . Figure 8 plots the cell density over time computed via the semi-analytical solution, replicating the plot presented in [13].
5 Conclusions
This paper has developed a new semi-analytical method for solving multilayer diffusion problems with time-varying external BCs and general internal BCs at the interfaces between adjacent layers. Numerical experiments suggested the semi-analytical solution exhibits a convergence rate of , where is the number of eigenvalues used in the solution expansions, a result which was also confirmed analytically. While this is some way away from the exponential convergence rate of the classical analytical solution, the semi-analytical approach possesses other clear advantages such as requiring only simple eigenvalues and performing well for a large number of layers; both due to it avoiding the solution of a complex transcendental equation for the eigenvalues. Numerical experiments demonstrated that solutions can be obtained using the new semi-analytical method that are more accurate and efficient than Sheils’ [18] unified transform method while also not exhibiting faulty behaviour at the external boundaries. Finally, in contrast to classical analytical solutions and the unified transform method, only the semi-analytical method introduced in this paper is able to correctly treat problems with both time-dependent external BCs and a large number of layers.
Acknowledgments
EJC acknowledges funding from the Australian Research Council (DE150101137).
Appendix A Psi functions
The functions and described in equation (19) are defined as follows:
- •
First Layer ()
[TABLE]
- •
Middle Layers ()
[TABLE]
- •
Last Layer ()
[TABLE]
Appendix B Linear system
This appendix formulates the entries of the matrix and featuring in the tridiagonal matrix system (37). Let denote the entry of and denote the th entry of .
Consider equation (36) and define () as follows:
[TABLE]
Substituting (35) into (34), and rearranging identifies
- •
the subdiagonal of :
[TABLE]
- •
the diagonal of :
[TABLE]
- •
the superdiagonal of :
[TABLE]
The entries of are given by:
[TABLE]
Appendix C Analytical solution
Using separation of variables, the following analytical solution of the multilayer diffusion problem described by equations (2)–(5) and (10) can be derived [23, 2, 7] when and in equations (4)–(5) are independent of time :
[TABLE]
where denotes the steady-state solution in the th layer (see, e.g., Carr and Turner [2]). The eigenvalues (), which form a global set valid across all layers, and the non-normalized eigenfunctions () satisfy a series of coupled Sturm Liouville problems involving homogeneous versions of the internal and external BCs:
[TABLE]
Substituting the form of the eigenfunctions:
[TABLE]
into the above internal and external BCs yields a linear system, which can be expressed in matrix form as , where and . The notation , and is used since they each depend on . The eigenvalues () are the non-negative roots of the transcendental equation:
[TABLE]
For each eigenvalue (), an eigenfunction is defined, where the coefficients and () are determined by finding a non-trivial solution of [2]. The eigenfunctions are orthogonal over the full domain with respect to the weight function . A proof of this result follows closely the proof given by Trefry and Whyte [23] for . Hence, using the initial condition, we have that:
[TABLE]
where .
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1Asvestas et al. [2014] M. Asvestas, A. G. Sifalakis, E. P. Papadopoulou, and Y. G. Saridakis. Fokas method for a multi-domain linear reaction-diffusion equation with discontinuous diffusivity. J. Phys. Conf. Ser. , 490:012143, 2014.
- 2Carr and Turner [2016] E. J. Carr and I. W. Turner. A semi-analytical solution for multilayer diffusion in a composite medium consisting of a large number of layers. Appl. Math. Model. , 40:7034–7050, 2016.
- 3Carr et al. [2017] E. J. Carr, I. W. Turner, and P. Perré. Macroscale modeling of multilayer diffusion: using volume averaging to correct the boundary condition. Appl. Math. Model. , 47:600–618, 2017.
- 4de Monte [2000] F. de Monte. Transient heat conduction in one-dimensional composite slab. A ‘natural’ analytic approach. Int. J. Heat Mass Tran. , 43:3607–3619, 2000.
- 5Fokas [1997] A. S. Fokas. A unified transform method for solving linear and certain nonlinear PD Es. Proc. R. Soc. Lond. A , 453:1411–1443, 1997.
- 6[6] P. Godfrey. erfz MATLAB function. http://au.mathworks.com/matlabcentral/fileexchange/3574-erfz [Accessed 28 May 2016] .
- 7Hickson et al. [2009] R. I. Hickson, S. I. Barry, and G. N. Mercer. Critical times in multilayer diffusion. Part 1: Exact solutions. Int. J. Heat Mass Tran. , 52:5776–5783, 2009.
- 8Hickson et al. [2011] R. I. Hickson, S. I. Barry, G. N. Mercer, and H. S. Sidhu. Finite difference schemes for multilayer diffusion. Math. Comput. Model. , 54:210–220, 2011.
