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

Add EKIN to Walberla branch #4267

Closed
RudolfWeeber opened this issue May 28, 2021 · 3 comments
Closed

Add EKIN to Walberla branch #4267

RudolfWeeber opened this issue May 28, 2021 · 3 comments
Labels
waLBerla Issues regarding waLBerla integration

Comments

@RudolfWeeber
Copy link
Contributor

Structure, LB coupling

  • EK and LB can each be used independently but also in combination
  • If used in combination, the LB velocity field is passed into EK, and EK adds to the LB force field
  • To allow for this, they should share the Walberla Blockforest (the data structure that handles the domain decomposition and field storage in Walberla)
  • To this end, a Lattice component is introduced:
    • Owns the Walberla-Blockforest
    • Parameters: number of cells per direction, number of blocks per direction per mpi rank, time step
    • Is passed as argument to the LB and EK upon their instanceiation
  • EK und LB get a shared pointer to the block forest from the lattice component

EK

Fields

$n$ = number of species, $r$ = number o reactions

  • $n$ densities
  • $n$ fluxes
  • 1 total charge
  • 1 electrostatic potential
  • reference to LB velocity and force fields (as BlockDataId)

Parameter:

  • $n$ * diffusion coefficients
  • $n$ charges (valencies)
  • kT
  • $r \times n$ * stoich. coefficients
  • $r \times n$ Reaction orders
  • $r$ * reactionrates

Kernel (in order of execution)

  • Calculate total charge from per species densities and valencies
  • FFT-Solver (from Walberla in combination with pfft)
  • Flux- and LB-force computation (executed for every species, can contain thermal fluctuations)
  • $r$ Reactions (adds source/sink terms to fluxes)
  • Boundary conditions
  • Continuity equation (for each species)

Sll kernels except the FFT solver for the Poisson eqn are generated using PyStencils/PyStenilcs_Walberla

Reaction kernels

  • Seperate kernels will be generated for the number of reactants.
  • Educts and Prudcuts will not have to be considerd separately. This is hanlded by the sign of the stoich. coeff.
  • There will be kernels from 1 to 5 reacting species.

Next steps

  • Write a Python script generating all necessary kernels
  • Implement the Lattice component holding the BlockForest and lattice, pull out the block forest from the LB base class (LBWalberlaImpl)
  • Create the Python interface for the Lattice component
  • Write the EK base class
@jngrad jngrad added the waLBerla Issues regarding waLBerla integration label May 28, 2021
@itischler
Copy link
Contributor

itischler commented Jul 6, 2021

first ek kernel generator added here
boundary and electrostatics kernels still to be done

@jngrad
Copy link
Member

jngrad commented Aug 4, 2022

@reinaual's walberla_ekin_scriptinterface branch has been merged into the walberla branch.

  • ESPResSo 4.3-dev now has:
    • an EK class that can be used alone or together with the LB class
    • electrokinetic solvers, kernels for bulk and indexed reactions
    • density and flux boundaries that can be created from a shape or on a per-node basis
  • code duplication between LBWalberlaImpl and EKinWalberlaImpl has been factored out
  • the LB and EK classes for VTK writers have been merged into one common interface
  • the EK code (excluding generated kernels) is 98% covered by integration tests
  • the user guide chapter on ekin has been restored and updated accordingly

@jngrad
Copy link
Member

jngrad commented Aug 4, 2022

Last remaining tasks:

  • EK coupling to LB with thermal fluctuations
    • blocked due to how the RNG is implemented in lbmpy
  • EK unit conversions between python interface and C++ class
  • EK unit conversions in VTK files
  • C++ unit tests for EK
  • checkpointing

@jngrad jngrad closed this as completed May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waLBerla Issues regarding waLBerla integration
Projects
None yet
Development

No branches or pull requests

3 participants