N_res = 1e+4 S = max(1, int(N / N_res)) ''' dt = csh.dt Ts = 1.#seconds Ts = Ts/scale + 0.001 N_res = 1e+4 S = max(1,int(N/N_res)) ''' #%% run #n=1000 it = time.time() while csh.time <= Ts: #itr < nitr: # csh.advance() results = fn.append_results(csh, results, step=S) simulation_time = time.time() - it fn.print_time(simulation_time, csh) #%% fn.plot_species(results, names=[]) #['calcite'] fn.plot_avg(results, names=['avg_poros', 'avg_D_eff']) fn.plot_fields(csh, names=['calcite'], fsize=(15, 1)) #,'Ca','Si' fn.plot_points(results, names=['calcite', 'poros', 'Ca', 'pH']) #%% plot ca/si against density plt.figure() plt.plot(results['Ca_Si'], results['csh_density']) plt.legend() plt.ylabel('CSH density') plt.xlabel('C/S')
N = Ts/carb_rt.dt N_res = 1e+4 S = max(1,int(N/N_res)) #%% RUN SOLVER while carb_rt.time <=Ts: #itr <= nitr: # if(True): if ( (carb_rt.time <= time_points[j]) and ((carb_rt.time + carb_rt.dt) > time_points[j]) ): print(time_points[j]) #fn.save_figures_minerals(carb_rt, max_pqty, time_points[j], path, nn, ptype=m) #fn.save_figures_mols(carb_rt, time_points[j], path, nn, ptype=m) j +=1 carb_rt.advance() results = fn.append_results(carb_rt, results, step = S ) itr += 1 #%% SIMULATION TIME simulation_time = time.time()-it fn.print_time(simulation_time, carb_rt) #%% SAVE if(False): fn.save_obj(results, path + str(nn) +'_results') np.save(path + 'SI', carb_rt.phrqc.selected_output()['SI_calcite'] ) np.save(path + 'pH', carb_rt.phrqc.selected_output()['pH'] ) np.save(path + 'Ca', carb_rt.phrqc.selected_output()['Ca'] ) np.save(path + 'C', carb_rt.phrqc.selected_output()['C'] ) np.save(path + 'De', carb_rt.fluid.Ca.De )