mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
Add check in Decay.decay_constant for erroneous half-life
This commit is contained in:
parent
7fcc204726
commit
19494cccd0
1 changed files with 4 additions and 5 deletions
|
|
@ -465,11 +465,10 @@ class Decay(EqualityMixin):
|
|||
|
||||
@property
|
||||
def decay_constant(self):
|
||||
if hasattr(self.half_life, 'n'):
|
||||
return log(2.)/self.half_life
|
||||
else:
|
||||
mu, sigma = self.half_life
|
||||
return ufloat(log(2.)/mu, log(2.)/mu**2*sigma)
|
||||
if self.half_life.n == 0.0:
|
||||
name = self.nuclide['name']
|
||||
raise ValueError(f"{name} is listed as unstable but has a zero half-life.")
|
||||
return log(2.)/self.half_life
|
||||
|
||||
@property
|
||||
def decay_energy(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue