Ignore:
Timestamp:
Mar 2, 2007, 10:06:53 AM (16 years ago)
Author:
gerson bicca
Message:

some modifications in the models for the new language (reactors model)

Location:
branches/newlanguage/sample/reactors/fogler
Files:
11 edited

Legend:

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

    r82 r171  
    5858
    5959Model stream
    60         PARAMETERS
     60
     61PARAMETERS
    6162        NComp   as Integer      (Brief="Number of components", Default=1);
    62         VARIABLES
    63         F(NComp)as flow_mol     (Brief="Molar flow", Unit="mol/s");
    64         X(NComp)as fraction     (Brief="Molar conversion");
    65 end
    66 
     63
     64VARIABLES
     65        F(NComp)        as flow_mol     (Brief="Molar flow", Unit='mol/s');
     66        X(NComp)        as fraction     (Brief="Molar conversion");
     67
     68end
    6769
    6870#*---------------------------------------------------------------------
     
    7173
    7274Model cstr     
    73         VARIABLES
    74 in      Inlet   as stream; # Inlet stream
    75 out     Outlet  as stream; # Outlet stream
    76         r               as reaction_mol(Brief="Rate of reaction", Unit="mol/l/s");
    77         V       as volume          (Brief="Volume", Unit="l", Upper=2e3);
    78 
    79         EQUATIONS
    80         "Component molar balance"
     75
     76VARIABLES
     77
     78in              Inlet           as stream       (Brief="Inlet stream");
     79out     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
     84EQUATIONS
     85
     86"Component molar balance"
    8187        Inlet.F - Outlet.F = (-r)*V;
    8288       
    83         "Outlet molar flow"
     89"Outlet molar flow"
    8490        Outlet.F = Inlet.F*(1 - Outlet.X);
     91
    8592end
    8693
     
    9198
    9299Model pfr
    93         VARIABLES
    94 in      Inlet   as stream; # Inlet stream
    95 out     Outlet  as stream; # Outlet stream
    96         V       as volume          (Brief="Volume", Unit="l", Upper=2e3);
    97         r               as reaction_mol(Brief="Rate of reaction", Unit="mol/l/s");
    98        
    99         EQUATIONS
    100         "Molar balance"
    101         diff(V) = Inlet.F/(-r)*"1/s";
    102 
    103         "Change time in X"
    104         Outlet.X = time*"1/s";
     100
     101VARIABLES
     102in              Inlet           as stream       (Brief="Inlet stream");
     103out     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       
     108EQUATIONS
     109
     110"Molar balance"
     111        diff(V) = Inlet.F/(-r)*'1/s';
     112
     113"Change time in X"
     114        Outlet.X = time*'1/s';
    105115       
    106116        "Molar flow"
     
    120130in      Inlet   as stream; # Inlet stream
    121131out     Outlet  as stream; # Outlet stream
    122         V(N)    as volume           (Brief="Volume", Unit="l", Upper=2e3);
     132        V(N)    as volume           (Brief="Volume", Unit='l', Upper=2e3);
    123133        X(N)    as fraction             (Brief="Molar conversion");
    124134        dx      as fraction     (Brief="Conversion increment");
    125         r(N)    as reaction_mol (Brief="Rate of reaction", Unit="mol/l/s");
    126         F(N)    as flow_mol             (Brief="Molar flow", Unit="mol/s");
     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');
    127137       
    128138        EQUATIONS
     
    154164FlowSheet cstr_sample
    155165        PARAMETERS
    156         R       as Real                 (Brief="Universal gas constant", Unit="atm*l/mol/K", Default=0.082);
    157         T       as temperature  (Brief="Temperatura in the reactor", Unit="K");
    158         P       as pressure             (Brief="Pressure in the reactor", Unit="atm");
     166        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');
    159169        zin     as fraction             (Brief="Inlet molar fraction");
    160170        v0  as flow_vol         (Brief="Volumetric flow");
    161171       
    162172        VARIABLES
    163         Vt      as volume               (Brief="Total reactor volume", Unit="l");
     173        Vt      as volume               (Brief="Total reactor volume", Unit='l');
    164174       
    165175        DEVICES
     
    175185       
    176186        "Rate of reaction"
    177         (-R1.r) = (0.0092*R1.Outlet.X^3 - 0.0153*R1.Outlet.X^2 + 0.0013*R1.Outlet.X + 0.0053)*"mol/l/s";
     187        (-R1.r) = (0.0092*R1.Outlet.X^3 - 0.0153*R1.Outlet.X^2 + 0.0013*R1.Outlet.X + 0.0053)*'mol/l/s';
    178188       
    179189        "Total reactor volume"
     
    187197       
    188198        SET
    189         v0  = 6.0*"l/s";
    190         T       = 422.2*"K";
    191         P       = 10*"atm";
     199        v0  = 6.0*'l/s';
     200        T       = 422.2*'K';
     201        P       = 10*'atm';
    192202        zin     = 0.5;
    193203       
    194204        OPTIONS
    195         mode = "steady";
     205        Dynamic = false;
    196206end
    197207
     
    202212
    203213FlowSheet pfr_sample
    204         DEVICES
    205         Inlet   as stream; # Inlet stream
     214
     215DEVICES
     216        Inlet   as stream;
    206217        R1              as pfr;
    207218       
    208         CONNECTIONS
     219CONNECTIONS
    209220        Inlet   to R1.Inlet;
    210221       
    211         EQUATIONS
    212         "Rate of reaction"
    213         (-R1.r) = (0.0092*R1.Outlet.X^3 - 0.0153*R1.Outlet.X^2 + 0.0013*R1.Outlet.X + 0.0053)*"mol/l/s";
    214        
    215         SPECIFY
    216         "Inlet molar flow"
    217         Inlet.F = 0.866541*"mol/s";
    218         "Inlet conversion"
     222EQUATIONS
     223
     224"Rate of reaction"
     225        (-R1.r) = (0.0092*R1.Outlet.X^3 - 0.0153*R1.Outlet.X^2 + 0.0013*R1.Outlet.X + 0.0053)*'mol/l/s';
     226       
     227SPECIFY
     228
     229"Inlet molar flow"
     230        Inlet.F = 0.866541*'mol/s';
     231
     232"Inlet conversion"
    219233        Inlet.X = 0.0;
    220234       
    221         INITIAL
    222         "Reactor volume"
    223         R1.V    = 0.0*"l";
    224        
    225         OPTIONS
    226         time = [0:0.004:0.8];
     235INITIAL
     236
     237"Reactor volume"
     238        R1.V    = 0.0*'l';
     239       
     240OPTIONS
     241       
     242        Dynamic         = true;
     243        TimeStep        = 0.004;
     244        TimeEnd         = 0.8;
     245        TimeUnit        = 's';
     246       
    227247end
    228248
     
    234254FlowSheet pfr_d_sample
    235255        VARIABLES
    236         Vt              as volume       (Brief="Total reactor volume", Unit="l");
     256        Vt              as volume       (Brief="Total reactor volume", Unit='l');
    237257       
    238258        DEVICES
     
    245265        EQUATIONS
    246266        "Rate of reaction"
    247         (-R1.r) = (0.0092*R1.X^3 - 0.0153*R1.X^2 + 0.0013*R1.X + 0.0053)*"mol/l/s";
     267        (-R1.r) = (0.0092*R1.X^3 - 0.0153*R1.X^2 + 0.0013*R1.X + 0.0053)*'mol/l/s';
    248268       
    249269        "Total reactor volume"
     
    255275        SPECIFY
    256276        "Inlet molar flow"
    257         Inlet.F = 0.866541*"mol/s";
     277        Inlet.F = 0.866541*'mol/s';
    258278        "Inlet conversion"
    259279        Inlet.X = 0.0;
     
    262282        R1.Outlet.X     = 0.8;
    263283        "Initial volume"
    264         R1.V(1) = 0.0*"l";
    265        
    266         OPTIONS
    267         mode = "steady";
     284        R1.V(1) = 0.0*'l';
     285       
     286        OPTIONS
     287        Dynamic = false;
    268288end
    269289
     
    275295FlowSheet comparative
    276296        VARIABLES
    277         V_cstr  as volume       (Brief="CSTR volume", Unit="l");
    278         V_pfr   as volume       (Brief="PFR volume", Unit="l");
     297        V_cstr  as volume       (Brief="CSTR volume",Unit='l');
     298        V_pfr   as volume       (Brief="PFR volume", Unit='l');
    279299       
    280300        DEVICES
     
    289309        EQUATIONS
    290310        "Rate of reaction in CSTR"
    291         (-CSTR.r) = (0.0092*CSTR.Outlet.X^3 - 0.0153*CSTR.Outlet.X^2 + 0.0013*CSTR.Outlet.X + 0.0053)*"mol/l/s";
     311        (-CSTR.r) = (0.0092*CSTR.Outlet.X^3 - 0.0153*CSTR.Outlet.X^2 + 0.0013*CSTR.Outlet.X + 0.0053)*'mol/l/s';
    292312        "Rate of reaction in PFR"
    293         (-PFR.r) = (0.0092*PFR.X^3 - 0.0153*PFR.X^2 + 0.0013*PFR.X + 0.0053)*"mol/l/s";
     313        (-PFR.r) = (0.0092*PFR.X^3 - 0.0153*PFR.X^2 + 0.0013*PFR.X + 0.0053)*'mol/l/s';
    294314       
    295315        "CSTR volume"
     
    303323        SPECIFY
    304324        "Inlet molar flow"
    305         Inlet.F = 5.0*"mol/s";
     325        Inlet.F = 5.0*'mol/s';
    306326        "Inlet conversion"
    307327        Inlet.X = 0.0;
     
    313333       
    314334        "Initial volume in PFR"
    315         PFR.V(1) = 0.0*"l";
    316        
    317         OPTIONS
    318         mode = "steady";
     335        PFR.V(1) = 0.0*'l';
     336       
     337        OPTIONS
     338        Dynamic = false;
    319339end
    320340
     
    326346FlowSheet cstr_cstr
    327347        VARIABLES
    328         V1              as volume       (Brief="1st reactor volume", Unit="l");
    329         V2              as volume       (Brief="2nd reactor volume", Unit="l");
    330         Vt              as volume       (Brief="Total reactor volumes", Unit="l");
    331        
    332         DEVICES
    333         Inlet   as stream; # Inlet stream
     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;
    334354        R1              as cstr;
    335355        R2              as cstr;
     
    341361        EQUATIONS
    342362        "Rate of reaction in 1st reactor"
    343         (-R1.r) = (0.0092*R1.Outlet.X^3 - 0.0153*R1.Outlet.X^2 + 0.0013*R1.Outlet.X + 0.0053)*"mol/l/s";
     363        (-R1.r) = (0.0092*R1.Outlet.X^3 - 0.0153*R1.Outlet.X^2 + 0.0013*R1.Outlet.X + 0.0053)*'mol/l/s';
    344364        "Rate of reaction in 2nd reactor"
    345         (-R2.r) = (0.0092*R2.Outlet.X^3 - 0.0153*R2.Outlet.X^2 + 0.0013*R2.Outlet.X + 0.0053)*"mol/l/s";
     365        (-R2.r) = (0.0092*R2.Outlet.X^3 - 0.0153*R2.Outlet.X^2 + 0.0013*R2.Outlet.X + 0.0053)*'mol/l/s';
    346366       
    347367        "1st volume reactor"
     
    354374        SPECIFY
    355375        "Inlet molar flow"
    356         Inlet.F = 0.866541*"mol/s";
     376        Inlet.F = 0.866541*'mol/s';
    357377        "Inlet conversion"
    358378        Inlet.X = 0.0;
     
    364384       
    365385        OPTIONS
    366         mode = "steady";
     386        Dynamic=false;
     387       
    367388end
    368389
     
    374395FlowSheet pfr_pfr
    375396        VARIABLES
    376         V1              as volume       (Brief="1st reactor volume", Unit="l");
    377         V2              as volume       (Brief="2nd reactor volume", Unit="l");
    378         Vt              as volume       (Brief="Total reactor volumes", Unit="l");
    379        
    380         DEVICES
    381         Inlet   as stream; # Inlet stream
     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;
    382403        R1              as pfr_d;
    383404        R2              as pfr_d;
     
    389410        EQUATIONS
    390411        "Rate of reaction in 1st reactor"
    391         (-R1.r) = (0.0092*R1.X^3 - 0.0153*R1.X^2 + 0.0013*R1.X + 0.0053)*"mol/l/s";
     412        (-R1.r) = (0.0092*R1.X^3 - 0.0153*R1.X^2 + 0.0013*R1.X + 0.0053)*'mol/l/s';
    392413        "Rate of reaction in 2nd reactor"
    393         (-R2.r) = (0.0092*R2.X^3 - 0.0153*R2.X^2 + 0.0013*R2.X + 0.0053)*"mol/l/s";
     414        (-R2.r) = (0.0092*R2.X^3 - 0.0153*R2.X^2 + 0.0013*R2.X + 0.0053)*'mol/l/s';
    394415       
    395416        "1st reactor volume"
     
    402423        SPECIFY
    403424        "Inlet molar flow"
    404         Inlet.F = 0.866541*"mol/s";
     425        Inlet.F = 0.866541*'mol/s';
    405426        "Inlet conversion"
    406427        Inlet.X = 0.0;
     
    412433       
    413434        "Initial 1st reactor volume"
    414         R1.V(1) = 0.0*"l";
     435        R1.V(1) = 0.0*'l';
    415436        "Initial 2nd reactor volume"
    416         R2.V(1) = 0.0*"l";
    417        
    418         OPTIONS
    419         mode = "steady";
     437        R2.V(1) = 0.0*'l';
     438       
     439        OPTIONS
     440        Dynamic = false;
    420441end
    421442
     
    427448FlowSheet pfr_cstr
    428449        VARIABLES
    429         V1              as volume       (Brief="1st reactor volume", Unit="l");
    430         V2              as volume       (Brief="2nd reactor volume", Unit="l");
    431         Vt              as volume       (Brief="Total reactor volumes", Unit="l");
    432        
    433         DEVICES
    434         Inlet   as stream; # Inlet stream
     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;
    435456        R1              as pfr_d;
    436457        R2              as cstr;
     
    442463        EQUATIONS
    443464        "Rate of reaction in 1st reactor"
    444         (-R1.r) = (0.0092*R1.X^3 - 0.0153*R1.X^2 + 0.0013*R1.X + 0.0053)*"mol/l/s";
     465        (-R1.r) = (0.0092*R1.X^3 - 0.0153*R1.X^2 + 0.0013*R1.X + 0.0053)*'mol/l/s';
    445466        "Rate of reaction in 2nd reactor"
    446         (-R2.r) = (0.0092*R2.Outlet.X^3 - 0.0153*R2.Outlet.X^2 + 0.0013*R2.Outlet.X + 0.0053)*"mol/l/s";
     467        (-R2.r) = (0.0092*R2.Outlet.X^3 - 0.0153*R2.Outlet.X^2 + 0.0013*R2.Outlet.X + 0.0053)*'mol/l/s';
    447468       
    448469        "1st reactor volume"
     
    458479        SPECIFY
    459480        "Inlet molar flow"
    460         Inlet.F = 0.866541*"mol/s";
     481        Inlet.F = 0.866541*'mol/s';
    461482        "Inlet conversion"
    462483        Inlet.X = 0.0;
     
    468489       
    469490        "Initial 1st reactor volume"
    470         R1.V(1) = 0.0*"l";
    471        
    472         OPTIONS
    473         mode = "steady";
     491        R1.V(1) = 0.0*'l';
     492       
     493        OPTIONS
     494        Dynamic= false;
    474495end
    475496
     
    481502FlowSheet cstr_pfr
    482503        VARIABLES
    483         V1              as volume       (Brief="1st reactor volume", Unit="l");
    484         V2              as volume       (Brief="2nd reactor volume", Unit="l");
    485         Vt              as volume       (Brief="Total reactor volumes", Unit="l");
     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');
    486507       
    487508        DEVICES
     
    496517        EQUATIONS
    497518        "Rate of reaction in 1st reactor"
    498         (-R1.r) = (9.2*R1.Outlet.X^3 - 15.3*R1.Outlet.X^2 + 1.3*R1.Outlet.X + 5.3)*1e-3*"mol/l/s";
     519        (-R1.r) = (9.2*R1.Outlet.X^3 - 15.3*R1.Outlet.X^2 + 1.3*R1.Outlet.X + 5.3)*1e-3*'mol/l/s';
    499520        "Rate of reaction in 2nd reactor"
    500         (-R2.r) = (9.2*R2.X^3 - 15.3*R2.X^2 + 1.3*R2.X + 5.3)*1e-3*"mol/l/s";
     521        (-R2.r) = (9.2*R2.X^3 - 15.3*R2.X^2 + 1.3*R2.X + 5.3)*1e-3*'mol/l/s';
    501522       
    502523        "1st reactor volume"
     
    512533        SPECIFY
    513534        "Inlet molar flow"
    514         Inlet.F = 0.866541*"mol/s";
     535        Inlet.F = 0.866541*'mol/s';
    515536        "Inlet conversion"
    516537        Inlet.X = 0.0;
     
    522543       
    523544        "Initial 2nd reactor volume"
    524         R2.V(1) = 0.0*"l";
    525        
    526         OPTIONS
    527         mode = "steady";
    528 end
     545        R2.V(1) = 0.0*'l';
     546       
     547        OPTIONS
     548        Dynamic = false;
     549end
  • branches/newlanguage/sample/reactors/fogler/chap3/equilibrium_conversion.mso

    r82 r171  
    5454Model stream
    5555        PARAMETERS
    56 ext     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", Unit='kmol/l', Lower=0);
    6060        z(NComp)as fraction(Brief="Molar fraction");
    6161end
     
    6969        PARAMETERS
    7070        NComp   as Integer      (Brief="Number of chemical components", Lower=1);
    71         R               as Real         (Brief="Universal gas constant", Unit="atm*l/mol/K", Default=0.082);
     71        R               as Real         (Brief="Universal gas constant", Unit='atm*l/mol/K', Default=0.082);
    7272        stoic(NComp) as Real(Brief="Stoichiometric coefficients");
    7373       
     
    7676        Outlet  as stream; # Outlet stream
    7777        X               as fraction     (Brief="Molar conversion", Lower=0);
    78         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");
     78        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');
    8383        Theta(NComp) as Real(Brief="Parameter Theta");
    8484       
     
    114114
    115115        "Inlet pressure"
    116         P = 2.0*"atm";
     116        P = 2.0*'atm';
    117117        "Inlet temperature"
    118         T = 340*"K";
     118        T = 340*'K';
    119119       
    120120        "Equilibrium constant"
    121         Kc = 0.1*"mol/l";
     121        Kc = 0.1*'mol/l';
    122122       
    123123        OPTIONS
    124         mode = "steady";
     124        Dynamic = false;
    125125end
    126126
     
    133133        PARAMETERS
    134134        NComp   as Integer      (Brief="Number of chemical components", Lower=1);
    135         R               as Real         (Brief="Universal gas constant", Unit="atm*l/mol/K", Default=0.082);
     135        R               as Real         (Brief="Universal gas constant", Unit='atm*l/mol/K', Default=0.082);
    136136        stoic(NComp) as Real(Brief="Stoichiometric coefficients");
    137137       
     
    140140        Outlet  as stream; # Outlet stream
    141141        X               as fraction     (Brief="Molar conversion", Lower=0);
    142         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");
     142        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');
    147147        Theta(NComp) as Real(Brief="Parameter Theta");
    148148        epsilon as Real         (Brief="Parameter epsilon");
     
    182182
    183183        "Inlet pressure"
    184         P = 2.0*"atm";
     184        P = 2.0*'atm';
    185185        "Inlet temperature"
    186         T = 340*"K";
     186        T = 340*'K';
    187187       
    188188        "Equilibrium constant"
    189         Kc = 0.1*"mol/l";
     189        Kc = 0.1*'mol/l';
    190190       
    191191        OPTIONS
    192         mode = "steady";
     192        Dynamic = false;
    193193end
  • branches/newlanguage/sample/reactors/fogler/chap3/oxidation_of_so2.mso

    r82 r171  
    5151Model stream
    5252        PARAMETERS
    53 ext     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", Unit='mol/l', Lower=0);
    5757        z(NComp)as fraction(Brief="Molar fraction");
    5858end
     
    6767        NComp   as Integer;
    6868        stoic(NComp) as Real(Brief="Stoichiometric coefficients");
    69         k       as Real (Brief="Specific rate of reaction", Unit="l/mol/s");
    70         R               as Real (Brief="Universal gas constant", Unit="atm*l/mol/K", Default=0.082);
     69        k       as Real (Brief="Specific rate of reaction", Unit='l/mol/s');
     70        R               as Real (Brief="Universal gas constant", Unit='atm*l/mol/K', Default=0.082);
    7171       
    7272        VARIABLES
    73         Inlet   as stream; # Inlet stream
    74         Outlet  as stream; # Outlet stream     
     73        Inlet   as stream;
     74        Outlet  as 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", Unit='mol/l/s');
     77        T               as temperature  (Brief="Temperature", Unit='K');
     78        P               as pressure     (Brief="Pressure", Unit='atm');
    7979        Theta(NComp)as Real     (Brief="Parameter Theta");
    8080        epsilon as Real         (Brief="Parameter epsilon");
     
    8282        EQUATIONS
    8383        "Change time in X"
    84         X = time*"1/s";
     84        X = time*'1/s';
    8585       
    8686        "Outlet molar fraction"
     
    105105        NComp = 4; # A, B, C and I
    106106        stoic = [-1.0, -0.5, 1.0, 0.0];
    107         k = 200*"l/mol/s";
     107        k = 200*'l/mol/s';
    108108       
    109109        SPECIFY
     
    111111        Inlet.z = [0.28, 0.1512, 0.0, 0.5688];
    112112        "Inlet pressure"
    113         P = 1485*"kPa";
     113        P = 1485*'kPa';
    114114        "Inlet temperature"
    115         T = (227 + 273.15)*"K";
     115        T = (227 + 273.15)*'K';
    116116       
    117117        OPTIONS
    118         time = [0:0.005:0.995];
     118        TimeStep = 0.005;
     119        TimeEnd = 0.995;
     120       
    119121end
  • branches/newlanguage/sample/reactors/fogler/chap4/membrane_reactor.mso

    r82 r171  
    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");
    54         kc      as Real                 (Brief="Mass transfer coefficient", Unit="1/min");
    55         R               as Real                 (Brief="Universal gas constant", Unit="atm*l/mol/K", Default=0.082);
     53        Kc      as conc_mol             (Brief="Equilibrium constant", Unit='mol/l');
     54        kc      as Real                 (Brief="Mass transfer coefficient", Unit='1/min');
     55        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");
    62         k               as Real                 (Brief="Specific rate of reaction", Unit="1/min");
    63         V               as volume               (Brief="Volume", Unit="l");
     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');
     62        k               as Real                 (Brief="Specific rate of reaction", Unit='1/min');
     63        V               as volume               (Brief="Volume", Unit='l');
    6464       
    65         T               as temperature  (Brief="Temperatura", Unit="K");
    66         P               as pressure             (Brief="Pressure", Unit="atm");
     65        T               as temperature  (Brief="Temperatura", Unit='K');
     66        P               as pressure             (Brief="Pressure", Unit='atm');
    6767
    6868        EQUATIONS
    6969        "Change time in V"
    70         V = time*"l/s";
     70        V = time*'l/s';
    7171       
    7272        "Molar balance for A"
    73         diff(F(1))*"s/l" = r(1);
     73        diff(F(1))*'s/l' = r(1);
    7474        "Molar balance for B"
    75         diff(F(2))*"s/l" = r(2) - kc*C(2);
     75        diff(F(2))*'s/l' = r(2) - kc*C(2);
    7676        "Molar balance for C"
    77         diff(F(3))*"s/l" = r(3);
     77        diff(F(3))*'s/l' = r(3);
    7878       
    7979        "Rate of reaction"
     
    9090        stoic = [-1.0, 1.0, 1.0]; # A <-> B + C
    9191       
    92         kc = 0.20*"1/min";
    93         Kc = 0.05*"mol/l";
     92        kc = 0.20*'1/min';
     93        Kc = 0.05*'mol/l';
    9494       
    9595        SPECIFY
    9696        "Pressure"
    97         P = 8.2*"atm";  # Isobaric system
     97        P = 8.2*'atm';  # Isobaric system
    9898        "Temperature"
    99         T = 500*"K";    # Isotermic system
     99        T = 500*'K';    # Isotermic system
    100100       
    101101        "Specific rate of reaction"
    102         k = 0.7*"1/min";
     102        k = 0.7*'1/min';
    103103
    104104        INITIAL
    105105        "Molar flow"
    106         F = [10, 0.0, 0.0]*"mol/min";
     106        F = [10, 0.0, 0.0]*'mol/min';
    107107
    108108        OPTIONS
    109         time =[0:10:500];
     109        TimeStep =10;
     110        TimeEnd =500;
    110111end
  • branches/newlanguage/sample/reactors/fogler/chap4/molarflow_pfr.mso

    r82 r171  
    4848        PARAMETERS
    4949        NComp   as Integer;
    50         ka              as Real                 (Brief="Specific rate of reaction", Unit="1/min");
     50        ka              as Real                 (Brief="Specific rate of reaction", Unit='1/min');
    5151        Kc              as conc_mol     (Brief="Equilibrium constant");
    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", 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');
    6161       
    6262        EQUATIONS
    6363        "Change time in V"
    64         V = time*"l/s";
     64        V = time*'l/s';
    6565
    6666        "Molar balance"
    67         diff(F(1))= r(1)*"l/s";
     67        diff(F(1))= r(1)*'l/s';
    6868       
    6969        "Reaction rate of A"
     
    8484        SET
    8585        NComp = 2; # components A and B
    86         ka = 2.7*"1/min";
    87         Kc = 1.2*"mol/l";
     86        ka = 2.7*'1/min';
     87        Kc = 1.2*'mol/l';
    8888       
    8989    SPECIFY
    9090        "Input total molar concentration"
    91         Cto = 0.1*"mol/l";
     91        Cto = 0.1*'mol/l';
    9292       
    9393        "Input molar flow"
    94         Fo = [10, 0]*"mol/min";
     94        Fo = [10, 0]*'mol/min';
    9595       
    9696        INITIAL
    9797        "Molar flow of A"
    98         F(1) = 10*"mol/min";
     98        F(1) = 10*'mol/min';
    9999       
    100100        OPTIONS
    101         time=[0:1:100];
     101        TimeStep=1;
     102        TimeEnd=100;
    102103        DAESolver = "dassl";
    103104end
  • branches/newlanguage/sample/reactors/fogler/chap4/semibatch_reactor.mso

    r82 r171  
    5454       
    5555        VARIABLES
    56         C(NComp)        as conc_mol             (Brief="Concentration", Unit="mol/l", Lower=0);
    57         Co(NComp)       as conc_mol             (Brief="Inlet concentration", Unit="mol/l", Lower=0);
     56        C(NComp)        as conc_mol             (Brief="Concentration", Unit='mol/l', Lower=0);
     57        Co(NComp)       as conc_mol             (Brief="Inlet concentration", Unit='mol/l', Lower=0);
    5858       
    59         r(NComp)        as reaction_mol (Brief="Rate of reaction", Unit="mol/l/s");
    60         k                       as Real                 (Brief="Specific rate of reaction", Unit="l/mol/s");
    61         V                       as volume               (Brief="Volume", Unit="l");
     59        r(NComp)        as reaction_mol (Brief="Rate of reaction", Unit='mol/l/s');
     60        k                       as Real                 (Brief="Specific rate of reaction", Unit='l/mol/s');
     61        V                       as volume               (Brief="Volume", Unit='l');
    6262        X                       as fraction     (Brief="Molar conversion", Lower=0);
    6363       
     
    8080        stoic = [-1.0, -1.0, 1.0, 1.0]; # A + B -> C + D
    8181       
    82         Vo = 5.00*"l";
    83         vo = 0.05*"l/s";
    84         Cao= 0.05*"mol/l"; # Initial condition
     82        Vo = 5.00*'l';
     83        vo = 0.05*'l/s';
     84        Cao= 0.05*'mol/l'; # Initial condition
    8585       
    8686        SPECIFY
    8787        "Specific rate of reaction"
    88         k = 2.2*"l/mol/s";
     88        k = 2.2*'l/mol/s';
    8989       
    9090        "Inlet concentration"
    91         Co = [0.0, 0.025, 0.0, 0.0]*"mol/l";
     91        Co = [0.0, 0.025, 0.0, 0.0]*'mol/l';
    9292
    9393        INITIAL
    9494        "Molar concentration"
    95         C = [0.05, 0.0, 0.0, 0.0]*"mol/l";
     95        C = [0.05, 0.0, 0.0, 0.0]*'mol/l';
    9696        "Volume"
    9797        V = Vo;
    9898
    9999        OPTIONS
    100         time =[0:5:500];
     100        TimeStep =5;
     101        TimeEnd =500;
    101102end
  • branches/newlanguage/sample/reactors/fogler/chap4/spheric_reactor.mso

    r82 r171  
    5151
    5252FlowSheet spheric_reactor
    53         PARAMETERS
    54         rho_0 as dens_mass      (Brief="Initial density");
    55         Dp    as length         (Brief="Particle diameter");
    56         k_lin as Real           (Brief="Specific rate of reaction", Unit="m^3/kg/s");
    57         visc  as viscosity      (Brief="Flow viscosity");
    58         L     as length         (Brief="Fixed bed half length");
    59         rho_c as dens_mass      (Brief="Catalyser density");
    60         phi   as fraction       (Brief="Fixed bed porosity");
    61         pi        as Real               (Brief="Number pi", Default=3.14159);
    62         R     as length         (Brief="Radius reactor");
     53
     54PARAMETERS
     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");
    6364       
    6465        VARIABLES
    6566        X     as fraction       (Brief="Molar conversion");
    6667        y     as Real           (Brief="Dimensionless pressure drop (P/P0)", Lower=0);
    67         P     as pressure       (Brief="Output pressure", Unit="kPa");
     68        P     as pressure       (Brief="Output pressure", Unit='kPa');
    6869        z         as length             (Brief="Length of reactor");
    69         beta0 as Real           (Brief="Parameter beta0 of Ergun equation", Unit="Pa/m");
     70        beta0 as Real           (Brief="Parameter beta0 of Ergun equation", Unit='Pa/m');
    7071        Ac    as area           (Brief="Tranversal section area", Lower=0);
    7172        Ca0   as conc_mol       (Brief="Input molar concentration of A");
    7273        Fa0   as flow_mol       (Brief="Input molar flow of A");
    73         P0    as pressure       (Brief="Initial pressure", Unit="kPa");
     74        P0    as pressure       (Brief="Initial pressure", Unit='kPa');
    7475        m         as flow_mass  (Brief="Mass flow");
    7576       
    7677        EQUATIONS
    7778        "Change time in z"
    78         z = time*"m/s";
     79        z = time*'m/s';
    7980       
    8081        "Transversal section area"
     
    8687       
    8788        "Molar conversion"
    88         diff(X) = k_lin*(Ca0*(1 - X)/(1 + X)*y)*rho_c*(1 - phi)*Ac/Fa0*"m/s";
     89        diff(X) = k_lin*(Ca0*(1 - X)/(1 + X)*y)*rho_c*(1 - phi)*Ac/Fa0*'m/s';
    8990       
    9091        "Pressure drop"
    91         diff(y) = -beta0/P0/y*(1 + X)*"m/s";
     92        diff(y) = -beta0/P0/y*(1 + X)*'m/s';
    9293       
    9394        "Dimensionless pressure drop"
     
    9596       
    9697        SET
    97         rho_0 = 32*"kg/m^3";
    98         Dp        = 0.002*"m";
    99         k_lin = 2e-5*"m^3/kg/s";
    100         visc  = 1.5e-5*"kg/m/s";
    101         L         = 2.7*"m";
    102         rho_c = 2600*"kg/m^3";
     98        rho_0 = 32*'kg/m^3';
     99        Dp        = 0.002*'m';
     100        k_lin = 2e-5*'m^3/kg/s';
     101        visc  = 1.5e-5*'kg/m/s';
     102        L         = 2.7*'m';
     103        rho_c = 2600*'kg/m^3';
    103104        phi   = 0.4;
    104         R         = 3*"m";
     105        R         = 3*'m';
    105106       
    106107        SPECIFY
    107108        "Input molar concentration of A"
    108         Ca0 = 320*"mol/m^3";
     109        Ca0 = 320*'mol/m^3';
    109110        "Input molar flow of A"
    110         Fa0 = 440*"mol/s";
     111        Fa0 = 440*'mol/s';
    111112        "Initial pressure"
    112         P0      = 2000*"kPa";
     113        P0      = 2000*'kPa';
    113114        "Input mass flow"
    114         m       = 44*"kg/s";
     115        m       = 44*'kg/s';
    115116
    116117        INITIAL
     
    121122
    122123        OPTIONS
    123         time =[0:0.1:5.4];
     124        TimeStep =0.1;
     125        TimeEnd =5.4;
    124126end
  • branches/newlanguage/sample/reactors/fogler/chap6/hidrodesalkeletion.mso

    r82 r171  
    5656        NReac           as Integer              (Brief="Number of reactions");
    5757        stoic(NComp,NReac) as Real      (Brief="Stoichiometric coefficients");
    58         k(NReac)        as Real                 (Brief="Specific velocity reaction", Unit="(ft^3/lbmol)^.5/h");
     58        k(NReac)        as Real                 (Brief="Specific velocity reaction", Unit='(ft^3/lbmol)^.5/h');
    5959        P                       as pressure     (Brief="Pressure of reactor");
    6060        T                       as temperature  (Brief="Temperature of reactor");
    61         R                       as Real                 (Brief="Universal gas constant", Unit="atm*ft^3/degR/lbmol", Default=0.73);
     61        R                       as Real                 (Brief="Universal gas constant", Unit='atm*ft^3/degR/lbmol', Default=0.73);
    6262        yo(NComp)       as fraction     (Brief="Input molar fraction");
    6363        vo                      as flow_vol     (Brief="Input volumetric flow");
    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", 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');
    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", 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');
    7474
    7575        EQUATIONS
     
    108108        stoic(:,2) = [ 0, -1, -1, 1, 1]; # X + H -> T + Me
    109109       
    110         vo= 476*"ft^3/h";
    111         T = 1500*"degR";
    112         P = 35*"atm";
     110        vo= 476*'ft^3/h';
     111        T = 1500*'degR';
     112        P = 35*'atm';
    113113        yo= [1/3, 2/3, 0.0, 0.0, 0.0];
    114         k = [55.2, 30.2]*"(ft^3/lbmol)^.5/h";
     114        k = [55.2, 30.2]*'(ft^3/lbmol)^.5/h';
    115115       
    116116        INITIAL
     
    119119       
    120120        OPTIONS
    121         time=[0:0.01:0.5]*"h";
     121        TimeStep =0.01;
     122        TimeEnd  =0.5;
     123        TimeUnit = 'h';
    122124end
  • branches/newlanguage/sample/reactors/fogler/chap8/acetic_anhydride.mso

    r82 r171  
    6161        Ta                      as temperature  (Brief="Internal temperature");
    6262        Hr(NComp)       as enth_mol             (Brief="Enthalpy of component");
    63         R                       as Real                 (Brief="Universal gas constant", Unit="kPa*m^3/kmol/K", Default=8.314);
    64         U                       as Real                 (Brief="Heat transfer coefficient", Unit="J/m^2/K/s");
    65         a                       as Real                 (Brief="Heat transfer area per volume of tube", Unit="1/m");
     63        R                       as Real                 (Brief="Universal gas constant", Unit='kPa*m^3/kmol/K', Default=8.314);
     64        U                       as Real                 (Brief="Heat transfer coefficient", Unit='J/m^2/K/s');
     65        a                       as Real                 (Brief="Heat transfer area per volume of tube", Unit='1/m');
    6666        alpha(NComp)as cp_mol           (Brief="Alpha term of Cp expression");
    67         beta(NComp)     as Real                 (Brief="Beta term of Cp expression", Unit="J/mol/K^2");
    68         gamma(NComp)as Real                     (Brief="Gamma term of Cp expression", Unit="J/mol/K^3");
     67        beta(NComp)     as Real                 (Brief="Beta term of Cp expression", Unit='J/mol/K^2');
     68        gamma(NComp)as Real                     (Brief="Gamma term of Cp expression", Unit='J/mol/K^3');
    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");
     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');
    7373        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");
    76         k                       as Real                 (Brief="Specific rate of reaction", Unit="1/s");
    77         T                       as temperature  (Brief="Temperature of reactor", Unit="K");
     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');
     76        k                       as Real                 (Brief="Specific rate of reaction", Unit='1/s');
     77        T                       as temperature  (Brief="Temperature of reactor", Unit='K');
    7878        X                       as fraction     (Brief="Molar conversion", Lower=0);
    79         V                       as volume               (Brief="Volume", Unit="m^3");
     79        V                       as volume               (Brief="Volume", Unit='m^3');
    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", Unit='J/mol/K');
     82        DHr                     as enth_mol             (Brief="Enthalpy of reaction", Unit='kJ/mol'); 
    8383       
    8484        EQUATIONS
    8585        "Change time in V"
    86         V = time*"m^3/s";
     86        V = time*'m^3/s';
    8787       
    8888        "Molar balance"
    89         diff(X) = (-r)/Fa0*"m^3/s";
     89        diff(X) = (-r)/Fa0*'m^3/s';
    9090       
    9191        "Rate of reaction"
     
    9393       
    9494        "Specific rate of reaction"
    95         k = exp(34.34)*exp(-34222*"K"/T)*"1/s";
     95        k = exp(34.34)*exp(-34222*'K'/T)*'1/s';
    9696       
    9797        "Concentration of component A"
     
    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)*(Fa0*(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";
    134        
    135         R.alpha = [26.63,  20.04, 13.39]*"J/mol/K";
    136         R.beta  = [0.183, 0.0945, 0.077]*"J/mol/K^2";
    137         R.gamma = [-45.86e-6, -30.95e-6, -18.71e-6]*"J/mol/K^3";
    138        
    139         R.Hr = [-216.67, -61.09, -74.81]*"kJ/mol";
    140         R.Tr = 298*"K";
    141         R.T0 = 1035*"K";
    142         R.Ta = 1150*"K";
    143         R.U  = 0.0*"J/m^2/K/s";
    144         R.a  = 150*"1/m";
     133        R.Pa0 = 162*'kPa';
     134       
     135        R.alpha = [26.63,  20.04, 13.39]*'J/mol/K';
     136        R.beta  = [0.183, 0.0945, 0.077]*'J/mol/K^2';
     137        R.gamma = [-45.86e-6, -30.95e-6, -18.71e-6]*'J/mol/K^3';
     138       
     139        R.Hr = [-216.67, -61.09, -74.81]*'kJ/mol';
     140        R.Tr = 298*'K';
     141        R.T0 = 1035*'K';
     142        R.Ta = 1150*'K';
     143        R.U  = 0.0*'J/m^2/K/s';
     144        R.a  = 150*'1/m';
    145145       
    146146        SPECIFY
    147147        "Inlet molar flow"
    148         R.Fa0 = (8000/58)*"kmol/h";
     148        R.Fa0 = (8000/58)*'kmol/h';
    149149       
    150150        INITIAL
     
    152152        R.X = 0.0;
    153153        "Temperature"
    154         R.T = 1035*"K";
     154        R.T = 1035*'K';
    155155       
    156156        OPTIONS
    157         time = [0:0.05:5];
     157        TimeStep = 0.05;
     158        TimeEnd = 5;
    158159end
    159160
     
    171172        R.stoic = [-1.0, 1.0, 1.0]; # A -> B + C
    172173       
    173         R.Pa0 = 162*"kPa";
    174        
    175         R.alpha = [26.63,  20.04, 13.39]*"J/mol/K";
    176         R.beta  = [0.183, 0.0945, 0.077]*"J/mol/K^2";
    177         R.gamma = [-45.86e-6, -30.95e-6, -18.71e-6]*"J/mol/K^3";
    178        
    179         R.Hr = [-216.67, -61.09, -74.81]*"kJ/mol";
    180         R.Tr = 298*"K";
    181         R.T0 = 1035*"K";
    182         R.Ta = 1150*"K";
    183         R.U  = 110*"J/m^2/K/s";
    184         R.a  = 150*"1/m";
     174        R.Pa0 = 162*'kPa';
     175       
     176        R.alpha = [26.63,  20.04, 13.39]*'J/mol/K';
     177        R.beta  = [0.183, 0.0945, 0.077]*'J/mol/K^2';
     178        R.gamma = [-45.86e-6, -30.95e-6, -18.71e-6]*'J/mol/K^3';
     179       
     180        R.Hr = [-216.67, -61.09, -74.81]*'kJ/mol';
     181        R.Tr = 298*'K';
     182        R.T0 = 1035*'K';
     183        R.Ta = 1150*'K';
     184        R.U  = 110*'J/m^2/K/s';
     185        R.a  = 150*'1/m';
    185186       
    186187        SPECIFY
    187188        "Inlet molar flow"
    188         R.Fa0 = (18.8*2e-3)*"mol/s";
     189        R.Fa0 = (18.8*2e-3)*'mol/s';
    189190       
    190191        INITIAL
     
    192193        R.X = 0.0;
    193194        "Temperature"
    194         R.T = 1035*"K";
     195        R.T = 1035*'K';
    195196       
    196197        OPTIONS
    197         time = [0:1e-5:1e-3];
     198        TimeStep = 1e-5;
     199        TimeEnd = 1e-3;
    198200end
  • branches/newlanguage/sample/reactors/fogler/chap8/propylene_glycol.mso

    r82 r171  
    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");
    63         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");
     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');
     63        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');
    6565        V                       as volume               (Brief="Volume of the reactor");
    6666        # Rate of reaction
    6767        A                       as frequency    (Brief="Frequency factor");
    68         E                       as Real                 (Brief="Energy activation", Unit="Btu/lbmol");
    69         R                       as Real                 (Brief="Universal gas constant", Unit="Btu/lbmol/degR", Default=1.987);
     68        E                       as Real                 (Brief="Energy activation", Unit='Btu/lbmol');
     69        R                       as Real                 (Brief="Universal gas constant", Unit='Btu/lbmol/degR', Default=1.987);
    7070
    7171        VARIABLES
    72         T                       as temperature  (Brief="Temperature", Unit="degR");
    73         k                       as Real                 (Brief="Specific rate of reaction", Unit="1/h");
     72        T                       as temperature  (Brief="Temperature", Unit='degR');
     73        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", Unit='h');
    7777        Theta(NComp)as Real                     (Brief="Molar fraction between components");
    7878       
    7979        EQUATIONS
    8080        "Change time in T"
    81         T = time*"degR/s";
     81        T = time*'degR/s';
    8282       
    8383        "Residence time"
     
    101101        stoic = [-1, -1, 1, 0]; # A + B -> C
    102102       
    103         V       = 300*"gal";
    104         Hro = [-6.66e4, -1.23e5, -2.26e5, 0]*"Btu/lbmol"; # at Tr
    105         Cp  = [35, 18, 46, 19.5]*"Btu/lbmol/degR";
    106         vo  = [46.62, 233.1, 0, 46.62]*"ft^3/h";
     103        V       = 300*'gal';
     104        Hro = [-6.66e4, -1.23e5, -2.26e5, 0]*'Btu/lbmol'; # at Tr
     105        Cp  = [35, 18, 46, 19.5]*'Btu/lbmol/degR';
     106        vo  = [46.62, 233.1, 0, 46.62]*'ft^3/h';
    107107       
    108         Fo      = [43.04, 802.8, 0, 71.87]*"lbmol/h";
    109         To      = (75 + 459.69)*"degR";
    110         Tr      = (68 + 459.69)*"degR";
     108        Fo      = [43.04, 802.8, 0, 71.87]*'lbmol/h';
     109        To      = (75 + 459.69)*'degR';
     110        Tr      = (68 + 459.69)*'degR';
    111111       
    112         A       = 16.96e12*"1/h";
    113         E       = 32400*"Btu/lbmol";
     112        A       = 16.96e12*'1/h';
     113        E       = 32400*'Btu/lbmol';
    114114       
    115115        OPTIONS
    116         time=[535:0.45:625];   
     116#       time=[535:0.45:625];   
    117117end
    118118
     
    126126        NComp           as Integer              (Brief="Number of components", Lower=1);
    127127        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");
     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');
    130130        To                      as temperature  (Brief="Initial temperature");
    131131        Tr                      as temperature  (Brief="Reference temperature");
    132132        Ta                      as temperature  (Brief="Temperature of cooling");
    133         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");
     133        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');
    135135        V                       as volume               (Brief="Volume of the reactor");
    136136        U                       as heat_trans_coeff(Brief="Heat transfer coefficient");
     
    138138        # Rate of reaction
    139139        A                       as frequency    (Brief="Frequency factor");
    140         E                       as Real                 (Brief="Energy Activation", Unit="Btu/lbmol");
    141         R                       as Real                 (Brief="Universal gas constant", Unit="Btu/lbmol/degR", Default=1.987);
     140        E                       as Real                 (Brief="Energy Activation", Unit='Btu/lbmol');
     141        R                       as Real                 (Brief="Universal gas constant", Unit='Btu/lbmol/degR', Default=1.987);
    142142
    143143        VARIABLES
    144144        XMB                     as fraction             (Brief="Molar conversion as Material balance");
    145145        XEB                     as fraction             (Brief="Molar conversion as Energy balance", Lower=-0.1, Upper=1.5);
    146         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");
     146        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');
    149149        Theta(NComp)as Real                     (Brief="Molar fraction between components");
    150150       
    151151        EQUATIONS
    152152        "Change time in T"
    153         T = time*"degR/s";
     153        T = time*'degR/s';
    154154       
    155155        "Specific rate of reaction"
     
    174174        stoic = [-1, -1, 1, 0]; # A + B -> C
    175175       
    176         V       = 300*"gal";
    177         U       = 100*"Btu/ft^2/h/degR";
    178         a       = 40*"ft^2";
     176        V       = 300*'gal';
     177        U       = 100*'Btu/ft^2/h/degR';
     178        a       = 40*'ft^2';
    179179       
    180         Hro = [-6.66e4, -1.23e5, -2.26e5, 0]*"Btu/lbmol"; # at Tr
    181         Cp  = [35, 18, 46, 19.5]*"Btu/lbmol/degR";
    182         vo  = [46.62, 233.1, 0, 46.62]*"ft^3/h";
    183         Fo      = [43.04, 802.8, 0, 71.87]*"lbmol/h";
     180        Hro = [-6.66e4, -1.23e5, -2.26e5, 0]*'Btu/lbmol'; # at Tr
     181        Cp  = [35, 18, 46, 19.5]*'Btu/lbmol/degR';
     182        vo  = [46.62, 233.1, 0, 46.62]*'ft^3/h';
     183        Fo      = [43.04, 802.8, 0, 71.87]*'lbmol/h';
    184184       
    185         To      = (75 + 459.69)*"degR";
    186         Tr      = (68 + 459.69)*"degR";
    187         Ta      = (85 + 459.69)*"degR";
     185        To      = (75 + 459.69)*'degR';
     186        Tr      = (68 + 459.69)*'degR';
     187        Ta      = (85 + 459.69)*'degR';
    188188       
    189         A       = 16.96e12*"1/h";
    190         E       = 32400*"Btu/lbmol";
     189        A       = 16.96e12*'1/h';
     190        E       = 32400*'Btu/lbmol';
    191191       
    192192        OPTIONS
    193         time=[535:0.45:625];
     193#       time    =[535:0.45:625]; original
     194       
     195        TimeStep        =0.45;
     196        TimeEnd         =625;
    194197end
  • branches/newlanguage/sample/reactors/fogler/chap8/series_reactions.mso

    r82 r171  
    5656        vo              as flow_vol     (Brief="Volumetric flow");
    5757        Cp              as cp_mol               (Brief="Heat capacity");
    58         UA              as Real                 (Brief="Heat change", Unit="J/min/K");
     58        UA              as Real                 (Brief="Heat change", Unit='J/min/K');
    5959        tau             as time_min     (Brief="Residence time");
    6060       
     
    6262        Tr_ko(NReac)as temperature      (Brief="Reference temperature for ko");
    6363       
    64         ko(NReac)       as Real                 (Brief="Frequency factor", Unit="1/min");
     64        ko(NReac)       as Real                 (Brief="Frequency factor", Unit='1/min');
    6565        E(NReac)        as energy_mol   (Brief="Activation energy");
    66         R                       as Real                 (Brief="Universal gas constant", Unit="cal/mol/K", Default=1.987);
     66        R                       as Real                 (Brief="Universal gas constant", Unit='cal/mol/K', Default=1.987);
    6767       
    6868        VARIABLES
     
    7373        kappa           as Real                 (Brief="Kappa parameter");
    7474        Tc              as temperature  (Brief="Temperature of reactor surface");
    75         k(NReac)        as Real                 (Brief="Specific rate of reaction", Unit="1/min");
     75        k(NReac)        as Real                 (Brief="Specific rate of reaction", Unit='1/min');
    7676        Co              as conc_mol     (Brief="Initial concentration of A");
    7777        To              as temperature  (Brief="Initial temperature");
     
    7979        EQUATIONS
    8080        "Temperature profile"
    81         diff(T) = 2*"K/min";
     81        diff(T) = 2*'K/min';
    8282       
    8383        "Parameter kappa"
     
    110110        NReac = 2; # A->B->C
    111111       
    112         DH      = [-5.50e4, -7.15e4]*"J/mol";
    113         vo      = 1000*"m^3/min";
     112        DH      = [-5.50e4, -7.15e4]*'J/mol';
     113        vo      = 1000*'m^3/min';
    114114       
    115         ko      = [ 3.30,  4.58]*"1/min";
    116         E       = [9.9e3, 2.7e4]*"cal/mol";
    117         Tr_ko = [300, 500]*"K";
     115        ko      = [ 3.30,  4.58]*'1/min';
     116        E       = [9.9e3, 2.7e4]*'cal/mol';
     117        Tr_ko = [300, 500]*'K';
    118118       
    119         Cp      = 200*"J/mol/K";
    120         UA      = 4e4*"J/min/K";
    121         tau     = 0.01*"min";
    122         Ta      = 330*"K";
     119        Cp      = 200*'J/mol/K';
     120        UA      = 4e4*'J/min/K';
     121        tau     = 0.01*'min';
     122        Ta      = 330*'K';
    123123       
    124124        SPECIFY
    125125        "Inlet temperature"
    126         To = 283*"K" ;
     126        To = 283*'K' ;
    127127        "Inlet concentration of A"
    128         Co= 0.3*"mol/m^3";
     128        Co= 0.3*'mol/m^3';
    129129
    130130        INITIAL
    131131        "Temperature"
    132         T = 283*"K";
     132        T = 283*'K';
    133133
    134134        OPTIONS
    135         time = [0:2:225]*"min";
     135        TimeStep = 2;
     136        TimeEnd = 225;
     137        TimeUnit ='min';
    136138end
Note: See TracChangeset for help on using the changeset viewer.