The first routine needed for the reactive absorber model is a flash routine that equilibrates the two reactions and the two phases. The Mathcad solve block is used to produce a rx_flash function that can be used repeatedly. In this first model, I have assumed isothermal operation.
The arguments for rx_flash are, in order, total molar feed vector, nf, guesses for molar vapor vector, n, and liquid, m, temperature, and pressure. By including nf, the function can be used with any total feed, not just the one used to create the function. Similarly, guesses for the results can be provided to accelerate convergence.
Tolerance parameters in Mathcad
There are two tolerance parameters for Mathcad, TOL and CTOL. In the solve block above, every statement is a constraint, so CTOL is the active tolerance parameter. I found that the results were best with CTOL = 10^-7.
Some solve blocks involve finding a minimum or maximum of a function accompanied by constraints. In that case, TOL would govern the min/max problem and CTOL would apply to the constraints.
The tolerances are absolute errors. If relative errors are needed, the constraints can be written in a relative, or fractional manner. If I run into trouble with my development, I may need to rewrite rx_flash in such a manner.
A temperature survey
The plots below show effect of temperature on the flash.
In the previous post, the equilibrium coefficient for the HNO3 reaction clearly shows that production of nitric acid should decrease as the temperature is increased. Would anyone like to explain why HNO3 is increasing in both the gas and liquid phases as temperature is increased?