File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 155155 zeros (length (sol[collector. port_b. Q_flow]))
156156 @test sol[collector. port_b. T] == sol[collector. port_a1. T] == sol[collector. port_a2. T]
157157end
158+
159+ @testset " FixedHeatFlow with alpha=0.0 test" begin
160+ @mtkmodel TestModel begin
161+
162+ @components begin
163+ temp = FixedTemperature (T= 300 )
164+ heatflow = FixedHeatFlow (Q_flow= - 1.0 )
165+ wall = ThermalResistor (R= 1 )
166+ end
167+
168+ @equations begin
169+ connect (temp. port, wall. port_a)
170+ connect (wall. port_b, heatflow. port)
171+ end
172+
173+ end
174+
175+ @info " Building a FixedHeatFlow with alpha=0.0"
176+ @mtkbuild test_model = TestModel ()
177+ prob = ODEProblem (test_model, Pair[], (0 , 10.0 ))
178+ sol = solve (prob)
179+
180+ heat_flow = sol[test_model. heatflow. port. Q_flow]
181+
182+ @test SciMLBase. successful_retcode (sol) # Ensure the simulation is successful
183+ @test all (isapprox .(heat_flow, 1.0 , rtol= 1e-6 )) # Heat flow value should be equal to the fixed value defined
184+ end
You can’t perform that action at this time.
0 commit comments