-
Notifications
You must be signed in to change notification settings - Fork 169
/
Types.mo
331 lines (268 loc) · 11.3 KB
/
Types.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
within Modelica.Fluid;
package Types "Common types for fluid models"
extends Modelica.Icons.TypesPackage;
type HydraulicConductance = Modelica.Icons.TypeReal (
final quantity="HydraulicConductance",
final unit="kg/(s.Pa)") "Real type for hydraulic conductance";
type HydraulicResistance = Modelica.Icons.TypeReal (
final quantity="HydraulicResistance",
final unit="Pa.s/kg") "Real type for hydraulic resistance";
type Roughness = Modelica.Icons.TypeReal (final quantity="Length", final unit="m", displayUnit="mm", min=0)
"Real type for roughness of a pipe"
annotation (Documentation(info="<html>
<p>
This Real type defines the absolute roughness of the inner surface of a
pipe or fitting, i.e., the absolute average height of surface asperities.
It has usually to
be estimated. In <em>[Idelchik 1994, pp. 105-109,
Table 2-5; Miller 1990, p. 190, Table 8-1]</em> many examples are given.
As a short summary:
</p>
<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">
<tr><td colspan=\"2\" align=\"center\"><strong>Type of pipe</strong></td>
<td align=\"center\">Roughness</td></tr>
<tr><td><strong>Smooth pipes</strong></td>
<td>Drawn brass, copper, aluminium, glass, etc.</td>
<td> 0.0025 mm</td>
</tr>
<tr><td rowspan=\"3\"><strong>Steel pipes</strong></td>
<td>New smooth pipes</td>
<td>0.025 mm</td>
</tr>
<tr><td>Mortar lined, average finish</td>
<td>0.1 mm</td>
</tr>
<tr><td>Heavy rust</td>
<td>1 mm</td>
</tr>
<tr><td rowspan=\"3\"><strong>Concrete pipes</strong></td>
<td>Steel forms, first class workmanship</td>
<td>0.025 mm</td>
</tr>
<tr><td>Steel forms, average workmanship</td>
<td>0.1 mm</td>
</tr>
<tr><td>Block linings</td>
<td>1 mm</td>
</tr>
</table>
<h4>References</h4>
<dl>
<dt>Idelchik I.E. (1994):</dt>
<dd><a href=\"http://www.bookfinder.com/dir/i/Handbook_of_Hydraulic_Resistance/0849399084/\"><strong>Handbook
of Hydraulic Resistance</strong></a>. 3rd edition, Begell House, ISBN
0-8493-9908-4</dd>
<dt>Miller D. S. (1990):</dt>
<dd><strong>Internal flow systems</strong>.
2nd edition. Cranfield:BHRA(Information Services).</dd>
</dl>
</html>"));
type Dynamics = enumeration(
DynamicFreeInitial
"DynamicFreeInitial -- Dynamic balance, Initial guess value",
FixedInitial "FixedInitial -- Dynamic balance, Initial value fixed",
SteadyStateInitial
"SteadyStateInitial -- Dynamic balance, Steady state initial with guess value",
SteadyState "SteadyState -- Steady state balance, Initial guess value")
"Enumeration to define definition of balance equations"
annotation (Documentation(info="<html>
<p>
Enumeration to define the formulation of balance equations
(to be selected via choices menu):
</p>
<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">
<tr><th><strong>Dynamics.</strong></th><th><strong>Meaning</strong></th></tr>
<tr><td>DynamicFreeInitial</td><td>Dynamic balance, Initial guess value</td></tr>
<tr><td>FixedInitial</td><td>Dynamic balance, Initial value fixed</td></tr>
<tr><td>SteadyStateInitial</td><td>Dynamic balance, Steady state initial with guess value</td></tr>
<tr><td>SteadyState</td><td>Steady state balance, Initial guess value</td></tr>
</table>
<p>
The enumeration \"Dynamics\" is used for the mass, energy and momentum balance equations
respectively. The exact meaning for the three balance equations is stated in the following
tables:
</p>
<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">
<tr><td colspan=\"3\"><strong>Mass balance</strong> </td></tr>
<tr><td><strong>Dynamics.</strong></td>
<td><strong>Balance equation</strong></td>
<td><strong>Initial condition</strong></td></tr>
<tr><td> DynamicFreeInitial</td>
<td> no restrictions </td>
<td> no initial conditions </td></tr>
<tr><td> FixedInitial</td>
<td> no restrictions </td>
<td> <strong>if</strong> Medium.singleState <strong>then</strong><br>
no initial condition<br>
<strong>else</strong> p=p_start </td></tr>
<tr><td> SteadyStateInitial</td>
<td> no restrictions </td>
<td> <strong>if</strong> Medium.singleState <strong>then</strong><br>
no initial condition<br>
<strong>else</strong> <strong>der</strong>(p)=0 </td></tr>
<tr><td> SteadyState</td>
<td> <strong>der</strong>(m)=0 </td>
<td> no initial conditions </td></tr>
</table>
<br>
<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">
<tr><td colspan=\"3\"><strong>Energy balance</strong> </td></tr>
<tr><td><strong>Dynamics.</strong></td>
<td><strong>Balance equation</strong></td>
<td><strong>Initial condition</strong></td></tr>
<tr><td> DynamicFreeInitial</td>
<td> no restrictions </td>
<td> no initial conditions </td></tr>
<tr><td> FixedInitial</td>
<td> no restrictions </td>
<td> T=T_start or h=h_start </td></tr>
<tr><td> SteadyStateInitial</td>
<td> no restrictions </td>
<td> <strong>der</strong>(T)=0 or <strong>der</strong>(h)=0 </td></tr>
<tr><td> SteadyState</td>
<td> <strong>der</strong>(U)=0 </td>
<td> no initial conditions </td></tr>
</table>
<br>
<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">
<tr><td colspan=\"3\"><strong>Momentum balance</strong> </td></tr>
<tr><td><strong>Dynamics.</strong></td>
<td><strong>Balance equation</strong></td>
<td><strong>Initial condition</strong></td></tr>
<tr><td> DynamicFreeInitial</td>
<td> no restrictions </td>
<td> no initial conditions </td></tr>
<tr><td> FixedInitial</td>
<td> no restrictions </td>
<td> m_flow = m_flow_start </td></tr>
<tr><td> SteadyStateInitial</td>
<td> no restrictions </td>
<td> <strong>der</strong>(m_flow)=0 </td></tr>
<tr><td> SteadyState</td>
<td> <strong>der</strong>(m_flow)=0 </td>
<td> no initial conditions </td></tr>
</table>
<p>
In the tables above, the equations are given for one-substance fluids. For multiple-substance
fluids and for trace substances, equivalent equations hold.
</p>
<p>
Medium.singleState is a medium property and defines whether the medium is only
described by one state (+ the mass fractions in case of a multi-substance fluid). In such
a case one initial condition less must be provided. For example, incompressible
media have Medium.singleState = <strong>true</strong>.
</p>
</html>"));
type CvTypes = enumeration(
Av "Av (metric) flow coefficient",
Kv "Kv (metric) flow coefficient",
Cv "Cv (US) flow coefficient",
OpPoint "Av defined by operating point")
"Enumeration to define the choice of valve flow coefficient" annotation (
Documentation(info="<html>
<p>
Enumeration to define the choice of valve flow coefficient
(to be selected via choices menu):
</p>
<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">
<tr><th><strong>CvTypes.</strong></th>
<th><strong>Meaning</strong></th></tr>
<tr><td>Av</td>
<td>Av (metric) flow coefficient</td></tr>
<tr><td>Kv</td>
<td>Kv (metric) flow coefficient</td></tr>
<tr><td>Cv</td>
<td>Cv (US) flow coefficient</td></tr>
<tr><td>OpPoint</td>
<td>Av defined by operating point</td></tr>
</table>
<p>
The details of the coefficients are explained in the
<a href=\"modelica://Modelica.Fluid.UsersGuide.ComponentDefinition.ValveCharacteristics\">
User's Guide </a>.
</p>
</html>"));
type PortFlowDirection = enumeration(
Entering "Fluid flow is only entering",
Leaving "Fluid flow is only leaving",
Bidirectional "No restrictions on fluid flow (flow reversal possible)")
"Enumeration to define whether flow reversal is allowed" annotation (
Documentation(info="<html>
<p>
Enumeration to define the assumptions on the model for the
direction of fluid flow at a port (to be selected via choices menu):
</p>
<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">
<tr><th><strong>PortFlowDirection.</strong></th>
<th><strong>Meaning</strong></th></tr>
<tr><td>Entering</td>
<td>Fluid flow is only entering the port from the outside</td></tr>
<tr><td>Leaving</td>
<td>Fluid flow is only leaving the port to the outside</td></tr>
<tr><td>Bidirectional</td>
<td>No restrictions on fluid flow (flow reversal possible)</td></tr>
</table>
<p>
The default is \"PortFlowDirection.Bidirectional\". If you are completely sure that
the flow is only in one direction, then the other settings may
make the simulation of your model faster.
</p>
</html>"));
type ModelStructure = enumeration(
av_vb "av_vb: port_a - volume - flow model - volume - port_b",
a_v_b "a_v_b: port_a - flow model - volume - flow model - port_b",
av_b "av_b: port_a - volume - flow model - port_b",
a_vb "a_vb: port_a - flow model - volume - port_b")
"Enumeration with choices for model structure in distributed pipe model"
annotation (Documentation(info="<html>
<p>
Enumeration to define the discretization structure of
distributed pipe models according to the staggered grid scheme:
</p>
<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">
<tr><th><strong>ModelStructure.</strong></th>
<th><strong>Meaning</strong></th></tr>
<tr><td>av_vb</td>
<td>port_a - volume - flow model - volume - port_b</td></tr>
<tr><td>a_v_b</td>
<td>port_a - flow model - volume - flow model - port_b</td></tr>
<tr><td>av_b</td>
<td>port_a - volume - flow model - port_b</td></tr>
<tr><td>a_vb</td>
<td>port_a - flow model - volume - port_b</td></tr>
</table>
<p>
The default is \"ModelStructure.av_vb\", i.e., the distributed pipe
has \"volumes\" at its both ends. The advantage is that connections
of the pipe to flow models (like fittings) lead to the desirable structure
of alternating volume and flow models, which means that no non-linear
algebraic equations occur.
</p>
<p>
Direct connections of distributed pipes with
this option means that two volumes are directly connected together. Due to the
stream concept this means that the pressures of the two connected volumes
are identical, but the temperatures are not set equal
(this corresponds to volumes that are connected together with a very
short distance and it needs some time until different volume temperatures
are equilibrated). Since the pressures of the volumes are identical, the number
of states is reduced and index reduction takes place (which means that medium
equations depending on pressure are differentiated and the number of required
initial conditions is reduced by one).
</p>
<p>
The default option \"av_vb\" cannot be used, if the dynamic pipe is connected to a model with non-differentiable pressure, like a Sources.Boundary_pT with prescribed jumping pressure. The modelStructure can be configured as appropriate in such situations, in order to place a momentum balance between a pressure state of the pipe and a non-differentiable boundary condition
(e.g., if the jumping pressure component is connected to port_a, use model structure
ModelStructure.a_vb).
</p>
</html>"));
type CheckValveHomotopyType = enumeration(Open, Closed, NoHomotopy)
"Enumeration with choices for check valve homotopy"
annotation (Documentation(info="<html>
<p>If it is known whether the check valve will start open or closed this can simplify the initialization.</p>
<p>The choice <strong>NoHomotopy</strong> is useful if nothing is known for the check valve.</p>
</html>"));
annotation (preferredView="info",
Documentation(info="<html>
</html>"));
end Types;