def get_vent_wall_temperature_by_simplified_calculation_no_02( parm: vw.Parameters, h_out: float): """ 簡易計算法案No.2:簡易式により通気層の平均温度を求める関数 :param parm: 計算条件パラメータ群 :param h_out: 室外側総合熱伝達率[W/(m2・K)] :return: 通気層の平均温度[degC], 室外側から通気層までの熱貫流率[W/(m2・K)], 室内側から通気層までの熱貫流率[W/(m2・K)] """ # 相当外気温度を計算 theta_sat = epf.get_theta_SAT(theta_e=parm.theta_e, a_surf=parm.a_surf, j_surf=parm.J_surf, h_out=h_out) # 有効放射率の計算 effective_emissivity = htc.effective_emissivity_parallel( parm.emissivity_1, parm.emissivity_2) # 対流熱伝達率、放射熱伝達率の計算 if parm.theta_r == 20.0: h_cv = htc.convective_heat_transfer_coefficient_simplified_winter( v_a=parm.v_a) h_rv = htc.radiative_heat_transfer_coefficient_simplified_winter( effective_emissivity=effective_emissivity) else: h_cv = htc.convective_heat_transfer_coefficient_simplified_summer( v_a=parm.v_a) h_rv = htc.radiative_heat_transfer_coefficient_simplified_summer( effective_emissivity=effective_emissivity) # 室外側から通気層までの熱貫流率、室内側から通気層までの熱貫流率を計算 u_o = epf.get_u_o(parm.C_1, h_cv, h_rv) u_i = epf.get_u_i(parm.C_2, h_cv, h_rv) # theta_weを計算 theta_we = (u_o * theta_sat + u_i * parm.theta_r) / (u_o + u_i) # 通気風量の計算 v_vent = parm.v_a * parm.l_d * parm.l_w # 通気層の平均空気温度の計算用の値を設定 if parm.v_a > 0.0: w_h = (u_o + u_i) / (get_c_air(parm.theta_e) * get_rho_air(parm.theta_e) * v_vent) epc = 1.0 - math.exp(-w_h * parm.l_h) x = 1.0 - epc / (w_h * parm.l_h) else: w_h = 0.0 epc = 0.0 x = 1.0 theta_as_ave = (1.0 - x) * parm.theta_e + x * theta_we return theta_as_ave, u_o, u_i
def get_wall_status_data_by_detailed_calculation( calc_mode_h_cv: str, calc_mode_h_rv: str) -> pd.DataFrame: """ 通気層を有する壁体の総当たりパラメータを取得し、各ケースの計算結果を保有するDataFrameを作成する :param calc_mode_h_cv: 対流熱伝達率の計算モード :param calc_mode_h_rv: 放射熱伝達率の計算モード :return: DataFrame """ # パラメータの総当たりリストを作成する parameter_name = [ 'theta_e', 'theta_r', 'j_surf', 'a_surf', 'C_1', 'C_2', 'l_h', 'l_w', 'l_d', 'angle', 'v_a', 'l_s', 'emissivity_1', 'emissivity_2' ] df = pd.DataFrame(get_parameter_list(), columns=parameter_name) # 固定値の設定 h_out = global_number.get_h_out() h_in = global_number.get_h_in() # 計算結果格納用配列を用意 theta_sat = [] # 相当外気温度[℃] theta_out_surf = [] # 外気側表面温度[℃] theta_1_surf = [] # 通気層に面する面1の表面温度[℃] theta_2_surf = [] # 通気層に面する面1の表面温度[℃] theta_in_surf = [] # 室内側表面温度[℃] theta_as_ave = [] # 通気層の平均温度[℃] effective_emissivity = [] # 有効放射率[-] h_cv = [] # 通気層の対流熱伝達率[W/(m2・K)] h_rv = [] # 通気層の放射熱伝達率[W/(m2・K)] theta_as_e = [] # 通気層の等価温度[℃] q_room_side = [] # 室内表面熱流[W/m2] k_e = [] # 通気層を有する壁体の相当熱貫流率を求めるための補正係数[-] heat_balance_0 = [] # 外気側表面の熱収支収支[W/m2] heat_balance_1 = [] # 通気層に面する面1の熱収支[W/m2] heat_balance_2 = [] # 通気層に面する面2の熱収支[W/m2] heat_balance_3 = [] # 室内側表面の熱収支[W/m2] heat_balance_4 = [] # 通気層内空気の熱収支[W/m2] is_optimize_succeed = [] # 最適化が正常に終了したかどうか optimize_message = [] # 最適化の終了メッセージ # エラーログ出力用の設定 log = Log() saved_handler = np.seterrcall(log) with np.errstate(all='log'): # withスコープ内でエラーが出た場合、Logを出力する for row in df.itertuples(): print(row[0]) # パラメータを設定 parms = (vw.Parameters(theta_e=row.theta_e, theta_r=row.theta_r, J_surf=row.j_surf, a_surf=row.a_surf, C_1=row.C_1, C_2=row.C_2, l_h=row.l_h, l_w=row.l_w, l_d=row.l_d, angle=row.angle, v_a=row.v_a, l_s=row.l_s, emissivity_1=row.emissivity_1, emissivity_2=row.emissivity_2)) # 通気層の状態値を取得 status = vw.get_wall_status_values(parms, calc_mode_h_cv, calc_mode_h_rv, h_out, h_in) theta_out_surf.append(status.matrix_temp[0]) theta_1_surf.append(status.matrix_temp[1]) theta_2_surf.append(status.matrix_temp[2]) theta_in_surf.append(status.matrix_temp[3]) theta_as_ave.append(status.matrix_temp[4]) effective_emissivity.append( htc.effective_emissivity_parallel( emissivity_1=row.emissivity_1, emissivity_2=row.emissivity_2)) h_cv.append(status.h_cv) h_rv.append(status.h_rv) # 通気層の等価温度を取得 theta_as_e_buf = epf.get_theata_as_e(status.matrix_temp[4], status.matrix_temp[1], status.h_cv, status.h_rv) theta_as_e.append(theta_as_e_buf) # 相当外気温度を計算 theta_sat_buf = epf.get_theta_SAT(row.theta_e, row.a_surf, row.j_surf, h_out) theta_sat.append(theta_sat_buf) # 通気層を有する壁体の相当熱貫流率を求めるための補正係数を取得 k_e.append(epf.get_k_e(theta_as_e_buf, row.theta_r, theta_sat_buf)) # 室内側表面熱流を計算 r_i_buf = epf.get_r_i(C_2=row.C_2) q_room_side.append( epf.get_heat_flow_room_side_by_vent_layer_heat_resistance( r_i=r_i_buf, theta_2=status.matrix_temp[2], theta_r=row.theta_r)) # 各層の熱収支収支を取得 heat_balance_0.append(status.matrix_heat_balance[0]) heat_balance_1.append(status.matrix_heat_balance[1]) heat_balance_2.append(status.matrix_heat_balance[2]) heat_balance_3.append(status.matrix_heat_balance[3]) heat_balance_4.append(status.matrix_heat_balance[4]) # 最適化に関する情報を取得 is_optimize_succeed.append(status.is_optimize_succeed) optimize_message.append(status.optimize_message) # 計算結果をDataFrameに追加 df['theta_sat'] = theta_sat df['theta_out_surf'] = theta_out_surf df['theta_1_surf'] = theta_1_surf df['theta_2_surf'] = theta_2_surf df['theta_in_surf'] = theta_in_surf df['theta_as_ave'] = theta_as_ave df['effective_emissivity'] = effective_emissivity df['h_cv'] = h_cv df['h_rv'] = h_rv df['theta_as_e'] = theta_as_e df['k_e'] = k_e df['q_room_side'] = q_room_side df['heat_balance_0'] = heat_balance_0 df['heat_balance_1'] = heat_balance_1 df['heat_balance_2'] = heat_balance_2 df['heat_balance_3'] = heat_balance_3 df['heat_balance_4'] = heat_balance_4 df['is_optimize_succeed'] = is_optimize_succeed df['optimize_message'] = optimize_message return df
def get_wall_status_data_by_simplified_calculation_no_04() -> pd.DataFrame: """ 通気層を有する壁体の総当たりパラメータを取得し、簡易計算法案No.4(簡易計算法案No.3をさらに簡略化)による計算結果を保有するDataFrameを作成する :param: なし :return: DataFrame """ # パラメータの総当たりリストを作成する parameter_name = [ 'theta_e', 'theta_r', 'j_surf', 'a_surf', 'C_1', 'C_2', 'l_h', 'l_w', 'l_d', 'angle', 'v_a', 'l_s', 'emissivity_1', 'emissivity_2' ] df = pd.DataFrame(get_parameter_list(), columns=parameter_name) # 固定値の設定 h_out = global_number.get_h_out() # 計算結果格納用配列を用意 theta_sat = [] # 相当外気温度[℃] h_cv = [] # 通気層の対流熱伝達率[W/(m2・K)] h_rv = [] # 通気層の放射熱伝達率[W/(m2・K)] u_dash = [] # 修正熱貫流率[W/(m2・K)] eta_dash = [] # 修正日射熱取得率[-] q_room_side = [] # 室内表面熱流[W/m2] # エラーログ出力用の設定 log = Log() saved_handler = np.seterrcall(log) with np.errstate(all='log'): # withスコープ内でエラーが出た場合、Logを出力する for row in df.itertuples(): print(row[0]) # パラメータを設定 parms = (vw.Parameters(theta_e=row.theta_e, theta_r=row.theta_r, J_surf=row.j_surf, a_surf=row.a_surf, C_1=row.C_1, C_2=row.C_2, l_h=row.l_h, l_w=row.l_w, l_d=row.l_d, angle=row.angle, v_a=row.v_a, l_s=row.l_s, emissivity_1=row.emissivity_1, emissivity_2=row.emissivity_2)) # 相当外気温度を計算 theta_sat.append( epf.get_theta_SAT(row.theta_e, row.a_surf, row.j_surf, h_out)) # 対流熱伝達率、放射熱伝達率、修正熱貫流率、修正日射熱取得率、室内側表面熱流を計算 h_cv_buf, h_rv_buf, u_dash_buf, eta_dash_buf, q_room_side_buf \ = vws.get_vent_wall_performance_factor_by_simplified_calculation_no_04(parm=parms, h_out=h_out) # 配列に格納 h_cv.append(h_cv_buf) h_rv.append(h_rv_buf) u_dash.append(u_dash_buf) eta_dash.append(eta_dash_buf) q_room_side.append(q_room_side_buf) # 計算結果をDataFrameに追加 df['theta_sat'] = theta_sat df['h_cv'] = h_cv df['h_rv'] = h_rv df['u_dash'] = u_dash df['eta_dash'] = eta_dash df['q_room_side'] = q_room_side return df
def get_wall_status_data_by_simplified_calculation_no_02() -> pd.DataFrame: """ 通気層を有する壁体の総当たりパラメータを取得し、簡易計算法案No.2(簡易式)による計算結果を保有するDataFrameを作成する :param: なし :return: DataFrame """ # パラメータの総当たりリストを作成する parameter_name = [ 'theta_e', 'theta_r', 'j_surf', 'a_surf', 'C_1', 'C_2', 'l_h', 'l_w', 'l_d', 'angle', 'v_a', 'l_s', 'emissivity_1', 'emissivity_2' ] df = pd.DataFrame(get_parameter_list(), columns=parameter_name) # 固定値の設定 h_out = global_number.get_h_out() h_in = global_number.get_h_in() # 計算結果格納用配列を用意 theta_sat = [] # 相当外気温度[℃] theta_as_ave = [] # 通気層の平均温度[℃] effective_emissivity = [] # 有効放射率[-] h_cv = [] # 通気層の対流熱伝達率[W/(m2・K)] h_rv = [] # 通気層の放射熱伝達率[W/(m2・K)] u_o = [] # 室外側から通気層までの熱貫流率[W/(m2・K)] u_i = [] # 室内側から通気層までの熱貫流率[W/(m2・K)] q_room_side = [] # 室内表面熱流[W/m2] # エラーログ出力用の設定 log = Log() saved_handler = np.seterrcall(log) with np.errstate(all='log'): # withスコープ内でエラーが出た場合、Logを出力する for row in df.itertuples(): print(row[0]) # パラメータを設定 parms = (vw.Parameters(theta_e=row.theta_e, theta_r=row.theta_r, J_surf=row.j_surf, a_surf=row.a_surf, C_1=row.C_1, C_2=row.C_2, l_h=row.l_h, l_w=row.l_w, l_d=row.l_d, angle=row.angle, v_a=row.v_a, l_s=row.l_s, emissivity_1=row.emissivity_1, emissivity_2=row.emissivity_2)) # 対流熱伝達率、放射熱伝達率を計算 effective_emissivity_buf = htc.effective_emissivity_parallel( emissivity_1=row.emissivity_1, emissivity_2=row.emissivity_2) if parms.theta_r == 20.0: h_cv_buf = htc.convective_heat_transfer_coefficient_simplified_winter( v_a=row.v_a) h_rv_buf = htc.radiative_heat_transfer_coefficient_simplified_winter( effective_emissivity=effective_emissivity_buf) else: h_cv_buf = htc.convective_heat_transfer_coefficient_simplified_summer( v_a=row.v_a) h_rv_buf = htc.radiative_heat_transfer_coefficient_simplified_summer( effective_emissivity=effective_emissivity_buf) effective_emissivity.append(effective_emissivity_buf) h_cv.append(h_cv_buf) h_rv.append(h_rv_buf) # 通気層平均温度を取得 theta_as_ave_buf, u_o_buf, u_i_buf = vws.get_vent_wall_temperature_by_simplified_calculation_no_02( parm=parms, h_out=h_out) theta_as_ave.append(theta_as_ave_buf) # 相当外気温度を計算 theta_sat.append( epf.get_theta_SAT(row.theta_e, row.a_surf, row.j_surf, h_out)) # 室外側から通気層までの熱貫流率、室内側から通気層までの熱貫流率 u_o.append(u_o_buf) u_i.append(u_i_buf) # 室内側表面熱流を計算 q_room_side.append( epf.get_heat_flow_room_side_by_vent_layer_heat_transfer_coeff( u_i=u_i_buf, theta_as_ave=theta_as_ave_buf, theta_r=row.theta_r)) # 計算結果をDataFrameに追加 df['theta_sat'] = theta_sat df['theta_as_ave'] = theta_as_ave df['effective_emissivity'] = effective_emissivity df['h_cv'] = h_cv df['h_rv'] = h_rv df['u_o'] = u_o df['u_i'] = u_i df['q_room_side'] = q_room_side return df
def get_wall_status_data_by_simplified_calculation_no_01() -> pd.DataFrame: """ 通気層を有する壁体の総当たりパラメータを取得し、簡易計算法案No.1(簡易版の行列式)による計算結果を保有するDataFrameを作成する :param: なし :return: DataFrame """ # パラメータの総当たりリストを作成する parameter_name = [ 'theta_e', 'theta_r', 'j_surf', 'a_surf', 'C_1', 'C_2', 'l_h', 'l_w', 'l_d', 'angle', 'v_a', 'l_s', 'emissivity_1', 'emissivity_2' ] df = pd.DataFrame(get_parameter_list(), columns=parameter_name) # 固定値の設定 h_out = global_number.get_h_out() # 計算結果格納用配列を用意 theta_sat = [] # 相当外気温度[℃] theta_1_surf = [] # 通気層に面する面1の表面温度[℃] theta_2_surf = [] # 通気層に面する面1の表面温度[℃]] theta_as_ave = [] # 通気層の平均温度[℃] effective_emissivity = [] # 有効放射率[-] h_cv = [] # 通気層の対流熱伝達率[W/(m2・K)] h_rv = [] # 通気層の放射熱伝達率[W/(m2・K)] q_room_side = [] # 室内表面熱流[W/m2] # エラーログ出力用の設定 log = Log() saved_handler = np.seterrcall(log) with np.errstate(all='log'): # withスコープ内でエラーが出た場合、Logを出力する for row in df.itertuples(): print(row[0]) # パラメータを設定 parms = (vw.Parameters(theta_e=row.theta_e, theta_r=row.theta_r, J_surf=row.j_surf, a_surf=row.a_surf, C_1=row.C_1, C_2=row.C_2, l_h=row.l_h, l_w=row.l_w, l_d=row.l_d, angle=row.angle, v_a=row.v_a, l_s=row.l_s, emissivity_1=row.emissivity_1, emissivity_2=row.emissivity_2)) # 通気層の状態値を取得 temps, h_cv_buf, h_rv_buf, r_i_buf = vws.get_vent_wall_temperature_by_simplified_calculation_no_01( parm=parms, h_out=h_out) theta_1_surf.append(temps[0]) theta_2_surf.append(temps[2]) theta_as_ave.append(temps[1]) effective_emissivity.append( htc.effective_emissivity_parallel( emissivity_1=row.emissivity_1, emissivity_2=row.emissivity_2)) h_cv.append(h_cv_buf) h_rv.append(h_rv_buf) # 相当外気温度を計算 theta_sat_buf = epf.get_theta_SAT(theta_e=row.theta_e, a_surf=row.a_surf, j_surf=row.j_surf, h_out=h_out) theta_sat.append(theta_sat_buf) # 室内側表面熱流を計算 q_room_side.append( epf.get_heat_flow_room_side_by_vent_layer_heat_resistance( r_i=r_i_buf, theta_2=temps[2], theta_r=row.theta_r)) # 計算結果をDataFrameに追加 df['theta_sat'] = theta_sat df['theta_1_surf'] = theta_1_surf df['theta_2_surf'] = theta_2_surf df['theta_as_ave'] = theta_as_ave df['effective_emissivity'] = effective_emissivity df['h_cv'] = h_cv df['h_rv'] = h_rv df['q_room_side'] = q_room_side return df
def get_vent_wall_temperature_by_simplified_calculation_no_01( parm: vw.Parameters, h_out: float) -> np.zeros(3): """ 簡易計算法案No.1:簡易版の行列式により各部位の温度を求める関数 :param parm: 計算条件パラメータ群 :param h_out: 室外側総合熱伝達率[W/(m2・K)] :return: 各部位の温度(3×1の行列)[degC], 対流熱伝達率[W/(m2・K)], 放射熱伝達率[W/(m2・K)], 室内側から通気層表面までの熱抵抗[(m2・K)/W] """ # 相当外気温度を計算 theta_SAT = epf.get_theta_SAT(theta_e=parm.theta_e, a_surf=parm.a_surf, j_surf=parm.J_surf, h_out=h_out) # 行列の初期化 matrix_coeff = np.zeros(shape=(3, 3)) matrix_const = np.zeros(3) # 有効放射率の計算 effective_emissivity = htc.effective_emissivity_parallel( parm.emissivity_1, parm.emissivity_2) # 対流熱伝達率、放射熱伝達率の計算 if parm.theta_r == 20.0: h_cv = htc.convective_heat_transfer_coefficient_simplified_winter( v_a=parm.v_a) h_rv = htc.radiative_heat_transfer_coefficient_simplified_winter( effective_emissivity=effective_emissivity) else: h_cv = htc.convective_heat_transfer_coefficient_simplified_summer( v_a=parm.v_a) h_rv = htc.radiative_heat_transfer_coefficient_simplified_summer( effective_emissivity=effective_emissivity) # 通気風量の計算 v_vent = parm.v_a * parm.l_d * parm.l_w # 通気層の平均空気温度の計算用の値を設定 epc_s = 0.0 if parm.v_a > 0.0: beta = (2 * h_cv * parm.l_w) / (get_c_air(parm.theta_e) * get_rho_air(parm.theta_e) * v_vent) epc_s = 1.0 / parm.l_h * 1.0 / beta * (math.exp(-beta * parm.l_h) - 1) # 熱抵抗を設定 R_o = epf.get_r_o(parm.C_1) R_i = epf.get_r_i(parm.C_2) # 行列に値を設定 matrix_coeff[0][0] = 1.0 / R_o + h_cv + h_rv matrix_coeff[0][1] = -h_cv matrix_coeff[0][2] = -h_rv matrix_coeff[1][0] = (1.0 + epc_s) / 2.0 matrix_coeff[1][1] = -1.0 matrix_coeff[1][2] = (1.0 + epc_s) / 2.0 matrix_coeff[2][0] = -h_rv matrix_coeff[2][1] = -h_cv matrix_coeff[2][2] = 1.0 / R_i + h_cv + h_rv matrix_const[0] = (1.0 / R_o) * theta_SAT matrix_const[1] = epc_s * parm.theta_e matrix_const[2] = (1.0 / R_i) * parm.theta_r # 逆行列を計算 matrix_coeff_inv = np.linalg.inv(matrix_coeff) # 各部位の温度を計算 matrix_temp = np.matmul(matrix_coeff_inv, matrix_const) return matrix_temp, h_cv, h_rv, R_i