예제 #1
0
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()
예제 #2
0
        prev_nodetype = deepcopy(rt.nodetype)
        rt_time.append(rt.time * scale)
        rt.dissolution_time.append(rt.time)
        rt_port.append(np.sum(rt.solid.portlandite.c) * scale)
        if (len(rt_port) < 2):
            dport.append(0)
        else:
            dport.append(
                (rt_port[-1] - rt_port[-2]) / (rt_time[-1] - rt_time[-2]))
    itr += 1

#%% SIMULATION TIME
print("Fraction %s done" % str(f))
print("Time to dissolve %s" % str(rt.time * scale))
simulation_time = time.time() - it
fn.print_time(simulation_time, rt)

#%%  PRINT
print('Ca %s' % str(np.array(rt.fluid.Ca._c[1, :])))
print('Ca +ss %s' % str(
    np.array(rt.fluid.Ca.c[1, :]) +
    np.array(rt.fluid.Ca._ss[1, :]) / np.array(rt.phrqc.poros[1, :])))
print('H +ss %s' % str(
    np.array(rt.fluid.H.c[1, :]) +
    np.array(rt.fluid.H._ss[1, :]) / np.array(rt.phrqc.poros[1, :])))
print('O +ss %s' % str(
    np.array(rt.fluid.O.c[1, :]) +
    np.array(rt.fluid.O._ss[1, :]) / np.array(rt.phrqc.poros[1, :])))
print('CH %s' % str(np.array(rt.solid.portlandite.c[1, :])))
print('Phrqc CH %s' %
      str(np.array(rt.phrqc.selected_output()['portlandite'][1, :])))
예제 #3
0
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 )
    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'])