Skip to content

Commit

Permalink
Add IsotropicChargeDriftModel
Browse files Browse the repository at this point in the history
  • Loading branch information
Padniuk committed Nov 11, 2024
1 parent cd712ac commit cf9def5
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
model: IsotropicChargeDriftModel
mobilities:
e: 1000cm^2/(V*s)
h: 1000cm^2/(V*s)
3 changes: 2 additions & 1 deletion src/ChargeDriftModels/ChargeDriftModels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ abstract type AbstractChargeDriftModel{T <: SSDFloat} end
abstract type AbstractTemperatureModel{T <: SSDFloat} end

include("ElectricFieldChargeDriftModel/ElectricFieldChargeDriftModel.jl")
include("ADLChargeDriftModel/ADLChargeDriftModel.jl")
include("ADLChargeDriftModel/ADLChargeDriftModel.jl")
include("IsotropicChargeDriftModel/IsotropicChargeDriftModel.jl")
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
"""
struct IsotropicChargeDriftModel{T <: SSDFloat} <: AbstractChargeDriftModel{T}
Charge drift model in which the electrons and holes drift along the electric field with a constant mobility in m²/Vs
## Fields
- `μ_e::Union{RealQuantity, AbstractString}`: Mobility of the electrons in m²/Vs.
- `μ_h::Union{RealQuantity, AbstractString}`: Mobility of the holes in m²/Vs.
"""
struct IsotropicChargeDriftModel{T <: SSDFloat} <: AbstractChargeDriftModel{T}
μ_e::T
μ_h::T
IsotropicChargeDriftModel{T}(
μ_e::Union{RealQuantity, AbstractString},
μ_h::Union{RealQuantity, AbstractString}
) where {T <: SSDFloat} = new{T}(_parse_value.(T, (μ_e, μ_h), internal_mobility_unit)...)
end

IsotropicChargeDriftModel(args...; T::Type = Float32, kwargs...) = IsotropicChargeDriftModel{T}(args...; kwargs...)

const default_icd_config_file = joinpath(get_path_to_example_config_files(), "IsotropicChargeDriftModel/mobilities.yaml")

function IsotropicChargeDriftModel{T}(config_filename::AbstractString = default_icd_config_file) where {T <: SSDFloat}
IsotropicChargeDriftModel(parse_config_file(config_filename))
end

function IsotropicChargeDriftModel{T}(config::AbstractDict) where {T <: SSDFloat}
if !haskey(config, "mobilities")
throw(ConfigFileError("IsotropicChargeDriftModel config file needs entry 'mobilities'."))
end

for axis in ("e", "h")
if !haskey(config["mobilities"], axis)
throw(ConfigFileError("IsotropicChargeDriftModel config file needs entry 'mobilities/$axis'."))
end
end

IsotropicChargeDriftModel{T}(config["mobilities"]["e"], config["mobilities"]["h"])
end

@fastmath function getVe(fv::SVector{3, T}, cdm::IsotropicChargeDriftModel{T}) where {T <: SSDFloat}
@inbounds begin
-cdm.μ_e*fv
end
end

@fastmath function getVh(fv::SVector{3, T}, cdm::IsotropicChargeDriftModel{T}) where {T <: SSDFloat}
@inbounds begin
cdm.μ_h*fv
end
end
2 changes: 1 addition & 1 deletion src/SolidStateDetectors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export Grid, GridPoint
export ElectricPotential, PointTypes, EffectiveChargeDensity, DielectricDistribution, WeightingPotential, ElectricField
export apply_initial_state!
export calculate_electric_potential!, calculate_weighting_potential!, calculate_electric_field!, calculate_drift_fields!
export ElectricFieldChargeDriftModel, ADLChargeDriftModel
export ElectricFieldChargeDriftModel, ADLChargeDriftModel, IsotropicChargeDriftModel
export NoChargeTrappingModel, BoggsChargeTrappingModel
export get_active_volume, is_depleted, estimate_depletion_voltage
export calculate_stored_energy, calculate_mutual_capacitance, calculate_capacitance_matrix
Expand Down

0 comments on commit cf9def5

Please sign in to comment.