I'd like to understand whether a work interaction occurs during the thermodynamic process described below, and why or why not. My analysis seems to suggest that some sort of work should be occurring, but my intuition says there's no work done. So specifically I want to know where my approach fails, or why my intuition is off base.
Consider two equal volumes of an ideal gas, $A$ and $B$, separated by a fixed adiabatic wall. Both halves contain the same number of molecules: The only difference between the two halves is that they're at different temperatures, say $T_A$ and $T_B$. This is the initial equilibrium state of the system.
Now, suppose the adiabatic wall is replaced by a thermally conductive wall, also rigid. This wall keeps the volume of each half the same, but allows energy transfer between the two halves. After some time, the two halves reach a common temperature $(T_A+T_B)/2$.
I can say a few things about this process. Let's just focus on one half of the system, say $A$. First, assuming that the movement towards equilibrium after initial thermal contact is sufficiently slow, the subsystem $A$ passes through a succession of states with roughly well-defined thermodynamic variables. So, at every infinitesimal step of the process, we have:
$$dU=TdS-PdV,$$
where $U$, $T$, $S$, $P$, and $V$ are thermodynamic properties of $A$ alone. Second, by the first law of thermodynamics:
$$dU=\delta Q + \delta W.$$
Here, I've used the convention that $\delta Q$ is the heat flow into $A$ during the infinitesimal step, and $\delta W$ is the work done on A. Taking the difference between these two equations yields:
$$TdS - \delta Q = PdV + \delta W.$$
Now, it seems to me that the process is irreversible: Returning the total system $A$ and $B$ to its original state would require some sort of permanent alteration of its environment. We can't just make the temperatures of the two halves unequal again without any external effects (right? This is one part where I'm a little confused, so I'm being somewhat imprecise). So by the second law of thermodynamics, we know that $dS > \delta Q/T$, and so:
$$TdS - \delta Q = PdV + \delta W > 0.$$
But the volume of $A$ remains fixed during the process, so $dV=0$, and therefore we have $\delta W > 0$. So it seems like at each infinitesimal step in the process, some work is done on $A$. But I can't see a mechanism by which this work is being performed. So am I wrong in my conclusion that a work interaction is occurring, or I am not thinking about something else in the right way?
Thanks.