Here is my analysis of the problem based on the open system (control volume) versions of the 1st and 2nd laws of thermodynamics applied to each of the two tanks and the turbine. It does not require the temperatures in the two tanks to be equal (as I definitely do not expect them to be). It also assumes that the mass holdup in the turbine is negligible, so that the turbine operates at quasi-steady-state, and all the mass of gas resides in the two tanks.
Nomenclature
##n_1(t)=## moles of gas in tank 1
##n_2(t)=## moles of gas in tank 2
##T_1(t)=## temperature of gas in tank 1 = temperature of gas entering turbine
##T_2(t)=## temperature of gas in tank 2 (assumed well-mixed)
##P_1(t)=## pressure of gas in tank 1 = pressure of gas entering turbine
##P_2(t)=## pressure of gas in tank 2 = pressure of gas exiting turbine
##T_f(t)=## temperature of gas exiting turbine and entering tank 2
##u_1(t)## = internal energy per mole of gas in tank 1 = internal energy per mole of gas exiting tank 1 and entering turbine
##h_1(t)## = enthalpy per mole of gas in tank 1 = enthalpy per mole of gas exiting tank 1 and entering turbine
##h_f(t)## = enthalpy per mole of gas exiting turbine and entering tank 2
##u_2(t)## = internal energy per mole of gas in tank 2
TANK 1
Application of the open system version of the 1st law to Tank 1 yields:
$$\frac{d(n_1u_1)}{dt}=\frac{dn_1}{dt}h_1=\frac{dn_1}{dt}(u_1+RT_1)$$
Differentiating the left hand side by parts then yields:
$$n_1\frac{du_1}{dt}=RT_1\frac{dn_1}{dt}$$or equivalently $$n_1C_v\frac{dT_1}{dn_1}=RT_1$$ This equation integrates immediately to $$\frac{T_1}{T_{10}}=\left(\frac{n_1}{n_{10}}\right)^{(\gamma-1)}\tag{1}$$
The corresponding pressure is $$P_1=\frac{n_1RT_1}{V_1}=\frac{n_1RT_{10}}{V_1}\left(\frac{n_1}{n_{10}}\right)^{(\gamma-1)}=\frac{n_{10}RT_{10}}{V_1}\left(\frac{n_1}{n_{10}}\right)^{\gamma}=P_{10}\left(\frac{n_1}{n_{10}}\right)^{\gamma}\tag{2}$$
Eqns. 1 and 2 express the temperature in Tank 1 parametrically in terms of the number of moles of gas ##n_1(t)## remaining in the tank at any time. As expected, both the temperature and pressure decrease as gas leaves the adiabatic tank during the process.
TURBINE
Application of the open system version of the 2nd law of thermodynamics to the Turbine operating at steady state, adiabatically, and reversibly yields: $$-\frac{dn_1}{dt}\Delta s=0$$ where ##\Delta s## is the
change in entropy per mole of gas passing through the turbine, given by:
$$\Delta s=C_p\ln{(T_f/T_1)}-R\ln{(P_2/P_1)}=0$$or equivalently$$\frac{T_f}{T_1}=\left(\frac{P_2}{P_1}\right)^{\frac{(\gamma-1)}{\gamma}}\tag{3}$$where ##P_2## is the exit pressure from the turbine (also equal to the pressure in Tank 2)
TANK 2
Application of the open system version of the 1st law to Tank 2 yields:
$$\frac{d(n_2u_2)}{dt}=\frac{dn_2}{dt}h_f=\frac{dn_2}{dt}(u_f+RT_f)$$
Differentiating the left hand side by parts then yields:
$$n_2\frac{du_2}{dt}=(u_f-u_2+RT_f)\frac{dn_2}{dt}$$or equivalently
$$n_2C_v\frac{dT_2}{dt}=(C_pT_f-C_vT_2)\frac{dn_2}{dt}$$or equivalently
$$\frac{d{(n_2T_2)}}{dn_2}=\gamma T_f$$
Next, from the ideal gas law, we have that ##n_2T_2=\frac{P_2V_2}{R}##. Substitution of this into the previous equation gives:$$\frac{V_2}{R}\frac{dP_2}{dn_2}=\gamma T_f\tag{4}$$
If we next substitute Eqns 1- 3 into Eqn. 4, we obtain
$$\frac{V_2}{R}\frac{dP_2}{dn_2}=\gamma T_{10}\left(\frac{P_2}{P_{10}}\right)^{\frac{(\gamma-1)}{\gamma}}$$Further manipulation using the ideal gas law and integration leads to the astonishingly and unexpectedly simple result that $$\frac{P_2}{P_{10}}=\left(\frac{n_2V_1}{n_{10}V_2}\right)^\gamma\tag{5}$$
It will complete this analysis in a subsequent post.