Skip to content

Commit 095f761

Browse files
authored
Merge pull request JuliaPhysics#443 from JuliaPhysics/efieldlines
Add keyword argument `Δt` to electric field line plotting
2 parents d8b9bba + 39917da commit 095f761

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

docs/src/man/plotting.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ the plot recipe for electric field lines can additionally understand the followi
172172
* `sampling`: Specifies the steps at which the contacts are sampled to generate equally spaced charges at the surface. The default is `2u"mm"`, but the optimal value depends on the geometry of the detector and contacts. If no unit is given, `sampling` is interpreted in units of meter.
173173
* `offset`: The charges are created on the surface and have to be moved slightly inside the semiconductor to be able to drift (charges that are in the contacts will not drift). This keyword defines how much the charges will be moved inside along the normal vector of the surface. The default is `0.5u"mm"`, but the optimal value again depends on the detector geometry. Unitless quantities are interpreted in units of meter.
174174
* `skip_contact`: Detectors will usually have positively and negatively biased contacts. The charges should only be spawned on either of them, but not both. This keyword defines which contact should be skipped in the charge spawn algorithm. Default is `1`, i.e. that no charges will be spawned at the surface of contact with `id = 1`.
175-
* `max_nsteps`: After all, the generation of electric field lines is based on the charge drift code, which requires a maximum number of steps, which is set to `5000` by default here. If the drift ends before the charges reach a contact, the electric field line will not be fully displayed. In this case, it is recommended to increase `max_nsteps`.
175+
* `max_nsteps`: The generation of electric field lines is based on the charge drift code, which requires a maximum number of steps, which is set to `5000` by default here. If the drift ends before the charges reach a contact, the electric field line will not be fully displayed. In this case, it is recommended to increase `max_nsteps`.
176+
* `Δt`: The charges are drifted with a normalized mobility of $1\,\text{cm}^2\text{/Vs}$ (see [`ElectricFieldChargeDriftModel`](@ref)). If the individual steps are too large, it is recommended to reduce `Δt`.
176177

177178

178179

src/PlotRecipes/ElectricField.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ end
9292
sampling = 2u"mm", # Specifies in what density the Contacts are sampled to generate equally spaced surface charges. Also see spacing.
9393
offset = 0.5u"mm", # should be at least as big as sampling. In doubt sampling can be reduced and the spacing keyword can be used to thin out the lines.
9494
spacing = 1, # If, due to fine sampling, too many lines would clutter the plot, the spacing keyword allows to skip some fieldlines. Spacing = 2 means plot every second line. Spacing = 3 every third.
95+
Δt = 1u"ns",
9596
full_det = false,
9697
skip_contact = 1) # Usually the "core" contact is skipped, and the other contacts are equally sampled for charges to drift
9798
sim = gdd.args[1]
@@ -165,7 +166,7 @@ end
165166

166167
for el_field in (el_field_itp, el_field_itp_inv)
167168
paths::Array{CartesianPoint{T}, 2} = fill(zero(CartesianVector{T}), length(spawn_positions), max_nsteps)
168-
last_step::Int = _drift_charge!(paths, Vector{T}(undef, max_nsteps), sim.detector, sim.point_types, sim.electric_potential.grid, CartesianPoint.(spawn_positions), ones(T, length(spawn_positions)), T(1e-9), el_field, Electron, verbose = false )
169+
last_step::Int = _drift_charge!(paths, Vector{T}(undef, max_nsteps), sim.detector, sim.point_types, sim.electric_potential.grid, CartesianPoint.(spawn_positions), ones(T, length(spawn_positions)), T(to_internal_units(Δt)), el_field, Electron, verbose = false )
169170
for i in 1:size(paths, 1)
170171
path = @view paths[i, 1:last_step]
171172
@series begin

0 commit comments

Comments
 (0)