# 3. Improved Membrane Unit in Mathematica Linked to CHEMCAD

## Description

CHEMCAD is a suite of software for the simulation of chemical processes and the design of equipment. Mathematica is an entirely different type of software, providing powerful computer algebra tools and mathematical functions for the theoretical or numerical solution of advanced mathematical problems. This data set provides instructions with an example for connecting CHEMCAD to Mathematica through Excel. The example is a simple well-mixed membrane calculation with a fully specified feed stream split by the membrane into retentate and permeate streams. This data set is similar to Reference 1 in that the same feed and membrane specifications are used. In Reference 1, we used the algebraic solution provided in Reference 2, which was arrived at by the authors after a series of algebraic manipulations. What makes this data set different is that we invoked the symbolic engine in Mathematica, specifying only the governing equations and letting Mathematica arrive at the solution. This makes the model far more flexible since additional components can easily be added by adding additional flux and species mole balance equations and letting Mathematica re-derive the solution. The results are interesting because a wide range of advanced design and simulation equations can be posed in Mathematica and then used directly in simulations called from and running live in CHEMCAD. Files and instructions for connecting the software using Mathematica Link for Excel are included. The software prerequisites are working, licensed copies of Mathematica, CHEMCAD, and Mathematica Link for Excel. Users without licenses can request free trials from the vendors.

## Files

## Steps to reproduce

We took the following steps to verify that the software connectivity, data maps, and calculations are working correctly. The work was verified by replicating the published example problem from the textbook by Seader and Henley [Reference 2]. In all cases, we achieved the exact same answers as in the published solution. We also had each contributor download the files and follow the procedure in the instructions file to make sure the guidance is correct. In the example, air containing only nitrogen and oxygen is continuously separated into a nitrogen-enriched retentate stream and an oxygen-enriched permeate stream by gas permeation through a low-density polyethylene membrane. The membrane is in the form of a thin-film composite with a 0.2-μm-thick membrane skin. A total of 20,000 SCFM of clean dry air with composition 79 mol% N2 and 21 mole% O2 at 150 psia and 78 deg F is sent to the separator. The solubilities and diffusivities of nitrogen and oxygen are taken from Table 14.6 in the reference. The material balance and molar flux equation are used to calculate the membrane area in square feet as a function of the cut (moles in the permeate divided by moles in the feed). Pressures of 150 psia on the retentate side and 15 psia on the permeate side are assumed, with perfect mixing on both sides of the membrane, such that compositions on both sides are uniform and equal to exit compositions. Pressure drops and any mass transfer resistances external to the membrane are neglected. The solution shown here is also slightly different in one other respect. In the solution shown here, the user specifies the membrane area, and the cut and product flows and compositions are calculated. In the author's solution in Reference 2, the cut is specified. References [1] Biaglow, Andrew (2023), “Simple Membrane Unit in Mathematica Linked to CHEMCAD ”, Mendeley Data, V1, doi: 10.17632/cdcgbsrrhc.1 [2] J. Henley and E. Seader, Separation Process Principles, New York: Wiley, 1998, Example 14.5, pp. 705-707.