Curl in cylindrical coordinate

Hi everybody!
I need to perform some magnetostatic analysis in geometries that are actually close to a solenoid.
I’m producing the mesh in 2D, due to the Axial symmetry of the problem and, using the A-formulation of the Ampere Law, I need to introduce the operator CURL, but I’m not succeeding in writing down the weak formulation of the operator itself.
Does anybody succeeded in performing the same calculation? (The very same problem exists for me also modeling a simple solenoid with only one winding, because of course using the cartesian operator is like analyzing two infinite and straight conductors that are leading opposite current… nice problem, but not what I want to solve actually!)
I’m going to thanks already a lot all the people that would help me in solving this problem!

Have a nice day!

I think first without formulation and equation it is hard to give a correct
answer.

I find on the web:

The same technique does not work in magnetostatics since, in general, curl H ̸= 0. However, since

div B = 0

we conclude the existence of a vector potential A : R3 → R3 with B = −curlA in D. Substituting this into Ampere’s Law yields (for homogeneous media Ω) after multiplication with μ0

−μ0J = curlcurlA = ∇div A − ∆A.

Since curl ∇ = 0 we can add gradients ∇u to A without changing B. We will see later that we can choose u such that the resulting potential A satisfies div A = 0. This choice of normalization is called Coulomb gauge.

With this normalization we also get in the magnetostatic case the Poisson equation ∆A = −μ0J .

We note that in this case the Laplacian has to be taken component wise.

In your case J is normal to the 2d plan so A will be a scalar field in the plan.

\boldsymbol \nabla \wedge \mathbf{A} = \left(\frac{1}{r}\frac{\partial \mathrm{A}z}{\partial \theta} - \frac{\partial \mathrm{A}\theta}{\partial z}\right) \mathbf{u_r} + \left(\frac{\partial \mathrm{A}r}{\partial z} - \frac{\partial \mathrm{A}z}{\partial r}\right)\mathbf{u\theta} + \frac{1}{r}\left(\frac{\partial}{\partial r}(r \mathrm{A}\theta) - \frac{\partial \mathrm{A}_r}{\partial \theta}\right) \mathbf{u_z}.
=> 2 case scalaire avec A_\theta et le vectoriel A_z et A_r

Hi, I’m also solving the same problem in terms of magnetic vector potential Curl(A)=B, where A is vector potential, B is magnetic induction (magnetic flux density). In magnetostatics the governing equation is -L(A)= mu0 J, where L is Laplace operator (depending on coordinate system), mu0 = 4pi1e-7 is magnetic constant, J is electric current density.
Now I solved problem of calculation A and B for line wire for Cartesian
magnetic.edp (1.3 KB) and polar magneticAxi.edp (1.0 KB) geometries. You can try to play with different meshes and element types (P1 or P2), you will see how they influence on the calculation error. Description of writing in polar coordinates you can find in Documentation/Learning by Examples/Heat Conduction/Axisymmetry: 3D Rod with circular section.
For the single ring with current I the analytical solution is A = mu0/(4*pi) P theta / r^2, where P = I pi R^2 is magnetic moment of circuit, R is the circuit radius, theta is the angle between the symmetry axis and direction to point where A is being determinated, r is a distance from center of ring.
I think that the second code have to be correct with the CORRECT boundary conditions. For now I now that on Axis A=0 and the total magnetic flux should be equals to zero
int B n dS = 0 = int Curl(A) n dS = 0 where n is normal vector to dS. But for now I have not realized it. Here is code magneticAxiRing.edp (2.1 KB) I’m working with it.
If you succeed, let us know.

Thanks evrybody! Problem solved!