Defining work in a general, non-quasistic process involving thermal interaction Is it possible, even in theory, to determine the work done and the heat exchanged in a general, non-quasistatic process?
Example situation: Consider a tube separated into two sides A and B by a piston that is initially in a fixed position. The piston conducts heat. Initially, side A is filled with a cool, low-density gas and side B is empty. At t=0, we rapidly fill side B with a hot gas to an extremely high density. We then quickly release the piston, causing it to rapidly move towards side A. Assume the piston moves fast enough that the process cannot be considered quasi-static. Furthermore, assume that initial temperature difference between the gasses is large enough to ensure that they interact thermally during this process.
Question: Can we define the work done on A in this process?
My thinking: In a non-quasi-static process, mechanical interaction causes the energy levels defined by the Hamiltonian to shift. At the same time, the interaction causes transitions between energy levels to occur. The combination of these two effects results in a change in average energy of the system (A). According to Reif, this energy change is defined as the work. However, at the same time we have thermal interaction between A and B. These interactions do not cause the energy levels of A to shift, but it does cause transitions between energy levels.
At any step in the process, the most we could know about our system is the energy levels and the population of those energy levels by an ensemble of similar systems. However, I don't see how we can determine which transitions from the original state were induced by mechanical interactions and which were induced by thermal interactions. Therefore, I don't see how we can separate the total average energy change into work and heat.
Any insights into this problem or where my thinking went astray is deeply appreciated.
 A: An irreversible process like this can not be quantified using equilibrium thermodynamics alone.  This process involves large non-uniform temperature gradients and velocity gradients within the gas.  So the transport phenomena of viscous momentum transfer and conductive heat transfer are present.  In freshman physics, we learned about Fourier's law of heat conduction and Newton's law of viscous momentum transfer. For more complicated situations involving temperature- and velocity gradients that vary with position and direction, we need to use the 3D tensorial versions of these laws.  For Fourier's law, the local heat flux vector is expressed in terms of the temperature gradient vector.  For Newton's law of viscous momentum transfer, the viscous stress tensor is expressed in terms of the symmetric part of the velocity gradient tensor.  The new physical property parameters involved here are the thermal conductivity and the viscosity.
These transport laws are substituted into a partial differential equation called the differential momentum balance equation and a differential energy balance equation (the time-dependent first law of thermodynamics with transport processes included).  These equations then allow us to solve for the variations in velocity and temperature with respect to time and spatial position within the system during the process.  The equations are usually pretty complicated, so they typically require the use of Computational Fluid Dynamics (CFD) numerical solution.
