- Location:
- /mso
- Files:
-
- 8 deleted
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
/mso/eml/controllers/Comparator.mso
r63 r49 20 20 Model comparator 21 21 22 PARAMETERS 23 22 24 VARIABLES 23 25 input1 as Real (Brief="input signal 1"); … … 30 32 output=input1-input2; 31 33 34 INITIAL 35 32 36 end -
/mso/eml/controllers/HiLoSelect.mso
r63 r49 36 36 output = input2; 37 37 end 38 39 INITIAL 38 40 39 41 end -
/mso/eml/controllers/iae.mso
r63 r49 21 21 Model IAE 22 22 23 PARAMETERS 24 23 25 VARIABLES 24 26 input as Real (Brief="input signal"); -
/mso/eml/controllers/ise.mso
r63 r49 1 1 #*---------------------------------------------------------------------- 2 * Model I SE2 * Model IAE 3 3 *----------------------------------------------------------------------- 4 4 * - Inputs … … 21 21 Model ISE 22 22 23 PARAMETERS 24 23 25 VARIABLES 24 26 input as Real (Brief="input signal"); -
/mso/eml/controllers/multiply.mso
r63 r49 1 1 #*---------------------------------------------------------------------- 2 * Model Multiply2 * Model Lead Lag 3 3 *----------------------------------------------------------------------- 4 4 * - Inputs … … 20 20 Model Multiply 21 21 22 PARAMETERS 23 22 24 VARIABLES 23 25 input1 as Real (Brief="input signal 1"); … … 29 31 "Calculate output" 30 32 output=input1*input2; 33 34 INITIAL 35 31 36 32 37 end -
/mso/eml/controllers/ratio.mso
r63 r49 19 19 20 20 Model Ratio 21 22 PARAMETERS 21 23 22 24 VARIABLES … … 29 31 if abs(input2)>1e-5 then 30 32 "Calculate output" 31 input2*output=input1;33 output=input1*input2; 32 34 else 33 35 if input2>0 then 34 36 "Calculate output" 35 output=input1*1e 5;37 output=input1*1e-5; 36 38 else 37 39 "Calculate output" 38 output=-input1*1e 5;40 output=-input1*1e-5; 39 41 end 40 42 end 41 43 44 INITIAL 42 45 end -
/mso/eml/controllers/sum.mso
r63 r49 1 1 #*---------------------------------------------------------------------- 2 * Model Sum2 * Model Rum 3 3 *----------------------------------------------------------------------- 4 4 * - Inputs … … 20 20 Model Sum 21 21 22 PARAMETERS 23 22 24 VARIABLES 23 25 input1 as Real (Brief="input signal 1"); … … 29 31 "Calculate output" 30 32 output = input1+input2; 33 34 INITIAL 31 35 32 36 end -
/mso/eml/pressure_changers/pump.mso
r63 r49 1 #*------------------------------------------------------------------------2 * This file is property of the author and cannot be used, copyed3 * or modified without permission.4 *5 * Copyright (C) 2002-2006 the author6 *-------------------------------------------------------------------------7 * Authors: Andrey Copat Estefane da Silveira Horn8 * $Id$ Marcos Lovato Alencastro9 * Date: 20/02/200610 *-------------------------------------------------------------------------11 * -> Steady State12 * -> Only Liquid13 * -> Adiabatic14 * -> Isentropic15 *-------------------------------------------------------------------------*#16 using "streams";17 using "pressure_changers/flux_machine_basic";18 19 Model centrifugal_pump as flux_machine_basic20 21 PARAMETERS22 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 VARIABLES33 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 SET50 Mw = PP.MolecularWeight();51 52 EQUATIONS53 #Mixtures Properties54 "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 Equations73 "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 end116 117 118 1 #*------------------------------------------------------------------- 119 2 * Model of a pump … … 132 15 * $Id$ 133 16 *--------------------------------------------------------------------*# 134 17 using "streams"; 135 18 136 19 Model pump -
/mso/eml/pressure_changers/valve.mso
r63 r49 1 #*-----------------------------------------------------------------------------2 * Author: Estefane Horn Date:06/10/20063 *4 *$Id:$5 *-----------------------------------------------------------------------------6 * Assumptions7 * -> Steady State8 * -> Isentalpic9 * -> Liquid10 *11 *#12 13 using "streams";14 using "pressure_changers/flux_machine_basic";15 16 17 Model valve_basic as flux_machine_basic_TP18 19 PARAMETERS20 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 VARIABLES25 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 SET34 rho60F = 99.022 * "kg/m^3";35 36 EQUATIONS37 "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 end65 66 Model valve_linear as valve_basic67 68 VARIABLES69 x as fraction (Brief = "Opening");70 71 EQUATIONS72 73 "Opening Equation"74 fc = 100*x;75 76 end77 78 Model valve_parabolic as valve_basic79 80 PARAMETERS81 n as positive (Brief = "Constant", Lower = 1.4, Upper = 2.6);82 83 VARIABLES84 x as fraction (Brief = "Opening");85 86 EQUATIONS87 88 "Opening Equation"89 fc = 100*x^n;90 91 end92 93 Model valve_equal as valve_basic94 95 PARAMETERS96 a as Real (Brief = "Constant", Default = 100);97 98 VARIABLES99 x as fraction (Brief = "Opening");100 101 EQUATIONS102 103 "Opening Equation"104 fc = 100*a^(x-1);105 106 end107 108 Model valve_quick as valve_basic109 110 PARAMETERS111 a as positive (Brief = "Constant", Default = 0.05);112 n as positive (Brief = "Constant", Default = 5);113 114 VARIABLES115 x as fraction (Brief = "Opening");116 117 EQUATIONS118 119 "Opening Equation"120 fc = 100*(1-(a*(1-x)-(a-1)*(1-x)^n));121 122 end123 124 1 #*------------------------------------------------------------------- 125 2 * Model of a valve … … 150 27 * $Id$ 151 28 *--------------------------------------------------------------------*# 29 30 using "streams"; 152 31 153 32 Model valve -
/mso/eml/stage_separators/flash.mso
r63 r49 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
r63 r49 90 90 "Chemical Equilibrium" 91 91 PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z = 92 PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, yideal)*yideal;92 PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*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, yideal)*yideal;253 PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*yideal; 254 254 255 255 OutletV.z = Emv * (yideal - InletV.z) + InletV.z; -
/mso/eml/types.mso
r63 r49 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 000, Unit = "m^3");48 volume as positive (Brief = "Volume", Default=10, Lower=0, Upper=1E6, 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
r63 r49 1 1 using "pressure_changers/pump"; 2 3 FlowSheet Pump_P14 5 DEVICES6 S1 as streamTP;7 P1 as centrifugal_pump;8 9 CONNECTIONS10 S1 to P1.Inlet;11 12 PARAMETERS13 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 SET18 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 SPECIFY30 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 end39 2 40 3 FlowSheet pump_Test -
/mso/sample/pressure_changers/sample_valve.mso
r63 r49 76 76 77 77 end 78 79 FlowSheet valve_linear_Test80 81 DEVICES82 S1 as streamTP;83 V1 as valve_linear;84 85 CONNECTIONS86 S1 to V1.Inlet;87 88 PARAMETERS89 PP as CalcObject (Brief="External Physical Properties", File="vrpp");90 NComp as Integer (Default= 1);91 92 SET93 PP.Components = ["water"];94 PP.LiquidModel = "IdealLiquid";95 PP.VapourModel = "Ideal";96 PP.Derivatives = 0;97 NComp = PP.NumberOfComponents;98 99 SPECIFY100 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
r63 r49 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" , Upper=2e3);65 V as volume (Brief="Volume", Unit="l"); 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" , Upper=2e3);84 V as volume (Brief="Volume", Unit="l"); 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 iscrete points", Default=200);105 N as Integer (Brief="Number of descrete 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" , Upper=2e3);110 V(N) as volume (Brief="Volume", Unit="l"); 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 PFR261 *--------------------------------------------------------------------*#262 263 FlowSheet comparative264 VARIABLES265 V_cstr as volume (Brief="CSTR volume", Unit="l");266 V_pfr as volume (Brief="PFR volume", Unit="l");267 268 DEVICES269 Inlet as stream; # Inlet stream270 CSTR as cstr;271 PFR as pfr_d;272 273 CONNECTIONS274 Inlet to CSTR.Inlet;275 Inlet to PFR.Inlet;276 277 EQUATIONS278 "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 # SET289 # PFR.N = 100;290 291 SPECIFY292 "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 OPTIONS306 mode = "steady";307 end308 309 310 #*---------------------------------------------------------------------311 260 * Example 2-5: two CSTRs in serie 312 261 *--------------------------------------------------------------------*# … … 357 306 358 307 #*--------------------------------------------------------------------- 359 * Example 2-6: two PFRs in series (d iscreted)308 * Example 2-6: two PFRs in series (descreted) 360 309 *--------------------------------------------------------------------*# 361 310 -
/mso/sample/reactors/fogler/chap3/oxidation_of_so2.mso
r63 r49 24 24 * 25 25 *---------------------------------------------------------------------- 26 * Author: Christiano D. W .Guerra and Rodolfo Rodrigues26 * Author: Christiano D. Wetzel 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 74 71 "Outlet molar fraction" 75 72 Outlet.C = Outlet.z*sum(Outlet.C); … … 103 100 T = (227 + 273.15)*"K"; 104 101 102 "Outlet molar conversion" 103 X = 0.5; 104 105 105 OPTIONS 106 time = [0:0.005:0.995];106 mode = "steady"; 107 107 end -
/mso/sample/reactors/fogler/chap9/cstr_startup.mso
r63 r49 28 28 * 29 29 *---------------------------------------------------------------------- 30 * Author: Christiano D. W .Guerra and Rodolfo Rodrigues30 * Author: Christiano D. Wetzel 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" , Unit="lbmol/degR/h");200 kc as Real (Brief="Gain"); 201 201 202 202 VARIABLES 203 I as Real (Brief="Integral action" , Unit="degR*h");203 I as Real (Brief="Integral action"); 204 204 X as fraction (Brief="Fraction conversion", Lower=0); 205 205 -
/mso/sample/stage_separators/sample_flash.mso
r63 r49 24 24 Q to fl.Q; 25 25 26 EQUATIONS27 fl.OutletL.F = 400*sqrt(fl.Level/"m") * "kmol/h";28 29 26 SPECIFY 30 27 s1.F = 496.3 * "kmol/h"; … … 32 29 s1.P = 507.1 * "kPa"; 33 30 #s1.v = 0.1380; 34 s1.z = [0.2379,0.3082,0.0995 8,0.1373,0.08872,0.1283];31 s1.z = [0.2379,0.3082,0.09959,0.1373,0.08872,0.1283]; 35 32 36 33 fl.OutletV.F = 68.5 * "kmol/h"; 34 fl.OutletL.F = 400*sqrt(fl.Level/"m") * "kmol/h"; 35 37 36 Q = 1 * "kJ/h"; 38 37 … … 51 50 52 51 OPTIONS 53 relativeAccuracy = 1e-7; 54 absoluteAccuracy = 1e-9; 55 #mode="steady"; 56 time = [0:0.1:20]*"h"; 52 relativeAccuracy = 1e-6; 53 time = [0:100:10000]; 57 54 end 58 55
Note: See TracChangeset
for help on using the changeset viewer.