Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demag Kernel incorrect when using multiple cells in the Z direction in thin films #348

Open
marcrovi opened this issue Dec 4, 2024 · 1 comment

Comments

@marcrovi
Copy link
Contributor

marcrovi commented Dec 4, 2024

Hello,

I've been trying to simulate multilayered systems and therefore I am setting the geometry and setting regions to different layers and I can only do that by putting multiple cells in the Z direction. The system I am using is the following


CellSize:=5.e-9
NumCells:=512
ZNumCells:= 6
SetGridSize(NumCells, NumCells, ZNumCells)
SetCellSize(CellSize, CellSize, 6.e-9)
SETPBC(6,6,0)

//Material
Msat=1000e3
Aex=1e-11
alpha = 0.007
anisC1=vector(1,1,0)
anisC2=vector(-1,1,0)
Kc1=5000
Kc2=0


In this system the demag kernel is:
B_demag = (-5.375485731444011e-05, 7.689423121822377e-05, -0.06891722977161407)

For this material and since its a thin film (36nm), I expect to have a demag in plane and I have an easy axis in the x-direction.
However, the demag values are not correct for an extended thin film (it is mostly out of plane...)
If I use only one cell in the Z direction of 36 nm:


CellSize:=5.e-9
NumCells:=512
ZNumCells:= 1
SetGridSize(NumCells, NumCells, ZNumCells)
SetCellSize(CellSize, CellSize, 36.e-9)
SETPBC(6,6,0)
setgeom(universe())


The B_demag = (0.0011605947511270642, 2.4958247274442513e-11, 1.287635509328311e-08)

I would have expected both to be the same, since its exactly the same system just one has 1 cell of 36nm, while the other system is 6 cells of 6nm each. I see that using only 2 cells also works, but for 3+ it fails and gives an out of plane component.

The rest of the code is completely equal in each case:


m =uniform(1,0,0)
relax()
FixDt = 1e-11;
// SOME FMR CODE HERE


Is this a problem on the mumax3 kernel calculation? I have seen other problems with it when changing the initial state of m.

Also, the simulations I want to do is to see the dipolar coupling between layers or different materials and therefore if the demag is not correct I wont get good results. :(

Thank you for any response or fix.

Marc

@JonathanMaes
Copy link
Contributor

When running the code on mumax3.10, I get

  • ZNumCells = 6B_demag = (-0.0002259404088060061, 3.312126686920898e-13, 1.5901631863120731e-18)
  • ZNumCells = 1B_demag = ( 0.00105499557685107, -1.3783979738946073e-05, 0)

which is in-plane as expected, for both cases.

I used this input script derived from your message:

CellSize := 5.e-9
NumCells := 512
ZNumCells := 6 // Or 1
SetGridSize(NumCells, NumCells, ZNumCells)
SetCellSize(CellSize, CellSize, 6.e-9) // Or 36.e-9
SETPBC(6, 6, 0)

//Material
Msat = 1000e3
Aex = 1e-11
alpha = 0.007
anisC1 = vector(1, 1, 0)
anisC2 = vector(-1, 1, 0)
Kc1 = 5000
Kc2 = 0

m = uniform(1, 0, 0)
relax()
FixDt = 1e-11
print(B_demag)

Could you share the exact, complete input script you used which gives you the unexpected result?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants