I need To apply a uniform magnetic field in perpendicular direction on photonic crystal fiber by using COMSOL multiphysics or any other software, I am already design a PCF with COMSOL.
First, you need to make sure that you have access to the AC/DC module in Comsol. Next, you'll have to use the Magnetic Fields (mf) interface.
A simple permanent magnet could be your magnetic field source. You'll need to generate its CAD (geometry, 2D or 3D, depending on your model). Use the remanent flux density as the constitutive relation in the magnetic field (mf) interface and specify the remanent flux density components values. For example, if your photonic crystal fiber is along the 0-x direction you'll have to set Bx = 0 T / By = 1 T for a 2D model, and Bx = 0 T / By = 0 T / Bz = 1 T for a 3D model, in order to generate a perpendicular magnetic field.
Another uniform magnetic field source could also be an electric wire passed by DC current. This is a little bit more difficult to model than the permanent magnet example mentioned above.
Dear Mr Kou, I am also doing some simulation with coupled velocity field and magnetic field. And the way that adding the uniform applied B to the magnetic field boundary condition works pretty good in low Hartmann number. But if the applied B is too large, then the comsol cannot get the right magnetic boundary conditions which is like magnetic insulations on the walls. And it cannot get a solution. Therefore, adding the applied B as the extra term in remanent flux density will be a good idea for large Hartmann number as Dobre said. :)
Dear Mr Dobre, as I mentioned in my previous reply, I used the way you described to add a uniform magnetic field in remanent magnetic flux density option but the issue is after running my module, the magnetic field from my result is not consistent with the value I added in the remanent magnetic flux density. For example, my applied B0 I used is 1T, which is the Br term in the remanent magnetic flux density, but the result after running gives me e-16 T which is way off. I guess the explanation for this inconsistency will be either the Br is not added in the solver which turns out almost zero (e-16 T) in the result, or there should be a coefficient between Br I added in the remanent term with the real value in the solver (in this case for example, the coefficient will be e-16)
If you have any thought about that, please let me know. Any information or comments would be greatly appreciated.
From your previous post I understand that you are trying to solve a multiphysics problem (CFD+magnetostatics). Just in case you didn't, I would suggest you to check out the magnetic drug targeting model that can be found in the Comsol model library. This is a good reference. I attached the 3.5a version to this post.
I'm afraid there's something wrong with the boundary conditions or the way you couple the CFD and magnetostatics modules. You can try to solve just the magnetostatics problem (isolated from the coupled model) and see if you still get the bad results (1e-6 T magnetic flux density). If you will still get this, it means that the problem lies somewhere in the boundary conditions or the subdomain settings of the magnetic field problem.
Thank you for your swift reply and sorry about my delay. I have already read the magnetic drug module before, actually, I read a lot of modules online and they are pretty helpful. Thank you.
I figured out the reason why I got the magnetic field too low because my magnetic field domain is bounded by the magnetic insulation which is applied automatically on the domain boundary. To fix up this issue, I build another big sphere outside my fluid domain where I force the magnetic insulation on the boundary of the sphere and it turns out to be pretty good. The only issue will be the non-uniform magnetic field in my result. The reason I think will be if we use the option of "remanent magnetic flux density" to apply our magnetic field, then the comsol will simply change the fluid domain as a permanent magnet (as least shown from my result). I guess it is also why the comsol called it "remanent" stands for permanent magnet.
Therefore, I tried to use another way to add the uniform magnetic field. The way that add the magnetic field on the boundary works but then the magnetic insulation condition will be overridden because both of them will work on the boundaries. I am still working on how to fix this problem but my results are kind of close to the analytic solution.
Anyways, Thank you very much for your time and reply. I will let you know when I fix it up. If you have any comments or suggestions, please please let me know.
1. If you are using a sphere to close your magnetostatics problem, you should choose an as big as your computational power allows you sphere. This way you'll reduce the constraints that act upon the magnetic field spectrum and minimize the numerical result errors.
2. You can also use infinite elements in your approach and compare the results. There are several models out there that can be used as good examples.
3. It is still not clear to me how you couple the magnetostatics and the CFD problems. I think that the right way to do it is like in the magnetic drug therapy model. First you solve the magnetostatics problem and you evaluate the magnetic field. Then, in the CFD problem you will use the magnetic flux density gradient (which gives you the external magnetic force that acts upon your magnetizable fluid) in the Navier-Stokes equation. This way you are solving a magnetohydrodynamics problem.
Do you use the same computational domain for both the magnetostatics and the CFD problems (the same geometry is, first, used as a permanent magnet, then, the same geometry plays the fluid domain)?
I figured it out about how to set my uniform magnetic field by simply adding adding an extra volume current which comes from my uniform magnetic field and then solve the induced magnetic field physics alone.
By doing this, I get the induced magnetic field flux density (Bx = fn(y,z) which is exactly what i expected but my flux density gradient (d(Bx,z)) is equal to zero. It doesn't make any sense to me since my Bx changes in y and z, it shows me in plot but the gradient is zero in the picture along with this reply.
The contour in that picture is my Bx but my d(Bx,z) are all equal to zero, shown as the green surface.
I get it, the expression of getting the gradient of magnetic field is not correct in comsol. I need to build a coefficient form of PDE to express the gradB. However, if I want to use this form or value of gradB from PDE to get my lorentz force, how could I do that? simply using the variables from PDE into the volume force for my laminar flow does not work.
Regarding your question "If I want to use this form or value of gradB from PDE to get my lorentz force, how could I do that?". Did you try to solve the PDE that gives you the magnetic flux density gradient (gradB) and the module that solves for the Lorentz force at the same time?
Thank you for your great idea. I will definitely try that but do you think I can directly use the current density from the magnetic field instead of find the gradB since my Lorentz force is simply equal to J cross B right? I have done that but i don't think it give me the results what i want to get.
One more good question Bro. Do you have any experience about how to set up the tricky boundary condition of interface condition in magnetic field? My questions will be since my flow is bounded by four conducting walls, then I need to be careful about setting the condition on the interface of fluid and the wall. I got a similar idea from the comsol module, the submarine one -- the submarine is bounded by a whole metal hull which different permeability with water. In that model, there is actually no such a metal hull in the geometry, instead, the magnetic shielding boundary condition is applied where the permeability and the thickness of the hull has been defined or set up. I guess I could also use the similar method to deal with my wall and fluid right? or maybe not. But I try to find more information about setting the boundary condition on the modeling guide, and I failed there.