Skip to content

Commit be15614

Browse files
author
Brad Carman
committed
fixed DynamicVolume
1 parent d349f53 commit be15614

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

src/Hydraulic/IsothermalCompressible/components.jl

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ dm ────► │ │ area
592592
x_min = x_min
593593
x_damp = x_damp
594594

595-
direction = direction
595+
# direction = direction
596596

597597
perimeter = perimeter
598598
shape_factor = shape_factor
@@ -671,18 +671,20 @@ dm ────► │ │ area
671671
push!(volumes, comp)
672672
end
673673

674-
push!(eqs, connect(moving_volume.port, volumes[1].port, pipe_bases[1].port_a))
675-
push!(eqs, connect(pipe_bases[end].port_b, damper.port_a))
676-
for i in 2:N
674+
push!(eqs, connect(moving_volume.port, volumes[end].port, pipe_bases[end].port_a))
675+
push!(eqs, connect(pipe_bases[1].port_b, damper.port_a))
676+
for i in 1:N-1
677677
push!(eqs,
678-
connect(volumes[i].port, pipe_bases[i - 1].port_b, pipe_bases[i].port_a))
678+
connect(volumes[i].port, pipe_bases[i + 1].port_b, pipe_bases[i].port_a))
679679
end
680680

681681
for i in 1:N
682-
push!(eqs,
683-
volumes[i].dx ~ ifelse((vol >= (i - 1) * (x_max / N) * area) &
684-
(vol < (i) * (x_max / N) * area),
685-
flange.v * direction, 0))
682+
683+
push!(eqs,
684+
volumes[i].dx ~ ifelse((vol >= (i - 1) * (x_max / N) * area) &
685+
(vol < (i) * (x_max / N) * area),
686+
direction*flange.v, 0))
687+
686688
push!(eqs, pipe_bases[i].x ~ volumes[i].vol / volumes[i].area)
687689
end
688690
else

test/Hydraulic/isothermal_compressible.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ end
139139

140140
for N in [1, 2]
141141
for damping_volume in [0.01 * 0.1 * 0.25]
142+
142143
@named system = System(N; damping_volume)
143144
s = complete(system)
144145
sys = structural_simplify(system)

0 commit comments

Comments
 (0)