Changeset 555 for branches/gui/eml


Ignore:
Timestamp:
Jul 18, 2008, 4:01:13 PM (14 years ago)
Author:
Rafael de Pelegrini Soares
Message:

Updating the models to be usable by the gui

Location:
branches/gui/eml
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/eml/controllers/PIDIncr.mso

    r354 r555  
    1818using "types";
    1919
    20 Model MParameters
    21 
    22 ATTRIBUTES
    23         Pallete         = false;
    24         Brief           = "Model of Parameters to be used with incremental PIDs.";
    25        
    26         VARIABLES
    27        
    28         alpha      as positive (Brief="Derivative term filter constant", Default=1);
    29         beta       as positive (Brief="Proportional term setPoint change filter");
    30         bias       as control_signal (Brief="Previous scaled bias", Default=0.5);
    31         derivTime  as time_sec (Brief="Derivative time constant");
    32         intTime    as time_sec (Brief="Integral time constant");
    33         gain       as positive (Brief="Controller gain", Default=0.5);
    34         gamma      as positive (Brief="Derivative term SP change filter");
    35         tau        as time_sec (Brief="Input filter time constant");
    36         tauSet     as time_sec (Brief="Input filter time constant");
    37        
    38 end
    39 
    40 Model MOptions 
    41 
    42 ATTRIBUTES
    43         Pallete         = false;
    44         Brief           = "Model of Options to be used with incremental PIDs.";
    45        
    46         VARIABLES       
    47        
    48         action     as Real     (Brief="Controller action: (-1) Direct,(1) Reverse", Default=-1);
    49     autoMan    as Real     (Brief="Controller option: (0) Automatic, (1) Manual", Default=0);   
    50         clip       as Real     (Brief="Controller option: (1) output clipped, (0) output unclipped", Default=1);
    51 
    52 end
    53 
    5420Model MPorts
    5521
     
    10874       
    10975        PID_Select as Switcher (Brief="Type of PID Incremental", Valid=["Ideal","Parallel","Series","Ideal_AWBT","Parallel_AWBT","Series_AWBT","Ideal_AW","Parallel_AW","Series_AW"], Default = "Ideal");
     76        Action     as Switcher (Brief="Controller action", Valid=["Direct","Reverse"], Default = "Reverse");
     77        Mode       as Switcher (Brief="Controller mode", Valid=["Automatic","Manual"], Default = "Automatic");
     78        Clip       as Switcher (Brief="Controller mode", Valid=["Clipped","Unclipped"], Default = "Clipped");
     79       
     80        alpha      as positive (Brief="Derivative term filter constant", Default=1);
     81        beta       as positive (Brief="Proportional term setPoint change filter");
     82        bias       as control_signal (Brief="Previous scaled bias", Default=0.5);
     83        derivTime  as time_sec (Brief="Derivative time constant");
     84        intTime    as time_sec (Brief="Integral time constant");
     85        gain       as positive (Brief="Controller gain", Default=0.5);
     86        gamma      as positive (Brief="Derivative term SP change filter");
     87        tau        as time_sec (Brief="Input filter time constant");
     88        tauSet     as time_sec (Brief="Input filter time constant");
    11089       
    11190        VARIABLES
    112         Parameters         as MParameters;
    113         Options            as MOptions;
    11491        Internal           as MInternal_Variables;
    11592        Ports              as MPorts;
    116         AWFactor     as Real     (Brief="Integral term multiplier used in anti-reset windup");
     93        AWFactor     as Real(Brief="Integral term multiplier used in anti-reset windup", Hidden=true);
     94        action       as Real(Hidden=true);
    11795       
    11896        EQUATIONS
    11997
    120         if (Parameters.tau equal 0) then
     98        if (tau equal 0) then
    12199                "Input first order filter"
    122                 (Parameters.tau + 1e-3*'s')*diff(Internal.inputFilt)= Ports.input - Internal.inputFilt;
     100                (tau + 1e-3*'s')*diff(Internal.inputFilt)= Ports.input - Internal.inputFilt;
    123101        else
    124102                "Input first order filter"
    125                 Parameters.tau*diff(Internal.inputFilt)= Ports.input - Internal.inputFilt;     
    126         end
    127 
    128         if (Parameters.tauSet equal 0) then
     103                tau*diff(Internal.inputFilt)= Ports.input - Internal.inputFilt;
     104        end
     105
     106        if (tauSet equal 0) then
    129107                "setPoint first order filter"
    130                 (Parameters.tauSet + 1e-3*'s')*diff(Internal.setPointFilt)= Ports.setPoint - Internal.setPointFilt;
     108                (tauSet + 1e-3*'s')*diff(Internal.setPointFilt)= Ports.setPoint - Internal.setPointFilt;
    131109        else
    132110                "setPoint first order filter"
    133                 Parameters.tauSet*diff(Internal.setPointFilt)= Ports.setPoint - Internal.setPointFilt;
    134         end
    135 
    136         if Options.autoMan equal 1 then
     111                tauSet*diff(Internal.setPointFilt)= Ports.setPoint - Internal.setPointFilt;
     112        end
     113
     114        switch Mode
     115        case "Manual":
    137116                "Error definition for proportional term"
    138                 Internal.error*'s' = Internal.inputFilt*(Parameters.beta-1.0);
     117                Internal.error*'s' = Internal.inputFilt*(beta-1.0);
    139118                "Error definition for derivative term"
    140                 Internal.errorD*'s'= Internal.inputFilt*(Parameters.gamma-1.0);
     119                Internal.errorD*'s'= Internal.inputFilt*(gamma-1.0);
    141120                "Error definition for integral term"           
    142121                Internal.errorI= 0;
    143         else
     122        case "Automatic":
    144123                "Error definition for proportional term"                       
    145                 Internal.error = Parameters.beta*diff(Internal.setPointFilt) - diff(Internal.inputFilt);
     124                Internal.error = beta*diff(Internal.setPointFilt) - diff(Internal.inputFilt);
    146125                "Error definition for derivative term"
    147                 Internal.errorD = Parameters.gamma*diff(Internal.setPointFilt) - diff(Internal.inputFilt);
     126                Internal.errorD = gamma*diff(Internal.setPointFilt) - diff(Internal.inputFilt);
    148127                "Error definition for integral term"
    149128                Internal.errorI = Internal.setPointFilt-Internal.inputFilt;     
     
    153132        Internal.dpropTerm=Internal.error; 
    154133       
    155         if (Parameters.derivTime equal 0) then
     134        if (derivTime equal 0) then
    156135                "Derivative term filter"       
    157                 Parameters.alpha*(Parameters.derivTime + 1e-3*'s')*diff(Internal.dFilt) = Internal.errorD - Internal.dFilt;
     136                alpha*(derivTime + 1e-3*'s')*diff(Internal.dFilt) = Internal.errorD - Internal.dFilt;
    158137        else
    159138                "Derivative term filter"       
    160                 Parameters.alpha*(Parameters.derivTime)*diff(Internal.dFilt) = Internal.errorD - Internal.dFilt;
     139                alpha*(derivTime)*diff(Internal.dFilt) = Internal.errorD - Internal.dFilt;
    161140        end
    162141
    163142        "Calculate derivative term"
    164         Internal.dderivTerm = Parameters.derivTime*diff(Internal.dFilt);
     143        Internal.dderivTerm = derivTime*diff(Internal.dFilt);
    165144       
    166145    "Unscaled output"
     
    170149        Internal.outps=2*Internal.outp-1;
    171150
    172         if Options.clip equal 1 then
     151        switch Clip
     152        case "Clipped":
    173153                if abs(Internal.outps)>1 then
    174154                        "Calculate clipped output when it´s saturated"
     
    178158                        Ports.output=Internal.outp;
    179159                end
    180         else
     160        case "Unclipped":
    181161                "Calculate unclipped output"
    182162                Ports.output=Internal.outp;
    183163        end
     164       
     165        switch Action
     166        case "Direct":
     167                action = 1.0;
     168        case "Reverse":
     169                action = -1.0;
     170        end
    184171
    185172switch PID_Select
     
    188175       
    189176        "Calculate integral term"
    190         Parameters.intTime*Internal.dintTerm = Internal.errorI;
    191        
    192         "Sum of proportional, integral and derivative terms"
    193         Internal.doutp = Options.action*Parameters.gain*(Internal.dpropTerm + Internal.dintTerm + Internal.dderivTerm);
     177        intTime*Internal.dintTerm = Internal.errorI;
     178       
     179        "Sum of proportional, integral and derivative terms"
     180        Internal.doutp = action*gain*(Internal.dpropTerm + Internal.dintTerm + Internal.dderivTerm);
    194181
    195182        "Calculate AWFactor - Not in use in this mode"
     
    199186       
    200187        "Calculate integral term"
    201         Parameters.intTime*Internal.dintTerm = Internal.errorI;
    202        
    203         "Sum of proportional, integral and derivative terms"
    204         Internal.doutp = Options.action*(Parameters.gain*Internal.dpropTerm + Internal.dintTerm + Internal.dderivTerm);
     188        intTime*Internal.dintTerm = Internal.errorI;   
     189       
     190        "Sum of proportional, integral and derivative terms"
     191        Internal.doutp = action*(gain*Internal.dpropTerm + Internal.dintTerm + Internal.dderivTerm);
    205192
    206193"Calculate AWFactor - Not in use in this mode"
     
    210197       
    211198        "Calculate integral term"
    212         Parameters.intTime*Internal.dintTerm = Internal.errorI;
    213        
    214         "Sum of proportional, integral and derivative terms"
    215         Internal.doutp = Options.action*(Parameters.gain*(Internal.dpropTerm + Internal.dintTerm)*(1/'s' + Internal.dderivTerm)*'s');
     199        intTime*Internal.dintTerm = Internal.errorI;   
     200       
     201        "Sum of proportional, integral and derivative terms"
     202        Internal.doutp = action*(gain*(Internal.dpropTerm + Internal.dintTerm)*(1/'s' + Internal.dderivTerm)*'s');
    216203       
    217204        "Calculate AWFactor - Not in use in this mode"
     
    221208       
    222209        "Calculate integral term with anti-windup and bumpless transfer"
    223         Options.action*Parameters.gain*(Parameters.intTime*Internal.dintTerm-Internal.errorI) = Ports.output-Internal.outp;
    224 
    225         "Sum of proportional, integral and derivative terms"
    226         Internal.doutp = Options.action*Parameters.gain*(Internal.dpropTerm + Internal.dintTerm + Internal.dderivTerm);
     210        action*gain*(intTime*Internal.dintTerm-Internal.errorI) = Ports.output-Internal.outp;
     211
     212        "Sum of proportional, integral and derivative terms"
     213        Internal.doutp = action*gain*(Internal.dpropTerm + Internal.dintTerm + Internal.dderivTerm);
    227214
    228215        "Calculate AWFactor - Not in use in this mode"
     
    232219       
    233220        "Calculate integral term with anti-windup and bumpless transfer"
    234         Options.action*Parameters.gain*(Parameters.intTime*Internal.dintTerm-Internal.errorI) = Ports.output-Internal.outp;
    235        
    236         "Sum of proportional, integral and derivative terms"
    237         Internal.doutp = Options.action*(Parameters.gain*Internal.dpropTerm + Internal.dintTerm + Internal.dderivTerm);
     221        action*gain*(intTime*Internal.dintTerm-Internal.errorI) = Ports.output-Internal.outp;
     222       
     223        "Sum of proportional, integral and derivative terms"
     224        Internal.doutp = action*(gain*Internal.dpropTerm + Internal.dintTerm + Internal.dderivTerm);
    238225
    239226"Calculate AWFactor - Not in use in this mode"
     
    243230       
    244231        "Calculate integral term with anti-windup and bumpless transfer"
    245         Options.action*Parameters.gain*(Parameters.intTime*Internal.dintTerm-Internal.errorI) = Ports.output-Internal.outp;
    246 
    247         "Sum of proportional, integral and derivative terms"
    248         Internal.doutp = Options.action*(Parameters.gain*(Internal.dpropTerm + Internal.dintTerm)*(1/'s' + Internal.dderivTerm)*'s');
     232        action*gain*(intTime*Internal.dintTerm-Internal.errorI) = Ports.output-Internal.outp;
     233
     234        "Sum of proportional, integral and derivative terms"
     235        Internal.doutp = action*(gain*(Internal.dpropTerm + Internal.dintTerm)*(1/'s' + Internal.dderivTerm)*'s');
    249236
    250237"Calculate AWFactor - Not in use in this mode"
     
    254241       
    255242        "Calculate integral term with anti-windup"
    256         Parameters.intTime*Internal.dintTerm = AWFactor*Internal.errorI;
    257        
    258         "Sum of proportional, integral and derivative terms"
    259         Internal.doutp = Options.action*Parameters.gain*(Internal.dpropTerm + Internal.dintTerm + Internal.dderivTerm);
    260        
    261         if abs(Internal.outps)>1 and (Options.action*sign(Internal.outps)*Internal.errorI)>0 then
     243        intTime*Internal.dintTerm = AWFactor*Internal.errorI;
     244       
     245        "Sum of proportional, integral and derivative terms"
     246        Internal.doutp = action*gain*(Internal.dpropTerm + Internal.dintTerm + Internal.dderivTerm);
     247       
     248        if abs(Internal.outps)>1 and (action*sign(Internal.outps)*Internal.errorI)>0 then
    262249                "Calculate AWFactor"
    263250                AWFactor=-tanh(sign(Internal.outps)*Internal.outps*100-102);
     
    270257       
    271258        "Calculate integral term with anti-windup"
    272         Parameters.intTime*Internal.dintTerm = AWFactor*Internal.errorI;
    273        
    274         "Sum of proportional, integral and derivative terms"
    275         Internal.doutp = Options.action*(Parameters.gain*Internal.dpropTerm + Internal.dintTerm + Internal.dderivTerm);
    276        
    277         if abs(Internal.outps)>1 and (Options.action*sign(Internal.outps)*Internal.errorI)>0 then
     259        intTime*Internal.dintTerm = AWFactor*Internal.errorI;
     260       
     261        "Sum of proportional, integral and derivative terms"
     262        Internal.doutp = action*(gain*Internal.dpropTerm + Internal.dintTerm + Internal.dderivTerm);
     263       
     264        if abs(Internal.outps)>1 and (action*sign(Internal.outps)*Internal.errorI)>0 then
    278265                "Calculate AWFactor"
    279266                AWFactor=-tanh(sign(Internal.outps)*Internal.outps*100-102);
     
    286273       
    287274        "Calculate integral term with anti-windup"
    288         Parameters.intTime*Internal.dintTerm = AWFactor*Internal.errorI;
    289        
    290         "Sum of proportional, integral and derivative terms"
    291         Internal.doutp = Options.action*(Parameters.gain*(Internal.dpropTerm + Internal.dintTerm)*(1/'s' + Internal.dderivTerm)*'s');
    292        
    293         if abs(Internal.outps)>1 and (Options.action*sign(Internal.outps)*Internal.errorI)>0 then
     275        intTime*Internal.dintTerm = AWFactor*Internal.errorI;
     276       
     277        "Sum of proportional, integral and derivative terms"
     278        Internal.doutp = action*(gain*(Internal.dpropTerm + Internal.dintTerm)*(1/'s' + Internal.dderivTerm)*'s');
     279       
     280        if abs(Internal.outps)>1 and (action*sign(Internal.outps)*Internal.errorI)>0 then
    294281                "Calculate AWFactor"
    295282                AWFactor=-tanh(sign(Internal.outps)*Internal.outps*100-102);
     
    302289
    303290        INITIAL
    304         Ports.output = Parameters.bias;
     291        Ports.output = bias;   
    305292        diff(Internal.dFilt) = 0/'s^2';
    306293        diff(Internal.inputFilt)=0/'s';
     
    310297
    311298
     299Model PID_gui as PIDIncr
     300        ATTRIBUTES
     301        Pallete         = true;
     302        Icon            = "icon/PIDIncr";
     303
     304        PARAMETERS
     305        MinInput as control_signal;
     306        MaxInput as control_signal;
     307       
     308        VARIABLES
     309in      Input as control_signal(Protected=true, PosX=0, PosY=0.5);
     310out     Output as control_signal(Protected=true, PosX=1, PosY=0.5);
     311        SetPoint as control_signal;
     312       
     313        EQUATIONS
     314        Ports.input*(MaxInput - MinInput) = Input - MinInput;
     315        Ports.output = Output;
     316        Ports.setPoint*(MaxInput - MinInput) = SetPoint - MinInput;
     317end
  • branches/gui/eml/stage_separators/condenser.mso

    r353 r555  
    5151out     OutletL as liquid_stream(Brief="Liquid outlet stream", PosX=0.4513, PosY=1, Symbol="_{outL}");
    5252out     OutletV as vapour_stream(Brief="Vapour outlet stream", PosX=0.4723, PosY=0, Symbol="_{outV}");
    53 in      InletQ as energy_stream (Brief="Cold supplied", PosX=1, PosY=0.6311, Symbol="_{in}");
     53in      InletQ as power (Brief="Cold supplied", PosX=1, PosY=0.6311, Symbol="_{in}");
    5454
    5555        M(NComp) as mol (Brief="Molar Holdup in the tray");
     
    6868        "Energy Balance"
    6969        diff(E) = InletV.F*InletV.h - OutletL.F*OutletL.h
    70                                 - OutletV.F*OutletV.h + InletQ.Q;
     70                                - OutletV.F*OutletV.h + InletQ;
    7171
    7272        "Molar Holdup"
     
    129129in      InletV as stream(Brief="Vapour inlet stream", PosX=0.3431, PosY=0, Symbol="_{inV}");
    130130out     OutletL as liquid_stream(Brief="Liquid outlet stream", PosX=0.34375, PosY=1, Symbol="_{outL}");
    131 in      InletQ as energy_stream (Brief="Cold supplied", PosX=1, PosY=0.5974, Symbol="_{in}");
     131in      InletQ as power (Brief="Cold supplied", PosX=1, PosY=0.5974, Symbol="_{in}");
    132132        DP as press_delta (Brief="Pressure Drop in the condenser");
    133133
     
    138138               
    139139        "Energy Balance"
    140         InletV.F*InletV.h = OutletL.F*OutletL.h + InletQ.Q;
     140        InletV.F*InletV.h = OutletL.F*OutletL.h + InletQ;
    141141       
    142142        "Pressure"
     
    184184out     OutletL as liquid_stream(Brief="Liquid outlet stream", PosX=0.4513, PosY=1, Symbol="_{outL}");
    185185out     OutletV as vapour_stream(Brief="Vapour outlet stream", PosX=0.4723, PosY=0, Symbol="_{outV}");
    186 in      InletQ as energy_stream (Brief="Cold supplied", PosX=1, PosY=0.6311, Symbol="_{in}");
     186in      InletQ as power (Brief="Cold supplied", PosX=1, PosY=0.6311, Symbol="_{in}");
    187187
    188188        M(NComp) as mol (Brief="Molar Holdup in the tray");
     
    210210        "Energy Balance"
    211211        diff(E) = InletV.F*InletV.h - OutletL.F*OutletL.h
    212                                 - OutletV.F*OutletV.h + InletQ.Q + Hr * r3 * ML*vL;
     212                                - OutletV.F*OutletV.h + InletQ + Hr * r3 * ML*vL;
    213213
    214214        "Molar Holdup"
  • branches/gui/eml/stage_separators/flash.mso

    r372 r555  
    4242outer NComp as Integer (Brief = "Number of chemical components", Lower = 1);
    4343        V as volume (Brief="Total Volume of the flash");
    44         Mw(NComp) as molweight;
     44        Mw(NComp) as molweight(Protected=true);
    4545        orientation as Switcher (Valid=["vertical","horizontal"],Default="vertical");
    4646        diameter as length (Brief="Vessel diameter");
     
    5353out     OutletL as liquid_stream(Brief="Liquid outlet stream", PosX=0.4790, PosY=1, Symbol="_{outL}");
    5454out     OutletV as vapour_stream(Brief="Vapour outlet stream", PosX=0.4877, PosY=0, Symbol="_{outV}");
    55 in      InletQ as energy_stream (Brief="Rate of heat supply", PosX=1, PosY=0.7559, Symbol="_{in}");
    56 
    57         M(NComp) as mol (Brief="Molar Holdup in the tray");
    58         ML as mol (Brief="Molar liquid holdup");
    59         MV as mol (Brief="Molar vapour holdup");
    60         E as energy (Brief="Total Energy Holdup on tray");
    61         vL as volume_mol (Brief="Liquid Molar Volume");
    62         vV as volume_mol (Brief="Vapour Molar volume");
     55in      InletQ as power(Brief="Rate of heat supply", PosX=1, PosY=0.7559, Symbol="_{in}");
     56
     57        M(NComp) as mol (Brief="Molar Holdup in the tray", Protected=true);
     58        ML as mol (Brief="Molar liquid holdup", Protected=true);
     59        MV as mol (Brief="Molar vapour holdup", Protected=true);
     60        E as energy (Brief="Total Energy Holdup on tray", Protected=true);
     61        vL as volume_mol (Brief="Liquid Molar Volume", Protected=true);
     62        vV as volume_mol (Brief="Vapour Molar volume", Protected=true);
    6363        Level as length (Brief="liquid height");
    64         Across as area (Brief="Flash Cross section area");
     64        Across as area (Brief="Flash Cross section area", Protected=true);
    6565        vfrac as positive (Brief="Vapourization fraction", Symbol="\phi");
    6666        Pratio as positive      (Brief = "Pressure Ratio", Symbol ="P_{ratio}");       
    6767        Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P");
    6868
     69out     TI as control_signal(Brief="Temperature Indicator", PosX=1, PosY=0.2);
     70out     PI as control_signal(Brief="Pressure Indicator", PosX=1, PosY=0.3);
     71out     LI as control_signal(Brief="Level Indicator", PosX=1, PosY=0.4);
     72
    6973        EQUATIONS
    7074        "Component Molar Balance"
     
    7276       
    7377        "Energy Balance"
    74         diff(E) = Inlet.F*Inlet.h - OutletL.F*OutletL.h - OutletV.F*OutletV.h + InletQ.Q;
     78        diff(E) = Inlet.F*Inlet.h - OutletL.F*OutletL.h - OutletV.F*OutletV.h + InletQ;
    7579       
    7680        "Molar Holdup"
     
    113117        "Geometry Constraint"
    114118        V = ML * vL + MV * vV;
     119
     120        "Temperature indicator"
     121        TI * 'K' = OutletL.T - 273.15;
     122        "Pressure indicator"
     123        PI * 'atm' = OutletL.P;
     124        "Level indicator"
     125        LI*V = Level*Across;
    115126
    116127        switch orientation
     
    121132        "Liquid Level"
    122133                ML * vL = Across * Level;
    123 
     134               
    124135        case "horizontal":
    125136        "Cylindrical Side Area"
     
    157168out     OutletL as liquid_stream(Brief="Liquid outlet stream", PosX=0.4790, PosY=1, Symbol="_{outL}");
    158169out     OutletV as vapour_stream(Brief="Vapour outlet stream", PosX=0.4877, PosY=0, Symbol="_{outV}");
    159 in      InletQ as energy_stream (Brief="Rate of heat supply", PosX=1, PosY=0.7559, Symbol="_{in}");
     170in      InletQ as power (Brief="Rate of heat supply", PosX=1, PosY=0.7559, Symbol="_{in}");
    160171        vfrac as fraction (Brief="Vapourization fraction", Symbol="\phi");
    161172        Pratio as positive      (Brief = "Pressure Ratio", Symbol ="P_{ratio}");       
     
    173184       
    174185        "Energy Balance"
    175         Inlet.F*Inlet.h  + InletQ.Q = OutletL.F*OutletL.h + OutletV.F*OutletV.h;
     186        Inlet.F*Inlet.h  + InletQ = OutletL.F*OutletL.h + OutletV.F*OutletV.h;
    176187       
    177188        "Thermal Equilibrium"
     
    216227out     OutletL as liquid_stream(Brief="Liquid outlet stream", PosX=0.4790, PosY=1, Symbol="_{outL}");
    217228out     OutletV as vapour_stream(Brief="Vapour outlet stream", PosX=0.4877, PosY=0, Symbol="_{outV}");
    218 in      InletQ as energy_stream (Brief="Rate of heat supply", PosX=1, PosY=0.7559, Symbol="_{in}");
     229in      InletQ as power (Brief="Rate of heat supply", PosX=1, PosY=0.7559, Symbol="_{in}");
    219230        vfrac as fraction(Brief="Vaporization fraction", Symbol="\phi");
    220231        h as enth_mol(Brief="Mixture enthalpy");
     
    232243
    233244        "Energy Balance"
    234         Inlet.F*(h - Inlet.h) = InletQ.Q;
     245        Inlet.F*(h - Inlet.h) = InletQ;
    235246        Inlet.F*h = Inlet.F*(1-vfrac)*OutletL.h + Inlet.F*vfrac*OutletV.h;
    236247
     
    282293out     OutletL as liquid_stream(Brief="Liquid outlet stream", PosX=0.4790, PosY=1, Symbol="_{outL}");
    283294out     OutletV as vapour_stream(Brief="Vapour outlet stream", PosX=0.4877, PosY=0, Symbol="_{outV}");
    284 in      InletQ as energy_stream (Brief="Rate of heat supply", PosX=1, PosY=0.7559, Symbol="_{in}");
     295in      InletQ as power (Brief="Rate of heat supply", PosX=1, PosY=0.7559, Symbol="_{in}");
    285296        vfrac as fraction(Brief="Vaporization fraction", Symbol="\phi");
    286297        vsat as Real(Lower=-0.1, Upper=1.1, Brief="Vaporization fraction if saturated", Symbol="\phi_{sat}");
     
    308319
    309320        "Energy Balance if saturated"
    310         Inlet.F*Inlet.h  + InletQ.Q =
     321        Inlet.F*Inlet.h  + InletQ =
    311322                Inlet.F*(1-vsat)*PP.LiquidEnthalpy(Tsat, OutletL.P, xsat) +
    312323                Inlet.F*vsat*PP.VapourEnthalpy(Tsat, OutletV.P, ysat);
    313324
    314325        "Real Energy Balance"
    315         Inlet.F*Inlet.h  + InletQ.Q =
     326        Inlet.F*Inlet.h  + InletQ =
    316327                Inlet.F*(1-vfrac)*OutletL.h + Inlet.F*vfrac*OutletV.h;
    317328
  • branches/gui/eml/stage_separators/reboiler.mso

    r353 r555  
    5757out     OutletL as liquid_stream(Brief="Liquid outlet stream", PosX=0.2413, PosY=1, Symbol="_{outL}");
    5858out     OutletV as vapour_stream(Brief="Vapour outlet stream", PosX=0.5079, PosY=0, Symbol="_{outV}");
    59 in      InletQ as energy_stream (Brief="Heat supplied", PosX=1, PosY=0.6123, Symbol="_{in}");
     59in      InletQ as power (Brief="Heat supplied", PosX=1, PosY=0.6123, Symbol="_{in}");
    6060
    6161        M(NComp) as mol (Brief="Molar Holdup in the tray");
     
    7575        "Energy Balance"
    7676        diff(E) = Inlet.F*Inlet.h + InletL.F*InletL.h
    77                 - OutletL.F*OutletL.h - OutletV.F*OutletV.h + InletQ.Q;
     77                - OutletL.F*OutletL.h - OutletV.F*OutletV.h + InletQ;
    7878       
    7979        "Molar Holdup"
     
    140140in      InletL as stream(Brief="Liquid inlet stream", PosX=0.3345, PosY=1, Symbol="_{inL}");
    141141out     OutletV as vapour_stream(Brief="Vapour outlet stream", PosX=0.3369, PosY=0, Symbol="_{outV}");
    142 in      InletQ as energy_stream (Brief="Heat supplied", PosX=1, PosY=0.6111, Symbol="_{in}");
     142in      InletQ as power (Brief="Heat supplied", PosX=1, PosY=0.6111, Symbol="_{in}");
    143143        vV as volume_mol (Brief="Vapour Molar volume");
    144144        rhoV as dens_mass (Brief="Vapour Density");
     
    156156
    157157        "Energy Balance"
    158         InletL.F*InletL.h + InletQ.Q = OutletV.F*OutletV.h;
     158        InletL.F*InletL.h + InletQ = OutletV.F*OutletV.h;
    159159       
    160160        "Pressure"
     
    187187in      InletL as stream(Brief="Liquid inlet stream", PosX=0.3345, PosY=1, Symbol="_{inL}");
    188188out     OutletV as vapour_stream(Brief="Vapour outlet stream", PosX=0.3369, PosY=0, Symbol="_{outV}");
    189 in      InletQ as energy_stream (Brief="Heat supplied", PosX=1, PosY=0.6111, Symbol="_{in}");
     189in      InletQ as power (Brief="Heat supplied", PosX=1, PosY=0.6111, Symbol="_{in}");
    190190
    191191        EQUATIONS
     
    195195       
    196196        "Energy Balance"
    197         InletL.F*InletL.h + InletQ.Q = OutletV.F*OutletV.h;
     197        InletL.F*InletL.h + InletQ = OutletV.F*OutletV.h;
    198198       
    199199        "Pressure"
     
    207207       
    208208        "Pressure Drop through the reboiler"
    209         OutletV.F = k*InletQ.Q;
     209        OutletV.F = k*InletQ;
    210210end
    211211
     
    253253out     OutletL as liquid_stream(Brief="Liquid outlet stream", PosX=0.2413, PosY=1, Symbol="_{outL}");
    254254out     OutletV as vapour_stream(Brief="Vapour outlet stream", PosX=0.5079, PosY=0, Symbol="_{outV}");
    255 in      InletQ as energy_stream (Brief="Heat supplied", PosX=1, PosY=0.6123, Symbol="_{in}");
     255in      InletQ as power (Brief="Heat supplied", PosX=1, PosY=0.6123, Symbol="_{in}");
    256256
    257257        M(NComp) as mol (Brief="Molar Holdup in the tray");
     
    281281        "Energy Balance"
    282282        diff(E) = Inlet.F*Inlet.h + InletL.F*InletL.h
    283                 - OutletL.F*OutletL.h - OutletV.F*OutletV.h + InletQ.Q + Hr * r3 * vL*ML;
     283                - OutletL.F*OutletL.h - OutletV.F*OutletV.h + InletQ + Hr * r3 * vL*ML;
    284284       
    285285        "Molar Holdup"
  • branches/gui/eml/stage_separators/tank.mso

    r353 r555  
    6161in      Inlet  as stream (Brief = "Inlet stream", PosX=0.3037, PosY=0, Symbol="_{in}");
    6262out     Outlet as liquid_stream (Brief = "Outlet liquid stream", PosX=1, PosY=1, Symbol="_{out}");
    63 in      InletQ as energy_stream (Brief="Rate of heat supply", PosX=1, PosY=0.7859, Symbol="_{in}");
     63in      InletQ as power (Brief="Rate of heat supply", PosX=1, PosY=0.7859, Symbol="_{in}");
    6464        Level    as length(Brief="Tank level");
    6565        M(NComp) as mol (Brief="Molar Holdup in the tank");
     
    7272       
    7373        "Energy balance"
    74         diff(E) = Inlet.F*Inlet.h - Outlet.F*Outlet.h + InletQ.Q;
     74        diff(E) = Inlet.F*Inlet.h - Outlet.F*Outlet.h + InletQ;
    7575
    7676        "Energy Holdup"
     
    121121in      Inlet  as stream (Brief = "Inlet stream", PosX=0.1825, PosY=0, Symbol="_{in}");
    122122out     Outlet as liquid_stream (Brief = "Outlet liquid stream", PosX=1, PosY=1, Symbol="_{out}");
    123 in      InletQ as energy_stream (Brief="Rate of heat supply", PosX=1, PosY=0.6160, Symbol="_{in}");
     123in      InletQ as power (Brief="Rate of heat supply", PosX=1, PosY=0.6160, Symbol="_{in}");
    124124        Level    as length(Brief="Tank level");
    125125        Across as area (Brief="Tank cross section area", Default=2);
     
    133133       
    134134        "Energy balance"
    135         diff(E) = Inlet.F*Inlet.h - Outlet.F*Outlet.h + InletQ.Q;
     135        diff(E) = Inlet.F*Inlet.h - Outlet.F*Outlet.h + InletQ;
    136136
    137137        "Energy Holdup"
     
    212212in      Inlet  as stream (Brief = "Inlet stream", PosX=0.3037, PosY=0, Symbol="_{in}");
    213213out     Outlet as liquid_stream (Brief = "Outlet liquid stream", PosX=1, PosY=1, Symbol="_{out}");
    214 in      InletQ as energy_stream (Brief="Rate of heat supply", PosX=1, PosY=0.7859, Symbol="_{in}");
     214in      InletQ as power (Brief="Rate of heat supply", PosX=1, PosY=0.7859, Symbol="_{in}");
    215215
    216216        Level    as length(Brief="Tank level");
     
    224224       
    225225        "Energy balance"
    226         diff(E) = Feed.F*Feed.h + Inlet.F*Inlet.h - Outlet.F*Outlet.h + InletQ.Q;
     226        diff(E) = Feed.F*Feed.h + Inlet.F*Inlet.h - Outlet.F*Outlet.h + InletQ;
    227227
    228228        "Energy Holdup"
  • branches/gui/eml/streams.mso

    r551 r555  
    381381end
    382382
    383 Model energy_stream
    384         ATTRIBUTES
    385         Pallete = false;
    386         Brief = "General Energy Stream";
    387         Info =
    388         "This is the basic building block for the EML models.
    389         Every model should have input and output energy streams
    390         derived from this model.";
    391 
    392         VARIABLES
    393         Q as heat_rate(Brief="Energy rate");
    394 end
    395 
    396383Model energy_source
    397384        ATTRIBUTES
     
    401388
    402389        VARIABLES
    403         out OutletQ             as energy_stream (Brief = "Outlet energy stream", PosX=1, PosY=0.46, Symbol="_{out}");
    404 end
     390        out OutletQ             as power(Brief = "Outlet energy stream", PosX=1, PosY=0.46, Symbol="_{out}");
     391end
Note: See TracChangeset for help on using the changeset viewer.