plt.legend(fontsize = 12) plt.tick_params(axis='both', which='major', labelsize=12) plt.savefig(fpath + fname + suffix[k]) plt.show() #%% DISSOLUTION/PRECIPITATION RATE titles = ['Dissolution rate', 'Precipitation rate' ] comp = ['portlandite', 'calcite'] suffix = ['_CH_rate', '_CC_rate' ] s =2 for k in range(0, len(comp)): plt.figure(figsize=(8,4)) for i in range(0, len(names)): rate = np.abs(cf.get_rate(results[names[i]][comp[k]], results[names[i]]['time'][2] - results[names[i]]['time'][1], step = s )) #print(len(rate)) plt.plot(np.array(results[names[i]]['time'][::s])/3600, rate, ls=linetype[i], label = label[i]) plt.title(titles[k]) plt.xlabel('Time (h)') plt.ylabel('Rate (mol/s)') plt.yscale("log") plt.legend() plt.savefig(fpath + fname + suffix[k]) plt.show() #plt.savefig(fpath + fname + '_CH_rate') #%% POINTS f = ('C', 'C') # ('Ca', 'Ca') ('Volume CH', 'vol_CH') ('Volume CC', 'vol_CC') ('pH', 'pH') ('De', 'De')('Porosity', 'poros')
plt.legend() plt.savefig(fpath + fname + suffix[k]) plt.show() #%% DISSOLUTION RATE titles = ['Dissolution rate', 'Precipitation rate'] comp = ['portlandite', 'calcite'] suffix = ['_CH_rate', '_CC_rate'] limits = [[-0.1, 0], [0, 0.1]] rate = {} for i in range(0, len(names)): rate[names[i]] = {} for k in range(0, len(comp)): rate[names[i]][comp[k]] = cf.get_rate( results[names[i]][comp[k]], results[names[i]]['time'][2] - results[names[i]]['time'][1]) rstart = 0 rend = len(results[names[1]]['time']) - 1 for k in range(0, len(comp)): plt.figure(figsize=(8, 4)) for i in range(0, len(names)): plt.plot(results[names[i]]['time'][rstart:rend], rate[names[i]][comp[k]][rstart:rend], ls=linetype[i], label=label[i]) plt.title(titles[k]) #plt.ylim(limits[k]) plt.xlabel('Time (s)') plt.ylabel('Rate (mol/s)')
plt.tick_params(axis='both', which='major', labelsize=12) plt.savefig(fpath + fname + suffix[k]) plt.show() #%% DISSOLUTION AND PRECIPITATION RATE titles = ['Dissolution rate', 'Precipitation rate'] comp = ['portlandite', 'calcite'] suffix = ['_CH_rate', '_CC_rate'] s = 1 for k in range(0, len(comp)): plt.figure(figsize=(8, 4)) for i in range(0, len(names)): rate = np.abs( cf.get_rate(sres[names[i]][comp[k]], sres[names[i]]['time'][2] - sres[names[i]]['time'][1], step=s)) t = sres[names[i]]['time'] r = rate l = len(sres[names[i]]['time']) - len(rate) if (l > 0): t = sres[names[i]]['time'][l:] r = rate elif (l < 0): t = sres[names[i]]['time'] r = rate[np.abs(l):] plt.plot(t[10:r2], r[10:r2], ls=linetype[i], label=label[i]) plt.title(titles[k]) plt.xlabel('Time (s)') plt.ylabel('Rate (mol/s)')