I have a model with hundreds of magnets (all the same exact shape and size) that are placed around a sphere, so the magnetization is different for each magnet. I'll be using the MagenetoDynamics solver so can someone suggest a way to setup magnetization settings for the body force in the SIF file? The best I can come up with is to calculate the normal vector of each magnet from the model and dump those vectors to a file (vectors.dat). Then use vectors.dat as input to a python program which creates a Body Force section for each magnet (using one vector from vectors.dat), and it's corresponding Body section associating the correct body with the appropriate body force. Is there an easier way to do this?
Thanks for any help!
Code: Select all
pseudo code:
using Model
for each Magnet
calculate normal vector (to surface of sphere)
save body # and vector result to vectors.dat
using vectors.dat
for each line in file
write "Body Force" section where Magnetization 1 = x of vector, Magnetization 2 = y of vector, Magnetization 3 = z of vector
write "Body" section and assign BodyForce from previous step to this body