This diagram shows the subscript number for each stream:
Material balances on the mixing point
$$ [1] \quad F_{2} = F_{1} + F_{7} $$ $$ [2] \quad x_{i, 2} F_{2} = x_{i, 1} F_{1} + x_{i, 7} F_{7} $$
where \( F_{j} \) is the total molar flow rate at location \( j \), and \( x_{i, j} \) is the mole fraction of component \( i \) at location \( j \). The system has 3 component balances (N2, H2, and CH4).
Material balances on the reactor
Since a stoichiometric feed is used, there is one equation [3] for each reactant (N2, H2):
$$ [3] \quad x_{i, 3} F_{3} = x_{i, 2} F_{2} ( 1 - X ) $$
where \( X \) is the fractional conversion. Equation [4] is for the NH3 product:
$$ [4] \quad x_{NH_{3}, 3} F_{3} = 2 x_{NH_{2}} F_{2} X $$
where 2 is the stoichiometric coefficient for NH3. Equation [5] is for the CH4 product:
$$ [5] \quad x_{CH_{4}, 2} F_{2} = x_{CH_{4}, 3} F_{3} $$
Material balances on the separator
The separator is assumed to completely remove NH3 from the mixture but no H2, N2, or CH4. The overall material balance on the separator is:
$$ [6] \quad F_{3} = F_{4} + F_{5} $$
and the component material balance are:
$$ [7] \quad x_{i, 3} F_{3} = x_{i, 4} F_{4} + x_{i, 5} F_{5} $$
where \( x_{H_{2},4} \), \( x_{N_{2},4} \), and \( x_{CH_{4},4} \) are zero and \( x_{NH_{3},4} \) is 1.0.
Material balance on the splitting point:
$$ [8] \quad F_{5} = F_{6} + F_{7} $$ $$ [9] \quad F_{6} = p F_{5} $$
where \( p \) is the fraction purged from stream 5, and
$$ [10] \quad F_{7} = (1 - p) F_{5} $$ $$ [11] \quad x_{i, 5} = x_{i, 6} = x_{i, 7} $$
where there is one equation [11] for each component (N2, H2, CH4) at the splitting point. Note that the total materials balances (equations [1], [6], [8]) are not independent equations. The above equations are linear, but they were solved using an iteration method. The Excel spreadsheet here shows how to use the Excel Solver function to solve this system of equations.