Couple diffusion with electric field - Poisson Nernst Planck Equation
9 months ago by
The problem comes from a basic 2-species diffusion case, where I impose an electric field in the domain. That means, I couple the poisson equation into the diffusion equations. For the electric field, I impose a DirichletBC on both sides (0 and 13V) where it will create a force that drives some ions in certain direction and others in the oposite, according to the charge of them.
That means, my weak form will have three main components (2 species and 1 poisson equation, that relates the electric potential to the electric charge in space). Bellow, parts of the code that explains my problem:
P1 = FiniteElement("CG", mesh.ufl_cell(), 1)
ME = FunctionSpace(mesh, [P1,P1,P1])
u = Function(ME)
na, cl, psi = split(u)
# Defining the test functions
(vna, vcl, vpsi) = TestFunctions(ME)
Fna = na * vna * dx - na0 * vna * dx \
+ dt * D_na * dot(grad(na), grad(vna)) * dx \
+ dt * Z_na * D_na / (GasConstant*Temperature) * FaradayConstant * na * dot(grad(psi), grad(vna)) * dx
Fcl = + cl * vcl * dx - cl0 * vcl * dx \
+ dt * D_cl * dot(grad(cl), grad(vcl)) * dx \
+ dt * Z_cl * D_cl / (GasConstant*Temperature) * FaradayConstant * cl * dot(grad(psi), grad(vcl)) * dx
Fpsi = dot(grad(psi), grad(vpsi)) * dx \
- (FaradayConstant / epsilon) * na * vpsi * dx \
- (FaradayConstant / epsilon) * cl * vpsi * dx \
- (FaradayConstant / epsilon) * w * vpsi * dx
F = Fcl+Fna+Fpsi
From that, I imposed on the electric field the following:
boundaries = FacetFunction("size_t", mesh)
bc_left = DirichletBC(ME.sub(2), 0.0, boundaries, 1)
bc_right = DirichletBC(ME.sub(2), Voltage, boundaries, 2)
What I see, is that the electric field solution always has a peak in the middle of the domain and therefore, the diffusion occurs towards and against that peak. What I would like is to have a gradual increase of the electric field from one side to another. With such electric field distribution, I guess it would be possible to explicitly see the diffusion of ions with different charges towards differents sides of the domain (according to the electric field imposed).
Description of the problem and mathematical equations/approach can be found here: https://www.ncbi.nlm.nih.gov/pubmed/10362465
Pictures of the weird exponential electric field curve and the species diffusion after some time, available here: https://www.dropbox.com/sh/rq5p4akrolnc689/AADTtgh5aD_7UmZaixEk8QYva?dl=0
Thanks in advance for any help!!
Community: FEniCS Project
Please login to add an answer/comment or follow this question.