You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Volume with moving wall. The `direction` argument aligns the mechanical port with the hydraulic port, useful when connecting two dynamic volumes together in oppsing directions to create an actuator.
232
232
```
@@ -242,17 +242,18 @@ dm ────► dead volume │ │ area
242
242
```
243
243
244
244
# Parameters:
245
-
- `p_int`: [Pa] initial pressure (set by `p_int` argument)
246
-
- `x_int`: [m] initial position of the moving wall (set by the `x_int` argument)
247
-
- `area`: [m^2] moving wall area (set by the `area` argument)
248
-
- `dead_volume`: [m^3] perimeter of the pipe cross section (set by optional `perimeter` argument, needed only for non-circular pipes)
245
+
- `p_int`: [Pa] initial pressure
246
+
- `x_int`: [m] initial position of the moving wall
247
+
- `area`: [m^2] moving wall area
248
+
- `dead_volume`: [m^3] perimeter of the pipe cross section
249
+
- `minimum_volume`: [m^3] if `x`*`area` <= `minimum_volume` then mass flow `dm` shuts off
249
250
250
251
# Connectors:
251
252
- `port`: hydraulic port
252
253
- `flange`: mechanical translational port
253
254
"""
254
255
@componentfunctionDynamicVolume(; p_int, x_int =0, area, dead_volume =0, direction =+1,
255
-
name)
256
+
minimum_volume =0, name)
256
257
@assert (direction ==+1)||(direction ==-1) "direction arument must be +/-1, found $direction"
257
258
258
259
pars =@parametersbegin
@@ -272,17 +273,62 @@ dm ────► dead volume │ │ area
272
273
dx(t) =0
273
274
rho(t) =density(port, p_int)
274
275
drho(t) =0
276
+
vol(t) = dead_volume + area * x_int
277
+
p(t) = p_int
275
278
end
276
279
277
-
# let -------------
278
-
vol = dead_volume + area * x
279
-
280
-
eqs = [D(x) ~ dx
280
+
eqs = [0~ IfElse.ifelse(vol >= minimum_volume, p - port.p, port.dm)
281
+
vol ~ dead_volume + area * x
282
+
D(x) ~ dx
281
283
D(rho) ~ drho
282
284
dx ~ flange.v * direction
283
-
rho ~density(port, port.p)
285
+
rho ~density(port, p)
284
286
port.dm ~ drho * vol + rho * area * dx
285
-
flange.f ~-port.p * area * direction]
287
+
flange.f ~-p * area * direction]#TODO: update to dynamic pressure
0 commit comments