source: trunk/BioModel/heat_exchangers/Modelo_pinch.mso @ 1008

Last change on this file since 1008 was 1008, checked in by Argimiro Resende Secchi, 21 months ago

Adding BioModel? to the MSO library.

File size: 29.7 KB
Line 
1#*-------------------------------------------------------------------
2* Biorrefinaria Petrobras
3*--------------------------------------------------------------------
4* Nome do arquivo: Modelo_pinch.mso
5* Projeto: Modelo integrado de producao de etanol 1G/2G
6* Conteudo:
7*--------------------------------------------------------------------*#
8
9#*-------------------------------------------------------------------
10*
11* Versao:2.1
12* Data: 06/2019   
13* Autores: Andrew Elias
14*
15*--------------------------------------------------------------------
16* Descricao: Integracao de correntes energeticas para otimizacao de
17* troca energetica entre processos da planta.
18*--------------------------------------------------------------------
19
20*--------------------------------------------------------------------
21*Hipoteses assumidas: 1 - operacao em estado estacionario
22*                     2 - sem perdas de calor para o ambiente
23*--------------------------------------------------------------------
24
25*--------------------------------------------------------------------
26*Notas: Foi feito o flowsheet teste para averiguar o modelo.
27*--------------------------------------------------------------------*#
28
29using "main_stream";
30using "water_stream";
31using "energy_stream";
32
33Model heat_stream_int
34        ATTRIBUTES
35        Pallete = false;
36        Brief = "Heat Stream";
37        Color = "red";
38        Info =
39"== GENERAL ==
40        Corrente criada para ser utilizada quando o modelo possui interpolador
41";
42       
43        VARIABLES
44        Q as power (Upper = 1e8, Lower = -1e8);
45        T as temperature;
46       
47end
48
49Model heat_source_int
50        ATTRIBUTES
51        Pallete = true;
52        Icon = "icon/heatR";
53        Brief = "Heat Stream Source";
54        Info =
55"== GENERAL ==
56        Source of heat.
57";
58        VARIABLES
59out Outlet as heat_stream_int;
60
61end
62
63Model PinchPointInt
64       
65        ATTRIBUTES
66        Pallete = false;
67        Brief = "Integracao energetica atraves do pinch em processos com interpolador";
68        Info =
69"== GENERAL ==
70        Integracao de correntes energeticas para otimizacao de
71    troca energetica entre porcessos
72        == ASSUMPTIONS ==
73
74        * No heat loss to the environment;
75        * Steady-state;
76        * There is no phase change.
77
78        == SPECIFY ==
79        * Inlet main stream:
80          flow rate
81          temperature
82          pressure
83          stream composition
84          heat_trans_corr
85        * The cold water steam stream:
86          temperature
87          pressure
88          heat_trans_cold;
89        * The vapour steam stream:
90          pressure
91          vapourization fraction
92          heat_trans_hot;
93        * The heat steam stream:
94          heat_trans_corr;
95        * Minimum approach temperature (DTmin);
96        * Outlet Temperature of:
97          main stream
98          cold water steam stream
99          heat steam stream,
100
101        == SET ==
102        * Phase of the stream feed;
103        * Number of stream components(Ncomp/NcompS);
104        * Define type of method for area calculation by Switcher, U or h, Default = h ;
105        * Basic composition (mass or molar).
106        ";     
107
108        PARAMETERS
109outer   Pinch   as Plugin (Type = "Pinch");
110outer   PP              as Plugin (Brief = "External Physical Properties (Fluid Phase)", Type="PP");
111outer   PPS     as Plugin (Brief = "External Physical Properties (Solid Phase)", Type="PP");
112        propterm as Plugin (Type = "water");
113        method  as Switcher     (Brief="Type of method",Valid=["U","h"],Default="h");
114       
115        NCorrentes as Integer (Default = 11); #numero de correntes de processo que necessitam trocar calor
116        NCorrentesInt as Integer (Default = 8);#numero de correntes que entram no interpolador (normalmente, 8)
117       
118        NUtilQuente as Integer(Default = 3); #Numero de utilidades quentes (vapor de alta, media e baixa)
119        NUtilFria as Integer(Default = 1); #Numero de utilidades frias , agua de resfriamento
120
121        U as heat_trans_coeff (Default = 0.69445);
122       
123        VARIABLES
124       
125in      Inlet(NCorrentes)  as main_stream;
126out     Outlet(NCorrentes) as main_stream;
127
128in  Inlet_Int(NCorrentesInt)  as heat_stream_int;
129
130in  Inlet_q(NUtilQuente)  as water_stream;
131out Outlet_q(NUtilQuente) as water_stream;
132
133in  Inlet_f(NUtilFria)  as water_stream;
134out Outlet_f(NUtilFria) as water_stream;
135
136        H(NCorrentes + NCorrentesInt) as power;
137       
138        Tin(NCorrentes + NCorrentesInt) as temperature;
139        Tout(NCorrentes + NCorrentesInt) as temperature;
140       
141        TPinch as temperature (Lower = 1e-6);
142       
143        delHUtilQuente(NUtilQuente) as enth_mass ;
144        delHUtilFria(NUtilFria) as enth_mass;
145       
146        QH(NUtilQuente) as power (Brief = "Heat demand for each hot utility");
147        QC(NUtilFria) as power (Brief = "Heat demand for each cold utility");
148        QH_total as power;
149        QC_total as power;
150       
151        DTmin as Real (Unit =  'K', Default = 10);
152       
153        heat_trans_corr(NCorrentes + NCorrentesInt) as heat_trans_coeff ;
154        heat_trans_hot(NUtilQuente) as heat_trans_coeff ;
155        heat_trans_cold(NUtilFria) as heat_trans_coeff ;
156       
157        Area_HEN                as positive (Unit = 'm^2');
158        N_Troca                 as positive;
159        Area_HEN_med    as positive (Unit = 'm^2');
160       
161        EQUATIONS
162        "Global molar balance (Fluid)"
163        Inlet(1:NCorrentes).Fluid.F = Outlet(1:NCorrentes).Fluid.F;
164       
165        "Global molar balance (Solid)"
166        Inlet(1:NCorrentes).Solid.F = Outlet(1:NCorrentes).Solid.F;
167       
168        "Composition of fluid phase"
169        Inlet(1:NCorrentes).Fluid.z = Outlet(1:NCorrentes).Fluid.z;
170       
171        "Composition of solid phase"
172        Inlet(1:NCorrentes).Solid.z = Outlet(1:NCorrentes).Solid.z;
173       
174        "Mechanical equilibrium 1"
175        Inlet(1:NCorrentes).P = Outlet(1:NCorrentes).P;
176       
177        "Phase equilibrium 1"
178        Inlet(1:NCorrentes).v = Outlet(1:NCorrentes).v;
179       
180        #"Outlet molar enthalpy"
181        for i in 1:NCorrentes do
182                Outlet(i).Solid.h = PPS.VapourEnthalpy(Outlet(i).T, Outlet(i).P, Outlet(i).Solid.z);
183                if Outlet(i).v equal 1 then
184                        Outlet(i).Fluid.h = PP.VapourEnthalpy(Outlet(i).T, Outlet(i).P, Outlet(i).Fluid.z);
185                else
186                        Outlet(i).Fluid.h = PP.LiquidEnthalpy(Outlet(i).T, Outlet(i).P, Outlet(i).Fluid.z);
187                end
188        end
189       
190        #"Pinch information streams"
191        for i in 1:NCorrentes do
192                H(i)    = Inlet(i).Fluid.F * (Outlet(i).Fluid.h - Inlet(i).Fluid.h) + Inlet(i).Solid.F * (Outlet(i).Solid.h - Inlet(i).Solid.h);
193                Tin(i)  = Inlet(i).T;
194                Tout(i) = Outlet(i).T;
195        end
196
197        #"Pinch information streams 2"
198        for i in 1:NCorrentesInt do
199                H(i+NCorrentes)    = Inlet_Int(i).Q;
200                if Inlet_Int(i).Q < 0 * 'kW' then
201                        Tin(i+NCorrentes)  = Inlet_Int(i).T;
202                        Tout(i+NCorrentes) = Inlet_Int(i).T - 1 * 'K';
203                else
204                        Tin(i+NCorrentes)  = Inlet_Int(i).T;
205                        Tout(i+NCorrentes) = Inlet_Int(i).T + 1 * 'K';
206                end
207        end
208
209        "Global mass balance (Hot utilities)"
210        Inlet_q(1:NUtilQuente).Fw = Outlet_q(1:NUtilQuente).Fw;
211       
212        "Mechanical equilibrium 1"
213        Inlet_q(1:NUtilQuente).P  = Outlet_q(1:NUtilQuente).P;
214       
215        "Liquid saturated"
216        Outlet_q(1:NUtilQuente).v = 0;
217       
218        "Global mass balance (Cold utilities)"
219        Inlet_f(1:NUtilFria).Fw   = Outlet_f(1:NUtilFria).Fw;
220       
221        "Mechanical equilibrium 1"     
222        Inlet_f(1:NUtilFria).P    = Outlet_f(1:NUtilFria).P;
223
224        "Phase equilibrium 2"   
225        Inlet_f(1:NUtilFria).v    = Outlet_f(1:NUtilFria).v;   
226
227        #"Entropy and enthalpy of condensed hot utilities"
228        for i in 1:NUtilQuente do
229                Outlet_q(i).T = propterm.Tsat(Outlet_q(i).P);
230                [Outlet_q(i).S , Outlet_q(i).H] = propterm.propPTl(Inlet_q(i).P, propterm.Tsat(Inlet_q(i).P));
231        end
232       
233        #"Entropy and enthalpy of cold utilities"
234        for i in 1:NUtilFria do
235                [Outlet_f(i).S , Outlet_f(i).H] = propterm.propPTl(Outlet_f(i).P, Outlet_f(i).T);
236        end
237       
238        "Required enthapy 1"
239        delHUtilQuente = Outlet_q.H - Inlet_q.H;
240       
241        "Required enthapy 2"
242        delHUtilFria = Outlet_f.H - Inlet_f.H;
243       
244        "Hot utilities demand"
245        QH = -delHUtilQuente * Outlet_q.Fw;
246       
247        "Cold utilities demand"
248        QC = delHUtilFria * Outlet_f.Fw;
249       
250        #"plug-in arguments"
251        switch method
252                case "U":
253                        [QH,QC,TPinch,QH_total,QC_total, Area_HEN,N_Troca] = Pinch.pinch_method_U(DTmin,Tin,Tout,H,Inlet_q.T,Inlet_f.T, Outlet_f.T, U);
254                case "h":
255                        [QH,QC,TPinch,QH_total,QC_total, Area_HEN, N_Troca] = Pinch.pinch_method_h(DTmin,Tin,Tout,H,Inlet_q.T,Inlet_f.T, Outlet_f.T, heat_trans_corr, heat_trans_hot, heat_trans_cold);
256        end
257       
258        "Mean HEN area"
259        Area_HEN_med * N_Troca = Area_HEN;
260end
261
262# Modelo para sistemas sem interpolador
263Model PinchPointN
264       
265        ATTRIBUTES
266        Pallete = false;
267        Brief = "Integracao energetica atraves do pinch sem interpolador";
268        Info =
269
270"== GENERAL ==
271        Integracao de correntes energeticas para otimizacao de
272    troca energetica entre porcessos
273        == ASSUMPTIONS ==
274
275        * No heat loss to the environment;
276        * Steady-state;
277        * There is no phase change.
278
279        == SPECIFY ==
280        * Inlet main stream:
281          flow rate
282          temperature
283          pressure
284          stream composition
285          heat_trans_corr
286        * The cold water steam stream:
287          temperature
288          pressure
289          heat_trans_cold;
290        * The vapour steam stream:
291          pressure
292          vapourization fraction
293          heat_trans_hot;
294        * The heat steam stream:
295          heat_trans_corr;
296        * Minimum approach temperature (DTmin);
297        * Outlet Temperature of:
298          main stream
299          cold water steam stream
300          heat steam stream,
301
302        == SET ==
303        * Phase of the stream feed;
304        * Number of stream components(Ncomp/NcompS);
305        * Define type of method for area calculation by Switcher, U or h, Default = h ;
306        * Basic composition (mass or molar).
307";
308        PARAMETERS
309outer   Pinch   as Plugin (Type = "Pinch");
310outer   PP              as Plugin (Brief = "External Physical Properties (Fluid Phase)", Type="PP");
311outer   PPS     as Plugin (Brief = "External Physical Properties (Solid Phase)", Type="PP");
312
313        propterm as Plugin (Type = "water");
314        method  as Switcher     (Brief="Type of method",Valid=["U","h"],Default="h");
315       
316        NCorrentes as Integer (Default = 11); #numero de correntes de processo que necessitam trocar calor
317       
318        NUtilQuente as Integer(Default = 3); #Numero de utilidades quentes (vapor de alta, media e baixa)
319        NUtilFria as Integer(Default = 1); #Numero de utilidades frias , agua de resfriamento
320
321        U as heat_trans_coeff (Default = 0.69445);
322       
323        VARIABLES
324in      Inlet(NCorrentes)  as main_stream;
325out     Outlet(NCorrentes) as main_stream;
326
327
328in  Inlet_q(NUtilQuente)  as water_stream;
329out Outlet_q(NUtilQuente) as water_stream;
330
331in  Inlet_f(NUtilFria)  as water_stream;
332out Outlet_f(NUtilFria) as water_stream;
333
334        H(NCorrentes) as power;
335       
336        Tin(NCorrentes) as temperature;
337        Tout(NCorrentes) as temperature;
338       
339        TPinch as temperature (Lower = 1e-6);
340       
341        delHUtilQuente(NUtilQuente) as enth_mass ;
342        delHUtilFria(NUtilFria) as enth_mass;
343       
344        QH(NUtilQuente) as power (Brief = "Heat demand for each hot utility");
345        QC(NUtilFria) as power (Brief = "Heat demand for each cold utility");
346        QH_total as power;
347        QC_total as power;
348       
349        DTmin as Real (Unit =  'K', Default = 10);
350       
351        heat_trans_corr(NCorrentes) as heat_trans_coeff ;
352        heat_trans_hot(NUtilQuente) as heat_trans_coeff ;
353        heat_trans_cold(NUtilFria) as heat_trans_coeff ;
354       
355        Area_HEN                as positive (Unit = 'm^2');
356        N_Troca                 as positive;
357        Area_HEN_med    as positive (Unit = 'm^2');
358       
359        EQUATIONS
360        "Global molar balance (Fluid)"
361        Inlet(1:NCorrentes).Fluid.F = Outlet(1:NCorrentes).Fluid.F;
362       
363        "Global molar balance (Solid)"
364        Inlet(1:NCorrentes).Solid.F = Outlet(1:NCorrentes).Solid.F;
365       
366        "Composition of fluid phase"
367        Inlet(1:NCorrentes).Fluid.z = Outlet(1:NCorrentes).Fluid.z;
368       
369        "Composition of solid phase"
370        Inlet(1:NCorrentes).Solid.z = Outlet(1:NCorrentes).Solid.z;
371       
372        "Mechanical equilibrium 1"
373        Inlet(1:NCorrentes).P = Outlet(1:NCorrentes).P;
374       
375        "Phase equilibrium 1"
376        Inlet(1:NCorrentes).v = Outlet(1:NCorrentes).v;
377       
378        #"Outlet molar enthalpy"
379        for i in 1:NCorrentes do
380                if Outlet(i).v equal 1 then
381                        Outlet(i).Fluid.h = PP.VapourEnthalpy(Outlet(i).T, Outlet(i).P, Outlet(i).Fluid.z);
382                else
383                        Outlet(i).Fluid.h = PP.LiquidEnthalpy(Outlet(i).T, Outlet(i).P, Outlet(i).Fluid.z);
384                end
385                Outlet(i).Solid.h = PPS.VapourEnthalpy(Outlet(i).T, Outlet(i).P, Outlet(i).Solid.z);   
386        end
387       
388        #"Pinch information streams"
389        for i in 1:NCorrentes do
390                H(i)    = Inlet(i).Fluid.F * (Outlet(i).Fluid.h - Inlet(i).Fluid.h) + Inlet(i).Solid.F * (Outlet(i).Solid.h - Inlet(i).Solid.h);
391                Tin(i)  = Inlet(i).T;
392                Tout(i) = Outlet(i).T;
393        end
394
395        "Global mass balance (Hot utilities)"
396        Inlet_q(1:NUtilQuente).Fw = Outlet_q(1:NUtilQuente).Fw;
397       
398        "Mechanical equilibrium 1"
399        Inlet_q(1:NUtilQuente).P  = Outlet_q(1:NUtilQuente).P;
400       
401        "Liquid saturated"
402        Outlet_q(1:NUtilQuente).v = 0;
403       
404        "Global mass balance (Cold utilities)"
405        Inlet_f(1:NUtilFria).Fw   = Outlet_f(1:NUtilFria).Fw;
406       
407        "Mechanical equilibrium 1"     
408        Inlet_f(1:NUtilFria).P    = Outlet_f(1:NUtilFria).P;
409
410        "Phase equilibrium 2"   
411        Inlet_f(1:NUtilFria).v    = Outlet_f(1:NUtilFria).v;   
412
413        #"Entropy and enthalpy of condensed hot utilities"
414        for i in 1:NUtilQuente do
415                Outlet_q(i).T = propterm.Tsat(Outlet_q(i).P);
416                [Outlet_q(i).S , Outlet_q(i).H] = propterm.propPTl(Inlet_q(i).P, propterm.Tsat(Inlet_q(i).P));
417        end
418       
419        #"Entropy and enthalpy of cold utilities"
420        for i in 1:NUtilFria do
421                [Outlet_f(i).S , Outlet_f(i).H] = propterm.propPTl(Outlet_f(i).P, Outlet_f(i).T);
422        end
423       
424        "Required enthapy 1"
425        delHUtilQuente = Outlet_q.H - Inlet_q.H;
426       
427        "Required enthapy 2"
428        delHUtilFria = Outlet_f.H - Inlet_f.H;
429       
430        "Hot utilities demand"
431        QH = -delHUtilQuente * Outlet_q.Fw;
432       
433        "Cold utilities demand"
434        QC = delHUtilFria * Outlet_f.Fw;
435       
436        #"plug-in arguments"
437        switch method
438                case "U":
439                        [QH,QC,TPinch,QH_total,QC_total, Area_HEN,N_Troca] = Pinch.pinch_method_U(DTmin,Tin,Tout,H,Inlet_q.T,Inlet_f.T, Outlet_f.T, U);
440                case "h":
441                        [QH,QC,TPinch,QH_total,QC_total, Area_HEN, N_Troca] = Pinch.pinch_method_h(DTmin,Tin,Tout,H,Inlet_q.T,Inlet_f.T, Outlet_f.T, heat_trans_corr, heat_trans_hot, heat_trans_cold);
442        end
443       
444        "Mean HEN area"
445        Area_HEN_med * N_Troca = Area_HEN;
446end
447
448
449Model TAC_HEN
450       
451        ATTRIBUTES
452        Pallete = false;
453        Brief = "HEN CAPEX";
454        Info =
455        "== GENERAL ==
456        * Calculation of the annual energy demand of the pinch model
457
458        == SPECIFY ==
459        * number of utilities(num_util);
460        * Energy demand of Cold utility;
461        * Energy demand of Hot utility;
462        * area cost exponent.
463
464        == SET ==
465        * Number of stream components(Ncomp/NcompS);
466        * Annual fixed cost coefficient for heat exchangers;
467        * Annual variable cost coefficient for heat exchangers;
468        * Annualized cost of steam per energy unit(Cost_Hot_Util);
469        * Annualized cost of steam per energy unit(Cost_Cold_Util);
470        ";
471       
472        PARAMETERS
473        a_annu as Real (Brief = "Annual fixed cost coefficient for heat exchangers", Unit = 'US$/yr');
474        b_annu as Real (Brief = "Annual variable cost coefficient for heat exchangers", Unit = 'US$/(m^1.56)/yr');
475        c_annu as Real (Brief = "area cost exponent");
476        Cost_Hot_Util as Real (Brief = "Annualized cost of steam per energy unit", Unit =  'US$/kW/yr');
477        Cost_Cold_Util as Real (Brief = "Annualized cost of steam per energy unit", Unit =  'US$/kW/yr');
478       
479        VARIABLES
480        Demand_Hot as power (Brief = "Energy demand of Hot utility");
481        Demand_Cold as power (Brief = "Energy demand of Cold utility");
482        Area_HEN as Real (Lower = 1e-6, Unit = 'm^2');
483        capex_HEN as Real (Brief= "Annualized installed Capital Cost of Exchanger", Unit = 'US$/yr');
484        Opex_Hot as Real (Brief= "Annualized operational expendure of hot utilities", Unit = 'US$/yr');
485        Opex_Cold as Real (Brief= "Annualized operational expendure of cold utilities", Unit = 'US$/yr');
486        opex_HEN as Real (Unit = 'US$/yr');
487        tac_HEN as Real (Brief= "Total Annualized Costs of HEN", Unit = 'US$/yr');
488        num_util as Integer;
489       
490        EQUATIONS
491        "Installed Capital Cost of Exchanger"
492                capex_HEN = num_util* (a_annu + b_annu * ((Area_HEN ^ 0.78)/num_util));
493       
494        "Operational Expendures"
495                Opex_Cold =  Demand_Cold * Cost_Cold_Util;
496                Opex_Hot =  Demand_Hot * Cost_Hot_Util;
497                opex_HEN = Opex_Hot + Opex_Cold ;
498       
499        " Total annualized Costs "
500                tac_HEN = capex_HEN + opex_HEN;
501       
502end
503
504FlowSheet Teste_PinchInt
505        PARAMETERS
506        PP as Plugin    (Brief = "External Physical Properties",
507                Type="PP",
508                Project = "../Flowsheets/v2_2/Fluid_v2_2.vrtherm"
509        );
510        PPS as Plugin   (Brief = "External Physical Properties",
511                Type="PP",
512                Project = "../Flowsheets/v2_2/Solid_v2_2.vrtherm"
513        );
514       
515        # o numCorrentes eh a soma das correntes de processo + correntes "do interpolador"
516        Pinch as Plugin (Type = "Pinch", numCorrentes = 6, numUtilQuente = 3, numUtilFria = 1);
517       
518        NComp as Integer;
519        NCompS as Integer;
520
521        DEVICES
522        #fonte de agua de resfriamento
523        SS101 as water_sourceR;
524       
525        #fonte de vapor
526        SS102 as water_sourceR;
527        SS103 as water_sourceR;
528        SS104 as water_sourceR;
529       
530        #fontes representando correntes de processo
531        mS101 as main_sourceR;
532        mS102 as main_sourceR;
533        mS103 as main_sourceR;
534       
535        #Fonte representando correntes que entram ou saem do interpolador
536        INT101 as heat_source_int;
537        INT102 as heat_source_int;
538        INT103 as heat_source_int;     
539       
540        #modelo que faz a integracao energetica
541        PinchPoint as PinchPointInt;
542       
543        CONNECTIONS
544        SS101.Outlet to PinchPoint.Inlet_f(1);
545       
546        SS102.Outlet to PinchPoint.Inlet_q(1);
547        SS103.Outlet to PinchPoint.Inlet_q(2);
548        SS104.Outlet to PinchPoint.Inlet_q(3);
549       
550        mS101.Outlet to PinchPoint.Inlet(1);
551        mS102.Outlet to PinchPoint.Inlet(2);
552        mS103.Outlet to PinchPoint.Inlet(3);
553       
554        INT101.Outlet to PinchPoint.Inlet_Int(1);
555        INT102.Outlet to PinchPoint.Inlet_Int(2);
556        INT103.Outlet to PinchPoint.Inlet_Int(3);
557       
558        SET
559        SS101.ValidPhases = "Liquid-Only";
560       
561        SS102.ValidPhases = "Vapour-Liquid";
562        SS103.ValidPhases = "Vapour-Liquid";
563        SS104.ValidPhases = "Vapour-Liquid";
564       
565        mS101.CompositionBasis = "Molar";
566        mS102.CompositionBasis = "Molar";
567        mS103.CompositionBasis = "Molar";
568       
569        NComp = PP.NumberOfComponents();
570        NCompS = PPS.NumberOfComponents();
571       
572        PinchPoint.NCorrentes = 3 ; #numero de correntes de processo que necessitam trocar calor
573        PinchPoint.NCorrentesInt = 3; #numero de correntes que entram ou saem do interpolador
574       
575        PinchPoint.U = 0.69445 * 'kW/m^2/K';#coeficiente global de troca termica
576
577        SPECIFY
578        #temperatura minima de aproximacao
579        PinchPoint.DTmin = 20 *'K';
580       
581        #agua de resfriamento
582        SS101.T = 303.15 * 'K';
583        SS101.P = 1 * 'bar';
584        PinchPoint.Outlet_f(1).T = 333.15 * 'K';
585        PinchPoint.heat_trans_cold(1) = 1.38 * 'kW/m^2/K';
586       
587        #vapor de baixa
588        SS102.P = 2.5 * 'bar';
589        SS102.v = 1;
590        PinchPoint.heat_trans_hot(1) = 1.38 * 'kW/m^2/K' ;
591       
592        #vapor de media
593        SS103.P = 6 * 'bar';
594        SS103.v = 1;
595        PinchPoint.heat_trans_hot(2)= 1.38 * 'kW/m^2/K';
596       
597        #vapor de alta
598        SS104.P = 17.5 * 'bar';
599        SS104.v = 1;
600        PinchPoint.heat_trans_hot(3) = 1.38 * 'kW/m^2/K';
601       
602        #corrente de processo
603        mS101.Fluid.Fw = 700 * 'kg/h';
604        mS101.Solid.Fw = 10 * 'kg/h';
605        mS101.T = 300 * 'K';
606        mS101.P= 1 * 'atm';
607        mS101.CompositionOfSolid(1) = 0.4;
608        mS101.CompositionOfSolid(2) = 0.3;
609        mS101.CompositionOfSolid(3) = 0.28;
610        mS101.CompositionOfSolid(4) = 0.02;
611        mS101.CompositionOfSolid(5:NCompS) = 0;
612        mS101.CompositionOfFluid(1) = 0.9;
613        mS101.CompositionOfFluid(2) = 0.08;
614        mS101.CompositionOfFluid(3) = 0.02;
615        mS101.CompositionOfFluid(4:NComp) = 0;
616        PinchPoint.Outlet(1).T = 400 * 'K';#temperatura final da corrente
617        PinchPoint.heat_trans_corr(1) = 1.38 * 'kW/m^2/K';
618       
619        #corrente de processo
620        mS102.Fluid.Fw = 200 * 'kg/h';
621        mS102.Solid.Fw = 20 * 'kg/h';
622        mS102.T = 350 * 'K';
623        mS102.P = 1 * 'atm';
624        mS102.CompositionOfSolid(1) = 0.4;
625        mS102.CompositionOfSolid(2) = 0.3;
626        mS102.CompositionOfSolid(3) = 0.28;
627        mS102.CompositionOfSolid(4) = 0.02;
628        mS102.CompositionOfSolid(5:NCompS) = 0;
629        mS102.CompositionOfFluid(1) = 0.9;
630        mS102.CompositionOfFluid(2) = 0.08;
631        mS102.CompositionOfFluid(3) = 0.02;
632        mS102.CompositionOfFluid(4:NComp) = 0;
633        PinchPoint.Outlet(2).T = 450 * 'K'; #temperatura final da corrente
634        PinchPoint.heat_trans_corr(2) = 1.38 * 'kW/m^2/K';
635       
636        #corrente de processo
637        mS103.Fluid.Fw = 500 * 'kg/h';
638        mS103.Solid.Fw = 50 * 'kg/h';
639        mS103.T = 500 * 'K';
640        mS103.P = 1 * 'atm';
641        mS103.CompositionOfSolid(1) = 0.4;
642        mS103.CompositionOfSolid(2) = 0.3;
643        mS103.CompositionOfSolid(3) = 0.28;
644        mS103.CompositionOfSolid(4) = 0.02;
645        mS103.CompositionOfSolid(5:NCompS) = 0;
646        mS103.CompositionOfFluid(1) = 0.9;
647        mS103.CompositionOfFluid(2) = 0.08;
648        mS103.CompositionOfFluid(3) = 0.02;
649        mS103.CompositionOfFluid(4:NComp) = 0;
650        PinchPoint.Outlet(3).T = 350 * 'K'; #temperatura final da corrente
651        PinchPoint.heat_trans_corr(3) = 1.38  * 'kW/m^2/K';
652       
653        #correntes que entram ou saem do interpolador. Apenas informacoes de energia (Q e T)
654        INT101.Outlet.T = 385.0 * 'K';
655        INT102.Outlet.T = 381.5 * 'K';
656        INT103.Outlet.T = 358.5 * 'K';
657       
658        INT101.Outlet.Q =  9484.7 * 'kW';
659        INT102.Outlet.Q =  2280.4 * 'kW';
660        INT103.Outlet.Q = -1601.0 * 'kW';
661       
662        PinchPoint.heat_trans_corr(4) = 1.38  * 'kW/m^2/K';
663        PinchPoint.heat_trans_corr(5) = 1.38  * 'kW/m^2/K';
664        PinchPoint.heat_trans_corr(6) = 1.38  * 'kW/m^2/K';
665       
666        OPTIONS
667        Dynamic = false;
668       
669end
670
671FlowSheet Teste_PinchN
672        PARAMETERS
673        PP as Plugin    (Brief = "External Physical Properties",
674                Type="PP",
675                Project = "../Flowsheets/v2_2/Fluid_v2_2.vrtherm"
676        );
677        PPS as Plugin   (Brief = "External Physical Properties",
678                Type="PP",
679                Project = "../Flowsheets/v2_2/Solid_v2_2.vrtherm"
680        );
681       
682        # o numCorrentes eh a soma das correntes de processo + correntes "do interpolador"
683        Pinch as Plugin (Type = "Pinch", numCorrentes = 3, numUtilQuente = 3, numUtilFria = 1);
684       
685        NComp as Integer;
686        NCompS as Integer;
687
688        DEVICES
689        #fonte de agua de resfriamento
690        SS101 as water_sourceR;
691       
692        #fonte de vapor
693        SS102 as water_sourceR;
694        SS103 as water_sourceR;
695        SS104 as water_sourceR;
696       
697        #fontes representando correntes de processo
698        mS101 as main_sourceR;
699        mS102 as main_sourceR;
700        mS103 as main_sourceR;
701       
702        #modelo que faz a integracao energetica
703        PinchPoint as PinchPointN;
704       
705        CONNECTIONS
706        SS101.Outlet to PinchPoint.Inlet_f(1);
707       
708        SS102.Outlet to PinchPoint.Inlet_q(1);
709        SS103.Outlet to PinchPoint.Inlet_q(2);
710        SS104.Outlet to PinchPoint.Inlet_q(3);
711       
712        mS101.Outlet to PinchPoint.Inlet(1);
713        mS102.Outlet to PinchPoint.Inlet(2);
714        mS103.Outlet to PinchPoint.Inlet(3);
715       
716        SET
717        SS101.ValidPhases = "Liquid-Only";
718       
719        SS102.ValidPhases = "Vapour-Liquid";
720        SS103.ValidPhases = "Vapour-Liquid";
721        SS104.ValidPhases = "Vapour-Liquid";
722       
723        mS101.CompositionBasis = "Molar";
724        mS102.CompositionBasis = "Molar";
725        mS103.CompositionBasis = "Molar";
726       
727        NComp = PP.NumberOfComponents();
728        NCompS = PPS.NumberOfComponents();
729       
730        PinchPoint.NCorrentes = 3 ; #numero de correntes de processo que necessitam trocar calor
731               
732        PinchPoint.U = 0.69445 * 'kW/m^2/K';#coeficiente global de troca termica
733
734        SPECIFY
735        #temperatura minima de aproximacao
736        PinchPoint.DTmin = 20 *'K';
737       
738        #agua de resfriamento
739        SS101.T = 303.15 * 'K';
740        SS101.P = 1 * 'bar';
741        PinchPoint.Outlet_f(1).T = 333.15 * 'K';
742        PinchPoint.heat_trans_cold(1) = 1.38 * 'kW/m^2/K';
743       
744        #vapor de baixa
745        SS102.P = 2.5 * 'bar';
746        SS102.v = 1;
747        PinchPoint.heat_trans_hot(1) = 1.38 * 'kW/m^2/K' ;
748       
749        #vapor de media
750        SS103.P = 6 * 'bar';
751        SS103.v = 1;
752        PinchPoint.heat_trans_hot(2)= 1.38 * 'kW/m^2/K';
753       
754        #vapor de alta
755        SS104.P = 17.5 * 'bar';
756        SS104.v = 1;
757        PinchPoint.heat_trans_hot(3) = 1.38 * 'kW/m^2/K';
758       
759        #corrente de processo
760        mS101.Fluid.Fw = 700 * 'kg/h';
761        mS101.Solid.Fw = 10 * 'kg/h';
762        mS101.T = 300 * 'K';
763        mS101.P= 1 * 'atm';
764        mS101.CompositionOfSolid(1) = 0.4;
765        mS101.CompositionOfSolid(2) = 0.3;
766        mS101.CompositionOfSolid(3) = 0.28;
767        mS101.CompositionOfSolid(4) = 0.02;
768        mS101.CompositionOfSolid(5:NCompS) = 0;
769        mS101.CompositionOfFluid(1) = 0.9;
770        mS101.CompositionOfFluid(2) = 0.08;
771        mS101.CompositionOfFluid(3) = 0.02;
772        mS101.CompositionOfFluid(4:NComp) = 0;
773        PinchPoint.Outlet(1).T = 400 * 'K';#temperatura final da corrente
774        PinchPoint.heat_trans_corr(1) = 1.38 * 'kW/m^2/K';
775       
776        #corrente de processo
777        mS102.Fluid.Fw = 200 * 'kg/h';
778        mS102.Solid.Fw = 20 * 'kg/h';
779        mS102.T = 350 * 'K';
780        mS102.P = 1 * 'atm';
781        mS102.CompositionOfSolid(1) = 0.4;
782        mS102.CompositionOfSolid(2) = 0.3;
783        mS102.CompositionOfSolid(3) = 0.28;
784        mS102.CompositionOfSolid(4) = 0.02;
785        mS102.CompositionOfSolid(5:NCompS) = 0;
786        mS102.CompositionOfFluid(1) = 0.9;
787        mS102.CompositionOfFluid(2) = 0.08;
788        mS102.CompositionOfFluid(3) = 0.02;
789        mS102.CompositionOfFluid(4:NComp) = 0;
790        PinchPoint.Outlet(2).T = 450 * 'K'; #temperatura final da corrente
791        PinchPoint.heat_trans_corr(2) = 1.38 * 'kW/m^2/K';
792       
793        #corrente de processo
794        mS103.Fluid.Fw = 500 * 'kg/h';
795        mS103.Solid.Fw = 50 * 'kg/h';
796        mS103.T = 500 * 'K';
797        mS103.P = 1 * 'atm';
798        mS103.CompositionOfSolid(1) = 0.4;
799        mS103.CompositionOfSolid(2) = 0.3;
800        mS103.CompositionOfSolid(3) = 0.28;
801        mS103.CompositionOfSolid(4) = 0.02;
802        mS103.CompositionOfSolid(5:NCompS) = 0;
803        mS103.CompositionOfFluid(1) = 0.9;
804        mS103.CompositionOfFluid(2) = 0.08;
805        mS103.CompositionOfFluid(3) = 0.02;
806        mS103.CompositionOfFluid(4:NComp) = 0;
807        PinchPoint.Outlet(3).T = 350 * 'K'; #temperatura final da corrente
808        PinchPoint.heat_trans_corr(3) = 1.38  * 'kW/m^2/K';
809       
810       
811        OPTIONS
812        Dynamic = false;
813       
814end
815
816FlowSheet Teste_Pinch_TAC
817        PARAMETERS
818        PP as Plugin    (Brief = "External Physical Properties",
819                Type="PP",
820                Project = "../Flowsheets/v2_2/Fluid_v2_2.vrtherm"
821        );
822        PPS as Plugin   (Brief = "External Physical Properties",
823                Type="PP",
824                Project = "../Flowsheets/v2_2/Solid_v2_2.vrtherm"
825        );
826       
827        # o numCorrentes eh a soma das correntes de processo + correntes "do interpolador"
828        Pinch as Plugin (Type = "Pinch", numCorrentes = 6, numUtilQuente = 3, numUtilFria = 1);
829       
830        NComp as Integer;
831        NCompS as Integer;
832       
833        DEVICES
834        #fonte de agua de resfriamento
835        SS101 as water_sourceR;
836       
837        #fonte de vapor
838        SS102 as water_sourceR;
839        SS103 as water_sourceR;
840        SS104 as water_sourceR;
841       
842        #fontes representando correntes de processo
843        mS101 as main_sourceR;
844        mS102 as main_sourceR;
845        mS103 as main_sourceR;
846       
847        #Fonte representando correntes que entram ou saem do interpolador
848        INT101 as heat_source_int;
849        INT102 as heat_source_int;
850        INT103 as heat_source_int;     
851       
852        #modelo que faz a integracao energetica
853        PinchPoint as PinchPointInt;
854       
855        #Analise economica
856        TAC_HEN as TAC_HEN;
857       
858        CONNECTIONS
859        SS101.Outlet to PinchPoint.Inlet_f(1);
860       
861        SS102.Outlet to PinchPoint.Inlet_q(1);
862        SS103.Outlet to PinchPoint.Inlet_q(2);
863        SS104.Outlet to PinchPoint.Inlet_q(3);
864       
865        mS101.Outlet to PinchPoint.Inlet(1);
866        mS102.Outlet to PinchPoint.Inlet(2);
867        mS103.Outlet to PinchPoint.Inlet(3);
868       
869        INT101.Outlet to PinchPoint.Inlet_Int(1);
870        INT102.Outlet to PinchPoint.Inlet_Int(2);
871        INT103.Outlet to PinchPoint.Inlet_Int(3);
872       
873        SET
874        SS101.ValidPhases = "Liquid-Only";
875       
876        SS102.ValidPhases = "Vapour-Liquid";
877        SS103.ValidPhases = "Vapour-Liquid";
878        SS104.ValidPhases = "Vapour-Liquid";
879       
880        mS101.CompositionBasis = "Molar";
881        mS102.CompositionBasis = "Molar";
882        mS103.CompositionBasis = "Molar";
883       
884        NComp = PP.NumberOfComponents();
885        NCompS = PPS.NumberOfComponents();
886       
887        PinchPoint.NCorrentes = 3 ; #numero de correntes de processo que necessitam trocar calor
888        PinchPoint.NCorrentesInt = 3; #numero de correntes que entram ou saem do interpolador
889        PinchPoint.NUtilQuente = 3;#numero de Utilidades quentes
890        PinchPoint.NUtilFria = 1; # Numero de utilidades frias
891       
892        PinchPoint.U = 0.69445 * 'kW/m^2/K';#coeficiente global de troca termica       
893
894        #Analise economica
895        TAC_HEN.a_annu = 4897 * 'US$/yr';
896        TAC_HEN.b_annu = 33.0 * 'US$/(m^1.56)/yr';
897        TAC_HEN.c_annu = 0.78;
898        TAC_HEN.Cost_Hot_Util = 96 * 'US$/kW/yr';
899        TAC_HEN.Cost_Cold_Util = 50 * 'US$/kW/yr';
900       
901        SPECIFY
902       
903        PinchPoint.DTmin = 20 *'K';
904        #agua de resfriamento
905        SS101.T = 303.15 * 'K';
906        SS101.P = 1 * 'bar';
907        PinchPoint.Outlet_f(1).T = 333.15 * 'K';
908        PinchPoint.heat_trans_cold(1) = 1.38 * 'kW/m^2/K';
909       
910        #vapor de baixa
911        SS102.P = 2.5 * 'bar';
912        SS102.v = 1;
913        PinchPoint.heat_trans_hot(1) = 1.38 * 'kW/m^2/K' ;
914       
915        #vapor de media
916        SS103.P = 6 * 'bar';
917        SS103.v = 1;
918        PinchPoint.heat_trans_hot(2)= 1.38 * 'kW/m^2/K';
919       
920        #vapor de alta
921        SS104.P = 17.5 * 'bar';
922        SS104.v = 1;
923        PinchPoint.heat_trans_hot(3) = 1.38 * 'kW/m^2/K';
924       
925        #corrente de processo
926        mS101.Fluid.Fw = 700 * 'kg/h';
927        mS101.Solid.Fw = 10 * 'kg/h';
928        mS101.T = 300 * 'K';
929        mS101.P= 1 * 'atm';
930        mS101.CompositionOfSolid(1) = 0.4;
931        mS101.CompositionOfSolid(2) = 0.3;
932        mS101.CompositionOfSolid(3) = 0.28;
933        mS101.CompositionOfSolid(4) = 0.02;
934        mS101.CompositionOfSolid(5:NCompS) = 0;
935        mS101.CompositionOfFluid(1) = 0.9;
936        mS101.CompositionOfFluid(2) = 0.08;
937        mS101.CompositionOfFluid(3) = 0.02;
938        mS101.CompositionOfFluid(4:NComp) = 0;
939        PinchPoint.Outlet(1).T = 400 * 'K';#temperatura final da corrente
940        PinchPoint.heat_trans_corr(1) = 1.38 * 'kW/m^2/K';
941       
942        #corrente de processo
943        mS102.Fluid.Fw = 200 * 'kg/h';
944        mS102.Solid.Fw = 20 * 'kg/h';
945        mS102.T = 350 * 'K';
946        mS102.P = 1 * 'atm';
947        mS102.CompositionOfSolid(1) = 0.4;
948        mS102.CompositionOfSolid(2) = 0.3;
949        mS102.CompositionOfSolid(3) = 0.28;
950        mS102.CompositionOfSolid(4) = 0.02;
951        mS102.CompositionOfSolid(5:NCompS) = 0;
952        mS102.CompositionOfFluid(1) = 0.9;
953        mS102.CompositionOfFluid(2) = 0.08;
954        mS102.CompositionOfFluid(3) = 0.02;
955        mS102.CompositionOfFluid(4:NComp) = 0;
956        PinchPoint.Outlet(2).T = 450 * 'K'; #temperatura final da corrente
957        PinchPoint.heat_trans_corr(2) = 1.38 * 'kW/m^2/K';
958       
959        #corrente de processo
960        mS103.Fluid.Fw = 500 * 'kg/h';
961        mS103.Solid.Fw = 50 * 'kg/h';
962        mS103.T = 500 * 'K';
963        mS103.P = 1 * 'atm';
964        mS103.CompositionOfSolid(1) = 0.4;
965        mS103.CompositionOfSolid(2) = 0.3;
966        mS103.CompositionOfSolid(3) = 0.28;
967        mS103.CompositionOfSolid(4) = 0.02;
968        mS103.CompositionOfSolid(5:NCompS) = 0;
969        mS103.CompositionOfFluid(1) = 0.9;
970        mS103.CompositionOfFluid(2) = 0.08;
971        mS103.CompositionOfFluid(3) = 0.02;
972        mS103.CompositionOfFluid(4:NComp) = 0;
973        PinchPoint.Outlet(3).T = 350 * 'K'; #temperatura final da corrente
974        PinchPoint.heat_trans_corr(3) = 1.38  * 'kW/m^2/K';
975       
976        #correntes que entram ou saem do interpolador. Apenas informacoes de energia (Q e T)
977        INT101.Outlet.T = 385.0 * 'K';
978        INT102.Outlet.T = 381.5 * 'K';
979        INT103.Outlet.T = 358.5 * 'K';
980       
981        INT101.Outlet.Q =  9484.7 * 'kW';
982        INT102.Outlet.Q =  2280.4 * 'kW';
983        INT103.Outlet.Q = -1601.0 * 'kW';
984       
985        PinchPoint.heat_trans_corr(4) = 1.38  * 'kW/m^2/K';
986        PinchPoint.heat_trans_corr(5) = 1.38  * 'kW/m^2/K';
987        PinchPoint.heat_trans_corr(6) = 1.38  * 'kW/m^2/K';
988       
989        #Analise economica
990        TAC_HEN.Area_HEN        = PinchPoint.Area_HEN;
991        TAC_HEN.Demand_Hot      = 36000 * 'kW';
992        TAC_HEN.Demand_Cold = PinchPoint.QC_total;
993        TAC_HEN.num_util        = PinchPoint.N_Troca;
994       
995        OPTIONS
996        Dynamic = false;
997       
998end
999
1000
Note: See TracBrowser for help on using the repository browser.