How much work can you extract from a turbine connected to a pressure cooker?
The situation is modeled as a rigid adiabatic tank of volume $V_{tank}$, which initially contains water at a high pressure $P_1$ and quality $x_1$.
A tube connects the tank to a valve that only allows the flow of vapor to an isentropic turbine, which discharges to the atmosphere and produces work $W$. We know that the discharged vapor is a saturated vapor at $P_{atm}$.
The schematic is shown below:
Now, the valve is opened and vapor flows out until all the liquid phase in the tank is evaporated. Then the valve is closed.
Known parameters: $V_{tank}$, $P_1$, $x_1$, $x_2 = 0$, $P_{outlet}$
Unknown parameters: $T_2$, $P_2$, $W$
I begin by performing an energy balance on the whole system:
$$ \Delta U = m(u_{f,1} + x_1 u_{fg,1}) - (m-\Delta m)(u_{f,2})= -W -\Delta m h_{out}$$
where $h_{out}=h_g(P_{atm})$, the mass of water (vapor) loss is given by $\Delta m$, and $u_{f,1}$, $u_{fg,1}$ are tabulated values for water.
Initially, we have mass $m = \frac{V_{tank}}{v_1}$ and $v_1 = v_f + x_1v_{fg}$ is defined from steam tables since state 1 is fully defined.
I think I can assume that the final pressure is $P_{atm}$, once all the steam runs through the turbine, therefore state 2 is fully defined and $u_{f,2} = u_f(P_{atm})$.
Now we have 2 unknowns: $\Delta m$, and $W$.
The amount of mass that we lose, $\Delta m$, is the only other parameter needed to calculate work.
Entropy balance on the entire system adds another equation:
$$ \Delta S = m(s_{f,1} + x_1s_{fg,1}) - (m-\Delta m)s_{f,2} = -\Delta m s_{out} + S_{gen}$$
where $s_{out} = s_g(P_{atm})$, and $s_{f,2} = s_f(P_{atm})$. This adds entropy generation $S_{gen}$ as another unknown, however, and therefore I have 3 remaining unknowns ($\Delta m$, $W$, $S_{gen}$). If I could assume zero entropy generation, I could solve this problem, but I think the steam extraction is irreversible.
How else can I go about this?