Ivar KJELBERG
COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
Nov 27, 2009, 5:46 p.m. EST
Hi
first to minimise confusion, I would use either the plot parameters contour Az, or use the streamline but with "plot type" "magnitude controlled", otherwise the streamlines are very assymetric
Then I beleive it's correct, in the sens that you are observing FEM precision limitations, you need a very very fine mesh along the boundary, but even then you cannot avoid quite some gradients change over an element, and you have a "mu" of only 100, with soft iron >2000 it's even worse!.
jsut try to plot the different variables used for the FMx calculations along the same line
The magnetic flux density along X is a nice parabole, with some border artefacts realted directly to the meshing
It is like stress concetration in structural analysis. I would use adaptive meshing, even if the L2 norm used by COMSOL is not very good to "just" increase the mesh at stress concentration (or magnetic boundaries), it add quite some nodes all over.
If you want better explanations, I would suggest to submit the case to Comsol support, if so pls report back its of general interest, there are many dicussions around force calculations and their precision
Good luck
Ivar
Hi
first to minimise confusion, I would use either the plot parameters contour Az, or use the streamline but with "plot type" "magnitude controlled", otherwise the streamlines are very assymetric
Then I beleive it's correct, in the sens that you are observing FEM precision limitations, you need a very very fine mesh along the boundary, but even then you cannot avoid quite some gradients change over an element, and you have a "mu" of only 100, with soft iron >2000 it's even worse!.
jsut try to plot the different variables used for the FMx calculations along the same line
The magnetic flux density along X is a nice parabole, with some border artefacts realted directly to the meshing
It is like stress concetration in structural analysis. I would use adaptive meshing, even if the L2 norm used by COMSOL is not very good to "just" increase the mesh at stress concentration (or magnetic boundaries), it add quite some nodes all over.
If you want better explanations, I would suggest to submit the case to Comsol support, if so pls report back its of general interest, there are many dicussions around force calculations and their precision
Good luck
Ivar
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
Nov 27, 2009, 6:52 p.m. EST
Hi
Thanks for the response. I have actually made the mesh as fine as possible and have even used adaptive mesh refinement but it makes no difference. I have increased the boundary layer mesh as well and it makes no difference.
The example that I have posted should analytically give a 0 force spatially. I have done simple things like d(Hx_emqa,x) and the results give non-zero jumps at the boundaries and non-zero (higher order of magnitude than machine precision) for regions within the cylinder. The jumps at the boundary could be because of surface stress but those should be impulses and should not propagate into the subdomain of interest. Within the subdomain of interest the d(Hx_emqa,x) should be analytically 0 or 10^-15 in COMSOL.
Whats interesting is that COMSOL gives well behaved (or better) answers when it is a one region problem than when it is a two region problem, which means it could be the very nature of FEM.
Nonetheless, the result COMSOL gives is incorrect and it can affect several people trying to do force calculations or any calculation that involves a spatial derivative. I am working on a complicated model that requires calculating the magnetic body force density and inserting that into the navier stokes equation. If COMSOL cannot compute this simple case I dont think I can have confidence in any result it gives for more complicated problems that I work on.
I have submitted it to COMSOL support. I hope they will respond.
Best
Shahriar
Hi
Thanks for the response. I have actually made the mesh as fine as possible and have even used adaptive mesh refinement but it makes no difference. I have increased the boundary layer mesh as well and it makes no difference.
The example that I have posted should analytically give a 0 force spatially. I have done simple things like d(Hx_emqa,x) and the results give non-zero jumps at the boundaries and non-zero (higher order of magnitude than machine precision) for regions within the cylinder. The jumps at the boundary could be because of surface stress but those should be impulses and should not propagate into the subdomain of interest. Within the subdomain of interest the d(Hx_emqa,x) should be analytically 0 or 10^-15 in COMSOL.
Whats interesting is that COMSOL gives well behaved (or better) answers when it is a one region problem than when it is a two region problem, which means it could be the very nature of FEM.
Nonetheless, the result COMSOL gives is incorrect and it can affect several people trying to do force calculations or any calculation that involves a spatial derivative. I am working on a complicated model that requires calculating the magnetic body force density and inserting that into the navier stokes equation. If COMSOL cannot compute this simple case I dont think I can have confidence in any result it gives for more complicated problems that I work on.
I have submitted it to COMSOL support. I hope they will respond.
Best
Shahriar
Ivar KJELBERG
COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
Nov 28, 2009, 2:51 a.m. EST
Hi
Well we will see, but I'm still not 100% convinced that the field should be absolutely flat, and you cannot avoid steps at intefarces, such as step you see around changes of ur or E (stress for structural)
I have notived often that our analytical solutions are already approximations (that we have forgotten about) and that often we see more subtile effects with detailed FEM analysis. In youre case it could well be border effects due to the round surface, perhaps one should try a square central part.
Ivar
Hi
Well we will see, but I'm still not 100% convinced that the field should be absolutely flat, and you cannot avoid steps at intefarces, such as step you see around changes of ur or E (stress for structural)
I have notived often that our analytical solutions are already approximations (that we have forgotten about) and that often we see more subtile effects with detailed FEM analysis. In youre case it could well be border effects due to the round surface, perhaps one should try a square central part.
Ivar
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
Dec 8, 2009, 6:07 p.m. EST
This is the response I got from COMSOL Support
"With numerical modelling, you cannot expect to get zero result at the
limit of machine precision. It is the shape of the mesh elements at the
interface that decide how large the difference is. In this particular case,
you also use a second order derivative in the expression of the body force.
Because you are using second order elements (The Az-field is expressed with
second order polynomials), the second order derivative is a constant and
not very accurate. When you need high accuracy of higher order derivatives,
it is better to increase the element order than refining the mesh.
When I increased the element order to five in your model, the resulting
force was in the order of 1e-7. To decide whether this is a high value or a
low value, you should disturb your model so you get a non-zero force. Then
you compare that value with the "zero" value you get. As an example, I came
across another setup where the "zero" force was in the order of 1e3 N with
a virtual work calculation, which is a quite large force. When disturbing
that model the resulting force was in the order of 1e7 N, and it is this
relative comparison that you should look at.
To increase the shape order, select all domains, and open the subdomain
settings. The go to the element page, and select Lagrange - Quintic."
After changing to Quintic elements, I find that the problem works in the 2D case.
When I move to simulating a 3D problem I get errors. I think its just inherent to the FEM
This is the response I got from COMSOL Support
"With numerical modelling, you cannot expect to get zero result at the
limit of machine precision. It is the shape of the mesh elements at the
interface that decide how large the difference is. In this particular case,
you also use a second order derivative in the expression of the body force.
Because you are using second order elements (The Az-field is expressed with
second order polynomials), the second order derivative is a constant and
not very accurate. When you need high accuracy of higher order derivatives,
it is better to increase the element order than refining the mesh.
When I increased the element order to five in your model, the resulting
force was in the order of 1e-7. To decide whether this is a high value or a
low value, you should disturb your model so you get a non-zero force. Then
you compare that value with the "zero" value you get. As an example, I came
across another setup where the "zero" force was in the order of 1e3 N with
a virtual work calculation, which is a quite large force. When disturbing
that model the resulting force was in the order of 1e7 N, and it is this
relative comparison that you should look at.
To increase the shape order, select all domains, and open the subdomain
settings. The go to the element page, and select Lagrange - Quintic."
After changing to Quintic elements, I find that the problem works in the 2D case.
When I move to simulating a 3D problem I get errors. I think its just inherent to the FEM