You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor ThermalDiffusionLithiumDensity to remove hardcoded parameters (#578)
* Refactor ThermalDiffusionLithiumDensity to remove hardcoded parameters
* Refactor ThermalDiffusionLithiumDensity to remove hardcoded parameters
* Fix lithium diffusion model and YAML parsing
* Bug fixes
* Pass precision type to `ThermalDiffusionLithiumDensityParameters`
* Store `ThermalDiffusionLithiumDensityParameters.H` in units of `cal`
* Revert changes to `Project.toml`
* Fix order of magnitude of `lithium_density_on_contact`
The publication quotes values for calculating cm^-3, SSD expects m^-3
* cleaning the code and fixing bugs
* Remove example JSON file for inverted coaxial detectors
* Add references to `Thermal_Diffusion_Config.yaml`
* Reorganize code and add docstrings
* Remove `in_germanium` from `diffusivity` methods
The publications used for germanium also seem to provide values for silicon. I do not see why this model should not be also applicable to silicon.
* Update activation energy unit to `cal/mol`
---------
Co-authored-by: Simone Pellegrini <simonepellegrini@Mac.fritz.box>
Co-authored-by: Felix Hagemann <hagemann@berkeley.edu>
Co-authored-by: Simone Pellegrini <simonepellegrini@MacBook-Air-di-Simone-4.fritz.box>
Lithium impurity density model. Ref: [Dai _et al._ (2023)](https://doi.org/10.1016/j.apradiso.2022.110638)
5
5
6
6
## Fields
7
7
* `lithium_annealing_temperature::T`: lithium annealing temperature in Kelvin, when the lithium is diffused into the crystal. The default value is 623 K.
8
8
* `lithium_annealing_time::T`: lithium annealing time in seconds. The default value is 18 minutes.
9
9
* `distance_to_contact::Function`: the function for describing the depth to surface.
10
-
1) use the built-in function `ConstructiveSolidGeometry.distance_to_surface` to calculate the distance to the surface of the doped contact
10
+
1) use the built-in function `ConstructiveSolidGeometry.distance_to_surface` to calculate the distance to the surface of the doped contact.
11
11
2) custom. Custom function might be much faster while the detector has good symmetry.
12
-
* `lithium_density_on_contact::T`: the lithium concentration in the surface (in m^-3)
13
-
* `lithium_diffusivity_in_germanium::T`: the diffusivity of lithium in germanium (in m^2*s^-1)
12
+
* `lithium_density_on_contact::T`: the lithium concentration in the surface (in m^-3).
13
+
* `lithium_diffusivity::T`: the diffusivity of lithium (in m^2/s).
14
14
15
15
## Parameters for constructing the model
16
16
* `lithium_annealing_temperature::T`
17
17
* `lithium_annealing_time::T`
18
18
* `contact_with_lithium_doped::G`: the geometry of the contact with lithium doped, which is used to calculate the distance to the surface.
19
19
- If you don't pass this parameter, the `distance_to_contact` function should be passed.
20
20
- If you pass this parameter but don't pass the `distance_to_contact` function, the `distance_to_contact` function will use the default one.
21
-
* `distance_to_contact::Function`: optional, default is `ConstructiveSolidGeometry.distance_to_surface(pt, contact_with_lithium_doped)`
22
-
* `lithium_density_on_contact::T`: optional, default is the saturated lithium density at the given temperature
23
-
* `lithium_diffusivity_in_germanium::T`: optional, default is calculated with the annealing temperature
21
+
* `distance_to_contact::Function`: optional, default is `ConstructiveSolidGeometry.distance_to_surface(pt, contact_with_lithium_doped)`.
22
+
* `lithium_density_on_contact::T`: optional, default is the saturated lithium density at the given temperature.
23
+
* `lithium_diffusivity::T`: optional, default is calculated with the annealing temperature.
function ImpurityDensity(T::DataType, t::Val{:li_diffusion}, dict::AbstractDict, input_units::NamedTuple)
@@ -59,15 +52,16 @@ function ImpurityDensity(T::DataType, t::Val{:li_diffusion}, dict::AbstractDict,
59
52
contact_with_lithium_doped = haskey(dict, "contact_with_lithium_doped") ? dict["contact_with_lithium_doped"] :nothing# you don't have to pass the geometry of doped contact only when the distance_to_contact is passed
if diffusion_params[i].T_max < diffusion_params[i].T_min
112
+
throw(ConfigFileError("Invalid annealing temperature range $i: T_max must be ≥ T_min."))
113
+
end
114
+
if i >1&& diffusion_params[i-1].T_max != diffusion_params[i].T_min
115
+
throw(ConfigFileError("Annealing temperature ranges must be contiguous and increasing: range $(i-1) ends at a different temperature than range $i starts."))
116
+
end
117
+
end
118
+
119
+
saturation_params = LithiumSaturationParameters{T}(_parse_value(T, a, Unitful.NoUnits), _parse_value(T, b, Unitful.NoUnits))
@warn "Encountered unexpected key `$(k)` in 'annealing_temperature_ranges[$i]': Allowed keys are `T_min`, `T_max`, `D0` and `H`. Key `$(k)` will be ignored."
0 commit comments