Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EK density continuity broken for for boundaries in the ghostlayer #5049

Open
itischler opened this issue Feb 19, 2025 · 0 comments
Open

EK density continuity broken for for boundaries in the ghostlayer #5049

itischler opened this issue Feb 19, 2025 · 0 comments

Comments

@itischler
Copy link
Contributor

itischler commented Feb 19, 2025

I found a bug, where the global ek density increases over time. This happens when the sample script is run with multiple mpi processes, put it works fine when only using 1 process.

import numpy as np
import espressomd
import espressomd.electrokinetics
import espressomd.shapes

box_l = 20
time_step = 0.2

# Parameters
kT = 1.0
density = 0.2
valency = 1.0
diffusion = 0.2
ext_efield = [0.01, 0., 0.]
sphere_radius = 4.0


# Set-up the system
system = espressomd.System(box_l=[box_l] * 3)
system.time_step = time_step
system.cell_system.skin = 1.0


# Set-up the EK
lattice = espressomd.electrokinetics.LatticeWalberla(agrid=1.0, n_ghost_layers=1)
ek_solver = espressomd.electrokinetics.EKNone(lattice=lattice)
system.ekcontainer = espressomd.electrokinetics.EKContainer(
    solver=ek_solver, tau=system.time_step)


# Set-up the EK species
ek_species_pos = espressomd.electrokinetics.EKSpecies(
    lattice=lattice,
    single_precision=False,
    kT=kT,
    tau=system.time_step,
    density=density,
    valency=valency,
    diffusion=diffusion,
    advection=False,
    friction_coupling=False,
    ext_efield=ext_efield,
    thermalized=False
)
system.ekcontainer.add(ek_species_pos)

# Set-up the boundary
sphere = espressomd.shapes.Sphere(center=[box_l/2]*3, radius=sphere_radius)

ek_species_pos.add_boundary_from_shape(
    shape=sphere, value=[0.0,0.0,0.0], boundary_type=espressomd.electrokinetics.FluxBoundary)
    

for i in range(20):
    system.integrator.run(100)
    print(np.mean(ek_species_pos[:,:,:].density))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant