# Released-absorbed heat relation in irreversible process

suppose we have an irreversible process, caused by a pressure difference $$p_1 \neq p_2$$ between two separated gases. The whole system is insulated. The two gases are separated during all the process, but not insulated between them. Applying the first law to the first gas:

$$Q_1 = \Delta U_1 + \int p_2 dV_1$$

and applying to the second one:

$$Q_2 = \Delta U_2 + \int p_1 dV_2$$

that is a switch of system-surrounding role. Since the total energy is constant, we have $$\Delta U_1 = -\Delta U_2$$, and thus:

$$Q_1 + Q_2 = \int(p_2-p_1)dV_1 \neq 0$$

Is it correct that $$Q_1 \neq -Q_2$$? i can't tell if there is a trivial mistake, otherwise what's the meaning of this? how can released and absorbed heat not be equal?

• Are you saying there is a moveable non insulating barrier between the gases and one gas compressed the other? And the Q’s are between the gases? Commented Oct 2, 2019 at 22:10

In an irreversible process, the ideal gas law does not describe the behavior of an "ideal gas." This is because the ideal gas law applies only at thermodynamic equilibrium. In an irreversible process, there are also viscous stresses present within the gas that contribute to the force on the piston (separating the two gases). In this case, a crude approximation to the forces exerted by each of the gases on the piston (assuming that the pressures are unequal when the piston is released) is given by $$\frac{F}{A}=\frac{nRT}{V}-\frac{4}{3}\frac{\eta}{V}\frac{dV}{dt}$$where $$\eta$$ is the gas viscosity. So, in an irreversible expansion or compression, the force of the gas varies not only with the volume but also with the rate of change of volume.

A force balance on the piston is given by $$F_1-F_2=m\frac{dv}{dt}$$where m is the mass of the piston at v is the piston velocity. If the piston is massless, then the forces that the two gases exert on the piston must differ negligibly, and we have $$\frac{F_1}{A}=\frac{F_2}{A}=\frac{n_1RT_1}{V_1}-\frac{4}{3}\frac{\eta_1}{V_1}\frac{dV_1}{dt}=\frac{n_2RT_2}{V_2}-\frac{4}{3}\frac{\eta_2}{V_2}\frac{dV_2}{dt}$$with $$\frac{dV_2}{dt}=-\frac{dV_1}{dt}$$If the forces of the gases on the piston are equal, the net work done by the combination of the two gases is zero, and therefore, $$Q_1+Q_2=0$$

• When the forces on the piston are equal, the pressures $p_1$ and $p_2$ are equal. That establishes a reversible process by definition. Commented Oct 3, 2019 at 2:14
• @Jeffrey J Weiner As a chemical engineer, you are well aware that the forces include viscous stresses, and that the normal stress is equal to the pressure plus a viscous term. Commented Oct 3, 2019 at 2:28
• Hi Chet. What is the origin of the last term of the first equation? Also, if the piston is massless can we also say the forces have to be equal because of Newton’s third law? Commented Oct 3, 2019 at 9:15
• @BobD The last term is a crude approximation to the effect of viscous stresses in the deforming air. If you are familiar with Newton's law of viscosity in 3D, it is a crude approximation to $\frac{4}{3}\eta \frac{\partial w}{\partial z}$ at the piston face, assuming that the rate of axial deformation is homogeneous. For a massless piston, the forces are equal because of Newton's 2nd law. Commented Oct 3, 2019 at 10:42
• @ChetMiller Which part is the total force at the piston area? When the total force at the left is equal to the total force at the right, the piston can only move in a hypothetical reversible process. I don’t question the inclusion of viscosity terms for irreversible processes. Commented Oct 3, 2019 at 12:42

I don't see how you got the last equation. Under your assumptions I get

$$Q_{1}+Q_{2}=\int P_{2}dV_{1}+\int P_{1}dV_{2}$$

Am I missing something?

• Since the total volume Is constant, the differentials have opposite sign Commented Oct 3, 2019 at 6:52

The figure below represents a mechanical analog of the system of two gases separated by a movable partition described in the original post.

The system consists of two identical combinations of spring and damper (dashpot) in parallel sandwiched between two immovable walls, with a movable mass m between them. Each combination of spring and damper exhibits behavior analogous to that of the gas in one of the chambers of the original post. This combination of spring and damper is designed to capture the important mechanical aspects of the response of the gas in an irreversible process. The spring is intended to capture the "reversible elastic" P-V response of the gas, and the damper is intended to capture the viscous (dissipative, irreversible) behavior of the gas. The mass m is designed to simulate the movable barrier between the two masses.

In the configuration of the system shown, the springs are preloaded in compression, so each exerts a compressive force $$F_0$$ on the mass. The mass is not moving so that the dampers exert no force in this configuration. So the force exerted by the left spring/damper combination on the mass is $$F_0$$ to the right, and the total force exerted by the right spring/damper combination on the mass is $$F_0$$ to the left.

If we allow the mass to experience a time-dependent displacement $$\delta{t}$$ to the right of the central position, the total force exerted by the spring-dashpot combination situated to the left on the mass will be $$F_L=F_0-k\delta-C\frac{d\delta}{dt}$$and this force will be directed to the right. Similarly, the total force exerted by the spring-dashpot combination situated to the right on the mass will be $$F_R=F_0+k\delta+C\frac{d\delta}{dt}$$ and this force will be directed to the left. In these equations, C is the damper constant, and the damper terms indicate that the forces from the dampers are proportional to the velocity of one end of the damper relative to the fixed end.

The net force on the mass is $$F_L-F_R$$ and, from Newton's 2nd law, if follows that $$F_L-F_R=-2k\delta-2C\frac{d\delta}{dt}=m\frac{d^2\delta}{dt^2}\tag{1}$$

Initially, we are going to displace the mass to the left by an amount $$\delta_0$$ and hold it in place manually, such that, at time zero, $$\delta=-\delta_0$$, the force of the spring-damper combination from the left is $$F_L=F_0+k\delta_0$$, the force of the spring-damper combination from the right is $$F_R=F_0-k\delta_0$$,and the net force on the mass is $$2k\delta_0$$ to the right; so, to hold the mass in place, we need to be applying a force to the left of $$2k\delta_0$$. This is analogous to the pressure difference that existed in the two chambers prior to release of the piston in the original post.

We next release the mass at time $$t=0^+$$,and allow the mass to move freely. In the limit as the mass approaches zero, the velocity of the mass will experience a step increase in velocity, such that, after a negligibly short time, $$F_L=F_R$$ and $$\frac{d\delta}{dt}=\frac{k}{C}\delta_0$$ (at time $$t = 0^+$$). After this, Eqn. 1 will subsequently apply, with m = 0: $$F_R=F_L$$and$$\frac{d\delta}{dt}=-\frac{k}{C}\delta\tag{2}$$ The solution to this equation for $$\delta(t)$$ subject to the initial condition is $$\delta=-\delta(0)\exp{\left(-\frac{k}{C}t\right)}\tag{3}$$So the displacement decreases exponentially with time. If we substitute Eqn. 3 for the displacement into our equations for the forces on the right and left, we obtain $$F_R=F_L=F=F_0$$for all times greater than zero. So, in the limit of m = 0, the damper forces are such that the combination forces on the two sides of the mass are equal to one another throughout the mass displacement.

This is completely analogous to what happens in the OP situation, where, once the massless piston is released, the viscous stresses in the gases on either side of the piston are such that the forces of the gases in the two chambers on the piston are equal to one another throughout the irreversible process while the piston returns to its equilibrium position.

In our analog system, the work done by the spring damper combination on the left $$W_L=F_0\delta_0$$ is equal in magnitude and opposite in sign to the work done by the spring-damper combination on the right $$W_R=-F_0\delta_0$$. So the net work done is zero. Similarly, in or OP system, the net work done by the gases is zero.

• Chet. Beautiful analogy.👍 Commented Oct 10, 2019 at 12:11
• @BobD I had in mind that educators could use something like this as a pedagogical tool for giving students a better idea what is happening in irreversible gas expansions and compressions, and, in particular why the force per unit area on the piston is not simply the value calculated from the ideal gas law. Commented Oct 10, 2019 at 13:06
• Yes and speaking as your student, it does so beautifully. I think it would appeal to both mechanical and electrical engineering students. In my view, the dashpots are the key. MEs know that dashpots are dissipative. EEs have seen dash pots as the analog of electrical resistors which of course dissipate heat. I've book marked this page in my "Chet Miller analysis" folder. Commented Oct 10, 2019 at 13:28
• Interesting! Thank you. I tend to view what you propose using viscous damping instead as being due to density changes. So, I might ask, what is the time constant for dissipation of viscous damping in an ideal gas versus in a liquid? Alternatively, what is the time constant for an ideal gas to reorganize itself throughout to a lower / higher density versus the same time constant for a liquid? I would be curious to explore such seemingly disparate themes in greater detail. References perhaps???? Commented Oct 10, 2019 at 20:43
• @JeffreyJWeimer Thanks for looking over what I wrote. I don't quite follow what you are asking, but I would be interested in seeing what you come up with in quantifying the answers to these questions. As far as viscosity is concerned, that is the only mechanism we know of for dissipating mechanical energy to internal energy in gases and liquids. I'm not saying that viscous effects and PV effects are the only things happening in a gas. There are obviously other effects as well, such as mass (inertia) of the gas (which gives rise to density variations). However, in the end, this is al wiped Commented Oct 10, 2019 at 22:42

The equation $$dW = - p\;dV$$ is only valid for a reversible process. In an irreversible process the work done will be greater than this.

Yoursaargument shows that, since there is no external source of energy or heat, you will have that $$W_1 = - W_2$$, but you cannot simply relate this to the change in volume.

• The expression $\delta w = -p_{ext} dV$ is true for all forms of mechanical work. It is true even for irreversible processes. By example, for free expansion, $w = 0$ because $p_{ext} = 0$. For reversible processes, $p_{ext} = p_{int}$. Commented Oct 3, 2019 at 1:11
• @JeffreyJWeimer I think OP is just using a convention that they are familiar with. In my class, we consider $$p_{ext}$$ as a constant external pressure, used for irreversible processes. We use $$p$$ as the variable pressure for reversible processes. I've seen different sites and videos choose to use different conventions. But I understand your point. Commented Oct 3, 2019 at 1:30
• The ambiguity in notation does cause mistakes. Note however how the OP appears to write work using external pressure. By example, $p_2$ is external to system 1 in his first equation. Commented Oct 3, 2019 at 2:19

# Foundations

The first law for a differential change in a closed system by the IUPAC form is below.

$$dU = \delta q + \delta w$$

Allow that the system has only mechanical work to obtain this expression.

$$dU = \delta q - p_{ext} dV$$

In this, $$p_{ext}$$ is the external pressure and $$dV$$ is positive when the system expands.

# Problem Statement

Consider two separate systems that allow heat flow and mechanical work. Set a condition that the change in internal energy of both systems are equal. This condition can be satisfied without reservation by setting the internal energy change to zero for both cases.

$$0 = \delta q_A - p_{ext,A} dV_A$$ $$0 = \delta q_B - p_{ext,B} dV_B$$

For the same infinitesimal displacement in volume $$dV$$, the system with the larger instantaneous value of $$p_{ext}$$ will have the larger magnitude of $$\delta q$$.

Now allow the two systems to be connected by a massless barrier. Allow that heat flow cannot occur anywhere but through the barrier. Allow that the barrier moves without friction. Since the systems are connected, we obtain

$$\delta q_A - p_{ext,A} dV_A = \delta q_B - p_{ext,B} dV_B$$

$$\delta q_A - p_{B} dV = \delta q_B + p_{A} dV$$

$$\delta q_B - \delta q_A = (p_{A} - p_B)\ dV$$

Apparently, when $$p_A > p_B$$, then $$|q_B| > |q_A|$$.

How do we reconcile that this result violates the statement that "heat flow in = heat flow out" for an energy balance?

# Resolution

The implicit assumption for the initial state is that, while the two gases are at different pressures and also perhaps occupy different volumes, they are at the same temperature. The implicit realization for a process that takes place within an isolated system is that the end point of the process must be to have the two gases at the same temperature regardless of the final pressure.

We must have $$p_A > p_B$$ any point along the path as the massless piston moves, However, both $$p_A$$ and $$p_B$$ are not constant as the piston moves. They are a function of the position of the massless piston.

The resolution that we obtain must be independent of what we consider to be the state of the gas inside the chamber.

We can easily envision a situation where the massless piston moves with an infinitesimal velocity, allowing the pressure of the gas inside each chamber to remain at the same instantaneous, uniform value throughout. This approach frees us from needing to consider density or velocity gradients in the gas as the piston moves. This approach frees us from knowing any other parameter about the gas, such as its viscosity, in order to resolve the question.

We can envision a two step process as the piston moves. First, we envision that the gas expands adiabatically. No heat is exchanged. Along this step, we define the paths for A and B such that, while $$p_A > p_B$$ for the piston to move and while $$dV_A = -dV_B$$ at any point when the piston moves, the magnitude of the work for both chambers is equal at any point during the process.

$$| \int p_A(V_A) dV_B | = | \int p_B(V_B) dV_A |$$

This hypothetical path is irreversible because the internal and external pressures are different for each chamber. The path is feasible to establish under all conditions stated.

As the higher pressure gas expands adiabatically, it will cool. As the lower pressure gas contracts adiabatically, it will heat up.

For the next step, we allow that the two gases exchange heat. We see this is identically possible for two reasons.

• One gas is now hotter than the other, so that we do not violate the second law of thermodynamics as heat flows.
• Because the final process must not violate the first law, the amount of heat that will be exchanged in the second step will be equal between the two chambers.

# Summary

We have established a process to expand / compress fluids in two chambers within an isolated system that does not violate the first law of thermodynamics overall $$\Delta U = 0$$. It also does not violate the first law at the level that generates the balance of $$|q_A| = |q_B|$$ at any step along the path. Finally, we have also established a process that does not give rise to ambiguity about the requirements that $$p_A > p_B$$ at all points during the process and that heat can only flow between two objects when they are at different temperatures.

When we translate this hypothetical approach to a real-world behavior, we appreciate the insights. In the extreme case that the massless piston moves rapidly, we can well imagine a two step process where expansion / compression take place adiabatically and then heat exchange takes place at constant volume. We do not need to invoke the concept of gas viscosity and velocity gradients within the gas itself to resolve the overall behavior of the entire system. However, we can consider such factors as we might want to investigate the nature of how irreversibility arises and dissipates within each chamber of its own right during the irreversible process.

This is a more precise and detailed assessment of the issue based on fundamental Newtonian fluid mechanics.

For a compressible gas like air contained within a cylinder with a piston in which irreversible (or reversible) expansion of compression is occurring, Newton's law of viscosity in 3D tells us that the local normal compressive stress $$\Pi$$ exerted by the gas on the piston face is given by (see Transport Phenomena by Bird, Stewart, and Lightfoot, Section 1.2): $$\Pi=p-\frac{4}{3}\mu\frac{\partial w}{\partial z}$$with $$p=\rho RT$$where the pressure p is the determined locally by the ideal gas law, $$\mu$$ is the gas viscosity, $$\rho$$ is the local molar density of the gas at the piston face, and $$\partial w/\partial z$$ is the local axial gas velocity gradient at the piston face. In writing down this equation, use has been made of the well-established "no-slip" boundary condition, requiring that the tangential gas velocity components at the piston face are zero.

In addition to the basic "constitutive equation" for a Newtonian fluid, we can also write down the fundamental differential equation for conservation of mass (the so called continuity equation): $$\frac{1}{\rho}\frac{D\rho}{Dt}+\frac{\partial w}{\partial z}=0$$where where $$D\rho/Dt$$ is the time derivative of the molar density evaluated at the moving piston face and where use has again been made of the no-slip boundary condition. If we combine this equation with our equation for the local normal stress $$\Pi$$, we obtain: $$\Pi=p+\frac{4}{3}\frac{\mu}{\rho}\frac{D \rho}{D t}$$

In a reversible expansion or compression (sequence of thermodynamic equilibrium states for the gas), the material time derivative of the molar density is essentially zero, and the molar density, temperature, and pressure are uniform throughout the gas (including at the piston face); for an irreversible expansion or compression, all of these parameters can vary with spatial position within the gas, including at the piston face. So these fluid mechanics equations indicate that, in an irreversible expansion or compression, the normal stress exerted by the gas on the piston face differs from the pressure p predicted by the ideal gas law by the term involving viscosity.

For an irreversible expansion or compression, the local normal stress exerted by the gas on the piston varies with spatial location over the piston face, but we can integrate the local normal stress over the piston face to get the mean normal stress $$\bar{\Pi}$$: $$\bar{\Pi}=\frac{1}{A}\int{\Pi dA}=\frac{1}{A}\int{p dA}+\frac{4}{3}\frac{1}{A}\int{\frac{\mu}{\rho}\frac{D\rho}{Dt} dA}$$

Let us now apply these results to analyzing the problem at hand, which involves a frictionless piston situated within a closed cylinder between two gases at initially different pressures. If we apply Newton's 2nd law of motion to this piston, we obtain: $$\bar{\Pi}_L-\bar{\Pi}_R=\frac{m}{A^2}\frac{d^2V_L}{dt^2}=-\frac{m}{A^2}\frac{d^2V_R}{dt^2}\tag{1}$$Note that, unless the piston is has negligible mass, the mean normal stress exerted by the gas on the left face of the piston differs from the mean normal stress exerted by the gas on the right face of the piston throughout the expansion or compression. Physically, the piston will oscillate back and forth about the final equilibrium position like a mass executing damped harmonic motion. And, at times during the deformation, the mean normal stress on the left face of the piston will exceed the mean normal stress on the right, while at other times, the mean normal stress on the right will exceed the mean normal stress on the left until the piston ultimately comes to rest as a result of the viscous damping. However, in the limit as the mass of the piston becomes negligible, the two mean normal stresses will closely approach one another at all times throughout the process. This means that, in the limit of a massless piston, we will have $$\frac{1}{A}\int{p_L dA}+\frac{4}{3}\frac{1}{A}\int{\frac{\mu}{\rho_l}\frac{D\rho_L}{Dt} dA}=\frac{1}{A}\int{p_R dA}+\frac{4}{3}\frac{1}{A}\int{\frac{\mu}{\rho_R}\frac{D\rho_R}{Dt} dA}$$This equation means that, in the limit of negligible piston mass, even though the mean ideal gas "pressures" of the two gases at the piston faces are unequal, this is compensated for by the viscous part of the normal stresses in such a way that the mean normal compressive stresses on the piston faces are equal to one another throughout the deformation.

Turning attention next to applying the first law of thermodynamics to the piston, we have $$Q_L+Q_R=0\tag{2}$$where $$Q_L$$ is the heat flow from the piston to the gas on the left and $$Q_R$$ is the total heat flow from the piston to the gas on the right, and where the piston itself is assumed to have negligible capacity to store thermal energy.

Next, if we multiply Eqn. 1 by the rate of change of volume $$V_L$$ and integrate the resulting relationship between time zero and time arbitrary time t, we obtain: $$W_L(t)+W_R(t)=KE(t)\tag{3}$$where $$W_L(t)$$ is the cumulative work done by the gas on the left on the piston up to time t, $$W_R(t)$$ is the cumulative work done by the gas on the right on the piston up to time t, and KE(t) is the kinetic energy of the piston at time t, with $$W_L(t)=\int_0^t{\bar{\Pi}_L\frac{dV_L}{dt}dt}\tag{4a}$$ $$W_R(t)=\int_0^t{\bar{\Pi}_R\frac{dV_R}{dt}dt}=-\int_0^t{\bar{\Pi}_L\frac{dV_R}{dt}dt}\tag{4b}$$ and $$KE(t)=\frac{m}{2A^2}\left(\frac{dV_L}{dt}\right)^2=\frac{m}{2A^2}\left(\frac{dV_R}{dt}\right)^2\tag{4c}$$ Let us next apply the first law of thermodynamics to each of the gases in the two compartments: We have: $$\Delta U_L(t)=Q_L(t)-W_L(t)$$and $$\Delta U_R(t)=Q_R(t)-W_R(t)$$where the $$\Delta U's$$ are the changes in the internal energies up to time t. If we add these two equations together, we obtain:$$\Delta U(t)=\Delta U_L(t)+\Delta U_R(t)=(Q_L(t)+Q_R(t))-(W_L(t)+W_R(t))\tag{5}$$where $$\Delta U(t)$$ is the total internal energy change of the two gases up to time t. If we next substitute Eqns. 2 and 3 for the heat and work into this equation, we obtain:$$\Delta U(t)=-KE(t)$$This equation tells us that, during the deformation, the total internal energy of the combined system decreases to compensate for the increase in kinetic energy of the piston. However, in the end, when the piston ultimately comes to rest as a result of viscous damping, the final change in internal energy of the combined system is zero.

• Stunning! The probing question is "When $\int p dV$ for one chamber is bigger than that the other chamber, does that mean that heat flow in does not equal heat flow out?" Eq 2 answers that hard question simply by saying NO, heat flow out must equal heat flow in by the first law. So, all the other details given here, elegant as they are, are superfluous? Also, this still leaves me wishing for an analysis that does not have to consider fluids, oscillating irreversibility, and mass or massless pistons. It cannot be so hard to make thermodynamics make sense just on its own right. Commented Oct 22, 2019 at 23:06
• @JeffreyJWeimer Thanks. It depends on whether the person we are trying to teach about this would be willing to accept at face value the premise that an ideal gas obeys the ideal gas law only under equilibrium or quasi-static conditions and that in rapid (irreversible) deformations, the force per unit area exerted by the gas is not equal to nRT/V. Commented Oct 23, 2019 at 3:45
• The answer to the question has to be valid regardless of whether the system contains a gas, liquid, or solid. Commented Oct 23, 2019 at 13:14
• @JeffreyJWeimer The approach is going to be basically the same for a liquid as for a gas (since liquids are also also viscous), although the rheological constitutive equation for a liquid is going to be different. For example, instead of $p=\rho RT$, it is going to be something like $p=p_0+\ln(\rho/\rho_0)+(T-T_0)$. In the case of a linearly elastic solid, the situation is somewhat different because there is no internal mechanism for dissipation. But still, a spring and mass system will not oscillate forever, and when we load an elastic solid, it does not vibrate forever. (continued) Commented Oct 23, 2019 at 14:20
• In such cases, minor "frictional" interactions with the surroundings are responsible for damping. Still, if you are interested in pursuing this further in the case of ideally elastic solids, here is a wonderful reference on the fundamental thermodynamics of such materials: maeresearch.ucsd.edu/~vlubarda/research/pdfpapers/ijss-04.pdf. Enjoy!! Commented Oct 23, 2019 at 14:25