1 Introduction

High-precision observational data have confirmed evidence that the universe is undergoing a phase of accelerated expansion [1, 2] which may be due to dark energy that is gravitationally self-repulsive. Quintessence, a time-evolving, spatially inhomogeneous component with negative pressure is a possible candidate [3, 4] for dark energy, which is characterized by the equation of state \(P=\omega \rho \), where P is the pressure, \(\rho \) is the energy density, and \(-1< \omega < -1/3\). It is an exotic kind of field present everywhere in the universe that exerts force so that particles move away from each other by overpowering gravity and the other fundamental forces. The fact that dark energy constitutes 70% of the universe and black holes are part of our universe, makes the study of black holes surrounded by dark energy important. A spherical symmetric solution to the Einstein equations surrounded by quintessence matter was first obtained by Kiselev [5]; this solution includes the black hole, charged or not, in flat or de Sitter space.

Thereafter, significant attention has been devoted to a discussion of static spherically symmetric black hole solutions surrounded by quintessence matter and their properties [5,6,7,8,9,10]. Also, several extensions of the Kiselev solutions [5] have been obtained. These include models for a charged black hole [11], the Nariai solution [12, 13] and extensions to higher dimensions [14]. These black hole solutions are possible only under special choice of parameter in the energy momentum tensor of quintessence, depending on the state parameter \(\omega \). The black hole thermodynamics for the quintessence corrected black hole solutions were discussed in [15,16,17,18,19] and the quasinormal modes of such solutions have been obtained [20,21,22,23]. Owing to the quintessence surrounding the black hole, the thermodynamic quantities have also been corrected except for the black hole entropy, and it is shown that a phase transition is achievable. Ghosh [24] and Toshmatov et al. [25] further generalized the Kiselev solution to include the axially symmetric case, i.e., the Kerr-like black hole was also addressed. It was shown that a rotating counterpart of the Kiselev solutions [5] can be identified for quintessence parameter \( \omega =1/3 \), exactly as the Kerr–Newman black hole and as the Kerr black hole according to a choice of the integration constant [24, 25].

The accelerated expansion of the universe has also inspired several modifications of general relativity which aim to explain the cosmic acceleration and reconstruct the entire expansion history. A natural modification of general relativity is the Lovelock gravity, whose Lagrangian consists of the dimensionally extended Euler densities. This was obtained by Lovelock in an attempt to obtain the most general tensor that satisfies properties of the Einstein tensor in higher dimensions [26]. The Lovelock action contains higher order curvature terms and reduces to the Einstein–Hilbert action in four-dimensions, and its second order term is the Gauss–Bonnet invariant. The Lovelock theories have some special characteristics, amongst the larger class of general higher-curvature theories, in having field equations involving not more than second derivatives of the metric. They have also been shown to be free of ghosts when expanding about flat space, evading any problems with unitarity. Exact solutions describing black holes have also been found for these theories [27,28,29,30], and later several generalizations of the Boulware–Desser solution have also been discussed [31,32,33,34,35,36,37]. Recently, the quintessence atmosphere to the Einstein–Gauss–Bonnet black hole has been analyzed by Ghosh et al. [38]. In this analysis the case of no quintessence \(\omega =0\) reduces to the Boulware and Deser [27,28,29] Gauss–Bonnet black hole solution, and for quintessence parameter \(\omega =1/2\) with an appropriate choice of the integration constant it is mathematically similar to the charged Gauss–Bonnet black hole case due to Wiltshire [30]. The spherically symmetric vacuum solutions to Lovelock gravity have been found independently in [39, 43]; also, recent work includes a class of Lovelock black holes with conformal scalar hair [40,41,42]. It is the purpose of this paper to model the possible effect of surrounding quintessence matter on the spherically symmetric black hole solution in Lovelock gravity. In particular, we can explicitly explain how the effect of a background quintessence matter can alter black hole solutions and their thermodynamics.

The paper is organized as follows. In Sect. 2, we begin by reviewing the higher dimensional [14] spherically symmetric black hole surrounded by quintessence matter. We have analyzed the quintessence background of Kiselev [5] to derive the resulting exact Lovelock black holes. The thermodynamic properties of the new derived solutions are explored and we obtain the thermodynamic quantities exactly in Sect. 3. In Sect. 3 a discussion covering the thermodynamical stability of black holes is also presented, and Sect. 4 gives the concluding remarks.

We use units which fix the speed of light and the gravitational constant via \(8\pi G = c = 1\), and use the metric signature (\(-,\;+,\;+,\; \ldots ,\;+\)).

2 D-dimensional black holes surrounded by quintessence

In this section, we review D-dimensional static spherically symmetric black holes surrounded by quintessence matter. The metric for general static spherically symmetric spacetime in D-dimensions can be written as [14]

$$\begin{aligned} \mathrm{d}s^2=-f(r)\mathrm{d}t^2+\frac{1}{f(r)} \mathrm{d}r^2+r^2 \mathrm{d}\Omega ^2_{D-2}, \end{aligned}$$
(1)

where \(d\Omega _{D-2}\) is a line element on a \(D-2\) dimensional hypersurface with constant scalar curvature \(\kappa =1,0\) and \(-1\), respectively for spherical, flat and hyperbolic spaces. For D-dimensional spherically symmetric spacetime, the energy momentum tensor can be written as [14]

$$\begin{aligned} T_t{}^t=\chi (r),~~T_t{}^b=0,~~T_a{}^b=\xi (r)r_ar^b+\eta (r)\delta _a{}^b. \end{aligned}$$
(2)

The isotropic average over the angles in Eq. (2) leads to [5, 14]

$$\begin{aligned} \langle T_a{}^b\rangle =\zeta (r)\delta _a{}^b,~~\zeta (r)=-\frac{1}{D-1}\xi (r)r^2+\eta (r), \end{aligned}$$
(3)

and for quintessence matter we have

$$\begin{aligned} \zeta (r)=-\omega _q\chi (r). \end{aligned}$$
(4)

Then the general expression of the energy momentum tensor for quintessence in D-dimensional spacetime [14] is

$$\begin{aligned} T_t{}^t= & {} \rho _q(r),~~T_a{}^b\nonumber \\= & {} \rho _q(r)\alpha \left\{ -\big [1+(D-1)\eta \big ]\frac{r_ar^b}{r_n r^n}+\eta \delta _a{}^b\right\} . \end{aligned}$$
(5)

Again, if one takes an isotropic average over the angles,

$$\begin{aligned} \langle r_a r^b\rangle =\frac{r_n r^n\delta _a{}^b}{(D-1)}, \end{aligned}$$
(6)

one obtains

$$\begin{aligned} \langle T_a{}^b\rangle =\rho _q \frac{\alpha }{D-1}\delta _a{}^b=-p_q\delta _a{}^b. \end{aligned}$$
(7)

Using the equation of state for quintessence matter [5, 14]

$$\begin{aligned} p_q=\omega _q\rho _q, \end{aligned}$$
(8)

we obtain

$$\begin{aligned} \omega _q=\frac{\alpha }{(D-1)}. \end{aligned}$$
(9)

Clearly for quintessence \(-1<\omega _q<0\) leads to \(-(D-1)<\alpha <0\).

The Einstein field equations, \(G_\nu {}^\mu =T_\nu {}^\mu \), lead to the following equations:

$$\begin{aligned} T_t{}^t= & {} T_r{}^r=-\frac{D-2}{4r^2}\big [f^\prime +(D-3)(f-1)\big ], \end{aligned}$$
(10)
$$\begin{aligned} T_{\theta _1}{}^{\theta _1}= & {} 8\pi T_{\theta _2}{}^{\theta _2}=\cdots 8\pi T_{\theta _{D-2}}{}^{\theta _{D-2}}\nonumber \\= & {} -\frac{1}{4r^2}\big [r^2f^{\prime \prime }+2(D-3)rf^\prime \nonumber \\&+\,\, (D-4)(D-3)(f-1)\big ], \end{aligned}$$
(11)

where we have chosen units \(8\pi G=1\) and assumed that for the black hole \(T_t{}^t=T_r{}^r\). From Eqs. (5) and (10), one obtains

$$\begin{aligned} \eta =-\frac{(D-1)\omega _q+1}{(D-1)(D-2)\omega _q}, \end{aligned}$$
(12)

and the energy momentum tensor takes the form

$$\begin{aligned}&T_t{}^t=T_r{}^r=\rho _q, \end{aligned}$$
(13)
$$\begin{aligned}&T_{\theta _1}{}^{\theta _1}=T_{\theta _2}{}^{\theta _2}=\cdots T_{\theta _{D-2}}{}^{\theta _{D-2}} \nonumber \\&\quad = -\frac{1}{(D-2)}\rho _q\big [(D-1)\omega _q+1\big ]. \end{aligned}$$
(14)

From Eqs. (10), (11), (13) and (14), we get a master differential equation for f : 

$$\begin{aligned}&r^2f^{\prime \prime }+[(D-1)\omega _q+2D-5]rf^\prime \nonumber \\&\quad +(D-3)[(D-1)\omega _q+D-3](f-1)=0. \end{aligned}$$
(15)

Equation (15) admits the solution

$$\begin{aligned} f(r)=1-\frac{\mu }{r^{D-3}}+\frac{b}{r^{(D-1)\omega _q+D-3}}, \end{aligned}$$
(16)

where \(\mu \) and b are normalized factors. From Eqs. (10), (13) and (16) the energy density for quintessence is

$$\begin{aligned} \rho _q=-\frac{\omega _qq(D-1)(D-2)}{2 r^{(D-1)(\omega _q+1)}}, \end{aligned}$$
(17)

where we have chosen b as \(-q\) to be negative for positive energy density. The metric for a spherically symmetric black hole surrounded by quintessence reads [14]

$$\begin{aligned} \mathrm{d}s^2= & {} -\left[ 1-\frac{\mu }{r^{D-3}}-\frac{q}{r^{(D-1)\omega _q+D-3}}\right] \mathrm{d}t^2\nonumber \\&\quad +\left[ 1-\frac{\mu }{r^{D-3}}-\frac{q}{r^{(D-1)\omega _q+D-3}}\right] ^{-1}\mathrm{d}r^2+r^2\mathrm{d}\Omega _{D-2}. \nonumber \\ \end{aligned}$$
(18)

Note that this metric depends not only on the dimension D but also on a quintessence state parameter \(\omega _q\). In the limit \(q\rightarrow 0\), the metric goes to the Schwarzschild–Tangherlini metric in D dimensions [44]

$$\begin{aligned} \mathrm{d}s^2= & {} -\left[ 1-\frac{\mu }{r^{D-3}}\right] \mathrm{d}t^2\nonumber \\&\quad +\left[ 1-\frac{\mu }{r^{D-3}}\right] ^{-1}\mathrm{d}r^2+r^2\mathrm{d}\Omega _{D-2}. \end{aligned}$$
(19)

When \(\omega _q=(D-3)/(D-1)\), the metric in Eq. (18) reduces to the D-dimensional Reissner–Nordström metric with q replaced with \(-Q^2\) [45, 46]:

$$\begin{aligned} \mathrm{d}s^2= & {} -\left[ 1-\frac{\mu }{r^{D-3}}+\frac{Q^2}{r^{2(D-3)}}\right] \mathrm{d}t^2\nonumber \\&\quad +\left[ 1-\frac{\mu }{r^{D-3}}+\frac{Q^2}{r^{2(D-3)}}\right] ^{-1}\mathrm{d}r^2+r^2\mathrm{d}\Omega _{D-2}.\nonumber \\ \end{aligned}$$
(20)

The metric for a black hole in the string cloud given in [35, 47] can be obtained from Eq. (18) with \(q=-a\) and \(\omega _q=-1/(D-1)\) as

$$\begin{aligned} \mathrm{d}s^2= & {} -\left[ 1-\frac{\mu }{r^{D-3}}+\frac{a}{r^{D-4}}\right] \mathrm{d}t^2\nonumber \\&\quad +\left[ 1-\frac{\mu }{r^{D-3}}+\frac{a}{r^{D-4}}\right] ^{-1}\mathrm{d}r^2+r^2\mathrm{d}\Omega _{D-2}, \end{aligned}$$
(21)

where a is a constant from energy momentum tensor of a string cloud.

3 Lovelock back holes surrounded by quintessence matter

Among the higher derivative gravities the Lovelock gravity is very special [43], as the field equations are still second order, and this theory appears as the low energy limit of string theories [48]. We want to model black holes surrounded by quintessence matter in the general Lovelock gravity. The Lovelock gravity consists of Euler densities [26, 35, 43]

$$\begin{aligned} S=S_L+S_M, \end{aligned}$$
(22)

where \(S_M\) is the action for Quintessence matter which is as an alternative to a positive cosmological constant, can realize a fluid with an equation of state with \(\omega > -1\). A general action for quintessence in D-dimensional spacetime is

$$\begin{aligned} S_M =\int \mathrm{d}^D x \sqrt{-g} \left[ - \frac{1}{2} (\nabla \phi )^2 - V(\phi )\right] . \end{aligned}$$
(23)

The theory of the quintessence has been put forward as an alternative to a positive cosmological constant. The simplest way to generate models of quintessence is to adopt a matter system described by a single, real scalar field entering the action with a canonical kinetic term and an exponential potential of the form \(V(\phi ) = c \exp (\gamma \phi )\), with \(c,\gamma >0\). A simple calculation leads to

$$\begin{aligned} \omega _q = -1 + \frac{(D-2)\gamma ^2}{(D-1)2} \end{aligned}$$
(24)

when we choose \(\gamma ^2=2\), one obtains

$$\begin{aligned} \omega _q = - \frac{1}{(D-1)} \end{aligned}$$
(25)

and when \(D=4\), one gets \(\omega _q = - 1/3\). The \(S_L\) in D spacetime dimension reads

$$\begin{aligned} S_L=\frac{1}{2}\int \mathrm{d}x^{D}\sqrt{-g}\mathcal {L}, \end{aligned}$$
(26)

with Lagrangian \(\mathcal {L}\)

$$\begin{aligned} \mathcal {L}=\alpha _0+R+\sum \limits _{s=2}^{[(D-1)/2]}\alpha _{s}\mathcal {L}_s, \end{aligned}$$
(27)

where \(\alpha _s\) is a coupling constant, \(\mathcal {L}_s\) is the Euler density given by

$$\begin{aligned} \mathcal {L}_s=\frac{1}{2^{s}}\delta _{\alpha _{1}\beta _{1}... \alpha _{s}\beta _{s}}^{\mu _{1}\nu _{1}...\mu _{s}\nu _{s}} R^{\alpha _{1}\beta _{1}}{}_{\mu _{1}\nu _{1}}\cdots R^{\alpha _{s}\beta _{s}}{}_{\mu _{s}\nu _{s}}. \end{aligned}$$
(28)

The generalized Kronecker delta function is totally antisymmetric in all indices. The term \([(D-1)/2]\) on the summation means the integral part of \((D-1)/2\). Here \(\mathcal {L}_2\) corresponds to the Gauss–Bonnet term [43]. Varying the action in Eq. (22) with respect to the metric tensor \(g_{\mu \nu }\) we obtain the Lovelock field equations written in terms of generalized Einstein tensor [39, 43]

$$\begin{aligned} G_{\mu \nu }\equiv -\frac{\alpha _0}{2}g_{\mu \nu }+G_{\mu \nu }^{E}+\mathcal {G}_{\mu \nu }=T_{\mu \nu }, \end{aligned}$$
(29)

where

$$\begin{aligned} G_{\mu \nu }=\frac{2}{\sqrt{-g}}\frac{\delta S_L}{\delta g^{\mu \nu }},~~T_{\mu \nu }=-\frac{2}{\sqrt{-g}}\frac{\delta S_M}{\delta g^{\mu \nu }}. \end{aligned}$$
(30)

The model is governed by the energy momentum tensor \(T_{\mu \nu }\) associated with quintessence matter defined in Eq. (13). \(G_{\mu \nu }^{E}\) is the Einstein tensor, i.e.

$$\begin{aligned} G_{\mu \nu }^{E}=R_{\mu \nu }-\frac{1}{2}g_{\mu \nu }R. \end{aligned}$$
(31)

The Riemann–Lovelock curvature tensor \(G_\mu {}^{\nu (s)}\) is given as [35, 43, 49]

$$\begin{aligned} \mathcal {G}_\mu {}^{\nu }=\sum \limits ^{m}_{s=2}\alpha _s\delta _{\mu \alpha _{1}\cdots \alpha _{s}\beta _{1}\cdots \beta _{s}}^{\nu \mu _{1}\cdots \mu _{s}\nu _{1}\cdots \nu _{s}}R^{\alpha _{1}\beta _{1}}{}_{\mu _{1}\nu _{1}}\cdots R^{\alpha _{s}\beta _{s}}{}_{\mu _{s}\nu _{s}}. \end{aligned}$$
(32)

It is observed that the field equations are of second order as the Lovelock gravity is the sum of dimensionally continued Euler densities. The field equations can be conveniently expressed as a polynomial equation [50]. The static spherically symmetric metric is given by Eq. (1) with

$$\begin{aligned} f(r)=\kappa -r^2F(r). \end{aligned}$$
(33)

Here F(r) can determined by solving for the real roots of the following polynomial equation [39, 43]:

$$\begin{aligned} P(F)=\sum \limits ^{m}_{s=0}\tilde{\alpha }_s F^s= \frac{2 M}{(D-2)\Sigma _{D-2}r^{D-1}}+\frac{q}{r^{(D-1)(\omega _q+1)}}, \end{aligned}$$
(34)

where the coefficient \(\tilde{\alpha }_s\) is defined by

$$\begin{aligned} \tilde{\alpha }_0= & {} \frac{\alpha _0}{[(D-1)(D-2)]},~~~\tilde{\alpha }_1=1,\\ \tilde{\alpha }_s= & {} \prod \limits _{i=3}^{2s}(D-i)\alpha _s,~~(s>1). \end{aligned}$$

Equations (13) and (17) have been used, q is appropriately chosen such that \(\omega _q\le 0\) and M is an integration constant considered as the mass of a black hole, and \(\Sigma _{D-2}\) is the volume of a \((D-2)\)-unit sphere

$$\begin{aligned} \Sigma _{D-2}=\frac{2\pi ^{(D-1)/2}}{\Gamma [(D-1)/2]}. \end{aligned}$$
(35)

Thus, Eq. (1), with Eqs. (33) and (34), represents black holes in the Lovelock gravity surrounded by quintessence matter. The solution for \(q=0\) was obtained by Cai [39] and the asymptotic behavior and causal structure of the solution have been analyzed in detail [39]. Here we can also make a detailed analysis for the above black holes surrounded by quintessence matter on its horizon. When \(q=0\) the solution of \(P(F)=0\) is a constant curvature vacua [27, 43]. Again, for \(q=0\), the cases \(F_0<0\) and \(F_0>0\) correspond to, respectively, anti-de Sitter and de Sitter background. In the limit \(q\rightarrow 0\) the solution becomes black hole vacuum solutions in the Lovelock gravity obtained in [39, 43].

Quintessence as one candidate for the dark energy is defined as an ordinary scalar field coupled to gravity. Black holes surrounded by dark energy are believed to play the crucial role in cosmology and one of the important characteristics of a black hole is its thermodynamical properties and also it is interesting to know how does the dark energy affect the thermodynamics of the black holes in the Lovelock gravity. Having found the exact black hole solution, we can turn to a discussion of black hole thermodynamics in analogy with [49], where we treat all dimension couplings as thermodynamic quantities. The black hole thermodynamics also provides insight into quantum properties of the gravitational field., in particular, the thermodynamics of AdS black holes has been of great interest since the pioneering work of Hawking and Page, which demonstrated the existence of a phase transition in AdS black holes [51]. The thermodynamical quantities associated with black holes can be expressed in terms of a horizon radius \(r_h\) which satisfies \(f(r_h)=0\) in Eq. (33), leading to

$$\begin{aligned} r_h^2=\frac{\kappa }{F(r_h)}. \end{aligned}$$
(36)

The mass of the black hole in terms of horizons, by using the Eqs. (34) and (36), reads

$$\begin{aligned} M=\frac{(D-2)\Sigma _{D-2}}{2 }\left[ \sum \limits ^m_{s=0}\frac{\tilde{\alpha }_s\kappa ^s}{r^{-(D-2s-1)}_h}-\frac{q}{r_h^{(D-1)\omega _q}}\right] . \end{aligned}$$
(37)

One can verify that in the limit \(q\rightarrow 0\) it goes to the mass [39, 43]. It can also be seen that when \(\tilde{\alpha }_s\rightarrow 0, (s\ne 1)\) with \(\kappa =1\), it goes to the mass for the D dimensional Schwarzschild–Tangherlini black hole [35]:

$$\begin{aligned} M=\frac{(D-2)\Sigma _{D-2}}{2 }r_h^{D-3}. \end{aligned}$$
(38)

Next we calculate thermodynamic quantities associated with black holes. The Hawking temperature associated with black holes is defined as \(T=K/2\pi \), where K is the surface gravity, which leads to

$$\begin{aligned} T=\frac{f^\prime (r)}{4\pi }, \end{aligned}$$
(39)

which on Eq. (33), reads

$$\begin{aligned} T=\frac{1}{4\pi N(r_h)} \left[ {\sum \limits ^m_{s=0}\frac{\tilde{\alpha }_s\kappa ^{s}(D-2s-1)}{r^{2s+2}_h}+\frac{q\omega _q(D-1)}{r_h^{(D-1)\omega _q+D+1}}}\right] , \end{aligned}$$
(40)

with

$$\begin{aligned} N(r_h)={\sum \limits ^m_{s=1}\frac{\tilde{\alpha }_s s\kappa ^{s-1}}{r^{2s+1}_h}}. \end{aligned}$$

It can be seen that in the limit \(q\rightarrow 0\), it reduces to the Hawking temperature obtained in [39]. Whereas in the limit \(\tilde{\alpha }_1\rightarrow 1\) and \(\tilde{\alpha }_s\rightarrow 0, (s\ne 1)\) with \(\kappa =1\) the temperature reduces to

$$\begin{aligned} T=\frac{1}{4\pi }\left[ \frac{(D-3)}{r_h}+\frac{q\omega _q(D-1)}{r_h^{(D-1)\omega _q+D-2}}\right] . \end{aligned}$$
(41)
Fig. 1
figure 1

he plots show how the heat capacity behaves for different values of \(\omega _q\). We have chosen the parameters as \(\kappa =1\), \(D=7\), \(\tilde{\alpha }_0=-1\) and \(\tilde{\alpha }_1=\tilde{\alpha }_2=\tilde{\alpha }_3=1\). Here we used the parameters for q and \(\omega _q\), \(Q\equiv -(D-1)q\omega _q\) and \(\Omega \equiv (D-1)\omega _q\), respectively. The phase transition point \(r_h=r_c\), where the heat capacity diverges increases as the \(|\omega _q|\) increases

Equation (41) is the Hawking temperature in the D dimensional Schwarzschild–Tangherlini black hole surrounded by quintessence matter [14, 35]. Further, when \(q\rightarrow 0\), it leads to the Hawking temperature for the D dimensional Schwarzschild–Tangherlini black hole. The Lovelock black holes obeys extended first law and Smarr formula provided variations of the Lovelock couplings [49] and shall not be considered here. Since a black hole behaves as a thermodynamic system, the associated quantities should obey the first law which due to background quintessence modifies [14]:

$$\begin{aligned} \mathrm{d}M= T \mathrm{d}S+ \Phi _q \mathrm{d}q \end{aligned}$$
(42)

and for constant q, it is the same as d\(M= T \mathrm{d}S\). Hence the entropy is given by

$$\begin{aligned} S=\int T^{-1}\mathrm{d}M=\int T^{-1}\frac{\mathrm{d}M}{\mathrm{d}r}\mathrm{d}r. \end{aligned}$$
(43)

Inserting Eq. (40) and the derivative of Eq. (37) into the above equation the entropy becomes

$$\begin{aligned} S=2\pi (D-2)\Sigma _{D-2}\sum \limits ^m_{s=1}\frac{\tilde{\alpha }_s\kappa ^{s-1}s}{(D-2s)r_h^{-(D-2s)}}. \end{aligned}$$
(44)

It is interesting to know that the mathematical form of the entropy is the same as the entropy of EGB black holes. The contribution of background quintessence matter is reflected in the term \(r_h\) of the entropy. Equation (44) suggests that in general the Lovelock black hole surrounded by quintessence matter does not obey the area law. However, in the special case \(\kappa =0\) Eq. (44) reduces to

$$\begin{aligned} S=2\pi r^{D-2}_h\Sigma _{D-2}=2\pi A_{D-2}=\frac{A_{D-2}}{4G}, \end{aligned}$$
(45)

where \(A_{D-2}=r^{D-2}_h\Sigma _{D-2}\) is a horizon area of a D-dimensional black hole and in the last equation we have reinstated \(8\pi G\). Hence we conclude that in spite of higher-curvature terms the entropy of the black holes for \(\kappa =0\) always obeys the area law [39]. For the limit \(D=4\) it becomes a standard area law. The phase transition occurs in a asymptotically AdS hairy Lovelock black holes [41]. Next we discuss the stability of black holes by computing heat capacity and the effect of surrounding quintessence matter. Thermodynamic stability of black holes is directly related to the sign of the heat capacity. The heat capacity is defined as

$$\begin{aligned} C=\frac{\partial \mathrm{d} M}{\partial \mathrm{d} T}=\frac{\partial \mathrm{d} M}{\partial \mathrm{d}r_h}\frac{\partial \mathrm{d}r_h}{\partial \mathrm{d}T}. \end{aligned}$$
(46)

Thus using Eqs. (37) and (40)

$$\begin{aligned} C=2\pi (D-2)\Sigma _{D-2}\frac{c_1c_2^2}{c_3}, \end{aligned}$$
(47)

where

$$\begin{aligned} c_1= & {} \sum \limits ^m_{s=0}(D-2s-1)\frac{\tilde{\alpha }_s\kappa ^{s}}{r^{-(D-2s-2)}_h}+\frac{q\omega _q(D-1)}{r_h^{(D-1)\omega _q+1}},\nonumber \\ c_2= & {} \sum \limits ^m_{s=1}\frac{\tilde{\alpha }_s s\kappa ^{s-1}}{r^{-(D-2s-1)}_h}. \nonumber \\ c_3= & {} c_2\partial _{r_h}c_1-c_1\partial _{r_h}c_2 =\sum \limits ^m_{s,p}(D-2p-1)\nonumber \\&\quad (2s-2p-1)\frac{\tilde{\alpha }_s\tilde{\alpha }_p\kappa ^{s+p-1}s}{r^{-2(D-s-p-2)}_h} \end{aligned}$$
(48)
$$\begin{aligned}&-\sum \limits ^m_{s=1}[(D-1)\omega _q+1\nonumber \\&\quad +\,(D-2s-1)]\frac{q\omega _q(D-1)}{r_h^{(D-1)\omega _q+1}}\frac{\tilde{\alpha }_ss\kappa ^{s-1}}{r^{-(D-2s-2)}_h}, \end{aligned}$$
(49)

One can see that the heat capacity depends on the Lovelock coefficients \(\tilde{\alpha }_s\), the quintessence parameters \(\omega _q\) and q and the spacetime dimension D. It is well known that the sign of the heat capacity is a criterion determining whether a thermodynamic system is stable or not. In other words, the positivity of heat capacity ensures that a thermodynamic system is stable while its negativity implies that a thermodynamic system is unstable. Thus, as black holes are considered as a thermodynamic system, for \(C>0\) black holes are thermodynamically stable whereas for \(C<0\) black holes are thermodynamically unstable. In Eq. (47) the limits \(q\rightarrow 0\), \(\tilde{\alpha }_s\rightarrow 0\) \((s\ne 1)\) and \(\tilde{\alpha }_1\rightarrow 1\) with \(\kappa = 1\) lead to the heat capacity for the Schwarzschild–Tangherlini black hole [35],

$$\begin{aligned} C=-2\pi (D-2)\Sigma _{D-2}r^{D-2}. \end{aligned}$$
(50)

The negative sign in Eq. (50) implies that the Schwarzschild–Tangherlini black hole is thermodynamically unstable [35].

Equation (47) suggests that the heat capacity depends on quintessence, and also spacetime dimensions. In the limit \(q\rightarrow 0\) the heat capacity returns to the vacuum case [39]. In addition, in the limits \(q\rightarrow 0\), \(\tilde{\alpha }_s\rightarrow 0\) \((s\ne 1)\) and \(\tilde{\alpha }_1\rightarrow 1\) with \(\kappa = 1\) it goes to the general relativity case [35]. In order to show the effect of surrounding quintessence on heat capacity we plot them (cf. Figs. 1, 2, and 3). The figures show that heat capacity diverges at the critical radius \(r_c\) (cf. Figs. 1, 2, and 3). Further we know that the heat capacity changes sign around \(r_h=r_c\).

Fig. 2
figure 2

The plots show how the heat capacity behaves for different values of q. We have chosen the parameters as \(\kappa =1\), \(D=7\), \(\tilde{\alpha }_0=-1\) and \(\tilde{\alpha }_1=\tilde{\alpha }_2=\tilde{\alpha }_3=1\). At \(\Omega =-1\) the point \(r_h=r_c\) where the heat capacity diverges decreases as q increases while at \(\Omega =-2\), \(r_c\) increases as q increases. For \(\Omega =-2\) and \(Q=3\) there exist two \(r_c\)s in C

Thus the black hole is thermodynamically stable with positive heat capacity for \(r_h<r_c\) and unstable, otherwise. We find the region where the Lovelock black holes is thermodynamically stable. In particular one finds that heat capacity of the Lovelock black hole can become positive for \(r_h<r_c\) in all dimensions \(D\ge 7\) allowing the Lovelock black holes to achieve thermodynamic stability.

Fig. 3
figure 3

The plots show how the heat capacity changes with different dimensions. We have chosen the parameters as \(\kappa =1\), \(\tilde{\alpha }_0=-1\) and \(\tilde{\alpha }_1=\tilde{\alpha }_2=\tilde{\alpha }_3=1\)

4 Conclusion

Lovelock gravity is one of the most general gravity theories in which the field equations are still second order and it is the natural generalization of general relativity to higher dimensional spacetime. The basic idea is to supplement the Einstein–Hilbert action with the dimensionally continued Euler densities. The Lovelock gravity has several additional interesting properties when compared with general relativity which triggered significant attention especially in finding black hole solutions in these theories. We have obtained an exact spherically symmetric black hole solution surrounded by quintessence matter in general Lovelock gravity thereby generalizing the vacuum solution for these theories. The current evidence for an accelerating early universe can be accommodated theoretically via a reintroduction of Einsteins (positive) cosmological constant, which is equivalent to the introduction of quintessence matter with equation of state \(p=- \rho \). More generally, and for general spacetime dimension D, quintessence with equation of state \(p=\omega _q \rho _q\) also yields a flat accelerating universe provided that \(-1 \le \omega _q \le - 1 /(D-1)\). Despite complications of the geometry and horizon of the black hole, we have found exact expressions for the thermodynamic quantities like the black hole mass, the Hawking temperature, entropy and heat capacity in terms of the horizon. In particular, we demonstrate that these thermodynamical quantities are corrected owing to quintessence term \(q/r^{(D-1)(\omega _q+1)}\) in the solution Eq. (34). Explicit calculation of entropy shows that, in general, the area law does not hold for the Lovelock black hole in Eq. (34). One can understand the large scale structure of interactions containing quantum mechanical properties through thermodynamic quantities of black holes. We confirmed that the entropy does not depend on the surrounding quintessence matter as found in [52]. In general, the phase transition occurs in an AdS black holes. However, with our parameter choice \(\kappa =1\), \(\tilde{\alpha }_0=-1\) and \(\tilde{\alpha }_1=\tilde{\alpha }_2=\tilde{\alpha }_3=1\), we showed that the heat capacity has the phase transition point \(r_c\) in various dimensions, where the heat capacity diverges. For a horizon radius below \(r_c\) the heat capacity is positive, which means that the black hole is thermodynamically stable, and beyond \(r_c\) a thermodynamic unstable region starts, where the heat capacity is negative. Also we found that the phase transition point becomes larger as \(|\omega _q|\) increases. This implies that in the equation of state \(p_q=\omega _q \rho _q\) when the magnitude of the pressure gets closer to that of the energy density, i.e. \(\omega _q\rightarrow -1\), larger horizon radius range of stability is allowed, i.e. the black hole is more likely to be stable. On the other hand, we found that whether \(r_c\) increases or decreases as q increases also depends on \(\omega _q\). But in the particular case, \(\kappa =0\), the area law is restored. In addition, thermodynamically stable black holes always appear with a positive heat capacity in all the dimensions. These thermodynamical properties are different from those in the general relativity. However, they become qualitatively similar to the Gauss–Bonnet black holes. Our result generalized previous approaches to a more general case, and in the limit \(q\rightarrow 0\) this goes to the vacuum case.