Ignore:
Timestamp:
Mar 1, 2007, 3:35:36 PM (17 years ago)
Author:
gerson bicca
Message:

updated pfr reactor model for the new language

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/newlanguage/sample/reactors/sample_pfr.mso

    r82 r170  
    3636
    3737FlowSheet PFR_AceticAnhydride
    38         PARAMETERS
    39         PP   as CalcObject(Brief="Physical Properties",File="vrpp");
    40         NComp as Integer;
     38       
     39PARAMETERS
    4140
    42         DEVICES
    43         s1   as streamTP;
     41        PP              as Plugin (Brief="Physical Properties",File="vrpp");
     42        NComp   as Integer;
     43
     44DEVICES
     45
     46        s1      as source;
    4447        Reac as pfr;
    4548
    46         SET
    47         PP.Components = ["acetone", "acetic anhydride", "methane" ];
    48         PP.LiquidModel = "PR";
    49         PP.VapourModel = "PR";
     49SET
     50
     51        PP.Components   = ["acetone", "acetic anhydride", "methane" ];
     52        PP.LiquidModel  = "PR";
     53        PP.VapourModel  = "PR";
    5054       
    5155        NComp = PP.NumberOfComponents;
    5256       
    53         Reac.NDisc = 10;
    54         Reac.Across = 0.7 * "in^2";
    55         Reac.L = 2.28 * "m";
    56         Reac.NReac = 1;
     57        Reac.NDisc      = 10;
     58        Reac.Across     = 0.7 * 'in^2';
     59        Reac.L                  = 2.28 * 'm';
     60        Reac.NReac      = 1;
    5761
    5862        # Reaction 1: A -> B + C
    5963        Reac.stoic(:,1) = [-1, 1, 1];
    6064       
    61         EQUATIONS
     65EQUATIONS
    6266
    63         for z in [1:Reac.NDisc]
    64                 "Reaction Rate = k*C(1)"
    65                 Reac.r(1,z)  = exp(34.34 - (34222 * "K") / Reac.str(z).T)*"1/s" * Reac.C(1,z);
     67for z in [1:Reac.NDisc]
     68       
     69"Reaction Rate = k*C(1)"
     70        Reac.r(1,z)  = exp(34.34 - (34222 * 'K') / Reac.str(z).T)*'1/s' * Reac.C(1,z);
    6671
    67                 "Heat of reaction"
    68                 Reac.Hr(1,z) = -80.77 * "kJ/mol";
     72"Heat of reaction"
     73        Reac.Hr(1,z) = -80.77 * 'kJ/mol';
    6974
    70                 "Pressure Drop (no pressure drop)"
    71                 Reac.str(z+1).P = Reac.str(z).P;
    72         end
     75"Pressure Drop (no pressure drop)"
     76        Reac.str(z+1).P = Reac.str(z).P;
    7377
    74         SPECIFY
    75         s1.F = 138/1000 * "kmol/h";
    76         s1.T = 1035 * "K";
    77         s1.P = 1.6  * "atm";
    78         s1.z = [1, 0, 0];
     78end
    7979
    80         "Adiabatic"
    81         Reac.q     = 0     * "J/s";
     80SPECIFY
     81        s1.Outlet.F = 138/1000 * 'kmol/h';
     82        s1.Outlet.T = 1035 * 'K';
     83        s1.Outlet.P = 1.6  * 'atm';
     84        s1.Outlet.z = [1, 0, 0];
     85
     86"Adiabatic"
     87        Reac.q     = 0     * 'J/s';
    8288       
    83         CONNECTIONS
    84         s1  to  Reac.Inlet;
     89CONNECTIONS
     90
     91        s1.Outlet  to  Reac.Inlet;
    8592       
    86         INITIAL
    87         for z in [2:Reac.NDisc+1]
    88                 Reac.str(z).T = Reac.Inlet.T;
    89                 Reac.str(z).z(1:NComp-1) = Reac.Inlet.z(1:NComp-1);
    90         end
     93INITIAL
     94
     95for z in [2:Reac.NDisc+1]
    9196       
    92         OPTIONS
     97        Reac.str(z).T = Reac.Inlet.T;
     98        Reac.str(z).z(1:NComp-1) = Reac.Inlet.z(1:NComp-1);
     99
     100end
     101       
     102OPTIONS
    93103        # This model can be solved in both steady or dynamic
    94         #mode = "steady";
    95         time = [0:0.05:3] * "s";
    96         NLASolver = "sundials";
     104        Dynamic         = true;
     105        TimeStep        = 0.05;
     106        TimeEnd         = 3;
     107        NLASolver       = "sundials";
    97108        #DAESolver = "dassl";
    98109end
Note: See TracChangeset for help on using the changeset viewer.