Assembled thermal circuits#
This notebook shows how a set of disassembled thermal circuits is assembled into a single thermal circuit. The assembling can be done by using an assembling matrix or assembling lists. The assembling from matrix is implemented in the function assemble_TCd_matrix
. To assemble from lists, first the assembling lists are transformed in assembly matrix by using the function assemble_lists2matrix()
.
import pandas as pd
import dm4bem
Stating the problem#
Consider the disassembled thermal circuits shown in Figure 1 that we want to assemble as shown in Figure 2.
Figure 1. Four disassembled thermal circuits: wall_out, TC0, TC1, TC2, TC3.
Figure 2. The assembling of the four circuits from Figure 1.
Description of the folder containing the circuits#
The disassembled circuits and the indications on how to assemble them are given in the folder .\bldg
(link) composed by the files (see Walls data in pd01wall2TC.ipynb):
assembly:
assembly_lists.csv: lists with the nodes that merge;
assembly_matrix.csv: matrix with the nodes that merge;
walls:
wall_types.csv: physical properties and width of each mayerial;
walls_out.csv: geometric and surface characteristics of each wall.
Assembling#
In order to obtain the assembled circuit, first we need to construct the disassembled thermal circuits TCd
. The numbering of the thermal circuits TC
can be automatic or the symbols given in TC_.csv
files can be used.
folder_path = './pd/bldg'
# Disassembled thermal circuits
TCd = dm4bem.bldg2TCd(folder_path,
TC_auto_number=True)
Use of assembling matrix#
Then, we can obtain the assembled thermal circuits by using the assembly matrix.
# Assembled thermal circuit from assembly_matrix.csv
ass_mat = pd.read_csv(folder_path + '/assembly_matrix.csv')
TCm = dm4bem.assemble_TCd_matrix(TCd, ass_mat)
# dm4bem.print_TC(TCm)
Use of assembling lists#
Alternatively, we can obtain the assembled circuit by using the assembly lists.
# Assembled thermal circuit from assembly_lists.csv
ass_lists = pd.read_csv(folder_path + '/assembly_lists.csv')
ass_mat = dm4bem.assemble_lists2matrix(ass_lists)
TCl = dm4bem.assemble_TCd_matrix(TCd, ass_mat)
The obtained thermal circuit has all the branches of the set of disassembled circuits but fewer nodes (Figure 2).
dm4bem.print_TC(TCl)
A:
c1_θ0 c1_θ1 c2_θ0 ow0_θ0 ow0_θ1 ow0_θ2 ow0_θ3 ow0_θ4
c0_q0 0.0 1.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ype: float64
Note that the nodes which are faded in Figure 2 (c0_θ0, c0_θ1, c1_θ2, c3_θ0 and ow0_θ5) do not exist anymore in the assembled thermal circuit since they were merged with the primary nodes.