Skip to content

Commit a8957fa

Browse files
Merge pull request #48 from nayakpriyam/master
Added Test Examples Documentation and Modified Model Documentation
2 parents 26a5754 + 9ebb12a commit a8957fa

53 files changed

Lines changed: 1317 additions & 1174 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
package Acetic_Acid_Esterification
2+
3+
model ms
4+
extends Simulator.Streams.MaterialStream;
5+
extends Simulator.Files.ThermodynamicPackages.NRTL;
6+
end ms;
7+
8+
model Fls
9+
extends Simulator.UnitOperations.Flash;
10+
extends Simulator.Files.ThermodynamicPackages.NRTL;
11+
end Fls;
12+
13+
model Conv_React
14+
extends Simulator.UnitOperations.ConversionReactor;
15+
extends Simulator.Files.Models.ReactionManager.ConversionReaction;
16+
end Conv_React;
17+
18+
model Flowsheet
19+
20+
import data = Simulator.Files.ChemsepDatabase;
21+
parameter Integer Nc = 4;
22+
parameter data.Ethylacetate etac;
23+
parameter data.Water wat;
24+
parameter data.Aceticacid aa;
25+
parameter data.Ethanol eth;
26+
parameter data.GeneralProperties C[Nc] = {etac, wat, aa, eth};
27+
Simulator.UnitOperations.Mixer MIX_01(C = C, NI = 3, Nc = Nc, outPress = "Inlet_Average") annotation(
28+
Placement(visible = true, transformation(origin = {-48, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
29+
Acetic_Acid_Esterification.Conv_React CR_01(BC_r = {3},C = C, CalcMode = "Define_Out_Temperature", Coef_cr = {{1}, {1}, {-1}, {-1}}, Nc = Nc, Nr = 1, Tdef = 300, X_r = {0.6}) annotation(
30+
Placement(visible = true, transformation(origin = {16, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
31+
Simulator.UnitOperations.Splitter SPLIT_01(C = C, CalcType = "Split_Ratio", Nc = Nc, No = 2) annotation(
32+
Placement(visible = true, transformation(origin = {82, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
33+
Acetic_Acid_Esterification.ms S_01(C = C, Nc = Nc) annotation(
34+
Placement(visible = true, transformation(origin = {-88, 26}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
35+
Acetic_Acid_Esterification.ms S_02(C = C, Nc = Nc) annotation(
36+
Placement(visible = true, transformation(origin = {-88, -30}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
37+
Acetic_Acid_Esterification.ms S_03(C = C, Nc = Nc) annotation(
38+
Placement(visible = true, transformation(origin = {-18, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
39+
ms S_04(C = C, Nc = Nc) annotation(
40+
Placement(visible = true, transformation(origin = {48, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
41+
Acetic_Acid_Esterification.ms S_05(C = C, Nc = Nc) annotation(
42+
Placement(visible = true, transformation(origin = {116, 24}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
43+
Acetic_Acid_Esterification.ms S_06(C = C, Nc = Nc) annotation(
44+
Placement(visible = true, transformation(origin = {116, -28}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
45+
equation
46+
connect(S_05.Out, MIX_01.inlet[3]) annotation(
47+
Line(points = {{126, 24}, {140, 24}, {140, 50}, {-114, 50}, {-114, 0}, {-58, 0}, {-58, 0}}, color = {0, 70, 70}));
48+
connect(SPLIT_01.Out[1], S_05.In) annotation(
49+
Line(points = {{92, 0}, {106, 0}, {106, 24}}, color = {0, 70, 70}));
50+
connect(SPLIT_01.Out[2], S_06.In) annotation(
51+
Line(points = {{92, 0}, {106, 0}, {106, -28}}, color = {0, 70, 70}));
52+
connect(S_04.Out, SPLIT_01.In) annotation(
53+
Line(points = {{58, 0}, {72, 0}, {72, 0}, {72, 0}}, color = {0, 70, 70}));
54+
connect(CR_01.Out, S_04.In) annotation(
55+
Line(points = {{26, 0}, {38, 0}, {38, 0}, {38, 0}}, color = {0, 70, 70}));
56+
connect(S_03.Out, CR_01.In) annotation(
57+
Line(points = {{-8, 0}, {6, 0}, {6, 0}, {6, 0}}, color = {0, 70, 70}));
58+
connect(MIX_01.outlet, S_03.In) annotation(
59+
Line(points = {{-38, 0}, {-28, 0}, {-28, 0}, {-28, 0}}, color = {0, 70, 70}));
60+
connect(S_02.Out, MIX_01.inlet[2]) annotation(
61+
Line(points = {{-78, -30}, {-58, -30}, {-58, 0}, {-58, 0}}, color = {0, 70, 70}));
62+
connect(S_01.Out, MIX_01.inlet[1]) annotation(
63+
Line(points = {{-78, 26}, {-58, 26}, {-58, 0}, {-58, 0}}, color = {0, 70, 70}));
64+
65+
S_01.P = 101325;
66+
S_01.T = 300;
67+
S_01.x_pc[1, :] = {0, 0, 0, 1};
68+
S_01.F_p[1] = 60;
69+
S_02.P = 101325;
70+
S_02.T = 300;
71+
S_02.x_pc[1, :] = {0, 0, 1, 0};
72+
S_02.F_p[1] = 40;
73+
SPLIT_01.SpecVal_s = {0.75, 0.25};
74+
75+
end Flowsheet;
76+
77+
end Acetic_Acid_Esterification;

Sample_Flowsheets/Acetic_Acid_Esterification_by_Ethanol.mo

Lines changed: 0 additions & 81 deletions
This file was deleted.
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
package DiethylEther_from_Ethanol
2+
3+
model ms
4+
extends Simulator.Streams.MaterialStream;
5+
extends Simulator.Files.ThermodynamicPackages.RaoultsLaw;
6+
end ms;
7+
8+
model CR
9+
extends Simulator.UnitOperations.ConversionReactor;
10+
extends Simulator.Files.Models.ReactionManager.ConversionReaction;
11+
end CR;
12+
13+
package rigDist
14+
model Condenser
15+
extends Simulator.UnitOperations.DistillationColumn.Cond;
16+
extends Simulator.Files.ThermodynamicPackages.RaoultsLaw;
17+
end Condenser;
18+
19+
model Tray
20+
extends Simulator.UnitOperations.DistillationColumn.DistTray;
21+
extends Simulator.Files.ThermodynamicPackages.RaoultsLaw;
22+
end Tray;
23+
24+
model Reboiler
25+
extends Simulator.UnitOperations.DistillationColumn.Reb;
26+
extends Simulator.Files.ThermodynamicPackages.RaoultsLaw;
27+
end Reboiler;
28+
29+
model DistColumn
30+
31+
extends Simulator.UnitOperations.DistillationColumn.DistCol;
32+
Condenser condenser(Nc = Nc, C = C, Ctype = Ctype, Bin = Bin_t[1]);
33+
Reboiler reboiler(Nc = Nc, C = C, Bin = Bin_t[Nt]);
34+
Tray tray[Nt - 2](each Nc = Nc, each C = C, Bin = Bin_t[2:Nt - 1]);
35+
36+
end DistColumn;
37+
38+
end rigDist;
39+
40+
model Flowsheet
41+
42+
import data = Simulator.Files.ChemsepDatabase;
43+
parameter data.Diethylether dieth;
44+
parameter data.Ethanol eth;
45+
parameter data.Water wat;
46+
parameter Integer Nc = 3;
47+
parameter data.GeneralProperties C[Nc] = {dieth, eth, wat};
48+
Simulator.UnitOperations.Mixer MIX_01(C = C, NI = 2, Nc = Nc, outPress = "Inlet_Average") annotation(
49+
Placement(visible = true, transformation(origin = {-48, 48}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
50+
DiethylEther_from_Ethanol.CR REACT_01(BC_r = {2}, C = C, CalcMode = "Define_Out_Temperature", Coef_cr = {{1}, {-2}, {1}}, Nc = Nc, Nr = 1, Tdef = 298.15, X_r = {0.5}) annotation(
51+
Placement(visible = true, transformation(origin = {38, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
52+
DiethylEther_from_Ethanol.rigDist.DistColumn DC_01(C = C, Ctype = "Total", InT_s = {4}, Nc = Nc, Ni = 1, Nt = 8) annotation(
53+
Placement(visible = true, transformation(origin = {66, -38}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
54+
DiethylEther_from_Ethanol.rigDist.DistColumn DC_02(C = C, Ctype = "Total", InT_s = {7}, Nc = Nc, Ni = 1, Nt = 10) annotation(
55+
Placement(visible = true, transformation(origin = {-48, -38}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
56+
ms S_01(C = C, Nc = Nc) annotation(
57+
Placement(visible = true, transformation(origin = {-84, 66}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
58+
DiethylEther_from_Ethanol.ms S_02(C = C, Nc = Nc) annotation(
59+
Placement(visible = true, transformation(origin = {-86, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
60+
ms S_03(C = C, Nc = Nc) annotation(
61+
Placement(visible = true, transformation(origin = {-8, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
62+
ms S_04(C = C, Nc = Nc) annotation(
63+
Placement(visible = true, transformation(origin = {80, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
64+
DiethylEther_from_Ethanol.ms S_05(C = C, Nc = Nc) annotation(
65+
Placement(visible = true, transformation(origin = {10, -4}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
66+
DiethylEther_from_Ethanol.ms S_06(C = C, Nc = Nc) annotation(
67+
Placement(visible = true, transformation(origin = {8, -70}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
68+
DiethylEther_from_Ethanol.ms S_07(C = C, Nc = Nc) annotation(
69+
Placement(visible = true, transformation(origin = {-106, -8}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
70+
DiethylEther_from_Ethanol.ms S_08(C = C, Nc = Nc) annotation(
71+
Placement(visible = true, transformation(origin = {-106, -66}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
72+
Simulator.Streams.EnergyStream E_01 annotation(
73+
Placement(visible = true, transformation(origin = {20, 8}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
74+
Simulator.Streams.EnergyStream E_02 annotation(
75+
Placement(visible = true, transformation(origin = {18, -98}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
76+
Simulator.Streams.EnergyStream E_03 annotation(
77+
Placement(visible = true, transformation(origin = {10, 28}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
78+
Simulator.Streams.EnergyStream E_04 annotation(
79+
Placement(visible = true, transformation(origin = {-92, 22}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
80+
Simulator.Streams.EnergyStream E_05 annotation(
81+
Placement(visible = true, transformation(origin = {-106, -98}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
82+
equation
83+
connect(S_06.Out, DC_02.In_s[1]) annotation(
84+
Line(points = {{-2, -70}, {-6, -70}, {-6, -38}, {-22, -38}, {-22, -38}}, color = {0, 70, 70}));
85+
connect(E_05.Out, DC_02.Rduty) annotation(
86+
Line(points = {{-96, -98}, {-74, -98}, {-74, -98}, {-72, -98}}, color = {255, 0, 0}));
87+
connect(E_02.Out, DC_01.Rduty) annotation(
88+
Line(points = {{28, -98}, {40, -98}, {40, -98}, {42, -98}}, color = {255, 0, 0}));
89+
connect(DC_02.Cduty, E_04.In) annotation(
90+
Line(points = {{-72, 22}, {-82, 22}}, color = {255, 0, 0}));
91+
connect(DC_01.Cduty, E_01.In) annotation(
92+
Line(points = {{42, 22}, {30, 22}, {30, 8}, {30, 8}}, color = {255, 0, 0}));
93+
connect(E_03.Out, REACT_01.energy) annotation(
94+
Line(points = {{20, 28}, {38, 28}, {38, 38}, {38, 38}}, color = {255, 0, 0}));
95+
connect(S_08.In, DC_02.Bot) annotation(
96+
Line(points = {{-96, -66}, {-72, -66}, {-72, -68}, {-74, -68}, {-74, -68}}, color = {0, 70, 70}));
97+
connect(S_07.In, DC_02.Dist) annotation(
98+
Line(points = {{-96, -8}, {-72, -8}, {-72, -8}, {-72, -8}}, color = {0, 70, 70}));
99+
connect(S_06.In, DC_01.Bot) annotation(
100+
Line(points = {{18, -70}, {40, -70}, {40, -68}, {40, -68}}, color = {0, 70, 70}));
101+
connect(S_05.In, DC_01.Dist) annotation(
102+
Line(points = {{20, -4}, {40, -4}, {40, -8}, {42, -8}}, color = {0, 70, 70}));
103+
connect(S_04.Out, DC_01.In_s[1]) annotation(
104+
Line(points = {{90, 50}, {128, 50}, {128, -38}, {92, -38}, {92, -38}}, color = {0, 70, 70}));
105+
connect(REACT_01.Out, S_04.In) annotation(
106+
Line(points = {{48, 50}, {70, 50}, {70, 50}, {70, 50}}, color = {0, 70, 70}));
107+
connect(S_03.Out, REACT_01.In) annotation(
108+
Line(points = {{2, 50}, {28, 50}, {28, 50}, {28, 50}, {28, 50}}, color = {0, 70, 70}));
109+
connect(MIX_01.outlet, S_03.In) annotation(
110+
Line(points = {{-38, 48}, {-18, 48}, {-18, 50}, {-18, 50}}, color = {0, 70, 70}));
111+
connect(S_02.Out, MIX_01.inlet[2]) annotation(
112+
Line(points = {{-76, 40}, {-64, 40}, {-64, 48}, {-58, 48}, {-58, 48}}, color = {0, 70, 70}));
113+
connect(S_01.Out, MIX_01.inlet[1]) annotation(
114+
Line(points = {{-74, 66}, {-64, 66}, {-64, 48}, {-58, 48}, {-58, 48}}, color = {0, 70, 70}));
115+
116+
S_01.T = 347.602;
117+
S_01.P = 101325;
118+
S_01.F_p[1] = 20.7564;
119+
S_01.x_pc[1, :] = {0.025052486, 0.81126839, 0.16367913};
120+
S_02.T = 313.15;
121+
S_02.P = 101325;
122+
S_02.F_p[1] = 20;
123+
S_02.x_pc[1, :] = {0, 0.85, 0.15};
124+
DC_01.condenser.P = 101325;
125+
DC_01.reboiler.P = 101325;
126+
DC_01.RR = 3;
127+
S_06.F_p[1] = 30.7662;
128+
DC_02.condenser.P = 101325;
129+
DC_02.reboiler.P = 101325;
130+
DC_02.RR = 2;
131+
S_08.F_p[1] = 14.7189;
132+
end Flowsheet;
133+
134+
end DiethylEther_from_Ethanol;

0 commit comments

Comments
 (0)