Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • mso/eml/stage_separators/column.mso

    r46 r6  
    5050        trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 *
    5151            (trays([top:topdown:bot]).OutletV.P -
    52             trays([top:topdown:bot]).InletL.P)/"Pa"))/2 *
     52            trays([top:topdown:bot]).InletL.P)))/2 *
    5353            trays([top:topdown:bot]).Ah/trays([top:topdown:bot]).vV *
    5454            sqrt(2*(trays([top:topdown:bot]).OutletV.P -
     
    101101
    102102        "Pressure Drop through the tray"
    103         trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/"Pa"))/2 *
     103        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)))/2 *
    104104                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
    105105                cond.OutletL.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
     
    107107        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
    108108            (trays([top+topdown:topdown:bot]).OutletV.P -
    109             trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
     109            trays([top+topdown:topdown:bot]).InletL.P)))/2 *
    110110            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
    111111            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
     
    160160        tbottom as tank;
    161161        ttop as tank_cylindrical;
    162         spbottom as splitter;
    163         sptop as splitter;
    164         pump1 as pump;
    165 
    166         EQUATIONS
    167         "Pressure Drop through the tray"
    168         trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/"Pa"))/2 *
    169                 trays(top).Ah/trays(top).vV /2* sqrt(2*(trays(top).OutletV.P -
    170                 ttop.Outlet.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
    171                
    172         trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
    173             (trays([top+topdown:topdown:bot]).OutletV.P -
    174             trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
    175             trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV /2*
    176             sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
    177                 trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") /
    178             (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV));
    179        
    180         CONNECTIONS
    181         #vapor
    182         reb.OutletV to trays(bot).InletV;
    183         trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
    184         trays(top).OutletV to cond.InletV;
    185        
    186         #liquid
    187         cond.OutletL to ttop.Inlet;     
    188         ttop.Outlet to sptop.Inlet;
    189         sptop.Outlet2 to pump1.Inlet;   
    190         pump1.Outlet to trays(top).InletL;
    191         trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
    192         trays(bot).OutletL to tbottom.Inlet;
    193         tbottom.Outlet to spbottom.Inlet;
    194         spbottom.Outlet2 to reb.InletL;
    195 end
    196 
    197 
    198 #* -------------------------------------------------------------------
    199 * Distillation Column model with:
    200 *
    201 *       - NTrays like tray;
    202 *       - a vessel in the bottom of column;
    203 *       - a splitter who separate the bottom product and the stream to reboiler;
    204 *       - steady state reboiler (thermosyphon);
    205 *       - a dynamic condenser without subcooling;
    206 *       - a splitter which separate reflux and distillate;
    207 *       - a pump in reflux stream.
    208 *
    209 * ------------------------------------------------------------------*#
    210 Model Distillation_thermosyphon_cond
    211         PARAMETERS
    212 ext PP as CalcObject;
    213 ext NComp as Integer;
    214         NTrays as Integer(Brief="Number of trays", Default=2);
    215         topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
    216         top as Integer(Brief="Number of top tray");
    217         bot as Integer(Brief="Number of bottom tray");
    218 
    219         SET
    220         top = (NTrays-1)*(1-topdown)/2+1;
    221         bot = NTrays/top;
    222        
    223         VARIABLES
    224         trays(NTrays) as tray;
    225         cond as condenser;
    226         reb as reboilerSteady;
    227         tbottom as tank;
    228162        spbottom as splitter;
    229163        sptop as splitter;
     
    241175
    242176        "Pressure Drop through the tray"
    243         trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/"Pa"))/2 *
     177        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)))/2 *
    244178                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
    245                 cond.OutletL.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
     179                ttop.Outlet.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
    246180               
    247181        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
    248182            (trays([top+topdown:topdown:bot]).OutletV.P -
    249             trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
     183            trays([top+topdown:topdown:bot]).InletL.P)))/2 *
    250184            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
    251185            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
    252186                trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") /
    253187            (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV));
    254                        
     188       
    255189        CONNECTIONS
    256190        #vapor
     
    260194       
    261195        #liquid
    262         cond.OutletL to sptop.Inlet;   
    263         sptop.Outlet2 to pump1.Inlet;
     196        cond.OutletL to ttop.Inlet;     
     197        ttop.Outlet to sptop.Inlet;
     198        sptop.Outlet2 to pump1.Inlet;   
    264199        pump1.Outlet to trays(top).InletL;
    265200        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
     
    269204end
    270205
     206
    271207#* -------------------------------------------------------------------
    272208* Distillation Column model with:
    273209*
    274210*       - NTrays like tray;
    275 *       - a kettle reboiler;
    276 *       - a steady state condenser with subcooling;
    277 *       - a vessel drum (layed cilinder);
     211*       - a vessel in the bottom of column;
     212*       - a splitter who separate the bottom product and the stream to reboiler;
     213*       - steady state reboiler (thermosyphon);
     214*       - a dynamic condenser without subcooling;
    278215*       - a splitter which separate reflux and distillate;
    279216*       - a pump in reflux stream.
    280217*
    281218* ------------------------------------------------------------------*#
    282 Model Distillation_kettle_subcooling
    283         PARAMETERS
    284 ext PP as CalcObject;
    285 ext NComp as Integer;
    286         NTrays as Integer(Brief="Number of trays", Default=2);
    287         topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
    288         top as Integer(Brief="Number of top tray");
    289         bot as Integer(Brief="Number of bottom tray");
    290 
    291         SET
    292         top = (NTrays-1)*(1-topdown)/2+1;
    293         bot = NTrays/top;
    294        
    295         VARIABLES
    296         trays(NTrays) as tray;
    297         cond as condenserSteady;
    298         reb as reboiler;
    299         ttop as tank_cylindrical;
     219Model Distillation_thermosyphon_cond
     220        PARAMETERS
     221ext PP as CalcObject;
     222ext NComp as Integer;
     223        NTrays as Integer(Brief="Number of trays", Default=2);
     224        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
     225        top as Integer(Brief="Number of top tray");
     226        bot as Integer(Brief="Number of bottom tray");
     227
     228        SET
     229        top = (NTrays-1)*(1-topdown)/2+1;
     230        bot = NTrays/top;
     231       
     232        VARIABLES
     233        trays(NTrays) as tray;
     234        cond as condenser;
     235        reb as reboilerSteady;
     236        tbottom as tank;
     237        spbottom as splitter;
    300238        sptop as splitter;
    301239        pump1 as pump;
     
    312250
    313251        "Pressure Drop through the tray"
    314         trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/"Pa"))/2 *
     252        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)))/2 *
     253                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
     254                cond.OutletL.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
     255               
     256        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
     257            (trays([top+topdown:topdown:bot]).OutletV.P -
     258            trays([top+topdown:topdown:bot]).InletL.P)))/2 *
     259            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
     260            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
     261                trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") /
     262            (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV));
     263                       
     264        CONNECTIONS
     265        #vapor
     266        reb.OutletV to trays(bot).InletV;
     267        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
     268        trays(top).OutletV to cond.InletV;
     269       
     270        #liquid
     271        cond.OutletL to sptop.Inlet;   
     272        sptop.Outlet2 to pump1.Inlet;
     273        pump1.Outlet to trays(top).InletL;
     274        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
     275        trays(bot).OutletL to tbottom.Inlet;
     276        tbottom.Outlet to spbottom.Inlet;
     277        spbottom.Outlet2 to reb.InletL;
     278end
     279
     280
     281#* -------------------------------------------------------------------
     282* Distillation Column model with:
     283*
     284*       - NTrays like tray;
     285*       - a vessel in the bottom of column;
     286*       - a splitter who separate the bottom product and the stream to reboiler;
     287*       - steady state reboiler (thermosyphon) with partial vaporization;
     288*       - a dynamic condenser without subcooling;
     289*       - a splitter which separate reflux and distillate;
     290*       - a pump in reflux stream.
     291*
     292* ------------------------------------------------------------------*#
     293Model Distillation_thermosyphon_partial_cond
     294        PARAMETERS
     295ext PP as CalcObject;
     296ext NComp as Integer;
     297        NTrays as Integer(Brief="Number of trays", Default=2);
     298        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
     299        top as Integer(Brief="Number of top tray");
     300        bot as Integer(Brief="Number of bottom tray");
     301
     302        SET
     303        top = (NTrays-1)*(1-topdown)/2+1;
     304        bot = NTrays/top;
     305
     306        VARIABLES
     307        trays(NTrays) as tray;
     308        cond as condenser;
     309        reb as reboilerSteady_partial;
     310        mix as mixer_phase;
     311        tbottom as tank;
     312        spbottom as splitter;
     313        sptop as splitter;
     314        pump1 as pump;
     315
     316        SET
     317        mix.Npres = 1;
     318
     319        EQUATIONS
     320
     321        if (reb.OutletV.P > reb.InletL.P) then
     322                "Pressure Drop through the reboiler"
     323                reb.InletL.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P)
     324                                / (trays(bot).beta*reb.rho) );
     325        else
     326                "No flow in reboiler"
     327                reb.InletL.F = 0.0 * "mol/s";
     328        end
     329
     330        if trays(1).vV > 0 then
     331                "Pressure Drop through the tray"
     332                trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)))/2 *
     333                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
     334                cond.OutletL.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
     335        else
     336                "Pressure Drop through the tray"
     337                trays(top).OutletV.F = 0;
     338        end
     339       
     340        for i in [top+topdown:topdown:bot]
     341                if trays(i).vV > 0 then
     342                        trays(i).OutletV.F = (1 + tanh(1 * (trays(i).OutletV.P - trays(i).InletL.P)))/2 *
     343                        trays(i).Ah/trays(i).vV * sqrt(2*(trays(i).OutletV.P -
     344                        trays(i).InletL.P + 1e-8 * "atm") / (trays(i).alfa*trays(i).rhoV));
     345                else
     346                        trays(i).OutletV.F = 0;
     347                end
     348        end
     349       
     350        CONNECTIONS
     351        #vapor
     352        reb.OutletV to trays(bot).InletV;
     353        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
     354        trays(top).OutletV to cond.InletV;
     355       
     356        #liquid
     357        cond.OutletL to sptop.Inlet;   
     358        sptop.Outlet2 to pump1.Inlet;
     359        pump1.Outlet to trays(top).InletL;
     360        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
     361#       trays(bot).OutletL to tbottom.Inlet;
     362        trays(bot).OutletL to mix.Inlet_mixer(1);
     363        reb.OutletL to mix.Inlet_mixer(2);
     364        mix.Outlet to tbottom.Inlet;
     365        tbottom.Outlet to spbottom.Inlet;
     366        spbottom.Outlet2 to reb.InletL;
     367end
     368
     369
     370#* -------------------------------------------------------------------
     371* Distillation Column model with:
     372*
     373*       - NTrays like tray;
     374*       - a kettle reboiler;
     375*       - a steady state condenser with subcooling;
     376*       - a vessel drum (layed cilinder);
     377*       - a splitter which separate reflux and distillate;
     378*       - a pump in reflux stream.
     379*
     380* ------------------------------------------------------------------*#
     381Model Distillation_kettle_subcooling
     382        PARAMETERS
     383ext PP as CalcObject;
     384ext NComp as Integer;
     385        NTrays as Integer(Brief="Number of trays", Default=2);
     386        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
     387        top as Integer(Brief="Number of top tray");
     388        bot as Integer(Brief="Number of bottom tray");
     389
     390        SET
     391        top = (NTrays-1)*(1-topdown)/2+1;
     392        bot = NTrays/top;
     393       
     394        VARIABLES
     395        trays(NTrays) as tray;
     396        cond as condenserSteady;
     397        reb as reboiler;
     398        ttop as tank_cylindrical;
     399        sptop as splitter;
     400        pump1 as pump;
     401
     402        EQUATIONS
     403        if (reb.OutletV.P > reb.InletL.P) then
     404                "Pressure Drop through the reboiler"
     405                reb.OutletV.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P)
     406                                / (trays(bot).beta*reb.rhoV) );
     407        else
     408                "No flow in reboiler"
     409                reb.OutletV.F = 0.0 * "mol/s";
     410        end
     411
     412        "Pressure Drop through the tray"
     413        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)))/2 *
    315414                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
    316415                ttop.Outlet.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
     
    318417        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
    319418            (trays([top+topdown:topdown:bot]).OutletV.P -
    320             trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
     419            trays([top+topdown:topdown:bot]).InletL.P)))/2 *
    321420            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
    322421            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
     
    368467        EQUATIONS
    369468        "Pressure Drop through the tray"
    370         trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/"Pa"))/2 *
     469        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)))/2 *
    371470                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
    372471                cond.OutletL.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
     
    374473        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
    375474            (trays([top+topdown:topdown:bot]).OutletV.P -
    376             trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
     475            trays([top+topdown:topdown:bot]).InletL.P)))/2 *
    377476            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
    378477            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
     
    425524        EQUATIONS
    426525        "Pressure Drop through the tray"
    427         trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/"Pa"))/2 *
     526        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)))/2 *
    428527                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
    429528                ttop.Outlet.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
     
    431530        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
    432531            (trays([top+topdown:topdown:bot]).OutletV.P -
    433             trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
     532            trays([top+topdown:topdown:bot]).InletL.P)))/2 *
    434533            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
    435534            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
     
    479578        EQUATIONS
    480579        "Pressure Drop through the tray"
    481         trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/"Pa"))/2 *
     580        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)))/2 *
    482581                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
    483582                cond.OutletL.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
     
    485584        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
    486585            (trays([top+topdown:topdown:bot]).OutletV.P -
    487             trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
     586            trays([top+topdown:topdown:bot]).InletL.P)))/2 *
    488587            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
    489588            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
     
    536635        EQUATIONS
    537636        "Pressure Drop through the tray"
    538         trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/"Pa"))/2 *
     637        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)))/2 *
    539638                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
    540639                ttop.Outlet.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
     
    542641        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
    543642            (trays([top+topdown:topdown:bot]).OutletV.P -
    544             trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
     643            trays([top+topdown:topdown:bot]).InletL.P)))/2 *
    545644            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
    546645            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
     
    590689        EQUATIONS
    591690        "Pressure Drop through the tray"
    592         trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/"Pa"))/2 *
     691        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)))/2 *
    593692                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
    594693                cond.OutletL.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
     
    596695        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
    597696            (trays([top+topdown:topdown:bot]).OutletV.P -
    598             trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
     697            trays([top+topdown:topdown:bot]).InletL.P)))/2 *
    599698            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
    600699            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
     
    648747        EQUATIONS
    649748        "Pressure Drop through the tray"
    650         trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/"Pa"))/2 *
     749        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)))/2 *
    651750                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
    652751                ttop.Outlet.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
     
    654753        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
    655754            (trays([top+topdown:topdown:bot]).OutletV.P -
    656             trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
     755            trays([top+topdown:topdown:bot]).InletL.P)))/2 *
    657756            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
    658757            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
     
    711810        trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 *
    712811            (trays([top:topdown:bot]).OutletV.P -
    713             trays([top:topdown:bot]).InletL.P)/"Pa"))/2 *
     812            trays([top:topdown:bot]).InletL.P)))/2 *
    714813            trays([top:topdown:bot]).Ah/trays([top:topdown:bot]).vV *
    715814            sqrt(2*(trays([top:topdown:bot]).OutletV.P -
     
    769868        trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 *
    770869            (trays([top:topdown:bot]).OutletV.P -
    771             trays([top:topdown:bot]).InletL.P)/"Pa"))/2 *
     870            trays([top:topdown:bot]).InletL.P)))/2 *
    772871            trays([top:topdown:bot]).Ah/trays([top:topdown:bot]).vV *
    773872            sqrt(2*(trays([top:topdown:bot]).OutletV.P -
     
    816915                "Pressure Drop through the tray"
    817916                reb.OutletV.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P)
    818                                 / (trays(bot).beta*reb.rhoV) );
     917                                / (trays(bot).beta*reb.rhoV) ); # para o modelo com 25 pratos, o beta do refervedor é 0.8. Para a coluna com 80, o beta é:1.3
    819918        else
    820919                "Prato selado"
     
    825924        trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 *
    826925            (trays([top:topdown:bot]).OutletV.P -
    827             trays([top:topdown:bot]).InletL.P)/"Pa"))/2 *
     926            trays([top:topdown:bot]).InletL.P)))/2 *
    828927            trays([top:topdown:bot]).Ah/trays([top:topdown:bot]).vV *
    829928            sqrt(2*(trays([top:topdown:bot]).OutletV.P -
     
    874973                "Pressure Drop through the tray"
    875974                reb.OutletV.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P)
    876                                 / (trays(bot).beta*reb.rhoV) );
     975                                / (trays(bot).beta*reb.rhoV) ); # para o modelo com 25 pratos, o beta do refervedor é 0.8. Para a coluna com 80, o beta é:1.3
    877976        else
    878977                "Prato selado"
     
    883982        trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 *
    884983            (trays([top:topdown:bot]).OutletV.P -
    885             trays([top:topdown:bot]).InletL.P)/"Pa"))/2 *
     984            trays([top:topdown:bot]).InletL.P)))/2 *
    886985            trays([top:topdown:bot]).Ah/trays([top:topdown:bot]).vV *
    887986            sqrt(2*(trays([top:topdown:bot]).OutletV.P -
     
    900999        spbottom.Outlet2 to reb.InletL;
    9011000end
    902 
    903 # Reactive Distillation!!
    904 Model ReactiveDistillation
    905         PARAMETERS
    906 ext PP as CalcObject;
    907 ext NComp as Integer;
    908         NTrays as Integer(Brief="Number of trays", Default=2);
    909        
    910         VARIABLES
    911         trays(NTrays) as trayReact;
    912         cond as condenserReact;
    913         reb as reboilerReact;
    914         sp as splitter;
    915         p as pump;
    916        
    917         EQUATIONS
    918         if ( reb.OutletV.P > 1 * "atm" ) then
    919                 "Pressure Drop through the tray"
    920                 reb.OutletV.F = trays(1).Ah/reb.vV * sqrt((reb.OutletV.P - 1*"atm") / (0.15*reb.rhoV) );
    921         else
    922                 "Prato selado"
    923                 reb.OutletV.F = 0.0 * "mol/s";
    924         end
    925        
    926         CONNECTIONS
    927         #vapor
    928         reb.OutletV to trays([NTrays]).InletV;
    929         trays([2:NTrays]).OutletV to trays([1:NTrays-1]).InletV;
    930         trays(1).OutletV to cond.InletV;
    931 
    932         #liquid
    933         cond.OutletL to sp.Inlet;       
    934         sp.Outlet2 to p.Inlet;
    935         p.Outlet to trays(1).InletL;
    936         trays([1:NTrays-1]).OutletL to trays([2:NTrays]).InletL;
    937         trays(NTrays).OutletL to reb.InletL;
    938 end
Note: See TracChangeset for help on using the changeset viewer.