Boundary conditions
Specifying the field and/or potential
The applied electric field or voltage can be set through the option field_given_by, which can take the following forms:
field_given_by = voltage <value in V>"
field_given_by = field <value in V/m>"
field_given_by = voltage_table <filename>"
field_given_by = field_table <filename>"
In case of a table, the format of the table should be as follows:
voltage_vs_time (or field_vs_time)
--------
t1 v1
t2 v2
...
--------
where t1, t2, etc. are times and v1, v2, etc. are values. The lines with dashes should contain at least five dashes.
Electric potential boundary conditions
There is a parameter field_bc_type, that can be set to:
- 'homogeneous': Neumann zero on the sides, zero voltage at the bottom, and a fixed applied voltage on top.
- 'neumann': Neumann zero on the sides, zero voltage at the bottom, and a Neumann boundary at the top corresponding to the applied electric field
To have more flexibility, a custom routine for boundary conditions can be defined in the m_user.f90 file, which will override the above setting, see the m_user documentation.
Species boundary conditions
There is a parameter species_boundary_condition, that can be set to:
- 'neumann_zero': Neumann zero for all species on all domain boundaries. This means that electrons can flow out of electrodes.
- 'dirichlet_zero': Dirichlet zero for all species on all domain boundaries. Electrons can still flow into electrodes, but not out.
Specifying an electrode
To enable an electrode, set use_electrode = T. The electrode can be controlled with the following parameters:
call cfg_add_get(cfg, "field_electrode_grounded", field_electrode_grounded, &
"Whether electrode 1 is grounded or at the applied voltage")
call cfg_add_get(cfg, "field_electrode2_grounded", field_electrode2_grounded, &
"Whether electrode 2 is grounded or at the applied voltage")
call cfg_add_get(cfg, "field_rod_r0", rod_r0, &
"Electrode 1: first relative coordinate")
call cfg_add_get(cfg, "field_rod_r1", rod_r1, &
"Electrode 1: second relative coordinate")
call cfg_add_get(cfg, "field_rod2_r0", rod2_r0, &
"Electrode 2: first relative coordinate")
call cfg_add_get(cfg, "field_rod2_r1", rod2_r1, &
"Electrode 2: second relative coordinate")
call cfg_add_get(cfg, "field_rod_radius", rod_radius, &
"Electrode 1 radius (in m)")
call cfg_add_get(cfg, "field_rod2_radius", rod2_radius, &
"Electrode 2 radius (in m)")
call cfg_add_get(cfg, "cone_tip_radius", cone_tip_radius, &
"Electrode 1: tip radius (if conical)")
call cfg_add_get(cfg, "cone_length_frac", cone_length_frac, &
"Electrode 1: fraction of conical part (if conical)")
call cfg_add_get(cfg, "cone2_tip_radius", cone2_tip_radius, &
"Electrode 2: tip radius (if conical)")
call cfg_add_get(cfg, "cone2_length_frac", cone2_length_frac, &
"Electrode 2: fraction of conical part (if conical)")
rod_r0 = st_domain_origin + rod_r0 * st_domain_len
rod_r1 = st_domain_origin + rod_r1 * st_domain_len
rod2_r0 = st_domain_origin + rod2_r0 * st_domain_len
rod2_r1 = st_domain_origin + rod2_r1 * st_domain_len
electrode_type = "rod"
call cfg_add_get(cfg, "field_electrode_type", electrode_type, &
"Electrode: sphere, rod, rod_cone_top, rod_rod, sphere_rod, user")
The parameter field_electrode_type can be set to:
sphere: a spherical electrode
rod (default): a cylindrical electrode with a semi-spherical tip
rod_cone_top: a cylindrical electrode with a conical tip
rod_rod: two electrodes of rod type
user: a user-defined electrode
For a rod electrode, the relative coordinates field_rod_r0 and field_rod_r0 need to be defined. For the conical tip, field_rod_r2 also needs to be specified. See the electrode tutorial for examples.