Ignore:
Timestamp:
Sep 3, 2009, 3:36:47 PM (13 years ago)
Author:
gerson bicca
Message:

updated emso tutorial

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/tutorial/ThreeTank2.mso

    r765 r843  
    1010*
    1111* Arquivo de exemplo do EMSO
    12 *
    13 * Sistema de uma série de tanques.
    14 *
    1512*-------------------------------------------------------------------*#
    1613
    1714Model tank_simplified
    18         PARAMETERS
    19         k as Real (Brief="Valve Constant", Unit = 'm^2.5/h', Default=4);
    20         A as Real (Brief="Tank area", Default=2, Unit = 'm^2');
    2115
    22         VARIABLES
    23         Level as Real(Brief="Tank level", Unit='m');
    24 in      Fin  as Real(Brief="Input flow", Unit='m^3/h');
    25 out     Fout as Real(Brief="Output flow", Unit='m^3/h');
     16PARAMETERS
     17        pi  as Real (Brief="pi number",Default=3.141592);
     18        k       as Real (Brief="Valve Constant", Unit = 'm^2.5/h', Default=4);
     19        Dh  as Real     (Brief="Hydraulic diameter", Unit = 'm', Default=2);
     20        A       as Real (Brief="Tank area", Unit = 'm^2');
    2621
    27         EQUATIONS
    28         "Mass balance"
    29         diff(A*Level) = Fin - Fout;
     22SET
     23        pi  = 3.141592;
     24        A   = (pi*Dh^2)/4;
    3025
    31         "Valve equation"
    32         Fout = k*sqrt(Level);           
     26VARIABLES
     27        V               as Real (Brief="Tank Volume", Lower = 0, Unit='m^3');
     28        Level   as Real (Brief="Tank level", Lower = 0, Unit='m');
     29in      Fin     as Real (Brief="Input flow", Lower = 0, Unit='m^3/h');
     30out     Fout    as Real (Brief="Output flow",Lower = 0, Unit='m^3/h');
     31
     32EQUATIONS
     33
     34"Mass balance"
     35        diff(V) = Fin - Fout;
     36
     37"Valve equation"
     38        Fout = k*sqrt(Level);
     39
     40"Tank volume"
     41        V = A*Level;
     42
    3343end
    3444
    3545
    3646FlowSheet ThreeTank
    37         VARIABLES
    38         Feed    as Real(Unit='m^3/h');
     47       
     48DEVICES
     49        Feed    as Real (Brief="Feed Stream", Unit='m^3/h');
     50       
     51        Tank1   as tank_simplified (Brief="First Tank");
     52        Tank2   as tank_simplified (Brief="Second Tank");
     53        Tank3   as tank_simplified (Brief="Third Tank");
    3954
    40         DEVICES
    41         Tank1   as tank_simplified;
    42         Tank2   as tank_simplified;
    43         Tank3   as tank_simplified;
    44 
    45         CONNECTIONS
     55CONNECTIONS
    4656        Feed        to  Tank1.Fin;
    4757        Tank1.Fout      to      Tank2.Fin;
    4858        Tank2.Fout      to      Tank3.Fin;
    4959
    50         SPECIFY
     60SPECIFY
    5161        Feed = 10 * 'm^3/h';
    5262       
    53         INITIAL
     63INITIAL
    5464        Tank1.Level = 1 * 'm';
    5565        Tank2.Level = 2 * 'm';
    5666        Tank3.Level = 1 * 'm';
     67
    5768end
Note: See TracChangeset for help on using the changeset viewer.