{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "*This notebook contains course material from [CBE20255](https://jckantor.github.io/CBE20255)\n", "by Jeffrey Kantor (jeff at nd.edu); the content is available [on Github](https://github.com/jckantor/CBE20255.git).\n", "The text is released under the [CC-BY-NC-ND-4.0 license](https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode),\n", "and code is released under the [MIT license](https://opensource.org/licenses/MIT).*" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "< [Separating Milk](http://nbviewer.jupyter.org/github/jckantor/CBE20255/blob/master/notebooks/03.04-Separating-Milk.ipynb) | [Contents](toc.ipynb) | [Material Balances](http://nbviewer.jupyter.org/github/jckantor/CBE20255/blob/master/notebooks/04.00-Material-Balances.ipynb) >
"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Adipic Acid Flowsheet"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Summary\n",
"\n",
"This [Jupyter notebook](http://ipython.org/notebook.html) demonstrates the formulation and solution of material balances for a hypothetical adipic acid process described by Murphy (2005, Example 2.15) using the [symbolic algebra package Sympy](http://sympy.org/en/index.html)."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Problem Statement"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[Adipic acid](http://pubchem.ncbi.nlm.nih.gov/summary/summary.cgi?cid=196) (C6H10O4) (also called hexanedioic acid) rarely occurs in nature, but approximately 2.5 billion kilograms are produced per year from petrochemical feedstocks primarily for the production of nylon.\n",
"\n",
"
\n",
"\n",
"Recently there has been interest in [producing adipic acid from renewable resources](http://www.ihs.com/products/chemical/technology/pep/bio-based-adipic-acid.aspx). [For example, starting with glucose](http://pubs.acs.org/doi/abs/10.1021/ja00080a057) (C6H12O6), muconic acid (C6H6O4) is produced through fermentation with a genetically modified e. coli. via the reaction\n",
"\n",
"7⁄3 C6H12O6 + 17⁄2 O2 ➝ C6H6O4 + 8 CO2 + 11 H2O\n",
"\n",
"that is subsequently hydrogentated to form adipic acid\n",
"\n",
"C6H6O4 + 2 H2 ➝ C6H10O4\n",
"\n",
"Murphy (2005, Example 2.15) outlines a hypothetical flowsheet for this process:\n",
"\n",
"
\n",
"\n",
"Neglecting the _E. coli_, solve for the flowrates necessary to produce 12,000 kg/hour of adipic acid assuming that glucose is available as a 10 mg/mL solution.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Solution"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Process Variables"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We begin by relabeling the process flowsheet with stream numbers, stream variables, and extents of reaction. There are chemical species are abbreviated as follows:\n",
"\n",
"* A: adipic acid\n",
"* C: carbon dioxide\n",
"* G: glucose\n",
"* H: hydrogen\n",
"* M: muconic acid\n",
"* N: nitrogen\n",
"* O: oxygen\n",
"* W: water\n",
"\n",
"and where X1 and X2 denote the extents of reactions 1 and 2, respectively. The stream variables denote chemical flowrates in units of kg/hour. The extents of reaction will be in units of kg-mol/hour.\n",
"\n",
"
"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"(H10, M10)"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Import the symbolic algebra package sympy\n",
"import sympy as sym\n",
"\n",
"# Extents of reactions 1 and 2\n",
"sym.var('X1 X2')\n",
"\n",
"# Stream variables\n",
"sym.var('O1 N1') # Stream 1\n",
"sym.var('G2 W2') # Stream 2\n",
"sym.var('H3') # Stream 3\n",
"sym.var('N4 C4') # Stream 4\n",
"sym.var('W5') # Stream 5\n",
"sym.var('A6') # Stream 6\n",
"sym.var('O7 N7 G7 W7') # Stream 7\n",
"sym.var('N8 W8 C8 M8') # Stream 8\n",
"sym.var('M9') # Stream 9\n",
"sym.var('H10 M10') # Stream 10"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Because the flowsheet includes reactions, it will be necessary to include molecular weights in the mass balance expressions. For this purpose we gather the molecular weights of all species into a python dictionary indexed by the chemical species."
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"MW = {\n",
" 'A': 146.14,\n",
" 'C': 44.01,\n",
" 'G': 180.16,\n",
" 'H': 2.02,\n",
" 'M': 142.11,\n",
" 'N': 14.01,\n",
" 'O': 16.00,\n",
" 'W': 18.02\n",
"}"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Specifications"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"specs = [\n",
" sym.Eq(A6, 12000),\n",
" sym.Eq(N1/MW['N'], (0.79/0.21)*(O1/MW['O'])),\n",
" sym.Eq(G2, 0.01*W2)\n",
"]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Material Balances"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"mixer1 = [\n",
" sym.Eq(0, O1 - O7),\n",
" sym.Eq(0, N1 - N7),\n",
" sym.Eq(0, G2 - G7),\n",
" sym.Eq(0, W2 - W7)\n",
"]\n",
"\n",
"reactor1 = [\n",
" sym.Eq(0, O7 - MW['O']*(17/2)*X1),\n",
" sym.Eq(0, N7 - N8),\n",
" sym.Eq(0, G7 - MW['G']*(7/3)*X1),\n",
" sym.Eq(0, -C8 + MW['C']*8*X1),\n",
" sym.Eq(0, -M8 + MW['M']*X1),\n",
" sym.Eq(0, W7 - W8 + MW['W']*11*X1)\n",
"]\n",
"\n",
"separator = [\n",
" sym.Eq(0, N8 - N4),\n",
" sym.Eq(0, C8 - C4),\n",
" sym.Eq(0, M8 - M9),\n",
" sym.Eq(0, W8 - W5)\n",
"]\n",
"\n",
"mixer2 = [\n",
" sym.Eq(0, M9 - M10),\n",
" sym.Eq(0, H3 - H10)\n",
"]\n",
"\n",
"reactor2 = [\n",
" sym.Eq(0, H10 - MW['H']*2*X2),\n",
" sym.Eq(0, M10 - MW['M']*X2),\n",
" sym.Eq(0, -A6 + MW['A']*X2)\n",
"]\n",
"\n",
"mbals = mixer1 + reactor1 + separator + mixer2 + reactor2"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"[Eq(A6, 12000),\n",
" Eq(0.0713775874375446*N1, 0.235119047619048*O1),\n",
" Eq(G2, 0.01*W2),\n",
" Eq(0, O1 - O7),\n",
" Eq(0, N1 - N7),\n",
" Eq(0, G2 - G7),\n",
" Eq(0, W2 - W7),\n",
" Eq(0, O7 - 136.0*X1),\n",
" Eq(0, N7 - N8),\n",
" Eq(0, G7 - 420.373333333333*X1),\n",
" Eq(0, -C8 + 352.08*X1),\n",
" Eq(0, -M8 + 142.11*X1),\n",
" Eq(0, W7 - W8 + 198.22*X1),\n",
" Eq(0, -N4 + N8),\n",
" Eq(0, -C4 + C8),\n",
" Eq(0, M8 - M9),\n",
" Eq(0, -W5 + W8),\n",
" Eq(0, -M10 + M9),\n",
" Eq(0, -H10 + H3),\n",
" Eq(0, H10 - 4.04*X2),\n",
" Eq(0, M10 - 142.11*X2),\n",
" Eq(0, -A6 + 146.14*X2)]"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"specs + mbals"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Solution"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"{H3: 331.736690844396,\n",
" C8: 28910.3599288354,\n",
" W2: 3451813.32968386,\n",
" W5: 3468089.77692623,\n",
" G7: 34518.1332968386,\n",
" N7: 36785.5285538330,\n",
" O7: 11167.3737511975,\n",
" W8: 3468089.77692623,\n",
" W7: 3451813.32968386,\n",
" N8: 36785.5285538330,\n",
" G2: 34518.1332968386,\n",
" N1: 36785.5285538330,\n",
" M9: 11669.0844395785,\n",
" C4: 28910.3599288354,\n",
" X2: 82.1130422882168,\n",
" M8: 11669.0844395785,\n",
" M10: 11669.0844395785,\n",
" A6: 12000.0000000000,\n",
" H10: 331.736690844396,\n",
" N4: 36785.5285538330,\n",
" O1: 11167.3737511975,\n",
" X1: 82.1130422882168}"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"soln = sym.solve(mbals + specs)\n",
"soln"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"H3 331.7\n",
"C8 28910.4\n",
"W2 3451813.3\n",
"W5 3468089.8\n",
"G7 34518.1\n",
"N7 36785.5\n",
"O7 11167.4\n",
"W8 3468089.8\n",
"W7 3451813.3\n",
"N8 36785.5\n",
"G2 34518.1\n",
"N1 36785.5\n",
"M9 11669.1\n",
"C4 28910.4\n",
"X2 82.1\n",
"M8 11669.1\n",
"M10 11669.1\n",
"A6 12000.0\n",
"H10 331.7\n",
"N4 36785.5\n",
"O1 11167.4\n",
"X1 82.1\n"
]
}
],
"source": [
"for key in soln.keys():\n",
" print(\"{:3s} {:10.1f}\".format(str(key), float(soln[key])))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"< [Separating Milk](http://nbviewer.jupyter.org/github/jckantor/CBE20255/blob/master/notebooks/03.04-Separating-Milk.ipynb) | [Contents](toc.ipynb) | [Material Balances](http://nbviewer.jupyter.org/github/jckantor/CBE20255/blob/master/notebooks/04.00-Material-Balances.ipynb) >
"
]
}
],
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}