Changeset 148


Ignore:
Timestamp:
Feb 1, 2007, 6:57:34 PM (17 years ago)
Author:
gerson bicca
Message:

testing models for the new language

Location:
branches/newlanguage
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/newlanguage/eml/heat_exchangers/HeatExchangerSimplified.mso

    r147 r148  
    274274end
    275275
    276 
    277276#=====================================================================
    278277#       Thermal Details
     
    331330        Outlet.Cold.z=Inlet.Cold.z;
    332331       
    333 #"No Phase Change In Cold Stream"
    334 #       Inlet.Cold.v=Outlet.Cold.v;
    335 
    336 #"No Phase Change In Hot Stream"
    337 #       Inlet.Hot.v=Outlet.Hot.v;
    338 
    339332#======================================
    340333#       Pressure Drop
     
    355348end
    356349
    357 Model Heatex_Basic_NTU   as HeatExchangerSimplified_Basic
     350Model Heatex_Basic_NTU           as HeatExchangerSimplified_Basic
    358351
    359352ATTRIBUTES
     
    375368end
    376369
    377 Model Heatex_Basic_LMTD  as HeatExchangerSimplified_Basic
     370Model Heatex_Basic_LMTD          as HeatExchangerSimplified_Basic
    378371
    379372ATTRIBUTES
     
    425418end
    426419
    427 
    428 #=====================================================================
    429 #       Concrete Models for Simplified Heat Exchangers
    430 #=====================================================================
    431 
    432 #=====================================================================
    433 # LMTD Method
    434 #=====================================================================
    435 
    436 Model HeatExchanger_LMTD        as Heatex_Basic_LMTD
     420Model HeatExchanger_LMTD         as Heatex_Basic_LMTD
    437421
    438422ATTRIBUTES
     
    469453end
    470454
    471 Model E_Shell_LMTD                      as Heatex_Basic_LMTD       
    472 
     455Model Shell_and_Tubes_LMTD  as Heatex_Basic_LMTD
     456       
    473457ATTRIBUTES
    474458        Pallete         = true;
    475         Brief           = "Shell and Tubes Heat Exchanger with 1 shell pass - LMTD Method";
     459        Brief           = "Shell and Tubes Heat Exchanger with 1 or 2 shell pass - LMTD Method";
    476460        Info            =
    477461        "write some information";
    478 
     462       
    479463PARAMETERS
    480464
    481465LMTDcorrection as Switcher(Brief="LMTD Correction Factor Model",Valid=["Bowmann","Fakeri"],Default="Bowmann");
     466ShellType                as Switcher(Brief="TEMA Designation",Valid=["Eshell","Fshell"],Default="Eshell");
    482467
    483468VARIABLES
    484469
    485 R               as positive;
    486 P               as positive;
    487 Rho     as positive;
    488 Phi    as positive;
     470R                       as positive     (Brief=" Capacity Ratio for LMTD Correction Fator",Lower=1e-6);
     471P                       as positive     (Brief="Non - Dimensional Variable for LMTD Correction Fator ",Lower=1e-6);
     472Pc                      as positive     (Brief="Non - Dimensional Variable for LMTD Correction Fator when 2 Pass Shell Side",Lower=1e-6);
     473Rho             as positive     (Brief="Non - Dimensional Variable for LMTD Correction Fator in Fakeri Equation",Lower=1e-6);
     474Phi     as positive     (Brief="Non - Dimensional Variable for LMTD Correction Fator in Fakeri Equation",Lower=1e-6);
     475lambdaN as Real             (Brief="Non - Dimensional Variable for LMTD Correction Fator in Fakeri Equation when 2 Pass Shell Side");
     476lambda1 as Real         (Brief="Non - Dimensional Variable for LMTD Correction Fator in Fakeri Equationwhen 2 Pass Shell Side");
    489477
    490478EQUATIONS
    491479
    492 "Capacity Ratio for LMTD Correction Fator"
     480"R: Capacity Ratio for LMTD Correction Fator"
    493481        R*(Outlet.Cold.T - Inlet.Cold.T ) = (Inlet.Hot.T-Outlet.Hot.T);
    494482
    495 "Non - Dimensional Variable for LMTD Correction Fator"
     483"P: Non - Dimensional Variable for LMTD Correction Fator"
    496484        P*(Inlet.Hot.T- Inlet.Cold.T)= (Outlet.Cold.T-Inlet.Cold.T);
    497 
     485       
    498486"Temperature Difference at Inlet"
    499487        DT0 = Inlet.Hot.T - Outlet.Cold.T;
     
    502490        DTL = Outlet.Hot.T - Inlet.Cold.T;
    503491
    504 "Rho: Non - Dimensional Variable for LMTD Correction Fator in Fakeri Equation"
     492switch ShellType
     493       
     494        case "Fshell":
     495       
     496switch LMTDcorrection
     497       
     498        case "Bowmann":
     499       
     500" Variable not in use with Bowmann equation"
     501        lambdaN =1;
     502       
     503" Variable not in use with Bowmann equation"
     504        lambda1 =1;
     505
     506" Variable not in use with Bowmann equation"
     507        Phi = 1;
     508
     509" Variable not in use with Bowmann equation"
     510        Rho =1;
     511
     512if R equal 1
     513       
     514        then
     515       
     516"Non Dimensional Variable for LMTD Correction Fator when 2 Pass Shell Side"
     517        Pc*(2-P)= P;
     518
     519"LMTD Correction Fator when 2 Pass Shell Side"
     520        Fc= (sqrt(2)*Pc)/((1-Pc)*ln( abs( ( 2-Pc*0.585786)/( 2-Pc*3.414214))));
     521       
     522        else
     523       
     524"Non Dimensional Variable for LMTD Correction Fator when 2 Pass Shell Side"
     525        Pc = (sqrt(abs(( 1-P*R)/(1-P)))-1)/(sqrt(abs(( 1-P*R)/(1-P)))-R);
     526
     527"LMTD Correction Fator when 2 Pass Shell Side"
     528        Fc = sqrt(R*R+1)*ln(abs((1-Pc*R)/(1-Pc)))/((1-R)*ln( abs( ( 2-Pc*(R+1-sqrt(R*R+1)))/ ( 2-Pc*(R + 1 + sqrt(R*R+1))))));
     529       
     530end
     531
     532        case "Fakeri":
     533       
     534" Variable not in use with Fakeri equation"
     535        Pc = P;
     536       
     537"Non Dimensional Variable for LMTD Correction Fator in Fakeri Equation"
    505538        Rho*(1-P*R) = (1-P);
    506539
    507 "Phi: Non - Dimensional Variable for LMTD Correction Fator in Fakeri Equation"
     540"Non Dimensional Variable for LMTD Correction Fator in Fakeri Equation "
     541        Phi = (sqrt(((Inlet.Hot.T - Outlet.Hot.T)*(Inlet.Hot.T- Outlet.Hot.T))+((Outlet.Cold.T -  Inlet.Cold.T)*(Outlet.Cold.T -  Inlet.Cold.T))))/(2*((Inlet.Hot.T + Outlet.Hot.T)-( Inlet.Cold.T + Outlet.Cold.T)));
     542
     543if Rho equal 1
     544       
     545        then
     546       
     547" Variable not in use when Rho = 1"
     548        lambdaN =       1;
     549       
     550" Variable not in use when Rho = 1"
     551        lambda1 =       1;
     552       
     553"LMTD Correction Fator when 2 Pass Shell Side"
     554        Fc = (2*Phi )/(ln(abs((1+Phi )/(1-Phi ))));
     555       
     556        else
     557
     558"Non Dimensional Variable for LMTD Correction Fator in Fakeri Equation"
     559        lambdaN = (1/ln(sqrt(abs(Rho))))*((2*sqrt(abs(Rho))-2)/(sqrt(abs(Rho))+1));
     560       
     561"Non Dimensional Variable for LMTD Correction Fator in Fakeri Equation"
     562        lambda1 = (1/ln(abs(Rho)))*((2*Rho-2)/(Rho+1));
     563
     564"LMTD Correction Fator when 2 Pass Shell Side"
     565        Fc =    ((2*Phi *(lambdaN/lambda1))/(ln(abs((1+Phi *(lambdaN/lambda1))/(1-Phi *(lambdaN/lambda1))))))*(1/lambdaN);
     566
     567end
     568
     569
     570end
     571
     572        case "Eshell":
     573       
     574" Variable not in use when 1 Pass Shell Side"
     575        lambdaN =1;
     576
     577" Variable not in use when 1 Pass Shell Side"
     578        lambda1 =1;
     579       
     580" Variable not in use when 1 Pass Shell Side"
     581        Pc = P;
     582       
     583switch LMTDcorrection
     584       
     585        case "Bowmann":
     586
     587" Variable not in use with Bowmann equation"
     588        Phi  = 1;
     589       
     590" Variable not in use with Bowmann equation"
     591        Rho = 1;
     592
     593
     594 if R equal 1
     595       
     596    then
     597       
     598"LMTD Correction Fator when 1 Pass Shell Side"
     599        Fc = (sqrt(2)*P)/((1-P)*ln( abs( ( 2-P*0.585786)/( 2-P*3.414214))));
     600
     601        else
     602       
     603"LMTD Correction Fator when 1 Pass Shell Side"
     604        Fc = sqrt(R*R+1)*ln(abs((1-P*R)/(1-P)))/((1-R)*ln( abs( ( 2-P*(R+1-sqrt(R*R+1)))/ ( 2-P*(R + 1 + sqrt(R*R+1))))));
     605
     606end
     607
     608        case "Fakeri":
     609
     610"Non Dimensional Variable for LMTD Correction Fator in Fakeri Equation "
    508611        Phi  = (sqrt(((Inlet.Hot.T- Outlet.Hot.T)*(Inlet.Hot.T- Outlet.Hot.T))+((Outlet.Cold.T - Inlet.Cold.T)*(Outlet.Cold.T - Inlet.Cold.T))))/(2*((Inlet.Hot.T+ Outlet.Hot.T)-(Inlet.Cold.T+ Outlet.Cold.T)));
    509612
    510 switch LMTDcorrection
    511        
    512         case "Bowmann":
    513 
    514  if R equal 1
    515        
    516     then
    517         Fc = (sqrt(2)*P)/((1-P)*ln( abs( ( 2-P*0.585786)/( 2-P*3.414214))));
    518 
    519         else
    520         Fc = sqrt(R*R+1)*ln(abs((1-P*R)/(1-P)))/((1-R)*ln( abs( ( 2-P*(R+1-sqrt(R*R+1)))/ ( 2-P*(R + 1 + sqrt(R*R+1))))));
    521 
    522 end
    523 
    524 case "Fakeri":
     613"Non Dimensional Variable for LMTD Correction Fator in Fakeri Equation"
     614        Rho*(1-P*R) = (1-P);
    525615
    526616if Rho equal 1
    527617       
    528618        then
     619       
     620"LMTD Correction Fator when 1 Pass Shell Side"
    529621        Fc = (4*Phi)/(ln(abs((1+2*Phi)/(1-2*Phi))));
    530622
    531623        else
     624
     625"LMTD Correction Fator when 1 Pass Shell Side"
    532626        Fc = (2*Phi*(Rho+1)*ln(abs(Rho)))/( ln(abs((1+2*Phi)/(1-2*Phi)))*(Rho-1));
    533627       
     
    536630end
    537631
    538 end
    539 
    540 Model F_Shell_LMTD              as Heatex_Basic_LMTD
    541        
    542 ATTRIBUTES
    543         Pallete         = true;
    544         Brief           = "Shell and Tubes Heat Exchanger with 2 shell pass - LMTD Method";
    545         Info            =
    546         "write some information";
    547        
    548 PARAMETERS
    549 
    550 LMTDcorrection as Switcher(Brief="LMTD Correction Factor Model",Valid=["Bowmann","Fakeri"],Default="Bowmann");
    551 
    552 VARIABLES
    553 
    554 R                       as positive;
    555 P                       as positive;
    556 Pc                      as positive;
    557 Rho             as positive;
    558 Phi     as positive;
    559 lambdaN as positive;
    560 lambda1 as positive;
    561 
    562 EQUATIONS
    563 
    564 "Rho: Non - Dimensional Variable for LMTD Correction Fator in Fakeri Equation"
    565         Rho*(1-P*R) = (1-P);
    566 
    567 "R: Capacity Ratio for LMTD Correction Fator"
    568         R*(Outlet.Cold.T - Inlet.Cold.T ) = (Inlet.Hot.T-Outlet.Hot.T);
    569 
    570 "P: Non - Dimensional Variable for LMTD Correction Fator"
    571         P*(Inlet.Hot.T- Inlet.Cold.T)= (Outlet.Cold.T-Inlet.Cold.T);
    572        
    573 "Temperature Difference at Inlet"
    574         DT0 = Inlet.Hot.T - Outlet.Cold.T;
    575 
    576 "Temperature Difference at Outlet"
    577         DTL = Outlet.Hot.T - Inlet.Cold.T;
    578 
    579 switch LMTDcorrection
    580        
    581         case "Bowmann":
    582        
    583         lambdaN =1;
    584         lambda1 =1;
    585         Phi = 1;
    586 
    587 if R equal 1
    588        
    589         then
    590         Pc*(2-P)= P;
    591         Fc= (sqrt(2)*Pc)/((1-Pc)*ln( abs( ( 2-Pc*0.585786)/( 2-Pc*3.414214))));
    592        
    593         else
    594         Pc = (sqrt(abs(( 1-P*R)/(1-P)))-1)/(sqrt(abs(( 1-P*R)/(1-P)))-R);
    595         Fc = sqrt(R*R+1)*ln(abs((1-Pc*R)/(1-Pc)))/((1-R)*ln( abs( ( 2-Pc*(R+1-sqrt(R*R+1)))/ ( 2-Pc*(R + 1 + sqrt(R*R+1))))));
    596        
    597 end
    598 
    599         case "Fakeri":
    600         Pc = P;
    601         Phi = (sqrt(((Inlet.Hot.T - Outlet.Hot.T)*(Inlet.Hot.T- Outlet.Hot.T))+((Outlet.Cold.T -  Inlet.Cold.T)*(Outlet.Cold.T -  Inlet.Cold.T))))/(2*((Inlet.Hot.T + Outlet.Hot.T)-( Inlet.Cold.T + Outlet.Cold.T)));
    602 
    603 if Rho equal 1
    604        
    605         then
    606         lambdaN =       1;
    607         lambda1 =       1;
    608         Fc = (2*Phi )/(ln(abs((1+Phi )/(1-Phi ))));
    609        
    610         else
    611 
    612         lambdaN = (1/ln(sqrt(abs(Rho))))*((2*sqrt(abs(Rho))-2)/(sqrt(abs(Rho))+1));
    613        
    614         lambda1 = (1/ln(abs(Rho)))*((2*Rho-2)/(Rho+1));
    615 
    616         Fc =    ((2*Phi *(lambdaN/lambda1))/(ln(abs((1+Phi *(lambdaN/lambda1))/(1-Phi *(lambdaN/lambda1))))))*(1/lambdaN);
    617 
    618 end
    619 
    620 
    621 end
    622 
    623 
    624 end
    625 #=====================================================================
    626 # NTU Method
    627 #=====================================================================
     632       
     633end
     634
     635end
    628636
    629637Model HeatExchanger_NTU         as Heatex_Basic_NTU
     
    677685end
    678686
    679 Model E_Shell_NTU                       as Heatex_Basic_NTU
     687Model E_Shell_NTU                               as Heatex_Basic_NTU
    680688       
    681689ATTRIBUTES
     
    691699end
    692700
    693 Model F_Shell_NTU               as Heatex_Basic_NTU
     701Model F_Shell_NTU                       as Heatex_Basic_NTU
    694702
    695703ATTRIBUTES
  • branches/newlanguage/sample/heat_exchangers/sampleEshell.mso

    r100 r148  
    2929PARAMETERS
    3030
    31 PP               as CalcObject (Brief="Physical Properties",File="vrpp");
     31PP               as Plugin (Brief="Physical Properties",File="vrpp");
    3232NComp    as Integer;
    3333       
  • branches/newlanguage/sample/heat_exchangers/sampleEshell_LMTD.mso

    r147 r148  
    3434
    3535DEVICES
    36 exchanger       as E_Shell_LMTD;
     36exchanger       as Shell_and_Tubes_LMTD;
    3737streamhot       as source;
    3838streamcold  as source;
     
    4545NComp                           = PP.NumberOfComponents;
    4646
    47 #       exchanger.LMTDcorrection        = "Bowmann";
     47        exchanger.ShellType             = "Eshell";
    4848        exchanger.LMTDcorrection        = "Fakeri";
    4949       
     
    7171streamcold.Outlet.z             = [0,0.5, 0.1, 0.4];
    7272
    73 exchanger.Outlet.Cold.T = 330*"K";
     73exchanger.Details.A      = 12*"m^2";
    7474       
    7575OPTIONS
  • branches/newlanguage/sample/heat_exchangers/sampleFshell_LMTD.mso

    r147 r148  
    2121*----------------------------------------------------------------------
    2222* Author: Gerson B. Bicca
    23 * $Id: sampleEshell_LMTD.mso 100 2007-01-09 14:15:56Z bicca $
     23* $Id: sampleFshell_LMTD.mso 100 2007-01-09 14:15:56Z bicca $
    2424*--------------------------------------------------------------------*#
    25 #using "heat_exchangers/HeatExchangerSimplified";
    26 using "HeatExchangerSimplified";
     25using "heat_exchangers/HeatExchangerSimplified";
    2726
    2827FlowSheet LMTD_Method
Note: See TracChangeset for help on using the changeset viewer.