Simulation instabilites

58 views
Skip to first unread message

Ashwin George

unread,
Apr 15, 2025, 7:45:59 AMApr 15
to Boris Computational Spintronics

Hi Serban,

I'm running micromagnetic simulations using Boris Spintronics and have been seeing persistent artifacts and instabilities early in the simulation. I was hoping you might have some suggestions.

I'm trying to implement an absorbing boundary layer (ABL) to minimize reflections. Here's how I've defined it:

# Constant damping
ns.setparam('Py', 'damping', alpha)

# Damping with ABL near the boundaries
ns.setparamvar('Py', 'damping', 'ovf2', custom_file_with_defined_ABL)

Despite this, I’m still seeing noticeable reflection artifacts early in the run. I'm starting to suspect it may not be entirely due to the ABL.

The simulation uses an RK4 integrator with a timestep of 5e-16 (I’ve also tried smaller values), and it involves a laser pulse interacting with a sample.

Is there anything you’d recommend checking or modifying?

Thanks so much for your time and for all the work you’ve done on Boris!


Best regards,

Ashwin


Ashwin George

unread,
Apr 15, 2025, 10:09:45 AMApr 15
to Boris Computational Spintronics
Just some more details for clarity,
This simulation is to study ultrafast demagnetization with a gaussian laser pulse.
The magnetic cell size is right now at [1e-9, 1e-9, 1e-9]
The heat cell size is at [2e-9, 2e-9, 2e-9]
Periodic boundary conditions are also enabled.
85.png

The black points are the instabilities and they seem to evolve over time.
121.png

Please let me know if any other information could be useful.

Best,
Ashwin

Serban Lepadatu

unread,
Apr 17, 2025, 2:49:03 AMApr 17
to Boris Computational Spintronics
Hi Ashwin,

The time-step seems excessively small. Could this be some kind of imaging artifact? Those points are regular. I would have to see the whole script to understand what's going on.

Kind regards,
Serban

Ashwin George

unread,
Apr 28, 2025, 12:34:18 PMApr 28
to Boris Computational Spintronics
Hi Serban,

The script is pretty big so I can give you parts that might be causing the issue, 

Setup:

ns.setode('LLB', 'RK4')
#define useful parameters
xdim = 1024e-9 # 65536
ydim = 1024e-9
zdim = 2e-9
meshdim = [xdim, ydim, zdim]
cellsize = [1e-9, 1e-9, 1e-9]
ns.setmaterial('Py', meshdim)

ns.cellsize(cellsize)
ns.addmodule('Py', 'heat')
ns.tcellsize([1e-9, 1e-9, 1e-9])
ns.tmodel(2, 'Py')
ns.curietemperature(550)


# #PBC
ns.pbc('Py', 'x', 10)
ns.pbc('Py', 'y', 10)

ns.addmaterial('SiO2', [0.0, 0.0, -40e-9, xdim, ydim, 0.0])
ns.meshfocus('SiO2')
ns.addmodule('SiO2', 'heat')
ns.tcellsize([4e-9, 4e-9, 4e-9])


ns.setangle(90, 0)
H0 = 159.155e3
ns.setfield(H0,55,0)
ns.temperature(300)

Laser:
ns.setstage('Qequation', 'Py')
## Gaussian Window (2d)
ns.editstagevalue(0, 'Q0 * exp( -( (x - offset1)^2 / (FWHM^2/(4*ln(2))) )) * exp( -( (y - offset1y)^2 / (FWHM^2/(4*ln(2))) ) ) * exp(-(t-2*tau)^2/(tau^2/(4*ln(2))))')
ns.equationconstants('offset1', offset1)
ns.equationconstants('offset1y', offset1y)
ns.equationconstants('tau', 50e-15)
ns.equationconstants('Q0', 2e21)

ns.equationconstants('FWHM', FWHM)

Run:
time_step = 1e-16
dtheat = time_step * 0.5
ns.editstagestop(0, 'time', time_zero)
ns.setdt(time_step)
ns.setheatdt(dtheat)

ns.Run()

while current_time < time_end:
#Some logic to change the time steps to make them bigger when the simulation progresses
ns.editstagestop(0, 'time', current_time + time_step)
ns.setdt(time_step)
ns.setheatdt(dtheat)

#Logic to save M values

ns.Run()

Reducing Q0 has also removed the instability but also, no demagnetization occurs.

Please let me know if you have any ideas.

Best wishes,
Ashwin

Serban Lepadatu

unread,
Apr 30, 2025, 6:13:40 AMApr 30
to Boris Computational Spintronics
Hi Ashwin,

You can attach a file here. I don't know what the problem is without running it.

Kind regards,
Serban

Reply all
Reply to author
Forward
0 new messages