source: trunk/BioModel/separators/column.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: 26.3 KB
Line 
1#*-------------------------------------------------------------------
2* Biorrefinaria Petrobras
3*--------------------------------------------------------------------
4* Nome do arquivo: column.mso
5* Projeto: Modelo integrado de producao de etanol 1G/2G
6* Conteudo: coluna de destilacao
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 da coluna de destilacao de alcool hidratado e etanol anidro
17*--------------------------------------------------------------------
18
19*--------------------------------------------------------------------
20*Notas: Foi feito o flowsheet teste para averiguar o modelo
21* de coluna para producao de etanol hidratado e etanol anidro.
22* O modelo usa uma tabela de consulta que calcula as principais informações
23* da operação da coluna de destilacao. Estes dados foram o obtidas
24* a partir de simulações rigorosas do conjunto de Coluna de destilacao.
25* O modelo e limitado as seguintes condicoes de operacao:
26* Temperatura (K) de entrada do vinho, TWine (somente etanol e agua) - Lower = 348.15, Upper = 368.15
27* Fracao massica do etanol no vinho, Winez (somente etanol e agua) - Lower = 0.065, Upper = 0.105
28* Outras especificacoes nao devem ser alteradas pois sao dados que o usuario nao tem acesso (utilizados
29* como parametros no modelo rigoroso)
30* Para producao de etanol anidro, o switcher HydrOutletPhase deve ser definido como vapour para acomplamento com o modelo dehydration
31*--------------------------------------------------------------------*#
32
33using "main_stream";
34using "water_stream";
35using "energy_stream";
36using "assumptions";
37
38Model column
39        ATTRIBUTES
40        Pallete = true;
41        Icon = "icon/column";
42        Brief = "Column Model Based on a Look-Up Table";
43        Info =
44"== GENERAL ==
45        Model of a set of distillation columns responsible for producing
46        hydrous or anhydrous ethanol. The model uses a look-up table containing the
47        main information to describe the column operation. This
48        information is obtained from rigorous simulations of the set of
49        distillation columns.
50       
51== ASSUMPTIONS ==
52* Adiabatic;
53* Steady-state;
54* All solids exit the column in the Vinasse stream;
55* Only ethanol and water are present in the Ethanol and
56        Phlegm streams.
57       
58== SPECIFY ==
59* The inlet (Wine) stream:
60  flow rate
61  temperature (TWine)
62  pressure
63  stream composition (Winez, only ethanol and water)
64       
65== SET ==
66* Basic composition of inlet stream(mass or molar);
67* Define type of HydrOutletPhase by Switcher, Liquid(hydrous) or Vapour(anhydrous).
68";
69
70#*-------------------------------------------------------------------
71* Parametros
72*--------------------------------------------------------------------*#
73
74        PARAMETERS
75        IntLiquid               as Plugin (Brief = "Interpolator with Column Data for Liquid Hydrous Ethanol Outlet",
76                                                Type = "Int",
77                                                file = "malhas/column_Liquid_1.txt"
78                                                #file = "malhas/column_Liquid_2.txt"
79                                                #file = "malhas/column_Liquid_3.txt"
80        );
81        IntVapour               as Plugin (Brief = "Interpolator with Column Data for Vapour Hydrous Ethanol Outlet",
82                                                Type = "Int",
83                                                file = "malhas/column_Vapour_1.txt"
84                                                #file = "malhas/column_Vapour_2.txt"
85                                                #file = "malhas/column_Vapour_3.txt"
86                                                #file = "malhas/column_Vapour_4.txt"
87        );
88       
89outer   PP                              as Plugin               (Brief = "External Physical Properties (Fluid Phase)", Type="PP");
90outer   PPS                     as Plugin               (Brief = "External Physical Properties (Solid Phase)", Type="PP");
91outer   NComp                   as Integer              (Brief = "Number of Chemical Components for the Fluid Phase", Lower = 1);
92outer   NCompS                  as Integer              (Brief = "Number of Chemical Components for the Solid Phase", Lower = 1);
93                frac(NComp)             as Integer              (Brief = "Flag Indicating if a Compound Will Exit the Column in the Vinasse or the Second Grade Ethanol", Symbol = "f", Default = 0);
94outer   flu as ConstituentFluid(Symbol = " ", Protected = true);
95
96        HydrOutletPhase         as Switcher             (Brief = "Phase of Hydrous Ethanol Outlet", Valid = ["Liquid", "Vapour"], Default = "Liquid");
97       
98#*-------------------------------------------------------------------
99* Declaracao de variaveis
100*--------------------------------------------------------------------*#
101
102        VARIABLES
103in              Wine            as main_stream          (Brief = "Inlet Wine Stream", PosX=0.0, PosY=0.48, Symbol="_{Wine}", Protected = true);
104out             Vinasse         as main_stream_eq       (Brief = "Outlet Vinasse Stream", PosX=0.4235, PosY=1.0, Symbol="_{Vinasse}", Protected = false);
105out             Phlegm          as main_stream_eq       (Brief = "Outlet Phlegm Stream", PosX=1.0, PosY=0.9545, Symbol="_{Phlegm}", Protected = false);
106out             HydrEth         as main_stream          (Brief = "Outlet Hydrous Ethanol Stream", PosX=1.0, PosY=0.3025, Symbol="_{HydroEth}", Protected = false);
107out     SecGrad         as main_stream_eq       (Brief = "Outlet Second Grade Ethanol Stream");
108
109in      QAA1            as heat_stream          (Brief = "Heat Exchanged in the First Column Reboiler", PosX=0.27, PosY=1.0, Symbol = "Q_{refAA1}");
110in      QBB1            as heat_stream          (Brief = "Heat Exchanged in the Second Column Reboiler", PosX=0.87, PosY=1.0, Symbol = "Q_{refBB1}");
111out     CD                      as heat_stream          (Brief = "Heat Exchanged in the First Column Condenser", PosX=0.20, PosY=0.0, Symbol = "Q_{condD}");
112out     CBB1            as heat_stream          (Brief = "Heat Exchanged in the Second Column Condenser", PosX=0.88, PosY=0.0, Symbol = "Q_{condBB1}");
113
114        TWine           as temperature          (Brief = "Wine Temperature (Same Bounds of the Mesh)", Lower = 348.15, Upper = 368.15, Default = 358.15);
115       
116        SecGradz        as fraction     (Brief = "Ethanol molar fraction in the second grade ethanol stream", Hidden = true);
117        Winez           as fraction     (Brief = "Wine Ethanol Mass Fraction (Considering Only Ethanol and Water in the Stream)", Default = 0.075, Lower = 0.065, Upper = 0.105, Hidden = true);
118       
119       
120        VinF    as flow_mol     (Brief = "Vinasse Molar Flow Considering Only Ethanol and Water", Hidden = true);
121        SecF    as flow_mol             (Brief = "Second Grade Molar Flow Considering Only Ethanol and Water", Hidden = true);
122        WineF   as flow_mass    (Brief = "Wine Mass Flow Considering Only Ethanol and Water", Default = 10, Hidden = true);
123
124#*-------------------------------------------------------------------
125* Define o valor dos parametros declarados no modelo
126*--------------------------------------------------------------------*#
127
128        SET
129        Vinasse.Phase = "Liquid";
130        Phlegm.Phase  = "Liquid";
131        SecGrad.Phase = "Liquid";
132
133#*-------------------------------------------------------------------
134* Equacoes do modelo
135*--------------------------------------------------------------------*#
136
137        EQUATIONS
138        "Global Molar Balance (Fluid Phase)"
139        Wine.Fluid.F = Vinasse.Fluid.F + Phlegm.Fluid.F + HydrEth.Fluid.F + SecGrad.Fluid.F;
140       
141        "Global Molar Balance (Solid Phase)"
142        Wine.Solid.F = Vinasse.Solid.F;
143       
144        "No Solid in the Phlegm Stream"
145        Phlegm.Solid.F = 0 * 'kmol/h';
146       
147        "No Solid in the Hydrous Ethanol Stream"
148        HydrEth.Solid.F = 0 * 'kmol/h';
149       
150        "No Solid in the Second Grade Ethanol Stream"
151        SecGrad.Solid.F = 0 * 'kmol/h';
152       
153        "Vinasse Stream Composition (Solid Phase)"
154        Wine.Solid.z = Vinasse.Solid.z;
155       
156        "Phlegm Stream Composition (Solid Phase)"
157        Phlegm.Solid.z = Wine.Solid.z;
158       
159        "Hydrous Ethanol Stream Composition (Solid Phase)"
160        HydrEth.Solid.z = Wine.Solid.z;
161       
162        "Second Grade Ethanol Stream Composition (Solid Phase)"
163        SecGrad.Solid.z = Wine.Solid.z;
164       
165        for i in [1:NComp] do
166                if i equal flu.Ethanol then
167                        "Fixed Ethanol Fraction in the Vinasse Stream"
168                        Vinasse.Fluid.F * Vinasse.Fluid.z(flu.Ethanol) = 7.82E-5 * VinF;
169                       
170                        "Ethanol Fraction in the Second Grade Ethanol Stream"
171                        SecGrad.Fluid.F * SecGrad.Fluid.z(flu.Ethanol) = SecGradz * SecF;
172                       
173                        "Fixed Ethanol Molar Fraction in the Hydrous Ethanol Stream"
174                        HydrEth.Fluid.z(i) = 0.849;
175                       
176                        "Fixed Ethanol Molar Fraction in the Phlegm Stream"
177                        Phlegm.Fluid.z(i) = 7.82E-5;
178                else
179                        if i equal flu.Water then
180                                "Water Fraction in the Vinasse Stream"
181                                Vinasse.Fluid.F * Vinasse.Fluid.z(i) = 0.9999218 * VinF;
182                               
183                                "Water Fraction in the Second Grade Ethanol Stream"
184                                SecGrad.Fluid.F * SecGrad.Fluid.z(i) = (1 - SecGradz) * SecF;
185                               
186                                "Fixed Water Molar Fraction in the Hydrous Ethanol Stream"
187                                HydrEth.Fluid.z(i) = 0.151;
188                               
189                                "Fixed Water Molar Fraction in the Phlegm Stream"
190                                Phlegm.Fluid.z(i) = 0.9999218;
191                        else
192                                "Component Molar Balance in the Second Grade Ethanol Stream"
193                                SecGrad.Fluid.F * SecGrad.Fluid.z(i) = frac(i) * Wine.Fluid.F * Wine.Fluid.z(i);
194                               
195                                "Component Molar Balance in the Vinasse Stream"
196                                Vinasse.Fluid.F * Vinasse.Fluid.z(i) = (1 - frac(i)) * Wine.Fluid.F * Wine.Fluid.z(i);
197                               
198                                "Only Ethanol and Water in the Hydrous Ethanol Stream"
199                                HydrEth.Fluid.z(i) = 0;
200                               
201                                "Only Ethanol and Water in the Phlegm Stream"
202                                Phlegm.Fluid.z(i) = 0;
203                        end
204                end
205        end
206
207        "Sum of Molar Fractions (Fluid Phase)"
208        sum(Vinasse.Fluid.z) = sum(SecGrad.Fluid.z);
209       
210        "Wine Mass Flow Considering Only Ethanol and Water"
211        WineF = Wine.Fluid.Fw * (Wine.Fluid.zw(flu.Ethanol) + Wine.Fluid.zw(flu.Water));
212       
213        "Wine Ethanol Mass Fraction (Considering Only Ethanol and Water in the Stream)"
214        WineF * Winez = Wine.Fluid.Fw * Wine.Fluid.zw(flu.Ethanol);
215       
216        switch HydrOutletPhase
217                case "Liquid":
218                        "Call to the Interpolator"
219                        [QAA1.Q/WineF, QBB1.Q/WineF, -CD.Q/WineF, -CBB1.Q/WineF, SecGradz, VinF/WineF,
220                                SecF/WineF, Phlegm.Fluid.F /WineF, HydrEth.Fluid.F /WineF] = IntLiquid.interpola(TWine, Winez);
221                       
222                        "Fluid Phase Molar Enthalpy"
223                        HydrEth.Fluid.h = PP.LiquidEnthalpy(HydrEth.T, HydrEth.P, HydrEth.Fluid.z);
224                       
225                        "Vapour fraction"
226                        HydrEth.Fluid.v = 0;
227               
228                case "Vapour":
229                        "Call to the Interpolator"
230                        [QAA1.Q/WineF, QBB1.Q/WineF, -CD.Q/WineF, -CBB1.Q/WineF, SecGradz, VinF/WineF,
231                                SecF/WineF, Phlegm.Fluid.F /WineF, HydrEth.Fluid.F /WineF] = IntVapour.interpola(TWine, Winez);
232                       
233                        "Fluid Phase Molar Enthalpy"
234                        HydrEth.Fluid.h = PP.VapourEnthalpy(HydrEth.T, HydrEth.P, HydrEth.Fluid.z);
235                       
236                        "Vapour fraction"
237                        HydrEth.Fluid.v = 1;
238        end
239       
240        "Solid Phase Molar Enthalpy"
241        HydrEth.Solid.h = PPS.VapourEnthalpy(HydrEth.T, HydrEth.P, HydrEth.Solid.z);   
242
243        "Wine Temperature"
244        TWine = Wine.T;
245       
246#*-------------------------------------------------------------------
247* Especifica variaveis definidas no modelo
248*--------------------------------------------------------------------*#
249
250        SPECIFY
251        #Vinasse Pressure
252        Vinasse.P = 152.5 * 'kPa';
253       
254        #Phlegm Pressure
255        Phlegm.P = 135.7 * 'kPa';
256       
257        #Second Grade Ethanol Pressure
258        SecGrad.P = 133.8 * 'kPa';
259       
260        #Hydrous Ethanol Pressure
261        HydrEth.P = 116.0 * 'kPa';
262       
263        #Vinasse Temperature
264        Vinasse.T = 385.0 * 'K';
265       
266        #Phlegm Temperature
267        Phlegm.T = 381.5 * 'K';
268       
269        #Hydrous Ethanol Temperature
270        HydrEth.T = 354.6 * 'K';
271       
272        #Second Grade Ethanol Temperature
273        SecGrad.T = 358.5 * 'K';
274
275end
276
277
278Model dehydration
279        ATTRIBUTES
280        Pallete = true;
281        Icon = "icon/dehydration";
282        Brief = "Column Model Based on a Look-Up Table";
283        Info =
284"== GENERAL ==
285        Model of a set of distillation columns responsible for producing
286        anhydrous ethanol. The model uses a look-up table containing the
287        main information to describe the column operation. This
288        information is obtained from rigorous simulations of the set of
289        distillation columns.
290       
291== ASSUMPTIONS ==
292* Adiabatic;
293* Steady-state;
294* All solids exit the column in the Vinasse stream;
295* Only ethanol and water are present in the Hydrous Ethanol and
296        Phlegm streams.
297       
298== SPECIFY ==
299* The inlet (hydrous ethanol) stream.
300       
301== SET ==
302* Number of stream components(Ncomp/NcompS);
303* Basic composition of inlet stream(mass or molar);
304* Phase of the stream entering the separator;
305";
306
307#*-------------------------------------------------------------------
308* Parametros
309*--------------------------------------------------------------------*#
310
311        PARAMETERS
312        Int             as Plugin (Brief = "Interpolator with Column Data",
313                                                Type = "Int",
314                                                file = "malhas/dehydration_51.txt"
315                                                #file = "malhas/dehydration_11.txt"
316                                                #file = "malhas/dehydration_26.txt"
317        );
318       
319outer   PP                              as Plugin               (Brief = "External Physical Properties (Fluid Phase)", Type="PP");
320outer   PPS                     as Plugin               (Brief = "External Physical Properties (Solid Phase)", Type="PP");
321outer   NComp                   as Integer              (Brief = "Number of Chemical Components for the Fluid Phase", Lower = 1);
322outer   NCompS                  as Integer              (Brief = "Number of Chemical Components for the Solid Phase", Lower = 1);
323outer   flu as ConstituentFluid(Symbol = " ", Protected = true);
324
325       
326#*-------------------------------------------------------------------
327* Declaracao de variaveis
328*--------------------------------------------------------------------*#
329
330        VARIABLES
331in              HydrEth         as main_stream          (Brief = "Inlet Hydrous Ethanol Stream", PosX=0.0, PosY=0.48, Symbol="_{HydroEth}", Protected = true);
332in              MEG                     as main_stream          (Brief = "Inlet MEG Stream", PosX=0.0, PosY=0.40, Symbol="_{MEG}", Protected = true);
333out             AnhyEth         as main_stream_eq       (Brief = "Outlet Anhydrous Ethanol Stream", PosX=0.245, PosY=0.04, Symbol="_{AnhyEth}", Protected = false);
334out             RecMEG          as main_stream_eq       (Brief = "Outlet Recovered MEG Stream", PosX=0.85, PosY=0.89, Symbol="_{Phlegm}", Protected = false);
335out             Water           as main_stream_eq       (Brief = "Outlet Water Stream", PosX=0.85, PosY=0.281, Symbol="_{HydroEth}", Protected = false);
336
337in              QREXT           as heat_stream          (Brief = "Heat Exchanged in the Extraction Column Reboiler", PosX=0.225, PosY=1.0, Symbol = "Q_{refExt}");
338in              QRREC           as heat_stream          (Brief = "Heat Exchanged in the Recovery Column Reboiler", PosX=0.74, PosY=1.0, Symbol = "Q_{refRec}");
339out             QCEXT           as heat_stream          (Brief = "Heat Exchanged in the Extraction Column Condenser", PosX=0.15, PosY=0.0, Symbol = "Q_{condExt}");
340out     QCREC           as heat_stream          (Brief = "Heat Exchanged in the Recovery Column Condenser", PosX=0.75, PosY=0.0, Symbol = "Q_{condRec}");
341       
342        zEth_Anh        as fraction     (Brief = "Ethanol Molar Fraction in the Anhydrous Ethanol Stream", Hidden = true);
343        zEth_RMEG       as fraction     (Brief = "Ethanol Molar Fraction in the Recovered MEG Stream", Hidden = true);
344        zEth_Water      as fraction     (Brief = "Ethanol Molar Fraction in the Water Stream", Hidden = true);
345        zMEG_Anh        as fraction     (Brief = "MEG Molar Fraction in the Anhydrous Ethanol Stream", Hidden = true);
346        zMEG_RMEG       as fraction     (Brief = "MEG Molar Fraction in the Recovered MEG Stream", Hidden = true);
347        zMEG_Water      as fraction     (Brief = "MEG Molar Fraction in the Water Stream", Hidden = true);
348       
349        WaterF  as flow_mol             (Brief = "Water Stream Molar Flow Considering Only Ethanol, Water and MEG", Hidden = true);
350        HydroF  as flow_mol             (Brief = "Hydrous Ethanol Molar Flow Considering Only Ethanol and Water", Hidden = true);
351       
352        SolventRatio as Real    (Brief = "Ratio Between MEG and Hydrous Ethanol", Lower = 0.4798, Upper = 1.891, Default = 1);
353
354#*-------------------------------------------------------------------
355* Define o valor dos parametros declarados no modelo
356*--------------------------------------------------------------------*#
357
358        SET
359        AnhyEth.Phase = "Liquid";
360        RecMEG.Phase = "Liquid";
361        Water.Phase = "Liquid";
362
363#*-------------------------------------------------------------------
364* Equacoes do modelo
365*--------------------------------------------------------------------*#
366
367        EQUATIONS
368        "Global Molar Balance (Fluid Phase)"
369        HydrEth.Fluid.F + MEG.Fluid.F = RecMEG.Fluid.F + AnhyEth.Fluid.F + Water.Fluid.F;
370       
371        "Global Molar Balance (Solid Phase)"
372        MEG.Solid.F + HydrEth.Solid.F = Water.Solid.F;
373       
374        "No Solid in the Recovered MEG Stream"
375        RecMEG.Solid.F = 0 * 'kmol/h';
376       
377        "No Solid in the Anhydrous Ethanol Stream"
378        AnhyEth.Solid.F = 0 * 'kmol/h';
379       
380        "Water Stream Composition (Solid Phase)"
381        HydrEth.Solid.F * HydrEth.Solid.z + MEG.Solid.F * MEG.Solid.z = Water.Solid.F * Water.Solid.z;
382       
383        "Phlegm Stream Composition (Solid Phase)"
384        AnhyEth.Solid.z = Water.Solid.z;
385       
386        "Hydrous Ethanol Stream Composition (Solid Phase)"
387        RecMEG.Solid.z = Water.Solid.z;
388       
389        for i in [1:NComp] do
390                if i equal flu.Ethanol then
391                        "Ethanol Molar Fraction in the Anhydrous Ethanol Stream"
392                        AnhyEth.Fluid.z(i) = zEth_Anh;
393                       
394                        "Ethanol Molar Fraction in the Recovered MEG Stream"
395                        RecMEG.Fluid.z(i) = zEth_RMEG;
396                       
397                        "Ethanol Molar Fraction in the Anhydrous Ethanol Stream"
398                        Water.Fluid.F * Water.Fluid.z(i) = WaterF * zEth_Water;
399                       
400                else
401                        if i equal flu.MEG then
402                                "Ethanol Molar Fraction in the Anhydrous Ethanol Stream"
403                                AnhyEth.Fluid.z(i) = zMEG_Anh;
404                               
405                                "Ethanol Molar Fraction in the Recovered MEG Stream"
406                                RecMEG.Fluid.z(i) = zMEG_RMEG;
407                               
408                                "Ethanol Molar Fraction in the Anhydrous Ethanol Stream"
409                                Water.Fluid.F * Water.Fluid.z(i) = WaterF * zMEG_Water;
410                       
411                        else
412                                if i equal flu.Water then
413                                        "Water Fraction in the Water Stream"
414                                        HydrEth.Fluid.F * HydrEth.Fluid.z(i) + MEG.Fluid.F * MEG.Fluid.z(i) =
415                                        Water.Fluid.F * Water.Fluid.z(i) + AnhyEth.Fluid.F * AnhyEth.Fluid.z(i) + RecMEG.Fluid.F * RecMEG.Fluid.z(i);
416                                       
417                                        "Water Molar Fraction in the Anhydrous Ethanol Stream"
418                                        AnhyEth.Fluid.z(i) = 1 - zEth_Anh - zMEG_Anh;
419                                       
420                                        "Water Molar Fraction in the Recovered MEG Stream"
421                                        RecMEG.Fluid.z(i) = 1 - zEth_RMEG - zMEG_RMEG;
422                       
423                                else
424                                        "Component Molar Balance in the Water Stream"
425                                        Water.Fluid.F * Water.Fluid.z(i) = HydrEth.Fluid.F * HydrEth.Fluid.z(i);
426                                       
427                                        "Only Ethanol, Water and MEG in the Anhydrous Ethanol Stream"
428                                        AnhyEth.Fluid.z(i) = 0;
429                                       
430                                        "Only Ethanol, Water and MEG in the MEG Stream"
431                                        RecMEG.Fluid.z(i) = 0;
432                                end
433                        end
434                end
435        end
436       
437        "Wine Mass Flow Considering Only Ethanol and Water"
438        HydroF = HydrEth.Fluid.F * (HydrEth.Fluid.z(flu.Ethanol) + HydrEth.Fluid.z(flu.Water) + HydrEth.Fluid.z(flu.MEG));
439       
440        "Water Flow"
441        HydroF + MEG.Fluid.F - WaterF = AnhyEth.Fluid.F + RecMEG.Fluid.F;
442       
443        "Ratio Between MEG and Ethanol"
444        SolventRatio * HydrEth.Total.Fw = MEG.Total.Fw;
445       
446        "Call to the Interpolator"
447        [QREXT.Q/HydroF, QRREC.Q/HydroF, -QCEXT.Q/HydroF, -QCREC.Q/HydroF,
448                AnhyEth.Fluid.F/HydroF, RecMEG.Fluid.F/HydroF, AnhyEth.T, Water.T, RecMEG.T,
449                zEth_Anh, zEth_Water, zEth_RMEG, zMEG_Anh, zMEG_Water, zMEG_RMEG] = Int.interpola(SolventRatio);
450
451#*-------------------------------------------------------------------
452* Especifica variaveis definidas no modelo
453*--------------------------------------------------------------------*#
454
455        SPECIFY
456        #Anhydrous Ethanol Pressure
457        AnhyEth.P = 101.325 * 'kPa';
458       
459        #Water Pressure
460        Water.P = 101.325 * 'kPa';
461       
462        #Recovered MEG Pressure
463        RecMEG.P = 101.325 * 'kPa';
464
465end
466
467
468FlowSheet teste_column
469       
470#*-------------------------------------------------------------------
471* Declaracao de dispositivos (ou blocos contendo o modelo)
472*--------------------------------------------------------------------*#
473
474        DEVICES
475        S101 as main_sourceR;
476        Q101 as heat_sourceR;
477        Q102 as heat_sourceR;
478        E101 as column;
479       
480#*-------------------------------------------------------------------
481* Especifica as conexoes entre os modelos
482*--------------------------------------------------------------------*#
483       
484        CONNECTIONS
485        S101.Outlet to E101.Wine;
486        Q101.Outlet_q to E101.QAA1;
487        Q102.Outlet_q to E101.QBB1;
488       
489#*-------------------------------------------------------------------
490#Parametros
491*--------------------------------------------------------------------*#
492       
493        PARAMETERS
494        PP as Plugin    (Brief = "External Physical Properties",
495                Type="PP",
496                Project = "../Flowsheets/v2_2/Fluid_v2_2.vrtherm"
497        );
498
499        PPS as Plugin   (Brief = "External Physical Properties",
500                Type="PP",
501                Project = "../Flowsheets/v2_2/Solid_v2_2.vrtherm"
502        );
503
504        NComp   as Integer (Brief = "Number of chemical components in the fluid phase");
505        NCompS  as Integer (Brief = "Number of chemical components in the solid phase");
506        flu as ConstituentFluid(Symbol = " ", Protected = true);
507        sol as ConstituentSolid(Symbol = " ", Protected = true);
508       
509#*-------------------------------------------------------------------
510* Define o valor dos parametros declarados no modelo
511*--------------------------------------------------------------------*#
512       
513        SET
514        NComp = PP.NumberOfComponents();
515        NCompS = PPS.NumberOfComponents();
516        S101.CompositionBasis = "Mass";
517        E101.HydrOutletPhase = "Vapour";
518       
519#*-------------------------------------------------------------------
520* Especifica variaveis definidas no modelo
521*--------------------------------------------------------------------*#
522
523        SPECIFY
524        S101.T = 349 * 'K';
525        S101.P = 1.363 * 'bar';
526        S101.Fluid.Fw = 2000 * 'kg/h';
527        S101.Solid.Fw = 1e-6 * 'kg/h';
528        S101.CompositionOfFluid = [0.974, 0, 0, 0, 0.0826, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
529        S101.CompositionOfSolid = [0.25, 0.20, 0.55, 0, 0, 0, 0, 0, 0];
530       
531       
532       
533#*-------------------------------------------------------------------
534* Condicoes iniciais e opcoes de Solver
535*--------------------------------------------------------------------*#
536       
537        OPTIONS
538        Dynamic = false;
539end
540
541
542FlowSheet teste_int
543       
544#*-------------------------------------------------------------------
545#Parametros
546*--------------------------------------------------------------------*#
547
548        PARAMETERS
549        Int             as Plugin (Brief = "Interpolator with Column Data",
550                                                Type = "Int",
551                                                file = "malhas/column.txt"
552        );
553        MEthanol as molweight (Default = 46.0688);
554        MWater as molweight (Default = 18.0152);
555       
556#*-------------------------------------------------------------------
557* Especifica variaveis definidas no modelo
558*--------------------------------------------------------------------*#
559
560        VARIABLES
561        Fw as flow_mol;
562        Fh as flow_mol;
563        Fv as flow_mol;
564        Fp as flow_mol;
565       
566        zp(2) as fraction;
567        zw(2) as fraction;
568        zv(2) as fraction;
569        zh(2) as fraction;
570       
571        zVinEth as fraction;
572        zPhlEth as fraction;
573        zHydrEth as fraction;
574        zethanol as fraction;
575       
576        TVin as temperature;
577        TPhle as temperature;
578        TEth as temperature;
579       
580        QRef1 as power (Brief = "Heat Exchanged on First Column Reboiler");
581        QRef2 as power (Brief = "Heat Exchanged on Second Column Reboiler");
582        QCond as power (Brief = "Heat Exchanged on Condenser");
583       
584        WineF as flow_mass;
585        VinasseF as flow_mass;
586       
587#*-------------------------------------------------------------------
588* Equacoes do modelo
589*--------------------------------------------------------------------*#
590
591       
592        EQUATIONS
593        [zVinEth, zPhlEth, zHydrEth, TVin, TPhle, TEth, QRef1/WineF, QRef2/WineF, -QCond/WineF, VinasseF/WineF]
594                = Int.interpola(zethanol);
595       
596        WineF = Fw * zw(2) * MEthanol + Fw * zw(1) * MWater;
597        WineF * zethanol = Fw * zw(2) * MEthanol;
598       
599        Fv * zv(2) * MEthanol = VinasseF * zVinEth;
600        VinasseF = Fv * (zv(2) * MEthanol + zv(1) * MWater);
601       
602        "Parcial molar balance for solids"
603        Fw * zw = Fv * zv + Fp * zp + Fh * zh;
604       
605        Fw = Fv + Fp + Fh;
606       
607        "Partial molar balance for liquid phase"
608        zp(2) * MEthanol = (zp(2) * MEthanol + zp(1) * MWater) * zPhlEth;
609       
610        zh(2) * MEthanol = (zh(2) * MEthanol + zh(1) * MWater) * zHydrEth;
611
612        "Partial molar balance for liquid phase"
613#       zp(1) * MWater = (zp(2) * MEthanol + zp(1) * MWater) * (1 - zPhlEth);
614       
615#       zh(1) * MWater = (zh(2) * MEthanol + zh(1) * MWater) * (1 - zHydrEth);
616
617        sum(zh) = 1;
618        sum(zp) = 1;
619       
620        SPECIFY
621        Fw = 5.38186 * 'kmol/h';
622        zw = [0.979833, 0.0201665];
623       
624        GUESS
625        zh = [0.14, 0.86];
626        zp = [1, 0];
627        zv = [1, 0];
628        Fv = 4.88 * 'kmol/h';
629        Fh = 0.126 * 'kmol/h';
630        Fp = 0.376 * 'kmol/h';
631       
632#*-------------------------------------------------------------------
633* Condicoes iniciais e opcoes de Solver
634*--------------------------------------------------------------------*#
635       
636        OPTIONS
637        Dynamic = false;
638end
639
640FlowSheet teste_dehydratation
641       
642#*-------------------------------------------------------------------
643* Declaracao de dispositivos (ou blocos contendo o modelo)
644*--------------------------------------------------------------------*#
645
646        DEVICES
647        S101 as main_sourceR;
648        S102 as main_sourceR;
649        Q101 as heat_sourceR;
650        Q102 as heat_sourceR;
651        E101 as dehydration;
652       
653       
654#*-------------------------------------------------------------------
655* Especifica as conexoes entre os modelos
656*--------------------------------------------------------------------*#
657       
658        CONNECTIONS
659        S101.Outlet to E101.HydrEth;
660        S102.Outlet to E101.MEG;
661        Q101.Outlet_q to E101.QREXT;
662        Q102.Outlet_q to E101.QRREC;
663       
664#*-------------------------------------------------------------------
665#Parametros
666*--------------------------------------------------------------------*#
667       
668        PARAMETERS
669        PP as Plugin    (Brief = "External Physical Properties",
670                Type="PP",
671                Project = "../Flowsheets/v2_2/Fluid_v2_2.vrtherm"
672        );
673        PPS as Plugin   (Brief = "External Physical Properties",
674                Type="PP",
675                Project = "../Flowsheets/v2_2/Solid_v2_2.vrtherm"
676        );
677       
678        NComp as Integer (Brief = "Number of chemical components in the fluid phase");
679        NCompS as Integer (Brief = "Number of chemical components in the solid phase");
680        flu as ConstituentFluid(Symbol = " ", Protected = true);
681        sol as ConstituentSolid(Symbol = " ", Protected = true);
682#*-------------------------------------------------------------------
683* Define o valor dos parametros declarados no modelo
684*--------------------------------------------------------------------*#
685       
686        SET
687        NComp = PP.NumberOfComponents();
688        NCompS = PPS.NumberOfComponents();
689        S101.CompositionBasis = "Mass";
690        S102.CompositionBasis = "Mass";
691        S101.ValidPhases = "Vapour-Only";
692               
693       
694#*-------------------------------------------------------------------
695* Especifica variaveis definidas no modelo
696*--------------------------------------------------------------------*#
697
698        SPECIFY
699        S101.T = (81.442 + 273.15) * 'K';
700        S101.P = 116 * 'kPa';
701        S101.Fluid.F = 847 * 'kmol/h';
702        S101.Solid.Fw = 1e-6 * 'kg/h';
703        S101.CompositionOfFluid = [0.065, 0, 0, 0, 0.935, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
704        S101.CompositionOfSolid = [0.25, 0.20, 0.55, 0, 0, 0, 0, 0, 0];
705       
706        S102.T = (80 + 273.15) * 'K';
707        S102.P = 1 * 'bar';
708        S102.Solid.Fw = 1e-6 * 'kg/h';
709        S102.CompositionOfFluid = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0];
710        S102.CompositionOfSolid = [0.25, 0.20, 0.55, 0, 0, 0, 0, 0, 0];
711       
712        E101.SolventRatio = 1.89083;
713
714        #*-------------------------------------------------------------------
715* Condicoes iniciais e opcoes de Solver
716*--------------------------------------------------------------------*#
717       
718        OPTIONS
719        Dynamic = false;
720       
721end
722
Note: See TracBrowser for help on using the repository browser.