Examples¶
A simple simulation of magnetic nanoparticles is easy to set up. First you will need a position file; for a chain of MNPs this can be automatically generated:
mango_strings 1.0%1.0 5 0 0 0 0
The above command will generate an extended xyz file, string_5r1.0%1.0.xyz, containing 5 identical MNPs with a radius of 10nm separated by 1% of their diameter, 2nm. MNPs are aligned by default in the Z direction with their magnetisation also aligned along the same direction. The alignment can be adjusted with phi and theta (the four zeros, see mango_strings -h).
To run a simple susceptibility simulation in a vanishingly small applied field your input file will be:
SusceptibilityCalc True
Iterations 100000
Repetitions 1
NumberParticles 5
ParticleRadius 1.0
PositionFile ./string_5r1.0%1.0.xyz
SkipSave 50
Boxsize 100
Using an input file with the above content, a simulation is run with:
mango -I <input file>
The simulation will run one statistical repetition for 1e5 steps saving every 50th step. Values such as timestep are default values and therefore unneeded in the input file, the default values are shown in Full Input File.
To view the resulting movement the included visualiser can be used. Firstly a xyz file is needed for the visualiser. A xyz file is created by navigating to the output file in the newly created directory where the file S_Run1_mol-5.1.hdf5 has been created. The simulation is run 1, therefore we post process our datafile with the below command to create a xyz file:
mango --suscep --logs ./ --run 1 --cfile xyz
To visualise the simulation we use the created xyz file and run:
mango_vis S_Run1.0.m.xyz
The video below was created using the above command appending the -m flag to create a video. The mesh is the size of the particles (10nm radius), the central sphere allows for the viewing of the magnetisation (blue arrows) and force (red arrows) vectors.
Full Input File¶
The default values for all variables are also shown here
Downloadable here: InputFile
.
# Input files
InputFile None # Input file location
RestartFile None # Restart file location
PositionFile None # Positions file location
# Properties
ExternalFieldFreq 1e-06 # External Field Frequency [Hz]
ExternalFieldStrength 167.0 # External Field Strength [1e-6 Gauss]
MediumViscosity 0.01002 # Solvent Viscosity [g/(cm *s)]
MagneticDensity 85 # Magnetic Density of particles [emu/g]
ParticleDensity 6.99 # Density of each particle [g /cm^3]
ParticleRadius 5.0 # Radius of each particle [1e-6cm]
Temperature 298.0 # Temperature [K]
# Calculation Options
BackgroundNoise True # Background Noise switch
Boxsize 50 # Periodic boundary box size [1e-6cm]
Epsilon None # Set depth of Potential Well
Iterations 400.0 # Number of Iterations
Labview True # Remove initial cluster momentum
MagnetisationSW True # Magnetisation calculation switch
NumberParticles 5 # Number of Particles
Optimisation False # Auto-minimise energy of the system
PeriodicBoundaries True # Periodic Boundary Conditions
Potential False # Change potential used
Repetitions 10 # Number of statistical repetitions
SkipSave 1 # Save every # iterations
SusceptibilityCalc False # Zero field Calculation
ThermalOptim False # Add thermal noise to the momentum after the optimisation
Timestep 20 # Timestep [ps]
# Postprocessing
Align False # Align with Kabsch algorithm
Blocking 5, 10, 20, 50, 100 # Block averaging bins
CreateFile False # Create output files
Equilibrate 0.1 # Strip fraction of trajectory for equilibration
PlotColumns False # Plot simple datasets
Run False # Select run number
KineticTemp False # Calculate kinetic temperature
LengthCheck False # Calculate average particle separation
ShowGraphs False # Show graphs during run
SaveGraphs False # Save graphs
UseFile False # Post process from a specific file
# Run Style Changes
LogDirectory ./Mango_0.8.0-g_616c94e_Logs # Log save directory
Parallel True # Parallel Computation
SaveChunk 10000.0 # Save to file every # iterations
SaveFiletype hdf5 # Save filetype
Scfiter 20 # Magnetic self consistancy loop before warning
Walltime 10000000.0 # Run time [s]
Verbosity 2 # Verbosity level
# Néel Relaxation Properties
NeelRelaxations False # Enable Neel relaxations
NeelAnisotropicFactor 2.25e-08 # Set anisotropic factor [erg*cm3]
NeelTau0 1.7 # Zero value for τn [1.e-12 s]
NeelTemp0 262.0 # Neel zero temperature [K]