EIT Agent
登录
← 校园网页目录

校园网页 · 学校官网

A new Lagrange multiplier approach for constructing structure preserving schemes, I. positivity preserving.pdf

Available online at www.sciencedirect.com ScienceDirect Comput. Methods Appl. Mech. Engrg. 391 (2022) 114585 www.elsevier.com/locate/cma A new Lagrange multiplier approach for constructing structure preserving schemes, I. Positivity preserving✩ Qing Cheng, Jie Shen Department of Mathematics, Purdue University, West Lafayette, IN 47907, USA Received 4 August 2021; received in revised form 1 January 2022; accepted 3 January 2022 Available online xxxx Abstract We propose a new Lagrange multiplier approach to construct positivity preserving schemes for parabolic type equations. The new approach introduces a space–time Lagrange multiplier to enforce the positivity with the Karush–Kuhn–Tucker (KKT) conditions. We then use a predictor–corrector approach to construct a class of positivity schemes: with a generic semi-implicit or implicit scheme as the prediction step, and the correction step, which enforces the positivity, can be implemented with negligible cost. We also present a modification which allows us to construct schemes which, in addition to positivity preserving, is also mass conserving. This new approach is not restricted to any particular spatial discretization and can be combined with various time discretization schemes. We establish stability results for our first- and second-order schemes under a general setting, and present ample numerical results to validate the new approach. © 2022 Elsevier B.V . All rights reserved. MSC: 65M70; 65K15; 65N22 Keywords: Positivity preserving; Mass conserving; KKT conditions; Lagrange multiplier; Stability 1. Introduction Solutions for a large class of partial differential equations (PDEs) arising from sciences and engineering applications, e.g., solutions for physical variables such as density, concentration, height, population, etc., are required to be positive. It is of critical importance that their numerical approximations preserve the positivity of these variables at the discrete level, as violation of the positivity may render the discrete problems ill posed, although the original problems are well posed. In recent years, a large effort has been devoted to construct positivity preserving schemes for various problems. The existing approaches can be roughly classified into the following categories: • Cut-off approach: an ad-hoc approach which simply cuts off the values outside of the desired range. This approach is perhaps used in many simulations without being explicitly mentioned, and it is recently analyzed in [1,2] for certain class of time discretization schemes. The main advantages of the cut-off approach is (i) simple to implement, and (ii) it is able to preserve the accuracy of the underlying numerical schemes for problems with smooth solutions (cf. [2]). A disadvantage is that it does not preserve mass. ✩ This work is partially supported by NSF Grant DMS-2012585 and AFOSR Grant FA9550-20-1-0309. E-mail addresses: cheng573@purdue.edu (Q. Cheng), shen7@purdue.edu (J. Shen). https://doi.org/10.1016/j.cma.2022.114585 0045-7825/© 2022 Elsevier B.V . All rights reserved. Q. Cheng and J. Shen Computer Methods in Applied Mechanics and Engineering 391 (2022) 114585 • Discrete maximum principle preserving schemes (see, for instance, [3] and the references therein): these schemes are usually based on second-order finite differences or piecewise linear finite elements so they are limited in accuracy, see however some recent work on fourth-order finite differences [4,5] applied to second-order elliptic or parabolic equations. • Post-processing approach: sophisticated procedures are designed in [6,7] for hyperbolic systems: these are explicit schemes which are not quite suitable for parabolic systems. • Convex splitting approach: for examples, see [8] for Cahn–Hilliard equations with logarithmic potential, [9,10] for Poisson–Nernst–Planck (PNP) and Keller–Segel equations. The drawback of this approach is that a nonlinear system has to be solved at each time step. • Reformulation approach: reformulate the problem so that solution of the corresponding discrete problem is always positive, see, for instance, [9,11]. We observe that there is still a lack of more general and efficient numerical approach which can deal with a large class of positivity preserving parabolic systems. Recently, an interesting Lagrange multiplier approach was proposed in [12] and applied to solve positivity preserving parabolic systems. The key idea was to introduce a Lagrange multiplier and use the well-known Karush–Kuhn–Tucker (KKT) conditions [13–16] to enforce the positivity. At each time step, their approach reduces to solving a nonlinear constrained minimization problem. But since these constrained minimization problems are only semi-smooth, a delicate and costly iterative method has to be used. The main goal of this paper is to adopt a predictor–corrector approach to develop efficient and accurate schemes for a large class of positivity preserving parabolic systems without solving a constrained minimization problem at each time step. More precisely, we consider in this paper a class of linear or nonlinear parabolic equations with positive solutions in the following form: ut + Lu = 0, (1.1) with suitable initial and boundary conditions, where L could be Lu = Au + f (u) with A being a linear or nonlinear positive operator and f (u) a semi-linear or quasi-linear operator. Consider a generic spatial discretization of (1.1): ∂tuh + Lhuh = 0, (1.2) where uh is in certain finite dimensional approximation space Xh and Lh is a certain approximation of L. In general, uh, if it exists, may not preserve positivity. Oftentimes, (1.2) may not be well posed if uh cannot preserve positivity, e.g., a direct finite elements or spectral approximation to the porous media equation [17] ut − m∇ · (um−1∇u) = 0 with (m > 1) cannot preserve positivity so it is not well posed. Hence, special efforts have to be devoted to construct spatial discretization such that (1.2) is positivity preserving. Alternatively, we can introduce a Lagrange multiplier function λh(x, t) and solve the following expanded system: ∂tuh + Lhuh = λh, λh ≥ 0, uh ≥ 0, λ huh = 0. (1.3) Note that the second equation in the above represents the well-known Karush–Kuhn–Tucker (KKT) conditions [14–16,18] for constrained minimizations. The expanded system (1.3) is equivalent with system (1.2) with positivity constraint under suitable conditions. In the absence of time variable, the problem (1.3) has been well studied mathematically and numerically. However, how to efficiently solve the time dependent (1.3) is a completely different issue which has not received much attention. One can of course use an implicit discretization scheme such as backward-Euler or Backward Difference Formula (BDF) [19–21] schemes so that at each time step, the nonlinear system can still be interpreted as a constrained minimization and apply a suitable iterative procedure. But since these constrained minimization problems are only semi-smooth, a delicate and costly iterative method has to be used. We refer to [12] for such an attempt with a diagonally implicit Runge–Kutta discretization. To avoid solving a constrained minimization problem at each time step, we adopt in this paper a predictor– corrector approach to develop efficient and accurate schemes for (1.3). This approach enjoys the following advantages: • It allows us to construct positivity preserving schemes for a large class of linear or nonlinear parabolic equations with positive solutions, and the schemes can also be made mass conservative if the PDE is mass conserving; 2 Q. Cheng and J. Shen Computer Methods in Applied Mechanics and Engineering 391 (2022) 114585 • It can be combined with most existing numerical schemes — particularly legacy codes which are not necessarily positivity preserving; • It has essentially the same computational cost as the corresponding semi-implicit or implicit scheme with the same spatial discretization; • It has good stability property: the first- and second-order versions of our scheme are proven to be uncondi- tionally stable for a large class of problems. Moreover, we show that schemes based on the ad-hoc cut-off approach can be interpreted as special cases of our approach. Thus, this approach allows us to construct mass conserving schemes based on the cut-off approach, and our analysis leads to new stability results for the cut-off approach. We shall apply our new schemes to a variety of problems with positive solutions, including the challenging porous media equation [17,22] and the very challenging Lubrication equation [23]. The rest of the paper is organized as follows. In Section 2, we introduce the positivity and mass preserving schemes with Lagrange multiplier. In Section 3, we carry out stability analysis for the proposed positivity preserving schemes. In Section 4, we present numerical results for a variety of problems to validate our schemes. Some concluding remarks are given in Section 5. 2. Positivity and mass preserving schemes with Lagrange multiplier We start with a general description of the spatial discretization, followed by the construction of positivity preserving time discretization schemes without and with mass conservation. 2.1. Spatial discretization We now give a more precise description on the generic spatial discretization in (1.3). Let ¯Ω be the domain including boundary and Σh be a set of mesh points or collocation points in ¯Ω. Note that Σh should not include the points at the part of the boundary where a Dirichlet (or essential) boundary condition is prescribed, while it should include the points at the part of the boundary where a Neumann or mixed (or non-essential) boundary condition is prescribed. We consider a Galerkin type discretization with finite-elements or spectral methods or finite-differences with summation-by-parts in a subspace Xh ⊂ X, and define a discrete inner product, i.e. numerical integration, on Σh = { z} in ¯Ω: [u, v] = ∑ z∈Σh ωzu(z)v(z), (2.1) where we require that the weights ωz > 0. We also denote the induced norm by ∥u∥ = [u, u] 1 2 . For finite element methods, the sum should be understood as ∑ K ⊂T ∑ z∈Z(K ) where T is a given triangulation. We assume that there is a unique function ψz(x) in Xh satisfying ψz(z′) = δz z′ for z, z′ ∈ Σh. Then, (1.3) is interpreted as follows: Find uh ∈ Xh such that ∂tuh(z, t) + Lhuh(z, t) = λh(z, t), ∀z ∈ Σh, λh(z, t) ≥ 0, uh(z, t) ≥ 0, λ h(z, t)uh(z, t) = 0, ∀z ∈ Σh, uh(z, 0) = u0 h(z), (2.2) with the Dirichlet boundary condition to be satisfied pointwise if the original problem includes Dirichlet boundary condition at part or all of boundary. u0 h is the initial condition. 2.2. Time discretization Let Ln h be an approximate operator of L at tn. For examples, if Lu = −∇ · ( f (u)∇u), Ln h could be a lagged linear approximation Ln h ˜un+1 h := −∇ · ( f (un h)∇ ˜un+1 h ), (2.3) 3 Q. Cheng and J. Shen Computer Methods in Applied Mechanics and Engineering 391 (2022) 114585 and for Lu = Au + f (u), Ln h could be a fully implicit discretization Ln h ˜un+1 h := A ˜un+1 h + f ( ˜un+1 h ), (2.4) or an implicit–explicit (IMEX) discretization, Ln h ˜un+1 h := A ˜un+1 h + f ( ˜un h), (2.5) or some other type of discretization such as the convex splitting [24] or the SA V approach [25,26]. 2.2.1. First-order operator splitting scheme Let λ0 h ≡ 0, for n ≥ 0, we proceed as follows. Step 1 : solve ˜un+1 h from ˜un+1 h (z) − un h(z) δt + Ln h ˜un+1 h (z) = 0, ∀z ∈ Σh; (2.6) Step 2 : solve ( un+1 h , λn+1 h ) from un+1 h (z) − ˜un+1 h (z) δt = λn+1 h (z), ∀z ∈ Σh, λn+1 h (z) ≥ 0, un+1 h (z) ≥ 0, λ n+1 h (z)un+1 h (z) = 0, ∀z ∈ Σh. (2.7) The above scheme can be viewed as an operator splitting method. The first step is just a usual time stepping scheme and can be implemented as usual. However, ˜un+1 h may not be positive. In the second step, we use the KKT conditions to enforce the positivity of un+1 h . A remarkable property of (2.7) is that it can be solved pointwise as follows: (un+1 h (z), λn+1 h (z)) = { ( ˜un+1 h (z), 0) if 0 < ˜un+1 h (z) (0, − ˜un+1 h (z) δt ) otherwise , ∀z ∈ Σh. (2.8) Remark 2.1. The second step in the above scheme is equivalent to the simple cut-off approach [1,2]: un+1 h (z) = { ˜un+1 h (z) if ˜un+1 h (z) > 0 0 if ˜un+1 h (z) ≤ 0, ∀z ∈ Σh. (2.9) Hence, the cut-off approach can also be understood from an operator splitting point of view which opens new avenue for analysis and further algorithm improvement. 2.2.2. Higher-order schemes We can construct higher-order schemes by using a predictor–corrector approach. More precisely, a kth-order IMEX scheme based on Backward Difference Formula (BDF) and Adam–Bashforth [27] can be constructed as follows: Step 1 (prediction): solve ˜un+1 h from αk ˜un+1 h − Ak(un h) δt + Ln h ˜un+1 h = Bk−1(λn h); (2.10) Step 2 (correction): solve ( un+1 h , λn+1 h ) from αk(un+1 h (z) − ˜un+1 h (z)) δt = λn+1 h (z) − Bk−1(λn h), ∀z ∈ Σh, λn+1 h (z) ≥ 0, un+1 h (z) ≥ 0, λ n+1 h (z)un+1 h (z) = 0, ∀z ∈ Σh, (2.11) where αk, the operators Ak and Bk−1 (k = 2, 3, 4) are given by: First-order: α1 = 1, A1(un h) = un h, B0(λn h) = 0; (2.12) 4 Q. Cheng and J. Shen Computer Methods in Applied Mechanics and Engineering 391 (2022) 114585 Second-order: α2 = 3 2 , A2(un h) = 2un h − 1 2un−1 h , B1(λn h) = λn h; (2.13) Third-order: α3 = 11 6 , A3(un h) = 3un h − 3 2un−1 h + 1 3un−2 h , B2(λn h) = 2λn h − λn−1 h ; (2.14) Fourth-order: α4 = 25 12 , A4(un h) = 4un h − 3un−1 h + 4 3un−2 h − 1 4un−3 h , B3(λn h) = 3λn h − 3λn−1 h + λn−2 h . (2.15) The formulae for k = 5, 6 can be derived similarly with Taylor expansions. For the sake of simplicity and with a slight abuse of notations, we used Ak(un h) and Bk(un h) to denote Ak(un h, . . . ,un−k+1 h ) and Bk(un h, . . . ,un−k+1 h ), respectively. Note that for k = 1, the above scheme is exactly (2.6)–(2.7). The first-step is a usual kth-order IMEX scheme. The second step (2.11) can be viewed as a correction step in which λn+1 h is introduced to enforce the pointwise positivity of un+1 h , and can be efficiently solved as follows: (un+1 h (z), λn+1 h (z)) = { ( ˜un+1 h (z) − δt αk Bk−1(λn h), 0) if 0 < ˜un+1 h (z) − δt αk Bk−1(λn h) (0, Bk−1(λn h) − αk δt ˜un+1 h (z)) otherwise , ∀z ∈ Σh. (2.16) Remark 2.2. Since λn h is an approximation to λh which tends to zero as h → 0, an alternative is to replace Bk−1(λn h) by zero, i.e., leading to the scheme: Step 1 : solve ˜un+1 h from αk ˜un+1 h − Ak(un h) δt + Ln h ˜un+1 h = 0; (2.17) Step 2 : solve ( un+1 h , λn+1 h ) from αk(un+1 h (z) − ˜un+1 h (z)) δt = λn+1 h (z), ∀z ∈ Σh, λn+1 h (z) ≥ 0, un+1 h (z) ≥ 0, λ n+1 h (z)un+1 h (z) = 0, ∀z ∈ Σh. (2.18) Since the second step is once again equivalent to the cut-off approach (2.9), the above scheme can be interpreted as a kth-order cut-off scheme. 2.2.3. Positivity preserving schemes with mass conservation A drawback of the scheme (2.10)–(2.11) is that it does not preserve mass if the original equation does. For clarity, we consider first the first-order scheme (2.6)–(2.7). Let ⟨L·, ·⟩ (resp. ⟨Ln h·, ·⟩) denote the continuous (resp. discrete) bilinear form after proper integration by parts, e.g., if Ln huh := −∇ · ( f (un h)∇uh), then ⟨Ln huh, vh⟩ := [ f (un h)∇uh, ∇vh]. Assuming ⟨Lu, 1⟩ = 0, we find from (1.1) that ∂t(u, 1) = 0, i.e., the mass is conserved. But assuming ⟨Ln hvh, 1⟩ = 0 for any vh ∈ Xh, we derive from (2.6)–(2.7) that [un+1 h , 1] − [un h, 1] = δt[λn+1 h , 1]. Since λn+1 h ≥ 0, we find that the mass is not conserved, in fact it is increasing with n. We present below a simple modification which enables mass conservation. More precisely, we introduce another Lagrange multiplier ξ n+1 h , which is independent of spatial variables, to enforce the mass conservation in the correction step. Step 1 : solve ˜un+1 h from ˜un+1 h (z) − un h(z) δt + Ln h ˜un+1 h (z) = 0, ∀z ∈ Σh; (2.19) Step 2 : solve ( un+1 h , λn+1 h ) from un+1 h (z) − ˜un+1 h (z) δt = λn+1 h (z) + ξ n+1 h , ∀z ∈ Σh, (2.20a) 5 Q. Cheng and J. Shen Computer Methods in Applied Mechanics and Engineering 391 (2022) 114585 λn+1 h (z) ≥ 0, un+1 h (z) ≥ 0, λ n+1 h (z)un+1 h (z) = 0, ∀z ∈ Σh, (2.20b) [un+1 h , 1] = [un h, 1]. (2.20c) In order to solve (2.20), we rewrite (2.20a) in the following equivalent form un+1 h (z) − ( ˜un+1 h (z) + δtξ n+1 h ) δt = λn+1 h (z). (2.21) Hence, assuming ξ n+1 h is known, (2.21) and (2.20b) can be solved pointwise as follows: (un+1 h (z), λn+1 h (z)) = { ( ˜un+1 h (z) + δtξ n+1 h , 0) if 0 < ˜un+1 h (z) + δtξ n+1 h (0, − ˜un+1 h (z)+δtξ n+1 h δt ) otherwise , ∀z ∈ Σh. (2.22) It remains to determine ξ n+1 h . We find from (2.20c) and (2.21) that [ ˜un+1 h + δtξ n+1 h , 1] = [un h, 1] − δt[λn+1 h , 1], which, thanks to (2.22), can be rewritten as∑ z∈Σh s.t. 0< ˜un+1 h (z)+δtξ n+1 h ( ˜un+1 h (z) + δtξ n+1 h )ωz = [un h, 1]. Hence, ξ n+1 h is a solution to the nonlinear algebraic equation F(ξ) = ∑ z∈Σh s.t. 0< ˜un+1 h (z)+δtξ ( ˜un+1 h (z) + δtξ)ωz − [un h, 1] = 0. (2.23) Since F ′(ξ) may not exist and difficult to compute if it exists, instead of the Newton iteration, we can use the following secant method: ξk+1 = ξk − F(ξk)(ξk − ξk−1) F(ξk) − F(ξk−1) . (2.24) Since ξ n+1 h is an approximation to zero and it will be shown below that ξ n+1 h ≤ 0, we can choose ξ0 = 0 and ξ1 = − O(δt). In all our experiments, (2.24) converges in a few iterations so that the cost is negligible. Once ξ n+1 h is known, we can update ( un+1 h , λn+1 h ) with (2.22). Similarly, the higher-order scheme (2.10)–(2.11) can be modified to preserve mass as follows: Step 1 (prediction): solve ˜un+1 h from αk ˜un+1 h − Ak(un h) δt + Ln h ˜un+1 h = Bk−1(λn h) + Bk−1(ξ n h ); (2.25) Step 2 (correction): solve ( un+1 h , λn+1 h ) from αk(un+1 h (z) − ˜un+1 h (z)) δt = λn+1 h (z) − Bk−1(λn h) + ξ n+1 h − Bk−1(ξ n h ), ∀z ∈ Σh, (2.26a) λn+1 h (z) ≥ 0, un+1 h (z) ≥ 0, λ n+1 h (z)un+1 h (z) = 0, ∀z ∈ Σh, (2.26b) [un+1 h , 1] = [un h, 1]. (2.26c) In order to solve the above system, we denote ηn+1 h := δt αk (ξ n+1 h − Bk−1(ξ n h ) − Bk−1(λn h)) and rewrite (2.26a) as αk(un+1 h (z) − ( ˜un+1 h (z) + ηn+1 h (z))) δt = λn+1 h (z). (2.27) Assuming ξ n+1 h is known, we find from (2.26a) and (2.27) that (un+1 h (z), λn+1 h (z)) = { ( ˜un+1 h (z) + ηn+1 h , 0) if 0 < ˜un+1 h (z) + ηn+1 h , (0, − αk δt ( ˜un+1 h (z) + ηn+1 h (z))) otherwise . (2.28) Finally, we can determine ξ n+1 h by solving the nonlinear algebraic equation F(ξ n+1 h ) = ∑ z∈Σh s.t. 0< ˜un+1 h (z)+ηn+1(z) h ( ˜un+1 h (z) + ηn+1 h (z))ωz − [un h, 1] = 0. (2.29) 6 Q. Cheng and J. Shen Computer Methods in Applied Mechanics and Engineering 391 (2022) 114585 Remark 2.3. Replacing Bk−1(λn h) in (2.25)–(2.26) by zero, we obtain a mass conserved kth-order cut-off scheme. 3. Stability results We prove in this section that the first- and second-order positivity preserving schemes with or without mass conservation are dissipative and unconditionally stable if ⟨Ln hvh, vh⟩ ≥ 0 ∀vh ∈ Xh for all n. 3.1. First-order schemes We consider first the scheme (2.6)–(2.7). Theorem 3.1. For the scheme (2.6)–(2.7), we have ∥um h ∥2 + m−1∑ n=0 (∥ ˜un+1 h − un h∥2 + δt 2∥λn+1 h ∥2) + 2δt m−1∑ n=0 ⟨Ln h ˜un+1 h , ˜un+1 h ⟩ = ∥ u0 h∥2, ∀m ≥ 1. (3.1) In particular, if for all n, ⟨Ln hvh, vh⟩ ≥ 0 ∀vh ∈ Xh, then the scheme (2.6)–(2.7) with k = 1 is dissipative and unconditionally stable. Proof. Taking the discrete inner product of (2.6) with 2 δt ˜un+1 h , we obtain ∥ ˜un+1 h ∥2 − ∥un h∥2 + ∥ ˜un+1 h − un h∥2 + 2δt⟨Ln h ˜un+1 h , ˜un+1 h ⟩ = 0. (3.2) We rewrite (2.7) as un+1 h (z) − δtλn+1 h (z) = ˜un+1 h (z). (3.3) Taking the discrete inner product of each side of the above equation with itself, thanks to the last KKT condition in (2.7), we derive ∥un+1 h ∥2 + δt 2∥λn+1 h ∥2 = ∥ ˜un+1 h ∥2. Summing up the above with (3.2), we obtain ∥un+1 h ∥2 − ∥un h∥2 + δt 2∥λn+1 h ∥2 + ∥ ˜un+1 h − un h∥2 + 2δt⟨Ln h ˜un+1 h , ˜un+1 h ⟩ = 0. Summing up the above for n from 0 to m − 1, we arrive at (3.1). In particular, if ⟨Ln hvh, vh⟩ ≥ 0 ∀vh ∈ Xh, then we have ∥un+1 h ∥2 + δt 2∥λn+1 h ∥2 + ∥ ˜un+1 h − un h∥2 ≤ ∥un h∥2. We derive from above that ∥un+1 h ∥2 ≤ ∥un h∥2 for any n, so that the scheme (2.6)–(2.7) with k = 1 is unconditional stable and dissipative. □ Next, we consider the mass conserved scheme (2.19)–(2.20). Theorem 3.2. For the scheme (2.19)–(2.20), if ⟨Ln hvh, 1⟩ = 0 for any vh ∈ Xh, we have ∥um h ∥2 + m−1∑ n=0 (∥ ˜un+1 h − un h∥2 + δt 2∥λn+1 h + ξ n+1 h ∥2) + 2δt m−1∑ n=0 ⟨Ln h ˜un+1 h , ˜un+1 h ⟩ ≤ ∥ u0 h∥2, ∀m ≥ 1. (3.4) In particular, if for all n, ⟨Ln hvh, vh⟩ ≥ 0 ∀vh ∈ Xh, then the scheme (2.19)–(2.20) is dissipative and unconditionally stable. Proof. The proof follows the same procedure as that of Theorem 3.1. Indeed, we can replace (3.3) by un+1 h (z) − δt(λn+1 h (z) + ξ n+1 h ) = ˜un+1 h (z), (3.5) Taking the inner product of (3.5) with itself on both sides, we obtain ∥un+1 h (z)∥2 + δt 2∥λn+1 h (z) + ξ n+1 h ∥2 − 2δt[un+1 h (z), ξn+1 h ] = ∥ ˜un+1 h (z)∥2. (3.6) 7 Q. Cheng and J. Shen Computer Methods in Applied Mechanics and Engineering 391 (2022) 114585 Summing up (2.19) and (2.20a), we obtain un+1 h (z) − un h(z) δt + Ln h ˜un+1 h (z) = λn+1 h + ξ n+1 h , ∀z ∈ Σh, (3.7) Taking the discrete inner product of (3.7) with 1 on both sides, using the fact that ⟨Ln h ˜un+1 h , 1⟩ = 0, we obtain [λn+1 h , 1] + [ξ n+1 h , 1] = 0, (3.8) which implies that ξ n+1 h = − [λn+1 h ,1] |Ω| ≤ 0 since λn+1 h ≥ 0. Therefore, −2δt[un+1 h (z), ξn+1 h ] ≥ 0. Finally, summing up (3.6) with (3.2), we arrive at the following result ∥un+1 h ∥2 − ∥un h∥2 + δt 2∥λn+1 h + ξ n+1 h ∥2 + ∥ ˜un+1 h − un h∥2 + 2δt⟨Ln h ˜un+1 h , ˜un+1 h ⟩ = 2δt[un+1 h (z), ξn+1 h ] ≤ 0. Summing up the above for n from 0 to m −1, we arrive at the result (3.4). In particular, if ⟨Ln hvh, vh⟩ ≥ 0 ∀vh ∈ Xh, then we have ∥un+1 h ∥2 + δt 2∥λn+1 h + ξ n+1 h ∥2 + ∥ ˜un+1 h − un h∥2 ≤ ∥un h∥2. We derive from above that ∥un+1 h ∥2 ≤ ∥ un h∥2 for any n, so that the scheme (2.19)–(2.20) is dissipative and unconditionally stable. □ 3.2. Second-order schemes We first consider the scheme (2.10)–(2.11) with k = 2. Theorem 3.3. For the scheme (2.10)–(2.11) with k = 2, we assume that the first step is computed with the first-order scheme (2.6)–(2.7). Then, we have 4∥um h ∥2 + ∥2um h − um−1 h ∥2 + 4 3 δt 2∥λm h ∥2 + 4δt m−1∑ n=0 ⟨Ln h ˜un+1 h , ˜un+1 h ⟩ ≤ ∥ 2u1 h − u0 h∥2 + 4∥u0 h∥2, ∀m ≥ 1. (3.9) In particular, if for all n, ⟨Ln hvh, vh⟩ ≥ 0 ∀vh ∈ Xh, then the scheme (2.10)–(2.11) with k = 2 is dissipative and unconditionally stable. Proof. Taking inner product of Eq. (2.10) (with k = 2) with 4 δt ˜un+1 h , we obtain [3 ˜un+1 h − 4un h + un−1 h , 2 ˜un+1 h ] + 4δt⟨Ln h ˜un+1 h , ˜un+1 h ⟩ = 4δt[λn h, ˜un+1 h ]. (3.10) The term on the left can be written as [3 ˜un+1 h − 4un h + un−1 h , 2 ˜un+1 h ] = 2[3un+1 h − 4un h + un−1 h , un+1 h ] + 2[3un+1 h − 4un h + un−1 h , ˜un+1 h − un+1 h ] + 6[ ˜un+1 h − un+1 h , ˜un+1 h ]. (3.11) For the first term on the righthand side of (3.11), we have 2[3un+1 h − 4un h + un−1 h , un+1 h ] =∥un+1 h ∥2 − ∥un h∥2 + ∥2un+1 h − un h∥2 − ∥ 2un h − un−1 h ∥2 + ∥un+1 h − 2un h + un−1 h ∥2. (3.12) For the last term in (3.11), we have 6[ ˜un+1 h − un+1 h , ˜un+1 h ] = 3(∥ ˜un+1 h ∥2 − ∥un+1 h ∥2 + ∥ ˜un+1 h − un+1 h ∥2). (3.13) And for the second term on the righthand side of (3.11). Similarly, we have 2[3un+1 h − 4un h + un−1 h , ˜un+1 h − un+1 h ] =2[un+1 h − 2un h + un−1 h , ˜un+1 h − un+1 h ] + 4[un+1 h − un h, ˜un+1 h − un+1 h ]. (3.14) 8 Q. Cheng and J. Shen Computer Methods in Applied Mechanics and Engineering 391 (2022) 114585 By Cauchy–Schwartz inequality, the first term on the righthand side of (3.14) can be bounded by 2[un+1 h − 2un h + un−1 h , ˜un+1 h − un+1 h ] ≤ ∥un+1 h − 2un h + un−1 h ∥2 + ∥ ˜un+1 h − un+1 h ∥2. (3.15) Thanks to the KKT conditions in (2.11), we have [ un+1 h , λn+1 h ] = [un h, λn h] = 0 for all n, so for the second term on the righthand side of (3.14), we have 4[un+1 h − un h, ˜un+1 h − un+1 h ] = − 8δt 3 [un+1 h − un h, λn+1 h − λn h] = 8δt 3 {[un+1 h , λn h] + [un h, λn+1 h ]} ≥ 0. (3.16) Next, we rewrite (2.11) with k = 2 as 3un+1 h − 2δtλn+1 h = 3 ˜un+1 h − 2δtλn h. (3.17) Taking the discrete inner product of each side of the above equation with itself, since [ λn+1 h , un+1 h ] = 0, we derive 3∥un+1 h ∥2 + 4 3 δt 2∥λn+1 h ∥2 = 3∥ ˜un+1 h ∥2 − 4δt[ ˜un+1 h , λn h] + 4 3 δt 2∥λn h∥2. (3.18) Now, summing up (3.10) with (3.18), and using (3.11) to (3.16), we obtain that for n ≥ 1, 4(∥un+1 h ∥2 − ∥un h∥2) + ∥2un+1 h − un h∥2 − ∥2un h − un−1 h ∥2 + 2∥ ˜un+1 h − un+1 h ∥2 + 4 3 δt 2(∥λn+1 h ∥2 − ∥λn h∥2) + 4δt⟨Ln h ˜un+1 h , ˜un+1 h ⟩ = − 8δt 3 {[un+1 h , λn h] + [un h, λn+1 h ]}. (3.19) From (3.19) and using (3.16), we derive easily 4(∥un+1 h ∥2 − ∥un h∥2) + ∥2un+1 h − un h∥2 − ∥2un h − un−1 h ∥2 + 2∥ ˜un+1 h − un+1 h ∥2 + 4 3 δt 2(∥λn+1 h ∥2 − ∥λn h∥2) + 4δt⟨Ln h ˜un+1 h , ˜un+1 h ⟩ ≤ 0. (3.20) On the other hand, since the first step is computed by using the first-order scheme, we take n = 1 in (3.1) to obtain ∥u1 h∥2 + ∥ ˜u1 h − u0 h∥2 + 2δt⟨L0 h ˜u1 h, ˜u1 h⟩ + δt 2∥λ1 h∥2 = ∥u0 h∥2. (3.21) Finally, summing up (3.20) from n = 1 to n = m − 1 with (3.21) multiplied by 4, we obtain, after dropping some unnecessary terms, 4∥um h ∥2 + ∥2um h − um−1 h ∥2 + 4 3 δt 2∥λm h ∥2 + 4δt m−1∑ n=0 ⟨Ln h ˜un+1 h , ˜un+1 h ⟩ ≤ ∥ 2u1 h − u0 h∥2 + 4∥u0 h∥2, (3.22) which implies the (3.9). In particular, if ⟨Ln hvh, vh⟩ ≥ 0 ∀vh ∈ Xh, the above indicates that 4 ∥um h ∥2 + ∥2um h − um−1 h ∥2 ≤ ∥2u1 h − u0 h∥2 + 4∥u0 h∥2 for all m, so that the scheme (2.10)–(2.11) with k = 2 is unconditional stable and dissipative. □ Next, we consider the mass conserved scheme (2.25)–(2.26) with k = 2. Theorem 3.4. For the scheme (2.25)–(2.26) with k = 2, we assume that the first step is computed with the first-order scheme (2.19)–(2.20). Then, if ⟨Ln hvh, 1⟩ = 0 for any vh ∈ Xh, we have 4∥um h ∥2 + ∥2um h − um−1 h ∥2 + 4 3 δt 2∥λm h + ξ m h ∥2 + 4δt m−1∑ n=0 ⟨Ln h ˜un+1 h , ˜un+1 h ⟩ ≤ ∥2u1 h − u0 h∥2 + 4∥u0 h∥2, ∀m ≥ 1. (3.23) In particular, if for all n, ⟨Ln hvh, vh⟩ ≥ 0 ∀vh ∈ Xh, then the scheme (2.25)–(2.26) with k = 2 is dissipative and unconditionally stable. Proof. The proof is again similar to that of Theorem 3.3 so we just point out the differences below. 9 Q. Cheng and J. Shen Computer Methods in Applied Mechanics and Engineering 391 (2022) 114585 First, (3.10) should be replaced by [3 ˜un+1 h − 4un h + un−1 h , 2 ˜un+1 h ] + 4δt⟨Ln h ˜un+1 h , ˜un+1 h ⟩ = 4δt[λn h + ξ n h , ˜un+1 h ]. (3.24) Then (3.16) should be replaced by 4[un+1 h − un h, ˜un+1 h − un+1 h ] = − 8δt 3 [un+1 h − un h, λn+1 h + ξ n+1 h − (λn h + ξ n h )] = − 8δt 3 [un+1 h − un h, λn+1 h − λn h] − 8δt 3 [un+1 h − un h, ξn+1 h − ξ n h ] = − 8δt 3 [un+1 h − un h, λn+1 h − λn h] = 8δt 3 {[un+1 h , λn h] + [un h, λn+1 h ]} ≥ 0, (3.25) where we used the fact that −8δt 3 [un+1 h − un h, ξn+1 h − ξ n h ] = − 8δt 3 (ξ n+1 h − ξ n h ) ( [un+1 h , 1] − [un h, 1] ) = 0. Next, (3.17) should be replaced by 3un+1 h (z) − 2δt(λn+1 h (z) + ξ n+1 h ) = 3 ˜un+1 h (z) − 2δt(λn h(z) + ξ n h ). (3.26) Taking the discrete inner product of (3.26) with itself on both sides, we obtain 3∥un+1 h (z)∥2 + 4 3 δt 2∥λn+1 h (z) + ξ n+1 h ∥2 − 2δt[un+1 h , λn+1 h + ξ n+1 h ] = 3∥ ˜un+1 h (z)∥2 + 4 3 δt 2∥λn h(z) + ξ n h ∥2 − 2δt[ ˜un+1 h , λn h + ξ n h ]. (3.27) Summing up (2.25) and (2.26a), we obtain αkun+1 h − Ak(un h) δt + Ln h ˜un+1 h = λn+1 h + ξ n+1 h . (3.28) Taking the discrete inner product of (3.28) with 1 on both sides, using (2.26c), we obtain [λn+1 h + ξ n+1 h , 1] = [λn+1 h , 1] + [ξ n+1 h , 1] = 0, (3.29) which implies ξ n+1 h ≤ 0 since λn+1 h ≥ 0. Therefore, − 2δt[un+1 h , λn+1 h + ξ n+1 h ] = −2δt[un+1 h , ξn+1 h ] ≥ 0. (3.30) Then, summing up (3.24) with (3.27), and using (3.25) and (3.30), we arrive at 4(∥un+1 h ∥2 − ∥un h∥2) + ∥2un+1 h − un h∥2 − ∥2un h − un−1 h ∥2 + 2∥ ˜un+1 h − un+1 h ∥2 + 4 3 δt 2(∥λn+1 h + ξ n+1 h ∥2 − ∥λn h + ξ n h ∥2) + 4δt⟨Ln h ˜un+1 h , ˜un+1 h ⟩ = − 8δt 3 {[un+1 h , λn h] + [un h, λn+1 h ]} + 2δt[un+1 h , ξn+1 h ]. (3.31) From (3.31) and using (3.25) and (3.30), we obtain 4(∥un+1 h ∥2 − ∥un h∥2) + ∥2un+1 h − un h∥2 − ∥2un h − un−1 h ∥2 + 2∥ ˜un+1 h − un+1 h ∥2 + 4 3 δt 2(∥λn+1 h + ξ n+1 h ∥2 − ∥λn h + ξ n h ∥2) + 4δt⟨Ln h ˜un+1 h , ˜un+1 h ⟩ ≤ 0. (3.32) For the first step, we take m = 1 in (3.4) to obtain ∥u1 h∥2 + ∥ ˜u1 h − u0 h∥2 + 2δt⟨L0 h ˜u1 h, ˜u1 h⟩ + δt 2∥λ1 h + ξ 1 h ∥2 ≤ ∥u0 h∥2. (3.33) Finally, summing up (3.32) from n = 1 to n = m − 1 with (3.33) multiplied by 4, we obtain, 4∥um h ∥2 + ∥2um h − um−1 h ∥2 + 4 3 δt 2∥λm h + ξ m h ∥2 + 4δt m−1∑ n=0 ⟨Ln h ˜un+1 h , ˜un+1 h ⟩ ≤ ∥ 2u1 h − u0 h∥2 + 4∥u0 h∥2, 10 Q. Cheng and J. Shen Computer Methods in Applied Mechanics and Engineering 391 (2022) 114585 which implies the (3.23). In particular, if ⟨Ln hvh, vh⟩ ≥ 0 ∀vh ∈ Xh, the above indicates that 4 ∥um h ∥2 + ∥2um h − um−1 h ∥2 ≤ ∥2u1 h − u0 h∥2 + 4∥u0 h∥2 for all m, so that the scheme (2.25)–(2.26) with k = 2 is unconditional stable and dissipative. □ Remark 3.1. The results in the previous theorems are derived for a general approximate operator Ln h. They imply in particular: • If Ln h is non-negative, e.g., as in (2.3) with application to Porous Media equation, then the first- and second-order positivity preserving schemes with Lagrange multiplier are unconditionally energy stable. • If one can show, perhaps under certain condition ∆t ≤ c0hα with a semi-implicit discretization (where α > 0 depending on the problem and discretization), that for the usual schemes, i.e., by setting λn h ≡ 0 for all n, we have δt m−1∑ n=1 ⟨Ln h ˜un+1 h , ˜un+1 h ⟩ ≥ βδt m−1∑ n=1 ah( ˜un+1 h , ˜un+1 h ) − C1, ∀m ≤ T /∆t − 1, where β is some positive constant in (0 , 1] and T is the final time, then we derive from the above and (3.1) that the solutions of the corresponding schemes (2.10)–(2.11) and (2.25)–(2.26) with k = 1, 2 are bounded in the sense that ∥um h ∥2 + 2βδt m−1∑ n=1 ah( ˜un+1 h , ˜un+1 h ) ≤ ∥u0 h∥2 + C1, ∀m ≤ T /∆t − 1. Remark 3.2. We are unable to prove similar results for the schemes (2.10)–(2.11) and (2.25)–(2.26) with k ≥ 3. The situation is similar to the pressure-correction schemes for the Navier–Stokes equations [28]. 4. Numerical experiments In this section, we carry out various numerical experiments to demonstrate the performance of proposed positivity preserving schemes. We use spectral Galerkin methods with numerical integration for all cases, namely, Fourier- spectral method [29] is used for problems with periodic boundary conditions, while a Legendre-spectral method [29] is used for problems with Dirichlet or Neumann boundary conditions. Note that in general it is much more difficult to preserve positivity with a spectral method than with a lower-order finite element or finite difference method. Below, h = 1/N where N is the number of collocation points in each direction. 4.1. Convergence rate We first test the convergence rates in time for the positivity preserving schemes using the Allen–Cahn equation [30] ut − ∆u + 1 ϵ2 u(u − 1)(u − 1 2) = 0, (4.1) with periodic boundary condition in Ω = [0, 2π)2. It is well-known that the solution will remain in [0 , 1] if the values of the initial condition u(x, y, 0) are in [0 , 1] [31]. In particular, it is positivity preserving. We choose the following initial condition u(x, y, 0) = 1 2 ( 1 + tanh(1 − √ (x − π)2 + (y − π)2 √ 2ϵ ) ) , (4.2) with ϵ2 = 0.001 and use 322 uniform collocation points in [0, 2π)2, i.e., Σh = {x jk = ( j 2π , k 2π ) : j, k = 0, 1, . . . ,31}. We note that with this coarse mesh, the usual semi-implicit Fourier-collocation method will produce numerical solutions with negative values, i.e., the spatial discretized problem (2.2) will lead to non zero λh. The spatial discretized problem is smooth in time so it can be used to test the convergence rates of the positivity preserving time discretization schemes. On the other hand, the Fourier-spectral method with 32 × 32 uniform collocation points is 11 Q. Cheng and J. Shen Computer Methods in Applied Mechanics and Engineering 391 (2022) 114585 Fig. 1. Numerical solution of Allen-Cahn equation (4.1) with ϵ2 = 0.001 at t = 0.01 and t = 0.4 computed with 32 × 32 Fourier modes but plotted on the 256 × 256 grid. Table 1 Accuracy test: The L ∞ errors between un h and the reference solution at t = 0.01 for the Allen-Cahn equation (4.1) with ϵ2 = 0.001 using (2.10)–(2.11). δt (2.10)–(2.11) k = 1 Order (2.10)–(2.11) k = 2 Order 4 × 10−5 2.71 × 10−4 – 1 .20 × 10−5 – 2 × 10−5 1.37 × 10−4 0.98 2 .97 × 10−6 2.01 1 × 10−5 6.85 × 10−5 1.00 7 .31 × 10−7 2.02 5 × 10−6 3.42 × 10−5 1.00 1 .74 × 10−7 2.07 2.5 × 10−6 1.71 × 10−5 1.00 3 .54 × 10−8 2.30 enough to provide a reasonable approximation to this problem as shown in Fig. 1. As a reference solution, we use the numerical solution computed by the scheme (2.17)–(2.18) with k = 2 and δt = 10−6. In Table 1, we list the L ∞ errors of numerical solution between the reference solution un+1 h obtained using the schemes (2.10)–(2.11) with k = 1, 2. We observe from Table 1 that the schemes (2.10)–(2.11) are indeed kth order accurate. 4.2. Porous medium equation In this subsection, we consider the porous medium equation (PME) [17]: ρt = ∆ρm = m∇ · (ρm−1∇ρ), (4.3) with homogeneous Dirichlet boundary condition in Ω = (−5, 5)d (d = 1, 2, 3) where m ≥ 1 is a physical parameter. The porous medium equation has wide applications in various areas, including fluid dynamics, heater transfer and image processing. We observe from (4.3) that the PME is degenerate and its solution has to be positive. We shall use the Legendre–Galerkin method with numerical integration in space. LetPN be the set of polynomials with degree less than or equal to N in each direction, and let Σh be the set of the interior Legendre–Gauss–Lobatto points, i.e., in the one dimensional case, Σh = {xk : k = 1, 2, . . . ,N − 1} where {xk} are the roots of L ′ N (x) with L N being the Legendre polynomial of Nth degree, and in the multi-dimensional case, Σh is obtained by the tensor product of one-dimensional set. We set Xh = { vh ∈ PN : vh|∂Ω=0}, and use the scheme (2.10)–(2.11) with k = 2 and Ln h(vh) = −∇ · (m(ρn+1,∗)m−1∇vh). For the reader’s convenience, it is explicitly described below: Find ρn+1 h ∈ Xh such that [3 ˜ρn+1 h − 4ρn h + ρn−1 h 2δt , vh] + m[(ρn+1,∗ h )m−1∇ρn+1 h , ∇vh] = [λn h, vh], ∀vh ∈ Xh, (4.4) 3ρn+1 h (z) − 3 ˜ρn+1 h (z) 2δt = λn+1 h (z) − λn h(z), ∀z ∈ Σh, (4.5) λn+1 h (z) ≥ 0, ρ n+1 h (z) ≥ 0, λ n+1 h (z)ρn+1 h (z) = 0, (4.6) 12 Q. Cheng and J. Shen Computer Methods in Applied Mechanics and Engineering 391 (2022) 114585 where ρn+1,∗ h = { 2ρn h − ρn−1 h i f ρn h ≥ ρn−1 h , 1 2/ρn h −1/ρn−1 h i f ρn h < ρ n−1 h . (4.7) At each time step, we need to solve an elliptic equation with variable coefficients in (4.4), which can be efficiently solved by a preconditioned conjugate gradient iteration with a constant coefficient problem as the preconditioner. 4.2.1. Comparison with a usual semi-implicit scheme We now compare the positivity preserving scheme (4.4)–(4.6) with the corresponding usual semi-implicit scheme [3ρn+1 h − 4ρn h + ρn−1 h 2δt , vh] + m[(ρn+1,∗ h )m−1∇ρn+1 h , ∇vh] = 0, ∀vh ∈ Xh, (4.8) using the exact solution of the porous medium Eq. (4.3) in the Barenblatt form ρ(x, t) = 1 t α 0 ( C − α m − 1 2m x 2 t 2α 0 ) 1 m−1 + , (4.9) where f+ = max{ f, 0}, α = 1 m+1, C = 1 and t0 = t + 1. The solution is compactly supported in (0 , 1) with the interface moving outward in a finite speed. The initial condition for the numerical simulations is chosen as ρ(x, 0). In Fig. 2, we plot the L2 errors by the usual semi-implicit scheme (4.8) and by the positivity preserving (4.4)–(4.6) with m = 2 and set δt = 10−3. We observe that the errors grow rapidly after a short time with N = 128, 256, 512 using (4.8) since the numerical solution becomes negative at some places; while the error appears to be under control for at least up to T = 1 with N = 1024. On the other hand, by using (4.4)–(4.6), the errors remain under control and accurate solutions are obtained for all N. We observe from Fig. 2(c) that, even at N = 1024, the Lagrange multiplier λh becomes non-zero in order to maintain positivity. Numerical solutions ρh at T = 0.05, 0.1, 1 are plotted in Fig. 2(d). In Fig. 3, we consider a more challenging case with m = 5 using δt = 10−3 and N = 1024, and plot the numerical solution at T = 0.1 using the usual semi-implicit scheme (4.8) and the positivity preserving (4.4)–(4.6) in Fig. 3(a) and (b). We observe that the scheme (4.8) produces negative values near the interface while the scheme (4.4)–(4.6) leads to accurate positive solutions. We also plot the Lagrange multiplier λh in Fig. 3(c) which indicates that λh becomes larger near the interface to maintain the positivity of ρh. In Fig. 3(d), we plot the L2 errors using (4.4)–(4.6) with λh and without λh. Next we consider the 2D case with the exact solution in the Barenblatt form ρ(x, y, t)|t=0 = 1 t α 0 ( C − α m − 1 2m x 2 + y2 t 2α 0 ) 1 m−1 + , (4.10) where C = 1, t0 = t + 1 and α = 1 m+1. We set N = 200, δt = 2 × 10−4 and consider m = 2, 5. We observe from Fig. 4 that correct solutions are obtained by the positivity preserving scheme and that the values of Lagrange multiplier λh are quite large near the interface in order to maintain the positivity of ρh. 4.2.2. Effect of mass conservation The porous media Eq. (4.3) with homogeneous Dirichlet boundary conditions is mass conserving. So we compare the second-order positivity conserving schemes without mass conservation and with mass conservation for the porous medium equation. The results with δt = 10−4 and N = 128 are plotted in Fig. 5. We observe that the scheme with mass conservation preserves the mass and is slightly more accurate in terms of L2 error than the scheme without mass conservation whose mass is monotonically increasing. Actually, only a few iterations are needed at each time step to solve ξ using secant method. We can also observe Lagrange multiplier ξ ≤ 0 in time interval [0 , 2]. 4.3. Poisson-Nernst–Planck Equations We consider the following Poisson–Nernst–Planck (PNP) system [10,32] which describes the dynamics of ion transport in ion channels: −ϵ2∆φ = p − n, in ΩT := (0, T ] × Ω . (4.11) 13 Q. Cheng and J. Shen Computer Methods in Applied Mechanics and Engineering 391 (2022) 114585 Fig. 2. The L2 error of numerical solution by (4.8) and by (4.4)–(4.6) with δt = 10−3 and m = 2. pt = ∇ · (∇ p + p∇φ), (4.12) nt = ∇ · (∇n − n∇φ), (4.13) with initial conditions p(0, x) = p0(x) ≥ 0, n(0, x) = n0(x) ≥ 0, in Ω , (4.14) and homogeneous Neumann boundary conditions ∂p ∂n = ∂n ∂n = ∂φ ∂n = 0, on ∂ΩT := (0, T ] × ∂Ω . (4.15) In the above, p and n are concentration of positive and negative ions with valence +1 and −1, respectively, φ is the electrical potential, ϵ is a small positive dimensionless number representing the ratio of the Debye length to the physical characteristic length. The unknown functions p and n have to be positive for the problem to be well posed. Below we use the general approach presented in the last section to construct a positivity preserving scheme for the PNP equations. Since we need to keep both p and n positive, two Lagrange multipliers λ and η are needed . Lagrange multipliers ξ and γ are used to preserve mass. We set Xh = PN × PN , and Σh = { (xi , x j), 1 ≤ i, j ≤ N − 1}, where {xk}N k=0 are the roots of (1 − x 2)L ′ N (x) with L N being the Legendre polynomial of Nth degree. And we use the Legendre–Galerkin method with numerical 14 Q. Cheng and J. Shen Computer Methods in Applied Mechanics and Engineering 391 (2022) 114585 Fig. 3. (a) and (b) Numerical solutions ρh at T = 0.1 with m = 5, δ t = 10−3, N = 1024 by (4.8) and by (4.4)–(4.6). (c) Lagrange multiplier λh and ρh by (4.4)–(4.6). (d) L2 error with λh and without λh. integration in space [29]. Then a second-order positivity preserving scheme based on the scheme (2.25)–(2.26c) with k = 2 is as follows: for ∀qh, mh ∈ Xh [3 ˜pn+1 h − 4pn h + pn−1 h 2δt , qh] = [∇ pn+1 h + pn+1,⋆ h ∇φn+1,⋆ h , ∇qh] + [λn h + ξ n h , qh], (4.16) 3pn+1 h − ˜pn+1 h 2δt = λn+1 h − λn h + ξ n+1 h − ξ n h , (4.17) λn+1 h ≥ 0, pn+1 h ≥, λ n+1 h pn+1 h = 0, [pn+1 h , 1] = [pn h , 1]; (4.18) [3 ˜nn+1 h − 4nn h + nn−1 h 2δt , mh] = [∇nn+1 h − nn+1,⋆ h ∇φn+1,⋆ h , ∇mh] + [ηn h + γ n h , mh], (4.19) 3nn+1 h − 3 ˜nn+1 h 2δt = ηn+1 h − ηn h + γ n+1 h − γ n h , (4.20) ηn+1 h ≥ 0, nn+1 h ≥ 0, η n+1 h nn+1 h = 0, [nn+1 h , 1] = [nn h, 1]; (4.21) ϵ2[∇φn+1 h , ∇ψh] = [pn+1 h − nn+1 h , ψh], ∀ψh ∈ Xh; (4.22) 15 Q. Cheng and J. Shen Computer Methods in Applied Mechanics and Engineering 391 (2022) 114585 Fig. 4. Numerical solution of 2D porous medium equation at T = 0.2 with δt = 2 × 10−4 and N = 200: (a) ρh with m = 2. (b) Lagrange multiplier λh with m = 2. (c) ρh with m = 5. (d) Lagrange multiplier λh with m = 5. where pn+1,⋆ h = 2pn h − pn−1 h and nn+1,⋆ h = 2nn h − nn−1 h . In the above, pn+1 h and nn+1 h are decoupled and can be determined from (4.16)–(4.18) and (4.19)–(4.21) respectively. Once pn+1 h and nn+1 h are known, φn+1 h can be obtained from (4.22). Hence, the scheme is very efficient. We set Ω = (−1, 1)2, ϵ = 0.1, and use δt = 10−3, N = 256 in the above scheme with the initial conditions: p(x, y, 0), n(x, y, 0) = { 1, x 2 + y2 ≤ 0.25, 0, otherwise. φ(x, y, 0) = { (x − 0.5)2(y − 0.5)2, x 2 + y2 ≤ 0.25, 0, otherwise. (4.23) The numerical solution at different times are plotted in Fig. 6. We observe that p and n are always non-negative. We also plot the Lagrange multipliers λ and η in Fig. 7 at time t = 3 ×10−3. Since the solutions of the PNP system are smooth, the Lagrange multipliers are zero at most places, and are non-zero only at some localized boundary with quite small values. 16 Q. Cheng and J. Shen Computer Methods in Applied Mechanics and Engineering 391 (2022) 114585 Fig. 5. (a): L2 error by second-order positivity schemes with mass conservation and without mass conservation. (b): Evolution of mass with respective to time. (c): Lagrange multiplier ξ for mass conservation. 4.4. Lubrication-type equation As the last example, we consider the following lubrication equation [23] ρt + ∇ · ( f (ρ)∇∆ρ) = 0, (4.24) where f (ρ) ≈ ρm as ρ → 0 with m depending on the boundary condition at the liquid solid interface: m = 3 for no-slip boundary condition while 0 < m < 3 for various other boundary condition. The above equation has been used, e.g., in the study of thin liquid films and fluid interfaces by surface tension [33]. Below, we consider (4.24) in Ω = (−1, 1) and Ω = (−π, π)2 with periodic boundary conditions, and use a Fourier collocation method in space. Since Eq. (4.24) may develop a singularity in finite time, it is a common practice to regularize it [23,33]. In [33], the equation is regularized by replacing f (ρ) with fη(ρ) = ρ4 f (ρ) η f (ρ)+ρ4 and it is shown in [33] that the regularized problem is well posed for all time. On the other hand, one can also regularize the equation by requiring the solution to be bounded away from zero, namely, ρ(z) ≥ ϵ for a prescribed ϵ. Hence, a second-order scheme based on (2.25)–(2.26c) with k = 2 is as follows: 3 ˜ρn+1 h (z) − 4ρn h (z) + ρn−1 h (z) 2δt + Ln h ˜ρn+1 h (z) = λn h(z) + ξ n h , ∀z ∈ Σh, (4.25) 17 Q. Cheng and J. Shen Computer Methods in Applied Mechanics and Engineering 391 (2022) 114585 Fig. 6. The numerical solution of PNP Eqs. (4.11)–(4.13) with time step 1 × 10−3 and N = 256 in 2D by using scheme (4.16)–(4.22). Parameter ϵ = 0.1. and 3ρn+1 h (z) − 3 ˜ρn+1 h (z) 2δt = λn+1 h (z) − λn h(z) + ξ n+1 h − ξ n h , ∀z ∈ Σh, ρn+1 h (z) ≥ ϵ, λ n+1 h (z) ≥ 0, λ n+1 h (ρn+1(z) − ϵ) = 0, ∀z ∈ Σh, [ρn+1 h , 1] = [ρn h , 1], (4.26) where Ln h is defined as follows depending on the type of regularization: 18 Q. Cheng and J. Shen Computer Methods in Applied Mechanics and Engineering 391 (2022) 114585 Fig. 7. The Lagrange multipliers of PNP Eqs. (4.11)–(4.13) λ and η at time t = 3 × 10−3 for numerical simulations at Fig. 6. Fig. 8. Numerical solutions ρ and Lagrange multiplier λ of positivity preserving scheme computed with η = 10−12, ϵ = 0 and δt = 2×10−8. • ϵ = 0 and Ln h ˜ρn+1 h = ∇ · ( fη(ρn+1,∗ h )∇∆ ˜ρn+1 h ) with ρn+1,∗ h defined in (4.7). • ϵ > 0 and Ln h ˜ρn+1 h = ∇ · ( f (ρn+1,∗ h )∇∆ ˜ρn+1 h ) with ρn+1,∗ h defined in (4.7). The second step (4.26) can be implemented as (ρn+1 h , λn+1 h ) = { ( ˜ρn+1 h − 2 3 δt(λn h − ξ n+1 h + ξ n h ), 0) if ϵ ≤ ˜ρn+1 h − 2 3 δt(λn h − ξ n+1 h + ξ n h ), (ϵ, λn h + ξ n h − ξ n+1 h + 3 2δt (ϵ − ˜ρn+1 h )) otherwise. (4.27) We consider first the one-dimensional case with f (ρ) = ρ 1 2 in ( −1, 1) with periodic boundary conditions and the initial condition ρ0(x) = 0.8 − cos(π x) + 0.25 cos(2π x). (4.28) This example has been well studied in [23], and the original equation f (ρ) = ρ 1 2 will develop a singularity at t ≈ 0.00074. However, with a regularization, the solution can be continued beyond the singularity. In Fig. 8, numerical solutions ρ and Lagrange multiplier λ are shown at different times computed by regularized positivity preserving scheme with N = 1000, η = 10−12, ϵ = 0 and time step δt = 2 × 10−8. Numerical solutions in Fig. 8 are indistinguishable from results computed with (4.25). In Fig. 9(a–d), we plot the numerical solutions at different times computed with (4.25) using 1000 Fourier modes with various ϵ and δt. We observe that the numerical solutions are indistinguishable with ϵ ranging from 10 −2 to 10−4. However, as we decrease ϵ, smaller time steps has to be used. The Lagrange multiplier λh at time t = 0.001 and t = 0.0008 are plotted in Fig. 9(e–f). We observe that λh becomes large near the places where the solution approaches zero. 19 Q. Cheng and J. Shen Computer Methods in Applied Mechanics and Engineering 391 (2022) 114585 Fig. 9. (a)–(d): numerical solution ρh of positivity preserving scheme (4.25) for lubrication-type Eq. (4.24) in 1D at various time with different time steps and ϵ. (e)–(f): Lagrange multiplier λ at time t = 0.001 and t = 0.0008 using different time steps and ϵ. 20 Q. Cheng and J. Shen Computer Methods in Applied Mechanics and Engineering 391 (2022) 114585 Next, we consider a 2D example with the initial condition ρ(x, y) = { (x − 0.5)2(y − 0.5)2, x 2 + y2 ≤ 0.25, 0, otherwise, (4.29) in the domain [ −π, π)2. We first take f (ρ) = ρ and use the following usual semi-implicit scheme: 3ρn+1 h (z) − 4ρn h (z) + ρn−1 h (z) 2δt + Ln hρn+1 h (z) = 0, ∀z ∈ Σh. (4.30) The scheme failed to converge with δt = 10−5. However, by using the 2D version of the scheme (4.25) with ϵ = 0 and 128 × 128 Fourier modes, correct results can be obtained with δt = 10−5. In Fig. 10(a–d), we plot the initial condition and numerical solutions at t = 0.001, 0.01, 0.1, while we plot in Fig. 10(e–f) the Lagrange multipliers λh at t = 0.001, 0.1. We observe that the Lagrange multiplier takes nonzero values at a significant part of the domain which explains why the usual semi-implicit scheme failed to converge. 4.5. Cahn–Hilliard equation in 3D For three-dimensional case, we consider the Cahn–Hilliard equation [34] with a logarithmic potential in the domain [0, 1]3: ut = ∇ · (M(u)∇(µ − 1 α ∆u)), µ = log( u 1 − u ) + 2θ(1 − 2u), (4.31) where θ = Tc T is a dimensionless number which represents the ratio between the critical temperature Tc and the absolute temperature T . The mobility function is M(u) = αu(1 − u). With a given initial condition u0 > 0, due to the singular logarithmic potential, the solution of Cahn–Hilliard equation (4.31) is expected to be u(t) > 0. We choose initial condition to be u(t = 0) = ˆu0 + 0.05 rand(x, y), (4.32) where rand( x, y) represents random values with uniform distribution in [ −1, 1]. We develop the following positivity-preserving scheme 3 ˜un+1 h − 4un h + un−1 h 2δt + ∆2 ˜un+1 h − ∆ ˜un+1 h = ∆2un+1,⋆ h − ∆un+1,⋆ h + ∇ · (Mn+1,⋆ h ∇(µn+1,⋆ h − 1 α ∆ ˜un+1,⋆ h )) + λn h, µn+1,⋆ h = log( un+1,⋆ h 1 − un+1,⋆ h ) + 2θ(1 − 2un+1,⋆ h ), 3un+1 h (z) − 3 ˜un+1 h (z) 2δt = λn+1 h (z) − λn h(z), λn+1 h (z) ≥ 0, un+1 h (z) ≥ ϵ, λ n+1 h (z)(un+1 h (z) − ϵ) = 0, (4.33) where un+1,⋆ = 2un − un−1 and Mn+1,⋆ h = αun+1,⋆ h (1 − un+1,⋆ h ). We develop the linear no-iteration scheme (4.33) by adding two stabilized terms [21]. For computations, we implement Fourier spectral method in space [0 , 1]3 with resolution 128 3. We set parameters to be ˆu0 = 0.63, θ = 3 2, ϵ = 10−6 and α = 200 which are same with [34]. InFig. 11, we depict iso-surface of uh = 0.635 and uh = 0.63 at time t = 2.5 × 10−4, 1.183 × 10−3, 1.1514 × 10−3, 2.368 × 10−3, 5.240 × 10−3, 4 × 10−2 using positive-preserving scheme (4.33). We obtain similar results with Fig. 27 in [34]. We also show the evolution of minimum value of uh in Fig. 12 which indicates that uh will be positive from initial to steady state. Computations are implemented from initial time t = 0 to steady state t = 0.04 using time step δt = 10−6. CPU time is 16.774 h for 40 000 time steps on the Mac: Intel(R) Core(TM) i5-8279U CPU @ 2.40 GHz. 21 Q. Cheng and J. Shen Computer Methods in Applied Mechanics and Engineering 391 (2022) 114585 Fig. 10. Numerical solutions ρh with positivity preserving scheme at t = 0, 0.001, 0.01, 0.1, and Lagrange multiplier λh at t = 0.01, 0.1. 5. Concluding remarks If a PDE requires its solution to be positive, a generic numerical scheme for the PDE usually cannot preserve the positivity. We presented in this paper a new approach to construct positivity preserving schemes for parabolic type equations by a simple modification to generic numerical schemes. More precisely, we introduce a space–time 22 Q. Cheng and J. Shen Computer Methods in Applied Mechanics and Engineering 391 (2022) 114585 Fig. 11. The iso-surfaces of numerical solutions uh = 0.63 in blue and uh = 0.635 in red for Cahn–Hilliard equation with logarithmic potential computed by positivity preserving scheme with time step δt = 10−6 at t = 2.5 × 10−4, 1.183 × 10−3, 1.1514 × 10−3, 2 .368 × 10−3, 5.240 × 10−3, 4 × 10−2. (For interpretation of the references to color in this figure legend, the reader is referred to the web version of this article.) Lagrange multiplier function to enforce the positivity, and expand the underlying PDE using the KKT conditions. The key question is how to solve the expanded system efficiently with essentially the same cost as the generic numerical scheme. We constructed a new class of positivity preserving schemes by using the predictor–corrector approach to the expanded system: the prediction step can be a generic semi-implicit or implicit scheme, while the correction step is used to enforce the positivity and can be implemented as a simple pointwise update with negligible cost. This new approach is not restricted to any particular spatial discretization and can be combined with various time discretization schemes. It can be applied to a large class of parabolic PDEs which require solutions to be positive. It is also non 23 Q. Cheng and J. Shen Computer Methods in Applied Mechanics and Engineering 391 (2022) 114585 Fig. 12. The minimum value of uh for Cahn–Hilliard equation in 3D using positive-preserving scheme (4.33). intrusive as you can easily modify your non-positivity preserving schemes for them to become positivity preserving. In addition, we also presented a modification to the above approach so that the schemes can also preserve mass if the underlying PDE is mass conserving. An interesting and useful observation is that the ad-hoc cut-off approach can be interpreted as a special case of our predictor–corrector approach. Hence, it provides a different justification for the cut-off approach, moreover allows us to modify the cut-off approach so that it becomes mass conserving, and opens new avenue for further exploration. We established stability results for the first- and second-order schemes based on the new approach under a general setting, and presented ample numerical experiments to validate the new approach. Our numerical results indicate that the new approach is very effective for the variety of problems that we tested. Declaration of competing interest The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper. References [1] Changna Lu, Weizhang Huang, Erik S. Van Vleck, The cutoff method for the numerical computation of nonnegative solutions of parabolic PDEs with application to anisotropic diffusion and lubrication-type equations, J. Comput. Phys. 242 (2013) 24–36. [2] Buyang Li, Jiang Yang, Zhi Zhou, Arbitrarily high-order exponential cut-off methods for preserving maximum principle of parabolic equations, SIAM J. Sci. Comput. 42 (6) (2020) A3957–A3978. [3] Qiang Du, Lili Ju, Xiao Li, Zhonghua Qiao, Maximum bound principles for a class of semilinear parabolic equations and exponential time differencing schemes, 2020, arXiv preprint arXiv:2005.11465. [4] Hao Li, Shusen Xie, Xiangxiong Zhang, A high order accurate bound-preserving compact finite difference scheme for scalar convection diffusion equations, SIAM J. Numer. Anal. 56 (6) (2018) 3308–3345. [5] Hao Li, Xiangxiong Zhang, On the monotonicity and discrete maximum principle of the finite difference implementation of C0-Q2 finite element method, Numer. Math. 145 (2) (2020) 437–472. [6] Xiangxiong Zhang, Chi-Wang Shu, Maximum-principle-satisfying and positivity-preserving high-order schemes for conservation laws: survey and new developments, Proc. R. Soc. A 467 (2134) (2011) 2752–2776. [7] Xiangxiong Zhang, Chi-Wang Shu, On positivity-preserving high order discontinuous Galerkin schemes for compressible Euler equations on rectangular meshes, J. Comput. Phys. 229 (23) (2010) 8918–8934. [8] Wenbin Chen, Cheng Wang, Xiaoming Wang, Steven M. Wise, Positivity-preserving, energy stable numerical schemes for the Cahn-Hilliard equation with logarithmic potential, J. Comput. Phys.: X 3 (2019) 100031. [9] Jian-Guo Liu, Li Wang, Zhennan Zhou, Positivity-preserving and asymptotic preserving method for 2D Keller-Segal equations, Math. Comp. 87 (311) (2018) 1165–1189. [10] Jingwei Hu, Xiaodong Huang, A fully discrete positivity-preserving and energy-dissipative finite difference scheme for Poisson–Nernst–Planck equations, Numer. Math. (2020) 1–39. 24 Q. Cheng and J. Shen Computer Methods in Applied Mechanics and Engineering 391 (2022) 114585 [11] Fukeng Huang, Jie Shen, Bound/positivity preserving and energy stable SA V schemes for dissipative systems: applications to keller-segel and Poisson-Nernst-Planck equations, SIAM J. Sci. Comput. 43 (3) (2021) A1832–A1857. [12] Jaap J.W. van der Vegt, Yinhua Xia, Yan Xu, Positivity preserving limiters for time-implicit higher order accurate discontinuous Galerkin discretizations, SIAM J. Sci. Comput. 41 (3) (2019) A2037–A2063. [13] Kazufumi Ito, Karl Kunisch, On a semi-smooth Newton method and its globalization, Math. Program. 118 (2) (2009) 347–370. [14] Kazufumi Ito, Karl Kunisch, Lagrange Multiplier Approach to Variational Problems and Applications, SIAM, 2008. [15] Patrick T. Harker, Jong-Shi Pang, Finite-dimensional variational inequality and nonlinear complementarity problems: a survey of theory, algorithms and applications, Math. Program. 48 (1) (1990) 161–220. [16] Francisco Facchinei, Jong-Shi Pang, Finite-Dimensional Variational Inequalities and Complementarity Problems, Springer Science & Business Media, 2007. [17] Juan Luis Vázquez, The Porous Medium Equation: Mathematical Theory, Oxford University Press on Demand, 2007. [18] Maïtine Bergounioux, Kazufumi Ito, Karl Kunisch, Primal-dual strategy for constrained optimal control problems, SIAM J. Control Optim. 37 (4) (1999) 1176–1194. [19] Charles Francis Curtiss, Joseph O. Hirschfelder, Integration of stiff equations, Proc. Natl. Acad. Sci. USA 38 (3) (1952) 235. [20] Qing Cheng, Jie Shen, Global constraints preserving scalar auxiliary variable schemes for gradient flows, SIAM J. Sci. Comput. 42 (4) (2020) A2489–A2513. [21] Qing Cheng, Jie Shen, Multiple scalar auxiliary variable (MSA V) approach and its application to the phase-field vesicle membrane model, SIAM J. Sci. Comput. 40 (6) (2018) A3982–A4006. [22] Yuanyuan Liu, Chi-Wang Shu, Mengping Zhang, High order finite difference WENO schemes for nonlinear degenerate parabolic equations, SIAM J. Sci. Comput. 33 (2) (2011) 939–965. [23] Liya Zhornitskaya, Andrea L. Bertozzi, Positivity-preserving numerical schemes for lubrication-type equations, SIAM J. Numer. Anal. 37 (2) (1999) 523–555. [24] C.M. Elliott, A.M. Stuart, The global dynamics of discrete semilinear parabolic equations, SIAM J. Numer. Anal. 30 (6) (1993) 1622–1663. [25] Jie Shen, Jie Xu, Jiang Yang, A new class of efficient and robust energy stable schemes for gradient flows, SIAM Rev. 61 (3) (2019) 474–506. [26] Qing Cheng, Chun Liu, Jie Shen, Generalized SA V approaches for gradient systems, J. Comput. Appl. Math. 394 (2021) 113532. [27] John Charles Butcher, Numerical Methods for Ordinary Differential Equations, John Wiley & Sons, 2016. [28] Jean-Luc Guermond, Peter Minev, Jie Shen, An overview of projection methods for incompressible flows, Comput. Methods Appl. Mech. Engrg. 195 (44–47) (2006) 6011–6045. [29] Jie Shen, Tao Tang, Li-Lian Wang, Spectral Methods: Algorithms, Analysis and Applications, V ol. 41, Springer Science & Business Media, 2011. [30] Samuel M. Allen, John W. Cahn, A microscopic theory for antiphase boundary motion and its application to antiphase domain coarsening, Acta Metall. 27 (6) (1979) 1085–1095. [31] Roger Temam, Infinite-Dimensional Dynamical Systems in Mechanics and Physics, V ol. 68, Springer Science & Business Media, 2012. [32] Dongdong He, Kejia Pan, Xiaoqiang Yue, A positivity preserving and free energy dissipative difference scheme for the Poisson–Nernst–Planck system, J. Sci. Comput. 81 (1) (2019) 436–458. [33] Andrea L. Bertozzi, Mary Pugh, The lubrication approximation for thin viscous films: Regularity and long-time behavior of weak solutions, Comm. Pure Appl. Math. 49 (2) (1996) 85–123. [34] Héctor Gómez, Victor M. Calo, Yuri Bazilevs, Thomas J.R. Hughes, Isogeometric analysis of the Cahn–Hilliard phase-field model, Comput. Methods Appl. Mech. Engrg. 197 (49–50) (2008) 4333–4352. 25

采集于

查看校方原文 ↗