Changeset 175


Ignore:
Timestamp:
Mar 2, 2007, 1:57:58 PM (16 years ago)
Author:
gerson bicca
Message:

updated sepComp model and samples of mixers/splitter

Location:
branches/newlanguage
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/newlanguage/eml/mixers_splitters/sepComp.mso

    r76 r175  
    5252Model sepComp_n
    5353       
     54PARAMETERS
    5455
    55         PARAMETERS
    56 ext PP   as CalcObject (Brief = "External Physical Properties");
    57 ext     NComp as Integer (Brief = "Number of chemical components", Lower = 1);
    58         NOutlet as Integer (Brief = "Number of Outlet Streams", Lower = 1);
    59         mainComp as Integer (Brief = "Component specified", Default = 1, Lower = 1);
     56outer PP                        as Plugin       (Brief = "External Physical Properties");
     57outer   NComp           as Integer      (Brief = "Number of chemical components", Lower = 1);
     58                NOutlet                 as Integer      (Brief = "Number of Outlet Streams", Lower = 1);
     59                mainComp        as Integer      (Brief = "Component specified", Default = 1, Lower = 1);
    6060       
    61         VARIABLES
    62 in      Inlet   as stream;
    63 out Outlet(NOutlet) as stream;
    64         frac(NOutlet) as fraction (Brief = "Distribution of the Outlet streams");
    65         recovery(NOutlet) as fraction (Brief = "Recovery of the component specified");
     61VARIABLES
    6662
    67         EQUATIONS
     63in              Inlet                                   as stream;
     64out     Outlet(NOutlet)         as stream;
     65
     66        frac(NOutlet)                   as fraction (Brief = "Distribution of the Outlet streams");
     67        recovery(NOutlet)       as fraction (Brief = "Recovery of the component specified");
     68
     69EQUATIONS
    6870       
    69         "Flow"
     71"Flow"
    7072        sum(Outlet.F) = Inlet.F;
    7173       
    7274       
    73         for i in [1:NOutlet-1]
    74                
    75                 "Mol fraction normalisation"
    76                 sum(Outlet(i).z) = 1;
    77         end
     75for i in [1:NOutlet-1]
     76
     77"Mol fraction normalisation"
     78        sum(Outlet(i).z) = 1;
     79
     80end
    7881       
    7982       
    80         for i in [1:NComp]
     83for i in [1:NComp]
    8184       
    82         "Composition"
    83                 sum(Outlet.F*Outlet.z(i)) = Inlet.F*Inlet.z(i);
     85"Composition"
     86        sum(Outlet.F*Outlet.z(i)) = Inlet.F*Inlet.z(i);
    8487       
    85         end     
     88end     
    8689       
    8790       
    88         for i in [1:NOutlet]
    89                
    90                 "Flow"
    91                 Outlet(i).F = Inlet.F*frac(i);
    92                
    93                 "Recovery"
    94                 recovery(i)*Inlet.z(mainComp) = frac(i)*Outlet(i).z(mainComp);
     91for i in [1:NOutlet]
    9592       
    96                 "Pressure"
    97                 Outlet(i).P = Inlet.P;
     93"Flow"
     94        Outlet(i).F = Inlet.F*frac(i);
    9895       
    99                 "Enthalpy"
    100                 Outlet(i).h = (1-Outlet(i).v)*PP.LiquidEnthalpy(Outlet(i).T, Outlet(i).P, Outlet(i).z) +
     96"Recovery"
     97        recovery(i)*Inlet.z(mainComp) = frac(i)*Outlet(i).z(mainComp);
     98       
     99"Pressure"
     100        Outlet(i).P = Inlet.P;
     101       
     102"Enthalpy"
     103        Outlet(i).h = (1-Outlet(i).v)*PP.LiquidEnthalpy(Outlet(i).T, Outlet(i).P, Outlet(i).z) +
    101104                                Outlet(i).v*PP.VapourEnthalpy(Outlet(i).T, Outlet(i).P, Outlet(i).z);
    102105       
    103                 "Temperature"   
    104                 Outlet(i).T = Inlet.T;
    105          
    106                 "Vapourization Fraction"
    107                 Outlet(i).v = PP.VapourFraction(Outlet(i).T, Outlet(i).P, Outlet(i).z);
    108         end
     106"Temperature"   
     107        Outlet(i).T = Inlet.T;
     108
     109"Vapourization Fraction"
     110        Outlet(i).v = PP.VapourFraction(Outlet(i).T, Outlet(i).P, Outlet(i).z);
     111       
     112end
     113
    109114end
    110115
     
    112117Model sepComp
    113118       
    114         PARAMETERS
    115 ext PP   as CalcObject (Brief = "External Physical Properties");
    116 ext     NComp as Integer (Brief = "Number of chemical components", Lower = 1);
    117         mainComp as Integer (Brief = "Component specified", Default = 1, Lower = 1);
     119PARAMETERS
     120
     121outer PP                        as Plugin       (Brief = "External Physical Properties");
     122outer   NComp           as Integer      (Brief = "Number of chemical components", Lower = 1);
     123                mainComp        as Integer      (Brief = "Component specified", Default = 1, Lower = 1);
    118124       
    119         VARIABLES
    120 in      Inlet   as stream;
    121 out Outlet1 as stream;
    122 out Outlet2 as stream;
    123         frac as fraction (Brief = "Fraction to Outlet 1");
    124         recovery as fraction (Brief = "Recovery of the component specified");
     125VARIABLES
     126
     127in              Inlet           as stream;
     128out     Outlet1         as stream;
     129out     Outlet2         as stream;
     130       
     131        frac                    as fraction (Brief = "Fraction to Outlet 1");
     132        recovery        as fraction (Brief = "Recovery of the component specified");
    125133
    126134        EQUATIONS
    127135       
    128         "Flow"
     136"Flow"
    129137        Outlet1.F = Inlet.F * frac;
    130138        Outlet1.F + Outlet2.F = Inlet.F;
     
    134142        sum(Outlet1.z) = 1;
    135143       
    136         for i in [1:NComp]
    137                
    138         "Composition"
    139                 Outlet1.F*Outlet1.z(i) + Outlet2.F*Outlet2.z(i) = Inlet.F*Inlet.z(i);
    140         end
     144for i in [1:NComp]
    141145       
    142         "Pressure"
     146 "Composition"
     147        Outlet1.F*Outlet1.z(i) + Outlet2.F*Outlet2.z(i) = Inlet.F*Inlet.z(i);
     148
     149end
     150       
     151"Pressure"
    143152        Outlet1.P = Inlet.P;
    144153        Outlet2.P = Inlet.P;
    145154       
    146         "Enthalpy"
     155"Enthalpy"
    147156        Outlet1.h = (1-Outlet1.v)*PP.LiquidEnthalpy(Outlet1.T, Outlet1.P, Outlet1.z) +
    148157                                Outlet1.v*PP.VapourEnthalpy(Outlet1.T, Outlet1.P, Outlet1.z);
     
    150159                                Outlet2.v*PP.VapourEnthalpy(Outlet2.T, Outlet2.P, Outlet2.z);
    151160       
    152         "Temperature"
     161"Temperature"
    153162        Outlet1.T = Inlet.T;
    154163        Outlet2.T = Inlet.T;
    155164       
    156         "Vapourization Fraction"
     165"Vapourization Fraction"
    157166        Outlet1.v = PP.VapourFraction(Outlet1.T, Outlet1.P, Outlet1.z);
    158167        Outlet2.v = PP.VapourFraction(Outlet2.T, Outlet2.P, Outlet2.z);
     168
    159169end
    160170
  • branches/newlanguage/sample/mixers_splitters/sample_sepComp.mso

    r80 r175  
    2727
    2828FlowSheet Sample_sepComp_n
    29         PARAMETERS
    30         PP      as CalcObject(Brief="Physical Properties",File="vrpp");
    31         NComp as Integer;
    3229       
    33         DEVICES
    34         stream as stream_therm;
    35         sep as sepComp_n;
     30PARAMETERS
    3631       
    37         CONNECTIONS
    38         stream to sep.Inlet;
     32        PP                      as Plugin       (Brief="Physical Properties",File="vrpp");
     33        NComp   as Integer;
    3934       
    40         SET
     35DEVICES
     36        Stream  as source;
     37        sep             as sepComp_n;
     38       
     39CONNECTIONS
     40        Stream.Outlet to sep.Inlet;
     41       
     42SET
    4143        PP.Components = [ "isobutane", "benzene"];
    4244        PP.LiquidModel = "PR";
    4345        PP.VapourModel = "PR";
    4446        NComp = PP.NumberOfComponents;
     47       
    4548        sep.mainComp = 1;
    4649        sep.NOutlet = 3;
    4750
    48         SPECIFY
    49         stream.F = 30 * "kmol/h";
    50         stream.P = 120 * "kPa";
    51         stream.T = 290 * "K";
    52         stream.z = [0.6, 0.4];
    53         stream.v = 0;
     51SPECIFY
     52        Stream.Outlet.F = 30 * 'kmol/h';
     53        Stream.Outlet.P = 120 * 'kPa';
     54        Stream.Outlet.T = 290 * 'K';
     55        Stream.Outlet.z = [0.6, 0.4];
     56       
    5457        sep.Outlet(1).z(1) = 0.7;
    5558        sep.Outlet(2).z(1) = 0.1;
     
    5962#       sep.recovery(2) = 0.033333;
    6063
    61         OPTIONS
    62         relativeAccuracy = 1e-7;
     64OPTIONS
     65        RelativeAccuracy = 1e-7;
    6366       
    6467end
     
    6770FlowSheet Sample_sepComp
    6871        PARAMETERS
    69         PP      as CalcObject(Brief="Physical Properties",File="vrpp");
     72        PP      as Plugin(Brief="Physical Properties",File="vrpp");
    7073        NComp as Integer;
    7174       
    7275        DEVICES
    73         stream as streamTP;
     76        Stream as source;
    7477        sep as sepComp;
    7578       
    7679        CONNECTIONS
    77         stream to sep.Inlet;
     80        Stream.Outlet to sep.Inlet;
    7881       
    7982        SET
     
    8588
    8689        SPECIFY
    87         stream.F = 30 * "kmol/h";
    88         stream.P = 120 * "kPa";
    89         stream.T = 290 * "K";
    90         stream.z = [0.6, 0.4];
     90        Stream.Outlet .F = 30 * 'kmol/h';
     91        Stream.Outlet .P = 120 * 'kPa';
     92        Stream.Outlet .T = 290 * 'K';
     93        Stream.Outlet .z = [0.6, 0.4];
     94       
    9195        sep.Outlet1.z(1) = 0.7;
    9296        sep.frac = 0.4;
     
    9498
    9599        OPTIONS
    96         relativeAccuracy = 1e-7;
     100        RelativeAccuracy = 1e-7;
    97101       
    98102end
  • branches/newlanguage/sample/mixers_splitters/sample_splitter.mso

    r80 r175  
    2828FlowSheet TestSplitter
    2929        PARAMETERS
    30         PP      as CalcObject(Brief="Physical Properties",File="vrpp");
     30        PP      as Plugin (Brief="Physical Properties",File="vrpp");
    3131        NComp   as Integer;
    3232        NOutlet as Integer;
    3333       
    3434        DEVICES
    35         stream as stream_therm;
    36         splitter as splitter_n;
     35        Stream as source;
     36        Splitter as splitter_n;
    3737       
    3838        CONNECTIONS
    39         stream to splitter.Inlet;
     39        Stream.Outlet to Splitter.Inlet;
    4040       
    4141        SET
     
    4444        PP.VapourModel = "PR";
    4545        NComp = PP.NumberOfComponents;
    46         splitter.NOutlet = 3;
     46        Splitter.NOutlet = 3;
    4747
    4848        SPECIFY
    49         stream.F = 153 * "kmol/h";
    50         stream.P = 150 * "kPa";
    51         stream.T = 298.6 * "K";
    52         stream.z = [0.6, 0.4];
    53         stream.v = 0;
    54         splitter.frac(1) = 0.4;
    55         splitter.frac(2) = 0.1;
     49        Stream.Outlet.F = 153 * 'kmol/h';
     50        Stream.Outlet.P = 150 * 'kPa';
     51        Stream.Outlet.T = 298.6 * 'K';
     52        Stream.Outlet.z = [0.6, 0.4];
     53       
     54        Splitter.frac(1) = 0.4;
     55        Splitter.frac(2) = 0.1;
    5656
    5757        OPTIONS
    58         relativeAccuracy = 1e-7;
     58        RelativeAccuracy = 1e-7;
    5959       
    6060end
Note: See TracChangeset for help on using the changeset viewer.