Suppose we have an adiabatic box with a fixed volume $V$ and contains $n_0$ mol of gas at pressure $p_0$ and temperature $T_0$. Now the box is punctured by a small hole and gas from the outside flows in. The outside (surrounding) has a pressure of $p$ and a temperature of $T_0$. Assume the internal energy of $n$ mol of gas at temperature $T$ is $nc_v T$.
What is the final temperature in the box?
I tried the above problem but couldn't get far; I can get the temperature $T$ in terms of $T_0, R, c_v$ if the box is empty at first (ie. a vacuum). $\left(T = T_0 \frac{c_v + R}{c_v}\right)$
For this problem my thinking is something like:
$\Delta Q = 0$, so $\Delta U = \Delta W$
Then the gas outside has to do both boundary and shaft/flow work
The boundary work is done as the gas outside is expanding against the pressure $p_0$ in the box and
The shaft/flow work is done as the gas enters the box through the hole
However this is where I can't quite continue
Is $\Delta W = \Delta(PV) = P\Delta V + V\Delta P$? Or is $\Delta W = P\Delta V + PV$?
Furthermore, if $\Delta W = P\Delta V + PV$, then is the $P$ in $PV$ equal to $p - p_0$?
Finally, if, as the temperature of the gas originally in the box increases due to the work done by the outside gas, in order to calculate the final temperature in the box we need to know how much gas from outside entered, how can we do this?
Thanks.