From 9a39c5ed567cffc47af0c477825ade235b490fc0 Mon Sep 17 00:00:00 2001 From: Jan-Timo Hesse Date: Tue, 8 Oct 2024 16:17:17 +0200 Subject: [PATCH] refac --- src/Models/Thermal/Thermal_Factory.jl | 1 - .../Models/Thermal/ut_Thermal_Factory.jl | 47 ------------------- 2 files changed, 48 deletions(-) diff --git a/src/Models/Thermal/Thermal_Factory.jl b/src/Models/Thermal/Thermal_Factory.jl index 3e5bcc42..44fdce68 100644 --- a/src/Models/Thermal/Thermal_Factory.jl +++ b/src/Models/Thermal/Thermal_Factory.jl @@ -28,7 +28,6 @@ function init_fields(datamanager::Module) datamanager.create_constant_node_field("Delta Temperature", Float64, 1) datamanager.create_node_field("Heat Flow", Float64, 1) datamanager.create_constant_node_field("Specific Volume", Float64, 1) - datamanager.create_constant_bond_field("Bond Heat Flow", Float64, 1) # if it is already initialized via mesh file no new field is created here datamanager.create_constant_node_field("Surface_Nodes", Bool, 1, true) datamanager.create_constant_node_field("Specific Heat Capacity", Float64, 1) diff --git a/test/unit_tests/Models/Thermal/ut_Thermal_Factory.jl b/test/unit_tests/Models/Thermal/ut_Thermal_Factory.jl index 22911ec5..16be7745 100644 --- a/test/unit_tests/Models/Thermal/ut_Thermal_Factory.jl +++ b/test/unit_tests/Models/Thermal/ut_Thermal_Factory.jl @@ -25,7 +25,6 @@ using .Thermal @test "TemperatureNP1" in field_keys @test "Heat FlowN" in field_keys @test "Heat FlowNP1" in field_keys - @test "Bond Heat Flow" in field_keys end @testset "init_model" begin @@ -42,49 +41,3 @@ end test_data_manager.set_properties(2, "Thermal Model", Dict("Thermal Model" => "Missing")) @test isnothing(Thermal.init_model(test_data_manager, [1], 2)) end - -@testset "ut_distribute_heat_flows" begin - - nnodes = 2 - nodes = Vector{Int64}(1:nnodes) - dof = 2 - test_data_manager = PeriLab.Data_manager - test_data_manager.set_num_controller(2) - nn = test_data_manager.create_constant_node_field("Number of Neighbors", Int64, 1) - volume = test_data_manager.create_constant_node_field("Volume", Float64, 1) - - nn[1] = 1 - nn[2] = 1 - volume[1:2] .= 1 - - nlist = test_data_manager.create_constant_bond_field("Neighborhoodlist", Int64, 1) - nlist[1][1] = 2 - nlist[2][1] = 1 - - (heat_flowN, heat_flowNP1) = - test_data_manager.create_node_field("Heat Flow", Float64, 1) - bond_heat_flow = - test_data_manager.create_constant_bond_field("Bond Heat Flow", Float64, 1) - bond_heat_flow[1][1] = 1 - bond_heat_flow[2][1] = 1 - - test_data_manager = Thermal.distribute_heat_flows(test_data_manager, nodes) - - @test heat_flowNP1[1] == -1.0 - @test heat_flowNP1[2] == -1.0 - heat_flowNP1[1:2] .= 0 - bond_heat_flow[1][1] = 1 - bond_heat_flow[2][1] = -1 - - test_data_manager = Thermal.distribute_heat_flows(test_data_manager, nodes) - - @test heat_flowNP1[1] == -1 - @test heat_flowNP1[2] == 1 - - volume[2] = 0 - - test_data_manager = Thermal.distribute_heat_flows(test_data_manager, nodes) - - @test heat_flowNP1[1] == -1 - @test heat_flowNP1[2] == 2 -end