source: trunk/BioModel/mixers_and_splitters/mixer_and_splitter_w.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: 19.2 KB
Line 
1#*-------------------------------------------------------------------
2* Biorrefinaria Petrobras
3*--------------------------------------------------------------------
4* Nome do arquivo: mixer_and_splitter_w.mso
5* Projeto: Modelo integrado de producao de etanol 1G/2G
6* Conteudo: misturador e splitter
7*--------------------------------------------------------------------*#
8
9#*-------------------------------------------------------------------
10*
11* Versao 2.2
12* Data:    03/2016
13* Autores:   Anderson R. A. Lino e Gabriel C. Fonseca
14*
15*--------------------------------------------------------------------
16*Descricao: modelo do misturador e do splitter de correntes de agua
17*que serao empregados na biorrefinaria
18*--------------------------------------------------------------------
19
20*--------------------------------------------------------------------
21*Notas: Foi feito o flowsheet teste para averiguar o modelo
22*As siglas R, L, U, D sao indicativos da posisao da corrente de saida
23*sendo R=right, L=legth, U=up e D=down
24*--------------------------------------------------------------------*#
25
26using "water_stream";
27
28Model splitter_wU
29       
30        ATTRIBUTES
31        Pallete         = true;
32        Icon            = "icon/waterStreamD";
33        Brief           = "Splitter With 2 Outlet Streams";
34        Info =
35"== ASSUMPTIONS ==
36* Static;
37* Adiabatic.
38
39== SPEFICY ==
40* The inlet stream:
41  flow rate
42  temperature
43  pressure
44  stream composition
45* The split fraction (Outlet1).
46";
47
48#*-------------------------------------------------------------------
49#Parametros
50*--------------------------------------------------------------------*#
51
52        PARAMETERS
53        propterm as Plugin (Brief = "IAPWS 97 properties of water", Type = "water", Symbol = "{}");
54       
55#*-------------------------------------------------------------------
56* Declaracao de variaveis
57*--------------------------------------------------------------------*#
58
59        VARIABLES
60in  Inlet               as water_stream         (PosX=0.5, PosY=1.0, Symbol="_{in}", Protected = false);
61out Outlet1     as water_stream         (PosX=0.08, PosY=0.0, Symbol="_{out1}", Protected = false);
62out Outlet2     as water_stream         (PosX=0.92, PosY=0.0, Symbol="_{out2}", Protected = false);
63        frac            as fraction             (Brief = "fraction of molar outflow through the Outlet1",Symbol="\alpha");
64       
65#*-------------------------------------------------------------------
66* Equacoes do modelo
67*--------------------------------------------------------------------*#
68       
69        EQUATIONS
70        "Outlet1 Mass Flow"
71        Outlet1.Fw = Inlet.Fw * frac;
72       
73        "Outlet2 Mass Flow"
74        Outlet2.Fw = Inlet.Fw * (1 - frac);
75       
76        "Outlet1 Temperature"
77        Outlet1.T = Inlet.T;
78       
79        "Outlet2 Temperature"
80        Outlet2.T = Inlet.T;
81       
82        "Outlet1 Pressure"
83        Outlet1.P = Inlet.P;
84       
85        "Outlet2 Pressure"
86        Outlet2.P = Inlet.P;
87       
88        "Outlet1 Mass Entropy"
89        Outlet1.S = Inlet.S;
90       
91        "Outlet2 Mass Entropy"
92        Outlet2.S = Inlet.S;
93       
94        "Outlet1 Mass Enthalpy"
95        Outlet1.H = Inlet.H;
96       
97        "Outlet2 Mass Enthalpy"
98        Outlet2.H = Inlet.H;
99       
100        "Outlet1 Vapour Fraction"
101        Outlet1.v = Inlet.v;
102       
103        "Outlet2 Vapour Fraction"
104        Outlet2.v = Inlet.v;
105       
106end
107
108Model splitter_wD
109        ATTRIBUTES
110        Pallete         = true;
111        Icon            = "icon/waterStreamU";
112        Brief           = "Splitter with 2 outlet streams";
113        Info =
114"== ASSUMPTIONS ==
115* Static;
116* Adiabatic.
117
118== SPEFICY ==
119* The inlet stream:
120  flow rate
121  temperature
122  pressure
123  stream composition
124* The split fraction (Outlet1).
125";
126
127#*-------------------------------------------------------------------
128#Parametros
129*--------------------------------------------------------------------*#
130
131        PARAMETERS
132        propterm as Plugin (Brief = "IAPWS 97 properties of water", Type = "water", Symbol = "{}");
133       
134#*-------------------------------------------------------------------
135* Declaracao de variaveis
136*--------------------------------------------------------------------*#
137
138        VARIABLES
139in  Inlet               as water_stream         (PosX=0.5, PosY=1.0, Symbol="_{in}", Protected = false);
140out Outlet1     as water_stream         (PosX=0.08, PosY=0.0, Symbol="_{out1}", Protected = false);
141out Outlet2     as water_stream         (PosX=0.92, PosY=0.0, Symbol="_{out2}", Protected = false);
142        frac            as fraction             (Brief = "fraction of molar outflow through the Outlet1",Symbol="\alpha");
143
144       
145#*-------------------------------------------------------------------
146* Equacoes do modelo
147*--------------------------------------------------------------------*#
148       
149        EQUATIONS
150        "Outlet1 Mass Flow"
151        Outlet1.Fw = Inlet.Fw * frac;
152       
153        "Outlet2 Mass Flow"
154        Outlet2.Fw = Inlet.Fw * (1 - frac);
155       
156        "Outlet1 Temperature"
157        Outlet1.T = Inlet.T;
158       
159        "Outlet2 Temperature"
160        Outlet2.T = Inlet.T;
161       
162        "Outlet1 Pressure"
163        Outlet1.P = Inlet.P;
164       
165        "Outlet2 Pressure"
166        Outlet2.P = Inlet.P;
167       
168        "Outlet1 Mass Entropy"
169        Outlet1.S = Inlet.S;
170       
171        "Outlet2 Mass Entropy"
172        Outlet2.S = Inlet.S;
173       
174        "Outlet1 Mass Enthalpy"
175        Outlet1.H = Inlet.H;
176       
177        "Outlet2 Mass Enthalpy"
178        Outlet2.H = Inlet.H;
179       
180        "Outlet1 Vapour Fraction"
181        Outlet1.v = Inlet.v;
182       
183        "Outlet2 Vapour Fraction"
184        Outlet2.v = Inlet.v;
185       
186end
187
188Model splitter_wL
189       
190        ATTRIBUTES
191        Pallete         = true;
192        Icon            = "icon/waterStreamR";
193        Brief           = "Splitter with 2 outlet streams";
194        Info =
195"== ASSUMPTIONS ==
196* Static;
197* Adiabatic.
198
199== SPEFICY ==
200* The inlet stream:
201  flow rate
202  temperature
203  pressure
204  stream composition
205* The split fraction (Outlet1).
206";
207
208#*-------------------------------------------------------------------
209#Parametros
210*--------------------------------------------------------------------*#
211
212        PARAMETERS
213        propterm as Plugin (Brief = "IAPWS 97 properties of water", Type = "water", Symbol = "{}");
214       
215#*-------------------------------------------------------------------
216* Declaracao de variaveis
217*--------------------------------------------------------------------*#
218
219        VARIABLES
220in  Inlet               as water_stream         (PosX=0.5, PosY=1.0, Symbol="_{in}", Protected = false);
221out Outlet1     as water_stream         (PosX=0.08, PosY=0.0, Symbol="_{out1}", Protected = false);
222out Outlet2     as water_stream         (PosX=0.92, PosY=0.0, Symbol="_{out2}", Protected = false);
223        frac            as fraction             (Brief = "fraction of molar outflow through the Outlet1",Symbol="\alpha");
224       
225#*-------------------------------------------------------------------
226* Equacoes do modelo
227*--------------------------------------------------------------------*#
228       
229        EQUATIONS
230        "Outlet1 Mass Flow"
231        Outlet1.Fw = Inlet.Fw * frac;
232       
233        "Outlet2 Mass Flow"
234        Outlet2.Fw = Inlet.Fw * (1 - frac);
235       
236        "Outlet1 Temperature"
237        Outlet1.T = Inlet.T;
238       
239        "Outlet2 Temperature"
240        Outlet2.T = Inlet.T;
241       
242        "Outlet1 Pressure"
243        Outlet1.P = Inlet.P;
244       
245        "Outlet2 Pressure"
246        Outlet2.P = Inlet.P;
247       
248        "Outlet1 Mass Entropy"
249        Outlet1.S = Inlet.S;
250       
251        "Outlet2 Mass Entropy"
252        Outlet2.S = Inlet.S;
253       
254        "Outlet1 Mass Enthalpy"
255        Outlet1.H = Inlet.H;
256       
257        "Outlet2 Mass Enthalpy"
258        Outlet2.H = Inlet.H;
259       
260        "Outlet1 Vapour Fraction"
261        Outlet1.v = Inlet.v;
262       
263        "Outlet2 Vapour Fraction"
264        Outlet2.v = Inlet.v;
265       
266end
267
268Model splitter_wR
269       
270        ATTRIBUTES
271        Pallete         = true;
272        Icon            = "icon/waterStreamL";
273        Brief           = "Splitter with 2 outlet streams";
274        Info =
275"== ASSUMPTIONS ==
276* Static;
277* Adiabatic.
278
279== SPEFICY ==
280* The inlet stream:
281  flow rate
282  temperature
283  pressure
284  stream composition
285* The split fraction (Outlet1).
286";
287
288#*-------------------------------------------------------------------
289#Parametros
290*--------------------------------------------------------------------*#
291
292        PARAMETERS
293        propterm as Plugin (Brief = "IAPWS 97 properties of water", Type = "water", Symbol = "{}");
294       
295#*-------------------------------------------------------------------
296* Declaracao de variaveis
297*--------------------------------------------------------------------*#
298
299        VARIABLES
300in  Inlet               as water_stream         (PosX=0.5, PosY=1.0, Symbol="_{in}", Protected = false);
301out Outlet1     as water_stream         (PosX=0.08, PosY=0.0, Symbol="_{out1}", Protected = false);
302out Outlet2     as water_stream         (PosX=0.92, PosY=0.0, Symbol="_{out2}", Protected = false);
303        frac            as fraction             (Brief = "fraction of molar outflow through the Outlet1",Symbol="\alpha");     
304#*-------------------------------------------------------------------
305* Equacoes do modelo
306*--------------------------------------------------------------------*#
307       
308        EQUATIONS
309        "Outlet1 Mass Flow"
310        Outlet1.Fw = Inlet.Fw * frac;
311       
312        "Outlet2 Mass Flow"
313        Outlet2.Fw = Inlet.Fw * (1 - frac);
314       
315        "Outlet1 Temperature"
316        Outlet1.T = Inlet.T;
317       
318        "Outlet2 Temperature"
319        Outlet2.T = Inlet.T;
320       
321        "Outlet1 Pressure"
322        Outlet1.P = Inlet.P;
323       
324        "Outlet2 Pressure"
325        Outlet2.P = Inlet.P;
326       
327        "Outlet1 Mass Entropy"
328        Outlet1.S = Inlet.S;
329       
330        "Outlet2 Mass Entropy"
331        Outlet2.S = Inlet.S;
332       
333        "Outlet1 Mass Enthalpy"
334        Outlet1.H = Inlet.H;
335       
336        "Outlet2 Mass Enthalpy"
337        Outlet2.H = Inlet.H;
338       
339        "Outlet1 Vapour Fraction"
340        Outlet1.v = Inlet.v;
341       
342        "Outlet2 Vapour Fraction"
343        Outlet2.v = Inlet.v;
344       
345end
346
347Model mixer_wU
348       
349        ATTRIBUTES
350        Pallete = true;
351        Icon = "icon/waterStreamU";
352        Brief = "Mixer With 2 Inlet Streams";
353        Info =
354"== ASSUMPTIONS ==
355* Static;
356* Adiabatic.
357
358== SPEFICY ==
359* The inlet stream:
360  flow rate
361  temperature
362  pressure
363  stream composition.
364";
365
366#*-------------------------------------------------------------------
367#Parametros
368*--------------------------------------------------------------------*#
369
370        PARAMETERS
371        propterm as Plugin (Brief = "IAPWS 97 properties of water", Type = "water", Symbol = "{}");
372       
373#*-------------------------------------------------------------------
374* Declaracao de variaveis
375*--------------------------------------------------------------------*#
376       
377        VARIABLES
378in      Inlet1          as water_stream         (PosX=0.08, PosY=1.0, Symbol="_{in1}", Protected = false);
379in      Inlet2          as water_stream         (PosX=0.92, PosY=1.0, Symbol="_{in2}", Protected = false);
380out Outlet              as water_stream_eq      (PosX=0.5, PosY=0.0, Symbol="_{out}", Protected = false);
381
382#*-------------------------------------------------------------------
383* Equacoes do modelo
384*--------------------------------------------------------------------*#
385       
386        EQUATIONS
387        "Global Mass Balance"
388        Inlet1.Fw + Inlet2.Fw = Outlet.Fw;
389       
390        "Energy Balance"
391        Inlet1.Fw * Inlet1.H + Inlet2.Fw * Inlet2.H = Outlet.Fw * Outlet.H;
392       
393        "Mechanical Equilibrium, array = [Inlet1.P, Inlet2.P]"
394        Outlet.P = min([Inlet1.P, Inlet2.P]);
395end
396
397Model mixer_wD
398       
399        ATTRIBUTES
400        Pallete = true;
401        Icon = "icon/waterStreamD";
402        Brief = "Mixer With 2 Inlet Streams";
403        Info =
404"== ASSUMPTIONS ==
405* Static;
406* Adiabatic.
407
408== SPEFICY ==
409* The inlet stream:
410  flow rate
411  temperature
412  pressure
413  stream composition.
414
415== SET ==
416* Phase of the fluid entering the mixer;
417";
418
419#*-------------------------------------------------------------------
420#Parametros
421*--------------------------------------------------------------------*#
422
423        PARAMETERS
424        propterm as Plugin (Brief = "IAPWS 97 properties of water", Type = "water", Symbol = "{}");
425       
426#*-------------------------------------------------------------------
427* Declaracao de variaveis
428*--------------------------------------------------------------------*#
429       
430        VARIABLES
431in      Inlet1          as water_stream         (PosX=0.08, PosY=0.0, Symbol="_{in1}", Protected = false);
432in      Inlet2          as water_stream         (PosX=0.92, PosY=0.0, Symbol="_{in2}", Protected = false);
433out Outlet              as water_stream_eq      (PosX=0.5, PosY=1.0, Symbol="_{out}", Protected = false);
434
435#*-------------------------------------------------------------------
436* Equacoes do modelo
437*--------------------------------------------------------------------*#
438       
439        EQUATIONS
440        "Global Mass Balance"
441        Inlet1.Fw + Inlet2.Fw = Outlet.Fw;
442       
443        "Energy Balance"
444        Inlet1.Fw * Inlet1.H + Inlet2.Fw * Inlet2.H = Outlet.Fw * Outlet.H;
445       
446        "Mechanical Equilibrium, array = [Inlet1.P, Inlet2.P]"
447        Outlet.P = min([Inlet1.P, Inlet2.P]);
448end
449
450Model mixer_wL
451        ATTRIBUTES
452        Pallete = true;
453        Icon = "icon/waterStreamR";
454        Brief = "Mixer With 2 Inlet Streams";
455        Info =
456"== ASSUMPTIONS ==
457* Static;
458* Adiabatic.
459
460== SPEFICY ==
461* The inlet stream:
462  flow rate
463  temperature
464  pressure
465  stream composition.
466
467== SET ==
468* Phase of the fluid entering the mixer;
469";
470
471#*-------------------------------------------------------------------
472#Parametros
473*--------------------------------------------------------------------*#
474
475        PARAMETERS
476        propterm as Plugin (Brief = "IAPWS 97 properties of water", Type = "water", Symbol = "{}");
477       
478#*-------------------------------------------------------------------
479* Declaracao de variaveis
480*--------------------------------------------------------------------*#
481       
482        VARIABLES
483in      Inlet1          as water_stream         (PosX=0.0, PosY=0.08, Symbol="_{in1}", Protected = false);
484in      Inlet2          as water_stream         (PosX=0.0, PosY=0.92, Symbol="_{in2}", Protected = false);
485out Outlet              as water_stream_eq      (PosX=1.0, PosY=0.50, Symbol="_{out}", Protected = false);
486
487#*-------------------------------------------------------------------
488* Equacoes do modelo
489*--------------------------------------------------------------------*#
490       
491        EQUATIONS
492        "Global Mass Balance"
493        Inlet1.Fw + Inlet2.Fw = Outlet.Fw;
494       
495        "Energy Balance"
496        Inlet1.Fw * Inlet1.H + Inlet2.Fw * Inlet2.H = Outlet.Fw * Outlet.H;
497       
498        "Mechanical Equilibrium, array = [Inlet1.P, Inlet2.P]"
499        Outlet.P = min([Inlet1.P, Inlet2.P]);
500end
501
502Model mixer_wR
503       
504        ATTRIBUTES
505        Pallete = true;
506        Icon = "icon/waterStreamL";
507        Brief = "Mixer With 2 Inlet Streams";
508        Info =
509"== ASSUMPTIONS ==
510* Static;
511* Adiabatic.
512
513== SPEFICY ==
514* The inlet stream:
515  flow rate
516  temperature
517  pressure
518  stream composition.
519
520== SET ==
521* Phase of the fluid entering the mixer;
522";
523
524#*-------------------------------------------------------------------
525#Parametros
526*--------------------------------------------------------------------*#
527
528        PARAMETERS
529        propterm as Plugin (Brief = "IAPWS 97 properties of water", Type = "water", Symbol = "{}");
530       
531#*-------------------------------------------------------------------
532* Declaracao de variaveis
533*--------------------------------------------------------------------*#
534       
535        VARIABLES
536in      Inlet1          as water_stream         (PosX=1.0, PosY=0.08, Symbol="_{in1}", Protected = false);
537in      Inlet2          as water_stream         (PosX=1.0, PosY=0.92, Symbol="_{in2}", Protected = false);
538out Outlet              as water_stream_eq      (PosX=0.0, PosY=0.50, Symbol="_{out}", Protected = false);
539
540#*-------------------------------------------------------------------
541* Equacoes do modelo
542*--------------------------------------------------------------------*#
543
544        EQUATIONS
545        "Global Mass Balance"
546        Inlet1.Fw + Inlet2.Fw = Outlet.Fw;
547       
548        "Energy Balance"
549        Inlet1.Fw * Inlet1.H + Inlet2.Fw * Inlet2.H = Outlet.Fw * Outlet.H;
550       
551        "Mechanical Equilibrium, array = [Inlet1.P, Inlet2.P]"
552        Outlet.P = min([Inlet1.P, Inlet2.P]);
553end
554
555FlowSheet teste_mixer
556       
557#*-------------------------------------------------------------------
558* Declaracao de dispositivos (ou blocos contendo o modelo)
559*--------------------------------------------------------------------*#
560       
561        DEVICES
562        S101 as water_sourceR;
563        S102 as water_sourceR;
564        mix as mixer_wR;
565       
566#*-------------------------------------------------------------------
567* Especifica as conexoes entre os modelos
568*--------------------------------------------------------------------*#
569       
570        CONNECTIONS
571        S102.Outlet to mix.Inlet2;
572        S101.Outlet to mix.Inlet1;
573               
574#*-------------------------------------------------------------------
575* Especifica variaveis definidas no modelo
576*--------------------------------------------------------------------*#
577
578        SPECIFY
579        S101.Fw = 185278 * 'kg/h';
580        S101.T = 318.185 * 'K';
581        S101.P = 1.65 * 'bar';
582       
583        #S102.Fw = 10000 * 'kg/h';
584        S102.T = 390.192 * 'K';
585        S102.P = 1.65 * 'bar';
586       
587        mix.Outlet.v = 0;
588       
589       
590#*-------------------------------------------------------------------
591* Define o valor dos parametros declarados no modelo
592*--------------------------------------------------------------------*#
593
594        SET
595        S101.ValidPhases = "Liquid-Only";
596        S102.ValidPhases = "Liquid-Only";
597       
598#*-------------------------------------------------------------------
599* Opcoes de Solver e Condicoes Iniciais
600*--------------------------------------------------------------------*#
601       
602        OPTIONS
603        Dynamic = false;
604       
605end
606
607Model mixer_wU_n
608       
609        ATTRIBUTES
610        Pallete = true;
611        Icon = "icon/waterStreamU";
612        Brief = "Mixer With n Inlet Streams";
613        Info =
614"== ASSUMPTIONS ==
615* Static;
616* Adiabatic.
617
618== SPEFICY ==
619* The inlet stream:
620  flow rate
621  temperature
622  pressure
623  stream composition;
624* number of streams.
625
626== SET ==
627* Phase of the fluid entering the mixer;
628* Input stream number;
629";
630
631#*-------------------------------------------------------------------
632#Parametros
633*--------------------------------------------------------------------*#
634
635        PARAMETERS
636        propterm as Plugin (Brief = "IAPWS 97 properties of water", Type = "water", Symbol = "{}");
637        n as Integer (Default=2);
638       
639#*-------------------------------------------------------------------
640* Declaracao de variaveis
641*--------------------------------------------------------------------*#
642       
643        VARIABLES
644in      Inlet(n)        as water_stream         (PosX=0.08, PosY=1.0, Symbol="_{in1}", Protected = false);
645out Outlet              as water_stream_eq      (PosX=0.5, PosY=0.0, Symbol="_{out}", Protected = false);
646
647#*-------------------------------------------------------------------
648* Equacoes do modelo
649*--------------------------------------------------------------------*#
650       
651        EQUATIONS
652        "Global Mass Balance"
653        sum(Inlet.Fw) = Outlet.Fw;
654       
655        "Energy Balance"
656        sum(Inlet.Fw * Inlet.H) = Outlet.Fw * Outlet.H;
657       
658        "Mechanical Equilibrium, array = [Inlet1.P, Inlet2.P]"
659        Outlet.P = min(Inlet.P);
660end
661
662FlowSheet teste_mixer_n
663       
664#*-------------------------------------------------------------------
665* Declaracao de dispositivos (ou blocos contendo o modelo)
666*--------------------------------------------------------------------*#
667       
668        DEVICES
669        S101 as water_sourceR;
670        S102 as water_sourceR;
671        S103 as water_sourceR;
672        mix as mixer_wU_n;
673       
674#*-------------------------------------------------------------------
675* Especifica as conexoes entre os modelos
676*--------------------------------------------------------------------*#
677       
678        CONNECTIONS
679        S101.Outlet to mix.Inlet(1);
680        S102.Outlet to mix.Inlet(2);
681        S103.Outlet to mix.Inlet(3);
682               
683#*-------------------------------------------------------------------
684* Especifica variaveis definidas no modelo
685*--------------------------------------------------------------------*#
686
687        SPECIFY
688        S101.Fw = 185278 * 'kg/h';
689        S101.T = 318.185 * 'K';
690        S101.P = 1.65 * 'bar';
691       
692        S102.Fw = 10000 * 'kg/h';
693        S102.T = 290.192 * 'K';
694        S102.P = 1.65 * 'bar';
695       
696        S103.Fw = 185278 * 'kg/h';
697        S103.T = 356.185 * 'K';
698        S103.P = 1.65 * 'bar';
699       
700       
701#*-------------------------------------------------------------------
702* Define o valor dos parametros declarados no modelo
703*--------------------------------------------------------------------*#
704
705        SET
706        S101.ValidPhases = "Liquid-Only";
707        S102.ValidPhases = "Liquid-Only";
708        S103.ValidPhases = "Liquid-Only";
709        mix.Outlet.ValidPhases = "Liquid-Only";
710        mix.n=3;
711       
712#*-------------------------------------------------------------------
713* Opcoes de Solver e Condicoes Iniciais
714*--------------------------------------------------------------------*#
715       
716        OPTIONS
717        Dynamic = false;
718       
719end
Note: See TracBrowser for help on using the repository browser.