Changeset 432 for trunk/eml/heat_exchangers/DoublePipeIncr.mso
 Timestamp:
 Dec 13, 2007, 6:04:33 PM (16 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/eml/heat_exchangers/DoublePipeIncr.mso
r430 r432 29 29 PARAMETERS 30 30 31 outer N as Integer (Brief="Number of incremental points", Default = 2);31 outer N as Integer (Brief="Number of zones", Default = 2); 32 32 33 33 VARIABLES … … 65 65 PARAMETERS 66 66 67 outer N as Integer (Brief="Number of incremental points", Default = 2);67 outer N as Integer (Brief="Number of zones", Default = 2); 68 68 69 69 VARIABLES … … 99 99 PARAMETERS 100 100 101 outer N as Integer (Brief="Number of incremental points", Default = 2);101 outer N as Integer (Brief="Number of zones", Default = 2); 102 102 103 103 VARIABLES … … 122 122 As as area (Brief="Cross Sectional Area for Flow",Default=0.05,Lower=1e8); 123 123 Dh as length (Brief="Hydraulic Diameter of Pipe for Heat Transfer",Lower=1e8); 124 outer N as Integer (Brief="Number of incremental points", Default = 2); 124 outer N as Integer (Brief="Number of zones", Default = 2); 125 outer Npoints as Integer (Brief="Number of incremental points", Default = 3); 125 126 126 127 VARIABLES 127 128 128 Tlocal(N +1) as temperature (Brief="Incremental Local Temperature",Lower=50);129 Tlocal(Npoints) as temperature (Brief="Incremental Local Temperature",Lower=50); 129 130 Re(N) as positive (Brief="Incremental Reynolds Number",Default=100,Lower=1); 130 131 hcoeff(N) as heat_trans_coeff (Brief="Incremental Film Coefficient",Default=1,Lower=1e12, Upper=1e6, DisplayUnit = 'W/m^2/K'); … … 134 135 Phi(N) as positive (Brief="Incremental Phi Correction",Default=1,Lower=1e3); 135 136 Vmean(N) as velocity (Brief="Incremental Tube Velocity",Lower=1e8); 136 Enth(N +1) as enth_mol (Brief="Incremental Stream Enthalpy");137 Enth(Npoints) as enth_mol (Brief="Incremental Stream Enthalpy"); 137 138 138 139 end … … 149 150 150 151 Dh as length (Brief="Hydraulic Diameter of Pipe for Pressure Drop",Lower=1e6); 151 outer N as Integer (Brief="Number of incremental points", Default = 2); 152 outer N as Integer (Brief="Number of zones", Default = 2); 153 outer Npoints as Integer (Brief="Number of incremental points", Default = 3); 152 154 153 155 VARIABLES 154 156 155 Plocal(N +1)as pressure (Brief="Incremental Local Pressure",Default=1, Lower=1e10, Upper=2e4, DisplayUnit='kPa');156 Pdrop as press_delta (Brief="Total Pressure Drop",Default=0.01, Lower=0,DisplayUnit='kPa', Symbol ="\Delta P");157 Pd_fric(N +1)as press_delta (Brief="Incremental Pressure Drop for friction",Default=0.01, Lower=0,DisplayUnit='kPa', Symbol ="\Delta P_{fric}");158 fi(N) as fricfactor (Brief="Incremental Friction Factor", Default=0.05, Lower=1e10, Upper=2000);159 Re(N) as positive (Brief="Incremental Reynolds Number",Default=100,Lower=1);157 Plocal(Npoints) as pressure (Brief="Incremental Local Pressure",Default=1, Lower=1e10, Upper=2e4, DisplayUnit='kPa'); 158 Pdrop as press_delta (Brief="Total Pressure Drop",Default=0.01, Lower=0,DisplayUnit='kPa', Symbol ="\Delta P"); 159 Pd_fric(Npoints) as press_delta (Brief="Incremental Pressure Drop for friction",Default=0.01, Lower=0,DisplayUnit='kPa', Symbol ="\Delta P_{fric}"); 160 fi(N) as fricfactor (Brief="Incremental Friction Factor", Default=0.05, Lower=1e10, Upper=2000); 161 Re(N) as positive (Brief="Incremental Reynolds Number",Default=100,Lower=1); 160 162 161 163 end … … 190 192 outer PP as Plugin (Brief="External Physical Properties", Type="PP"); 191 193 outer NComp as Integer (Brief="Number of Components"); 192 N as Integer (Brief="Number of incremental points", Default = 2); 194 N as Integer (Brief="Number of zones", Default = 2); 195 Npoints as Integer (Brief="Number of incremental points", Default = 3); 193 196 194 197 M(NComp) as molweight (Brief="Component Mol Weight"); … … 229 232 Outer as Main_DoublePipe (Brief="Outer Side of the Heat Exchanger", Symbol="_{Outer}"); 230 233 231 Lincr(N +1) as length (Brief = "Incremental Tube Length", Symbol = "L_{incr}");234 Lincr(Npoints) as length (Brief = "Incremental Tube Length", Symbol = "L_{incr}"); 232 235 233 236 SET 237 238 #"Number of incremental points" 239 Npoints = N+1; 234 240 235 241 #"Component Molecular Weight" … … 260 266 261 267 "Outer Stream Average Temperature" 262 Outer.Properties.Average.T(1:N) = 0.5*Outer.HeatTransfer.Tlocal(1:N) + 0.5*Outer.HeatTransfer.Tlocal(2:N +1);268 Outer.Properties.Average.T(1:N) = 0.5*Outer.HeatTransfer.Tlocal(1:N) + 0.5*Outer.HeatTransfer.Tlocal(2:Npoints); 263 269 264 270 "Inner Stream Average Temperature" 265 Inner.Properties.Average.T(1:N) = 0.5*Inner.HeatTransfer.Tlocal(1:N) + 0.5*Inner.HeatTransfer.Tlocal(2:N +1);271 Inner.Properties.Average.T(1:N) = 0.5*Inner.HeatTransfer.Tlocal(1:N) + 0.5*Inner.HeatTransfer.Tlocal(2:Npoints); 266 272 267 273 "Outer Stream Average Pressure" 268 Outer.Properties.Average.P(1:N) = 0.5*Outer.PressureDrop.Plocal(1:N) + 0.5*Outer.PressureDrop.Plocal(2:N +1);274 Outer.Properties.Average.P(1:N) = 0.5*Outer.PressureDrop.Plocal(1:N) + 0.5*Outer.PressureDrop.Plocal(2:Npoints); 269 275 270 276 "Inner Stream Average Pressure" 271 Inner.Properties.Average.P(1:N) = 0.5*Inner.PressureDrop.Plocal(1:N) + 0.5*Inner.PressureDrop.Plocal(2:N +1);277 Inner.Properties.Average.P(1:N) = 0.5*Inner.PressureDrop.Plocal(1:N) + 0.5*Inner.PressureDrop.Plocal(2:Npoints); 272 278 273 279 "Inner Stream Wall Temperature" … … 409 415 case "cocurrent": 410 416 "Energy Balance Outer Stream in cocurrent flow" 411 Details.Q(1:N) = InletOuter.F*(Outer.HeatTransfer.Enth(1:N)  Outer.HeatTransfer.Enth(2:N +1));417 Details.Q(1:N) = InletOuter.F*(Outer.HeatTransfer.Enth(1:N)  Outer.HeatTransfer.Enth(2:Npoints)); 412 418 413 419 case "counter": 414 420 "Energy Balance Outer Stream in counter flow" 415 Details.Q(1:N) = InletOuter.F*(Outer.HeatTransfer.Enth(2:N +1)  Outer.HeatTransfer.Enth(1:N));421 Details.Q(1:N) = InletOuter.F*(Outer.HeatTransfer.Enth(2:Npoints)  Outer.HeatTransfer.Enth(1:N)); 416 422 417 423 end 418 424 419 425 "Energy Balance Inner Stream" 420 Details.Q(1:N) = InletInner.F*(Inner.HeatTransfer.Enth(1:N)  Inner.HeatTransfer.Enth(2:N +1));426 Details.Q(1:N) = InletInner.F*(Inner.HeatTransfer.Enth(1:N)  Inner.HeatTransfer.Enth(2:Npoints)); 421 427 422 428 when InletInner.T > InletOuter.T switchto "inner"; … … 425 431 426 432 "Energy Balance Hot Stream" 427 Details.Q(1:N) = InletInner.F*(Inner.HeatTransfer.Enth(1:N)Inner.HeatTransfer.Enth(2:N +1));433 Details.Q(1:N) = InletInner.F*(Inner.HeatTransfer.Enth(1:N)Inner.HeatTransfer.Enth(2:Npoints)); 428 434 429 435 switch FlowDirection … … 431 437 case "cocurrent": 432 438 "Energy Balance Cold Stream in cocurrent flow" 433 Details.Q(1:N) = InletOuter.F*(Outer.HeatTransfer.Enth(1:N)  Outer.HeatTransfer.Enth(2:N +1));439 Details.Q(1:N) = InletOuter.F*(Outer.HeatTransfer.Enth(1:N)  Outer.HeatTransfer.Enth(2:Npoints)); 434 440 435 441 case "counter": 436 442 "Energy Balance Cold Stream in counter flow" 437 Details.Q(1:N) = InletOuter.F*(Outer.HeatTransfer.Enth(2:N +1)  Outer.HeatTransfer.Enth(1:N));443 Details.Q(1:N) = InletOuter.F*(Outer.HeatTransfer.Enth(2:Npoints)  Outer.HeatTransfer.Enth(1:N)); 438 444 439 445 end … … 771 777 772 778 "Enthalpy of inner Side  Outlet Boundary" 773 Inner.HeatTransfer.Enth(N +1) = OutletInner.h;779 Inner.HeatTransfer.Enth(Npoints) = OutletInner.h; 774 780 775 781 "Temperature of Inner Side  Inlet Boundary" … … 777 783 778 784 "Temperature of Inner Side  Outlet Boundary" 779 Inner.HeatTransfer.Tlocal(N +1) = OutletInner.T;785 Inner.HeatTransfer.Tlocal(Npoints) = OutletInner.T; 780 786 781 787 "Pressure of Inner Side  Inlet Boundary" … … 783 789 784 790 "Pressure of Inner Side  Outlet Boundary" 785 Inner.PressureDrop.Plocal(N +1) = OutletInner.P;791 Inner.PressureDrop.Plocal(Npoints) = OutletInner.P; 786 792 787 793 switch FlowDirection … … 793 799 794 800 "Enthalpy of Outer Side  Outlet Boundary" 795 Outer.HeatTransfer.Enth(N +1) = OutletOuter.h;801 Outer.HeatTransfer.Enth(Npoints) = OutletOuter.h; 796 802 797 803 "Temperature of Outer Side  Inlet Boundary" … … 799 805 800 806 "Temperature of Outer Side  Outlet Boundary" 801 Outer.HeatTransfer.Tlocal(N +1) = OutletOuter.T;807 Outer.HeatTransfer.Tlocal(Npoints) = OutletOuter.T; 802 808 803 809 "Pressure of Outer Side  Inlet Boundary" … … 805 811 806 812 "Pressure of Outer Side  Outlet Boundary" 807 Outer.PressureDrop.Plocal(N +1) = OutletOuter.P;813 Outer.PressureDrop.Plocal(Npoints) = OutletOuter.P; 808 814 809 815 case "counter": 810 816 811 817 "Enthalpy of Outer Side  Inlet Boundary" 812 Outer.HeatTransfer.Enth(N +1) = InletOuter.h;818 Outer.HeatTransfer.Enth(Npoints) = InletOuter.h; 813 819 814 820 "Enthalpy of Outer Side  Outlet Boundary" … … 816 822 817 823 "Temperature of Outer Side  Inlet Boundary" 818 Outer.HeatTransfer.Tlocal(N +1) = InletOuter.T;824 Outer.HeatTransfer.Tlocal(Npoints) = InletOuter.T; 819 825 820 826 "Temperature of Outer Side  Outlet Boundary" … … 822 828 823 829 "Pressure of Outer Side  Inlet Boundary" 824 Outer.PressureDrop.Plocal(N +1) = InletOuter.P;830 Outer.PressureDrop.Plocal(Npoints) = InletOuter.P; 825 831 826 832 "Pressure of Outer Side  Outlet Boundary" … … 834 840 835 841 "Total Pressure Drop Outer Stream" 836 Outer.PressureDrop.Pdrop = Outer.PressureDrop.Pd_fric(N +1);842 Outer.PressureDrop.Pdrop = Outer.PressureDrop.Pd_fric(Npoints); 837 843 838 844 "Outer Pipe Pressure Drop for friction" 839 Outer.PressureDrop.Pd_fric(2:N +1) = (2*Outer.PressureDrop.fi*Lincr(2:N+1)*Outer.Properties.Average.rho*Outer.HeatTransfer.Vmean^2)/(Outer.PressureDrop.Dh*Outer.HeatTransfer.Phi);845 Outer.PressureDrop.Pd_fric(2:Npoints) = (2*Outer.PressureDrop.fi*Lincr(2:Npoints)*Outer.Properties.Average.rho*Outer.HeatTransfer.Vmean^2)/(Outer.PressureDrop.Dh*Outer.HeatTransfer.Phi); 840 846 841 847 "Outer Pipe Pressure Drop for friction" … … 862 868 863 869 "Outer Pipe Pressure Drop for friction" 864 Outer.PressureDrop.Pd_fric(N +1) = 0*'kPa';870 Outer.PressureDrop.Pd_fric(Npoints) = 0*'kPa'; 865 871 866 872 for i in [1:N] 867 873 868 874 "Outer Pipe Local Pressure" 869 Outer.PressureDrop.Plocal(i) = Outer.PressureDrop.Plocal(N +1)  Outer.PressureDrop.Pd_fric(i+1);875 Outer.PressureDrop.Plocal(i) = Outer.PressureDrop.Plocal(Npoints)  Outer.PressureDrop.Pd_fric(i+1); 870 876 871 877 end … … 874 880 875 881 "Total Pressure Drop Inner Stream" 876 Inner.PressureDrop.Pdrop = Inner.PressureDrop.Pd_fric(N +1);882 Inner.PressureDrop.Pdrop = Inner.PressureDrop.Pd_fric(Npoints); 877 883 878 884 "Inner Pipe Pressure Drop for friction" 879 Inner.PressureDrop.Pd_fric(2:N +1) = (2*Inner.PressureDrop.fi*Lincr(2:N+1)*Inner.Properties.Average.rho*Inner.HeatTransfer.Vmean^2)/(DiInner*Inner.HeatTransfer.Phi);885 Inner.PressureDrop.Pd_fric(2:Npoints) = (2*Inner.PressureDrop.fi*Lincr(2:Npoints)*Inner.Properties.Average.rho*Inner.HeatTransfer.Vmean^2)/(DiInner*Inner.HeatTransfer.Phi); 880 886 881 887 "Inner Pipe Pressure Drop for friction"
Note: See TracChangeset
for help on using the changeset viewer.