I would have liked to get some details on the relation between the mechanical and thermodynamical definitions of pressure. I have read that $p_\mathrm{mech}=p_\mathrm{therm}-\operatorname{div}\left(\mathbf v\right)\cdot\left(\frac2 3\cdot\mu+\lambda\right)$ (let us only consider newtonian fluids), where $\mathbf v$ is the fluid velocity field, $\mu$ is the dynamic viscosity and $\lambda$ is the bulk viscosity. To the best of my knowledge, I understand this equation and how it is derived. The problem I have with it is that the derivation I've seen (on this StackExchange question) just called $p_\mathrm{therm}$ the expression $\frac1 3\cdot\operatorname{Tr}\left(\mathbf\sigma\right)$, where $\mathbf\sigma$ is the stress tensor of the fluid. I understand $p_\mathrm{therm}$ as defined by $p_\mathrm{therm}=-\left(\frac{\partial U}{\partial V}\right)_{S,\,N=\mathrm{cst}}$ or by some other equivalent formula (using another thermodynamic potential than the internal energy $U$).
But what is the proof that $-\left(\frac{\partial U}{\partial V}\right)_{S,\,N=\mathrm{cst}}=\frac1 3\cdot\operatorname{Tr}\left(\sigma\right)$?
I find this particularly interesting as on the left hand side are only quantities that can be defined through a statistical physics approach, and on the right hand side is a quantity defined in continuum mechanics.
Usually, in introductory classes on thermodynamics, you learn the $-p\cdot\mathrm dV$ term in the thermodynamic identity $\mathrm dU=-p\cdot\mathrm dV+T\cdot\mathrm dS$ (for a number $N=\mathrm{cst}$ of particles) through the following proof: you write out the first principle for a infinitesimally small transformation ($\mathrm dU=\delta W+\delta Q$, where $\delta W$ is the work and $\delta Q$ the heat) and you state that $\delta W$ is the work of pressure forces. Thoses forces act on each surface element $\mathrm d\mathbf\Sigma$ of the system on a length $\mathrm d\mathbf l\left(\mathrm d\mathbf\Sigma\right)=\mathbf r_{\mathrm d\mathbf\Sigma}\left(t+\mathrm dt\right)-\mathbf r_{\mathrm d\mathbf\Sigma}\left(t\right)$, where $\mathbf r_{\mathrm d\mathbf\Sigma}\left(t\right)$ is the position of the surface element $\mathrm d\mathbf\Sigma$ a time $t$ relative to an arbitrary origin. Integrating, you get: $\delta W=\iint_\mathbf\Sigma-p\mathrm d\mathbf l\cdot\mathrm d\mathbf\Sigma=-p\cdot\left(\iint_\mathbf\Sigma\mathbf r_{\mathrm d\mathbf\Sigma}\left(t+\mathrm dt\right)\cdot\mathrm d\mathbf\Sigma-\iint_\mathbf\Sigma\mathbf r_{\mathrm d\mathbf\Sigma}\left(t\right)\cdot\mathrm d\mathbf\Sigma\right)=-p\cdot\left(V\left(t+\mathrm dt\right)-V\left(t\right)\right)=-p\cdot\mathrm dV$. I have several problems with this proof:
- It appears $p$ in this proof refers to the thermodynamical pressure, as the result $\mathrm dU=-p\cdot\mathrm dV+\dots$ indicates. In the proof though, should $p$ not be the one in $p=\frac F S$, that is, the mechanical pressure? I get that they are equal if the fluid doesn't move, but here it necessarily moves as the volume changes. I expect complications because of the out of equilibrium situation due to the transformation.
- What allows you to take $p$ out of the integral?
- You are considering a transformation where the volume changes. What if you cannot do that, because you study a system occupying a box of given volume (for example in the canonical ensemble)? In those cases, how should you make sense of the derivative $\left(\frac{\partial U}{\partial V}\right)_{S,\,N=\mathrm{cst}}$?
- This is more of an open question, but what if your system does not actually have a given bounding surface (for instance if your system is the set of all molecules of one particular type in a mix of several types of molecules) or volume? Can you still define pressure in that case, for this particular system?
That was a big question, huge thanks to anyone who can give an answer to one of the four questions or give another proof for the identity $-\left(\frac{\partial U}{\partial V}\right)_{S,\,N=\mathrm{cst}}=\frac1 3\cdot\operatorname{Tr}\left(\sigma\right)$.