Changeset 497 for branches/packed


Ignore:
Timestamp:
Apr 11, 2008, 2:03:21 PM (14 years ago)
Author:
Paula Bettio Staudt
Message:

Problem solved: model of a packed columnstage and its examples working

Location:
branches/packed
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/packed/eml/stage_separators/PackedStage.mso

    r496 r497  
    5050        uV as velocity (Brief="volume flow rate of vapor, m^3/m^2/s", Lower=-10, Upper=100);
    5151        dp as length (Brief="Particle diameter", Default=1e-3, Lower=0, Upper=10);
    52         invK as positive (Brief="Wall factor");
    53         Rev as Real (Brief="Reynolds number of the vapor stream", Default=100);
    54         Al as area;
    55         hl as Real (Brief="Column holdup", Unit='m^3/m^3');
     52        invK as positive (Brief="Wall factor", Default=1, Upper=10);
     53        Rev as Real (Brief="Reynolds number of the vapor stream", Default=4000);
     54        Al as area (Brief="Area occupied by the liquid", Default=0.001, Upper=1);
     55        hl as positive (Brief="Column holdup", Unit='m^3/m^3', Default=0.01,Upper=10);
    5656#       hlS as Real (Brief="Column holdup at loading point", Unit='m^3/m^3');
    5757#       hlFl as Real (Brief="Column holdup at flooding point", Unit='m^3/m^3');
     
    6060#       uLS as velocity;
    6161#       uLFl as velocity;
    62         Qsil as Real (Brief="Resistance coefficient on the liquid load", Lower = 0);
     62        Qsil as positive (Brief="Resistance coefficient on the liquid load");
    6363#       QsiS as Real (Brief="Resistance coefficient at the loading point", Lower = 0);
    6464#       QsiFl as Real (Brief="Resistance coefficient at the flooding point", Lower = 0);
     
    232232        #t1.OutletV.F = 180.1 * 'kmol/h';
    233233        t1.deltaP = 0.00189536 * 'atm';
    234         t1.Qsil = 1;
     234        t1.Qsil = 5;
    235235       
    236236        SET
  • branches/packed/eml/stage_separators/column.mso

    r477 r497  
    12811281        bot = NStages/top;
    12821282        stage.hs = H/NStages;   
    1283         stage.V = stage.hs * stage.Ap;
     1283        stage.V = stage.hs * stage.d^2*3.14159/4;
    12841284       
    12851285        CONNECTIONS
     
    12881288end
    12891289
    1290 Model PackedDistillation_kettle_cond
    1291         PARAMETERS
    1292         outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
    1293         outer NComp as Integer;
    1294         NStages as Integer(Brief="Number of stages", Default=2);
    1295         topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
    1296         top as Integer(Brief="Number of top tray");
    1297         bot as Integer(Brief="Number of bottom tray");
    1298         H as length (Brief="Height of packing");
    1299         K as Real (Brief="Reboiler flow constant", Unit='mol*s^0.5/kg^0.5/m');
    1300        
    1301         VARIABLES
    1302         stage(NStages) as packedStage_BilletSchultes;
     1290Model PackedDistillation_kettle_cond as Section_Column_Packed
     1291        PARAMETERS
     1292        VapourFlow as Switcher(Valid = ["on", "off"], Default = "on");
     1293       
     1294        VARIABLES
    13031295        cond as condenser;
    13041296        reb as reboiler;
     
    13061298        pump1 as pump;
    13071299       
    1308         SET
    1309         top = (NStages-1)*(1-topdown)/2+1;
    1310         bot = NStages/top;
    1311         stage.hs = H/NStages;   
    1312         stage.V = stage.hs * stage.Ap;
    1313        
    13141300        CONNECTIONS
    13151301        #vapor
    13161302        reb.OutletV to stage(bot).InletV;
    1317         stage([top+topdown:topdown:bot]).OutletV to stage([top:topdown:bot-topdown]).InletV;
    13181303        stage(top).OutletV to cond.InletV;
    13191304       
     
    13221307        sptop.Outlet2 to pump1.Inlet;
    13231308        pump1.Outlet to stage(top).InletL;
    1324         stage([top:topdown:bot-topdown]).OutletL to stage([top+topdown:topdown:bot]).InletL;
    13251309        stage(bot).OutletL to reb.InletL;
    1326 end
     1310       
     1311        EQUATIONS
     1312        switch VapourFlow
     1313                case "on":
     1314                stage(bot).InletV.F*stage(bot).vV = sqrt((reb.OutletV.P - stage(bot).OutletV.P)/
     1315                                        (stage(bot).rhoV*stage(bot).Qsil*20))*(stage(bot).d^2*3.14159/4*stage(bot).e - stage(bot).Al);
     1316                when stage(bot).InletV.F < 1e-6 * 'kmol/h' switchto "off";
     1317               
     1318                case "off":
     1319                stage(bot).InletV.F = 0 * 'mol/s';
     1320                when reb.OutletV.P > stage(bot).OutletV.P + 1e-1 * 'atm' switchto "on";
     1321        end
     1322
     1323end
  • branches/packed/eml/stage_separators/tray.mso

    r493 r497  
    323323        V = ML* vL + MV*vV;
    324324end
    325        
     325
     326#*-------------------------------------
     327* Model of a packed column stage
     328-------------------------------------*#
     329Model packedStage
     330        PARAMETERS
     331outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
     332outer NComp as Integer;
     333        PPwater as Plugin(Brief="Physical Properties",
     334                Type="PP",
     335                Components = [ "water" ],
     336                LiquidModel = "PR",
     337                VapourModel = "PR"
     338        );
     339
     340        V as volume(Brief="Total Volume of the tray");
     341        Q as heat_rate (Brief="Rate of heat supply");
     342        d as length (Brief="Column diameter"); 
     343
     344        a as Real (Brief="surface area per packing volume", Unit='m^2/m^3');
     345        g as acceleration;
     346        e as Real (Brief="Void fraction of packing, m^3/m^3");
     347        Cpo as Real (Brief="Constant for resitance equation"); # Billet and Schultes, 1999.
     348        Mw(NComp)       as molweight    (Brief = "Component Mol Weight");
     349        hs as length (Brief="Height of the packing stage");
     350
     351        VARIABLES
     352in      Inlet as stream (Brief="Feed stream", PosX=0, PosY=0.4932, Symbol="_{in}");
     353in      InletL as stream (Brief="Inlet liquid stream", PosX=0.5195, PosY=0, Symbol="_{inL}");
     354in      InletV as stream (Brief="Inlet vapour stream", PosX=0.4994, PosY=1, Symbol="_{inV}");
     355out     OutletL as liquid_stream (Brief="Outlet liquid stream", PosX=0.8277, PosY=1, Symbol="_{outL}");
     356out     OutletV as vapour_stream (Brief="Outlet vapour stream", PosX=0.8043, PosY=0, Symbol="_{outV}");
     357
     358        M(NComp) as mol (Brief="Molar Holdup in the tray", Default=0.01, Lower=0, Upper=100);
     359        ML as mol (Brief="Molar liquid holdup", Default=0.01, Lower=0, Upper=100);
     360        MV as mol (Brief="Molar vapour holdup", Default=0.01, Lower=0, Upper=100);
     361        E as energy (Brief="Total Energy Holdup on tray", Default=-500);
     362        vL as volume_mol (Brief="Liquid Molar Volume");
     363        vV as volume_mol (Brief="Vapour Molar volume");
     364       
     365        miL as viscosity (Brief="Liquid dynamic viscosity", DisplayUnit='kg/m/s');
     366        miV as viscosity (Brief="Vapor dynamic viscosity", DisplayUnit='kg/m/s');
     367        rhoL as dens_mass;
     368        rhoV as dens_mass;
     369       
     370        deltaP as pressure;
     371       
     372        uL as velocity (Brief="volume flow rate of liquid, m^3/m^2/s", Lower=-10, Upper=100);
     373        uV as velocity (Brief="volume flow rate of vapor, m^3/m^2/s", Lower=-10, Upper=100);
     374        dp as length (Brief="Particle diameter", Default=1e-3, Lower=0, Upper=10);
     375        invK as positive (Brief="Wall factor", Default=1, Upper=10);
     376        Rev as Real (Brief="Reynolds number of the vapor stream", Default=4000);
     377        Al as area (Brief="Area occupied by the liquid", Default=0.001, Upper=1);
     378        hl as positive (Brief="Column holdup", Unit='m^3/m^3', Default=0.01,Upper=10);
     379        Qsil as positive (Brief="Resistance coefficient on the liquid load");
     380
     381        SET
     382        Mw = PP.MolecularWeight();
     383
     384        EQUATIONS
     385        "Component Molar Balance"
     386        diff(M)=Inlet.F*Inlet.z + InletL.F*InletL.z + InletV.F*InletV.z
     387                - OutletL.F*OutletL.z - OutletV.F*OutletV.z;
     388
     389        "Energy Balance"
     390        diff(E) = ( Inlet.F*Inlet.h + InletL.F*InletL.h + InletV.F*InletV.h
     391                - OutletL.F*OutletL.h - OutletV.F*OutletV.h + Q );
     392       
     393        "Molar Holdup"
     394        M = ML*OutletL.z + MV*OutletV.z;
     395       
     396        "Energy Holdup"
     397        E = ML*OutletL.h + MV*OutletV.h - OutletL.P*V;
     398       
     399        "Mol fraction normalisation"
     400        sum(OutletL.z)= 1.0;
     401       
     402        "Liquid Volume"
     403        vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z);
     404        "Vapour Volume"
     405        vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z);
     406       
     407        "Chemical Equilibrium"
     408        PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z =
     409                PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z;
     410       
     411        "Thermal Equilibrium"
     412        OutletV.T = OutletL.T;
     413       
     414        "Mechanical Equilibrium"
     415        OutletL.P = OutletV.P;
     416       
     417        "Geometry Constraint"
     418        V*e = ML*vL + MV*vV;
     419       
     420        "Liquid Density"
     421        rhoL = PP.LiquidDensity(OutletL.T, OutletL.P, OutletL.z);
     422        "Vapour Density"
     423        rhoV = PP.VapourDensity(InletV.T, InletV.P, InletV.z);
     424        "Liquid viscosity"
     425        miL = PP.LiquidViscosity(OutletL.T, OutletL.P, OutletL.z);
     426        "Vapour viscosity"
     427        miV = PP.VapourViscosity(InletV.T, InletV.P, InletV.z);
     428
     429        "Area occupied by the liquid"
     430        Al = ML*vL/hs;
     431
     432        "Volume flow rate of liquid, m^3/m^2/s"
     433        uL * Al = OutletL.F * vL;
     434        "Volume flow rate of vapor, m^3/m^2/s"
     435        uV * ((d^2*3.14159/4)*e - Al) = OutletV.F * vV;
     436       
     437        "Liquid holdup"
     438        hl = ML*vL/V/e;
     439       
     440        "Particle diameter"
     441        dp = 6 * (1-e)/a;
     442       
     443        "Wall Factor"
     444        invK = (1 + (2*dp/(3*d*(1-e))));
     445       
     446        "Reynolds number of the vapor stream"
     447        Rev*invK = dp*uV*rhoV / (miV*(1-e));
     448       
     449        deltaP = InletV.P - OutletV.P;
     450       
     451        "Pressure drop and Vapor flow"
     452        deltaP/hs  = Qsil*a*uV^2*rhoV*invK / (2*(e-hl)^3);
     453
     454        "Liquid holdup"
     455        hl = (12*miL*a^2*uL/rhoL/g)^1/3;
     456end
     457
     458
     459#Models not working!!!!
     460
    326461Model packedStage_Navaes as trayBasic
    327462        PARAMETERS
     
    571706end
    572707
    573 Model packedStage
    574         PARAMETERS
    575 outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
    576 outer NComp as Integer;
    577         PPwater as Plugin(Brief="Physical Properties",
    578                 Type="PP",
    579                 Components = [ "water" ],
    580                 LiquidModel = "PR",
    581                 VapourModel = "PR"
    582         );
    583 
    584         V as volume(Brief="Total Volume of the tray");
    585         Q as heat_rate (Brief="Rate of heat supply");
    586         Ap as area (Brief="Plate area = Atray - Adowncomer");
    587 
    588         a as Real (Brief="surface area per packing volume", Unit='m^2/m^3');
    589         g as acceleration;
    590         e as Real (Brief="Void fraction of packing, m^3/m^3");
    591         ds as length (Brief="Column diameter");
    592         Cpo as Real (Brief="Constant for resitance equation"); # Billet and Schultes, 1999.
    593         Mw(NComp)       as molweight    (Brief = "Component Mol Weight");
    594         hs as length (Brief="Height of the packing stage");
    595 
    596         VARIABLES
    597 in      Inlet as stream (Brief="Feed stream", PosX=0, PosY=0.4932, Symbol="_{in}");
    598 in      InletL as stream (Brief="Inlet liquid stream", PosX=0.5195, PosY=0, Symbol="_{inL}");
    599 in      InletV as stream (Brief="Inlet vapour stream", PosX=0.4994, PosY=1, Symbol="_{inV}");
    600 out     OutletL as liquid_stream (Brief="Outlet liquid stream", PosX=0.8277, PosY=1, Symbol="_{outL}");
    601 out     OutletV as vapour_stream (Brief="Outlet vapour stream", PosX=0.8043, PosY=0, Symbol="_{outV}");
    602 
    603         M(NComp) as mol (Brief="Molar Holdup in the tray");
    604         ML as mol (Brief="Molar liquid holdup");
    605         MV as mol (Brief="Molar vapour holdup");
    606         E as energy (Brief="Total Energy Holdup on tray");
    607         vL as volume_mol (Brief="Liquid Molar Volume");
    608         vV as volume_mol (Brief="Vapour Molar volume");
    609        
    610         miL as viscosity (Brief="Liquid dynamic viscosity", DisplayUnit='kg/m/s');
    611         miV as viscosity (Brief="Vapor dynamic viscosity", DisplayUnit='kg/m/s');
    612         rhoL as dens_mass;
    613         rhoV as dens_mass;
    614        
    615         deltaP as pressure;
    616        
    617         uL as velocity (Brief="volume flow rate of liquid, m^3/m^2/s", Lower = -10, Default = 0.007);
    618         uV as velocity (Brief="volume flow rate of vapor, m^3/m^2/s", Lower = -10, Default = 1.14);
    619         dp as length (Brief="Particle diameter", Default=1e-3);
    620         invK as Real (Brief="Wall factor");
    621         Rev as Real (Brief="Reynolds number of the vapor stream", Lower = 0, Default=100);
    622         Al as area;
    623         hl as Real (Brief="Column holdup", Unit='m^3/m^3');
    624         Qsil as Real (Brief="Resistance coefficient on the liquid load", Lower = 0);
    625 
    626         SET
    627         Mw = PP.MolecularWeight();
    628 
    629         EQUATIONS
    630         "Component Molar Balance"
    631         diff(M)=Inlet.F*Inlet.z + InletL.F*InletL.z + InletV.F*InletV.z
    632                 - OutletL.F*OutletL.z - OutletV.F*OutletV.z;
    633 
    634         "Energy Balance"
    635         diff(E) = ( Inlet.F*Inlet.h + InletL.F*InletL.h + InletV.F*InletV.h
    636                 - OutletL.F*OutletL.h - OutletV.F*OutletV.h + Q );
    637        
    638         "Molar Holdup"
    639         M = ML*OutletL.z + MV*OutletV.z;
    640        
    641         "Energy Holdup"
    642         E = ML*OutletL.h + MV*OutletV.h - OutletL.P*V;
    643        
    644         "Mol fraction normalisation"
    645         sum(OutletL.z)= 1.0;
    646        
    647         "Liquid Volume"
    648         vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z);
    649         "Vapour Volume"
    650         vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z);
    651        
    652         "Chemical Equilibrium"
    653         PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z =
    654                 PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z;
    655        
    656         "Thermal Equilibrium"
    657         OutletV.T = OutletL.T;
    658        
    659         "Mechanical Equilibrium"
    660         OutletL.P = OutletV.P;
    661        
    662         "Geometry Constraint"
    663         V*e = ML*vL + MV*vV;
    664        
    665         "Liquid Density"
    666         rhoL = PP.LiquidDensity(OutletL.T, OutletL.P, OutletL.z);
    667         "Vapour Density"
    668         rhoV = PP.VapourDensity(InletV.T, InletV.P, InletV.z);
    669         "Liquid viscosity"
    670         miL = PP.LiquidViscosity(OutletL.T, OutletL.P, OutletL.z);
    671         "Vapour viscosity"
    672         miV = PP.VapourViscosity(InletV.T, InletV.P, InletV.z);
    673 
    674         "Area occupied by the liquid"
    675         Al = ML*vL/hs;
    676 
    677         "Volume flow rate of liquid, m^3/m^2/s"
    678         uL * Al = OutletL.F * vL;
    679         "Volume flow rate of vapor, m^3/m^2/s"
    680         uV * (Ap*e - Al) = OutletV.F * vV;
    681        
    682         "Liquid holdup"
    683         hl = ML*vL/V/e;
    684        
    685         "Particle diameter"
    686         dp = 6 * (1-e)/a;
    687        
    688         "Wall Factor"
    689         invK = (1 + (2*dp/(3*ds*(1-e))));
    690        
    691         "Reynolds number of the vapor stream"
    692         Rev*invK = dp*uV*rhoV / (miV*(1-e));
    693        
    694         deltaP = InletV.P - OutletV.P;
    695        
    696         "Pressure drop and Vapor flow"
    697         deltaP/hs  = Qsil*a*uV^2*rhoV*invK / (2*(e-hl)^3);
    698 
    699         "Liquid holdup"
    700         hl = (12*miL*a^2*uL/rhoL/g)^1/3;
    701 end
    702 
    703708Model packedStage_old
    704709        PARAMETERS
     
    980985        (InletV.P - OutletV.P)/hs  = Qsio*a*uV^2*rhoV*invK / (2*(e-hl)^3);
    981986end
    982 
    983 FlowSheet test
    984         PARAMETERS
    985         a as Real (Brief="surface area per packing volume", Unit='m^2/m^3');
    986 #       N as Real (Brief="Number of elements per volume",Unit='1/m^3');
    987         niL as Real (Brief="Liquid dynamic viscosity", Unit='kg/m/s');
    988         niV as Real (Brief="Vapor dynamic viscosity", Unit='kg/m/s');
    989         g as acceleration;
    990         rhoL as dens_mass;
    991         rhoV as dens_mass;
    992         e as Real (Brief="Void fraction of packing, m^3/m^3");
    993         V as volume;
    994         Across as area;
    995         ds as length (Brief="Column diameter");
    996         d as length (Brief="size of an element of packing");
    997         h as length (Brief="Height of packing");
    998         C as Real (Brief="Constant for resitance factor equation");
    999         Cp as Real (Brief="Constant for resitance at loading point factor equation");
    1000        
    1001         vL as volume_mol;
    1002         vV as volume_mol;
    1003         ML as mol;
    1004         Mw as molweight;
    1005         dP as pressure (DisplayUnit='atm');
    1006        
    1007         VARIABLES
    1008         hL as Real (Brief="Liquid holdup", Default = 0.424);
    1009         VL as volume (Brief="Liquid volume", Default = 0.025);
    1010         uL as velocity (Brief="volume flow rate of liquid, m^3/m^2/s", Default = 0.007);
    1011         uV as velocity (Brief="volume flow rate of vapor, m^3/m^2/s", Default = 1.14);
    1012 #       n as Real;
    1013         FV as flow_mol(Default = 149);
    1014         FL as flow_mol(Default = 222);
    1015         ksi as Real (Brief="Coefficient of Resistance", Default = 0.784);
    1016         ksil as Real (Brief="Coefficient of Resistance", Default = 0.032);
    1017         Rev as Real(Default = 0.966);
    1018         hLs as Real(Default = 0.037);
    1019        
    1020         EQUATIONS
    1021         VL = vL * ML;
    1022         hL = VL/V;
    1023         uL * Across = FL * vL;
    1024         uV * Across = FV * vV;
    1025        
    1026         ksi * C^2 * (uL/uV * sqrt(rhoV/rhoL) * (niL/niV)^5.8)^3 = g/1*'s^2/m';
    1027        
    1028         a^2 * niL * uL = hL^1 *(g*rhoL/3 - ksi*a*rhoV*uV^2/(4*hL*(e-hL)^2));
    1029        
    1030         dP/h = ksil *(a/2 + 2/ds)*(uV^2*rhoV/(e-hL)^3);
    1031        
    1032         ksil = Cp * (exp(uL*rhoL/a/niL/200)*(hL/hLs)^0.3) * (64/Rev+(1.8/Rev)) *
    1033                                 ((e-hL)/e);#1.5
    1034        
    1035         Rev = uV * (d-2*hL/a) * rhoV/ niV;
    1036        
    1037         hLs = (12*a^2*niL*uL/g/rhoL)^0.333;
    1038 
    1039         SPECIFY
    1040 #       FV = 147.1 * 'kmol/h';
    1041 #       FL = 229.5 * 'kmol/h';
    1042 #       ksi = 0.809623;
    1043        
    1044         SET
    1045         Mw = 75 * 'g/mol';
    1046         vL = 9.5e-5 * 'm^3/mol';
    1047         vV = 0.022 * 'm^3/mol';
    1048         niL = 0.00032 * 'kg/m/s';
    1049         niV = 8.2e-5 * 'kg/m/s';
    1050         rhoL = 809 * 'kg/m^3';
    1051         rhoV  = 4.63 * 'kg/m^3';
    1052         ML = 0.268 * 'kmol';
    1053         dP = 0.1984 * 0.001 * 'atm';#0.1984 * 'atm';
    1054        
    1055         V = 0.06 * 'm^3';#0.06 * 'm^3';
    1056         Across = 0.8 * 'm^2';
    1057         h = 0.075 * 'm';
    1058         ds = 1.009 * 'm';
    1059         d = 50 * 'mm';
    1060 
    1061 #       ksi = 0.8;
    1062         C = 2.37;
    1063         Cp = 0.662;
    1064         e = 0.78;
    1065         a = 120 * 'm^2/m^3';
    1066 #       N = 6400 * '1/m^3';
    1067 
    1068 end
    1069 
    1070 #*
    1071         "Reynolds number of the liquid stream"
    1072         Rel = uL*rhoL / (a*miL);
    1073 
    1074         if Rel < 5 then
    1075                 if Rel < 1e-4 then
    1076                         ah = 0 * '1/m';
    1077                 else
    1078                         "Hydraulic surface area"
    1079                         ah = a * Ch * Rel^0.15 * (uL^2*a/g)^0.1; #(Rel^2*a^3*miL^2/rhoL^2/g)^0.1; #
    1080                 end
    1081         else
    1082                 ah = a * Ch * 0.85 * Rel^0.25 * (uL^2*a/g)^0.1; #(Rel^2*a^3*miL^2/rhoL^2/g)^0.1; #
    1083         end
    1084        
    1085 
    1086 *#     
  • branches/packed/eml/streams.mso

    r496 r497  
    3535
    3636        VARIABLES
    37         F as flow_mol                   (Brief = "Stream Molar Flow Rate", Lower=-1e2);
     37        F as flow_mol                   (Brief = "Stream Molar Flow Rate");
    3838        T as temperature                (Brief = "Stream Temperature");
    3939        P as pressure                   (Brief = "Stream Pressure");
  • branches/packed/sample/stage_separators/sample_column.mso

    r495 r497  
    557557        sec.stage.Qsil = 0.1;
    558558        #sec.stage(1).OutletV.F = 150 * 'kmol/h';
    559         sec.stage.deltaP = 0.0001 * 'atm';
     559        sec.stage.deltaP = 0.001 * 'atm';
    560560
    561561        SET
     
    563563        sec.NStages = 8;
    564564        sec.stage.Q = 0 * 'kW';
    565         sec.stage.Ap = 3.94 * 'ft^2';
    566         sec.stage.ds = 1.009 * 'm';
     565        sec.stage.d = 1.009 * 'm';
    567566        sec.stage.Cpo = 0.763;
    568567        sec.stage.e = 0.951;
     
    571570        INITIAL
    572571        sec.stage.OutletL.T =[283:(325-283)/(sec.NStages-1):325] *'K';
    573         sec.stage.ML = 0.1 * 'kmol';
    574         sec.stage.OutletL.z([1:4]) = [0.2, 0.2, 0.2, 0.2];
     572        sec.stage.ML = 0.01 * 'kmol';
     573        sec.stage.OutletL.z([1:4]) = [0.3, 0.2, 0.002, 0.1];
    575574
    576575        OPTIONS
     
    582581end
    583582
    584 FlowSheet Packed_kettle_cond_Test_1
     583FlowSheet Packed_kettle_cond_Test
    585584        PARAMETERS
    586585        PP      as Plugin(Brief="Physical Properties",
    587586                Type="PP",
    588                 Components = [ "methanol", "water"],
    589                 LiquidModel = "IdealLiquid",
    590                 VapourModel = "Ideal"
     587                Components = [ "isobutane", "n-pentane", "propylene",
     588                "benzene", "isobutene" ],
     589                LiquidModel = "PR",
     590                VapourModel = "PR"
    591591        );
    592592        NComp   as Integer;
     
    605605       
    606606        CONNECTIONS
    607         feed.Outlet to col.reb.Inlet;
    608         zero to col.stage([1:col.NStages]).Inlet;
     607        feed.Outlet to col.stage(5).Inlet;
     608        zero to col.reb.Inlet;
     609        zero to col.stage([1:4]).Inlet;
     610        zero to col.stage([6:col.NStages]).Inlet;
    609611        Qc.OutletQ to col.cond.InletQ;
    610612        Qr.OutletQ to col.reb.InletQ;
    611613       
    612         VARIABLES
    613         deltaP(col.NStages) as Real (Unit = 'atm/m');
    614        
    615614        SPECIFY
    616         feed.Outlet.F = 0.98 * 'mol/min';
    617         feed.Outlet.T = (50+273.15) * 'K';
    618         feed.Outlet.P = 0.91 * 'kPa';
    619         feed.Outlet.z = [0.16, 0.84];
     615        feed.Outlet.F = 113.4 * 'kmol/h';
     616        feed.Outlet.T = 291 * 'K';
     617        feed.Outlet.P = 168.3 * 'kPa';
     618        feed.Outlet.z = 1/NComp;
    620619       
    621620        zero.F = 0 * 'kmol/h';
     
    626625        zero.h = 0 * 'J/mol';
    627626       
    628         col.sptop.frac = 0.4;
    629         col.sptop.Outlet1.F = 0.10 * 'mol/min';
    630         col.reb.OutletL.F = 0.88 * 'mol/min';
     627        col.sptop.Outlet2.F = 85 * 'kmol/h';
     628        col.reb.OutletL.F = 28.4 * 'kmol/h';
     629        col.sptop.frac = 0.444445;
    631630        col.cond.OutletV.F = 0 * 'kmol/h';
    632         Qr.OutletQ.Q = 700 * 'cal/min';
    633         Qc.OutletQ.Q = -700 * 'cal/min';
    634         col.pump1.dP = 0.1 * 'atm';
    635        
    636         EQUATIONS
    637         col.reb.OutletV.F = 0.2 * 'mol*min^0.5/kg^0.5/m' * sqrt(Qr.OutletQ.Q);
    638         deltaP = (col.stage.InletV.P - col.stage.OutletV.P)/col.stage.hs;
    639        
    640         SET
    641         col.H = 1 * 'm';
    642         col.NStages = 2;
    643 
    644         col.cond.V = 1 * 'l';
    645         col.cond.Across = 100 * 'cm^2';
    646 #       col.K = 0.2 * 'mol*min^0.5/kg^0.5/m';
    647        
    648         col.reb.V = 2 * 'l';
    649         col.reb.Across = 200 * 'cm^2';
    650 
     631        Qr.OutletQ.Q = 3.7743e6 * 'kJ/h';
     632        Qc.OutletQ.Q = -3.71e6 * 'kJ/h';
     633        col.pump1.dP = 16 * 'kPa';
     634
     635        col.stage.Qsil = 2;
     636        col.stage.deltaP = 0.003 * 'atm';
     637
     638        SET
     639        col.H = 3.5 * 'm';
     640        col.NStages = 8;
    651641        col.stage.Q = 0 * 'kW';
    652         col.stage.Ap = 56.74 * 'cm^2';
    653         col.stage.ds = 85 * 'mm';
    654         col.stage.e = 0.662;
    655         col.stage.a = 185.4 * 'm^2/m^3';
     642        col.stage.d = 2.24 * 'ft';
    656643        col.stage.Cpo = 0.763;
    657         col.stage.Qsio = 1;
     644        col.stage.e = 0.951;
     645        col.stage.a = 112.6 * 'm^2/m^3';
     646
     647        col.cond.V = 2 * 'm^3';
     648        col.cond.Across = 1 * 'm^2';
     649        col.reb.V = 2 * 'm^3';
     650        col.reb.Across = 1 * 'm^2';
    658651       
    659652        INITIAL
    660653        # condenser
    661         col.cond.OutletL.T = (63.5+273.15) *'K';
    662         col.cond.Level = 2 * 'cm';
    663         col.cond.OutletL.z(1) = 0.8; #0.16;
     654        col.cond.OutletL.T = 260 *'K';
     655        col.cond.Level = 1 * 'm';
     656        col.cond.OutletL.z([1:4]) = [0.65, 0.05, 0.01, 0.01];
    664657
    665658        # reboiler
    666         col.reb.OutletL.T = (82+273.15) *'K';
    667         col.reb.Level = 2 * 'cm';
    668         col.reb.OutletL.z(1) = 0.7;
    669 
    670         # column stages
    671         col.stage.OutletL.T = [(62.5+273.15):((83+273.15)-(62.5+273.15))/(col.NStages-1):(83+273.15)] * 'K';
    672         #col.stage.Level = 2 * 'cm';
    673         col.stage.ML = 0.2 * 'mol';
    674         col.stage.OutletL.z(1) = 0.5; #[0.79, 0.65, 0.5, 0.25, 0.16];
     659        col.reb.OutletL.T = 330 *'K';
     660        col.reb.Level = 1 * 'm';
     661        col.reb.OutletL.z([1:4]) = [0.1, 0.7, 0.01, 0.01];
     662
     663        # column trays
     664        col.stage.OutletL.T = [290:(330-290)/(col.NStages-1):330] * 'K';
     665        col.stage.ML = 0.1 * 'kmol';
     666        col.stage.OutletL.z([1:4]) = [0.15, 0.5, 0.001, 0.1];
    675667
    676668        OPTIONS
    677         DAESolver(File="dassl");
     669        TimeStep = 10;
     670        TimeEnd = 500;
     671end
     672
     673FlowSheet PackedColumn_ctrl
     674        PARAMETERS
     675        PP      as Plugin(Brief="Physical Properties",
     676                Type="PP",
     677                Components = [ "isobutane", "n-pentane", "propylene",
     678                        "benzene", "isobutene" ],
     679                LiquidModel = "PR",
     680                VapourModel = "PR"
     681        );
     682        NComp   as Integer;
     683       
     684        Qcmin as heat_rate (Brief="Minimum Condenser Heat supplied");
     685        Qcmax as heat_rate (Brief="Maximum Condenser Heat supplied");
     686        Qrmin as heat_rate (Brief="Minimum Reboiler Heat supplied");
     687        Qrmax as heat_rate (Brief="Maximum Reboiler Heat supplied");
     688        Frmin as flow_mol (Brief="Minimum bottom flow rate");
     689        Frmax as flow_mol (Brief="Maximum bottom flow rate");
     690        Fcmin as flow_mol (Brief="Minimum reflux flow rate");
     691        Fcmax as flow_mol (Brief="Maximum reflux flow rate");
     692        Hmint as length (Brief="Minimum liquid level in top tank");
     693        Hmaxt as length (Brief="Maximum liquid level in top tank");
     694    Hminb as length (Brief="Minimum liquid level in reboiler");
     695        Hmaxb as length (Brief="Maximum liquid level in reboiler");
     696        Pmax as pressure (Brief="Maximum column pressure");
     697        Pmin as pressure (Brief="Minimum column pressure");
     698        Tmax as temperature (Brief="Maximum column temperature");
     699        Tmin as temperature (Brief="Minimum column temperature");
     700
     701        VARIABLES
     702        Qc as energy_source (Brief="Heat rate removed from condenser");
     703        Qr as energy_source (Brief="Heat rate supplied to reboiler");
     704        Had_top as Real (Brief="Dimensionless condenser level");
     705        Had_bot as Real (Brief="Dimensionless reboiler level");
     706        Pad as Real (Brief="Dimensionless pressure");
     707        Tad as Real (Brief="Dimensionless temperature");
     708        RR      as positive (Brief="Reflux ratio");
     709
     710        SET
     711        NComp = PP.NumberOfComponents;
     712
     713        DEVICES
     714        col as PackedDistillation_kettle_cond;
     715        feed as source;
     716        zero as stream;
     717        TCcond as PIDIncr;
     718        LCtop as PIDIncr;
     719        LCbot as PIDIncr;
     720        PC as PIDIncr;
     721
     722        CONNECTIONS
     723        feed.Outlet to col.stage(5).Inlet;
     724        zero to col.reb.Inlet;
     725        zero to col.stage([1:4]).Inlet;
     726        zero to col.stage([6:col.NStages]).Inlet;
     727        Qc.OutletQ to col.cond.InletQ;
     728        Qr.OutletQ to col.reb.InletQ;
     729
     730        EQUATIONS
     731   "Temperature Controller"
     732        TCcond.Parameters.tau = 0*'s'; 
     733        TCcond.Parameters.tauSet = 0*'s';       
     734        TCcond.Parameters.alpha = 0.3;
     735        TCcond.Parameters.bias = 0.5;   
     736        TCcond.Parameters.gamma = 1;
     737        TCcond.Parameters.beta = 1;
     738        TCcond.Options.action = 1;
     739        TCcond.Options.clip = 1;
     740        TCcond.Options.autoMan = 0;
     741        TCcond.Parameters.intTime = 60*'s';
     742        TCcond.Parameters.gain = 0.6;
     743        TCcond.Parameters.derivTime = 1*'s';
     744        TCcond.Ports.setPoint = ((15+273.15) * 'K' - Tmin)/(Tmax-Tmin);
     745        TCcond.Ports.input = Tad;
     746        Tad = (col.cond.OutletL.T-Tmin)/(Tmax-Tmin);
     747        Qc.OutletQ.Q = Qcmin+(Qcmax-Qcmin)*TCcond.Ports.output;
     748
     749        "Pressure Controller"
     750        PC.Parameters.tau = 0*'s';     
     751        PC.Parameters.tauSet = 0*'s';   
     752        PC.Parameters.alpha = 0.3;
     753        PC.Parameters.bias = 0;
     754        PC.Parameters.gamma = 1;
     755        PC.Parameters.beta = 1;
     756        PC.Options.action = -1;
     757        PC.Options.clip = 1;
     758        PC.Options.autoMan = 0;
     759        PC.Parameters.intTime = 50*'s';
     760        PC.Parameters.gain = 0.5;
     761        PC.Parameters.derivTime = 1*'s';
     762        PC.Ports.setPoint = (4.0*'bar'-Pmin)/(Pmax-Pmin);
     763        PC.Ports.input = Pad;
     764        Pad = (col.cond.OutletV.P-Pmin)/(Pmax-Pmin);
     765        col.cond.OutletV.F = (Fcmin+(Fcmax-Fcmin)*PC.Ports.output);     
     766       
     767        "Ttop Level Controller"
     768        LCtop.Parameters.tau = 0*'s';   
     769        LCtop.Parameters.tauSet = 0*'s';       
     770        LCtop.Parameters.alpha = 0.3;
     771        LCtop.Parameters.bias = 0.5;   
     772        LCtop.Parameters.gamma = 1;
     773        LCtop.Parameters.beta = 1;
     774        LCtop.Options.action = -1;
     775        LCtop.Options.clip = 1;
     776        LCtop.Options.autoMan = 0;
     777        LCtop.Parameters.intTime = 10*'s';
     778        LCtop.Parameters.gain = 1;
     779        LCtop.Parameters.derivTime = 0*'s';
     780        LCtop.Ports.setPoint = (1.0 * 'm' - Hmint)/(Hmaxt-Hmint);
     781        LCtop.Ports.input = Had_top;
     782        Had_top = (col.cond.Level-Hmint)/(Hmaxt-Hmint);
     783        col.sptop.Outlet1.F = Fcmin + (Fcmax-Fcmin) * LCtop.Ports.output;
     784
     785        "Tbottom Level Controller"
     786        LCbot.Parameters.tau = 0*'s';   
     787        LCbot.Parameters.tauSet = 0*'s';       
     788        LCbot.Parameters.alpha = 0.3;
     789        LCbot.Parameters.bias = 0.5;   
     790        LCbot.Parameters.gamma = 1;
     791        LCbot.Parameters.beta = 1;
     792        LCbot.Options.action = -1;
     793        LCbot.Options.clip = 1;
     794        LCbot.Options.autoMan = 0;
     795        LCbot.Parameters.intTime = 100*'s';
     796        LCbot.Parameters.gain = 1;
     797        LCbot.Parameters.derivTime = 0*'s';
     798        LCbot.Ports.setPoint = (1.0 * 'm' - Hminb)/(Hmaxb-Hminb);
     799        LCbot.Ports.input = Had_bot;
     800        Had_bot = (col.reb.Level-Hminb)/(Hmaxb-Hminb);
     801        col.reb.OutletL.F = Frmin + (Frmax-Frmin) * LCbot.Ports.output;
     802
     803        RR * (col.cond.OutletV.F + col.sptop.Outlet1.F) = col.sptop.Outlet2.F;
     804       
     805        if time < 1 * 'h' then
     806                col.sptop.Outlet2.F = 75 * 'kmol/h'; # reflux
     807        else
     808                col.sptop.Outlet2.F = 85 * 'kmol/h'; # reflux
     809        end
     810
     811        SPECIFY
     812        feed.Outlet.F = 113.4 * 'kmol/h';
     813        feed.Outlet.T = 291 * 'K';
     814        feed.Outlet.P = 5 * 'bar';
     815        feed.Outlet.z = 1/NComp;
     816       
     817        zero.F = 0 * 'kmol/h';
     818        zero.T = 300 * 'K';
     819        zero.P = 1 * 'atm';
     820        zero.z = 1/NComp;
     821        zero.v = 0;
     822        zero.h = 0 * 'J/mol';
     823       
     824        Qr.OutletQ.Q = 4e6 * 'kJ/h';
     825        col.pump1.dP = 16 * 'kPa';
     826       
     827        col.stage.Qsil = 2;
     828        col.stage.deltaP = 0.003 * 'atm';
     829
     830        SET
     831        col.H = 3.5 * 'm';
     832        col.NStages = 8;
     833        col.stage.Q = 0 * 'kW';
     834        col.stage.d = 2.24 * 'ft';
     835        col.stage.Cpo = 0.763;
     836        col.stage.e = 0.951;
     837        col.stage.a = 112.6 * 'm^2/m^3';
     838
     839        col.cond.V = 2 * 'm^3';
     840        col.cond.Across = 1 * 'm^2';
     841        col.reb.V = 2 * 'm^3';
     842        col.reb.Across = 1 * 'm^2';
     843
     844        # Controllers type
     845        TCcond.PID_Select = "Ideal_AW";
     846        PC.PID_Select = "Ideal_AW";
     847        LCtop.PID_Select = "Ideal_AW";
     848        LCbot.PID_Select = "Ideal_AW";
     849
     850        Qrmax = 5e6 * 'kJ/h';
     851        Qrmin = 1e6 * 'kJ/h';
     852        Frmin = 0 * 'kmol/h';
     853        Frmax = 60 * 'kmol/h';
     854        Fcmin = 0 * 'kmol/h';
     855        Fcmax = 120 * 'kmol/h';
     856        Hmint = 0 * 'm';
     857        Hmaxt = 2 * 'm';
     858        Hminb = 0 * 'm';
     859        Hmaxb = 2 * 'm';
     860        Pmin = 0.5 * 'bar';
     861        Pmax = 6 * 'bar';
     862        Qcmax = -5e5 * 'kJ/h';
     863        Qcmin = -5e6 * 'kJ/h';
     864        Tmax = (30+273.15) * 'K';
     865        Tmin = (-20+273.15) * 'K';
     866       
     867        INITIAL
     868        # condenser
     869        col.cond.OutletL.T = 260 *'K';
     870        col.cond.Level = 1 * 'm';
     871        col.cond.OutletL.z([1:4]) = [0.2, 0.2, 0.4, 0.05];
     872
     873        # reboiler
     874        col.reb.OutletL.T = 350 *'K';
     875        col.reb.Level = 1 * 'm';
     876        col.reb.OutletL.z([1:4]) = [0.1, 0.4, 0.1, 0.3];
     877
     878        # column trays
     879        col.stage.OutletL.T = [290:(330-290)/(col.NStages-1):330] * 'K';
     880        col.stage.ML = 0.1 * 'kmol';
     881        col.stage.OutletL.z([1:4]) = [0.15, 0.3, 0.25, 0.2];
     882
     883        OPTIONS
    678884        TimeStep = 0.1;
    679         TimeEnd = 50;
     885        TimeEnd = 5;
     886        TimeUnit = 'h';
     887        #InitialFile = "Column_ctrl.rlt";
    680888end
  • branches/packed/sample/stage_separators/sample_tray.mso

    r493 r497  
    369369        inV.z = [0.0584, 0.9416];#[0.5, 0.5];#
    370370       
    371         #t1.OutletV.P = 145 * 'kPa';
    372         t1.OutletV.F = 190 * 'kmol/h';
     371        t1.OutletV.P = 145 * 'kPa';
     372        #t1.OutletV.F = 190 * 'kmol/h';
    373373        t1.Qsil = 10;
    374374       
     
    445445        inV.z = [0.265, 0.233, 0.150, 0.014, 0.338];
    446446       
    447         #t1.deltaP = 0.01 * 'atm';
    448         t1.OutletV.F = 165 * 'kmol/h';
     447        t1.deltaP = 0.01 * 'atm';
     448        #t1.OutletV.F = 165 * 'kmol/h';
    449449        t1.Qsil = 10;
    450450       
Note: See TracChangeset for help on using the changeset viewer.