 Timestamp:
 Apr 16, 2016, 1:57:07 PM (6 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/eml/water_steam/power_plant.mso
r354 r964 28 28 EnergiaInterna as Real(Default=2,Lower=0,Upper=10,Unit='MJ/kg'); 29 29 Entalpia as Real(Default=3,Lower=1e3,Upper=7,Unit='MJ/kg'); 30 Entropia as Real(Default=5,Lower=1e3,Upper=8,Unit='kJ/kg/K'); 30 EntalpiaMol as Real(Default=3,Lower=1e3,Upper=7,Unit='kJ/kmol'); 31 Entropia as Real(Default=5,Lower=1e3,Upper=10,Unit='kJ/kg/K'); 31 32 Fracao as Real(Default=0.5,Lower=0,Upper=1); 32 Potencia as Real(Default=10,Lower=0,Upper=500,Unit='1000*kW' );33 Potencia as Real(Default=10,Lower=0,Upper=500,Unit='1000*kW', Color="Red"); 33 34 Pressao as Real(Default=1,Lower=5e4,Upper=20,Unit='MPa'); 34 35 MassaEspecifica as Real(Default=1e3,Lower=1e3,Upper=1e6,Unit='kg/m^3'); … … 37 38 VazaoMassica as Real(Default=50,Lower=0,Upper=1e4,Unit='kg/s'); 38 39 VolumeEspecifico as Real(Default=1e3,Lower=1e6,Upper=500,Unit='m^3/kg'); 40 Pot_sinal as Potencia(Color="Red", LineDashed=true); 41 positive as Real (Brief = "Positive General Constant", Default=1.0, Lower=1e6); 42 mol as positive (Brief = "Moles", Default=2500, Upper=1e9, final Unit = 'kmol'); 43 fraction as Real (Brief = "Fraction" , Default=0.5, Lower=1e6, Upper=1.00001); 44 molweight as Real (Brief = "Molar Weight", Default=75, Lower=1, Upper=1e8, final Unit = 'kg/kmol'); 45 Volume as Real (Default=1e3,Lower=1e6,Upper=500,Unit='m^3'); 46 Reacao_mol as Real (Brief = "Molar Reaction Rate", Default=0, Lower=1e6, Upper=1e6, final Unit = 'kmol/h/m^3'); 47 VazaoMolar as Real(Default=50,Lower=0,Upper=1e4,Unit='kmol/s'); 39 48 40 49 Model Corrente … … 44 53 P as Pressao; 45 54 T as Temperatura; 46 S as Entropia; 47 H as Entalpia; 48 end 55 S as Entropia; # (Lower=2); 56 H as Entalpia; # (Lower=100); 57 end 58 59 Model CorrenteZ as Corrente 60 PARAMETERS 61 outer Ncomp as Integer; 62 63 VARIABLES 64 z(NComp) as fraction; 65 end 66 67 Model CorrenteVap as CorrenteZ 68 ATTRIBUTES 69 Pallete = false; 70 Brief = "Vapour Material Stream"; 71 Info = 72 "Model for vapour material streams. 73 This model should be used only when the phase of the stream 74 is known ''a priori''."; 75 76 PARAMETERS 77 outer PP as Plugin(Brief = "External Physical Properties"); 78 79 EQUATIONS 80 "Vapour Enthalpy" 81 H = PP.VapourEnthalpy(T, P, z); 82 "Vapour Entropy" 83 S = PP.VapourEntropy(T, P, z); 84 end 85 86 Model Fonte2 87 ATTRIBUTES 88 Pallete = true; 89 Icon = "icon/fonte2"; 90 Brief="Corrente de saída"; 91 Info = " "; 92 93 PARAMETERS 94 outer PP2 as Plugin(Brief="Steam tables"); 95 96 VARIABLES 97 out Fout as Corrente(Symbol="_{out}", PosX = 1, PosY = 0.5); 98 99 EQUATIONS 100 [Fout.S,Fout.H] = PP2.propPTl(Fout.P,Fout.T); 101 end 102 103 104 Model Sumidouro 105 ATTRIBUTES 106 Pallete = true; 107 Icon = "icon/sumidouro"; 108 Brief="Sumidouro de corrente de processo"; 109 Info = " "; 110 111 VARIABLES 112 in Fin as Corrente(Symbol="_{in}", PosX = 0, PosY = 0.5 ); 113 end 114 115 116 Model SumidouroQ 117 ATTRIBUTES 118 Pallete = true; 119 Icon = "icon/sumidouroQ"; 120 Brief="Sumidouro de calor"; 121 122 VARIABLES 123 in Qin as Potencia(Symbol="_{in}", PosX = 0, PosY = 0.5); 124 end 125 49 126 50 127 # Modelo de turbina sem sangria 51 128 Model Turbina 52 PARAMETERS 53 outer propterm as Plugin(Brief="Steam tables", Type="water"); 129 ATTRIBUTES 130 Pallete = true; 131 Icon = "icon/turbina"; 132 133 134 PARAMETERS 135 outer PP2 as Plugin(Brief="Steam tables"); 54 136 55 137 VARIABLES 56 138 H_IS as Entalpia; 57 139 EF_T as Eficiencia (Brief="Eficiencia da turbina"); 58 POT_TURB as Potencia (Brief="Potencia da turbina");59 in Fin as Corrente (Symbol="_{in}");60 out Fout as Corrente (Symbol="_{out}");61 62 EQUATIONS 63 64 H_IS = propterm.propPS(Fout.P,Fin.S);140 in Fin as Corrente (Symbol="_{in}", PosX = 0, PosY = 0.25); 141 out POT_TURB as Potencia (Brief="Potencia da turbina",PosX = 1, PosY = 0.5); 142 out Fout as Corrente (Symbol="_{out}", PosX = 1, PosY = 1); 143 144 EQUATIONS 145 146 H_IS = PP2.propPS(Fout.P,Fin.S); 65 147 66 148 Fout.H = (H_IS  Fin.H) * EF_T + Fin.H; 67 149 68 [Fout.S,Fout.T] = propterm.propPH(Fout.P,Fout.H);150 [Fout.S,Fout.T] = PP2.propPH(Fout.P,Fout.H); 69 151 70 152 Fin.F * (Fin.H  Fout.H) = POT_TURB; … … 75 157 # Modelo de turbina com sangria 76 158 Model Turbina_sangra 77 PARAMETERS 78 outer propterm as Plugin(Brief="Steam tables", Type="water"); 159 ATTRIBUTES 160 Pallete = true; 161 Icon = "icon/turbina_sa"; 162 163 164 PARAMETERS 165 outer PP2 as Plugin(Brief="Steam tables"); 79 166 80 167 VARIABLES 81 168 H_IS as Entalpia; 82 169 EF_T as Eficiencia(Brief="Eficiencia da turbina"); 83 POT_TURB as Potencia(Brief="Potencia da turbina");170 out POT_TURB as Potencia(Brief="Potencia da turbina", PosX = 0.9, PosY = 0.45); 84 171 y as Fracao(Brief="Fracao massica da sangria"); 85 in Fin as Corrente (Symbol="_{in}" );86 out Fout as Corrente (Symbol="_{out}" );87 out Fouts as Corrente (Symbol="_{outx}" );#(Brief="Sangria da Turbina")88 89 EQUATIONS 90 91 H_IS = propterm.propPS(Fout.P,Fin.S);172 in Fin as Corrente (Symbol="_{in}", PosX = 0, PosY = 0.25); 173 out Fout as Corrente (Symbol="_{out}", PosX = 1, PosY = 0.85); 174 out Fouts as Corrente (Symbol="_{outx}", PosX = 0.85, PosY = 1); #(Brief="Sangria da Turbina"); 175 176 EQUATIONS 177 178 H_IS = PP2.propPS(Fout.P,Fin.S); 92 179 93 180 Fout.H = (H_IS  Fin.H) * EF_T + Fin.H; 94 181 95 [Fout.S,Fout.T] = propterm.propPH(Fout.P,Fout.H);182 [Fout.S,Fout.T] = PP2.propPH(Fout.P,Fout.H); 96 183 97 184 Fin.F * (Fin.H  Fout.H) = POT_TURB; … … 107 194 # Modelo de condensador com uma alimentacao 108 195 Model Condensador 109 PARAMETERS 110 outer propterm as Plugin(Brief="Steam tables", Type="water"); 111 112 VARIABLES 113 Q_COND as Potencia (Brief="Taxa de calor removido"); 196 ATTRIBUTES 197 Pallete = true; 198 Icon = "icon/condensador"; 199 200 PARAMETERS 201 outer PP2 as Plugin(Brief="Steam tables"); 202 203 VARIABLES 204 out Q_COND as Potencia (Brief="Taxa de calor removido",PosX = 1, PosY = 0.5); 114 205 G_S as Dif_Temp (Brief="Grau de subresfriamento"); 115 in Fin as Corrente (Symbol="_{in}" );116 out Fout as Corrente (Symbol="_{out}" );206 in Fin as Corrente (Symbol="_{in}", PosX = 0.5, PosY = 0); 207 out Fout as Corrente (Symbol="_{out}", PosX = 0.5, PosY = 1); 117 208 118 209 EQUATIONS 119 210 120 211 Fout.P = Fin.P; 121 Fout.T = propterm.Tsat(Fout.P)  G_S;122 123 [Fout.S,Fout.H] = propterm.propPTl(Fout.P,Fout.T);212 Fout.T = PP2.Tsat(Fout.P)  G_S; 213 214 [Fout.S,Fout.H] = PP2.propPTl(Fout.P,Fout.T); 124 215 125 216 Q_COND = Fin.F * (Fin.H  Fout.H); … … 130 221 Model Condensador_2alim 131 222 PARAMETERS 132 outer propterm as Plugin(Brief="Steam tables", Type="water");223 outer PP2 as Plugin(Brief="Steam tables"); 133 224 134 225 VARIABLES … … 142 233 143 234 Fout.P = Fin1.P; 144 Fout.T = propterm.Tsat(Fout.P)  G_S;145 146 [Fout.S,Fout.H] = propterm.propPTl(Fout.P,Fout.T);235 Fout.T = PP2.Tsat(Fout.P)  G_S; 236 237 [Fout.S,Fout.H] = PP2.propPTl(Fout.P,Fout.T); 147 238 148 239 Fout.F = Fin1.F + Fin2.F; … … 150 241 end 151 242 152 # Modelo de tanque de armazenamento com tres alimentacoes 243 # Modelo de tanque de armazenamento com dois alimentacoes 244 Model Tanque2 245 ATTRIBUTES 246 Pallete = true; 247 Icon = "icon/tanque2"; 248 PARAMETERS 249 outer PP2 as Plugin(Brief="Steam tables"); 250 251 VARIABLES 252 in Fin1 as Corrente (Symbol="_{in1}",PosX = 0.1, PosY = 0.20); 253 in Fin2 as Corrente (Symbol="_{in2}",PosX = 0.1, PosY = 0.79); 254 out Fout as Corrente (Symbol="_{out}",PosX = 0.9, PosY = 0.5); 255 256 EQUATIONS 257 258 Fout.F = Fin1.F + Fin2.F; 259 Fout.F * Fout.H = Fin1.F * Fin1.H + Fin2.F * Fin2.H; 260 261 [Fout.S,Fout.T] = PP2.propPH(Fout.P,Fout.H); 262 end 263 264 # Modelo de tanque de armazenamento com tres alimentacoes sem perdas 265 153 266 Model Tanque 154 PARAMETERS 155 outer propterm as Plugin(Brief="Steam tables", Type="water"); 267 268 PARAMETERS 269 270 outer PP2 as Plugin(Brief="Steam tables"); 271 272 273 274 VARIABLES 275 276 in Fin1 as Corrente (Symbol="_{in1}"); 277 278 in Fin2 as Corrente (Symbol="_{in2}"); 279 280 in Fin3 as Corrente (Symbol="_{in3}"); 281 282 out Fout as Corrente (Symbol="_{out}"); 283 284 285 286 EQUATIONS 287 288 289 290 Fout.F = Fin1.F + Fin2.F + Fin3.F; 291 292 Fout.F * Fout.H = Fin1.F * Fin1.H + Fin2.F * Fin2.H + Fin3.F * Fin3.H; 293 294 295 296 [Fout.S,Fout.T] = PP2.propPH(Fout.P,Fout.H); 297 298 end 299 300 301 302 # Modelo de tanque de armazenamento com tres alimentacoes e perdas 303 Model Tanque3 304 PARAMETERS 305 outer PP2 as Plugin(Brief="Steam tables"); 156 306 157 307 VARIABLES … … 160 310 in Fin3 as Corrente (Symbol="_{in3}"); 161 311 out Fout as Corrente (Symbol="_{out}"); 162 163 EQUATIONS 164 165 Fout.F = Fin1.F + Fin2.F + Fin3.F; 166 Fout.F * Fout.H = Fin1.F * Fin1.H + Fin2.F * Fin2.H + Fin3.F * Fin3.H; 167 168 [Fout.S,Fout.T] = propterm.propPH(Fout.P,Fout.H); 312 out Fperda as Corrente (Symbol="_{perda}"); 313 314 EQUATIONS 315 316 Fout.F = Fin1.F + Fin2.F + Fin3.F  Fperda.F; 317 Fout.F * Fout.H = Fin1.F * Fin1.H + Fin2.F * Fin2.H + Fin3.F * Fin3.H  Fperda.F*Fperda.H; 318 319 [Fout.S,Fout.T] = PP2.propPH(Fout.P,Fout.H); 320 Fperda.S = Fout.S; 321 Fperda.T = Fout.T; 322 Fperda.P = Fout.P; 323 Fperda.H = Fout.H; 324 325 end 326 327 328 # Modelo de tanque de armazenamento com quatro alimentacoes 329 Model Tanque4 330 PARAMETERS 331 outer PP2 as Plugin(Brief="Steam tables"); 332 333 VARIABLES 334 in Fin1 as Corrente (Symbol="_{in1}"); 335 in Fin2 as Corrente (Symbol="_{in2}"); 336 in Fin3 as Corrente (Symbol="_{in3}"); 337 in Fin4 as Corrente (Symbol="_{in4}"); 338 out Fout as Corrente (Symbol="_{out}"); 339 340 EQUATIONS 341 342 Fout.F = Fin1.F + Fin2.F + Fin3.F + Fin4.F; 343 Fout.F * Fout.H = Fin1.F * Fin1.H + Fin2.F * Fin2.H + Fin3.F * Fin3.H + Fin4.F * Fin4.H; 344 345 [Fout.S,Fout.T] = PP2.propPH(Fout.P,Fout.H); 346 end 347 348 349 # Modelo de tanque de armazenamento com quatro alimentacoes e perdas 350 351 352 353 Model Tanque4perdas 354 ATTRIBUTES 355 Pallete = true; 356 Icon = "icon/tanque4perdas"; 357 358 PARAMETERS 359 outer PP2 as Plugin(Brief="Steam tables"); 360 361 VARIABLES 362 y as Fracao(Brief="Fracao massica de perdas"); 363 Fsalida as VazaoMassica; 364 in Fin1 as Corrente (Symbol="_{in1}", PosX = 0.1, PosY = 0.16); 365 in Fin2 as Corrente (Symbol="_{in2}", PosX = 0.1, PosY = 0.35); 366 in Fin3 as Corrente (Symbol="_{in3}", PosX = 0.1, PosY = 0.55); 367 in Fin4 as Corrente (Symbol="_{in4}", PosX = 0.1, PosY = 0.75); 368 out Fout as Corrente (Symbol="_{out}", PosX = 1, PosY = 0.45); 369 out Fperda as Corrente (Symbol="_{perdas}",PosX = 0.5, PosY = 1); 370 371 EQUATIONS 372 373 Fout.F = Fin1.F + Fin2.F + Fin3.F + Fin4.F  Fperda.F; 374 Fsalida= Fin1.F + Fin2.F + Fin3.F + Fin4.F; 375 Fperda.F=y*Fsalida; 376 377 Fout.F * Fout.H = Fin1.F * Fin1.H + Fin2.F * Fin2.H + Fin3.F * Fin3.H + 378 Fin4.F * Fin4.H  Fperda.F*Fperda.H; 379 380 [Fout.S,Fout.T] = PP2.propPH(Fout.P,Fout.H); 381 Fperda.S = Fout.S; 382 Fperda.T = Fout.T; 383 Fperda.P = Fout.P; 384 Fperda.H = Fout.H; 385 end 386 387 # Modelo de desaerador (tanque) com 5 entradas e saída líquido saturado (x=0) 388 Model Desaerador5 389 ATTRIBUTES 390 Pallete = true; 391 Icon = "icon/desaerador"; 392 PARAMETERS 393 outer PP2 as Plugin(Brief="Steam tables"); 394 395 VARIABLES 396 in Fin1 as Corrente (Symbol="_{in1}", PosX = 1, PosY = 0.2); 397 in Fin2 as Corrente (Symbol="_{in2}", PosX = 1, PosY = 0.45); 398 in Fin3 as Corrente (Symbol="_{in3}", PosX = 1, PosY = 0.7); 399 in Fin4 as Corrente (Symbol="_{in4}", PosX = 1, PosY = 0.9); 400 in Fin5 as Corrente (Symbol="_{in5}", PosX = 0.5, PosY = 0); 401 out Fout as Corrente (Symbol="_{out}", PosX = 0, PosY = 0.85); 402 403 EQUATIONS 404 405 Fout.F = Fin1.F + Fin2.F + Fin3.F + Fin4.F + Fin5.F; 406 Fout.F * Fout.H = Fin1.F * Fin1.H + Fin2.F * Fin2.H + Fin3.F * Fin3.H + Fin4.F * Fin4.H + Fin5.F * Fin5.H; 407 #Fout.T = PP2.Tsat(Fout.P); 408 409 [Fout.S,Fout.H] = PP2.propPTl(Fout.P,Fout.T); 169 410 end 170 411 … … 172 413 Model Trocador 173 414 PARAMETERS 174 outer propterm as Plugin(Brief="Steam tables", Type="water");415 outer PP2 as Plugin(Brief="Steam tables"); 175 416 176 417 VARIABLES … … 185 426 Fout.P = Fin.P  DP; 186 427 Fout.F * (Fout.H  Fin.H) = Q; 187 [Fout.S,Fout.T] = propterm.propPH(Fout.P,Fout.H);428 [Fout.S,Fout.T] = PP2.propPH(Fout.P,Fout.H); 188 429 end 189 430 190 431 # Modelo de torre de refrigeracao 191 432 Model Torre 433 ATTRIBUTES 434 Pallete = true; 435 Icon = "icon/torreresf"; 436 192 437 PARAMETERS 193 438 cpa as CalorEspecifico; … … 195 440 VARIABLES 196 441 F as VazaoMassica; 197 Q as Potencia;442 in Qin as Potencia (Symbol="_{in1}", PosX = 0.1, PosY = 0.5); 198 443 DTh as Dif_Temp; 199 444 DTc as Dif_Temp; … … 210 455 DTh = Th  Tar_h; 211 456 DTc = Tc  Tar_c; 212 F * cpa * (Th  Tc) = Q ;213 Uat * (DTh  DTc) = Q * ln(abs(DTh/DTc));214 # Uat * 0.5 * (DTh + DTc) = Q ;457 F * cpa * (Th  Tc) = Qin; 458 Uat * (DTh  DTc) = Qin * ln(abs(DTh/DTc)); 459 # Uat * 0.5 * (DTh + DTc) = Qin; 215 460 end 216 461 217 462 # Modelo de bomba 218 463 Model Bomba 219 PARAMETERS 220 outer propterm as Plugin(Brief="Steam tables", Type="water"); 221 v_esp as VolumeEspecifico; 464 ATTRIBUTES 465 Pallete = true; 466 Icon = "icon/bomba1"; 467 468 469 PARAMETERS 470 outer PP2 as Plugin(Brief="Steam tables"); 471 # v_esp as VolumeEspecifico; 222 472 223 473 VARIABLES 224 474 H_IS as Entalpia; 225 POT_BMB as Potencia(Brief="Potencia do motor da bomba");475 out POT_BMB as Pot_sinal(Brief="Potencia do motor da bomba", PosX = 0.5, PosY = 1 ); 226 476 POT_EF as Potencia(Brief="Potencia injetada pela bomba"); 227 477 EF_B as Eficiencia(Brief="Eficiencia da bomba"); 228 478 in Fin as Corrente (Symbol="_{in}"); 229 out Fout as Corrente (Symbol="_{out}"); 230 231 EQUATIONS 232 233 H_IS = propterm.propPS(Fout.P,Fin.S); 479 out Fout as Corrente (Symbol="_{out}",PosX = 0, PosY = 0.2); 480 v_esp as VolumeEspecifico; 481 482 EQUATIONS 483 484 v_esp = PP2.Vesp(Fin.P,Fin.T); 485 486 H_IS = PP2.propPS(Fout.P,Fin.S); 234 487 235 488 (Fout.H  Fin.H) * EF_B = H_IS  Fin.H; 236 489 # (Fout.H  Fin.H) * Fin.F = POT_EF; # Forma alternativa 237 490 238 [Fout.S,Fout.T] = propterm.propPH(Fout.P,Fout.H);491 [Fout.S,Fout.T] = PP2.propPH(Fout.P,Fout.H); 239 492 240 493 POT_EF = POT_BMB * EF_B; … … 243 496 end 244 497 498 245 499 # Modelo de gerador de vapor 246 500 Model Gerador_Vapor 247 PARAMETERS 248 outer propterm as Plugin(Brief="Steam tables", Type="water"); 249 250 VARIABLES 251 Q_GV as Potencia (Brief="Taxa de calor gerado na caldeira"); 501 ATTRIBUTES 502 Pallete = true; 503 Icon = "icon/caldeira"; 504 505 PARAMETERS 506 outer PP2 as Plugin(Brief="Steam tables"); 507 508 VARIABLES 509 out Q_GV as Pot_sinal (Brief="Taxa de calor gerado na caldeira", PosX = 1, PosY = 0.5); 252 510 EF_GV as Eficiencia (Brief="Eficiencia do gerador de vapor"); 253 511 Qra as Potencia (Brief="Taxa de calor nos reaquecedores"); … … 255 513 Qca as Potencia (Brief="Taxa de calor no evaporador"); 256 514 Qec as Potencia (Brief="Taxa de calor nos economizadores"); 257 in Fin_a as Corrente (Brief="Agua de alimentacao", Symbol="_{in_a}" );258 in Fin_ra as Corrente (Brief="Vapor a ser Reaquecido", Symbol="_{in_ra}" );259 out Fout_sa as Corrente (Brief="Vapor Superaquecido", Symbol="_{out_sa}" );260 out Fout_ra as Corrente (Brief="Vapor Reaquecido", Symbol="_{out_ra}" );515 in Fin_a as Corrente (Brief="Agua de alimentacao", Symbol="_{in_a}", PosX = 0.5, PosY = 1); 516 in Fin_ra as Corrente (Brief="Vapor a ser Reaquecido", Symbol="_{in_ra}", PosX = 0.7, PosY = 1); 517 out Fout_sa as Corrente (Brief="Vapor Superaquecido", Symbol="_{out_sa}", PosX = 0.5, PosY = 0); 518 out Fout_ra as Corrente (Brief="Vapor Reaquecido", Symbol="_{out_ra}", PosX = 0.7, PosY = 0); 261 519 Fvap as Corrente (Brief="Evaporador"); 262 520 Feco as Corrente (Brief="Economizadores"); … … 264 522 EQUATIONS 265 523 266 # [Fin_a.S,Fin_a.H] = propterm.propPTl(Fin_a.P,Fin_a.T); # Reduntante no ciclo fechado524 # [Fin_a.S,Fin_a.H] = PP2.propPTl(Fin_a.P,Fin_a.T); # Reduntante no ciclo fechado 267 525 268 526 "Economizadores ECO1 + ECO1" 269 527 # Feco.F = Fin_a.F; # Reduntante no ciclo fechado 270 [Feco.S,Feco.H] = propterm.propPTv(Feco.P,Feco.T);528 [Feco.S,Feco.H] = PP2.propPTv(Feco.P,Feco.T); 271 529 Qec = Feco.F * (Feco.H  Fin_a.H); 272 530 273 531 "Evaporador  Camisa dagua" 274 532 Fvap.F = Feco.F; 275 [Fvap.S,Fvap.H] = propterm.propPTv(Fvap.P,Fvap.T);533 [Fvap.S,Fvap.H] = PP2.propPTv(Fvap.P,Fvap.T); 276 534 Qca = Fvap.F * (Fvap.H  Feco.H); 277 535 278 536 "Superaquecedores BT + AT" 279 537 Fout_sa.F = Fvap.F; 280 [Fout_sa.S,Fout_sa.H] = propterm.propPTv(Fout_sa.P,Fout_sa.T);538 [Fout_sa.S,Fout_sa.H] = PP2.propPTv(Fout_sa.P,Fout_sa.T); 281 539 Qsa = Fout_sa.F * (Fout_sa.H  Fvap.H); 282 540 283 541 "Reaquecedores BT + AT" 284 542 Fout_ra.F = Fin_ra.F; 285 [Fout_ra.S,Fout_ra.H] = propterm.propPTv(Fout_ra.P,Fout_ra.T);543 [Fout_ra.S,Fout_ra.H] = PP2.propPTv(Fout_ra.P,Fout_ra.T); 286 544 Qra = Fout_ra.F * (Fout_ra.H  Fin_ra.H); 287 545 … … 290 548 end 291 549 550 551 # Modelo de gerador de vapor modificado 552 Model Gerador_VaporMod 553 ATTRIBUTES 554 Pallete = true; 555 Icon = "icon/caldeira"; 556 557 558 PARAMETERS 559 outer PP2 as Plugin(Brief="Steam tables"); 560 561 VARIABLES 562 out Q_GV as Pot_sinal (Brief="Taxa de calor gerado na caldeira", PosX = 1, PosY = 0.5); 563 EF_GV as Eficiencia (Brief="Eficiencia do gerador de vapor"); 564 Qpre as Potencia (Brief="Taxa de calor no pre aquecedor de ar"); 565 Qsa as Potencia (Brief="Taxa de calor nos superaquecedores"); 566 Qca as Potencia (Brief="Taxa de calor no evaporador"); 567 Qec as Potencia (Brief="Taxa de calor nos economizadores"); 568 in Fin_a as Corrente (Brief="Agua de alimentacao", Symbol="_{in_a}", PosX = 0.5, PosY = 1); 569 out Fout_sa as Corrente (Brief="Vapor Superaquecido", Symbol="_{out_sa}", PosX = 0.5, PosY = 0); 570 Fvap as Corrente (Brief="Evaporador"); 571 Feco as Corrente (Brief="Economizadores"); 572 573 EQUATIONS 574 575 # [Fin_a.S,Fin_a.H] = PP2.propPTl(Fin_a.P,Fin_a.T); # Reduntante no ciclo fechado 576 577 "Economizadores ECO1 + ECO1" 578 # Feco.F = Fin_a.F; # Reduntante no ciclo fechado 579 [Feco.S,Feco.H] = PP2.propPTv(Feco.P,Feco.T); 580 Qec = Feco.F * (Feco.H  Fin_a.H); 581 582 "Evaporador  Camisa dagua" 583 Fvap.F = Feco.F; 584 [Fvap.S,Fvap.H] = PP2.propPTv(Fvap.P,Fvap.T); 585 Qca = Fvap.F * (Fvap.H  Feco.H); 586 587 "Superaquecedores BT + AT" 588 Fout_sa.F = Fvap.F; 589 [Fout_sa.S,Fout_sa.H] = PP2.propPTv(Fout_sa.P,Fout_sa.T); 590 Qsa = Fout_sa.F * (Fout_sa.H  Fvap.H); 591 592 "Caldeira" 593 Q_GV * EF_GV = Qec + Qca + Qsa + Qpre; 594 end 595 596 292 597 # Modelo simplificado gerador de vapor 293 598 Model Gerador_Vapor_Simples 294 599 PARAMETERS 295 outer propterm as Plugin(Brief="Steam tables", Type="water");600 outer PP2 as Plugin(Brief="Steam tables"); 296 601 297 602 VARIABLES … … 305 610 Fout.P = Fin.P; 306 611 307 [Fout.S,Fout.H] = propterm.propPTv(Fout.P,Fout.T);612 [Fout.S,Fout.H] = PP2.propPTv(Fout.P,Fout.T); 308 613 309 614 Q_GV * EF_GV = Fin.F * (Fout.H  Fin.H); … … 313 618 # Modelo de gerador eletrico 314 619 Model Gerador_Eletrico 620 ATTRIBUTES 621 Pallete = true; 622 Icon = "icon/gerador"; 623 315 624 PARAMETERS 316 625 EF_GE as Eficiencia(Brief="Eficiencia do gerador eletrico"); 317 626 318 627 VARIABLES 319 POT_GE as Potencia(Brief="Potencia do gerador eletrico"); 320 end 628 out POT_GE as Pot_sinal(Brief="Potencia do gerador eletrico", PosX = 1, PosY = 0.5); 629 POT_TURB as Potencia(Brief="Potencia total das turbinas"); 630 in POT_TURB1 as Potencia(Brief="Potencia total da turbina", PosX = 0, PosY = 0.5); 631 in POT_TURB2 as Potencia(Brief="Potencia total da turbina", PosX = 0.02, PosY = 0.25); 632 in POT_TURB3 as Potencia(Brief="Potencia total da turbina", PosX = 0.02, PosY = 0.75); 633 in POT_TURB4 as Potencia(Brief="Potencia total da turbina", PosX = 0.5, PosY = 1); 634 635 EQUATIONS 636 "Potencia total das turbinas" 637 POT_TURB = POT_TURB1 + POT_TURB2 + POT_TURB3 + POT_TURB4; 638 639 "Potencia do Gerador Eletrico" 640 POT_GE = EF_GE * POT_TURB; 641 end 642 643 # Modelo de gerador eletrico 644 Model Gerador_Eletrico_Simples 645 ATTRIBUTES 646 Pallete = true; 647 Icon = "icon/gerador"; 648 649 PARAMETERS 650 EF_GE as Eficiencia(Brief="Eficiencia do gerador eletrico"); 651 652 VARIABLES 653 out POT_GE as Pot_sinal(Brief="Potencia do gerador eletrico", PosX = 1, PosY = 0.5); 654 end 655 321 656 322 657 # Modelo de separador de corrente 323 658 Model Splitter 659 ATTRIBUTES 660 Pallete = true; 661 Icon = "icon/splitter"; 662 324 663 VARIABLES 325 664 y as Fracao(Brief="Fracao de massa para a segunda corrente"); 326 in Fin as Corrente (Symbol="_{in}" );327 out Fout as Corrente (Symbol="_{out}" );328 out Fouts as Corrente(Brief="Segunda corrente", Symbol="_{outx}" );665 in Fin as Corrente (Symbol="_{in}", PosX = 0, PosY = 0.5); 666 out Fout as Corrente (Symbol="_{out}", PosX = 1, PosY = 0.25); 667 out Fouts as Corrente(Brief="Segunda corrente", Symbol="_{outx}", PosX = 1, PosY = 0.75); 329 668 330 669 EQUATIONS … … 343 682 Fout.F = Fin.F  Fouts.F; 344 683 end 684 685 686 # Modelo de separador de corrente de 4 saidas 687 Model Splitter4 688 ATTRIBUTES 689 Pallete = true; 690 Icon = "icon/splitter4"; 691 692 VARIABLES 693 y(3) as Fracao(Brief="Fracao de massa"); 694 in Fin as Corrente (Symbol="_{in}", PosX = 1, PosY = 0.5); 695 out Fout1 as Corrente (Symbol="_{out1}", PosX = 0, PosY = 0.19); 696 out Fout2 as Corrente(Symbol="_{out2}", PosX = 0, PosY = 0.4); 697 out Fout3 as Corrente (Symbol="_{out3}", PosX = 0, PosY = 0.62); 698 out Fout4 as Corrente(Symbol="_{out4}", PosX = 0, PosY = 0.85); 699 700 701 EQUATIONS 702 703 Fout1.P = Fin.P; 704 Fout1.T = Fin.T; 705 Fout1.S = Fin.S; 706 Fout1.H = Fin.H; 707 708 Fout2.P = Fin.P; 709 Fout2.T = Fin.T; 710 Fout2.S = Fin.S; 711 Fout2.H = Fin.H; 712 713 Fout3.P = Fin.P; 714 Fout3.T = Fin.T; 715 Fout3.S = Fin.S; 716 Fout3.H = Fin.H; 717 718 Fout4.P = Fin.P; 719 Fout4.T = Fin.T; 720 Fout4.S = Fin.S; 721 Fout4.H = Fin.H; 722 723 Fout1.F = Fin.F * y(1); 724 Fout2.F = Fin.F * y(2); 725 Fout3.F = Fin.F * y(3); 726 #Fout4.F = Fin.F * y(4); 727 728 729 Fout4.F = Fin.F  Fout1.F  Fout2.F  Fout3.F; 730 end 731 732 # Modelo de flash provisório, pois o PP tem cálculo de flash mas 733 # esta função não está disponibilizada no plugin (esta função seria mais 734 # eficiente nos cálculos, não teria cálculos repetitivos) 735 Model Flash 736 737 ATTRIBUTES 738 Pallete = true; 739 Icon = "icon/flash"; 740 741 PARAMETERS 742 outer PP2 as Plugin(Brief="Steam tables"); 743 744 VARIABLES 745 TIT as Fracao (Upper=2); 746 # S_ad as Entropia; 747 in Fin as Corrente (Symbol="_{in}",PosX = 1, PosY = 0.5); 748 out FoutL as Corrente (Symbol="_{outL}", PosX = 0.4, PosY = 1); 749 out FoutV as Corrente (Symbol="_{outV}", PosX = 0.4, PosY = 0); 750 751 EQUATIONS 752 753 Fin.F = FoutL.F + FoutV.F; 754 FoutV.F = TIT * Fin.F; 755 756 FoutL.T = FoutV.T; 757 FoutL.P = FoutV.P; 758 759 # [S_ad,FoutL.T] = PP2.propPH(FoutL.P,Fin.H); 760 # [FoutV.S,FoutV.H] = PP2.propPTv(FoutV.P,FoutV.T+0.1*'K'); # perturbado para evitar ir para liq. 761 # [FoutL.S,FoutL.H] = PP2.propPTl(FoutL.P,FoutL.T0.1*'K'); # perturbado para evitar ir para vap. 762 763 [FoutL.S,FoutL.H,FoutV.S,FoutV.H,FoutL.T,TIT] = PP2.FlashPH(FoutL.P,Fin.H); 764 765 # TIT * (FoutV.H  FoutL.H) = Fin.H  FoutL.H; 766 end 767 768 Model ETA_CICLO 769 ATTRIBUTES 770 Pallete = true; 771 Icon = "icon/eficiencia"; 772 773 VARIABLES 774 EF_CIC as Eficiencia; 775 in POT_BMB1 as Pot_sinal(Symbol = "_{inB1}", PosX = 0.2, PosY = 0); 776 in POT_BMB2 as Pot_sinal(Symbol = "_{inB2}", PosX = 0.4, PosY = 0); 777 in POT_BMB3 as Pot_sinal(Symbol = "_{inB3}", PosX = 0.6, PosY = 0); 778 in POT_BMB4 as Pot_sinal(Symbol = "_{inB4}", PosX = 0.8, PosY = 0); 779 in POT_BMB5 as Pot_sinal(Symbol = "_{inB5}", PosX = 0.25, PosY = 1); 780 in POT_GE as Pot_sinal(Symbol = "_{inGE}", PosX = 0.5, PosY = 1); 781 in POT_GV as Pot_sinal(Symbol = "_{inGV}", PosX = 0.75, PosY = 1); 782 783 784 EQUATIONS 785 "Eficiencia do Ciclo" 786 EF_CIC * POT_GV = POT_GE  POT_BMB1  POT_BMB2  POT_BMB3  POT_BMB4  POT_BMB5; 787 788 end 789 790 791 #* 792 * only vapour phase 793 **# 794 Model Equil_vap 795 ATTRIBUTES 796 Pallete = true; 797 Icon = "icon/cstr"; 798 Brief = "Model of a generic vapourphase equilibrium CSTR"; 799 Info = " 800 == Assumptions == 801 * only vapourphase 802 * thermodynamic equilibrium 803 * steadystate 804 805 == Specify == 806 * inlet stream 807 * stoichiometric matrix 808 * equilibrium temperature 809 "; 810 811 PARAMETERS 812 outer PP as Plugin(Brief = "External Physical Properties"); 813 NReac as Integer (Brief="Number of reactions", Default=1); 814 stoic(NComp,NReac) as Real (Brief="Stoichiometric matrix", Symbol="\nu"); 815 Rg as Real (Brief="Universal gas constant", Unit='J/mol/K', Default=8.314); 816 fs(NComp) as Pressao (Brief="Fugacity in standard state", Default=1, DisplayUnit='atm'); 817 To as Temperatura (Brief="Reference temperature", Default=298.15); 818 V as Volume; 819 Mw(NComp) as molweight; 820 821 VARIABLES 822 in Inlet as CorrenteZ (Brief="Inlet stream", PosX=0, PosY=0, Symbol="_{in}"); 823 out Outlet as CorrenteVap (Brief="Outlet stream", PosX=1, PosY=1, Symbol="_{out}"); 824 825 G(NComp) as EntalpiaMol (Brief="Gibbs freeenergy of formation"); 826 K(NReac) as Real (Brief="Equillibrium constant", Lower=0, Default=1.5); 827 activ(NComp)as Real (Brief="Activity", Symbol="\hat{a}", Lower=0, Default=0.2); 828 829 rate(NComp) as Reacao_mol (Brief="Overall component rate of reaction"); 830 extent(NReac) as VazaoMolar (Brief="Extent of reaction", Symbol="\xi"); 831 conv(NComp) as Real (Brief="Fractional conversion of component", Symbol="X", Default=0); # Lower=1e3, Upper=1e3); 832 833 SET 834 Mw = PP.MolecularWeight(); 835 836 EQUATIONS 837 "Outlet stream" 838 Outlet.F*Outlet.z = Inlet.F*Inlet.z + rate*V*Mw; 839 840 "Mechanical equilibrium" 841 Outlet.P = Inlet.P; 842 843 "Energy balance" 844 Outlet.F*Outlet.H = Inlet.F*Inlet.H; 845 846 "Steadystate" 847 Outlet.F = Inlet.F + sum(sumt(stoic*extent)*Mw); 848 849 "Gibbs freeenergy of formation" 850 G = PP.IdealGasGibbsOfFormation(Outlet.T); 851 852 # "Gibbs freeenergy of formation without Cp correction" 853 # G = PP.IdealGasGibbsOfFormationAt25C()*Outlet.T/To 854 # + PP.IdealGasEnthalpyOfFormationAt25C()*(1  Outlet.T/To); 855 856 for j in [1:NReac] do 857 "Gibbs free energy of reaction" 858 sumt(G*stoic(:,j)) = Rg*Outlet.T*ln(K(j)); 859 # K(j) = exp(sumt(G*stoic(:,j))/(Rg*Outlet.T)); 860 861 "Equilibrium constant" 862 K(j) = prod(activ^stoic(:,j)); 863 end 864 865 for i in [1:NComp] do 866 "Outlet molar fraction" 867 Outlet.F*Outlet.z(i) = (Inlet.F*Inlet.z(i) + sumt(stoic(i,:)*extent)*Mw); 868 end 869 870 for i in [1:NComp] do 871 if (Inlet.z(i) > 1e16) then 872 "Molar conversion" 873 Outlet.F*Outlet.z(i) = Inlet.F*Inlet.z(i)*(1  conv(i)); 874 else if (Outlet.z(i) > 0) then 875 "Molar conversion" 876 conv(i) = 1; # ? 877 else 878 "Molar conversion" 879 conv(i) = 0; # ? 880 end 881 end 882 end 883 884 "Activity" 885 activ = PP.VapourFugacityCoefficient(Outlet.T,Outlet.P,Outlet.z)*Outlet.P*Outlet.z/fs; 886 end 887
Note: See TracChangeset
for help on using the changeset viewer.