Changeset 372 for trunk/eml


Ignore:
Timestamp:
Sep 21, 2007, 7:17:36 PM (16 years ago)
Author:
Argimiro Resende Secchi
Message:

Adding pressure drop variable (Pdrop) and pressure ratio (Pratio) in some models. Need to do the same for other models.

Location:
trunk/eml
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/eml/heat_exchangers/heater.mso

    r358 r372  
    3939        Lfrac                   as fraction             (Brief = "Liquid fraction Outlet Stream",Symbol="L_{frac}");
    4040        Kvalue(NComp)   as Real                         (Brief = "Phase Equilibrium K-values",Symbol="K_{value}");
    41 in  Inlet(Ninlet )  as stream                   (Brief="Inlet Streams", PosX=0, PosY=0.4833, Symbol="^{in}");
    42 out Outlet              as streamPH                     (Brief="Outlet Stream", PosX=1, PosY=0.4782, Symbol="^{out}");
     41        Pratio                  as positive                     (Brief = "Pressure Ratio", Symbol ="P_{ratio}");       
     42        Pdrop                   as press_delta          (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P");
     43in  Inlet(Ninlet )  as stream                   (Brief = "Inlet Streams", PosX=0, PosY=0.4833, Symbol="^{in}");
     44out Outlet              as streamPH                     (Brief = "Outlet Stream", PosX=1, PosY=0.4782, Symbol="^{out}");
    4345       
    4446 EQUATIONS
     
    6365        QDuty = Outlet.F*Outlet.h - sum(Inlet.F*Inlet.h);
    6466
     67 "Pressure Drop"
     68        Outlet.P = Inlet.P - Pdrop;
     69
     70 "Pressure Ratio"
     71        Outlet.P = Inlet.P * Pratio;
     72       
    6573 switch Kvalues # Fix for better convergence !!!
    6674        case "yes":
  • trunk/eml/pressure_changers/compressor.mso

    r353 r372  
    4848        Cp              as cp_mol               (Brief = "Heat Capacity");
    4949        Cv                      as cv_mol               (Brief = "Heat Capacity");
    50         Pdiff           as press_delta  (Brief = "Pressure Increase", DisplayUnit='kPa');
    51         Pratio          as positive             (Brief = "Pressure Ratio");     
     50        Pratio          as positive             (Brief = "Pressure Ratio", Symbol ="P_{ratio}");       
     51        Pdrop           as press_delta  (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P");
    5252        Wp                      as energy_mol   (Brief = "Politropic Head");
    5353        Ws                      as energy_mol   (Brief = "Isentropic Head");
     
    6868        Mwm = sum(Mw*Inlet.z);
    6969
    70         "Calculate Outlet Stream Pressure"
    71         Outlet.P = Inlet.P + Pdiff;
    72        
    73         "Pratio Definition"
     70        "Pressure Ratio"
    7471        Outlet.P = Inlet.P * Pratio;
    75        
     72
     73        "Pressure Drop"
     74        Outlet.P  = Inlet.P - Pdrop;
     75
    7676        "Calculate Cp Using a External Physical Properties Routine"
    7777        Cp = PP.VapourCp(Inlet.T,Inlet.P,Inlet.z);
     
    106106        FPower*Effs = Inlet.F*Ws;
    107107       
    108         "Molar Balance"
     108        "Overall Molar Balance"
    109109        Outlet.F = Inlet.F;
    110        
     110
     111        "Component Molar Balance"
    111112        Outlet.z = Inlet.z;
    112113end
  • trunk/eml/pressure_changers/pump.mso

    r353 r372  
    5454        BPower    as power                      (Brief = "Brake Power");
    5555        EPower    as power                      (Brief = "Eletrical Potency");
    56         Pdiff     as press_delta        (Brief = "Pressure Increase", DisplayUnit='kPa');
    57         Pratio    as positive           (Brief = "Pressure Ratio");     
     56        Pratio    as positive           (Brief = "Pressure Ratio", Symbol ="P_{ratio}");       
     57        Pdrop     as press_delta        (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P");
    5858        Head      as head                       (Brief = "Head Developed");
    5959        Head_is   as head                       (Brief = "Isoentripic Head");
     
    9090        vm = PP.LiquidVolume(Inlet.T,Inlet.P,Inlet.z);
    9191       
    92         #Mass and Energy Balance and Pump Equations     
    93         "Calculate Outlet Stream Pressure"
    94         Outlet.P = Inlet.P + Pdiff;
    95        
    96         "Pratio Definition"
     92        "Pressure Ratio"
    9793        Outlet.P = Inlet.P * Pratio;
    98        
     94
     95        "Pressure Drop"
     96        Outlet.P  = Inlet.P - Pdrop;
     97
    9998        "Calculate Isentropic Head"
    100         Head_is = Pdiff * Mwm/rho;
     99        Head_is = -Pdrop * Mwm/rho;
    101100
    102101        "Calculate Real Head"
     
    116115       
    117116        "Calculate Outlet Temperature"
    118         (Outlet.T - Inlet.T) * Cp = (Outlet.h - Inlet.h) -  Pdiff * Mwm / rho * (1 - Beta * Inlet.T);
     117        (Outlet.T - Inlet.T) * Cp = (Outlet.h - Inlet.h) + Pdrop * Mwm / rho * (1 - Beta * Inlet.T);
    119118       
    120119        "Molar Balance"
  • trunk/eml/pressure_changers/turbine.mso

    r353 r372  
    5353        BPower  as power                        (Brief = "Brake Power");
    5454        EPower  as power                        (Brief = "Eletrical Potency");
    55         Pdiff   as press_delta          (Brief = "Pressure Increase");
    56         Pratio  as positive                     (Brief = "Pressure Ratio");     
     55        Pratio  as positive                     (Brief = "Pressure Ratio");
     56        Pdrop   as press_delta          (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P");
    5757        Mwm     as molweight            (Brief = "Mixture Molar Weight");
    5858        rho             as dens_mass            (Brief = "Specific Mass");
     
    7878        Cp = PP.LiquidCp(Inlet.T,Inlet.P,Inlet.z);
    7979       
    80         #Mass and Energy Balance and Turbine Equations
    81         "Calculate Outlet Stream Pressure"
    82         Outlet.P = Inlet.P + Pdiff;
    83        
    84         "Pratio Definition"
     80        "Pressure Ratio"
    8581        Outlet.P = Inlet.P * Pratio;
    86        
     82
     83        "Pressure Drop"
     84        Outlet.P  = Inlet.P - Pdrop;
     85
    8786        "Calculate Fluid Power"
    88         FPower * rho = Pdiff * Inlet.F * Mwm;
    89        
     87        FPower * rho = -Pdrop * Inlet.F * Mwm;
     88
    9089        "Calculate Brake Power"
    9190        BPower = FPower * Eff;
     
    9695        "Calculate Outlet Temperature"
    9796        (Outlet.T - Inlet.T) * rho * Cp = (Outlet.h - Inlet.h) * rho
    98         -  Pdiff * Mwm * (1-Beta*Inlet.T);
     97        + Pdrop * Mwm * (1-Beta*Inlet.T);
    9998       
    10099        "Calculate Outlet Enthalpy"
    101         (Outlet.h - Inlet.h) * rho =  Pdiff * Mwm;
     100        (Outlet.h - Inlet.h) * rho =  -Pdrop * Mwm;
    102101       
    103102        "Molar Balance"
  • trunk/eml/pressure_changers/valve.mso

    r353 r372  
    5454
    5555        VARIABLES
    56         Pdiff   as press_delta          (Brief = "Pressure Increase");
     56        Pratio  as positive                     (Brief = "Pressure Ratio", Symbol ="P_{ratio}");       
     57        Pdrop   as press_delta          (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P");
    5758        Qv              as flow_vol                     (Brief = "Volumetric Flow");
    5859        fc              as positive                     (Brief = "Opening Function");
     
    6970       
    7071        EQUATIONS
    71         "Calculate Outlet Stream Pressure"
    72         Inlet.P - Outlet.P = Pdiff;
     72        "Pressure Drop"
     73        Outlet.P  = Inlet.P - Pdrop;
     74
     75        "Pressure Ratio"
     76        Outlet.P = Inlet.P * Pratio;
    7377       
    7478        "Enthalpy Balance"
     
    8185        Outlet.z = Inlet.z;
    8286
    83         if Pdiff > 0 then
     87        if Pdrop > 0 then
    8488                "Valve Equation - Flow"
    85                 Qv = fc*cv*sqrt(Pdiff/Gf);     
     89                Qv = fc*cv*sqrt(Pdrop/Gf);     
    8690        else
    8791                "Valve Equation - Closed"
     
    169173        rho as dens_mass (Brief="Fluid Density", Default=1e3);
    170174        v as vol_mol (Brief="Specific volume", Default=1e3);
     175        Pdrop     as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P");
     176        Pratio  as positive     (Brief = "Pressure Ratio", Symbol ="P_{ratio}");       
    171177
    172178        PARAMETERS
     
    175181
    176182        EQUATIONS
    177         "Molar Balance"
     183        "Overall Molar Balance"
    178184        Inlet.F = Outlet.F;
     185       
     186        "Componente Molar Balance"
    179187        Inlet.z = Outlet.z;
    180188       
    181189        "Energy Balance"
    182190        Inlet.h = Outlet.h;
     191
     192        "Pressure Drop"
     193        Outlet.P  = Inlet.P - Pdrop;
     194
     195        "Pressure Ratio"
     196        Outlet.P = Inlet.P * Pratio;
    183197
    184198        "Density"
     
    190204                (1-Inlet.v)*PP.LiquidVolume((Inlet.T+Outlet.T)/2, (Inlet.P+Outlet.P)/2, Outlet.z);
    191205
    192         if Inlet.P > Outlet.P then
     206        if Pdrop > 0 then
    193207                "Flow"
    194                 Outlet.F * v = k*x*sqrt((Inlet.P - Outlet.P)*rho_ref / rho ) ;
     208                Outlet.F * v = k*x*sqrt(Pdrop * rho_ref / rho ) ;
    195209        else
    196210                "Closed"
  • trunk/eml/stage_separators/flash.mso

    r353 r372  
    6464        Across as area (Brief="Flash Cross section area");
    6565        vfrac as positive (Brief="Vapourization fraction", Symbol="\phi");
     66        Pratio as positive      (Brief = "Pressure Ratio", Symbol ="P_{ratio}");       
     67        Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P");
    6668
    6769        EQUATIONS
     
    102104        "Mechanical Equilibrium"
    103105        OutletV.P = OutletL.P;
    104        
     106
     107        "Pressure Drop"
     108        OutletL.P  = Inlet.P - Pdrop;
     109
     110        "Pressure Ratio"
     111        OutletL.P = Inlet.P * Pratio;
     112
    105113        "Geometry Constraint"
    106114        V = ML * vL + MV * vV;
     
    151159in      InletQ as energy_stream (Brief="Rate of heat supply", PosX=1, PosY=0.7559, Symbol="_{in}");
    152160        vfrac as fraction (Brief="Vapourization fraction", Symbol="\phi");
     161        Pratio as positive      (Brief = "Pressure Ratio", Symbol ="P_{ratio}");       
     162        Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P");
    153163
    154164        EQUATIONS
     
    170180        "Mechanical Equilibrium"
    171181        OutletV.P = OutletL.P;
     182
     183        "Pressure Drop"
     184        OutletL.P  = Inlet.P - Pdrop;
     185
     186        "Pressure Ratio"
     187        OutletL.P = Inlet.P * Pratio;
    172188end
    173189
     
    203219        vfrac as fraction(Brief="Vaporization fraction", Symbol="\phi");
    204220        h as enth_mol(Brief="Mixture enthalpy");
     221        Pratio as positive (Brief = "Pressure Ratio", Symbol ="P_{ratio}");     
     222        Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P");
    205223
    206224        EQUATIONS
     
    222240        "Mechanical Equilibrium"
    223241        OutletV.P = OutletL.P;
     242
     243        "Pressure Drop"
     244        OutletL.P  = Inlet.P - Pdrop;
     245
     246        "Pressure Ratio"
     247        OutletL.P = Inlet.P * Pratio;
    224248end
    225249
     
    264288        xsat(NComp) as Real(Lower=0, Upper=1, Brief="Liquid composition if saturated");
    265289        ysat(NComp) as Real(Lower=0, Upper=1, Brief="Vapour composition if saturated");
     290        Pratio as positive (Brief = "Pressure Ratio", Symbol ="P_{ratio}");     
     291        Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P");
    266292       
    267293        zero_one as fraction(Brief="Regularization Variable");
     
    295321        "Mechanical Equilibrium"
    296322        OutletV.P = OutletL.P;
    297        
     323
     324        "Pressure Drop"
     325        OutletL.P  = Inlet.P - Pdrop;
     326
     327        "Pressure Ratio"
     328        OutletL.P = Inlet.P * Pratio;
     329
    298330        # regularization functions
    299331        zero_one = (1 + tanh(B * vsat))/2;
Note: See TracChangeset for help on using the changeset viewer.