source: trunk/BioModel/separators/mill.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: 10.2 KB
Line 
1#*-------------------------------------------------------------------
2* Biorrefinaria Petrobras
3*--------------------------------------------------------------------
4* Nome do arquivo: mill.mso
5* Projeto: Modelo integrado de producao de etanol 1G/2G
6* Conteudo: moenda
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 moenda de cana que sera empregado
17*na biorrefinaria
18*--------------------------------------------------------------------
19
20*--------------------------------------------------------------------
21*Notas: Foram feitos um flowsheets para averiguar o modelo
22*--------------------------------------------------------------------*#
23
24using "main_stream";
25using "water_stream";
26using "energy_stream";
27using "assumptions";
28
29Model mill
30       
31        ATTRIBUTES
32        Pallete         = true;
33        Icon            = "icon/mill";
34        Brief           = "Model of a mill";
35        Info =
36"== GENERAL ==
37        Simplified Model of a mill of cane with the power requirement is based on
38        the inlet of fiber.
39       
40== ASSUMPTIONS ==
41* Steady-state;
42* Adiabatic.
43        M101.WFPTC = 0;
44        M101.Duty = 16 * 'kW*h/t';
45        M101.humidity = 0.53;
46        M101.impurity = 0.0001;
47        M101.Extract = 0.70;
48== SPECIFY ==
49* The Cane stream:
50  flow rate
51  temperature
52  pressure;
53  stream composition;
54* The Water stream (Except the fluid flow);
55  flow rate
56  temperature
57  pressure
58  stream composition;
59* The proportion between the Sugarcane and the Water streams (Extract);
60* The bagasse humidity;
61* The impurities in the MixedJuice stream;
62* Ton of Water Per Ton of Cane (WFPTC);
63* The power required (based on the amount of fiber - Duty).
64       
65== SET ==
66* Basic composition (mass or molar);
67* Number of stream components(Ncomp/NcompS);
68* The compounds that participate in the Brix calculation
69        (1 if participates, 0 if not).
70";
71
72#*-------------------------------------------------------------------
73* Declaracao de variaveis
74*--------------------------------------------------------------------*#
75       
76        VARIABLES
77in      Cane                    as main_stream          (Brief = "Inlet Cane", PosX=0.0, PosY=0.5, Symbol="_{Cane}", Protected = false);
78in      Water                   as main_stream          (Brief = "Inlet Water", PosX=0.5, PosY=0.0, Symbol="_{Water}", Protected = false);
79out     MixedJuice              as main_stream_eq       (Brief = "MixedJuice Stream", PosX=0.57, PosY=1.0, Symbol="_{Juice}", Protected = false);
80out     Bagasse                 as main_stream_eq       (Brief = "Bagasse Stream", PosX=0.0, PosY=0.7, Symbol="_{Bagasse}", Protected = false );
81        frac_sol                as fraction             (Brief = "Solids Separation Efficiency");
82        humidity                as fraction             (Brief = "Fraction of Water in the Bagasse");
83        impurity                as fraction             (Brief = "Fraction of Solids in the MixedJuice");
84        Duty                    as positive                     (Brief = "Actual Duty (per Ton of Fiber)", Symbol="Q_{Duty}", Default=16, Unit = 'kW*h/kg');
85        Work                    as power                        (Brief = "Inlet Work Stream", PosX=0.0, PosY=0.7, Symbol="_{Work}");
86        WFPTC                   as positive             (Brief = "Ton of Water Per Ton of Cane");
87        Fiber           as fraction             (Brief = "Amount of Fiber in the Inlet Sugarcane", Default = 0.12, Protected = true);
88        Outlet_Brix     as fraction                     (Brief = "Total Soluble Solids", Protected = true);
89        Extract                 as fraction                     (Brief = "Amount of Sugars Extracted");
90       
91#*-------------------------------------------------------------------
92#Parametros
93*--------------------------------------------------------------------*#
94
95        PARAMETERS
96       
97outer   PP                              as Plugin               (Brief = "External Physical Properties (Fluid Phase)", Type="PP");
98outer   PPS                     as Plugin               (Brief = "External Physical Properties (Solid Phase)", Type="PP");
99outer   NComp                   as Integer              (Brief = "Number of Chemical Components for the Fluid Phase", Lower = 1);
100outer   NCompS                  as Integer              (Brief = "Number of Chemical Components for the Solid Phase", Lower = 1);
101                M(NComp)                as molweight    (Brief = "Component Mol Weight (Fluid Phase), Vector Size = NComp", Protected=true);
102                MS(NCompS)      as molweight    (Brief = "Component Mol Weight (Solid Phase), Vector Size = NCompS", Protected=true);
103       
104                Brix(NComp)             as Integer              (Brief = "Flag for the Compound that Enters the Brix Calculation");
105outer   flu as ConstituentFluid(Symbol = " ", Protected = true);
106outer   sol as ConstituentSolid(Symbol = " ", Protected = true);
107
108#*-------------------------------------------------------------------
109* Define o valor dos parametros declarados no modelo
110*--------------------------------------------------------------------*#
111
112        SET
113       
114        M   = PP.MolecularWeight();
115        MS   = PPS.MolecularWeight();
116       
117        MixedJuice.Phase = "Liquid";
118        Bagasse.Phase = "Liquid";
119       
120#*-------------------------------------------------------------------
121* Equacoes do modelo
122*--------------------------------------------------------------------*#
123       
124        EQUATIONS
125       
126        "Water Flow per Flow of Fiber"
127        Water.Fluid.Fw = Cane.Total.Fw * Fiber * WFPTC;
128       
129        "Global Molar Balance (Fluid Phase)"
130        Cane.Fluid.F + Water.Fluid.F = MixedJuice.Fluid.F + Bagasse.Fluid.F;
131       
132        "Sum of Molar Fractions (Fluid Phase)"
133        sum(MixedJuice.Fluid.z) = sum(Bagasse.Fluid.z);
134       
135        for i in [1:NComp] do
136                if i equal flu.Water then
137                        "Solid Humidty"
138                        Bagasse.Total.zw(i) = humidity;
139                       
140                        "Component Molar Balance (Fluid Phase)"
141                        MixedJuice.Fluid.F * MixedJuice.Fluid.z(i) + Bagasse.Fluid.F * Bagasse.Fluid.z(i) =
142                        Cane.Fluid.F * Cane.Fluid.z(i) + Water.Fluid.F * Water.Fluid.z(i);
143                       
144                else
145                        "Component Molar Balance (Fluid Phase) 1"
146                        MixedJuice.Fluid.F * MixedJuice.Fluid.z(i) =
147                        Cane.Fluid.F * Cane.Fluid.z(i) * Extract + Water.Fluid.F * Water.Fluid.z(i);
148                       
149                        "Component Molar Balance (Fluid Phase) 2"
150                        Bagasse.Fluid.F * Bagasse.Fluid.z(i) = Cane.Fluid.F * Cane.Fluid.z(i) * (1 - Extract);
151                end
152        end
153       
154        "Global Molar Balance (Solid Phase)"
155        Cane.Solid.F + Water.Solid.F = Bagasse.Solid.F + MixedJuice.Solid.F;
156       
157        "Sum of Molar Fractions (Solid Phase)"
158        sum(MixedJuice.Solid.z) = sum(Bagasse.Solid.z);
159       
160        "Component Molar Balance (Solid Phase) 1"
161        MixedJuice.Solid.F * MixedJuice.Solid.z = (Cane.Solid.F * Cane.Solid.z + Water.Solid.F * Water.Solid.z) * (1 - frac_sol);
162       
163        "Component Molar Balance (Solid Phase) 2"
164        Bagasse.Solid.F * Bagasse.Solid.z = (Cane.Solid.F * Cane.Solid.z + Water.Solid.F * Water.Solid.z) * frac_sol;
165       
166        "Liquid Stream Impurities"
167        MixedJuice.Solid.Fw = impurity * MixedJuice.Total.Fw;
168       
169        "Total Soluble Solids"
170        Outlet_Brix = sum(MixedJuice.Fluid.zw * Brix);
171       
172        "Outlet Temperatures"
173        MixedJuice.T = Bagasse.T;
174       
175        "Energy Balance"
176        Bagasse.Fluid.F * Bagasse.Fluid.h + Bagasse.Solid.F * Bagasse.Solid.h + MixedJuice.Fluid.F * MixedJuice.Fluid.h + MixedJuice.Solid.F * MixedJuice.Solid.h =
177        Cane.Fluid.F * Cane.Fluid.h + Water.Fluid.F * Water.Fluid.h + Cane.Solid.F * Cane.Solid.h + Water.Solid.F * Water.Solid.h;
178       
179        "Mechanical Equilibrium 1"     
180        Bagasse.P = Cane.P;
181       
182        "Mechanical Equilibrium 2"
183        MixedJuice.P = Cane.P;
184       
185        "Calculation of Fiber"
186        Fiber = Cane.Total.zw(NComp + sol.Cellulose) + Cane.Total.zw(NComp + sol.Hemicell) + Cane.Total.zw(NComp + sol.Lignin);
187       
188        "Energy Balance"
189        Work = Cane.Total.Fw * Duty * Fiber;
190       
191end
192
193
194FlowSheet teste_mill
195       
196#*-------------------------------------------------------------------
197* Declaracao de dispositivos (ou blocos contendo o modelo)
198*--------------------------------------------------------------------*#
199       
200        DEVICES
201        M101 as mill;
202        S101 as main_sourceR;
203        S102 as main_sourceR;
204       
205#*-------------------------------------------------------------------
206* Especifica as conexoes entre os modelos
207*--------------------------------------------------------------------*#
208       
209        CONNECTIONS
210        S101.Outlet to M101.Cane;
211        S102.Outlet to M101.Water;
212       
213#*-------------------------------------------------------------------
214#Parametros
215*--------------------------------------------------------------------*#
216       
217        PARAMETERS
218        PP as Plugin    (Brief = "External Physical Properties",
219                Type="PP",
220                Project = "../Flowsheets/v2_2/Fluid_v2_2.vrtherm"
221        );
222        PPS as Plugin   (Brief = "External Physical Properties",
223                Type="PP",
224                Project = "../Flowsheets/v2_2/Solid_v2_2.vrtherm"
225        );
226       
227        NComp   as Integer (Brief = "Number of chemical components in the fluid phase");
228        NCompS  as Integer (Brief = "Number of chemical components in the solid phase");
229        flu as ConstituentFluid(Symbol = " ", Protected = true);
230        sol as ConstituentSolid(Symbol = " ", Protected = true);
231#*-------------------------------------------------------------------
232* Especifica variaveis definidas no modelo
233*--------------------------------------------------------------------*#
234
235        SPECIFY
236        # Cane
237        S101.CompositionOfFluid = [0.804, 0.1673, 0.0287, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
238        S101.CompositionOfSolid = [43.1, 25.2, 22.9, 0, 0, 0, 0, 0, 0];
239        S101.Fluid.Fw = 436000 * 'kg/h';
240        S101.Solid.Fw = 64000 * 'kg/h' ;
241        S101.T = 303.15 * 'K' ;
242        S101.P = 1 * 'atm' ;
243        # Water
244        S102.CompositionOfFluid = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
245        S102.CompositionOfSolid = [0.4024, 0.3823, 0.1670, 0, 0.0483, 0, 0, 0, 0];
246        S102.Solid.Fw = 1e-6 * 'kg/h' ;
247        S102.T = 323.15 * 'K' ;
248        S102.P = 1 * 'atm' ;
249       
250        M101.WFPTC = 0;
251        M101.Duty = 16 * 'kW*h/t';
252        M101.humidity = 0.53;
253        M101.impurity = 0.0001;
254        M101.Extract = 0.70;
255#       M101.Work=1024*'kW';
256
257#*-------------------------------------------------------------------
258* Define o valor dos parametros declarados no modelo
259*--------------------------------------------------------------------*#
260
261        SET
262        NComp = PP.NumberOfComponents();
263        NCompS = PPS.NumberOfComponents();
264        S101.CompositionBasis = "Mass";
265        S102.CompositionBasis = "Mass";
266       
267        M101.Brix = [0, 1, 1, 1,  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
268       
269#*-------------------------------------------------------------------
270* Condicoes iniciais e opcoes de Solver
271*--------------------------------------------------------------------*#
272
273        OPTIONS
274        Dynamic = false;
275        NLASolver(
276                File = "sundials",
277                RelativeAccuracy = 1e-3,
278                AbsoluteAccuracy = 1e-6,
279                MaxIterations = 100
280        );
281       
282end
283
Note: See TracBrowser for help on using the repository browser.