Skip to content

Commit c17e52c

Browse files
authored
Merge pull request #15 from BAMresearch/development
Merge development for new version
2 parents 753667c + 5358465 commit c17e52c

File tree

11 files changed

+297
-61
lines changed

11 files changed

+297
-61
lines changed

bamLoadBasedTesting/Example/modelOnTestBench.py renamed to Example/modelOnTestBench.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
from bamLoadBasedTesting.BuildingModels import BAM_RRT_MT
1+
from bamLoadBasedTesting.BuildingModels import BAM_RRT_HP3_variableflow_8Kcalc
22
import time
33

44
# Step Size
5-
stepSize = 1
5+
stepSize = 1 #ToDo: Allign step size with your own step size
66

77
# Create Reduced building
8-
BamBuilding = BAM_RRT_MT.MTBui_A
8+
BamBuilding = BAM_RRT_HP3_variableflow_8Kcalc.MTBui_F
99

1010
while True:
1111
t1 = time.time()
1212

1313
t_sup_test_bench = 52 #TODO Connect your test bench here!
14-
v_flow = 720/3600 #in l/s #TODO Connect your test bench here!
14+
m_w_hp = 720/3600 #in kg/s #TODO Connect your test bench here!
1515
t_ret_test_bench = 45 #TODO Connect your test bench here!
1616
#Calculate time step in Building model
17-
BamBuilding.doStep(t_sup=t_sup_test_bench, m_dot=v_flow, stepSize=stepSize, t_ret_mea=t_ret_test_bench)
17+
BamBuilding.doStep(t_sup=t_sup_test_bench, m_w_hp=m_w_hp, stepSize=stepSize, t_ret_mea=t_ret_test_bench)
1818

1919
print("Has to be connected to test bench! Set return temperature for test bench:" + str(BamBuilding.t_ret)) #TODO Connect your test bench here!
2020

2121
print("Supply Temperature: " + str(round(t_sup_test_bench, 2)) +
22-
" V_flow : " + str(round(v_flow, 2)) +
22+
" m_flow : " + str(round(m_w_hp, 2)) +
2323
" Return Temperature: " + str(round(BamBuilding.t_ret, 2)))
2424
print(" T_H = " + str(round(BamBuilding.MassH.T, 2)) +
2525
" T_B = " + str(round(BamBuilding.MassB.T, 2)) +
Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
"""Script to test 2-mass-building model"""
22

3-
from bamLoadBasedTesting.BuildingModels import BAM_RRT_MT
3+
from bamLoadBasedTesting.BuildingModels import BAM_RRT_HP3_fixedflow
44
import numpy as np
55
import matplotlib.pyplot as plt
66

77
# Create new building model:
8-
Building = BAM_RRT_MT.MTBui_E
9-
stepSize = 0.5
8+
comBui = BAM_RRT_HP3_fixedflow
9+
Building = comBui.MTBui_D
10+
stepSize = 1
1011
T_b = []
1112
T_H = []
1213
T_ret = []
@@ -17,55 +18,76 @@
1718
q_flow_int = []
1819
t = []
1920
t_sup = []
21+
T_sup_hs = []
22+
m_flow_byp = []
23+
m_flow_hp = []
24+
m_flow_sh = []
2025
internalGains = 0 # 0 W constant internal gains into building
2126
#loop by doing x steps
22-
for x in range(3600*3):
27+
m_flow = comBui.m_dot_H_design
28+
for x in range(3600*6):
2329
t.append(x * stepSize)
2430
"Step response"
25-
if x<3600:
26-
t_sup.append(52)
31+
if x<3600*6:
32+
t_sup.append(30)
2733
else:
2834
t_sup.append(Building.t_ret)
2935
T_ret.append(Building.t_ret)
3036
"Do step with Building Model"
31-
Building.doStep(t_sup=t_sup[-1], t_ret_mea=T_ret[-1], m_dot=720/3600, stepSize=stepSize, q_dot_int=internalGains)
37+
Building.doStep(t_sup=t_sup[-1], t_ret_mea=T_ret[-1], m_w_hp=m_flow, stepSize=stepSize, q_dot_int=internalGains)
38+
if x==0:
39+
print("Start value for return temperature " + str(T_ret[-1]) + " °C")
3240
"Save current values:"
3341
T_b.append(Building.MassB.T)
3442
T_H.append(Building.MassH.T)
43+
T_sup_hs.append(Building.hydraulicSwitch.T_sup_swi)
3544
q_flow_ba.append(Building.q_dot_ba)
3645
q_flow_hb.append(Building.q_dot_hb)
3746
q_flow_hp.append(Building.q_dot_hp)
3847
q_flow_int.append(Building.q_dot_int)
3948
q_flow_bh.append(Building.q_dot_bh)
49+
m_flow_byp.append(Building.hydraulicSwitch.m_flow_swi)
50+
m_flow_hp.append(m_flow)
51+
m_flow_sh.append(Building.hydraulicSwitch.m_flow_sh)
4052

4153
hours = np.array(t)
4254
hours = hours/3600
4355
fig, ax = plt.subplots()
4456
ax.plot(hours, T_ret, label = "return temperature")
4557
ax.plot(hours, T_H, label = 'transfer system temperature')
46-
ax.plot(hours, t_sup, label = 'supply temperature')
58+
ax.plot(hours, t_sup, label = 'supply temperature heat pump')
59+
ax.plot(hours, T_sup_hs, label = 'supply temperature transfer system')
4760
ax.legend()
4861
plt.grid(True)
49-
plt.ylabel('[°C]')
62+
plt.ylabel('Temperature in °C')
5063
plt.xlabel('time in hours')
5164
plt.show()
5265

5366
fig, ax = plt.subplots()
5467
ax.plot(hours, q_flow_hp, label = 'heat flow heat pump --> heating system ')
5568
ax.plot(hours, q_flow_hb, label = 'heat flow transfer --> building')
5669
ax.plot(hours, q_flow_ba, label = 'heat flow Building --> Ambient')
57-
ax.plot(hours, q_flow_int, label = 'heat flow internal gains --> building')
58-
ax.plot(hours, q_flow_bh, label = 'heat flow booster heater --> heating system')
70+
#ax.plot(hours, q_flow_bh, label = 'heat flow booster heater --> heating system')
5971
ax.legend()
60-
plt.ylabel('[W]')
72+
plt.ylabel('Heat flow in W')
6173
plt.xlabel('time in hours')
6274
plt.grid(True)
6375
plt.show()
6476

6577
fig, ax = plt.subplots()
6678
ax.plot(hours, T_b, label = 'building temperature')
6779
ax.legend()
68-
plt.ylabel('[°C]')
80+
plt.ylabel('Temperature in °C')
81+
plt.xlabel('time in hours')
82+
plt.grid(True)
83+
plt.show()
84+
85+
fig, ax = plt.subplots()
86+
ax.plot(hours, m_flow_byp, label = 'm_flow_bypass')
87+
ax.plot(hours, m_flow_sh, label = 'm_flow_sh')
88+
ax.plot(hours, m_flow_hp, label = 'm_flow_hp')
89+
ax.legend()
90+
plt.ylabel('mass flow in kg/s')
6991
plt.xlabel('time in hours')
7092
plt.grid(True)
7193
plt.show()
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
from bamLoadBasedTesting.twoMassModel import CalcParameters
2+
3+
"Change design power according to your heat pump"
4+
q_design_e = 7550 # design heating power in E - only value which is dependent on the heat pump
5+
t_a_design = -10
6+
t_flow_design = 55
7+
tau_b = 209125
8+
tau_h = 1957
9+
m_dot_H_design = 0.129 #kg/s equal to 464/3600
10+
t_b = 20 # constant building temperature
11+
12+
13+
#TLF: T_biv=-5°C
14+
ParaMTBui_F = CalcParameters(t_a_design=t_a_design, t_a=-5, q_design=q_design_e, PLC=0.81, tau_b=tau_b, tau_h=tau_h,
15+
t_flow_design=t_flow_design, t_flow_plc=49.8, t_b=t_b, const_flow=True, m_dot_H_design=m_dot_H_design,
16+
hydraulicSwitch = False)
17+
MTBui_F = ParaMTBui_F.createBuilding()
18+
19+
20+
ParaMTBui_B = CalcParameters(t_a_design=t_a_design, t_a=2, q_design=q_design_e, PLC=0.538, tau_b=tau_b, tau_h=tau_h,
21+
t_flow_design=t_flow_design, t_flow_plc=42, t_b=t_b, const_flow=True, m_dot_H_design=m_dot_H_design,
22+
hydraulicSwitch = False)
23+
MTBui_B = ParaMTBui_B.createBuilding()
24+
25+
26+
ParaMTBui_C = CalcParameters(t_a_design=t_a_design, t_a=7, q_design=q_design_e, PLC=0.346, tau_b=tau_b, tau_h=tau_h,
27+
t_flow_design=t_flow_design, t_flow_plc=36, t_b=t_b, const_flow=True, m_dot_H_design=m_dot_H_design,
28+
hydraulicSwitch = False)
29+
MTBui_C = ParaMTBui_C.createBuilding()
30+
31+
32+
ParaMTBui_D = CalcParameters(t_a_design=t_a_design, t_a=12, q_design=q_design_e, PLC=0.154, tau_b=tau_b, tau_h=tau_h,
33+
t_flow_design=t_flow_design, t_flow_plc=30, t_b=t_b, const_flow=True, m_dot_H_design=m_dot_H_design,
34+
hydraulicSwitch = False)
35+
MTBui_D = ParaMTBui_D.createBuilding()
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
from bamLoadBasedTesting.twoMassModel import CalcParameters
2+
3+
"Change design power according to your heat pump"
4+
q_design_e = 7550 # design heating power in E - only value which is dependent on the heat pump
5+
t_a_design = -10
6+
t_flow_design = 55
7+
tau_b = 209125
8+
tau_h = 1957
9+
m_dot_H_design = 0.129 #kg/s equal to 464/3600
10+
t_b = 20 # constant building temperature
11+
12+
13+
#TLF: T_biv=-5°C
14+
ParaMTBui_F = CalcParameters(t_a_design=t_a_design, t_a=-5, q_design=q_design_e, PLC=0.81, tau_b=tau_b, tau_h=tau_h,
15+
t_flow_design=t_flow_design, t_flow_plc=49.8, t_b=t_b, const_flow=True, m_dot_H_design=m_dot_H_design,
16+
hydraulicSwitch = True)
17+
MTBui_F = ParaMTBui_F.createBuilding()
18+
19+
20+
ParaMTBui_B = CalcParameters(t_a_design=t_a_design, t_a=2, q_design=q_design_e, PLC=0.538, tau_b=tau_b, tau_h=tau_h,
21+
t_flow_design=t_flow_design, t_flow_plc=42, t_b=t_b, const_flow=True, m_dot_H_design=m_dot_H_design,
22+
hydraulicSwitch = True)
23+
MTBui_B = ParaMTBui_B.createBuilding()
24+
25+
26+
ParaMTBui_C = CalcParameters(t_a_design=t_a_design, t_a=7, q_design=q_design_e, PLC=0.346, tau_b=tau_b, tau_h=tau_h,
27+
t_flow_design=t_flow_design, t_flow_plc=36, t_b=t_b, const_flow=True, m_dot_H_design=m_dot_H_design,
28+
hydraulicSwitch = True)
29+
MTBui_C = ParaMTBui_C.createBuilding()
30+
31+
32+
ParaMTBui_D = CalcParameters(t_a_design=t_a_design, t_a=12, q_design=q_design_e, PLC=0.154, tau_b=tau_b, tau_h=tau_h,
33+
t_flow_design=t_flow_design, t_flow_plc=30, t_b=t_b, const_flow=True, m_dot_H_design=m_dot_H_design,
34+
hydraulicSwitch = True)
35+
MTBui_D = ParaMTBui_D.createBuilding()
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
from bamLoadBasedTesting.twoMassModel import CalcParameters
2+
3+
"Change design power according to your heat pump"
4+
q_design_e = 7550 # design heating power in E - only value which is dependent on the heat pump
5+
t_a_design = -10
6+
t_flow_design = 55
7+
tau_b = 209125
8+
tau_h = 1957
9+
m_dot_H_design = q_design_e / (4183 * 8) #kg/s equal to 8 K spread in design power point
10+
t_b = 20 # constant building temperature
11+
12+
13+
#TLF: T_biv=-5°C
14+
ParaMTBui_F = CalcParameters(t_a_design=t_a_design, t_a=-5, q_design=q_design_e, PLC=0.81, tau_b=tau_b, tau_h=tau_h,
15+
t_flow_design=t_flow_design, t_flow_plc=49.8, t_b=t_b, const_flow=True, m_dot_H_design=m_dot_H_design,
16+
hydraulicSwitch = True)
17+
MTBui_F = ParaMTBui_F.createBuilding()
18+
19+
20+
ParaMTBui_B = CalcParameters(t_a_design=t_a_design, t_a=2, q_design=q_design_e, PLC=0.538, tau_b=tau_b, tau_h=tau_h,
21+
t_flow_design=t_flow_design, t_flow_plc=42, t_b=t_b, const_flow=True, m_dot_H_design=m_dot_H_design,
22+
hydraulicSwitch = True)
23+
MTBui_B = ParaMTBui_B.createBuilding()
24+
25+
26+
ParaMTBui_C = CalcParameters(t_a_design=t_a_design, t_a=7, q_design=q_design_e, PLC=0.346, tau_b=tau_b, tau_h=tau_h,
27+
t_flow_design=t_flow_design, t_flow_plc=36, t_b=t_b, const_flow=True, m_dot_H_design=m_dot_H_design,
28+
hydraulicSwitch = True)
29+
MTBui_C = ParaMTBui_C.createBuilding()
30+
31+
32+
ParaMTBui_D = CalcParameters(t_a_design=t_a_design, t_a=12, q_design=q_design_e, PLC=0.154, tau_b=tau_b, tau_h=tau_h,
33+
t_flow_design=t_flow_design, t_flow_plc=30, t_b=t_b, const_flow=True, m_dot_H_design=m_dot_H_design,
34+
hydraulicSwitch = True)
35+
MTBui_D = ParaMTBui_D.createBuilding()

bamLoadBasedTesting/BuildingModels/BAM_RRT_MT.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,30 @@
22

33
"Change design power according to your heat pump"
44
q_design_e = 5390 # design heating power in E - only value which is dependent on the heat pump
5+
t_a_design = -10
6+
t_flow_design = 55
57
tau_b = 209125
68
tau_h = 1957
79
mass_flow = 720/3600
810
t_b = 20 # constant building temperature
911

10-
ParaMTBui_E = CalcParameters(t_a=-10, q_design=q_design_e, tau_b=tau_b, tau_h=tau_h, t_flow_design=55, t_b=t_b,
11-
const_flow=True, mass_flow=mass_flow, boostHeat=True, maxPowBooHea=7000)
12+
ParaMTBui_E = CalcParameters(t_a_design=t_a_design, t_a=-10, q_design=q_design_e, PLC=1, tau_b=tau_b, tau_h=tau_h,
13+
t_flow_design=t_flow_design, t_flow_plc=55, t_b=t_b, const_flow=True, m_dot_H_design=mass_flow,
14+
boostHeat=False, maxPowBooHea=7000)
1215
MTBui_E = ParaMTBui_E.createBuilding()
1316

14-
ParaMTBui_A = CalcParameters(t_a=-7, q_design=q_design_e*0.885, tau_b=tau_b, tau_h=tau_h, t_flow_design=52, t_b=t_b,
15-
const_flow=True, mass_flow=mass_flow)
17+
ParaMTBui_A = CalcParameters(t_a_design=t_a_design, t_a=-7, q_design=q_design_e, PLC=0.885, tau_b=tau_b, tau_h=tau_h,
18+
t_flow_design=t_flow_design, t_flow_plc=52, t_b=t_b, const_flow=True, m_dot_H_design=mass_flow)
1619
MTBui_A = ParaMTBui_A.createBuilding()
1720

18-
ParaMTBui_B = CalcParameters(t_a=2, q_design=q_design_e*.538, tau_b=tau_b, tau_h=tau_h, t_flow_design=42, t_b=t_b,
19-
const_flow=True, mass_flow=mass_flow)
21+
ParaMTBui_B = CalcParameters(t_a_design=t_a_design, t_a=2, q_design=q_design_e, PLC=0.538, tau_b=tau_b, tau_h=tau_h,
22+
t_flow_design=t_flow_design, t_flow_plc=42, t_b=t_b, const_flow=True, m_dot_H_design=mass_flow)
2023
MTBui_B = ParaMTBui_B.createBuilding()
2124

22-
ParaMTBui_C = CalcParameters(t_a=7, q_design=q_design_e*0.346, tau_b=tau_b, tau_h=tau_h, t_flow_design=36, t_b=t_b,
23-
const_flow=True, mass_flow=mass_flow)
25+
ParaMTBui_C = CalcParameters(t_a_design=t_a_design, t_a=7, q_design=q_design_e, PLC=0.346, tau_b=tau_b, tau_h=tau_h,
26+
t_flow_design=t_flow_design, t_flow_plc=36, t_b=t_b, const_flow=True, m_dot_H_design=mass_flow)
2427
MTBui_C = ParaMTBui_C.createBuilding()
2528

26-
ParaMTBui_D = CalcParameters(t_a=12, q_design=q_design_e *0.154, tau_b=tau_b, tau_h=tau_h, t_flow_design=30, t_b=t_b,
27-
const_flow=True, mass_flow=mass_flow)
29+
ParaMTBui_D = CalcParameters(t_a_design=t_a_design, t_a=12, q_design=q_design_e, PLC=0.154, tau_b=tau_b, tau_h=tau_h,
30+
t_flow_design=t_flow_design, t_flow_plc=30, t_b=t_b, const_flow=True, m_dot_H_design=mass_flow)
2831
MTBui_D = ParaMTBui_D.createBuilding()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version__ = "0.1.0"
1+
__version__ = "0.25.0"
22
__author__ = "Stephan Göbel"

bamLoadBasedTesting/Example/__init__.py

Lines changed: 0 additions & 2 deletions
This file was deleted.

bamLoadBasedTesting/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version__ = "0.1.0"
1+
__version__ = "0.25.0"
22
__author__ = "Stephan Göbel"

0 commit comments

Comments
 (0)