Changeset 844 for trunk/eml


Ignore:
Timestamp:
Sep 10, 2009, 8:47:35 AM (13 years ago)
Author:
Argimiro Resende Secchi
Message:

Adding dew and bubble point models in flash.mso.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/eml/stage_separators/flash.mso

    r680 r844  
    198198
    199199#*----------------------------------------------------------------------
     200* Model of a Steady State Bubble flash
     201*---------------------------------------------------------------------*#
     202Model bubble_steady
     203        ATTRIBUTES
     204        Pallete         = true;
     205        Icon            = "icon/Flash";
     206        Brief           = "Model of a Steady State flash.";
     207        Info            =
     208"== Assumptions ==
     209* both phases are perfectly mixed.
     210       
     211== Specify ==
     212* the feed stream;
     213* the outlet pressure (OutletV.P);
     214* the outlet temperature OR the heat supplied.
     215";
     216       
     217        PARAMETERS
     218outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
     219       
     220        VARIABLES
     221in      Inlet as stream(Brief="Feed Stream", PosX=0, PosY=0.5421, Symbol="_{in}");
     222out     OutletL as liquid_stream(Brief="Liquid outlet stream", PosX=0.4790, PosY=1, Symbol="_{outL}");
     223out     OutletV as vapour_stream(Brief="Vapour outlet stream", PosX=0.4877, PosY=0, Symbol="_{outV}");
     224in      InletQ as energy_stream (Brief="Rate of heat supply", PosX=1, PosY=0.7559, Symbol="_{in}");
     225        vfrac as fraction (Brief="Vapourization fraction", Symbol="\phi");
     226        Pratio as positive      (Brief = "Pressure Ratio", Symbol ="P_{ratio}");       
     227        Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P");
     228
     229        EQUATIONS
     230        "The flash calculation"
     231        PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z =
     232                PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z;
     233
     234        "Component Molar Balance"
     235        Inlet.z = OutletL.z;
     236        sum(OutletL.z) = sum(OutletV.z);
     237
     238        "Global Molar Balance"
     239        Inlet.F = OutletV.F + OutletL.F;
     240       
     241        "Vaporization Fraction"
     242        OutletV.F = Inlet.F * vfrac;
     243
     244        "Energy Balance"
     245        Inlet.F*Inlet.h  + InletQ.Q = OutletL.F*OutletL.h + OutletV.F*OutletV.h;
     246       
     247        "Thermal Equilibrium"
     248        OutletV.T = OutletL.T;
     249       
     250        "Mechanical Equilibrium"
     251        OutletV.P = OutletL.P;
     252
     253        "Pressure Drop"
     254        OutletL.P  = Inlet.P - Pdrop;
     255
     256        "Pressure Ratio"
     257        OutletL.P = Inlet.P * Pratio;
     258       
     259        "Vapor fraction"
     260        vfrac = 0;
     261end
     262
     263#*----------------------------------------------------------------------
     264* Model of a Steady State Dew flash
     265*---------------------------------------------------------------------*#
     266Model dew_steady
     267        ATTRIBUTES
     268        Pallete         = true;
     269        Icon            = "icon/Flash";
     270        Brief           = "Model of a Steady State flash.";
     271        Info            =
     272"== Assumptions ==
     273* both phases are perfectly mixed.
     274       
     275== Specify ==
     276* the feed stream;
     277* the outlet pressure (OutletV.P);
     278* the outlet temperature OR the heat supplied.
     279";
     280       
     281        PARAMETERS
     282outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
     283       
     284        VARIABLES
     285in      Inlet as stream(Brief="Feed Stream", PosX=0, PosY=0.5421, Symbol="_{in}");
     286out     OutletL as liquid_stream(Brief="Liquid outlet stream", PosX=0.4790, PosY=1, Symbol="_{outL}");
     287out     OutletV as vapour_stream(Brief="Vapour outlet stream", PosX=0.4877, PosY=0, Symbol="_{outV}");
     288in      InletQ as energy_stream (Brief="Rate of heat supply", PosX=1, PosY=0.7559, Symbol="_{in}");
     289        vfrac as fraction (Brief="Vapourization fraction", Symbol="\phi");
     290        Pratio as positive      (Brief = "Pressure Ratio", Symbol ="P_{ratio}");       
     291        Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P");
     292
     293        EQUATIONS
     294        "The flash calculation"
     295        PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z =
     296                PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z;
     297
     298        "Component Molar Balance"
     299        Inlet.z = OutletV.z;
     300        sum(OutletL.z) = sum(OutletV.z);
     301
     302        "Global Molar Balance"
     303        Inlet.F = OutletV.F + OutletL.F;
     304       
     305        "Vaporization Fraction"
     306        OutletV.F = Inlet.F * vfrac;
     307
     308        "Energy Balance"
     309        Inlet.F*Inlet.h  + InletQ.Q = OutletL.F*OutletL.h + OutletV.F*OutletV.h;
     310       
     311        "Thermal Equilibrium"
     312        OutletV.T = OutletL.T;
     313       
     314        "Mechanical Equilibrium"
     315        OutletV.P = OutletL.P;
     316
     317        "Pressure Drop"
     318        OutletL.P  = Inlet.P - Pdrop;
     319
     320        "Pressure Ratio"
     321        OutletL.P = Inlet.P * Pratio;
     322       
     323        "Vapor fraction"
     324        vfrac = 1;
     325end
     326
     327#*----------------------------------------------------------------------
     328* Model of a Steady State flash
     329*---------------------------------------------------------------------*#
     330Model flash_steady_full
     331        ATTRIBUTES
     332        Pallete         = true;
     333        Icon            = "icon/Flash";
     334        Brief           = "Model of a Steady State flash.";
     335        Info            =
     336"== Assumptions ==
     337* both phases are perfectly mixed.
     338       
     339== Specify ==
     340* the feed stream;
     341* the outlet pressure (OutletV.P);
     342* the outlet temperature OR the heat supplied.
     343";
     344       
     345        PARAMETERS
     346outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
     347       
     348        VARIABLES
     349in      Inlet as stream(Brief="Feed Stream", PosX=0, PosY=0.5421, Symbol="_{in}");
     350out     OutletL as liquid_stream(Brief="Liquid outlet stream", PosX=0.4790, PosY=1, Symbol="_{outL}");
     351out     OutletV as vapour_stream(Brief="Vapour outlet stream", PosX=0.4877, PosY=0, Symbol="_{outV}");
     352in      InletQ as energy_stream (Brief="Rate of heat supply", PosX=1, PosY=0.7559, Symbol="_{in}");
     353        vfrac as fraction (Brief="Vapourization fraction", Symbol="\phi");
     354        Pratio as positive      (Brief = "Pressure Ratio", Symbol ="P_{ratio}");       
     355        Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P");
     356
     357        EQUATIONS
     358        "The flash calculation"
     359        PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z =
     360                PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z;
     361
     362        "Component Molar Balance"
     363        Inlet.F*Inlet.z = OutletL.F*OutletL.z + OutletV.F*OutletV.z;
     364        sum(OutletL.z) = sum(OutletV.z);
     365
     366        "Global Molar Balance"
     367        Inlet.F = OutletV.F + OutletL.F;
     368       
     369        "Vaporization Fraction"
     370        OutletV.F = Inlet.F * vfrac;
     371
     372        "Energy Balance"
     373        Inlet.F*Inlet.h  + InletQ.Q = OutletL.F*OutletL.h + OutletV.F*OutletV.h;
     374       
     375        "Thermal Equilibrium"
     376        OutletV.T = OutletL.T;
     377       
     378        "Mechanical Equilibrium"
     379        OutletV.P = OutletL.P;
     380
     381        "Pressure Drop"
     382        OutletL.P  = Inlet.P - Pdrop;
     383
     384        "Pressure Ratio"
     385        OutletL.P = Inlet.P * Pratio;
     386end
     387
     388#*----------------------------------------------------------------------
     389* Model of a Steady State flash
     390*---------------------------------------------------------------------*#
     391Model flash_steady_bd
     392        ATTRIBUTES
     393        Pallete         = true;
     394        Icon            = "icon/Flash";
     395        Brief           = "Model of a Steady State flash.";
     396        Info            =
     397"== Assumptions ==
     398* both phases are perfectly mixed.
     399       
     400== Specify ==
     401* the feed stream;
     402* the outlet pressure (OutletV.P);
     403* the outlet temperature OR the heat supplied.
     404";
     405       
     406        PARAMETERS
     407outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
     408outer NComp as Integer;
     409
     410        VARIABLES
     411in      Inlet as stream(Brief="Feed Stream", PosX=0, PosY=0.5421, Symbol="_{in}");
     412out     OutletL as liquid_stream(Brief="Liquid outlet stream", PosX=0.4790, PosY=1, Symbol="_{outL}");
     413out     OutletV as vapour_stream(Brief="Vapour outlet stream", PosX=0.4877, PosY=0, Symbol="_{outV}");
     414in      InletQ as energy_stream (Brief="Rate of heat supply", PosX=1, PosY=0.7559, Symbol="_{in}");
     415        vfrac as fraction (Brief="Vapourization fraction", Symbol="\phi");
     416        Pratio as positive      (Brief = "Pressure Ratio", Symbol ="P_{ratio}");       
     417        Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P");
     418        T_dew as temperature (Brief="Dew-point Temperature");
     419        T_bubble as temperature (Brief="Bubble-point Temperature");
     420        x_dew(NComp) as fraction (Brief="Dew-point liquid composition");
     421        y_bubble(NComp) as fraction (Brief="Bubble-point Vapour composition");
     422
     423        EQUATIONS
     424       
     425        if OutletL.T > T_bubble and OutletL.T < T_dew then
     426           "The flash calculation"
     427                PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z =
     428                PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z;
     429
     430           "Composition constraint"
     431                sum(OutletL.z) = sum(OutletV.z);
     432
     433           "Component Molar Balance"
     434                Inlet.F*Inlet.z = OutletL.F*OutletL.z + OutletV.F*OutletV.z;
     435
     436        else if OutletL.T <= T_bubble then
     437                        "Bubble-point result"
     438                        OutletL.z = Inlet.z;
     439                        OutletV.z = y_bubble;
     440                        vfrac = 0;
     441                 else
     442                        "Dew-point result"
     443                        OutletL.z = x_dew;
     444                        OutletV.z = Inlet.z;
     445                        vfrac = 1;
     446                 end
     447        end
     448
     449        "Dew-point equations"
     450        PP.LiquidFugacityCoefficient(T_dew, OutletL.P, x_dew)*x_dew =
     451                PP.VapourFugacityCoefficient(T_dew, OutletV.P, Inlet.z)*Inlet.z;
     452        sum(x_dew) = 1;
     453
     454        "Bubble-point equations"
     455        PP.LiquidFugacityCoefficient(T_bubble, OutletL.P, Inlet.z)*Inlet.z =
     456                PP.VapourFugacityCoefficient(T_bubble, OutletV.P, y_bubble)*y_bubble;
     457        sum(y_bubble) = 1;
     458
     459        "Global Molar Balance"
     460        Inlet.F = OutletV.F + OutletL.F;
     461       
     462        "Vaporization Fraction"
     463        OutletV.F = Inlet.F * vfrac;
     464
     465        "Energy Balance"
     466        Inlet.F*Inlet.h  + InletQ.Q = OutletL.F*OutletL.h + OutletV.F*OutletV.h;
     467       
     468        "Thermal Equilibrium"
     469        OutletV.T = OutletL.T;
     470       
     471        "Mechanical Equilibrium"
     472        OutletV.P = OutletL.P;
     473
     474        "Pressure Drop"
     475        OutletL.P  = Inlet.P - Pdrop;
     476
     477        "Pressure Ratio"
     478        OutletL.P = Inlet.P * Pratio;
     479end
     480
     481
     482#*----------------------------------------------------------------------
    200483* Model of a steady-state PH flash.
    201484*---------------------------------------------------------------------*#
Note: See TracChangeset for help on using the changeset viewer.