Entropy production in a heat conduction problem

Heat conduction along an isolated bar placed between two reservoirs at different temperatures is studied. The entropy production is considered in detail with two different approaches. In the first one, the whole system (the bar and the two reservoirs) is analysed in the steady state with the help of standard thermodynamics. In the second one, the bar is divided into n cells and a simple finite difference method is used to evaluate the time evolution of the entropy production. This approach is useful because the transient behaviour can be studied. In this way, it is shown a simple example of a non-equilibrium system where the entropy production (even its transient behaviour) can be evaluated with tools at hand of a motivated undergraduate.

Thermodynamics is a subtle science.Calculations are simple, but the correct understanding and application of basic concepts require a perspicacious mind.The situation is even worse if non-equilibrium systems are considered; additionally, a course of nonequilibrium thermodynamics is rarely included in the normal training of a physicist.For these reasons, it seems convenient to study a non-equilibrium situation using a simple problem.This is the aim of this paper.
A very simple problem will be analysed: heat conduction through a bar between two heat reservoirs at different temperatures.First, the problem is stud-ied from a global point of view once the system is in a steady state.Later, the question is considered in more details, when the system has not yet reached the steady state; the bar is divided into several cells and it is assumed they are small enough as to have well defined thermodynamic variables.A straightforward application of numerical methods allows us to evaluate the temperature evolution and the entropy production.Of course, once the system reaches its steady state the numerical results agree with the previous global analysis.The numerical calculations are repeated for a couple different boundary conditions.
The knowledge required to understand this article is that provided by a good course in general thermodynamics [1,2].Additionally, some familiarity with

Global analysis of the problem
The problem we want to study in this work is shown in Figure 1.A bar is located between two reservoirs at different temperatures.The hotter one is at a temperature T h while the cooler one is at a temperature T c .It is assumed that the bar is insulated and it exchanges heat only through its ends.We are interested in the production of entropy and the entropy production rate which is the former quantity per unit time.
The entropy production in the whole system is considered.Since the system is isolated, there is no exchange of entropy with the external world, that is, the flux of entropy Φ is zero.The variation of entropy ∆S is only due to the production of entropy K inside the system itself.
The entropy production inside the system can be easily evaluated once the steady state is reached.In that situation, a certain quantity of heat −Q leaves the hot reservoir, and the same amount of heat goes into the cold one.Of course, the reservoirs are big enough to maintain their temperature constant.Therefore, the entropy change in the system is: Figure 1: This diagram sketches the problem considered in this paper: the heat conduction through a bar placed between two reservoirs at temperature T h -the hot oneand T c -the cold one-.It is assumed that the bar is thermally isolated and can exchange heat only at its ends.Two analyses are performed.A global one that regards both reservoirs and the bar as the relevant system, and a local one that takes the bar as the object to be studied.
The entropy production rate, that is, the production of entropy per unit time, is called P = K / ∆t, where ∆t is a time interval, and it is given by: where q = Q / ∆t so that dS/dt = P.
In the Section 2 we analyse what happens in the bar instead of in the whole system and in Section 3 we solve (2) for a particular case to compare the result with a numerical simulation.

Local analysis
In this section the bar will be considered rather than the whole system.The strategy to follow is simple.The bar is divided into many equal slices, each one small enough as to be always in thermal equilibrium.Consequently, classical thermodynamics can be applied.
We know that heat conduction through the bar is described by the Fourier law: As usual, J is the heat flux and k the thermal conductivity.
From energy conservation, we may write a continuity equation: The internal energy at a unitary volume around x (i.e. the internal energy density at x) is called u.In eq. ( 4) it is assumed that no work is done; this equation states that the temporal change in the internal energy density of a small volume around x has the same magnitude but opposite sign that the net heat flux in that small volume.
The internal energy density change can be rewritten using the definitions of the specific heat per unit mass c and the density ρ of the rod as: du = cρ dT , and the temporal change comes to be: From eqs. ( 3), ( 4) and ( 5) an equation for the temperature is found: Or, considering the rod divided into n slices, eq. ( 6) can be restated as: ) ξ is the thickness of each slice, and T i the temperature of the ith-slice.To obtain (7), the second derivative in x has been rewritten using a standard finite difference scheme.The former equation shows the time evolution of temperature in slice i in terms of the temperature of its neighbour slices.One should remark that slice n + 1 is the cold reservoir while slice 0 is the hot one.
Let us see now what happens in slice i.The entropy density change in it can be put as: It should be remembered that the slices have been chosen small enough such that the thermodynamical variables have a well defined value.
According to (4) the time evolution of the internal energy in the slice i is: A is the bar section.This equation is just a restatement of energy conservation: the change in the internal energy of cell i is given by the heat coming from cell i − 1 minus the heat leaving cell i.
From ( 8) and (9), it turns out that the total change of entropy in the rod is: It is convenient to add and subtract AJ 0 /T 0 and AJ n /T n+1 to (11).Notice that T 0 = T h and T n+1 = T c .Eq. ( 10) can be rearranged as follow: The entropy production rate has been decomposed into two terms.The first one, φ, is associated with the production of entropy due to the interaction of the bar with the reservoirs.The second term, σ, is the entropy production inside the bar.It is helpful to write them explicitly: One should remember that the total entropy production rate was called P in the previous section, then P = φ + σ, and the entropy change ∆S at time t will be: The heat flux from cell i to cell i + 1 can be written, from the Fourier law, as follows: Our task is almost finished.Replacing (13) in (12) and remembering (7), it turns out that the system of differential equations to be solved numerically is: The boundary conditions depend on the particular simulation in which we are interested.

Numerical results
To solve the ordinary differential equation system (15), a computational code was implemented.A simple Euler scheme was enough to solve the equations, although some care is needed in the value of the temporal step to avoid instabilities in the solution.
The physical parameters of the rod were chosen as follow.We assume its length is l = 10 cm with a cross section A = 1 cm 2 .It is made of copper with a density ρ = 8.954 g cm −3 , a specific heat c = 0.385 J g −1 K −1 and a thermal conductivity k = 4.01 W cm −1 K −1 .The hot reservoir is at T h = 373.15K (boiling water) and the cold one at T c = 293.15K (room temperature).
For the first simulation the following boundary conditions were used: The physical situation described by ( 15) is easy to understand: the bar is originally at room temperature, and one of its ends is introduced into boiling water.
In Figure 2 the results of the numerical simulation are shown.In Fig. 2a the internal entropy production σ is shown as a function of time.After a relatively high entropy production at the beginning, it reaches a stationary value: σ → 0.024 J K −1 s −1 .The entropy production due to the interaction with the reservoirs goes quickly to zero: φ → 0. This means that once the steady state is reached, the entropy production takes place inside the bar and not at the interface with the reservoirs.Figure 2c shows the total entropy produced as a function of time This result can be compared with the one obtained in section 2. There, an expression was found -eq. ( 3)-that gives the entropy production in the steady state.To evaluate that expression, we need the heat flux rate q.To obtain it, we should remember that once the steady state has been reached, the temperature in the rod falls linearly from the hot reservoir to the cold one.This is a well-known result in heat conduction [5], and it also comes out from our simulations.Consequently, we may write: And replacing ( 16) in ( 2): The numerical evaluation of (17) gives P = 0.0234 J s −1 K −1 in excellent agreement with the numerical simulation.
The advantage of dividing the bar into a finite number of cells is now obvious.The numerical simulation shows where the entropy production takes place and gives us information about the entropy production before the system is in its steady state.A usual thermodynamical analysis as the one performed in section 2 tells us about the global behaviour of the system in its steady state.the bar is originally at room temperature and, at t = 0, one of its ends is introduced in boiling water.These figures show the time evolution of the entropy production inside the bar σ -Fig.2a-, at the interfaces of the bar with the reservoirs -Fig.2b-and the time evolution of the produced entropy (∆S) -Fig.2c-Initially entropy is produced both inside the bar and at the interface with the reservoirs, however once the system is in a steady state the entropy is produced only inside.The numerical value of the entropy production in the steady state agrees with that found in the global analysis of the problem.However the local approach allows us to study the transient behaviour of the entropy production.In words, the bar is initially at room temperature, and then one of its ends is introduced into boiling water.After 25s that end is removed from the boiling water and it is set at room temperature.
As can be seen from Figure 3, there is a clear discontinuity at t = 25s due to the change in the boundary conditions.This is not surprising.Notice that the internal entropy production does not change sign when the heat flow changes from inwards to outwards.However, the external entropy production does change its sign.This is not hard to understand: for t < 25s heat goes into the bar while for t > 25s heat goes out of it.Since the entropy is a state function and the initial and final states of the rod are the same, the entropy at the beginning and at the end of the simulation should be the same, and this is what is shown by Fig. 3c.
One can simulate other situations, changing in a proper way the boundary conditions.However, the above examples are enough to show the power of this approach.A simple finite difference scheme applied to the rod lets us follow the time evolution of the entropy in a non-equilibrium situation.

Conclusions
In this paper we have studied an everyday problem, but a conceptually rich one.The heat conduction along a rod between two heat reservoirs at different temperatures is the most simple non-equilibrium thermodynamics problem one can analyse.Besides its simplicity, the system reaches a steady state where the usual thermodynamical considerations are valid.
A global analysis of the whole system (reservoirs + bar) lets us obtain an expression for the total entropy production rate in the steady state -eq.( 2) -.However, that analysis does not tell us anything about the place where the entropy is produced or about the transient behaviour of the system.A local analysis of the bar is fruitful.The rod is divided into n equal cells and each one is considered to be  2, but for a different situation.The bar is originally at room temperature, and one end is put into contact with boiling water for 25s.After this time interval, the bar end is removed from the boiling water, and the whole rod reaches room temperature in a short period of time.In Fig. 3a the internal production of entropy is shown as a function of time.Notice that the entropy production inside the bar is always positive.In Fig. 3b the entropy produce at the interfaces of the bar with the reservoirs is shown.At the beginning, the entropy produced there is positive since heat flows from the hot reservoir (boiling water) to the bar.Once the bar end has been removed from the boiling water, the heat flows from the bar to the surroundings and the entropy production changes its sign.The total entropy produced is shown is Fig. 3c.Since the initial and final states of the bar are the same, there is no net change in the entropy in equilibrium.Those cells are the fundamental elements for a numerical calculation based in a finite difference approach.In this way, the analysis of the temporal evolution of the system becomes possible.This particular example shows the power of the "local equilibrium approach" to non-equilibrium thermodynamics; the interested reader is referred to advanced textbooks for further developments [6,7,8] The computational code has been used to study two different situations.The results are summarised in Figures 2 and 3.This analysis allows us to discriminate between the entropy produced inside the bar and that produced at the interface bar-reservoirs.The calculations show that the entropy is only produced inside the bar once the system is in its steady state.Of course, the global analysis agrees with the local one in the steady state.
In summary, a thermodynamics system out of equilibrium has been analysed without using the cumbersome tools of non-equilibrium thermodynamics.Moreover, the time evolution of the entropy production has been calculated with elementary concepts.A keen student should be able to reproduce the results of this paper that can be used as an "advanced project" in an undergraduate course.

Figure 2 :
Figure 2: Numerical results for the first situation simulated:the bar is originally at room temperature and, at t = 0, one of its ends is introduced in boiling water.These figures show the time evolution of the entropy production inside the bar σ -Fig.2a-, at the interfaces of the bar with the reservoirs -Fig.2b-and the time evolution of the produced entropy (∆S) -Fig.2c-Initiallyentropy is produced both inside the bar and at the interface with the reservoirs, however once the system is in a steady state the entropy is produced only inside.The numerical value of the entropy production in the steady state agrees with that found in the global analysis of the problem.However the local approach allows us to study the transient behaviour of the entropy production.

Miranda e4303- 5 In
Figure 3 the results of other simulation are shown.The boundary conditions used are: T 0 = 373.15K for t < 25 s T 0 = 273.15K for t > 25 s T n+1 = 273.15K ∀t T i = 273.15K for t = 0 and i = 0 (18)

Figure 3 :
Figure 3: This figure shows the same quantities as Figure2, but for a different situation.The bar is originally at room temperature, and one end is put into contact with boiling water for 25s.After this time interval, the bar end is removed from the boiling water, and the whole rod reaches room temperature in a short period of time.In Fig.3athe internal production of entropy is shown as a function of time.Notice that the entropy production inside the bar is always positive.In Fig.3bthe entropy produce at the interfaces of the bar with the reservoirs is shown.At the beginning, the entropy produced there is positive since heat flows from the hot reservoir (boiling water) to the bar.Once the bar end has been removed from the boiling water, the heat flows from the bar to the surroundings and the entropy production changes its sign.The total entropy produced is shown is Fig.3c.Since the initial and final states of the bar are the same, there is no net change in the entropy