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/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.