|
1 | 1 | within Buildings.DHC.ETS.Combined.Controls; |
2 | 2 | model Borefield |
3 | 3 | "Borefield controller" |
4 | | - extends Modelica.Blocks.Icons.Block; |
5 | | - parameter Modelica.Units.SI.Temperature TBorWatEntMax(displayUnit="degC") |
| 4 | + |
| 5 | + parameter Real TBorWatEntMax( |
| 6 | + final quantity="ThermodynamicTemperature", |
| 7 | + final unit="K", |
| 8 | + displayUnit="degC") |
6 | 9 | "Maximum value of borefield water entering temperature"; |
7 | 10 | parameter Real spePumBorMin( |
8 | 11 | final unit="1")=0.1 |
9 | 12 | "Borefield pump minimum speed"; |
10 | 13 | Buildings.Controls.OBC.CDL.Interfaces.RealInput yValIso_actual[2] |
11 | 14 | "Isolation valves return position (fractional)" |
12 | | - annotation (Placement(transformation(extent={{-140,-60},{-100,-20}}), |
| 15 | + annotation (Placement(transformation(extent={{-140,-80},{-100,-40}}), |
13 | 16 | iconTransformation(extent={{-140,-20},{-100,20}}))); |
14 | 17 | Buildings.Controls.OBC.CDL.Interfaces.RealInput u |
15 | 18 | "Control signal from supervisory" |
16 | | - annotation (Placement(transformation(extent={{-140,40},{-100,80}}), |
| 19 | + annotation (Placement(transformation(extent={{-140,60},{-100,100}}), |
17 | 20 | iconTransformation(extent={{-140,40},{-100,80}}))); |
18 | 21 | Buildings.Controls.OBC.CDL.Interfaces.RealOutput yPum( |
19 | 22 | final unit="kg/s") |
20 | 23 | "Control signal for borefield pump" |
21 | | - annotation (Placement(transformation(extent={{100,40},{140,80}}), |
| 24 | + annotation (Placement(transformation(extent={{100,60},{140,100}}), |
22 | 25 | iconTransformation(extent={{100,40},{140,80}}))); |
23 | 26 | Buildings.Controls.OBC.CDL.Interfaces.RealOutput yValMix( |
24 | 27 | final unit="1") |
25 | 28 | "Control signal for borefield mixing valve" |
26 | | - annotation (Placement(transformation(extent={{100,-80},{140,-40}}), |
| 29 | + annotation (Placement(transformation(extent={{100,-90},{140,-50}}), |
27 | 30 | iconTransformation(extent={{100,-80},{140,-40}}))); |
28 | 31 | Buildings.Controls.OBC.CDL.Interfaces.RealInput TBorWatEnt( |
29 | 32 | final unit="K", |
30 | 33 | displayUnit="degC") |
31 | 34 | "Borefield water entering temperature" |
32 | | - annotation (Placement(transformation(extent={{-140,-120},{-100,-80}}), |
| 35 | + annotation (Placement(transformation(extent={{-140,-130},{-100,-90}}), |
33 | 36 | iconTransformation(extent={{-140,-80},{-100,-40}}))); |
34 | 37 | Buildings.Controls.OBC.CDL.Reals.PIDWithReset conMix( |
35 | 38 | final yMin=0, |
36 | 39 | final yMax=1, |
37 | 40 | final reverseActing=true, |
38 | 41 | y_reset=0, |
39 | 42 | k=0.1, |
40 | | - final controllerType=Modelica.Blocks.Types.SimpleController.PI, |
41 | | - Ti( |
42 | | - displayUnit="s")=120) |
| 43 | + final controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI, |
| 44 | + Ti(displayUnit="s")=120) |
43 | 45 | "Mixing valve controller" |
44 | | - annotation (Placement(transformation(extent={{-10,-90},{10,-70}}))); |
| 46 | + annotation (Placement(transformation(extent={{-10,-100},{10,-80}}))); |
45 | 47 | Buildings.Controls.OBC.CDL.Reals.Sources.Constant maxTBorWatEnt( |
46 | 48 | y(final unit="K", |
47 | 49 | displayUnit="degC"), |
48 | 50 | final k=TBorWatEntMax) |
49 | 51 | "Maximum value of borefield water entering temperature" |
50 | | - annotation (Placement(transformation(extent={{-50,-90},{-30,-70}}))); |
| 52 | + annotation (Placement(transformation(extent={{-50,-100},{-30,-80}}))); |
51 | 53 | Buildings.Controls.OBC.CDL.Reals.GreaterThreshold opeVal( |
52 | 54 | final t=0.9, |
53 | 55 | final h=0.1) |
54 | 56 | "True if at least one isolation valve is open" |
55 | | - annotation (Placement(transformation(extent={{-50,-58},{-30,-38}}))); |
| 57 | + annotation (Placement(transformation(extent={{-40,-70},{-20,-50}}))); |
56 | 58 | Buildings.Controls.OBC.CDL.Reals.MultiMax multiMax1( |
57 | 59 | final nin=2) |
58 | 60 | "Maximum opening" |
59 | | - annotation (Placement(transformation(extent={{-90,-50},{-70,-30}}))); |
| 61 | + annotation (Placement(transformation(extent={{-80,-70},{-60,-50}}))); |
60 | 62 | Buildings.Controls.OBC.CDL.Reals.GreaterThreshold enaSup( |
61 | 63 | final t=0.05, |
62 | 64 | final h=0.025) |
63 | 65 | "Borefield enabled from supervisory" |
64 | | - annotation (Placement(transformation(extent={{-50,-30},{-30,-10}}))); |
| 66 | + annotation (Placement(transformation(extent={{-40,-40},{-20,-20}}))); |
65 | 67 | Buildings.Controls.OBC.CDL.Reals.Switch runBor |
66 | 68 | "Enable borefield system pump" |
67 | | - annotation (Placement(transformation(extent={{70,50},{90,70}}))); |
| 69 | + annotation (Placement(transformation(extent={{70,70},{90,90}}))); |
68 | 70 | Buildings.Controls.OBC.CDL.Reals.Sources.Constant limVal( |
69 | 71 | final k=0.3) |
70 | 72 | "Control signal value for full opening of the valve" |
71 | | - annotation (Placement(transformation(extent={{-40,10},{-20,30}}))); |
| 73 | + annotation (Placement(transformation(extent={{-40,20},{-20,40}}))); |
72 | 74 | Buildings.Controls.OBC.CDL.Reals.Sources.Constant speMin( |
73 | 75 | final k=spePumBorMin) |
74 | 76 | "Minimum pump speed" |
75 | | - annotation (Placement(transformation(extent={{-40,74},{-20,94}}))); |
| 77 | + annotation (Placement(transformation(extent={{-40,94},{-20,114}}))); |
76 | 78 | Buildings.Controls.OBC.CDL.Logical.And enaBor |
77 | 79 | "Borefield enable signal" |
78 | | - annotation (Placement(transformation(extent={{-10,-40},{10,-20}}))); |
| 80 | + annotation (Placement(transformation(extent={{20,-50},{40,-30}}))); |
79 | 81 | Buildings.Controls.OBC.CDL.Reals.Line mapSpe |
80 | 82 | "Mapping function for pump speed" |
81 | | - annotation (Placement(transformation(extent={{20,70},{40,90}}))); |
| 83 | + annotation (Placement(transformation(extent={{20,90},{40,110}}))); |
82 | 84 | Buildings.Controls.OBC.CDL.Reals.Sources.Constant one( |
83 | 85 | final k=1) |
84 | 86 | "One" |
85 | 87 | annotation (Placement(transformation(extent={{-20,-10},{0,10}}))); |
86 | 88 | Buildings.Controls.OBC.CDL.Reals.Sources.Constant zer( |
87 | 89 | final k=0) |
88 | 90 | "Zero" |
89 | | - annotation (Placement(transformation(extent={{-60,30},{-40,50}}))); |
| 91 | + annotation (Placement(transformation(extent={{-60,50},{-40,70}}))); |
90 | 92 | Buildings.Controls.OBC.CDL.Reals.Line mapVal |
91 | 93 | "Mapping function for valve opening" |
92 | | - annotation (Placement(transformation(extent={{20,30},{40,50}}))); |
| 94 | + annotation (Placement(transformation(extent={{20,40},{40,60}}))); |
93 | 95 | Buildings.Controls.OBC.CDL.Reals.Min min1 |
94 | 96 | "Minimum" |
95 | | - annotation (Placement(transformation(extent={{70,-70},{90,-50}}))); |
| 97 | + annotation (Placement(transformation(extent={{70,-80},{90,-60}}))); |
96 | 98 | equation |
97 | 99 | connect(multiMax1.y,opeVal.u) |
98 | | - annotation (Line(points={{-68,-40},{-60,-40},{-60,-48},{-52,-48}},color={0,0,127})); |
| 100 | + annotation (Line(points={{-58,-60},{-42,-60}}, color={0,0,127})); |
99 | 101 | connect(yValIso_actual,multiMax1.u) |
100 | | - annotation (Line(points={{-120,-40},{-92,-40}},color={0,0,127})); |
| 102 | + annotation (Line(points={{-120,-60},{-82,-60}},color={0,0,127})); |
101 | 103 | connect(u,enaSup.u) |
102 | | - annotation (Line(points={{-120,60},{-80,60},{-80,-20},{-52,-20}},color={0,0,127})); |
| 104 | + annotation (Line(points={{-120,80},{-80,80},{-80,-30},{-42,-30}},color={0,0,127})); |
103 | 105 | connect(enaSup.y,enaBor.u1) |
104 | | - annotation (Line(points={{-28,-20},{-20,-20},{-20,-30},{-12,-30}},color={255,0,255})); |
| 106 | + annotation (Line(points={{-18,-30},{0,-30},{0,-40},{18,-40}}, color={255,0,255})); |
105 | 107 | connect(opeVal.y,enaBor.u2) |
106 | | - annotation (Line(points={{-28,-48},{-20,-48},{-20,-38},{-12,-38}},color={255,0,255})); |
| 108 | + annotation (Line(points={{-18,-60},{0,-60},{0,-48},{18,-48}}, color={255,0,255})); |
107 | 109 | connect(enaBor.y,conMix.trigger) |
108 | | - annotation (Line(points={{12,-30},{20,-30},{20,-96},{-6,-96},{-6,-92}},color={255,0,255})); |
| 110 | + annotation (Line(points={{42,-40},{60,-40},{60,-106},{-6,-106},{-6,-102}}, color={255,0,255})); |
109 | 111 | connect(maxTBorWatEnt.y,conMix.u_s) |
110 | | - annotation (Line(points={{-28,-80},{-12,-80}},color={0,0,127})); |
| 112 | + annotation (Line(points={{-28,-90},{-12,-90}},color={0,0,127})); |
111 | 113 | connect(runBor.y,yPum) |
112 | | - annotation (Line(points={{92,60},{120,60}},color={0,0,127})); |
| 114 | + annotation (Line(points={{92,80},{120,80}},color={0,0,127})); |
113 | 115 | connect(TBorWatEnt,conMix.u_m) |
114 | | - annotation (Line(points={{-120,-100},{0,-100},{0,-92}},color={0,0,127})); |
| 116 | + annotation (Line(points={{-120,-110},{0,-110},{0,-102}}, color={0,0,127})); |
115 | 117 | connect(enaBor.y,runBor.u2) |
116 | | - annotation (Line(points={{12,-30},{20,-30},{20,20},{64,20},{64,60},{68,60}},color={255,0,255})); |
| 118 | + annotation (Line(points={{42,-40},{60,-40},{60,80},{68,80}}, color={255,0,255})); |
117 | 119 | connect(mapSpe.y,runBor.u1) |
118 | | - annotation (Line(points={{42,80},{60,80},{60,68},{68,68}},color={0,0,127})); |
| 120 | + annotation (Line(points={{42,100},{60,100},{60,88},{68,88}}, color={0,0,127})); |
119 | 121 | connect(u,mapSpe.u) |
120 | | - annotation (Line(points={{-120,60},{0,60},{0,80},{18,80}},color={0,0,127})); |
| 122 | + annotation (Line(points={{-120,80},{0,80},{0,100},{18,100}}, color={0,0,127})); |
121 | 123 | connect(speMin.y,mapSpe.f1) |
122 | | - annotation (Line(points={{-18,84},{18,84}},color={0,0,127})); |
| 124 | + annotation (Line(points={{-18,104},{18,104}}, color={0,0,127})); |
123 | 125 | connect(min1.y,yValMix) |
124 | | - annotation (Line(points={{92,-60},{120,-60}},color={0,0,127})); |
| 126 | + annotation (Line(points={{92,-70},{120,-70}},color={0,0,127})); |
125 | 127 | connect(conMix.y,min1.u2) |
126 | | - annotation (Line(points={{12,-80},{60,-80},{60,-66},{68,-66}},color={0,0,127})); |
| 128 | + annotation (Line(points={{12,-90},{50,-90},{50,-76},{68,-76}},color={0,0,127})); |
127 | 129 | connect(mapVal.y,min1.u1) |
128 | | - annotation (Line(points={{42,40},{60,40},{60,-54},{68,-54}},color={0,0,127})); |
| 130 | + annotation (Line(points={{42,50},{50,50},{50,-64},{68,-64}},color={0,0,127})); |
129 | 131 | connect(one.y,mapSpe.x2) |
130 | | - annotation (Line(points={{2,0},{12,0},{12,76},{18,76}},color={0,0,127})); |
| 132 | + annotation (Line(points={{2,0},{12,0},{12,96},{18,96}},color={0,0,127})); |
131 | 133 | connect(one.y,mapSpe.f2) |
132 | | - annotation (Line(points={{2,0},{12,0},{12,72},{18,72}},color={0,0,127})); |
| 134 | + annotation (Line(points={{2,0},{12,0},{12,92},{18,92}},color={0,0,127})); |
133 | 135 | connect(one.y,mapVal.f2) |
134 | | - annotation (Line(points={{2,0},{12,0},{12,32},{18,32}},color={0,0,127})); |
| 136 | + annotation (Line(points={{2,0},{12,0},{12,42},{18,42}},color={0,0,127})); |
135 | 137 | connect(zer.y,mapVal.x1) |
136 | | - annotation (Line(points={{-38,40},{-10,40},{-10,48},{18,48}},color={0,0,127})); |
| 138 | + annotation (Line(points={{-38,60},{-10,60},{-10,58},{18,58}},color={0,0,127})); |
137 | 139 | connect(limVal.y,mapVal.x2) |
138 | | - annotation (Line(points={{-18,20},{6,20},{6,36},{18,36}},color={0,0,127})); |
| 140 | + annotation (Line(points={{-18,30},{6,30},{6,46},{18,46}},color={0,0,127})); |
139 | 141 | connect(u,mapVal.u) |
140 | | - annotation (Line(points={{-120,60},{0,60},{0,40},{18,40}},color={0,0,127})); |
| 142 | + annotation (Line(points={{-120,80},{0,80},{0,50},{18,50}},color={0,0,127})); |
141 | 143 | connect(limVal.y,mapSpe.x1) |
142 | | - annotation (Line(points={{-18,20},{6,20},{6,88},{18,88}},color={0,0,127})); |
| 144 | + annotation (Line(points={{-18,30},{6,30},{6,108},{18,108}}, color={0,0,127})); |
143 | 145 | connect(zer.y,mapVal.f1) |
144 | | - annotation (Line(points={{-38,40},{-10,40},{-10,44},{18,44}},color={0,0,127})); |
| 146 | + annotation (Line(points={{-38,60},{-10,60},{-10,54},{18,54}},color={0,0,127})); |
145 | 147 | connect(zer.y,runBor.u3) |
146 | | - annotation (Line(points={{-38,40},{-10,40},{-10,52},{68,52}},color={0,0,127})); |
| 148 | + annotation (Line(points={{-38,60},{-10,60},{-10,72},{68,72}},color={0,0,127})); |
147 | 149 | annotation ( |
148 | 150 | Diagram( |
149 | 151 | coordinateSystem( |
@@ -200,5 +202,15 @@ the control of the system when the mass flow rate required to meet |
200 | 202 | the heat or cold rejection demand is below the flow rate corresponding |
201 | 203 | to the minimum pump speed. |
202 | 204 | </p> |
203 | | -</html>")); |
| 205 | +</html>"), |
| 206 | + Icon(graphics={ |
| 207 | + Rectangle( |
| 208 | + extent={{-100,-100},{100,100}}, |
| 209 | + lineColor={0,0,127}, |
| 210 | + fillColor={255,255,255}, |
| 211 | + fillPattern=FillPattern.Solid), |
| 212 | + Text( |
| 213 | + textColor={0,0,255}, |
| 214 | + extent={{-100,100},{102,140}}, |
| 215 | + textString="%name")})); |
204 | 216 | end Borefield; |
0 commit comments