Changeset 604


Ignore:
Timestamp:
Aug 21, 2008, 11:30:04 PM (14 years ago)
Author:
gerson bicca
Message:

added expander model

Location:
branches/gui
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/eml/pressure_changers/turbine.mso

    r597 r604  
    128128Model expander
    129129       
    130         ATTRIBUTES
     130ATTRIBUTES
    131131        Pallete         = true;
    132132        Icon            = "icon/HidraulicTurbine";
    133         Brief           = "Testing Model of a expander.";
     133        Brief           = "Model of an expansor.";
     134        Info            =
     135"To be documented";
    134136       
    135137PARAMETERS
    136138
    137 outer NComp     as Integer                      (Brief = "Number of chemical components", Lower = 1);
    138 outer PP                as Plugin                       (Brief = "External Physical Properties", Type="PP");
    139         Mw(NComp)       as molweight            (Brief = "Molar Weight");
    140        
     139outer PP                as Plugin               (Brief = "External Physical Properties", Type="PP");
     140outer NComp     as Integer              (Brief = "Number of chemical components", Lower = 1);
     141        Rgas            as positive     (Brief = "Constant of Gases", Unit= 'kJ/kmol/K', Default = 8.31451,Hidden=true);
     142        Mw(NComp)       as molweight    (Brief = "Molar Weight");
     143
    141144VARIABLES
    142         Eff     as efficiency           (Brief = "Turbine efficiency");
    143         Meff    as efficiency           (Brief = "Brake efficiency");
    144         Beta    as positive             (Brief = "Volumetric expansivity", Unit = '1/K');
    145         Head    as head                         (Brief = "Head Developed");
    146         FPower  as power                        (Brief = "Fluid Power");
    147         BPower  as power                        (Brief = "Brake Power");
    148         Pratio  as positive                     (Brief = "Pressure Ratio");
    149         Pdrop   as press_delta          (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P");
    150         Mwm     as molweight            (Brief = "Mixture Molar Weight");
    151         rho             as dens_mass            (Brief = "Specific Mass");
    152         Cp              as cp_mol                       (Brief = "Heat Capacity");
    153        
     145
     146        IseCoeff        as positive     (Brief = "Isentropic Coefficient", Lower=0.2);
     147        Pratio          as positive             (Brief = "Pressure Ratio", Symbol ="P_{ratio}");       
     148        Pdrop           as press_delta  (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P");
     149        Pdecrease       as press_delta  (Brief = "Pressure Decrease", DisplayUnit = 'kPa', Symbol ="P_{decr}");
     150
     151        Head                            as energy_mass  (Brief = "Head");
     152        HeadIsentropic          as energy_mass  (Brief = "Isentropic Head");
     153        Tisentropic                     as temperature  (Brief = "Isentropic Temperature");
     154       
     155        IsentropicEff   as efficiency   (Brief = "Isentropic efficiency");
     156        MechanicalEff   as efficiency   (Brief = "Mechanical efficiency");
     157       
     158        FluidPower      as power                (Brief = "Fluid Power");
     159        BrakePower      as power                (Brief = "Brake Power");
     160        PowerLoss       as power                (Brief = "Power Losses");
     161        Mwm                     as molweight    (Brief = "Mixture Molar Weight");
     162        rho                     as dens_mass    (Brief = "Mass Density");
     163        Zfac_in         as fraction     (Brief = "Compressibility factor at inlet");
     164        Zfac_out        as fraction     (Brief = "Compressibility factor at outlet");
     165
    154166in      Inlet           as stream       (Brief = "Inlet stream", PosX=0.05, PosY=0.0, Symbol="_{in}");
    155 out     Outlet          as stream       (Brief = "Outlet stream", PosX=0.65, PosY=1, Symbol="_{out}");
    156 out WorkOut             as power        (Brief = "Work Outlet", PosX=1, PosY=0.46);
     167out     Outlet          as streamPH     (Brief = "Outlet stream", PosX=0.65, PosY=1, Symbol="_{out}");
     168
     169out     WorkOut         as power        (Brief = "Work Outlet", PosX=1, PosY=0.46);
    157170
    158171SET
    159         Mw = PP.MolecularWeight();     
    160        
     172
     173        Mw = PP.MolecularWeight();
     174
     175        Rgas    = 8.31451*'kJ/kmol/K';
     176
    161177EQUATIONS
    162178
    163 "Calculate Mwm for Inlet Mixture"
     179"Overall Molar Balance"
     180        Outlet.F = Inlet.F;
     181
     182"Component Molar Balance"
     183        Outlet.z = Inlet.z;
     184
     185"Average Molecular Weight"
    164186        Mwm = sum(Mw*Inlet.z);
    165187
    166 "Calculate rho using a External Physical Properties Routine"
    167         rho = PP.LiquidDensity(Inlet.T,Inlet.P,Inlet.z);
    168        
    169 "Calculate Outlet Vapour Fraction"
    170         Outlet.v = PP.VapourFraction(Outlet.T, Outlet.P, Outlet.z);
    171        
    172 "Calculate Cp Using a External Physical Properties Routine"
    173         Cp = PP.LiquidCp(Inlet.T,Inlet.P,Inlet.z);
    174        
    175188"Pressure Ratio"
    176189        Outlet.P = Inlet.P * Pratio;
     
    179192        Outlet.P  = Inlet.P - Pdrop;
    180193
    181 "Calculate Fluid Power"
    182         FPower * rho = -Pdrop * Inlet.F * Mwm;
    183 
    184 "Calculate Brake Power"
    185         BPower = FPower * Eff;
    186 
    187         BPower = WorkOut;
    188 
    189 "Calculate Outlet Temperature"
    190         (Outlet.T - Inlet.T) * rho * Cp = (Outlet.h - Inlet.h) * rho
    191         + Pdrop * Mwm * (1-Beta*Inlet.T);
    192 
    193 "Calculate Outlet Enthalpy"
    194         (Outlet.h - Inlet.h) * rho =  -Pdrop * Mwm;
    195 
    196 "Molar Balance"
    197         Outlet.F = Inlet.F;
    198 "Outlet Composition"
    199         Outlet.z = Inlet.z;
    200 
    201 "Calculate Head"
    202         Head = Outlet.h - Inlet.h;
    203 
    204 end
     194"Pressure Decrease"
     195        Outlet.P  = Inlet.P - Pdecrease;
     196
     197"Mass Density"
     198        rho = PP.VapourDensity(Inlet.T, Inlet.P, Inlet.z);
     199       
     200"Compressibility factor at Inlet Conditions"
     201        Zfac_in = PP.VapourCompressibilityFactor(Inlet.T,Inlet.P,Inlet.z);
     202       
     203"Compressibility factor at Outlet Conditions"
     204        Zfac_out = PP.VapourCompressibilityFactor(Outlet.T,Outlet.P,Outlet.z);
     205
     206"Isentropic Head"
     207        HeadIsentropic*Mwm = (PP.VapourEnthalpy(Tisentropic,Outlet.P,Outlet.z)-Inlet.h);
     208
     209"Isentropic Outlet Temperature"
     210        PP.VapourEntropy(Tisentropic, Outlet.P, Outlet.z) = PP.VapourEntropy(Inlet.T, Inlet.P, Inlet.z);
     211
     212
     213if IsentropicEff equal 1
     214
     215        then
     216"Discharge Temperature"
     217        Outlet.T = Tisentropic;
     218
     219"Head"
     220        Head = HeadIsentropic;
     221
     222"Isentropic Coefficient"
     223        IseCoeff= 1;
     224
     225        else
     226"Isentropic Coefficient"
     227        #HeadIsentropic = (0.5*Zfac_in+0.5*Zfac_out)*(1/Mwm)*(IseCoeff/(IseCoeff-1.001))*Rgas*Inlet.T*((Outlet.P/Inlet.P)^((IseCoeff-1.001)/IseCoeff) - 1);
     228        Head = (0.5*Zfac_in+0.5*Zfac_out)*(1/Mwm)*(IseCoeff/(IseCoeff-1.001))*Rgas*Inlet.T*((Outlet.P/Inlet.P)^((IseCoeff-1.001)/IseCoeff) - 1);
     229
     230"Discharge Temperature"
     231        Outlet.T = Inlet.T*((Outlet.P/Inlet.P)^((IseCoeff-1.001)/IseCoeff));
     232
     233"Head"
     234        Head*Mwm = (PP.VapourEnthalpy(Outlet.T,Outlet.P,Outlet.z)-Inlet.h);
     235
     236end
     237
     238"Fluid Power"
     239        FluidPower*IsentropicEff = Head*sum(Mw*Inlet.z)*Inlet.F;
     240        #FluidPower = Head*sum(Mw*Inlet.z)*Inlet.F;
     241
     242"Brake Power"
     243        BrakePower = WorkOut;
     244
     245"Brake Power"
     246        BrakePower = (FluidPower/MechanicalEff)-PowerLoss;
     247
     248"Power Loss"
     249        PowerLoss = BrakePower - FluidPower;
     250
     251end
Note: See TracChangeset for help on using the changeset viewer.