Commit 63954f61 authored by LEFEBVREJP email's avatar LEFEBVREJP email
Browse files

Merge branch 'decaydeb' into 'master'

Adding decaydb::calculate_activity(zaid,abundance) method.

See merge request !84
parents c20bb537 01cf294c
Pipeline #71877 passed with stages
in 18 minutes and 41 seconds
......@@ -13458,6 +13458,37 @@ DecayDb::DecayDb()
0.0f, 0.0f,
0.0f, {{0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.18434f, 0.0f}}};
}
float DecayDb::calculate_activity(int zaid, float abundance) const
{
static float lntwo = std::log(2.0f); // for activities
static float avogadro = 6.0221367e23f; // per mole
static float curie = 37.0e9f; // (dis/sec)/Ci
float activity = 0.0f;
const auto& it = mActivation.find(zaid);
if (it != mActivation.end())
{
activity = abundance / it->second.halflife;
}
else
{
const auto& it2 = mActinide.find(zaid);
if (it2 != mActinide.end())
{
activity = abundance / it2->second.halflife;
}
else
{
const auto& it3 = mFissionProduct.find(zaid);
if (it3 != mFissionProduct.end())
{
activity = abundance / it3->second.halflife;
}
}
}
activity = activity * avogadro * lntwo / curie;
return activity;
}
float DecayDb::calculate_activity(int zaid, float lp_abundance,
float ap_abundance, float fp_abundance) const
{
......
......@@ -124,6 +124,7 @@ class RADIX_PUBLIC DecayDb
public:
DecayDb();
float calculate_activity(int zaid, float abundance) const;
float calculate_activity(int zaid, float lp_abundance, float ap_abundance,
float fp_abundance) const;
std::string activation_title() const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment