Changeset 543 for branches/tests


Ignore:
Timestamp:
Jun 26, 2008, 4:48:34 PM (15 years ago)
Author:
gerson bicca
Message:

updated pipe model (testing beggs-brill and lockhart-martinelli for horizontal flow only)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/tests/eml/pressure_changers/pipe.mso

    r541 r543  
    11
    22using "streams";
     3
    34# Not Finished yet !!!!
    45# Do Not Use it
     
    1213PARAMETERS
    1314
    14 outer   N               as Integer      (Brief = "Number of Profile Intervals", Default = 1, Lower = 1, Upper = 100);
     15outer   N                               as Integer      (Brief = "Number of Profile Intervals", Default = 1, Lower = 1, Upper = 100);
    1516outer   NComp   as Integer      (Brief = "Number of chemical components", Lower = 1);
    16        
     17
    1718VARIABLES
    1819
    19         Fw(N+1)                         as flow_mass    (Brief = "Mass Flow Profile" , Symbol = "F_w");
    20         rho(N+1)                        as dens_mass    (Brief = "Mass Density Profile" , Symbol = "\rho");
    21         mu(N+1)                         as viscosity            (Brief = "Viscosity Profile" , Symbol = "\mu");
    22 
    23         Vel(N+1)                        as velocity     (Brief = "Velocity Profile");
    24         vm(N+1)                         as vol_mol      (Brief = "Molar Volume Profile");
    25         frac(N+1)                       as fraction     (Brief = "Molar Fraction Profile");
    26         Vsfrac(N+1)                     as fraction     (Brief = "No Slip Volume Fraction Profile",Lower=0);
    27         Holdup(N+1)                     as fraction     (Brief = "Holdup Profile",Lower=0);
    28         Mfrac(N+1,NComp)        as fraction     (Brief = "Phase Molar Fraction Profile");
    29         h(N+1)                          as enth_mol (Brief = "Molar Enthalpy profile");
    30        
     20        Fw(N+1)                                         as flow_mass (Brief = "Mass Flow Profile" , Symbol = "F_w");
     21        rho(N+1)                                        as dens_mass (Brief = "Mass Density Profile" , Symbol = "\rho");
     22        mu(N+1)                                         as viscosity    (Brief = "Viscosity Profile" , Symbol = "\mu");
     23
     24        Vel(N+1)                                        as velocity     (Brief = "Velocity Profile");
     25        vm(N+1)                                 as vol_mol      (Brief = "Molar Volume Profile");
     26        frac(N+1)                                       as fraction             (Brief = "Molar Fraction Profile");
     27        Vsfrac(N+1)                             as fraction             (Brief = "No Slip Volume Fraction Profile",Lower=0);
     28        Holdup(N+1)                             as fraction             (Brief = "Holdup Profile",Lower=0);
     29        Mfrac(N+1,NComp)        as fraction             (Brief = "Phase Molar Fraction Profile");
     30        h(N+1)                                          as enth_mol     (Brief = "Molar Enthalpy profile");
     31
    3132end
    3233
     
    3637        Pallete         = true;
    3738        Icon            = "icon/pipe";         
    38         Brief           = "pipe";
     39        Brief   = "pipe";
    3940        Info            =
    4041"This distributed model describes the pressure drop of a material stream flowing in a pipe.
     
    4950
    5051        outer   NComp   as Integer      (Brief = "Number of chemical components", Lower = 1);
    51         outer  PP               as Plugin       (Brief = "External Physical Properties",Type="PP");
     52        outer  PP                       as Plugin       (Brief = "External Physical Properties",Type="PP");
    5253
    5354        N                                               as Integer                              (Brief = "Number of Profile Intervals", Default = 1, Lower = 1, Upper = 100);
     
    6263        M(NComp)                as molweight            (Brief="Component Mol Weight");
    6364        FlowRegime              as Switcher                     (Brief="Pipe flow regime",Valid=["laminar","turbulent"],Default="laminar");
    64         Correlation             as Switcher                     (Brief="Holdup Correlation for Two Phase Flow", Valid=["Beggs-Brill","Lockhart-Martinelli"], Default="Beggs-Brill");
     65        Correlation             as Switcher                     (Brief="Holdup Correlation for Two Phase Flow", Valid=["Beggs-Brill","Lockhart-Martinelli"], Default="Beggs-Brill");   
    6566        Thermal                         as Switcher                     (Brief="Pipe Thermal Specification ",Valid=["Constant Temperature","Linear Temperature profile"],Default="Constant Temperature");
    6667        Toutlet                                 as temperature          (Brief= "Outlet Temperature", Symbol = "T_{out}");
     
    9394        Lincr(N+1)              as length                       (Brief = "Length Points", Symbol = "L_{incr}");
    9495        fns(N+1)                        as fricfactor           (Brief = "No Slip Friction Factor");
    95         ftp(N+1)                        as fricfactor           (Brief = "Two phase Friction Factor");
    9696        Mw                                      as molweight    (Brief = "Average Mol Weight");
    9797        zmass(NComp)    as fraction                     (Brief = "Mass Fraction");
     
    105105        h(N+1)                          as enth_mol             (Brief = "Molar Enthalpy profile");
    106106       
    107         dPdLfric(N+1)           as positive             (Brief = "Friction Gradient",Lower = 0, Unit = 'Pa/m', DisplayUnit = 'kPa/m');
    108         dPelvdL(N+1)            as positive             (Brief = "Elevation Gradient", Lower = 0 , Unit = 'Pa/m', DisplayUnit = 'kPa/m');
    109         #dPaccdL(N+1)           as positive             (Brief = "Acceleration Gradient",Lower = 0 , Unit = 'Pa/m', DisplayUnit = 'kPa/m');
    110        
    111 #Beggs&Brill Method
     107#Beggs & Brill Method
    112108#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    113         NFR(N+1)                                as positive             (Brief="Froude Number", Lower=1E-10,Symbol = "N_{FR}");
    114         BBLine1(N+1)                    as positive             (Brief="Beggs and Brill Correlation Parameter 1");
    115         BBLine2(N+1)                    as positive             (Brief="Beggs and Brill Correlation Parameter 2");
    116         BBLine3(N+1)                    as positive             (Brief="Beggs and Brill Correlation Parameter 3");
    117         BBLine4(N+1)                    as positive             (Brief="Beggs and Brill Correlation Parameter 4");
    118         Map(N+1)                                as positive             (Brief="Beggs and Brill Flag ");#apenas verificação do algoritmo
    119         Atrans(N+1)                             as positive             (Brief="Beggs and Brill Correction When Flow is in Transition Pattern");
    120         Y(N+1)                                  as positive             (Brief="Beggs and Brill Correction for Friction Factor in Two Phase Flow");
    121         S(N+1)                                  as Real                         (Brief="Beggs and Brill Correction for Friction Factor in Two Phase Flow");
    122 
    123 #Lockhart&Martinelli Method
     109        NFR(N+1)                                as positive             (Brief="Froude Number", Lower=1E-10,Hidden=true, Symbol = "N_{FR}");
     110        BBLine1(N+1)            as positive             (Brief="Beggs and Brill Correlation Parameter 1",Hidden=true);
     111        BBLine2(N+1)            as positive             (Brief="Beggs and Brill Correlation Parameter 2",Hidden=true);
     112        BBLine3(N+1)            as positive             (Brief="Beggs and Brill Correlation Parameter 3",Hidden=true);
     113        BBLine4(N+1)            as positive             (Brief="Beggs and Brill Correlation Parameter 4",Hidden=true);
     114        Map(N+1)                                as positive             (Brief="Beggs and Brill Flag ");
     115        Atrans(N+1)                     as positive             (Brief="Beggs and Brill Correction When Flow is in Transition Pattern");
     116
     117#Lockhart & Martinelli Method
    124118#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    125119
    126 XLM(N+1)                                        as Real                         (Brief="Lockhart and Martinelli  Parameter - Square", Lower=1E-6);
    127 PhiLM(N+1)                              as Real                         (Brief="Lockhart and Martinelli  Two phase Multiplier - Square", Lower=1E-3);
     120XLM(N+1)                                        as Real         (Brief="Lockhart and Martinelli  Parameter", Hidden=true, Lower=1E-6);
     121PhiLM(N+1)                              as Real         (Brief="Lockhart and Martinelli  Two phase Multiplier", Hidden=true, Lower=1E-3);
    128122
    129123EQUATIONS
     
    148142if Vapour.frac(i) equal 0 then # Only Liquid phase
    149143
     144"Incremental Friction Pressure Drop"
     145        dPfric(i) = 0.5*fns(i)*Lincr(i)*Liquid.rho(i)*Vel(i)*Vel(i)/Dpipe;
     146       
    150147"Reynolds Number"
    151148        Re(i)*mu(i)     = rho(i)*Vel(i)*Dpipe;
     
    166163        Liquid.Holdup(i) = 1;
    167164
    168 "Lockhart-martinelli Two Phase Multiplier"
    169         XLM(i)  = 1;
    170 
    171         PhiLM(i) = 1;
    172        
    173165"Beggs and Brill Line 1"
    174166        BBLine1(i) = 1;
     
    185177Map(i)=10;     
    186178Atrans(i) = 1;
    187 Y(i) = 1;
    188 
    189 ftp(i)= 1;
    190        
    191         S(i)= 1;
     179
     180"Lockhart-martinelli Parameter"
     181        XLM(i)  = 1;
     182
     183"Lockhart-martinelli Two Phase Multiplier"
     184        PhiLM(i) = 1;   
    192185       
    193186else if Liquid.frac(i) equal 0 then # Only Vapour phase
     187
     188"Incremental Friction Pressure Drop"
     189        dPfric(i) = 0.5*fns(i)*Lincr(i)*Vapour.rho(i)*Vel(i)*Vel(i)/Dpipe;
    194190
    195191"Reynolds Number"
     
    211207        Liquid.Holdup(i) = 0;
    212208
    213 "Lockhart-martinelli Two Phase Multiplier"
    214         XLM(i)  = 1;
    215 
    216         PhiLM(i) = 1;
    217        
    218209"Beggs and Brill Line 1"
    219210        BBLine1(i) = 1;
     
    230221Map(i)=11;     
    231222Atrans(i) = 1;
    232 Y(i) = 1;
    233 
    234 ftp(i)= 1;
    235        
    236         S(i)= 1;
    237        
     223
     224"Lockhart-martinelli Parameter"
     225        XLM(i)  = 1;
     226
     227"Lockhart-martinelli Two Phase Multiplier"
     228        PhiLM(i) = 1;   
     229
    238230else # Two phase
    239231
    240232"Reynolds Number"
    241         Re(i)*(Liquid.mu(i)*Liquid.Vsfrac(i)+Vapour.mu(i)*Vapour.Vsfrac(i))= (Liquid.rho(i)*Liquid.Vsfrac(i)+Vapour.rho(i)*Vapour.Vsfrac(i))*Vel(i)*Dpipe; #no sip Reynolds Number
     233        Re(i)*(Liquid.mu(i)*Liquid.Vsfrac(i)+Vapour.mu(i)*Vapour.Vsfrac(i))= (Liquid.rho(i)*Liquid.Vsfrac(i)+Vapour.rho(i)*Vapour.Vsfrac(i))*Vel(i)*Dpipe;
    242234
    243235"Vapour Superficial Velocity"
     
    252244"Vapour Mass Flow"
    253245        Vapour.Fw(i) =  Inlet.F*Vapour.frac(i)*sumt(M(1:NComp)*Vapour.Mfrac(i,1:NComp));
    254        
     246
    255247switch Correlation
    256        
     248
    257249        case "Beggs-Brill":
    258 
    259 "Lockhart-martinelli Two Phase Multiplier"
    260         XLM(i)  = 1;
    261 
    262         PhiLM(i) = 1;
    263250       
    264251"Beggs and Brill Line 1"       
    265         BBLine1(i) = 2.499687083 + 0.302*log(Liquid.Vsfrac(i));#aplicado o log somente no lado direito da equação
     252        BBLine1(i) = 2.499687083 + 0.302*log(Liquid.Vsfrac(i));
    266253
    267254"Beggs and Brill Line 2"       
    268         BBLine2(i) = -3.033764376 - 2.4684*log(Liquid.Vsfrac(i));#aplicado o log somente no lado direito da equação
     255        BBLine2(i) = -3.033764376 - 2.4684*log(Liquid.Vsfrac(i));
    269256
    270257"Beggs and Brill Line 3"       
    271         BBLine3(i) = -1 - 1.4516*log(Liquid.Vsfrac(i));#aplicado o log somente no lado direito da equação
     258        BBLine3(i) = -1 - 1.4516*log(Liquid.Vsfrac(i));
    272259
    273260"Beggs and Brill Line 4"       
    274         BBLine4(i) = -0.301029996 - 6.738*log(Liquid.Vsfrac(i));#aplicado o log somente no lado direito da equação
    275 
    276 Y(i)*Liquid.Holdup(i)*Liquid.Holdup(i) = Liquid.Vsfrac(i);
    277 
    278         ftp(i)= fns(i)*exp(S(i));
    279        
    280         S(i)= ln(abs(2.2*Y(i)-1.2));
    281        
     261        BBLine4(i) = -0.301029996 - 6.738*log(Liquid.Vsfrac(i));
     262
    282263# Find the Flow Pattern for Beggs-Brill Method
    283264#++++++++++++++++++++++++++++++++++++++++++
     
    357338
    358339end
    359 #++++++++++++++++++++++++++++++++++++++++++
     340
     341"Incremental Friction Pressure Drop"
     342        dPfric(i) = 0.5*fns(i)*Lincr(i)*(Liquid.rho(i)*Liquid.Vsfrac(i)+Vapour.rho(i)*Vapour.Vsfrac(i))*Vel(i)*Vel(i)/Dpipe;
     343
     344"Lockhart-martinelli Parameter"
     345        XLM(i)  = 1;
     346
     347"Lockhart-martinelli Two Phase Multiplier"
     348        PhiLM(i) = 1;
     349
    360350        case "Lockhart-Martinelli":
    361        
    362 "Do Not Use Variables related to Beggs and Brill Method"
     351
     352"Lockhart-martinelli Parameter"
     353        XLM(i)  = (((1-Vapour.frac(i))/Vapour.frac(i))^0.9)*((Vapour.rho(i)/Liquid.rho(i))^0.5)*((Liquid.mu(i)/Vapour.mu(i)))^0.1;
     354
     355"Lockhart-martinelli Two Phase Multiplier"
     356        PhiLM(i) = (1+20/XLM(i)+1/(XLM(i)^2))^0.5;
     357
     358"Liquid Holdup"
     359        Liquid.Holdup(i) = 1/abs(PhiLM(i));
     360
     361"Incremental Friction Pressure Drop"#FIXME
     362        dPfric(i) = 0.5*PhiLM(i)*PhiLM(i)*Lincr(i)*(1-Vapour.frac(i))^2*fns(i)*(Fw/Apipe)^2/(Liquid.rho(i)*Dpipe);
     363
     364"Beggs and Brill Line 1"
    363365        BBLine1(i) = 1;
    364366
    365 "Do Not Use Variables related to Beggs and Brill Method"
    366         BBLine2 (i)= 1;
    367 
    368 "Do Not Use Variables related to Beggs and Brill Method"
     367"Beggs and Brill Line 2"
     368        BBLine2(i) = 1;
     369
     370"Beggs and Brill Line 3"
    369371        BBLine3(i) = 1;
    370372
    371 "Do Not Use Variables related to Beggs and Brill Method"
    372         BBLine4 (i)= 1;
    373 
    374 "Lockhart-martinelli Two Phase Multiplier"
    375         XLM(i)*Vapour.rho(i)*Vapour.Vel(i)^2    = Liquid.rho(i)*Liquid.Vel(i)^2;
    376        
    377         PhiLM(i) = 1+20/sqrt(XLM(i))+1/XLM(i);
    378 
    379 "Liquid Holdup"
    380         Liquid.Holdup(i) = (1/abs(PhiLM(i)))^(1/3);
    381        
    382         Atrans(i) = 1;
    383        
    384         Map(i)=20;
    385        
    386         Y(i)=1;
    387        
    388         ftp(i)= 1;
    389        
    390         S(i)= 1;
    391 
    392 end
    393 
     373"Beggs and Brill Line 4"
     374        BBLine4(i) = 1;
     375
     376Map(i)=11;     
     377Atrans(i) = 1;
     378
     379end
    394380
    395381end
     
    446432"Incremental Elevation Pressure Drop"
    447433        dPelv= rho*g*Lincr*sin(Hrise);
    448        
    449         dPelvdL= rho*g*sin(Hrise);
    450 
    451 "Incremental Friction Pressure Drop"
    452         #dPfric = (0.5*fns*Lincr*(Liquid.rho*Liquid.Vsfrac+Vapour.rho*Vapour.Vsfrac)*Vel*Vel/Dpipe);
    453         dPfric = PhiLM*(0.5*fns*Lincr*(Liquid.rho*Liquid.Vsfrac+Vapour.rho*Vapour.Vsfrac)*Vel*Vel/Dpipe);
    454        
    455         dPdLfric = (0.5*fns*(Liquid.rho*Liquid.Vsfrac+Vapour.rho*Vapour.Vsfrac)*Vel*Vel/Dpipe);
    456        
     434
    457435for i in [1:N+1]
    458436
     
    512490
    513491        case "Constant Temperature":
    514         "Outlet Temperature"
    515                 Tincr(i+1) = Inlet.T;
     492
     493"Outlet Temperature"
     494        Tincr(i+1) = Inlet.T;
    516495       
    517496        case "Linear Temperature profile":
    518         "Outlet Temperature"
    519                 Toutlet - Tincr(1) = Lpipe*((Tincr(i+1)-Tincr(i))/(Lincr(i+1)-Lincr(i)));
     497
     498"Outlet Temperature"
     499        Toutlet - Tincr(1) = Lpipe*((Tincr(i+1)-Tincr(i))/(Lincr(i+1)-Lincr(i)));
    520500
    521501end
     
    548528
    549529
    550 FlowSheet Pipe_simples
     530FlowSheet Pipe_Flow
    551531
    552532PARAMETERS
     
    567547SET
    568548        NComp  = PP.NumberOfComponents;
    569         Tube.N  = 5;
     549        Tube.N  = 10;
     550       
     551        #Tube.Correlation ="Beggs-Brill";
     552        Tube.Correlation ="Lockhart-Martinelli";
    570553       
    571554        #Tube.Thermal ="Constant Temperature";
     
    579562
    580563SPECIFY
    581         Feed.Outlet.F = 10 * 'kmol/h';
     564        Feed.Outlet.F = 5 * 'kmol/h';
    582565        Feed.Outlet.P = 3* 'atm';
    583566        Feed.Outlet.T = (60+273.15) * 'K';
     
    586569SET
    587570        Tube.Lpipe = 5*'m';
    588         Tube.Hrise =    0*'deg'; # working only in the horizontal , must be updated
    589         Tube.Correlation = "Beggs-Brill";
    590         #Tube.Correlation = "Lockhart-Martinelli";
    591        
     571        Tube.Hrise =    0*'deg';
    592572
    593573        Tube.Dpipe                      = 3*'in';
     
    596576        OPTIONS
    597577        Dynamic = false;
    598         #GuessFile="Pipe_simples";
    599 
    600 end
     578
     579end
Note: See TracChangeset for help on using the changeset viewer.