Changeset 813 for branches/gui/sample


Ignore:
Timestamp:
Aug 5, 2009, 4:00:16 PM (13 years ago)
Author:
Rafael de Pelegrini Soares
Message:

Fixed PFR model and sample

File:
1 edited

Legend:

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

    r745 r813  
    3939PARAMETERS
    4040
    41         PP              as Plugin (Brief="Physical Properties",
     41        PP as Plugin (Brief="Physical Properties",
    4242                Type = "PP",
    43                 Components = ["acetone", "acetic anhydride", "methane" ],
     43                Components = ["acetone", "ketene", "methane" ],
    4444                LiquidModel = "PR",
    4545                VapourModel = "PR"
    4646        );
    4747        NComp   as Integer;
     48SET
     49        NComp = PP.NumberOfComponents;
    4850
    4951DEVICES
     52        s1      as source;
     53        Reac    as pfr;
    5054
    51         s1      as simple_source;
    52         Reac as pfr;
     55CONNECTIONS
     56        s1.Outlet  to  Reac.Inlet;
     57       
     58SET
     59        Reac.NDisc      = 15;
     60        Reac.L          = 2.28 * 'm';
     61        # Area was chosen to match the original example data
     62        Reac.Across = 1.27*'m^3'/Reac.L;
    5363
    54 SET
    55         NComp = PP.NumberOfComponents;
    56        
    57         s1.ValidPhases = "Vapour-Liquid";
    58         #s1.CompositionBasis = "Molar";
    59        
    60         Reac.NDisc      = 10;
    61         Reac.Dpipe      = 3 * 'in';
    62         Reac.L                  = 15 * 'm';
     64        # Only one reaction
    6365        Reac.NReac      = 1;
    64         Reac.Roughness  = 4.572E-5*'m';
     66        # Reaction 1: acetone -> ketene + methane
     67        Reac.stoic(:,1) = [-1, 1, 1];
    6568
    66         # Reaction 1: A -> B + C
    67         Reac.stoic(:,1) = [-1, 1, 1];
     69SPECIFY
     70        # Feed specification
     71        s1.Fw = 8000 * 'kg/h';
     72        s1.T = 1035 * 'K';
     73        s1.P = 1.6  * 'atm';
     74        s1.Composition = [0.98, 0.01, 0.01];
     75
     76        # Adiabatic
     77        Reac.q     = 0     * 'J/s';
    6878       
    6979EQUATIONS
     
    7787        Reac.Hr(1,z) = -80.77 * 'kJ/mol';
    7888
     89"Pressure Drop (no pressure drop)"
     90        Reac.str(z+1).P = Reac.str(z).P;
     91
    7992end
    8093
    81 SPECIFY
    82         s1.F = 138/1000 * 'kmol/h';
    83         s1.T = 1035 * 'K';
    84         s1.P = 1.6  * 'atm';
    85         s1.MolarComposition = [1, 0, 0];
    86 
    87         Reac.q     = 0     * 'J/s';
    88        
    89 CONNECTIONS
    90 
    91         s1.Outlet  to  Reac.Inlet;
    92        
    9394INITIAL
    9495
    9596for z in [2:Reac.NDisc+1] do
     97        Reac.str(z).T = Reac.Inlet.T;
     98        Reac.str(z).z(1:NComp) = Reac.Inlet.z(1:NComp);
     99end
    96100       
    97         Reac.str(z).T = Reac.Inlet.T;
    98         Reac.vel(z) = Reac.vel(1);
    99         #Reac.str(z).F = Reac.str(1).F;
    100         Reac.str(z).z(1:NComp-1) = Reac.Inlet.z(1:NComp-1);
    101 
    102 end
    103 
    104 VARIABLES
    105 
    106 SOMA as Real;
    107 
    108 EQUATIONS
    109 
    110 SOMA = sum(Reac.Outlet.z);
    111 
    112101OPTIONS
    113         # This model can be solved in both steady or dynamic
    114102        Dynamic         = true;
    115103        TimeStep        = 0.05;
    116         TimeEnd         = 3;
    117         DAESolver(File="sundials", RelativeAccuracy=1e-2);
    118         NLASolver(RelativeAccuracy=1e-4);
     104        TimeEnd         = 10;
    119105        #InitialFile = "PFR_AceticAnhydride";
    120         #Dynamic = false;
    121         #DAESolver = "dassl";
     106        #Dynamic = false; # Requires a GuessFile from a dynamic simulation
    122107end
Note: See TracChangeset for help on using the changeset viewer.