Mortar BC with Whitney Solver

General discussion about Elmer
Post Reply
fjimenez
Posts: 38
Joined: 27 Sep 2021, 23:40
Antispam: Yes

Mortar BC with Whitney Solver

Post by fjimenez »

Hi,

I am trying to implement a model with mortar BC in 3D with the Whitney solver and I am not sure how to proceed. Figure shows results from a simple test case in which I show a comparison between a 3D and a 2D case. On the right you can see a slice of the 3D model, on the left the 2D results are shown. For each case, I created two separate meshes (top and bottom) and stitch them together with ElmerGrid using the -unite flag. If you look in detail, you can see the mesh interface in the figure. I am not sure what type of projection I should use in the 3D case. Clearly the magnetic field in the 3D case is not properly mapped between both meshes. Please refer to the .sif file for the projection types that I've tried. I've also attached both meshes (cery coarse given size limitations of the forum).
image1.png
image1.png (46.33 KiB) Viewed 191 times
Cheers,

Francisco
test_case.tgz
(503.62 KiB) Downloaded 12 times
kevinarden
Posts: 1603
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Mortar BC with Whitney Solver

Post by kevinarden »

For the 3D I turned of the Edge Basis, did not test to see if this mattered

However
! Edge Basis = Logical True
Apply Mortar BCs = True

when I added Apply Mortar BCs = True to Solver 2 I got results across the mortar

Apparently you have to do this to both solvers

I used the normal projector
fjimenez
Posts: 38
Joined: 27 Sep 2021, 23:40
Antispam: Yes

Re: Mortar BC with Whitney Solver

Post by fjimenez »

Thanks for taking a look at the case. I did as suggested (deactivate Edge basis, add Apply Mortar BCs to solver 2, and use normal project) but I am still getting a similar response. I am using a relatively new commit (Nov 11) for this test. I haven't tried with previous versions though.
image1.png
image1.png (35.69 KiB) Viewed 162 times
Cheers,
kevinarden
Posts: 1603
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Mortar BC with Whitney Solver

Post by kevinarden »

Can you post your updated SIF file?
fjimenez
Posts: 38
Joined: 27 Sep 2021, 23:40
Antispam: Yes

Re: Mortar BC with Whitney Solver

Post by fjimenez »

Sure.
magnet_3d.sif
(3.65 KiB) Downloaded 14 times
kevinarden
Posts: 1603
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Mortar BC with Whitney Solver

Post by kevinarden »

When it worked yesterday it was with the variable magnetic field strength, not magnetic field strength e. Yesterday I did not check magnetic field strength e. In your new sif you only get magnetic field strength e. The first is nodal data and the second is elemental data. Not sure why it works with nodal data and not elemental data.
Rich_B
Posts: 237
Joined: 24 Aug 2009, 20:18

Re: Mortar BC with Whitney Solver

Post by Rich_B »

Maybe the nodal data on a coarse mesh looks like it crossed the boundary, but really didn't?

Rich.
field-strength.png
field-strength.png (330.65 KiB) Viewed 148 times
field-strength-e.png
field-strength-e.png (324.39 KiB) Viewed 148 times
fjimenez
Posts: 38
Joined: 27 Sep 2021, 23:40
Antispam: Yes

Re: Mortar BC with Whitney Solver

Post by fjimenez »

Yes, I think that the post processing step allows for the nodal values to leak into the bottom air body. Here is another way to see the results (plotting Magnetic flux Density e using the Discontinuous Bodies flag). You can see that the bottom surface of body 1 (top, air, right plot) is several order of magnitude larger than the bottom surface of body 2 (bottom, air, left figure). These two should be the same if the mortar bc were working, so I suspect something is not quite working well. Hopefully it is only related to the way I set up the case and I just need to add some flags to the sif file.
image2.png
image2.png (34.16 KiB) Viewed 144 times
raback
Site Admin
Posts: 4455
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Mortar BC with Whitney Solver

Post by raback »

Hi

We had a look at the case as it was looking bad for the eye.

There is a challenge in convergence. This comes from the coarse mesh and mortar BCs. You could try switching the slave and master pieces for the mortar BC and using the following linear system settings:

Code: Select all

  Linear System Iterative Method = GCR
  Linear System Solver = Iterative
  Linear System GCR Restart = 1000
  Linear System Preconditioning = ilu5
  Linear System Max Iterations = 1000
  Edge Basis = True
This uses ILU5 for the rows associated to the mortar constraint but not for the edge degree of freedoms. It is a little expensive but here we can afford it. I woud think that if master and slave would be better compatible the convergence would be better and of course there would be no need to switch the BCs.

Even after this the continuity looks bad. But this is just a artefact of the very coarse mesh and of the fact the continuity over the interface is not enforced. The "Discontinuous Bodies" only does it within materials and omits the mortar BCs. There are just two element layers separating the magnet and the jump so you cannot expect too smooth solution.

-Peter
Attachments
Jump2.PNG
Magnetic Flux Density on y-axis
(50.31 KiB) Not downloaded yet
fjimenez
Posts: 38
Joined: 27 Sep 2021, 23:40
Antispam: Yes

Re: Mortar BC with Whitney Solver

Post by fjimenez »

Hi Peter,

Thanks for checking the case. Things certainly improved with your settings, even with a coarse mesh (see figure). Left: tet mesh with quad faces on the boundaries, right: hex mesh. Continuity is greatly improved, I suspect things will get better with a denser mesh, I might try that over the weekend.
I have a much complex case in mind so I might as well try that. However, I set up a quick case with a denser mesh and I had this error with ilu5 preconditioner. Any tips as to how to avoid this error? iluX with X lower than 5 possibly?

Code: Select all

 
ERROR:: CRS_IncompleteLU: Number of nonzeros larger than HUGE(Integer)
ERROR:: CRS_IncompleteLU: Try some cheaper preconditioner!
res2.png
res2.png (51.86 KiB) Viewed 70 times
Cheers,
Post Reply