Closed lopeztarifa closed 1 year ago
Hi @lopeztarifa,
The keyword "variant" is not yet implemented in pyZacros. However, I agree with the line you wrote, "# I expect a 1-2 instead", so I'll check it. Regarding the +1, it is because I need to convert the python zero-based indexing to zacros one-based indexing.
Nestor
Thanks for taking a look!
I used the code shown below, and it works as expected:
import scm.pyzacros as pz
O2_g = pz.Species("O2")
s0 = pz.Species("*")
O_s = pz.Species("O*")
O2_ads = pz.ElementaryReaction(initial=[s0,s0,O2_g],
final=[O_s,O_s],
site_types=['brg','brg'],
neighboring=[(0,1)],
reversible=True,
pre_expon=7.980e+07,
pe_ratio=9.431e-09,
activation_energy=0.000,
label="O2_adsorption")
print(O2_ads)
This is the output:
reversible_step O2_adsorption
gas_reacs_prods O2 -1
sites 2
neighboring 1-2
initial
1 * 1
2 * 1
final
1 O* 1
2 O* 1
site_types brg brg
pre_expon 7.98000e+07
pe_ratio 9.43100e-09
activ_eng 0.00000e+00
end_reversible_step
The problem is the indexing you are using. Remember that python uses zero-based indexing, so the neighboring
must to be [(0,1)]
and not [(1,2)]
.
Nestor
Yes, I know. But I think for users would be better to have the same neighboring indexing as Zacros, wouldn't be?
The concept of neighboring is based on the Python index. Users copying/pasting from Zacros inputs should change them accordingly.
Hi @nfaguirrec ,
I am trying to reproduce the following reaction:
For that, I create the corresponding pz.ElementaryReaction using a neighboring=[(1, 2)]. The mechanism_input.dat file that pyZacros writes:
That makes Zacros to crash:
I guess the reason is the output of the ElementaryReaction: https://github.com/SCM-NV/pyZacros/blob/65fc06077ad6cc7b75c60a004c86640a4f39cea6/core/ElementaryReaction.py#L232
Any reasons why a +1 is added to the neighboring numbers? I think is confusing :S
Thanks