Changeset 37


Ignore:
Timestamp:
Oct 23, 2006, 1:47:17 PM (16 years ago)
Author:
Paula Bettio Staudt
Message:

Fixed warning and error messages

Location:
mso
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • mso/eml/controllers/lead_lag.mso

    r1 r37  
    3939
    4040        INITIAL
    41         diff(aux)=0;
     41        diff(aux)= 0 * "1/s";
    4242       
    4343end
  • mso/eml/pressure_changers/valve.mso

    r1 r37  
    4040        x as fraction (Brief="Plug Position");
    4141        rho as dens_mass (Brief="Fluid Density", Default=1e3);
     42        v as vol_mol (Brief="Specific volume", Default=1e3);
    4243
    4344        PARAMETERS
     
    6061                (1-Inlet.v)*PP.LiquidDensity((Inlet.T+Outlet.T)/2, (Inlet.P+Outlet.P)/2, Outlet.z);
    6162
     63        "Volume"
     64        v = Inlet.v*PP.VapourVolume((Inlet.T+Outlet.T)/2, (Inlet.P+Outlet.P)/2, Outlet.z) +
     65                (1-Inlet.v)*PP.LiquidVolume((Inlet.T+Outlet.T)/2, (Inlet.P+Outlet.P)/2, Outlet.z);
     66
    6267        #if Inlet.P > Outlet.P then
    6368        #       "Flow"
    64                 Outlet.F = k*x*sqrt((Inlet.P - Outlet.P)*rho_ref / rho );
     69                Outlet.F * v = k*x*sqrt((Inlet.P - Outlet.P)*rho_ref / rho ) ;
    6570        #else
    6671        #       "Closed"
  • mso/eml/stage_separators/column.mso

    r6 r37  
    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 -
     
    175175
    176176        "Pressure Drop through the tray"
    177         trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)))/2 *
     177        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/"Pa"))/2 *
    178178                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
    179179                ttop.Outlet.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
     
    181181        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
    182182            (trays([top+topdown:topdown:bot]).OutletV.P -
    183             trays([top+topdown:topdown:bot]).InletL.P)))/2 *
     183            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
    184184            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
    185185            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
     
    250250
    251251        "Pressure Drop through the tray"
    252         trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)))/2 *
     252        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/"Pa"))/2 *
    253253                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
    254254                cond.OutletL.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
     
    256256        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
    257257            (trays([top+topdown:topdown:bot]).OutletV.P -
    258             trays([top+topdown:topdown:bot]).InletL.P)))/2 *
     258            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
    259259            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
    260260            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
     
    277277        spbottom.Outlet2 to reb.InletL;
    278278end
    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 * ------------------------------------------------------------------*#
    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 
    369279
    370280#* -------------------------------------------------------------------
     
    411321
    412322        "Pressure Drop through the tray"
    413         trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)))/2 *
     323        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/"Pa"))/2 *
    414324                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
    415325                ttop.Outlet.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
     
    417327        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
    418328            (trays([top+topdown:topdown:bot]).OutletV.P -
    419             trays([top+topdown:topdown:bot]).InletL.P)))/2 *
     329            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
    420330            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
    421331            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
     
    467377        EQUATIONS
    468378        "Pressure Drop through the tray"
    469         trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)))/2 *
     379        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/"Pa"))/2 *
    470380                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
    471381                cond.OutletL.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
     
    473383        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
    474384            (trays([top+topdown:topdown:bot]).OutletV.P -
    475             trays([top+topdown:topdown:bot]).InletL.P)))/2 *
     385            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
    476386            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
    477387            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
     
    524434        EQUATIONS
    525435        "Pressure Drop through the tray"
    526         trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)))/2 *
     436        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/"Pa"))/2 *
    527437                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
    528438                ttop.Outlet.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
     
    530440        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
    531441            (trays([top+topdown:topdown:bot]).OutletV.P -
    532             trays([top+topdown:topdown:bot]).InletL.P)))/2 *
     442            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
    533443            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
    534444            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
     
    578488        EQUATIONS
    579489        "Pressure Drop through the tray"
    580         trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)))/2 *
     490        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/"Pa"))/2 *
    581491                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
    582492                cond.OutletL.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
     
    584494        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
    585495            (trays([top+topdown:topdown:bot]).OutletV.P -
    586             trays([top+topdown:topdown:bot]).InletL.P)))/2 *
     496            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
    587497            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
    588498            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
     
    635545        EQUATIONS
    636546        "Pressure Drop through the tray"
    637         trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)))/2 *
     547        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/"Pa"))/2 *
    638548                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
    639549                ttop.Outlet.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
     
    641551        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
    642552            (trays([top+topdown:topdown:bot]).OutletV.P -
    643             trays([top+topdown:topdown:bot]).InletL.P)))/2 *
     553            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
    644554            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
    645555            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
     
    689599        EQUATIONS
    690600        "Pressure Drop through the tray"
    691         trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)))/2 *
     601        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/"Pa"))/2 *
    692602                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
    693603                cond.OutletL.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
     
    695605        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
    696606            (trays([top+topdown:topdown:bot]).OutletV.P -
    697             trays([top+topdown:topdown:bot]).InletL.P)))/2 *
     607            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
    698608            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
    699609            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
     
    747657        EQUATIONS
    748658        "Pressure Drop through the tray"
    749         trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)))/2 *
     659        trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/"Pa"))/2 *
    750660                trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P -
    751661                ttop.Outlet.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));
     
    753663        trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 *
    754664            (trays([top+topdown:topdown:bot]).OutletV.P -
    755             trays([top+topdown:topdown:bot]).InletL.P)))/2 *
     665            trays([top+topdown:topdown:bot]).InletL.P)/"Pa"))/2 *
    756666            trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV *
    757667            sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P -
     
    810720        trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 *
    811721            (trays([top:topdown:bot]).OutletV.P -
    812             trays([top:topdown:bot]).InletL.P)))/2 *
     722            trays([top:topdown:bot]).InletL.P)/"Pa"))/2 *
    813723            trays([top:topdown:bot]).Ah/trays([top:topdown:bot]).vV *
    814724            sqrt(2*(trays([top:topdown:bot]).OutletV.P -
     
    868778        trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 *
    869779            (trays([top:topdown:bot]).OutletV.P -
    870             trays([top:topdown:bot]).InletL.P)))/2 *
     780            trays([top:topdown:bot]).InletL.P)/"Pa"))/2 *
    871781            trays([top:topdown:bot]).Ah/trays([top:topdown:bot]).vV *
    872782            sqrt(2*(trays([top:topdown:bot]).OutletV.P -
     
    915825                "Pressure Drop through the tray"
    916826                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
     827                                / (trays(bot).beta*reb.rhoV) );
    918828        else
    919829                "Prato selado"
     
    924834        trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 *
    925835            (trays([top:topdown:bot]).OutletV.P -
    926             trays([top:topdown:bot]).InletL.P)))/2 *
     836            trays([top:topdown:bot]).InletL.P)/"Pa"))/2 *
    927837            trays([top:topdown:bot]).Ah/trays([top:topdown:bot]).vV *
    928838            sqrt(2*(trays([top:topdown:bot]).OutletV.P -
     
    973883                "Pressure Drop through the tray"
    974884                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
     885                                / (trays(bot).beta*reb.rhoV) );
    976886        else
    977887                "Prato selado"
     
    982892        trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 *
    983893            (trays([top:topdown:bot]).OutletV.P -
    984             trays([top:topdown:bot]).InletL.P)))/2 *
     894            trays([top:topdown:bot]).InletL.P)/"Pa"))/2 *
    985895            trays([top:topdown:bot]).Ah/trays([top:topdown:bot]).vV *
    986896            sqrt(2*(trays([top:topdown:bot]).OutletV.P -
  • mso/eml/stage_separators/tray.mso

    r1 r37  
    134134        if (Level > (beta * hw)) then
    135135                "Francis Equation"
    136                 OutletL.F = 1.84*lw*((Level-(beta*hw))/(beta))^1.5/vL;
     136                OutletL.F = 1.84*"m^0.5/s"*lw*((Level-(beta*hw))/(beta))^1.5/vL;
    137137        else
    138138                "Low level"
  • mso/sample/controllers/CSTR_noniso_pid.mso

    r34 r37  
    168168        OPTIONS
    169169        time = [0:0.1:1 1:1:100] * "h";
    170         outputLevel = "high";
    171170end
  • mso/sample/controllers/Sample_flash_pid.mso

    r29 r37  
    151151        OPTIONS
    152152        relativeAccuracy = 1e-6;
    153         time = [0:100:7000 7000:0.10:8150 8150:100:10000];
     153        #time = [0:100:7000 7000:0.10:8150 8150:100:10000];
     154        time = [0:100:10000];
    154155end
    155156
  • mso/sample/mixers_splitters/sample_sepComp.mso

    r33 r37  
    1 
    2 
    31using "mixers_splitters/sepComp";
    42
  • mso/sample/stage_separators/sample_batch_dist.mso

    r33 r37  
    11using "stage_separators/batch_dist";
    2 
    32
    43FlowSheet TesteBatch
     
    5554       
    5655        OPTIONS
    57         relativeAccuracy = 1e-5;
    58        
     56        relativeAccuracy = 1e-3;
    5957        time = [0:0.1:20]*"min";
    6058end
Note: See TracChangeset for help on using the changeset viewer.