Changeset 441 for trunk/eml


Ignore:
Timestamp:
Jan 8, 2008, 1:55:28 PM (15 years ago)
Author:
gerson bicca
Message:

updated Hairpin model

Location:
trunk/eml/heat_exchangers
Files:
1 added
1 edited

Legend:

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

    r420 r441  
    719719
    720720end
    721 
    722 # Testing Hairpin Heat Exchanger (U tube)
    723 
    724 Model Hairpin_Basic
    725 
    726 ATTRIBUTES
    727         Pallete         = false;
    728         Brief           = "Basic Equations for hairpin heat exchanger model.";
    729         Info            =
    730         "to be documented.";
    731 
    732 PARAMETERS
    733 
    734 outer PP            as Plugin           (Brief="External Physical Properties", Type="PP");
    735 outer NComp     as Integer      (Brief="Number of Components");
    736        
    737         M(NComp)        as molweight    (Brief="Component Mol Weight");
    738        
    739         HotSide                         as Switcher             (Brief="Flag for Fluid Alocation ",Valid=["outer","inner"],Default="outer");
    740         innerFlowRegime         as Switcher     (Brief="Inner Flow Regime ",Valid=["laminar","transition","turbulent"],Default="laminar");
    741         outerFlowRegime         as Switcher     (Brief="Outer Flow Regime ",Valid=["laminar","transition","turbulent"],Default="laminar");
    742 
    743         InnerLaminarCorrelation         as Switcher     (Brief="Heat Transfer Correlation in Laminar Flow for the Inner Side",Valid=["Hausen","Schlunder"],Default="Hausen");
    744         InnerTransitionCorrelation  as Switcher         (Brief="Heat Transfer Correlation in Transition Flow for the Inner Side",Valid=["Gnielinski","Hausen"],Default="Gnielinski");
    745         InnerTurbulentCorrelation   as Switcher (Brief="Heat Transfer Correlation in Turbulent Flow for the Inner Side",Valid=["Petukhov","SiederTate"],Default="Petukhov");
    746 
    747         OuterLaminarCorrelation         as Switcher             (Brief="Heat Transfer Correlation in Laminar Flow for the Outer Side",Valid=["Hausen","Schlunder"],Default="Hausen");
    748         OuterTransitionCorrelation  as Switcher         (Brief="Heat Transfer Correlation in Transition Flow for the OuterSide",Valid=["Gnielinski","Hausen"],Default="Gnielinski");
    749         OuterTurbulentCorrelation   as Switcher         (Brief="Heat Transfer Correlation in Turbulent Flow for the Outer Side",Valid=["Petukhov","SiederTate"],Default="Petukhov");
    750 
    751         Pi                              as constant             (Brief="Pi Number",Default=3.14159265, Symbol = "\pi");
    752         DoInner         as length                       (Brief="Outside Diameter of Inner Pipe",Lower=1e-6);
    753         DiInner as length                       (Brief="Inside Diameter of Inner Pipe",Lower=1e-10);
    754         DiOuter as length                       (Brief="Inside Diameter of Outer pipe",Lower=1e-10);
    755         Lpipe           as length                       (Brief="Effective Tube Length of one segment of Pipe",Lower=0.1, Symbol = "L_{pipe}");
    756         Kwall           as conductivity         (Brief="Tube Wall Material Thermal Conductivity",Default=1.0, Symbol = "K_{wall}");
    757         Rfi                     as positive                     (Brief="Inside Fouling Resistance",Unit='m^2*K/kW',Default=1e-6,Lower=0);
    758         Rfo                     as positive                     (Brief="Outside Fouling Resistance",Unit='m^2*K/kW',Default=1e-6,Lower=0);
    759 
    760 VARIABLES
    761 
    762 in  InletInner          as stream               (Brief="Inlet Inner Stream", PosX=1, PosY=0.7, Symbol="_{inInner}");   
    763 in  InletOuter          as stream               (Brief="Inlet Outer Stream", PosX=0.8, PosY=0, Symbol="_{inOuter}");
    764 out OutletInner         as streamPH     (Brief="Outlet Inner Stream", PosX=1, PosY=0.3, Symbol="_{outInner}");
    765 out OutletOuter         as streamPH     (Brief="Outlet Outer Stream", PosX=0.8, PosY=1, Symbol="_{outOuter}");
    766 
    767         Details         as Details_Main         (Brief="Some Details in the Heat Exchanger", Symbol=" ");
    768         Inner                   as Main_DoublePipe      (Brief="Inner Side of the Heat Exchanger", Symbol="_{Inner}");
    769         Outer                   as Main_DoublePipe      (Brief="Outer Side of the Heat Exchanger", Symbol="_{Outer}");
    770 
    771 SET
    772 
    773 #"Component Molecular Weight"
    774         M  = PP.MolecularWeight();
    775        
    776 #"Pi Number"
    777         Pi      = 3.14159265;
    778        
    779 #"Inner Pipe Cross Sectional Area for Flow"
    780         Inner.HeatTransfer.As=Pi*DiInner*DiInner/4;
    781        
    782 #"Outer Pipe Cross Sectional Area for Flow"
    783         Outer.HeatTransfer.As=Pi*(DiOuter*DiOuter - DoInner*DoInner)/4;
    784        
    785 #"Inner Pipe Hydraulic Diameter for Heat Transfer"
    786         Inner.HeatTransfer.Dh=DiInner;
    787        
    788 #"Outer Pipe Hydraulic Diameter for Heat Transfer"
    789         Outer.HeatTransfer.Dh=(DiOuter*DiOuter-DoInner*DoInner)/DoInner;
    790 
    791 #"Inner Pipe Hydraulic Diameter for Pressure Drop"
    792         Inner.PressureDrop.Dh=DiInner;
    793        
    794 #"Outer Pipe Hydraulic Diameter for Pressure Drop"
    795         Outer.PressureDrop.Dh=DiOuter-DoInner;
    796 
    797 EQUATIONS
    798 
    799 "Outer  Stream Average Temperature"
    800         Outer.Properties.Average.T = 0.5*InletOuter.T + 0.5*OutletOuter.T;
    801 
    802 "Inner Stream Average Temperature"
    803         Inner.Properties.Average.T = 0.5*InletInner.T + 0.5*OutletInner.T;
    804        
    805 "Outer Stream Average Pressure"
    806         Outer.Properties.Average.P = 0.5*InletOuter.P+0.5*OutletOuter.P;
    807        
    808 "Inner Stream Average Pressure"
    809         Inner.Properties.Average.P = 0.5*InletInner.P+0.5*OutletInner.P;
    810 
    811 "Inner Stream Wall Temperature"
    812         Inner.Properties.Wall.Twall =   0.5*Outer.Properties.Average.T + 0.5*Inner.Properties.Average.T;
    813 
    814 "Outer Stream Wall Temperature"
    815         Outer.Properties.Wall.Twall =   0.5*Outer.Properties.Average.T + 0.5*Inner.Properties.Average.T;
    816 
    817 "Outer Stream Average Molecular Weight"
    818         Outer.Properties.Average.Mw = sum(M*InletOuter.z);
    819 
    820 "Inner Stream Average Molecular Weight"
    821         Inner.Properties.Average.Mw = sum(M*InletInner.z);
    822 
    823 if InletInner.v equal 0
    824        
    825         then   
    826 
    827 "Average Heat Capacity Inner Stream"
    828         Inner.Properties.Average.Cp             =       PP.LiquidCp(Inner.Properties.Average.T,Inner.Properties.Average.P,InletInner.z);
    829 
    830 "Average Mass Density Inner Stream"
    831         Inner.Properties.Average.rho    =       PP.LiquidDensity(Inner.Properties.Average.T,Inner.Properties.Average.P,InletInner.z);
    832 
    833 "Inlet Mass Density Inner Stream"
    834         Inner.Properties.Inlet.rho              =       PP.LiquidDensity(InletInner.T,InletInner.P,InletInner.z);
    835 
    836 "Outlet Mass Density Inner Stream"
    837         Inner.Properties.Outlet.rho     =       PP.LiquidDensity(OutletInner.T,OutletInner.P,OutletInner.z);
    838 
    839 "Average Viscosity Inner Stream"
    840         Inner.Properties.Average.Mu     =       PP.LiquidViscosity(Inner.Properties.Average.T,Inner.Properties.Average.P,InletInner.z);
    841 
    842 "Average        Conductivity Inner Stream"
    843         Inner.Properties.Average.K              =       PP.LiquidThermalConductivity(Inner.Properties.Average.T,Inner.Properties.Average.P,InletInner.z);
    844 
    845 "Viscosity Inner Stream at wall temperature"
    846         Inner.Properties.Wall.Mu                =       PP.LiquidViscosity(Inner.Properties.Wall.Twall,Inner.Properties.Average.P,InletInner.z);
    847 
    848         else
    849 
    850 "Average Heat Capacity InnerStream"
    851         Inner.Properties.Average.Cp     =       PP.VapourCp(Inner.Properties.Average.T,Inner.Properties.Average.P,InletInner.z);
    852 
    853 "Average Mass Density Inner Stream"
    854         Inner.Properties.Average.rho    =       PP.VapourDensity(Inner.Properties.Average.T,Inner.Properties.Average.P,InletInner.z);
    855 
    856 "Inlet Mass Density Inner Stream"
    857         Inner.Properties.Inlet.rho              =       PP.VapourDensity(InletInner.T,InletInner.P,InletInner.z);
    858        
    859 "Outlet Mass Density Inner Stream"
    860         Inner.Properties.Outlet.rho     =       PP.VapourDensity(OutletInner.T,OutletInner.P,OutletInner.z);
    861 
    862 "Average Viscosity Inner Stream"
    863         Inner.Properties.Average.Mu     =       PP.VapourViscosity(Inner.Properties.Average.T,Inner.Properties.Average.P,InletInner.z);
    864 
    865 "Average Conductivity Inner Stream"
    866         Inner.Properties.Average.K              =       PP.VapourThermalConductivity(Inner.Properties.Average.T,Inner.Properties.Average.P,InletInner.z);
    867 
    868 "Viscosity Inner Stream at wall temperature"
    869         Inner.Properties.Wall.Mu                =       PP.VapourViscosity(Inner.Properties.Wall.Twall,Inner.Properties.Average.P,InletInner.z);
    870 
    871 end
    872 
    873 if InletOuter.v equal 0
    874 
    875         then
    876 
    877 "Average Heat Capacity Outer Stream"
    878         Outer.Properties.Average.Cp     =               PP.LiquidCp(Outer.Properties.Average.T,Outer.Properties.Average.P,InletOuter.z);
    879 
    880 "Average Mass Density Outer Stream"
    881         Outer.Properties.Average.rho =          PP.LiquidDensity(Outer.Properties.Average.T,Outer.Properties.Average.P,InletOuter.z);
    882 
    883 "Inlet Mass Density Outer Stream"
    884         Outer.Properties.Inlet.rho              =               PP.LiquidDensity(InletOuter.T,InletOuter.P,InletOuter.z);
    885 
    886 "Outlet Mass Density Outer Stream"
    887         Outer.Properties.Outlet.rho     =               PP.LiquidDensity(OutletOuter.T,OutletOuter.P,OutletOuter.z);
    888 
    889 "Average Viscosity Outer Stream"
    890         Outer.Properties.Average.Mu     =               PP.LiquidViscosity(Outer.Properties.Average.T,Outer.Properties.Average.P,InletOuter.z);
    891 
    892 "Average Conductivity Outer Stream"
    893         Outer.Properties.Average.K      =               PP.LiquidThermalConductivity(Outer.Properties.Average.T,Outer.Properties.Average.P,InletOuter.z);       
    894 
    895 "Viscosity Outer Stream at wall temperature"
    896         Outer.Properties.Wall.Mu                =               PP.LiquidViscosity(Outer.Properties.Wall.Twall,Outer.Properties.Average.P,InletOuter.z);       
    897 
    898 
    899         else
    900 
    901 "Average Heat Capacity Outer Stream"
    902         Outer.Properties.Average.Cp     =               PP.VapourCp(Outer.Properties.Average.T,Outer.Properties.Average.P,InletOuter.z);
    903 
    904 "Average Mass Density Outer Stream"
    905         Outer.Properties.Average.rho =          PP.VapourDensity(Outer.Properties.Average.T,Outer.Properties.Average.P,InletOuter.z);
    906 
    907 "Inlet Mass Density Outer Stream"
    908         Outer.Properties.Inlet.rho              =               PP.VapourDensity(InletOuter.T,InletOuter.P,InletOuter.z);
    909        
    910 "Outlet Mass Density Outer Stream"
    911         Outer.Properties.Outlet.rho     =               PP.VapourDensity(OutletOuter.T,OutletOuter.P,OutletOuter.z);
    912 
    913 "Average Viscosity Outer Stream"
    914         Outer.Properties.Average.Mu     =               PP.VapourViscosity(Outer.Properties.Average.T,Outer.Properties.Average.P,InletOuter.z);
    915 
    916 "Average Conductivity Outer Stream"
    917         Outer.Properties.Average.K      =               PP.VapourThermalConductivity(Outer.Properties.Average.T,Outer.Properties.Average.P,InletOuter.z);       
    918 
    919 "Viscosity Outer Stream at wall temperature"
    920         Outer.Properties.Wall.Mu                =               PP.VapourViscosity(Outer.Properties.Wall.Twall,Outer.Properties.Average.P,InletOuter.z);
    921 
    922 end
    923 
    924 switch HotSide
    925        
    926         case "outer":
    927 
    928 "Energy Balance Outer Stream"
    929         Details.Q = InletOuter.F*(InletOuter.h-OutletOuter.h);
    930 
    931 "Energy Balance Inner Stream"
    932         Details.Q = InletInner.F*(OutletInner.h-InletInner.h);
    933 
    934         when InletInner.T > InletOuter.T switchto "inner";
    935 
    936 case "inner":
    937 
    938 "Energy Balance Hot Stream"
    939         Details.Q = InletInner.F*(InletInner.h-OutletInner.h);
    940 
    941 "Energy Balance Cold Stream"
    942         Details.Q = InletOuter.F*(OutletOuter.h - InletOuter.h);
    943 
    944         when InletInner.T < InletOuter.T switchto "outer";
    945 
    946 end
    947 
    948 "Flow Mass Inlet Inner Stream"
    949         Inner.Properties.Inlet.Fw       =  sum(M*InletInner.z)*InletInner.F;
    950 
    951 "Flow Mass Outlet Inner Stream"
    952         Inner.Properties.Outlet.Fw      =  sum(M*OutletInner.z)*OutletInner.F;
    953 
    954 "Flow Mass Inlet Outer Stream"
    955         Outer.Properties.Inlet.Fw               =  sum(M*InletOuter.z)*InletOuter.F;
    956 
    957 "Flow Mass Outlet Outer Stream"
    958         Outer.Properties.Outlet.Fw      =  sum(M*OutletOuter.z)*OutletOuter.F;
    959 
    960 "Molar Balance Outer Stream"
    961         OutletOuter.F = InletOuter.F;
    962        
    963 "Molar Balance Inner Stream"
    964         OutletInner.F = InletInner.F;
    965 
    966 "Outer Stream Molar Fraction Constraint"
    967         OutletOuter.z=InletOuter.z;
    968        
    969 "InnerStream Molar Fraction Constraint"
    970         OutletInner.z=InletInner.z;
    971 
    972 "Exchange Surface Area for one segment of pipe"
    973         Details.A=Pi*DoInner*(2*Lpipe);
    974 
    975 switch innerFlowRegime
    976        
    977         case "laminar":
    978        
    979 "Inner Side Friction Factor for Pressure Drop - laminar Flow"
    980         Inner.PressureDrop.fi*Inner.PressureDrop.Re = 16;
    981        
    982         when Inner.PressureDrop.Re > 2300 switchto "transition";
    983 
    984         case "transition":
    985        
    986 "using Turbulent Flow - to be implemented"
    987         (Inner.PressureDrop.fi-0.0035)*(Inner.PressureDrop.Re^0.42) = 0.264;
    988 
    989         when Inner.PressureDrop.Re < 2300 switchto "laminar";
    990         when Inner.PressureDrop.Re > 10000 switchto "turbulent";
    991 
    992         case "turbulent":
    993 
    994 "Inner Side Friction Factor - Turbulent Flow"
    995         (Inner.PressureDrop.fi-0.0035)*(Inner.PressureDrop.Re^0.42) = 0.264;
    996 
    997         when Inner.PressureDrop.Re < 10000 switchto "transition";
    998        
    999 end     
    1000 
    1001 switch outerFlowRegime
    1002        
    1003         case "laminar":
    1004        
    1005 "Outer Side Friction Factor - laminar Flow"
    1006         Outer.PressureDrop.fi*Outer.PressureDrop.Re = 16;
    1007        
    1008         when Outer.PressureDrop.Re > 2300 switchto "transition";
    1009 
    1010         case "transition":
    1011        
    1012 "using Turbulent Flow - Transition Flow must be implemented"
    1013         (Outer.PressureDrop.fi-0.0035)*(Outer.PressureDrop.Re^0.42) = 0.264;
    1014 
    1015         when Outer.PressureDrop.Re < 2300 switchto "laminar";
    1016         when Outer.PressureDrop.Re > 10000 switchto "turbulent";
    1017 
    1018         case "turbulent":
    1019 
    1020 "Outer Side Friction Factor - Turbulent Flow"
    1021         (Outer.PressureDrop.fi-0.0035)*(Outer.PressureDrop.Re^0.42) = 0.264;
    1022 
    1023         when Outer.PressureDrop.Re < 10000 switchto "transition";
    1024        
    1025 end
    1026 
    1027 switch innerFlowRegime
    1028        
    1029         case "laminar":
    1030        
    1031 "Inner Side Friction Factor for Heat Transfer - laminar Flow"
    1032         Inner.HeatTransfer.fi   = 1/(0.79*ln(Inner.HeatTransfer.Re)-1.64)^2;
    1033        
    1034 switch InnerLaminarCorrelation
    1035        
    1036         case "Hausen":
    1037 
    1038 "Nusselt Number"
    1039         Inner.HeatTransfer.Nu = 3.665 + ((0.19*((DiInner/Lpipe)*Inner.HeatTransfer.Re*Inner.HeatTransfer.PR)^0.8)/(1+0.117*((DiInner/Lpipe)*Inner.HeatTransfer.Re*Inner.HeatTransfer.PR)^0.467));
    1040        
    1041         case "Schlunder":
    1042 
    1043 "Nusselt Number"
    1044         Inner.HeatTransfer.Nu = (49.027896+4.173281*Inner.HeatTransfer.Re*Inner.HeatTransfer.PR*(DiInner/Lpipe))^(1/3);
    1045 
    1046 end
    1047        
    1048         when Inner.HeatTransfer.Re > 2300 switchto "transition";
    1049        
    1050         case "transition":
    1051        
    1052 "Inner Side Friction Factor for Heat Transfer - transition Flow"
    1053         Inner.HeatTransfer.fi   = 1/(0.79*ln(Inner.HeatTransfer.Re)-1.64)^2;
    1054        
    1055 switch InnerTransitionCorrelation
    1056        
    1057         case "Gnielinski":
    1058        
    1059 "Nusselt Number"
    1060         Inner.HeatTransfer.Nu*(1+(12.7*sqrt(0.125*Inner.HeatTransfer.fi)*((Inner.HeatTransfer.PR)^(2/3) -1))) = 0.125*Inner.HeatTransfer.fi*(Inner.HeatTransfer.Re-1000)*Inner.HeatTransfer.PR;
    1061 
    1062         case "Hausen":
    1063 
    1064 "Nusselt Number"
    1065         Inner.HeatTransfer.Nu =0.116*(Inner.HeatTransfer.Re^(0.667)-125)*Inner.HeatTransfer.PR^(0.333)*(1+(DiInner/Lpipe)^0.667);
    1066        
    1067 end
    1068 
    1069         when Inner.HeatTransfer.Re < 2300 switchto "laminar";
    1070         when Inner.HeatTransfer.Re > 10000 switchto "turbulent";
    1071 
    1072         case "turbulent":
    1073 
    1074 switch InnerTurbulentCorrelation
    1075        
    1076         case "Petukhov":
    1077        
    1078 "Inner Side Friction Factor for Heat Transfer - turbulent Flow"
    1079         Inner.HeatTransfer.fi   = 1/(1.82*log(Inner.HeatTransfer.Re)-1.64)^2;
    1080 
    1081 "Nusselt Number"
    1082         Inner.HeatTransfer.Nu*(1.07+(12.7*sqrt(0.125*Inner.HeatTransfer.fi)*((Inner.HeatTransfer.PR)^(2/3) -1))) = 0.125*Inner.HeatTransfer.fi*Inner.HeatTransfer.Re*Inner.HeatTransfer.PR;
    1083        
    1084         case "SiederTate":
    1085 
    1086 "Nusselt Number"
    1087         Inner.HeatTransfer.Nu = 0.027*(Inner.HeatTransfer.PR)^(1/3)*(Inner.HeatTransfer.Re)^(4/5);
    1088 
    1089 "Inner Side Friction Factor for Heat Transfer - turbulent Flow"
    1090         Inner.HeatTransfer.fi   = 1/(1.82*log(Inner.HeatTransfer.Re)-1.64)^2;
    1091        
    1092 end
    1093        
    1094         when Inner.HeatTransfer.Re < 10000 switchto "transition";
    1095        
    1096 end
    1097 
    1098 switch outerFlowRegime
    1099        
    1100         case "laminar":
    1101        
    1102 "Outer Side Friction Factor for Heat Transfer - laminar Flow"
    1103         Outer.HeatTransfer.fi   = 1/(0.79*ln(Outer.HeatTransfer.Re)-1.64)^2;
    1104        
    1105 switch OuterLaminarCorrelation
    1106        
    1107         case "Hausen":
    1108 
    1109 "Nusselt Number"
    1110         Outer.HeatTransfer.Nu = 3.665 + ((0.19*((Outer.HeatTransfer.Dh/Lpipe)*Outer.HeatTransfer.Re*Outer.HeatTransfer.PR)^0.8)/(1+0.117*((Outer.HeatTransfer.Dh/Lpipe)*Outer.HeatTransfer.Re*Outer.HeatTransfer.PR)^0.467));
    1111        
    1112         case "Schlunder":
    1113 
    1114 "Nusselt Number"
    1115         Outer.HeatTransfer.Nu = (49.027896+4.173281*Outer.HeatTransfer.Re*Outer.HeatTransfer.PR*(Outer.HeatTransfer.Dh/Lpipe))^(1/3);
    1116 
    1117 end
    1118        
    1119         when Outer.HeatTransfer.Re > 2300 switchto "transition";
    1120        
    1121         case "transition":
    1122        
    1123 switch OuterTransitionCorrelation
    1124        
    1125         case "Gnielinski":
    1126 
    1127 "Outer Side Friction Factor for Heat Transfer - transition Flow"
    1128         Outer.HeatTransfer.fi   = 1/(0.79*ln(Outer.HeatTransfer.Re)-1.64)^2;
    1129 
    1130 "Nusselt Number"
    1131         Outer.HeatTransfer.Nu*(1+(12.7*sqrt(0.125*Outer.HeatTransfer.fi)*((Outer.HeatTransfer.PR)^(2/3) -1))) = 0.125*Outer.HeatTransfer.fi*(Outer.HeatTransfer.Re-1000)*Outer.HeatTransfer.PR;
    1132 
    1133         case "Hausen":
    1134 
    1135 "Nusselt Number"
    1136         Outer.HeatTransfer.Nu = 0.116*(Outer.HeatTransfer.Re^(0.667)-125)*Outer.HeatTransfer.PR^(0.333)*(1+(Outer.HeatTransfer.Dh/Lpipe)^0.667);
    1137 
    1138 
    1139 "Outer Side Friction Factor for Heat Transfer - transition Flow"
    1140         Outer.HeatTransfer.fi   = 1/(0.79*ln(Outer.HeatTransfer.Re)-1.64)^2;
    1141        
    1142 end
    1143        
    1144         when Outer.HeatTransfer.Re < 2300 switchto "laminar";
    1145         when Outer.HeatTransfer.Re > 10000 switchto "turbulent";
    1146        
    1147         case "turbulent":
    1148        
    1149 switch OuterTurbulentCorrelation
    1150        
    1151         case "Petukhov":
    1152 
    1153 "Outer Side Friction Factor for Heat Transfer - turbulent Flow"
    1154         Outer.HeatTransfer.fi   = 1/(1.82*log(Outer.HeatTransfer.Re)-1.64)^2;
    1155        
    1156 "Nusselt Number"
    1157         Outer.HeatTransfer.Nu*(1.07+(12.7*sqrt(0.125*Outer.HeatTransfer.fi)*((Outer.HeatTransfer.PR)^(2/3) -1))) = 0.125*Outer.HeatTransfer.fi*Outer.HeatTransfer.Re*Outer.HeatTransfer.PR;
    1158        
    1159         case "SiederTate":
    1160 
    1161 "Nusselt Number"
    1162         Outer.HeatTransfer.Nu = 0.027*(Outer.HeatTransfer.PR)^(1/3)*(Outer.HeatTransfer.Re)^(4/5);
    1163 
    1164 "Outer Side Friction Factor for Heat Transfer - turbulent Flow"
    1165         Outer.HeatTransfer.fi   = 1/(1.82*log(Outer.HeatTransfer.Re)-1.64)^2;
    1166        
    1167 end
    1168 
    1169         when Outer.HeatTransfer.Re < 10000 switchto "transition";
    1170 
    1171 end
    1172 
    1173 "Inner Pipe Film Coefficient"
    1174         Inner.HeatTransfer.hcoeff = (Inner.HeatTransfer.Nu*Inner.Properties.Average.K/DiInner)*Inner.HeatTransfer.Phi;
    1175 
    1176 "Outer Pipe Film Coefficient"
    1177         Outer.HeatTransfer.hcoeff= (Outer.HeatTransfer.Nu*Outer.Properties.Average.K/Outer.HeatTransfer.Dh)*Outer.HeatTransfer.Phi;
    1178 
    1179 "Total Pressure Drop Outer Stream"
    1180         Outer.PressureDrop.Pdrop  = Outer.PressureDrop.Pd_fric+Outer.PressureDrop.Pd_ret;
    1181 
    1182 "Total Pressure Drop Inner Stream"
    1183         Inner.PressureDrop.Pdrop  = Inner.PressureDrop.Pd_fric+Inner.PressureDrop.Pd_ret;
    1184        
    1185 "Pressure Drop Outer Stream"
    1186         OutletOuter.P  = InletOuter.P - Outer.PressureDrop.Pdrop;
    1187 
    1188 "Pressure Drop Inner Stream"
    1189         OutletInner.P  = InletInner.P - Inner.PressureDrop.Pdrop;
    1190        
    1191 "Outer Pipe Pressure Drop for friction"
    1192         Outer.PressureDrop.Pd_fric = (2*Outer.PressureDrop.fi*(2*Lpipe)*Outer.Properties.Average.rho*Outer.HeatTransfer.Vmean^2)/(Outer.PressureDrop.Dh*Outer.HeatTransfer.Phi);
    1193        
    1194 "Inner Pipe Pressure Drop for friction"
    1195         Inner.PressureDrop.Pd_fric = (2*Inner.PressureDrop.fi*(2*Lpipe)*Inner.Properties.Average.rho*Inner.HeatTransfer.Vmean^2)/(DiInner*Inner.HeatTransfer.Phi);
    1196 
    1197 "Outer Pipe Pressure Drop due to return"
    1198         Outer.PressureDrop.Pd_ret = 1.5*Outer.Properties.Average.rho*Outer.HeatTransfer.Vmean^2;
    1199 
    1200 "Inner Pipe Pressure Drop due to return"
    1201         Inner.PressureDrop.Pd_ret = 1.5*Inner.Properties.Average.rho*Inner.HeatTransfer.Vmean^2;
    1202 
    1203 "Outer Pipe Phi correction"
    1204         Outer.HeatTransfer.Phi = (Outer.Properties.Average.Mu/Outer.Properties.Wall.Mu)^0.14;
    1205        
    1206 "Inner Pipe Phi correction"
    1207         Inner.HeatTransfer.Phi  = (Inner.Properties.Average.Mu/Inner.Properties.Wall.Mu)^0.14;
    1208 
    1209 "Outer Pipe Prandtl Number"
    1210         Outer.HeatTransfer.PR = ((Outer.Properties.Average.Cp/Outer.Properties.Average.Mw)*Outer.Properties.Average.Mu)/Outer.Properties.Average.K;
    1211 
    1212 "Inner Pipe Prandtl Number"
    1213         Inner.HeatTransfer.PR = ((Inner.Properties.Average.Cp/Inner.Properties.Average.Mw)*Inner.Properties.Average.Mu)/Inner.Properties.Average.K;
    1214 
    1215 "Outer Pipe Reynolds Number for Heat Transfer"
    1216         Outer.HeatTransfer.Re = (Outer.Properties.Average.rho*Outer.HeatTransfer.Vmean*Outer.HeatTransfer.Dh)/Outer.Properties.Average.Mu;
    1217 
    1218 "Outer Pipe Reynolds Number for Pressure Drop"
    1219         Outer.PressureDrop.Re = (Outer.Properties.Average.rho*Outer.HeatTransfer.Vmean*Outer.PressureDrop.Dh)/Outer.Properties.Average.Mu;
    1220 
    1221 "Inner Pipe Reynolds Number for Heat Transfer"
    1222         Inner.HeatTransfer.Re = (Inner.Properties.Average.rho*Inner.HeatTransfer.Vmean*Inner.HeatTransfer.Dh)/Inner.Properties.Average.Mu;
    1223 
    1224 "Inner Pipe Reynolds Number for Pressure Drop"
    1225         Inner.PressureDrop.Re = Inner.HeatTransfer.Re;
    1226 
    1227 "Outer Pipe Velocity"
    1228         Outer.HeatTransfer.Vmean*(Outer.HeatTransfer.As*Outer.Properties.Average.rho)  = Outer.Properties.Inlet.Fw;
    1229 
    1230 "Inner Pipe Velocity"
    1231         Inner.HeatTransfer.Vmean*(Inner.HeatTransfer.As*Inner.Properties.Average.rho)  = Inner.Properties.Inlet.Fw;
    1232 
    1233 "Overall Heat Transfer Coefficient Clean"
    1234         Details.Uc*((DoInner/(Inner.HeatTransfer.hcoeff*DiInner) )+(DoInner*ln(DoInner/DiInner)/(2*Kwall))+(1/(Outer.HeatTransfer.hcoeff)))=1;
    1235 
    1236 "Overall Heat Transfer Coefficient Dirty"
    1237         Details.Ud*(Rfi*(DoInner/DiInner) +  Rfo + (DoInner/(Inner.HeatTransfer.hcoeff*DiInner) )+(DoInner*ln(DoInner/DiInner)/(2*Kwall))+(1/(Outer.HeatTransfer.hcoeff)))=1;
    1238 
    1239 end
    1240 
    1241 Model Hairpin_NTU as Hairpin_Basic
    1242 
    1243 ATTRIBUTES
    1244 
    1245         Icon = "icon/hairpin";
    1246         Pallete = true;
    1247         Brief  = "Hairpin Heat Exchanger - NTU Method";
    1248         Info  =
    1249         "to be documented.";
    1250 
    1251 PARAMETERS
    1252 
    1253 FlowDirection   as Switcher     (Brief="Flow Direction",Valid=["counter","cocurrent"],Default="cocurrent");
    1254        
    1255 VARIABLES
    1256 
    1257 Method as NTU_Basic     (Brief="NTU Method of Calculation", Symbol=" ");
    1258 
    1259 EQUATIONS
    1260 
    1261 "Number of Units Transference"
    1262         Method.NTU*Method.Cmin = Details.Ud*Pi*DoInner*(2*Lpipe);
    1263        
    1264 "Minimum Heat Capacity"
    1265         Method.Cmin  = min([Method.Ch,Method.Cc]);
    1266 
    1267 "Maximum Heat Capacity"
    1268         Method.Cmax  = max([Method.Ch,Method.Cc]);
    1269 
    1270 "Thermal Capacity Ratio"
    1271         Method.Cr    = Method.Cmin/Method.Cmax;
    1272 
    1273 "Effectiveness Correction"
    1274         Method.Eft1 = 1;
    1275 
    1276 if Method.Cr equal 0
    1277        
    1278         then   
    1279 "Effectiveness"
    1280         Method.Eft = 1-exp(-Method.NTU);
    1281        
    1282         else
    1283 
    1284 switch  FlowDirection
    1285 
    1286         case "cocurrent":
    1287        
    1288 "Effectiveness in Cocurrent Flow"
    1289         Method.Eft = (1-exp(-Method.NTU*(1+Method.Cr)))/(1+Method.Cr);
    1290 
    1291         case "counter":
    1292 
    1293 if Method.Eft >= 1
    1294        
    1295         then
    1296        
    1297 "Effectiveness in Counter Flow"
    1298         Method.Eft = 1;
    1299        
    1300         else
    1301        
    1302 "Effectiveness in Counter Flow"
    1303         Method.NTU*(Method.Cr-1.00001) = ln(abs((Method.Eft-1.00001))) - ln(abs((Method.Cr*Method.Eft-1.00001)));
    1304 end
    1305 
    1306 end
    1307 
    1308 end
    1309 
    1310 switch HotSide
    1311        
    1312         case "outer":
    1313 
    1314 "Duty"
    1315         Details.Q       = Method.Eft*Method.Cmin*(InletOuter.T-InletInner.T);
    1316 
    1317 "Hot Stream Heat Capacity"
    1318         Method.Ch  = InletOuter.F*Outer.Properties.Average.Cp;
    1319        
    1320 "Cold Stream Heat Capacity"
    1321         Method.Cc = InletInner.F*Inner.Properties.Average.Cp;
    1322 
    1323         when InletInner.T > InletOuter.T switchto "inner";
    1324        
    1325         case "inner":
    1326 
    1327 "Duty"
    1328         Details.Q       = Method.Eft*Method.Cmin*(InletInner.T-InletOuter.T);
    1329 
    1330 "Cold Stream Heat Capacity"
    1331         Method.Cc = InletOuter.F*Outer.Properties.Average.Cp;
    1332        
    1333 "Hot Stream Heat Capacity"
    1334         Method.Ch = InletInner.F*Inner.Properties.Average.Cp;
    1335        
    1336         when InletInner.T < InletOuter.T switchto "outer";
    1337        
    1338 end
    1339 
    1340 end
    1341 
    1342 Model Hairpin_LMTD as Hairpin_Basic
    1343        
    1344 ATTRIBUTES
    1345 
    1346         Icon = "icon/hairpin";
    1347         Pallete = true;
    1348         Brief  = "Hairpin Heat Exchanger - LMTD Method";
    1349         Info  =
    1350         "to be documented.";
    1351 
    1352 PARAMETERS
    1353 
    1354 FlowDirection   as Switcher     (Brief="Flow Direction",Valid=["counter","cocurrent"],Default="cocurrent");
    1355        
    1356 VARIABLES
    1357 
    1358 Method as LMTD_Basic    (Brief="LMTD Method of Calculation", Symbol=" ");
    1359 
    1360 EQUATIONS
    1361 
    1362 "Exchange Surface Area"
    1363         Details.Q = Details.Ud*Pi*DoInner*(2*Lpipe)*Method.LMTD;
    1364        
    1365 "LMTD Correction Factor - True counter ou cocurrent flow"
    1366         Method.Fc = 1;
    1367 
    1368 switch HotSide
    1369        
    1370         case "outer":
    1371        
    1372 switch FlowDirection
    1373 
    1374         case "cocurrent":
    1375        
    1376 "Temperature Difference at Inlet - Cocurrent Flow"
    1377         Method.DT0 = InletOuter.T - InletInner.T;
    1378 
    1379 "Temperature Difference at Outlet - Cocurrent Flow"
    1380         Method.DTL = OutletOuter.T - OutletInner.T;
    1381 
    1382         case "counter":
    1383        
    1384 "Temperature Difference at Inlet - Counter Flow"
    1385         Method.DT0 = InletOuter.T - OutletInner.T;
    1386 
    1387 "Temperature Difference at Outlet - Counter Flow"
    1388         Method.DTL = OutletOuter.T - InletInner.T;
    1389        
    1390 
    1391 end
    1392 
    1393         when InletInner.T > InletOuter.T switchto "inner";
    1394        
    1395         case "inner":
    1396 
    1397 switch FlowDirection
    1398 
    1399         case "cocurrent":
    1400        
    1401 "Temperature Difference at Inlet - Cocurrent Flow"
    1402         Method.DT0 = InletInner.T - InletOuter.T;
    1403 
    1404 "Temperature Difference at Outlet - Cocurrent Flow"
    1405         Method.DTL = OutletInner.T - OutletOuter.T;
    1406        
    1407         case "counter":
    1408        
    1409 "Temperature Difference at Inlet - Counter Flow"
    1410         Method.DT0 = InletInner.T - OutletOuter.T;
    1411 
    1412 "Temperature Difference at Outlet - Counter Flow"
    1413         Method.DTL = OutletInner.T - InletOuter.T;
    1414        
    1415 end
    1416 
    1417         when InletInner.T < InletOuter.T switchto "outer";
    1418 
    1419 end
    1420 
    1421 end
Note: See TracChangeset for help on using the changeset viewer.