1 Introduction

The canceling out the covariant divergence of Einstein tensor is considered as one of the fundamental assumptions in curved space-time. Such assumption implies that the energy–momentum tensor is conserved. Actually, with an eye to validity of conserved energy–momentum condition in special relativity, one can use the principle of equivalence to validity of this condition in general relativity [1]. Applying variational principle is another way to derive \({\mathcal {T}}_{ \mu ;\nu }^{\nu }=0\). One must assume that the Lagrangian density can be written as a sum of two independent terms, the first term is independent of the derivatives of the metric while second one is independent of the non-gravitational field variables [2]. Finally, as third approach, one can derive \({\mathcal {T}}_{ \mu ;\nu }^{\nu }=0\) on the basis of a classical, statistical model of matter. Here, one must assume that matter consists of particles that collide with one another, geometrically without changing in rest mass during collisions [3].

These assumptions derive \({\mathcal {T}}_{ \mu ;\nu }^{\nu }=0\) are all questionable. The well-known problem of the non-renormalisability of Einstein gravity has given rise to dozen attempts to view it as an effective low-energy theory [4]. In string theory, for instance, the Einstein–Hilbert action is just the first term in an infinite series of gravitational corrections. As result, it is possible in quantumic circumstances in which energy levels increases and or within event horizon of black holes, curvature of spacetime and gravity deviates from the Einsteinian general relativity theory. This can be explained through different scenarios, using more curvature terms, and perturbations in geometry and or as another possible approach through breaking energy–momentum tensor. It depicts the validity of conservation of energy–momentum in special relativity may broke in quantumic mediums and or in high gravity energy levels. Furthermore, the second assumption in which one study Lagrangian of theory to derive \({\mathcal {T}}_{ \mu ;\nu }^{\nu }=0\) is own questionable in astronomy. Coupling two independent terms in Einstein–Hilbert action built some modified theories of gravity, implies \({\mathcal {T}}_{ \mu ;\nu }^{\nu }\ne 0\), and thus to keep \({\mathcal {T}}_{ \mu ;\nu }^{\nu }=0\) in such theories one needs to redefine energy–momentum tensor as effective energy–momentum tensor [5]. Moreover, the creation and annihilation particles in collision process demonstrates the classical, statistical model of matter is valid only for so low temperature system [6].

Beside all plausible theories to address some of these issues, and instead expanding geometrical part of action, it is possible to develop matter term through non-Einsteinian matter source [7] and or ignoring conservation of energy–momentum tensor wherein one can assume \({\mathcal {T}}_{ \mu ;\nu }^{\nu }=a_{\mu }\), when the functions \(a_{\mu }\) vanish in flat spacetime. Such theory is proposed by Rastall in which \(a_{\mu }=\lambda R_{,\mu }\), where \(\lambda \) is proportional constant and \(R=g^{\mu \nu }R_{\mu \nu }\) is the curvature invariant, Ricci scalar [8]. The Rastall theory can be considered as a good candidate for particle creation through its non-minimal coupling [9]. Apart from the celestial object solutions [10,11,12], different cosmological aspects of Rastall gravity are studied [13]. Recently, it is shown that the original Rastall gravity presents the cosmological-like scenario while both density and pressure of corresponded dark energy vary with time [14]. Although Rastall gravity under some conditions is equivalent to Einstein gravity [15], Rastall assumption is own questionable. For instance, one may replace Ricci scalar in relation \({\mathcal {T}}_{ \mu ;\nu }^{\nu }=\lambda R_{,\mu }\) by an arbitrary function of Ricci scalar or other geometrical scalar to illustrate flow of the energy–momentum in curved geometry [16]. This implies in the absence of strong theoretical evidence, one can suggest different form of geometrical scalar built from Riemann tensor and its derivatives to show flux of energy–momentum tensor in curved spacetime, namely

$$\begin{aligned} {\mathcal {T}}_{\,\,\,\, \mu ;\nu }^{\nu }=\lambda f({R,R_{\mu \nu }R^{\mu \nu },R_{\mu \nu \sigma \lambda }R^{\mu \nu \sigma \lambda },\ldots )}_{,\mu }. \end{aligned}$$
(1)

In fact, Rastall argument gives family of modified theory of gravity in which \(T_{\,\,\,\, \mu ;\nu }^{\nu }=\lambda R_{,\mu }\) presents simplest model. Thus, Rastall idea is not clear and needs more considerations.

The contents in the paper are organized as follows. In Sect. 2 and by revisiting covariant thermodynamics laws, we have proposed new modified theory of gravity. Section 3 is devoted to effects of this new modified gravity in very early Universe, inflation era, theoretically. Also, we have investigated the cosmology evolution in late-time through using observations and adding the cosmological constant to field equations. The remarks given in Sect. 5.

2 Covariant thermodynamics and new gravity model

In this section we will investigate first thermodynamics law to explore and introduce new modified theory of gravity. In this context, exploring thermodynamics may lead one to some robust clues. In relativistic thermodynamics the transformation laws of heat and temperature under the Lorentz group is considered as one of the most and opening topics. As example, Einstein and Planck proposed [17, 18]

$$\begin{aligned} \delta Q=\delta Q_{0}\gamma ^{-1}, \quad T=T_{0}\gamma ^{-1} \end{aligned}$$
(2)

while Ott and Arzelies suggested other transformation form [19, 20]

$$\begin{aligned} \delta Q=\delta Q_{0}\gamma , \quad T=T_{0}\gamma \end{aligned}$$
(3)

where \(\delta Q\) and T denote heat and temperature, respectively, the variables with subscript represent those observed in the comoving frame, and \(\gamma \) is the Lorentz factor. In addition to these options, Landsberg assumed that heat and temperature are absolute parameters and thus comoving and independent observers measure same heat and temperature [21, 22]. However, just two first options (2) and (3) can satisfy a relativistic Carnot cycle [23, 24]. In particular, since Einstein theory of relativity is formulated through covariant form, it seems that covariant form of thermodynamics laws is necessary to satisfy Lorentz transformation. One of the earliest attempts in this issue was made by Israel and collaborators [25, 26]. They proposed a 4-vector \(S^{\mu }\) for the flux of entropy in similar way to the 4-vector for the flux of particle number. So, like the particle number that is scalar for comoving observer, it is shown that entropy in its comoving frame is a scalar as well [27]. As result, this model is not in conflict with standard expression of thermodynamical expression only when it is explored by comoving observer. To study such model in a continuous medium we assume that there are some interactions and non-viscous components. In addition to conservation of the energy–momentum tensor given by

$$\begin{aligned} \sum \limits _i {\mathcal {T}}_{\,\,\,\,\, i,\mu }^{\mu \nu } =0 \end{aligned}$$
(4)

there exists number of 4-vector \(J_{ji}^{\mu }=n_{ji}u^{\mu }\), representing the flux densities of conserved charges j for component i-th expressed asFootnote 1

$$\begin{aligned} \sum \limits _i J_{\,\, ji,\mu }^{\mu } =0. \end{aligned}$$
(5)

Introducing the entropy 4-flux \(S_{i}^{\mu }\) and using Gibbs–Duhem relations, one can write the following covariant equation [25]

$$\begin{aligned} \sum \limits _i S_{\,\, i,\mu }^{\mu } =-\sum \limits _i \left( \sum \limits _j {\alpha _{ji}\,\, J_{\,\, ji,\mu }^{\mu }+\beta _{\nu i}{\mathcal {T}}_{i,\mu }^{\mu \nu }} \right) \end{aligned}$$
(6)

where \(\beta _{\nu }=u_{\nu } / T_{0}\) is the inverse temperature 4-vector proposed by Van Kampen [28], and \(\alpha _{j}=\zeta _{j} / T_{0}\). The parameter \(\zeta _{j}\) denotes the relativistic injection energy or chemical potential per particle of type j, related to its classical counterpart by:

$$\begin{aligned} \zeta _{j}=m_{j}+\zeta _{j}^{(classic)}. \end{aligned}$$
(7)

Although this model proposed for interaction between two or among some different fluids, one may use this model for unique field, includes interacting particles carry different chemical potential/charge. Hence, Eq. (6) recasts to

$$\begin{aligned} S_{,\mu }^{\mu }=-\sum \limits _l {\alpha _{l}\,\, J_{\,\, l,\mu }^{\mu }} -\beta _{\nu }{\mathcal {T}}_{,\mu }^{\mu \nu } \end{aligned}$$
(8)

where l represents l-th particle in the finite system. For such explicit case, rearranging Eq. (8) with respect to energy–momentum tensor yields

$$\begin{aligned} {\mathcal {T}}_{,\mu }^{\mu \nu }=-u^{\nu }\left( T_{0}S_{,\mu }^{\mu }+\sum \limits _l {\zeta _{l}\,\, J_{\,\, l,\mu }^{\mu }} \right) . \end{aligned}$$
(9)

For the perfect fluid given by density \(\rho \) and pressure p, the energy–momentum tensor given by

$$\begin{aligned} {\mathcal {T}}^{\mu \nu }=\left( \rho +p \right) u^{\mu }u^{\nu }+pg^{\mu \nu } \end{aligned}$$
(10)

where \(g^{\mu \nu }\) presents contravariant form of metric \(g_{\mu \nu }\). As result, for non-interacting/chargeless fluid, Eq. (9) shrinks to the first law of thermodynamics, namely

$$\begin{aligned} d\rho =\vert T_{0}\vert dS. \end{aligned}$$
(11)

Thus, Eqs. (6) or (8) present entropy and temperature as non-conserved effect of stress-energy tensor in Minkowski geometry. Consequently, in the system includes interacting/charged particles, entropy and temperature evolve and thus the energy–momentum tensor is not conserved in flatness spacetime. It demonstrates one can expand Rastall argument to Minkowskian geometry. On the other hand, Eqs. (6) and or (8) give robust theoretical origin of non-conserved scenario for energy–momentum tensor. In fact, although these equations confirm Rastall viewpoint, unlike his model conservation of energy–momentum is broken with entropy-temperature evolution not Ricci or other geometrical parameters.

In order to generalize Israel model to curved geometry, one just need to use general relativity principle [1],

$$\begin{aligned} \sum \limits _i S_{\,\, i;\mu }^{\mu } =-\sum \limits _i \left( \sum \limits _j {\alpha _{ji}\,\, J_{\,\, ji;\mu }^{\mu }+\beta _{\nu i}{\mathcal {T}}_{i;\mu }^{\mu \nu }} \right) \end{aligned}$$
(12)

in which usual (scalar) derivative replaced by covariant derivative. As result, after some manipulations, the field equations become,

$$\begin{aligned} G_{\mu \nu }-\kappa ^{\prime }\sum \limits _{i} {{u_{{\nu }_{i}}}\left( T_{0}{S_{{\mu }_{i}}}+\sum \limits _j {{{\zeta _{j}}_{i}}{{J_{j\mu }}_{i}}} \right) } =\kappa ^{\prime }\sum \limits _i {{{\mathcal {T}}_{\mu \nu }}_{i}}\nonumber \\ \end{aligned}$$
(13)

where \(\kappa ^{\prime }\) is proportional constant. Defining non-conserved term for each component participated in our system as

$$\begin{aligned} {\mathcal {E}}_{\mu \nu }=u_{\nu }\left( T_{0}S_{\mu }+\sum \limits _j {\zeta _{j}J_{j\mu }} \right) \end{aligned}$$
(14)

recasts field equations (13) like

$$\begin{aligned} G_{\mu \nu }-\kappa ^{\prime }\sum \limits _i {E_{{\mu \nu }_{i}}} =\sum \limits _i {{\mathcal {T}}_{{\mu \nu }_{i}}} \end{aligned}$$
(15)

which shows each fluid plays explicit role in field equations.

Summation on all different components participated in system (summation on index i), yields,

$$\begin{aligned} G_{\mu \nu }-\kappa ^{\prime }{\mathcal {E}}_{\mu \nu }^{[e]}=\kappa ^{\prime }T_{\mu \nu }^{[e]} \end{aligned}$$
(16)

where we define effective terms \({\mathcal {E}}_{\mu \nu }^{[e]}\) and \(T_{\mu \nu }^{[e]}\) through

$$\begin{aligned} \sum \limits _i {X_{{\mu \nu }_{i}}} ={X_{{\mu \nu }^{[e]}}} \end{aligned}$$
(17)

where \(X={\mathcal {E}}\) and T.

Obviously, in the absence of 4-vector flux entropy and charge terms on the left-hand side, the field equations (16) give the standard field equations. It implies without losing generality, one can set \(\kappa ^{\prime }=\kappa =8\pi \). Moreover, in absence of the matter (vacuum scenario), the energy–momentum tensor and non-conserved terms in left-hand side vanished and thus one finds \(R=0\). It implies that the field equations (16) for vacuum solutions gives no new results and thus considering static and spherically symmetric solutions of field equations (16) leads one to the usual Schwarzschild metric.

To consider consistency of our modified theory, it is worthwhile to explore and present Lagrangian of non-conserved term. In this regard, relation (9) and or (12) leads one to

$$\begin{aligned} {\delta {\mathcal {E}}} / {\delta T}=-1, \quad {\delta {\mathcal {E}}_{\mu \nu }} / {\delta T_{\mu \nu }}=-1 \end{aligned}$$
(18)

where \({\mathcal {E}}=g^{\mu \nu }{\mathcal {E}}_{\mu \nu }\) and \(T=g^{\mu \nu }T_{\mu \nu }\) are trace of non-conserved and energy–momentum parts, respectively for each field attends in our model.

We introduce total Lagrangian as follows

$$\begin{aligned} {\mathcal {L}}_{tot}={\mathcal {L}}_{EH}+{\mathcal {L}}_{M}+{\mathcal {L}}_{NC} \end{aligned}$$
(19)

where \({\mathcal {L}}_{EH}\), \({\mathcal {L}}_{M}\) and \({\mathcal {L}}_{NC}\) are Lagrangian of Einstein–Hilbert, matter field and non-conserved \({\mathcal {L}}_{NC}={\mathcal {E}} /4\).

With aid of Lagrangian (19), the action of our model becomes

$$\begin{aligned} S=\int {\left( \frac{R}{2\kappa }+{\mathcal {L}}_{M}+\frac{1}{4}{\mathcal {E}} \right) \sqrt{-g} \,\, d^{4}x}. \end{aligned}$$
(20)

Variation with respect to metric \(g^{\mu \nu }\), we find

$$\begin{aligned} \delta S= & {} \int {\frac{1}{2\kappa }\sqrt{-g} G_{\mu \nu }-\frac{1}{2}\sqrt{-g} T_{\mu \nu }+\frac{1}{4}\frac{\delta \left( {\mathcal {E}}\sqrt{-g} \right) }{\delta g^{\mu \nu }}} \,\, d^{4}x\nonumber \\= & {} \int {\frac{\sqrt{-g} }{2}\left( \frac{G_{\mu \nu }}{\kappa }-T_{\mu \nu } \right) +\frac{1}{4}{\mathcal {E}}\frac{\delta \left( \sqrt{-g} \right) }{\delta g^{\mu \nu }}+\frac{1}{4}\sqrt{-g} \frac{\delta {\mathcal {E}}}{\delta g^{\mu \nu }}} \,\, d^{4}x \nonumber \\= & {} \int {\frac{\sqrt{-g} }{2}\left( \frac{G_{\mu \nu }}{\kappa }-T_{\mu \nu }-\frac{1}{4}{\mathcal {E}}g_{\mu \nu } \right) +\frac{1}{4}\sqrt{-g} \frac{\delta {\mathcal {E}}}{\delta T}\left( \frac{\delta T}{\delta g^{\mu \nu }} \right) } \,\, d^{4}x.\nonumber \\ \end{aligned}$$
(21)

To find modified field equation one only needs to derive last term in action (21). In this context, the last term in action (21) given by [29]

$$\begin{aligned} \frac{\delta T}{\delta g^{\mu \nu }}=T_{\mu \nu }+{\mathcal {T}}_{\mu \nu } \end{aligned}$$
(22)

in which \({\mathcal {T}}_{\mu \nu }\) defined by

$$\begin{aligned} {\mathcal {T}}_{\mu \nu }\equiv g^{\alpha \beta }\frac{\delta T_{\alpha \beta }}{\delta g^{\mu \nu }}=-\frac{1}{2}\left( 8\bar{T}_{\mu \nu }-\bar{T}g_{\mu \nu } \right) +\left( \rho +p \right) u_{\mu }u_{\nu }\nonumber \\ \end{aligned}$$
(23)

where \(\bar{T}_{\mu \nu }\) as modified energy–momentum tensor is defined as

$$\begin{aligned} \bar{T}_{\mu \nu }=\left( \rho +p \right) u_{\mu }u_{\nu }+\frac{1}{2}pg_{\mu \nu }. \end{aligned}$$
(24)

Hence, \(\bar{T}=-\rho +p\). Rewriting Eq. (24) as covariant form of the standard energy–momentum tensor (10) reveals

$$\begin{aligned} {\mathcal {T}}_{\mu \nu }\equiv g^{\alpha \beta }\frac{\delta T_{\alpha \beta }}{\delta g^{\mu \nu }}=-3T_{\mu \nu }+\frac{1}{2}Tg_{\mu \nu }. \end{aligned}$$
(25)

As result, Eq. (22) recasts to

$$\begin{aligned} \frac{\delta T}{\delta g^{\mu \nu }}=-2T_{\mu \nu }+\frac{1}{2}Tg_{\mu \nu }. \end{aligned}$$
(26)

In general case, the relation (18) illustrates that non-conserved part given as function of energy–momentum tensor, and thus \(L_{M}\) and \(L_{NC}\) are depend on each other, shown in Eq. (26). This is not surprising result in our model. As shown in [30], even original Rastall gravity can be given by using explicit form of \(f(R,\,\, T)\) gravity for non-linear relation between matter and non-conserved terms. To keep standard form of Einstein field equations and also since Eq. (26) arises from variation of non-conserved Lagrangian with respect to metric, i.e., \({\partial \left( {\mathcal {E}}\sqrt{-g} \right) } /{\partial g^{\mu \nu }}\), using relations (18) yields

$$\begin{aligned} \frac{\delta T}{\delta g^{\mu \nu }}=2{\mathcal {E}}_{\mu \nu }-\frac{1}{2}{\mathcal {E}}g_{\mu \nu }. \end{aligned}$$
(27)

Plugging this equation in last term of Eq. (21), one finds

$$\begin{aligned} \delta S=\int {\frac{\sqrt{-g} }{2}\left( \frac{G_{\mu \nu }}{\kappa }-T_{\mu \nu }-{\mathcal {E}}_{\mu \nu } \right) } \,\, d^{4}x \end{aligned}$$
(28)

which leads to modified Einstein–Hilbert action

$$\begin{aligned} G_{\mu \nu }-\kappa {\mathcal {E}}_{\mu \nu }=\kappa T_{\mu \nu }. \end{aligned}$$
(29)

Thus, the Lagrangian (19) demonstrate that the model is consistent for different fluids and the field equations (16) give valuable modified theory of gravity in different astrophysical and astronomical studies.

It is to be noted that if the energy–momentum tensor depends on metric only, the relations (18) implies that the non-conserved term is also function of metric. This assumption helps us to present simplest field equations in this study, Eq. (29). However, as discussed in Refs. [31, 32], if \(T_{\mu \nu }\) given by other scalar field such as \(\chi \), model includes two field equations, one comes from variation of Lagrangian (19) with respect to metric while other derives from variation of (19) with respect to field \(\chi \) which can unify dark energy and dark matter as uniqueness field.

In the next two sections the cosmological applications for primary inflation and late-time acceleration phase are studied.

3 Inflation

In follows and as the first glance, it is worthwhile to consider field equations (13) or (16) for evolution of the Universe while FRW metric is used,

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

where \(a=a(t)\) is the cosmic scale factor and \(k=0\), 1 and \(-1\) correspond to flat, close, and open Universe, respectively. Observations confirm that the Universe is flat and thus in follows we assume \(k=0\). As results, the Friedmann equations for comoving observer given by,

$$\begin{aligned}{} & {} 3H^{2}-8\pi \left( T_{0}S_{0}+\sum \limits _j {\zeta _{j}J_{j0}} \right) =8\pi \tilde{\rho }\end{aligned}$$
(31)
$$\begin{aligned}{} & {} 2\dot{H}+3H^{2}=-8\pi \tilde{p} \end{aligned}$$
(32)

in which \(H=\dot{a} / a\) is Hubble parameter and over dot denotes derivative with respect to cosmic time. Two parameters \(\tilde{\rho }\) and \(\tilde{p}\) are total density and pressure filled Universe, respectively. As shown, in frame of comoving observer entropy is presented as scalar parameter as well.

The general relativity governs well space-time curvature around massive objects and large-scale structure. However, finding the flux density \(J_{0}\) for these celestial ingredients and or for whole Universe as unique system is far away from hand and thus one needs to use approximation methods. In this context, by using definition of charge density \(J_{j0}\) in comoving frame, \(n_{j}u^{0}\), and using relation (7), we should have:

$$\begin{aligned} \zeta _{j}J_{j0}=\left( m_{j}+\zeta _{j}^{\left( classic \right) } \right) n_{j}u^{0}. \end{aligned}$$
(33)

If we assume that relativistic injection energy \(\zeta _{j}\) is proportional to density of total density \(\tilde{\rho }\), namely

$$\begin{aligned} \zeta _{j}=m_{j}+\zeta _{j}^{\left( classic \right) }=\xi \tilde{\rho }_{j} \end{aligned}$$
(34)

the first Friedmann equation (13) becomes

$$\begin{aligned} 3H^{2}-8\pi \left( T_{0}S_{0}+\sum \limits _j {\tilde{\zeta }_{j}\tilde{\rho }_{j}} \right) =8\pi \tilde{\rho } \end{aligned}$$
(35)

where we define \(\tilde{\zeta }_{j}=\xi n_{j}\). Although this coefficient plays key role in studying charged black holes surrounded by matter fields or in system with high levels of interaction among particles such as interior medium of stars, due to negligible interaction among different particles in the large-scale structure this parameter must be so small. However, keeping it in cosmological models may alleviate some inconsistencies especially in \({\Lambda }\)CDM model.

In the large-scale structures, homogeneity and isotropic assumptions implies that the electric charge/interaction is same in all directions and in all selected part of the observable Universe. So, summation on index j in Eq. (35)

$$\begin{aligned} \sum \limits _j {\tilde{\zeta }_{j}\tilde{\rho }_{j0}} =\tilde{\zeta }\tilde{\rho } \end{aligned}$$
(36)

must be universal. In fact, this assumption helps us to simplify what comes in follows. According to this suggestion, the total charge/interaction density is uniform in different directions and zones of the Universe. As result, summation gives net charge in our model and so sign of constant \(\tilde{\zeta }\) shows resultant charge/interaction in system, Universe.

The observations related to the cosmic microwave background (CMB) through various surveys contain different information about the formation and evolution of the Universe in which some concepts such as flatness and horizon problems challenge the standard cosmological model [33]. To solve these problems, the primary accelerated expansion known as cosmic inflation has been proposed for the earliest stage of the evolution of the Universe [34]. During this short era, one may assume that the Universe fills with unknown field, for instance, the scalar field given by Lagrangian

$$\begin{aligned} {\mathcal {L}}=-\frac{1}{2}g^{\mu \nu }\partial _{\mu }\varphi \partial _{\nu }\varphi -V\left( \varphi \right) \end{aligned}$$
(37)

where \(\varphi =\varphi (t)\) presents the scalar field and \(V\left( \varphi \right) \) is the potential of the scalar field. As result, density and pressure of such field become

$$\begin{aligned} \rho =\frac{1}{2}\dot{\varphi }^{2}+V\left( \varphi \right) , \quad p=\frac{1}{2}\dot{\varphi }^{2}-V\left( \varphi \right) \end{aligned}$$
(38)

and then Friedmann equations recast to

$$\begin{aligned}{} & {} 3H^{2}-\kappa T_{0}S_{0}=\kappa \left( 1+\tilde{\zeta } \right) \left( \frac{1}{2}\dot{\varphi }^{2}+V\left( \varphi \right) \right) \end{aligned}$$
(39)
$$\begin{aligned}{} & {} 2\dot{H}+3H^{2}=-\kappa \left( \frac{1}{2}\dot{\varphi }^{2}-V\left( \varphi \right) \right) . \end{aligned}$$
(40)

Taking derivative with respect to time from Eq. (39) and substituting its result in Eq. (40) yields continuity equation,

$$\begin{aligned}{} & {} \dot{\varphi }\left( \ddot{\varphi }+3H\dot{\varphi }+V^{\prime } \right) +\tilde{\zeta }\left( \dot{\varphi }\ddot{\varphi }+\dot{\varphi }V^{\prime }+\frac{d}{dt}\left( \frac{T_{0}S_{0}}{\tilde{\zeta }} \right) \right) \nonumber \\{} & {} \quad +3H\tilde{\zeta }\left( \frac{1}{2}\dot{\varphi }^{2}+V\left( \varphi \right) +\frac{T_{0}S_{0}}{\tilde{\zeta }} \right) =0 \end{aligned}$$
(41)

where prime is derivative with respect to scalar field. Moreover, Lagrangian (37) obtains the Klein–Gordon equation

$$\begin{aligned} \ddot{\varphi }+3H\dot{\varphi }+V^{\prime }=0. \end{aligned}$$
(42)

During the inflation era the comoving Hubble horizon shrinks, i.e.,

$$\begin{aligned} \frac{{d\left( aH \right) }^{-1}}{dt}=-\frac{1}{a}\left( 1-\epsilon _{1} \right) <0 \end{aligned}$$
(43)

where, \(\epsilon _{1}<1\) is the first slow-roll parameter, defined as [35, 36]

$$\begin{aligned} \epsilon _{1}\left( t \right) \equiv -\frac{\dot{H}}{H^{2}}. \end{aligned}$$
(44)

In inflation context we can describes the rate of the expansion of inflation as a natural logarithm of the scale factor [37, 38],

$$\begin{aligned} N=\ln \left( \frac{a_{end}}{a} \right) =\int _t^{t_{end}} H dt \end{aligned}$$
(45)

where the index ‘end’ denotes the value of quantitates at the end of inflation epoch. Through this e-folding number N, one can define several possible sets of slow roll parameters, namely [39]

$$\begin{aligned} \epsilon _{n+1}\left( t \right) \equiv \frac{d\ln \left| \epsilon _{n}\left( t \right) \right| }{dN}. \end{aligned}$$
(46)

As result, the second slow-roll parameter becomes

$$\begin{aligned} \epsilon _{2}\left( t \right) =\frac{\dot{\epsilon }_{1}}{H\epsilon _{1}}=\frac{\ddot{H}}{H\dot{H}}-2\frac{\dot{H}}{H^{2}}. \end{aligned}$$
(47)

It is well-known under condition \(\left| \epsilon _{n} \right| \ll 1\), the inflation occurs and will continue long enough to solve the standard cosmological problems [39].

In order to find first and second slow roll parameters, using Eqs. (41) and (42) suggest

$$\begin{aligned} \frac{\partial }{\partial t}\left( \tilde{\zeta }\rho +T_{0}S_{0} \right) +3H\left( \tilde{\zeta }\rho +T_{0}S_{0} \right) =0. \end{aligned}$$
(48)

Thus, we should have:

$$\begin{aligned} \tilde{\zeta }\rho +T_{0}S_{0}=c_{0}a^{-3} \end{aligned}$$
(49)

where \(c_{0}\) is constant of the model. With aid of above relation and Friedmann equations, one finds

$$\begin{aligned} \epsilon _{1}=\frac{3\left( \dot{\varphi }^{2}+c_{0}a^{-3} \right) }{\dot{\varphi }^{2}+2V\left( \varphi \right) +2c_{0}a^{-3}}. \end{aligned}$$
(50)

Satisfying \(\epsilon _{1}\ll 1\) leads one to

$$\begin{aligned} \dot{\varphi }^{2}+\frac{c_{0}}{2}a^{-3}\ll V\left( \varphi \right) . \end{aligned}$$
(51)

Using this condition, Eq. (49) implies that

$$\begin{aligned} T_{0}S_{0}\propto V\left( \varphi \right) \end{aligned}$$
(52)

where density (38) is used. Since temperature exponentially drops down as function of scale factor, with suitable potential form, the Eq. (52) can keep the second law of thermodynamics, namely

$$\begin{aligned} S_{0}\propto a^{n}V,\quad \text {for}\ n>0. \end{aligned}$$
(53)

For instance, in the so-called chaotic inflation model, the potential becomes [40]

$$\begin{aligned} V=V_{0}\left( \kappa \phi \right) ^{\sigma } \end{aligned}$$
(54)

where \(V_{0}\) and \(\sigma \) are constants of the model. As discussed in [41], \(\kappa \phi \approx \sqrt{\sigma \left( 4N+\sigma \right) } /2 \) wherein N is the natural logarithm of the scale factor given by Eq. (45). Plugging potential (54) in entropy (53) shows that the entropy increases with cosmic time, satisfies the second law of thermodynamics.

Applying condition (51) on Eq. (50) gives \(\epsilon _{1}\),

$$\begin{aligned} \epsilon _{1}\approx \frac{3\left( \dot{\varphi }^{2}+c_{0}a^{-3} \right) }{2V\left( \varphi \right) } \end{aligned}$$
(55)

approximately. The second slow-roll parameter can also be defined as

$$\begin{aligned} \eta =2\epsilon _{1}-\frac{\epsilon _{2}}{2}\approx -\frac{\dot{\varphi }\ddot{\varphi }-3c_{0}Ha^{-3}}{H\left( \dot{\varphi }^{2}+c_{0}a^{-3} \right) } \end{aligned}$$
(56)

where in the last approximation, relation (51) is used. Furthermore, condition \(\left| \eta \right| \ll 1\) yields (\(c_{0}\ne 0)\)

$$\begin{aligned} \textrm{If}\ c_{0}>-\dot{\varphi }^{2}a^{3}:\left\{ {\begin{array}{l} \frac{3c_{0}H}{2\dot{\varphi }a^{3}}<\ddot{\varphi }<\frac{H\left( 2\dot{\varphi }^{2}a^{3}+5c_{0} \right) }{2\dot{\varphi }a^{3}} \\ -\frac{H\left( 2\dot{\varphi }^{2}a^{3}-c_{0} \right) }{2\dot{\varphi }a^{3}}<\ddot{\varphi }\le \frac{3c_{0}H}{2\dot{\varphi }a^{3}} \\ \end{array}} \right. \end{aligned}$$
(57a)
$$\begin{aligned} \textrm{If}\ c_{0}<-\dot{\varphi }^{2}a^{3}: \left\{ {\begin{array}{l} \frac{H\left( 2\dot{\varphi }^{2}a^{3}+5c_{0} \right) }{2\dot{\varphi }a^{3}}<\ddot{\varphi }<\frac{3c_{0}H}{2\dot{\varphi }a^{3}} \\ \frac{3c_{0}H}{2\dot{\varphi }a^{3}}\le \ddot{\varphi }<-\frac{H\left( 2\dot{\varphi }^{2}a^{3}-c_{0} \right) }{2\dot{\varphi }a^{3}}. \\ \end{array}} \right. \end{aligned}$$
(57b)

These conditions together with condition (51) are known as the slow-roll conditions. If these conditions are fulfilled, the inflation onsets, continues and when those are violated, the inflation process will end. Using the slow-roll conditions (51) and ((57)), Eqs. (39) and (42) can also be approximated to

$$\begin{aligned}{} & {} H^{2}\approx \frac{\kappa }{3}V\left( \varphi \right) \end{aligned}$$
(58)
$$\begin{aligned}{} & {} \dot{\varphi }\approx -\frac{V^{\prime }}{3H} \end{aligned}$$
(59)

where Eq. (49) is used. Consequently, the slow-roll parameters (55) and (56) can be written in terms of the inflationary potential and its derivatives,

$$\begin{aligned}{} & {} \epsilon _{1}\approx \frac{1}{2\kappa }\left( \frac{V{'}}{V} \right) ^{2} \end{aligned}$$
(60)
$$\begin{aligned}{} & {} \eta \approx \frac{V{'}^{2}V{''}+9c_{0}\kappa ^{2}V^{2}a^{-3}}{\kappa VV{'}^{2}+3c_{0}\kappa ^{2}V^{2}a^{-3}} \end{aligned}$$
(61)

In order to describe and examine the theoretical predictions of the inflation scenario, the model should satisfy observations. In this context, three observables defined as [39]

  • The scalar spectra index:

    $$\begin{aligned} n_{S}=1-6\epsilon _{1}+2\eta . \end{aligned}$$
    (62)
  • The tensor spectral index:

    $$\begin{aligned} n_{T}=-2\epsilon _{1}. \end{aligned}$$
    (63)
  • The tensor-to-scalar ratio:

    $$\begin{aligned} r=16\epsilon _{1}. \end{aligned}$$
    (64)

In this regard, the latest constraints from Planck data on the scalar spectral index and the tensor-to-scalar ratio suggests [42]

$$\begin{aligned}{} & {} n_{S}=0.9649\pm 0.0042 \end{aligned}$$
(65)
$$\begin{aligned}{} & {} r<0.10. \end{aligned}$$
(66)

Although the non-conserved terms give no new \(\epsilon _{1}\) with respect to standard inflation theory [43, 44], the second slow-roll parameter \(\eta \) depends on non-conserved parameter. As result, the model only deviates from standard inflation theory for the scalar spectra index. However, exploring the second slow roll (61) shows,

$$\begin{aligned} \eta \approx \frac{V{''}}{\kappa V}+\frac{9c_{0}\kappa Va^{-3}}{V{'}^{2}} \end{aligned}$$
(67)

when condition (51) is used. The exponentially evolution of the Universe during inflation era, for instance implies that the second term gives no tangible effects on the second slow-roll parameter for chaotic potential (54), and thus it gives no tangible deviations from the standard form of the scalar spectra index [43].

However, this is open field and thus interested people can explore different potential models to check effects of the non-conserved term on scalar potential \(V\left( \varphi \right) \) and the scalar spectra index \(n_{S}\).

4 Late-time universe

In this section the late-time Universe in the presence of the cosmological constant is studied. Adding the cosmological constant parameter to Friedmann equations (31) and (32), one obtains

$$\begin{aligned}{} & {} 3H^{2}=k\left( \rho _{m}+\psi \right) +{\Lambda } \end{aligned}$$
(68)
$$\begin{aligned}{} & {} 2\dot{H}+3H^{2}={\Lambda } \end{aligned}$$
(69)

where \(\rho _{m}\) is matter density and we define

$$\begin{aligned} \psi =-T_{0}S_{t}-\sum \limits _j {\zeta _{j}J_{jt}}. \end{aligned}$$
(70)

Defining density and pressure of effective dark energy as

$$\begin{aligned}{} & {} \rho _{X}^{e}=\frac{{\Lambda }}{\kappa }+\psi \end{aligned}$$
(71)
$$\begin{aligned}{} & {} p_{X}^{e}=-\frac{{\Lambda }}{\kappa } \end{aligned}$$
(72)

lead us to following continuity equations:

$$\begin{aligned}{} & {} \dot{\rho }_{m}+3H\rho _{m}=Q \end{aligned}$$
(73)
$$\begin{aligned}{} & {} \dot{\rho }_{X}^{e}+3H\left( \rho _{X}^{e}+p_{X}^{e} \right) =-Q \end{aligned}$$
(74)

where Q denotes an interaction term.

As first scenario and in lack of microscopic origin of interaction term between dark energy and matter one may assume \(Q=0\), which gives

$$\begin{aligned}{} & {} \rho _{m}=\rho _{m0}a^{-3} \end{aligned}$$
(75)
$$\begin{aligned}{} & {} \psi =\psi _{0}a^{-3}. \end{aligned}$$
(76)

Substituting Eqs. (75) and (76) in Friedmann equation (68) and constraining model with current value of free parameters, yields

$$\begin{aligned} {\Lambda =3}H_{0}^{2}\left( 1-{\Omega }_{m0} \right) -\kappa \psi _{0}. \end{aligned}$$
(77)

Obviously in the absence of non-conserved term the model coincides with \({\Lambda }\)CDM theory. With aid of this relation, Eqs. (75) and (76), the equation of state of such dark energy becomes

$$\begin{aligned} \omega _{X}=-1+\frac{\kappa \psi _{0}a^{-3}}{3H_{0}^{2}\left( 1-{\Omega }_{m0} \right) +\kappa \psi _{0}\left( a^{-3}-1 \right) }. \end{aligned}$$
(78)

Furthermore, the deceleration parameter given by

$$\begin{aligned} q=\frac{1}{2}\left( 1+\frac{3p_{X}}{\rho _{X}+\rho _{m}} \right) . \end{aligned}$$
(79)

In order to constraint model with observations, we apply the Markov Chain Monte Carlo (MCMC) method based on the emcee package [45], in which the total likelihoods \({\mathcal {L}}\propto e^{-\chi ^{2} / 2}\) includes supernovae Ia data, baryon acoustic oscillations (BAO) measurements from redshift interval \((0.1<z<0.7)\), and cosmic microwave radiation (CMB). Then the \(\chi ^{2}\) is given as

$$\begin{aligned} \chi ^{2}=\chi _{SN}^{2}+\chi _{BAO}^{2}+\chi _{CMB}^{2} \end{aligned}$$
(80)

with the following 3-dimensional parameter space:

$$\begin{aligned} \theta \equiv \left( {\Omega }_{m0},\,\, H_{0},\,\, \psi _{0} \right) . \end{aligned}$$
(81)

Furthermore, the priors to the model parameter is taken as follows: the initial fractional matter density \({\Omega }_{m0}\in (0,\,\,1)\); the Hubble constant range \(H_{0}\in (50,\,\, 100)\) and \(\psi _{0}\in (0,\,\, 10)\). The results of the best fit values of the model derived by minimizing \(\chi ^{2}\), relation (80). In Table 2 the best fit values for parameter space (81) are summarized. We also have plotted the one dimensional marginalized distribution on individual parameters and two-dimensional contours in Fig. 1.

Fig. 1
figure 1

The one-dimensional marginalized distribution on individual parameters and two-dimensional contours by using SNe + BAO + CMB data points

With aid of these set of free parameters of the model, the evolution of equation of state (78) and deceleration parameter (79) are plotted in Fig. 2. As shown, model presents dark energy that behaves as pressureless matter in past while in future it coincides with standard cosmological constant. Furthermore, its current equation of state is slightly bigger than \(-1\), \(\omega _{X}\approx -0.995\). Exploring deceleration parameter reveals that the acceleration phase onsets at \(z_{T}\approx 0.68\) which satisfies the joint analysis of SNe + CMB data with the \({\Lambda }\)CDM model [46].

Fig. 2
figure 2

The Evolution of equation of state (up) and deceleration parameter (below) panels versus redshift for non-interaction model when we use \(H_{0}=67.59\), \({\Omega }_{m0}=0.29\) and \(\psi _{0}=1.84\)

In this step it is worthwhile to explore validity of the second law of thermodynamics in this scenario, non-interaction one. In this context, and with Eqs. (36), (70) and (76) at hand, the entropy of matter due to interior interaction among particles of matter component becomes

$$\begin{aligned} S_{t}=-\left( \tilde{\zeta }\rho _{m0}+\psi _{0} \right) a^{-2} \end{aligned}$$
(82)

where we assume \(T_{0}\propto a^{-1}\). To have positive entropy, the Eq. (82) implies \(\tilde{\zeta }\) must be negative, \(\tilde{\zeta }<{-\psi _{0}} / \rho _{m0}\approx -0.01\). However, the evolution of entropy (82) illustrates \(S_{t}\) decreases with redshift, which violates the second law of thermodynamics. This problem is not new issue. In fact, there is same problem for the cosmological models in which dark energy comes from modified entropy expression [47, 48]. In such models the entropy of matter field decreases with redshift due to expanding Universe and thus one needs to check total entropy of the Universe includes matter and dark energy components on the apparent horizon. If we follow same rule, the first law of thermodynamics leads us to

$$\begin{aligned} S_{tot}=\frac{\kappa \pi }{3}r^{4}\rho _{tot}=\frac{\pi }{H^{2}} \end{aligned}$$
(83)

where we use \(T=1 / {2\pi r}\) and \(H=r^{-1}\) on the apparent horizon [47]. The behavior of total entropy \(S_{tot}\) for Hubble parameter (68) is plotted in Fig. 3 which satisfies the second law of thermodynamics.

Fig. 3
figure 3

The total entropy of non-interaction scenario versus redshift when free parameters are set with values in Table 1

Table 1 The best-fit parameters of the non-interaction scenario wherein effective dark energy includes non-conserved term and cosmological constant

In follows we attempt to consider model in presence of the interaction term \(Q=\alpha H(\rho _{m}+\rho _{X})\) with free parameter \(\alpha \). In order to consider model under this interaction form and by using e-folding number \(x=\ln {(a)}\), solving Eqs. (73) and (74), we obtain

$$\begin{aligned}{} & {} \rho _{m}=\left( c_{1}+xc_{2} \right) e^{-3x} \end{aligned}$$
(84)
$$\begin{aligned}{} & {} \psi =\frac{c_{2}}{\alpha }e^{-3x}-\left( c_{1}+xc_{2} \right) e^{-3x} \end{aligned}$$
(85)

which leads one to

$$\begin{aligned} \rho _{X}=\frac{{\Lambda }}{\kappa }+\frac{c_{2}}{\alpha }e^{-3x}-\left( c_{1}+xc_{2} \right) e^{-3x}. \end{aligned}$$
(86)

The equation of state of dark energy in interaction scenario given by

$$\begin{aligned} \omega _{X}=-1+\frac{\kappa \left( \left( c_{1}+c_{2}x \right) \alpha -c_{2} \right) e^{-3x}}{\kappa \left( \left( c_{1}+c_{2}x \right) \alpha -c_{2} \right) e^{-3x}-\alpha {\Lambda }}. \end{aligned}$$
(87)

Theoretically, constraining model with current Universe yields

$$\begin{aligned}{} & {} c_{1}=\frac{3H_{0}^{2}}{\kappa }{\Omega }_{m0} {\Lambda }=3H_{0}^{2}-\frac{\kappa c_{2}}{\alpha } \end{aligned}$$
(88)

which implies \(c_{1}=\rho _{m0}\).

To find other free parameters of model, includes \(\alpha \) and \(c_{2}\), redefining codes with parameter space

$$\begin{aligned} \theta \equiv \left( {\Omega }_{m0},H_{0},\alpha ,c_{2} \right) \end{aligned}$$
(89)

and adding priors set \(\alpha \in (0,1)\) and \(c_{2}\in [0,20)\) to MCMC package approximates free parameters of our model given in Table 2. Also, one-dimensional marginalized distribution on individual parameters and two-dimensional contours are plotted in (Fig.  4).

Table 2 The best-fit parameters of the interaction scenario for our model
Fig. 4
figure 4

The one-dimensional marginalized distribution on individual parameters and two-dimensional contours by using SNe + BAO + CMB data points for interaction scenario

The equation of state (87) and deceleration parameter (79) for interaction model are illustrated in Fig. 5. As shown the dark energy evolves as pressureless matter filed in high redshift while in future coincides with the cosmological constant model. Comparing the interaction scenario with non-interaction one reveals that the model in former case evolves like phantom field for small interval of future with extremum point \(\omega _{X}\approx -1.022\) at \(z\approx -0.283\). This behavior, phantom-like dark energy is usual result in holographic dark energy models [49, 50] and some explicit forms of f(R) gravity [51,52,53] which possesses negative kinetic energy.

Fig. 5
figure 5

Equation of state (up) and deceleration parameter (below) panels as function of redshift for interaction model when we use \(H_{0}=67.62\), \({\Omega }_{m0}=0.31\), \(c_{2}=17.30\) and \(\alpha =0.39\)

At the end, exploring total entropy (83) for interaction model with same approach shows such scenario keeps the validity of the second law of thermodynamics for whole Universe (Fig. 6). However, the outstanding result in comparing non-interaction with interaction medium may come from the evolution of the corresponded entropy to non-conserved term \(\psi \) wherein \(S_{t}\) has the extremum during matter-dominated era for interaction scenario. This behavior shows during matter era, the entropy of non-conserved part increases while this process ends due to expanding Universe at \(z\approx 6.88\) and shrinks with redshift to present time. In Fig. 7, the \(S_{t}\) for both non-interaction and interaction cases are plotted versus redshift. As shown, \(S_{t}\) for non-interaction model is so large even before nucleosynthesis process while for interaction model the corresponded entropy onsets after big bang and grows up with matter creation, proportionally. It demonstrates that the second scenario, interaction model, gives better physical results with respect to the first one, non-interaction scenario.

Fig. 6
figure 6

The total entropy of interaction model when free parameters are set with data in Table 1

Fig. 7
figure 7

The evolution of entropy \(S_{t}\) for non-interaction scenario (left panel) and for interaction model (right panel) with respect to redshift. The free parameters are set with data in Tables 1 and 2

5 Remark

To summarize, in this study, we have reconsidered Rastall argument in which the conservation of energy–momentum tensor in curved spacetime is broken. As discussed, exploring covariant form of thermodynamics can lead one to outstanding results in this context. For finite system in which particles of different fluids and or of a unique field interact to each other, conservation of energy–momentum is just broken in Minkowskian spacetime. Using general relativity principle allows one to generalize this issue to curved spacetime, governs with field equations. Thus, the field equations get two extra terms includes temperature-entropy term and interaction/charge one. In the absence of interior interactions among particles, the non-conserved terms are vanished; the standard field equations reproduced. It shows this model gives no new solutions for vacuum geometry, \(R=0\), with respect to standard field equations. Studying the modified field equations (15) reveals that only time component deviates compared with that in standard field equations for comoving observers. The exploring field equations (15) needs more details for different systems such as evolution of the Universe, dynamics of black holes and stars, etc. However, in this paper we only concentrate on its applications in cosmology and evolution of the Universe in very early era, inflation, and late-time phase. Introducing scalar field as source of the inflation depicts that the non-conserved term gives no tangible effects on observables. However, depending on model and potential the scalar spectra index deviates from standard one. In order to study late-time we added the cosmological constant to Friedmann equations. For non-interaction scenario and fixing free parameters through MCMC algorithm one finds that the model can satisfy observations. Furthermore, in such model coincidence problem of the cosmological constant vanished. However, exploring entropy of non-conserved part shows this parameter decreases from so large values before big bang wherein matter is not existed. To alleviate this problem, we assume that dark energy interacts with matter. This assumption, as shown in Fig. 7, can solve this problem wherein entropy of non-conserved term increases during matter-dominated era and shrinks by expanding Universe to current time.

The investigating other solutions and their applications are assigned to the future studies.