Skip to content

Commit e2b4642

Browse files
test: fix thermal heat-flow sensor topology (#488)
Connect the two ideal heat-flow sensors in series so the test system has a unique through-flow, and assert that both sensors report the same value. Co-authored-by: ChrisRackauckas-Claude <accounts@chrisrackauckas.com>
1 parent 3a162d1 commit e2b4642

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

test/thermal.jl

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,9 @@ end
7474
@info "Building a heat-flow system..."
7575
eqs = [
7676
connect(mass1.port, th_resistor.port_a, th_conductor.port_a)
77-
connect(
78-
th_conductor.port_b, flow_src.port, hf_sensor1.port_a,
79-
hf_sensor2.port_a
80-
)
81-
connect(
82-
th_resistor.port_b, hf_sensor1.port_b, hf_sensor2.port_b,
83-
th_ground.port
84-
)
77+
connect(th_conductor.port_b, flow_src.port, hf_sensor1.port_a)
78+
connect(hf_sensor1.port_b, hf_sensor2.port_a)
79+
connect(th_resistor.port_b, hf_sensor2.port_b, th_ground.port)
8580
]
8681
@named h2 = System(
8782
eqs, t,
@@ -99,6 +94,7 @@ end
9994
@test SciMLBase.successful_retcode(sol)
10095
@test sol[th_conductor.dT] .* G == sol[th_conductor.Q_flow]
10196
@test sol[th_conductor.Q_flow] sol[hf_sensor1.Q_flow.u] + sol[flow_src.port.Q_flow]
97+
@test sol[hf_sensor1.Q_flow.u] == sol[hf_sensor2.Q_flow.u]
10298

10399
@test sol[mass1.T] == sol[th_resistor.port_a.T]
104100
@test sol[th_resistor.dT] ./ R sol[th_resistor.Q_flow]

0 commit comments

Comments
 (0)