Solution (source code)

= Solution

The weaker plume detrains into the middle layer at $h_2$, while the stronger plume passes through it and feeds the upper layer at $h_1$. Middle-layer volume balance is
$$
Q_2(h_2)=Q_1(h_1)-Q_1(h_2).
$$
Using $Q_i(z)=C_QF_i^{1/3}z^{5/3}$ gives
$$
\boxed{
\frac{h_2}{h_1}
=\left[
1+\left(\frac{F_2}{F_1}\right)^{1/3}
\right]^{-3/5}
}.
$$

The middle layer receives buoyancy flux $F_2$ and loses volume $Q_2(h_2)$ by entrainment into the strong plume. The upper layer ultimately receives both source buoyancy fluxes and loses volume $Q_1(h_1)$ through the ceiling. Hence
$$
\boxed{
\widehat g'_{10}=\frac{F_2}{Q_2(h_2)},
\qquad
\widehat g'_{20}=\frac{F_1+F_2}{Q_1(h_1)}
}.
$$

The interior-minus-exterior pressure is constant below $h_2$, rises with slope $\rho_0\widehat g'_{10}$ in the middle layer, and with slope $\rho_0\widehat g'_{20}$ in the upper layer. Put
$$
\mathcal B
=\widehat g'_{10}(h_1-h_2)
+\widehat g'_{20}(H-h_1).
$$
Equal ideal openings split the total pressure difference equally, and the common ventilation rate is
$$
Q_1(h_1)=C_dA_f\sqrt{\mathcal B}
=C_dA_c\sqrt{\mathcal B}.
$$
Thus the required equal vent areas are
$$
\boxed{
A_f=A_c
=\frac{Q_1(h_1)}
{C_d\sqrt{
\widehat g'_{10}(h_1-h_2)
+\widehat g'_{20}(H-h_1)}}
}.
$$