- Location:
- /mso
- Files:
-
- 8 added
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
/mso/eml/controllers/Comparator.mso
r49 r63 20 20 Model comparator 21 21 22 PARAMETERS23 24 22 VARIABLES 25 23 input1 as Real (Brief="input signal 1"); … … 32 30 output=input1-input2; 33 31 34 INITIAL35 36 32 end -
/mso/eml/controllers/HiLoSelect.mso
r49 r63 36 36 output = input2; 37 37 end 38 39 INITIAL40 38 41 39 end -
/mso/eml/controllers/iae.mso
r49 r63 21 21 Model IAE 22 22 23 PARAMETERS24 25 23 VARIABLES 26 24 input as Real (Brief="input signal"); -
/mso/eml/controllers/ise.mso
r49 r63 1 1 #*---------------------------------------------------------------------- 2 * Model I AE2 * Model ISE 3 3 *----------------------------------------------------------------------- 4 4 * - Inputs … … 21 21 Model ISE 22 22 23 PARAMETERS24 25 23 VARIABLES 26 24 input as Real (Brief="input signal"); -
/mso/eml/controllers/multiply.mso
r49 r63 1 1 #*---------------------------------------------------------------------- 2 * Model Lead Lag2 * Model Multiply 3 3 *----------------------------------------------------------------------- 4 4 * - Inputs … … 20 20 Model Multiply 21 21 22 PARAMETERS23 24 22 VARIABLES 25 23 input1 as Real (Brief="input signal 1"); … … 31 29 "Calculate output" 32 30 output=input1*input2; 33 34 INITIAL35 36 31 37 32 end -
/mso/eml/controllers/ratio.mso
r49 r63 19 19 20 20 Model Ratio 21 22 PARAMETERS23 21 24 22 VARIABLES … … 31 29 if abs(input2)>1e-5 then 32 30 "Calculate output" 33 output=input1*input2;31 input2*output=input1; 34 32 else 35 33 if input2>0 then 36 34 "Calculate output" 37 output=input1*1e -5;35 output=input1*1e5; 38 36 else 39 37 "Calculate output" 40 output=-input1*1e -5;38 output=-input1*1e5; 41 39 end 42 40 end 43 44 INITIAL 41 45 42 end -
/mso/eml/controllers/sum.mso
r49 r63 1 1 #*---------------------------------------------------------------------- 2 * Model Rum2 * Model Sum 3 3 *----------------------------------------------------------------------- 4 4 * - Inputs … … 20 20 Model Sum 21 21 22 PARAMETERS23 24 22 VARIABLES 25 23 input1 as Real (Brief="input signal 1"); … … 31 29 "Calculate output" 32 30 output = input1+input2; 33 34 INITIAL35 31 36 32 end -
/mso/eml/pressure_changers/pump.mso
r49 r63 1 #*------------------------------------------------------------------------ 2 * This file is property of the author and cannot be used, copyed 3 * or modified without permission. 4 * 5 * Copyright (C) 2002-2006 the author 6 *------------------------------------------------------------------------- 7 * Authors: Andrey Copat Estefane da Silveira Horn 8 * $Id$ Marcos Lovato Alencastro 9 * Date: 20/02/2006 10 *------------------------------------------------------------------------- 11 * -> Steady State 12 * -> Only Liquid 13 * -> Adiabatic 14 * -> Isentropic 15 *-------------------------------------------------------------------------*# 16 using "streams"; 17 using "pressure_changers/flux_machine_basic"; 18 19 Model centrifugal_pump as flux_machine_basic 20 21 PARAMETERS 22 ext NComp as Integer (Brief = "Number of chemical components", Lower = 1); 23 ext PP as CalcObject (Brief = "External Physical Properties"); 24 Mw(NComp) as molweight (Brief = "Molar Weight"); 25 Eff as positive (Default = 0.72, Brief = "Pump Efficiency"); 26 Meff as positive (Default = 0.95, Brief = "Brake Efficiency"); 27 Beta as positive (Default = 0, Brief = "Volumetric Expansivity", Unit = "1/K"); 28 g as acceleration (Brief = "Gravity Acceleration", Default = 9.81); 29 N as vel_angular (Brief = "Rotation", Default = 100); 30 Lev as length (Brief = "Loss Friction", Default = 0); 31 32 VARIABLES 33 rho as dens_mass (Brief = "Specific Mass", Unit="kg/m^3"); 34 Cp as cp_mol (Brief = "Heat Capacity", Unit="kJ/kmol/K"); 35 FPower as power (Brief = "Fluid Power", Unit="kW"); 36 BPower as power (Brief = "Brake Power",Unit="kW"); 37 EPower as power (Brief = "Eletrical Potency", Unit="kW"); 38 Pdiff as press_delta (Brief = "Pressure Increase", Unit="kPa"); 39 Pratio as positive (Brief = "Pressure Ratio"); 40 Head as head (Brief = "Head Developed", Unit="kJ/kmol"); 41 Head_is as head (Brief = "Isoentripic Head", Unit="kJ/kmol"); 42 Mwm as molweight (Brief = "Mixture Molar Weight"); 43 pvm as pressure (Brief = "Mixture Vapour Pressure", Unit = "kPa"); 44 NPSHa as length (Brief = "Available Net Positive Suction Head"); 45 NS as positive (Brief = "Specific Speed", Unit = "(rpm*(gal/min)^0.5)/(m^3/4)"); 46 Q as flow_vol (Brief = "Volumetric Flow Rate"); 47 vm as vol_mol (Brief = "Mixture Molar Volume", Unit = "m^3/kmol"); 48 49 SET 50 Mw = PP.MolecularWeight(); 51 52 EQUATIONS 53 #Mixtures Properties 54 "Calculate Mwm for Inlet Mixture" 55 Mwm = sum(Mw([1:NComp])*Inlet.z([1:NComp])); 56 57 "Calculate Cp Using a External Physical Properties Routine" 58 Cp = PP.LiquidCp(Inlet.T,Inlet.P,Inlet.z); 59 60 "Calculate rho using a External Physical Properties Routine" 61 rho = PP.LiquidDensity(Inlet.T,Inlet.P,Inlet.z); 62 63 "Calculate Mixture Vapour Pressure" 64 [pvm] = PP.BubbleP(Inlet.T,Inlet.z); 65 66 "Calculate Outlet Vapour Fraction" 67 Outlet.v = PP.VapourFraction(Outlet.T, Outlet.P, Outlet.z); 68 69 "Calculate Liquid Molar Volume" 70 vm = PP.LiquidVolume(Inlet.T,Inlet.P,Inlet.z); 71 72 #Mass and Energy Balance and Pump Equations 73 "Calculate Outlet Stream Pressure" 74 Outlet.P = Inlet.P + Pdiff; 75 76 "Pratio Definition" 77 Outlet.P = Inlet.P * Pratio; 78 79 "Calculate Isentropic Head" 80 Head_is = Pdiff * Mwm/rho; 81 82 "Calculate Real Head" 83 Head = Head_is/(Eff*Meff); 84 85 "Calculate Outlet Enthalpy" 86 Outlet.h - Inlet.h = Head; 87 88 "Calculate Fluid Power" 89 FPower = Head_is * Inlet.F; 90 91 "Calculate Brake Power" 92 BPower * Eff = FPower; 93 94 "Calculate Eletric Power" 95 BPower = EPower * Meff; 96 97 "Calculate Outlet Temperature" 98 (Outlet.T - Inlet.T) * Cp = (Outlet.h - Inlet.h) - Pdiff * Mwm / rho * (1 - Beta * Inlet.T); 99 100 "Molar Balance" 101 Outlet.F = Inlet.F; 102 103 "Calculate Outlet Composition" 104 Outlet.z = Inlet.z; 105 106 "Calculate Net Positive Suction Head" 107 NPSHa = - Lev + (Inlet.P - pvm)/(g*rho); #If Inlet.P is the suction pump pressure, Lev is 0. 108 109 "Calculate Volumetric Flow Rate" 110 Q = Inlet.F*vm; 111 112 "Calculate Specific Speed" 113 NS = N*(Q^0.5)/(Head^3/4); 114 115 end 116 117 1 118 #*------------------------------------------------------------------- 2 119 * Model of a pump … … 15 132 * $Id$ 16 133 *--------------------------------------------------------------------*# 17 using "streams"; 134 18 135 19 136 Model pump -
/mso/eml/pressure_changers/valve.mso
r49 r63 1 #*----------------------------------------------------------------------------- 2 * Author: Estefane Horn Date:06/10/2006 3 * 4 *$Id:$ 5 *----------------------------------------------------------------------------- 6 * Assumptions 7 * -> Steady State 8 * -> Isentalpic 9 * -> Liquid 10 * 11 *# 12 13 using "streams"; 14 using "pressure_changers/flux_machine_basic"; 15 16 17 Model valve_basic as flux_machine_basic_TP 18 19 PARAMETERS 20 ext PP as CalcObject (Brief = "External Physical Properties", File = "vrpp"); 21 ext NComp as Integer (Brief = "Number of chemical components", Lower = 1); 22 rho60F as dens_mass; 23 24 VARIABLES 25 Pdiff as press_delta (Brief = "Pressure Increase", Unit = "kPa"); 26 Qv as flow_vol (Brief = "Volumetric Flow"); 27 fc as positive (Brief = "Opening Function"); 28 cv as positive (Brief = "Valve Coefficient", Unit = "m^3/h/kPa^0.5"); 29 Gf as positive (Brief = "Specific Gravity"); 30 rho as dens_mass; 31 vm as vol_mol (Brief = "Mixture Molar Volume", Unit = "m^3/kmol"); 32 33 SET 34 rho60F = 99.022 * "kg/m^3"; 35 36 EQUATIONS 37 "Calculate Outlet Stream Pressure" 38 Inlet.P - Outlet.P = Pdiff; 39 40 "Enthalpy Balance" 41 Outlet.h = Inlet.h; 42 43 "Molar Balance" 44 Outlet.F = Inlet.F; 45 46 "Calculate Outlet Composition" 47 Outlet.z = Inlet.z; 48 49 "Valve Equation" 50 Qv = fc*cv*sqrt(Pdiff/Gf); 51 52 "Calculate Gf" 53 Gf = rho/rho60F; 54 55 "Calculate Specific Mass" 56 rho = PP.LiquidDensity(Inlet.T,Inlet.P,Inlet.z); 57 58 "Calculate Mass Flow" 59 Qv = Inlet.F*vm; 60 61 "Calculate Liquid Molar Volume" 62 vm = PP.LiquidVolume(Inlet.T,Inlet.P,Inlet.z); 63 64 end 65 66 Model valve_linear as valve_basic 67 68 VARIABLES 69 x as fraction (Brief = "Opening"); 70 71 EQUATIONS 72 73 "Opening Equation" 74 fc = 100*x; 75 76 end 77 78 Model valve_parabolic as valve_basic 79 80 PARAMETERS 81 n as positive (Brief = "Constant", Lower = 1.4, Upper = 2.6); 82 83 VARIABLES 84 x as fraction (Brief = "Opening"); 85 86 EQUATIONS 87 88 "Opening Equation" 89 fc = 100*x^n; 90 91 end 92 93 Model valve_equal as valve_basic 94 95 PARAMETERS 96 a as Real (Brief = "Constant", Default = 100); 97 98 VARIABLES 99 x as fraction (Brief = "Opening"); 100 101 EQUATIONS 102 103 "Opening Equation" 104 fc = 100*a^(x-1); 105 106 end 107 108 Model valve_quick as valve_basic 109 110 PARAMETERS 111 a as positive (Brief = "Constant", Default = 0.05); 112 n as positive (Brief = "Constant", Default = 5); 113 114 VARIABLES 115 x as fraction (Brief = "Opening"); 116 117 EQUATIONS 118 119 "Opening Equation" 120 fc = 100*(1-(a*(1-x)-(a-1)*(1-x)^n)); 121 122 end 123 1 124 #*------------------------------------------------------------------- 2 125 * Model of a valve … … 27 150 * $Id$ 28 151 *--------------------------------------------------------------------*# 29 30 using "streams";31 152 32 153 Model valve -
/mso/eml/stage_separators/flash.mso
r49 r63 55 55 56 56 "Energy Balance" 57 diff(E) = Inlet.F*Inlet.h 57 diff(E) = Inlet.F*Inlet.h - OutletL.F*OutletL.h - OutletV.F*OutletV.h + Q; 58 58 59 59 "Molar Holdup" -
/mso/eml/stage_separators/tray.mso
r49 r63 90 90 "Chemical Equilibrium" 91 91 PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z = 92 PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*yideal;92 PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, yideal)*yideal; 93 93 94 94 "Murphree Efficiency" … … 251 251 "Chemical Equilibrium" 252 252 PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z = 253 PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*yideal;253 PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, yideal)*yideal; 254 254 255 255 OutletV.z = Emv * (yideal - InletV.z) + InletV.z; -
/mso/eml/types.mso
r49 r63 46 46 length as positive (Brief = "Length", Default=1, Upper=5e6, Unit = "m"); 47 47 length_delta as length (Brief = "Difference of Length", Lower=-1000); 48 volume as positive (Brief = "Volume", Default=10, Lower=0, Upper=1 E6, Unit = "m^3");48 volume as positive (Brief = "Volume", Default=10, Lower=0, Upper=1000, Unit = "m^3"); 49 49 volume_mol as positive (Brief = "Molar Volume", Default=10, Lower=0, Upper=1E6, Unit = "m^3/mol"); 50 50 volume_mass as positive (Brief = "Specific Volume", Default=10, Lower=0, Upper=1E30, Unit = "m^3/kg"); -
/mso/sample/pressure_changers/sample_pump.mso
r49 r63 1 1 using "pressure_changers/pump"; 2 3 FlowSheet Pump_P1 4 5 DEVICES 6 S1 as streamTP; 7 P1 as centrifugal_pump; 8 9 CONNECTIONS 10 S1 to P1.Inlet; 11 12 PARAMETERS 13 PP as CalcObject (Brief="External Physical Properties", File="vrpp"); 14 Mw as positive (Brief = "Molar Mass", Unit = "kg/kmol"); 15 NComp as Integer (Default= 1); 16 17 SET 18 PP.Components = ["water", "benzene"]; 19 PP.LiquidModel = "PR"; 20 PP.VapourModel = "PR"; 21 NComp = PP.NumberOfComponents; 22 PP.Derivatives = 0; 23 P1.N = 1000 * "rpm"; 24 P1.Lev = 0 * "m"; 25 P1.Meff = 0.95; 26 P1.Eff = 0.72; 27 P1.Beta = 425e-6 * "1/K"; 28 29 SPECIFY 30 S1.F = 1000 * "kmol/h"; 31 S1.P = 10 * "atm"; 32 S1.T = 298 * "K" ; 33 S1.z = [1,0]; 34 P1.Pdiff = 8 * "kPa"; 35 #P1.Outlet.P = 2 * "atm"; 36 #P1.BPower = 1 * "kW"; 37 38 end 2 39 3 40 FlowSheet pump_Test -
/mso/sample/pressure_changers/sample_valve.mso
r49 r63 76 76 77 77 end 78 79 FlowSheet valve_linear_Test 80 81 DEVICES 82 S1 as streamTP; 83 V1 as valve_linear; 84 85 CONNECTIONS 86 S1 to V1.Inlet; 87 88 PARAMETERS 89 PP as CalcObject (Brief="External Physical Properties", File="vrpp"); 90 NComp as Integer (Default= 1); 91 92 SET 93 PP.Components = ["water"]; 94 PP.LiquidModel = "IdealLiquid"; 95 PP.VapourModel = "Ideal"; 96 PP.Derivatives = 0; 97 NComp = PP.NumberOfComponents; 98 99 SPECIFY 100 S1.P = 2169.78 * "kPa"; 101 S1.T = 394.26 * "K" ; 102 S1.z = [1]; 103 V1.Qv = 113.56 * "m^3/h"; 104 V1.x = 0.5; 105 V1.cv = 3.997 * "m^3/h/kPa^0.5"; 106 end -
/mso/sample/reactors/fogler/chap2/series_reactors.mso
r49 r63 63 63 out Outlet as stream; # Outlet stream 64 64 r as reaction_mol(Brief="Rate of reaction", Unit="mol/l/s"); 65 V as volume (Brief="Volume", Unit="l" );65 V as volume (Brief="Volume", Unit="l", Upper=2e3); 66 66 67 67 EQUATIONS … … 82 82 in Inlet as stream; # Inlet stream 83 83 out Outlet as stream; # Outlet stream 84 V as volume (Brief="Volume", Unit="l" );84 V as volume (Brief="Volume", Unit="l", Upper=2e3); 85 85 r as reaction_mol(Brief="Rate of reaction", Unit="mol/l/s"); 86 86 … … 103 103 Model pfr_d 104 104 PARAMETERS 105 N as Integer (Brief="Number of d escrete points", Default=200);105 N as Integer (Brief="Number of discrete points", Default=200); 106 106 107 107 VARIABLES 108 108 in Inlet as stream; # Inlet stream 109 109 out Outlet as stream; # Outlet stream 110 V(N) as volume (Brief="Volume", Unit="l" );110 V(N) as volume (Brief="Volume", Unit="l", Upper=2e3); 111 111 X(N) as fraction (Brief="Molar conversion"); 112 112 dx as fraction (Brief="Conversion increment"); … … 258 258 259 259 #*--------------------------------------------------------------------- 260 * Example 2-4: Comparing volumes between one CSTR and one PFR 261 *--------------------------------------------------------------------*# 262 263 FlowSheet comparative 264 VARIABLES 265 V_cstr as volume (Brief="CSTR volume", Unit="l"); 266 V_pfr as volume (Brief="PFR volume", Unit="l"); 267 268 DEVICES 269 Inlet as stream; # Inlet stream 270 CSTR as cstr; 271 PFR as pfr_d; 272 273 CONNECTIONS 274 Inlet to CSTR.Inlet; 275 Inlet to PFR.Inlet; 276 277 EQUATIONS 278 "Rate of reaction in CSTR" 279 (-CSTR.r) = (0.0092*CSTR.Outlet.X^3 - 0.0153*CSTR.Outlet.X^2 + 0.0013*CSTR.Outlet.X + 0.0053)*"mol/l/s"; 280 "Rate of reaction in PFR" 281 (-PFR.r) = (0.0092*PFR.X^3 - 0.0153*PFR.X^2 + 0.0013*PFR.X + 0.0053)*"mol/l/s"; 282 283 "CSTR volume" 284 V_cstr = CSTR.V; 285 "PFR volume" 286 V_pfr = PFR.V(PFR.N); 287 288 # SET 289 # PFR.N = 100; 290 291 SPECIFY 292 "Inlet molar flow" 293 Inlet.F = 5.0*"mol/s"; 294 "Inlet conversion" 295 Inlet.X = 0.0; 296 297 "Required CSTR conversion" 298 CSTR.Outlet.X = 0.6; 299 "Required PFR conversion" 300 PFR.Outlet.X = 0.6; 301 302 "Initial volume in PFR" 303 PFR.V(1) = 0.0*"l"; 304 305 OPTIONS 306 mode = "steady"; 307 end 308 309 310 #*--------------------------------------------------------------------- 260 311 * Example 2-5: two CSTRs in serie 261 312 *--------------------------------------------------------------------*# … … 306 357 307 358 #*--------------------------------------------------------------------- 308 * Example 2-6: two PFRs in series (d escreted)359 * Example 2-6: two PFRs in series (discreted) 309 360 *--------------------------------------------------------------------*# 310 361 -
/mso/sample/reactors/fogler/chap3/oxidation_of_so2.mso
r49 r63 24 24 * 25 25 *---------------------------------------------------------------------- 26 * Author: Christiano D. W etzelGuerra and Rodolfo Rodrigues26 * Author: Christiano D. W. Guerra and Rodolfo Rodrigues 27 27 * GIMSCOP/UFRGS - Group of Integration, Modeling, Simulation, Control, 28 28 * and Optimization of Processes … … 69 69 70 70 EQUATIONS 71 "Change time in X" 72 X = time*"1/s"; 73 71 74 "Outlet molar fraction" 72 75 Outlet.C = Outlet.z*sum(Outlet.C); … … 100 103 T = (227 + 273.15)*"K"; 101 104 102 "Outlet molar conversion"103 X = 0.5;104 105 105 OPTIONS 106 mode = "steady";106 time = [0:0.005:0.995]; 107 107 end -
/mso/sample/reactors/fogler/chap9/cstr_startup.mso
r49 r63 28 28 * 29 29 *---------------------------------------------------------------------- 30 * Author: Christiano D. W etzelGuerra and Rodolfo Rodrigues30 * Author: Christiano D. W. Guerra and Rodolfo Rodrigues 31 31 * GIMSCOP/UFRGS - Group of Integration, Modeling, Simulation, Control, 32 32 * and Optimization of Processes … … 198 198 Tsp as temperature (Brief="Reference temperature"); 199 199 mco as flow_mol (Brief="Molar flow of cooling water"); 200 kc as Real (Brief="Gain" );200 kc as Real (Brief="Gain", Unit="lbmol/degR/h"); 201 201 202 202 VARIABLES 203 I as Real (Brief="Integral action" );203 I as Real (Brief="Integral action", Unit="degR*h"); 204 204 X as fraction (Brief="Fraction conversion", Lower=0); 205 205 -
/mso/sample/stage_separators/sample_flash.mso
r49 r63 24 24 Q to fl.Q; 25 25 26 EQUATIONS 27 fl.OutletL.F = 400*sqrt(fl.Level/"m") * "kmol/h"; 28 26 29 SPECIFY 27 30 s1.F = 496.3 * "kmol/h"; … … 29 32 s1.P = 507.1 * "kPa"; 30 33 #s1.v = 0.1380; 31 s1.z = [0.2379,0.3082,0.0995 9,0.1373,0.08872,0.1283];34 s1.z = [0.2379,0.3082,0.09958,0.1373,0.08872,0.1283]; 32 35 33 36 fl.OutletV.F = 68.5 * "kmol/h"; 34 fl.OutletL.F = 400*sqrt(fl.Level/"m") * "kmol/h";35 36 37 Q = 1 * "kJ/h"; 37 38 … … 50 51 51 52 OPTIONS 52 relativeAccuracy = 1e-6; 53 time = [0:100:10000]; 53 relativeAccuracy = 1e-7; 54 absoluteAccuracy = 1e-9; 55 #mode="steady"; 56 time = [0:0.1:20]*"h"; 54 57 end 55 58
Note: See TracChangeset
for help on using the changeset viewer.