Changeset 169


Ignore:
Timestamp:
Mar 1, 2007, 3:09:21 PM (16 years ago)
Author:
gerson bicca
Message:

updated cstr reactor model for the new language

Location:
branches/newlanguage
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/newlanguage/eml/reactors/cstr.mso

    r77 r169  
    1616* Model of cstr reactor
    1717*--------------------------------------------------------------------
    18 *
    19 *
    20 *
    21 *----------------------------------------------------------------------
    2218* Author: Paula B. Staudt
    2319* $Id$
     
    2723
    2824Model cstr_basic
    29         PARAMETERS
    30 ext     NComp as Integer;
    31         NReac as Integer;
    32         stoic(NComp, NReac) as Real (Brief = "Stoichiometric Matrix");
    3325
    34         VARIABLES
    35 in      Inlet  as stream;
    36 out     Outlet as stream_therm;
    37         q    as heat_rate;
    38         Vr   as volume (Brief="Reacting Volume");
    39         M    as mol (Brief = "Molar total amount");
    40         C(NComp)  as conc_mol(Brief="Components concentration");
     26ATTRIBUTES
     27        Pallete         = false;
     28        Brief           = "Brief";
     29        Info            =
     30        "write some information";
     31       
     32PARAMETERS
    4133
    42         EQUATIONS
    43         "Molar fraction"
     34outer   NComp                                           as Integer      (Brief = "Number Of Components");
     35                NReac                                           as Integer      (Brief = "Number Of Reactions");
     36                stoic(NComp, NReac)     as Real                 (Brief = "Stoichiometric Matrix");
     37
     38VARIABLES
     39
     40in              Inlet   as stream               (Brief="Inlet Stream");
     41out     Outlet  as streamPH     (Brief="Outlet Stream");
     42
     43        q                       as heat_rate    (Brief="Heat");
     44        Vr                      as volume               (Brief="Reacting Volume");
     45        M                       as mol                  (Brief = "Molar total amount");
     46        C(NComp)        as conc_mol     (Brief="Components concentration");
     47
     48EQUATIONS
     49
     50"Molar fraction"
    4451        Outlet.z * M = C * Vr;
    45         "Vapourisation Fraction"
     52       
     53"Vapourisation Fraction"
    4654        Outlet.v = Inlet.v;
     55
    4756end
    4857
    4958Model cstr_yield as cstr_basic
    50         PARAMETERS
    51         yield(NReac) as fraction;
     59
     60ATTRIBUTES
     61        Pallete         = true;
     62        Brief           = "Brief";
     63        Info            =
     64        "write some information";
    5265       
    53         EQUATIONS
     66PARAMETERS
     67       
     68        yield(NReac) as fraction (Brief="Yield");
     69       
     70EQUATIONS
     71
    5472        Outlet.z*Outlet.F = Inlet.z*Inlet.F * sumt(stoic*(1-yield));
    55         "Reactor Energy Balance"
     73
     74"Reactor Energy Balance"
    5675        diff(M*Outlet.h) = Inlet.F*Inlet.h - Outlet.F*Outlet.h - q;
     76
    5777end
    5878
    5979
    6080Model cstr as cstr_basic
    61         VARIABLES
    62         r(NReac) as reaction_mol;
    63         Hr(NReac) as heat_reaction;
    6481       
    65         EQUATIONS
    66         "Component Molar Balance"
     82ATTRIBUTES
     83        Pallete         = true;
     84        Brief           = "Brief";
     85        Info            =
     86        "write some information";
     87       
     88VARIABLES
     89       
     90        r(NReac)        as reaction_mol         (Brief="Molar Reaction Rate");
     91        Hr(NReac)       as heat_reaction        (Brief="Heat Reaction");
     92       
     93EQUATIONS
     94
     95"Component Molar Balance"
    6796        diff(Outlet.z*M) = (Inlet.F*Inlet.z - Outlet.F*Outlet.z) + sumt(stoic*r)*Vr;
    6897
    69         "Reactor Energy Balance"
    70         diff(M*Outlet.h) = Inlet.F*Inlet.h - Outlet.F*Outlet.h +
    71                 sum(Hr*sum(stoic*r))*Vr - q;
     98"Reactor Energy Balance"
     99        diff(M*Outlet.h) = Inlet.F*Inlet.h - Outlet.F*Outlet.h +sum(Hr*sum(stoic*r))*Vr - q;
     100
    72101end
  • branches/newlanguage/sample/reactors/sample_cstr.mso

    r82 r169  
    2727
    2828FlowSheet cstr_PropyleneGlycol
    29         PARAMETERS
    30         PP   as CalcObject(Brief="Physical Properties",File="vrpp");
    31         NComp as Integer;
    32         R as Real(Default=8.3145, Unit="J/mol/K");
    3329
    34         DEVICES
    35         s1   as stream_therm;
    36         Reac as cstr;
     30PARAMETERS
     31        PP              as Plugin       (Brief="Physical Properties",File="vrpp");
     32        NComp   as Integer;
     33        R                       as Real         (Default=8.3145, Unit='J/mol/K');
    3734
    38         SET
    39         PP.Components = ["1,2-propylene oxide", "methanol",
    40                 "water", "sulfuric acid", "1,2-propylene glycol" ];
    41         PP.LiquidModel = "PR";
    42         PP.VapourModel = "PR";
     35DEVICES
     36        s1      as source;
     37        Reac    as cstr;
    4338
    44         NComp = PP.NumberOfComponents;
    45         Reac.NReac = 1;
    46         Reac.stoic = [-1, 0, -1, 0, 1];
     39SET
     40
     41        PP.Components   = ["1,2-propylene oxide", "methanol","water","sulfuric acid", "1,2-propylene glycol" ];
     42        PP.LiquidModel  = "PR";
     43        PP.VapourModel  = "PR";
     44
     45        NComp                   = PP.NumberOfComponents;
     46        Reac.NReac      = 1;
     47        Reac.stoic              = [-1, 0, -1, 0, 1];
    4748       
    48         EQUATIONS
     49EQUATIONS
     50
    4951#       Reac.Hr = -36400 * "Btu/lbmol" - 7 * "Btu/lbmol/degR" * (Reac.Fout.T - 528 * "degR");
    5052#       Reac.r = 16.96e12 / "h" * exp(- 32400 * "Btu/lbmol"/R/Reac.Fout.T)
    5153#               * Reac.C(1);
    52         Reac.Hr = 0 * "Btu/lbmol";
    53         Reac.r  = 0 * "mol/l/s";
     54        Reac.Hr = 0 * 'Btu/lbmol';
     55        Reac.r  = 0 * 'mol/l/s';
    5456
    5557        SPECIFY
    56         s1.F = 52126 * "mol/h";
    57         s1.P = 1     * "atm";
    58         s1.T = 534.67* "degR";
    59         s1.z = [0.0468, 0.0783, 0.874, 0.0009, 0];
    60         s1.v = 0.0;
     58        s1.Outlet.F = 52126 * 'mol/h';
     59        s1.Outlet.P = 1     * 'atm';
     60        s1.Outlet.T = 534.67* 'degR';
     61        s1.Outlet.z = [0.0468, 0.0783, 0.874, 0.0009, 0];
     62        s1.Outlet.v = 0.0;
    6163
    62         Reac.Vr    = 300   * "gal";
    63         Reac.Outlet.F= Reac.Inlet.F;
    64         "Adiabatic"
    65         Reac.q     = 0     * "J/s";
    66         Reac.Outlet.P= 1     * "atm";
     64        Reac.Vr                 = 300   * 'gal';
     65        Reac.Outlet.F   = Reac.Inlet.F;
     66
     67"Adiabatic"
     68        Reac.q                  = 0     * 'J/s';
     69        Reac.Outlet.P   = 1     * 'atm';
    6770       
    68         CONNECTIONS
    69         s1  to  Reac.Inlet;
     71CONNECTIONS
     72
     73        s1.Outlet  to  Reac.Inlet;
    7074       
    71         INITIAL
     75INITIAL
     76
    7277        Reac.Outlet.T = Reac.Inlet.T;
    7378        Reac.Outlet.z = Reac.Inlet.z;
    7479
    75         OPTIONS
    76         time = [0:0.1:5]*"h";
     80OPTIONS
     81        TimeStep        = 0.1;
     82        TimeEnd         = 5;
     83
    7784end
Note: See TracChangeset for help on using the changeset viewer.