Hi,
I need to solve electrochemistry diffusion-advection eqs. with Navier Stokes with a boundary condition of zero normal flux at a surface, to study accumulation of certain species at the surface. It looks like it is not possible to apply boundary conditions to the flux N (as defined here http://www.elmerfem.org/elmerwiki/index ... =Main_Page ) . I am able to apply boundary conditions to the concentration and to the diffusion flux only but what I really need is to apply boundary conditions to the (total) flux N.
I am wondering why it is not possible to apply this kind of boundary conditions. It looks simple. I really need to apply these BC so I'll be happy to volunteer programing and help implementing these BC in ELmer.
Jordi
--
Dr. Jordi Faraudo
Institut de Ciencia de Materials de Barcelona (ICMAB-CSIC),
http://icmab.es/about/people/detail/detail?id=593
Editorial Board member @ "Materials" journal, http://www.mdpi.com/journal/materials
Editorial Board member @ "Heliyon" journal, http://www.heliyon.com
BC in Electrochemistry solver
Re: BC in Electrochemistry solver
Hi,
did you read the corresponding chapters in the Elmer Models Manual? I have never used those solvers myself, but from a quick glance into the manual it seems to me that a flux BC is possible.
HTH,
Matthias
did you read the corresponding chapters in the Elmer Models Manual? I have never used those solvers myself, but from a quick glance into the manual it seems to me that a flux BC is possible.
HTH,
Matthias
-
- Site Admin
- Posts: 4812
- Joined: 22 Aug 2009, 11:57
- Antispam: Yes
- Location: Espoo, Finland
- Contact:
Re: BC in Electrochemistry solver
Hi
I think that the zero normal flux would be the default BC if nothing else is set.
-Peter
I think that the zero normal flux would be the default BC if nothing else is set.
-Peter
Re: BC in Electrochemistry solver
No, this boundary condition is NOT correctly applied in the electrochemistry solver. The reason is, as clearly explained in the example, that the total flux N is not considered in the boundary conditions. Only diffusive flux and flux due to fluid motion are considered. But in this case there is another contribution, which is due to the mass flux due to the electric field.
If you look at the equations as described in the example, the total flux N contains correctly these three terms BUT as explained in the example, at the present time no boundary conditions can be applied to this total flux N.
Anyway, the manual in this case is useless, since the electrochemistry solver is not described in the manual, as far as I can see.
My question is really why not implementing the total flux N in the boundary conditions? It looks like a trivial change. In fact, I can help to code it if needed.
jordi
If you look at the equations as described in the example, the total flux N contains correctly these three terms BUT as explained in the example, at the present time no boundary conditions can be applied to this total flux N.
Anyway, the manual in this case is useless, since the electrochemistry solver is not described in the manual, as far as I can see.
My question is really why not implementing the total flux N in the boundary conditions? It looks like a trivial change. In fact, I can help to code it if needed.
jordi
Re: BC in Electrochemistry solver
Matthias, please, read my comment more carefully. I said that it is possible to apply flux BC to convective and diffusive flux but not to the total electrochemical flux N. This is not my opinion, this was stated clearly in the official Elmer electrochemistry solver example:
http://www.elmerfem.org/elmerwiki/index ... ochemistry
http://www.elmerfem.org/elmerwiki/index ... ochemistry
mzenker wrote:Hi,
did you read the corresponding chapters in the Elmer Models Manual? I have never used those solvers myself, but from a quick glance into the manual it seems to me that a flux BC is possible.
HTH,
Matthias
Re: BC in Electrochemistry solver
Sorry, but you miss the essence of the problem. What you said applies only to convective and diffusive flux.
I refer to the TOTAL electrochemical flux N including the Nernst-Planck electromigration term.
The official Elmer electrochemistry solver wiki clearly says that it is not possible to apply boundary conditions to the total electrochemical flux N.
This is not my opinion, this was stated clearly in the :
http://www.elmerfem.org/elmerwiki/index ... ochemistry
And of course in electrochemistry you need to apply BC to the total flux N!!
Jordi
I refer to the TOTAL electrochemical flux N including the Nernst-Planck electromigration term.
The official Elmer electrochemistry solver wiki clearly says that it is not possible to apply boundary conditions to the total electrochemical flux N.
This is not my opinion, this was stated clearly in the :
http://www.elmerfem.org/elmerwiki/index ... ochemistry
And of course in electrochemistry you need to apply BC to the total flux N!!
Jordi
raback wrote:Hi
I think that the zero normal flux would be the default BC if nothing else is set.
-Peter
-
- Site Admin
- Posts: 4812
- Joined: 22 Aug 2009, 11:57
- Antispam: Yes
- Location: Espoo, Finland
- Contact:
Re: BC in Electrochemistry solver
Hi
Sorry for being too hasty to answer. I overlooked the fact that you used the tailored solver. This was written long ago by Adam P. who is since quite a few years busy with other things. I would indeed say that the BC would be not a big deal to implement but it is currently not implemented.
Do you have convection? If not, then the diffusive flux could be equation with the flux of the electric potential multiplied by a suitable coefficient involving mobility. This could be done on discrete level without any need to code. If you have a sif I could suggest a few changes.
-Peter
Sorry for being too hasty to answer. I overlooked the fact that you used the tailored solver. This was written long ago by Adam P. who is since quite a few years busy with other things. I would indeed say that the BC would be not a big deal to implement but it is currently not implemented.
Do you have convection? If not, then the diffusive flux could be equation with the flux of the electric potential multiplied by a suitable coefficient involving mobility. This could be done on discrete level without any need to code. If you have a sif I could suggest a few changes.
-Peter
Re: BC in Electrochemistry solver
Peter,
Jordi has mentioned in his first post that Advection-Diffusion Equation (with Nernst Planck term) is to be used with Navier-Stokes Equation. So, his works will have to use convection term (species concentration coupled with flow velocity) too.
I have uploaded a test on electrochemical migration of Sn and Zn species with dirichlet BCs for concentration (https://github.com/anilkunwar/elmerfem/ ... v-case.sif). You can modify the sif files there to develop flux boundary conditions for simulations with negligible convection effect.
Yours Sincerely,
Anil Kunwar
Jordi has mentioned in his first post that Advection-Diffusion Equation (with Nernst Planck term) is to be used with Navier-Stokes Equation. So, his works will have to use convection term (species concentration coupled with flow velocity) too.
I have uploaded a test on electrochemical migration of Sn and Zn species with dirichlet BCs for concentration (https://github.com/anilkunwar/elmerfem/ ... v-case.sif). You can modify the sif files there to develop flux boundary conditions for simulations with negligible convection effect.
Yours Sincerely,
Anil Kunwar
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
Re: BC in Electrochemistry solver
You are right. Before answering, I should have taken more time to analyze your problem - or, since I am not an electrochemistry expert, I should not have answered at all.jfaraudo wrote:Matthias, please, read my comment more carefully.
Matthias
Re: BC in Electrochemistry solver
Matthias,
I think you have answered very correctly in the second post .
In fact, flux BC is available for any PDE having diffusion and advection/convection term.
https://github.com/ElmerCSC/elmerfem/bl ... delPDE.F90
D grad_c = g ---(for a general PDE).
dC/dt = D nabla^2 c - v_{conv}.c
D_{em} grad_c = h ---(for electrochemical solver with the fluid motion nearly equal to zero).
1/M_{i} dC/dt = D_{em} nabla^2 c - grad_phi.c,
where , D_{em} = D/M_{i}
M_{i} = Dze/(kT),
So, we need to put 1/M_{i} in the coefficient of time-derivative term and D/M_{i} in the coefficient of diffusion term. Then, the flux BC applies for Nernst Planck term.
Now, the difficult part, what Jordi is trying to say is the inclusion of flow solver, which has an additional convection vector (fluid velocity) different than grad_phi.
Yours Sincerely,
Anil Kunwar
I think you have answered very correctly in the second post .
In fact, flux BC is available for any PDE having diffusion and advection/convection term.
https://github.com/ElmerCSC/elmerfem/bl ... delPDE.F90
D grad_c = g ---(for a general PDE).
dC/dt = D nabla^2 c - v_{conv}.c
D_{em} grad_c = h ---(for electrochemical solver with the fluid motion nearly equal to zero).
1/M_{i} dC/dt = D_{em} nabla^2 c - grad_phi.c,
where , D_{em} = D/M_{i}
M_{i} = Dze/(kT),
So, we need to put 1/M_{i} in the coefficient of time-derivative term and D/M_{i} in the coefficient of diffusion term. Then, the flux BC applies for Nernst Planck term.
Now, the difficult part, what Jordi is trying to say is the inclusion of flow solver, which has an additional convection vector (fluid velocity) different than grad_phi.
Yours Sincerely,
Anil Kunwar
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice