[417] | 1 | #*--------------------------------------------------------------------- |
---|
| 2 | * EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC. |
---|
| 3 | * |
---|
| 4 | * This LIBRARY is free software; you can distribute it and/or modify |
---|
| 5 | * it under the therms of the ALSOC FREE LICENSE as available at |
---|
| 6 | * http://www.enq.ufrgs.br/alsoc. |
---|
| 7 | * |
---|
| 8 | * EMSO Copyright (C) 2004 - 2007 ALSOC, original code |
---|
| 9 | * from http://www.rps.eng.br Copyright (C) 2002-2004. |
---|
| 10 | * All rights reserved. |
---|
| 11 | * |
---|
| 12 | * EMSO is distributed under the therms of the ALSOC LICENSE as |
---|
| 13 | * available at http://www.enq.ufrgs.br/alsoc. |
---|
| 14 | * |
---|
| 15 | *---------------------------------------------------------------------- |
---|
| 16 | * Model of an yield reactor |
---|
| 17 | *---------------------------------------------------------------------- |
---|
| 18 | * |
---|
| 19 | * Description: |
---|
| 20 | * Modeling of a reactor based on an yield approach. |
---|
| 21 | * |
---|
| 22 | * Assumptions: |
---|
| 23 | * * steady-state |
---|
| 24 | * |
---|
| 25 | * Specify: |
---|
| 26 | * * inlet stream |
---|
| 27 | * * component yield or |
---|
| 28 | * * reaction yield |
---|
| 29 | * |
---|
| 30 | *---------------------------------------------------------------------- |
---|
| 31 | * Author: Rodolfo Rodrigues |
---|
| 32 | * $Id$ |
---|
| 33 | *--------------------------------------------------------------------*# |
---|
| 34 | |
---|
| 35 | using "tank_basic"; |
---|
| 36 | |
---|
| 37 | |
---|
| 38 | #*--------------------------------------------------------------------- |
---|
| 39 | * only vapour phase |
---|
| 40 | *--------------------------------------------------------------------*# |
---|
| 41 | Model yield_vap as tank_vap |
---|
| 42 | ATTRIBUTES |
---|
| 43 | Pallete = true; |
---|
| 44 | Icon = "icon/cstr"; |
---|
| 45 | Brief = "Model of a generic vapour-phase yield CSTR"; |
---|
| 46 | Info = " |
---|
| 47 | Requires the information of: |
---|
| 48 | * component yield or |
---|
| 49 | * reaction yield |
---|
| 50 | "; |
---|
| 51 | |
---|
| 52 | PARAMETERS |
---|
| 53 | NReac as Integer (Brief="Number of reactions", Default=1); |
---|
| 54 | KComp as Integer (Brief="Key component", Lower=1, Default=1); |
---|
| 55 | |
---|
| 56 | VARIABLES |
---|
| 57 | out Outlet as vapour_stream; # Outlet stream |
---|
| 58 | rate(NComp) as reaction_mol (Brief="Overall component rate of reaction"); |
---|
| 59 | conv(NComp) as Real (Brief="Fractional conversion of component", Default=0); |
---|
| 60 | |
---|
| 61 | yield(NComp) as Real (Brief="Molar component yield"); # global yield |
---|
| 62 | yield_(NComp) as Real (Brief="Molar reaction yield"); # instantaneous yield |
---|
| 63 | |
---|
| 64 | EQUATIONS |
---|
| 65 | "Outlet stream" |
---|
| 66 | Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*V; |
---|
| 67 | |
---|
| 68 | "Rate of reaction" |
---|
| 69 | rate*V = Outletm.F*(yield/(1 + yield(KComp))*Outletm.z(KComp) - Outletm.z); |
---|
| 70 | |
---|
| 71 | "Instantaneous yield" |
---|
| 72 | rate = yield_*rate(KComp); |
---|
| 73 | |
---|
| 74 | "Mechanical equilibrium" |
---|
| 75 | Outlet.P = Outletm.P; |
---|
| 76 | |
---|
| 77 | "Energy balance" |
---|
| 78 | Outlet.F*Outlet.h = Outletm.F*Outletm.h; |
---|
| 79 | |
---|
| 80 | for i in [1:NComp] |
---|
| 81 | if (Outletm.z(i) > 0) then |
---|
| 82 | "Molar conversion" |
---|
| 83 | Outlet.F*Outlet.z(i) = Outletm.F*Outletm.z(i)*(1 - conv(i)); |
---|
| 84 | else if (Outlet.z(i) > 0) then |
---|
| 85 | "Molar conversion" |
---|
| 86 | conv(i) = 1; # ? |
---|
| 87 | else |
---|
| 88 | "Molar conversion" |
---|
| 89 | conv(i) = 0; # ? |
---|
| 90 | end |
---|
| 91 | end |
---|
| 92 | end |
---|
| 93 | end |
---|
| 94 | |
---|
| 95 | |
---|
| 96 | #*--------------------------------------------------------------------- |
---|
| 97 | * only liquid phase |
---|
| 98 | *--------------------------------------------------------------------*# |
---|
| 99 | Model yield_liq as tank_liq |
---|
| 100 | ATTRIBUTES |
---|
| 101 | Pallete = true; |
---|
| 102 | Icon = "icon/cstr"; |
---|
| 103 | Brief = "Model of a generic liquid-phase yield CSTR"; |
---|
| 104 | Info = " |
---|
| 105 | Requires the information of: |
---|
| 106 | * component yield or |
---|
| 107 | * reaction yield |
---|
| 108 | "; |
---|
| 109 | |
---|
| 110 | PARAMETERS |
---|
| 111 | NReac as Integer (Brief="Number of reactions", Default=1); |
---|
| 112 | KComp as Integer (Brief="Key component", Lower=1, Default=1); |
---|
| 113 | |
---|
| 114 | VARIABLES |
---|
| 115 | out Outlet as liquid_stream; # Outlet stream |
---|
| 116 | rate(NComp) as reaction_mol (Brief="Overall component rate of reaction"); |
---|
| 117 | conv(NComp) as Real (Brief="Fractional conversion of component", Default=0); |
---|
| 118 | |
---|
| 119 | yield(NComp) as Real (Brief="Molar component yield"); # global yield |
---|
| 120 | yield_(NComp) as Real (Brief="Molar reaction yield"); # instantaneous yield |
---|
| 121 | |
---|
| 122 | EQUATIONS |
---|
| 123 | "Outlet stream" |
---|
| 124 | Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*V; |
---|
| 125 | |
---|
| 126 | "Rate of reaction" |
---|
| 127 | rate*V = Outletm.F*(yield/(1 + yield(KComp))*Outletm.z(KComp) - Outletm.z); |
---|
| 128 | |
---|
| 129 | "Molar reaction yield" |
---|
| 130 | rate = yield_*rate(KComp); |
---|
| 131 | |
---|
| 132 | "Mechanical equilibrium" |
---|
| 133 | Outlet.P = Outletm.P; |
---|
| 134 | |
---|
| 135 | "Energy balance" |
---|
| 136 | Outlet.F*Outlet.h = Outletm.F*Outletm.h; |
---|
| 137 | |
---|
| 138 | for i in [1:NComp] |
---|
| 139 | if (Outletm.z(i) > 0) then |
---|
| 140 | "Molar conversion" |
---|
| 141 | Outlet.F*Outlet.z(i) = Outletm.F*Outletm.z(i)*(1 - conv(i)); |
---|
| 142 | else if (Outlet.z(i) > 0) then |
---|
| 143 | "Molar conversion" |
---|
| 144 | conv(i) = 1; # ? |
---|
| 145 | else |
---|
| 146 | "Molar conversion" |
---|
| 147 | conv(i) = 0; # ? |
---|
| 148 | end |
---|
| 149 | end |
---|
| 150 | end |
---|
| 151 | end |
---|