source: branches/gui/eml/mixers_splitters/mixer.mso @ 577

Last change on this file since 577 was 574, checked in by Rafael de Pelegrini Soares, 15 years ago

Updated the models to work with some language constraints

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.3 KB
RevLine 
[1]1#*-------------------------------------------------------------------
[76]2* EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC.
3*
4* This LIBRARY is free software; you can distribute it and/or modify
5* it under the therms of the ALSOC FREE LICENSE as available at
6* http://www.enq.ufrgs.br/alsoc.
7*
8* EMSO Copyright (C) 2004 - 2007 ALSOC, original code
9* from http://www.rps.eng.br Copyright (C) 2002-2004.
10* All rights reserved.
11*
12* EMSO is distributed under the therms of the ALSOC LICENSE as
13* available at http://www.enq.ufrgs.br/alsoc.
14*
15*-------------------------------------------------------------------
[554]16* Author: Rafael de Pelegrini Soares
17*         Maurício Carvalho Maciel
[1]18* $Id: mixer.mso 574 2008-07-25 14:18:50Z rafael $
19*--------------------------------------------------------------------*#
20
[400]21using "streams";
[1]22
[363]23Model mixer
[269]24        ATTRIBUTES
25        Pallete         = true;
[304]26        Icon            = "icon/mixer";
[269]27        Brief           = "Model of a mixer";
[354]28        Info            =
29"== Assumptions ==
[363]30* static
[354]31* adiabatic
[363]32
[354]33== Specify ==
34* the inlet streams";
[269]35       
[554]36        VARIABLES
37in  Inlet1 as stream (Brief = "Inlet stream 1", PosX=0, PosY=0.25, Symbol="_{in1}");
38in  Inlet2 as stream (Brief = "Inlet stream 2", PosX=0, PosY=0.75, Symbol="_{in2}");
39out Outlet as streamPH (Brief = "Outlet stream", PosX=1, PosY=0.5059, Symbol="_{out}");
40       
41        EQUATIONS
42       
43        "Flow"
44        Outlet.F = Inlet1.F + Inlet2.F;
45
46        "Composition"
47    Outlet.F*Outlet.z = Inlet1.F*Inlet1.z + Inlet2.F*Inlet2.z;
48
49        "Energy Balance"
50        Outlet.F*Outlet.h = Inlet1.F*Inlet1.h + Inlet2.F*Inlet2.h;
51
52        "Pressure"
53        Outlet.P = min([Inlet1.P, Inlet2.P]);
54end
55
56Model mixer_n
57        ATTRIBUTES
58        Pallete         = true;
59        Icon            = "icon/mixer";
60        Brief           = "Model of a mixer";
61        Info            =
62"== Assumptions ==
63* static
64* adiabatic
65
66== Specify ==
67* the inlet streams";
68       
[1]69        PARAMETERS
[176]70outer NComp as Integer (Brief = "Number of chemical components", Lower = 1);
71          Ninlet as Integer (Brief = "Number of Inlet Streams", Lower = 1, Default = 2);
[1]72       
73        VARIABLES
[400]74in  Inlet(Ninlet) as stream (Brief = "Inlet streams", PosX=0, PosY=0.5, Symbol="_{inMix}");
[363]75out Outlet                      as streamPH (Brief = "Outlet stream", PosX=1, PosY=0.5059, Symbol="_{out}");
[1]76       
77        EQUATIONS
78       
79        "Flow"
[400]80        Outlet.F = sum(Inlet.F);
[363]81
[574]82        for i in [1:NComp] do
[1]83       
84                "Composition"
[400]85        Outlet.F*Outlet.z(i) = sum(Inlet.F*Inlet.z(i));
[1]86    end
87
88        "Energy Balance"
[400]89        Outlet.F*Outlet.h = sum(Inlet.F*Inlet.h);
[363]90
[1]91        "Pressure"
[400]92        Outlet.P = min(Inlet.P);
[1]93end
Note: See TracBrowser for help on using the repository browser.