#---------Local epsilon------------------ EPSILOC12 = 1.0e-12 EPSILOC11 = 1.0e-11 EPSILOC10 = 1.0e-10 EPSILOC9 = 1.0e-9 EPSILOC8 = 1.0e-8 EPSILOC7 = 1.0e-7 EPSILOC6 = 1.0e-6 EPSILOC5 = 1.0e-5 EPSILOC4 = 1.0e-4 #-----Range for checking is det(beta) = 0 and cos(beta*L/sqrt(k)) = 0 for Dirichlet BC ---- NEPSILOC = 5 #-------Min and Max beta---------------------- BETAMIN = 1.0e-12 BETAMAX = 0.1 #---- Number of periods functions det(beta) in zeroo search- this is old version NPERIOD = 100 #-------Number of points in one 'preiod' of det (beta) function in first zero's search ---- NODEBETAT = 30 #-------Zoom in in second search (deep search) for det(beta) = 0------ DEEPITERBETA = 4 #-------Number of iteration in deep search ------------ NITERBETA = 2 #------Position of x and y labels ---------------------- XLAB_XCOOR = 1.01 XLAB_YCOOR = -0.06 YLAB_XCOOR = -0.04 YLAB_YCOOR = 0.97 #-------Legend size----------------------------------- LEGEND_SIZE = 15 #-------Number of plot points------------------------- XNODE = 100 #---------- Numerical integration parameters---------- EPS_ABS_INT = 1.49e-10 EPS_REL_INT = 1.49e-10 LIMIT_INT = 10000 SEC_HOUR = 3600 HOUR_DAY = 24 SEC_DAY = HOUR_DAY * SEC_HOUR #------------- f1(x) & f2(x) corrections ------------------------------------------------------------------------------- # f1*(x) = f1(x) - exp( -k1 * x ) => exp ( -k1 * d1 ) = exp ( -nk1 ) # f2*(x) = f2(x) - exp( -k2 * ( L - x ) ) => exp exp ( -k2 * (xn-1 - L ) ) = exp exp ( -k2 * dn ) = exp ( -nk2 ) # k1 = NK1/d1 # k2 = NK2/dn NK1 = 20.0 NK2 = 20.0 #-------------------- BC conditions------------------------------------------------------------------------------------- # key words for boundary conditions # d - Dirichle BC for both side of wall (t(x= 0,L) = t1,2(t)) # n - Neuman BC for both side of wall (q(x=0,L) = q1,2 (t)) # tq1 - Dirichle BC from side 1 (x=0) and Neuman BC from side 2 (x = L) (t(x= 0) = t1(t); q(x= L) = q2(t) ) # tq2 - Dirichle BC from side 2 (x=0) and Neuman BC from side 1 (x = L) (t(x= 0) = q1(t); q(x= L) = t2(t) ) # m0 - Mixed BC (-lambda1,n * dt/dx(x=0,L) = alf1,2 * (-/+t +/- t1,2(t)) from both side of wall # md1 - Dirichle BC from side 1 (x= 0) and mixed form side 2 (x = L) (t(x= 0) = t1(t); -lambda(n) * dt/dx(x=L) = alf2 * (t - t2(t)) # md2 - Dirichle BC from side 2 (x= 0) and mixed form side 1 (x = L) (t(x= L) = t2(t); -lambda(1) * dt/dx(x=0) = alf1 * (t1(t) - t ) # mn1 - Dirichle BC from side 1 (x= 0) and mixed form side 2 (x = L) (q(x= 0) = q1(t); -lambda(n) * dt/dx(x=L) = alf2 * (t - t2(t)) # mn2 - Dirichle BC from side 2 (x= 0) and mixed form side 1 (x = L) (q(x= L) = q2(t); -lambda(1) * dt/dx(x=0) = alf1 * (t1(t) - t ) #----------------------------------------------------------------------------------------------------------------------- BC_KEYWORDS = ['d', 'n', 'tq1' ,'tq2', 'm0', 'md1', 'md2', 'mn1', 'mn2'] BC_NAME = {'d': 'Dirichle', 'n': 'Neuman', 'm0': 'Mixed', 'tq1': '1:Dirichle + 2:Neuman', 'tq2': '1:Neuman + 2:Dirichle', 'md1': '1:Mixed + 2:Dirichle', 'md2': '1:Dirichle + 2:Mixed', 'mn1':'1:Mixed + 2:Neuman', 'mn2': '1:Neuman + 2:Mixed'} #--------------------------- Wall input data---------------------------------------------------------------------------- input_dictionary0 = {'tickness': [0.03, 0.25, 0.05, 0.12, 0.02], 'conductivity': [0.99, 0.61, 0.034, 0.76, 0.99 ], 'density': [1900, 1400, 23, 1800, 1900], 'specific_heat': [1050, 920, 840, 920, 1050], 'nlayer': 5, 'alf1': 5.7, 'alf2': 25.0, 'alf_steady': 0, 'smoothing': 1, 'cut_fl': True} input_dictionary1 = {'tickness': [0.03, 0.25, 0.05, 0.12, 0.02], 'conductivity': [0.99, 0.61, 0.034, 0.76, 0.99 ], 'density': [1900, 1400, 23, 1800, 1900], 'specific_heat': [1050, 920, 840, 920, 1050], 'nlayer': 5, 'alf1': 5.7, 'alf2': 25, 'alf_steady': 0, 'smoothing': 1, 'cut_fl': True } input_dictionary2 = {'tickness': [0.02, 0.3, 0.08, 0.02], 'conductivity': [1.4, 0.61, 0.034, 1.4 ], 'density': [1900, 1400, 23, 1800], 'specific_heat': [1050, 920, 840, 920], 'nlayer': 4, 'alf1': 5.7, 'alf2': 25, 'alf_steady': 0, 'smoothing': 1, 'cut_fl': True} #'smooting' = 1 Lanczos smoothing #'smooting' = 2 ..... #'smooting' = 3 ..... #wallpl2.tickradii[0] = 0.04 #wallpl2.conductivity[3] = 0.26 #wallpl2.density[2] = 23 #wallpl2.specheat[4] = 1550 #wallpl2.alf1 = 8.7 #wallpl2.alf2 = 29.78 input_dictionary00 = {'tickness': [0.03, 0.25, 0.05, 0.12, 0.02], 'conductivity': [0.99, 0.16, 0.034, 0.76, 0.99 ], 'density': [1900, 1400, 23, 1800, 1900], 'specific_heat': [1050, 920, 840, 920, 1050], 'nlayer': 5, 'alf1': 5.7, 'alf2': 25, 'alf_steady': 0, 'smoothing': 1, 'cut_fl': True} #--------------------------- Wall input data---------------------------------------------------------------------------- #--------------------------- Global variables--------------------------------------------------------------------------- rooth_globals = globals() #--------------------------- Global variables--------------------------------------------------------------------------- #--------------------------- Input data files--------------------------------------------------------------------------- input_data_files = {'flux_in_out_raw': 'flux_RAW','flux_in_out_smooth': 'flux_smooth','temp_in_out_raw': 'TP_RAW','temp_in_out_smooth': 'TP_smooth', 'start_time': 6000.0 } #--------------------------- Input data files--------------------------------------------------------------------------- #apath1 = globals()['__name__'] #apath2 = globals()['__path__'][0] #apath3 = globals()['__package__'] #======================================================================================================================= #--------------------Plot Settings-------------------------------------------------------------------------------------- plot_style_dict_11 = {'title_fig': 'Function f(x)', 'xlabel_fig': 'x', 'ylabel_fig' : 'fi(x)', 'ax_line_width': 1, 'ax_line_color': 'r', 'minor_loc': 5, 'nbins_x': 10, 'nbins_y': 10, 'color_grid': 'grey', 'alpha_grid': 0.6, 'tick_width': 2, 'tick_len_major': 7, 'tick_len_minor': 4, 'tick_color': 'k'} #======================================================================================================================= # initial figure ID i_fig0 = 10 #======================================================================================================================= line_color_set = ['red', 'blue', 'black', 'green', 'm', 'black', 'red', 'blue', 'green', 'red', 'blue', 'black', 'green', 'm', 'black', 'red', 'blue', 'green', 'red', 'blue', 'black', 'green', 'm', 'black', 'red', 'blue', 'green'] line_style_set = ['-','--','-.',':' ] line_width_set = [1, 1, 1, 1] marker_color_set = ['red', 'blue', 'black', 'green'] marker_style_set = ['o','.', '<','v'] marker_size_set = [4, 4, 4, 4] label_fig_set = ['Eigen_fun1', 'Eigen_fun2', 'Eigen_fun3', 'Eigen_fun4', 'Eigen_fun5', 'Eigen_fun6', 'Eigen_fun7', 'Eigen_fun8','Eigen_fun9', 'Eigen_fun10', 'Eigen_fun11', 'Eigen_fun12', 'Eigen_fun13', 'Eigen_fun14', 'Eigen_fun15', 'Eigen_fun16'] #======================================================================================================================= single_graph_fl = True #fitx_fl = False fitx_fl = True xminmax_offset = 0.01 # fit x - axes with off_set yminmax_fl = 3 # yminmax_fl = 3 fit the y axes to plot, =1 zoom to minimal value, 2 zoom to maximal value, 0 no acction yminmax_offset = 0.01 # fit y - axes with off_set xyminmax_close = 5.0 #======================================================================================================================= #min_max_dict_set = {'xy_which' :[None], 'list_xminmax' : [None], 'list_yminmax': [None]} #======================================================================================================================= dict_sub_plot_set = { 'sub_plot' : False, 'n_sub' : 3 , 'm_sub': 3, 'title': 'Function', 'ylab': 'fi'} #--------------------Plot Settings-------------------------------------------------------------------------------------- #======================================================================================================================= #--------------------Test Settings-------------------------------------------------------------------------------------- #--------------------which_test----------------------------------------------------------------------------------------- #'ort_test_0' - partial orto test #'ort_test_full' - perform full orto test #'matching_test' - perform matching condition test #'uf12_test_fl' - perform uf12 test #'check_type_orto_0' - test type for orto_test_0 = # -1 or -10 : Calculate for all indices and all boundary conditions, check_type =2 full ort otest # 0 or 2 or 10 : Calculate only for i,j in ind_list and all boundary conditions, check_type = 0 # 1 Calculate only integral from x1 to x2 in test_layer for i = ind1_ext and j = ind2_ext and all boundary conditions, check_type = 1 #'check_type_orto_full' - test type for orto_test_full = must be -1 !!! THIS IS REDUNDANT !!! #----------------------------------------------------------------------------------------------------------------------- which_test = {'ort_test_0': False, 'ort_test_full': False, 'matching_test' : False, 'uf12_test_fl': False } test_data = {'print_fl':[True, True, False], 'ind_lis': [[1, 1], [2, 2], [0, 1], [0, 2], [0, 3], [0, 4], [1, 3],[1, 4], [4, 8], [3, 4], [5, 9], [3, 3], [4, 4], [5, 5], [6, 6]], 'check_type_orto_0': 0, 'layer': 1, 'offset1': 0.1, 'offset2': 0.1, 'check_type_orto_full': -1 } #------------- Setings for convolution sum testing --------------------------------------------------------------------- #'exitation' : input test data for exitiation #'bc_test' : BC for testing #'raw_smooth': raw or smooth testing input data #'mode_test' : testing mode : 'temp' or 'flux' or 'both' #'test_fl' : True - perform convolution sums testing, False - No testing for solution sums sol_test_dict = {'exitation': None ,'bc_test': None ,'raw_smooth': None, 'mode_test': None, 'test_fl': False, 'test_type': 1 } #--------------------Test Settings-------------------------------------------------------------------------------------- #=========================Plot intedmediate results===================================================================== #---------------------- eigen_dict-------------------------------------------------------------------------------------- # setings for eigen-functions plot #ind_list_fi' : list of eigen function indexes for ploting #'ind_list_weight' : list of weight function indexes for ploting #'mod1' : mode of ploting : temp or flux or both #'fun_type_set' : 0 - generate data for eigen & weight fnctions ( plot or other use ) # 1 - generate data for steady state distribution ( plot or other use ) # 2 - generate data for U functions f1 and f2 ( plot or other use ) THIS IS REDUNDANT !!! #'bc' : BC which set of eigen functions to use eigen_dict = {'ind_list_fi' : [0, 1, 2, 3, 4, 5, 6, 7, 8], 'ind_list_weight' : [[0, 1], [0, 2], [0, 3], [0, 4], [1, 3], [1, 4], [4, 8], [3, 4], [5, 9]], 'mode_set': 'temp', 'bc': None, 'nnx_calc': XNODE, 'sub_plot': True, 'n_sub': 3, 'm_sub': 3, 'title':'Eigen Functions ', 'ylab': 'fi', 'weight_title': 'Weight Functions ', 'xlabel_fig': 'x[m]', 'ylabel_fig': 'fi'} #**********'fun_type_set' : 0 , #---------------------- eigen_dict-------------------------------------------------------------------------------------- #---------------------- u_dict------------------------------------------------------------------------------------------ # setings for U-plot #'fun_type_set': must be 2 !!! - ( data generation type, 0, 1 or 2 ) THIS IS REDUNDANT !!!! #'which_set1' : 1 generate data for U-function f1 (x); if = 0 no data for f1 (no plot) #'which_set2' : 2 generate data for U-function f2 (x); if = 0 no data for f2 (no plot) #'deriv_set' : U-functions or derivatives df1/dx and df2/dx #'bc' : BC conditions ('n', 'd', 'm0', 'tq1', 'tq2', 'md1', 'md2',... ) u_dict = {'which_set1': 1, 'which_set2': 2, 'mode_set': 'temp', 'bc': None, 'nnx_calc': XNODE, 'cut_fl': True, 'label_f1': 'U function - f1(x)', 'label_f1_fseries': 'f1(x) - Fourier series', 'label_f2': 'U function - f2(x)', 'label_f2_fseries': 'f2(x) - Fourier series', 'sub_plot': False, 'title': 'f1(x) & f2(x) fun & FS ', 'xlabel_fig': 'x[m]', 'ylabel_fig': 'f12(x)'} #*********'fun_type_set': 2, #---------------------- u_dict------------------------------------------------------------------------------------------ #---------------------- steady_dict------------------------------------------------------------------------------------- #'fun_type_set' : 1 calculate data fir steady state distribution, must be 1 THIS IS REDUNDANT !!! #'temp1_set' : 20.0 inside temperature #'temp2_set' : -10.0 outside temperature #'bc' : BC condition - this is important to now which set of eigen functions to use in Fourier series #---------------------- test function dict------------------------------------------------------------------------------ #'test_fun_plot': True - Plot test function #'nn' - Number of segments in test function #'dx_list' - Segment lenght in x direction #'dy_list' - Jumps in y direction #'k_list' - segments slope #'nnx_calc' - Number of x-points in plot test_dict0 = {'test_fun_plot': True, 'nn': 5, 'dx_list': [0.0, 0.1, 0.3, 0.6, 0.7, 1.0], 'dy_list': [2.0, 0.0, 0.0, 0.0, 0.0, -3.0 ], 'k_list': [3, -5.0, 0.0, 6.0, -3.35], 'bc': None, 'nnx_calc': XNODE, 'mode': None, 'xmin': None, 'xmax': None, 'x_step': None, 'use_step': None, 'equal_fl': 1, 'title': 'Test Function + Fourier Series for ', 'label_function': 'Test Function', 'label_fseries': 'Fourier series', 'sub_plot': False, 'xlabel_fig': 'x', 'ylabel_fig': 'Test(x)'} #======================================================================================================================= plot_input_fl = False #plot_input_fl = True #------------------------- plot_eigen_fl = False #plot_eigen_fl = True #------------------------- solve_fl = True #solve_fl = False #------------------------- plot_res_fl = True #plot_res_fl = False #======================================================================================================================= time_step = 6.0 t_min = 0.0 t_max = 12.5 * SEC_DAY write_solve_data = False temp_calc = False flux_calc = False steady_temp = False steady_flux = False raw_smooth = 'smooth' f_raw_smooth = 'smooth' #------------------------- mode_sol = 'temp' write_wall_class = True read_wall_class = True plot_xt = 2 #------------------------- temp_shift_1 = 0.0 temp_shift_2 = 0.0 flux_shift_1 = 0.0 flux_shift_2 = 8.1 shift_on_off = True #------------------------- fluent_coord = [0.0, 0.05875, 0.1175, 0.17625, 0.235, 0.29375, 0.3525, 0.41125, 0.47] #------------------------- nn_plots = [0,-1] fluent_plot = [0,-1] #------------------------- t1_ini = 20.0 t2_ini = -5.0 #======================================================================================================================= # --------------------------Estimation----------------------------- buffer_time = 2.0 do_estimate = True plot_green = True buffer_m11 = buffer_time * SEC_HOUR buffer_m12 = buffer_time * SEC_HOUR buffer_m21 = buffer_time * SEC_HOUR buffer_m22 = buffer_time * SEC_HOUR #------------------------------------------------------------------- raw_smooth_estim = 'smooth' filter_conf = 1 #estim_calc = None estim_calc = 'no' #estim_calc = 'temp_calc' #estim_calc = 'flux_calc' #------------------------------------------------------------------- estim_time_units = '[sec]' estim_time_start = 0.0 estim_time_end = 6 * SEC_DAY estim_time_step = None estim_resample_tool = 0 estim_resample_rate = None estim_sub_plot = True green_sub_plot_n = 2 green_sub_plot_m = 2 # --------------------------Estimation----------------------------- #========================================Calc Settings: Fluent Comparison, test_cases, measurements ... ================ #f_folder_name = 'flux_BC_raw_fluent1' #---------------------------------------------- #f_folder_name = 'flux_BC_smooth_fluent1' #---------------------------------------------- #f_folder_name = 'flux_BC_steady_fluent1' #---------------------------------------------- #f_folder_name = 'temp_BC_raw_fluent1' #---------------------------------------------- #f_folder_name = 'temp_BC_smooth_fluent1' #---------------------------------------------- #f_folder_name = 'temp_BC_steady_fluent1' #---------------------------------------------- #f_folder_name = 'flux_BC_test_case1' #---------------------------------------------- #f_folder_name = 'temp_BC_test_case1' #---------------------------------------------- #f_folder_name = 'temp_BC_zp_smooth_calc1' #---------------------------------------------- #f_folder_name = 'flux_BC_zp_smooth_calc1' #---------------------------------------------- #f_folder_name = 'temp_BC_zp_smooth_me1' #---------------------------------------------- f_folder_name = 'flux_BC_zp_smooth_me1' #---------------------------------------------- #f_folder_name = 'temp_BC_zp_raw_calc1' #---------------------------------------------- #f_folder_name = 'flux_BC_zp_raw_calc1' #---------------------------------------------- #f_folder_name = 'temp_BC_zp_raw_me1' #---------------------------------------------- #f_folder_name = 'flux_BC_zp_raw_me1' #---------------------------------------------- #f_folder_name = 'green_conf_1' #---------------------------------------------- #f_folder_name = 'green_conf_2' #---------------------------------------------- #f_folder_name = 'green_conf_3' #---------------------------------------------- #f_folder_name = 'green_conf_4' #---------------------------------------------- #f_folder_name = 'green_conf_5' #---------------------------------------------- #f_folder_name = 'green_conf_6' #---------------------------------------------- #======================================================================================================================== #---------------- Test in/out temperatures---------------------- if f_folder_name == 'flux_BC_raw_fluent1' : t_max = 1074000.0 t1_ini = 0.0 t2_ini = 0.0 bc = BC_KEYWORDS[1] #------------------------------------------------------ f_raw_smooth = 'raw' test_fluent = True test_case = False elif f_folder_name == 'flux_BC_smooth_fluent1' : #--------------Flux_BC_smooth_IC_0- Fluent_test-------- t_max = 1074000.0 t1_ini = 0.0 t2_ini = 0.0 bc = BC_KEYWORDS[1] test_fluent = True test_case = False #--------------------------------------------------------- elif f_folder_name == 'temp_BC_raw_fluent1' : pass # t_max = 1073690.0 # t1_ini = 10.65 # t2_ini = 10.65 # bc = BC_KEYWORDS[0] #------------------------------------------------------ # f_raw_smooth = 'raw' # test_fluent = True # test_case = False elif f_folder_name == 'temp_BC_smooth_fluent1' : #--------------Temp_BC_smooth_IC_10.65- Fluent_test-------- t_max = 1073690.0 t1_ini = 10.65 t2_ini = 10.65 bc = BC_KEYWORDS[0] test_fluent = True test_case = False #--------------------------------------------------------- elif f_folder_name == 'flux_BC_steady_fluent1' : #--------------Flux_BC_steady_IC_0- Fluent_test-------- #t_max = 10480.0/2.0 #----------------------- t_max = 104800.0 t1_ini = 0.0 t2_ini = 0.0 dx_list1 = [0.0, 2950.0/t_max, 22990.0/t_max, 48010.0/t_max ,1.0] dx_list2 = [0.0, 2950.0/t_max, 22990.0/t_max, 48010.0/t_max ,1.0] k_list1 = [0.0, 0.0, 0.0, 0.0 ] k_list2 = [0.0, 0.0, 0.0, 0.0 ] q_in = [5.0, 15.0, -5.0, 10.0, 10.0] q_out = [-7.0, -2.0, -15.0, 10.0, 10.0] bc = BC_KEYWORDS[1] #--------------------------------------------------------- f_raw_smooth = 'test_case' test_fluent = True test_case = False #-------------------------------------------------------- steady_flux = True #--------------------------------------------------------- elif f_folder_name == 'temp_BC_steady_fluent1' : #--------------Temp_BC_steady_IC_20- Fluent_test-------- #t_max = 1335977.0 #t_max = 150000.0 #---------------------- t_max = 60000.0 t1_ini = 20.0 t2_ini = 20.0 dx_list1 = [0.0, 5607.0/t_max, 30182.0/t_max, 1.0] dx_list2 = [0.0, 30182.0/t_max, 33063.0/t_max, 35791.0/t_max ,1.0] k_list1 = [0.0, 0.0, 0.0] k_list2 = [0.0, 0.0, 0.0, 0.0 ] temp_in = [20.0, 5.0, 30.0, 30.0 ] temp_out = [-4.0, 4.0, -5.0, 4.0, 4.0 ] bc = BC_KEYWORDS[0] #--------------------------------------------------------- f_raw_smooth = 'test_case' test_fluent = True test_case = False #--------------------------------------------------------- steady_temp = True #--------------------------------------------------------- #======================================================================================================================= elif f_folder_name == 'flux_BC_test_case1' : #--------------Flux_BC_steady - Steady_Test-------- t_max = 5080000.0 t1_ini = 10.0 t2_ini = -5.0 dx_list1 = [0.0, 0.1, 0.2, 0.3, 1.0] dx_list2 = [0.0, 0.07, 0.18, 0.26, 1.0] k_list1 = [0.0, 0.0, 0.0, 0.0 ] k_list2 = [0.0, 0.0, 0.0, 0.0 ] q_in = [5.0, 15.0, -5.0, 10.0, 10.0] q_out = [-7.0, -2.0, -15.0, 10.0, 10.0] bc = BC_KEYWORDS[1] test_fluent = False test_case = True mode_sol = 'temp' plot_xt = 1 plot_input_fl = True #--------------------------------------------------------- steady_flux = True #--------------------------------------------------------- elif f_folder_name == 'temp_BC_test_case1' : #--------------Temp_BC_steady - Steady_Test-------- t_max = 1080000.0 t1_ini = 25.0 t2_ini = 8.0 dx_list1 = [0.0, 0.12, 0.18, 0.28, 1.0] dx_list2 = [0.0, 0.08, 0.15, 0.29, 1.0] k_list1 = [0.0, 0.0, 0.0, 0.0 ] k_list2 = [0.0, 0.0, 0.0, 0.0 ] temp_in = [25.0, 5.0, 10.0, 15.0, 15.0 ] temp_out = [8.0, 4.0, -5.0, -7.0, -7.0 ] bc = BC_KEYWORDS[0] test_fluent = False test_case = True mode_sol = 'temp' plot_xt = 1 plot_input_fl = True #--------------------------------------------------------- steady_temp = True #--------------------------------------------------------- elif f_folder_name == 'temp_BC_zp_smooth_calc1' : bc = BC_KEYWORDS[0] test_fluent = False test_case = False mode_sol = 'flux' #--------------------------------------------------------- temp_calc = True #-------------------------------- elif f_folder_name == 'flux_BC_zp_smooth_calc1' : bc = BC_KEYWORDS[1] test_fluent = False test_case = False mode_sol = 'temp' #--------------------------------------------------------- flux_calc = True #-------------------------------- #--------------------------------------------------------- elif f_folder_name == 'temp_BC_zp_raw_calc1' : bc = BC_KEYWORDS[0] test_fluent = False test_case = False mode_sol = 'flux' raw_smooth = 'raw' #--------------------------------------------------------- temp_calc = True #-------------------------------- elif f_folder_name == 'flux_BC_zp_raw_calc1' : bc = BC_KEYWORDS[1] test_fluent = False test_case = False mode_sol = 'temp' raw_smooth = 'raw' #--------------------------------------------------------- flux_calc = True #-------------------------------- elif f_folder_name == 'temp_BC_mm_calc1' : pass elif f_folder_name == 'flux_BC_mm_calc1' : pass #--------------------------------------------------------- elif f_folder_name == 'temp_BC_zp_smooth_me1' : bc = BC_KEYWORDS[0] test_fluent = False test_case = False mode_sol = 'flux' # write_solve_data = True # write_solve_data = False #--------------------------------------------------------- elif f_folder_name == 'flux_BC_zp_smooth_me1' : bc = BC_KEYWORDS[1] test_fluent = False test_case = False mode_sol = 'temp' # write_solve_data = True # write_solve_data = False #--------------------------------------------------------- elif f_folder_name == 'temp_BC_zp_raw_me1' : bc = BC_KEYWORDS[0] test_fluent = False test_case = False mode_sol = 'flux' raw_smooth = 'raw' # write_solve_data = True # write_solve_data = False #--------------------------------------------------------- elif f_folder_name == 'flux_BC_zp_raw_me1' : bc = BC_KEYWORDS[1] test_fluent = False test_case = False mode_sol = 'temp' raw_smooth = 'raw' # write_solve_data = True # write_solve_data = False #--------------------------------------------------------- elif f_folder_name == 'temp_BC_mm_measurements1' : pass elif f_folder_name == 'flux_BC_mm_measurements1' : pass else : t1_ini = 20.0 t2_ini = -5.0 #======================================================================================================================= if any((steady_temp, steady_flux)) : nn_list1 = len(k_list1) nn_list2 = len(k_list2) equal_fl_set = 2 steady_dict0 = {'temp1_set': t1_ini, 'temp2_set': t2_ini, 'mode_set': 'temp', 'bc': None, 'nnx_calc': XNODE, 'cut_fl': False, 'title': 'Steady Temp dist & FS ', 'steady_label': 'Steady State Temp', 'steady_fseries_label': 'Fourier series', 'sub_plot': False, 'xlabel_fig': 'x[m]', 'ylabel_fig': 'temp(x)'} if steady_temp : test_dict_0_temp1 = {'test_fun_plot': True, 'nn': nn_list1, 'dx_list': dx_list1, 'dy_list': temp_in, 'k_list': k_list1, 'bc': None, 'nnx_calc': XNODE, 'mode': None, 'xmin': t_min, 'xmax': t_max, 'x_step': time_step, 'use_step': True, 'equal_fl': equal_fl_set } test_dict_0_temp2 = {'test_fun_plot': True, 'nn': nn_list2, 'dx_list': dx_list2, 'dy_list': temp_out, 'k_list': k_list2, 'bc': None, 'nnx_calc': XNODE, 'mode': None, 'xmin': t_min, 'xmax': t_max, 'x_step': time_step, 'use_step': True, 'equal_fl': equal_fl_set } test_dict_0_temp = [test_dict_0_temp1, test_dict_0_temp2 ] else: test_dict_0_temp = [] if steady_flux : #---------------- Test in/out fluxes------------------------------------------------------------------------------------ test_dict_0_flux1 = {'test_fun_plot': True, 'nn': nn_list1, 'dx_list': dx_list1, 'dy_list': q_in, 'k_list': k_list1, 'bc': None, 'nnx_calc': XNODE, 'mode': None,'xmin': t_min, 'xmax': t_max, 'x_step': time_step, 'use_step': True, 'equal_fl': equal_fl_set } test_dict_0_flux2 = {'test_fun_plot': True, 'nn': nn_list2, 'dx_list': dx_list2, 'dy_list': q_out, 'k_list': k_list2, 'bc': None, 'nnx_calc': XNODE, 'mode': None, 'xmin': t_min, 'xmax': t_max, 'x_step': time_step, 'use_step': True, 'equal_fl': equal_fl_set } test_dict_0_flux = [ test_dict_0_flux1, test_dict_0_flux2 ] else : test_dict_0_flux = [] #'dy_list': [0.0, 1.5, -2.0, 0.0, -0.5, 0.0 ] #********'fun_type_set': 1, #---------------------- steady_dict------------------------------------------------------------------------------------- # 'fun_type_set' : 1 #---------------------- steady_dict------------------------------------------------------------------------------------- #apath1 = globals()['__name__'] #apath2 = globals()['__doc__'] #apath3 = globals()['__package__'] #======================================== Solution Settings ============================================================ #----------- Type of BC ------------- #bc_solve = BC_KEYWORDS[1] #------raw or smoothed data--------------------------------------------------------------------------------------------- #raw_smooth = 'raw' #raw_smooth = 'smooth' #-----Solve only for one singel spatial coordinate x (= True) or for a list or np.array of spatial coordinates (= False) #single_x_point = True #single_x_point = False #------what quantity to solve temp, flux or both------------------------------------------------------------------------ #which_sol = 'temp' #which_sol = 'flux' #which_sol = 'both' #------a list or np.array of spatial points [x0, x1, x2,...] for which the solution will be calculated ----------------- #sol_x = [x0 , x1 , x2 , ... , xn] #---The Number of spatial points evanly distributed for which the calculation will be performed ----------------------- #-- if single_x_point = True, 0.0 <= nnx_points <= 1.0 represents the relative position of the single spatial point inside the wall #nnx_points = 3 #------------------------------------------------------------------------------------------------------------------------------------------------------ #ini_cond = 1 Take staedy state initial conditions (IC) t1, t2 -- inside and outside temperatures, # this values are obtained from boundary conditions at t = 0 (Dirichle BC) or from measurements at t = 0 (non diricle BC) #ini_cond = 2 use some preset function fi(x) as BC (from fluent or other function) #ini_cond = 3 use polynomial expansion for BC fi(x) = fi1 + a11 * x + a21 * x^2 + a31 * x^3 + ...., expansion near x = 0 # fi(x) = fi2 + a12 * (x - L) + a22 * (x - L)^2 + a32 * (x - L)^3 + ...., expansion near x = L # coefficients a1, a2 ,... are obtained from surface measurements # a11 = -(1/lambda1)*q1(t=0,x=0), a21 = (c1*ro1/lambda1) * dT1/dt(t=0,x=0), a31 = -(ro1*c1/lambda1^2) * dq1/dt (t=0, x=0) # a12 = -(1/lambda_n)*q2(t=0,x=L), a22 = (c_n*ro_n/lambda_n) * dT2/dt(t=0,x=L), a32 = -(ro_n*c_n/lambda_n^2) * dq2/dt (t=0, x=L) #ini_cond = 4 use backward uniqueness theorem and surface measurments (temperature + flux ) during long period of time to determine IC ???? #----------------------------------------------------------------------------------------------------------------------- #'test_fl': if true perform convolution integral test # --- calculation units for temperature, fulx, time and lenght ---------- #'time_unit':'[sec]' #'temp_unit': '[C]' #'flux_unit':'[W/m^2]' #'unit_lenght':'[m]' #'deriv_len': - number os samples used for numerical differentaition #'temp_shift_1': - inside temperature shift ( temperature correction for interior measured data ) #'temp_shift_2': - inside temperature shift ( temperature correction for exterior measured data ) #'flux_shift_1': - inside flux shift ( flux correction for interior measured data ) #'flux_shift_2': - inside flux shift ( flux correction for exterior measured data ) #'shift_on_off': - if True usecorrections #======================================== Solution Settings ============================================================ #======================================== Plot Settings ================================================================ #---Plot or not measured data (in, our, temp, flux, = True or False)---------------------------------------------------- #plot_me_temp_in = False #plot_me_temp_out = False #plot_me_flux_in = False #plot_me_flux_out = False #----------------------------------------------------------------------------------------------------------------------- #'plot_xt' = 1 plot spatial distribution #'plot_xt' = 2 plot temporal distribution #---The list of indexes of point coordinates for which results will be ploted (plot_xt == 2; f(t, x=x1), f(t, x=x2) or plt_xt == 1; f(x, t=t1), f(x, t=t2)) #nn_plots = [] #---The list of point coordinates for which results will be ploted (plot_xt == 2; f(t, x=x1), f(t, x=x2) or plot_xt == 1; f(x, t=t1), f(x, t=t2)) #xt_plots = [] #----------------------------------------------------------------------------------------------------------------------- #'me_plot'[0] - How to plot measured data with numerical results : # 0 dont'plot measured data with numerical results # 1 plot measured data together with numerical ones (measured temp with numerical temp 7 measured flux with numerical flux ) # 2 ...... # 3 ...... #----------------------------------------------------------------------------------------------------------------------- #'me_plot'[1] - How to plot measured data : # 0 dont'plot measured data separately # -1 plot measured data on separat figures, one set per figure (flux in out temp in out = 8 figures) # -2 plot measured temperatures and fluxes on separat figures in/out + raw/smooth ( in/out raw flux + in/out raw temperature + # in/out smooth flux + in/out smooth temperature = 4 fugures) # -3 plot raw and smooth data in one figure raw/smooth + in/out ( raw/smooth in flux + raw/smooth out flux + # raw/smooth in temperature + raw/smooth out temperature = 4 figures ) # -4 plot all measurements on one single figure (temperatures in and out + fluxes in and out raw + smooth = 2 figures) #----------------------------------------------------------------------------------------------------------------------- #'me_plot'[2] - How to plot test exitations : # 0 don't plot test exitations # -11 plot test exitations #----------------------------------------------------------------------------------------------------------------------- #======================================== Plot Settings ================================================================ calc_dict = {'bc_solve': bc, 'raw_smooth': raw_smooth , 'single_x_point': False, 'mode_sol': mode_sol, 'sol_x': None, 'nnx_points': XNODE , 'test_fl': False, 'time_unit':'[sec]', 'temp_unit': '[C]', 'flux_unit':'[W/m^2]', 'lenght_unit':'[m]', 'deriv_len': 30, 'ini_cond': 1, 'temp_shift_1': temp_shift_1, 'temp_shift_2': temp_shift_2, 'flux_shift_1': flux_shift_1, 'flux_shift_2': flux_shift_2, 'shift_on_off': shift_on_off, 'test_case': test_case, 'temp_calc': temp_calc , 'flux_calc': flux_calc } plot_dict = {'plot_me_temp_in': False, 'plot_me_temp_out': False, 'plot_me_flux_in': False, 'plot_me_flux_out': False, 'plot_test_results': False, 'plot_xt': plot_xt, 'nn_plots': nn_plots , 'xt_plots': [0.2, 0.4], 'time_unit':'[min]', 'temp_unit': '[C]', 'flux_unit':'[W/m^2]', 'lenght_unit':'[m]', 'temp_title': 'Temperature', 'flux_title': 'Thermal Flux', 'me_plot': [1,-3, -11], 'plot_pattern': [ ['flux', 'temp'], ['in', 'out'], ['raw', 'smooth'] ] } #========================================Fluent Comparison Settings ==================================================== #---- Compare results with fluent (yes ot no)------------------------ #test_fluent = True #test_fluent = False #---- which quantitu to compare (temp or flux or both)--------------- #which_fluent_test = 'temp' #which_fluent_test = 'flux' #which_test = 'both' #---- number of spatial points from fluent --------------------------- #nx_fluent = 9 #---- pre set the x coordinates of spatial points from flunet ---- #x_fluent = [None] #'which_nx' = 1 ----> use nx_fluent points to calculate temp or flux #'which_nx' = 2 ----> use x_fluent coordinates to calculate temp or flux #'fluent_plot' = list of fluent data to plot [0, -1] - plot data from first and last file (in and out) #========================================Fluent Comparison Settings ==================================================== fluent_path = {'flux_BC_smooth_fluent1' :'/data/fluent/flux_BC_smooth_IC_0_C/', 'flux_BC_raw_fluent1' :'/data/fluent/flux_BC_raw_IC_0_C/', 'flux_BC_steady_fluent1' :'/data/fluent/flux_BC_steady_IC_0_C/', 'temp_BC_steady_fluent1' :'/data/fluent/temp_BC_steady_IC_20_C/', 'temp_BC_smooth_fluent1' :'/data/fluent/temp_BC_smooth_IC_10_65_C/', 'f_folder_name': f_folder_name } start_time_fluent = 0.0 #end_time_fluent = 104800.0 end_time_fluent = t_max #BC_KEYWORDS[1] fluent_dict = {'bc_fluent': bc , 'test_fluent': test_fluent, 'raw_smooth': f_raw_smooth, 'which_fluent_test':'temp', 'which_nx': 1, 'nx_fluent': 9, 'x_fluent': [None], 'fluent_plot': fluent_plot, 'start_time' : start_time_fluent , 'end_time' : end_time_fluent, 'x_coord': fluent_coord, 'time_unit':'[sec]', 'temp_unit':'[K]', 'flux_unit':'[W/m^2]', 'lenght_unit':'[m]', 'x_quant':'time','y_quant':'temp', 'ini_cond':1, 't1_ini': t1_ini, 't2_ini': t2_ini, 'f_path': fluent_path } #========================================Fluent Comparison Settings ==================================================== #======================================== Unit Conversion ============================================================== time_list = ['[sec]', '[min]', '[hour]', '[day]', '[week]', '[month]', '[year]'] con_time = [1.0, 60.0, 3600.0, 86400.0, 604800.0 , 18144000.0, 6622560000.0] solution_titles = ['initial energy =', 'final energy =', 'energy difference =', 'steady state flux =', 'temp1_steady =', 'temp2_steady =', 'temp diff_steady =', 'temp1_calc =', 'temp2_calc =', 'temp/flux diff_calc ='] #======================================== Unit Conversion ============================================================== # id_case = 0 Zorana data # id_case = 1 Milica data #----------------------------------------------------------------------------------------------------------------------- id_case = 0 io_dict0 = { 'folder': '/data/', 'wall_file': ['zp_wall_pl', 'mm_wall_pl' ], 'data_solve_file': ['zp_data_solve', 'mm_data_solve'], 'solve_temp_data': ['zp_temp', 'mm_temp'], 'solve_flux_data': ['zp_flux', 'mm_flux'], 'file_type': '.txt', 'id_case': id_case, 'write_WallClass': write_wall_class, 'read_WallClass': read_wall_class, 'write_DataSolveClass': False, 'read_DataSolveClass': False, 'write_solve_data': write_solve_data, 'read_solve_data': False, 'bc_wall': 'ndm0', 'bc_data': None , 'type_data': None, 'line_0': '1-inside 2-outside', 'line_1': 'time_step =', 'line_2': 'time_units = ', 'line_3': 'No_samples = ', 'line_4': 'ort_vector_out_in = 1.0 1.0 \n', 'index_data':0, 'temp_input_files': ['zp_temp_b_max_0.1_bc_n_smooth.txt'], 'flux_input_files': ['zp_flux_b_max_0.1_bc_n_smooth.txt'], 'temp_num_file': 0, 'flux_num_file': 0 } #----------------------------------------------------- # filter_conf : # - 1 temp1,2 inputs, flux1,2 outputs # - 2 flux1,2 inputs, temp1,2 outputs #----------------------------------------------------- # - 3 temp1, flux1 inputs, temp2, flux2 outputs # - 4 temp1, flux2 inputs, temp2, flux1 outputs #----------------------------------------------------- # - 5 temp2, flux1 inputs, temp1, flux2 outputs # - 6 temp2, flux2 inputs, temp1, flux1 outputs #----------------------------------------------------- #estim_path = {'estim_smooth_calc1':'/data/estimation/estim_smooth_calc1.txt', # 'estim_raw_calc1':'/data/estimation/estim_calc2.txt', # 'filter_3_calc1':'/data/estimation/estim_calc3.txt', # 'filter_4_calc1':'/data/estimation/estim_calc4.txt', # 'estim_folder_name':None} estim_dict = {'mm_list': [buffer_m11, buffer_m12, buffer_m21, buffer_m22], 'raw_smooth_estim': raw_smooth_estim, 'estim_calc': estim_calc, 'filter_conf': filter_conf, 'estim_time_units': estim_time_units, 'estim_time_start': estim_time_start, 'estim_time_end': estim_time_end, 'estim_time_step': estim_time_step, 'estim_resample_tool': estim_resample_tool, 'estim_resample_rate': estim_resample_rate, 'sub_plot': estim_sub_plot, 'n_sub': green_sub_plot_n, 'm_sub': green_sub_plot_m, 'title': 'Geen functions', 'ylab': 'green_fun', 'xlabel_fig': 't[sec]', 'ylabel_fig': 'g', 'green_fun': [] }