Ignore:
Timestamp:
Jun 9, 2016, 10:21:54 PM (6 years ago)
Author:
Argimiro Resende Secchi
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sample/stage_separators/ColumnPacked_Diagram.mso

    r911 r991  
    33*----------------------------------------------*#
    44
    5 using "streams";
    6 using "stage_separators/column";
     5using "streams.mso";
     6using "controllers\PIDs.mso";
     7using "mixers_splitters\splitter.mso";
     8using "pressure_changers\valve.mso";
     9using "pressure_changers\pump.mso";
     10using "controllers\heat_flow.mso";
     11using "stage_separators\condenser.mso";
     12using "stage_separators\reboiler.mso";
     13using "stage_separators\column.mso";
    714
    815FlowSheet ColumnPacked_Diagram
    916        PARAMETERS
    1017        PP as Plugin(Brief="Physical Properties",
    11                 Type="PP",
    12                 Components = ["isobutane","n-pentane","propylene","benzene","isobutene"],
    13                 LiquidModel = "PR",
    14                 VapourModel = "PR"
     18                Type="PP"
     19                ,Components = ["propylene","propane"]
     20                ,LiquidModel = ["PR"]
     21                ,VapourModel = ["PR"]
    1522        );
    1623        NComp as Integer;
    17 
    18 DEVICES
    19         feed                            as simple_source;
    20         Packed_Section          as Packed_Section_Column;
    21         Vapour_Out                      as simple_sink;
    22         Liquid_Out                      as simple_sink;
    23         condenser_device        as simple_source;
    24         reboiler_device         as simple_source;
    25        
    26 SET
     24        SET
    2725        NComp = PP.NumberOfComponents;
    28         feed.ValidPhases = "Liquid-Only";
    29 
    30 SPECIFY
    31         feed.MolarComposition(1) = 0.2;
    32         feed.MolarComposition(2) = 0.2;
    33         feed.MolarComposition(3) = 0.2;
    34         feed.MolarComposition(4) = 0.2;
    35         feed.MolarComposition(5) = 0.2;
    36         feed.F = 113.4 * 'kmol/h';
    37         feed.T = 291 * 'K';
    38         feed.P = 1.66 * 'atm';
    39 
    40 SET
    41         Packed_Section.NumberOfStages = 8;
    42         Packed_Section.FeedStageLocation = 5;
    43         Packed_Section.PackingHeight = 4 * 'm';
    44         Packed_Section.HeatSupply = 0 * 'kW';
    45         Packed_Section.ColumnDiameter = 1.009 * 'm';
    46         Packed_Section.VoidFraction = 0.951;
    47         Packed_Section.ResistanceCoeff = 0.1;
    48         Packed_Section.AreaPerPackingVol = 112.6 * 'm^2/m^3';
    49         Packed_Section.INITIALIZATION.TopStageTemperature = 300 * 'K';
    50         Packed_Section.INITIALIZATION.BottomStageTemperature = 300 * 'K';
    51         Packed_Section.INITIALIZATION.TopStageComposition(1) = 0.2;
    52         Packed_Section.INITIALIZATION.TopStageComposition(2) = 0.2;
    53         Packed_Section.INITIALIZATION.TopStageComposition(3) = 0.2;
    54         Packed_Section.INITIALIZATION.TopStageComposition(4) = 0.2;
    55         Packed_Section.INITIALIZATION.TopStageComposition(5) = 0.2;
    56         Packed_Section.INITIALIZATION.BottomStageComposition(1) = 0.2;
    57         Packed_Section.INITIALIZATION.BottomStageComposition(2) = 0.2;
    58         Packed_Section.INITIALIZATION.BottomStageComposition(3) = 0.2;
    59         Packed_Section.INITIALIZATION.BottomStageComposition(4) = 0.2;
    60         Packed_Section.INITIALIZATION.BottomStageComposition(5) = 0.2;
    61         Packed_Section.INITIALIZATION.ColumnHoldup = 0.01;
     26
     27        DEVICES
     28        feed as simple_source;
     29        LiquidOut as simple_sink;
     30        PIDT_condenser as PID;
     31        PIDT_reboiler as PID;
     32        PIDL_reboiler as PID;
     33        splitter_S1 as splitter_column;
     34        Valve_Distillate as valve_flow;
     35        distillate_stream as sink;
     36        pump_P1 as pump2;
     37        Valve_Bottom as valve_flow;
     38        PIDL_condenser as PID;
     39        heat_condenser as heat_flow;
     40        heat_reboiler as heat_flow;
     41        vapour_s1 as simple_sink2;
     42        condenser_C1 as condenser;
     43        reboiler_R1 as reboiler;
     44        PackedTower as Packed_Section_Column;
     45
     46        CONNECTIONS
     47        splitter_S1.Distillate to Valve_Distillate.Inlet;
     48        Valve_Distillate.Outlet to distillate_stream.Inlet;
     49        splitter_S1.Reflux to pump_P1.Inlet;
     50        Valve_Bottom.Outlet to LiquidOut.Inlet;
     51        PIDL_reboiler.Output to Valve_Bottom.FlowFraction;
     52        PIDL_condenser.Output to Valve_Distillate.FlowFraction;
     53        PIDT_condenser.Output to heat_condenser.HeatFlowFraction;
     54        PIDT_reboiler.Output to heat_reboiler.HeatFlowFraction;
     55        condenser_C1.OutletLiquid to splitter_S1.Inlet;
     56        heat_condenser.HeatFlow to condenser_C1.InletQ;
     57        condenser_C1.TI to PIDT_condenser.Input;
     58        condenser_C1.LI to PIDL_condenser.Input;
     59        condenser_C1.OutletVapour to vapour_s1.Inlet;
     60        heat_reboiler.HeatFlow to reboiler_R1.InletQ;
     61        reboiler_R1.OutletLiquid to Valve_Bottom.Inlet;
     62        reboiler_R1.LI to PIDL_reboiler.Input;
     63        reboiler_R1.TI to PIDT_reboiler.Input;
     64        PackedTower.VapourOutlet to condenser_C1.InletVapour;
     65        pump_P1.Outlet to PackedTower.LiquidInlet;
     66        feed.Outlet to PackedTower.FeedStage;
     67        PackedTower.LiquidOutlet to reboiler_R1.InletLiquid;
     68        reboiler_R1.OutletVapour to PackedTower.VapourInlet;
     69
     70        SET
     71        feed.ValidPhases = "Vapour-Liquid" ;
     72        PIDT_condenser.PID_Select = "Ideal_AWBT" ;
     73        PIDT_condenser.Action = "Reverse" ;
     74        PIDT_condenser.Mode = "Automatic" ;
     75        PIDT_condenser.Clip = "Clipped" ;
     76        PIDT_condenser.alpha = 0.2 ;
     77        PIDT_condenser.beta = 1 ;
     78        PIDT_condenser.bias = 0.5 ;
     79        PIDT_condenser.derivTime = 10 * 's' ;
     80        PIDT_condenser.intTime = 100 * 's' ;
     81        PIDT_condenser.gain = 5 ;
     82        PIDT_condenser.gamma = 1 ;
     83        PIDT_condenser.tau = 1 * 's' ;
     84        PIDT_condenser.tauSet = 1 * 's' ;
     85        PIDT_condenser.MinInput = 250 ;
     86        PIDT_condenser.MaxInput = 380 ;
     87        PIDT_condenser.MinOutput = 0 ;
     88        PIDT_condenser.MaxOutput = 1 ;
     89        PIDT_reboiler.PID_Select = "Ideal_AW" ;
     90        PIDT_reboiler.Action = "Reverse" ;
     91        PIDT_reboiler.Mode = "Automatic" ;
     92        PIDT_reboiler.Clip = "Clipped" ;
     93        PIDT_reboiler.alpha = 0.2 ;
     94        PIDT_reboiler.beta = 1 ;
     95        PIDT_reboiler.bias = 0.2 ;
     96        PIDT_reboiler.derivTime = 1 * 's' ;
     97        PIDT_reboiler.intTime = 10 * 's' ;
     98        PIDT_reboiler.gain = 3 ;
     99        PIDT_reboiler.gamma = 1 ;
     100        PIDT_reboiler.tau = 1 * 's' ;
     101        PIDT_reboiler.tauSet = 1 * 's' ;
     102        PIDT_reboiler.MinInput = 200 ;
     103        PIDT_reboiler.MaxInput = 400 ;
     104        PIDT_reboiler.MinOutput = 0 ;
     105        PIDT_reboiler.MaxOutput = 1 ;
     106        PIDL_reboiler.PID_Select = "Series_AWBT" ;
     107        PIDL_reboiler.Action = "Direct" ;
     108        PIDL_reboiler.Mode = "Automatic" ;
     109        PIDL_reboiler.Clip = "Clipped" ;
     110        PIDL_reboiler.alpha = 1 ;
     111        PIDL_reboiler.beta = 1 ;
     112        PIDL_reboiler.bias = 0 ;
     113        PIDL_reboiler.derivTime = 0 * 's' ;
     114        PIDL_reboiler.intTime = 20 * 's' ;
     115        PIDL_reboiler.gain = 5 ;
     116        PIDL_reboiler.gamma = 1 ;
     117        PIDL_reboiler.tau = 1 * 's' ;
     118        PIDL_reboiler.tauSet = 1 * 's' ;
     119        PIDL_reboiler.MinInput = 0.1 ;
     120        PIDL_reboiler.MaxInput = 0.8 ;
     121        PIDL_reboiler.MinOutput = 0 ;
     122        PIDL_reboiler.MaxOutput = 1 ;
     123        Valve_Distillate.MinFlow = 0 * 'kmol/h' ;
     124        Valve_Distillate.MaxFlow = 400 * 'kmol/h' ;
     125        Valve_Bottom.MinFlow = 0 * 'kmol/h' ;
     126        Valve_Bottom.MaxFlow = 6000 * 'kmol/h' ;
     127        PIDL_condenser.PID_Select = "Ideal_AW" ;
     128        PIDL_condenser.Action = "Direct" ;
     129        PIDL_condenser.Mode = "Automatic" ;
     130        PIDL_condenser.Clip = "Clipped" ;
     131        PIDL_condenser.alpha = 1 ;
     132        PIDL_condenser.beta = 1 ;
     133        PIDL_condenser.bias = 0 ;
     134        PIDL_condenser.derivTime = 0 * 's' ;
     135        PIDL_condenser.intTime = 20 * 's' ;
     136        PIDL_condenser.gain = 2 ;
     137        PIDL_condenser.gamma = 1 ;
     138        PIDL_condenser.tau = 1 * 's' ;
     139        PIDL_condenser.tauSet = 1 * 's' ;
     140        PIDL_condenser.MinInput = 0.1 ;
     141        PIDL_condenser.MaxInput = 0.8 ;
     142        PIDL_condenser.MinOutput = 0 ;
     143        PIDL_condenser.MaxOutput = 1 ;
     144        heat_condenser.MinHeatFlow = -20000 * 'kW' ;
     145        heat_condenser.MaxHeatFlow = 0 * 'kW' ;
     146        heat_reboiler.MinHeatFlow = 0 * 'kW' ;
     147        heat_reboiler.MaxHeatFlow = 20000 * 'kW' ;
     148        condenser_C1.Kfactor = 7 ;
     149        condenser_C1.Levelpercent_Initial = 0.5 ;
     150        condenser_C1.Initial_Temperature = 299 * 'K' ;
     151        reboiler_R1.Initial_Temperature = 320 * 'K' ;
     152        reboiler_R1.Initial_Composition(1) = 0.01 ;
     153        reboiler_R1.Initial_Composition(2) = 0.99 ;
     154        PackedTower.INITIALIZATION.TopStageTemperature = 308 * 'K' ;
     155        PackedTower.INITIALIZATION.BottomStageTemperature = 316 * 'K' ;
     156        PackedTower.INITIALIZATION.TopStageComposition(1) = 0.8 ;
     157        PackedTower.INITIALIZATION.TopStageComposition(2) = 0.2 ;
     158        PackedTower.INITIALIZATION.BottomStageComposition(1) = 0.2 ;
     159        PackedTower.INITIALIZATION.BottomStageComposition(2) = 0.8 ;
     160        PackedTower.NumberOfStages = 14 ;
     161        PackedTower.FeedStageLocation(1) = 9 ;
     162        PackedTower.PackingHeight = 22 * 'm' ;
     163        PackedTower.HeatSupply = 0 * 'kW' ;
     164        PackedTower.ColumnDiameter = 3.6 * 'm' ;
     165        PackedTower.VoidFraction = 0.95 ;
     166        PackedTower.ResistanceCoeff = 0.0763 ;
     167        PackedTower.AreaPerPackingVol = 112 * 'm^2/m^3' ;
    62168
    63169        SPECIFY
    64         Packed_Section.PressureDrop = 0.008 * 'atm';
    65 
    66 
    67 SET
    68         condenser_device.ValidPhases = "Liquid-Only";
    69 
    70 SPECIFY
    71         condenser_device.MolarComposition(1) = 0.599;
    72         condenser_device.MolarComposition(2) = 0.044;
    73         condenser_device.MolarComposition(3) = 0.035;
    74         condenser_device.MolarComposition(4) = 0.007;
    75         condenser_device.MolarComposition(5) = 0.315;
    76         condenser_device.F = 85 * 'kmol/h';
    77         condenser_device.T = 283.5 * 'K';
    78         condenser_device.P = 2.33 * 'atm';
    79 
    80 SET
    81         reboiler_device.ValidPhases = "Vapour-Only";
    82 
    83 SPECIFY
    84         reboiler_device.MolarComposition(1) = 0.16;
    85         reboiler_device.MolarComposition(2) = 0.542;
    86         reboiler_device.MolarComposition(3) = 0.013;
    87         reboiler_device.MolarComposition(4) = 0.008;
    88         reboiler_device.MolarComposition(5) = 0.277;
    89         reboiler_device.F = 137.57 * 'kmol/h';
    90         reboiler_device.T = 325 * 'K';
    91         reboiler_device.P = 2.46 * 'atm';
    92 
    93 CONNECTIONS
    94         feed.Outlet to Packed_Section.FeedStage;
    95         Packed_Section.VapourOutlet to Vapour_Out.Inlet;
    96         Packed_Section.LiquidOutlet to Liquid_Out.Inlet;
    97         condenser_device.Outlet to Packed_Section.LiquidInlet;
    98         reboiler_device.Outlet to Packed_Section.VapourInlet;
    99 
    100 OPTIONS
     170        feed.MolarComposition(1) = 0.4 ;
     171        feed.MolarComposition(2) = 0.6 ;
     172        feed.F = 612.4 * 'kmol/h' ;
     173        feed.T_Cdeg = 50 * 'K' ;
     174        feed.P = 2068 * 'kPa' ;
     175        PIDT_condenser.SetPoint = (273+34) ;
     176        PIDT_reboiler.SetPoint = (45+273) ;
     177        PIDL_reboiler.SetPoint = 0.7 ;
     178        splitter_S1.RefluxRatio = 20 ;
     179        pump_P1.Pincrease = 14 * 'kPa' ;
     180        PIDL_condenser.SetPoint = 0.7 ;
     181        condenser_C1.OutletVapour.F = 0 * 'kmol/h' ;
     182
     183        INITIAL
     184
     185        GUESS
     186
     187        OPTIONS
    101188        Dynamic = true;
    102         TimeStep = 0.1;
    103         TimeEnd = 1;
    104         TimeUnit = 'h';
     189        TimeStep = 5;
     190        TimeEnd = 200;
     191        TimeUnit = 's';
    105192        Integration = "original";
    106193        NLASolver(
     
    111198        );
    112199        DAESolver(
    113                 File = "sundials",
     200                File = "dassl",
    114201                RelativeAccuracy = 1e-3,
    115202                AbsoluteAccuracy = 1e-6,
    116203                EventAccuracy = 1e-2
    117204        );
     205
    118206end
Note: See TracChangeset for help on using the changeset viewer.