From b666f7324c25063cb3d189fba0abec742c14e220 Mon Sep 17 00:00:00 2001 From: Trung Nguyen Date: Mon, 11 Apr 2022 14:44:02 -0500 Subject: [PATCH] Updated the example input script with the set command for per-atom dielectric constant --- examples/PACKAGES/dielectric/data.confined | 6 +++--- examples/PACKAGES/dielectric/in.confined | 16 ++++++++++------ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/examples/PACKAGES/dielectric/data.confined b/examples/PACKAGES/dielectric/data.confined index 2e166151bb..8145c829d1 100644 --- a/examples/PACKAGES/dielectric/data.confined +++ b/examples/PACKAGES/dielectric/data.confined @@ -1,4 +1,4 @@ -LAMMPS data file: two oppositely charged ions confined between two walls +LAMMPS data file: two oppositely charged ions confined between two walls epsilon1=2 | epsilon2=10 | epsilon1=2 4002 atoms 3 atom types @@ -4015,5 +4015,5 @@ Atoms # dielectric: id mol type q x y z normx normy normz area_per_patch ed em e 3998 0 1 0 38.5078 42.4438 30.002 0 0 -1 0.866 8 6 6 0 3999 0 1 0 39.0079 41.5776 30.002 0 0 -1 0.866 8 6 6 0 4000 0 1 0 39.508 42.4438 30.002 0 0 -1 0.866 8 6 6 0 -4001 0 2 1 15 20 15 0 0 1 0.866 8 6 10 0 -4002 0 3 -1 25 20 25 0 0 1 0.866 8 6 10 0 +4001 0 2 1 15 20 15 0 0 1 1.0 8 6 10 0 +4002 0 3 -1 25 20 25 0 0 1 1.0 8 6 10 0 diff --git a/examples/PACKAGES/dielectric/in.confined b/examples/PACKAGES/dielectric/in.confined index c9ae6d712a..0bff4b2a1d 100644 --- a/examples/PACKAGES/dielectric/in.confined +++ b/examples/PACKAGES/dielectric/in.confined @@ -4,6 +4,8 @@ # top interface: n = (0, 0, -1) # so that ed's are the same for both interfaces +# Dielectric constants can be set to be different from the input data file + variable epsilon1 index 20 variable epsilon2 index 8 @@ -21,6 +23,8 @@ variable method index gmres # gmres = BEM/GMRES # dof = Direct optimization of the functional # none +# compute the relevant values for the interface particles + variable ed equal "v_epsilon2 - v_epsilon1" variable em equal "(v_epsilon2 + v_epsilon1)/2" variable epsilon equal 1.0 # epsilon at the patch, not used for now @@ -34,12 +38,10 @@ group ions type 2 3 group cations type 2 group anions type 3 -# 1.0 = q * epsilon2 = qreal for cations -# -1.0 = q * epsilon2 = qreal for anions -variable qscale equal "1.0 / v_epsilon2" -set group cations charge ${qscale} -variable qscale equal "-1.0 / v_epsilon2" -set group anions charge ${qscale} +# set the dielectric constant of the medium where the ions belong + +set group cations epsilon ${epsilon2} +set group anions epsilon ${epsilon2} pair_style lj/cut/coul/long/dielectric 1.122 10.0 pair_coeff * * 1.0 1.0 @@ -59,6 +61,8 @@ dump 3 ions custom 100 ions.dump id mol type q x y z fx fy fz #c_ef[1 fix 1 ions nve +# fix modify is used to set the properties of the interface particle group + if "${method} == gmres" then & "fix 3 interface polarize/bem/gmres 1 1.0e-4" & "fix_modify 3 itr_max 50 dielectrics ${ed} ${em} ${epsilon} ${area} NULL" &