Magnetics-Permanent Magnetic Circuit with Air Gap

  • Last Post 3 weeks ago posted this 15 August 2017

In this tutorial, the magnetic flux density will be calculated. See the attached file for the tutorial of this problem.

Attached Files

Order By: Standard | Newest | Votes
sageblade posted this 08 February 2018

I am trying to model the pull force of a permanent magnet on a steel plate. It seems like a very simple problem but I can't seem to figure out how to do it (I tried to go through this tutorial and make edits to suit my particular problem but it did not give me any results). Could you offer some advice? 

Les-O-Lee posted this 3 weeks ago


                The statement “it did not give me any results” is not an adequate fault report. Anybody who wanted to help you would first have to ask loads of boring questions to extract the facts. But if you appear as if you are not willing to put in any effort yourself, then that puts all the work down to this helpful third party.

The sort of things that would be useful are: any error messages, any screen shots, at what point did your setup diverge from the tutorial instructions?

 Sadly, I myself am unable to be of any assistance since I am training to be a n00b. I installed AIM 19.0 three times before giving up and reverting to 18.2. Even then, although the help then worked correctly and the dimensioning also worked correctly, I still get the same error as on 19.0, namely

‘DataContainerReference’ object has no attribute ‘GetGeneralPhysicsOptions’

on the magnetic simulation. (I did manage to get a stress analysis simulation to work correctly.)

I think a lot of the problem is that these newer CAD systems are bolted together with loads of third party software like Python. You need to be really good to fix these installation/linkage types of problems, and unless you are a paying customer that sort of in-depth fault finding is likely to be patchy at best.

  • Liked by
  • peteroznewman
Les-O-Lee posted this 3 weeks ago

Ok ANSYS, it’s time to put your hands up and admit that Magnetic/Electromagnetic modelling does not work in AIM 18.2 (or 19.0 for that matter). This will stop people wasting their time trying to work out why it doesn’t work on their system, but apparently does work because there is a tutorial to prove it.

 Let’s look at the evidence.

 Create a geometry then add some Physics.

You can't add a magnetic or electromagnetics Physics region because there is no such option.

Ok then, let’s do it like the tutorial and use the template, then look at the Physics options.



  • Liked by
  • peteroznewman
Les-O-Lee posted this 3 weeks ago

(continued from the post above. This site is playing silly beggars.)

So you can now select Electromagnetic physics, except that is not a valid thing to do ... at all.

But, I hear you say, it must work because of the tutorial. Ok, fair point. Let's look at that in more detail then.

Did you notice that the tutorial was “Created using ANSYS AIM 18.1.” Then by the fourth page it tells you to load 18.2. Hmm.
Then in the contents on the first page there is a title for Mesh. That’s interesting because there is no such section in the actual document. But how can a full field simulation run without a mesh? So we go straight from geometry to Physics without a Mesh, as seen on page 7 of the tutorial. No wonder the Physics complains!

How can this have happened? I have a tentative theory. This subject was titled Magnetics: Physics. But in 19.0 it is Electromagnetics. I think that between 18.1 and 18.2 they half changed it from Magnetics to Electromagnetics and broke the internal linkages. Easy to do, and also fairly easy to fix I would think.

  • Liked by
  • peteroznewman
Les-O-Lee posted this 3 weeks ago

(continued again)

You can also note that if you try to add a Mesh after the geometry it doesn’t understand Magnetics or Electromagnetics as a valid reason for having a mesh.

 I claim that the tutorial is bogus in as much as it was started on 18.1 and edited to 18.2 without ever having tried it from start to finish on 18.2

 I am happy to delete my assertion if just one person can honestly claim to have run this tutorial from start to finish in 18.2

 I really want this simulation to work, and I have put a lot of effort into getting this far. I don’t imagine the 18.1 version is still in its licence period given that 18.2 runs out in 6 months. I look forward to 19.1 where hopefully they can fix this problem, and the help problem, and the Space Claim dimensioning problem.

  • Liked by
  • peteroznewman
Les-O-Lee posted this 3 weeks ago

So my next theory and plan is this: Given that the Aim 18.2 user interface to the Magnetic simulations is clearly broken, can we bypass the user interface using the built in scripting?

The first step is to put the automatically created journal in an easily accessible place (or you could just create a short-cut to it).

Top left file menu icon: Tools > Options … then Journals and Logs

Then we start the workbench, create a Magnetics project using a geometry import, and see what the journal looks like (I prefer Notepad++ for this viewing).

Then we close the workbench and try again with an Electric Conduction simulation, as this uses a mesh.

Again we close the workbench and now we have two journals to compare.

Now this journal is not a Python script as that would end in a .py file extension. And in fact the scripting is done in IronPython (which I only heard of yesterday). It seems to be Python with .NET functionality, so why it wasn’t called Python.NET is unclear.

Looking at the journal files, the # at the beginning of a line is a comment. A colon is a tag for a functional block and the indenting is crucial to define where this block ends (since there are no braces or semi-colons).

I merged the two journal files to electromagnetics and a mesh.

    meshing1.EngineeringIntent = 2

In the meshing dialog box you have two options: “structural, thermal or electric conduction” or “Fluid flow or fluid-solid heat transfer”. In the script the string may not be exactly what I typed above. But IronPython is not a strongly typed language so you can give it a string or an int. Guessing it was an enum I tried 0, 1, 2, and 3 for the engineering intent. 0 is not accepted. 1 and 2 give the equivalents of the string types mentioned above, and 3 is not accepted. Apparently magnetics or electromagnetics is an unlisted intent. I can’t find any header source files to see if “Magnetics” is some larger value like 123, which would be very boring to try to test!

 (The merged script file is script2.wbjn but this site doesn't like .wbjn as an extension so I had to change it to txt )

Attached Files

Les-O-Lee posted this 3 weeks ago

The next area of attack was the script line:

    physicsRegion1.PhysicsType = "Electromagnetics"

Again I tried different ints on the right hand side, running the script, seeing what happened, then closing the workbench and trying again. Only after I had done most of the testing did I wonder what the Reset() command in the script did. So I opened the scripting command window

File > Scripting > Open command window

And enter the Reset () command. Sure enough it reset the workbench environment. A few goes like that and I again realised that all I actually needed to do was to just run the next script variant as the script itself already contains a Reset().

From direct experimentation it seems that the PhysicsType in question is really split into bit fields. With the least significant bit as B0 we have

B0 = ?
B1 = structural
B2 = ?
B3 = electrical conduction
B4 = fluid
B5 = thermal
B6 = ?
B7 = ?
B8 = polymer extrusion
B9 = electromagnetics

You can enter 512 for the PhysicsType and get electromagnetics, and you can use 520 to get electromagnetics and electric conduction. Neither is valid however :-(

The strings “Magnetic”, “Magnetics”, and “Electromagnetic” as PhysicsTypes are not recognised.


This is what apparently constitutes HELP on the subject of PhysicsTypes ...