Skip to content

Commit 644d620

Browse files
committed
Implemented reviewer comments
1 parent 6fad3a0 commit 644d620

File tree

3 files changed

+19
-28
lines changed

3 files changed

+19
-28
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ docs/site/
2121
# It records a fixed state of all packages used by the project. As such, it should not be
2222
# committed for packages, but should be committed for applications that require a static
2323
# environment.
24-
Manifest.toml
24+
Manifest.toml

src/Hydraulic/IsothermalCompressible/components.jl

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ Caps a hydraulic port to prevent mass flow in or out.
99
"""
1010
@mtkmodel Cap begin
1111

12-
@parameters begin
13-
end
14-
1512
@variables begin
1613
p(t), [guess = 0]
1714
end
@@ -36,9 +33,6 @@ Provides an "open" boundary condition for a hydraulic port such that mass flow `
3633
- `port`: hydraulic port
3734
"""
3835
@mtkmodel Open begin
39-
40-
@parameters begin
41-
end
4236

4337
@variables begin
4438
p(t), [guess = 0]
@@ -359,11 +353,14 @@ end
359353

360354
@mtkmodel VolumeBase begin
361355

356+
@structural_parameters begin
357+
x1 = 1
358+
x2 = 1
359+
end
360+
362361
@parameters begin
363362
area = area
364363
dead_volume = dead_volume
365-
x1 = 1
366-
x2 = 1
367364
end
368365

369366
@variables begin
@@ -404,7 +401,7 @@ Fixed fluid volume.
404401
@mtkmodel FixedVolume begin
405402

406403
@parameters begin
407-
Volume
404+
vol
408405
end
409406

410407
@variables begin
@@ -416,9 +413,12 @@ Fixed fluid volume.
416413
port = HydraulicPort()
417414
end
418415

419-
@equations begin
416+
begin
420417
dm = port.dm
421418
p = port.p
419+
end
420+
421+
@equations begin
422422
D(rho) ~ drho
423423
rho ~ full_density(port, p)
424424
dm ~ drho * vol
@@ -427,7 +427,7 @@ Fixed fluid volume.
427427
end
428428

429429
"""
430-
Volume(; x, dx=0, p, drho=0, dm=0, area, direction = +1, name)
430+
Volume(; x, dx=0, p, drho=0, dm=0, area, direction = 1, name)
431431
432432
Volume with moving wall with `flange` connector for converting hydraulic energy to 1D mechanical. 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.
433433
@@ -466,9 +466,12 @@ See also [`FixedVolume`](@ref), [`DynamicVolume`](@ref)
466466
"""
467467
@mtkmodel Volume begin
468468

469+
@structural_parameters begin
470+
direction = 1
471+
end
472+
469473
@parameters begin
470474
area
471-
direction = +1
472475
end
473476

474477
@variables begin
@@ -503,6 +506,9 @@ See also [`FixedVolume`](@ref), [`DynamicVolume`](@ref)
503506
dm ~ drho * x * area + rho * dx * area
504507
end
505508

509+
@defaults begin
510+
rho => liquid_density(port)
511+
end
506512

507513
end
508514

src/Hydraulic/IsothermalCompressible/sources.jl

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ Hydraulic mass flow input source
99
- `dm`: real input
1010
"""
1111
@mtkmodel MassFlow begin
12-
13-
@parameters begin
14-
end
15-
16-
@variables begin
17-
end
1812

1913
@components begin
2014
port = HydraulicPort()
@@ -43,9 +37,6 @@ Fixed pressure source
4337
p
4438
end
4539

46-
@variables begin
47-
end
48-
4940
@components begin
5041
port = HydraulicPort()
5142
end
@@ -68,12 +59,6 @@ input pressure source
6859
"""
6960
@mtkmodel Pressure begin
7061

71-
@parameters begin
72-
end
73-
74-
@variables begin
75-
end
76-
7762
@components begin
7863
port = HydraulicPort()
7964
p = RealInput()

0 commit comments

Comments
 (0)