Non-linear demagnetization curve input for magnet material

General discussion about Elmer
Post Reply
szlyc0706
Posts: 11
Joined: 04 Jan 2024, 15:33
Antispam: Yes

Non-linear demagnetization curve input for magnet material

Post by szlyc0706 »

Hi,

I am trying to use Elmer to calculate demagnetisation behaviour of a magnet, in order to do so I need to input a demagnetisation curve (where its knee point is at B>0 and H are negative values). I changed the PM material section according to this post :https://www.elmerfem.org/forum/viewtopic.php?t=7042
Specifically these few lines:

Code: Select all

Material 2
  Name = "N52"
  Relative Permeability = 1.05
  Magnetization 1 = 956180
  Electric Conductivity = 0.667
  H-B Curve = Variable "nonlin"
    include HB_N52
  End
End
So my PM material input is

Code: Select all

Material 4
 Name = "PM"
Relative Permeability = 1.05
 Electric Conductivity = 0
 Magnetization 1 = 0
 Magnetization 2 =519435

 H-B Curve = Variable "nonlin"
 Real Monotone Cubic

0.000843  -519435
0.056154  -516384
0.092699  -515317
0.131122  -512802
0.169682  -511050
0.201866  -508916
0.233615  -506782
0.26288  -504542
0.293817  -501448
0.33042  -498247
0.362566  -493980
0.392992  -489179
0.421125  -483312
0.450756  -475310
0.478149  -465175
0.5016  -453973
0.521266  -442238
0.538269  -430503
0.554577  -418767
0.571002  -407032
0.58731  -395297
0.60304  -383561
0.618886  -371826
0.633342  -360091
0.649535  -348355
0.665265  -336620
0.680763  -324885
0.694873  -313149
0.710834  -301414
0.727258  -289679
0.742525  -277943
0.757445  -266208
0.773753  -254473
0.78902  -242737
0.804287  -231002
0.818744  -219267
0.834705  -207531
0.84974  -195796
0.865818  -184061
0.881663  -172326
0.89774  -160590
0.912313  -148855
0.928968  -137120
0.944814  -125384
0.960312  -113649
0.974653  -101914
0.989689  -90178.3
1.00484  -78442.9
1.021727  -66707.6
1.035605  -54972.3
1.051219  -43237
1.066717  -31501.6
1.081405  -19766.3
1.097019  -8030.99
1.108842  -557.999

End
End
However the Elmer result is not sensible(as shown in the first image below) and it is different from Ansys Maxwell's result (as shownin the second image below)
Image
Image

By changing the PM material code in the .sif file I also find that:
1. Elmer simulation doesn't want to converge when my input of Magnetization is Smaller than the Hc of the BH data (For example Magnetization 2 = 700000 and this Hc = -519435 ).
2. Changing the Relative Permeability value doesn't impact the result. Even if I delete the complete line of Relative Permeability.
3. Both of changing magnitude of BH curve and Magnetization 1 or 2 can vary the simulation result.

So my question is , what is the correct input when I have a non-linear demagnetisation curve for magnet material?

Kind regards,
Eric
szlyc0706
Posts: 11
Joined: 04 Jan 2024, 15:33
Antispam: Yes

Re: Non-linear demagnetization curve input for magnet material

Post by szlyc0706 »

Thanks very much for your reply Kevinarden,

Now I am having a problem about compiling the .f90 file into .dll. Accroading to your reply of a post 15 years ago, there are two ways of doing this:
1:I clicked on Run -> compiler -> select the .f90 file, the following message is shown in the compiler log:
"The system cannot find the path specified.
Ready"
2: I used the commend window, here is what it shows:
"C:\Dev\ElmerFEM-gui-nompi-Windows-AMD64\bin>elmerf90 GetWorkingPoint.f90 -o GetWorkingPoint.dll
"/stripped_gfortran/bin/x86_64-w64-mingw32-gfortran.exe" GetWorkingPoint.f90 -o GetWorkingPoint.dll -fallow-argument-mismatch -DCONTIG= -DMINGW32 -DWIN32 -DHAVE_EXECUTECOMMANDLINE -DUSE_ISO_C_BINDINGS -DUSE_ARPACK -O3 -DNDEBUG -O3 -shared -I"/share/elmersolver/include" -L"/bin" -shared -lelmersolver
The system cannot find the path specified."

Do you have any idea for solving this?
kevinarden
Posts: 2315
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Non-linear demagnetization curve input for magnet material

Post by kevinarden »

does not sound like the paths are set

f you use the zip files vice the exe to install, then you must manually set the environment variables. Search for “path” in your Windows system and choose “Edit environment variables for your account” and set “Variable” to “Value” as follows:

ELMER_HOME = c:\ElmerFEM-gui-nompi-Windows-AMD64
ELMERGUI_HOME = %ELMER_HOME%\share\ElmerGUI
ELMER_LIB = %ELMER_HOME%\share\elmersolver\lib
PATH = %PATH%;%ELMER_HOME%\bin;%ELMER_HOME%\lib
szlyc0706
Posts: 11
Joined: 04 Jan 2024, 15:33
Antispam: Yes

Re: Non-linear demagnetization curve input for magnet material

Post by szlyc0706 »

Thanks very much!!!! now my .dll file is successfully generated.
But now i am facing another problem. Do you know where do I store it so it can be recognized by Elmer? because when I try to call this function in my .sif file it says:
Loading user function library: [GetWorkingPoint]...[GetWorkingPoint]
Can not find GetWorkingPoint.
Can not find GetWorkingPoint.dll.
Can not find .\GetWorkingPoint.
Can not find .\GetWorkingPoint.dll.
Can not find C:\Program Files\Elmer 9.0-Release\bin\..\share\elmersolver\lib\GetWorkingPoint.
Can not find C:\Program Files\Elmer 9.0-Release\bin\..\share\elmersolver\lib\GetWorkingPoint.dll.
kevinarden
Posts: 2315
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Non-linear demagnetization curve input for magnet material

Post by kevinarden »

It searches in the present working directory where ElmerSolver was started and it searches for two names, that is what these lines are

Can not find GetWorkingPoint.
Can not find GetWorkingPoint.dll.
Can not find .\GetWorkingPoint.
Can not find .\GetWorkingPoint.dll.

it then searches in the library

Can not find C:\Program Files\Elmer 9.0-Release\bin\..\share\elmersolver\lib\GetWorkingPoint.
Can not find C:\Program Files\Elmer 9.0-Release\bin\..\share\elmersolver\lib\GetWorkingPoint.dll.

You can fully qualify the name in the call
Real Procedure "initrho" "c:\mydirectory\libraries\initrho.dll"
szlyc0706
Posts: 11
Joined: 04 Jan 2024, 15:33
Antispam: Yes

Re: Non-linear demagnetization curve input for magnet material

Post by szlyc0706 »

Thanks very much for your help! working now
Post Reply