-
Notifications
You must be signed in to change notification settings - Fork 25
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
Radioactive decay #679
Radioactive decay #679
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #679 +/- ##
==========================================
+ Coverage 98.93% 98.95% +0.01%
==========================================
Files 57 58 +1
Lines 2154 2195 +41
==========================================
+ Hits 2131 2172 +41
Misses 23 23 ☔ View full report in Codecov by Sentry. |
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.
Just some minor things from me, and it seems there is still a little coverage missing. Otherwise looks good, could be very useful!
Co-authored-by: James Dark <[email protected]>
Co-authored-by: James Dark <[email protected]>
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.
looks good!
@Allentro You seemed interested in this feature. Do you have anything to add about this implementation? |
Proposed changes
This PR implements radioactive decay (fixes #488).
The new formulation is:
where$\lambda$ is the decay constant (expressed in s^-1).
It is implemented as a volumetric source object inheriting from
F.Source
.It takes a decay constant parameter.
Usage:
Alternatively, a single decay source can be applied to all concentrations (default behaviour):
On a simple simulation with no BCs, no trapping/detrapping, but initial conditions (200 for mobile and 100 for trapped concentration), a half-life of 50 s, things work as expected:
Types of changes
What types of changes does your code introduce to FESTIM?
Checklist
Further comments
@jhdark I had to modify the formulation in order to make this work. Before, we had:
This trapping term wouldn't work when adding decay. Since:
then the decay of trapped particles would create mobile particles!
I therefore had to:
I'm happy to break this PR down and open a smaller PR that just does this
Also, it might be interesting to allow several materials per source!