Changeset 339


Ignore:
Timestamp:
Aug 14, 2007, 2:46:50 PM (15 years ago)
Author:
gerson bicca
Message:

testing a new streamTherm

Location:
branches/tests
Files:
3 edited

Legend:

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

    r325 r339  
    3636VARIABLES
    3737
    38 in  InletHot    as stream               (Brief="Inlet Hot Stream", PosX=0, PosY=0.4915);
     38in  InletHot    as streamTherm          (Brief="Inlet Hot Stream", PosX=0, PosY=0.4915);
    3939out OutletHot   as streamPH     (Brief="Outlet Hot Stream", PosX=1, PosY=0.4915);
    40 in  InletCold   as stream               (Brief="Inlet Cold Stream", PosX=0.5237, PosY=1);
     40in  InletCold   as streamTherm          (Brief="Inlet Cold Stream", PosX=0.5237, PosY=1);
    4141out OutletCold  as streamPH     (Brief="Outlet Cold Stream", PosX=0.5237, PosY=0);
    42 
    43         xh(NComp)       as fraction             (Brief = "Liquid Molar Fraction in Hot Side");
    44         yh(NComp)       as fraction             (Brief = "Vapour Molar Fraction in Hot Side");
    45         vh                      as fraction             (Brief = "Vapour Molar Fraction in Hot Side");
    46        
    47         xc(NComp)       as fraction             (Brief = "Liquid Molar Fraction in Cold Side");
    48         yc(NComp)       as fraction             (Brief = "Vapour Molar Fraction in Cold Side");
    49         vc                      as fraction             (Brief = "Vapour Molar Fraction in Cold Side");
    5042
    5143        Details     as Details_Main     (Brief="Heat Exchanger Details");
     
    6052EQUATIONS
    6153
    62 "Flash Calculation in Hot Side"
    63         [vh, xh, yh] = PP.Flash(InletHot.T, InletHot.P, InletHot.z);
    64 
    65 "Flash Calculation in Cold Side"
    66         [vc, xc, yc] = PP.Flash(InletCold.T, InletCold.P, InletCold.z);
     54#"Flash Calculation in Hot Side"
     55#       [vh, xh, yh] = PP.Flash(InletHot.T, InletHot.P, InletHot.z);
     56
     57#"Flash Calculation in Cold Side"
     58#       [vc, xc, yc] = PP.Flash(InletCold.T, InletCold.P, InletCold.z);
    6759
    6860"Hot Stream Average Temperature"
     
    9183
    9284"Cold Stream Average Heat Capacity"
    93         ColdSide.Properties.Average.Cp  =       (1-InletCold.v)*PP.LiquidCp(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,xc) +
    94                 InletCold.v*PP.VapourCp(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,yc);
     85        ColdSide.Properties.Average.Cp  =       (1-InletCold.v)*PP.LiquidCp(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,InletCold.x) +
     86                InletCold.v*PP.VapourCp(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,InletCold.y);
    9587
    9688"Cold Stream Inlet Heat Capacity"
    97         ColdSide.Properties.Inlet.Cp    =       (1-InletCold.v)*PP.LiquidCp(InletCold.T,InletCold.P,xc)+
    98                 InletCold.v*PP.VapourCp(InletCold.T,InletCold.P,yc);
     89        ColdSide.Properties.Inlet.Cp    =       (1-InletCold.v)*PP.LiquidCp(InletCold.T,InletCold.P,InletCold.x)+
     90                InletCold.v*PP.VapourCp(InletCold.T,InletCold.P,InletCold.y);
    9991
    10092"Cold Stream Outlet Heat Capacity"
     
    10395
    10496"Cold Stream Average Mass Density"
    105         ColdSide.Properties.Average.rho =       (1-InletCold.v)*PP.LiquidDensity(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,xc)+
    106                 InletCold.v*PP.VapourDensity(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,yc);
     97        ColdSide.Properties.Average.rho =       (1-InletCold.v)*PP.LiquidDensity(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,InletCold.x)+
     98                InletCold.v*PP.VapourDensity(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,InletCold.y);
    10799
    108100"Cold Stream Inlet Mass Density"
    109         ColdSide.Properties.Inlet.rho   =       (1-InletCold.v)*PP.LiquidDensity(InletCold.T,InletCold.P,xc)+
    110                 InletCold.v*PP.VapourDensity(InletCold.T,InletCold.P,yc);
     101        ColdSide.Properties.Inlet.rho   =       (1-InletCold.v)*PP.LiquidDensity(InletCold.T,InletCold.P,InletCold.x)+
     102                InletCold.v*PP.VapourDensity(InletCold.T,InletCold.P,InletCold.y);
    111103
    112104"Cold Stream Outlet Mass Density"
     
    115107
    116108"Cold Stream Average Viscosity"
    117         ColdSide.Properties.Average.Mu  =       (1-InletCold.v)*PP.LiquidViscosity(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,xc)+
    118                 InletCold.v*PP.VapourViscosity(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,yc);
     109        ColdSide.Properties.Average.Mu  =       (1-InletCold.v)*PP.LiquidViscosity(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,InletCold.x)+
     110                InletCold.v*PP.VapourViscosity(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,InletCold.y);
    119111
    120112"Cold Stream inlet Viscosity"
    121         ColdSide.Properties.Inlet.Mu    =       (1-InletCold.v)*PP.LiquidViscosity(InletCold.T,InletCold.P,xc)+
    122                 InletCold.v*PP.VapourViscosity(InletCold.T,InletCold.P,yc);
     113        ColdSide.Properties.Inlet.Mu    =       (1-InletCold.v)*PP.LiquidViscosity(InletCold.T,InletCold.P,InletCold.x)+
     114                InletCold.v*PP.VapourViscosity(InletCold.T,InletCold.P,InletCold.y);
    123115
    124116"Cold Stream Outlet Viscosity"
     
    127119
    128120"Cold Stream Average Conductivity"
    129         ColdSide.Properties.Average.K   =       (1-InletCold.v)*PP.LiquidThermalConductivity(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,xc)+
    130                 InletCold.v*PP.VapourThermalConductivity(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,yc);
     121        ColdSide.Properties.Average.K   =       (1-InletCold.v)*PP.LiquidThermalConductivity(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,InletCold.x)+
     122                InletCold.v*PP.VapourThermalConductivity(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,InletCold.y);
    131123
    132124"Cold Stream Inlet Conductivity"       
    133         ColdSide.Properties.Inlet.K     =       (1-InletCold.v)*PP.LiquidThermalConductivity(InletCold.T,InletCold.P,xc)+
    134                 InletCold.v*PP.VapourThermalConductivity(InletCold.T,InletCold.P,yc);
     125        ColdSide.Properties.Inlet.K     =       (1-InletCold.v)*PP.LiquidThermalConductivity(InletCold.T,InletCold.P,InletCold.x)+
     126                InletCold.v*PP.VapourThermalConductivity(InletCold.T,InletCold.P,InletCold.y);
    135127
    136128"Cold Stream Outlet Conductivity"
     
    139131       
    140132"Cold Stream Viscosity at Wall Temperature"
    141         ColdSide.Properties.Wall.Mu     =       (1-InletCold.v)*PP.LiquidViscosity(ColdSide.Properties.Wall.Twall,ColdSide.Properties.Average.P,xc)+
    142                 InletCold.v*PP.VapourViscosity(ColdSide.Properties.Wall.Twall,ColdSide.Properties.Average.P,yc);
     133        ColdSide.Properties.Wall.Mu     =       (1-InletCold.v)*PP.LiquidViscosity(ColdSide.Properties.Wall.Twall,ColdSide.Properties.Average.P,InletCold.x)+
     134                InletCold.v*PP.VapourViscosity(ColdSide.Properties.Wall.Twall,ColdSide.Properties.Average.P,InletCold.y);
    143135
    144136"Hot Stream Average Heat Capacity"
    145         HotSide.Properties.Average.Cp   =       (1-InletHot.v)*PP.LiquidCp(HotSide.Properties.Average.T,HotSide.Properties.Average.P,xc) +
    146                 InletHot.v*PP.VapourCp(HotSide.Properties.Average.T,HotSide.Properties.Average.P,yc);
     137        HotSide.Properties.Average.Cp   =       (1-InletHot.v)*PP.LiquidCp(HotSide.Properties.Average.T,HotSide.Properties.Average.P,InletHot.x) +
     138                InletHot.v*PP.VapourCp(HotSide.Properties.Average.T,HotSide.Properties.Average.P,InletHot.y);
    147139
    148140"Hot Stream Inlet Heat Capacity"
    149         HotSide.Properties.Inlet.Cp     =       (1-InletHot.v)*PP.LiquidCp(InletHot.T,InletHot.P,xc)+
    150                 InletHot.v*PP.VapourCp(InletHot.T,InletHot.P,yc);
     141        HotSide.Properties.Inlet.Cp     =       (1-InletHot.v)*PP.LiquidCp(InletHot.T,InletHot.P,InletHot.x)+
     142                InletHot.v*PP.VapourCp(InletHot.T,InletHot.P,InletHot.y);
    151143
    152144"Hot Stream Outlet Heat Capacity"
     
    155147
    156148"Hot Stream Average Mass Density"
    157         HotSide.Properties.Average.rho =        (1-InletHot.v)*PP.LiquidDensity(HotSide.Properties.Average.T,HotSide.Properties.Average.P,xc)+
    158                 InletHot.v*PP.VapourDensity(HotSide.Properties.Average.T,HotSide.Properties.Average.P,yc);
     149        HotSide.Properties.Average.rho =        (1-InletHot.v)*PP.LiquidDensity(HotSide.Properties.Average.T,HotSide.Properties.Average.P,InletHot.x)+
     150                InletHot.v*PP.VapourDensity(HotSide.Properties.Average.T,HotSide.Properties.Average.P,InletHot.y);
    159151
    160152"Hot Stream Inlet Mass Density"
    161         HotSide.Properties.Inlet.rho    =       (1-InletHot.v)*PP.LiquidDensity(InletHot.T,InletHot.P,xc)+
    162                 InletHot.v*PP.VapourDensity(InletHot.T,InletHot.P,yc);
     153        HotSide.Properties.Inlet.rho    =       (1-InletHot.v)*PP.LiquidDensity(InletHot.T,InletHot.P,InletHot.x)+
     154                InletHot.v*PP.VapourDensity(InletHot.T,InletHot.P,InletHot.y);
    163155
    164156"Hot Stream Outlet Mass Density"
     
    167159
    168160"Hot Stream Average Viscosity"
    169         HotSide.Properties.Average.Mu   =       (1-InletHot.v)*PP.LiquidViscosity(HotSide.Properties.Average.T,HotSide.Properties.Average.P,xc)+
    170                 InletHot.v*PP.VapourViscosity(HotSide.Properties.Average.T,HotSide.Properties.Average.P,yc);
     161        HotSide.Properties.Average.Mu   =       (1-InletHot.v)*PP.LiquidViscosity(HotSide.Properties.Average.T,HotSide.Properties.Average.P,InletHot.x)+
     162                InletHot.v*PP.VapourViscosity(HotSide.Properties.Average.T,HotSide.Properties.Average.P,InletHot.y);
    171163
    172164"Hot Stream inlet Viscosity"
    173         HotSide.Properties.Inlet.Mu     =       (1-InletHot.v)*PP.LiquidViscosity(InletHot.T,InletHot.P,xc)+
    174                 InletHot.v*PP.VapourViscosity(InletHot.T,InletHot.P,yc);
     165        HotSide.Properties.Inlet.Mu     =       (1-InletHot.v)*PP.LiquidViscosity(InletHot.T,InletHot.P,InletHot.x)+
     166                InletHot.v*PP.VapourViscosity(InletHot.T,InletHot.P,InletHot.y);
    175167
    176168"Hot Stream Outlet Viscosity"
     
    179171
    180172"Hot Stream Average Conductivity"
    181         HotSide.Properties.Average.K    =       (1-InletHot.v)*PP.LiquidThermalConductivity(HotSide.Properties.Average.T,HotSide.Properties.Average.P,xc)+
    182                 InletHot.v*PP.VapourThermalConductivity(HotSide.Properties.Average.T,HotSide.Properties.Average.P,yc);
     173        HotSide.Properties.Average.K    =       (1-InletHot.v)*PP.LiquidThermalConductivity(HotSide.Properties.Average.T,HotSide.Properties.Average.P,InletHot.x)+
     174                InletHot.v*PP.VapourThermalConductivity(HotSide.Properties.Average.T,HotSide.Properties.Average.P,InletHot.y);
    183175
    184176"Hot Stream Inlet Conductivity"
    185         HotSide.Properties.Inlet.K      =       (1-InletHot.v)*PP.LiquidThermalConductivity(InletHot.T,InletHot.P,xc)+
    186                 InletHot.v*PP.VapourThermalConductivity(InletHot.T,InletHot.P,yc);
     177        HotSide.Properties.Inlet.K      =       (1-InletHot.v)*PP.LiquidThermalConductivity(InletHot.T,InletHot.P,InletHot.x)+
     178                InletHot.v*PP.VapourThermalConductivity(InletHot.T,InletHot.P,InletHot.y);
    187179
    188180"Hot Stream Outlet Conductivity"
     
    191183       
    192184"Hot Stream Viscosity at Wall Temperature"
    193         HotSide.Properties.Wall.Mu      =       (1-InletHot.v)*PP.LiquidViscosity(HotSide.Properties.Wall.Twall,HotSide.Properties.Average.P,xc)+
    194                 InletHot.v*PP.VapourViscosity(HotSide.Properties.Wall.Twall,HotSide.Properties.Average.P,yc);
     185        HotSide.Properties.Wall.Mu      =       (1-InletHot.v)*PP.LiquidViscosity(HotSide.Properties.Wall.Twall,HotSide.Properties.Average.P,InletHot.x)+
     186                InletHot.v*PP.VapourViscosity(HotSide.Properties.Wall.Twall,HotSide.Properties.Average.P,InletHot.y);
    195187
    196188"Energy Balance Hot Stream"
  • branches/tests/eml/streams.mso

    r325 r339  
    3535
    3636        VARIABLES
    37         F as flow_mol;
    38         T as temperature;
    39         P as pressure;
     37        F as flow_mol(Brief = "Molar Flow");
     38        T as temperature(Brief = "Temperature");
     39        P as pressure(Brief = "Pressure");
    4040        z(NComp) as fraction(Brief = "Overall Molar Fraction");
    41         h as enth_mol;
     41        h as enth_mol(Brief = "Molar Enthalpy");
    4242        v as fraction(Brief = "Vapourization fraction");
     43end
     44
     45Model streamTherm as stream
     46        ATTRIBUTES
     47        Pallete = false;
     48        Brief = "General Material Stream";
     49        Info =
     50        "comments.";
     51       
     52        PARAMETERS
     53        outer NComp as Integer (Brief = "Number of chemical components", Lower = 1);
     54
     55        VARIABLES
     56        x(NComp) as fraction(Brief = "Liquid Molar Fraction");
     57        y(NComp) as fraction(Brief = "Vapour Molar Fraction");
     58
    4359end
    4460
     
    6076        "Liquid stream"
    6177        v = 0;
     78
    6279end
    6380
     
    7996        "Vapour stream"
    8097        v = 1;
    81 end
    82 
    83 Model streamPH as stream
     98
     99end
     100
     101Model streamPH as streamTherm
    84102        ATTRIBUTES
    85103        Brief = "Stream with built-in flash calculation";
     
    99117        PARAMETERS
    100118        outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
    101        
    102         VARIABLES
    103         x(NComp) as fraction(Brief = "Liquid Molar Fraction");
    104         y(NComp) as fraction(Brief = "Vapour Molar Fraction");
    105119       
    106120        EQUATIONS
     
    150164
    151165        VARIABLES
    152         out Outlet                      as stream                       (Brief = "Outlet stream", PosX=1, PosY=0.5256);
    153         x(NComp)                        as fraction                     (Brief = "Liquid Molar Fraction");
    154         y(NComp)                        as fraction                     (Brief = "Vapour Molar Fraction");
     166        out Outlet                      as streamTherm                  (Brief = "Outlet stream", PosX=1, PosY=0.5256);
    155167        hl                                      as enth_mol;
    156168        hv                                      as enth_mol;
     
    165177        EQUATIONS
    166178        "Flash Calculation"
    167         [Outlet.v, x, y] = PP.Flash(Outlet.T, Outlet.P, Outlet.z);
     179        [Outlet.v, Outlet.x, Outlet.y] = PP.Flash(Outlet.T, Outlet.P, Outlet.z);
    168180       
    169181        "Overall Enthalpy"
    170         Outlet.h = (1-Outlet.v)*PP.LiquidEnthalpy(Outlet.T, Outlet.P, x) +
    171                 Outlet.v*PP.VapourEnthalpy(Outlet.T, Outlet.P, y);
    172        
    173         hl = PP.LiquidEnthalpy(Outlet.T, Outlet.P, x);
    174         hv = PP.VapourEnthalpy(Outlet.T, Outlet.P, y);
     182        Outlet.h = (1-Outlet.v)*PP.LiquidEnthalpy(Outlet.T, Outlet.P, Outlet.x) +
     183                Outlet.v*PP.VapourEnthalpy(Outlet.T, Outlet.P, Outlet.y);
     184       
     185        hl = PP.LiquidEnthalpy(Outlet.T, Outlet.P, Outlet.x);
     186        hv = PP.VapourEnthalpy(Outlet.T, Outlet.P, Outlet.y);
    175187       
    176188        "Average Molecular Weight"
     
    184196                case "correlation":
    185197        "Mass Density"
    186                 rho*((1-Outlet.v)/PP.LiquidDensity(Outlet.T,Outlet.P,x) + Outlet.v/PP.VapourDensity(Outlet.T,Outlet.P,y)) = 1;
     198                rho*((1-Outlet.v)/PP.LiquidDensity(Outlet.T,Outlet.P,Outlet.x) + Outlet.v/PP.VapourDensity(Outlet.T,Outlet.P,Outlet.y)) = 1;
    187199        end
    188200       
     
    194206
    195207        "Molar Volume"
    196         vm = (1-Outlet.v)*PP.LiquidVolume(Outlet.T, Outlet.P, x) + Outlet.v*PP.VapourVolume(Outlet.T,Outlet.P,y);
     208        vm = (1-Outlet.v)*PP.LiquidVolume(Outlet.T, Outlet.P, Outlet.x) + Outlet.v*PP.VapourVolume(Outlet.T,Outlet.P,Outlet.y);
    197209       
    198210        "Volumetric Flow"
     
    226238       
    227239        VARIABLES
    228         out Outlet                      as stream               (Brief = "Outlet stream", PosX=1, PosY=0.5256);
    229         x(NComp)                        as fraction             (Brief = "Liquid Molar Fraction");
    230         y(NComp)                        as fraction             (Brief = "Vapour Molar Fraction");
     240        out Outlet                      as streamTherm          (Brief = "Outlet stream", PosX=1, PosY=0.5256);
    231241        hl                                      as enth_mol;
    232242        hv                                      as enth_mol;
     
    234244        EQUATIONS
    235245        "Flash Calculation"
    236         [Outlet.v, x, y] = PP.Flash(Outlet.T, Outlet.P, Outlet.z);
     246        [Outlet.v, Outlet.x, Outlet.y] = PP.Flash(Outlet.T, Outlet.P, Outlet.z);
    237247       
    238248        "Overall Enthalpy"
    239         Outlet.h = (1-Outlet.v)*PP.LiquidEnthalpy(Outlet.T, Outlet.P, x) +
    240                 Outlet.v*PP.VapourEnthalpy(Outlet.T, Outlet.P, y);
    241 
    242         hl = PP.LiquidEnthalpy(Outlet.T, Outlet.P, x);
    243         hv = PP.VapourEnthalpy(Outlet.T, Outlet.P, y);
     249        Outlet.h = (1-Outlet.v)*PP.LiquidEnthalpy(Outlet.T, Outlet.P, Outlet.x) +
     250                Outlet.v*PP.VapourEnthalpy(Outlet.T, Outlet.P, Outlet.y);
     251
     252        hl = PP.LiquidEnthalpy(Outlet.T, Outlet.P, Outlet.x);
     253        hv = PP.VapourEnthalpy(Outlet.T, Outlet.P, Outlet.y);
    244254end
    245255
     
    274284       
    275285        VARIABLES
    276         in Inlet                as stream               (Brief = "Inlet Stream", PosX=0, PosY=0.5308);
    277         v                               as fraction             (Brief = "Vapourization fraction");
    278         x(NComp)                as fraction             (Brief = "Liquid Molar Fraction");
    279         y(NComp)                as fraction             (Brief = "Vapour Molar Fraction");
     286        in Inlet                as streamTherm          (Brief = "Inlet Stream", PosX=0, PosY=0.5308);
    280287        zmass(NComp)    as fraction             (Brief = "Mass Fraction");
    281288        Mw                              as molweight    (Brief = "Average Mol Weight");
     
    287294       
    288295        EQUATIONS
    289         "Flash Calculation"
    290         [v, x, y] = PP.FlashPH(Inlet.P, Inlet.h, Inlet.z);
    291        
    292296        "Average Molecular Weight"
    293297        Mw = sum(M*Inlet.z);
     
    300304                case "correlation":
    301305        "Mass Density"
    302                 rho * ((1-v)/PP.LiquidDensity(Inlet.T,Inlet.P,x) + v/PP.VapourDensity(Inlet.T,Inlet.P,y)) = 1;
     306                rho * ((1-Inlet.v)/PP.LiquidDensity(Inlet.T,Inlet.P,Inlet.x) + Inlet.v/PP.VapourDensity(Inlet.T,Inlet.P,Inlet.y)) = 1;
    303307        end
    304308       
     
    310314
    311315        "Molar Volume"
    312         vm = (1-v)*PP.LiquidVolume(Inlet.T, Inlet.P, x) + v*PP.VapourVolume(Inlet.T,Inlet.P,y);
     316        vm = (1-Inlet.v)*PP.LiquidVolume(Inlet.T, Inlet.P, Inlet.x) + Inlet.v*PP.VapourVolume(Inlet.T,Inlet.P,Inlet.y);
    313317       
    314318        "Volumetric Flow"
  • branches/tests/sample/heat_exchangers/Sample_DoublePipe.mso

    r236 r339  
    9999
    100100Dynamic  = false;
    101 GuessFile = "GuessPipe";
     101#GuessFile = "GuessPipe";
    102102
    103103end
     
    178178Dynamic = false;
    179179
    180 GuessFile = "GuessPipe";
     180#GuessFile = "GuessPipe";
    181181
    182182end
Note: See TracChangeset for help on using the changeset viewer.