mumax3, how to engage strain exx for my calculation?

817 views
Skip to first unread message

Nam Hoon Goo

unread,
Jul 27, 2022, 2:45:35 AM7/27/22
to mumax2
In the follwoing script, I tried to apply uniaxial strain parallel to the easy axis. 
I have two questions, 

1. B1 and B2 value I used here for BCC iron, are they correct ? 
   I guess the B1 is likely to be positive rather than negative. 
   The calculated hysteresis with these values, the trends is opposite that I expected. 
   With tensile the magnetization reversal becomes harder, while in compression the reversal becomes easy. 

2. The assignement of C11 , C22  and C44 is not possible with following errors, 

 : undefined: c11s/GO/src/github.com/mumax/3/cmd/mumax3/main.go:110 script line 44: c11 = 286e9

****************************************************************

m.setRegion(1, uniform(1, 0, 0))
m.setRegion(2, uniform(-1, 0, 0))
m.setRegion(3, randomMag())

saveas(m, "m_inital")
run(.1e-9)
saveas(m, "m_final")

B1 = -2.9e6
B2 = 7.1e6

c11 = 286e9
c12 = 147e9
c44 = 99e9
rho = 8e3
eta = 0


esxx := 0.0
esyy := 0.0


Bmax  := 3.5
Bstep :=  1.0e-2
MinimizerStop = 1e-6
TableAdd(B_ext)

exx.setregion(1, esxx)
eyy.setregion(1, esyy)
exx.setregion(2, esxx)
eyy.setregion(2, esyy)

Josh Lauzier

unread,
Jul 27, 2022, 5:13:32 AM7/27/22
to mumax2
Hello,

Are you using the magnetoelastic module, or just regular mumax3? Regular mumax has some magnetoelastic functionality, but it's only an effective field term, and you can set strains like exx and the coupling B1/B2. To set something like C11, which is an entirely elastic parameter, you need the full magnetoelastic module. It can be found here. It does need to be compiled separately.

Offhand, I don't know the B values for BCC iron, but you can just copy them from the literature fairly easily. Those values look pretty close to the values given by Kittel with B1 negative, B2 positive, (from C. Kittel, Rev. Mod. Phys. 21, 541 (1949)), as well as Cullity's textbook. Ni B1 is +6.2e6 , and they should be opposite sign, as well, so that also seems right. I could be misremembering though, so I'd verify it again. 

Often, experimentally the magnetostrictive constant λ is reported instead of the B's. λ _100 is positive for iron and λ _111 negative , but there is a sign switch between B's and λ, keep in mind. For cubic crystals, the relationship is  λ_100=-2/3*((B_1)/(c_11-c_12)) and  λ_111=-1/3*((B_2)/(c_44)).

Cheers,
Josh L.

Nam Hoon Goo

unread,
Jul 27, 2022, 9:46:30 PM7/27/22
to mumax2
Hi Josh, 
I appreciate your kind response. I did not know another full package was available through the other site. In the moment I just tried to set the effective field vector by use of the coupling constant. I uses B1 = - 2.9e6, and B2 = 7.1e6, and they works well. 
I am now developing a representative volume element for micromagnetic simulation of motor core materials. mumax3 is very fast and it is helpful. 
Many thanks again,
Regards, 
NH Goo 

그림1.png




2022년 7월 27일 수요일 오후 6시 13분 32초 UTC+9에 Josh Lauzier님이 작성:

Yamazaki Takahiro

unread,
Sep 21, 2022, 2:39:39 AM9/21/22
to mumax2
Hi Josh and NH Goo,

I am struggling to solve the exx dependence using the magnetoelastic module for a couple of weeks. I've finished installing the ME package and have confirmed that the package itself works fine, but the magnetoelastic calculation does not work. Hopefully, I would like to get the almost same results as NH Goo's above results, but my magnetization curves at each exx didn't have any difference, unfortunately. I am attaching an example of my code. I would appreciate if you could give me some advice on my problem.

Thank you very much,
Takahiro


Nx := 128
Ny := 128
Nz := 2
c := 2e-9
setgridsize(Nx, Ny, Nz)
setcellsize(c, c, c)
setgeom(Cuboid(Nx*c, Ny*c, Nz*c))
 
// Magnetic constants of Fe
Msat = 1.71e6
Aex = 1.5e-11
GammaLL =  2.211e5
alpha = 1 // for high speed calculation
Kc1 = 4.8e4
 
// Magnetoelastic constants of Fe
C11 = 2.86e11
C12 = 1.47e11
C44 = 9.9e10
eta = 1e14 //for high speed calculation
rho = 8e3

B1 = -2.9e6
B2 = 7.1e6
 
// Save the setting of table data
u = uniform(1, 0, 0)
du = uniform(1, 0, 0)
TableAdd(B_ext)
TableAdd(E_total)
TableAdd(E_mel)
SnapshotFormat = "png"
setsolver(9) //for magnetoelastic package
 
// Magnetizing condition
m = randomMag()
relax()

Bmax := 0.3
Bstep := 0.001

// External strain as an order parameter
exx = 0.2 //0.2, 0.1, 0, 0.1, 0.2
 
for B:=0.0; B<=Bmax; B+=Bstep{
    B_ext = vector(B, 0, 0)
    print("B(1st)=",B,"Oe")
    minimize()
    snapshot(m)
    tablesave()
}
for B:=Bmax; B>=-Bmax; B-=Bstep{
    B_ext = vector(B, 0, 0)
    print("B(2nd)=",B,"Oe")
    minimize()
    snapshot(m)
    tablesave()
}
for B:=-Bmax; B<=Bmax; B+=Bstep{
    B_ext = vector(B, 0, 0)
    print("B(3rd)=",B,"Oe")
    minimize()
    snapshot(m)
    tablesave()
}

Josh Lauzier

unread,
Sep 26, 2022, 5:11:41 AM9/26/22
to mumax2
Hello,

Sorry for the slow reply. (Here I will refer to the full magnetoelastic module as "the module", and mumax that has the effective magnetoelastic effective field as "regular mumax") There are a few different things to mention:

1:
As far as I can tell, minimize() and relax() were not updated for the module. I think you have to use run() in order to get the benefits of the module. This is unfortunate for hysteresis problems, since run() is so much slower than relax or minimize, although it can be done if you need to. However, if you just want a hysteresis loop, you might not need the module; I would expect the hysteresis behavior to be mostly the same if you just use the effective field term in normal mumax, if all you care about is the hysteresis behavior.

So when you call minimize/relax, it is reverting back to the purely magnetic solver, with the caveat that the effective term for the magnetoelastic term doesn't work, so there are kind of two problems. As part of the up date to the module, they did change the magnetoelastic energy term (which minimize/relax call upon), so it no longer depends on exx/eyy/ezz directly, but instead references normstrain and u (which doesn't get set properly for minimize/relax since they did not exist). So it both falls back to the old solver, and with a 0 magnetoelastic effective term. So if you want to use the effective field form,  use a binary that is just regular mumax.

2:
That said, you can still set exx and it should work with run(). The syntax you used is correct for regular mumax. For the module, it should also work, as it's listed as a type of excitation in the paper, but I have not tested this very much myself. In my very limited testing, it doesn't seem to lead to the response in u (and normstrain) you would expect, so I would try to verify it is working as you expect. You might need to use FrozenDispVal and FrozenDisploc instead.


3:
You don't need to initialize du (i'm not sure if it hurts anything or if it's just cosmetic. Probably just cosmetic)

4: 
If you want to set a cubic anisotropy, make sure you set Kc2 as well (kc3 gets computed automatically), as well as anisc1 and anisc2 for the directions. Kc1 by itself won't do anything.

5:
For the magnetoelastic module, you need to set a fixdt value, as it does not have adaptive timestepping built in. This can be fairly sensitive, especially as you make the mesh smaller. In the paper, they use a relatively large value of 1e-13, but you may need to shrink this down to 1e-14 or smaller. It depends on things like cell size, exchange strength etc. You want it as large as possible for speed, but care needs to be taken.


Best,
Josh L.

Yamazaki Takahiro

unread,
Sep 27, 2022, 6:13:09 AM9/27/22
to mumax2
Hi Josh,

I really appreciate your polite and detailed explanation. I will try to set 'fixdt', 'kc2' and 'FrozenDispVal'/ 'FrozenDisploc' and do 'run()' , and also try to adjust the proper parameters following your advice. 

Thank you so much,
Takahiro
Reply all
Reply to author
Forward
0 new messages