-
Notifications
You must be signed in to change notification settings - Fork 298
/
Mixer2.mo
85 lines (78 loc) · 2.68 KB
/
Mixer2.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
85
within DataReconciliationSimpleTests.QLib.WaterSteam.Junctions;
model Mixer2 "Mixer with two inlets"
public
Real alpha1 "Extraction coefficient for inlet 1 (<=1)";
public
Connectors.FluidInlet Ce2 annotation (Placement(transformation(extent={{-50,-110},
{-30,-90}}, rotation=0)));
Connectors.FluidOutlet Cs annotation (Placement(transformation(extent={{90,-10},
{110,10}}, rotation=0)));
public
Connectors.FluidInlet Ce1 annotation (Placement(transformation(extent={{-50,90},
{-30,110}}, rotation=0)));
InstrumentationAndControl.Connectors.InputReal Ialpha1
"Extraction coefficient for inlet 1 (<=1)" annotation (Placement(
transformation(extent={{-80,50},{-60,70}}, rotation=0)));
InstrumentationAndControl.Connectors.OutputReal Oalpha1 annotation (Placement(
transformation(extent={{-20,50},{0,70}}, rotation=0)));
equation
if (cardinality(Ialpha1) == 0) then
Ialpha1.signal = 0.5;
end if;
/* Mass balance equation */
0 = Ce1.Q + Ce2.Q - Cs.Q;
/* Mass flow at outlet 1 */
if (cardinality(Ialpha1) <> 0) then
Ce1.Q = Ialpha1.signal*Cs.Q;
end if;
alpha1 = Ce1.Q/Cs.Q;
Oalpha1.signal = alpha1;
annotation (
Diagram(coordinateSystem(
preserveAspectRatio=false,
extent={{-100,-100},{100,100}},
grid={2,2}), graphics={
Polygon(
points={{-60,-100},{-20,-100},{-20,-20},{100,-20},{100,20},{-20,20},{
-20,100},{-60,100},{-60,-100}},
lineColor={0,0,255},
fillColor={255,255,0},
fillPattern=FillPattern.Solid),
Text(extent={{-60,80},{-20,40}}, textString=
"1"),
Text(extent={{-60,-40},{-20,-80}}, textString=
"2")}),
Icon(coordinateSystem(
preserveAspectRatio=false,
extent={{-100,-100},{100,100}},
grid={2,2}), graphics={
Polygon(
points={{-60,-100},{-20,-100},{-20,-20},{100,-20},{100,20},{-20,20},{
-20,100},{-60,100},{-60,-100}},
lineColor={0,0,255},
fillColor={255,255,0},
fillPattern=FillPattern.Solid),
Text(extent={{-60,80},{-20,40}}, textString=
"1"),
Text(extent={{-60,-40},{-20,-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>
"));
end Mixer2;