Hello,

I am running a simulation of a 1D electrochemical system with an applied
constant current boundary condition in which the current density (J) is
known to be uniform in space (dJ/dx = 0). The expression for J is J =
-1/2*(c-\rho/2)*d(\phi)/dx where \phi is the electric potential and \rho is
a parameter. In lines 59 and 60 of my code (http://pastebin.com/mksk9NJf),
I wrote code to verify if J is uniform in space using 2 different ways (one
using phi.faceGrad and the other using phi.grad):

J_face.setValue(-1.0/2.0*(c.harmonicFaceValue-rho/2.0)*phi.faceGrad)
J_cell.setValue(-1.0/2.0*(c-rho/2.0)*phi.grad)

The figure below is generated for an applied constant current of 2, so we
expect J to be constant at 2. In the figure, the green line is J_face while
the blue line is J_cell. It seems that J_cell becomes 1 (which is
suspiciously half of 2) on the rightmost cell while J_face is still 2. I
would like to ask why J_cell doesn't achieve a value of 2 on the rightmost
cell.

Thanks!

Best,
Edwin
[image: Inline image 2]

<<J_cell vs. J_face.png>>

Attachment: fipy_pde_v2.py
Description: Binary data

_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to