-
Notifications
You must be signed in to change notification settings - Fork 298
/
Splitter2.mo
84 lines (77 loc) · 2.75 KB
/
Splitter2.mo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
within DataReconciliationSimpleTests.QLib.WaterSteam.Junctions;
model Splitter2 "Splitter with two outlets"
public
Real alpha1 "Extraction coefficient for outlet 1 (<=1)";
public
Connectors.FluidInlet Ce annotation (Placement(
transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
Connectors.FluidOutlet Cs1 annotation (Placement(
transformation(extent={{30,90},{50,110}}, rotation=0)));
Connectors.FluidOutlet Cs2 annotation (Placement(
transformation(extent={{30,-110},{50,-90}}, rotation=0)));
InstrumentationAndControl.Connectors.InputReal Ialpha1
"Extraction coefficient for outlet 1 (<=1)"
annotation (Placement(transformation(extent={{0,50},{20,70}}, rotation=0)));
InstrumentationAndControl.Connectors.OutputReal Oalpha1
annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0)));
equation
if (cardinality(Ialpha1) == 0) then
Ialpha1.signal = 0.5;
end if;
/* Mass balance equation */
0 = Ce.Q - Cs1.Q - Cs2.Q;
/* Mass flow at outlet 1 */
if (cardinality(Ialpha1) <> 0) then
Cs1.Q = Ialpha1.signal*Ce.Q;
end if;
alpha1 = Cs1.Q/Ce.Q;
Oalpha1.signal = alpha1;
annotation (
Diagram(coordinateSystem(
preserveAspectRatio=false,
extent={{-100,-100},{100,100}},
grid={2,2}), graphics={
Polygon(
points={{60,100},{60,-100},{20,-100},{20,-20},{-100,-20},{-100,20},{
20,20},{20,100},{60,100}},
lineColor={0,0,0},
fillColor={255,255,0},
fillPattern=FillPattern.Solid),
Text(extent={{20,80},{60,40}}, textString=
"1"),
Text(extent={{20,-40},{60,-80}}, textString=
"2")}),
Icon(coordinateSystem(
preserveAspectRatio=false,
extent={{-100,-100},{100,100}},
grid={2,2}), graphics={
Polygon(
points={{60,100},{60,-100},{20,-100},{20,-20},{-100,-20},{-100,20},{
20,20},{20,100},{60,100}},
lineColor={0,0,0},
fillColor={255,255,0},
fillPattern=FillPattern.Solid),
Text(extent={{20,80},{60,40}}, textString=
"1"),
Text(extent={{20,-40},{60,-80}}, textString=
"2")}),
Window(
x=0.33,
y=0.09,
width=0.71,
height=0.88),
Documentation(info="<html>
<p><b>Copyright © EDF 2002 - 2013</b> </p>
<p><b>ThermoSysPro Version 3.1</b> </p>
</html>",
revisions="<html>
<u><p><b>Authors</u> : </p></b>
<ul style='margin-top:0cm' type=disc>
<li>
Baligh El Hefni</li>
<li>
Daniel Bouskela</li>
</ul>
</html>
"), DymolaStoredErrors);
end Splitter2;