1 Introduction

Many astrophysical and nuclear physics phenomena are of interest in self-gravitating stellar objects when its structure of matter approaches densities \(\rho \sim 0.16 ~\text{ fm }^{-3}\) at finite temperature (< 20 MeV). Exact solutions of the Einsteins field equations for static spherically symmetric manifolds are important in the description of such anisotropic relativistic spheres. The interior spacetime matches smoothly with the exterior Schwarzschild model [1]. Many exact solutions to the field equations have been generated by different approaches with generalized forms for one of the gravitational potentials that does have an equation of state (EoS) (linear [2,3,4,5,6,7], quadratic [8,9,10], polytropic [11,12,13,14,15,16], Van der Waals [17], etc.) and without [18,19,20,21,22,23,24,25] a particular barotropic EoS relating the pressure to the energy density. However, among large number of such work reported over the years, relatively few of these solutions correspond to non-singular metric functions with physically acceptable energy momentum tensor.

In this work we generate a general frame work describing static spherically symmetric anisotropic matter distribution in terms of an equation of state \(p_r=p_r(\rho )\) and gravitational potential as generating function. We treat Van der Waals type of EoS and a physically reasonable form of gravitational potential as a particular example to model mixed fluid astrophysical objects that is of physical significance. There are many phenomena in stellar objects where first-order phase transitions occur (e.g., pion condensation, kaon condensation, deconfinement and chiral phase transitions) [26,27,28], and the Van der Waals fluid is a good model to illustrate principal features of such scenario [29, 30]. At low-temperature high-density limits, as the densities grow the separation distance between particles decreases and quantum degeneracy pressure due to the exclusion principle supports against further collapse and the average particle energy increases. This leads to the deconfinement of the nucleons and mixed phases are expected with various first-order phase transitions, such as liquid–gas transition in the low densities [31,32,33], meson condensations and hadron-quark deconfinement transitions at high-density region [34,35,36,37].

Meson condensations (pions and kaons) have been extensively investigated as new states of high-density hadronic matter, which may be realized in hybrid stars. Meson condensed states are strongly interacting systems of mesons and baryons whose dynamics is controlled by the underlying chiral symmetry, and quark confinement/deconfinement play an important role in connecting hadron dynamics and quark–gluon dynamics, leading to a unified description. The breaking of chiral symmetry triggers the onset of kaon condensation in both hadronic matter phase and the color-flavor locked (CFL) phase [38]. The authors have shown that a Van der Waals type EoS with appropriate choice of parameters can be used to model a neutral strange quark star with ultra-dense matter in spherically symmetric mixed phases in color singlet domain [17].

On the other hand, in the low-density regime (\(\rho _s \approx 0.16 \ {\text {fm}}^{-3} \)) at finite temperature (\(T < 20 \ {\text {MeV}}\)), there appears a “liquid–gas” mixed phase equilibrium [27, 31], where the coexisting nuclear phase (liquid) and nuclear/electron phase (gas) are non-congruent and are separated in space forming pasta structures. Such frustrated system of “pasta phase” appears due to competition between the Coulomb interaction and the strong force, and is constituted by different geometrical configurations [39,40,41]. Nuclear pasta forms in core-collapse supernova events [32, 33, 42] and in the inner crust of neutron stars [43], and observation of the signals of the mixed phase has been suggested in the spectra of the gravitational waves [44]. Pressure anisotropy [45,46,47] is expected to play an important role in such mixed fluid and we show Van der Waals EOS could represent a low-density scenario of a star.

2 Anisotropic model with EoS

The interior of static spherically symmetric star can be described by the metric

$$\begin{aligned} ds^{2} = -e^{2\nu (r)} dt^{2} + e^{2\lambda (r)} dr^{2} + r^{2}(d\theta ^{2} + \sin ^{2}{\theta } d\phi ^{2}) \end{aligned}$$
(1)

in Schwarzschild coordinates \((x^{a}) = (t,r,\theta ,\phi ).\) For anisotropic imperfect neutral matter distribution the energy momentum tensor can be taken as

$$\begin{aligned} T_{ij}=\text{ diag } (-\rho , p_r, p_t, p_t ). \end{aligned}$$
(2)

In the above equation the energy density\(\rho ,\), radial pressure \(p_r\) and tangential pressure \(p_t\) are measured relative to the comoving fluid 4-velocity \(u^i = e^{-\nu }\delta ^i_0.\) For the metric (1) and energy momentum tensor (2) the Einstein field equations becomes

$$\begin{aligned}&\frac{1}{r^{2}} [ r(1-e^{-2\lambda }) ]' = \rho , \end{aligned}$$
(3)
$$\begin{aligned}&- \frac{1}{r^{2}} ( 1-e^{-2\lambda } ) + \frac{2\nu '}{r}e^{-2\lambda } = p_r, \end{aligned}$$
(4)
$$\begin{aligned}&e^{-2\lambda }\left( \nu '' + \nu '^{2} + \frac{\nu '}{r}- \nu '\lambda ' - \frac{\lambda '}{r} \right) = p_t, \end{aligned}$$
(5)

where primes denote differentiation with respect to r. To obtain the Einstein system of Eqs. (3)–(5), we assumed \(8\pi G=1\) and the speed of light \(c=1\). The system of Eqs. (3)–(5) describes the behaviour of the gravitational field inside an anisotropic star.

The mass contained within the sphere of radius r is given by

$$\begin{aligned} m(r)= \frac{1}{2}\int _0^r\omega ^2 \rho (\omega )d\omega . \end{aligned}$$
(6)

Using the transformation suggested by Durgapal and Bannerji [48]

$$\begin{aligned} x = r^2,\quad Z(x) = e^{-2\lambda (r)} \quad A^{2}y^{2}(x) = e^{2\nu (r)}, \end{aligned}$$
(7)

the system (3)–(5) becomes

$$\begin{aligned}&\frac{1-Z}{x} - 2{\dot{Z}} = \rho , \end{aligned}$$
(8)
$$\begin{aligned}&4Z\frac{{\dot{y}}}{y} + \frac{Z-1}{x} = p_r, \end{aligned}$$
(9)
$$\begin{aligned}&4x Z \frac{\ddot{y}}{y} +(4 Z+ 2 x {\dot{Z}}) \frac{{\dot{y}}}{y} + {\dot{Z}} =p_t, \end{aligned}$$
(10)

where A is an arbitrary constant and dots denote differentiation with respect to the variable x. Under this transformation (7) the mass function (6) becomes

$$\begin{aligned} m(x)=\frac{1}{4 } \int _0^x\sqrt{w}\rho (w)dw. \end{aligned}$$
(11)

A physically realistic fluid matter distribution is expected to satisfy the barotropic equation of state

$$\begin{aligned} p_r=p_r(\rho ) \end{aligned}$$
(12)

With the inclusion of (12), the general solution to the system (8)–(10) can be written as

$$\begin{aligned} e^{2\lambda }= & {} Z^{-1}, \end{aligned}$$
(13)
$$\begin{aligned} e^{2\nu }= & {} A^2 y^2, \end{aligned}$$
(14)
$$\begin{aligned} \rho= & {} \frac{1-Z}{x}-2 {\dot{Z}}, \end{aligned}$$
(15)
$$\begin{aligned} p_r= & {} p_r(\rho ), \end{aligned}$$
(16)
$$\begin{aligned} p_t= & {} p_r +\varDelta , \end{aligned}$$
(17)
$$\begin{aligned} \varDelta= & {} 4 x Z \frac{\ddot{y}}{y} + {\dot{Z}} \left( 1+ 2x \frac{{\dot{y}}}{y}\right) +\frac{1-Z}{x}, \end{aligned}$$
(18)

in terms of the gravitational potential Z, where the quantity \(\varDelta = p_t -p_r\) is the measure of anisotropy,

$$\begin{aligned} y=dx^{-\frac{1}{4}}\exp \left[ \int \frac{1+xp_r(\rho )}{4xZ}dx\right] \end{aligned}$$
(19)

and d is a constant of integration. Therefore the line element (1) takes the form

$$\begin{aligned} ds^{2}= & {} -d^2 r^{-1} \exp \left[ \int \left( \frac{1+r^2p_r(\rho )}{rZ}\right) dr \right] dt^{2} \nonumber \\&+ \ Z^{-1} dr^{2} + r^{2}(d\theta ^{2} + \sin ^{2}{\theta } d\phi ^{2}). \end{aligned}$$
(20)

Hence, any solution describing static spherically symmetric anisotropic matter distribution with any form of equation of state can be easily determined by the generating function Z(r) if \(p_r=p_r(\rho )\) is specified. In particular, for a linear EoS

$$\begin{aligned} p_r=p_r(\rho )=\alpha \rho -\beta , \end{aligned}$$
(21)

where \(\alpha \) and \(\beta \) are real constants the metric (20) reduces to

$$\begin{aligned} ds^{2}= & {} -d^2 r^{-(1+\alpha )}Z^{- \alpha } \exp \left[ \int \left( \frac{1+\alpha -\beta r^2}{rZ}\right) dr \right] dt^{2} \nonumber \\&+\ Z^{-1} dr^{2} + r^{2}(d\theta ^{2} + \sin ^{2}{\theta } d\phi ^{2}). \end{aligned}$$
(22)

The metric (22) with Tolmann IV type potential for Z has been shown to well model a strange star candidate [6].

3 Particular model with Van der Waal’s EoS

In principle we can express any model explicitly from the system (13)–(18) that describe the behaviour of an anisotropic star if the form of the equation of state \(p_r=p_r(\rho )\) and the gravitational potential Z are specified. Consequently, in this paper, we consider the modified Van der Waals equation of state

$$\begin{aligned} p_r =p_r(\rho )= \alpha \rho ^{2}+\frac{\beta \rho }{1+\gamma \rho }, \end{aligned}$$
(23)

where \(\alpha , \beta \) and \(\gamma \) are real constants together with the form for the gravitational potential

$$\begin{aligned} Z= \frac{(2-ax)}{2(1+ax)}, \end{aligned}$$
(24)

where a is a positive real constant. The gravitational potential Z is regular at the origin and well behaved in the stellar interior for a wide range of values for the parameters a. This form of gravitational potential were previously used to study an isotropic perfect fluid sphere [48] and shown to satisfy all the physical requirements for realistic neutron star [49]. Later this model were generalized by Thirukkanesh and Maharaj [19] and Thirukkanesh and Ragel [50]. Therefore the form chosen in (24) is physically viable.

Substituting (23) and (24) into (19) we obtain

$$\begin{aligned} y= & {} d~ \exp \left[ -\frac{a \alpha (11+8ax)}{4(1+ax)^2}\right] (1+ax)^{\frac{25a\alpha }{24}} \nonumber \\&\times \ (2-ax)^{- \left( \frac{3}{4}+\frac{25a\alpha }{24}+\frac{15\beta }{2(6+5a\gamma )}\right) } \nonumber \\&\times \ f(x)^{\frac{3\beta (4-5a\gamma )}{8(6+5a\gamma )}} g(x)^{\frac{\beta \sqrt{3a\gamma }~(52-15a \gamma )}{8\sqrt{3a\gamma -16}~(6+5a\gamma )}}. \end{aligned}$$
(25)

where

$$\begin{aligned} f(x)= & {} 3a\gamma (3+ax)+2(1+ax)^2,\\ g(x)= & {} \frac{4(1+ax)+3a\gamma +\sqrt{3a\gamma (3a\gamma -16)}}{4(1+ax)+3a\gamma -\sqrt{3a\gamma (3a\gamma -16)}} \end{aligned}$$

Hence an exact model for the system (13)–(18) is as follows

$$\begin{aligned} e^{2\lambda }= & {} \frac{2(1+ax)}{(2-ax)} \end{aligned}$$
(26)
$$\begin{aligned} e^{2\nu }= & {} A^2 d^2 \exp \left[ -\frac{a \alpha (11+8ax)}{2(1+ax)^2}\right] (1+ax)^{\frac{25a\alpha }{12}}\nonumber \\&\times \ (2-ax)^{- \left( \frac{3}{2}+\frac{25a\alpha }{12} +\frac{15\beta }{(6+5a\gamma )}\right) } \nonumber \\&\times \ f(x)^{\frac{3\beta (4-5a\gamma )}{4(6+5a\gamma )}} g(x)^{\frac{\beta \sqrt{3a\gamma }~(52-15a \gamma )}{4\sqrt{3a\gamma -16}~(6+5a\gamma )}} \end{aligned}$$
(27)
$$\begin{aligned} \rho= & {} \frac{3a(3+ax)}{2(1+ax)^2} \end{aligned}$$
(28)
$$\begin{aligned} p_r= & {} \alpha \rho ^{2}+\frac{\beta \rho }{1+\gamma \rho }, \end{aligned}$$
(29)
$$\begin{aligned} p_t= & {} p_r +\varDelta , \end{aligned}$$
(30)
$$\begin{aligned} \varDelta= & {} 2 x \left( \frac{2-ax}{1+ax}\right) \frac{\ddot{y}}{y} +\frac{3ax}{2(1+ax)^2} \left( a- 2 \frac{{\dot{y}}}{y}\right) , \end{aligned}$$
(31)

where y is given by (25). The solution (26)–(31) is given in simple elementary function so it may be used to model an anisotropic star with Van der Waals equation of state.

The mass function takes the form

$$\begin{aligned} m(x)=\frac{3a x^{\frac{3}{2}}}{4(1+ax)}. \end{aligned}$$
(32)

4 Physical analysis

In the analysis of physical viability, the following conditions have been generally recognized to be crucial for anisotropic fluid spheres [51, 52]:

  1. (i)

    the density \(\rho \) and the radial pressure \(p_r\) should be positive inside the star;

  2. (ii)

    the density \(\rho \), the radial pressure \(p_r\) and the tangential pressure \(p_t\) should be monotonically decreasing from center to surface;

  3. (iii)

    the radial pressure \(p_r\) must vanish but the tangential pressure \(p_t\) need not necessarily vanish at the boundary of the sphere. However, the radial pressure should be equal to the tangential pressure at center of the fluid sphere;

  4. (iv)

    inside the static configuration the speed of sound should be less than the speed of light, i.e., \(\displaystyle 0 \le V_{Sr}^2=\frac{dp_r}{d\rho }\le 1\) and \(\displaystyle 0 \le V_{St}^2= \frac{dp_t}{d\rho }\le 1\);

  5. (v)

    the energy–momentum tensor has to obey the conditions \(\rho -p_r-2p_t\ge 0\) and \(\rho +p_r+2p_t\ge 0\);

  6. (vi)

    At the boundary of the star \(r=R\), the interior metric matches smoothly with the exterior Schwarzschild metric

    $$\begin{aligned} ds^2= & {} - \left( 1 - \frac{2M}{r} \right) dt^2 +\left( 1 - \frac{2M}{r} \right) ^{-1} dr^2 \\&+\ r^2 (d\theta ^2 +\sin ^2\theta d\phi ^2), \end{aligned}$$

    where M is the total mass of the sphere.

Now we show that the model generated satisfy the above physical conditions and hence, physically represent a realistic star. From condition (iii), at the boundary of the star \(r=R\), we have \(p_r(R)=0\) which yield

$$\begin{aligned} R= & {} \left[ \phantom {\left. \frac{1}{4\beta }\sqrt{\frac{3\alpha }{2a}} \sqrt{\left[ \left( 3a \alpha -16\beta -6a \beta \gamma \right) +\frac{\psi }{\sqrt{\alpha ^2-4\alpha \beta \gamma }} \right] }\right] }-\frac{1}{8a \beta }\left( 8\beta +3a(\alpha +\sqrt{\alpha ^2-4 \beta \gamma })\right) \right. \\&+ \ \left. \frac{1}{4\beta }\sqrt{\frac{3\alpha }{2a}} \sqrt{\left[ \left( 3a \alpha -16\beta -6a \beta \gamma \right) +\frac{\psi }{\sqrt{\alpha ^2-4\alpha \beta \gamma }} \right] }\right] ^{1/2}, \end{aligned}$$

where \(\psi =3a\alpha ^2-16\alpha \beta +64 \beta ^2 \gamma -12a \alpha \beta \gamma \). For suitable choice of parameters \(\alpha , \beta \) and \(\gamma \) we can get the positive radius R. The matching condition (vi) imply

$$\begin{aligned}&\left( 1 - \frac{2M}{R} \right) ^{-1}=\frac{2(1+aR^2)}{(2-aR^2)} \end{aligned}$$
(33)
$$\begin{aligned}&\left( 1 - \frac{2M}{R} \right) = A^2y^2(R^2), \end{aligned}$$
(34)

where \(M=m(R)=\frac{3aR^3}{4(1+aR^2)}.\) The condition (33) does not impose any restrictions on the parameters. However the condition (34) impose restriction on the parameters A as

$$\begin{aligned} A^2= \frac{(2-aR^2)}{2(1+aR^2)y^2(R^2)}. \end{aligned}$$

Due to complexity of the solution, we show graphically that the matter variable are well behaved throughout the interior of the star and the plotted radial dependence of physical quantities of the model illustrates that the model satisfy the conditions (i)–(v). The graphs have been plotted for a particular choice of parameter values \(a=0.001, \alpha =45, \beta =-\ 0.1655\) and \(\gamma =1\) with stellar boundary \(R=11.5\) km. The choice of parameters have been such that the model is physically viable satisfying the conditions (i)–(v).

Fig. 1
figure 1

Energy density

Fig. 2
figure 2

Radial pressure

Fig. 3
figure 3

Tangential pressure

Fig. 4
figure 4

Measure of anisotropy

Fig. 5
figure 5

The square of radial speed of light

Fig. 6
figure 6

The square of tangential speed of light

Fig. 7
figure 7

Condition for energy–momentum tensor

Fig. 8
figure 8

Condition for energy–momentum tensor

Fig. 9
figure 9

Condition for stability

Figures 1 and 2 show that the energy density and the radial pressure decreases monotonically with increasing radius, and the density is non-zero at the surface and the radial pressure vanishes, which is the requirement for realistic star. However, as seen in Fig. 3, the tangential pressure is non-zero at the surface, which is physically possible [51], and such a scenario of anisotropic fluid has been explained by assumption of particles moving on circular orbits [53, 54] and the tangential pressure of a surface layer is related to surface tension [55]. As demonstrated in Fig. 4, the anisotropy \(\varDelta \) is repulsive and increases monotonically towards the surface boundary remaining finite and continuous in the interior. Moreover, Figs. 5 and 6 illustrate that inside the static configuration the square of speed of sound (both radial and tangential) remain between 0 and 1, satisfying another physical requirement. Figures 7 and 8 show that the energy–momentum tensor of the model is physically admissible, satisfying the condition (v). Therefore the model, for the chosen parameters satisfy all major physical conditions (i)–(vi) listed above of a realistic star. Moreover, Figure 9 illustrates that the model satisfy in addition the important stability condition [56] \( \displaystyle -1 \le V_{St}^2 - V_{Sr}^2 \le 0\).

For the model generated by these parameter values, we calculate the mass of the stellar object to be \(M=0.6818 M_{\odot }\), central density \(\rho (0)=2.4123\times 10^{14} \ {\text {g cm}}^{-3}\) and surface density \(\rho (R)=1.9646\times 10^{14} \ {\text {g cm}}^{-3}\), which shows that the stellar object has a density less than the nuclear saturation density \(2.8\times 10^{14} \ {\text {g cm}}^{-3}\), with model parameters that could represent the “liquid–gas” mixed phase equilibrium in the low-density regime.

5 Conclusion

In this paper, a general frame work is generated to describe static spherically symmetric anisotropic matter distribution with an equation of state \(p_r=p_r(\rho )\) and gravitational potential Z(r) as generating function. The general model is examined by choosing Van der Waals type equation of state with gravitational potential \(\displaystyle Z= \frac{(2-ax)}{2(1+ax)}\), to represent liquid–gas mixed fluid sphere. The model is shown to satisfies all the required major physical properties of a realistic star, and stable in the investigated low-density regime.