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

Updated reactor samples for the new language

Location:
branches/newlanguage/sample/reactors/fogler
Files:
12 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
  • branches/newlanguage/sample/reactors/fogler/chap3/equilibrium_conversion.mso

    r171 r188  
    4141*
    4242*----------------------------------------------------------------------
    43 * Author: Christiano D. Wetzel Guerra and Rodolfo Rodrigues
     43* Author: Christiano D. W. Guerra and Rodolfo Rodrigues
    4444* $Id$
    4545*--------------------------------------------------------------------*#
     
    5454Model stream
    5555        PARAMETERS
    56 outer   NComp   as Integer (Brief="Number of chemical components", Lower=1);
     56outer NComp     as Integer (Brief="Number of chemical components", Lower=1);
    5757       
    5858        VARIABLES
    59         C(NComp)as conc_mol(Brief="Concentration", Unit='kmol/l', Lower=0);
     59        C(NComp)as conc_mol(Brief="Concentration", DisplayUnit='kmol/l', Lower=0);
    6060        z(NComp)as fraction(Brief="Molar fraction");
    6161end
     
    7777        X               as fraction     (Brief="Molar conversion", Lower=0);
    7878        Kc      as Real         (Brief="Equilibrium constant", Unit='mol/l');
    79         C               as conc_mol     (Brief="Total outlet concentration", Unit='mol/l', Lower=0);
    80         Co              as conc_mol     (Brief="Total inlet concentration", Unit='mol/l', Lower=0);
    81         T               as temperature (Brief="Temperature", Unit='K');
    82         P               as pressure     (Brief="Pressure", Unit='atm');
     79        C               as conc_mol     (Brief="Total outlet concentration", DisplayUnit='mol/l', Lower=0);
     80        Co              as conc_mol     (Brief="Total inlet concentration", DisplayUnit='mol/l', Lower=0);
     81        T               as temperature (Brief="Temperature");
     82        P               as pressure     (Brief="Pressure");
    8383        Theta(NComp) as Real(Brief="Parameter Theta");
    8484       
     
    141141        X               as fraction     (Brief="Molar conversion", Lower=0);
    142142        Kc      as Real         (Brief="Equilibrium constant", Unit='mol/l');
    143         C               as conc_mol     (Brief="Total outlet concentration", Unit='mol/l', Lower=0);
    144         Co              as conc_mol     (Brief="Total inlet concentration", Unit='mol/l', Lower=0);
    145         T               as temperature (Brief="Temperatura", Unit='K');
    146         P               as pressure     (Brief="Pressure", Unit='atm');
     143        C               as conc_mol     (Brief="Total outlet concentration", DisplayUnit='mol/l', Lower=0);
     144        Co              as conc_mol     (Brief="Total inlet concentration", DisplayUnit='mol/l', Lower=0);
     145        T               as temperature (Brief="Temperatura");
     146        P               as pressure     (Brief="Pressure");
    147147        Theta(NComp) as Real(Brief="Parameter Theta");
    148148        epsilon as Real         (Brief="Parameter epsilon");
  • branches/newlanguage/sample/reactors/fogler/chap3/oxidation_of_so2.mso

    r171 r188  
    5151Model stream
    5252        PARAMETERS
    53 outer   NComp   as Integer (Brief="Number of chemical components", Lower=1);
     53outer NComp     as Integer (Brief="Number of chemical components", Lower=1);
    5454       
    5555        VARIABLES
    56         C(NComp)as conc_mol(Brief="Concentration", Unit='mol/l', Lower=0);
     56        C(NComp)as conc_mol(Brief="Concentration", DisplayUnit='mol/l', Lower=0);
    5757        z(NComp)as fraction(Brief="Molar fraction");
    5858end
     
    7171       
    7272        VARIABLES
    73         Inlet   as stream;
    74         Outlet  as stream;     
     73        Inlet   as stream; # Inlet stream
     74        Outlet  as stream; # Outlet stream     
    7575        X               as fraction     (Brief="Molar conversion", Lower=0);
    76         r               as reaction_mol (Brief="Rate of reaction of A", Unit='mol/l/s');
    77         T               as temperature  (Brief="Temperature", Unit='K');
    78         P               as pressure     (Brief="Pressure", Unit='atm');
     76        r               as reaction_mol (Brief="Rate of reaction of A", DisplayUnit='mol/l/s');
     77        T               as temperature  (Brief="Temperature");
     78        P               as pressure     (Brief="Pressure");
    7979        Theta(NComp)as Real     (Brief="Parameter Theta");
    8080        epsilon as Real         (Brief="Parameter epsilon");
     
    118118        TimeStep = 0.005;
    119119        TimeEnd = 0.995;
    120        
    121120end
  • branches/newlanguage/sample/reactors/fogler/chap4/membrane_reactor.mso

    r171 r188  
    4040*
    4141*----------------------------------------------------------------------
    42 * Author: Christiano D. Wetzel Guerra and Rodolfo Rodrigues
     42* Author: Christiano D. W. Guerra and Rodolfo Rodrigues
    4343* $Id$
    4444*--------------------------------------------------------------------*#
     
    5151        NComp   as Integer              (Brief="Number of chemical components", Lower=1);
    5252        stoic(NComp)as Real             (Brief="Stoichiometric number");
    53         Kc      as conc_mol             (Brief="Equilibrium constant", Unit='mol/l');
     53        Kc      as conc_mol             (Brief="Equilibrium constant", DisplayUnit='mol/l');
    5454        kc      as Real                 (Brief="Mass transfer coefficient", Unit='1/min');
    5555        R               as Real                 (Brief="Universal gas constant", Unit='atm*l/mol/K', Default=0.082);
    5656       
    5757        VARIABLES
    58         F(NComp)as flow_mol             (Brief="Molar flow", Unit='mol/min');
    59         C(NComp)as conc_mol             (Brief="Molar concentration", Unit='mol/l', Lower=0);
    60         r(NComp)as reaction_mol (Brief="Rate of reaction", Unit='mol/l/min');
    61         Cto             as conc_mol             (Brief="Total inlet concentration", Unit='mol/l');
     58        F(NComp)as flow_mol             (Brief="Molar flow", DisplayUnit='mol/min');
     59        C(NComp)as conc_mol             (Brief="Molar concentration", DisplayUnit='mol/l', Lower=0);
     60        r(NComp)as reaction_mol (Brief="Rate of reaction", DisplayUnit='mol/l/min');
     61        Cto             as conc_mol             (Brief="Total inlet concentration", DisplayUnit='mol/l');
    6262        k               as Real                 (Brief="Specific rate of reaction", Unit='1/min');
    63         V               as volume               (Brief="Volume", Unit='l');
     63        V               as volume               (Brief="Volume", DisplayUnit='l');
    6464       
    65         T               as temperature  (Brief="Temperatura", Unit='K');
    66         P               as pressure             (Brief="Pressure", Unit='atm');
     65        T               as temperature  (Brief="Temperatura");
     66        P               as pressure             (Brief="Pressure");
    6767
    6868        EQUATIONS
     
    107107
    108108        OPTIONS
    109         TimeStep =10;
    110         TimeEnd =500;
     109        TimeStep = 10;
     110        TimeEnd = 500;
     111        TimeUnit = 's';
    111112end
  • branches/newlanguage/sample/reactors/fogler/chap4/molarflow_pfr.mso

    r171 r188  
    5252       
    5353        VARIABLES
    54     F(NComp)as flow_mol         (Brief="Molar flow", Unit='mol/min');
    55         C(NComp)as conc_mol     (Brief="Molar concentration", Unit='mol/l');
    56         r(NComp)as reaction_mol (Brief="Reaction rate", Unit='mol/min/l');
    57         Fo(NComp) as flow_mol   (Brief="Input molar flow of A", Unit='mol/min');
    58     Ft          as flow_mol     (Brief="Total molar flow", Unit='mol/min');
    59         Cto     as conc_mol     (Brief="Initial concentration", Unit='mol/l');
    60         V               as volume               (Brief="Reactor volume", Unit='l');
     54    F(NComp)as flow_mol         (Brief="Molar flow", DisplayUnit='mol/min');
     55        C(NComp)as conc_mol     (Brief="Molar concentration", DisplayUnit='mol/l');
     56        r(NComp)as reaction_mol (Brief="Reaction rate", DisplayUnit='mol/min/l');
     57        Fo(NComp) as flow_mol   (Brief="Input molar flow of A", DisplayUnit='mol/min');
     58    Ft          as flow_mol     (Brief="Total molar flow", DisplayUnit='mol/min');
     59        Cto     as conc_mol     (Brief="Initial concentration", DisplayUnit='mol/l');
     60        V               as volume               (Brief="Reactor volume", DisplayUnit='l');
    6161       
    6262        EQUATIONS
     
    9999       
    100100        OPTIONS
    101         TimeStep=1;
    102         TimeEnd=100;
    103         DAESolver = "dassl";
     101        TimeStep = 1;
     102        TimeEnd = 100;
    104103end
  • branches/newlanguage/sample/reactors/fogler/chap4/semibatch_reactor.mso

    r181 r188  
    3838*
    3939*----------------------------------------------------------------------
    40 * Author: Christiano D. Wetzel Guerra and Rodolfo Rodrigues
     40* Author: Christiano D. W. Guerra and Rodolfo Rodrigues
    4141* $Id$
    4242*--------------------------------------------------------------------*#
     
    9898
    9999        OPTIONS
    100         TimeStep =5;
    101         TimeEnd =500;
     100        TimeStep = 5;
     101        TimeEnd = 500;
    102102end
  • branches/newlanguage/sample/reactors/fogler/chap4/spheric_reactor.mso

    r171 r188  
    4141*
    4242*----------------------------------------------------------------------
    43 * Author: Christiano D. Wetzel Guerra and Rodolfo Rodrigues
    44 * GIMSCOP/UFRGS - Group of Integration, Modeling, Simulation, Control,
    45 *                                       and Optimization of Processes
     43* Author: Christiano D. W. Guerra and Rodolfo Rodrigues
    4644* $Id$
    4745*--------------------------------------------------------------------*#
     
    5149
    5250FlowSheet spheric_reactor
    53 
    54 PARAMETERS
    55         rho_0   as dens_mass    (Brief="Initial density");
    56         Dp              as length               (Brief="Particle diameter");
    57         k_lin           as Real                         (Brief="Specific rate of reaction", Unit='m^3/kg/s');
    58         visc            as viscosity    (Brief="Flow viscosity");
    59         L               as length               (Brief="Fixed bed half length");
    60         rho_c   as dens_mass    (Brief="Catalyser density");
    61         phi             as fraction             (Brief="Fixed bed porosity");
    62         pi                      as Real                 (Brief="Number pi", Default=3.14159);
    63         R               as length               (Brief="Radius reactor");
     51        PARAMETERS
     52        rho_0 as dens_mass      (Brief="Initial density");
     53        Dp    as length         (Brief="Particle diameter");
     54        k_lin as Real           (Brief="Specific rate of reaction", Unit='m^3/kg/s');
     55        visc  as viscosity      (Brief="Flow viscosity");
     56        L     as length         (Brief="Fixed bed half length");
     57        rho_c as dens_mass      (Brief="Catalyser density");
     58        phi   as fraction       (Brief="Fixed bed porosity");
     59        pi        as Real               (Brief="Number pi", Default=3.14159);
     60        R     as length         (Brief="Radius reactor");
    6461       
    6562        VARIABLES
    6663        X     as fraction       (Brief="Molar conversion");
    6764        y     as Real           (Brief="Dimensionless pressure drop (P/P0)", Lower=0);
    68         P     as pressure       (Brief="Output pressure", Unit='kPa');
     65        P     as pressure       (Brief="Output pressure", DisplayUnit='kPa');
    6966        z         as length             (Brief="Length of reactor");
    7067        beta0 as Real           (Brief="Parameter beta0 of Ergun equation", Unit='Pa/m');
     
    7269        Ca0   as conc_mol       (Brief="Input molar concentration of A");
    7370        Fa0   as flow_mol       (Brief="Input molar flow of A");
    74         P0    as pressure       (Brief="Initial pressure", Unit='kPa');
     71        P0    as pressure       (Brief="Initial pressure", DisplayUnit='kPa');
    7572        m         as flow_mass  (Brief="Mass flow");
    7673       
     
    122119
    123120        OPTIONS
    124         TimeStep =0.1;
    125         TimeEnd =5.4;
     121        TimeStep = 0.1;
     122        TimeEnd = 5.4;
    126123end
  • branches/newlanguage/sample/reactors/fogler/chap6/hidrodesalkeletion.mso

    r171 r188  
    4040*
    4141*----------------------------------------------------------------------
    42 * Author: Christiano D. Wetzel Guerra and Rodolfo Rodrigues
     42* Author: Christiano D. W. Guerra and Rodolfo Rodrigues
    4343* $Id$
    4444*--------------------------------------------------------------------*#
     
    6464       
    6565        VARIABLES
    66         F(NComp)        as flow_mol     (Brief="Molar flow", Unit='lbmol/h');
    67         C(NComp)        as conc_mol     (Brief="Molar concentration", Lower=0, Unit='lbmol/ft^3');
    68         Co(NComp)       as conc_mol     (Brief="Input molar concentration", Lower=0, Unit='lbmol/ft^3');
     66        F(NComp)        as flow_mol     (Brief="Molar flow", DisplayUnit='lbmol/h');
     67        C(NComp)        as conc_mol     (Brief="Molar concentration", Lower=0, DisplayUnit='lbmol/ft^3');
     68        Co(NComp)       as conc_mol     (Brief="Input molar concentration", Lower=0, DisplayUnit='lbmol/ft^3');
    6969       
    70         r(NComp,NReac) as reaction_mol (Brief="Relative rate of reaction", Unit='lbmol/h/ft^3');
    71         rate(NComp)     as reaction_mol (Brief="Overall rate of reaction", Unit='lbmol/h/ft^3');
    72         tau                     as time_h               (Brief="Residence time", Unit='h');
    73         V                       as volume               (Brief="Reactor volume", Unit='ft^3');
     70        r(NComp,NReac) as reaction_mol (Brief="Relative rate of reaction", DisplayUnit='lbmol/h/ft^3');
     71        rate(NComp)     as reaction_mol (Brief="Overall rate of reaction", DisplayUnit='lbmol/h/ft^3');
     72        tau                     as time_h               (Brief="Residence time", DisplayUnit='h');
     73        V                       as volume               (Brief="Reactor volume", DisplayUnit='ft^3');
    7474
    7575        EQUATIONS
     
    105105                                # 2: X + H -> T + Me
    106106       
    107         stoic(:,1) = [-1, -1,  1, 1, 0]; # M + H -> X + Me
    108         stoic(:,2) = [ 0, -1, -1, 1, 1]; # X + H -> T + Me
     107        stoic(:,1) = [-1.0, -1.0,  1.0, 1.0, 0.0]; # M + H -> X + Me
     108        stoic(:,2) = [ 0.0, -1.0, -1.0, 1.0, 1.0]; # X + H -> T + Me
    109109       
    110110        vo= 476*'ft^3/h';
     
    119119       
    120120        OPTIONS
    121         TimeStep =0.01;
    122         TimeEnd  =0.5;
     121        TimeStep = 0.01;
     122        TimeEnd = 0.5;
    123123        TimeUnit = 'h';
    124124end
  • branches/newlanguage/sample/reactors/fogler/chap8/acetic_anhydride.mso

    r171 r188  
    5656        NComp           as Integer              (Brief="Number of components", Lower=1);
    5757        stoic(NComp)as Real                     (Brief="Stoichiometric number");
    58         Pa0             as pressure     (Brief="Input pressure of A");
     58        Pao             as pressure     (Brief="Input pressure of A");
    5959        Tr                      as temperature  (Brief="Reference temperature");
    60         T0                      as temperature  (Brief="Inlet temperature");
     60        To                      as temperature  (Brief="Inlet temperature");
    6161        Ta                      as temperature  (Brief="Internal temperature");
    6262        Hr(NComp)       as enth_mol             (Brief="Enthalpy of component");
     
    6969       
    7070        VARIABLES
    71         Ca                      as conc_mol     (Brief="Molar concentration of A", Unit='kmol/m^3');
    72         Ca0             as conc_mol     (Brief="Inlet molar concentration of A", Unit='mol/m^3');
    73         Fa0             as flow_mol     (Brief="Inlet molar flow of A");
    74         v0                      as flow_vol     (Brief="Volumetric flow", Unit='m^3/s');
    75         r                       as reaction_mol (Brief="Rate of reaction", Unit='kmol/m^3/s');
     71        Ca                      as conc_mol     (Brief="Molar concentration of A", DisplayUnit='kmol/m^3');
     72        Cao             as conc_mol     (Brief="Inlet molar concentration of A", DisplayUnit='mol/m^3');
     73        Fao             as flow_mol     (Brief="Inlet molar flow of A");
     74        vo                      as flow_vol     (Brief="Volumetric flow", DisplayUnit='m^3/s');
     75        r                       as reaction_mol (Brief="Rate of reaction", DisplayUnit='kmol/m^3/s');
    7676        k                       as Real                 (Brief="Specific rate of reaction", Unit='1/s');
    77         T                       as temperature  (Brief="Temperature of reactor", Unit='K');
     77        T                       as temperature  (Brief="Temperature of reactor");
    7878        X                       as fraction     (Brief="Molar conversion", Lower=0);
    79         V                       as volume               (Brief="Volume", Unit='m^3');
     79        V                       as volume               (Brief="Volume");
    8080        eps                     as Real                 (Brief="Parameter epsilon");
    81         Cp(NComp)       as cp_mol               (Brief="Molar heat capacity", Unit='J/mol/K');
    82         DHr                     as enth_mol             (Brief="Enthalpy of reaction", Unit='kJ/mol'); 
     81        Cp(NComp)       as cp_mol               (Brief="Molar heat capacity", DisplayUnit='J/mol/K');
     82        DHr                     as enth_mol             (Brief="Enthalpy of reaction", DisplayUnit='kJ/mol');   
    8383       
    8484        EQUATIONS
     
    8787       
    8888        "Molar balance"
    89         diff(X) = (-r)/Fa0*'m^3/s';
     89        diff(X) = (-r)/Fao*'m^3/s';
    9090       
    9191        "Rate of reaction"
     
    9696       
    9797        "Concentration of component A"
    98         Ca = Ca0*(1 - X)/(1 + eps*X)*T0/T;
     98        Ca = Cao*(1 - X)/(1 + eps*X)*To/T;
    9999       
    100100        "Parameter epsilon"
     
    102102       
    103103        "Inlet molar concentration of A"
    104         Ca0 = Pa0/(R*T0);
     104        Cao = Pao/(R*To);
    105105       
    106106        "Volumetric flow"
    107         Fa0 = Ca0*v0;
     107        Fao = Cao*vo;
    108108       
    109109        "Energy balance"
    110         diff(T)*(Fa0*(Cp(1) + X*sumt(stoic*Cp))) = (U*a*(Ta - T) + (-r)*(-DHr))*'m^3/s';
     110        diff(T)*(Fao*(Cp(1) + X*sumt(stoic*Cp))) = (U*a*(Ta - T) + (-r)*(-DHr))*'m^3/s';
    111111
    112112        "Enthalpy of reaction"
     
    131131        R.stoic = [-1.0, 1.0, 1.0]; # A -> B + C
    132132       
    133         R.Pa0 = 162*'kPa';
     133        R.Pao = 162*'kPa';
    134134       
    135135        R.alpha = [26.63,  20.04, 13.39]*'J/mol/K';
     
    139139        R.Hr = [-216.67, -61.09, -74.81]*'kJ/mol';
    140140        R.Tr = 298*'K';
    141         R.T0 = 1035*'K';
     141        R.To = 1035*'K';
    142142        R.Ta = 1150*'K';
    143143        R.U  = 0.0*'J/m^2/K/s';
     
    146146        SPECIFY
    147147        "Inlet molar flow"
    148         R.Fa0 = (8000/58)*'kmol/h';
     148        R.Fao = (8000/58)*'kmol/h';
    149149       
    150150        INITIAL
     
    157157        TimeStep = 0.05;
    158158        TimeEnd = 5;
     159        TimeUnit = 's';
    159160end
    160161
     
    172173        R.stoic = [-1.0, 1.0, 1.0]; # A -> B + C
    173174       
    174         R.Pa0 = 162*'kPa';
     175        R.Pao = 162*'kPa';
    175176       
    176177        R.alpha = [26.63,  20.04, 13.39]*'J/mol/K';
     
    180181        R.Hr = [-216.67, -61.09, -74.81]*'kJ/mol';
    181182        R.Tr = 298*'K';
    182         R.T0 = 1035*'K';
     183        R.To = 1035*'K';
    183184        R.Ta = 1150*'K';
    184185        R.U  = 110*'J/m^2/K/s';
     
    187188        SPECIFY
    188189        "Inlet molar flow"
    189         R.Fa0 = (18.8*2e-3)*'mol/s';
     190        R.Fao = (18.8*2e-3)*'mol/s';
    190191       
    191192        INITIAL
     
    198199        TimeStep = 1e-5;
    199200        TimeEnd = 1e-3;
     201        TimeUnit = 's';
    200202end
  • branches/newlanguage/sample/reactors/fogler/chap8/propylene_glycol.mso

    r171 r188  
    5757        NComp           as Integer              (Brief="Number of components", Lower=1);
    5858        stoic(NComp)as Real             (Brief="Stoichiometric coefficients");
    59         vo(NComp)       as flow_vol     (Brief="Total input flow", Unit='ft^3/h');
    60         Hro(NComp)      as enth_mol     (Brief="Enthalpy of formation", Unit='Btu/lbmol');
    61         To                      as temperature  (Brief="Initial temperature", Unit='degR');
    62         Tr                      as temperature  (Brief="Reference temperature", Unit='degR');
     59        vo(NComp)       as flow_vol     (Brief="Total input flow", DisplayUnit='ft^3/h');
     60        Hro(NComp)      as enth_mol     (Brief="Enthalpy of formation", DisplayUnit='Btu/lbmol');
     61        To                      as temperature  (Brief="Initial temperature", DisplayUnit='degR');
     62        Tr                      as temperature  (Brief="Reference temperature", DisplayUnit='degR');
    6363        Cp(NComp)       as Real                 (Brief="Molar heat capacity", Unit='Btu/lbmol/degR');
    64         Fo(NComp)       as flow_mol             (Brief="Input molar flow of component", Unit='lbmol/h');
     64        Fo(NComp)       as flow_mol             (Brief="Input molar flow of component", DisplayUnit='lbmol/h');
    6565        V                       as volume               (Brief="Volume of the reactor");
    6666        # Rate of reaction
     
    7070
    7171        VARIABLES
    72         T                       as temperature  (Brief="Temperature", Unit='degR');
     72        T                       as temperature  (Brief="Temperature", DisplayUnit='degR');
    7373        k                       as Real                 (Brief="Specific rate of reaction", Unit='1/h');
    7474        XMB                     as fraction             (Brief="Conversion as Material balance");
    7575        XEB                     as fraction             (Brief="Conversion as Energy balance");
    76         tau                     as time_h               (Brief="Residence time", Unit='h');
     76        tau                     as time_h               (Brief="Residence time");
    7777        Theta(NComp)as Real                     (Brief="Molar fraction between components");
    7878       
     
    114114       
    115115        OPTIONS
    116 #       time=[535:0.45:625];   
     116        TimeStart = 535;
     117        TimeStep = 0.45;
     118        TimeEnd = 625;
    117119end
    118120
     
    126128        NComp           as Integer              (Brief="Number of components", Lower=1);
    127129        stoic(NComp)as Real             (Brief="Stoichiometric coefficients");
    128         vo(NComp)       as flow_vol     (Brief="Total input flow", Unit='ft^3/h');
    129         Hro(NComp)      as enth_mol     (Brief="Enthalpy of formation", Unit='Btu/lbmol');
     130        vo(NComp)       as flow_vol     (Brief="Total input flow", DisplayUnit='ft^3/h');
     131        Hro(NComp)      as enth_mol     (Brief="Enthalpy of formation", DisplayUnit='Btu/lbmol');
    130132        To                      as temperature  (Brief="Initial temperature");
    131133        Tr                      as temperature  (Brief="Reference temperature");
    132134        Ta                      as temperature  (Brief="Temperature of cooling");
    133135        Cp(NComp)       as Real                 (Brief="Molar heat capacity", Unit='Btu/lbmol/degR');
    134         Fo(NComp)       as flow_mol             (Brief="Input molar flow of component", Unit='lbmol/h');
     136        Fo(NComp)       as flow_mol             (Brief="Input molar flow of component", DisplayUnit='lbmol/h');
    135137        V                       as volume               (Brief="Volume of the reactor");
    136138        U                       as heat_trans_coeff(Brief="Heat transfer coefficient");
     
    145147        XEB                     as fraction             (Brief="Molar conversion as Energy balance", Lower=-0.1, Upper=1.5);
    146148        k                       as Real                 (Brief="Specific rate of reaction", Unit='1/h');
    147         T                       as temperature  (Brief="Temperature", Unit='degR');
    148         tau                     as time_h               (Brief="Residence time", Unit='h');
     149        T                       as temperature  (Brief="Temperature", DisplayUnit='degR');
     150        tau                     as time_h               (Brief="Residence time");
    149151        Theta(NComp)as Real                     (Brief="Molar fraction between components");
    150152       
     
    191193       
    192194        OPTIONS
    193 #       time    =[535:0.45:625]; original
    194        
    195         TimeStep        =0.45;
    196         TimeEnd         =625;
     195        TimeStart = 535;
     196        TimeStep = 0.45;
     197        TimeEnd = 625;
    197198end
  • branches/newlanguage/sample/reactors/fogler/chap8/series_reactions.mso

    r171 r188  
    4040*
    4141*----------------------------------------------------------------------
    42 * Author: Christiano D. Wetzel Guerra and Rodolfo Rodrigues
     42* Author: Christiano D. W. Guerra and Rodolfo Rodrigues
    4343* $Id$
    4444*--------------------------------------------------------------------*#
     
    113113        vo      = 1000*'m^3/min';
    114114       
    115         ko      = [ 3.30,  4.58]*'1/min';
     115        ko      = [ 3.30,  4.58]/'min';
    116116        E       = [9.9e3, 2.7e4]*'cal/mol';
    117117        Tr_ko = [300, 500]*'K';
     
    124124        SPECIFY
    125125        "Inlet temperature"
    126         To = 283*'K' ;
     126        To = 283*'K';
    127127        "Inlet concentration of A"
    128128        Co= 0.3*'mol/m^3';
     
    133133
    134134        OPTIONS
    135         TimeStep = 2;
     135        TimeStep = 0;
    136136        TimeEnd = 225;
    137         TimeUnit ='min';
     137        TimeUnit = 'min';
    138138end
  • branches/newlanguage/sample/reactors/fogler/chap9/cstr_startup.mso

    r82 r188  
    5757        NComp           as Integer              (Brief="Number of components");
    5858        stoic(NComp)as Real             (Brief="Stoichiometric number");
    59         UA              as Real             (Brief="Exchange heat", Unit="Btu/h/degR");
     59        UA              as Real             (Brief="Exchange heat", Unit='Btu/h/degR');
    6060        V               as volume           (Brief="Volume of the reactor");
    6161        Ta1             as temperature  (Brief="Cooling temperature");
     
    6666        ko                      as frequency    (Brief="Frequency factor");
    6767        E                       as energy_mol   (Brief="Activation energy");
    68         R                       as Real                 (Brief="Universal gas constant", Unit="Btu/lbmol/degR", Default=1.987);
     68        R                       as Real                 (Brief="Universal gas constant", Unit='Btu/lbmol/degR', Default=1.987);
    6969       
    7070        VARIABLES
    71         C(NComp)        as conc_mol     (Brief="Molar concentration", Unit="lbmol/ft^3", Lower=0);
    72         N(NComp)        as mol                  (Brief="Molar holdup", Unit="lbmol");
    73         Co(NComp)       as conc_mol     (Brief="Initial molar concentration", Unit="lbmol/ft^3", Lower=0);
    74         Fo(NComp)       as flow_mol     (Brief="Initial molar flow", Unit="lbmol/h");
    75         T               as temperature  (Brief="Reactor temperature", Unit="degR");
    76         To              as temperature  (Brief="Initial reactor temperature", Unit="degR");
    77         Ta2             as temperature  (Brief="Temperature of heat exchange", Unit="degR");
    78         r(NComp)        as reaction_mol (Brief="Rate of reaction", Unit="lbmol/ft^3/h");
    79         k               as frequency    (Brief="Specific rate of reaction", Unit="1/h", Upper=1e5);
    80         mc              as flow_mol     (Brief="Molar flow of cooling water", Unit="lbmol/h");
    81         Q               as heat_rate    (Brief="Heat exchange", Unit="Btu/h");
     71        C(NComp)        as conc_mol     (Brief="Molar concentration", DisplayUnit='lbmol/ft^3', Lower=0);
     72        N(NComp)        as mol                  (Brief="Molar holdup", DisplayUnit='lbmol');
     73        Co(NComp)       as conc_mol     (Brief="Initial molar concentration", DisplayUnit='lbmol/ft^3', Lower=0);
     74        Fo(NComp)       as flow_mol     (Brief="Initial molar flow", DisplayUnit='lbmol/h');
     75        T               as temperature  (Brief="Reactor temperature", DisplayUnit='degR');
     76        To              as temperature  (Brief="Initial reactor temperature", DisplayUnit='degR');
     77        Ta2             as temperature  (Brief="Temperature of heat exchange", DisplayUnit='degR');
     78        r(NComp)        as reaction_mol (Brief="Rate of reaction", DisplayUnit='lbmol/ft^3/h');
     79        k               as frequency    (Brief="Specific rate of reaction", DisplayUnit='1/h', Upper=1e5);
     80        mc              as flow_mol     (Brief="Molar flow of cooling water", DisplayUnit='lbmol/h');
     81        Q               as heat_rate    (Brief="Heat exchange", DisplayUnit='Btu/h');
    8282        Theta(NComp)as Real                     (Brief="Parameter Theta");
    83         vo              as flow_vol     (Brief="Volumetric flow", Unit="ft^3/h");
    84         tau             as time_h       (Brief="Residence time", Unit="h");
     83        vo              as flow_vol     (Brief="Volumetric flow", DisplayUnit='ft^3/h');
     84        tau             as time_h       (Brief="Residence time", DisplayUnit='h');
    8585
    8686        EQUATIONS
     
    122122        stoic = [-1, -1, 1, 0]; # A + 2B -> C + D
    123123       
    124         UA      = 16000*"Btu/h/degR";
    125         V       = 500*"gal";
    126         Ta1     = (60 + 460)*"degR";
    127         DH      =-3.6e4*"Btu/lbmol";
    128         rho     = [0.923, 3.45, 1, 1.54]*"lbmol/ft^3";
    129         cp      = [35, 18, 46, 19.5]*"Btu/lbmol/degR";
    130        
    131         ko = 16.96e12*"1/h";
    132         E  = -32400*"Btu/lbmol";
     124        UA      = 16000*'Btu/h/degR';
     125        V       = 500*'gal';
     126        Ta1     = (60 + 460)*'degR';
     127        DH      =-3.6e4*'Btu/lbmol';
     128        rho     = [0.923, 3.45, 1, 1.54]*'lbmol/ft^3';
     129        cp      = [35, 18, 46, 19.5]*'Btu/lbmol/degR';
     130       
     131        ko = 16.96e12*'1/h';
     132        E  = -32400*'Btu/lbmol';
    133133end
    134134
     
    140140        SPECIFY
    141141        "Inlet molar flow"
    142         CSTR.Fo = [80, 1000, 0, 100]*"lbmol/h";
     142        CSTR.Fo = [80, 1000, 0, 100]*'lbmol/h';
    143143        "Inlet reactor temperature"
    144         CSTR.To = (75 + 460)*"degR";
     144        CSTR.To = (75 + 460)*'degR';
    145145        "Molar flow of cooling water"
    146         CSTR.mc = 1e3*"lbmol/h";
     146        CSTR.mc = 1e3*'lbmol/h';
    147147
    148148        INITIAL
    149149        "Molar concentration"
    150         CSTR.C  = [0, 3.45, 0, 0]*"lbmol/ft^3";
     150        CSTR.C  = [0, 3.45, 0, 0]*'lbmol/ft^3';
    151151        "Reactor temperature"
    152152        CSTR.T  = CSTR.To;
    153153
    154154        OPTIONS
    155         time = [0:0.05:4]*"h";
     155        TimeStep = 0.05;
     156        TimeEnd = 4;
     157        TimeUnit = 'h';
    156158end
    157159
     
    185187        SPECIFY
    186188        "Inlet molar flow"
    187         CSTR.Fo = [80, 1000, 0, 100]*"lbmol/h";
     189        CSTR.Fo = [80, 1000, 0, 100]*'lbmol/h';
    188190        "Inlet reactor temperature"
    189         CSTR.To = (70 + 460)*"degR"; # Reduction of temperature: 75°F to 70°F
     191        CSTR.To = (70 + 460)*'degR'; # Reduction of temperature: 75°F to 70°F
    190192        "Molar flow of cooling water"
    191         CSTR.mc = 1e3*"lbmol/h";
     193        CSTR.mc = 1e3*'lbmol/h';
    192194
    193195        INITIAL
    194196        "Molar concentration"
    195         CSTR.C = [0.039, 2.12, 0.143, 0.226]*"lbmol/ft^3"; # Final values of SS in 9-4
     197        CSTR.C = [0.039, 2.12, 0.143, 0.226]*'lbmol/ft^3'; # Final values of SS in 9-4
    196198        "Reactor temperature"
    197         CSTR.T = (138.5 + 460)*"degR"; # Final values of SS in 9-4
     199        CSTR.T = (138.5 + 460)*'degR'; # Final values of SS in 9-4
    198200
    199201        OPTIONS
    200         time = [0:0.05:4]*"h";
     202        TimeStep = 0.05;
     203        TimeEnd = 4;
     204        TimeUnit = 'h';
    201205end
    202206
     
    210214        Tsp                     as temperature  (Brief="Reference temperature");
    211215        mco             as flow_mol     (Brief="Molar flow of cooling water");
    212         kc                      as Real                 (Brief="Gain", Unit="lbmol/degR/h");
     216        kc                      as Real                 (Brief="Gain", Unit='lbmol/degR/h');
    213217       
    214218        VARIABLES
    215         I                       as Real                 (Brief="Integral action", Unit="degR*h");
     219        I                       as Real                 (Brief="Integral action", Unit='degR*h');
    216220        X                       as fraction             (Brief="Fraction conversion", Lower=0);
    217221       
     
    233237       
    234238        SET
    235         CSTR.mco = 1000*"lbmol/h";
    236         CSTR.Tsp = (138 + 460)*"degR";
    237         CSTR.kc = 8.5;
     239        CSTR.mco = 1000*'lbmol/h';
     240        CSTR.Tsp = (138 + 460)*'degR';
     241        CSTR.kc = 8.5*'lbmol/degR/h';
    238242
    239243        SPECIFY
    240244        "Inlet molar flow"
    241         CSTR.Fo = [80, 1000, 0, 100]*"lbmol/h";
     245        CSTR.Fo = [80, 1000, 0, 100]*'lbmol/h';
    242246        "Inlet reactor temperature"
    243         CSTR.To = (70 + 460)*"degR";
     247        CSTR.To = (70 + 460)*'degR';
    244248
    245249        INITIAL
    246250        "Molar concentration"
    247         CSTR.C = [0.03789, 2.12, 0.143, 0.2265]*"lbmol/ft^3";
     251        CSTR.C = [0.03789, 2.12, 0.143, 0.2265]*'lbmol/ft^3';
    248252        "Reactor temperature"
    249         CSTR.T = (138.53 + 460)*"degR";
     253        CSTR.T = (138.53 + 460)*'degR';
    250254        "Integral action"
    251         CSTR.I = 0;
     255        CSTR.I = 0*'degR*h';
    252256
    253257        OPTIONS
    254         time = [0:0.01:4]*"h";
    255 end
     258        TimeStep = 0.01;
     259        TimeEnd = 4;
     260        TimeUnit = 'h';
     261end
Note: See TracChangeset for help on using the changeset viewer.