1 Introduction

Since the introduction in the 70’s of the biological Keller–Segel model for chemotaxis phenomena [30, 31], it and many related variants have attracted a great deal of interest in the mathematical community. Chemotaxis, a biological process through which organisms (e.g. cells) migrate in response to a chemical stimulus, is modelled by means of nonlinear systems of partial differential equations (PDE). The classical one can be written as follows: find two real valued functions, \(u=u(\textbf{x},t)\) and \(v=v(\textbf{x},t)\), defined in \(\Omega \times [0,T]\) such that:

$$\begin{aligned} \partial _t u&=k_0\Delta u-k_1\nabla \cdot (u\nabla v),&\quad \text {in }\Omega \times (0,T), \end{aligned}$$
(1a)
$$\begin{aligned} \tau \partial _t v&=k_2\Delta v-k_3v+k_4u,&\quad \text {in }\Omega \times (0,T),\end{aligned}$$
(1b)
$$\begin{aligned} \partial _\textbf{n}u&:=\nabla u\cdot \textbf{n}=0,\quad \partial _\textbf{n} v =0,&\qquad \text {on }\partial \Omega \times (0,T),\end{aligned}$$
(1c)
$$\begin{aligned} u(0)&=u_0,\quad v(0)=v_0\text { if }\tau >0,&\text {in }\Omega . \end{aligned}$$
(1d)

Herein \(\Omega \) is a bounded and smooth domain of \({\mathbb {R}}^d\), with \(d\in {\mathbb {N}}\) the spatial dimension, and the parameters are \(k_i>0\) for \(i\in \{0,1,2,3,4\}\). The mathematical formulation of (1) can be interpreted in biological terms as follows: u denotes a certain cell distribution (or population of organisms, in general) at the position \(\textbf{x}\in \Omega \) and time \(t\in [0,T]\), whereas v stands for the concentration of chemoattractant (i.e. a chemical signal towards which cells are induced to migrate). Both cells and chemoattractant experiment some diffusion in the spatial domain.

This auto-diffusion phenomena (experimented by cells and chemoattractant) are designed by the terms \(-k_0\Delta u\) and \(-k_2\Delta v\), while the migration mechanism is modeled by the nonlinear cross-diffusion term \(-k_1\nabla \cdot (u\nabla v)\). This term is the major difficulty for theoretical analysis and also for numerical modelling of system (Eq. 1). Further, the degradation and production of chemoattractant are associated with the terms \(-k_3v\) and \(k_4u\), respectively. Note that the production of chemoattractant by the cells, to which cells are attracted, may eventually result in a chemotactic collapse, a phenomenon in which uncontrolled aggregation for u give rise to blowing up or exploding in finite time. This feature is well known and constitutes one of the outstanding characteristics of classical Keller–Segel model, and also one of its main challenges, specifically for numerical methods. Finally, the coefficient \(\tau \in \{0, 1\}\) is considered to write at the same time the parabolic system when \(\tau =1\), or the parabolic-elliptic for \(\tau =0\).

Regarding the mathematical analysis for the system (1): some results on sufficient conditions to ensure global existence and boundedness of solutions along time can be shown (see e.g. the review of Bellomo et al.  [7] and the references therein). They are based on mass conservation for u and on an energy dissipation law for this model (see Sect. 3). For dimension \(d\ge 2\), these results require the initial density of cells, \(\int _\Omega u_0\), to be bigger than certain threshold. On the other hand, considerable research has been done in the direction of finding cases where chemotactic collapse arise. Among them, it is worth mentioning the first result in this direction, due to Herrero and Velázquez [26], where radially symmetric two-dimensional solutions which finite-time blow up are found. Other authors shed light on more general cases, for instance Horstmann and Wang [27] (non symmetric blow-up solutions) or Winkler [40] (higher dimensional case).

In the last decades, a lot of papers have been published dealing with these kinds of theoretical issues both for the classical model (1) and for other models based on some extensions or generalizations. In general, they start from the Keller–Segel classical equations and modify them with the purpose of avoiding the non-physical blow up of solutions, producing solutions which are closer to the “real chemotaxis” phenomena observed in biology. Models include logistic, non-linear diffusion or production terms, chemo-repulsion effects or coupling with fluid equations [11, 23, 37, 38, 41]. See e.g. [5, 7] for more examples. Thus, it is hoped that understanding the classical Keller–Segel equations may open new insights for dealing in depth with those other chemotaxis models.

On the other hand, taking into account the considerable efforts of the mathematical community in the theoretical analysis of Keller–Segel models, the number of papers dedicated to numerical analysis and simulation of chemotaxis equations is much lower, in relative terms. The main difficulty is the numerical approximation of the cross-diffusion term. Not only for its non-linearity, but due to its convective nature, which makes particularly difficult to deal with using the finite element (FE) method (see, for instance, [9, 20] for more details about this method). This difficulty is specifically significant in steep-gradient regions for v, which are precisely relevant in blow-up settings. Furthermore, preserving the physical properties of the continuous model (mass conservation, positivity and energy dissipation) in the discrete case adds an extra level of complication when it comes to designing a well-suited approximation.

Despite that, many interesting works have been published on numerical simulation of chemotaxis equations using different kinds of approaches. For instance, the work by Saito [35] uses FE with upwind stabilization for the parabolic-elliptic Keller–Segel model [\(\tau =0\) in (1)] showing mass conservation, positivity and error estimates. Also, Gutiérrez-Santacreu and Rodríguez-Galván demonstrate positivity, an energy law and a priori bounds for their FE scheme on acute meshes in [25]. In addition, other sophisticated techniques have been applied to this problem. This is the case of the finite volume (FV) method (we recommend [32] on this topic) which has become a very popular and successful approach as we can observe in papers like [13] by Chertock and Kurganov in which the authors devised positive preserving methods for the parabolic-parabolic formulation [\(\tau =1\) in (1)], with demonstrated high accuracy and robustness, specifically on chemotactic collapse. It might also be pointed out the works of Saad and others, for instance in [29], where a volume finite element scheme for the capture of spatial patterns for a volume-filling chemotaxis is analyzed.

In this sense, it is also worth mentioning the very recent works [6, 12, 28, 36] that show and analyze different techniques to approximate the solution of (1) while achieving mass conservation, positivity and energy-dissipation for a strictly positive initial cell condition. In the paper by Badía et al. [6] a discrete scheme using stabilized FE with a graph-Laplacian operator and a shock detector is proposed. This discretization satisfies, in general, both the mass conservation and positivity properties, and, in the case of acute meshes, it is also energy-dissipative. Otherwise, Huang and Shen develop in [28] a time-discrete approximation, admitting any spatial discretization, that preserves the positivity for the cell distribution u and is energy stable for a modified energy. This latest approach uses a suitable transformation of the solution for the positivity and the scalar auxiliary variable (SAV) technique for the energy stability. Alternatively, Shen and Xu introduced in [36] another general, positive (for the cell distribution u) and energy-dissipative, time-discrete scheme based on the gradient flow structure of the continuous model that admits different kinds of spatial discretization such as FE, spectral methods or even finite-differences. The order of the latest approach and the blow-up phenomenon of the discrete solution, under a CFL condition, is studied in [12] by Chen et al.

Furthermore, discontinuous Galerkin (DG) methods (we refer the reader to [15, 17, 34] for a further insight) aroused the interest of researchers in recent years due to their flexibility for approximating, using standard meshes and computer libraries, different types of PDEs: elliptic, parabolic, hyperbolic. In the chemotaxis context, it is worth mentioning the paper of Epshteyn and Kurganov [19], where the FV scheme given in [13] for the 2D Keller–Segel model (1) is extended to a DG scheme on cartesian meshes, obtaining good approximations even on blow-up regimes. Epshteyn introduced two other related schemes in [18]. In all cases, different discontinuous Interior Penalty (IP) methods and upwinding techniques were considered for defining DG approximations. The schemes are even applied to the simulation of an haptotaxis model of tumor invasion into healthy tissue. Error estimates are shown but no energy property or maximum principle for the schemes is proven. In fact, spurious oscillations and negative values in the solution are reported.

More recent works make further progress in this direction, for instance in [42], where the classical equations (1) are approximated by a positivity-preserving DG method with strong stability preserving (SSP) high order time discretizations. Error order estimates as well as positivity are shown in this work. Finally, in [24, 33], the local discontinuous Galerkin method is applied, showing respectively positivity and energy dissipation.

In this work, we propose a new upwind DG scheme for the Keller–Segel model (1) that preserves the mass-conservation, positivity and energy stability properties of the continuous problem. As in [36], the proposed discretization takes advantage of the gradient flow structure of the model. First, Sect. 2 sets the notation that we are going to consider throughout the paper. In Sect. 3 we discuss the physical properties of the continuous model. Section 4 is the main part of the paper, in which we introduce the upwind DG scheme (8). In particular, in Sect. 4.1, we define the upwind approximation based on the ideas introduced in [1] along with some geometrical considerations for the mesh family \(\mathscr {T}_h\), and we discuss the properties of the scheme in Sect. 4.2. Finally, in Sect. 5, we show several numerical tests in which we reproduce some blow-up results shown in the literature with one steady peak [13], and a peak moving towards the corner of the domain [35], as well as pattern formation results with several peaks, [4, 10, 21, 39]. These numerical experiments endorse the good behaviour of the approximation obtained with the new scheme, which allows us to capture peaks reaching values up to the order of \(10^{7}\). These kinds of numerical results are rare in the literature due to the steep-gradients inherent to such sort of tests.

2 Notation

In this section we introduce the notation used throughout the paper. First, we consider a shape-regular triangular mesh \(\mathscr {T}_h=\{K\}_{K\in \mathscr {T}_h}\) of size h over a bounded polygonal domain \(\Omega \subset \mathbb {R}^d\). Moreover, we note the set of edges or faces of \(\mathscr {T}_h\) by \(\mathscr {E}_h\), which can be split into the interior edges \(\mathscr {E}_h^i\) and the boundary edges \(\mathscr {E}_h^b\). Then, \(\mathscr {E}_h=\mathscr {E}_h^i\cup \mathscr {E}_h^b\).

Now, we fix the following orientation for the unit normal vector \(\textbf{n}_e\) associated to and edge \(e\in \mathscr {E}_h\) of the mesh \(\mathscr {T}_h\):

  • If \(e\in \mathscr {E}_h^i\) is shared by the elements K and L, i.e. \(e=\partial K\cap \partial L\), then \(\textbf{n}_e\) is exterior to K pointing to L (see Fig. 1).

  • If \(e\in \mathscr {E}_h^b\), then \(\textbf{n}_e\) points outwards of the domain \(\Omega \).

Fig. 1
figure 1

Orientation of the unit normal vector \(\textbf{n}_e\)

Moreover, we denote the baricenter of the triangle \(K\in \mathscr {T}_h\) by \(C_K\).

Now, we define the approximation spaces of discontinuous, \(\mathbb {P}^{\text {disc}}_k(\mathscr {T}_h)\), and continuous, \(\mathbb {P}^{\text {cont}}_k(\mathscr {T}_h)\), finite element functions over \(\mathscr {T}_h\) whose restriction to \(K\in \mathscr {T}_h\) are polynomials of degree \(k\ge 0\). In addition, the average \(\left\{ \!\left\{ \cdot \right\} \!\right\} \) and the jump \(\left[ \left[ \cdot \right] \right] \) of a scalar function v on an edge \(e\in \mathscr {E}_h\) are defined as follows:

$$\begin{aligned} \left\{ \!\left\{ v\right\} \!\right\} {:}{=}{\left\{ \begin{array}{ll} \dfrac{v_{K}+v_{L}}{2}&{}\text {if } e\in \mathscr {E}_h^i\\ v_{K}&{}\text {if }e\in \mathscr {E}_h^b \end{array}\right. }, \qquad \left[ \left[ v\right] \right] {:}{=}{\left\{ \begin{array}{ll} v_{K}-v_{L}&{}\text {if } e\in \mathscr {E}_h^i\\ v_{K}&{}\text {if }e\in \mathscr {E}_h^b \end{array}\right. }. \end{aligned}$$

Regarding the time discretization, we take an equispaced partition \(0=t_0<t_1<\cdots <t_N=T\) of the time domain [0, T] with \(\Delta t=t_{m+1}-t_m\) the time step. We denote \(v^m\simeq v(t_m)\) for any function v defined on [0, T] and define the discrete time derivative \(\delta _t v^{m+1}=(v^{m+1}-v^m)/\Delta t\).

Finally we set the following notation for the positive and negative parts of a scalar function v:

$$\begin{aligned} v_\oplus {:}{=}\frac{|v|+v}{2}=\max \{v,0\}, \quad v_\ominus {:}{=}\frac{|v|-v}{2}=-\min \{v,0\}, \quad v=v_\oplus - v_\ominus . \end{aligned}$$

3 Keller–Segel Model

Let us consider the Keller–Segel system (1).

Remark 1

There is a classic solution of the Keller–Segel problem (1) at least local in time which is positive, i.e., \(u, v\ge 0\) in \(\Omega \times (0,T)\) whenever \(u_0\ge 0\) and \(v_0\ge 0\) in \(\Omega \). See, for instance [7, 16].

To the best knowledge of the authors, the existence of global solutions in time is still not clear in the literature.

Assume \(u_0, v_0\ge 0\) in \(\Omega \). The weak formulation of the problem (1) consists of finding \((u,v): [0,T]\times \Omega \rightarrow \mathbb {R}_+\times \mathbb {R}_+\) regular enough, i.e. \(u(t), v(t)\in V\) for a certain regular Sobolev space V (for instance, \(V=W^{1,\infty }(\Omega )\)), with \(\partial _t u(t),\tau \partial _t v(t)\in V'\) a.e. \(t\in (0,T)\), satisfying the following variational problem a.e. \(t\in (0,T)\):

$$\begin{aligned} \langle \partial _t u(t),\overline{u}\rangle&=-k_0\left( \nabla u(t),\nabla \overline{u}\right) +k_1\left( u(t)\nabla v(t),\nabla \overline{u}\right) ,&\forall \overline{u}\in V,\end{aligned}$$
(2a)
$$\begin{aligned} \langle \tau \partial _tv(t),\overline{v}\rangle&=-k_2 \left( \nabla v(t),\nabla \overline{v}\right) -k_3\left( v(t),\overline{v}\right) +k_4\left( u(t),\overline{v}\right) ,&\forall \overline{v}\in V, \end{aligned}$$
(2b)

and the initial conditions \(u(0)=u_0\), \(v(0)=v_0\) in \(\Omega \). Hereafter, \(\left( \cdot ,\cdot \right) \) and \(\langle \cdot ,\cdot \rangle \) denote the scalar product in \(L^2(\Omega )\) and the duality product in \(V'\), respectively.

By taking, formally, the chemical potential of u,

$$\begin{aligned} \mu =k_0\log (u) - k_1 v, \end{aligned}$$
(3)

we can rewrite (2) as a gradient flow system where the flux direction is given by \(-\nabla \mu \) containing the effect of both the diffusion and the chemotaxis terms (see, for instance, [8]). This variational formulation consists of finding \((u,\mu , v): [0,T]\times \Omega \rightarrow \mathbb {R}_+\times \mathbb {R}\times \mathbb {R}_+\) regular enough, i.e. \(u(t), \mu (t), v(t)\in V\) for a certain regular Sobolev space V (for instance, \(V=W^{1,\infty }(\Omega )\)), with \(\partial _t u(t),\tau \partial _t v(t)\in V'\) a.e. \(t\in (0,T)\), satisfying the following variational problem a.e. \(t\in (0,T)\):

$$\begin{aligned} \langle \partial _t u(t),\overline{u}\rangle&=-\left( u(t)\nabla \mu (t),\nabla \overline{u}\right) ,&\forall \overline{u}\in V,\end{aligned}$$
(4a)
$$\begin{aligned} \left( \mu (t),\overline{\mu }\right)&=\left( k_0\log (u(t))-k_1v(t),\overline{\mu }\right) ,&\forall \overline{\mu }\in V,\end{aligned}$$
(4b)
$$\begin{aligned} \langle \tau \partial _tv(t),\overline{v}\rangle&=-k_2 \left( \nabla v(t),\nabla \overline{v}\right) -k_3\left( v(t),\overline{v}\right) +k_4\left( u(t),\overline{v}\right) ,&\forall \overline{v}\in V, \end{aligned}$$
(4c)

and the initial conditions \(u(0)=u_0\), \(v(0)=v_0\) in \(\Omega \).

Remark 2

By taking \(\overline{u}=1\) in (2a) (or (4a)), any solution u conserves the mass, because

$$\begin{aligned} \frac{d}{dt}\int _\Omega u(x,t)dx=0. \end{aligned}$$

Remark 3

By taking (formally) \(\overline{u}=\mu (t)\), \(\overline{\mu }=\partial _t u(t)\) and \(\overline{v}=(k_1/k_4)\partial _t v(t) \) in (4), and adding the resulting expressions, one has that any solution (uv) satisfies the following energy law

$$\begin{aligned} \frac{d }{dt}E(u(t),v(t))&+\tau \frac{k_1}{k_4}\int _\Omega |\partial _t v(t)|^2dx + \int _\Omega u(t)\left| \nabla (\mu (t))\right| ^2 dx =0, \end{aligned}$$
(5)

where \(E:H^1(\Omega )_+\times H^1(\Omega )\longrightarrow \mathbb {R}\) is the energy functional, defined as follows

$$\begin{aligned} E(u,v)&{:}{=}\int _\Omega \left( k_0u\log (u)-k_1uv+\frac{k_1k_2}{2k_4}\vert \nabla v\vert ^2+\frac{k_1k_3}{2k_4}v^2\right) , \end{aligned}$$
(6)

and \(H^1(\Omega )_+=\{u\in H^1(\Omega ):u\ge 0\}\).

4 Fully Discrete Scheme

First, we regularize the chemical potential of u, defined in (3), by

$$\begin{aligned} \mu _\varepsilon =k_0\log (u+\varepsilon )-k_1 v, \end{aligned}$$
(7)

for some \(\varepsilon >0\). Note that \(\varepsilon \) is a regularization parameter since \(\log (u+\varepsilon )\) is regular for all \(u\ge 0\). We will take \(\varepsilon =\varepsilon (h,\Delta t)\) such that \(\varepsilon (h,\Delta t)\rightarrow 0\) if \((h,\Delta t)\rightarrow 0\), being \(h>0\) the mesh size and \(\Delta t>0\) the time step.

Then, we propose the following decoupled fully discrete first order in time and upwind DG in space scheme for the model (1):

Let \(v^{m}\in \mathbb {P}^{\text {cont}}_1(\mathscr {T}_h)\) and \(u^{m}\in \mathbb {P}^{\text {disc}}_0(\mathscr {T}_h)\) such that \(v^m\ge 0\) in the case \(\tau >0\) and \(u^m\ge 0\) be given.

Step 1 Find \(v^{m+1}\in \mathbb {P}^{\text {cont}}_1(\mathscr {T}_h)\) solving

$$\begin{aligned} \tau \left( \delta _tv^{m+1},\overline{v}\right) _h&+k_2\left( \nabla v^{m+1},\nabla \overline{v}\right) +k_3\left( v^{m+1},\overline{v}\right) _h-k_4\left( u^m,\overline{v}\right) =0, \end{aligned}$$
(8a)

for all \(\overline{v}\in \mathbb {P}^{\text {cont}}_1(\mathscr {T}_h)\).

Step 2 Find \((u^{m+1},\mu ^{m+1})\in \mathbb {P}^{\text {disc}}_0(\mathscr {T}_h)\times \mathbb {P}^{\text {disc}}_0(\mathscr {T}_h)\) with \(u^{m+1}\ge 0\) solving the coupled problem

$$\begin{aligned} \left( \delta _tu^{m+1},\overline{u}\right)&+a_h^{\text {upw}}(\mu ^{m+1};u^{m+1},\overline{u})=0,\end{aligned}$$
(8b)
$$\begin{aligned} \left( \mu ^{m+1},\overline{\mu }\right)&-k_0 \left( \log (u^{m+1}+\varepsilon ),\overline{\mu }\right) + k_1\left( v^{m+1},\overline{\mu }\right) =0, \end{aligned}$$
(8c)

for all \(\overline{u},\overline{\mu }\in \mathbb {P}^{\text {disc}}_0(\mathscr {T}_h)\), where \(a_h^{\text {upw}}(\cdot ;\cdot ,\cdot )\) will be defined below in Sect. 4.1.

Notice that Eq. 8a is a linear problem for \(v^{m+1}\) and that (8b)–(8c) is a coupled nonlinear problem for \((u^{m+1},\mu ^{m+1})\). In fact, we are going to use Newton’s method as iterative procedure approximating the scheme (8b)–(8c).

In order to preserve the positivity of \(v^{m+1}\), we have done mass lumping in the terms \(\left( \partial _t v^{m+1},\overline{v}\right) _h\) and \(k_3\left( v^{m+1},\overline{v}\right) _h\) in (8a).

In Sect. 4.2, we will provide a way of computing the solution of (8) enforcing the nonnegativity restriction \(u^{m+1}\ge 0\).

4.1 Definition of Upwind Bilinear form \(a_h^{\text {upw}}(\cdot ;\cdot ,\cdot )\)

Now, we are going to define the upwind bilinear form \(a_h^{\text {upw}}(\cdot ;\cdot ,\cdot )\), introduced in the scheme (8).

In order to achieve the energy stability with the scheme (8), we must consider the following hypothesis that will let us approximate the flux \(-\nabla \mu \) accordingly:

Hypothesis 1

The mesh \(\mathscr {T}_h\) of \(\overline{\Omega }\) is structured in the sense that the line between the baricenters of the triangles K and L is orthogonal to the interface \(e=K\cap L\in \mathscr {E}_h^i\).

Then, we define the following upwind bilinear form to be applied to the flux \(-\nabla \mu \) which may be discontinuous over \(\mathscr {E}_h^i\):

$$\begin{aligned} a_h^{\text {upw}}(\mu ;u,\overline{u}){:}{=}\int _\Omega (\nabla \mu \cdot \nabla \overline{u})u + \sum _{e\in \mathscr {E}_h^i,e=K\cap L}\int _e\left( \left( -\nabla _{\textbf{n}_e}^0\mu \right) _\oplus u_{K}-(-\nabla _{\textbf{n}_e}^0\mu )_\ominus u_{L}\right) \left[ \left[ \overline{u}\right] \right] ,\nonumber \\ \end{aligned}$$
(9)

where for every \(e\in \mathscr {E}_h^i\) with \(e=K\cap L\),

$$\begin{aligned} \nabla _{\textbf{n}_e}^0\mu =\frac{-\left[ \left[ \Pi _0\mu \right] \right] }{\mathscr {D}_e(\mathscr {T}_h)}= \frac{\Pi _0\mu _{L}-\Pi _0\mu _{K}}{\mathscr {D}_e(\mathscr {T}_h)}, \end{aligned}$$
(10)

with \(\Pi _0\) being the projection on \(\mathbb {P}^{\text {disc}}_0(\mathscr {T}_h)\) and \(\mathscr {D}_e(\mathscr {T}_h)\) the distance between the baricenters of the triangles K and L of the mesh \(\mathscr {T}_h\) that share \(e\in \mathscr {E}_h^{\text {i}}\), denoted by \(C_K\) and \(C_L\), respectively. This way, we can rewrite (9) as

$$\begin{aligned} a_h^{\text {upw}}(\mu ;u,\overline{u}){:}{=}&\int _\Omega (\nabla \mu \cdot \nabla \overline{u})u \nonumber \\ {}&+ \sum _{e\in \mathscr {E}_h^i,e=K\cap L}\frac{1}{\mathscr {D}_e(\mathscr {T}_h)}\int _e\left( \left( \left[ \left[ \Pi _0\mu \right] \right] \right) _\oplus u_{K}-(\left[ \left[ \Pi _0\mu \right] \right] )_\ominus u_{L}\right) \left[ \left[ \overline{u}\right] \right] . \end{aligned}$$
(11)

Remark 4

Since the quadrature formula of the baricenter (or centroid) is exact for polynomials of order 1, if \(\mu \in \mathbb {P}^{\text {disc}}_1(\mathscr {T}_h)\), we have that

$$\begin{aligned} \Pi _0\mu |_K=\oint _K\mu =\frac{1}{\vert K\vert }\int _K\mu =\mu (C_K), \end{aligned}$$

where \(C_K\) is the baricenter of \(K\in \mathscr {T}_h\).

Hence, if \(\mu \in \mathbb {P}^{\text {disc}}_1(\mathscr {T}_h)\), the expression (10) is the slope of the line between the points \((C_K, \mu (C_K))\) and \((C_L,\mu (C_L))\), which, under the Hypothesis 1, this line is parallel to the vector \(\textbf{n}_e\), with \(e=K\cap L\in \mathscr {E}_h^i\). This expression is considered as an approximation of the discontinuous numerical normal flux \(\nabla \mu \cdot \textbf{n}_e\) for \(\mu \in \mathbb {P}^{\text {disc}}_1(\mathscr {T}_h)\).

In addition, observe that, since the baricenters are located 1/3 of the median from the side and 2/3 of the median from the vertex of the triangle, the expression (10) does not degenerate when \(h\rightarrow 0\), i.e., \(\mathscr {D}_e(\mathscr {T}_h)>0\) for every \(e\in \mathscr {E}_h^i\) and \(h>0\). A visual representation of the regular polygonal structure given by the lines between the adjacent baricenters is given in Fig. 2.

Fig. 2
figure 2

Polygonal structure between adjacent baricenters

Furthermore, in order to preserve the positivity of the variable v in our fully discrete scheme, we assume the following hypothesis.

Hypothesis 2

The mesh \(\mathscr {T}_h\) is acute, i.e., the angles of the triangles of \(T_h\) are less than or equal to \(\pi /2\).

Fig. 3
figure 3

Representation of \(\mathscr {D}_e(\mathscr {T}_h)\)

We give some examples, the meshes represented in Fig. 3, which satisfy both Hypotheses 1 and 2.

Theorem 1

Given the meshes represented in Fig. 3 we can define \(\mathscr {D}_e(T_h)\) for these meshes as follows

where l is the length of the side of the highlighted squares of the mesh.

Proof

We will only prove the case (a) Mesh 1 since the case (b) Mesh 2 is analogous.

Observe Mesh 1 in Fig. 3. The baricenter of the triangles \(\triangle OAB\), \(\triangle OBC\) and \(\triangle OCD\) are, respectively \(\frac{O+A+B}{3}\), \(\frac{O+B+C}{3}\) and \(\frac{O+C+D}{3}\). Hence, if we denote by \(e_1\) the edge between \(\triangle OAB\) and \(\triangle OBC\) and by \(e_2\) the edge between \(\triangle OBC\) and \(\triangle OCD\), then

$$\begin{aligned} \mathscr {D}_{e_1}(\mathscr {T}_h)=\frac{\vert C-A\vert }{3}=\frac{2l}{3}, \quad \mathscr {D}_{e_2}(\mathscr {T}_h)=\frac{\vert D-B\vert }{3}=\frac{\sqrt{2}l}{3} \end{aligned}$$

Now, since \(l/\vert e_1\vert =1\) and \(l/\vert e_2\vert =1/\sqrt{2}\), we can define \(\mathscr {D}_e(\mathscr {T}_h)\) for any \(e\in \mathscr {E}_h^{\text {i}}\) as

$$\begin{aligned} \mathscr {D}_e(\mathscr {T}_h)=\frac{2l}{3}\cdot \frac{l}{\vert e\vert }=\frac{2l^2}{3\vert e\vert }. \end{aligned}$$
(12)

\(\square \)

4.2 Properties of the Scheme

Finally, we discuss the different properties of the scheme (8) with the upwind bilinear form defined in (9) on meshes under the Hypotheses 1 and 2.

With the purpose of proving the existence of solution of the scheme (8) and providing a way of computing it enforcing the restriction \(u^{m+1}\ge 0\), we define the following auxiliary scheme where a cut-off operator is introduced in (8b):

Step 1 Given \(v^m\in \mathbb {P}^{\text {cont}}_1(\mathscr {T}_h)\) such that \(v^m\ge 0\) in the case \(\tau >0\), find \(v^{m+1}\in \mathbb {P}^{\text {cont}}_1(\mathscr {T}_h)\) solving

$$\begin{aligned} \tau \left( \delta _tv^{m+1},\overline{v}\right) _h&+k_2\left( \nabla v^{m+1},\nabla \overline{v}\right) +k_3\left( v^{m+1},\overline{v}\right) _h-k_4\left( u^m,\overline{v}\right) =0, \end{aligned}$$
(13a)

for all \(\overline{v}\in \mathbb {P}^{\text {cont}}_1(\mathscr {T}_h)\).

Step 2 Given \(u^m, \mu ^m\in \mathbb {P}^{\text {disc}}_0(\mathscr {T}_h)\) such that \(u^m\ge 0\), find \(u^{m+1},\mu ^{m+1}\in \mathbb {P}^{\text {disc}}_0(\mathscr {T}_h)\) solving

$$\begin{aligned} \left( \delta _tu^{m+1},\overline{v}\right)&+a_h^{\text {upw}}(\mu ^{m+1};(u^{m+1})_\oplus ,\overline{u})=0,\end{aligned}$$
(13b)
$$\begin{aligned} \left( \mu ^{m+1},\overline{\mu }\right)&-k_0 \left( \log (u^{m+1}+\varepsilon ),\overline{\mu }\right) + k_1\left( v^{m+1},\overline{\mu }\right) =0, \end{aligned}$$
(13c)

for all \(\overline{u},\overline{\mu }\in \mathbb {P}^{\text {disc}}_0(\mathscr {T}_h)\).

Remark 5

In order to preserve the positivity of the solution \(u^{m+1}\) of (13), we have introduced a truncation of this function taking its positive part \((u^{m+1})_\oplus \) in the upwind part of (13b), which is consistent as the solution of the continuous model (1) satisfies \(u\ge 0\).

Since Theorem 2 below will guarantee that \(u^{m+1}\ge 0\), then \(\left( \log (u^{m+1}+\varepsilon ),\overline{\mu }\right) \) in (13b) is well-defined.

Proposition 1

The schemes (8) and (13) conserve the mass of u:

$$\begin{aligned} \int _\Omega u^{m+1}=\int _\Omega u^m. \end{aligned}$$

Proof

Just need to take \(\overline{u}=1\) in (8b) and (13b). \(\square \)

Theorem 2

(DG (13) preserves positivity)

If we assume that \(u^m\ge 0\) and, in the case \(\tau >0\), \(v^m\ge 0\) in \(\Omega \), then any solution of (13) satisfies that \(u^{m+1}, v^{m+1}\ge 0\) in \(\Omega \).

Proof

Proving that if \(u^m\ge 0\) and \(v^m\ge 0\) (when \(\tau >0\)) then \(v^{m+1}\ge 0\) using that the mesh is acute is a classic result which can be found, for example, in [14, 22].

Moreover, if \(u^m\ge 0\) and \(v^m\ge 0\) (when \(\tau >0\)) it follows from the Eq. (13b) that \(u^{m+1}\ge 0\) using the same arguments that are shown to prove the positivity result in [1] since the proof given in [1] is independent of the flux \(\nabla \mu ^{m+1}\). \(\square \)

Proposition 2

There is a unique solution \(v^{m+1}\) of the linear equation (13a).

Proof

Since we are dealing with a discrete linear problem, existence and unicity of the solution are equivalent. Hence, we just need to assume that there are two solutions of (8a), \(v_1\) and \(v_2\), substract the expressions resulting of evaluating both solutions and test with \(v_1-v_2\) to prove unicity of the solution. \(\square \)

Proposition 3

There is at least one solution of (13b)–(13c).

Proof

Consider the following well-known theorem: \(\square \)

Theorem 3

(Leray–Schauder fixed point theorem) Let \(\mathscr {X}\) be a Banach space and let \(T:\mathscr {X}\longrightarrow \mathscr {X}\) be a continuous and compact operator. If the set

$$\begin{aligned} \{x\in \mathscr {X}:x=\alpha \,T(x)\quad \text {for some } 0\le \alpha \le 1\} \end{aligned}$$

is bounded (uniformly with respect to \(\alpha \)), then T has at least one fixed point.

Given \(u^m\in \mathbb {P}^{\text {disc}}_0(\mathscr {T}_h)\) with \(u^m\ge 0\) and the unique solution \(v^{m+1}\) of (13a), we define the map

$$\begin{aligned} T:\mathbb {P}^{\text {disc}}_0(\mathscr {T}_h)\times \mathbb {P}^{\text {disc}}_0(\mathscr {T}_h)\longrightarrow \mathbb {P}^{\text {disc}}_0(\mathscr {T}_h)\times \mathbb {P}^{\text {disc}}_0(\mathscr {T}_h) \end{aligned}$$

such that \(T({\widehat{u}},\widehat{\mu })=(u,\mu )\in \mathbb {P}^{\text {disc}}_0(\mathscr {T}_h)\times \mathbb {P}^{\text {disc}}_0(\mathscr {T}_h)\) is the unique solution of the linear (and decoupled) problem:

$$\begin{aligned} \frac{1}{\Delta t}\left( u-u^m,\overline{u}\right)&=-a_h^{\text {upw}}(\widehat{\mu };{\widehat{u}}_\oplus ,\overline{u}),&\forall \overline{u}\in \mathbb {P}^{\text {disc}}_0(\mathscr {T}_h),\end{aligned}$$
(14a)
$$\begin{aligned} \left( \mu ,\overline{\mu }\right)&=k_0 \left( \log ((\widehat{u})_\oplus +\varepsilon ),\overline{\mu }\right) - k_1\left( v^{m+1},\overline{\mu }\right) ,&\forall \overline{\mu }\in \mathbb {P}^{\text {disc}}_0(\mathscr {T}_h). \end{aligned}$$
(14b)

To check that T is well defined, it is straightforward to see that the solutions u of (14a) and \(\mu \) of (14b) are unique, which involves their existence as \(\mathbb {P}^{\text {disc}}_0(\mathscr {T}_h)\) is a finite-dimensional space.

Secondly, we will check that T is continuous. Let \(\{{\widehat{u}}_j\}_{j\in \mathbb {N}}, \{\widehat{\mu }_j\}_{j\in \mathbb {N}}\subset \mathbb {P}^{\text {disc}}_0(\mathscr {T}_h)\) be sequences such that \(\lim _{j\rightarrow \infty }{\widehat{u}}_j={\widehat{u}}\) and \(\lim _{j\rightarrow \infty }\widehat{\mu }_j=\widehat{\mu }\). Taking into account that all norms are equivalent in \(\mathbb {P}^{\text {disc}}_0(\mathscr {T}_h)\) since it is a finite-dimensional space, the convergences \({{\widehat{u}}}_j\rightarrow \widehat{u}\) and \(\widehat{\mu }_j\rightarrow \widehat{\mu }\) are equivalent to the elementwise convergences \(({{\widehat{u}}}_j)_K\rightarrow {{\widehat{u}}}_K\) and \((\widehat{\mu }_j)_K\rightarrow \widehat{\mu }_K\) for every \(K\in \mathscr {T}_h\) (this may be seen, for instance, by using the norm \(\left\| \cdot \right\| _{L^\infty (\Omega )}\)). Taking limits when \(j\rightarrow \infty \) in (14) (with \({\widehat{u}}{:}{=}{\widehat{u}}_j\), \(\widehat{\mu }{:}{=}\widehat{\mu }_j\) and \((u,\mu ){:}{=}T(\widehat{u}_j,\widehat{\mu }_j)\)), using the notion of elementwise convergence and the fact that \(\log (({{\widehat{u}}})_\oplus +\varepsilon )\) is continuous, we get that

$$\begin{aligned} \lim _{j\rightarrow \infty } T(\widehat{u}_j,\widehat{\mu }_j)=T({{\widehat{u}}},\widehat{\mu })=T\left( \lim _{j\rightarrow \infty }({{\widehat{u}}}_j,\widehat{\mu }_j)\right) , \end{aligned}$$

hence T is continuous. In addition, T is compact since \(\mathbb {P}^{\text {disc}}_0(\mathscr {T}_h)\) have finite dimension.

Finally, let us prove that the set

$$\begin{aligned} B=\{(u,\mu )\in \mathbb {P}^{\text {disc}}_0(\mathscr {T}_h)\times \mathbb {P}^{\text {disc}}_0(\mathscr {T}_h):(u,\mu )=\alpha T(u,\mu )\text { for some } 0\le \alpha \le 1\} \end{aligned}$$

is bounded (independent of \(\alpha \)). The case \(\alpha =0\) is trivial so we will assume that \(\alpha \in (0,1]\).

If \((u,\mu )\in B\), then \(u\in \mathbb {P}^{\text {disc}}_0(\mathscr {T}_h)\) is the solution of

$$\begin{aligned} \frac{1}{\Delta t}\left( u-\alpha u^m,\overline{u}\right) =-\alpha \,a_h^{\text {upw}}(\mu ;u_\oplus ,\overline{u}),{} & {} \forall \overline{u}\in \mathbb {P}^{\text {disc}}_0(\mathscr {T}_h). \end{aligned}$$
(15)

Now, testing (15) with \({\overline{u}}=1\), we get that

$$\begin{aligned} \int _\Omega u=\alpha \int _\Omega u^m, \end{aligned}$$

and, as \(u^m\ge 0\) and it can be proved that \(u\ge 0\) using the same arguments than in Theorem 2, we get that

$$\begin{aligned} \left\| u\right\| _{L^1(\Omega )}\le \left\| u^m\right\| _{L^1(\Omega )}. \end{aligned}$$

Moreover, since \(u\ge 0\), \(\mu \in \mathbb {P}^{\text {disc}}_0(\mathscr {T}_h)\) is the solution of the equation

$$\begin{aligned} \left( \mu ,\overline{\mu }\right) =\alpha k_0 \left( \log ( u+\varepsilon ),\overline{\mu }\right) - \alpha k_1\left( v^{m+1},\overline{\mu }\right) ,{} & {} \forall \overline{\mu }\in \mathbb {P}^{\text {disc}}_0(\mathscr {T}_h). \end{aligned}$$
(16)

Hence,

$$\begin{aligned} \mu =\alpha k_0 \log ( u+\varepsilon )- \alpha k_1\Pi _0 v^{m+1},{} & {} \text {in } \mathbb {P}^{\text {disc}}_0(\mathscr {T}_h). \end{aligned}$$

Thus, taking into account that u is bounded in \(\mathbb {P}^{\text {disc}}_0(\mathscr {T}_h)\), we conclude that \(\mu \) is bounded in \(\mathbb {P}^{\text {disc}}_0(\mathscr {T}_h)\).

Since \(\mathbb {P}^{\text {disc}}_0(\mathscr {T}_h)\) is a finite-dimensional space where all the norms are equivalent, we have proved that B is bounded.

Finally, we can apply the Leray–Schauder fixed point Theorem 3 to prove the existence of a fixed point of (14a)–(14b) and, consequently, the existence of a solution \((u^{m+1},\mu ^{m+1})\) of (13b)–(13c). \(\square \)

Since every solution of (13) is positive according to Theorem 2, the schemes (13) and (8) are equivalent in the sense that any solution of (13) is solution of (8) and vice versa. Therefore, using Propositions 2 and 3 the following result holds.

Corollary 1

There is at least one solution of the decoupled non-truncated scheme (8). Moreover, \(v^{m+1}\) is unique.

Remark 6

Obtaining the nonnegative solutions of (8) can be enforced by solving the scheme (13) including the cut-off operator (13b). In practice, the same solution was found in our numerical experiments using either the auxiliary truncated scheme (13) or the non-truncated scheme (8) without explicitly imposing the nonnegativity restriction \(u^{m+1}\ge 0\) (see Remark 10).

Remark 7

Showing uniqueness of solution of (8) is not straightforward and it might require using inverse inequalities that would probably involve some kind of restriction on the time step and mesh size, and this is beyond the scope of this work.

Theorem 4

Any solution of the scheme (8) satisfies the following discrete energy law at the time step \(m+1\):

$$\begin{aligned} \delta _t E_\varepsilon (u^{m+1}, v^{m+1}) + \Delta t \frac{k_1 k_3}{2k_4}\int _\Omega (\delta _t v^{m+1})^2+ \Delta t \frac{k_1k_2}{2k_4}\int _\Omega \vert \delta _t \nabla v^{m+1}\vert ^2 \nonumber \\ + \tau \frac{k_1}{k_4} \int _\Omega (\delta _t v^{m+1})^2 +a_h^{\text {upw}}(\mu ^{m+1};u^{m+1},\mu ^{m+1})\le 0, \end{aligned}$$
(17)

where

$$\begin{aligned}&E_\varepsilon (u,v) \nonumber \\&\quad {:}{=}\int _\Omega \left( k_0(u+\varepsilon )\log (u+\varepsilon )-k_1uv+\frac{k_1k_2}{2k_4}\vert \nabla v\vert ^2+\frac{k_1k_3}{2k_4}v^2\right) . \end{aligned}$$
(18)

Proof

Take \(\overline{u}=\mu ^{m+1}\), \(\overline{\mu }=\delta _t u^{m+1}\), \(\overline{v}=(k_1/k_4)\delta _t v^{m+1}\) in (8) and consider the equalities

$$\begin{aligned} \delta _t(u^{m+1}v^{m+1})&=u^m\delta _t(v^{m+1})+\delta _t(u^{m+1}) v^{m+1},\\ \delta _t(v^{m+1})v^{m+1}&=\frac{1}{2}\delta _t(v^{m+1})^2+\frac{\Delta t}{2}(\delta _t v^{m+1})^2. \end{aligned}$$

Then, adding the resulting expressions for (8a) and (8c) and substracting (8b), we obtain

$$\begin{aligned} 0&=a_h^{\text {upw}}(\mu ^{m+1};u^{m+1},\mu ^{m+1})+k_0\int _\Omega \delta _t (u^{m+1})\log (u^{m+1}+\varepsilon )\nonumber \\&\quad -k_1\int _\Omega \delta _t (u^{m+1})v^{m+1} -k_1\int _\Omega u^m\delta _t(v^{m+1})+\frac{k_1}{k_4}\int _\Omega (\delta _t v^{m+1})^2\nonumber \\&\quad +\frac{k_1k_2}{k_4}\int _\Omega \nabla v^{m+1}\cdot \nabla (\delta _t v^{m+1})+\frac{k_1k_3}{k_4}\int _\Omega v^{m+1}\delta _t (v ^{m+1})\nonumber \\&=a_h^{\text {upw}}(\mu ^{m+1};u^{m+1},\mu ^{m+1})+k_0\int _\Omega \delta _t (u^{m+1})\log (u^{m+1}+\varepsilon )\nonumber \\&\quad -k_1\delta _t\int _\Omega u^{m+1}v^{m+1}+\frac{k_1k_2}{2k_4}\delta _t\int _\Omega \vert \nabla v^{m+1}\vert ^2+\frac{\Delta tk_1k_2}{2k_4}\int _\Omega \vert \delta _t \nabla v^{m+1}\vert ^2\nonumber \\&\quad +\frac{k_1k_3}{2k_4}\delta _t\int _\Omega (v^{m+1})^2+\left( \frac{k_1}{k_4}+\frac{\Delta tk_1 k_3}{2k_4}\right) \int _\Omega (\delta _t v^{m+1})^2. \end{aligned}$$
(19)

Now, using that \(\delta _t (u^{m+1}) F'(u^{m+1}) \ge \delta _t (F(u^{m+1}))\) for \(F'(u^{m+1})=\log (u^{m+1}+\varepsilon )\) (owing to the fact that F(u) is convex) we have that

$$\begin{aligned} \delta _t(u^{m+1})\log (u^{m+1}+\varepsilon )\ge \delta _t\left( (u^{m+1}+\varepsilon )\log (u^{m+1}+\varepsilon )\right) -\delta _t(u^{m+1}+\varepsilon ). \end{aligned}$$

Hence, using Proposition 1,

$$\begin{aligned} \int _\Omega \delta _t(u^{m+1})\log (u^{m+1}+\varepsilon )\ge \delta _t\left( \int _\Omega \left( (u^{m+1}+\varepsilon )\log (u^{m+1}+\varepsilon )\right) \right) . \end{aligned}$$
(20)

Thus, taking into account Theorems 19 and 20, we obtain the discrete energy law (17). \(\square \)

Corollary 2

Given a solution of the scheme (8), the upwind bilinear form defined in (9) satisfies

$$\begin{aligned} a_h^{\text {upw}}(\mu ^{m+1};u^{m+1},\mu ^{m+1})\ge 0. \end{aligned}$$

In consequence, the scheme (8) is unconditionally energy stable with respect to the approximated energy \(E_\varepsilon \), that is

$$\begin{aligned} E_\varepsilon (u^{m+1},v^{m+1})\le E_\varepsilon (u^{m},v^{m}). \end{aligned}$$

Proof

Since we know that the discrete energy satisfies (17), it suffices to prove that \(a_h^{\text {upw}}(\mu ^{m+1};u^{m+1},\mu ^{m+1})\ge 0\) to show \(\delta _t E_\varepsilon (u^{m+1},v^{m+1})\le 0\).

Now, take \(\overline{u}=\mu ^{m+1}\) and use the definition (11) of the upwind bilinear form to get the following:

$$\begin{aligned}&a_h^{\text {upw}}(\mu ^{m+1};(u^{m+1})_\oplus ,\mu ^{m+1})\\&\quad =\sum _{e\in \mathscr {E}_h^i,e=K\cap L}\frac{1}{\mathscr {D}_e(\mathscr {T}_h)}\int _e\left( \left( \left[ \left[ \mu ^{m+1}\right] \right] \right) _\oplus u_{K}^{m+1}-(\left[ \left[ \mu ^{m+1}\right] \right] )_\ominus u_{L}^{m+1}\right) \left[ \left[ \mu ^{m+1}\right] \right] \\&\quad =\sum _{e\in \mathscr {E}_h^i,e=K\cap L}\frac{1}{\mathscr {D}_e(\mathscr {T}_h)}\int _e\left( \Big (\left[ \left[ \mu ^{m+1}\right] \right] \Big )_\oplus ^2u_{K}^{m+1}+\Big (\left[ \left[ \mu ^{m+1}\right] \right] \Big )_\ominus ^2u_{L}^{m+1}\right) \ge 0. \end{aligned}$$

\(\square \)

Remark 8

Notice that the energy stability of the scheme (8) is obtained thanks to the approximation of the flux \(-\nabla \mu \) made in the upwind bilinear form \(a_h^{\text {upw}}(\cdot ;\cdot ,\cdot )\). In addition, the approximation \(-\nabla _{\textbf{n}_e}^0\mu \) on the edges \(e\in \mathscr {E}_h^{\text{ i }}\) requires the assumption of the Hypothesis 1 for the mesh \(\mathscr {T}_h\) as discussed in the Remark 4.

5 Numerical Experiments

In this section we show some numerical tests whose results are according to the results shown above for the scheme (8). For these tests we consider the parameters \(k_i=1\) for \(i\in \{0,1,\ldots ,4\}\), \(\tau =1\), \(\varepsilon =10^{-10}\) and the domain \(\Omega =[-1/2,1/2]\times [-1/2,1/2]\) unless otherwise specified. Also, the mesh 1 in Fig. 3 is used to discretize the domain.

In the test 5.1 we reproduce the first numerical experiment shown in the paper [13] by A. Chertock and A. Kurganov. In this paper, they use a scheme that preserves the positivity of both variables u and v, although they do not show any energy related result. Hence, in our case, we can improve the results shown in the aforementioned paper assuring that our scheme preserves the energy law of the continuous Keller–Segel model.

Then, in the test 5.2 we simulate the qualitative behaviour of the solution in the numerical experiment made by N. Saito in [35]. However, since the initial conditions used for the experiment in [35] are not specified we cannot reproduce the exact same test shown in this paper. In the case of our numerical test, the qualitative behaviour of the solution is similar to the one in [35] until the mesh is refined enough so that we capture the blow-up phenomenon.

Finally, in the test Sect. 5.3 we reproduce the qualitative behaviour of the results in [4, 10, 39] for different variations of chemotaxis equations and in [21] for the Keller–Segel equations, where pattern formations with multiple peaks are shown.

Remark 9

The scheme (8) preserves the positivity and conserves the mass of \(u^{m+1}\) which implies \(u^{m+1}\in L^1(\Omega )\). Therefore, we cannot expect an actual blow-up in the discrete case as it occurs in the continuous model. However, we observe in the numerical tests how the mass accumulates in some elements of \(\mathscr {T}_h\) leading to the formation of peaks.

In fact, we are able to capture peaks that reach values up to the order of \(10^{7}\) using the approximation shown in (8). These kinds of numerical results are not usual in the literature due to the difficulties when approximating the steep gradients that this process involved.

The numerical results shown in this paper have been obtained using the Python library FEniCS [3]. In order to improve the efficiency of the code, these have been run in parallel using several CPUs.

For the sake of a better visualization of the results, a \(\mathbb {P}^{\text {cont}}_1\)-projection of u is represented in 3D using Paraview [2].

Remark 10

All the tests were carried out using both the non-truncated equation (8b) without the restriction \(u^{m+1}\ge 0\) and the truncated version (13b) to enforce the nonnegativity. The approximations of u and v obtained in every case using both versions of the scheme were identical in all the degrees of freedom.

5.1 One Bulge of Cells

First, we reproduce the results shown in [13]. For this purpose, we consider the radially symmetric initial conditions

$$\begin{aligned} u_0 = 1000 e^{-100 (x^2 + y^2)}, \quad v_0 = 500e^{-50 (x^2 + y^2)}, \end{aligned}$$

which are plotted in Fig. 4.

Fig. 4
figure 4

Initial conditions for blow-up as in [13] (different scales are used for u and v)

As stated in [13], the u and v components of the solution are expected to blow up in a finite time due to the initial conditions chosen. The result of the test using the scheme (8) with \(h\approx 1.41\times 10^{-3}\) and \(\Delta t=10^{-6}\) is shown in Figs. 5 and 6. In fact, we observe a blow-up phenomenon for a certain finite time in the range conjectured by A. Chertock and A. Kurganov in [13], \(t^*\in (4.4\times 10^{-5},10^{-4})\), as our discrete approximation reaches values of order \(10^6\) in this time interval.

Fig. 5
figure 5

Blow-up of u as in [13]

Fig. 6
figure 6

Aggregation of v in the test in [13]

Moreover, the positivity is preserved for both u and v as stated in Theorem 2 and, unlike the scheme presented in [13], we are certain that the discrete energy decreases (both for \(E(\cdot , \cdot )\) and \(E(\cdot , \cdot )\)) using the scheme (8) as proved in Theorem 4. See Figs. 7 and 8.

Remark 11

This test have been computed with greater and lower values of \(\varepsilon \) including the limiting case \(\varepsilon =0\). The difference in norms \(L^2\) and \(L^\infty \) are shown in Table 1. From a qualitative point of view, the solutions are indistinguishable.

In this case, the numerical approximation works with \(\varepsilon =0\) since the minimum of u remains strictly positive and does not tend to 0, it takes values around \(10^{-19}\) during all the iterations computed. Below, in Remark 12, we show a different test where we do have to take \(\varepsilon >0\) to ensure convergence of the scheme.

An accuracy test in space (with \(\varepsilon =10^{-10}\)) has been also carried out where the solution obtained with \(h\approx 7.071\times 10^{-4}\) and \(\Delta t=10^{-6}\) has been taken as reference solution. The results shown in Tables 2 and 3 suggest first order of convergence in space in norm \(L^2\) both for u and v.

It is remarkable to notice that, although the \(L^2\) errors of the approximation of u may seem huge at first, particularly as it approaches the blow-up time, they are not that big in relative terms. As it can be observed in Fig. 5, the maximum value reached by u is around \(10^3\) bigger than the \(L^2\) errors shown in Table 2 at each time step. These errors will tend to vanish as the mesh is refined so that the spiky bulge in the middle of the domain is more accurately approximated.

Also, we would like to emphasize the difficulty of achieving such results as obtaining a reference solution in a blow-up situation where the exact solution tends to degenerate and huge gradients appear require a significant computational effort. In this regard, the reference solution has been computed in parallel using a domain decomposition technique.

Fig. 7
figure 7

Minimum and maximum of u and v over time in the case shown in [13]

Fig. 8
figure 8

Discrete energy over time in the case shown in [13]

5.2 Three Bulges of Cells

Now, we show the results for a similar test to the one that appears in [35]. In this case, we take the parabolic-elliptic case (\(\tau =0\)) so that the characteristic speed of v is much faster than the characteristic speed of u. Moreover, we consider the initial condition

$$\begin{aligned} u_0 = 900 e^{-100((x-0.2)^2 + y^2)} + 800 e^{-100(x^2 + (y-0.2)^2)} + 1000 e^{-100 ((x-0.3)^2 + (y-0.3)^2)}, \end{aligned}$$

which is plotted in Fig. 9. As stated in [35] and the references therein, since \(\left\| u_0\right\| _{L^1(\Omega )}>8\pi \), the solution is expected to blow-up in finite time.

Table 1 Difference between approximations of the test in Sect. 5.1 at \(t=5\times 10^{-5}\) with respect to the solution with \(\varepsilon =0\)
Table 2 Accuracy test in norm \(L^2\) for u (test in Sect. 5.1)
Table 3 Accuracy test in norm \(L^2\) for v (test in Sect. 5.1)
Fig. 9
figure 9

Initial condition with three cell bulges (similar to the one in [13])

In Figs. 10 and 11 we can observe the result of the test with \(h\approx 2.83\times 10^{-2}\) and \(\Delta t=10^{-5}\). In this case, the qualitative behavior of the solution is similar to the one shown in [35], with the peak of cells moving towards a corner of the domain. However, the qualitative behavior of the solution is different if we take \(h\approx 7.07\times 10^{-3}\) and \(\Delta t=10^{-5}\). Now, as represented in Figs. 12 and 13, a blow-up phenomenon seems to occur in finite time and the peak of cells remains motionless far away from the corners of the domain.

Fig. 10
figure 10

Aggregation of three cell bulges with \(h\approx 2.83\times 10^{-2}\)

Fig. 11
figure 11

Chemoattractant in the case of three cell bulges with \(h\approx 2.83\times 10^{-2}\)

Fig. 12
figure 12

Aggregation of three cell bulges with \(h\approx 7.07\times 10^{-3}\)

Fig. 13
figure 13

Chemoattractant in the case of three cell bulges with \(h\approx 7.07\times 10^{-3}\)

In both cases, the positivity is preserved and the energy decreases in the discrete case. See Figs. 14 and 16 (left) for the case \(h\approx 2.83\times 10^{-2}\) and Figs. 15 and 16 (right) for the case \(h\approx 7.07\times 10^{-3}\).

Fig. 14
figure 14

Minimum and maximum of u and v in the case of aggregation of three cell bulges with \(h\approx 2.83\times 10^{-2}\)

Fig. 15
figure 15

Minimum and maximum of u and v in the case of aggregation of three cell bulges with \(h\approx 7.07\times 10^{-3}\)

Fig. 16
figure 16

Discrete energy over time in the case of aggregation of three cell bulges. On the left, \(h\approx 2.83\times 10^{-2}\). On the right, \(h\approx 7.07\times 10^{-3}\)

5.3 Pattern Formation with Multiple Peaks

Finally, we show the results for a test in which we obtain a numerical solution describing a pattern with multiple peaks as it occurs, for instance, in the cases that appear in [4, 10, 39] for different variations of chemotaxis equations and in [21] for the Keller–Segel equations. For this purpose, we consider the initial conditions

$$\begin{aligned} u_0 = 1000 (\cos (2\pi x)\cos (2\pi y) + 1), \quad v_0 = 500 (\sin (3\pi x)\sin (3\pi y) + 1), \end{aligned}$$

which are plotted in Fig. 17.

Fig. 17
figure 17

Initial conditions for the pattern formation with multiple peaks (different scales are used for u and v)

In Figs. 18 and 19 we can observe the result of the test with \(h\approx 3.54\times 10^{-3}\) and \(\Delta t=10^{-7}\). Notice that we obtain 8 peaks of cells that reach very high values (up to values of order \(10^{7}\)), which may be due to a blow-up phenomenon occurring at a certain finite time \(t^*\) close to \(10^{-4}\).

Fig. 18
figure 18

Pattern formation of u with multiple peaks

Fig. 19
figure 19

Pattern formation of v with multiple peaks

Again, the positivity is preserved as shown in Fig. 20 and the energy decreases in the discrete case as in Fig. 21.

Fig. 20
figure 20

Minimum and maximum of u and v in the case of multiple peaks

Fig. 21
figure 21

Discrete energy over time in the case of multiple peaks

Table 4 Difference between approximations of the test in Sect. 5.3 (\(h\approx 2.828\times 10^{-2}\), \(\Delta t=2.5\times 10^{-6}\)) with respect to the solution with \(\varepsilon =0\)

Remark 12

This test was also computed with \(h\approx 2.828\times 10^{-2}\), \(\Delta t=2.5\times 10^{-6}\) and values of \(\varepsilon \) lower than \(10^{-10}\). In this case, the minimum value of u tends to 0 (see Fig. 20), hence (8) is not well suited for too small values of \(\varepsilon \) and the convergence of Newton’s method (or other iterative methods) to approximate the solution of the nonlinear schemes is not guaranteed as \(\lim _{u\rightarrow 0}\log (u)=\infty \). Therefore, regularizing the chemical potential of u eases the convergence of the numerical method while only introducing a small error as shown by the results in Table 4.

In this table, the difference in \(L^2\) and \(L^\infty \) norms between the approximation with \(\varepsilon =0\) and the approximations with greater values of \(\varepsilon \) at \(t=2.5\times 10^{-4}\) and \(t=5.25\times 10^{-4}\) (last time step before Newton’s method stop converging with \(\varepsilon =0\)) are shown. In the range of values for \(\varepsilon \) taken, \(\varepsilon =10^{-12}\) is the lowest value for which Newton’s method converges during the 4000 time iterations computed. The minimum value of u achieved at \(t=0.01\), the last time step computed, with \(\varepsilon =10^{-12}\) is of order \(10^{-167}\). Newton’s method stops converging with \(\varepsilon =10^{-14}\) at \(t=8.275\times 10^{-4}\) and at \(t=5.525\times 10^{-4}\) with \(\varepsilon =10^{-16}\) (same time step than with smaller \(\varepsilon \) values including \(\varepsilon =0\)).