1 Introduction

The gravitational collapse of stellar objects is of much interest in relativistic astrophysics, requiring the solution of time-dependent relativistic field equations. Gravitational collapse problems were pioneered by Oppenheimer and Synder [1], not long after General Relativity was formulated by Einstein. Initially, the Schwarzschild solution was used until the discovery of the Vaidya solution [2] which accommodates null-radiation in the exterior atmosphere due to energy being radiated away from the collapsing body of fluid. There have been numerous attempts at obtaining solutions of the Einstein field equations for describing a radiating body, simultaneously undergoing gravitational collapse, and these efforts typically employ boundary conditions, equations of state, initial static configurations and separation of variables [3,4,5]. The boundary of a collapsing star divides the spacetime into two distinct regions, the interior, \({\mathscr {M}}^-\), and the exterior spacetime, \({\mathscr {M}}^+\). The interior spacetime must match smoothly to the exterior spacetime in order to generate a physically viable model of a radiating star. Early attempts were made by Glass [6] in which the Darmois and Lincherowitz matching conditions were utilised. Santos then established the appropriate boundary conditions for a spherically symmetric, shear-free, time-dependent metric which matches smoothly to the exterior Vaidya metric [7]. The Santos matching condition requires a non-vanishing pressure at the boundary for a star dissipating energy in the form of a radial heat flux. This is a necessary condition that ensures continuity of momentum flux across the boundary. The Santos junction conditions have been generalised to include shear [8, 9], the cosmological constant as well as the electromagnetic field [10, 11]. Herrera et al. [12,13,14] have established important, fundamental results concerning matter distribution, stability of the shear-free condition, energy conditions and thermodynamic properties of gravitational collapse processes.

In developing models describing gravitational collapse, assumptions concerning the gravitational potentials and matter content of the gravitating body are often made. These have included acceleration-free and expansion-free collapse, Weyl-free collapse, anisotropic pressure configurations, the inclusion of shear and bulk viscosity and stipulations of equation of state [15,16,17]. Differential equations which arise, typically with respect to invariance of the junction conditions, lend themselves to the application of Lie symmetry methods and this can help to determine novel, exact solutions [18,19,20]. In addition to restricting the matter content, conditions on the spacetime geometry are just as important. It is of interest to consider gravitational fields, typically represented by a Riemannian metric of four dimensions, to be immersed in a flat spacetime of higher dimension. Randall–Sundram and Anchordoqui–Bergliaffa re-established the conjecture that 4-dimensional spacetime might be embedded in higher dimensional flat space and much effort is made to achieve class one embedding [21]. In general, an n-dimensional Riemannian spacetime is said to be of class p if it can be embedded into a flat space of dimension n + p.

The Karmarkar condition [22] is a necessary (but not sufficient) condition for a spacetime to be of class one [23]. The derivation of the Karmarkar condition is purely geometric in nature providing relations among the components of the Riemann tensor. This in turn relates the metric potentials to one another and has thus assisted in model development. Of interest is to note that the Karmarkar condition together with pressure isotropy gives the interior Schwarzschild solution as the only bounded matter configuration. Recent attempts at modelling compact objects such as 4U 1538-52, PSR J1614-2230, Vela X-1 and Cen X-3 using the Karmarkar condition have produced models with favourable physical characteristics, consistent with observations [24, 25]. It is expected that the Karmarkar condition should also provide interesting scenarios for time-dependent systems, however its compatibility needs to be assessed [26].

Lie symmetry analysis is a very powerful tool for the study of nonlinear differential equations and we make use of this in generating solutions of differential equations obtained via Karmarkar’s condition. The steps that we follow in the analysis are: (i) we determine the Lie symmetries for each master partial differential equation for each model, (ii) the one-dimensional optimal system is determined in each case for the admitted Lie symmetries, (iii) we define similarity transformations from the Lie symmetries by using the Lie invariants which are used to reduce the master equation into an ordinary differential equation and (iv) exact closed-form solutions are then obtained. These steps have been applied before for various gravitational models with interesting results. Exact solutions describing charged radiation have been derived by applying Lie symmetries [27]. Moreover, in [20] Lie symmetries have been used to derive expanding and shearing models of radiating relativistic stars, while shear-free radiating stars were considered in [28]. In [29], a new solution which describes a Euclidean star is derived by Lie symmetries and has the physical property of satisfying all the energy conditions and admitting a barotropic equation of state. For the field equations of the Schwarzschild model, conservation laws, invariant functions and differential operators derived by using the Lie symmetry analysis in [30, 31]. The Emden–Fowler equation which can describe gravitational spherically symmetric solutions was investigated via symmetry analysis in [32]. For other applications of symmetry analysis in gravitational physics, we refer the reader to [33,34,35,36] and the references therein.

The plan of this paper is as follows: In Sect. 2 we present the gravitational field equations for our analysis. In Sect. 3, the basic properties and definitions of Lie symmetries are given. The definition of the one-dimensional optimal system is discussed. The latter is necessary in order to perform a complete classification of the admitted similarity transformations. In Sects. 4, 5 and 6 we solve the Karmarkar condition with respect to conformally flat, Weyl-free collapse and shear-free metrics respectively. A physical application is then given in Sect. 7 which describes radiating, Weyl-free collapse. In Sect. 8 we discuss the merits of the radiating stellar model obtained and in Sect. 9 we conclude on the suitability and novelty of our methods. Appendices A, B and C complete the presentation of this study where we present exact solutions for the three cases given in Sects. 4, 5 and 6. These may be used for future studies.

2 Spherically symmetric spacetimes in relativity

The spherically symmetric line element is given by

$$\begin{aligned} ds^2 = -A^2 \left( t, r\right) dt^2 + B^{2}\left( t, r\right) dr^2 + Y^2 \left( t, r\right) d\varOmega ^2 \end{aligned}$$
(1)

where \(d\varOmega ^2\) is the line element of the two-sphere, that is,

$$\begin{aligned} d\varOmega ^2 = d\theta ^2 + \sin ^2\theta d\phi ^2. \end{aligned}$$
(2)

An energy–momentum tensor incorporating heat flux, \(q^{a} = (0,q^1,0,0)\), is used,

$$\begin{aligned} T^-_{ab}= & {} (\rho + p_{t})u_au_b + p_{t}g_{ab}+ (p_{r}-p_{t}) \chi _{a} \chi _{b} \nonumber \\&+ q_au_b + q_bu_a \end{aligned}$$
(3)

where, \(\rho \) is the energy density, \(p_{r}\) the radial pressure, \(p_{t}\) the tangential pressure and \(q_a\) the heat flux vector. The timelike four-velocity of the fluid is \(u_a\) and \(\chi _a\) is a spacelike unit four-velocity along the radial direction. These quantities must satisfy \(u_a u^a = -1\), \(u_a q^a = 0\), \(\chi _a \chi ^a = 1\) and \(\chi _a u^a = 0\). In co-moving coordinates we have

$$\begin{aligned} u^a = A^{-1} \delta _{0}^{a},\quad q^a = q \delta _{1}^{a},\quad \chi ^a = B^{-1} \delta _{1}^{a}. \end{aligned}$$
(4)

The four-acceleration and expansion scalar are given by

$$\begin{aligned} w_a = u_{a;b} u^b,\quad \varTheta = {u^a}_{;a}. \end{aligned}$$
(5)

Einstein’s time-dependent field equations are then given by

$$\begin{aligned} \rho= & {} \frac{1}{A^2}\left( 2\frac{\dot{B}}{B} + \frac{\dot{Y}}{Y}\right) \frac{\dot{Y}}{Y} \nonumber \\&-\, \frac{1}{B^2}\left[ 2\frac{Y''}{Y} + \left( \frac{Y'}{Y}\right) ^2 - 2\frac{B'}{B}\frac{Y'}{Y} -\left( \frac{B}{Y}\right) ^2\right] , \end{aligned}$$
(6)
$$\begin{aligned} p_r= & {} -\frac{1}{A^2} \left[ 2\frac{{{\ddot{Y}}}}{Y} - \left( 2\frac{\dot{A}}{A} - \frac{\dot{Y}}{Y}\right) \frac{\dot{Y}}{Y}\right] \nonumber \\&+ \,\frac{1}{B^2}\left( 2\frac{A'}{A} + \frac{Y'}{Y}\right) \frac{Y'}{Y}- \frac{1}{Y^2}, \end{aligned}$$
(7)
$$\begin{aligned} p_{t}= & {} -\frac{1}{A^2}\left[ \frac{{\ddot{B}}}{B} + \frac{{\ddot{Y}}}{Y} - \frac{\dot{A}}{A}\left( \frac{\dot{B}}{B} + \frac{\dot{Y}}{Y}\right) + \frac{\dot{B}}{B}\frac{\dot{Y}}{Y}\right] \nonumber \\&+\, \frac{1}{B^2}\left[ \frac{A''}{A} + \frac{Y''}{Y} - \frac{A'}{A}\frac{B'}{B} + \left( \frac{A'}{A} - \frac{B'}{B}\right) \frac{Y'}{Y}\right] , \end{aligned}$$
(8)
$$\begin{aligned} q= & {} \frac{2}{AB}\left( \frac{\dot{Y'}}{Y} - \frac{\dot{B}}{B}\frac{Y'}{Y} - \frac{\dot{Y}}{Y}\frac{A'}{A}\right) . \end{aligned}$$
(9)

In the above, \(\rho \), \(p_{r}\), \(p_{t}\) and q are the energy density, radial pressure, tangential pressure and radial heat flux respectively.

2.1 The Karmarkar condition

The Karmarkar condition [22], which allows for the embedding of a four-dimensional spacetime into a five-dimensional pseudo-Euclidean space, is given in terms of the following relationship with respect to the components of the Riemann tensor, namely

$$\begin{aligned} {\mathscr {R}}_{1010} {\mathscr {R}}_{2323} = {\mathscr {R}}_{1212} {\mathscr {R}}_{3030} - {\mathscr {R}}_{1220} {\mathscr {R}}_{1330}, \end{aligned}$$
(10)

where the notation (0, 1, 2, 3) represents the coordinates \((t, r, \theta , \phi )\). We then consider the metric (1) and calculate Karmarkar’s condition for a shearing, nonstatic spherically symmetric metric. The relevant nonzero Riemann tensor components are

$$\begin{aligned} {\mathscr {R}}_{1010}= & {} \frac{1}{AB}\biggl (-B^2{\ddot{B}}A+A^2{A}^{\prime \prime }B -{B}^{\prime }{A}^{\prime }A^2+{\dot{B}}{\dot{A}}B^2\biggr ), \nonumber \\ {\mathscr {R}}_{1212}= & {} \frac{Y}{A^2 B}\biggl (-{Y}^{\prime \prime }BA^2+ {B}^{\prime }{Y}^{\prime }A^2+B^2{\dot{B}}{\dot{Y}}\biggr ), \nonumber \\ {\mathscr {R}}_{1220}= & {} \frac{-Y}{AB}\biggl (-{{\dot{Y}}}^{\prime }AB+{\dot{B}}{Y}^{\prime }A+ {A}^{\prime }{\dot{Y}}B\biggr ), \nonumber \\ {\mathscr {R}}_{1330}= & {} \frac{-Y\sin ^2{\theta }}{A B}\biggl (-{{\dot{Y}}}^{\prime }BA+{\dot{B}}{Y}^\prime A+{A}^{\prime }{\dot{Y}}B\biggr ), \nonumber \\ {\mathscr {R}}_{2323}= & {} \frac{Y^2\sin ^2{\theta }}{B^2 A^2}\biggl (B^2A^2-{{Y}^{\prime }}^2A^2+{{\dot{Y}}}^2B^2\biggr ), \nonumber \\ {\mathscr {R}}_{3030}= & {} \frac{Y\sin ^2{\theta }}{AB^2}\biggl (-{\ddot{Y}}B^2A+A^2{A}^{\prime }{Y}^{\prime }+{\dot{Y}}{\dot{A}}B^2\biggr ). \nonumber \\ \end{aligned}$$
(11)

which results in the following expression for the Karmarkar condition:

$$\begin{aligned} 0= & {} AB\bigg (A {Y}^{\prime }{\dot{B}} +B{A}^{\prime }{\dot{Y}}-AB{\dot{Y}}^{\prime }\bigg )^2 \nonumber \\&+ \bigg (A^2B^2-A^2{{Y}^{\prime }}^2+B^2{{\dot{Y}}}^2\bigg ) \nonumber \\&\times \bigg (-A^2{A}^{\prime }{B}^{\prime }+A^2B{A}^{\prime \prime }+B^2{\dot{A}}{\dot{B}}-AB^2{\ddot{B}}\bigg )\nonumber \\&- \bigg (A^2{B}^{\prime }{Y}^{\prime }-A^2B{Y}^{\prime \prime }+B^2{\dot{B}}{\dot{Y}}\bigg )\nonumber \\&\times \bigg (A^2{A}^{\prime }{Y}^{\prime }+B^2{\dot{A}}{\dot{Y}}-AB^2{\ddot{Y}}\bigg ). \end{aligned}$$
(12)

3 Lie symmetries of differential equations

In the context of geometry a differential equation (DE) may be considered as a function \(H=H(y^{i},u^{A},u_{,i}^{A},u_{,ij}^{A},\ldots )\) in the jet-space \(B=B\left( y^{i},u^{A},u_{,i}^{A},u_{,ij}^{A},\ldots \right) \), where \(\left\{ y^{i}\right\} \) are the independent variables and \(u^{A}\) are the dependent variables, while comma means derivative with respect to the variable \(y^{i}\), that is \(u_{,i}^{A}=\frac{\partial u^{A}}{\partial y^{i}}\).

Consider the infinitesimal one-parameter point transformation

$$\begin{aligned} {\bar{x}}^{i}= & {} x^{i}+\varepsilon \xi ^{i}(x^{k},u^{B}), \end{aligned}$$
(13)
$$\begin{aligned} {\bar{u}}^{A}= & {} {\bar{u}}^{A}+\varepsilon \eta ^{A}(x^{k},u^{B}), \end{aligned}$$
(14)

with generator

$$\begin{aligned} {\mathbf {X}}=\xi ^{i}(x^{k},u^{B})\partial _{x^{i}}+\eta ^{A}(x^{k},u^{B} )\partial _{u^{A}}. \end{aligned}$$
(15)

The vector field \({\mathbf {X}}\) which defines the infinitesimal transformation (13)–(14) is called a Lie point symmetry of the DE H if there exists a function \(\kappa \) such that the following condition holds [37,38,39]

$$\begin{aligned} {\mathbf {X}}^{[n]}(H)=\kappa H,~modH=0, \end{aligned}$$
(16)

where

$$\begin{aligned} {\mathbf {X}}^{[n]}={\mathbf {X}}+\eta _{i}^{A}\partial _{u_{i}^{A}}+\eta _{ij} ^{A}\partial _{u_{ij}^{A}}+\cdots \end{aligned}$$
(17)

is the nth extension vector. Coefficient \(\eta _{i}^{A}\) of the first extension vector is defined as

$$\begin{aligned} \eta _{i}^{A} =\eta _{,i}^{A}+u_{,i}^{B}\eta _{,B}^{A}- \xi _{,i}^{j}u_{,j}^{A}-u_{,i}^{A}u_{,j}^{B}\xi _{,B}^{j}, \end{aligned}$$
(18)

coefficient \(\eta _{ij}^{A}\) of the second extension vector is given by the expression

$$\begin{aligned} \eta _{ij}^{A}= & {} \eta _{,ij}^{A}+2\eta _{,B(i}^{A}u_{,j)}^{B}- \xi _{,ij}^{k}u_{,k}^{A}+\eta _{,BC}^{A}u_{,i}^{B}u_{,j}^{C}\nonumber \\&-2\xi _{,(i|B|}^{k}u_{j)}^{B}u_{,k}^{A}-\xi _{,BC}^{k}u_{,i}^{B}u_{,j}^{C}u_{,k}^{A}+ \eta _{,B}^{A}u_{,ij}^{B}\nonumber \\&-2\xi _{,(j}^{k}u_{,i)k}^{A}-\xi _{,B}^{k}\left( u_{,k}^{A}u_{,ij}^{B}+2u_{(,j}^{B}u_{,i)k}^{A}\right) \end{aligned}$$
(19)

while coefficient \(\eta _{ij\ldots j_{n}}^{A}\) of the nth extension vector is defined as

$$\begin{aligned} \eta _{ij\ldots j_{n}}^{A}=D\eta _{ij\ldots j_{n-1}}^{A}-u_{ij\ldots k}^{A}D_{j_{n}}\xi ^{k}. \end{aligned}$$
(20)

The main application of Lie point symmetries of a DE is focused on the construction of invariant functions which can be used for the determination of invariant solutions also known as similarity solutions.

For the Lie point symmetry \({\mathbf {X}}\) of the differential equation H we define the Lagrange system [37,38,39] as

$$\begin{aligned} \frac{dx^{i}}{\xi ^{i}}=\frac{du^{A}}{\eta ^{A}}=\frac{du_{i}^{A}}{\eta _{\left[ i\right] }^{A}}=\frac{du_{ij}^{A}}{\eta _{\left[ ij\right] }^{A}}=\cdots \end{aligned}$$
(21)

whose solution provides the characteristic functions \(W^{\left[ 0\right] }\left( y^{k},u\right) ,~W^{\left[ 1\right] }\left( y^{k},u,u_{i}\right) \), \(W^{\left[ 2\right] }\left( y^{k},u,u_{,i},u_{ij}\right) ,\ldots .\)

The characteristic functions, can be applied to reduce the order of the DE (in the case of ordinary differential equations) or the number of the dependent variables (in the case of partial differential equations).

3.1 One-dimension optimal system

For a given differential equation H which admit a Lie algebra \(G_{n}\) of dimension \(\dim G_{n}=n\) and elements \(\left\{ X_{1},~X_{2},\ldots X_{n}\right\} ,\) we consider the two generic vector fields [40]

$$\begin{aligned} Z = \sum \limits _{i=1}^{n}a_{i}X_{i},\quad W =\sum \limits _{i=1}^{n}b_{i}X_{i}, \end{aligned}$$
(22)

where \(a_{i},~b_{i}\) are constants.

The vector fields Z,  W are equivalent and leads to the same similarity transformation if and only if

$$\begin{aligned} {\mathbf {W}} = {\prod \limits _{i}}Ad\left( \exp \left( \varepsilon _{i}X_{i}\right) \right) {\mathbf {Z}} \end{aligned}$$
(23)

or

$$\begin{aligned} W=cZ,~c=const. \end{aligned}$$
(24)

where the operator \(Ad\left( \exp \left( \varepsilon X_{i}\right) \right) \) is the Adjoint operator defined as [40]

$$\begin{aligned}&Ad\left( \exp \left( \varepsilon X_{i}\right) \right) X_{j}\nonumber \\&\quad = X_{j} - \varepsilon \left[ X_{i},X_{j}\right] +\frac{1}{2}\varepsilon ^{2}\left[ X_{i},\left[ X_{i},X_{j}\right] \right] +\cdots \end{aligned}$$
(25)

which is used to determine the Adjoint representation. Hence, in order to perform a complete classification for the similarity solutions of a given differential equation we should determine all the one-dimensional independent symmetry vectors of the Lie algebra \(G_{n}\).

In the following sections we consider special forms for the unknown metric functions such that there is only one unknown function, for that models we perform a detailed analysis of the Karmarkar condition by using the Lie’s theory. In particular we determine the Lie point symmetries and the one-dimensional optimal system for the Karmarkar condition, while we determine similarity solutions.

4 Model A: conformally flat metric

Consider \(A\left( t,r\right) = B\left( t,r\right) \) and \(Y\left( t,r\right) =rB\left( t,r\right) \). In this case, the line element (1) is,

$$\begin{aligned} ds^2 = B^2 \left( t,r\right) \left( -dt^{2}+dr^{2}+r^{2}d\varOmega ^{2}\right) \end{aligned}$$
(26)

and the field equations are given by

$$\begin{aligned} \rho= & {} \frac{1}{B^4}\bigg (3 {\dot{B}}^2 + B'^2 - 2 \frac{B}{r}\left( 2 B' + r B'' \right) \bigg ) \end{aligned}$$
(27)
$$\begin{aligned} p_r= & {} \frac{1}{B^4}\bigg ( {\dot{B}}^2 + 3 B'^2 + \frac{B}{r} \left( 4 B' - 2 r {\ddot{B}} \right) \bigg ) \end{aligned}$$
(28)
$$\begin{aligned} p_t= & {} \frac{1}{B^4}\bigg ( {\dot{B}}^2 - B'^2 + 2 \frac{B}{r} \left( B' + r B'' - r {\ddot{B}} \right) \bigg ) \end{aligned}$$
(29)
$$\begin{aligned} q= & {} \frac{2}{B^4}\bigg ( B \dot{B'} - 2 {\dot{B}} B' \bigg ). \end{aligned}$$
(30)

A spacetime with line element (26) is conformally flat and admits fifteen Conformal Killing vector fields (CKVs). For the conformally flat metric (26) where \(B\left( t,r\right) \) is the unique unknown function, the Karmarkar condition becomes,

$$\begin{aligned} 0= & {} -4 r^2 {\dot{B}}B' {\dot{B}}' + B \left( r^2 {\dot{B}}'^2 + B'^2 - r B'' B' + r {\ddot{B}}\left( B' - r B'' \right) \right) \nonumber \\&+\,2 r B'^2 \left( r {\ddot{B}} + B' \right) + 2 r {\dot{B}}^2 \left( r B'' - B' \right) . \end{aligned}$$
(31)

We apply the Lie theory to Eq. (31) from which we obtain the Lie point symmetry vectors

$$\begin{aligned} X_{1}= & {} \partial _{t},~X_{2}=B\partial _{B},~X_{3}=B^{2}\partial _{B},~X_{4}= \frac{1}{r}\partial _{r},\\ X_{5}= & {} tB^{2}\partial _{B},~X_{6}=\left( r^{2}-t^{2}\right) B^{2}\partial _{B},~X_{7}=t\partial _{t}+r\partial _{r}. \end{aligned}$$

The admitted Lie symmetries form a seven-dimensional Lie algebra \(G_{A}\), i.e. \(\dim G_{A} = 7\), and the associated commutators are shown in Table 1. Moreover, in Table 2 we present the Adjoint representation for the elements of the Lie algebra \(G_{A}\).

Table 1 Commutators of the admitted Lie point symmetries for the Karmarkar condition (26)
Table 2 Adjoint representation for the admitted Lie point symmetries for the Karmarkar condition (26)

We continue by using the results in Tables 1 and 2 to derive the one-dimensional optimal system for the partial differential equation (31). Consider the generic symmetry vector

$$\begin{aligned} Z =\alpha _{1}X_{1}+\alpha _{2}X_{2}+\alpha _{3}X_{3}+\alpha _{4}X_{4}+ \alpha _{5}X_{5}+\alpha _{6}X_{6}+\alpha _{7}X_{7}. \end{aligned}$$
(32)

From Table 2 we see that by applying the following adjoint representations

$$\begin{aligned} Z^{\prime }= & {} Ad\left( \exp \left( \varepsilon _{2}X_{2}\right) \right) Ad\left( \exp \left( \varepsilon _{5}X_{5}\right) \right) Ad\left( \exp \left( \varepsilon _{6}X_{6}\right) \right) \nonumber \\&\times \, Ad\left( \exp \left( \varepsilon _{1}X_{1}\right) \right) Z, \end{aligned}$$
(33)

for specific values of \(\varepsilon _{1,}~\varepsilon _{2},~\varepsilon _{5}\) and \(\varepsilon _{6}\) it follows that

$$\begin{aligned} Z^{\prime }=\alpha _{2}^{\prime }X_{2}+\alpha _{4}^{\prime }X_{4}+\alpha _{7}^{\prime }X_{7}. \end{aligned}$$
(34)

Thus, the two vector fields \(Z^{\prime }\) and Z are equivalent and lead to the same similarity solution. Coefficient constants \(\alpha _{2},~\alpha _{4}\) and \(\alpha _{7}\) are called relative invariants of the full adjoint action. Thus, in order to derive the relative invariants we solve the following system of partial differential equation [40]

$$\begin{aligned} \varDelta \left( \phi \left( \alpha _{i}\right) \right) = C_{ij}^{k}\alpha ^{i}\frac{\partial }{\partial \alpha _{j}} \end{aligned}$$
(35)

where \(C_{ij}^{k}\) are the structure constants of the Lie algebra \(G_{A}\) as presented in Table 1. Hence, system (35) becomes

$$\begin{aligned} \alpha _{5}\frac{\partial \phi }{\partial \alpha _{3}}-2\alpha _{6} \frac{\partial \phi }{\partial \alpha _{5}} + \alpha _{7} \frac{\partial \phi }{\partial \alpha _{1}}= & {} 0, \end{aligned}$$
(36)
$$\begin{aligned} \alpha _{3}\frac{\partial \phi }{\partial \alpha _{3}}+\alpha _{5}\frac{\partial \phi }{\partial \alpha _{5}}+\alpha _{6}\frac{\partial \phi }{\partial \alpha _{6}}= & {} 0, \end{aligned}$$
(37)
$$\begin{aligned} -\alpha _{2}\frac{\partial \phi }{\partial \alpha _{3}}= & {} 0, \end{aligned}$$
(38)
$$\begin{aligned} 2\alpha _{6}\frac{\partial \phi }{\partial \alpha _{3}}= & {} 0, \end{aligned}$$
(39)
$$\begin{aligned} -\alpha _{1}\frac{\partial \phi }{\partial \alpha _{3}}-\left( \alpha _{2} +\alpha _{7}\right) \frac{\partial \phi }{\partial \alpha _{5}}= & {} 0, \end{aligned}$$
(40)
$$\begin{aligned} 2\alpha _{1}\frac{\partial \phi }{\partial \alpha _{5}}-\left( \alpha _{2} +2\alpha _{7}\right) \frac{\partial \phi }{\partial \alpha _{6}}-2\alpha _{4} \frac{\partial \phi }{\partial \alpha _{3}}= & {} 0, \end{aligned}$$
(41)
$$\begin{aligned} -\alpha _{1}\frac{\partial \phi }{\partial \alpha _{1}}+\alpha _{5}\frac{\partial \phi }{\partial \alpha _{5}}+\alpha _{6}\frac{\partial \phi }{\partial \alpha _{6}}= & {} 0, \end{aligned}$$
(42)

from where it follows \(\phi \left( \alpha _{i}\right) = \phi \left( \alpha _{2},\alpha _{4},\alpha _{7}\right) \), that is, the relative invariants are \(\left\{ \alpha _{2},\alpha _{4},\alpha _{7}\right\} \).

For \(\alpha _{7}=0\), we find the equivalent symmetry vector

$$\begin{aligned} Z^{\prime \prime }=\alpha _{1}^{\prime \prime }X_{1}+\alpha _{2}^{\prime \prime } X_{2}+\alpha _{4}^{\prime \prime }X_{4}. \end{aligned}$$
(43)

On the other hand for \(\alpha _{2}=0\), the equivalent symmetry vector is

$$\begin{aligned} Z^{\prime \prime \prime }=\alpha _{4}^{\prime \prime \prime }X_{4}+\alpha _{7} ^{\prime \prime \prime }X_{7}, \end{aligned}$$
(44)

while when \(\alpha _{4}=0\), the resulting equivalent symmetry vector is derived

$$\begin{aligned} Z^{\prime \prime \prime \prime }=\alpha _{2}^{\prime \prime \prime \prime }X_{2} +\alpha _{7}^{\prime \prime \prime \prime }X_{7}. \end{aligned}$$
(45)

Similarly, the following equivalent symmetry vectors are obtained:

$$\begin{aligned} \{\alpha _{2}= & {} 0,~\alpha _{4}=0\} ~\Rightarrow ~ {\bar{Z}}={\bar{\alpha }}_{7}X_{7},\\ \{\alpha _{4}= & {} 0,~\alpha _{7}=0\} ~\Rightarrow ~ {\bar{Z}}^{\prime }={\bar{\alpha }}_{1}^{\prime }X_{1}+{\bar{\alpha }}_{2}^{\prime }X_{2},\\ \{\alpha _{2}= & {} 0,~\alpha _{7}=0\} ~\Rightarrow ~ {\bar{Z}}^{\prime \prime }={\bar{\alpha }}_{1}^{\prime \prime }X_{1}+ {\bar{\alpha }}_{4}^{\prime \prime }X_{4}+{\bar{\alpha }}_{5}^{\prime \prime }X_{5}+ {\bar{\alpha }}_{6}^{\prime \prime }X_{6},\\ \{\alpha _{2}= & {} 0,~\alpha _{4}=0,~\alpha _{7}=0\} ~\Rightarrow ~ {\bar{Z}}^{\prime \prime \prime } = {\bar{\alpha }}_{1}^{\prime \prime \prime }X_{1}+{\bar{\alpha }} _{5}^{\prime \prime \prime }X_{5}+{\bar{\alpha }}_{6}^{\prime \prime \prime }X_{6}. \end{aligned}$$

Thus, a one-dimensional optimal system is constructed from the one-dimensional Lie algebras:

$$\begin{aligned}&\{X_1\} ,~ \{X_2\} ,~ \{X_3\} ,~ \{X_4\} ,~ \{X_5\} ,~ \{X_6\} ,~ \{X_7\} ,~\\&\{X_1 + \alpha X_5\} ,~ \{X_1 + \alpha X_6\} ,~ \{X_5 + \alpha X_6\} ,~ \{X_2 + \alpha X_7\} ,~\\&\{X_5 + \alpha X_7\} ,~ \{X_1 + \alpha X_4\} ,~ \{X_4 + \alpha X_5\} ,~ \{X_4 + \alpha X_6\} ,~\\&\{X_1 + \alpha X_2 + \beta X_4\} ,~ \{X_1 + \alpha X_5 + \beta X_6\} ,~ \{X_4 + \alpha X_1 + \beta X_5\} ,~\\&\{X_4 + \alpha X_1 + \beta X_6\} ,~ \{X_4 + \alpha X_5 + \beta X_6\} ,~ \{X_2 + \alpha X_4 + \beta X_7\} . \end{aligned}$$

We proceed by using the Lie symmetries to determine similarity transformations. Application of the Lie point symmetries lead to exact solutions expressed in closed-form functions. These are given in Appendix A.

5 Model B: Weyl-free collapse

We proceed with our study on the Karmarkar condition by assuming Weyl-free collapse spacetimes, where

$$\begin{aligned} A\left( t,r\right)= & {} \left( 1-\omega ^{2}r^{2}\right) ^{1/2} B\left( t,r\right) \nonumber \\ Y\left( t,r\right)= & {} rB\left( t,r\right) \end{aligned}$$
(46)

that is, the line element (1) becomes

$$\begin{aligned} ds^{2}=B^{2}\left( t,r\right) \left[ -\left( 1-\omega ^{2}r^{2}\right) dt^{2}+dr^{2}+r^{2}d\varOmega ^{2}\right] \end{aligned}$$
(47)

and the field equations become

$$\begin{aligned} \rho= & {} \frac{1}{B^4}\bigg (B'^2 + \frac{3 {\dot{B}}^2}{1 - \omega ^2 r^2} - \frac{2 B \left( 2 B' + r B'' \right) }{r} \bigg ) \end{aligned}$$
(48)
$$\begin{aligned} p_r= & {} \frac{1}{(1 - \omega ^2 r^2) B^4}\bigg (2 \frac{B}{r} \left( \left( 2 - 3 \omega ^2 r^2 \right) B' - r {\ddot{B}}\right) \nonumber \\&+ \left( {\dot{B}}^2 + 3 \left( 1 - \omega ^2 r^2\right) B'^2 \right) - 2 \omega ^2 B^2 \bigg ) \end{aligned}$$
(49)
$$\begin{aligned} p_t= & {} \frac{1}{(1 - \omega ^2 r^2) B^4}\bigg (2 \frac{B}{r} \bigg (\left( 1 - 2 \omega ^2 r^2 \right) B' \nonumber \\&+\, r \left( 1 - \omega ^2 r^2\right) B'' - r {\ddot{B}} \bigg ) - \bigg (\left( 1 - \omega ^2 r^2\right) B'^2 - {\dot{B}}^2\bigg ) \nonumber \\&-\, \omega ^2 \frac{\left( 2 - \omega ^2 r^2\right) }{\left( 1 - \omega ^2 r^2 \right) } B^2 \bigg ) \end{aligned}$$
(50)
$$\begin{aligned} q= & {} \frac{1}{(1 - \omega ^2 r^2)^{3/2} B^4}\bigg (2 B \left( \left( 1 - \omega ^2 r^2 \right) \dot{B'} + r \omega ^2 {\dot{B}} \right) \nonumber \\&-\,4 \left( 1 - \omega ^2 r^2 \right) {\dot{B}} B' \bigg ) \end{aligned}$$
(51)

with \(\omega \ne 0\). Recall that in the limit where \(\omega =0,\) the latter line element describes the conformally flat spacetime (26). The Karmarkar condition for the above line element is

$$\begin{aligned} 0= & {} r \omega ^2 B^2 \left( \left( r^2 \omega ^2+1\right) B' + r \left( r^2 \omega ^2-1\right) B'' \right) \nonumber \\&+\, B \bigg (r^2 {\dot{B}}' \left( \left( 1-r^2 \omega ^2\right) {\dot{B}}' + 2 r \omega ^2 {\dot{B}}\right) + r \left( r^2 \omega ^2-1\right) B' B'' \nonumber \\&+\, r \left( r^2 \omega ^2 - 1\right) \left( r B'' - B' \right) {\ddot{B}} + \left( 1 + r^2 \omega ^2 - r^4 \omega ^4\right) B'^2\bigg ) \nonumber \\&-\, 2 r \bigg ({\dot{B}}^2 \left( \left( r^2 \omega ^2+1\right) B' + r \left( r^2 \omega ^2-1\right) B'' \right) \nonumber \\&-\, 2 r \left( r^2 \omega ^2-1\right) B' {\dot{B}}' {\dot{B}} + \left( r^2 \omega ^2-1\right) \left( r {\ddot{B}} + B' \right) B'^2 \bigg ). \end{aligned}$$
(52)

This admits a six-dimensional Lie algebra, \(G_{B}\), consisted by the Lie symmetry vectors

$$\begin{aligned} Y_{1}= & {} \partial _{t},~Y_{2}=B\partial _{B},~Y_{3}=\left( 1+\omega ^{2}r^{2}\right) B^{2}\partial _{B}, \\ Y_{4}= & {} e^{-2\omega t}\left( \omega ^{2}r^{2}-1\right) \partial _{B},~Y_{5}=e^{2\omega t}\left( \omega ^{2}r^{2}-1\right) \partial _{B},\\ Y_{6}= & {} \left( \omega ^{2}r^{2}-1\right) \left( 2\omega ^{2}B\partial _{B}-\frac{\left( 1+\omega ^{2}r^{2}\right) }{r}\partial _{r}\right) . \end{aligned}$$

In Table 3 we present the commutators of the Lie algebra \(G_{B}\) while in Table 4 the Adjoint representation is given, necessary for the derivation of the one-dimensional optimal system.

Table 3 Commutators of the admitted Lie point symmetries for the Karmarkar condition for the Weyl-free collapse spacetimes

Hence, the system of the partial differential equations (35) which provides the relative invariants is simplified as

$$\begin{aligned} \frac{\partial \phi }{\partial \alpha _{3}} = 0,\quad \frac{\partial \phi }{\partial \alpha _{4}}=0,\quad \frac{\partial \phi }{\partial \alpha _{5}}=0, \end{aligned}$$
(53)

which means that \(\phi \left( \alpha _{I}\right) =\phi \left( \alpha _{1},\alpha _{2},\alpha _{6}\right) \).

Table 4 Adjoint representation for the admitted Lie point symmetries for the Karmarkar condition for the Weyl-free collapse spacetimes

Assume the generic symmetry vector \(W=\alpha _{1}Y_{1}+\alpha _{2}Y_{2}+\alpha _{3}Y_{3}+\alpha _{4}Y_{4}+\alpha _{5}Y_{5}+\alpha _{6}Y_{6}\), then when \(\alpha _{1}\alpha _{2}\alpha _{6}\ne 0\), the equivalent symmetry vector is

$$\begin{aligned} W^{\prime }=\alpha _{1}^{\prime }Y_{1}+\alpha _{2}^{\prime }Y_{2}+\alpha _{6}^{\prime }Y_{6}. \end{aligned}$$
(54)

For \(\alpha _{6}=0\), the equivalent vector field is \(W^{\prime \prime }=\alpha _{1}^{\prime \prime }Y_{1}+\alpha _{2}^{\prime \prime }Y_{2}\). For \(\alpha _{4}=0\), it follows that \(W^{\prime \prime \prime }=\alpha _{1}^{\prime \prime \prime }Y_{1}+\alpha _{3}^ {\prime \prime \prime }Y_{3}+\alpha _{6}^{\prime \prime \prime }Y_{6}\), and when \(\alpha _{1}=0\) we have the equivalent symmetry vector \(~W^{\prime \prime \prime \prime }=\alpha _{2}^{\prime \prime \prime \prime } Y_{2}+\alpha _{6}^{\prime \prime \prime \prime }Y_{6}.\)

Similarly, the following equivalent symmetry vectors are obtained:

$$\begin{aligned} \{\alpha _{1}= & {} 0,~\alpha _{6}=0\} ~\Rightarrow ~ {\bar{W}}={\bar{\alpha }}_{2}Y_{2},\\ \{\alpha _{1}= & {} 0,~\alpha _{2}=0\} ~\Rightarrow ~ {\bar{W}}^{\prime }={\bar{\alpha }}_{3}^{\prime }Y_{3}+{\bar{\alpha }}_{6}^{\prime }Y_{6},\\ \{\alpha _{2}= & {} 0,~\alpha _{6}=0\} ~\Rightarrow ~ {\bar{W}}^{\prime \prime }={\bar{\alpha }}_{1}^{\prime \prime }Y_{1} +{\bar{\alpha }}_{3}^{\prime \prime }Y_{3},\\ \{\alpha _{1}= & {} 0,~\alpha _{2}=0,~\alpha _{6}=0\} ~\Rightarrow ~ {\bar{W}}^{\prime \prime \prime }={\bar{\alpha }}_{3}^{\prime \prime \prime }Y_{3} +{\bar{\alpha }}_{4}^{\prime \prime \prime }Y_{4}+{\bar{\alpha }}_{5}^{\prime \prime \prime }Y_{5}. \end{aligned}$$

We conclude that the one-dimensional optimal system consisted by the one-dimensional Lie algebras:

$$\begin{aligned}&\{Y_1\} ,~ \{Y_2\} ,~ \{Y_3\} ,~ \{Y_4\} ,~ \{Y_5\} ,~ \{Y_6\} ,\\&\{Y_1 + \alpha Y_2\} ,~ \{Y_1 + \alpha Y_3\} ,~ \{Y_1 + \alpha Y_6\} ,~ \{Y_2 + \alpha Y_6\} ,\\&\{Y_3 + \alpha Y_4\} ,~ \{Y_3 + \alpha Y_5\} ,~ \{Y_3 + \alpha Y_6\} ,~ \{Y_4 + \alpha Y_5\} ,\\&\{Y_1 + \alpha Y_3 + \alpha Y_6\} ,~ \{Y_1 + \alpha Y_2 + \beta Y_6\} ,~ \{Y_3 + \alpha Y_4 + \beta Y_5\}. \end{aligned}$$

We proceed with the presentation of the similarity solutions which are expressed by closed-form functions. These are given in Appendix B.

6 Model C: shear-free collapse

Consider the shear-free collapse spacetime where \(Y\left( t,r\right) = rB\left( t,r\right) \) and \(A\left( t,r\right) = B\left( t,r\right) ^{-N}\) with \(N\ne -1\). The line element (1) then becomes,

$$\begin{aligned} ds^{2} = B^{2}\left( t,r\right) \left[ -B^{-2(N + 1)}\left( t,r\right) dt^{2}+dr^{2}+r^{2}d\varOmega ^{2}\right] \end{aligned}$$
(55)

and the associated field equations are given by

$$\begin{aligned} \rho= & {} \frac{1}{B^4}\bigg (3 ({\dot{B}}B^{N+1})^2 + B'^2 - \frac{2B}{r} \left( 2 B' + r B'' \right) \bigg ) \end{aligned}$$
(56)
$$\begin{aligned} p_r= & {} \frac{1}{B^4}\bigg (-(2N + 1) ({\dot{B}}B^{N+1})^2 - 2 {\ddot{B}}B^{2 N+3} \nonumber \\&- 2(N-1)\frac{B' B}{r} + (1-2 N) B'^2 \bigg ) \end{aligned}$$
(57)
$$\begin{aligned} p_t= & {} \frac{1}{B^4}\bigg (\left( N^2+N-1\right) B'^2 - (2 N+1) ({\dot{B}}B^{N+1})^2 \nonumber \\&- 2 {\ddot{B}} B^{2 N+3}-(N-1) \left( B' + r B'' \right) \frac{B}{r} \bigg ) \end{aligned}$$
(58)
$$\begin{aligned} q= & {} 2 B^{N-3} \left( (N-1) {\dot{B}} B' + B \dot{B'} \right) . \end{aligned}$$
(59)

The Karmarkar condition then gives

$$\begin{aligned} 0= & {} \left( 2N^2 + 3 N + 1\right) r ({\dot{B}} B' B^{N+1})^2 - N (N+1) r B'^4 \nonumber \\&- 2B^{2 N+3} \left( N {\dot{B}}^2 \left( r B'' - B' \right) - (N-1) r B' {\dot{B}}' {\dot{B}} - r {\ddot{B}} B'^2\right) \nonumber \\&+ B^{2N+4}\left( r {\dot{B}}'^2 + {\ddot{B}}\left( B' - r B'' \right) \right) + \frac{N B'B^2}{r} \left( r B'' - B' \right) \nonumber \\&- 2 N(N+2) B'^3 B. \end{aligned}$$
(60)

The resulting Karmarkar condition admits a three dimensional Lie algebra, \(G_{C}\), consisted by the Lie symmetry vectors

$$\begin{aligned} Z_{1} =\partial _{t},~Z_{2}=r\partial _{r}-\frac{1}{N+1}B \partial _{B},~Z_{3}=t\partial _{t}+\frac{1}{N+1}B\partial _{B}, \end{aligned}$$
(61)

with commutators and Adjoint representation as given in Table 5.

Table 5 Commutators and Adjoint representation of the admitted Lie point symmetries for the Karmarkar condition for the model C

We calculate that the relative invariants are \(\alpha _{2},\alpha _{3}\), from which we conclude that the one-dimensional optimal system comes from the one-dimensional Lie algebras

$$\begin{aligned} \left\{ Z_{1}\right\} ,~\left\{ Z_{2}\right\} ,~\left\{ Z_{3}\right\} ,~\left\{ Z_{1}+\alpha Z_{2}\right\} ,~\left\{ Z_{2}+\alpha Z_{3}\right\} . \end{aligned}$$

The solution is given in Appendix C.

7 A radiating, Weyl-free model

By assuming Weyl-free collapse spacetimes where the line element is given by

$$\begin{aligned} ds^{2}=B^{2}\left( t,r\right) \left[ -\left( 1-\omega ^{2}r^{2}\right) dt^{2}+dr^{2}+r^{2}d\varOmega ^{2}\right] , \end{aligned}$$
(62)

application of the Lie symmetry vector \(X_{1}+\alpha X_{6}\) gives the similarity solution

$$\begin{aligned} B\left( t, r\right) = -\frac{8\alpha \omega ^{2}}{\omega ^{2}r^{2} + 1}\left( \lambda _{1}e^{-4z\alpha \omega ^{2}}-\lambda _{0}\right) ^{-1} \end{aligned}$$
(63)

where \(z=-\frac{1}{4\alpha \omega ^{2}}\left( \ln \left( \frac{\omega ^{2}r^{2}-1}{\omega ^{2}r^{2}+1}\right) +4\alpha \omega ^{2}t\right) \).

By setting \(\lambda _0 = 0\), we find that the solution satisfies the heat-flux boundary condition,

$$\begin{aligned} p_r = qB|_\varSigma \end{aligned}$$
(64)

and a simple radiating model may be generated. From the boundary condition constraint, an expression for \(\alpha \) is obtained,

$$\begin{aligned} \alpha = \frac{\sqrt{3}\sqrt{2 + R^2\omega ^2} - R\omega }{4\omega \sqrt{1 - R^2\omega ^2}} \end{aligned}$$
(65)

where \(R = r_\varSigma \) is the co-moving boundary. We examine the mass function obtained by calculating,

$$\begin{aligned} m = \frac{r^3 B {\dot{B}}^2}{2 A^2} - r^2 B' - \frac{r^3 B'^2}{2B} \end{aligned}$$
(66)

and then search for a function \(\omega (t)\) such that the mass is constant during the distant past and then decreases monotonically from some point in time as the stellar object undergoes non-adiabatic gravitational collapse.

During this investigation, a definitive form for the function \(\omega (t)\) was not obtainable and an ad hoc approach was used in establishing an approximate relationship. This involved calculating values for \(\omega (t)\) for \(t < t_i\) such that the mass function remained constant. The function

$$\begin{aligned} \omega (t) = \frac{a}{b t - c} + \frac{d}{t - e} \end{aligned}$$
(67)

was found to be appropriate for approximating the data obtained.

We consider a mass of \(3 M_\odot \) prior to collapse \((t < -1000)\) with a comoving boundary \(r_\varSigma = 3 \times 10^{10}~\hbox {cm} / c = 1.00~\hbox {s}\). The following parameters were then obtained for the function (67) by solving (66) for time t, obtaining data for \(\omega (t)\) at early times \((t < -1000)\) and then fitting the data to the function (67):

$$\begin{aligned} (a, b, c)\rightarrow & {} (-0.727479, 0.191566, 1399.22) \nonumber \\ (d, e)\rightarrow & {} (-6.25399, 136.291). \end{aligned}$$
(68)

Now that \(\omega (t)\) has been determined, the gravitational potentials are fully specified and a radiating model, based on the Karmarkar condition with vanishing Weyl stress, has been generated.

8 Discussion

The solutions obtained for the conformally flat metric (model A) did not offer the possibility for closed systems satisfying the heat flux boundary condition. Pressure isotropy is however easily invoked which can assist in setting parameters. Cosmological models might then be possible, to be explored in future work.

A solution for the Weyl-free collapse metric (model B) was found to satisfy the heat-flux boundary condition and this was exploited in the previous section. The resulting mass function is shown in Fig. 1. The radial profile is typical of uniform density matter and most of the mass is radiated as the collapse proceeds. The energy density, pressure and heat flux are shown in Figs. 2, 3 and 4. The energy density is uniform and relatively low for a stellar collapse process. The pressure behaves in a similar manner. We note that the heat flux increases towards the surface boundary as the collapse proceeds, so that little heat is generated near the gravitating centre.

Fig. 1
figure 1

Mass radial-temporal profile

Fig. 2
figure 2

Energy density

Fig. 3
figure 3

Pressure

Fig. 4
figure 4

Heat flux

The shear-free solution (model C) is yet to be explored and forms a basis for future work.

9 Conclusion

The use of Lie symmetries in obtaining solutions for conformally flat, Weyl-free and shear-free metrics which in addition, satisfy the Karmarkar condition has been shown. This is a novel method in respect of the time-dependent Karmarkar condition and adds to recent research on this highly active topic [26]. The solutions range from those that are almost trivial to those that are fairly complex. The field equations were given for each case. These can be used for examining the physical viability of the solutions obtained. In searching for solutions that are consistent with the heat-flux boundary condition given according to Santos, a solution obtained for the Weyl-free collapse scenario was found suitable. Other solutions from the other models did not offer a clear means of maintaining a time-independent heat-flux boundary condition. Some of these solutions might be suited to cosmological models in which the energy density may be related to the fourth power of the temperature. In particular, a solution was found with respect to Weyl-free collapse which allows for a radiating model to be constructed. We see from Figs. 1, 2, 3 and 4 that the physical parameters behave in a physically viable manner. The mass decreases monotonically, in a way that is similar to other gravitational collapse models. We note that the mass does not display a simple linear time-dependence as shown in other studies [41]. The solutions presented here compliment the recent solution obtained for the temporal evolution of a conformally flat interior, matched to a Vaidya exterior. This was obtained using Lie symmetry methods [42].