The rx_flash routine is the core for a full absorber model. However, it needs to be embedded in another routine that computes the total feed and initial guesses for a single stage. This additional routine, stage_N, considers the location of the stage in the column in order to compute the liquid and gas feeds to the stage. The top and bottom stages are unique because they don't receive liquid or gas, respectively, from other stages. They do receive liq_add and gas_add, respectively.
The function is shown below.
NC = number of compounds
NS = number of stages
Gas = a NC x NS matrix of the vapor leaving the stages
Liq = a NC x NS matrix of the liquid leaving the stages
gas_add = a NC x NS matrix of gas fed to the stages
liq_add = a NC x NS matrix of liquid fed to the stages
vol = gas volume between this stage and the next higher stage
t = temperature, K
p = pressure, Pa
Gas, Liq, gas_add, and liq_add are flow rates, mol/s
k0NBS = the rate constant for NO oxidation 
Description of routine
The first part of the routine computes the total gas and liquid feeds to the stage. Then rx_flash is called, using the Gas and Liq columns for this stage as the initial guesses. These matrices are the ultimate solution which changes as the column iterations proceed. Finally, the gas leaving the stage is adjusted for the NO oxidation that occurs before the gas enters the stage above. The output from stage_N is the gas and liquid leaving the stage, in the nested vector, out.
Two layers, one to go
We now have two layers needed for the column model: rx_flash and stage_N. In the next post, the final layer will be added. This layer will cycle through the stages and also iterate until Gas and Liq are converged.
 Westley, Francis. Table of Recommended Rate Constants for Chemical Reactions Occurring in Combustion, NSRDS-NBS67, Nat. Bur. Standards, 1980.