], flag='1nn') for coord in nn_coords
]

# and conditions and actions are simply
conditions = [Condition(species='CO', coord=center)]
actions = [Action(species='empty', coord=center)]

# define the rate at ZCL
rate_constant = 'p_COgas*A*bar/sqrt(2*m_CO*umass/beta)'  #rate_constant = 'p_COgas*A*bar/sqrt(2*m_CO*umass/beta)*exp(beta*(E_CO-mu_COgas)*eV)'
# and the otf rate expression
otf_rate = 'base_rate*exp(beta*nr_CO_1nn*E_CO_nn*eV)'

proc = Process(name='CO_desorption',
               condition_list=conditions,
               action_list=actions,
               bystander_list=bystander_list,
               rate_constant=rate_constant,
               otf_rate=otf_rate)
kmc_model.add_process(proc)

###It's good to simply copy and paste the below lines between model creation files.
kmc_model.filename = model_name + ".xml"
kmc_model.backend = 'otf'  #specifying is optional. local_smart is the dfault. Currently, the other options are 'lat_int' and 'otf'
kmc_model.clear_model(
    model_name, backend=kmc_model.backend
)  #This line is optional: if you are updating a model, this line will remove the old model before exporting the new one. It is convenent to always include this line because then you don't need to 'confirm' removing the old model.
kmc_model.save()
kmcos.export(
    kmc_model.filename + ' -b ' + kmc_model.backend
)  #alternatively, one can use: kmcos.cli.main('export '+  kmc_model.filename + ' -b' + kmc_model.backend)
             if 0 < (np.linalg.norm(nn_coord.pos - center.pos)) <= A]

# which will be bystanders to the CO desorption process
bystander_list = [Bystander(coord=coord,
                            allowed_species=['CO',],
                            flag='1nn') for coord in nn_coords]

# and conditions and actions are simply
conditions = [Condition(species='CO',coord=center)]
actions = [Action(species='empty',coord=center)]

# define the rate at ZCL
rate_constant = 'p_COgas*A*bar/sqrt(2*m_CO*umass/beta)' #rate_constant = 'p_COgas*A*bar/sqrt(2*m_CO*umass/beta)*exp(beta*(E_CO-mu_COgas)*eV)'
# and the otf rate expression
otf_rate = 'base_rate*exp(beta*nr_CO_1nn*E_CO_nn*eV)'

proc = Process(name='CO_desorption',
                condition_list=conditions,
                action_list=actions,
                bystander_list = bystander_list,
                rate_constant=rate_constant,
                otf_rate=otf_rate)
pt.add_process(proc)

###It's good to simply copy and paste the below lines between model creation files.
pt.filename = model_name + ".xml"
pt.backend = 'otf' #specifying is optional. local_smart is the dfault. Currently, the other options are 'lat_int' and 'otf'
pt.clear_model(model_name, backend=pt.backend) #This line is optional: if you are updating a model, this line will remove the old model before exporting the new one. It is convenent to always include this line because then you don't need to 'confirm' removing the old model.
pt.save()
kmcos.export(pt.filename + ' -b ' + pt.backend) #alternatively, one can use: kmcos.cli.main('export '+  pt.filename + ' -b' + pt.backend)
Пример #3
0
def compile(kmc_model): #exports the kmc_model.xml file
    import kmcos
    kmcos.export(kmc_model.filename + ' -b' + kmc_model.backend + ' ' + kmc_model.compile_options) # You can find these various compile_options in get_options() in kmcos/cli.py
Пример #4
0
def compile(kmc_model):  #exports the kmc_model.xml file
    import kmcos
    kmcos.export(kmc_model.filename + ' -b' + kmc_model.backend)