Changeset 421
- Timestamp:
- Nov 29, 2007, 10:05:51 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/eml/reactors/equil.mso
r415 r421 22 22 * 23 23 * Assumptions: 24 * * single- and two-phases involved 24 25 * * thermodynamic equilibrium 25 26 * * steady-state … … 47 48 Brief = "Model of a generic vapour-phase equilibrium CSTR"; 48 49 Info = " 49 Requires the information of: 50 * number of reactions 51 * matrix of stoichiometric coefficients (components by reactions) 50 == Assumptions == 51 * only vapour-phase 52 * thermodynamic equilibrium 53 * steady-state 54 55 == Specify == 56 * inlet stream 57 * stoichiometric matrix 58 * equilibrium temperature 52 59 "; 53 60 54 61 PARAMETERS 55 62 NReac as Integer (Brief="Number of reactions", Default=1); 56 stoic(NComp,NReac) as Real (Brief="Stoichiometric matrix" );63 stoic(NComp,NReac) as Real (Brief="Stoichiometric matrix", Symbol="\nu"); 57 64 Rg as Real (Brief="Universal gas constant", Unit='J/mol/K', Default=8.314); 58 65 fs(NComp) as pressure (Brief="Fugacity in standard state", Default=1, DisplayUnit='atm'); … … 60 67 61 68 VARIABLES 62 out Outlet as vapour_stream ; # Outlet stream69 out Outlet as vapour_stream(Brief="Outlet stream", PosX=1, PosY=1, Symbol="_{out}"); 63 70 64 71 G(NComp) as energy_mol (Brief="Gibbs free-energy of formation"); 65 72 K(NReac) as Real (Brief="Equillibrium constant",Default=1.5); 66 activ(NComp)as Real (Brief="Activity", Default=0.2);73 activ(NComp)as Real (Brief="Activity", Symbol="\hat{a}", Default=0.2); 67 74 68 75 rate(NComp) as reaction_mol (Brief="Overall component rate of reaction"); 69 extent(NReac) as flow_mol (Brief="Extent of reaction" );70 conv(NComp) as Real (Brief="Fractional conversion of component", Default=0); # Lower=-1e3, Upper=1e3);76 extent(NReac) as flow_mol (Brief="Extent of reaction", Symbol="\xi"); 77 conv(NComp) as Real (Brief="Fractional conversion of component", Symbol="X", Default=0); # Lower=-1e3, Upper=1e3); 71 78 72 79 EQUATIONS 73 80 "Outlet stream" 74 Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*V ;81 Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*Vr; 75 82 76 83 "Mechanical equilibrium" … … 87 94 88 95 # "Gibbs free-energy of formation without Cp correction" 89 # G = PP.IdealGasGibbsOfFormationAt25C()*Outlet.T/To+PP.IdealGasEnthalpyOfFormationAt25C()*(1-Outlet.T/To); 96 # G = PP.IdealGasGibbsOfFormationAt25C()*Outlet.T/To 97 # + PP.IdealGasEnthalpyOfFormationAt25C()*(1 - Outlet.T/To); 90 98 91 99 "Gibbs free energy of reaction" 92 #sumt(G*stoic) = -Rg*Outlet.T*ln(K);93 K = exp(-sumt(G*stoic)/(Rg*Outlet.T));100 sumt(G*stoic) = -Rg*Outlet.T*ln(K); 101 # K = exp(-sumt(G*stoic)/(Rg*Outlet.T)); 94 102 95 103 for j in [1:NReac] … … 131 139 Brief = "Model of a generic liquid-phase equilibrium CSTR"; 132 140 Info = " 133 Requires the information of: 134 * number of reactions 135 * matrix of stoichiometric coefficients (components by reactions) 141 == Assumptions == 142 * only liquid-phase 143 * thermodynamic equilibrium 144 * steady-state 145 146 == Specify == 147 * inlet stream 148 * stoichiometric matrix 149 * equilibrium temperature 136 150 "; 137 151 138 152 PARAMETERS 139 153 NReac as Integer (Brief="Number of reactions", Default=1); 140 stoic(NComp,NReac) as Real (Brief="Stoichiometric matrix" );154 stoic(NComp,NReac) as Real (Brief="Stoichiometric matrix", Symbol="\nu"); 141 155 Rg as Real (Brief="Universal gas constant", Unit='J/mol/K', Default=8.314); 142 156 Ps as pressure (Brief="Standard pressure", Default=1, DisplayUnit='bar'); … … 144 158 145 159 VARIABLES 146 out Outlet as liquid_stream ; # Outlet stream160 out Outlet as liquid_stream(Brief="Outlet stream", PosX=1, PosY=1, Symbol="_{out}"); 147 161 148 162 G(NReac) as enth_mol (Brief="Gibbs free-energy of formation"); 149 163 K(NReac) as fraction (Brief="Equillibrium constant"); 150 activ(NComp)as Real (Brief="Activity" );164 activ(NComp)as Real (Brief="Activity", Symbol="\hat{a}"); 151 165 152 166 rate(NComp) as reaction_mol (Brief="Overall component rate of reaction"); 153 extent(NReac)as flow_mol (Brief="Extent of reaction" );154 conv(NComp) as Real (Brief="Fractional conversion of component", Default=0);167 extent(NReac)as flow_mol (Brief="Extent of reaction", Symbol="\xi"); 168 conv(NComp) as Real (Brief="Fractional conversion of component", Symbol="X", Default=0); 155 169 156 170 EQUATIONS 157 171 "Outlet stream" 158 Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*V ;172 Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*Vr; 159 173 160 174 "Mechanical equilibrium" … … 171 185 172 186 # "Gibbs free-energy of formation without Cp correction" 173 # G = PP.IdealGasGibbsOfFormationAt25C()*Outlet.T/To+PP.IdealGasEnthalpyOfFormationAt25C()*(1-Outlet.T/To); 187 # G = PP.IdealGasGibbsOfFormationAt25C()*Outlet.T/To 188 # + PP.IdealGasEnthalpyOfFormationAt25C()*(1 - Outlet.T/To); 174 189 175 190 "Gibbs free energy of reaction" 176 #sumt(G*stoic) = -Rg*Outlet.T*ln(K);177 K = exp(-sumt(G*stoic)/(Rg*Outlet.T));191 sumt(G*stoic) = -Rg*Outlet.T*ln(K); 192 # K = exp(-sumt(G*stoic)/(Rg*Outlet.T)); 178 193 179 194 for j in [1:NReac] -
trunk/eml/reactors/gibbs.mso
r414 r421 18 18 * 19 19 * Description: 20 21 20 * Thermodynamic equilibrium modeling of a reactor using Gibbs 22 21 * free energy minimization approach. 23 24 * 25 22 * 26 23 * Assumptions: 27 24 * * single- and two-phases involved 28 25 * * thermodynamic equilibrium 29 30 26 * * steady-state 31 32 * 33 27 * 34 28 * Specify: 35 36 29 * * inlet stream 37 30 * * number of elements related to components 38 39 31 * * matrix of elements by components 40 41 32 * * equilibrium temperature 42 33 * … … 58 49 Brief = "Model of a generic vapour-phase Gibbs CSTR"; 59 50 Info = " 60 Requires the information of: 61 * number of elements 62 * matrix of elements (elements by compoments) 51 == Assumptions == 52 * thermodynamic equilibrium 53 * steady-state 54 55 == Specify == 56 * inlet stream 57 * number of elements related to components 58 * matrix of elements by components 59 * equilibrium temperature 63 60 "; 64 61 … … 71 68 72 69 VARIABLES 73 out Outlet as vapour_stream ; # Outlet stream70 out Outlet as vapour_stream(Brief="Outlet stream", PosX=1, PosY=1, Symbol="_{out}"); 74 71 75 72 G(NComp) as energy_mol (Brief="Gibbs free-energy change of formation"); 76 lambda(NElem) as energy_mol (Brief="Lagrangian multiplier"); 77 activ(NComp) as Real (Brief="Activity", Lower=1e-20); 78 phi(NComp) as fugacity (Brief="Fugacity coefficient", Default=1); 73 lambda(NElem) as energy_mol (Brief="Lagrangian multiplier", Symbol="\lambda"); 74 activ(NComp) as Real (Brief="Activity", Symbol="\hat{a}", Lower=1e-20); 79 75 80 76 rate(NComp) as reaction_mol (Brief="Overall component rate of reaction"); 81 conv(NComp) as Real (Brief="Fractional conversion of component", Default=0);77 conv(NComp) as Real (Brief="Fractional conversion of component", Symbol="X", Default=0); 82 78 Fi(NComp) as flow_mol (Brief="Component molar flow rate"); 83 79 84 80 EQUATIONS 85 81 "Outlet stream" 86 Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*V ;82 Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*Vr; 87 83 88 84 "Mechanical equilibrium" … … 105 101 106 102 # "Gibbs free-energy of formation without Cp correction" 107 # G = PP.IdealGasGibbsOfFormationAt25C()*Outlet.T/To+PP.IdealGasEnthalpyOfFormationAt25C()*(1-Outlet.T/To); 103 # G = PP.IdealGasGibbsOfFormationAt25C()*Outlet.T/To 104 # + PP.IdealGasEnthalpyOfFormationAt25C()*(1 - Outlet.T/To); 108 105 109 106 for i in [1:NComp] … … 122 119 end 123 120 end 124 125 121 end 126 122 127 "Fugacity coefficient"128 phi = PP.VapourFugacityCoefficient(Outlet.T,Outlet.P,Outlet.z);129 130 123 "Activity" 131 activ = phi*Outlet.P*Outlet.z/fs; 124 activ = PP.VapourFugacityCoefficient(Outlet.T,Outlet.P,Outlet.z) 125 *Outlet.P*Outlet.z/fs; 132 126 end 133 127 … … 142 136 Brief = "Model of a generic liquid-phase Gibbs CSTR"; 143 137 Info = " 144 Requires the information of: 145 * number of elements 146 * matrix of elements (elements by compoments) 138 == Assumptions == 139 * thermodynamic equilibrium 140 * steady-state 141 142 == Specify == 143 * inlet stream 144 * number of elements related to components 145 * matrix of elements by components 146 * equilibrium temperature 147 147 "; 148 148 … … 155 155 156 156 VARIABLES 157 out Outlet as liquid_stream ; # Outlet stream157 out Outlet as liquid_stream(Brief="Outlet stream", PosX=1, PosY=1, Symbol="_{out}"); 158 158 159 159 G(NComp) as energy_mol (Brief="Gibbs free-energy change of formation"); 160 lambda(NElem) as energy_mol (Brief="Lagrangian multiplier"); 161 activ(NComp) as Real (Brief="Activity", Lower=0); 162 gamma(NComp) as fugacity (Brief="Activity coefficient", Default=1); 163 160 lambda(NElem) as energy_mol (Brief="Lagrangian multiplier", Symbol="\lambda"); 161 activ(NComp) as Real (Brief="Activity", Symbol="\hat{a}", Lower=0); 162 164 163 rate(NComp) as reaction_mol (Brief="Overall component rate of reaction"); 165 conv(NComp) as Real (Brief="Fractional conversion of component", Default=0);164 conv(NComp) as Real (Brief="Fractional conversion of component", Symbol="X", Default=0); 166 165 Fi(NComp) as flow_mol (Brief="Component molar flow rate"); 167 166 168 167 EQUATIONS 169 168 "Outlet stream" 170 Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*V ;169 Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*Vr; 171 170 172 171 "Mechanical equilibrium" … … 189 188 190 189 # "Gibbs free-energy of formation without Cp correction" 191 # G = PP.IdealGasGibbsOfFormationAt25C()*Outlet.T/To+PP.IdealGasEnthalpyOfFormationAt25C()*(1-Outlet.T/To); 190 # G = PP.IdealGasGibbsOfFormationAt25C()*Outlet.T/To 191 # + PP.IdealGasEnthalpyOfFormationAt25C()*(1 - Outlet.T/To); 192 192 193 193 for i in [1:NComp] … … 206 206 end 207 207 end 208 209 208 end 210 209 211 "Activity coefficient"212 gamma = PP.LiquidFugacityCoefficient(Outlet.T,Outlet.P,Outlet.z);213 214 210 "Activity" 215 activ = gamma*Outlet.z*exp(PP.LiquidVolume(Outlet.T,Outlet.P,Outlet.z)*(Outlet.P - Ps)/Rg/Outlet.T); 211 activ = PP.LiquidFugacityCoefficient(Outlet.T,Outlet.P,Outlet.z)*Outlet.z 212 *exp(PP.LiquidVolume(Outlet.T,Outlet.P,Outlet.z)*(Outlet.P - Ps)/Rg/Outlet.T); 216 213 end -
trunk/eml/reactors/stoic.mso
r419 r421 21 21 * 22 22 * Assumptions: 23 * * single- and two-phases involved 23 24 * * steady-state 24 25 * … … 40 41 *--------------------------------------------------------------------*# 41 42 Model stoic_vap as tank_vap 43 ATTRIBUTES 44 Brief = "Basic model for a vapour-phase stoichiometric CSTR"; 45 Info = " 46 == Assumptions == 47 * only vapour-phase 48 * steady-state 49 "; 50 42 51 PARAMETERS 43 52 NReac as Integer (Brief="Number of reactions", Default=1); 44 stoic(NComp,NReac) as Real (Brief="Stoichiometric matrix" );45 46 VARIABLES 47 out Outlet as vapour_stream ; # Outlet stream53 stoic(NComp,NReac) as Real (Brief="Stoichiometric matrix", Symbol="\nu"); 54 55 VARIABLES 56 out Outlet as vapour_stream(Brief="Outlet stream", PosX=1, PosY=1, Symbol="_{out}"); 48 57 49 58 rate(NComp) as reaction_mol (Brief="Overall component rate of reaction"); 50 conv(NComp) as Real (Brief="Fractional conversion of component", Default=0);59 conv(NComp) as Real (Brief="Fractional conversion of component", Symbol="X", Default=0); 51 60 52 61 EQUATIONS 53 62 "Outlet stream" 54 Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*V ;63 Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*Vr; 55 64 56 65 "Mechanical equilibrium" … … 83 92 *--------------------------------------------------------------------*# 84 93 Model stoic_liq as tank_liq 94 ATTRIBUTES 95 Brief = "Basic model for a liquid-phase stoichiometric CSTR"; 96 Info = " 97 == Assumptions == 98 * only liquid-phase 99 * steady-state 100 "; 101 85 102 PARAMETERS 86 103 NReac as Integer (Brief="Number of reactions", Default=1); 87 stoic(NComp,NReac) as Real (Brief="Stoichiometric matrix" );88 89 VARIABLES 90 out Outlet as liquid_stream ; # Outlet stream104 stoic(NComp,NReac) as Real (Brief="Stoichiometric matrix", Symbol="\nu"); 105 106 VARIABLES 107 out Outlet as liquid_stream(Brief="Outlet stream", PosX=1, PosY=1, Symbol="_{out}"); 91 108 92 109 rate(NComp) as reaction_mol (Brief="Overall component rate of reaction"); 93 conv(NComp) as Real (Brief="Fractional conversion of component", Default=0);110 conv(NComp) as Real (Brief="Fractional conversion of component", Symbol="X", Default=0); 94 111 95 112 EQUATIONS 96 113 "Outlet stream" 97 Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*V ;114 Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*Vr; 98 115 99 116 "Mechanical equilibrium" … … 131 148 Brief = "Model of a generic vapour-phase stoichiometric CSTR based on extent of reaction"; 132 149 Info = " 133 Requires the information of: 150 == Specify == 151 * inlet stream 134 152 * extent of reactions 135 153 "; 136 154 137 155 VARIABLES 138 extent(NReac) as flow_mol (Brief="Extent of reaction" );156 extent(NReac) as flow_mol (Brief="Extent of reaction", Symbol="\xi"); 139 157 140 158 EQUATIONS 141 159 "Rate of reaction" 142 rate*V = sumt(stoic*extent);160 rate*Vr = sumt(stoic*extent); 143 161 end 144 162 … … 149 167 Brief = "Model of a generic liquid-phase stoichiometric CSTR based on extent of reaction"; 150 168 Info = " 151 Requires the information of: 169 == Specify == 170 * inlet stream 152 171 * extent of reactions 153 172 "; 154 173 155 174 VARIABLES 156 extent(NReac) as flow_mol (Brief="Extent of reaction" );175 extent(NReac) as flow_mol (Brief="Extent of reaction", Symbol="\xi"); 157 176 158 177 EQUATIONS 159 178 "Rate of reaction" 160 rate*V = sumt(stoic*extent);179 rate*Vr = sumt(stoic*extent); 161 180 end 162 181 … … 171 190 Brief = "Model of a generic vapour-phase stoichiometric CSTR based on conversion of a key component"; 172 191 Info = " 173 Requires the information of: 192 == Specify == 193 * inlet stream 174 194 * conversion of a key component 175 195 "; … … 179 199 180 200 VARIABLES 181 kconv as Real (Brief="Molar conversion of key component" );201 kconv as Real (Brief="Molar conversion of key component", Symbol="X_k"); 182 202 183 203 EQUATIONS 184 204 "Reaction rate" 185 rate*V = sumt(stoic)/abs(sumt(stoic(KComp,:)))*Outletm.F*Outletm.z(KComp)*kconv;205 rate*Vr = sumt(stoic)/abs(sumt(stoic(KComp,:)))*Outletm.F*Outletm.z(KComp)*kconv; 186 206 end 187 207 … … 192 212 Brief = "Model of a generic liquid-phase stoichiometric CSTR based on conversion of a key component"; 193 213 Info = " 194 Requires the information of: 214 == Specify == 215 * inlet stream 195 216 * conversion of a key component 196 217 "; … … 200 221 201 222 VARIABLES 202 kconv as Real (Brief="Molar conversion of key component" );223 kconv as Real (Brief="Molar conversion of key component", Symbol="X_k"); 203 224 204 225 EQUATIONS 205 226 "Reaction rate" 206 rate*V = sumt(stoic)/abs(sumt(stoic(KComp,:)))*Outletm.F*Outletm.z(KComp)*kconv;207 end 227 rate*Vr = sumt(stoic)/abs(sumt(stoic(KComp,:)))*Outletm.F*Outletm.z(KComp)*kconv; 228 end -
trunk/eml/reactors/tank_basic.mso
r403 r421 17 17 *---------------------------------------------------------------------- 18 18 * 19 * Description: 20 * Generic model for a dynamic tank. 19 21 * 22 * Assumptions: 23 * * single- and two-phases involved 24 * * dynamic 20 25 * 21 26 *---------------------------------------------------------------------- … … 28 33 29 34 Model tank_basic 35 ATTRIBUTES 36 Brief = "Basic model for a dynamic tank"; 37 30 38 PARAMETERS 31 outer PP as Plugin(Brief="External physical properties", Type="PP");32 outer NComp as Integer(Brief="Number of components", Default=1);39 outer PP as Plugin (Brief="External physical properties", Type="PP"); 40 outer NComp as Integer (Brief="Number of components", Default=1); 33 41 34 42 VARIABLES 35 in Inlet as stream ; # Inlet stream36 out Outletm as stream ; # Intermediary outlet stream43 in Inlet as stream (Brief="Inlet stream", PosX=0, PosY=0, Symbol="_{in}"); 44 out Outletm as stream (Brief="Intermediary outlet stream", Symbol="_{outm}"); 37 45 38 46 M(NComp)as mol (Brief="Component molar holdup"); 39 47 Mt as mol (Brief="Total component molar holdup"); 40 V as volume (Brief="Volume of reactional mixture");48 Vr as volume (Brief="Volume of reactional mixture"); 41 49 E as energy (Brief="Internal energy"); 42 50 Q as heat_rate(Brief="Reactor duty", Default=0); … … 53 61 54 62 "Mole fraction normalisation" 55 sum(Outletm.z) = 1 .0;63 sum(Outletm.z) = 1; 56 64 57 65 "Energy balance" … … 59 67 60 68 "Geometry" 61 V = Across*Level; 62 end 63 64 65 #*--------------------------------------------------------------------- 66 * only liquid phase 67 *--------------------------------------------------------------------*# 68 69 Model tank_liq as tank_basic 70 EQUATIONS 71 "Vapourisation fraction" 72 Outletm.v = 0.0; 73 74 "Liquid Enthalpy" 75 Outletm.h = PP.LiquidEnthalpy(Outletm.T,Outletm.P,Outletm.z); 76 77 "Volume constraint" 78 V = Mt*PP.LiquidVolume(Outletm.T,Outletm.P,Outletm.z); 79 80 "Total internal energy" 81 E = Mt*Outletm.h - Outletm.P*V; 69 Vr = Across*Level; 82 70 end 83 71 … … 86 74 * only vapour phase 87 75 *--------------------------------------------------------------------*# 88 89 76 Model tank_vap as tank_basic 77 ATTRIBUTES 78 Brief = "Model of a generic vapour-phase tank"; 79 90 80 EQUATIONS 91 81 "Vapourisation fraction" 92 Outletm.v = 1 .0;82 Outletm.v = 1; 93 83 94 84 "Vapour Enthalpy" … … 96 86 97 87 "Volume constraint" 98 V = Mt*PP.VapourVolume(Outletm.T,Outletm.P,Outletm.z);88 Vr = Mt*PP.VapourVolume(Outletm.T,Outletm.P,Outletm.z); 99 89 100 90 "Total internal energy" … … 104 94 105 95 #*--------------------------------------------------------------------- 96 * only liquid phase 97 *--------------------------------------------------------------------*# 98 Model tank_liq as tank_basic 99 ATTRIBUTES 100 Brief = "Model of a generic liquid-phase tank"; 101 102 EQUATIONS 103 "Vapourisation fraction" 104 Outletm.v = 0; 105 106 "Liquid Enthalpy" 107 Outletm.h = PP.LiquidEnthalpy(Outletm.T,Outletm.P,Outletm.z); 108 109 "Volume constraint" 110 Vr = Mt*PP.LiquidVolume(Outletm.T,Outletm.P,Outletm.z); 111 112 "Total internal energy" 113 E = Mt*Outletm.h - Outletm.P*Vr; 114 end 115 116 117 #*--------------------------------------------------------------------- 106 118 * liquid and vapour phases 107 119 *--------------------------------------------------------------------*# 108 109 120 Model tank_liqvap 121 ATTRIBUTES 122 Brief = "Model of a generic two-phase tank"; 123 110 124 PARAMETERS 111 125 outer PP as Plugin(Brief="External physical properties", Type="PP"); … … 113 127 114 128 VARIABLES 115 in Inlet as stream ; # Inlet stream116 out OutletmL as liquid_stream ; # Intermediary liquid outlet stream117 out OutletV as vapour_stream ; # Outlet vapour stream129 in Inlet as stream (Brief="Inlet stream", PosX=0, PosY=0, Symbol="_{in}"); 130 out OutletmL as liquid_stream (Brief="Intermediary liquid outlet stream", Symbol="_{outmL}"); 131 out OutletV as vapour_stream (Brief="Outlet vapour stream", Symbol="_{outV}"); 118 132 119 133 M(NComp)as mol (Brief="Component molar holdup"); 120 134 ML as mol (Brief="Molar liquid holdup"); 121 135 MV as mol (Brief="Molar vapour holdup"); 122 V as volume (Brief="Volume of reactional mixture");136 Vr as volume (Brief="Volume of reactional mixture"); 123 137 E as energy (Brief="Internal energy"); 124 138 Q as heat_rate (Brief="Reactor duty", Default=0); … … 137 151 138 152 "Mole fraction normalisation" 139 sum(OutletmL.z) = 1 .0;153 sum(OutletmL.z) = 1; 140 154 141 155 "Mole fraction normalisation" … … 144 158 145 159 "Vapourisation fraction" 146 OutletV.v = 1 .0;160 OutletV.v = 1; 147 161 148 162 "Vapourisation fraction" 149 OutletmL.v = 0 .0;163 OutletmL.v = 0; 150 164 151 165 … … 157 171 158 172 "Geometry constraint" 159 V = ML*vL + MV*PP.VapourVolume(OutletV.T,OutletV.P,OutletV.z);173 Vr = ML*vL + MV*PP.VapourVolume(OutletV.T,OutletV.P,OutletV.z); 160 174 161 175 -
trunk/eml/reactors/vol_tank.mso
r411 r421 40 40 Pallete = false; 41 41 Brief = "Routine to calculate tank volume"; 42 Info = "Based in 2 geometry and 2 configurations/orientations"; 42 Info = " 43 Based in 2 geometry and 2 configurations/orientations 44 45 == Geometry == 46 * Flat (no head) (default) 47 * Spherical 48 49 == Orientation == 50 * Vertical (default) 51 * Horizontal 52 "; 43 53 44 54 PARAMETERS 45 pi as positive (Brief="Pi value", Default=3.141593);55 pi as positive (Brief="Pi value", Default=3.141593, Symbol="\pi"); 46 56 Geometry as Switcher (Brief="Tank head type", Valid=["flat","spherical"], Default="flat"); 47 57 Orientation as Switcher(Brief="Tank orientation", Valid=["vertical","horizontal"], Default="vertical"); … … 64 74 case "flat": 65 75 "Tank volume" 66 Vt = pi *(D^2)*L/4;76 Vt = pi/4*(D^2)*L; 67 77 "Level tank volume" 68 V = pi *(D^2)*Level/4;78 V = pi/4*(D^2)*Level; 69 79 70 80 case "spherical": 71 81 "Tank volume" 72 Vt = pi *D^3/6;82 Vt = pi/6*D^3; 73 83 "Level tank volume" 74 84 V = pi/3*Level^2*(3*D/2 - Level); … … 78 88 case "flat": 79 89 "Tank volume" 80 Vt = pi *(D^2)*L/4;90 Vt = pi/4*(D^2)*L; 81 91 "Level tank volume" 82 92 V = ((D^2)*acos((D - 2*Level)/D)/4/"rad" - … … 85 95 case "spherical": 86 96 "Tank volume" 87 Vt = pi *D^3/6;97 Vt = pi/6*D^3; 88 98 "Level tank volume" 89 99 V = pi/3*Level^2*(3*D/2 - Level); -
trunk/eml/reactors/yield.mso
r417 r421 21 21 * 22 22 * Assumptions: 23 * * single- and two-phases involved 23 24 * * steady-state 24 25 * … … 45 46 Brief = "Model of a generic vapour-phase yield CSTR"; 46 47 Info = " 47 Requires the information of: 48 == Assumptions == 49 * only vapour-phase 50 * steady-state 51 52 == Specify == 53 * inlet stream 48 54 * component yield or 49 55 * reaction yield … … 55 61 56 62 VARIABLES 57 out Outlet as vapour_stream ; # Outlet stream63 out Outlet as vapour_stream(Brief="Outlet stream", PosX=1, PosY=1, Symbol="_{out}"); 58 64 rate(NComp) as reaction_mol (Brief="Overall component rate of reaction"); 59 conv(NComp) as Real (Brief="Fractional conversion of component", Default=0);65 conv(NComp) as Real (Brief="Fractional conversion of component", Symbol="X", Default=0); 60 66 61 yield(NComp) as Real (Brief="Molar component yield "); # global yield62 yield_(NComp) as Real (Brief="Molar reaction yield "); # instantaneous yield67 yield(NComp) as Real (Brief="Molar component yield (global)", Symbol="Y_G"); 68 yield_(NComp) as Real (Brief="Molar reaction yield (instantaneous)", Symbol="Y_I"); 63 69 64 70 EQUATIONS 65 71 "Outlet stream" 66 Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*V ;72 Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*Vr; 67 73 68 74 "Rate of reaction" 69 rate*V = Outletm.F*(yield/(1 + yield(KComp))*Outletm.z(KComp) - Outletm.z);75 rate*Vr = Outletm.F*(yield/(1 + yield(KComp))*Outletm.z(KComp) - Outletm.z); 70 76 71 77 "Instantaneous yield" … … 103 109 Brief = "Model of a generic liquid-phase yield CSTR"; 104 110 Info = " 105 Requires the information of: 111 == Assumptions == 112 * only liquid-phase 113 * steady-state 114 115 == Specify == 116 * inlet stream 106 117 * component yield or 107 118 * reaction yield … … 109 120 110 121 PARAMETERS 111 NReac as Integer (Brief="Number of reactions", Default=1);122 NReac as Integer (Brief="Number of reactions", Default=1); 112 123 KComp as Integer (Brief="Key component", Lower=1, Default=1); 113 124 114 125 VARIABLES 115 out Outlet as liquid_stream ; # Outlet stream126 out Outlet as liquid_stream(Brief="Outlet stream", PosX=1, PosY=1, Symbol="_{out}"); 116 127 rate(NComp) as reaction_mol (Brief="Overall component rate of reaction"); 117 conv(NComp) as Real (Brief="Fractional conversion of component", Default=0);128 conv(NComp) as Real (Brief="Fractional conversion of component", Symbol="X", Default=0); 118 129 119 yield(NComp) as Real (Brief="Molar component yield "); # global yield120 yield_(NComp) as Real (Brief="Molar reaction yield "); # instantaneous yield130 yield(NComp) as Real (Brief="Molar component yield (global)", Symbol="Y_G"); 131 yield_(NComp) as Real (Brief="Molar reaction yield (instantaneous)", Symbol="Y_I"); 121 132 122 133 EQUATIONS 123 134 "Outlet stream" 124 Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*V ;135 Outlet.F*Outlet.z = Outletm.F*Outletm.z + rate*Vr; 125 136 126 137 "Rate of reaction" 127 rate*V = Outletm.F*(yield/(1 + yield(KComp))*Outletm.z(KComp) - Outletm.z);138 rate*Vr = Outletm.F*(yield/(1 + yield(KComp))*Outletm.z(KComp) - Outletm.z); 128 139 129 140 "Molar reaction yield" -
trunk/sample/reactors/sample_stoic.mso
r419 r421 129 129 R.Across = 5*'m^2'; 130 130 131 INITIAL132 R.Outletm.T = 500*'K';133 R.M = [25, 75, 0, 0, 0]*'kmol';134 135 131 OPTIONS 136 132 Dynamic = false;
Note: See TracChangeset
for help on using the changeset viewer.