Ignore:
File:
1 edited

Legend:

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

    r6 r46  
    5050        trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 *
    5151            (trays([top:topdown:bot]).OutletV.P -
    52             trays([top:topdown:bot]).InletL.P)))/2 *
     52            trays([top:topdown:bot]).InletL.P)/"Pa"))/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)))/2 *
     103        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/"Pa"))/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)))/2 *
     109            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/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;
     195end
     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* ------------------------------------------------------------------*#
     210Model Distillation_thermosyphon_cond
     211        PARAMETERS
     212ext PP as CalcObject;
     213ext 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;
    162228        spbottom as splitter;
    163229        sptop as splitter;
     
    175241
    176242        "Pressure Drop through the tray"
    177         trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)))/2 *
     243        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/"Pa"))/2 *
    178244                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
    179                 ttop.Outlet.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
     245                cond.OutletL.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
    180246               
    181247        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
    182248            (trays([top+topdown:topdown:bot]).OutletV.P -
    183             trays([top+topdown:topdown:bot]).InletL.P)))/2 *
     249            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
    184250            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
    185251            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
    186252                trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") /
    187253            (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV));
    188        
     254                       
    189255        CONNECTIONS
    190256        #vapor
     
    194260       
    195261        #liquid
    196         cond.OutletL to ttop.Inlet;     
    197         ttop.Outlet to sptop.Inlet;
    198         sptop.Outlet2 to pump1.Inlet;   
     262        cond.OutletL to sptop.Inlet;   
     263        sptop.Outlet2 to pump1.Inlet;
    199264        pump1.Outlet to trays(top).InletL;
    200265        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
     
    204269end
    205270
    206 
    207271#* -------------------------------------------------------------------
    208272* Distillation Column model with:
    209273*
    210274*       - NTrays like tray;
    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;
     275*       - a kettle reboiler;
     276*       - a steady state condenser with subcooling;
     277*       - a vessel drum (layed cilinder);
    215278*       - a splitter which separate reflux and distillate;
    216279*       - a pump in reflux stream.
    217280*
    218281* ------------------------------------------------------------------*#
    219 Model Distillation_thermosyphon_cond
    220         PARAMETERS
    221 ext PP as CalcObject;
    222 ext 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;
     282Model Distillation_kettle_subcooling
     283        PARAMETERS
     284ext PP as CalcObject;
     285ext 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;
    238300        sptop as splitter;
    239301        pump1 as pump;
     
    250312
    251313        "Pressure Drop through the tray"
    252         trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)))/2 *
     314        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/"Pa"))/2 *
     315                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
     316                ttop.Outlet.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
     317               
     318        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
     319            (trays([top+topdown:topdown:bot]).OutletV.P -
     320            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
     321            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
     322            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
     323                trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") /
     324            (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV));
     325       
     326        CONNECTIONS
     327        #vapor
     328        reb.OutletV to trays(bot).InletV;
     329        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
     330        trays(top).OutletV to cond.InletV;
     331       
     332        #liquid
     333        cond.OutletL to ttop.Inlet;     
     334        ttop.Outlet to sptop.Inlet;
     335        sptop.Outlet2 to pump1.Inlet;   
     336        pump1.Outlet to trays(top).InletL;
     337        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
     338        trays(bot).OutletL to reb.InletL;
     339end
     340
     341
     342#*----------------------------------------------------------------------
     343* Model of a  rectifier containing:
     344*       - NTrays like tray;
     345*       - dymamic condenser without subcooling;
     346*       - a splitter which separate reflux and distillate;
     347*       - a pump in reflux stream;
     348*---------------------------------------------------------------------*#
     349Model Rectifier
     350        PARAMETERS
     351ext PP as CalcObject;
     352ext NComp as Integer;
     353        NTrays as Integer(Brief="Number of trays", Default=2);
     354        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
     355        top as Integer(Brief="Number of top tray");
     356        bot as Integer(Brief="Number of bottom tray");
     357
     358        SET
     359        top = (NTrays-1)*(1-topdown)/2+1;
     360        bot = NTrays/top;
     361       
     362        VARIABLES
     363        trays(NTrays) as tray;
     364        cond as condenser;
     365        sptop as splitter;
     366        pump1 as pump;
     367
     368        EQUATIONS
     369        "Pressure Drop through the tray"
     370        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/"Pa"))/2 *
    253371                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
    254372                cond.OutletL.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
     
    256374        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
    257375            (trays([top+topdown:topdown:bot]).OutletV.P -
    258             trays([top+topdown:topdown:bot]).InletL.P)))/2 *
     376            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
    259377            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
    260378            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
    261379                trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") /
    262380            (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV));
    263                        
    264         CONNECTIONS
    265         #vapor
    266         reb.OutletV to trays(bot).InletV;
     381       
     382        CONNECTIONS
     383        #vapor
    267384        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
    268385        trays(top).OutletV to cond.InletV;
     
    270387        #liquid
    271388        cond.OutletL to sptop.Inlet;   
    272         sptop.Outlet2 to pump1.Inlet;
     389        sptop.Outlet2 to pump1.Inlet;   
    273390        pump1.Outlet to trays(top).InletL;
    274391        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;
    278392end
    279393
    280394
    281395#* -------------------------------------------------------------------
    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 * ------------------------------------------------------------------*#
    293 Model Distillation_thermosyphon_partial_cond
    294         PARAMETERS
    295 ext PP as CalcObject;
    296 ext 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;
    367 end
    368 
    369 
    370 #* -------------------------------------------------------------------
    371 * Distillation Column model with:
    372 *
    373 *       - NTrays like tray;
    374 *       - a kettle reboiler;
     396* Rectifier Column with:
     397*
     398*       - NTrays like tray;
    375399*       - a steady state condenser with subcooling;
    376400*       - a vessel drum (layed cilinder);
     
    379403*
    380404* ------------------------------------------------------------------*#
    381 Model Distillation_kettle_subcooling
     405Model Rectifier_subcooling
    382406        PARAMETERS
    383407ext PP as CalcObject;
     
    395419        trays(NTrays) as tray;
    396420        cond as condenserSteady;
    397         reb as reboiler;
    398421        ttop as tank_cylindrical;
    399422        sptop as splitter;
     
    401424
    402425        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 *
     426        "Pressure Drop through the tray"
     427        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/"Pa"))/2 *
    414428                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
    415429                ttop.Outlet.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
     
    417431        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
    418432            (trays([top+topdown:topdown:bot]).OutletV.P -
    419             trays([top+topdown:topdown:bot]).InletL.P)))/2 *
     433            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
    420434            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
    421435            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
     
    425439        CONNECTIONS
    426440        #vapor
    427         reb.OutletV to trays(bot).InletV;
    428441        trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
    429442        trays(top).OutletV to cond.InletV;
     
    435448        pump1.Outlet to trays(top).InletL;
    436449        trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
    437         trays(bot).OutletL to reb.InletL;
    438450end
    439451
    440452
    441453#*----------------------------------------------------------------------
    442 * Model of a  rectifier containing:
     454* Model of a  Refluxed Stripping column containing:
    443455*       - NTrays like tray;
    444456*       - dymamic condenser without subcooling;
     
    446458*       - a pump in reflux stream;
    447459*---------------------------------------------------------------------*#
    448 Model Rectifier
     460Model Refluxed_Stripping
    449461        PARAMETERS
    450462ext PP as CalcObject;
     
    467479        EQUATIONS
    468480        "Pressure Drop through the tray"
    469         trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)))/2 *
     481        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/"Pa"))/2 *
    470482                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
    471483                cond.OutletL.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
     
    473485        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
    474486            (trays([top+topdown:topdown:bot]).OutletV.P -
    475             trays([top+topdown:topdown:bot]).InletL.P)))/2 *
     487            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
    476488            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
    477489            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
     
    493505
    494506#* -------------------------------------------------------------------
    495 * Rectifier Column with:
    496 *
    497 *       - NTrays like tray;
    498 *       - a steady state condenser with subcooling;
     507* Refluxed Stripping Column with:
     508*
     509*       - NTrays like tray;
     510*       - a steady state condenser (with subcooling);
    499511*       - a vessel drum (layed cilinder);
    500512*       - a splitter which separate reflux and distillate;
     
    502514*
    503515* ------------------------------------------------------------------*#
    504 Model Rectifier_subcooling
     516Model Refluxed_Stripping_subcooling
    505517        PARAMETERS
    506518ext PP as CalcObject;
     
    524536        EQUATIONS
    525537        "Pressure Drop through the tray"
    526         trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)))/2 *
     538        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/"Pa"))/2 *
    527539                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
    528540                ttop.Outlet.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
     
    530542        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
    531543            (trays([top+topdown:topdown:bot]).OutletV.P -
    532             trays([top+topdown:topdown:bot]).InletL.P)))/2 *
     544            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
    533545            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
    534546            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
     
    551563
    552564#*----------------------------------------------------------------------
    553 * Model of a  Refluxed Stripping column containing:
     565* Model of a  Refluxed Absorption column containing:
    554566*       - NTrays like tray;
    555567*       - dymamic condenser without subcooling;
     
    557569*       - a pump in reflux stream;
    558570*---------------------------------------------------------------------*#
    559 Model Refluxed_Stripping
     571Model Refluxed_Absorption
    560572        PARAMETERS
    561573ext PP as CalcObject;
     
    578590        EQUATIONS
    579591        "Pressure Drop through the tray"
    580         trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)))/2 *
     592        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/"Pa"))/2 *
    581593                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
    582594                cond.OutletL.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
     
    584596        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
    585597            (trays([top+topdown:topdown:bot]).OutletV.P -
    586             trays([top+topdown:topdown:bot]).InletL.P)))/2 *
     598            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
    587599            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
    588600            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
     
    596608       
    597609        #liquid
    598         cond.OutletL to sptop.Inlet;   
     610        cond.OutletL to cond.InletV;   
     611        cond.OutletL to sptop.Inlet;
    599612        sptop.Outlet2 to pump1.Inlet;   
    600613        pump1.Outlet to trays(top).InletL;
     
    604617
    605618#* -------------------------------------------------------------------
    606 * Refluxed Stripping Column with:
     619* Refluxed Absorption Column with:
    607620*
    608621*       - NTrays like tray;
     
    613626*
    614627* ------------------------------------------------------------------*#
    615 Model Refluxed_Stripping_subcooling
     628Model Refluxed_Absorption_subcooling
    616629        PARAMETERS
    617630ext PP as CalcObject;
     
    635648        EQUATIONS
    636649        "Pressure Drop through the tray"
    637         trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)))/2 *
     650        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/"Pa"))/2 *
    638651                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
    639652                ttop.Outlet.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
     
    641654        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
    642655            (trays([top+topdown:topdown:bot]).OutletV.P -
    643             trays([top+topdown:topdown:bot]).InletL.P)))/2 *
    644             trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
    645             sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
    646                 trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") /
    647             (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV));
    648        
    649         CONNECTIONS
    650         #vapor
    651         trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
    652         trays(top).OutletV to cond.InletV;
    653        
    654         #liquid
    655         cond.OutletL to ttop.Inlet;     
    656         ttop.Outlet to sptop.Inlet;
    657         sptop.Outlet2 to pump1.Inlet;   
    658         pump1.Outlet to trays(top).InletL;
    659         trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
    660 end
    661 
    662 
    663 #*----------------------------------------------------------------------
    664 * Model of a  Refluxed Absorption column containing:
    665 *       - NTrays like tray;
    666 *       - dymamic condenser without subcooling;
    667 *       - a splitter which separate reflux and distillate;
    668 *       - a pump in reflux stream;
    669 *---------------------------------------------------------------------*#
    670 Model Refluxed_Absorption
    671         PARAMETERS
    672 ext PP as CalcObject;
    673 ext NComp as Integer;
    674         NTrays as Integer(Brief="Number of trays", Default=2);
    675         topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
    676         top as Integer(Brief="Number of top tray");
    677         bot as Integer(Brief="Number of bottom tray");
    678 
    679         SET
    680         top = (NTrays-1)*(1-topdown)/2+1;
    681         bot = NTrays/top;
    682        
    683         VARIABLES
    684         trays(NTrays) as tray;
    685         cond as condenser;
    686         sptop as splitter;
    687         pump1 as pump;
    688 
    689         EQUATIONS
    690         "Pressure Drop through the tray"
    691         trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)))/2 *
    692                 trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
    693                 cond.OutletL.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
    694                
    695         trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
    696             (trays([top+topdown:topdown:bot]).OutletV.P -
    697             trays([top+topdown:topdown:bot]).InletL.P)))/2 *
    698             trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
    699             sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
    700                 trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") /
    701             (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV));
    702        
    703         CONNECTIONS
    704         #vapor
    705         trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
    706         trays(top).OutletV to cond.InletV;
    707        
    708         #liquid
    709         cond.OutletL to cond.InletV;   
    710         cond.OutletL to sptop.Inlet;
    711         sptop.Outlet2 to pump1.Inlet;   
    712         pump1.Outlet to trays(top).InletL;
    713         trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
    714 end
    715 
    716 
    717 #* -------------------------------------------------------------------
    718 * Refluxed Absorption Column with:
    719 *
    720 *       - NTrays like tray;
    721 *       - a steady state condenser (with subcooling);
    722 *       - a vessel drum (layed cilinder);
    723 *       - a splitter which separate reflux and distillate;
    724 *       - a pump in reflux stream.
    725 *
    726 * ------------------------------------------------------------------*#
    727 Model Refluxed_Absorption_subcooling
    728         PARAMETERS
    729 ext PP as CalcObject;
    730 ext NComp as Integer;
    731         NTrays as Integer(Brief="Number of trays", Default=2);
    732         topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
    733         top as Integer(Brief="Number of top tray");
    734         bot as Integer(Brief="Number of bottom tray");
    735 
    736         SET
    737         top = (NTrays-1)*(1-topdown)/2+1;
    738         bot = NTrays/top;
    739        
    740         VARIABLES
    741         trays(NTrays) as tray;
    742         cond as condenserSteady;
    743         ttop as tank_cylindrical;
    744         sptop as splitter;
    745         pump1 as pump;
    746 
    747         EQUATIONS
    748         "Pressure Drop through the tray"
    749         trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)))/2 *
    750                 trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
    751                 ttop.Outlet.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
    752                
    753         trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
    754             (trays([top+topdown:topdown:bot]).OutletV.P -
    755             trays([top+topdown:topdown:bot]).InletL.P)))/2 *
     656            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
    756657            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
    757658            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
     
    810711        trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 *
    811712            (trays([top:topdown:bot]).OutletV.P -
    812             trays([top:topdown:bot]).InletL.P)))/2 *
     713            trays([top:topdown:bot]).InletL.P)/"Pa"))/2 *
    813714            trays([top:topdown:bot]).Ah/trays([top:topdown:bot]).vV *
    814715            sqrt(2*(trays([top:topdown:bot]).OutletV.P -
     
    868769        trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 *
    869770            (trays([top:topdown:bot]).OutletV.P -
    870             trays([top:topdown:bot]).InletL.P)))/2 *
     771            trays([top:topdown:bot]).InletL.P)/"Pa"))/2 *
    871772            trays([top:topdown:bot]).Ah/trays([top:topdown:bot]).vV *
    872773            sqrt(2*(trays([top:topdown:bot]).OutletV.P -
     
    915816                "Pressure Drop through the tray"
    916817                reb.OutletV.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P)
    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
     818                                / (trays(bot).beta*reb.rhoV) );
    918819        else
    919820                "Prato selado"
     
    924825        trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 *
    925826            (trays([top:topdown:bot]).OutletV.P -
    926             trays([top:topdown:bot]).InletL.P)))/2 *
     827            trays([top:topdown:bot]).InletL.P)/"Pa"))/2 *
    927828            trays([top:topdown:bot]).Ah/trays([top:topdown:bot]).vV *
    928829            sqrt(2*(trays([top:topdown:bot]).OutletV.P -
     
    973874                "Pressure Drop through the tray"
    974875                reb.OutletV.F = trays(bot).Ah/reb.vV * sqrt((reb.OutletV.P - trays(bot).OutletL.P)
    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
     876                                / (trays(bot).beta*reb.rhoV) );
    976877        else
    977878                "Prato selado"
     
    982883        trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 *
    983884            (trays([top:topdown:bot]).OutletV.P -
    984             trays([top:topdown:bot]).InletL.P)))/2 *
     885            trays([top:topdown:bot]).InletL.P)/"Pa"))/2 *
    985886            trays([top:topdown:bot]).Ah/trays([top:topdown:bot]).vV *
    986887            sqrt(2*(trays([top:topdown:bot]).OutletV.P -
     
    999900        spbottom.Outlet2 to reb.InletL;
    1000901end
     902
     903# Reactive Distillation!!
     904Model ReactiveDistillation
     905        PARAMETERS
     906ext PP as CalcObject;
     907ext 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;
     938end
Note: See TracChangeset for help on using the changeset viewer.