def BasicDataDispose(sequence, r, threshold=0): # usage: 常用的基础数据处理 # 由基本的TestInf文件和原始实验数据OriginResult读取并计算,得到主要的裂纹扩展速率实验参数 # input parameters: # sequence: 试件名(与MTS内设置一致) # r:实验应力比 # threshold:数据筛选最小值,默认为0(即不筛选),可用于前段数据质量差时将其筛去 # return paramater: # dadn、n、dk、a、kop:常见参数 specimen, width, notch_length, thickness, elastic_modulus, yield_strength, precrack_length = \ read_data.ReadTestInf(sequence=sequence) cycles, cracklength, kmax, kmin, pmax, pmin, kclosure, closureload = \ read_data.ReadOriginResult(sequence=sequence, closure=True, cod=False) dadn_Manual, n_Manual, dk_Manual, a_Manual, kop_Manual = \ experiment_calculation.FCGRandDKbyOriginalData(b=thickness, w=width, n=cycles, pmax=pmax, pmin=pmin, a=cracklength, ys=yield_strength, r=r, kclosure=kclosure, threshold=threshold) return dadn_Manual, n_Manual, dk_Manual, a_Manual, kop_Manual
def read_experimental_data(self, read_test_inf=True, ys=0): # 读取实验结果,默认读取实验参数文件,也可选择不读,若不读需在执行该函数前先存入相关参数 # 若传入ys参数不为零,则存数据时存为传入的yield strength值,输入单位MPa if read_test_inf: specimen, width, notch_length, thickness, elastic_modulus, yield_strength, precrack_length = \ read_data.ReadTestInf(sequence=self.name) self.specimen = specimen self.width = width self.notch_length = notch_length self.thickness = thickness self.elastic_modulus = elastic_modulus if ys == 0: self.yield_strength = yield_strength else: self.yield_strength = ys * 1e-3 # TestInf记录单位为GPa self.precrack_length = precrack_length dadn_MTS, n_MTS, dk_MTS = read_data.ReadMtsResult(sequence=self.name) cycles, cracklength, kmax, kmin, pmax, pmin, kclosure, closureload = \ read_data.ReadOriginResult(sequence=self.name, closure=True, cod=False) dadn_Manual, n_Manual, dk_Manual, a_Manual, kc_Manual = \ experiment_calculation.FCGRandDKbyOriginalData(b=self.thickness, w=self.width, n=cycles, pmax=pmax, pmin=pmin, a=cracklength, ys=self.yield_strength, r=self.stress_ratio, kclosure=kclosure, threshold=self.threshold) self.dadn_MTS = dadn_MTS self.n_MTS = n_MTS self.dk_MTS = dk_MTS self.cycles = cycles self.cracklength = cracklength self.kmax = kmax self.kmin = kmin self.pmax = pmax self.pmin = pmin self.kclosure = kclosure self.closureload = closureload self.dadn_Manual = dadn_Manual self.n_Manual = n_Manual self.dk_Manual = dk_Manual self.a_Manual = a_Manual self.kc_Manual = kc_Manual
def basic_result_calculate(self): _, width, notch_length, thickness, elastic_modulus, yield_strength, precrack_length = \ read_data.ReadTestInf(sequence=self.name) cycles, cracklength, kmax, kmin, pmax, pmin, kc_Manual, pc_Manual = \ read_data.ReadOriginResult(self.name, closure=True, cod=False) dadn_Manual, n_Manual, dk_Manual, a_Manual, kop_Manual = \ experiment_calculation.FCGRandDKbyOriginalData(b=thickness, w=width, n=cycles, pmax=pmax, pmin=pmin, a=cracklength, ys=yield_strength, r=self.stress_ratio, kclosure=kc_Manual, threshold=0) self.width = width self.thickness = thickness self.notch_length = notch_length self.elastic_modulus = elastic_modulus self.precrack_length = precrack_length self.dadn = dadn_Manual self.n = n_Manual self.dk = dk_Manual self.a = a_Manual self.kc = kop_Manual
r = 0.1 threshold = 0 aol_hold = 12.0057 # 高载长度:按Hold时记录的裂纹长度 aol_maxrate = 12.0057 # 高载长度:对应FCGRate最大时的裂纹长度 aol_minrate = 12.7927 # 高载长度:对应FCGRate最小时的裂纹长度 # 程序参数 show = 1 # 绘图开关 # 裂纹扩展公式数据库 c_w, m_w, gamma = paris_and_walker.WalkerParameter() c_p, m_p = paris_and_walker.ParisParameter(r=r) # 读取数据并完成基本的FCG处理 specimen, width, notch_length, thickness, elastic_modulus, yield_strength, precrack_length = \ read_data.ReadTestInf(sequence=sequence[0]) cycles, cracklength, kmax, kmin, pmax, pmin, kclosure, closureload = \ read_data.ReadOriginResult(sequence=sequence[0], closure=True, cod=False) dadn_Manual, n_Manual, dk_Manual, a_Manual, kc_Manual = \ experiment_calculation.FCGRandDKbyOriginalData(b=thickness, w=width, n=cycles, pmax=pmax, pmin=pmin, a=cracklength, ys=yield_strength, r=r, kclosure=kclosure, threshold=threshold) # Kmax at Overload计算 k_max_ol = mts_analysis.DeltaKCalculating(b=thickness, w=width, a=aol_hold, pmax=pol, pmin=0)