source: mso/eml/heat_exchangers/Mheatex.mso @ 100

Last change on this file since 100 was 100, checked in by gerson bicca, 15 years ago

updated

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.9 KB
RevLine 
[78]1#*-------------------------------------------------------------------
2* EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC.
3*
4* This LIBRARY is free software; you can distribute it and/or modify
5* it under the therms of the ALSOC FREE LICENSE as available at
6* http://www.enq.ufrgs.br/alsoc.
7*
8* EMSO Copyright (C) 2004 - 2007 ALSOC, original code
9* from http://www.rps.eng.br Copyright (C) 2002-2004.
10* All rights reserved.
11*
12* EMSO is distributed under the therms of the ALSOC LICENSE as
13* available at http://www.enq.ufrgs.br/alsoc.
14*
15*
16*---------------------------------------------------------------------
[26]17* Model of a Multistream Heat Exchanger
[1]18*
[26]19*       Streams:
20*               * Inlet(Ninlet) streams ....    at least one material stream
21*               * Outlet stream             ....        one material stream
[1]22*
[26]23*       Purpose:
24*               * Determines thermal and phase conditions of outlet stream
[1]25*
26*----------------------------------------------------------------------
27* Author: Gerson Balbueno Bicca
28* $Id: Mheatex.mso 100 2007-01-09 14:15:56Z bicca $
29*--------------------------------------------------------------------*#
[45]30
[1]31using "streams.mso";
32
[45]33Model Inlet_Main_Stream         
[26]34#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
[45]35#       Inlet Streams
[26]36#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
[1]37PARAMETERS
[45]38
39        Ncold   as Integer      (Brief="Number of Inlet Cold Streams",Lower=1);
40        Nhot    as Integer      (Brief="Number of Inlet Hot Streams",Lower=1);
[1]41       
42VARIABLES
43
[45]44        Hot  (Nhot)     as stream;# Inlet Hot Streams
45        Cold (Ncold)    as stream;# Inlet Cold Streams
[1]46       
47end
48
[45]49Model Outlet_Main_Stream       
[26]50#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
[1]51#       Outlet Streams
[26]52#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
[45]53PARAMETERS
54
55        Ncold   as Integer      (Brief="Number of Inlet Cold Streams",Lower=1);
56        Nhot    as Integer      (Brief="Number of Inlet Hot Streams",Lower=1);
57       
[1]58VARIABLES
59
[45]60        Hot  (Nhot)     as stream_therm;# Outlet Hot Streams
61        Cold (Ncold)    as stream_therm;# Outlet Cold Streams
[1]62       
63end
64
65Model Mheatex
[26]66#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
[1]67#       Multistream Heat Exchanger Basic Calculation
[26]68#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
[1]69PARAMETERS
70
[45]71ext PP          as CalcObject   (Brief="Physical Properties");
72ext     NComp   as Integer              (Brief="Number of Components");
73        HE              as CalcObject   (Brief="Cold Box Calculations",File="heatex");
[1]74        Side    as Integer              (Brief="Flow Direction",Lower=0,Upper=1);
[45]75        Ncold   as Integer              (Brief="Number of Inlet Cold Streams",Lower=1);
76        Nhot    as Integer              (Brief="Number of Inlet Hot Streams",Lower=1);
77       
[1]78VARIABLES
79
80in  Inlet       as Inlet_Main_Stream;           # Inlet Hot Streams
81out Outlet      as Outlet_Main_Stream;          # Outlet Hot Streams
82
83        Q       as power                (Brief="Heat Transfer");
84        LMTD    as temp_delta   (Brief="Logarithmic Mean Temperature Difference");
85        UA      as positive     (Unit="W/K");
[45]86
87SET
88
[100]89# Flow Direction
90        Side = HE.FlowDir();
[45]91
[100]92# Inlet Ncold Parameters
93        Inlet.Ncold  = Ncold;
94       
95# Outlet Ncold Parameters
96        Outlet.Ncold = Ncold;
[45]97
[100]98# Inlet Nhot Parameters
99        Inlet.Nhot  = Nhot;
100       
101# Outlet Nhot Parameters
102        Outlet.Nhot = Nhot ;
[45]103
[1]104EQUATIONS
105
106"Hot Flow"
107        Outlet.Hot.F = Inlet.Hot.F;     
108
109"Cold Flow"
110        Outlet.Cold.F = Inlet.Cold.F;
111       
112"Hot Composition"
113        Outlet.Hot.z = Inlet.Hot.z;
114       
115"Cold Composition"
116        Outlet.Cold.z = Inlet.Cold.z;
117       
118"Vapourisation Fraction Hot Stream"
119        Outlet.Hot.v = Inlet.Hot.v;             
120       
121"Vapourisation Fraction Cold Stream"
122        Outlet.Cold.v = Inlet.Cold.v;   
123       
124"Heat Duty Hot Stream"
125        Q =  sum(Inlet.Hot.F*(Inlet.Hot.h- Outlet.Hot.h));
126       
127"Heat Duty Cold Stream"
128        Q = -sum(Inlet.Cold.F*(Inlet.Cold.h- Outlet.Cold.h));
129       
130"Heat Duty"
131        Q=UA*LMTD;
132
[26]133#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
[1]134#       Flow Direction
[26]135#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
136
[1]137if Side equal 0
138       
139        then
140"Cocurrent Flow LMTD"
141        LMTD = HE.CocurrentLMTD(max(Inlet.Hot.T),min(Outlet.Hot.T),min(Inlet.Cold.T),max(Outlet.Cold.T));
142       
143        else
144"Counter Flow LMTD"
145        LMTD = HE.CounterLMTD(max(Inlet.Hot.T),min(Outlet.Hot.T),max(Inlet.Cold.T),min(Outlet.Cold.T));
146       
147end
148
149end
Note: See TracBrowser for help on using the repository browser.