def __init__(self, drop_species='decane', gas_species='air', T_G=1000, rho_G=0.3529, C_p_G=1135, Re_d=17, T_d=315, D=0.004): self.drop_species = drop_species self.gas_species = gas_species self.T_G = T_G self.rho_G = rho_G self.C_p_G = C_p_G self.Re_d = Re_d self.T_d = T_d self.D = D self.c = Constants(self.drop_species, self.gas_species, self.T_G, self.rho_G, self.C_p_G, self.Re_d) self.c.drop_properties() self.c.gas_properties() self.c.get_reference_conditions() self.c.add_drop_properties() self.c.add_gas_properties() self.c.add_properties() self.p = particle(self.c, [0, 0, 0], velocity=[0, 0, 0], D=self.D, T_d=self.T_d, ODE_solver=2, coupled=2) self.div = self.p.get_tau()/32 self.N = 10000
def __init__(self, time_divisor=0.5): self.c = Constants(drop_species='water', gas_species='air', T_G=298, rho_G=1.184, C_p_G=1007, Re_d=0) self.c.drop_properties() self.c.gas_properties() self.c.get_reference_conditions() self.c.add_drop_properties() self.c.add_gas_properties() self.c.add_properties() self.p1 = particle(self.c, [0, 0, 0], velocity=[0, 0, 0], D=np.sqrt(1.1)/1000, T_d=282, ODE_solver=0, coupled=0) self.p2 = particle(self.c, [0, 0, 0], velocity=[0, 0, 0], D=np.sqrt(1.1)/1000, T_d=282, ODE_solver=1, coupled=0) self.p3 = particle(self.c, [0, 0, 0], velocity=[0, 0, 0], D=np.sqrt(1.1)/1000, T_d=282, ODE_solver=2, coupled=0) self.p4 = particle(self.c, [0, 0, 0], velocity=[0, 0, 0], D=np.sqrt(1.1)/1000, T_d=282, ODE_solver=3, coupled=0) self.p5 = particle(self.c, [0, 0, 0], velocity=[0, 0, 0], D=np.sqrt(1.1)/1000, T_d=282, ODE_solver=4, coupled=0) self.time_divisor = time_divisor self.div = self.p2.get_tau()*(self.time_divisor) self.N = 10000 self.p2_error = [] self.p3_error = [] self.p4_error = [] self.p5_error = []
def __init__(self, time_divisor=0.0625): self.c = Constants() self.c.drop_properties() self.c.gas_properties() self.c.get_reference_conditions() self.c.add_drop_properties() self.c.add_gas_properties() self.c.add_properties() self.p2 = particle(self.c, [0, 0, 0], velocity=[0, 0, 0], D=np.sqrt(1.1)/1000, T_d=282, ODE_solver=1, coupled=2) self.p3 = particle(self.c, [0, 0, 0], velocity=[0, 0, 0], D=np.sqrt(1.1)/1000, T_d=282, ODE_solver=2, coupled=2) self.p4 = particle(self.c, [0, 0, 0], velocity=[0, 0, 0], D=np.sqrt(1.1)/1000, T_d=282, ODE_solver=3, coupled=2) self.p5 = particle(self.c, [0, 0, 0], velocity=[0, 0, 0], D=np.sqrt(1.1)/1000, T_d=282, ODE_solver=4, coupled=2) self.time_divisor = time_divisor self.div = self.p2.get_tau()*self.time_divisor self.N = 10000
class test(): def __init__(self, time_divisor=0.0625): self.c = Constants() self.c.drop_properties() self.c.gas_properties() self.c.get_reference_conditions() self.c.add_drop_properties() self.c.add_gas_properties() self.c.add_properties() self.p2 = particle(self.c, [0, 0, 0], velocity=[0, 0, 0], D=np.sqrt(1.1)/1000, T_d=282, ODE_solver=1, coupled=2) self.p3 = particle(self.c, [0, 0, 0], velocity=[0, 0, 0], D=np.sqrt(1.1)/1000, T_d=282, ODE_solver=2, coupled=2) self.p4 = particle(self.c, [0, 0, 0], velocity=[0, 0, 0], D=np.sqrt(1.1)/1000, T_d=282, ODE_solver=3, coupled=2) self.p5 = particle(self.c, [0, 0, 0], velocity=[0, 0, 0], D=np.sqrt(1.1)/1000, T_d=282, ODE_solver=4, coupled=2) self.time_divisor = time_divisor self.div = self.p2.get_tau()*self.time_divisor self.N = 10000 def iter_particles(self): last_time = 0 for t in range(self.N): if (self.p2.m_d/self.p2.m_d0 > 0.001 and self.p2.T_d/self.p2.T_G < 0.999): time1 = t * self.div self.p2.iterate(time1 - last_time) last_time = time1 else: break last_time = 0 for t in range(self.N): if (self.p3.m_d/self.p3.m_d0 > 0.001 and self.p3.T_d/self.p3.T_G < 0.999): time1 = t * self.div self.p3.iterate(time1 - last_time) last_time = time1 else: break last_time = 0 for t in range(self.N): if (self.p4.m_d/self.p4.m_d0 > 0.001 and self.p4.T_d/self.p4.T_G < 0.999): time1 = t * self.div self.p4.iterate(time1 - last_time) last_time = time1 else: break last_time = 0 for t in range(self.N): if (self.p5.m_d/self.p5.m_d0 > 0.001 and self.p5.T_d/self.p5.T_G < 0.999): time1 = t * self.div self.p5.iterate(time1 - last_time) last_time = time1 else: break def plot_data(self): f1 = plt.figure(figsize=(20, 10)) ax1 = f1.add_subplot(111) ax1.plot(self.p2.times, self.p2.diameter_2_history, 'g--', label='Forward Euler') ax1.plot(self.p3.times, self.p3.diameter_2_history, 'rx', label='Backward Euler') ax1.plot(self.p4.times, self.p4.diameter_2_history, 'y*', label='Modified Euler') ax1.plot(self.p5.times, self.p5.diameter_2_history, 'x', label='Runge Kutta') ax1.set_xlim(0) ax1.set_ylim(0) plt.xlabel(r'$t$ ($s$)') plt.ylabel(r'$D^2$ ($mm^2$)') plt.legend(loc='upper right') plt.title('Diameter Evolution of Evaporating Droplet') f2 = plt.figure(figsize=(20, 10)) ax2 = f2.add_subplot(111) ax2.plot(self.p2.times, self.p2.temp_history, 'g--', label='Forward Euler') ax2.plot(self.p3.times, self.p3.temp_history, 'rx', label='Backward Euler') ax2.plot(self.p4.times, self.p4.temp_history, 'y*', label='Modified Euler') ax2.plot(self.p5.times, self.p5.temp_history, 'x', label='Runge Kutta') ax2.set_xlim(0) ax2.set_ylim(self.p2.T_d0) plt.xlabel(r'$t$ ($s$)') plt.ylabel(r'$T_d$ ($K$)') plt.legend(loc='lower right') plt.title('Temperature Evolution of Evaporating Droplet') def save_data(self): self.file_dir = 'Sim_Code//Verification_Tests//heat_mass_data//' with open(self.file_dir + 'c_fe_heat_mass_transfer_time_step_' + str(self.time_divisor) + '_tau.txt', 'w') as f: self.p2.times[::-1] f.write('time' + ' ' + 'T_d' + ' ' + 'd2' + ' ' + '\n') for i in range(len(self.p2.times)): f.write(str(self.p2.times[i]) + ' ' + str(self.p2.temp_history[i]) + ' ' + str(self.p2.diameter_2_history[i]) + ' ' + '\n') self.p2.times_temp_nd[::-1] with open(self.file_dir + 'c_be_heat_mass_transfer_time_step_' + str(self.time_divisor) + '_tau.txt', 'w') as f: self.p3.times[::-1] f.write('time' + ' ' + 'T_d' + ' ' + 'd2' + ' ' + '\n') for i in range(len(self.p3.times)): f.write(str(self.p3.times[i]) + ' ' + str(self.p3.temp_history[i]) + ' ' + str(self.p3.diameter_2_history[i]) + ' ' + '\n') self.p3.times_temp_nd[::-1] with open(self.file_dir + 'c_me_heat_mass_transfer_time_step_' + str(self.time_divisor) + '_tau.txt', 'w') as f: self.p4.times[::-1] f.write('time' + ' ' + 'T_d' + ' ' + 'd2' + ' ' + '\n') for i in range(len(self.p4.times)): f.write(str(self.p4.times[i]) + ' ' + str(self.p4.temp_history[i]) + ' ' + str(self.p4.diameter_2_history[i]) + ' ' + '\n') self.p4.times_temp_nd[::-1] with open(self.file_dir + 'c_rk_heat_mass_transfer_time_step_' + str(self.time_divisor) + '_tau.txt', 'w') as f: self.p5.times[::-1] f.write('time' + ' ' + 'T_d' + ' ' + 'd2' + ' ' + '\n') for i in range(len(self.p5.times)): f.write(str(self.p5.times[i]) + ' ' + str(self.p5.temp_history[i]) + ' ' + str(self.p5.diameter_2_history[i]) + ' ' + '\n') self.p5.times[::-1]
class test(): def __init__(self, time_divisor=0.5): self.c = Constants(drop_species='water', gas_species='air', T_G=298, rho_G=1.184, C_p_G=1007, Re_d=0) self.c.drop_properties() self.c.gas_properties() self.c.get_reference_conditions() self.c.add_drop_properties() self.c.add_gas_properties() self.c.add_properties() self.p1 = particle(self.c, [0, 0, 0], velocity=[0, 0, 0], D=np.sqrt(1.1) / 1000, T_d=282, ODE_solver=0, coupled=0) self.p2 = particle(self.c, [0, 0, 0], velocity=[0, 0, 0], D=np.sqrt(1.1) / 1000, T_d=282, ODE_solver=1, coupled=0) self.p3 = particle(self.c, [0, 0, 0], velocity=[0, 0, 0], D=np.sqrt(1.1) / 1000, T_d=282, ODE_solver=2, coupled=0) self.p4 = particle(self.c, [0, 0, 0], velocity=[0, 0, 0], D=np.sqrt(1.1) / 1000, T_d=282, ODE_solver=3, coupled=0) self.p5 = particle(self.c, [0, 0, 0], velocity=[0, 0, 0], D=np.sqrt(1.1) / 1000, T_d=282, ODE_solver=4, coupled=0) self.time_divisor = time_divisor self.div = self.p2.get_tau() * (self.time_divisor) self.N = 10000 self.p2_error = [] self.p3_error = [] self.p4_error = [] self.p5_error = [] def iter_particles(self): last_time = 0 for t in range(self.N): if self.p1.m_d / self.p1.m_d0 > 0.001: time1 = t * self.div self.p1.iterate(time1 - last_time) last_time = time1 else: break last_time = 0 for t in range(self.N): if self.p2.m_d / self.p2.m_d0 > 0.001: time1 = t * self.div self.p2.iterate(time1 - last_time) last_time = time1 else: break last_time = 0 for t in range(self.N): if self.p3.m_d / self.p3.m_d0 > 0.001: time1 = t * self.div self.p3.iterate(time1 - last_time) last_time = time1 else: break last_time = 0 for t in range(self.N): if self.p4.m_d / self.p4.m_d0 > 0.001: time1 = t * self.div self.p4.iterate(time1 - last_time) last_time = time1 else: break last_time = 0 for t in range(self.N): if self.p5.m_d / self.p5.m_d0 > 0.01: time1 = t * self.div self.p5.iterate(time1 - last_time) last_time = time1 else: break def get_error_data(self): for i in range(len(self.p2.times_mass_nd)): self.p2_error.append( np.sqrt((self.p1.mass_history_nd[i] - self.p2.mass_history_nd[i])**2)) self.p2_avg_error = sum(self.p2_error) / len(self.p2.times_mass_nd) print("p2:", self.p2_avg_error * 100) for i in range(len(self.p1.times_mass_nd)): self.p3_error.append( np.sqrt((self.p1.mass_history_nd[i] - self.p3.mass_history_nd[i])**2)) self.p3_avg_error = sum(self.p3_error) / len(self.p3.times_mass_nd) print("p3:", self.p3_avg_error * 100) for i in range(len(self.p1.times_mass_nd)): self.p4_error.append( np.sqrt((self.p1.mass_history_nd[i] - self.p4.mass_history_nd[i])**2)) self.p4_avg_error = sum(self.p4_error) / len(self.p4.times_mass_nd) print("p4:", self.p4_avg_error * 100) for i in range(len(self.p5.times_mass_nd)): self.p5_error.append( np.sqrt((self.p1.mass_history_nd[i] - self.p5.mass_history_nd[i])**2)) self.p5_avg_error = sum(self.p5_error) / len(self.p5.times_mass_nd) print("p5:", self.p5_avg_error * 100, '\n') return (self.p2_avg_error * 100, self.p3_avg_error * 100, self.p4_avg_error * 100, self.p5_avg_error * 100) def plot_data(self): f = plt.figure(figsize=(20, 10)) ax = f.add_subplot(111) ax.plot(self.p1.times_mass_nd, self.p1.diameter_2_history_nd, 'b-', label='Exact') ax.plot(self.p2.times_mass_nd, self.p2.diameter_2_history_nd, 'g--', label='Forward Euler') ax.plot(self.p3.times_mass_nd, self.p3.diameter_2_history_nd, 'rx', label='Backward Euler') ax.plot(self.p4.times_mass_nd, self.p4.diameter_2_history_nd, 'y*', label='Modified Euler') ax.plot(self.p5.times_mass_nd, self.p5.diameter_2_history_nd, 'x', label='Runge Kutta') ax.set_xlim(0) ax.set_ylim(0, 1) plt.xlabel(r'$t/\tau_{d,0}$') plt.ylabel(r'$D^2/{D_0}^2$') plt.legend(loc='upper right') plt.title('Non-Dimensionalised Diameter Evolution of ' + 'Evaporating Droplet') def save_data(self): self.file_dir = 'Sim_Code//Verification_Tests//uc_mass_data//' with open( self.file_dir + 'uc_an_d2_transfer_time_step_tau_' + str(self.time_divisor) + '_tau_nd.txt', 'w') as f: self.p1.times_temp_nd[::-1] f.write('time' + ' ' + 'D2' + ' ' + '\n') for i in range(len(self.p1.times_mass_nd)): f.write( str(self.p1.times_mass_nd[i]) + ' ' + str(self.p1.diameter_2_history_nd[i]) + '\n') self.p1.times_temp_nd[::-1] with open( self.file_dir + 'uc_fe_d2_transfer_time_step_tau_' + str(self.time_divisor) + '_tau_nd.txt', 'w') as f: self.p2.times_temp_nd[::-1] f.write('time' + ' ' + 'D2' + ' ' + '\n') for i in range(len(self.p2.times_mass_nd)): f.write( str(self.p2.times_mass_nd[i]) + ' ' + str(self.p2.diameter_2_history_nd[i]) + '\n') self.p2.times_temp_nd[::-1] with open( self.file_dir + 'uc_be_d2_transfer_time_step_tau_' + str(self.time_divisor) + '_tau_nd.txt', 'w') as f: self.p3.times_temp_nd[::-1] f.write('time' + ' ' + 'D2' + ' ' + '\n') for i in range(len(self.p3.times_mass_nd)): f.write( str(self.p3.times_mass_nd[i]) + ' ' + str(self.p3.diameter_2_history_nd[i]) + '\n') self.p3.times_temp_nd[::-1] with open( self.file_dir + 'uc_me_d2_transfer_time_step_tau_' + str(self.time_divisor) + '_tau_nd.txt', 'w') as f: self.p4.times_temp_nd[::-1] f.write('time' + ' ' + 'D2' + ' ' + '\n') for i in range(len(self.p4.times_mass_nd)): f.write( str(self.p4.times_mass_nd[i]) + ' ' + str(self.p4.diameter_2_history_nd[i]) + '\n') self.p4.times_temp_nd[::-1] with open( self.file_dir + 'uc_rk_d2_transfer_time_step_tau_' + str(self.time_divisor) + '_tau_nd.txt', 'w') as f: self.p5.times_temp_nd[::-1] f.write('time' + ' ' + 'D2' + ' ' + '\n') for i in range(len(self.p5.times_mass_nd)): f.write( str(self.p5.times_mass_nd[i]) + ' ' + str(self.p5.diameter_2_history_nd[i]) + '\n') self.p5.times_temp_nd[::-1]
class run_sim(): def __init__(self, drop_species='decane', gas_species='air', T_G=1000, rho_G=0.3529, C_p_G=1135, Re_d=17, T_d=315, D=0.004): self.drop_species = drop_species self.gas_species = gas_species self.T_G = T_G self.rho_G = rho_G self.C_p_G = C_p_G self.Re_d = Re_d self.T_d = T_d self.D = D self.c = Constants(self.drop_species, self.gas_species, self.T_G, self.rho_G, self.C_p_G, self.Re_d) self.c.drop_properties() self.c.gas_properties() self.c.get_reference_conditions() self.c.add_drop_properties() self.c.add_gas_properties() self.c.add_properties() self.p = particle(self.c, [0, 0, 0], velocity=[0, 0, 0], D=self.D, T_d=self.T_d, ODE_solver=2, coupled=2) self.div = self.p.get_tau()/32 self.N = 10000 def iter_particles(self): last_time = 0 for t in range(self.N): if (self.p.m_d/self.p.m_d0 > 0.001 and self.p.T_d/self.p.T_G < 0.999): time1 = t * self.div self.p.iterate(time1 - last_time) last_time = time1 else: break def plot_data(self): fig, (ax1, ax2) = plt.subplots(2, figsize=(20, 10)) ax1.plot(self.p.times, self.p.diameter_2_history, '--') ax1.set_xlim(0) ax1.set_ylim(0) ax1.set_xlabel(r'$t$ ($s$)') ax1.set_ylabel(r'$D^2$ ($mm^2$)') ax1.set_title('Diameter Evolution of Evaporating ' + self.drop_species.title() + ' Droplet') ax2.plot(self.p.times, self.p.temp_history, '--') ax2.set_xlim(0) ax2.set_ylim(self.p.T_d0) ax2.set_xlabel(r'$t$ ($s$)') ax2.set_ylabel(r'$T_d$ ($K$)') ax2.set_title('Temperature Evolution of Evaporating ' + self.drop_species.title() + ' Droplet') def save_data(self): self.file_dir = 'Sim_Code//Simulation//sim_data//' with open(self.file_dir + 'c_' + self.drop_species + '_heat_mass_transfer_time_step_tau_32.txt', 'w') as f: self.p.times[::-1] f.write('time' + ' ' + 'T_d' + ' ' + 'd2' + ' ' + '\n') for i in range(len(self.p.times)): f.write(str(self.p.times[i]) + ' ' + str(self.p.temp_history[i]) + ' ' + str(self.p.diameter_2_history[i]) + ' ' + '\n') self.p.times_temp_nd[::-1]
class run_sim(): def __init__(self, drop_species='decane', gas_species='air', model=2, T_G=1000, rho_G=0.3529, C_p_G=1135, Re_d=17, T_d=315, D=0.004): self.drop_species = drop_species self.gas_species = gas_species self.T_G = T_G self.rho_G = rho_G self.C_p_G = C_p_G self.Re_d = Re_d self.T_d = T_d self.D = D self.model = model self.c = Constants(self.drop_species, self.gas_species, self.T_G, self.rho_G, self.C_p_G, self.Re_d, model=self.model) self.c.drop_properties() self.c.gas_properties() self.c.get_reference_conditions() self.c.add_drop_properties() self.c.add_gas_properties() self.c.add_properties() self.p = particle(self.c, [0, 0, 0], velocity=[0, 0, 0], D=self.D, T_d=self.T_d, ODE_solver=2, coupled=2) self.div = self.p.get_tau() / 32 self.N = 10000 def iter_particles(self): last_time = 0 for t in range(self.N): if (self.p.m_d / self.p.m_d0 > 0.001 and self.p.T_d / self.p.T_G < 0.999): time1 = t * self.div self.p.iterate(time1 - last_time) last_time = time1 # print(time1) else: break def plot_data(self, modellist, timelist, d2list, templist): # fig, (ax1, ax2) = plt.subplots(2, figsize=(20, 10)) # ax1.plot(self.p.times, self.p.diameter_2_history, '--') # ax1.set_xlim(0) # ax1.set_ylim(0) # ax1.set_xlabel(r'$t$ ($s$)') # ax1.set_ylabel(r'$D^2$ ($mm^2$)') # ax1.set_title('Diameter Evolution of Evaporating ' + # self.drop_species.title() + ' Droplet, Model ' # + str(self.model)) # ax2.plot(self.p.times, self.p.temp_history, '--') # ax2.set_xlim(0) # ax2.set_ylim(self.p.T_d0) # ax2.set_xlabel(r'$t$ ($s$)') # ax2.set_ylabel(r'$T_d$ ($K$)') # ax2.set_title('Temperature Evolution of Evaporating ' + # self.drop_species.title() + ' Droplet, Model ' # + str(self.model)) # Experimental data t = [ 0, 0.35, 0.4, 0.87, 1.07, 1.26, 1.47, 1.65, 1.86, 2.05, 2.28, 2.48, 2.67, 2.95, 3.08, 3.3, 3.48, 3.67 ] d2 = [ 4, 4, 4, 3.9, 3.87, 3.82, 3.75, 3.67, 3.52, 3.4, 3.28, 3.1, 2.95, 2.65, 2.5, 2.28, 2.16, 2 ] T = [ 315, 330, 348, 370, 380, 387, 391, 398, 402.5, 407, 412.5, 416, 417, 420, 421, 422, 423, 425 ] # Exp M1 t1 = [0, 0.6, 0.8, 1, 1.2, 1.4, 1.6, 2, 2.4, 2.8, 3.2, 3.6] d21 = [ 4, 3.95, 3.8, 3.72, 3.45, 3.2, 2.95, 2.45, 1.8, 1.25, 0.78, 0.25 ] T1 = [315, 355, 375, 380, 385, 390, 395, 395, 395, 395, 395, 395] # Exp M2 t2 = [0, 0.6, 0.8, 1, 1.2, 1.4, 1.6, 2, 2.4, 2.8, 3.2, 3.6, 4, 4.2] d22 = [ 4, 3.96, 3.93, 3.72, 3.7, 3.6, 3.5, 3.26, 3.08, 2.85, 2.62, 2.42, 2.2, 2.1 ] T2 = [ 315, 350, 360, 362, 365, 365, 366, 370, 370, 370, 370, 370, 370, 370 ] # Exp M3 t3 = [0, 0.6, 0.8, 1, 1.2, 1.4, 1.6, 2, 2.4, 2.8, 3.2] d23 = [4, 3.95, 3.8, 3.75, 3.5, 3.25, 2.9, 2.3, 1.64, 1, 0.45] T3 = [315, 365, 380, 385, 390, 400, 402, 405, 405, 405, 405] # Exp M5 t5 = [0, 0.6, 0.8, 1, 1.2, 1.4, 1.6, 2, 2.4, 2.8, 3.2, 3.6, 4, 4.2] d25 = [ 4, 3.96, 3.93, 3.72, 3.68, 3.6, 3.4, 3.1, 2.77, 2.43, 2.1, 1.75, 1.5, 1.38 ] T5 = [ 315, 365, 380, 390, 400, 415, 425, 445, 460, 475, 495, 515, 535, 545 ] # Plot diameter first plt.figure(dpi=500) plt.plot(t, d2, "o", label="Experiment") plt.plot(t1, d21, "x", label="M1, Miller") plt.plot(t2, d22, "x", label="M2, Miller") plt.plot(t3, d23, "x", label="M3, Miller") plt.plot(t5, d25, "x", label="M5, Miller") for i in range(len(modellist)): plt.plot(timelist[i], d2list[i], label=("M" + str(modellist[i]) + ", Simulation")) plt.xlabel(r'$t$ ($s$)') plt.ylabel(r'$D^2$ ($mm^2$)') plt.legend(fontsize=8) # plt.title('Diameter Evolution of Evaporating ' + # self.drop_species.title()) plt.show() # Plot temperature plt.figure(dpi=500) plt.plot(t, T, "o", label="Experiment") plt.plot(t1, T1, "x", label="M1, Miller") plt.plot(t2, T2, "x", label="M2, Miller") plt.plot(t3, T3, "x", label="M3, Miller") plt.plot(t5, T5, "x", label="M5, Miller") for i in range(len(modellist)): plt.plot(timelist[i], templist[i], label=("M" + str(modellist[i]) + ", Simulation")) plt.xlabel(r'$t$ ($s$)') plt.ylabel(r'$T_d$ ($K$)') plt.legend(fontsize=8) # plt.title('Temperature Evolution of Evaporating ' + # self.drop_species.title()) plt.show() def save_data(self): self.file_dir = 'Sim_Code//Simulation//sim_data//' with open( self.file_dir + 'c_' + self.drop_species + '_heat_mass_transfer_time_step_tau_32.txt', 'w') as f: self.p.times[::-1] f.write('time' + ' ' + 'T_d' + ' ' + 'd2' + ' ' + '\n') for i in range(len(self.p.times)): f.write( str(self.p.times[i]) + ' ' + str(self.p.temp_history[i]) + ' ' + str(self.p.diameter_2_history[i]) + ' ' + '\n') self.p.times_temp_nd[::-1]