Ignore:
Timestamp:
Mar 7, 2007, 1:53:12 PM (17 years ago)
Author:
Rodolfo Rodrigues
Message:

Updated reactor samples for the new language

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/newlanguage/sample/reactors/fogler/chap2/series_reactors.mso

    r178 r188  
    5858
    5959Model stream
    60 
    61 PARAMETERS
     60        PARAMETERS
    6261        NComp   as Integer      (Brief="Number of components", Default=1);
    63 
    64 VARIABLES
    65         F(NComp)        as flow_mol     (Brief="Molar flow", Unit='mol/s');
    66         X(NComp)        as fraction     (Brief="Molar conversion");
    67 
    68 end
     62        VARIABLES
     63        F(NComp)as flow_mol     (Brief="Molar flow", DisplayUnit='mol/s');
     64        X(NComp)as fraction     (Brief="Molar conversion");
     65end
     66
    6967
    7068#*---------------------------------------------------------------------
     
    7371
    7472Model cstr     
    75 
    76 VARIABLES
    77 
    78 in              Inlet           as stream       (Brief="Inlet stream");
    79 out     Outlet  as stream       (Brief="Outlet stream");
    80        
    81         r        as reaction_mol        (Brief="Rate of reaction", Unit='mol/l/s');
    82         V   as volume                   (Brief="Volume", Unit='l', Upper=2e3);
    83 
    84 EQUATIONS
    85 
    86 "Component molar balance"
     73        VARIABLES
     74in      Inlet   as stream; # Inlet stream
     75out     Outlet  as stream; # Outlet stream
     76        r               as reaction_mol(Brief="Rate of reaction", DisplayUnit='mol/l/s');
     77        V       as volume          (Brief="Volume", DisplayUnit='l', Upper=2e3);
     78
     79        EQUATIONS
     80        "Component molar balance"
    8781        Inlet.F - Outlet.F = (-r)*V;
    8882       
    89 "Outlet molar flow"
     83        "Outlet molar flow"
    9084        Outlet.F = Inlet.F*(1 - Outlet.X);
    91 
    9285end
    9386
     
    9891
    9992Model pfr
    100 
    101 VARIABLES
    102 in              Inlet           as stream       (Brief="Inlet stream");
    103 out     Outlet  as stream       (Brief="Outlet stream");
    104        
    105         V  as volume                    (Brief="Volume", Unit='l', Upper=2e3);
    106         r       as reaction_mol (Brief="Rate of reaction", Unit='mol/l/s');
    107        
    108 EQUATIONS
    109 
    110 "Molar balance"
    111         diff(V) = Inlet.F/(-r)*'1/s';
    112 
    113 "Change time in X"
    114         Outlet.X = time*'1/s';
     93        VARIABLES
     94in      Inlet   as stream; # Inlet stream
     95out     Outlet  as stream; # Outlet stream
     96        V       as volume          (Brief="Volume", DisplayUnit='l', Upper=2e3);
     97        r               as reaction_mol(Brief="Rate of reaction", DisplayUnit='mol/l/s');
     98       
     99        EQUATIONS
     100        "Molar balance"
     101        diff(V) = Inlet.F/(-r)/'s';
     102
     103        "Change time in X"
     104        Outlet.X = time/'s';
    115105       
    116106        "Molar flow"
     
    130120in      Inlet   as stream; # Inlet stream
    131121out     Outlet  as stream; # Outlet stream
    132         V(N)    as volume           (Brief="Volume", Unit='l', Upper=2e3);
     122        V(N)    as volume           (Brief="Volume", DisplayUnit='l', Upper=2e3);
    133123        X(N)    as fraction             (Brief="Molar conversion");
    134124        dx      as fraction     (Brief="Conversion increment");
    135         r(N)    as reaction_mol (Brief="Rate of reaction", Unit='mol/l/s');
    136         F(N)    as flow_mol             (Brief="Molar flow", Unit='mol/s');
     125        r(N)    as reaction_mol (Brief="Rate of reaction", DisplayUnit='mol/l/s');
     126        F(N)    as flow_mol             (Brief="Molar flow", DisplayUnit='mol/s');
    137127       
    138128        EQUATIONS
     
    165155        PARAMETERS
    166156        R       as Real                 (Brief="Universal gas constant", Unit='atm*l/mol/K', Default=0.082);
    167         T       as temperature  (Brief="Temperatura in the reactor", Unit='K');
    168         P       as pressure             (Brief="Pressure in the reactor", Unit='atm');
     157        T       as temperature  (Brief="Temperatura in the reactor");
     158        P       as pressure             (Brief="Pressure in the reactor");
    169159        zin     as fraction             (Brief="Inlet molar fraction");
    170160        v0  as flow_vol         (Brief="Volumetric flow");
    171161       
    172162        VARIABLES
    173         Vt      as volume               (Brief="Total reactor volume", Unit='l');
     163        Vt      as volume               (Brief="Total reactor volume", DisplayUnit='l');
    174164       
    175165        DEVICES
     
    212202
    213203FlowSheet pfr_sample
    214 
    215 DEVICES
    216         Inlet   as stream;
     204        DEVICES
     205        Inlet   as stream; # Inlet stream
    217206        R1              as pfr;
    218207       
    219 CONNECTIONS
     208        CONNECTIONS
    220209        Inlet   to R1.Inlet;
    221210       
    222 EQUATIONS
    223 
    224 "Rate of reaction"
     211        EQUATIONS
     212        "Rate of reaction"
    225213        (-R1.r) = (0.0092*R1.Outlet.X^3 - 0.0153*R1.Outlet.X^2 + 0.0013*R1.Outlet.X + 0.0053)*'mol/l/s';
    226214       
    227 SPECIFY
    228 
    229 "Inlet molar flow"
     215        SPECIFY
     216        "Inlet molar flow"
    230217        Inlet.F = 0.866541*'mol/s';
    231 
    232 "Inlet conversion"
     218        "Inlet conversion"
    233219        Inlet.X = 0.0;
    234220       
    235 INITIAL
    236 
    237 "Reactor volume"
     221        INITIAL
     222        "Reactor volume"
    238223        R1.V    = 0.0*'l';
    239224       
    240 OPTIONS
    241        
    242         Dynamic         = true;
    243         TimeStep        = 0.004;
    244         TimeEnd         = 0.8;
    245         TimeUnit        = 's';
    246        
     225        OPTIONS
     226        TimeStep = 0.004;
     227        TimeEnd = 0.8;
    247228end
    248229
     
    254235FlowSheet pfr_d_sample
    255236        VARIABLES
    256         Vt              as volume       (Brief="Total reactor volume", Unit='l');
     237        Vt              as volume       (Brief="Total reactor volume", DisplayUnit='l');
    257238       
    258239        DEVICES
     
    295276FlowSheet comparative
    296277        VARIABLES
    297         V_cstr  as volume       (Brief="CSTR volume");
    298         V_pfr   as volume       (Brief="PFR volume", Unit='l');
     278        V_cstr  as volume       (Brief="CSTR volume", DisplayUnit='l');
     279        V_pfr   as volume       (Brief="PFR volume", DisplayUnit='l');
    299280       
    300281        DEVICES
     
    346327FlowSheet cstr_cstr
    347328        VARIABLES
    348         V1              as volume       (Brief="1st reactor volume", Unit='l');
    349         V2              as volume       (Brief="2nd reactor volume", Unit='l');
    350         Vt              as volume       (Brief="Total reactor volumes", Unit='l');
    351        
    352         DEVICES
    353         Inlet   as stream;
     329        V1              as volume       (Brief="1st reactor volume", DisplayUnit='l');
     330        V2              as volume       (Brief="2nd reactor volume", DisplayUnit='l');
     331        Vt              as volume       (Brief="Total reactor volumes", DisplayUnit='l');
     332       
     333        DEVICES
     334        Inlet   as stream; # Inlet stream
    354335        R1              as cstr;
    355336        R2              as cstr;
     
    384365       
    385366        OPTIONS
    386         Dynamic=false;
    387        
     367        Dynamic = false;
    388368end
    389369
     
    395375FlowSheet pfr_pfr
    396376        VARIABLES
    397         V1              as volume       (Brief="1st reactor volume", Unit='l');
    398         V2              as volume       (Brief="2nd reactor volume", Unit='l');
    399         Vt              as volume       (Brief="Total reactor volumes", Unit='l');
    400        
    401         DEVICES
    402         Inlet   as stream;
     377        V1              as volume       (Brief="1st reactor volume", DisplayUnit='l');
     378        V2              as volume       (Brief="2nd reactor volume", DisplayUnit='l');
     379        Vt              as volume       (Brief="Total reactor volumes", DisplayUnit='l');
     380       
     381        DEVICES
     382        Inlet   as stream; # Inlet stream
    403383        R1              as pfr_d;
    404384        R2              as pfr_d;
     
    448428FlowSheet pfr_cstr
    449429        VARIABLES
    450         V1              as volume       (Brief="1st reactor volume", Unit='l');
    451         V2              as volume       (Brief="2nd reactor volume", Unit='l');
    452         Vt              as volume       (Brief="Total reactor volumes", Unit='l');
    453        
    454         DEVICES
    455         Inlet   as stream;
     430        V1              as volume       (Brief="1st reactor volume", DisplayUnit='l');
     431        V2              as volume       (Brief="2nd reactor volume", DisplayUnit='l');
     432        Vt              as volume       (Brief="Total reactor volumes", DisplayUnit='l');
     433       
     434        DEVICES
     435        Inlet   as stream; # Inlet stream
    456436        R1              as pfr_d;
    457437        R2              as cstr;
     
    492472       
    493473        OPTIONS
    494         Dynamic= false;
     474        Dynamic = false;
    495475end
    496476
     
    502482FlowSheet cstr_pfr
    503483        VARIABLES
    504         V1              as volume       (Brief="1st reactor volume", Unit='l');
    505         V2              as volume       (Brief="2nd reactor volume", Unit='l');
    506         Vt              as volume       (Brief="Total reactor volumes", Unit='l');
     484        V1              as volume       (Brief="1st reactor volume", DisplayUnit='l');
     485        V2              as volume       (Brief="2nd reactor volume", DisplayUnit='l');
     486        Vt              as volume       (Brief="Total reactor volumes", DisplayUnit='l');
    507487       
    508488        DEVICES
Note: See TracChangeset for help on using the changeset viewer.