I am attempting to develop a simulation of the boiler of a steam locomotive for a video game.
Assume we begin with a rigid vessel of volume $V$ entirely filled with known masses of liquid water $m_l$ and steam vapor $m_v$ at pressure $P$. We then inject a quantity of heat $Q$, vaporizing some unknown mass of the water $m_e$ into steam, and the vessel settles into a new equilibrium at higher pressure $P'$.
Simplifying assumptions:
- The vessel is perfectly rigid, sealed, and insulated, so total volume, mass, and energy are preserved, and the vessel itself does not change in temperature.
- There is no water in liquid state suspended in the steam, i.e. the steam is dry with 100% quality.
- Pressures $P$ and $P'$ are sufficiently close that the physical properties of steam and water can be approximated as constant, particularly density and specific heat.
- The system evolves along the saturation line, so pressure fully determines temperature and vice versa.
- Likewise, assume temperature is uniform throughout the vessel both at the start and end of the process.
- If it helps, for most but not all simulation initial conditions, $m_l >> m_v >> m_e$.
Goal:
- The final pressure $P'$. Equivalently, the final temperature, or the mass of water that evaporates ($m_e$).
How far I've gotten:
Starting with the conservation of energy, I believe the heat will go into a) heating the water to the final temperature, b) heating the initial vapor to the final temperature, and c) vaporizing some quantity of the (heated) water.
$Q = m_l C_l \Delta T + m_v C_v \Delta T + m_e \Delta H_v$
where $C_l$ is the isochoric specific heat capacity of water, $C_v$ the isochoric specific heat capacity of steam vapor, and $\Delta H_v$ the latent heat of vaporization of water, all at pressure $P$. This gives me two unknowns $m_e$ and $\Delta T$, but I've been unable to relate them to each other, and I'm not sure that I can since the phase transition happens at a single temperature.
Introducing conservation of mass has so far gotten me nothing but a tautology: $m_l + m_v = (m_l-m_e)+(m_v+m_e)$
Working with volume via density has led to the predictable conclusion that volume is conserved if nothing changes:
$V = V_l+V_v = \frac{m_l}{\rho_l} + \frac{m_v}{\rho_v}$
$= \frac{m_l-m_e}{\rho_l} + \frac{m_v+m_e}{\rho_v}$
$= \frac{m_l}{\rho_l} + \frac{m_v}{\rho_v} - \frac{m_e}{\rho_l} + \frac{m_e}{\rho_v}$
$= V_l + V_v + \frac{m_e\rho_l}{\rho_l\rho_v} - \frac{m_e\rho_v}{\rho_l\rho_v}$
Thus $0 = m_e\frac{\rho_l-\rho_v}{\rho_l \rho_v}$.
Questions:
- Will this model approximate reality or am I missing key factors?
- Is there an analytic solution for this? As this is for a video game, performance is key and I'm willing to give up considerable physical accuracy to get it.