my aim in this is to model the current flow of a cylindrical disk with one end set to potential 0 and the other end set to potential 1. In this section of code I am trying to find the scalar potential function (so I can then find the electric field). I do not need to know the specific form of the potential function, I just want to make a streamplot of the field (or a 3D vector plot of the field).
Assign the cylindrical disk to R2
R2 = Cylinder[{{0, 0, -0.1}, {0, 0, 0.1}}, 1]
(* sets left circle segment to 0 and right circle segment to 1. *)
DBC1 = {DirichletCondition[
u[x, y, z] =
0, (-1 <= x <= -0.8 \[And] Abs[y] <= 0.6 \[And] Abs[z] == 0.1)],
DirichletCondition[
u[x, y, z] =
1, (0.8 <= x <= 1 \[And] Abs[y] <= 0.6 \[And] Abs[z] == 0.1)]}
Potential = NDSolveValue[{Laplacian[u[x, y, z], {x, y, z}] == 0,
DBC2}, u, Element[{x, y, z}, R2]]
ERROR:
NDSolveValue::deqn: Equation or list of equations expected instead of True in the first argument {True,{DirichletCondition[0,-1<=x<=-0.8&&Abs[y]<=0.6&&Abs[z]==0.1],DirichletCondition[1,0.8<=x<=1&&Abs[y]<=0.6&&Abs[z]==0.1]}}.
I'm not sure how to fix the issue I am facing, any help would be greatly appreciated! Also if anyone knows of an efficient way to get the magnetic field profile that would be great too... Thank you.
=
where you need==
inu[x, y, z] =
, and you also haveDBC1
is one place andDBC2
in another. However correcting this only throws others errors. $\endgroup$