Non Linear Convergence Question

Numerical methods and mathematical models of Elmer
Post Reply
pmxppl
Posts: 15
Joined: 29 Jun 2021, 13:41
Antispam: Yes

Non Linear Convergence Question

Post by pmxppl »

Hi

We have been observing some convergence behavior for some electric machine models which we do not understand and would like some help with.

We have generally found that with coarse meshes our analyses converge fine but when we go to finer meshes the maximum number of iterations is reached.

I have attached two examples which are very similar. They are the same model and sif file, the only difference is a slight difference in mesh (in this case the mesh with bad convergence has slightly less elements, 8773, compared to the one with good convergence 8813, contrary to our general observation) . "Good Convergence" converges after 9 iterations.

The first few iterations of "Good Convergence" are below. The norm of the first iteration is 286

MAIN: -------------------------------------
MAIN: Time: 1/3: 2.500E-03
MAIN: -------------------------------------
MAIN:
ComputeChange: NS (ITER=1) (NRM,RELC): ( 286.15415 2.0000000 ) :: mgdyn2d
ComputeChange: NS (ITER=2) (NRM,RELC): ( 10390.471 1.8927923 ) :: mgdyn2d
ComputeChange: NS (ITER=3) (NRM,RELC): ( 3990.2400 0.89011328 ) :: mgdyn2d
ComputeChange: NS (ITER=4) (NRM,RELC): ( 3670.9340 0.83356917E-01 ) :: mgdyn2d

"Bad Convergence" reaches the maximum number of iterations of 50.

The first few iterations of "Bad Convergence" are as below. We notice that the norm on the first iteration is a very high value.

MAIN: -------------------------------------
MAIN: Time: 1/3: 2.500E-03
MAIN: -------------------------------------
MAIN:
ComputeChange: NS (ITER=1) (NRM,RELC): ( 0.88329967E+09 2.0000000 ) :: mgdyn2d
ComputeChange: NS (ITER=2) (NRM,RELC): ( 90784692. 1.6271999 ) :: mgdyn2d
ComputeChange: NS (ITER=3) (NRM,RELC): ( 42805029. 0.71831369 ) :: mgdyn2d
ComputeChange: NS (ITER=4) (NRM,RELC): ( 0.15274347E+09 1.1244110 ) :: mgdyn2d

Could you please help us to understand this different behavior between these models.

How does Elmer obtain the permeability of the elements using the non linear BH curve for the first iteration? This seems to be different for the two examples?

Thanks and Best Regards,

Paul
Attachments
Good Convergence.zip
(156.32 KiB) Downloaded 67 times
Bad Convergence.zip
(154.91 KiB) Downloaded 58 times
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Non Linear Convergence Question

Post by raback »

Hi

Just looked quickly on the one sif so these are just possibilities. The mortar BCs are not by default additive, I think, you could test "Mortar BCs Additive = True". The "Conforming BC" for the symmetric sides could be more robust in terms of convergence.

The most suspicious thing is use of p:2 elements. It has been shown that the mortar BCs are optimal for for the linear elements, and we have also done some testing for p:2 elements and mortars and there is basically no reason why it would not work, but the combination has perhaps not been rigorously checked. When you have N features there are N^2 binary combinations. It could be some rare problem of p:2 and mortars.

Do you have good convergence if additive BCs + linear basis? With just additive BCs?

-Peter
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Non Linear Convergence Question

Post by kevinarden »

I ran them both and they both converged to the same answer. Although the 'bad' one took a rather long path.

Another factor that can influence the convergence of iterative solvers is the quality of the elements. Poorly shaped elements with high aspect ratios can lead to poor iterative solver convergence. It is possible a finer mesh has a few distorted elements, especially if there is a transition from a finer area to a more coarse area.
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Non Linear Convergence Question

Post by kevinarden »

I converted to gsh and plotted statistics, the 'good' problem does have better element quality numbers than the 'bad' problem
pmxppl
Posts: 15
Joined: 29 Jun 2021, 13:41
Antispam: Yes

Re: Non Linear Convergence Question

Post by pmxppl »

Hi Peter and Kevin,

Thank you very much for your quick replies.

Peter - I tried "Mortar BCs Additive = True" and it seemed to work in terms of the convergence for both linear and p:2 elements.

I am finding however that the field result for the first timestep has regions which are not as smooth as they should be. This is most clearly seen in the flux density but can also be seen in directly in the magnetic potential. I have added pictures of the flux density on rotor in the first and last timestep to show what I mean. The last timestep is after an electrical period and should have the same results as the first. All timesteps tend to be smooth except the first.

I have seen the same behavior with many models, with both linear or p:2 elements. Also with both transient and steady state solutions.

Do you have any suggestions as to what may be causing this?

I have also attached the solver log file for this case. We notice that there are a few warnings e.g.

WARNING:: LevelProjector: Projector % InvPerm not set in for dofs: 364
WARNING:: CRS_AddToMatrixElement: Matrix element is to be added to a nonexistent position
WARNING:: CRS_AddToMatrixElement: Row: 4514 Col: 11892
WARNING:: CRS_AddToMatrixElement: Number of Matrix rows:11892
WARNING:: CRS_AddToMatrixElement: Converting CRS to list

Are these anything to be concerned about/consider? I think the level projector warning is not occurring when we use linear elements. These warnings occur in timesteps where the results are fine as well as the first.

Thanks and Best Regards,

Paul
Attachments
Solver.log
(6.29 KiB) Downloaded 54 times
Rotor First Timestep.PNG
Rotor First Timestep.PNG (134.74 KiB) Viewed 852 times
Rotor Last Timestep.PNG
Rotor Last Timestep.PNG (100.78 KiB) Viewed 852 times
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Non Linear Convergence Question

Post by raback »

Hi,

Do you get similar nonphysical regions on 1st timestep also with iterative solvers? Sometimes problems with challenging constraints enforce a nonphysical solution with direct solvers whereas this might not be seen on iterative ones (but difficulty of convergence could be).

Are you certain that the nonlinear system was solved to sufficient accuracy? Enough nonlinear iterations etc.

As said the combination of p:2 and mortar elements has not been rigorously tested for electrical machines. The warnings may suggest that there is an issue how the constraints related to the p:2 quadratic term (associated with edge) are included in the global matrix. The mortar projector only includes rows associated to the dofs to be constrained. When these are combined with standard linear system of fem (and possibly matrix coming from electrical circuits) we need to know the association of the mortar rows to the fem matrix. The Warning seems to suggest that the constraints related to the quadratic terms might not be properly included. Or at least they come as a surprice since the system is moved from CRS to List matrix and back to CRS. This CRS matrix assumes that all entries are created in advance whereas the list matrix allows any entry to be created on-the-fly. This is at least expensive since the matrix is very large. So yes, there may be a reason to be concerned.

-Peter
Post Reply