-
Notifications
You must be signed in to change notification settings - Fork 54
Temperature handling for charge drift and trapping models #611
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,11 +63,14 @@ function _calculate_mobility_with_impurities( | |
| end | ||
|
|
||
| function InactiveLayerChargeDriftModel{T}(config::AbstractDict, | ||
| imp_model::AbstractImpurityDensity, input_units::NamedTuple, | ||
| imp_model::AbstractImpurityDensity, input_units::NamedTuple, temperature::RealQuantity | ||
| ) where {T <: SSDFloat} | ||
|
|
||
| temperature = _parse_value(T, get(config, "temperature", 90u"K"), input_units.temperature) | ||
| temperature::T = _parse_value(T, temperature, input_units.temperature) | ||
|
|
||
| if temperature < 50 || temperature > 150 | ||
| @warn "Temperature = $(temperature) K is outside the typical validated range (50–150 K)." | ||
| end | ||
|
Comment on lines
+66
to
+73
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking at maximum compatibility: how about still being able to define the temperature in the charge drift model, especially for the case where no temperature was explicitly defined for the semiconductor (and maybe throwing an error here in case two non-matching temperatures are defined in the semiconductor and the charge drift model)? |
||
| neutral_imp_model = if haskey(config, "neutral_impurity_density") | ||
| ImpurityDensity(T, config["neutral_impurity_density"], input_units) | ||
| else | ||
|
|
@@ -98,4 +101,4 @@ end | |
|
|
||
| @fastmath function getVh(fv::SVector{3, T}, cdm::InactiveLayerChargeDriftModel{T}, current_pos::CartesianPoint{T} = zero(CartesianPoint{T})) where {T <: SSDFloat} | ||
| calculate_mobility(cdm, current_pos, Hole) * fv | ||
| end | ||
| end | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -66,7 +66,6 @@ Charge trapping model presented in [Boggs _et al._ (2023)](https://doi.org/10.10 | |||||
| ## Fields | ||||||
| * `nσe::T`: Trapping product for electrons (default: `(nσe)^-1 = 1020cm`). | ||||||
| * `nσh::T`: Trapping product for holes (default: `(nσh)^-1 = 2040cm`). | ||||||
| * `temperature::T`: Temperature of the crystal (default: `78K`). | ||||||
|
|
||||||
| See also [Charge Trapping Models](@ref). | ||||||
| """ | ||||||
|
|
@@ -124,7 +123,7 @@ end | |||||
|
|
||||||
|
|
||||||
| BoggsChargeTrappingModel(args...; T::Type{<:SSDFloat}, kwargs...) = BoggsChargeTrappingModel{T}(args...; kwargs...) | ||||||
| function BoggsChargeTrappingModel{T}(config_dict::AbstractDict = Dict(); temperature::RealQuantity = T(78)) where {T <: SSDFloat} | ||||||
| function BoggsChargeTrappingModel{T}(temperature::RealQuantity, config_dict::AbstractDict = Dict()) where {T <: SSDFloat} | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks like a breaking change..
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe give |
||||||
| nσe::T = ustrip(u"m^-1", inv(1020u"cm")) | ||||||
| nσh::T = ustrip(u"m^-1", inv(2040u"cm")) | ||||||
| meffe::T = 0.12 | ||||||
|
|
@@ -147,7 +146,7 @@ function BoggsChargeTrappingModel{T}(config_dict::AbstractDict = Dict(); tempera | |||||
| if haskey(parameters, "nσh-1") nσh = inv(_parse_value(T, parameters["nσh-1"], internal_length_unit)) end | ||||||
| if haskey(parameters, "meffe") meffe = _parse_value(T, parameters["meffe"], Unitful.NoUnits) end | ||||||
| if haskey(parameters, "meffh") meffh = _parse_value(T, parameters["meffh"], Unitful.NoUnits) end | ||||||
| if haskey(parameters, "temperature") temperature = _parse_value(T, parameters["temperature"], internal_temperature_unit) end | ||||||
|
|
||||||
| BoggsChargeTrappingModel{T}(nσe, nσh, meffe, meffh, temperature) | ||||||
| end | ||||||
|
|
||||||
|
|
@@ -330,7 +329,7 @@ end | |||||
|
|
||||||
|
|
||||||
| CombinedChargeTrappingModel(args...; T::Type{<:SSDFloat}, kwargs...) = CombinedChargeTrappingModel{T}(args...; kwargs...) | ||||||
| function CombinedChargeTrappingModel{T}(config_dict::AbstractDict = Dict(); temperature::RealQuantity = T(78)) where {T <: SSDFloat} | ||||||
| function CombinedChargeTrappingModel{T}(temperature::RealQuantity, config_dict::AbstractDict = Dict()) where {T <: SSDFloat} | ||||||
|
|
||||||
| if haskey(config_dict, "model") && config_dict["model"] !== nothing && !(haskey(config_dict, "parameters")) | ||||||
| throw(ConfigFileError("`CombinedChargeTrappingModel` does not have `parameters`")) | ||||||
|
|
@@ -347,7 +346,7 @@ function CombinedChargeTrappingModel{T}(config_dict::AbstractDict = Dict(); temp | |||||
| if isnothing(model) | ||||||
| throw(ConfigFileError("`model` is defined but empty in config. Remove it or provide a valid name.")) | ||||||
| elseif model == "Boggs" | ||||||
| BoggsChargeTrappingModel{T}(config_dict; temperature) | ||||||
| BoggsChargeTrappingModel{T}(temperature, config_dict) | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
? |
||||||
| elseif model == "ConstantLifetime" | ||||||
| ConstantLifetimeChargeTrappingModel{T}(config_dict) | ||||||
| else | ||||||
|
|
||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some of the changes you are proposing would be breaking changes, requiring a new minor version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe still allow for this syntax (to make this non-breaking), but check that it matches the temperature of the semiconductor, if any was given (?)