1 Introduction

Explaining the thermodynamic nature of black holes can have a deep impact upon the understanding of quantum gravity. By making a black hole with an ergosphere absorb a particle with negative energy, Penrose noted that energy can be extracted from the black hole [1]. Later, an irreducible quantity, namely the irreducible mass, was found to exist when a black hole absorbs a particle [2,3,4]. Due to the similarity between the irreducible mass and the entropy, Bekenstein proposed that the area of a black hole (or the square of its irreducible mass) corresponds to its entropy [5, 6]. Moreover, the four laws of black hole mechanics were established in [7], which are analogous to the laws of thermodynamics. Without using any complete quantum theory of gravity, the semi-classical approach allows for the computation of the thermodynamic quantities of black holes. Indeed, with the advent of quantum field theory in curved spacetime, Hawking found that black holes possess the temperature [8].

Investigating the thermodynamic properties of black holes has become quite a mature subject over the years. In particular, the study of asymptotically anti-deSitter black holes has become important since the discovery of the AdS/CFT correspondence [9]. Hawking and Page showed that a first-order phase transition occurs between the Schwarzschild AdS black hole and the thermal AdS space [10], which was later understood as a confinement/deconfinement phase transition in the context of the AdS/CFT correspondence [11]. There has been much interest in studying the thermodynamics and phase structure of AdS black holes [12,13,14,15,16]. Recently, the asymptotically AdS black holes have also been studied in the context of the extended phase space thermodynamics, where the cosmological constant is interpreted as a thermodynamic pressure [17, 18]. The PV criticality study and thermodynamics have been explored for various AdS black holes in the extended phase space [19,20,21,22,23,24,25,26], where some intriguing phase behavior, e.g., reentrant phase transitions, tricritical points, was found to be present. Therefore, studying the thermodynamics and phase structure of black holes in both the normal and extended phase spaces is important and interesting.

The weak cosmic censorship conjecture asserts that singularities are always hidden by event horizons in any real physical process from regular initial conditions and cannot be seen by the observers at the future null infinity [1]. To test the validity of the weak cosmic censorship conjecture, Wald attempted to overcharge or overspin an extremal Kerr–Newman black hole by throwing a test particle into the black hole [27]. However, for the particle with sufficient charge or angular momentum to overcharge or overspin the black hole, the black hole can not capture it because of the electromagnetic or centrifugal repulsion force. On the other hand, it was found that near-extremal charged/rotating black holes could be overcharged/overspun by absorbing a particle [28,29,30]. However, subsequent researches showed that the weak cosmic censorship conjecture might be still valid for these black holes with consideration of the backreaction and self-force effects [31,32,33,34,35,36]. Since there is still a lack of the general proof of the weak cosmic censorship conjecture, its validity has been tested in various black holes [37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60]. In particular, the thermodynamics and the weak cosmic censorship conjecture have been considered for a D-dimensional Reissner–Nordstrom (RN)-AdS black via the charged particle absorption in the extended phase space [61]. It showed that the first law of thermodynamics and the weak cosmic censorship conjecture are satisfied while the second law of thermodynamics is violated near extremality. It is noteworthy that the second law of thermodynamics is always valid for a RN-AdS black hole in the normal phase space.

If quantum corrections are considered, nonlinear terms are usually added to the Maxwell Lagrangian, which is an effective model, namely the nonlinear electrodynamics (NLED). In the Einstein-NLED theory, various NLED charged black hole solutions were derived and discussed in a number of papers [62,63,64,65,66,67,68,69,70,71] (for a brief review see [72]). A globally regular NLED black hole solution with nonzero electric charge can be constructed, which requires that the NLED Lagrangian is strongly non-Maxwell in the weak field limit [73, 74]. Specifically, the thermodynamics of NLED black holes has been considered in the literature, e.g., power Maxwell invariant black holes [75, 76], non-linear magnetic-charged dS black holes [77], Born–Infeld AdS black holes [78,79,80,81,82,83,84,85,86,87,88,89,90,91,92], Born–Infeld black holes in a cavity [93]. The general D-dimensional, asymptotically flat or AdS, NLED charged black hole solutions were obtained in [94], where the black holes’ structural and thermodynamic properties were carefully analyzed. In particular, the first law of black hole thermodynamics and the Smarr formula in the normal phase space were given there. However, to the best of our knowledge, the laws of thermodynamics in the extended phase space and the weak cosmic censorship conjecture have not been discussed in the context of a general D-dimensional NLED-AdS black hole.

In this paper, we extend the analysis of [61] (a RN-AdS black hole) to study the thermodynamics and the weak cosmic censorship conjecture for a D-dimensional AdS, NLED charged black hole in the normal and extended phase spaces. Our results are NLED model independent and show that the results of [61] are quite robust against the corrections from NLED. The rest of this paper is organized as follows. In Sect. 2, we derive the Hamilton–Jacobi equation for a particle in curved spacetime and discuss its motion around the black hole horizon. In Sect. 3, we review the D-dimensional NLED charged AdS black hole solution to lay the ground for studying the thermodynamics of the black hole and the weak cosmic censorship in the following sections. In Sect. 4, the thermodynamics of the black hole are discussed in the normal and extended phase spaces. We test the weak cosmic censorship conjecture in Sect. 5. We summarize our results in Sect. 6. For simplicity, we set \(G=\hbar =c=k_{B}=1\) in this paper.

2 Hamilton–Jacobi equation

In [95], we have already derived the Hamilton–Jacobi equations for a scalar particle and a fermion in a curved spacetime background under an electric potential \(A_{\mu }\) and showed that these Hamilton–Jacobi equations have the same form. Here, we first briefly review the derivation of the Hamilton–Jacobi equation. After the Hamilton–Jacobi equation is obtained, the motion of the particle near the horizon of a charged black hole is discussed. In this section, we temporarily restore \(\hbar \) to keep the track of the leading term of the WKB expansion.

2.1 Scalar particle

In a semiclassical approximation, the Hamilton–Jacobi equation for a scalar particle is the lowest order of the WKB expansion of the corresponding Klein–Gordon equation. In curved spacetime, for a scalar particle of mass m and charge q, the Klein–Gordon equation is

$$\begin{aligned} \left( \nabla ^{\mu }-\frac{iqA^{\mu }}{\hbar }\right) \left( \nabla _{\mu }-\frac{iqA_{\mu }}{\hbar }\right) \phi +\frac{m^{2}}{\hbar ^{2}}\phi =0, \end{aligned}$$
(1)

where \(\nabla _{\mu }\) is the covariant derivative, and \(A_{\mu \text { }}\)is the electromagnetic potential. Assuming the WKB ansatz for \(\phi \):

$$\begin{aligned} \phi =A\exp \left( \frac{iI}{\hbar }\right) , \end{aligned}$$
(2)

where A is a slowly varying amplitude, one can expand Eq. (1) in powers of \(\hbar \) and finds that the lowest order term is

$$\begin{aligned} \left( \partial ^{\mu }I-qA^{\mu }\right) \left( \partial _{\mu }I-qA_{\mu }\right) =m^{2}. \end{aligned}$$
(3)

which is the Hamilton–Jacobi equation.

2.2 Fermion

In curved spacetime, the Dirac equation for a spin-1 / 2 fermion of the mass m and the charge q takes on the form as

$$\begin{aligned} i\gamma _{\mu }\left( \partial ^{\mu }+\Omega ^{\mu }-\frac{iqA^{\mu }}{\hbar }\right) \psi -\frac{m}{\hbar }\psi =0, \end{aligned}$$
(4)

where \(\Omega _{\mu }\equiv \frac{i}{2}\omega _{\mu }^{\text { }ab}\Sigma _{ab}\), \(\Sigma _{ab}\) is the Lorentz spinor generator, \(\omega _{\mu }^{\text { }ab}\) is the spin connection and \(\left\{ \gamma _{\mu },\gamma _{\nu }\right\} =2g_{\mu \nu }\). The Greek indices are raised and lowered by the curved metric \(g_{\mu \nu }\), while the Latin indices are governed by the flat metric \(\eta _{ab}\). To obtain the Hamilton–Jacobi equation for the fermion, the WKB ansatz for \(\psi \) is assumed as

$$\begin{aligned} \psi =\exp \left( \frac{iI}{\hbar }\right) v, \end{aligned}$$
(5)

where v is a slowly varying spinor amplitude. Substituting Eq. (5) into Eq. (4), we find that the lowest order term of \(\hbar \) is

$$\begin{aligned} \gamma _{\mu }\left( \partial ^{\mu }I-qA^{\mu }\right) v=-mv, \end{aligned}$$
(6)

which is the Hamilton–Jacobi equation for the fermion. Multiplying both sides of Eq. (6) from the left by \(\gamma _{\nu }\left( \partial ^{\nu }I+eA^{v}\right) \) and then using Eq. (6) to simplify the RHS, one obtains

$$\begin{aligned} \gamma _{\nu }\left( \partial ^{\nu }I-qA^{\nu }\right) \gamma _{\mu }\left( \partial ^{\mu }I-qA^{\mu }\right) v=m^{2}v. \end{aligned}$$
(7)

Using \(\left\{ \gamma _{\mu },\gamma _{\nu }\right\} =2g_{\mu \nu }\), we have

$$\begin{aligned} \left[ \left( \partial ^{\mu }I-qA^{\mu }\right) \left( \partial _{\mu }I-qA_{\mu }\right) -m^{2}\right] v=0. \end{aligned}$$
(8)

Since v is nonzero, the Hamilton–Jacobi equation reduces to

$$\begin{aligned} \left( \partial ^{\mu }I-qA^{\mu }\right) \left( \partial _{\mu }I-qA_{\mu }\right) =m^{2}, \end{aligned}$$
(9)

which is the same as the Hamilton–Jacobi equation for a scalar.

2.3 Motion near black hole horizon

To include a broader class, we consider a D-dimensional static black hole with the line element

$$\begin{aligned} ds^{2}=-f\left( r\right) dt^{2}+\frac{1}{f\left( r\right) }dr^{2}+C\left( r^{2}\right) h_{ab}\left( x\right) dx^{a}dx^{b}, \end{aligned}$$
(10)

where a, \(b=1,\ldots D-2\). We also assume that there is a presence of electromagnetic potential \(A_{\mu }\) with the following ansatz

$$\begin{aligned} A_{\mu }=A_{t}\left( r\right) \delta _{\mu t}, \end{aligned}$$
(11)

which means that the black hole is electrically charged. Suppose that the outermost horizon of the black hole is at \(r=r_{+}\), which gives that \(f\left( r_{+}\right) =0\) and \(f\left( r\right) >0\) for \(r>r_{+}\).

In the metric (10), the Hamilton–Jacobi equation (3) reduces to

$$\begin{aligned} -\frac{\left( \partial _{t}I-qA_{t}\right) ^{2}}{f\left( r\right) }+f\left( r\right) \left( \partial _{r}I\right) ^{2}+\frac{h^{ab}\left( x\right) \partial _{a}I\partial _{b}I}{C\left( r^{2}\right) }=m^{2}, \end{aligned}$$
(12)

where \(h^{ab}h_{bc}=\delta _{c}^{a}\). Since I is the classical action, \(E=-\partial _{t}I\) is the conserved energy of the particle. To solve the Hamilton–Jacobi equation, we can employ the following ansatz

$$\begin{aligned} I=-Et+W\left( r\right) +\Theta \left( x\right) . \end{aligned}$$
(13)

The method of separation of variables gives the differential equation for \(\Theta \left( x\right) \)

$$\begin{aligned} h^{ab}\left( x\right) \partial _{a}\Theta \left( x\right) \partial _{b} \Theta \left( x\right) =\lambda , \end{aligned}$$
(14)

where \(\lambda \) is a constant. On the other hand, the differential equation for \(W\left( r\right) \) can lead to

$$\begin{aligned} E=-qA_{t}\left( r\right) +\sqrt{f\left( r\right) \left[ m^{2} +\frac{\lambda }{C\left( r^{2}\right) }\right] +\left[ P^{r}\left( r\right) \right] ^{2}}, \nonumber \\ \end{aligned}$$
(15)

where \(P^{r}\left( r\right) \equiv f\left( r\right) \partial _{r}W\left( r\right) \) is the radial momentum of the particle, and we choose the positive sign in front of the square root since the energy of the particle is required to be a positive value [2, 4]. As noted in [96], \(P^{r}\left( r\right) \) is finite and nonzero at \(r=r_{+}\), which accounts for the Hawing radiation modeled as a tunneling process. So very close to the outer horizon at \(r=r_{+}\), Eq. (15) becomes

$$\begin{aligned} E=q\Phi +\left| P^{r}\left( r_{+}\right) \right| , \end{aligned}$$
(16)

where \(\Phi \equiv -A_{t}\left( r_{+}\right) \) is the electric potential of the black hole. Equation (16) relates the energy of the particle to the momentum and the potential energy near \(r=r_{+}\).

3 D-dimensional NLED black hole solution

For general NLED theories, the four and higher-dimensional static and spherically symmetric black hole solutions with an electric field have already been given in [97, 98] and [94], respectively. Here, we review the derivation of the D-dimensional NLED charged black hole solution to introduce the black hole setup for the rest of the paper. Consider a D-dimensional model of gravity coupled to a nonlinear electromagnetic field \(A_{\mu }\) with the action given by

$$\begin{aligned} S_{\text {Bulk}}=\int d^{D}x\sqrt{-g}\left[ \frac{R-2\Lambda }{16\pi } +\frac{{\mathcal {L}}\left( s;a_{i}\right) }{4\pi }\right] , \end{aligned}$$
(17)

where the cosmological constant \(\Lambda =-\frac{\left( D-1\right) \left( D-2\right) }{2l^{2}}\), and l is the AdS radius. In the action (17), we assume that the generic NLED Lagrangian \({\mathcal {L}}\left( s;a_{i}\right) \) is a function of s and the dimensionful parameters \(a_{i}\). The parameters \(a_{i}\) characterize the effects of nonlinearity in the NLED, and s is an independent nontrivial scalar using \(F_{\mu \nu }=\partial _{\mu }A_{\nu }-\partial _{\nu }A_{\mu }\) and none of its derivatives:

$$\begin{aligned} s=-\frac{1}{4}F^{\mu \nu }F_{\mu \nu }. \end{aligned}$$
(18)

Varying the action (17) with respect to \(g_{\mu \nu }\) and \(A_{\mu }\), we find that the equations of motion are

$$\begin{aligned} R_{\mu \nu }-\frac{1}{2}Rg_{\mu \nu }-\frac{\left( D-1\right) \left( D-2\right) }{2l^{2}}g_{\mu \nu }&=8\pi T_{\mu \nu },\nonumber \\ \nabla _{\mu }G^{\mu \nu }&=0, \end{aligned}$$
(19)

where \(T_{\mu \nu }\) is the energy–momentum tensor:

$$\begin{aligned} T_{\mu \nu }=\frac{1}{4\pi }\left[ g_{\mu \nu }{\mathcal {L}}\left( s;a_{i}\right) +\frac{\partial {\mathcal {L}}\left( s;a_{i}\right) }{\partial s}F_{\mu }^{ \rho }F_{\nu \rho }\right] . \end{aligned}$$
(20)

Here, we define the auxiliary fields \(G^{\mu \nu }\) for later convenience:

$$\begin{aligned} G^{\mu \nu }\equiv -\frac{\partial {\mathcal {L}}\left( s;a_{i}\right) }{\partial F_{\mu \nu }}=\frac{\partial {\mathcal {L}}\left( s;a_{i}\right) }{\partial s}F^{\mu \nu }. \end{aligned}$$
(21)

To construct a charged AdS black hole solution, we take the following ansatz for the metric and the NLED field

$$\begin{aligned} ds^{2}&=-f\left( r\right) dt^{2}+\frac{dr^{2}}{f\left( r\right) }+r^{2}d\Omega _{D-2}^{2},\nonumber \\ A_{\mu }dx^{\mu }&=A_{t}\left( r\right) dt, \end{aligned}$$
(22)

where \(d\Omega _{D-2}^{2}\) is the metric on the unit \(\left( D-2\right) \)-sphere. The equations of motion for tt-component of gravity and \(A_{t}\left( r\right) \) are

$$\begin{aligned}&-\frac{\left( D-2\right) \left( D-3\right) }{2}\frac{f\left( r\right) \left[ -1+f\left( r\right) -\frac{D-1}{D-3}\frac{r^{2}}{l^{2}} +\frac{rf^{\prime }\left( r\right) }{D-3}\right] }{r^{2}} \nonumber \\&\quad =-2f\left( r\right) \left[ {\mathcal {L}}\left( s;a_{i}\right) +A_{t}^{\prime }\left( r\right) G^{rt}\right] , \end{aligned}$$
(23)
$$\begin{aligned}&\left[ r^{D-2}G^{tr}\right] ^{\prime } =0, \end{aligned}$$
(24)

respectively, where

$$\begin{aligned} s=\frac{A_{t}^{\prime 2}\left( r\right) }{2}\text { and }G^{tr}=\frac{\partial {\mathcal {L}}\left( s,a_{i}\right) }{\partial s}A_{t}^{\prime }\left( r\right) . \end{aligned}$$
(25)

It can show that the rest equations of motion can be derived from Eqs. (23) and (24). Solving Eq. (24) gives

$$\begin{aligned} G^{tr}=\frac{{\tilde{Q}}}{r^{D-2}}, \end{aligned}$$
(26)

where \({\tilde{Q}}\) is a constant. From Eqs. (25) and (26), \(A_{t}^{\prime }\left( r\right) \) is determined by

$$\begin{aligned} \frac{\partial {\mathcal {L}}\left( A_{t}^{\prime 2}\left( r\right) /2;a_{i}\right) }{\partial s}A_{t}^{\prime }\left( r\right) =\frac{{\tilde{Q}}}{r^{D-2}}. \end{aligned}$$
(27)

Furthermore, integrating Eq. (23) leads to

$$\begin{aligned} f\left( r\right)= & {} 1-\frac{{\tilde{M}}}{r^{D-3}}+\frac{r^{2}}{l^{2}}-\frac{4}{D-2}\frac{1}{r^{D-3}}\nonumber \\&\times \int _{r}^{\infty }r^{D-2}\left[ {\mathcal {L}}\left( \frac{A_{t}^{\prime 2}\left( r\right) }{2};a_{i}\right) -A_{t}^{\prime }\left( r\right) \frac{{\tilde{Q}}}{r^{D-2}}\right] dr,\nonumber \\ \end{aligned}$$
(28)

where \({\tilde{M}}\) is a constant. For large values of r, one finds that

$$\begin{aligned} f\left( r\right) \approx 1-\frac{{\tilde{M}}}{r^{D-3}}+\frac{r^{2}}{l^{2} }+\frac{2{\tilde{Q}}^{2}}{\left( D-2\right) \left( D-3\right) r^{2\left( D-3\right) }},\nonumber \\ \end{aligned}$$
(29)

which reduces to the metric of a D-dimensional RN-AdS black hole. The Hawking temperature of the black hole is given by

$$\begin{aligned} T=\frac{f^{\prime }\left( r_{+}\right) }{4\pi }. \end{aligned}$$
(30)

At \(r=r_{+}\), Eq. (23) gives

$$\begin{aligned} T= & {} \frac{\left( D-3\right) }{4\pi r_{+}}\left\{ 1+\frac{D-1}{D-3}\frac{r_{+}^{2}}{l^{2}}+\frac{4r_{+}^{2}}{\left( D-2\right) \left( D-3\right) }\right. \nonumber \\&\times \left. \left[ {\mathcal {L}}\left( \frac{A_{t}^{\prime 2}\left( r_{+}\right) }{2};a_{i}\right) -A_{t}^{\prime }\left( r_{+}\right) \frac{{\tilde{Q}}}{r_{+}^{D-2}}\right] \right\} . \end{aligned}$$
(31)

Since the black hole solution (28) is asymptotically AdS, the asymptotic behavior of \(f\left( r\right) \) in Eq. (29) can relate the constant \({\tilde{M}}\) to the black hole mass M [99],

$$\begin{aligned} M=\frac{D-2}{16\pi }\omega _{D-2}{\tilde{M}}, \end{aligned}$$
(32)

with \(\omega _{D-2}\) being the volume of the unit \(\left( D-2\right) \)-sphere:

$$\begin{aligned} \omega _{D-2}=\frac{2\pi ^{\frac{D-1}{2}}}{\Gamma \left( \frac{D-1}{2}\right) }. \end{aligned}$$
(33)

The black hole charge Q can be expressed in terms of the constants \({\tilde{Q}}\). To do so, turning on an external current \(J^{\mu }\) gives an interaction term:

$$\begin{aligned} S_{I}=\int d^{D}x\sqrt{-g}J^{\mu }A_{\mu }. \end{aligned}$$
(34)

The equation of motion for \(A_{\mu }\) then becomes

$$\begin{aligned} \nabla _{\nu }G^{\mu \nu }=4\pi J^{\mu }. \end{aligned}$$
(35)

The charge passing through a spacelike t-constant hypersurface \(\Sigma _{t}\) is given by

$$\begin{aligned} Q=-\int _{\Sigma _{t}}J^{\mu }n_{\mu }d\Sigma , \end{aligned}$$
(36)

where \(n_{\mu }\) is the unit normal vector of \(\Sigma _{t}\), and \(d\Sigma \) is the surface element on \(\Sigma _{t}\). Using Stokes’ theorem, we rewrite Q as an integral over the boundary of \(\Sigma _{t}\), i.e., the \(\left( D-2\right) \)-sphere \(S^{D-2}\) at \(r=\infty \),

$$\begin{aligned} Q=\frac{1}{8\pi }\oint \limits _{S^{D-2}}G^{\mu \nu }dS_{\mu \nu }=\frac{{\tilde{Q}} }{4\pi }\omega _{D-2}, \end{aligned}$$
(37)

where Eqs. (26) and (35) are used, and \(dS_{\mu \nu }\) is the directed surface element on \(S^{D-2}\). The electrical potential measured with respect to the horizon is

$$\begin{aligned} \Phi =\int _{r_{+}}^{\infty }A_{t}^{\prime }\left( r\right) =-A_{t}\left( r_{+}\right) , \end{aligned}$$
(38)

where we fix the field \(A_{t}\left( r\right) \) at \(r=\infty \) to be zero. The electrostatic potential \(\Phi \) plays a role as the conjugated variable to Q in black hole thermodynamics. The entropy of the black hole is one-quarter of the horizon area

$$\begin{aligned} S=\frac{r_{+}^{D-2}\omega _{D-2}}{4}. \end{aligned}$$
(39)

Besides s, there exist other invariants built from \(F_{\mu \nu }\) using the totally antisymmetric Lorentz tensor \(\epsilon ^{\mu _{1}\cdots \mu _{D}}\). For example, in four-dimensional spacetime, one can have another invariant \(p=-\frac{1}{8}\epsilon ^{\mu \nu \rho \sigma }F_{\mu \nu }F_{\rho \sigma }\). The NLED Lagrangian can be a function of s and p. In fact, Born–Infeld electrodynamics is described by the Lagrangian density

$$\begin{aligned} {\mathcal {L}}_{\text {BI}}\left( s,p;a\right) =\frac{1}{a}\left( 1-\sqrt{1-2as-a^{2}p^{2}}\right) , \end{aligned}$$
(40)

where the coupling parameter a is related to the string tension \(\alpha ^{\prime }\) as \(a=\left( 2\pi \alpha ^{\prime }\right) ^{2}\). However, when a black hole ansatz has no magnetic charge, the invariant p always vanishes, and hence \({\mathcal {L}}_{\text {BI}}\left( s,p;a\right) \) and \({\mathcal {L}}_{\text {BI}}\left( s,0;a\right) \) would give the same solution. Therefore, focusing on black hole solutions that are not magnetically charged, our results also apply to the NLED with a more general Lagrangian containing not only s but also other invariants that vanish for zero magnetic charge.

4 Thermodynamics via charged particle absorption

In this section, we investigate thermodynamics of the NLED black hole solution (22) by a charged particle entering the horizon. When the particle is absorbed by the black hole, the mass and charge of the black hole are varied due to the energy and charge conservation. Other thermodynamic variables (e.g., the entropy) would change accordingly. The aim of this section is to check whether the changes of the black hole thermodynamic variables satisfy the first and second law of thermodynamics in the normal and extended phase spaces. To do so, we first present some useful formulae:

$$\begin{aligned} \frac{\partial f\left( r\right) }{\partial r}|_{r=r_{+}}&=4\pi T,\nonumber \\ \frac{\partial f\left( r\right) }{\partial M}|_{r=r_{+}}&=-\frac{16\pi }{\left( D-2\right) \omega _{D-2}r_{+}^{D-3}},\nonumber \\ \frac{\partial f\left( r\right) }{\partial l}|_{r=r+}&=-\frac{2r_{+} ^{2}}{l^{3}}, \nonumber \\ \frac{\partial f\left( r\right) }{\partial Q}|_{r=r_{+}}&=\frac{16\pi \Phi }{\left( D-2\right) \omega _{D-2}r_{+}^{D-3}},\nonumber \\ \frac{\partial f\left( r\right) }{\partial a_{i}}|_{r=r_{+}}&=\frac{16\pi {\mathcal {A}}_{i}}{\left( D-2\right) \omega _{D-2}r_{+}^{D-3} }, \end{aligned}$$
(41)

where \({\mathcal {A}}_{i}\) is defined in Eq. (53), and Eq. (27) are used to obtain \(\partial f\left( r\right) /\partial Q|_{r=r_{+}}\) and \(\partial f\left( r\right) /\partial a|_{r=r_{+}}\).

4.1 Normal phase space

In the normal phase space, the AdS radius l and the parameters \(a_{i}\) are fixed and not treated as thermodynamic variables. So the black hole mass M is the internal energy of the black hole. After the black hole absorbs a charged particle of the energy E and charge q, the state of the black hole changes from \(\left( M,Q\right) \) to \(\left( M+dM,Q+dQ\right) \). The energy and charge conservation of the absorbing process gives

$$\begin{aligned} dM=E\quad \text { and }\quad dQ=q, \end{aligned}$$
(42)

where E and q are related via Eq. (16). To treat the particle as a test particle, we shall assume its energy E and charge q are small compared to those of the black hole,

$$\begin{aligned} q=dQ\ll Q\quad \text { and }\quad E=dM \ll M. \end{aligned}$$
(43)

For the initial state \(\left( M,Q\right) \), the outer horizon radius of the black hole \(r_{+}\) satisfies

$$\begin{aligned} f\left( r_{+};M,Q\right) =0, \end{aligned}$$
(44)

where the parameters M and Q are temporarily put explicitly as arguments of the function \(f\left( r\right) \). When the black hole mass and charge are varied, the outer horizon radius moves to \(r_{+}+dr_{+}\), which also satisfies

$$\begin{aligned} f\left( r_{+}+dr_{+};M+dM,Q+dQ\right) =0. \end{aligned}$$
(45)

So the infinitesimal changes in M, Q and \(r_{+}\) are related by

$$\begin{aligned} \frac{\partial f\left( r\right) }{\partial r}|_{r=r_{+}}dr_{+} +\frac{\partial f\left( r\right) }{\partial M}|_{r=r_{+}}dM+\frac{\partial f\left( r\right) }{\partial Q}|_{r=r_{+}}dQ=0. \end{aligned}$$
(46)

Using Eqs. (16), (39) and (41), we find that the above equation reduces to

$$\begin{aligned} \left| P^{r}\left( r_{+}\right) \right| =TdS. \end{aligned}$$
(47)

Therefore, the variation of entropy is

$$\begin{aligned} dS=\frac{\left| P^{r}\left( r_{+}\right) \right| }{T}>0, \end{aligned}$$
(48)

which means the second law of thermodynamics is always satisfied. Substituting Eq. (47) into Eq. (16), we obtain

$$\begin{aligned} dM=\Phi dQ+TdS, \end{aligned}$$
(49)

which is the first law of thermodynamics. Note that for the D-dimensional NLED charged black hole, the first law of thermodynamics in the normal phase space was already discussed in [94].

4.2 Extended phase space

Comparing with the first law of a usual thermodynamic system, one notes that there is an omission of a pressure volume term PdV in Eq. (49). This observation motivates treating the cosmological constant as pressure associated with a black hole [17, 18]:

$$\begin{aligned} P\equiv -\frac{\Lambda }{8\pi }=\frac{\left( D-1\right) \left( D-2\right) }{16\pi l^{2}}. \end{aligned}$$
(50)

In this case, the mass of the black hole is no longer identified with internal energy, rather it is regarded as a gravitational version of chemical enthalpy. So the conjugate thermodynamic volume of the black hole is given by

$$\begin{aligned} V=\frac{\partial M}{\partial P}. \end{aligned}$$
(51)

Using Eq. (28) for \(f\left( r\right) \) and \(f\left( r_{+}\right) =0\), we find that the thermodynamic volume of the NLED black hole is

$$\begin{aligned} V=\frac{\omega _{D-2}}{D-1}r_{+}^{D-1}. \end{aligned}$$
(52)

To satisfy the Smarr relation, we need to further enlarge the phase space by promoting any dimensionful parameter in the theory to a thermodynamic variable [19, 100], which introduce the associated conjugate. The parameters and their conjugates add extra terms in the first law of thermodynamics. In particular, the parameter \(a_{i}\) in the NLED theory (17) is considered as a thermodynamic phase space variable, and the associated conjugates \({\mathcal {A}}_{i}\) is

$$\begin{aligned} {\mathcal {A}}_{i}=\frac{\partial M}{\partial a_{i}}=-\frac{\omega _{D-2}}{4\pi }\int _{r_{+}}^{\infty }r^{D-2}\frac{\partial {\mathcal {L}}\left( s;a_{i}\right) }{\partial a_{i}}dr. \end{aligned}$$
(53)

In [26], we showed that a complete Smarr relation is satisfied by all thermodynamic quantities in the extended phase space,

$$\begin{aligned} M=2\left( TS-VP\right) +\sum \nolimits _{i}c_{i}a_{i}{\mathcal {A}}_{i} +Q\Phi , \end{aligned}$$
(54)

where \(\left[ a_{i}\right] =L^{c_{i}}\).

After a charged particle of the energy E and charge q enters the black hole horizon, the internal energy and charge of the black hole are changed by

$$\begin{aligned} d\left( M-PV\right) =E\quad \text { and }\quad dQ=q, \end{aligned}$$
(55)

where \(M-PV\) is the black hole internal energy in the extended phase space. Thus, the black hole changes from the initial state \(\left( M,Q,l,a_{i} \right) \) to the final state \(( M+dM,Q+dQ,l+dl,a_{i}+da_{i}) \). The infinitesimal changes in M, Q, l, \(a_{i}\) and \(r_{+}\) are related by

$$\begin{aligned}&\frac{\partial f\left( r\right) }{\partial r}|_{r=r_{+}}dr_{+} +\frac{\partial f\left( r\right) }{\partial M}|_{r=r_{+}}dM+\frac{\partial f\left( r\right) }{\partial Q}|_{r=r_{+}}dQ\nonumber \\&\quad +\frac{\partial f\left( r\right) }{\partial l}|_{r=r_{+}}dl+\frac{\partial f\left( r\right) }{\partial a_{i}}|_{r=r_{+}}da_{i}=0. \end{aligned}$$
(56)

From Eq. (56), we find that

$$\begin{aligned} \left| P^{r}\left( r_{+}\right) \right| =TdS+\sum \nolimits _{i} {\mathcal {A}}_{i}da_{i}-PdV, \end{aligned}$$
(57)

where we use Eq. (16) to express dQ in terms of \(\left| P^{r}\left( r_{+}\right) \right| \), and the derivatives of \(f\left( r\right) \) are given in (41). Plugging the above equation into Eq. (16), we use Eq. (55) to obtain

$$\begin{aligned} dM=\Phi dQ+TdS+VdP+\sum \nolimits _{i}{\mathcal {A}}_{i}da_{i}, \end{aligned}$$
(58)

which is the first law of thermodynamics.

Equation (57) gives the change of the black hole entropy,

$$\begin{aligned} dS=\frac{\left| P^{r}\left( r_{+}\right) \right| -\sum \nolimits _{i}{\mathcal {A}}_{i}da_{i}}{T-\frac{\left( D-1\right) r_{+}}{4\pi l^{2}}}. \end{aligned}$$
(59)

For large values of T, the denominator in Eq. (59) becomes

$$\begin{aligned} T-\frac{\left( D-1\right) r_{+}}{4\pi l^{2}}\sim \frac{\left( D-3\right) }{4\pi r_{+}}>0, \end{aligned}$$
(60)

where we use Eq. (31). However for small enough T, the denominator is negative. Since \(da_{i}\) is arbitrary, the sign of the numerator in Eq. (59) is indefinite. In the extended phase space, the entropy can increases or decrease depending the values of \(da_{i}\). In the “restricted” extended phase space with \(da_{i}=0\), the change of the black hole entropy becomes

$$\begin{aligned} dS=\frac{\left| P^{r}\left( r_{+}\right) \right| }{T-\frac{\left( D-1\right) r_{+}}{4\pi l^{2}}}, \end{aligned}$$
(61)

which shows that the second law of thermodynamics is not satisfied for the extremal or near-extremal black hole. When the black hole is far enough from extremality, the second law is satisfied in the “restricted” extended phase space.

5 Weak cosmic censorship conjecture

To test the weak cosmic censorship conjecture, we make the black hole, which is initially extremal or near extremal, absorb a charged particle and check whether the resulting object has too much charge to be a black hole. Since the particle is a test particle, the black hole needs to start out close to extremal to have chance to become a naked singularity. So here we assume that the initial NLED black hole is near extremal, for which there are two horizons. Between these two horizons, there exists one and only one minimum point at \(r=r_{\min }\) for \(f\left( r\right) \). Moreover, the minimum value of \(f\left( r\right) \) is not greater than zero,

$$\begin{aligned} \delta \equiv f\left( r_{\min }\right) \le 0, \end{aligned}$$
(62)

and \(\delta =0\) corresponds to the extremal black hole. After the black hole absorbs a charged particle, the minimum point would move to \(r_{\min } +dr_{\min }\). For the final black hole solution, if the minimum value of \(f\left( r\right) \) at \(r=r_{\min }+dr_{\min }\) is still not greater than zero, there is an event horizon. Otherwise, the final black hole solution is over the extremal limit, and the weak cosmic censorship conjecture is violated. Again, we first present some useful formulae:

$$\begin{aligned} \frac{\partial f\left( r\right) }{\partial r}|_{r=r_{\min }}&=0,\nonumber \\ \frac{\partial f\left( r\right) }{\partial M}|_{r=r_{\min }}&=-\frac{16\pi }{\left( D-2\right) \omega _{D-2}r_{\min }^{D-3}}, \nonumber \\ \frac{\partial f\left( r\right) }{\partial l}|_{r=r_{\min }}&=-\frac{2r_{\min }^{2}}{l^{3}},\nonumber \\ \frac{\partial f\left( r\right) }{\partial Q}|_{r=r_{\min }}&=\frac{16\pi \left[ \Phi +A_{t}\left( r_{+}\right) -A_{t}\left( r_{\min }\right) \right] }{\left( D-2\right) \omega _{D-2}r_{\min }^{D-3}},\nonumber \\ \frac{\partial f\left( r\right) }{\partial a_{i}}|_{r=r_{\min }}&=\frac{16\pi \left( {\mathcal {A}}_{i}+\delta {\mathcal {A}}_{i}\right) }{\left( D-2\right) \omega _{D-2}r_{\min }^{D-3}}, \end{aligned}$$
(63)

where Eq. (27) are used to obtain \(\partial f\left( r\right) /\partial Q|_{r=r_{\min }}\) and \(\partial f\left( r\right) /\partial a_{i}|_{r=r_{\min }}\), and we define

$$\begin{aligned} \delta {\mathcal {A}}_{i}\equiv -\frac{\omega _{D-2}}{4\pi }\int _{r_{\min }}^{r_{+} }drr^{2}\frac{\partial {\mathcal {L}}\left( s;a_{i}\right) }{\partial a_{i} }. \end{aligned}$$
(64)
Table 1 Results for the first and second laws of thermodynamics and the weak cosmic censorship conjectures (WCCC), which are tested for a general NLED charged AdS black hole with absorbing a charged particle in the test particle limit

5.1 Normal phase space

In this case, absorbing a charged particle of the energy E and charge q makes the black hole change from the initial state \(\left( M,Q\right) \) to the final state \(\left( M+dM,Q+dQ\right) \), where dM and dQ are given in Eq. (42). Owing to these changes, the location of the minimum point of \(f\left( r\right) \) moves to \(r_{\min }+dr_{\min }\). For the final state, the minimum value of \(f\left( r\right) \) at \(r=r_{\min }+dr_{\min }\) becomes

$$\begin{aligned}&f\left( r_{\min }+dr_{\min };M+dM,Q+dQ\right) \nonumber \\&\quad =\delta +\frac{\partial f}{\partial r}|_{r=r_{\min }}dr_{\min }+\frac{\partial f}{\partial M}|_{r=r_{\min }}dM+\frac{\partial f}{\partial Q}|_{r=r_{\min } }dQ\nonumber \\&\quad =\delta -\frac{16\pi \left| P^{r}\left( r_{+}\right) \right| }{\left( D-2\right) \omega _{D-2}r_{\min }^{D-3}}+\!\frac{16\pi q\left[ A_{t}\left( r_{+}\right) -A_{t}\left( r_{\min }\right) \right] }{\left( D-2\right) \omega _{D-2}r_{\min }^{D-3}}, \end{aligned}$$
(65)

where the parameters of \(f\left( r\right) \) are put explicitly. If the initial black hole is extremal, we have \(r_{+}=r_{\min }\) and \(\delta =0\). The minimum value of \(f\left( r\right) \) of the final black hole reduces to

$$\begin{aligned} f\left( r_{\min }+dr_{\min }\right) =-\frac{16\pi \left| P^{r}\left( r_{+}\right) \right| }{\left( D-2\right) \omega _{D-2}r_{\min }^{D-3} }<0, \end{aligned}$$
(66)

which implies that the extremal black hole becomes a non-extremal one by the absorption. For the near-extremal black hole, we define \(\epsilon \) such that

$$\begin{aligned} r_{\min }=r_{+}\left( 1-\epsilon \right) , \end{aligned}$$
(67)

where \(\epsilon \ll 1\). So \(\delta \) is suppressed by \(\epsilon \) in the near-extremal limit. Moreover, the second term in the third line of Eq. (65) is only suppressed by the test particle limit while the third term is suppressed by both near-extremal limit and the test particle limit. Therefore, in the test particle limit for the near-extremal black hole, the third term can be neglected, and Eq. (65) then gives

$$\begin{aligned} f\left( r_{\min }+dr_{\min }\right) =\delta -\frac{16\pi \left| P^{r}\left( r_{+}\right) \right| }{\left( D-2\right) \omega _{D-2}r_{\min }^{D-3} }<0, \end{aligned}$$
(68)

which means that the near-extremal black hole stays non-extremal after the absorption. In the normal phase space, the weak cosmic censorship conjecture is satisfied for the extremal and near-extremal NLED black holes under the charge particle absorption.

5.2 Extended phase space

In the extended phase space, after absorbing a charged particle, the parameters of the black hole change from \(\left( M,Q,l,a_{i}\right) \) to \(\left( M+dM,Q+dQ,l+dl,a_{i}+da_{i}\right) \), and \(r_{\min }\) moves accordingly to \(r_{\min }+dr_{\min }\). The minimum value of \(f\left( r\right) \) at \(r=r_{\min }+dr_{\min }\) of the final state is given by

$$\begin{aligned}&f\left( r_{\min }+dr_{\min };M+dM,Q+dQ,l+dl,a_{i}+da_{i}\right) \nonumber \\&\quad =\delta +\frac{\partial f}{\partial M}|_{r=r_{\min }}dM+\frac{\partial f}{\partial Q}|_{r=r_{\min }}dQ+\frac{\partial f}{\partial l}|_{r=r_{\min } }dl\nonumber \\&\qquad +\sum \nolimits _{i}\frac{\partial f}{\partial a_{i}}|_{r=r_{\min }} da_{i}\nonumber \\&\quad =\delta -\frac{16\pi \left\{ TdS+\left[ A_{t}\left( r_{+}\right) -A_{t}\left( r_{\min }\right) \right] q+\delta {\mathcal {A}}_{i}da_{i}\right\} }{\left( D-2\right) \omega _{D-2}r_{\min }^{D-3}}\nonumber \\&\qquad +2\left( \frac{r_{+}^{D-1} }{r_{\min }^{D-3}}-r_{\min }^{2}\right) \frac{dl}{l^{3}}, \end{aligned}$$
(69)

where the parameters of \(f\left( r\right) \) are put explicitly, and we use Eq. (63) for the derivatives of \(f\left( r\right) \). When the initial black hole is extremal, one has that \(r_{+}=r_{\min }\), \(T=0\), \(\delta {\mathcal {A}}_{i}=0\) and \(\delta =0\). So the minimum value of \(f\left( r\right) \) of the final black hole is

$$\begin{aligned} f\left( r_{\min }+dr_{\min }\right) =0, \end{aligned}$$
(70)

which implies that the extremal black hole stays extremal after the absorption. For the near-extremal black hole in the test particle limit, the second and third terms in the third line of Eq. (69) are suppressed by both the near-extremal limit and the test particle limit and hence can be neglected. Therefore, Eq. (69) leads to

$$\begin{aligned} f\left( r_{\min }+dr_{\min }\right) =\delta <0, \end{aligned}$$
(71)

which means that the near-extremal black hole stays non-extremal after the absorption. In the extended phase space, the weak cosmic censorship conjecture is also satisfied for the extremal and near-extremal NLED black holes under the charge particle absorption.

6 Conclusion

In this paper, we calculated the variations of the thermodynamic quantities of a general NLED-AdS black hole via absorbing a charged practice. With these variations, we checked the first and second laws of thermodynamics and the weak cosmic censorship conjecture for the NLED black hole in the test particle limit. Two scenarios were considered, namely the normal phase space and the extended phase space. Our results are summarized in Table 1.

In [61], the first and second laws of thermodynamics and the weak cosmic censorship conjecture have been tested for the Einstein–Maxwell action in the D-dimensional spacetime, which is the special case of the Einstein-NLED theory, i.e., \({\mathcal {L}}\left( s;a_{i}\right) =s\). The analysis was considered in the extended phase space, in which there is no dimensionful parameter in the Maxwell Lagrangian. As expected, our results successfully reproduced those in [61]. Moreover, our results show that the correction terms to the electromagnetic part can not solve the violation of the second law of thermodynamics near extremality, and hence the correction terms to the gravity part should be considered. In [56], the thermodynamics and the weak cosmic censorship conjecture of the Born–Infeld AdS black holes were discussed in the normal and extended phase space. Our results agree with those in the normal phase space. However, in the extended space, it showed there that the extremal black holes will change into non-extremal black holes after the charge particle absorption, which can not reduce to the Maxwell case in [61] with \(b=0\). Recently, a \(\left( 2+1\right) \)-dimensional regular black hole with some nonlinear electrodynamic source was considered in [101], the results of which agree with ours.