Repository navigation
Custom generation function - #135
Conversation
| $(TYPEDEF) | ||
| Abstract type for a generation rate given by the user function `data.customGeneration`. | ||
| """ | ||
| abstract type GenerationCustom end |
There was a problem hiding this comment.
I am not really happy with the name. The name should reflect the intention. What do you think about GenerationByCustomFunction? Or something like that?
There was a problem hiding this comment.
I think you should be happy now with my changes. We are not in need of GenerationCustom as we already have GenerationData.
|
Dear @Bingjie9978, thanks for the changes. I had to time to have a look now. I did following adjustments: 1. No user_generation(G::AbstractArray, node, data) = G[node.index]
user_generation(G::Function, node, data) = G(node, data)The old 2. Allocations in Ex111: a) The bias stored as an arbitrary function ( phase = Ref(0) # 0 = dark, 1 = light, 2 = scan
function applied_bias(t)
if phase[] == 1
return light_bias(t)
elseif phase[] == 2
return scan_bias(t)
else
return 0.0
end
end
contactVoltageFunction = [zeroVoltage, applied_bias]b) The parameter struct fields have no type, so 3. I renamed the example to 4. I set |
|
Hi @dilaraabdel , thanks! it looks good to me |
The function can now also depend on time (node.time), e.g. for a time-dependent illumination in a transient solve after equilibrium_solve!.
Holes ⇌ anion vacancies in the perovskite, written as one customReaction! function; the light is switched on with a 2 ms Beer-Lambert ramp passed as userDefinedGeneration, followed by 30 min at 1.1 V with non-perturbing J-V scans every 300 s. Na = 1e26 m⁻³ and T = 298.15 K are set in the example; the shared parameter file is unchanged.
e7ec115 to
2d0d665
Compare
|
We cleaned up the history and will merge if everything is green :) |
What I did:
GenerationCustom, which evaluates a user functioncustomGeneration(node, data)passed asData(...; customGeneration = f), analogous tocustomReaction!. As for the other models, the value is multiplied byλ2. The function may depend on time vianode.timeand can be replaced between solves.customReaction!and a time-dependent light ramp usingGenerationCustom