Hello everyone! I want to simulate the current distribution. I use the continuity equation and the Neumann boundary conditions.
The current is set at the boundary as a function of potential. However, the task diverges as soon as the total current is not zero. What condition needs to be added to fix the sum of the currents?
(abs(int1d(Th, 1)(ISteel) + int1d(Th, 2)(IMg)) < 1e-1)
func ISteel = 14225 * (-phi)^6 + 93891 * (-phi)^5 + 249128 * (-phi)^4 + 341543 * (-phi)^3 + 255613 * (-phi)^2 + 99090 * (-phi) + 15552;
func IMg = -1764.2 * (-phi)^4 - 10108 * (-phi)^3 - 20773 * (-phi)^2 - 17653 * (-phi) - 4910.6;
problem Current(phi, v) =
int2d(Th)(Sigma * grad(phi)' * grad(v))
- int1d(Th, 1)(ISteel * v)
- int1d(Th, 2)(IMg * v);