`Save Boundaries Only` with MagnetoDynamics

Numerical methods and mathematical models of Elmer
Post Reply
tpgillam
Posts: 14
Joined: 06 Dec 2022, 13:35
Antispam: Yes

`Save Boundaries Only` with MagnetoDynamics

Post by tpgillam »

I am solving a (3D) magnetostatics problem on an unstructured mesh, chaining together `WhitneyAV`, `MagnetoDynamicsCalcFields` and `ResultOutputSolver` in a fairly standard way. This example is conceptually close to my "real" problem: https://github.com/ElmerCSC/elmer-elmag ... rentFixing

This example runs as-is. But if I make the following change to this example, Elmer runs to completion, but I do not get a VTU file written:

Code: Select all

diff --git a/SolenoidCurrentFixing/case.sif b/SolenoidCurrentFixing/case.sif
index 8e3a7e8..6f5b504 100644
--- a/SolenoidCurrentFixing/case.sif
+++ b/SolenoidCurrentFixing/case.sif
@@ -91,6 +91,7 @@ Solver 4
   Show Variables = Logical True
   Discontinuous Bodies = Logical True
   Eigen Analysis = Logical False
+  Save Boundaries Only = Logical True
 End
There are a few physical groups for different boundaries defined in this example (outside of airbox, winding surface, and box surface). So I would expect the VTU to contain only 2D triangle cells which exist on these named boundaries, and the corresponding points & point data. (In contrast to the VTU without this option, which would also contain 3d tetrahedral cells).

Are my expectations incorrect, e.g. am I misunderstanding what "Boundaries" means in the context of this option? Or is something not working as expected?

Thanks!
raback
Site Admin
Posts: 4841
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: `Save Boundaries Only` with MagnetoDynamics

Post by raback »

Hi

It seems that the flags "Discontinuous Bodies" + "Save Boundaries Only" are incompatible. Probably not done used much together. If the fields are discontinous then the value on the boundary is not uniquely defined. Which side to take? Then it may actually be better to use flag "Save Bulk Only" since then the boundaries don't mess with the values. "Discontinuous Bodies" + "Vtu Part Collection" is often handy.

See attached figure where solid is used for the solid parts, and glyphs for the air:
MagneticFieldStrength_e.png
(794.99 KiB) Not downloaded yet
I am hesitant to try to fix this as the combination of these two would require a choice which values to follow on the boundary. Probably it would be better to have it throw an error. This is of course not good, that it does nothing sensible.

-Peter
tpgillam
Posts: 14
Joined: 06 Dec 2022, 13:35
Antispam: Yes

Re: `Save Boundaries Only` with MagnetoDynamics

Post by tpgillam »

Thank you very much for the thoughts & info -- it's most helpful.
would require a choice which values to follow on the boundary
This is indeed a problem that I've had in this project. I had wondered if I could control the "side" of the boundary through normal orientation, but after some contortions in gmsh it seems that the mesh normal isn't used for this purpose.
Then it may actually be better to use flag "Save Bulk Only"
"Discontinuous Bodies" + "Vtu Part Collection" is often handy.
These are helpful ideas, thank you. I'm exprimenting with this route now.

What is the most correct/self-consistent way to compute the surface magnetic fields in this case? Should I e.g. find every tetrahedral cell that has an exterior face, and then use the elemental `magnetic flux density e` values from the points on that triangle? Or would it be better to use the nodal fields `magnetic flux density` in this way?
Post Reply