Skip to content

Commit

Permalink
refac
Browse files Browse the repository at this point in the history
  • Loading branch information
JTHesse committed Oct 8, 2024
1 parent 693ef2f commit 9a39c5e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 48 deletions.
1 change: 0 additions & 1 deletion src/Models/Thermal/Thermal_Factory.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
47 changes: 0 additions & 47 deletions test/unit_tests/Models/Thermal/ut_Thermal_Factory.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 9a39c5e

Please sign in to comment.