Changeset 432 for trunk/eml


Ignore:
Timestamp:
Dec 13, 2007, 6:04:33 PM (15 years ago)
Author:
gerson bicca
Message:

updated model double pipe incremental

File:
1 edited

Legend:

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

    r430 r432  
    2929PARAMETERS
    3030
    31 outer N   as Integer    (Brief="Number of incremental points", Default = 2);
     31outer N                         as Integer      (Brief="Number of zones", Default = 2);
    3232
    3333VARIABLES
     
    6565PARAMETERS
    6666
    67 outer N   as Integer    (Brief="Number of incremental points", Default = 2);
     67outer N                         as Integer      (Brief="Number of zones", Default = 2);
    6868
    6969VARIABLES
     
    9999PARAMETERS
    100100
    101 outer N   as Integer    (Brief="Number of incremental points", Default = 2);
     101outer N                         as Integer      (Brief="Number of zones", Default = 2);
    102102
    103103VARIABLES
     
    122122As                      as area                 (Brief="Cross Sectional Area for Flow",Default=0.05,Lower=1e-8);
    123123Dh                      as length               (Brief="Hydraulic Diameter of Pipe for Heat Transfer",Lower=1e-8);
    124 outer N   as Integer    (Brief="Number of incremental points", Default = 2);
     124outer N                         as Integer      (Brief="Number of zones", Default = 2);
     125outer Npoints           as Integer      (Brief="Number of incremental points", Default = 3);
    125126
    126127VARIABLES
    127128
    128 Tlocal(N+1)             as temperature                          (Brief="Incremental Local  Temperature",Lower=50);
     129Tlocal(Npoints)         as temperature                          (Brief="Incremental Local  Temperature",Lower=50);
    129130Re(N)                           as positive                                     (Brief="Incremental Reynolds Number",Default=100,Lower=1);
    130131hcoeff(N)                       as heat_trans_coeff             (Brief="Incremental Film Coefficient",Default=1,Lower=1e-12, Upper=1e6, DisplayUnit = 'W/m^2/K');
     
    134135Phi(N)                          as positive                                     (Brief="Incremental Phi Correction",Default=1,Lower=1e-3);
    135136Vmean(N)                as velocity                                     (Brief="Incremental Tube Velocity",Lower=1e-8);
    136 Enth(N+1)               as enth_mol                             (Brief="Incremental Stream Enthalpy");
     137Enth(Npoints)           as enth_mol                             (Brief="Incremental Stream Enthalpy");
    137138
    138139end
     
    149150
    150151Dh                      as length               (Brief="Hydraulic Diameter of Pipe for Pressure Drop",Lower=1e-6);
    151 outer N   as Integer    (Brief="Number of incremental points", Default = 2);
     152outer N                         as Integer      (Brief="Number of zones", Default = 2);
     153outer Npoints           as Integer      (Brief="Number of incremental points", Default = 3);
    152154
    153155VARIABLES
    154156
    155 Plocal(N+1)     as pressure             (Brief="Incremental Local  Pressure",Default=1, Lower=1e-10, 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=1e-10, Upper=2000);
    159 Re(N)                           as positive                     (Brief="Incremental Reynolds Number",Default=100,Lower=1);
     157Plocal(Npoints)         as pressure             (Brief="Incremental Local  Pressure",Default=1, Lower=1e-10, Upper=2e4, DisplayUnit='kPa');
     158Pdrop                                           as press_delta  (Brief="Total Pressure Drop",Default=0.01, Lower=0,DisplayUnit='kPa', Symbol ="\Delta P");
     159Pd_fric(Npoints)                as press_delta  (Brief="Incremental Pressure Drop for friction",Default=0.01, Lower=0,DisplayUnit='kPa', Symbol ="\Delta P_{fric}");
     160fi(N)                                           as fricfactor           (Brief="Incremental Friction Factor", Default=0.05, Lower=1e-10, Upper=2000);
     161Re(N)                                           as positive                     (Brief="Incremental Reynolds Number",Default=100,Lower=1);
    160162
    161163end     
     
    190192outer PP                as Plugin               (Brief="External Physical Properties", Type="PP");
    191193outer 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);
    193196       
    194197        M(NComp)        as molweight    (Brief="Component Mol Weight");
     
    229232        Outer                   as Main_DoublePipe      (Brief="Outer Side of the Heat Exchanger", Symbol="_{Outer}");
    230233
    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}");
    232235
    233236SET
     237
     238#"Number of incremental points"
     239        Npoints  = N+1;
    234240
    235241#"Component Molecular Weight"
     
    260266
    261267"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);
    263269
    264270"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);
    266272       
    267273"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);
    269275       
    270276"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);
    272278
    273279"Inner Stream Wall Temperature"
     
    409415        case "cocurrent":
    410416        "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));
    412418               
    413419        case "counter":
    414420        "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));
    416422               
    417423end
    418424
    419425"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));
    421427
    422428        when InletInner.T > InletOuter.T switchto "inner";
     
    425431
    426432"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));
    428434
    429435switch FlowDirection
     
    431437        case "cocurrent":
    432438        "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));
    434440               
    435441        case "counter":
    436442        "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));
    438444               
    439445end
     
    771777
    772778"Enthalpy of inner Side - Outlet Boundary"
    773         Inner.HeatTransfer.Enth(N+1) = OutletInner.h;
     779        Inner.HeatTransfer.Enth(Npoints) = OutletInner.h;
    774780
    775781"Temperature of Inner Side - Inlet Boundary"
     
    777783
    778784"Temperature of Inner Side - Outlet Boundary"
    779         Inner.HeatTransfer.Tlocal(N+1) = OutletInner.T;
     785        Inner.HeatTransfer.Tlocal(Npoints) = OutletInner.T;
    780786
    781787"Pressure of Inner Side - Inlet Boundary"
     
    783789
    784790"Pressure of Inner Side - Outlet Boundary"
    785         Inner.PressureDrop.Plocal(N+1) = OutletInner.P;
     791        Inner.PressureDrop.Plocal(Npoints) = OutletInner.P;
    786792
    787793switch FlowDirection
     
    793799
    794800"Enthalpy of Outer Side - Outlet Boundary"
    795         Outer.HeatTransfer.Enth(N+1) = OutletOuter.h;
     801        Outer.HeatTransfer.Enth(Npoints) = OutletOuter.h;
    796802
    797803"Temperature of Outer Side - Inlet Boundary"
     
    799805
    800806"Temperature of Outer Side - Outlet Boundary"
    801         Outer.HeatTransfer.Tlocal(N+1) = OutletOuter.T;
     807        Outer.HeatTransfer.Tlocal(Npoints) = OutletOuter.T;
    802808
    803809"Pressure of Outer Side - Inlet Boundary"
     
    805811
    806812"Pressure of Outer Side - Outlet Boundary"
    807         Outer.PressureDrop.Plocal(N+1) = OutletOuter.P;
     813        Outer.PressureDrop.Plocal(Npoints) = OutletOuter.P;
    808814
    809815        case "counter":
    810816
    811817"Enthalpy of Outer Side - Inlet Boundary"
    812         Outer.HeatTransfer.Enth(N+1) = InletOuter.h;
     818        Outer.HeatTransfer.Enth(Npoints) = InletOuter.h;
    813819
    814820"Enthalpy of Outer Side - Outlet Boundary"
     
    816822
    817823"Temperature of Outer Side - Inlet Boundary"
    818         Outer.HeatTransfer.Tlocal(N+1) = InletOuter.T;
     824        Outer.HeatTransfer.Tlocal(Npoints) = InletOuter.T;
    819825
    820826"Temperature of Outer Side - Outlet Boundary"
     
    822828
    823829"Pressure of Outer Side - Inlet Boundary"
    824         Outer.PressureDrop.Plocal(N+1) = InletOuter.P;
     830        Outer.PressureDrop.Plocal(Npoints) = InletOuter.P;
    825831
    826832"Pressure of Outer Side - Outlet Boundary"
     
    834840
    835841"Total Pressure Drop Outer Stream"
    836         Outer.PressureDrop.Pdrop  = Outer.PressureDrop.Pd_fric(N+1);
     842        Outer.PressureDrop.Pdrop  = Outer.PressureDrop.Pd_fric(Npoints);
    837843
    838844"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);
    840846
    841847"Outer Pipe Pressure Drop for friction"
     
    862868
    863869"Outer Pipe Pressure Drop for friction"
    864         Outer.PressureDrop.Pd_fric(N+1) = 0*'kPa';
     870        Outer.PressureDrop.Pd_fric(Npoints) = 0*'kPa';
    865871
    866872for i in [1:N]
    867873   
    868874"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);
    870876
    871877end
     
    874880
    875881"Total Pressure Drop Inner Stream"
    876         Inner.PressureDrop.Pdrop  = Inner.PressureDrop.Pd_fric(N+1);
     882        Inner.PressureDrop.Pdrop  = Inner.PressureDrop.Pd_fric(Npoints);
    877883       
    878884"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);
    880886
    881887"Inner Pipe Pressure Drop for friction"
Note: See TracChangeset for help on using the changeset viewer.