Getting started#
Introduction#
Simulation of the FEBID process written in Python. FEBID stands for Focused Electron Beam Induced Deposition, a variation of a CVD (chemical vapor deposition) process. It uses volatile organometallic molecules (precursor) as material and a controlled electron beam to selectively deposit material on a substrate.
Simulation base features:
Continuum model
Enabled diffusion
Enabled temperature effects
Electron-matter interaction via Monte Carlo simulation
No gas dynamics implications
Installation#
The simulation requires Python 3.7 or later.
Package is available via PyPi: pip install febid
Alternatively, it can be installed directly from GitHub via pip, although that will require compilation of some modules:
pip install git+https://github.com/MrCheatak/FEBID_py
Tip
Linux user may need to manually install Tkinter, as it is not always shipped with the default installation of Python.
Running the first simulation#
In order to run the first simulation, Parameters.yml and Me3PtCpMe.yml parameter files in the
Examples folder are needed.
As the installation finishes, run python -m febid
, which will show the main control panel:
There are three main setup steps that are essential for the simulation: space, pattern and parameters of the beam and deposition material. Further instructions will configure a simulation on a 200x200 nm substrate with a stationary 5s exposure of a 30keV 0.15nA beam deposition using the Me3PtCpMe precursor.
- Space:
Firstly, a simulation volume domain has to be created. The simplest case is a clean substrate. Choose Parameters option and specify 200x200x200 nm dimensions with 5 nm cell size and 10 nm substrate. This will define a cubic simulation domain divided into voxels with 5 nm edge length. Finally, a 20 nm layer of substrate material (Au) is laid at the bottom.
- Pattern:
Next, pattern has to be defined for the controlled beam. Choose Simple patterns and select Point from the drop-down menu. This option will fix the beam at a point specified by X and Y parameters, set both of them to 100 to position the beam at the center of the substrate. The time that the beam will spend at that point is defined by dwell time and repeats parameters. Lets set a 5 s exposure by setting them to 1000 and 5000 correspondingly. A beam is configured now to stay at the (100,100) point for 5 s.
- Beam and precursor:
Finally, open Parameters.yml for Settings and Me3PtCpMe.yml for Precursor parameters. The first one specifies the beam parameters and precursor flux, the second provides precursor material properties.
Lastly, uncheck all the saving options and enable Show the process to watch the growth in real time and hit Start.
A new window is then shown with a scene containing the substrate. The scene can be rotated and zoomed to get a better view angle.
Important
Besides the graphical representation, a console is will display simulation info. It is important to keep an eye on it as the deposition progress, execution speed and warnings and errors, if any occur, are output to the console.
Manual#
Contents:#
Interface#
Control panel:#
Here is the list of all settings available on the control panel.
Load last session – initially unchecked. Checking it will create a session file at the location, from where the Python command was executed. Lunching from the same location again will load settings used previously. This file can be as well be manually edited to change the settings preset, i.e for a series of simulation runs.
Simulation volume:
VTK file – allows specifying a VTK-type file (.vtk) that contains a predefined 3D structure to be used in the simulation.
Parameters – create a fresh simulation volume with specified dimensions and voxel(cell) size with a substrate at the bottom.
Auto – to be used only when using a stream-file. The dimensions of the simulation volume will be defined automatically to encapsulate the printing path with a sufficient margin.
Width, length, height – simulation volume dimensions, nm.
Cell size – edge length of a cubic cell or voxel that is the simulation volume is divided into. The smallest volume fraction of the simulation volume
Substrate height – the thickness of a substrate layer at the bottom of the simulation volume. By default, it has properties of gold. It should be a multiple of Cell size.
Volume dimensions have to be set only if Parameters is chosen. When VTK file is chosen, they are set automatically from the file, as well as Substrate height and Cell size. For the Auto option, only Cell size and Substrate height have to be specified.
Pattern:
Simple pattern – allows generation of a path with one of the available simple shapes: Available shapes: point, line, square, rectangle and circle.
x, y – parameters of the selected shape. Position for a point, length for a line, edge length for a square and rectangle, radius for a circle. Except for the point, all shapes are placed in the center. Keep in mind, that the printing path should be inside the borders of the simulation volume.
Pitch – the shape contour is divided into discrete points, which a beam visits in a sequence. This parameter defines the distance between two consequent positions of the beam along it’s path.
Dwell time – the amount of time the beam sits or dwells at a single position.
Repeats – the number of times the pattern defined by shape, dwell time and pitch has to be repeated.
Stream file – allows specifying a special stream-file, that defines a more complex printing path. It represents a sequence of beam positions with dwell times. This option requires Auto to be chosen in the Simulation volume section.
HFW – Half Field Width sets the scale of the structure. Because pattern files are resolved in pixels, they have to be related to the actual distance units. This relation is provided by the magnification or HFW.
Beam and precursor:
Settings – a YAML (.yml) file with beam parameters and precursor flux to be specified here.
Precursor parameters – a YAML (.yml) file with precursor(printing material) and deponat(printed material) properties.
Temperature tracking – check to enable calculation of the temperature profile and temperature dependency of the precursor coverage.
Warning
Corresponding precursor parameters have to be included in the parameter file in order for the temperature tracking to work.
Note
If a loaded 3D structure does not have temperature profile data, it will be added automatically.
Save file:
Save simulation data – check to regularly save statistical data of the simulation including time passed, deposition time passed and volume filled. The save interval is specified in the next field.
Save structure snapshots – check to regularly save the state of the deposition process. The save interval is specified in the next field.
- VTK file option:
Read the volume with a structure from a .vtk file. The file can be a regular .vtk file with a structure in it or it can be a file produced by the simulation (by checking Save structure snapshots). If an arbitrary .vtk file is specified, it has to be a UniformGrid, have a cubic cell (equal spacings) and have a single cell array.
- Graphical:
When ‘Show the process’ is checked to view the simulation process in real-time, a window with a 3D scene will open. Refresh rate is set to 0.5 s, thus it may be slow to interact with. The scene is interactive, meaning it can be zoomed by scrolling, rotated with a mouse, moved around (with Shift pressed) and focused at the cursor by pressing ‘F’. The coloring and the corresponding scale represents the concentration of the precursor at the surface. Thus, the 3D object displayed is not the solid structure itself, but it’s whole surface, that follows the shape of the solid 3D object.
Saving simulation results:#
When any of the ‚Save…‘ options are checked a new folder for the current simulation is created. The intervals of statistics records and snapshots saving refer to the deposition time.
Save simulation data creates an .xlsx Excel file and records simulation setup information and statistical data. Simulation setup is recorded before the simulation start and includes Precursor/deposit properties, Beam/precursor flux settings and Simulation volume attributes, which are saved on separate sheets. Statistical data is then recorded repeatedly during the simulation and includes the following default columns:
Precise time of record (real)
Time passed (real), s
Time passed (deposition/experiment), s
Current lowest precursor coverage 1/nm 2
Temperature, K
Deposited volume, nm 3
Growth rate
Note
The data collected can be extended via Statistics class by adding columns at the simulation initialization and then providing data for timely records in the monitoring function.
Hint
While real time refers to the real-world time, simulation/experiment refers to the time defined by the beam pattern.
Save structure snapshots enables regular dumping of the current state of structure. The data is saved in .vtk format, and includes 3D arrays that define:
Grown structure
Surface deposit
Surface precursor coverage
Temperature
Surface cells
Semi-surface cells
Ghost cells
Additionally, current time, time passed, deposition time passed and beam position are saved.
The files saved via this option can be then viewed as 3D models by the included show_file.py and show_animation.py scripts or in ParaView®.
Warning
3D structure file (.vtk) may reach 500 Mb for finer grids and, coupled with regular saving with short intervals, may occupy significant disc space. If only the end-result is needed, input an interval that is larger than the total deposition time.
Important
Currently, patterning information is not included in the saved simulation setup info and has to be managed manually.
Viewing simulation results:#
There are three options to inspect a 3D structure deposited by FEBID simulation.
The first one is viewing a specific snapshot with all the corresponding data layers (precursor coverage, temperature etc.).
python -m febid show_file
The second option is to view the process based on a series of structure snapshots. Unlike viewing a single file, only one data layer can be ‘animated’.
python -m febid show_animation
Surface deposit, precursor coverage and temperature profile data are currently supported, it can be set up inside the script.
The third option is to use Paraview®. Examples folder contains a process file, that has all presets for each dataset included in the 3D structure file to render the same result as the show_file script.
Experimental settings#
An example of a settings file can be found in the Examples folder of the repository.
Beam:#
Experiment beam settings:
beam_energy – energy of the electron beam, keV
beam_current – current of the electron beam, A
Modulation of the beam profile:
gauss_dev – standard deviation of a Gaussian beam shape function in nm
n – order of the Gaussian function (see super or higher order gaussian distribution)
Electron trajectory settings:
minimum_energy – energy at which electron trajectory following concludes, keV
Other:#
precursor_flux – precursor flux at the surface, 1/(nm^2*s)
substrate_element – material of the substrate, i.e. ‘Au’
deposition_scaling – multiplier for deposited volume for artificial speed up of the simulation
emission_fraction – fraction of the total energy lost by primary electrons that is converted to secondary electron emission
Precursor parameters file#
An example of a precursor parameters file can be found in the Examples folder of the repository.
Precursor parameters list:#
Base parameters:
name – a common name of the selected precursor
formula - a chemical formula of the precursor ,i,e ‘Me3PtCpMe’
molar_mass_precursor – molecular mass of the precursor molecule, g/mol
max_density - maximum site density of the precursor, 1/nm^2
dissociated_volume – deposited material volume resulting from dissociation of s single molecule, nm^3
sticking_coefficient – a probability that a precursor molecule adheres to the surface upon collision
P_vap: precursor vapor pressure in the chamber, Pa
Dissociation:
cross_section – precursor molecule integral dissociation cross-section, nm^2
Diffusion:
diffusion_coefficient – surface diffusion coefficient , nm^2/s
diffusion_activation_energy* – activation energy of the diffusion in its Arrhenius equation, eV
diffusion_prefactor* – prefactor in diffusion Arrhenius equation, nm^2/s
Desorption:
residence_time – a mean time a precursor molecule stays on the surface, µs
adsorption_activation_energy* – activation energy of the adsorption in the residence time Arrhenius equation, eV
desorption_attempt_frequency* – a frequency, at which a molecule attempts to desorb from the surface, Hz
Deposit parameters list:#
deposit – chemical formula reflecting resulting deposit composition
molar_mass_deposit – molecular mass of the given formula, g/mol
SE_emission_activation_energy – energy required to emit a secondary electron, eV
SE_mean_free_path – secondary electron mean free path nm
average_element_number – average or effective atomic number of the given formula
average_element_mol_mass – average molecular mass of the given formula g/mol
average_density – deposit mass density, g/cm^3
thermal_conductivity – thermal conductivity of the bulk deposit, W/nm/K
* – parameters required for temperature tracking
Setting up a series of simulations#
Optimisation of pattern files, simulation input parameters or simulation of several structures may require running a significant number of simulations. The package offers some simple automation features for such tasks. Setting up a simulation series requires composing a Python script.
The first feature allows executing a sequence of simulations arising from consequently changing a single parameter. A series of such simulations is regarded as a scan. Such scan can be carried out on any parameter from the Precursor or Settings file.
# Initially, a session configuration file has to be specified.
# This file, along settings and precursor parameters files specified in it, is to be modified
# and then used to run a simulation. This routine is repeated until the desired parameter
# has taken a given number of values.
# The routine only changes a single parameter. All other parameters have to be preset forehand.
session_file = '/home/kuprava/simulations/last_session.yml'
# The first parameter change or scan modifies the Gaussian deviation parameter of the beam.
# The file that will be modified in this case is the settings file.
# Set up a folder (it will be created automatically) for simulation save files
directory = '/home/kuprava/simulations/gauss_dev_scan/'
write_param(session_file, 'save_directory', directory)
# Specify parameter name
param = 'gauss_dev'
# Specify values that the parameter will take during consequent simulations
vals = [2, 3, 4, 5, 6, 7, 8]
# Launch the scan
scan_settings(session_file, param, vals, 'hs')
# Files that are saved during the simulation are named after the specified common name (here i.e. 'hs')
# and the parameter name.``
It is also possible to run a 2D scan, meaning another parameter is scanned for each value of the first parameter.
The second option is to run simulations by using a collection of pattern files. This mode requires that all the desired pattern files are collected in a single folder, that has to be provided to the script.
# Again, specify a desired location for simulation save files
directory = '/home/kuprava/simulations/longs/'
# Optionally, an initial structure can be specified. This will 'continue' deposition
# onto a structure obtained in one of the earlier simulations.
# It can be used i.e. when all planned structures share a same initial feature such as a pillar.
# Keep in mind that it can be used only for patterning files with the same patterning area.
# To that, the patterning area must correspond to one that is defined by the simulation for the current
# pattern including margins.
initial_structure = '/home/kuprava/simulations/hockey_stick_therm_050_5_01_15:12:31.vtk'
write_param(session_file, 'structure_source', 'vtk')
write_param(session_file, 'vtk_filename', initial_structure)
write_param(session_file, 'save_directory', directory)
# Specifying a folder with patterning files
stream_files = '/home/kuprava/simulations/steam_files_long_s'
# Launching the series
scan_stream_files(session_file, stream_files)
Note
Scanning only modifies the selected parameter(s). Thus, all other parameters as well as saving options and output directory have to be preset.
How it works#
This section will explain how various modules work, what solutions are applied and how some of the input parameters are estimated
Contents:#
Monte Carlo module#
The Monte Carlo module realises electron beam – matter interaction. There are two results, that are eventually transferred to the deposition module. The first one is secondary electron flux profile, the second is distribution of the volumetric heat sources in the solid or beam heating power.
There are a total of 5 stages that the simulation consists of:
Primary electron scattering
Secondary electron emission
Surface electron flux estimation
Primary electron energy deposition
Secondary electron energy deposition
1. Primary electron scattering#

A total of 20000 generated electrons on a 50x50 grid with 3.8 standard deviation. Histograms reflect equatorial distributions.#
At this step, scattering of the primary electrons is simulated, resulting in a collection of electron trajectories coupled with energy losses along the trajectory.
Initially, a number of electrons are generated around the beam position according to the Gaussian distribution:
The scattering process occurs in a simulation volume domain of a predefined material.
Each electron initially has the energy of the beam , that is continuously lost as the electron propagates
through the solid. The trajectory of an electron consists of a number of consequent scattering points, that are
characterised by the electron position and energy. Together, a number of trajectories represent the spacial scattering
of the emitted electrons.
At each scattering point, based on the electron energy, the scattering angle and the free path length are calculated based on random values from a normal distribution. After this, the trajectory is extended by an additional segment. The trajectory proceeds likewise until an electron reaches a cut-off energy or escapes the simulation volume domain:

Simulation volume domain subdivided into cubic cells.#

Two electron trajectories in the simulation volume. Coloring corresponds to electron energy.#
2. Electron trajectory discretisation#

Red lines are SE vectors in the vicinity of the surface.#
Here, the generated trajectories are subdivided and secondary electrons are emitted based on the energy loss on those subsegments.
Firstly, the trajectories of primary electrons are finely (less then a nm) subdivided into subsegments. Each subsegment
corresponds to the energy lost by an electron at this distance . Based on that energy, the number of emitted
secondary electrons is calculated. Electrons are emitted from from the beginning of the subsegment and the emission
direction is random. The free path that secondary electrons may travel is fixed for a given material, thus all the
emission vectors as assigned the same length. The result at this step is a collection of secondary electron vectors,
stemming from primary electron trajectories.
At this stage, those vectors are as well filtered. All SEs that cannot reach the surface due to being buried too deep in the solid are separated from those that have their emission sources in the vicinity of the surface.
3. Surface electron flux estimation#

Surface SE flux, lighter color corresponds to higher flux rate.#
Now, the secondary electron vectors are converted into surface secondary electron flux.
Each vector may or may not reach the surface depending on its position and direction. To test each vector for crossing with the surface, they are followed along and each cell that they traverse through is checked. If a traversed cell appears to be a surface cell, the number of emitted secondary electron that the vector ‘carries’ is added to that surface cell. Performing such routine on all the vectors results in accumulation of secondary electrons in the surface cells and yields a surface secondary electron flux.
4. Beam heating power estimation#

Beam heating power distributed per cell, the higher the power the more red is the cell.#
Finally, the power of the beam heating is calculated at this step.
The energy of primary electrons is spent as well on Joule heating. Each electron, as it travels through the solid, deposits a fraction of the lost energy into the solid, resulting in heating of the solid medium. Due to the fact that the solid is discretised into cubic cells, the heating power is a collective of cells traversed by primary electrons with energy deposited in them or a collection of volumetric heat sources.
Each trajectory is followed along to determine the distance traveled inside the cells they traverse. Traversed cells are then added the energy lost by that electron proportional to that distance. This results in a spatially resolved volumetric heat sources distribution, that follow electron trajectories.
In the end, the resulting distribution is added all the secondary electrons, that were buried too deep. Those electrons are considered scattered and contribute to the heating process.
- Secondary electron emission energy (
):
It is the energy required to launch a cascade of secondary electrons. While these values are tabulated for most of the elements in [Lin2005], compound energies shall be averaged volumetrically, i.e. AB compound(amorphous):
,
- where
and
are volume fractions of the phases
and
are emission activation energies
Lin Y., Joy D., A new examination of secondary electron yield data, Surf. Interface Anal. 2005, 37, 895–900
Diffusion#
Surface diffusion plays an important role in precursor coverage replenishment at the beam interaction region (BIR).

Diffusive flow#
In the discretised simulation volume, diffusion occurs on a monolayer of cells that separates solid and empty cell domains. It is the same cell layer that contains information about surface precursor coverage.
Solution of the diffusion equation is a subroutine of the reaction-diffusion equation solution. Each time the solution occurs, it outputs a profile of local precursor changes induced by the diffusion process and then added to the precursor coverage profile.
Ghost cells#

In order to enable diffusion exclusively along the surface a so-called ‘ghost cell’ method is used. The thin layer of surface cells is ultimately contained between the void and solid cells. The solid and void cells that neighbor a surface cell are marked as ghost cells, encapsulating the whole surface. During the application of the stencil operator, the ghost cells mimic the value in the current cell. This artificially creates a condition of zero concentration difference and consequently zero diffusive flux.
Diffusion is described via a parabolic PDE equation and thus requires a special numerical solution.
Characteristic time of the diffusion makes it feasible to use the simplest approach – the FTCS scheme.
Numerical solution#
The diffusion equation:
,
- where:
is surface diffusion coefficient
is temperature [K]
which is resolved in 3D space:
The solution occurs in a discretized volume domain, where the finest spacial step
along each axis is . Temperature in each cell is addressed by it’s index along each
axis i,j,k. The FTCS scheme can then be described as follows:
Partial derivatives are averaged from the current and neighboring cells along a single axis.
For a case with a cubic cell, where , the expression can be simplified:
- where:
is surface diffusion coefficient
is temperature in the given cell [K]
is the time step or time resolution, [s]
Using the derived expression, the state of the system at the next time step can be derived from the current state.

3D Stencil operator#
From analysing the expression, it is evident that it sums every neighbor and subtracts the value of the central cell. Such operation, that is applied to all cells in the same manner is called a stencil.
The Fourier stability criterion for the FTCS scheme is:
,
for 3D space yielding maximum stable time step:
,
while semi-implicit Crank-Nicholson and implicit Euler methods are unconditionally stable.
Nevertheless Crank-Nicholson is unconditionally stable, meaning it works for any time step, it may suffer oscillations. At the same time, implicit Euler is immune to oscillations, but has only 1st-order accuracy in time.
Thermal effects#
This page covers the model of beam heating influence on the deposit shape and presents utilised solution for the heat equation.
Temperature dependence#
The influence of the beam heating effect through temperature increase is multifold.

Initially, the heating power of the beam is generated by the Monte Carlo module.
After that, a temperature profile is derived based on and thermal conductivity of the deposit
The temperature profile is then used to calculate surface profiles of residence time and diffusion coefficient.
Finally, those profiles are used for the calculation of the precursor coverage profile. Precursor coverage then directly affects the amount of the deposited material.
Heat equation#
Both heat distribution and diffusion are described via a parabolic PDE equation and thus require a numerical solution.
Although, the processes are similar in nature, they occur at characteristic time steps differing by orders of magnitude. This fact implies usage of different numerical solution for th heat transfer problem.
In the actual version of the package, the default for heat transfer is SOR.
The heat equation:
,
which is resolved in 3D space:
- where:
is the heat capacity of the solid medium
is the density
is thermal conductance
is the heating source originating from electron beam heating
is temperature [K]
Due to the fact, that heat transfer characteristic time step is orders of magnitude shorter than one of mass transport (diffusion), the solution of heat equation requires an accordingly shorter time step. Such fine time discretization would make the simulation orders of magnitude slower.
Although, the same feature of the heat transfer means that evolution of an equilibrium or steady state occurs almost instantly [Mutunga2019]. It means that time discretization is neglected and the problem simplifies to a calculation of a steady state:
The problem of deriving a steady state is called a relaxation problem and is solved by a family of relaxation methods. Here it is solved via a Simultaeous Over-Relaxation (SOR) method. Generally, it represents an FTCS scheme, ultimately applied with the maximum stable time step. The main prerequisition for the SOR method is convergence of the solution. The convergence is evaluated based on a norm of the difference between current and previous iterations. When the norm diminishes below a certain value that is called solution accuracy the convergence is reached.
Due to the slow rise of temperature caused by beam heating, a steady state profile can be derived at a significantly lower rate than the diffusion equation is solved.
Effectively, re-calculation of the steady state temperature profile is necessary approximately 10 times per deposition time second for the PtC deposit.
Mutunga E., Winkler R., Sattelkow J. et al., Impact of Electron-Beam Heating during 3D Nanoprinting, ACS Nano 2019, 13, 5198-5213
febid#
FEBID Simulator package
Deposition process code |
|
Module for continuous process data recording |
|
Main internal data framework |
|
Diffusion module Solution for diffusion equation via FTCS method |
|
Control core of the simulation |
|
Heat transfer module |
|
Extension modules. |
|
Monte Carlo electron beam – matter interaction simulation subpackage |
|
Stream-file reader and pattern generator |
|
Scripting template for running series of simulations |
Welcome to FEBID Simulation documentation!#
The package is virtual representation of the direct-write nanofabrication technique called FEBID driven by an electron beam that typically takes place in a SEM. The simulation takes in a handful of parameters and allows prediction of the deposit shape expected from an experiment. It features a live visual process representation, periodical save of the current state of the 3D deposited structure and recording of the process parameters like time and growth rate. Additionally, the package features an electron beam - matter simulator, that can be run separately using a previously saved 3D structure to reveal beam related details of the process.
The saved 3D structure files can then be interactively viewed or compiled into a animated series depicting the process.
The Getting started section will let you quickly install the package and run an example simulation. A more detailed interface manual, input parameter files explanation and features list will give a full understanding on how to use the simulation.
For more in-deep understanding of the simulation design and code details check the API section.