As per @Bhavya Sharma's assessment, I too disagree strongly with what this author presents.
Consider a rigid adiabatic container of volume $V_2$, with a barrier within the container separating one mole of a real gas in a sub-compartment of volume $V_1<V_2$ from a second sub-compartment of volume $V_2-V_1$ containing vacuum. The initial gas temperature is $T_1$. We remove the barrier and allow the gas to re-equilibrate to a new (unknown) temperature $T_2$. We wish to determine the new temperature.
We begin by applying the first law of thermodynamics $\Delta U=Q+W$, where Q is the amount of heat that enters the container, W is the amount of work that the surroundings (in this case, the container) does on our system (in this case, the gas), and $\Delta U$ is the change in internal energy of our gas. The amount of heat that enters the container is zero (since the container is adiabatic) and the amount of work that the surroundings do on our system is zero (since the displacements at the interface with the rigid surroundings are zero). Therefore, the change in internal energy is zero. $$\Delta U=0\tag{1a}$$ or, equivalently, $$U(T_2,V_2)=U(T_1,V_1)\tag{1b}$$where U is determined relative to some reference state, say $(T_{ref},\infty)$, where U is taken to be zero.
This is all the information we can gleen from applying the first law of thermodynamics to this problem. However, we know that U is a function of state, and we also know that, from the 2nd law of thermodynamics, it follows that:
$$dU=C_vdT-\left[P-T\left(\frac{\partial P}{\partial T}\right)_V\right]dV\tag{2}$$If we know the heat capacity at constant volume as a function of temperature and pressure, and we know the equation of state for the real gas, we can integrate this equation over any arbitrary path to determine the change in internal energy from an initial state to a final state, and can thus determine the final temperature required to produce zero change in internal energy in our problem.
For some reason that doesn't make sense to me, the term in brackets in Eqn. 2 is sometimes referred to in the literature as the "internal pressure" $\pi(T,V)$ of the gas:$$\pi(T,V)=\left[P-T\left(\frac{\partial P}{\partial T}\right)_V\right]\tag{3}$$
As far as I'm concerned, they might as well have called this the "hippopotamus." I think there is some molecular motivation for calling this the "internal pressure," but I have never been able to see through the arguments. This author takes the conceptualization one step further by calling $$-\pi(T,V)dV=-\left[P-T\left(\frac{\partial P}{\partial T}\right)_V\right]dV\tag{4}$$ the "internal work." This too has no physical significance to me because it is totally separate from the first law of thermodynamics, and does not even relate to any kind of physical work involving force and displacement. I would prefer to call it "hippopotamus work." None of this terminology makes any sense to me, and to make matters worse, it is not even needed to solve problems of this kind. To make matters still worse, it has caused the OP to become confused into thinking that "internal work" is something that can actually be interpreted as real work in applying the laws of thermodynamics.
Out of the infinite number of possible (T,V) trajectories that can be used to integrate Eqn. 2 from the initial state to the final state of the system (to obtain $\Delta U$), the simplest trajectory involves an excursion through the ideal gas region ($V \rightarrow \infty$) . This is because, in the ideal gas region, $C_v$ is a function only of temperature $C_v^{IG}(T)$, and not of specific volume. Furthermore, the ideal gas heat capacity of the gas as a function of temperature is quite often known in advance. Any other path would require knowledge of both the temperature dependence and the volume dependence of $C_v$ (i.e., $C_v(T,V)$. So, to integrate Eqn. 2, we write:
$$\Delta U=-\int_{V_1}^{\infty}{\pi (T_1,V')dV'}+\int_{T_1}^{T_2}{C_v^{IG}(T)dT}+\int_{V_2}^{\infty}{\pi (T_2,V')dV'}\tag{5}$$where use has been made here of Eqn. 3 for shorthand purposes only. The same result can also be expressed in the form of Eqn. 1b by writing:
$$U(T,V)=\int_{T_{ref}}^{T}{C_v^{IG}(T')dT'}+\int_{V}^{\infty}{\pi (T,V')dV'}\tag{6}$$
For a van der Waals gas, $$\pi=-\frac{a}{V^2}$$and$$U(T,V)=\int_{T_{ref}}^{T}{C_v^{IG}(T')dT'}-\frac{a}{V}\tag{7a}$$or
$$\Delta U=\int_{T_1}^{T_2}{C_v^{IG}(T)dT}-a\left(\frac{1}{V_2}-\frac{1}{V_1}\right)\tag{7b}$$
ADDENDUM TO ADDRESS SHASHAANK'S QUESTION
Great question!! In the case where there is a small hole punched in the barrier (and the barrier is insulated), when the system equilibrates, the final temperatures in the two chambers will be different (assuming also that there is no heat transfer through the tiny opening in the barrier). But, there is still no work done on the combined system, and no change in internal energy of the combined system. But if you want to find out the final equilibrium state in each of the chambers, then you need to divide the gas into two subsystems: 1. The gas that has remained in the original chamber and 2. The gas that has gone into the vacuum chamber.
Imagine that there was a membrane that completely surrounded gas #1 during the process. The gas that has remained in the original chamber has experienced a very slow adiabatic (essentially reversible) expansion up to its new final volume (entirely filling the original containter). It has done adiabatic reversible work at its boundary, driving gas #2 out of the container. But this is work external to gas #1. If we knew the number of moles that got transferred through the opening, we could calculate the final state of gas #1. The conditions that we can use to determine the final states in both containers are that (1) the final pressures in the two chambers match and (2) the total change in internal energy for the combined system is zero.