Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Calculating Magnetic Flux in COMSOL

Please login with a confirmed email address before reporting spam

Hello,

Is there a way to calculate magnetic flux through a surface in COMSOL? I suspect calculating magnetic flux involves either "Subdomain Integration" or "Boundary Integration" under the Postprocessing tab, but I was unable to figure how to do this.

I have attached my COMSOL model. I am using 2D geometry space because is the magnet's height is much much greater than the width. The magnetic field plots agree very well with my analytic magnetic field calculations.

I am trying to test my analytic magnetic flux calculations. To test, I would like to integrate the magnetic flux density over a partial ring inside the magnet. For example in my COMSOL model, I would like to integrate over the curved surface part of the object CO1 I added. Can anyone tell me how I can do this?

Thank you,
Kevin


6 Replies Last Post 2013年8月20日 GMT-4 06:33

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2010年10月8日 GMT-4 04:09
Kevin,

go to Postprocessing -> Boundary Integration and select the boundary you want to integrate across. For the magnetic flux density components enter the expression Bx_emqa (or By_emqa) and apply. This gives you a result in Wb/m. Multiply with the length of your magnet (along z-axis) and you have the integral of the component.

Use the expression sqrt(Bx_emqa^2 + By_emqa^2) for the total flux.

Best regards
Edgar



Kevin, go to Postprocessing -> Boundary Integration and select the boundary you want to integrate across. For the magnetic flux density components enter the expression Bx_emqa (or By_emqa) and apply. This gives you a result in Wb/m. Multiply with the length of your magnet (along z-axis) and you have the integral of the component. Use the expression sqrt(Bx_emqa^2 + By_emqa^2) for the total flux. Best regards Edgar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2010年10月8日 GMT-4 04:40
Hi

you can also do a 1d plot of the flux density over the line.
I tried to refine the mesh and got a plot like the one shown on the attached jpg.
guess your first mesh was a bit too rough around the line 63.
Nicely arrangement of the magnets by the way, it looks cool with the formulas ;)
Hi you can also do a 1d plot of the flux density over the line. I tried to refine the mesh and got a plot like the one shown on the attached jpg. guess your first mesh was a bit too rough around the line 63. Nicely arrangement of the magnets by the way, it looks cool with the formulas ;)


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2010年10月8日 GMT-4 08:55
Edgar,

Thanks for your response. It makes sense to me that the COMSOL answer I get will be in terms of Wb/m and I will have to multiply by the height of the object to get the flux in Wb.

However I do have one concern. The flux through a surface is computed by taking the dot product of the magnetic flux density vector and differential surface vector (and then integrating over the surface).

In this case, with the curved surface I'm integrating over, the surface normal points only in the radial direction. Therefore only the radial component of the magnetic flux density contributes to the flux. (The azimuthal component of the magnetic flux density does not contribute anything.)

The question I am asking then is when calculating the flux, does COMSOL 'know' that only the radial component of the magnetic flux density contributes to the flux (given the surface I am integrating over)?

For instance sqrt(Bx_emqa^2 + By_emqa^2) gives me the magnitude of the magnetic flux density. Expressed in terms of cylindrical coordinates, some of this magnetic flux is directed in the radial direction and some is directed in the azimuthal direction. When I enter sqrt(Bx_emqa^2 + By_emqa^2) as my expression under Boundary Integration, does COMSOL 'know' to only integrate the radial component of the total flux density (since the azimuthal component contributes nothing to the flux given my surface)?

Or is it necessary for me to only enter the radial component of the magnetic flux density as my expression under Boundary Integration?

Thank you,
Kevin
Edgar, Thanks for your response. It makes sense to me that the COMSOL answer I get will be in terms of Wb/m and I will have to multiply by the height of the object to get the flux in Wb. However I do have one concern. The flux through a surface is computed by taking the dot product of the magnetic flux density vector and differential surface vector (and then integrating over the surface). In this case, with the curved surface I'm integrating over, the surface normal points only in the radial direction. Therefore only the radial component of the magnetic flux density contributes to the flux. (The azimuthal component of the magnetic flux density does not contribute anything.) The question I am asking then is when calculating the flux, does COMSOL 'know' that only the radial component of the magnetic flux density contributes to the flux (given the surface I am integrating over)? For instance sqrt(Bx_emqa^2 + By_emqa^2) gives me the magnitude of the magnetic flux density. Expressed in terms of cylindrical coordinates, some of this magnetic flux is directed in the radial direction and some is directed in the azimuthal direction. When I enter sqrt(Bx_emqa^2 + By_emqa^2) as my expression under Boundary Integration, does COMSOL 'know' to only integrate the radial component of the total flux density (since the azimuthal component contributes nothing to the flux given my surface)? Or is it necessary for me to only enter the radial component of the magnetic flux density as my expression under Boundary Integration? Thank you, Kevin

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2010年10月8日 GMT-4 09:25
Kevin,

I think your last sentence is correct. You must use the expression for the radial component in your case. COMSOL just simply integrates the quantity that results from your expression.
It doesn't know what the physical context is. This is actually an advantage because it gives you full control about what you want to do.

Best regards
Edgar
Kevin, I think your last sentence is correct. You must use the expression for the radial component in your case. COMSOL just simply integrates the quantity that results from your expression. It doesn't know what the physical context is. This is actually an advantage because it gives you full control about what you want to do. Best regards Edgar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年6月30日 GMT-4 20:57
I am trying to do the same calculation Kevin mentions, an integration of the magnetic flux density through a surface.

Presently I have a cylindrical volume aligned with the z axis in a 3D model. Consequently, it is easy to integrate the component of magnetic flux (B field) in the direction normal to the end of the cylinder: it is simply the surface integral of emqav.Bz

But in any other case, when the cylinder is no longer parallel with the z-axis, I would need something similar to what Kevin is looking for. That is an expression for the normal to the surface of integration.

I see in the documentation (p92 in the 4.0a user man) that there are the normal vectors, nx, ny, nz. For interior boundaries, there are up and down possible directions for the normals, so both are provided (unx, dnx, etc.)

(presumably one of unx or dnx will be the same as nx ??)


But here is a further problem... What if I want to integrate the flux over a volume (the whole cylinder), but continue to take only the component that is normal to the end of the cylinder ?? That is, dot the B field there with the normal of one of the end surfaces. Can I use the normals from some particular surface in my expression for the volume integral?

Thanks for any tips
I am trying to do the same calculation Kevin mentions, an integration of the magnetic flux density through a surface. Presently I have a cylindrical volume aligned with the z axis in a 3D model. Consequently, it is easy to integrate the component of magnetic flux (B field) in the direction normal to the end of the cylinder: it is simply the surface integral of emqav.Bz But in any other case, when the cylinder is no longer parallel with the z-axis, I would need something similar to what Kevin is looking for. That is an expression for the normal to the surface of integration. I see in the documentation (p92 in the 4.0a user man) that there are the normal vectors, nx, ny, nz. For interior boundaries, there are up and down possible directions for the normals, so both are provided (unx, dnx, etc.) (presumably one of unx or dnx will be the same as nx ??) But here is a further problem... What if I want to integrate the flux over a volume (the whole cylinder), but continue to take only the component that is normal to the end of the cylinder ?? That is, dot the B field there with the normal of one of the end surfaces. Can I use the normals from some particular surface in my expression for the volume integral? Thanks for any tips

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2013年8月20日 GMT-4 06:33
Edgar and Co.,

I have variable definitions to caculate this flux, however - how would I only refer to the radial component of normB?

regards,
Wesley.
Edgar and Co., I have variable definitions to caculate this flux, however - how would I only refer to the radial component of normB? regards, Wesley.

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.