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') plt.show()
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') plt.show() #%% SAVE if (True): fn.save_obj(results, path + str(nn) + '_results') np.save(path + 'SI', csh.phrqc.selected_output()['SI_calcite']) np.save(path + 'pH', csh.phrqc.selected_output()['pH'])
#%% 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 ) np.save(path + 'poros', carb_rt.fluid.Ca.poros) #%% PLOT if(True): fn.plot_species(results, names=[])#['calcite'] fn.plot_avg(results, names=['avg_poros', 'avg_D_eff']) fn.plot_points(results, names=['calcite', 'portlandite', 'poros', 'Ca', 'C']) fn.plot_fields(carb_rt, names=['calcite', 'portlandite', 'Ca', 'C', 'poros'],fsize=(15,1)) #%% PRINT if(True): print('Ca +ss %s' %str(np.array(carb_rt.fluid.Ca.c[1,:]) + np.array(carb_rt.fluid.Ca._ss[1,:])/np.array(carb_rt.phrqc.poros[1,:]))) print('C +ss %s' %str(np.array(carb_rt.fluid.C.c[1,:]) + np.array(carb_rt.fluid.C._ss[1,:])/np.array(carb_rt.phrqc.poros[1,:]))) print('H +ss %s' %str(np.array(carb_rt.fluid.H.c[1,:]) + np.array(carb_rt.fluid.H._ss[1,:])/np.array(carb_rt.phrqc.poros[1,:]))) print('O +ss %s' %str(np.array(carb_rt.fluid.O.c[1,:]) + np.array(carb_rt.fluid.O._ss[1,:])/np.array(carb_rt.phrqc.poros[1,:]))) print('CH %s' %str(np.array(carb_rt.solid.portlandite.c[1,:]))) print('dCH %s' %str(np.array(carb_rt.phrqc.dphases['portlandite'][1,:]))) print('CC %s' %str(np.array(carb_rt.solid.calcite.c[1,:]))) print('dCC %s' %str(np.array(carb_rt.phrqc.dphases['calcite'][1,:]))) print('Vol %s' %str(np.array(carb_rt.solid.vol[1,:]))) print('D %s' %str(np.array(carb_rt.fluid.C.De[1,:]))) print('SI %s' %str(np.array(carb_rt.solid.target_SI[1,:]))) print('pH %s' %str(np.array(carb_rt.phrqc.selected_output()['pH'][1,:])))
simulation_time = time.time() - it fn.print_time(simulation_time, carb_rt) #%% SAVE 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) np.save(path + 'poros', carb_rt.fluid.Ca.poros) #%% PLOT fn.plot_species(results, names=['calcite', 'portlandite', 'Ca', 'C'], fsize=(6, 4)) fn.plot_fields(carb_rt, names={'calcite', 'portlandite', 'Ca', 'C'}) #%%PRINT #print(carb_rt.fluid.Ca.De) #print(carb_rt.fluid.C.De) #print(carb_rt.fluid.Ca._c+carb_rt.fluid.Ca._ss) #print(carb_rt.fluid.C._c+carb_rt.fluid.C._ss) #print(carb_rt.solid.portlandite.c) #print(carb_rt.solid.calcite.c) #print(carb_rt.solid.poros) #%% ''' from copy import deepcopy