Hi Max,
You can warrant charge neutrality in one of two ways. The first way is to include the counter ion in your monomer definition, which would change your ITEM GROUPS
paragraphs as follows:
# Groups section
ITEM GROUPS
poly1 *CCC(c1ccc(S(:O)(:O):O)cc1)CC*.O(H)(H)(H), &
1,poly1:2, 2,poly2:1, 2,poly3:1
poly1_e1 CCC(c1ccc(S(:O)(:O):O)cc1)CC*.O(H)(H)(H), &
1,poly1:1, 1,poly2:1, 1,poly3:1
poly1_e2 *CCC(c1ccc(S(:O)(:O):O)cc1)CC.O(H)(H)(H), &
1,poly1:2, 1,poly2:2, 1,poly3:2
poly2 *CCCCC*, &
2,poly1:1, 1,poly2:2, 2,poly3:1
poly2_e1 CCCCC*, &
1,poly1:1, 1,poly2:1, 1,poly3:1
poly2_e2 *CCCCC, &
1,poly1:2, 1,poly2:2, 1,poly3:2
poly3 *CCC(c1ccccc1)CC*, &
2,poly1:1, 2,poly2:1, 1,poly3:2
poly3_e1 CCC(c1ccccc1)CC*, &
1,poly1:1, 1,poly2:1, 1,poly3:1
poly3_e2 *CCC(c1ccccc1)CC, &
1,poly1:2, 1,poly2:2, 1,poly3:2
water O
hydronium O(H)(H)(H)
ITEM END # GROUPS
The mass of one monomer includes the additional cation, thus allowing for inclusion in the mass fraction calculation. The inclusion method also allows you to set system_charge true
under ITEM OPTIONS
.
An alternative way is to redefine the number of hydronium clusters after the fact. In this case, you will have to use system_charge false
under ITEM OPTIONS
. I would define my clusters section as
ITEM CLUSTERS
poly random, 10
water water, 432
hydronium hydronium, 0
ITEM END # CLUSTERS
An extra verbatim EMC section is added to check for the system charge and calculate the correct number of hydronium molecules
ITEM EMC phase=1 spot=1
variables = {
n_hydronium -> int(abs(charge())+0.5)
};
clusters = {
cluster -> {
id -> hydronium, system -> main, group -> hydronium, n -> n_hydronium}
};
field = {
mode -> apply,
check -> {
atomistic -> true,
charge -> true
},
debug -> false
};
ITEM END # EMC
The keywords phase
and spot
control where this verbatim section appears in your resulting build.emc
. I added the field typing paragraph with checking system charge neutrality switched on (charge -> true
) to check the validity of my calculation. Please note that with this approach the hydronium molecules are excluded when assuming mass fractions for your clusters.