This notebook shows how a set of disassembled thermal circuits is assembled into a single thermal circuit. The assembling can be by using assembling matrix or assembling lits. The assembling from matrix is implemented in the functions assemble_TCd_matrix
. To assemble from lists, first the assembling lists are transformed in assembly matrix.
import pandas as pd
import pd_dm4bem
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.
The disassembled circuits and the indications on how to assemble them are given in the folder .\bldg
composed by the files (see Walls data in 01wall2TC.ipynb):
assembly_lists.csv
: lists with the nodes that merge;assembly_matrix.csv
: matrix with the nodes that merge;TC0.csv, ... , TC3.csv
;wall_types.csv
: physical properties and width of each mayerial;walls_out.csv
: geometric and surface characteristics of each wall.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 = 'bldg'
# Disassembled thermal circuits
TCd = pd_dm4bem.bldg2TCd(folder_path,
TC_auto_number=True)
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 = pd_dm4bem.assemble_TCd_matrix(TCd, ass_mat)
# pd_dm4bem.print_TC(TCm)
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 = pd_dm4bem.assemble_lists2matrix(ass_lists)
TCl = pd_dm4bem.assemble_TCd_matrix(TCd, ass_mat)
The otained thermal circuit has all the branches of the set of disassembled circuits but fewer nodes (Figure 2).
pd_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.0 0.0 0.0 0.0 0.0 0.0 -1.0 c1_q0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 c1_q1 -1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 c1_q2 0.0 -1.0 1.0 0.0 0.0 0.0 0.0 0.0 c2_q0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 c3_q0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 ow0_q0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 ow0_q1 0.0 0.0 0.0 -1.0 1.0 0.0 0.0 0.0 ow0_q2 0.0 0.0 0.0 0.0 -1.0 1.0 0.0 0.0 ow0_q3 0.0 0.0 0.0 0.0 0.0 -1.0 1.0 0.0 ow0_q4 0.0 0.0 0.0 0.0 0.0 0.0 -1.0 1.0 ow0_q5 0.0 0.0 1.0 0.0 0.0 0.0 0.0 -1.0 G: c0_q0 44.7868 c1_q0 165.7890 c1_q1 630.0000 c1_q2 72.0000 c2_q0 9.0000 c3_q0 1000000.0000 ow0_q0 1125.0000 ow0_q1 630.0000 ow0_q2 630.0000 ow0_q3 30.3750 ow0_q4 30.3750 ow0_q5 360.0000 dtype: float64 C: c1_θ0 1089000.0 c1_θ1 0.0 c2_θ0 32400.0 ow0_θ0 0.0 ow0_θ1 18216000.0 ow0_θ2 0.0 ow0_θ3 239580.0 ow0_θ4 0.0 dtype: float64 b: c0_q0 0 c1_q0 To c1_q1 0 c1_q2 0 c2_q0 To c3_q0 Ti_sp ow0_q0 To ow0_q1 0 ow0_q2 0 ow0_q3 0 ow0_q4 0 ow0_q5 0 dtype: object f: c1_θ0 Φ c1_θ1 0 c2_θ0 Qa ow0_θ0 Qo ow0_θ1 0 ow0_θ2 0 ow0_θ3 0 ow0_θ4 Qi dtype: object y: c1_θ0 0.0 c1_θ1 0.0 c2_θ0 3.0 ow0_θ0 1.0 ow0_θ1 0.0 ow0_θ2 0.0 ow0_θ3 0.0 ow0_θ4 0.0 dtype: 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 assembeled thermal circuit since they were merged with the primary nodes.