Changeset 117 for branches/newlanguage/eml/streams.mso
- Timestamp:
- Jan 15, 2007, 4:43:56 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/newlanguage/eml/streams.mso
r79 r117 23 23 24 24 Model stream 25 ATTRIBUTES 26 Pallete = false; 27 Brief = "General Material Stream"; 28 Documentation = 29 "This is the basic building block for the EML models. 30 Every model should have input and output streams derived 31 from this model."; 32 25 33 PARAMETERS 26 extNComp as Integer (Brief = "Number of chemical components", Lower = 1);34 outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); 27 35 28 36 VARIABLES … … 30 38 T as temperature; 31 39 P as pressure; 32 z(NComp) as fraction (Brief = "Molar Fraction");40 z(NComp) as fraction(Brief = "Overall Molar Fraction"); 33 41 h as enth_mol; 34 v as fraction 42 v as fraction(Brief = "Vapourisation fraction"); 35 43 end 36 44 37 Model stream_therm as stream 45 Model liquid_stream as stream 46 ATTRIBUTES 47 Pallete = false; 48 Brief = "Liquid Material Stream"; 49 Documentation = 50 "Model for liquid material streams. 51 This model should be used only when the phase of the stream 52 is known ''a priori''."; 53 38 54 PARAMETERS 39 ext PP as CalcObject (Brief = "External Physical Properties");55 outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); 40 56 41 57 EQUATIONS 42 h = (1-v)*PP.LiquidEnthalpy(T, P, z) + v*PP.VapourEnthalpy(T, P, z); 58 "Liquid Enthalpy" 59 h = PP.LiquidEnthalpy(T, P, z); 60 "Liquid stream" 61 v = 0; 43 62 end 44 63 45 Model streamTP as stream_therm 64 Model vapour_stream as stream 65 ATTRIBUTES 66 Pallete = false; 67 Brief = "Vapour Material Stream"; 68 Documentation = 69 "Model for vapour material streams. 70 This model should be used only when the phase of the stream 71 is known ''a priori''."; 72 46 73 PARAMETERS 47 ext PP as CalcObject (Brief = "External Physical Properties");74 outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); 48 75 49 76 EQUATIONS 50 v = PP.VapourFraction(T, P, z); 77 "Vapour Enthalpy" 78 h = PP.VapourEnthalpy(T, P, z); 79 "Vapour stream" 80 v = 1; 51 81 end 52 82 83 Model source 84 ATTRIBUTES 85 Documentation = 86 "Material stream source. 87 This model should be used for boundary streams. 88 Usually these streams are known and come from another process 89 units."; 90 91 PARAMETERS 92 outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); 93 outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); 94 95 VARIABLES 96 out Outlet as stream; 97 x(NComp) as fraction(Brief = "Liquid Molar Fraction"); 98 y(NComp) as fraction(Brief = "Vapour Molar Fraction"); 99 100 EQUATIONS 101 "Flash Calculation" 102 [Outlet.v, x, y] = PP.Flash(Outlet.T, Outlet.P, Outlet.z); 103 "Overall Enthalpy" 104 Outlet.h = (1-Outlet.v)*PP.LiquidEnthalpy(Outlet.T, Outlet.P, x) + 105 Outlet.v*PP.VapourEnthalpy(Outlet.T, Outlet.P, y); 106 end 107 108 Model sink 109 ATTRIBUTES 110 Documentation = 111 "Material stream sink. 112 This model should be used for boundary streams."; 113 114 PARAMETERS 115 outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); 116 outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); 117 118 VARIABLES 119 in Inlet as stream; 120 v as fraction; 121 x(NComp) as fraction(Brief = "Liquid Molar Fraction"); 122 y(NComp) as fraction(Brief = "Vapour Molar Fraction"); 123 124 EQUATIONS 125 "Flash Calculation" 126 [v, x, y] = PP.PHFlash(Inlet.P, Inlet.h, Inlet.z); 127 end
Note: See TracChangeset
for help on using the changeset viewer.